NtupleReader/NtupleReader/MySystematics.ixx

00001 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002 // Jamuary 2008      Ketevi A. Assamagan
00003 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00004 
00005 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00006 //:: IMPLEMENTATION OF INLINE METHODS DEFINED IN THE CLASS MySystematics ::
00009 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00010 
00011 //*****************************************************************************
00012 
00013   //:::::::::::::::::
00014   //:: METHOD egamma_resolution ::
00015   //:::::::::::::::::
00019 inline Double_t MySystematics::egamma_resolution( const Double_t et ) {
00020   Double_t sigma = 0.0073 * et; 
00021   return m_random->Gaus( et,sigma );
00022 }
00023 
00024 //*****************************************************************************
00025 
00026   //:::::::::::::::::
00027   //:: METHOD muon_resolution ::
00028   //:::::::::::::::::
00033 inline Double_t MySystematics::muon_resolution( const Double_t pt ) {
00034 
00035   if (pt==0.0) return 0.0;
00036 
00037   Double_t inv_pt=1.0/pt ;      
00038   Double_t comp1 = 0.011*inv_pt ;
00039   Double_t comp2 = 0.00017 ;
00040   Double_t sigma = sqrt( comp1*comp1 + comp2*comp2 ) ;
00041   Double_t new_inv_pt= m_random->Gaus( inv_pt,sigma ) ;
00042   Double_t new_pt=1.0/new_inv_pt ;
00043   return new_pt;
00044 
00045 
00046 /* (till 27.1.08) smearing in pt with some sigma specified/recommended */
00047 //  Double_t comp1 = 0.011*pt;
00048 //  Double_t comp2 = 0.00017 * (pt*pt);
00049 //  Double_t sigma = sqrt( comp1*comp1 + comp2*comp2 );
00050 //  return m_random->Gaus( pt,sigma );
00051 
00052 }
00053 
00054 //*****************************************************************************
00055 
00056   //:::::::::::::::::
00057   //:: METHOD jet_resolution ::
00058   //:::::::::::::::::
00065 inline Double_t MySystematics::jet_resolution( const Double_t e,const Double_t eta ) {
00066   Double_t sigma = 0.45 * sqrt(e);
00067   if (TMath::Abs(eta)>3.2) sigma = 0.63 * sqrt(e);
00068   return m_random->Gaus( e,sigma );
00069 }
00070 
00071 //*****************************************************************************
00072 
00073   //:::::::::::::::::
00074   //:: METHOD taujet_resolution ::
00075   //:::::::::::::::::
00081 inline Double_t MySystematics::taujet_resolution( const Double_t e ) {
00082   Double_t sigma = 0.45 * sqrt(e);
00083   return m_random->Gaus( e,sigma );
00084 }
00085 
00086 //*****************************************************************************
00087 
00088   //:::::::::::::::::
00089   //:: METHOD energy_scale ::
00090   //:::::::::::::::::
00092 inline Double_t MySystematics::energy_scale ( const Double_t pT, const Double_t f ) {
00093   return f*pT;
00094 } 
00095 
00096 //*****************************************************************************
00097 
00098   //:::::::::::::::::
00099   //:: METHOD is_detected ::
00100   //:::::::::::::::::
00107 inline Bool_t MySystematics::is_detected( const Double_t f ) {
00108   Double_t ran = m_random->Uniform();
00109   return ( ran>f );
00110 }
00111 
00112 //*****************************************************************************
00113 
00114   //:::::::::::::::::
00115   //:: METHOD is_bjet ::
00116   //:::::::::::::::::
00120 inline Bool_t MySystematics::is_bjet( const Double_t f_minus ) {
00121   Double_t ran = m_random->Uniform();
00122   return ( ran>f_minus );
00123 }
00124 
00125 //*****************************************************************************
00126 
00132   //:::::::::::::::::
00133   //:: METHOD metCorrection_x ::
00134   //:::::::::::::::::
00135 inline Double_t MySystematics::metCorrection_x(const Double_t aodPx, const Double_t correctedPx) {
00136   return ( +aodPx-correctedPx );
00137 }
00138 
00139   //:::::::::::::::::
00140   //:: METHOD metCorrection_y ::
00141   //:::::::::::::::::
00142 inline Double_t MySystematics::metCorrection_y(const Double_t aodPy, Double_t correctedPy) {
00143   return ( +aodPy-correctedPy );
00144 } 
00145 
00146   //:::::::::::::::::
00147   //:: METHOD metCorrection_sum ::
00148   //:::::::::::::::::
00149 inline Double_t MySystematics::metCorrection_sum(const Double_t aodSum, Double_t correctedSum) {
00150   return ( +aodSum-correctedSum );
00151 } 
00152 
00153   //:::::::::::::::::
00154   //:: METHOD metScale ::
00155   //S.M.: I do not use it at the moment!
00156   //:::::::::::::::::
00157 inline Double_t MySystematics::metScale ( const Double_t aodM, const Double_t correctedM, Double_t factor)
00158 {
00159   return (correctedM-factor*aodM);
00160 }
00161 
00162 //*****************************************************************************

Generated on Tue Oct 21 11:50:45 2008 for NtupleAnalysis by  doxygen 1.5.1