CMS 3D CMS Logo

GlobalFitParameters.h

Go to the documentation of this file.
00001 #ifndef GlobalFitParameters_h
00002 #define GlobalFitParameters_h
00003 
00004 // interface class for the Parametrization classes
00006 class TMeasurement
00007 {
00008 public:
00009   TMeasurement():
00010     pt  ( 0.),
00011     EMF ( 0.),
00012     HadF( 0.),
00013     OutF( 0.),
00014     E   ( 0.),
00015     eta ( 0.),
00016     phi ( 0.){};
00017   TMeasurement(TMeasurement* m):
00018     pt  (m->pt  ),
00019     EMF (m->EMF ),
00020     HadF(m->HadF),
00021     OutF(m->OutF),
00022     E   (m->E   ),
00023     eta (m->eta ),
00024     phi (m->phi ){};
00025 
00026   //all common variables
00027   double pt;
00028   double EMF;
00029   double HadF;
00030   double OutF;
00031   double E;
00032   double eta;//necessary???
00033   double phi;//necessary???
00034 };
00035 
00036 // keeps different parametrizations for the 
00037 // underlying hypothesis of the GlobalFit
00039 class Parametrization 
00040 {
00041 public:
00042   Parametrization(unsigned int ntowerpars, unsigned int njetpars) : 
00043     ntowerpars_(ntowerpars), njetpars_(njetpars) {}
00044   virtual ~Parametrization() {}
00045   // ----------------------------------------------------------------
00046   //  correctedTowerEt(TMeasurement *const x, double *const par)
00047   //  returns the corrected Et of a tower 
00048   //  input: x->pt   : et  of whole tower
00049   //         x->EMF  : et  of ECAL  part
00050   //         x->HadF : et  of HCAL  part
00051   //         x->OutF : et  of Outer part
00052   //         x->E    : en  of Outer part
00053   //         x->eta  : eta of tower
00054   //         x->phi  : phi of tower
00055   //  par  : the correction parameters of this tower
00056   // ----------------------------------------------------------------
00057   virtual double correctedTowerEt(TMeasurement *const x,double *const par) const = 0;
00058 
00059   // ----------------------------------------------------------------
00060   //  correctedJetEt(TMeasurement *const x,double *const par)
00061   //  returns the corrected Et of a jet 
00062   //  input: x->pt   : et  of uncorrected jet
00063   //         x->EMF  : et  of ECAL  part
00064   //         x->HadF : et  of HCAL  part
00065   //         x->OutF : et  of Outer part
00066   //         x->E    : en  of Outer part
00067   //         x->eta  : eta of tower
00068   //         x->phi  : phi of tower
00069   //  par:  the correction parameters of this jet
00070   // ----------------------------------------------------------------
00071   virtual double correctedJetEt(TMeasurement *const x,double *const par) const = 0;
00072   virtual const char * name() const = 0;
00073 
00074   unsigned int nTowerPars() const { return ntowerpars_;}
00075   unsigned int nJetPars() const { return njetpars_;}
00076 
00077 private: 
00078   Parametrization();
00079   unsigned int  ntowerpars_, njetpars_;
00080 };
00081 
00082 // parametrization of the hadronic response 
00083 // by a step function in et
00085 class StepParametrization : public Parametrization { 
00086 public:
00087   StepParametrization() : Parametrization(12,0) {}
00088   const char* name() const { return "StepParametrization";}
00089   
00090   double correctedTowerEt(TMeasurement *const x,double *par) const {
00091     double result = 0;
00092     
00093     if(x->HadF>=0.0  && x->HadF<=1.0)  result = x->EMF+x->OutF + par[0]*x->HadF; 
00094     else if (x->HadF>   1.0 && x->HadF<=   2.0) result = x->EMF+x->OutF+par[ 1]*x->HadF;
00095     else if (x->HadF>   2.0 && x->HadF<=   5.0) result = x->EMF+x->OutF+par[ 2]*x->HadF;
00096     else if (x->HadF>   5.0 && x->HadF<=  10.0) result = x->EMF+x->OutF+par[ 3]*x->HadF;
00097     else if (x->HadF>  10.0 && x->HadF<=  20.0) result = x->EMF+x->OutF+par[ 4]*x->HadF;
00098     else if (x->HadF>  20.0 && x->HadF<=  40.0) result = x->EMF+x->OutF+par[ 5]*x->HadF;
00099     else if (x->HadF>  40.0 && x->HadF<=  80.0) result = x->EMF+x->OutF+par[ 6]*x->HadF;
00100     else if (x->HadF>  80.0 && x->HadF<= 160.0) result = x->EMF+x->OutF+par[ 7]*x->HadF;
00101     else if (x->HadF> 160.0 && x->HadF<= 300.0) result = x->EMF+x->OutF+par[ 8]*x->HadF;
00102     else if (x->HadF> 300.0 && x->HadF<= 600.0) result = x->EMF+x->OutF+par[ 9]*x->HadF;
00103     else if (x->HadF> 600.0 && x->HadF<=1000.0) result = x->EMF+x->OutF+par[10]*x->HadF;
00104     else if (x->HadF>1000.0 )                   result = x->EMF+x->OutF+par[11]*x->HadF;
00105     return result;
00106   }
00107     
00108   double correctedJetEt(TMeasurement *const x,double *const par) const {
00109     return  x->pt;   
00110     //OutOfCone, Dominant, parametrized in Et since cone R lorenz invariant
00111     //return x->pt * ( 1. + 0.295 * par[0] * exp(- 0.02566 * par[1] * x->pt)); 
00112     /*
00113       double result = 0;
00114       if(x->pt>=0.0  && x->pt<=5.0)          result =  par[0]*x->pt + par[1];
00115       else if (x->pt>5.0   && x->pt<=20.0)   result =  par[2]*x->pt + par[3];
00116       else if (x->pt>20.0  && x->pt<=80.0)   result =  par[4]*x->pt + par[5];
00117       else if (x->pt>80.0 )                 result =  par[6]*x->pt + par[7];
00118       return result;
00119     */
00120   }
00121 };
00122 
00123 // parametrization of hadronic response 
00124 // by a step function in en
00126 class StepParametrizationEnergy : public Parametrization { 
00127 public:
00128   StepParametrizationEnergy() : Parametrization(12,2) {}
00129   const char* name() const { return "StepParametrizationEnergy";}
00130   
00131   double correctedTowerEt(TMeasurement *const x,double *const par) const {
00132     double result = 0;
00133     // reweight from et to en
00134     double e =  x->HadF * x->E / x->pt;
00135     
00136     if(e>=0.0  && e<=1.0)  result = x->EMF+x->OutF + par[0]*x->HadF;
00137     else if (e>   1.0 && e<=   2.0) result = x->EMF+x->OutF+par[ 1]*x->HadF;
00138     else if (e>   2.0 && e<=   5.0) result = x->EMF+x->OutF+par[ 2]*x->HadF;
00139     else if (e>   5.0 && e<=  10.0) result = x->EMF+x->OutF+par[ 3]*x->HadF;
00140     else if (e>  10.0 && e<=  20.0) result = x->EMF+x->OutF+par[ 4]*x->HadF;
00141     else if (e>  20.0 && e<=  40.0) result = x->EMF+x->OutF+par[ 5]*x->HadF;
00142     else if (e>  40.0 && e<=  80.0) result = x->EMF+x->OutF+par[ 6]*x->HadF;
00143     else if (e>  80.0 && e<= 160.0) result = x->EMF+x->OutF+par[ 7]*x->HadF;
00144     else if (e> 160.0 && e<= 300.0) result = x->EMF+x->OutF+par[ 8]*x->HadF;
00145     else if (e> 300.0 && e<= 600.0) result = x->EMF+x->OutF+par[ 9]*x->HadF;
00146     else if (e> 600.0 && e<=1000.0) result = x->EMF+x->OutF+par[10]*x->HadF;
00147     else if (e>1000.0 )             result = x->EMF+x->OutF+par[11]*x->HadF;
00148     
00149     return result;
00150   }
00151     
00152   double correctedJetEt(TMeasurement *const x,double *const par) const {
00153     //OutOfCone, Dominant, parametrized in Et since cone R lorenz invariant
00154     return x->pt * ( 1. + 0.295 * par[0] * exp(- 0.02566 * par[1] * x->pt));   
00155   }
00156 };
00157 
00158 // parametrization of hadronic response by a step 
00159 // function with 3 sets of parametrizations for 
00160 // different em fractions
00162 class StepEfracParametrization : public Parametrization {
00163 public:
00164   StepEfracParametrization() : Parametrization(36,0) {}  //(36,2) {}
00165   const char* name() const { return "StepEfracParametrization";}
00166 
00167   double correctedTowerEt(TMeasurement *const x,double *const par) const {
00168     double result=0;
00169     
00170     double Efrac = x->EMF/(x->HadF+x->OutF+x->EMF);
00171     if( Efrac < 0.2 ) {
00172       if(x->HadF>=0.0 && x->HadF<=1.0)            result = x->EMF+x->OutF+par[ 0]*x->HadF;
00173       else if (x->HadF>   1.0 && x->HadF<=   2.0) result = x->EMF+x->OutF+par[ 1]*x->HadF;
00174       else if (x->HadF>   2.0 && x->HadF<=   5.0) result = x->EMF+x->OutF+par[ 2]*x->HadF;
00175       else if (x->HadF>   5.0 && x->HadF<=  10.0) result = x->EMF+x->OutF+par[ 3]*x->HadF;
00176       else if (x->HadF>  10.0 && x->HadF<=  20.0) result = x->EMF+x->OutF+par[ 4]*x->HadF;
00177       else if (x->HadF>  20.0 && x->HadF<=  40.0) result = x->EMF+x->OutF+par[ 5]*x->HadF;
00178       else if (x->HadF>  40.0 && x->HadF<=  80.0) result = x->EMF+x->OutF+par[ 6]*x->HadF;
00179       else if (x->HadF>  80.0 && x->HadF<= 160.0) result = x->EMF+x->OutF+par[ 7]*x->HadF;
00180       else if (x->HadF> 160.0 && x->HadF<= 300.0) result = x->EMF+x->OutF+par[ 8]*x->HadF;
00181       else if (x->HadF> 300.0 && x->HadF<= 600.0) result = x->EMF+x->OutF+par[ 9]*x->HadF;
00182       else if (x->HadF> 600.0 && x->HadF<=1000.0) result = x->EMF+x->OutF+par[10]*x->HadF;
00183       else if (x->HadF>1000.0 )                   result = x->EMF+x->OutF+par[11]*x->HadF;
00184     } else if (Efrac < 0.5) {
00185       if(x->HadF>=0.0 && x->HadF<=1.0)            result = x->EMF+x->OutF+par[12]*x->HadF;
00186       else if (x->HadF>   1.0 && x->HadF<=   2.0) result = x->EMF+x->OutF+par[13]*x->HadF;
00187       else if (x->HadF>   2.0 && x->HadF<=   5.0) result = x->EMF+x->OutF+par[14]*x->HadF;
00188       else if (x->HadF>   5.0 && x->HadF<=  10.0) result = x->EMF+x->OutF+par[15]*x->HadF;
00189       else if (x->HadF>  10.0 && x->HadF<=  20.0) result = x->EMF+x->OutF+par[16]*x->HadF;
00190       else if (x->HadF>  20.0 && x->HadF<=  40.0) result = x->EMF+x->OutF+par[17]*x->HadF;
00191       else if (x->HadF>  40.0 && x->HadF<=  80.0) result = x->EMF+x->OutF+par[18]*x->HadF;
00192       else if (x->HadF>  80.0 && x->HadF<= 160.0) result = x->EMF+x->OutF+par[19]*x->HadF;
00193       else if (x->HadF> 160.0 && x->HadF<= 300.0) result = x->EMF+x->OutF+par[20]*x->HadF;
00194       else if (x->HadF> 300.0 && x->HadF<= 600.0) result = x->EMF+x->OutF+par[21]*x->HadF;
00195       else if (x->HadF> 600.0 && x->HadF<=1000.0) result = x->EMF+x->OutF+par[22]*x->HadF;
00196       else if (x->HadF>1000.0 )                   result = x->EMF+x->OutF+par[23]*x->HadF;
00197     } else {
00198       if(x->HadF>=0.0 && x->HadF<=1.0)            result = x->EMF+x->OutF+par[24]*x->HadF;
00199       else if (x->HadF>   1.0 && x->HadF<=   2.0) result = x->EMF+x->OutF+par[25]*x->HadF;
00200       else if (x->HadF>   2.0 && x->HadF<=   5.0) result = x->EMF+x->OutF+par[26]*x->HadF;
00201       else if (x->HadF>   5.0 && x->HadF<=  10.0) result = x->EMF+x->OutF+par[27]*x->HadF;
00202       else if (x->HadF>  10.0 && x->HadF<=  20.0) result = x->EMF+x->OutF+par[28]*x->HadF;
00203       else if (x->HadF>  20.0 && x->HadF<=  40.0) result = x->EMF+x->OutF+par[29]*x->HadF;
00204       else if (x->HadF>  40.0 && x->HadF<=  80.0) result = x->EMF+x->OutF+par[30]*x->HadF;
00205       else if (x->HadF>  80.0 && x->HadF<= 160.0) result = x->EMF+x->OutF+par[31]*x->HadF;
00206       else if (x->HadF> 160.0 && x->HadF<= 300.0) result = x->EMF+x->OutF+par[32]*x->HadF;
00207       else if (x->HadF> 300.0 && x->HadF<= 600.0) result = x->EMF+x->OutF+par[33]*x->HadF;
00208       else if (x->HadF> 600.0 && x->HadF<=1000.0) result = x->EMF+x->OutF+par[34]*x->HadF;
00209       else if (x->HadF>1000.0 )                   result = x->EMF+x->OutF+par[35]*x->HadF;
00210     }
00211     return result;
00212   }
00213   
00214   double correctedJetEt(TMeasurement *const x,double *const par) const {
00215     return  x->pt;   
00216     //OutOfCone, Dominant, parametrized in Et since cone R lorenz invariant
00217     //return x->pt * ( 1. + 0.295 * par[0] * exp(- 0.02566 * par[1] * x->pt));   
00218   }
00219 };
00220 
00221 // parametrization of hadronic response by a step 
00222 // function with 3 sets of parametrizations for 
00223 // different em fractions; correction only on jets
00225 class StepJetParametrization : public Parametrization { 
00226 public:
00227   StepJetParametrization() : Parametrization(0,65) {}
00228   const char* name() const { return "StepJetParametrization";}
00229 
00230   double correctedTowerEt(TMeasurement *const x,double *const par) const {
00231     return x->pt;
00232   }
00233     
00234   double correctedJetEt(TMeasurement *const x,double *const par) const {
00235     double pt     = x->pt;
00236     double Efrac  = x->EMF/( x->EMF+x->HadF+x->OutF);
00237     double result = 0.;
00238     if(Efrac < 0.2) {
00239       if(pt>=0.0 && pt<=10.0)         result = x->EMF+x->OutF+par[ 0]*x->HadF;
00240       else if (pt> 10.0 && pt<= 20.0) result = x->EMF+x->OutF+par[ 1]*x->HadF;
00241       else if (pt> 20.0 && pt<= 30.0) result = x->EMF+x->OutF+par[ 2]*x->HadF;
00242       else if (pt> 30.0 && pt<= 40.0) result = x->EMF+x->OutF+par[ 3]*x->HadF;
00243       else if (pt> 40.0 && pt<= 60.0) result = x->EMF+x->OutF+par[ 4]*x->HadF;
00244       else if (pt> 60.0 && pt<= 80.0) result = x->EMF+x->OutF+par[ 5]*x->HadF;
00245       else if (pt> 80.0 && pt<=100.0) result = x->EMF+x->OutF+par[ 6]*x->HadF;
00246       else if (pt>100.0 && pt<=120.0) result = x->EMF+x->OutF+par[ 7]*x->HadF;
00247       else if (pt>120.0 && pt<=140.0) result = x->EMF+x->OutF+par[ 8]*x->HadF;
00248       else if (pt>140.0 && pt<=160.0) result = x->EMF+x->OutF+par[ 9]*x->HadF;
00249       else if (pt>160.0 && pt<=180.0) result = x->EMF+x->OutF+par[10]*x->HadF;
00250       else if (pt>180.0 && pt<=200.0) result = x->EMF+x->OutF+par[11]*x->HadF;
00251       else if (pt>200.0 && pt<=225.0) result = x->EMF+x->OutF+par[12]*x->HadF;
00252       else if (pt>225.0 && pt<=250.0) result = x->EMF+x->OutF+par[13]*x->HadF;
00253       else if (pt>250.0 && pt<=275.0) result = x->EMF+x->OutF+par[14]*x->HadF;
00254       else if (pt>275.0 && pt<=300.0) result = x->EMF+x->OutF+par[15]*x->HadF;
00255       else if (pt>300.0 && pt<=350.0) result = x->EMF+x->OutF+par[16]*x->HadF;
00256       else if (pt>350.0 && pt<=400.0) result = x->EMF+x->OutF+par[17]*x->HadF;
00257       else if (pt>400.0 && pt<=500.0) result = x->EMF+x->OutF+par[18]*x->HadF;
00258       else if (pt>500.0 && pt<=700.0) result = x->EMF+x->OutF+par[19]*x->HadF;
00259       else if (pt>700.0 )             result = x->EMF+x->OutF+par[20]*x->HadF;
00260     } else if (Efrac < 0.5) {
00261       if(pt>=0.0 && pt<=10.0)         result = x->EMF+x->OutF+par[21]*x->HadF;
00262       else if (pt> 10.0 && pt<= 20.0) result = x->EMF+x->OutF+par[22]*x->HadF;
00263       else if (pt> 20.0 && pt<= 30.0) result = x->EMF+x->OutF+par[23]*x->HadF;
00264       else if (pt> 30.0 && pt<= 40.0) result = x->EMF+x->OutF+par[24]*x->HadF;
00265       else if (pt> 40.0 && pt<= 60.0) result = x->EMF+x->OutF+par[25]*x->HadF;
00266       else if (pt> 60.0 && pt<= 80.0) result = x->EMF+x->OutF+par[26]*x->HadF;
00267       else if (pt> 80.0 && pt<=100.0) result = x->EMF+x->OutF+par[27]*x->HadF;
00268       else if (pt>100.0 && pt<=120.0) result = x->EMF+x->OutF+par[28]*x->HadF;
00269       else if (pt>120.0 && pt<=140.0) result = x->EMF+x->OutF+par[29]*x->HadF;
00270       else if (pt>140.0 && pt<=160.0) result = x->EMF+x->OutF+par[30]*x->HadF;
00271       else if (pt>160.0 && pt<=180.0) result = x->EMF+x->OutF+par[31]*x->HadF;
00272       else if (pt>180.0 && pt<=200.0) result = x->EMF+x->OutF+par[32]*x->HadF;
00273       else if (pt>200.0 && pt<=225.0) result = x->EMF+x->OutF+par[33]*x->HadF;
00274       else if (pt>225.0 && pt<=250.0) result = x->EMF+x->OutF+par[34]*x->HadF;
00275       else if (pt>250.0 && pt<=275.0) result = x->EMF+x->OutF+par[35]*x->HadF;
00276       else if (pt>275.0 && pt<=300.0) result = x->EMF+x->OutF+par[36]*x->HadF;
00277       else if (pt>300.0 && pt<=350.0) result = x->EMF+x->OutF+par[37]*x->HadF;
00278       else if (pt>350.0 && pt<=400.0) result = x->EMF+x->OutF+par[38]*x->HadF;
00279       else if (pt>400.0 && pt<=500.0) result = x->EMF+x->OutF+par[39]*x->HadF;
00280       else if (pt>500.0 && pt<=700.0) result = x->EMF+x->OutF+par[40]*x->HadF;
00281       else if (pt>700.0 )             result = x->EMF+x->OutF+par[41]*x->HadF;
00282     } else {
00283       if(pt>=0.0 && pt<=10.0)   result = x->EMF+x->OutF+par[42]*x->HadF;
00284       else if (pt> 10.0 && pt<= 20.0) result = x->EMF+x->OutF+par[43]*x->HadF;
00285       else if (pt> 20.0 && pt<= 30.0) result = x->EMF+x->OutF+par[44]*x->HadF;
00286       else if (pt> 30.0 && pt<= 40.0) result = x->EMF+x->OutF+par[45]*x->HadF;
00287       else if (pt> 40.0 && pt<= 60.0) result = x->EMF+x->OutF+par[46]*x->HadF;
00288       else if (pt> 60.0 && pt<= 80.0) result = x->EMF+x->OutF+par[47]*x->HadF;
00289       else if (pt> 80.0 && pt<=100.0) result = x->EMF+x->OutF+par[48]*x->HadF;
00290       else if (pt>100.0 && pt<=120.0) result = x->EMF+x->OutF+par[49]*x->HadF;
00291       else if (pt>120.0 && pt<=140.0) result = x->EMF+x->OutF+par[50]*x->HadF;
00292       else if (pt>140.0 && pt<=160.0) result = x->EMF+x->OutF+par[51]*x->HadF;
00293       else if (pt>160.0 && pt<=180.0) result = x->EMF+x->OutF+par[52]*x->HadF;
00294       else if (pt>180.0 && pt<=200.0) result = x->EMF+x->OutF+par[53]*x->HadF;
00295       else if (pt>200.0 && pt<=225.0) result = x->EMF+x->OutF+par[54]*x->HadF;
00296       else if (pt>225.0 && pt<=250.0) result = x->EMF+x->OutF+par[55]*x->HadF;
00297       else if (pt>250.0 && pt<=275.0) result = x->EMF+x->OutF+par[56]*x->HadF;
00298       else if (pt>275.0 && pt<=300.0) result = x->EMF+x->OutF+par[57]*x->HadF;
00299       else if (pt>300.0 && pt<=350.0) result = x->EMF+x->OutF+par[58]*x->HadF;
00300       else if (pt>350.0 && pt<=400.0) result = x->EMF+x->OutF+par[59]*x->HadF;
00301       else if (pt>400.0 && pt<=500.0) result = x->EMF+x->OutF+par[60]*x->HadF;
00302       else if (pt>500.0 && pt<=700.0) result = x->EMF+x->OutF+par[61]*x->HadF;
00303       else if (pt>700.0 )             result = x->EMF+x->OutF+par[62]*x->HadF;
00304     }
00305 
00306     //OutOfCone, Dominant, parametrized in Et since cone R lorenz invariant
00307     result *= ( 1. + 0.295 * par[63] * exp(- 0.02566 * par[64] * result));   
00308 
00309     return  result;
00310   }
00311 };
00312 
00313 
00314 // parametrization of response by some "clever" function
00316 class MyParametrization: public Parametrization {
00317  public:
00318   MyParametrization() : Parametrization(3,2) {}
00319   const char* name() const { return "MyParametrization";}
00320   
00321   double correctedTowerEt(TMeasurement *const x,double *const par) const {
00322     return x->EMF + par[0]*x->HadF + par[1]*log(x->pt) + par[2];
00323   }
00324   
00325   double correctedJetEt(TMeasurement *const x,double *const par) const {
00326     return par[0]*x->pt + par[1];
00327   }
00328 };
00329 
00330 // Parametrization of response with some ideas from the JetMET group
00332 class JetMETParametrization: public Parametrization {
00333 public:
00334   JetMETParametrization() : Parametrization(3,5) {}
00335   const char* name() const { return "JetMETParametrization";}
00336   
00337   double correctedTowerEt(TMeasurement *const x,double *const par) const {
00338     if(par[0] < -10) par[0] =     -10;
00339     if(par[1] <   0) par[1] = -par[1];
00340     if(par[2] <   0) par[2] = -par[2];
00341     return par[1] * x->HadF + par[2] * x->EMF + x->OutF + par[0];
00342   }
00343   
00344   double correctedJetEt(TMeasurement *const x,double *const par) const {
00345     double logx = log(x->pt);
00346     if(logx < 0) logx = 0;
00347     if(par[1] < 0) par[1] *= -1;
00348     if(par[2] < 0) par[2] *= -1;
00349     if(par[3] < 0) par[3] *= -1;
00350     if(par[4] < 0) par[4] *= -1;
00351     return (par[0] - par[1]/(pow(logx,par[2]) + par[3]) + par[4]/x->pt) * x->pt;  
00352   }
00353 };
00354 
00355 // simple parametrization
00357 class SimpleParametrization: public Parametrization {
00358 public:
00359   SimpleParametrization() : Parametrization(3,3) {}
00360   const char* name() const { return "SimpleParametrization";}
00361 
00362   double correctedTowerEt(TMeasurement *const x,double *const par) const {
00363     if(par[0] < -10) par[0] =     -10;
00364     if(par[1] <   0) par[1] = -par[1];
00365     if(par[2] <   0) par[2] = -par[2];
00366     return par[1] * x->EMF + par[2] * x->HadF + x->OutF + par[0];
00367   }
00368 
00369   double correctedJetEt(TMeasurement *const x,double *const par) const {
00370     if(par[0] < 0) par[0] *= -1;
00371     if(par[1] < 0) par[1] *= -1;
00372     if(par[2] < 0) par[2] *= -1;
00373     return x->pt * ( par[2] + par[0] * exp( -par[1] * x->pt ) );  
00374   }
00375 };
00376 
00377 // parametrization for toy MC
00379 class ToyParametrization: public Parametrization {
00380 public:
00381   ToyParametrization() : Parametrization(1,0) {}
00382   const char* name() const { return "ToyParametrization";}
00383 
00384   double correctedTowerEt(TMeasurement *const x,double *const par) const {
00385     if( fabs(x->HadF+x->EMF+x->OutF-x->pt)>0.1){
00386       return par[0] * x->HadF + x->EMF + x->OutF;
00387     }
00388   }
00389 
00390   double correctedJetEt(TMeasurement *const x,double *const par) const {
00391     return x->pt;  
00392   }
00393 };
00394 
00395 // parametrization of hadronic response by a step function
00396 // optimized for ToyMC pt spectrum 0 - 300 GeV
00398 class ToyStepParametrization : public Parametrization { 
00399 public:
00400   ToyStepParametrization() : Parametrization(15,0) {}
00401   const char* name() const { return "ToyStepParametrization";}
00402   
00403   double correctedTowerEt(TMeasurement *const x,double *const par) const {
00404     double result = 0.;
00405     double pt = x->HadF;
00406     
00407     if(pt < 2.)        result = x->EMF+x->OutF+par[ 0]*x->HadF;
00408     else if(pt <   5.) result = x->EMF+x->OutF+par[ 1]*x->HadF;
00409     else if(pt <  10.) result = x->EMF+x->OutF+par[ 2]*x->HadF;
00410     else if(pt <  20.) result = x->EMF+x->OutF+par[ 3]*x->HadF;
00411     else if(pt <  30.) result = x->EMF+x->OutF+par[ 4]*x->HadF;
00412     else if(pt <  40.) result = x->EMF+x->OutF+par[ 5]*x->HadF;
00413     else if(pt <  50.) result = x->EMF+x->OutF+par[ 6]*x->HadF;
00414     else if(pt <  60.) result = x->EMF+x->OutF+par[ 7]*x->HadF;
00415     else if(pt <  70.) result = x->EMF+x->OutF+par[ 8]*x->HadF;
00416     else if(pt <  80.) result = x->EMF+x->OutF+par[ 9]*x->HadF;
00417     else if(pt <  90.) result = x->EMF+x->OutF+par[10]*x->HadF;
00418     else if(pt < 100.) result = x->EMF+x->OutF+par[11]*x->HadF;
00419     else if(pt < 110.) result = x->EMF+x->OutF+par[12]*x->HadF;
00420     else if(pt < 120.) result = x->EMF+x->OutF+par[13]*x->HadF;
00421     else               result = x->EMF+x->OutF+par[14]*x->HadF;
00422     return result;
00423   }
00424     
00425   double correctedJetEt(TMeasurement *const x,double *const par) const {
00426     return x->pt;
00427   }
00428 };
00429 
00430 
00431 // parametrization of Jet hadronic response by a step function
00432 // optimized for ToyMC pt spectrum 0 - 300 GeV
00434 class ToyStepJetParametrization : public Parametrization { 
00435  public:
00436   ToyStepJetParametrization() : Parametrization(0,15) {}
00437   const char* name() const { return "ToyStepJetParametrization";}
00438   
00439   double correctedTowerEt(TMeasurement *const x,double *const par) const {
00440     return x->pt;
00441   }
00442   
00443   double correctedJetEt(TMeasurement *const x,double *const par) const {
00444     double pt = x->HadF;
00445     double result = 0.;
00446     
00447     if(pt < 25. )      result = x->EMF+x->OutF+par[ 0]*x->HadF;
00448     else if(pt <  50.) result = x->EMF+x->OutF+par[ 1]*x->HadF;
00449     else if(pt <  75.) result = x->EMF+x->OutF+par[ 2]*x->HadF;
00450     else if(pt < 100.) result = x->EMF+x->OutF+par[ 3]*x->HadF;
00451     else if(pt < 125.) result = x->EMF+x->OutF+par[ 4]*x->HadF;
00452     else if(pt < 150.) result = x->EMF+x->OutF+par[ 5]*x->HadF;
00453     else if(pt < 175.) result = x->EMF+x->OutF+par[ 6]*x->HadF;
00454     else if(pt < 200.) result = x->EMF+x->OutF+par[ 7]*x->HadF;
00455     else if(pt < 225.) result = x->EMF+x->OutF+par[ 8]*x->HadF;
00456     else if(pt < 250.) result = x->EMF+x->OutF+par[ 9]*x->HadF;
00457     else if(pt < 275.) result = x->EMF+x->OutF+par[10]*x->HadF;
00458     else if(pt < 300.) result = x->EMF+x->OutF+par[11]*x->HadF;
00459     else if(pt < 325.) result = x->EMF+x->OutF+par[12]*x->HadF;
00460     else if(pt < 350.) result = x->EMF+x->OutF+par[13]*x->HadF;
00461     else               result = x->EMF+x->OutF+par[14]*x->HadF;
00462     return  result;
00463   }
00464 };
00465 
00466 #endif
00467 

Generated on Tue Jun 9 17:26:36 2009 for CMSSW by  doxygen 1.5.4