Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EnergyCorrections Namespace Reference

Track Energy/Momentum Correction. More...


Typedefs

typedef enum EnergyCorrections::EWhichCorrection WhichCorrection_t
typedef enum EnergyCorrections::ECorrectionVersion CorrectionVersion_t

Enumerations

enum  EWhichCorrection {
  kDefault = 0, kVersion1, kVersion2, kVersion3,
  kVersion4, kVersion5, kVersion6, kNoCalGroup
}
enum  ECorrectionVersion { kUnknown, kBirch, kCedar }

Functions

float FullyCorrectShowerEnergy (float E, const CandShowerHandle::ShowerType_t &st, VldContext vc, ReleaseType::Release_t release, EnergyCorrections::WhichCorrection_t whichCor=EnergyCorrections::kDefault)
float FullyCorrectMomentumFromRange (float p, VldContext vc, ReleaseType::Release_t release, EnergyCorrections::WhichCorrection_t whichCor=EnergyCorrections::kDefault)
 Track Energy/Momentum Correction.
float FullyCorrectEnergyFromRange (float E, VldContext vc, ReleaseType::Release_t release, EnergyCorrections::WhichCorrection_t whichCor=EnergyCorrections::kDefault)
float FullyCorrectSignedMomentumFromCurvature (float p, VldContext vc, ReleaseType::Release_t release, EnergyCorrections::WhichCorrection_t whichCor=EnergyCorrections::kDefault)
float CalibrationGroupEnergyCorrections (float E, VldContext vc, ReleaseType::Release_t release, EnergyCorrections::WhichCorrection_t whichCor=EnergyCorrections::kDefault)
float ShowerEnergyCorrectionNearCedar (float energy, const CandShowerHandle::ShowerType_t &st, EnergyCorrections::WhichCorrection_t whichCor)
float ShowerEnergyCorrectionFarCedar (float energy, const CandShowerHandle::ShowerType_t &st, EnergyCorrections::WhichCorrection_t whichCor)
float MasakiNearMay17th (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiFarMay17th (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiNearMay17thCGScaled (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiFarMay17thScaled (float energy, const CandShowerHandle::ShowerType_t &st)
float SignedMomentumCurvatureCorrectionCedar (float p, VldContext vc, WhichCorrection_t whichCor)
float SignedMomentumCurvatureCorrectionBirch (float p, VldContext vc, WhichCorrection_t whichCor)
float MomentumRangeCorrectionBirch (float p, VldContext vc, WhichCorrection_t whichCor)
float MomentumRangeCorrectionCedar (float p, VldContext vc, WhichCorrection_t whichCor)
float EnergyRangeCorrectionCedar (float E, VldContext vc, WhichCorrection_t whichCor)
void SetCorrectionVersion (const CorrectionVersion_t &ver, Short_t subver=0)
std::string GetCorrectionAsString ()
void WarnUnknownVersion (const char *caller_routine)
CorrectionVersion_t VersionFromFilename (const char *)
float CorrectMomentumFromRange (float p, bool isdata=true, DetectorType::Detector_t det=DetectorType::kNear)
float CorrectEnergyFromRange (float E, bool isdata=true, DetectorType::Detector_t det=DetectorType::kNear)
float CorrectSignedMomentumFromCurvature (float p, bool isdata=true, DetectorType::Detector_t det=DetectorType::kNear)
float CorrectShowerEnergy (float E, const DetectorType::Detector_t &det, const CandShowerHandle::ShowerType_t &st, int mode=1, bool isdata=true)
float CorrectShowerEnergyNear (float E, const CandShowerHandle::ShowerType_t &st, int mode=1, bool isdata=true)
float CorrectShowerEnergyFar (float E, const CandShowerHandle::ShowerType_t &st, int mode=1, bool isdata=true)
float CorrectMomentumFromRange_Birch (float p, bool isdata=true, DetectorType::Detector_t det=DetectorType::kNear)
float CorrectSignedMomentumFromCurvature_Birch (float p, bool isdata=true, DetectorType::Detector_t det=DetectorType::kNear)
float CorrectShowerEnergyNear_Birch (float E, const CandShowerHandle::ShowerType_t &st, int mode=1, bool isdata=true)
float CorrectShowerEnergyFar_Birch (float E, const CandShowerHandle::ShowerType_t &st, int mode=1, bool isdata=true)
float CorrectMomentumFromRange_Cedar (float p, bool isdata=true, DetectorType::Detector_t det=DetectorType::kNear)
float CorrectSignedMomentumFromCurvature_Cedar (float p, bool isdata=true, DetectorType::Detector_t det=DetectorType::kNear)
float CorrectShowerEnergyNear_Cedar (float E, const CandShowerHandle::ShowerType_t &st, int mode=1, bool isdata=true)
float CorrectShowerEnergyFar_Cedar (float E, const CandShowerHandle::ShowerType_t &st, int mode=1, bool isdata=true)

Variables

const float cgffBirchDataFD = 1.018
const float cgffCedarPhyDataFD = 0.9988
const float cgffCedarPhyDataND = 1.0039
const float cgffCedarR1_24_1MCFD = (0.001737/0.001786)
const float cgffCedarR1_24_1MCND = (0.001759/0.001792)
const float cgffCedarPhyDataFDOld = 0.996
const float cgffCedarPhyDataNDOld = 1.003
const float cgffCedarR1_24_1MCFDOld = 0.986
const float cgffCedarR1_24_1MCNDOld = 0.994
const float cgffCedarR1_24_2MCFD = cgffCedarR1_24_1MCFD*(0.001786/0.001737)
const float cgffCedarR1_24_2MCND = cgffCedarR1_24_1MCND*(0.001792/0.001759)
CorrectionVersion_t fVersion = EnergyCorrections::kUnknown
Short_t fSubVersion = 0


Detailed Description

Track Energy/Momentum Correction.

kNoCalGroup = Nothing

Notes: The currently implemented corrections are: i) 1.8% FD data correction for PRL era data ii) The MC drift bug correction for Cedar MC iii) The preliminary data and MC fudge factors that tweak the MEU scale. The numbers are taken from DocDB 3139 by Jeff Hartnell and Tingjun Yang

Further notes: This routine uses the Calibrator, and requires read access to the offline database. At present, any up-to-date database will do. Note that this routine initializes a custom Calibrator on the first call; it should not interfere with other Calibrators you may be using.


Typedef Documentation

typedef enum EnergyCorrections::ECorrectionVersion EnergyCorrections::CorrectionVersion_t
 

Referenced by VersionFromFilename().

typedef enum EnergyCorrections::EWhichCorrection EnergyCorrections::WhichCorrection_t
 


Enumeration Type Documentation

enum ECorrectionVersion
 

Enumeration values:
kUnknown 
kBirch 
kCedar 

Definition at line 280 of file EnergyCorrections.h.

00280                                    {
00281       kUnknown,
00282       kBirch,
00283       kCedar
00284    } CorrectionVersion_t;

enum EWhichCorrection
 

Enumeration values:
kDefault 
kVersion1 
kVersion2 
kVersion3 
kVersion4 
kVersion5 
kVersion6 
kNoCalGroup 

Definition at line 194 of file EnergyCorrections.h.

00194                                  {
00195       kDefault=0,
00196       kVersion1,
00197       kVersion2,
00198       kVersion3,
00199       kVersion4,
00200       kVersion5,
00201       kVersion6,
00202       kNoCalGroup
00203    } WhichCorrection_t;


Function Documentation

float EnergyCorrections::CalibrationGroupEnergyCorrections float  E,
VldContext  vc,
ReleaseType::Release_t  release,
EnergyCorrections::WhichCorrection_t  whichCor = EnergyCorrections::kDefault
 

Definition at line 332 of file EnergyCorrections.cxx.

References ReleaseType::AsString(), Calibrator::CreateCustomCalibrator(), VldContext::GetDetector(), Calibrator::GetDriftCorrected(), ReleaseType::GetRecoInfo(), VldContext::GetSimFlag(), MsgService::GetStream(), MsgService::Instance(), ReleaseType::IsBirch(), ReleaseType::IsCedar(), ReleaseType::IsDaikon(), MAXMSG, CalScheme::Reset(), CfgPromptConfigurable::Set(), and MsgStream::SetLogLevel().

Referenced by CorrectionsForMasaki::CalibratedShowerEnergy(), MeuPlots::CalibrationGroupEnergyCorrections(), and FullyCorrectShowerEnergy().

00336 {
00337   //Nb: This function is called by FullyCorrectShowerEnergy, do not use it for CC Shower's
00338 
00339   float retval = E; // Default return value.
00340 
00341   MAXMSG("DataUtil",Msg::kInfo,1)
00342     << "CalibrationGroupEnergyCorrections:: Using Release Type: "
00343     << ReleaseType::AsString(release) << "\tusing correction version: "
00344     << whichCor << "\n";
00345   
00346   static Calibrator* customCalibrator = 0;
00347   if(customCalibrator ==0 ) {
00348     //Initialize. Disable warning that we're about to do something 'tricksy'.
00349     // This tricksyness is just to make a custom instance of the calibrator, so we don't
00350     // interfere with any other custom settings that the user (i.e. Jeff H) is doing
00351     // This is actually pretty safe, if an expert like me (Nathaniel) does it.
00352     MsgService::Instance()->GetStream("Calib")->SetLogLevel(Msg::kFatal);
00353     customCalibrator = Calibrator::CreateCustomCalibrator();
00354 
00355     // Turn off the units we aren't using, just to make them go faster.
00356     // "Speed holes!" -Homer Simpson
00357     
00358     customCalibrator->Set("Thermometer=SimpleCalScheme "
00359                           "PeCalibrator=SimpleCalScheme "
00360                           "LinCalibrator=SimpleCalScheme "
00361                           "StripCalibrator=SimpleCalScheme "
00362                           "AttenCalibrator=SimpleCalScheme "
00363                           "MIPCalibrator=SimpleCalScheme "
00364                           "TimeCalibrator=SimpleCalScheme ");
00365     MsgService::Instance()->GetStream("Calib")->SetLogLevel(Msg::kWarning);    
00366   }
00367 
00368 
00369 
00370   // Get the reconstruction version.
00371   ReleaseType::Release_t recoVers = ReleaseType::GetRecoInfo(release);
00372 
00373   // Fudge #0:
00374   // For PRL-era data, we fudged the FD data by 1.8%
00375   if(    ReleaseType::IsBirch(release)
00376          && vc.GetSimFlag()==SimFlag::kData
00377          && vc.GetDetector()==Detector::kFar ) 
00378     {
00379       MAXMSG("DataUtil",Msg::kInfo,1)
00380         << "EnergyCorrections -- Applying Birch Far Detector Factor ( "
00381         << EnergyCorrections::cgffBirchDataFD << ")\n";
00382       retval = retval*EnergyCorrections::cgffBirchDataFD;
00383     }
00384   
00385 
00386 
00387   if(ReleaseType::IsCedar(release) && whichCor!=EnergyCorrections::kNoCalGroup) {
00388     //
00389     // Fudge #1
00390     // Attempt to remove the MC bug, where the drift decalibration was applied with the wrong sign.
00391     // This is a time-dependent correction which should fix the problem for cedar-daikon MC R1.24.1 
00392     // This problem was fixed in R1.24.2 and R1.24.calB, but NOT R1.24.calA.
00393     //
00394     if(   ReleaseType::IsCedar(release) 
00395           && ReleaseType::IsDaikon(release) 
00396           && (recoVers < ReleaseType::kR1_24_2 || recoVers == ReleaseType::kR1_24_Cal )
00397           && vc.GetSimFlag()==SimFlag::kMC) 
00398       {
00399         // Removes MC bug where drift correction was applied twice.
00400         // Fix it by de-applying the drift twice.
00401         MAXMSG("DataUtil",Msg::kInfo,1)
00402           << "EnergyCorrections -- Applying Infamous MC Drift Bug Correction\n";
00403         
00404         customCalibrator->Reset(vc);
00405         float drift = customCalibrator->GetDriftCorrected(1.0,PlexStripEndId());
00406         retval = retval / (drift*drift);     
00407       }
00408     
00409     
00410     // Correction #2
00411     // These are the preliminary final corrections for the June 2007 cc box opening.
00412     // The numbers are taken from DocDB 3139 by Jeff Hartnell and Tingjun Yang
00413     // These are only applied if using the default (or version3) correction
00414     if(!(whichCor==EnergyCorrections::kVersion1 || whichCor==EnergyCorrections::kVersion2)) {
00415       
00416       if(vc.GetSimFlag()==SimFlag::kMC) {
00417         //For the Cedar MC we have the following possible datasets:
00418         // i) CedarDaikon -- used in Summer analysis 2007
00419         // ii) CedarPhyDaikon -- reprocessed by batch group over summer 2007
00420 
00421         if(ReleaseType::IsCedar(release) && recoVers<=ReleaseType::kR1_24_1) {
00422           //Now here we have two options either use the latest greatest numbers
00423           // or we use the old numbers from the 2007 summer analysis
00424           if(whichCor==kVersion3) {
00425             //Use the old numbers
00426             if(vc.GetDetector()==Detector::kFar) {
00427               MAXMSG("DataUtil",Msg::kInfo,1)
00428                 << "EnergyCorrections -- Applying R_1_24_1 (Summer 2007) Far MC Correction Factor"
00429                 << " (" << EnergyCorrections::cgffCedarR1_24_1MCFDOld << ")\n";
00430               retval*=EnergyCorrections::cgffCedarR1_24_1MCFDOld;
00431             }
00432             else if(vc.GetDetector()==Detector::kNear) {
00433               MAXMSG("DataUtil",Msg::kInfo,1)
00434                 << "EnergyCorrections -- Applying R_1_24_1 (Summer 2007) Near MC Correction Factor"
00435                 << " (" << EnergyCorrections::cgffCedarR1_24_1MCNDOld << ")\n";
00436               retval*=EnergyCorrections::cgffCedarR1_24_1MCNDOld;
00437             }
00438           }
00439           else {
00440             //Use the new numbers
00441             if(vc.GetDetector()==Detector::kFar) {
00442               MAXMSG("DataUtil",Msg::kInfo,1)
00443                 << "EnergyCorrections -- Applying R_1_24_1 (Fall 2007) Far MC Correction Factor"
00444                 << " (" << EnergyCorrections::cgffCedarR1_24_1MCFD << ")\n";
00445               retval*=EnergyCorrections::cgffCedarR1_24_1MCFD;
00446             }
00447             else if(vc.GetDetector()==Detector::kNear) {
00448               MAXMSG("DataUtil",Msg::kInfo,1)
00449                 << "EnergyCorrections -- Applying R_1_24_1 (Fall 2007) Near MC Correction Factor"
00450                 << " (" << EnergyCorrections::cgffCedarR1_24_1MCND << ")\n";
00451               retval*=EnergyCorrections::cgffCedarR1_24_1MCND;
00452             }
00453               
00454           }
00455         }
00456         else if(ReleaseType::IsCedar(release) && recoVers>=ReleaseType::kR1_24_2) 
00457           {
00458             //Changed because we updated the GevPerMIP number in the MC
00459             // reprocessing. Bloody annoying.     
00460             if(vc.GetDetector()==Detector::kFar) {
00461               MAXMSG("DataUtil",Msg::kInfo,1)
00462                 << "EnergyCorrections -- Applying R_1_24_2 (Fall 2007) Far MC Correction Factor"
00463                 << " (" << EnergyCorrections::cgffCedarR1_24_2MCFD << ")\n";
00464               retval*=EnergyCorrections::cgffCedarR1_24_2MCFD;
00465             }
00466             else if(vc.GetDetector()==Detector::kNear) {
00467               MAXMSG("DataUtil",Msg::kInfo,1)
00468                 << "EnergyCorrections -- Applying R_1_24_2 (Fall 2007) Near MC Correction Factor"
00469                 << " (" << EnergyCorrections::cgffCedarR1_24_2MCND << ")\n";
00470               retval*=EnergyCorrections::cgffCedarR1_24_2MCND;
00471             }
00472           }     
00473       }
00474       else if(vc.GetSimFlag()==SimFlag::kData) {
00475         //Data corrections only available for Cedar_Phy
00476         //Once again we are going to have the option to use the old or
00477         // the new numbers
00478         if(whichCor==kVersion3) {
00479           //Use the old numbers from the Summer 2007 analysis
00480           if(recoVers>=ReleaseType::kCedarPhy) {
00481             if(vc.GetDetector()==Detector::kFar) {
00482               MAXMSG("DataUtil",Msg::kInfo,1)
00483                 << "EnergyCorrections -- Applying CedarPhy (Summer 2007) Far Correction Factor"
00484                 << " (" << EnergyCorrections::cgffCedarPhyDataFDOld << ")\n";
00485               retval*=EnergyCorrections::cgffCedarPhyDataFDOld;
00486             }
00487             else if(vc.GetDetector()==Detector::kNear) {
00488               MAXMSG("DataUtil",Msg::kInfo,1)
00489                 << "EnergyCorrections -- Applying CedarPhy (Summer 2007) Near Correction Factor"
00490                 << " (" << EnergyCorrections::cgffCedarPhyDataNDOld << ")\n";
00491               retval*=EnergyCorrections::cgffCedarPhyDataNDOld;
00492             }
00493           }
00494         }
00495         else {
00496           //Use the latest greatest numbers
00497           if(recoVers>=ReleaseType::kCedarPhy) {
00498             if(vc.GetDetector()==Detector::kFar) {
00499               MAXMSG("DataUtil",Msg::kInfo,1)
00500                 << "EnergyCorrections -- Applying CedarPhy (Fall 2007) Far Correction Factor"
00501                 << " (" << EnergyCorrections::cgffCedarPhyDataFD << ")\n";
00502               retval*=EnergyCorrections::cgffCedarPhyDataFD;
00503             }
00504             else if(vc.GetDetector()==Detector::kNear) {
00505               MAXMSG("DataUtil",Msg::kInfo,1)
00506                 << "EnergyCorrections -- Applying CedarPhy (Fall 2007) Near Correction Factor"
00507                 << " (" << EnergyCorrections::cgffCedarPhyDataND << ")\n";
00508               retval*=EnergyCorrections::cgffCedarPhyDataND;
00509             }
00510           }
00511         }
00512       }
00513     }
00514   }
00515 
00516   return retval;
00517 
00518 }

float EnergyCorrections::CorrectEnergyFromRange float  E,
bool  isdata = true,
DetectorType::Detector_t  det = DetectorType::kNear
 

Definition at line 627 of file EnergyCorrections.cxx.

References CorrectMomentumFromRange().

00627                                                                                                {
00628    const float m=0.1057;// mon mass
00629    float p = sqrt(E*E -m*m);
00630    float pcor = CorrectMomentumFromRange(p,isdata,det);
00631    return sqrt(pcor*pcor +m*m);
00632 } 

float EnergyCorrections::CorrectMomentumFromRange float  p,
bool  isdata = true,
DetectorType::Detector_t  det = DetectorType::kNear
 

Definition at line 588 of file EnergyCorrections.cxx.

References CorrectMomentumFromRange_Birch(), CorrectMomentumFromRange_Cedar(), and WarnUnknownVersion().

Referenced by CorrectEnergyFromRange(), MadMKAnalysis::CreatePAN(), NCAnalysisModule::FillRecoInfo(), MadMKAnalysis::RecoMKMuEnergy(), MadEvDisplay::RecoMKMuEnergy(), MadQuantities::RecoMuEnergy(), and ANtpTrackInfoAna::RecoMuEnergy().

00589                                                           {
00590   float pcor=p;
00591     switch(fVersion){
00592     case kCedar:
00593       pcor=CorrectMomentumFromRange_Cedar(p,isdata,det);
00594       break;
00595     case kBirch:
00596       pcor=CorrectMomentumFromRange_Birch(p,isdata,det);
00597       break;
00598     case kUnknown:
00599     default:
00600       WarnUnknownVersion("CorrectMomentumFromRange()");
00601       pcor=CorrectMomentumFromRange_Birch(p,isdata,det);      
00602       break;
00603     }
00604     return pcor;
00605 }

float EnergyCorrections::CorrectMomentumFromRange_Birch float  p,
bool  isdata = true,
DetectorType::Detector_t  det = DetectorType::kNear
 

Definition at line 715 of file EnergyCorrections.cxx.

References pow().

Referenced by CorrectMomentumFromRange().

00715                                                                                                        {
00716   static const float c[4]={1.01334,0.05563,-0.05346,0.01205};
00717   
00718   // correction for difference in data mc steel density
00719   if(isdata){
00720     // inital correction, pre-Oxford 2006
00721     //static const float dcor=7.755/7.87;// data/mc density
00722     float dcor=1;
00723     if (det==DetectorType::kNear) dcor=(7.85*2.563)/(7.87*2.54); 
00724     else if(det==DetectorType::kFar) dcor=(7.85*2.558)/(7.87*2.54);
00725 
00726     p*=dcor;
00727   }
00728   // 
00729   float pcor=p/(c[0] + c[1]*log(p) + c[2]*pow(log(p), 2) + c[3]*pow(log(p),3));
00730   return pcor;
00731 }

float EnergyCorrections::CorrectMomentumFromRange_Cedar float  p,
bool  isdata = true,
DetectorType::Detector_t  det = DetectorType::kNear
 

Definition at line 803 of file EnergyCorrections.cxx.

Referenced by CorrectMomentumFromRange().

00803                                                                                                                    {
00804   return p;
00805 }

float EnergyCorrections::CorrectShowerEnergy float  E,
const DetectorType::Detector_t &  det,
const CandShowerHandle::ShowerType_t st,
int  mode = 1,
bool  isdata = true
 

Definition at line 695 of file EnergyCorrections.cxx.

References CorrectShowerEnergyFar(), and CorrectShowerEnergyNear().

Referenced by MadEvDisplay::DrawTextBox(), NCAnalysisCuts::IsGoodShower(), MadMKAnalysis::RecoShwEnergy(), and ANtpShowerInfoAna::RecoShwEnergy().

00697                                                 {
00698    //People should not be using this function
00699   float ecor=E;
00700    if(det==DetectorType::kNear){
00701       ecor = CorrectShowerEnergyNear(E,st,mode,isdata);
00702    }
00703    else if(det==DetectorType::kFar){
00704       ecor = CorrectShowerEnergyFar(E,st,mode,isdata);
00705    }
00706 
00707    return ecor;
00708    
00709 }

float EnergyCorrections::CorrectShowerEnergyFar float  E,
const CandShowerHandle::ShowerType_t st,
int  mode = 1,
bool  isdata = true
 

Definition at line 657 of file EnergyCorrections.cxx.

References CorrectShowerEnergyFar_Birch(), CorrectShowerEnergyFar_Cedar(), and WarnUnknownVersion().

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

00657                                                                                                                      {
00658    //People should not be using this function
00659    
00660 
00661   float ecor=E;  
00662   switch(fVersion){
00663   case kCedar:
00664     ecor=CorrectShowerEnergyFar_Cedar(E,st,mode,isdata);
00665     break;
00666   case kBirch:
00667      if(isdata) {
00668         // a correction for the FD MIP scale
00669         // for the beam data, one measured MIP 
00670         // actually corresponds to 1.018 MIPs
00671         // so we must correct shower energy up
00672         const float mip_scale_correction=1.018;
00673         E*=mip_scale_correction;
00674      }
00675     ecor=CorrectShowerEnergyFar_Birch(E,st,mode,isdata);
00676     break;
00677   case kUnknown:
00678   default:
00679     WarnUnknownVersion("CorrectShowerEnergyFar()");
00680     if(isdata) {
00681        // a correction for the FD MIP scale
00682        // for the beam data, one measured MIP 
00683        // actually corresponds to 1.018 MIPs
00684        // so we must correct shower energy up
00685        const float mip_scale_correction=1.018;
00686         E*=mip_scale_correction;
00687      }    
00688     ecor=CorrectShowerEnergyFar_Birch(E,st,mode,isdata);      
00689     break;
00690   }
00691   return ecor;
00692 
00693 }

float EnergyCorrections::CorrectShowerEnergyFar_Birch float  E,
const CandShowerHandle::ShowerType_t st,
int  mode = 1,
bool  isdata = true
 

Definition at line 773 of file EnergyCorrections.cxx.

Referenced by CorrectShowerEnergyFar(), and FullyCorrectShowerEnergy().

00773                                                                                                                                {
00774    //   std::cout << "CorrectShowerEnergyFar_Birch: " << E << std::endl;
00775    float ecor=E;
00776    if(st==CandShowerHandle::kCC){
00777      if(mode==1){
00778        // Niki Correction
00779        ecor=((E)*(1.-0.12*exp(-0.12*E)));
00780      }
00781      else if(mode==2){
00782        // Andy Correction
00783        //        ecor=(E)*(1.-0.2*exp(-0.2*E));
00784        ecor=E*(0.99-0.035*E*exp(-0.25*E));
00785      }
00786    }
00787    else if(st==CandShowerHandle::kWtCC){
00788       if(mode==1){
00789          // Niki Correction
00790          ecor=((E)*(1.+0.18*exp(-0.35*E)));
00791       }
00792       else if(mode==2){
00793          // Andy Correction
00794          E=ecor;
00795       }
00796    }
00797    return ecor;
00798 }

float EnergyCorrections::CorrectShowerEnergyFar_Cedar float  E,
const CandShowerHandle::ShowerType_t st,
int  mode = 1,
bool  isdata = true
 

Definition at line 823 of file EnergyCorrections.cxx.

Referenced by CorrectShowerEnergyFar(), and ShowerEnergyCorrectionFarCedar().

00823                                                                                                                                          {
00824   
00825    float ecor=E;
00826    if(st==CandShowerHandle::kCC){
00827      ecor = ecor*(0.950+0.277*exp(-ecor*1.64));
00828    }
00829    else if(st==CandShowerHandle::kWtCC){
00830      ecor = ecor*(0.957+0.271*exp(-ecor*1.64));
00831    }
00832    return ecor;
00833 
00834 }

float EnergyCorrections::CorrectShowerEnergyNear float  E,
const CandShowerHandle::ShowerType_t st,
int  mode = 1,
bool  isdata = true
 

Definition at line 635 of file EnergyCorrections.cxx.

References CorrectShowerEnergyNear_Birch(), CorrectShowerEnergyNear_Cedar(), and WarnUnknownVersion().

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

00635                                                                                                                        {
00636    //People should not be using this function
00637 
00638   float ecor=E;
00639   switch(fVersion){
00640   case kCedar:
00641     ecor=CorrectShowerEnergyNear_Cedar(E,st,mode,isdata);
00642     break;
00643   case kBirch:
00644     ecor=CorrectShowerEnergyNear_Birch(E,st,mode,isdata);
00645     break;
00646   case kUnknown:
00647   default:
00648     WarnUnknownVersion("CorrectShowerEnergyNear()");
00649     ecor=CorrectShowerEnergyNear_Birch(E,st,mode,isdata);      
00650     break;
00651   }
00652   return ecor;
00653 }

float EnergyCorrections::CorrectShowerEnergyNear_Birch float  E,
const CandShowerHandle::ShowerType_t st,
int  mode = 1,
bool  isdata = true
 

Definition at line 746 of file EnergyCorrections.cxx.

Referenced by CorrectShowerEnergyNear(), and FullyCorrectShowerEnergy().

00746                                                                                                                                   {
00747 
00748    //   std::cout << "CorrectShowerEnergyNear_Birch: " << E << "\t" << mode <<  std::endl;
00749    float ecor=E;
00750    if(st==CandShowerHandle::kCC){
00751       if(mode==1){
00752          // Niki Correction
00753          ecor=E/1.18;
00754       }
00755       else if(mode==2){
00756          // Andy Correction
00757          ecor=((E/1.05)*(1.-0.35*exp(-0.18*E/1.06)));
00758       }
00759    }
00760    else if(st==CandShowerHandle::kWtCC){
00761       if(mode==1){
00762          // Niki Correction
00763          ecor=((E)*(1.+0.50*exp(-1.00*E)));
00764       }
00765       else if(mode==2){
00766          // Andy Correction
00767          ecor=E/1.03;
00768       }
00769    }
00770    return ecor;
00771 }

float EnergyCorrections::CorrectShowerEnergyNear_Cedar float  E,
const CandShowerHandle::ShowerType_t st,
int  mode = 1,
bool  isdata = true
 

Definition at line 811 of file EnergyCorrections.cxx.

Referenced by CorrectShowerEnergyNear(), and ShowerEnergyCorrectionNearCedar().

00811                                                                                                                                           {
00812 
00813    float ecor=E;
00814    if(st==CandShowerHandle::kCC){
00815      ecor = ecor*(0.921+0.231*exp(-ecor*1.63));
00816    }
00817    else if(st==CandShowerHandle::kWtCC){
00818      ecor = ecor*(0.924+0.235*exp(-ecor*1.63));
00819    }
00820    return ecor;
00821 }

float EnergyCorrections::CorrectSignedMomentumFromCurvature float  p,
bool  isdata = true,
DetectorType::Detector_t  det = DetectorType::kNear
 

Definition at line 607 of file EnergyCorrections.cxx.

References CorrectSignedMomentumFromCurvature_Birch(), CorrectSignedMomentumFromCurvature_Cedar(), and WarnUnknownVersion().

Referenced by MadMKAnalysis::CreatePAN(), NCAnalysisModule::FillRecoInfo(), MadMKAnalysis::RecoMKMuEnergy(), MadQuantities::RecoMuEnergy(), and ANtpTrackInfoAna::RecoMuEnergy().

00607                                                                                                              {
00608 
00609   float pcor=p;
00610     switch(fVersion){
00611     case kCedar:
00612       pcor=CorrectSignedMomentumFromCurvature_Cedar(p,isdata,det);
00613       break;
00614     case kBirch:
00615       pcor=CorrectSignedMomentumFromCurvature_Birch(p,isdata,det);
00616       break;
00617     case kUnknown:
00618     default:
00619       WarnUnknownVersion("CorrectSignedMomentumFromCurvature()");
00620       pcor=CorrectSignedMomentumFromCurvature_Birch(p,isdata,det);      
00621       break;
00622     }
00623     return pcor;
00624 }

float EnergyCorrections::CorrectSignedMomentumFromCurvature_Birch float  p,
bool  isdata = true,
DetectorType::Detector_t  det = DetectorType::kNear
 

Definition at line 733 of file EnergyCorrections.cxx.

Referenced by CorrectSignedMomentumFromCurvature().

00733                                                                                                                              {
00734   // input is the signed momentum (e.g. p/q)
00735   // isdata and det are not used... but maybe in the future
00736   float pcor=p;
00737   if(pcor!=0) {
00738     // correction advertised in 1430-v2, J. Musser
00739     // note: for 1/p < 0   C=1, so correction only matters for mu+
00740     float C = (1.01+0.1*fabs(1/p))/(1.01-0.1*(1/p));
00741     pcor*=(1.0/C);
00742   }
00743   return pcor;
00744 }

float EnergyCorrections::CorrectSignedMomentumFromCurvature_Cedar float  p,
bool  isdata = true,
DetectorType::Detector_t  det = DetectorType::kNear
 

Definition at line 807 of file EnergyCorrections.cxx.

Referenced by CorrectSignedMomentumFromCurvature().

00807                                                                                                                              {
00808   return p;
00809 }

float EnergyCorrections::EnergyRangeCorrectionCedar float  E,
VldContext  vc,
WhichCorrection_t  whichCor
 

Definition at line 989 of file EnergyCorrections.cxx.

References VldContext::GetDetector(), VldContext::GetSimFlag(), and MAXMSG.

Referenced by FullyCorrectEnergyFromRange(), and MomentumRangeCorrectionCedar().

00990 {
00991   MAXMSG("DataUtil",Msg::kInfo,1)
00992     << "EnergyCorrections -- Applying Energy from Range Correction for Cedar (1.018*E)-0.009 for ND Data and (1.010*E)-0.009 for everything else.\n";
00993   float eCor=E;
00994   if(vc.GetSimFlag()==SimFlag::kData && vc.GetDetector()==DetectorType::kNear) {
00995     eCor=(1.018*E)-0.009;
00996   }
00997   else {
00998     eCor=(1.010*E)-0.009;
00999   }
01000   
01001   return eCor;
01002 }

float EnergyCorrections::FullyCorrectEnergyFromRange float  E,
VldContext  vc,
ReleaseType::Release_t  release,
EnergyCorrections::WhichCorrection_t  whichCor = EnergyCorrections::kDefault
 

Definition at line 224 of file EnergyCorrections.cxx.

References EnergyRangeCorrectionCedar(), FullyCorrectMomentumFromRange(), ReleaseType::IsBirch(), and ReleaseType::IsCedar().

00228 {
00229   if(ReleaseType::IsBirch(release)) {
00230     const float m=0.1057;// muon mass
00231     float p = sqrt(E*E -m*m);
00232     float pcor = EnergyCorrections::FullyCorrectMomentumFromRange(p,vc,release,whichCor);
00233     return sqrt(pcor*pcor +m*m);   
00234   }
00235   else if(ReleaseType::IsCedar(release)) {
00236     return EnergyCorrections::EnergyRangeCorrectionCedar(E,vc,whichCor);
00237   }
00238   return E;
00239 }

float EnergyCorrections::FullyCorrectMomentumFromRange float  p,
VldContext  vc,
ReleaseType::Release_t  release,
EnergyCorrections::WhichCorrection_t  whichCor = EnergyCorrections::kDefault
 

Track Energy/Momentum Correction.

INPUTS:

  • Track energy/momentum in GeV
  • Valdity context of the event
  • Release code for the batch release (code+scripts+database+MC) used to generate the data
  • WhichCorrection_t generally speaking kDefault will be what most people want, but to compare corrections this switch is in place.

OUTPUT:

  • Track energy/momentum

Definition at line 208 of file EnergyCorrections.cxx.

References ReleaseType::IsBirch(), ReleaseType::IsCedar(), MomentumRangeCorrectionBirch(), and MomentumRangeCorrectionCedar().

Referenced by MNtpModule::Ana(), MuonRemovalInfoAna::Analyze(), MadTVAnalysis::CreatePAN(), FullyCorrectEnergyFromRange(), NCAnalysisUtils::GetTrackEnergy(), MadQuantities::RecoMuEnergyNew(), ANtpTrackInfoAna::RecoMuEnergyNew(), and Anp::FillTrack::Run().

00212 {
00213    float pcor=p;
00214    if(ReleaseType::IsBirch(release)) {   
00215       pcor=EnergyCorrections::MomentumRangeCorrectionBirch(p,vc,whichCor);
00216    }
00217    else if(ReleaseType::IsCedar(release)) {
00218       pcor=EnergyCorrections::MomentumRangeCorrectionCedar(p,vc,whichCor);
00219    }
00220    return pcor;
00221 
00222 }

float EnergyCorrections::FullyCorrectShowerEnergy float  E,
const CandShowerHandle::ShowerType_t st,
VldContext  vc,
ReleaseType::Release_t  release,
EnergyCorrections::WhichCorrection_t  whichCor = EnergyCorrections::kDefault
 

INPUTS:

  • Shower energy in GeV (for Masaki CC correction). SigMap and MEU/MIP are also supported for non kCC CandShowerHandle::ShowerType_t.
  • Shower type (only kCC showers have Masaki's correction)
  • Valdity context of the event
  • Release code for the batch release (code+scripts+database+MC) used to generate the data
  • WhichCorrection_t generally speaking kDefault will be what most people want, but to compare corrections this switch is in place.

OUTPUT:

  • Shower energy in same units as input.

Further notes: This routine uses the Calibrator, and requires read access to the offline database. At present, any up-to-date database will do. Note that this routine initializes a custom Calibrator on the first call; it should not interfere with other Calibrators you may be using.

WhichCorrection_t lookup table

Birch -- Shower ================= kDefault = Niki's Correction kVersion1 = Niki's Correction kVersion2 = Andy's Correction Cedar -- Shower =============== kDefault = (MC Only) Drift Correction + Cal Group Fudge Factors + Scaled Masaki 17th May kVersion1 = (MC Only) Drift Correction + Masaki 17th May kVersion2 = Masaki Exponential kVersion3 = (MC Only) Drift Correction + Cal Group Fudge Factors + Scaled Masaki 17th May kNoCalGroup = Scaled Masaki 17th May

Definition at line 144 of file EnergyCorrections.cxx.

References CalibrationGroupEnergyCorrections(), CorrectShowerEnergyFar_Birch(), CorrectShowerEnergyNear_Birch(), VldContext::GetDetector(), ReleaseType::IsBirch(), ReleaseType::IsCedar(), ShowerEnergyCorrectionFarCedar(), and ShowerEnergyCorrectionNearCedar().

Referenced by MNtpModule::Ana(), MuonRemovalInfoAna::Analyze(), CandShowerHandle::CalibrateEnergy(), NCAnalysisUtils::GetShowerEnergy(), MadQuantities::RecoShwEnergyNew(), ANtpShowerInfoAna::RecoShwEnergyNew(), and Anp::FillShower::Run().

00149 {
00150 
00151    //First step is to apply Calibration Group Corrections
00152    float eCor=EnergyCorrections::CalibrationGroupEnergyCorrections(E,vc,release,whichCor);
00153 
00154 
00155    //Now need to apply Masaki's correction
00156    //Need switch on detector
00157    switch(vc.GetDetector()) {
00158    case DetectorType::kNear:
00159       //      std::cout << "Near" << std::endl;
00160       if(ReleaseType::IsBirch(release)) {
00161          //Birch Release
00162          int mode=1;
00163          if(whichCor==EnergyCorrections::kVersion2)
00164             mode=2;
00165          return EnergyCorrections::CorrectShowerEnergyNear_Birch(eCor,st,mode);
00166       }
00167       else if(ReleaseType::IsCedar(release)) {
00168          //Cedar Release
00169          return EnergyCorrections::ShowerEnergyCorrectionNearCedar(eCor,st,whichCor);
00170       }
00171       return E;
00172    case DetectorType::kFar:
00173       //      std::cout << "Far" << std::endl;
00174       if(ReleaseType::IsBirch(release)) {
00175          //Birch Release
00176          int mode=1;
00177          if(whichCor==EnergyCorrections::kVersion2)
00178             mode=2;
00179          return EnergyCorrections::CorrectShowerEnergyFar_Birch(eCor,st,mode);
00180       }
00181       else if(ReleaseType::IsCedar(release)) {
00182          //Cedar Release
00183          return EnergyCorrections::ShowerEnergyCorrectionFarCedar(eCor,st,whichCor);
00184       }      
00185       return E;
00186    default:      
00187       return E;
00188    }     
00189 }  

float EnergyCorrections::FullyCorrectSignedMomentumFromCurvature float  p,
VldContext  vc,
ReleaseType::Release_t  release,
EnergyCorrections::WhichCorrection_t  whichCor = EnergyCorrections::kDefault
 

Definition at line 241 of file EnergyCorrections.cxx.

References ReleaseType::IsBirch(), ReleaseType::IsCedar(), SignedMomentumCurvatureCorrectionBirch(), and SignedMomentumCurvatureCorrectionCedar().

Referenced by MNtpModule::Ana(), MuonRemovalInfoAna::Analyze(), MadTVAnalysis::CreatePAN(), NCAnalysisUtils::GetTrackEnergy(), MadQuantities::RecoMuEnergyNew(), and ANtpTrackInfoAna::RecoMuEnergyNew().

00245 {
00246    float pcor=p;
00247    if(ReleaseType::IsBirch(release)) {   
00248       pcor=EnergyCorrections::SignedMomentumCurvatureCorrectionBirch(p,vc,whichCor);
00249    }
00250    else if(ReleaseType::IsCedar(release)) {
00251       pcor=EnergyCorrections::SignedMomentumCurvatureCorrectionCedar(p,vc,whichCor);
00252    }
00253    return pcor;
00254 
00255 }

std::string EnergyCorrections::GetCorrectionAsString  ) 
 

Definition at line 538 of file EnergyCorrections.cxx.

References fSubVersion, and s().

Referenced by WarnUnknownVersion().

00538                                                   {
00539   std::string s;
00540   switch(fVersion){
00541   case kBirch:
00542     s+="BIRCH"; break;
00543   case kCedar:
00544     s+="CEDAR"; break;
00545   case kUnknown:
00546   default:
00547     s+="???"; 
00548     break;
00549   }
00550   std::ostringstream os; os<<"-v"<<fSubVersion<<std::ends;
00551   s+=os.str();
00552 
00553   return s;
00554 }

float EnergyCorrections::MasakiFarMay17th float  energy,
const CandShowerHandle::ShowerType_t st
 

Definition at line 889 of file EnergyCorrections.cxx.

References MAXMSG, and pow().

Referenced by ShowerEnergyCorrectionFarCedar().

00891 {
00892    //From DocDB 3077_v3
00893   MAXMSG("DataUtil",Msg::kInfo,1)
00894     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Far Detector from DocDB 3077_v3\n";
00895    float recoE=energy;
00896    //   std::cout << "Old:\t" << recoE << std::endl;
00897    float le = log10(fmax(energy,0.2));   
00898    if(st==CandShowerHandle::kCC){
00899       recoE = energy*(1.113584-0.299139*le+0.145169*(2.*pow(le,2)-1)-0.0232853*(4.*pow(le,3)-3.*le));
00900    }
00901    else if (st==CandShowerHandle::kWtCC){
00902       recoE= energy*(1.052872-0.19185*le+0.102449*(2.*pow(le,2)-1)-0.0182317*(4.*pow(le,3)-3.*le));
00903    }
00904    return recoE;
00905 }

float EnergyCorrections::MasakiFarMay17thScaled float  energy,
const CandShowerHandle::ShowerType_t st
 

Definition at line 926 of file EnergyCorrections.cxx.

References MAXMSG, and pow().

Referenced by ShowerEnergyCorrectionFarCedar().

00928 {
00929    //From DocDB 3077_v3
00930   MAXMSG("DataUtil",Msg::kInfo,1)
00931     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Far Detector from DocDB 3077_v3 -- Scaled by Appropriate CG factor for uncalibrated data he used\n";
00932    float tempE=energy/EnergyCorrections::cgffCedarR1_24_1MCFD;
00933    float recoE=tempE;
00934    //   std::cout <<  "New:\t" <<recoE << std::endl;
00935    float le = log10(fmax(tempE,0.2));   
00936    if(st==CandShowerHandle::kCC){
00937       recoE = tempE*(1.113584-0.299139*le+0.145169*(2.*pow(le,2)-1)-0.0232853*(4.*pow(le,3)-3.*le));
00938    }
00939    else if (st==CandShowerHandle::kWtCC){
00940       recoE= tempE*(1.052872-0.19185*le+0.102449*(2.*pow(le,2)-1)-0.0182317*(4.*pow(le,3)-3.*le));
00941    }
00942    return recoE;
00943 }

float EnergyCorrections::MasakiNearMay17th float  energy,
const CandShowerHandle::ShowerType_t st
 

Definition at line 872 of file EnergyCorrections.cxx.

References MAXMSG, and pow().

Referenced by ShowerEnergyCorrectionNearCedar().

00874 {
00875    //From DocDB 3077_v3
00876   MAXMSG("DataUtil",Msg::kInfo,1)
00877     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Near Detector from DocDB 3077_v3\n";
00878   float recoE=energy;
00879    float le = log10(fmax(energy,0.2));
00880    if(st==CandShowerHandle::kCC){
00881       recoE = energy*(1.078984-0.249843*le+0.134518*(2.*pow(le,2)-1)-0.025613*(4.*pow(le,3)-3.*le));
00882    }
00883    else if(st==CandShowerHandle::kWtCC) {
00884       recoE= energy*(1.070553-0.207148*le+0.0943124*(2.*pow(le,2)-1)-0.0153231*(4.*pow(le,3)-3.*le));
00885    }
00886    return recoE;
00887 }

float EnergyCorrections::MasakiNearMay17thCGScaled float  energy,
const CandShowerHandle::ShowerType_t st
 

Definition at line 908 of file EnergyCorrections.cxx.

References MAXMSG, and pow().

Referenced by ShowerEnergyCorrectionNearCedar().

00910 {
00911    //From DocDB 3077_v3
00912   MAXMSG("DataUtil",Msg::kInfo,1)
00913     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Near Detector from DocDB 3077_v3 -- Scaled by Appropriate CG factor for uncalibrated data he used\n";
00914    float tempE=energy/EnergyCorrections::cgffCedarR1_24_1MCND;
00915    float recoE=tempE;
00916    float le = log10(fmax(tempE,0.2));
00917    if(st==CandShowerHandle::kCC){
00918       recoE = tempE*(1.078984-0.249843*le+0.134518*(2.*pow(le,2)-1)-0.025613*(4.*pow(le,3)-3.*le));
00919    }
00920    else if(st==CandShowerHandle::kWtCC) {
00921       recoE= tempE*(1.070553-0.207148*le+0.0943124*(2.*pow(le,2)-1)-0.0153231*(4.*pow(le,3)-3.*le));
00922    }
00923    return recoE;
00924 }

float EnergyCorrections::MomentumRangeCorrectionBirch float  p,
VldContext  vc,
WhichCorrection_t  whichCor
 

Definition at line 946 of file EnergyCorrections.cxx.

References VldContext::GetDetector(), VldContext::GetSimFlag(), and pow().

Referenced by FullyCorrectMomentumFromRange().

00947 {
00948   static const float c[4]={1.01334,0.05563,-0.05346,0.01205};
00949   
00950   // correction for difference in data mc steel density
00951   if(vc.GetSimFlag()==SimFlag::kData){
00952     // inital correction, pre-Oxford 2006
00953     //static const float dcor=7.755/7.87;// data/mc density
00954     float dcor=1;
00955     if (vc.GetDetector()==DetectorType::kNear) dcor=(7.85*2.563)/(7.87*2.54); 
00956     else if(vc.GetDetector()==DetectorType::kFar) dcor=(7.85*2.558)/(7.87*2.54);
00957 
00958     p*=dcor;
00959   }
00960   // 
00961   float pcor=p/(c[0] + c[1]*log(p) + c[2]*pow(log(p), 2) + c[3]*pow(log(p),3));
00962   return pcor;
00963 }

float EnergyCorrections::MomentumRangeCorrectionCedar float  p,
VldContext  vc,
WhichCorrection_t  whichCor
 

Definition at line 980 of file EnergyCorrections.cxx.

References EnergyRangeCorrectionCedar().

Referenced by FullyCorrectMomentumFromRange().

00981 {
00982   //return p;
00983     const float m=0.1057;// muon mass
00984     float E = sqrt(p*p+m*m);
00985     float eCor = EnergyCorrections::EnergyRangeCorrectionCedar(E,vc,whichCor);
00986     return sqrt(eCor*eCor-m*m);  
00987 }

void EnergyCorrections::SetCorrectionVersion const CorrectionVersion_t ver,
Short_t  subver = 0
 

Definition at line 533 of file EnergyCorrections.cxx.

References fSubVersion, and fVersion.

Referenced by MNtpModule::Ana(), MuonRemovalInfoAna::Analyze(), ANtpTrackInfoAna::Analyze(), ANtpShowerInfoAna::Analyze(), and NCAnalysisCuts::IsGoodShower().

00533                                                                                           {
00534   fVersion=ver;
00535   fSubVersion=subver;
00536 }

float EnergyCorrections::ShowerEnergyCorrectionFarCedar float  energy,
const CandShowerHandle::ShowerType_t st,
EnergyCorrections::WhichCorrection_t  whichCor
 

Definition at line 855 of file EnergyCorrections.cxx.

References CorrectShowerEnergyFar_Cedar(), MasakiFarMay17th(), and MasakiFarMay17thScaled().

Referenced by FullyCorrectShowerEnergy().

00858 {
00859    switch(whichCor) {
00860    case EnergyCorrections::kVersion2:
00861       return EnergyCorrections::CorrectShowerEnergyFar_Cedar(energy,st);
00862    case EnergyCorrections::kVersion1:
00863       return EnergyCorrections::MasakiFarMay17th(energy,st);
00864    case EnergyCorrections::kVersion3:
00865    case EnergyCorrections::kDefault:
00866    default:
00867       return EnergyCorrections::MasakiFarMay17thScaled(energy,st);
00868    }   
00869    return energy;
00870 }

float EnergyCorrections::ShowerEnergyCorrectionNearCedar float  energy,
const CandShowerHandle::ShowerType_t st,
EnergyCorrections::WhichCorrection_t  whichCor
 

Definition at line 838 of file EnergyCorrections.cxx.

References CorrectShowerEnergyNear_Cedar(), MasakiNearMay17th(), and MasakiNearMay17thCGScaled().

Referenced by FullyCorrectShowerEnergy().

00841 {
00842    switch(whichCor) {
00843    case EnergyCorrections::kVersion2:
00844       return EnergyCorrections::CorrectShowerEnergyNear_Cedar(energy,st);
00845    case EnergyCorrections::kVersion1:
00846       return EnergyCorrections::MasakiNearMay17th(energy,st);
00847    case EnergyCorrections::kVersion3:
00848    case EnergyCorrections::kDefault:
00849    default:
00850       return EnergyCorrections::MasakiNearMay17thCGScaled(energy,st);
00851    }   
00852    return energy;
00853 }

float EnergyCorrections::SignedMomentumCurvatureCorrectionBirch float  p,
VldContext  vc,
WhichCorrection_t  whichCor
 

Definition at line 965 of file EnergyCorrections.cxx.

Referenced by FullyCorrectSignedMomentumFromCurvature().

00965                                                                                                                          {
00966   // input is the signed momentum (e.g. p/q)
00967   // isdata and det are not used... but maybe in the future
00968   float pcor=p;
00969   if(pcor!=0) {
00970     // correction advertised in 1430-v2, J. Musser
00971     // note: for 1/p < 0   C=1, so correction only matters for mu+
00972     float C = (1.01+0.1*fabs(1/p))/(1.01-0.1*(1/p));
00973     pcor*=(1.0/C);
00974   }
00975   return pcor;
00976 }

float EnergyCorrections::SignedMomentumCurvatureCorrectionCedar float  p,
VldContext  vc,
WhichCorrection_t  whichCor
 

Definition at line 1004 of file EnergyCorrections.cxx.

References MAXMSG.

Referenced by FullyCorrectSignedMomentumFromCurvature().

01005 {
01006   MAXMSG("DataUtil",Msg::kInfo,1)
01007     << "EnergyCorrections -- Not applying momentum from curvature correction for Cedar\n";
01008   return p;
01009 }

EnergyCorrections::CorrectionVersion_t EnergyCorrections::VersionFromFilename const char *   ) 
 

Definition at line 573 of file EnergyCorrections.cxx.

References CorrectionVersion_t, and s().

00573                                                                                            {
00574   CorrectionVersion_t ver = kUnknown;
00575   std::string s=name;
00576   
00577   if(s.find("R1_18")!=std::string::npos){
00578     ver=EnergyCorrections::kBirch;
00579   }
00580   else if(s.find("cedar")!=std::string::npos){
00581     ver=EnergyCorrections::kCedar;
00582   }
00583   return ver;
00584 }

void EnergyCorrections::WarnUnknownVersion const char *  caller_routine  ) 
 

Definition at line 556 of file EnergyCorrections.cxx.

References GetCorrectionAsString().

Referenced by CorrectMomentumFromRange(), CorrectShowerEnergyFar(), CorrectShowerEnergyNear(), and CorrectSignedMomentumFromCurvature().

00556                                                                     {
00557   static Short_t nwarn=0;
00558   if(nwarn<=9){
00559     std::cerr<<"Energy Corrections: In "<<caller_routine
00560              <<"Energy Corrections: Warning, unknown correction version "
00561              <<GetCorrectionAsString()
00562              <<"Energy Corrections: Defaulting to Birch era corrections.\n"
00563              <<"Energy Corrections: Please Call SetCorrectionVersion() in the future.\n"
00564              <<std::endl;
00565     nwarn++;
00566   }
00567   if(nwarn==9){
00568     std::cerr<<"Energy Corrections: last message of this type..."<<std::endl;
00569   }
00570   
00571 }


Variable Documentation

const float EnergyCorrections::cgffBirchDataFD = 1.018 [static]
 

Definition at line 308 of file EnergyCorrections.cxx.

const float EnergyCorrections::cgffCedarPhyDataFD = 0.9988 [static]
 

Definition at line 312 of file EnergyCorrections.cxx.

const float EnergyCorrections::cgffCedarPhyDataFDOld = 0.996 [static]
 

Definition at line 319 of file EnergyCorrections.cxx.

const float EnergyCorrections::cgffCedarPhyDataND = 1.0039 [static]
 

Definition at line 313 of file EnergyCorrections.cxx.

const float EnergyCorrections::cgffCedarPhyDataNDOld = 1.003 [static]
 

Definition at line 320 of file EnergyCorrections.cxx.

const float EnergyCorrections::cgffCedarR1_24_1MCFD = (0.001737/0.001786) [static]
 

Definition at line 314 of file EnergyCorrections.cxx.

const float EnergyCorrections::cgffCedarR1_24_1MCFDOld = 0.986 [static]
 

Definition at line 321 of file EnergyCorrections.cxx.

const float EnergyCorrections::cgffCedarR1_24_1MCND = (0.001759/0.001792) [static]
 

Definition at line 315 of file EnergyCorrections.cxx.

const float EnergyCorrections::cgffCedarR1_24_1MCNDOld = 0.994 [static]
 

Definition at line 322 of file EnergyCorrections.cxx.

const float EnergyCorrections::cgffCedarR1_24_2MCFD = cgffCedarR1_24_1MCFD*(0.001786/0.001737) [static]
 

Definition at line 326 of file EnergyCorrections.cxx.

const float EnergyCorrections::cgffCedarR1_24_2MCND = cgffCedarR1_24_1MCND*(0.001792/0.001759) [static]
 

Definition at line 327 of file EnergyCorrections.cxx.

Short_t EnergyCorrections::fSubVersion = 0 [static]
 

Definition at line 530 of file EnergyCorrections.cxx.

Referenced by GetCorrectionAsString(), and SetCorrectionVersion().

CorrectionVersion_t EnergyCorrections::fVersion = EnergyCorrections::kUnknown [static]
 

Definition at line 529 of file EnergyCorrections.cxx.

Referenced by SetCorrectionVersion().


Generated on Thu Nov 1 12:02:15 2007 for loon by  doxygen 1.3.9.1