Changeset 14762 for fact/tools/rootmacros/PulseTemplates/pulse.C
- Timestamp:
- 12/21/12 15:33:51 (12 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.