- Timestamp:
- 12/21/12 15:33:51 (12 years ago)
- Location:
- fact/tools/rootmacros/PulseTemplates
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/pulse.C
r14755 r14762 148 148 mAmplitude.second = 0; 149 149 mPhE.second = 0; 150 mRisetime.first = 0; 151 mRisetime.second = 0; 150 152 mOrder = 0; 151 153 mType = 0; … … 154 156 mFitNdf = 0; 155 157 mChi2 = 0; 158 mTimeResolution = 0.5; 156 159 } 157 160 … … 275 278 mAmplitude.first = mModel->GetMaximum() - mBsl.first; 276 279 // mAmplitude.second = mModel->GetMaximum() - mBsl.first; 280 mRisetime.first = mTimeResolution*CalculateHistEdgeRisetime(); 277 281 mFitProb = mFitResultPtr->Prob(); 278 282 mFitNCalls = mFitResultPtr->NCalls(); … … 281 285 } 282 286 287 double 288 Pulse::CalculateHistEdgeRisetime() // in bins 289 { 290 //rise-tim for pulse for pulse height from 10% to 90% 291 double riseTime = 0; 292 293 // Get Pulse Maximum value and bin 294 int maxBin = mHisto->GetMaximumBin(); 295 double max = mHisto->GetBinContent(maxBin); 296 297 // values of bin with 10% and 90% 298 int tenPctBin = 0; 299 int ninetyPctBin = 0; 300 301 // flag points 302 bool finishedLow = false; 303 bool finishedHigh = false; 304 305 //2nd runvariable 306 int j = maxBin; 307 308 //loop over from 20 bins bevore max to maximum 309 for (int i = maxBin - 20; i<maxBin; i++){ 310 j--; 311 if (j<0) break; 312 313 if (mHisto->GetBinContent(i) >= 0.1*max && !finishedLow) 314 { 315 tenPctBin = i; 316 finishedLow = true; 317 } 318 319 320 if (mHisto->GetBinContent(j) <= 0.9*max && !finishedHigh) 321 { 322 ninetyPctBin = j; 323 finishedHigh = true; 324 } 325 326 if (finishedLow && finishedHigh) 327 { 328 break; 329 } 330 } 331 332 riseTime = mHisto->GetBinLowEdge(ninetyPctBin) - mHisto->GetBinLowEdge(tenPctBin); 333 return riseTime; 334 } 335 336 337 338 283 339 // =========================================================================== 284 340 // ACCESS … … 287 343 TString Pulse::GetName(){ return mName;} 288 344 double Pulse::GetBsl(){ return mBsl.first;} 345 double Pulse::GetBslErr(){ return mBsl.second;} 289 346 double Pulse::GetHeight(){ return mHeight.first;} 347 double Pulse::GetHeightErr(){ return mHeight.second;} 290 348 double Pulse::GetT0(){ return mT0.first;} 349 double Pulse::GetT0Err(){ return mT0.second;} 291 350 double Pulse::GetT1(){ return mT1.first;} 351 double Pulse::GetT1Err(){ return mT1.second;} 292 352 double Pulse::GetTau1(){ return mTau1.first;} 353 double Pulse::GetTau1Err(){ return mTau1.second;} 293 354 double Pulse::GetTau2(){ return mTau2.first;} 355 double Pulse::GetTau2Err(){ return mTau2.second;} 294 356 double Pulse::GetIntegral(){ return mIntegral.first;} 357 double Pulse::GetIntegralErr(){ return mIntegral.second;} 295 358 double Pulse::GetAmplitude(){ return mAmplitude.first;} 359 double Pulse::GetAmplitudeErr(){ return mAmplitude.second;} 296 360 int Pulse::GetPhE(){ return mPhE.first;} 297 double Pulse::GetBslErr(){ return mBsl.second;}298 double Pulse::GetHeightErr(){ return mHeight.second;}299 double Pulse::GetT0Err(){ return mT0.second;}300 double Pulse::GetT1Err(){ return mT1.second;}301 double Pulse::GetTau1Err(){ return mTau1.second;}302 double Pulse::GetTau2Err(){ return mTau2.second;}303 double Pulse::GetIntegralErr(){ return mIntegral.second;}304 double Pulse::GetAmplitudeErr(){ return mAmplitude.second;}305 361 int Pulse::GetPhEErr(){ return mPhE.second;} 362 double Pulse::GetRiseTime(){ return mRisetime.first; } 363 double Pulse::GetRiseTimeErr(){ return mRisetime.second;} 306 364 int Pulse::GetOrder(){ return mOrder;} 307 365 int Pulse::GetType(){return mType;} … … 312 370 double Pulse::GetFitNdf(){return mFitNdf;} 313 371 double Pulse::GetChi2(){return mChi2;} 372 double Pulse::GetTimeResolution(){return mTimeResolution;} 373 void Pulse::SetTimeResolution(double timeResolution){mTimeResolution = timeResolution;} 314 374 315 375 -
fact/tools/rootmacros/PulseTemplates/pulse.h
r14531 r14762 83 83 void FitContious(TString fitName, TString fitOptions, int fitMin, int fitMax); 84 84 void CalculateParameters(); 85 double CalculateHistEdgeRisetime(); 85 86 void InitMembers(); 86 87 … … 89 90 TString GetName(); 90 91 double GetBsl(); 92 double GetBslErr(); 91 93 double GetHeight(); 94 double GetHeightErr(); 92 95 double GetT0(); 96 double GetT0Err(); 93 97 double GetT1(); 98 double GetT1Err(); 94 99 double GetTau1(); 100 double GetTau1Err(); 95 101 double GetTau2(); 102 double GetTau2Err(); 96 103 double GetIntegral(); 104 double GetIntegralErr(); 97 105 double GetAmplitude(); 106 double GetAmplitudeErr(); 98 107 int GetPhE(); 108 int GetPhEErr(); 99 109 int GetOrder(); 100 110 int GetType(); … … 105 115 double GetFitNdf(); 106 116 double GetChi2(); 107 double GetBslErr(); 108 double GetHeightErr(); 109 double GetT0Err(); 110 double GetT1Err(); 111 double GetTau1Err(); 112 double GetTau2Err(); 113 double GetIntegralErr(); 114 double GetAmplitudeErr(); 115 int GetPhEErr(); 117 double GetRiseTime(); 118 double GetRiseTimeErr(); 119 double GetTimeResolution(); 120 void SetTimeResolution(double timeResolution); 116 121 117 122 // INQUIRY … … 130 135 pair <double, double> mAmplitude; 131 136 pair <int, double> mPhE; 137 pair <double, double> mRisetime; 138 double mTimeResolution; // [ns/slice] 132 139 int mOrder; 133 140 int mType;
Note:
See TracChangeset
for help on using the changeset viewer.