EnergyCorrections.cxx File Reference

#include "EnergyCorrections.h"
#include <cmath>

Go to the source code of this file.

Functions

float CorrectMomentumFromRange (float p, bool isdata, Detector::Detector_t det)
float CorrectSignedMomentumFromCurvature (float p, bool, Detector::Detector_t)
float CorrectEnergyFromRange (float E, bool isdata, Detector::Detector_t det)
float CorrectShowerEnergyNear (float E, const CandShowerHandle::ShowerType_t &st, int mode, bool)
float CorrectShowerEnergyFar (float E, const CandShowerHandle::ShowerType_t &st, int mode, bool isdata)
float CorrectShowerEnergy (float E, const Detector::Detector_t &det, const CandShowerHandle::ShowerType_t &st, int mode, bool isdata)

Function Documentation

float CorrectEnergyFromRange ( float  E,
bool  isdata,
Detector::Detector_t  det 
)

Definition at line 94 of file MCNNAnalysis/HEAD/EnergyCorrections.cxx.

References EnergyCorrections::CorrectMomentumFromRange(), and Munits::m.

00094                                                                           {
00095    const float m=0.1057;// mon mass
00096    float p = sqrt(E*E -m*m);
00097    float pcor = CorrectMomentumFromRange(p,isdata,det);
00098    return sqrt(pcor*pcor +m*m);
00099 } 

float CorrectMomentumFromRange ( float  p,
bool  isdata,
Detector::Detector_t  det 
)

Definition at line 62 of file MCNNAnalysis/HEAD/EnergyCorrections.cxx.

References EnergyCorrections::CorrectMomentumFromRange_Birch(), EnergyCorrections::CorrectMomentumFromRange_Cedar(), EnergyCorrections::fVersion, EnergyCorrections::kBirch, EnergyCorrections::kCedar, Detector::kFar, Detector::kNear, EnergyCorrections::kUnknown, and EnergyCorrections::WarnUnknownVersion().

Referenced by EnergyCorrections::CorrectEnergyFromRange(), CorrectEnergyFromRange(), MadMKAnalysis::CreatePAN(), NtpTools::FillRecoEInfo(), MicroDSTMaker::FillRecoInfo(), MadScanDisplay::RecoMKMuEnergy(), MadEvDisplay::RecoMKMuEnergy(), MadMKAnalysis::RecoMKMuEnergy(), ANtpTrackInfoAna::RecoMuEnergy(), and MadQuantities::RecoMuEnergy().

00062                                                                             {
00063   static const float c[4]={1.01334,0.05563,-0.05346,0.01205};
00064   
00065   // correction for difference in data mc steel density
00066   if(isdata){
00067     // inital correction, pre-Oxford 2006
00068     //static const float dcor=7.755/7.87;// data/mc density
00069     float dcor=1;
00070     if (det==Detector::kNear) dcor=(7.85*2.563)/(7.87*2.54); 
00071     else if(det==Detector::kFar) dcor=(7.85*2.558)/(7.87*2.54);
00072 
00073     p*=dcor;
00074   }
00075   // 
00076   float pcor=p/(c[0] + c[1]*log(p) + c[2]*pow(log(p), 2) + c[3]*pow(log(p),3));
00077   return pcor;
00078 }

float CorrectShowerEnergy ( float  E,
const Detector::Detector_t det,
const CandShowerHandle::ShowerType_t st,
int  mode,
bool  isdata 
)
float CorrectShowerEnergyFar ( float  E,
const CandShowerHandle::ShowerType_t st,
int  mode,
bool  isdata 
)

Definition at line 128 of file MCNNAnalysis/HEAD/EnergyCorrections.cxx.

References EnergyCorrections::CorrectShowerEnergyFar_Birch(), EnergyCorrections::CorrectShowerEnergyFar_Cedar(), EnergyCorrections::fVersion, EnergyCorrections::kBirch, CandShowerHandle::kCC, EnergyCorrections::kCedar, EnergyCorrections::kUnknown, CandShowerHandle::kWtCC, and EnergyCorrections::WarnUnknownVersion().

Referenced by EnergyCorrections::CorrectShowerEnergy(), CorrectShowerEnergy(), ANtpShowerInfoAna::RecoShwEnergy(), MadBase::RecoShwEnergy(), and MadQuantities::RecoShwEnergy().

00128                                                                                                     {
00129 
00130    float ecor=E;
00131    if(st==CandShowerHandle::kCC){
00132      if(isdata) {
00133        // a correction for the FD MIP scale
00134        // for the beam data, one measured MIP 
00135        // actually corresponds to 1.018 MIPs
00136        // so we must correct shower energy up
00137        const float mip_scale_correction=1.018;
00138        E*=mip_scale_correction;
00139      }
00140 
00141      if(mode==1){
00142        // Niki Correction
00143        ecor=((E)*(1.-0.12*exp(-0.12*E)));
00144      }
00145      else if(mode==2){
00146        // Andy Correction
00147        //        ecor=(E)*(1.-0.2*exp(-0.2*E));
00148        ecor=E*(0.99-0.035*E*exp(-0.25*E));
00149      }
00150    }
00151    else if(st==CandShowerHandle::kWtCC){
00152       if(mode==1){
00153          // Niki Correction
00154          ecor=((E)*(1.+0.18*exp(-0.35*E)));
00155       }
00156       else if(mode==2){
00157          // Andy Correction
00158          E=ecor;
00159       }
00160    }
00161    return ecor;
00162 }

float CorrectShowerEnergyNear ( float  E,
const CandShowerHandle::ShowerType_t st,
int  mode,
bool   
)

Definition at line 102 of file MCNNAnalysis/HEAD/EnergyCorrections.cxx.

References EnergyCorrections::CorrectShowerEnergyNear_Birch(), EnergyCorrections::CorrectShowerEnergyNear_Cedar(), EnergyCorrections::fVersion, EnergyCorrections::kBirch, CandShowerHandle::kCC, EnergyCorrections::kCedar, EnergyCorrections::kUnknown, CandShowerHandle::kWtCC, and EnergyCorrections::WarnUnknownVersion().

Referenced by EnergyCorrections::CorrectShowerEnergy(), CorrectShowerEnergy(), ANtpShowerInfoAna::RecoShwEnergy(), MadBase::RecoShwEnergy(), and MadQuantities::RecoShwEnergy().

00102                                                                                                            {
00103 
00104    float ecor=E;
00105    if(st==CandShowerHandle::kCC){
00106       if(mode==1){
00107          // Niki Correction
00108          ecor=E/1.18;
00109       }
00110       else if(mode==2){
00111          // Andy Correction
00112          ecor=((E/1.05)*(1.-0.35*exp(-0.18*E/1.06)));
00113       }
00114    }
00115    else if(st==CandShowerHandle::kWtCC){
00116       if(mode==1){
00117          // Niki Correction
00118          ecor=((E)*(1.+0.50*exp(-1.00*E)));
00119       }
00120       else if(mode==2){
00121          // Andy Correction
00122          ecor=E/1.03;
00123       }
00124    }
00125    return ecor;
00126 }

float CorrectSignedMomentumFromCurvature ( float  p,
bool  ,
Detector::Detector_t   
)

Definition at line 80 of file MCNNAnalysis/HEAD/EnergyCorrections.cxx.

References EnergyCorrections::CorrectSignedMomentumFromCurvature_Birch(), EnergyCorrections::CorrectSignedMomentumFromCurvature_Cedar(), EnergyCorrections::fVersion, EnergyCorrections::kBirch, EnergyCorrections::kCedar, EnergyCorrections::kUnknown, and EnergyCorrections::WarnUnknownVersion().

Referenced by MadMKAnalysis::CreatePAN(), NtpTools::FillRecoEInfo(), MicroDSTMaker::FillRecoInfo(), MadMKAnalysis::RecoMKMuEnergy(), ANtpTrackInfoAna::RecoMuEnergy(), and MadQuantities::RecoMuEnergy().

00080                                                                                                   {
00081   // input is the signed momentum (e.g. p/q)
00082   // isdata and det are not used... but maybe in the future
00083   float pcor=p;
00084   if(pcor!=0) {
00085     // correction advertised in 1430-v2, J. Musser
00086     // note: for 1/p < 0   C=1, so correction only matters for mu+
00087     float C = (1.01+0.1*fabs(1/p))/(1.01-0.1*(1/p));
00088     pcor*=(1.0/C);
00089   }
00090   return pcor;
00091 }


Generated on 16 Apr 2018 for loon by  doxygen 1.6.1