Changeset 14479
- Timestamp:
- 10/15/12 14:51:54 (12 years ago)
- Location:
- fact/tools/rootmacros/PulseTemplates
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/pulse.C
r14476 r14479 60 60 delete mModel; 61 61 } 62 63 // =========================================================================== 64 // PUBLIC OPERATIONS 65 // =========================================================================== 66 67 void 68 Pulse::Fit( 69 TString fitName, 70 TString fitOptions, 71 int type 72 ) 73 { 74 int fitMin = mHisto->GetXaxis()->GetFirst(); 75 int fitMax = mHisto->GetXaxis()->GetLast(); 76 77 Fit( 78 fitName, 79 fitOptions, 80 type, 81 fitMin, 82 fitMax 83 ); 84 } 85 86 void 87 Pulse::Fit( 88 TString fitName, 89 TString fitOptions, 90 int type, 91 int fitMin, 92 int fitMax 93 ) 94 { 95 fitOptions += "R"; 96 if (type == 0) 97 FitSectionWise( 98 fitName, 99 fitOptions, 100 fitMin, 101 fitMax 102 ); 103 else if (type == 1) 104 FitContious( 105 fitName, 106 fitOptions, 107 fitMin, 108 fitMax 109 ); 110 else{ 111 cout << "not a correct type number --> fitting skipped!" << endl; 112 return; 113 } 114 115 CalculateParameters(); 116 return; 117 } 118 119 // =========================================================================== 120 // PRIVATE OPERATIONS 121 // =========================================================================== 62 122 63 123 void … … 85 145 86 146 void 87 Pulse::Fit(88 TString fitName,89 TString fitOptions,90 int type91 )92 {93 int fitMin = mHisto->GetXaxis()->GetFirst();94 int fitMax = mHisto->GetXaxis()->GetLast();95 96 Fit(97 fitName,98 fitOptions,99 type,100 fitMin,101 fitMax102 );103 }104 105 void106 Pulse::Fit(107 TString fitName,108 TString fitOptions,109 int type,110 int fitMin,111 int fitMax112 )113 {114 fitOptions += "R";115 if (type == 0)116 FitSectionWise(117 "Model0",118 fitOptions,119 fitMin,120 fitMax121 );122 else if (type == 1)123 FitContious(124 "Model1",125 fitOptions,126 fitMin,127 fitMax128 );129 else{130 cout << "not a correct type number --> fitting skipped!" << endl;131 return;132 }133 134 CalculateParameters();135 return;136 }137 138 void139 147 Pulse::FitSectionWise( 140 148 TString fitName, … … 227 235 } 228 236 229 double Pulse::GetBsl(){ return mBsl;}230 double Pulse::GetHeight(){ return mHeight;}231 double Pulse::GetAvalancheStart(){ return mT0;}232 double Pulse::GetAvalancheEnd(){ return mT1;}233 double Pulse::GetTimeConstRising(){ return mTau1;}234 double Pulse::GetTimeConstFalling(){ return mTau2;}235 double Pulse::GetIntegral(){ return mIntegral;}236 double Pulse::GetAmplitude(){ return mAmplitude;}237 int Pulse::GetPE(){ return mPhE;}238 239 237 void 240 238 Pulse::CalculateParameters() … … 248 246 } 249 247 248 // =========================================================================== 249 // ACCESS 250 // =========================================================================== 251 252 TString Pulse::GetName(){ return mName;} 253 double Pulse::GetBsl(){ return mBsl;} 254 double Pulse::GetHeight(){ return mHeight;} 255 double Pulse::GetT0(){ return mT0;} 256 double Pulse::GetT1(){ return mT1;} 257 double Pulse::GetTau1(){ return mTau1;} 258 double Pulse::GetTau2(){ return mTau2;} 259 double Pulse::GetIntegral(){ return mIntegral;} 260 double Pulse::GetAmplitude(){ return mAmplitude;} 261 int Pulse::GetPhe(){ return mPhE;} 262 int Pulse::GetType(){return mType;} 263 int Pulse::GetFitMin(){return mFitMin;} 264 int Pulse::GetFitMax(){return mFitMax;} 265 double Pulse::GetFitProb(){return mFitProb;} 266 double Pulse::GetFitNCalls(){return mFitNCalls;} 267 double Pulse::GetFitNdf(){return mFitNdf;} 268 double Pulse::GetChi2(){return mChi2;} 269 270 271 // =========================================================================== 272 // NON CLASS MATH FUNCTIONS 273 // =========================================================================== 250 274 251 275 //double -
fact/tools/rootmacros/PulseTemplates/pulse.h
r14475 r14479 34 34 /** 35 35 */ 36 // NON CLASS MATH FUNCTIONS 36 37 int Heaviside(double val); 37 38 double shapeFunc( double* t, double* par); … … 86 87 double GetBsl(); 87 88 double GetHeight(); 88 double Get AvalancheStart();89 double Get AvalancheEnd();90 double GetT imeConstRising();91 double GetT imeConstFalling();89 double GetT0(); 90 double GetT1(); 91 double GetTau1(); 92 double GetTau2(); 92 93 double GetIntegral(); 93 94 double GetAmplitude(); 94 int GetPE(); 95 int GetPhe(); 96 int GetType(); 97 int GetFitMin(); 98 int GetFitMax(); 99 double GetFitProb(); 100 double GetFitNCalls(); 101 double GetFitNdf(); 102 double GetChi2(); 95 103 96 104 // INQUIRY 105 private: 97 106 TString mName; 98 107 TH1* mHisto;
Note:
See TracChangeset
for help on using the changeset viewer.