Ignore:
Timestamp:
10/15/12 14:51:54 (12 years ago)
Author:
Jens Buss
Message:
add getters
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/rootmacros/PulseTemplates/pulse.C

    r14476 r14479  
    6060    delete mModel;
    6161}
     62
     63// ===========================================================================
     64// PUBLIC OPERATIONS
     65// ===========================================================================
     66
     67void
     68Pulse::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
     86void
     87Pulse::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// ===========================================================================
    62122
    63123void
     
    85145
    86146void
    87 Pulse::Fit(
    88         TString fitName,
    89         TString fitOptions,
    90         int type
    91         )
    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         fitMax
    102         );
    103 }
    104 
    105 void
    106 Pulse::Fit(
    107         TString fitName,
    108         TString fitOptions,
    109         int type,
    110         int fitMin,
    111         int fitMax
    112         )
    113 {
    114     fitOptions += "R";
    115     if (type == 0)
    116         FitSectionWise(
    117                     "Model0",
    118                     fitOptions,
    119                     fitMin,
    120                     fitMax
    121                     );
    122     else if (type == 1)
    123         FitContious(
    124                     "Model1",
    125                     fitOptions,
    126                     fitMin,
    127                     fitMax
    128                     );
    129     else{
    130         cout << "not a correct type number --> fitting skipped!" << endl;
    131         return;
    132     }
    133 
    134     CalculateParameters();
    135     return;
    136 }
    137 
    138 void
    139147Pulse::FitSectionWise(
    140148        TString fitName,
     
    227235}
    228236
    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 
    239237void
    240238Pulse::CalculateParameters()
     
    248246}
    249247
     248// ===========================================================================
     249// ACCESS
     250// ===========================================================================
     251
     252TString Pulse::GetName(){ return mName;}
     253double  Pulse::GetBsl(){ return mBsl;}
     254double  Pulse::GetHeight(){ return mHeight;}
     255double  Pulse::GetT0(){ return mT0;}
     256double  Pulse::GetT1(){ return mT1;}
     257double  Pulse::GetTau1(){ return mTau1;}
     258double  Pulse::GetTau2(){ return mTau2;}
     259double  Pulse::GetIntegral(){ return mIntegral;}
     260double  Pulse::GetAmplitude(){ return mAmplitude;}
     261int     Pulse::GetPhe(){ return mPhE;}
     262int     Pulse::GetType(){return mType;}
     263int     Pulse::GetFitMin(){return mFitMin;}
     264int     Pulse::GetFitMax(){return mFitMax;}
     265double  Pulse::GetFitProb(){return mFitProb;}
     266double  Pulse::GetFitNCalls(){return mFitNCalls;}
     267double  Pulse::GetFitNdf(){return mFitNdf;}
     268double  Pulse::GetChi2(){return mChi2;}
     269
     270
     271// ===========================================================================
     272// NON CLASS MATH FUNCTIONS
     273// ===========================================================================
    250274
    251275//double
Note: See TracChangeset for help on using the changeset viewer.