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, kDogwood }

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 ShowerEnergyCorrectionNearDogwood (float energy, const CandShowerHandle::ShowerType_t &st, EnergyCorrections::WhichCorrection_t whichCor)
float ShowerEnergyCorrectionFarDogwood (float energy, const CandShowerHandle::ShowerType_t &st, EnergyCorrections::WhichCorrection_t whichCor)
float ShowerEnergyCorrectionNearDogwood0 (float energy, const CandShowerHandle::ShowerType_t &st, EnergyCorrections::WhichCorrection_t whichCor)
float ShowerEnergyCorrectionFarDogwood0 (float energy, const CandShowerHandle::ShowerType_t &st, EnergyCorrections::WhichCorrection_t whichCor)
float ShowerEnergyCorrectionNearCedarPhyBhcurve (float energy, const CandShowerHandle::ShowerType_t &st, EnergyCorrections::WhichCorrection_t whichCor)
float ShowerEnergyCorrectionFarCedarPhyBhcurve (float energy, const CandShowerHandle::ShowerType_t &st, EnergyCorrections::WhichCorrection_t whichCor)
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 MasakiNearJune30_2009 (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiFarJune30_2009 (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiNear_forDogwood0 (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiFar_forDogwood0 (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiNearDec15th (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiFarDec15th (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiNearDec15thScaled (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiFarDec15thScaled (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiNearMay17th (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiFarMay17th (float energy, const CandShowerHandle::ShowerType_t &st)
float MasakiNearMay17thScaled (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)
float ShowerEnergyConversionDogwood (float E, VldContext vc)
float WeightedShowerEnergyConversionDogwood (float E, VldContext vc)
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, Detector::Detector_t det=Detector::kNear)
float CorrectEnergyFromRange (float E, bool isdata=true, Detector::Detector_t det=Detector::kNear)
float CorrectSignedMomentumFromCurvature (float p, bool isdata=true, Detector::Detector_t det=Detector::kNear)
float CorrectShowerEnergy (float E, const Detector::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, Detector::Detector_t det=Detector::kNear)
float CorrectSignedMomentumFromCurvature_Birch (float p, bool isdata=true, Detector::Detector_t det=Detector::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, Detector::Detector_t det=Detector::kNear)
float CorrectSignedMomentumFromCurvature_Cedar (float p, bool isdata=true, Detector::Detector_t det=Detector::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

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

Detailed Description

Track Energy/Momentum Correction.

CalibrationGroupEnergyCorrections =================================

This function is called by FullyCorrectShowerEnergy to apply the post processing Calibration Group corrections. It effectively returns a PseudoMEU. Whilst it is possible (and in some cases recommended) to apply these corrections to lower level calibrated quantities, it is important to remember that FullyCorrectShowerEnergy expects uncorrected GeV values from the ntuples.

INPUTS:

OUTPUT:

WhichCorrection_t lookup table Birch -- no effect Cedar ===== kDefault = (MC Only) Drift Correction + Cal Group Fudge Factors (DocDB 3322) kVersion1 = (MC Only) Drift Correction kVersion2 = (MC Only) Drift Correction kVersion3 = (MC Only) Drift Correction + Cal Group Fudge Factors (Summer 2007) kVersion4 = (MC Only) Drift Correction + Cal Group Fudge Factors (Fall 2007) 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.

INPUTS:

OUTPUT:

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 (Summer 2007) + Scaled Masaki 17th May kVersion4 = (MC Only) Drift Correction + Cal Group Fudge Factors (Fall 2007) + Scaled Masaki 17th May kNoCalGroup = Scaled Masaki 17th May Cedar Phy Daikon04 -- Shower =========================== kDefault = Cal Group Fudge Factors + Masaki 15th December kVersion4 = Cal Group Fudge Factors + Scaled Masaki 17th May kNoCalGroup = Masaki 15th December INPUTS:

OUTPUT:

This function is called by FullyCorrectShowerEnergy to apply the post processing Calibration Group corrections. It effectively returns a PseudoMEU. Whilst it is possible (and in some cases recommended) to apply these corrections to lower level calibrated quantities, it is important to remember that FullyCorrectShowerEnergy expects uncorrected GeV values from the ntuples.

INPUTS:

OUTPUT:

WhichCorrection_t lookup table Birch -- no effect Cedar ===== kDefault = (MC Only) Drift Correction + Cal Group Fudge Factors (DocDB 3139) kVersion1 = (MC Only) Drift Correction kVersion2 = (MC Only) Drift Correction kVersion3 = (MC Only) Drift Correction + Cal Group Fudge Factors 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

Expected Corrections to Come: i) Corrections to the ND/FD data and/or MC energy scales for the Cedar/Cedar_phy May 07 box opening

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


Enumeration Type Documentation

Enumerator:
kUnknown 
kBirch 
kCedar 
kDogwood 

Definition at line 375 of file DataUtil/HEAD/EnergyCorrections.h.

00375                                   {
00376     kUnknown,
00377     kBirch,
00378     kCedar,
00379     kDogwood
00380   } CorrectionVersion_t;

Enumerator:
kDefault 
kVersion1 
kVersion2 
kVersion3 
kVersion4 
kVersion5 
kVersion6 
kNoCalGroup 

Definition at line 235 of file DataUtil/HEAD/EnergyCorrections.h.

00235                                 {
00236     kDefault = 0,
00237     kVersion1,
00238     kVersion2,
00239     kVersion3,
00240     kVersion4,
00241     kVersion5,
00242     kVersion6,
00243     kNoCalGroup
00244   } WhichCorrection_t;


Function Documentation

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

Definition at line 404 of file DataUtil/HEAD/EnergyCorrections.cxx.

References ReleaseType::AsString(), cgffBirchDataFD, cgffCedarPhyDataFD, cgffCedarPhyDataFDOld, cgffCedarPhyDataND, cgffCedarPhyDataNDOld, cgffCedarR1_24_1MCFD, cgffCedarR1_24_1MCFDOld, cgffCedarR1_24_1MCND, cgffCedarR1_24_1MCNDOld, cgffCedarR1_24_2MCFD, cgffCedarR1_24_2MCND, Calibrator::CreateCustomCalibrator(), VldContext::GetDetector(), Calibrator::GetDriftCorrected(), ReleaseType::GetRecoInfo(), VldContext::GetSimFlag(), MsgService::GetStream(), MsgService::Instance(), ReleaseType::IsBirch(), ReleaseType::IsCedar(), ReleaseType::IsDaikon(), ReleaseType::kCedarPhy, SimFlag::kData, Detector::kFar, Msg::kFatal, Msg::kInfo, SimFlag::kMC, Detector::kNear, kNoCalGroup, ReleaseType::kR1_24_1, ReleaseType::kR1_24_2, ReleaseType::kR1_24_Cal, kVersion1, kVersion2, kVersion3, Msg::kWarning, MAXMSG, CalScheme::Reset(), CfgPromptConfigurable::Set(), and MsgStream::SetLogLevel().

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

00408 {
00409   //Nb: This function is called by FullyCorrectShowerEnergy, 
00410   //do not use it for CC Shower's
00411   
00412   float retval = E; // Default return value.
00413   
00414   MAXMSG("DataUtil",Msg::kInfo,1)
00415     << "CalibrationGroupEnergyCorrections:: Using Release Type: "
00416     << ReleaseType::AsString(release) << "\tusing correction version: "
00417     << whichCor << "\n";
00418   
00419   static Calibrator* customCalibrator = 0;
00420   if (customCalibrator ==0 ) {
00421     //Initialize. Disable warning that we're about to do something 'tricksy'.
00422     // This tricksyness is just to make a custom instance of the calibrator, so we don't
00423     // interfere with any other custom settings that the user (i.e. Jeff H) is doing
00424     // This is actually pretty safe, if an expert like me (Nathaniel) does it.
00425     MsgService::Instance()->GetStream("Calib")->SetLogLevel(Msg::kFatal);
00426     customCalibrator = Calibrator::CreateCustomCalibrator();
00427 
00428     // Turn off the units we aren't using, just to make them go faster.
00429     // "Speed holes!" -Homer Simpson
00430 
00431     customCalibrator->Set("Thermometer=SimpleCalScheme "
00432                           "PeCalibrator=SimpleCalScheme "
00433                           "LinCalibrator=SimpleCalScheme "
00434                           "StripCalibrator=SimpleCalScheme "
00435                           "AttenCalibrator=SimpleCalScheme "
00436                           "MIPCalibrator=SimpleCalScheme "
00437                           "TimeCalibrator=SimpleCalScheme ");
00438     MsgService::Instance()->GetStream("Calib")->SetLogLevel(Msg::kWarning);
00439   }
00440 
00441   // Get the reconstruction version.
00442   ReleaseType::Release_t recoVers = ReleaseType::GetRecoInfo(release);
00443 
00444   // Fudge #0:
00445   // For PRL-era data, we fudged the FD data by 1.8%
00446   if (ReleaseType::IsBirch(release)
00447       && vc.GetSimFlag()==SimFlag::kData
00448       && vc.GetDetector()==Detector::kFar ) {
00449     MAXMSG("DataUtil",Msg::kInfo,1)
00450       << "EnergyCorrections -- Applying Birch Far Detector Factor ( "
00451       << EnergyCorrections::cgffBirchDataFD << ")\n";
00452     retval = retval*EnergyCorrections::cgffBirchDataFD;
00453   }
00454   
00455   if (ReleaseType::IsCedar(release) && 
00456       whichCor!=EnergyCorrections::kNoCalGroup) {
00457     //
00458     // Fudge #1
00459     // Attempt to remove the MC bug, where the drift decalibration was applied with the wrong sign.
00460     // This is a time-dependent correction which should fix the problem for cedar-daikon MC R1.24.1
00461     // This problem was fixed in R1.24.2 and R1.24.calB, but NOT R1.24.calA.
00462     //
00463     if (ReleaseType::IsCedar(release) && ReleaseType::IsDaikon(release)
00464         && (recoVers < ReleaseType::kR1_24_2 || 
00465             recoVers == ReleaseType::kR1_24_Cal )
00466         && vc.GetSimFlag()==SimFlag::kMC) {
00467       // Removes MC bug where drift correction was applied twice.
00468       // Fix it by de-applying the drift twice.
00469       MAXMSG("DataUtil",Msg::kInfo,1)
00470         << "EnergyCorrections -- Applying Infamous MC Drift Bug Correction\n";
00471       
00472       customCalibrator->Reset(vc);
00473       float drift = customCalibrator->GetDriftCorrected(1.0,PlexStripEndId());
00474       retval = retval / (drift*drift);
00475     }
00476     
00477     // Correction #2
00478     // These are the preliminary final corrections for the June 2007 cc box opening.
00479     // The numbers are taken from DocDB 3139 by Jeff Hartnell and Tingjun Yang
00480     // These are only applied if using the default (or version3) correction
00481     if (!(whichCor==EnergyCorrections::kVersion1 || 
00482           whichCor==EnergyCorrections::kVersion2)) {
00483       
00484       if (vc.GetSimFlag()==SimFlag::kMC) {
00485         //For the Cedar MC we have the following possible datasets:
00486         // i) CedarDaikon -- used in Summer analysis 2007
00487         // ii) CedarPhyDaikon -- reprocessed by batch group over summer 2007
00488         
00489         if (ReleaseType::IsCedar(release) && 
00490             recoVers<=ReleaseType::kR1_24_1) {
00491           //Now here we have two options either use the latest greatest numbers
00492           // or we use the old numbers from the 2007 summer analysis
00493           if (whichCor==kVersion3) {
00494             //Use the old numbers
00495             if (vc.GetDetector()==Detector::kFar) {
00496               MAXMSG("DataUtil",Msg::kInfo,1)
00497                 << "EnergyCorrections -- Applying R_1_24_1 (Summer 2007) Far MC Correction Factor"
00498                 << " (" << EnergyCorrections::cgffCedarR1_24_1MCFDOld << ")\n";
00499               retval*=EnergyCorrections::cgffCedarR1_24_1MCFDOld;
00500             }
00501             else if (vc.GetDetector()==Detector::kNear) {
00502               MAXMSG("DataUtil",Msg::kInfo,1)
00503                 << "EnergyCorrections -- Applying R_1_24_1 (Summer 2007) Near MC Correction Factor"
00504                 << " (" << EnergyCorrections::cgffCedarR1_24_1MCNDOld << ")\n";
00505               retval*=EnergyCorrections::cgffCedarR1_24_1MCNDOld;
00506             }
00507           }
00508           else {
00509             //Use the new numbers
00510             if (vc.GetDetector()==Detector::kFar) {
00511               MAXMSG("DataUtil",Msg::kInfo,1)
00512                 << "EnergyCorrections -- Applying R_1_24_1 (Fall 2007) Far MC Correction Factor"
00513                 << " (" << EnergyCorrections::cgffCedarR1_24_1MCFD << ")\n";
00514               retval*=EnergyCorrections::cgffCedarR1_24_1MCFD;
00515             }
00516             else if (vc.GetDetector()==Detector::kNear) {
00517               MAXMSG("DataUtil",Msg::kInfo,1)
00518                 << "EnergyCorrections -- Applying R_1_24_1 (Fall 2007) Near MC Correction Factor"
00519                 << " (" << EnergyCorrections::cgffCedarR1_24_1MCND << ")\n";
00520               retval*=EnergyCorrections::cgffCedarR1_24_1MCND;
00521             }
00522 
00523           }
00524         }
00525         else if (ReleaseType::IsCedar(release) && 
00526                  recoVers>=ReleaseType::kR1_24_2) {
00527           //Changed because we updated the GevPerMIP number in the MC
00528           // reprocessing. Bloody annoying.
00529           if (vc.GetDetector()==Detector::kFar) {
00530             MAXMSG("DataUtil",Msg::kInfo,1)
00531               << "EnergyCorrections -- Applying R_1_24_2 (Fall 2007) Far MC Correction Factor"
00532               << " (" << EnergyCorrections::cgffCedarR1_24_2MCFD << ")\n";
00533             retval*=EnergyCorrections::cgffCedarR1_24_2MCFD;
00534           }
00535           else if (vc.GetDetector()==Detector::kNear) {
00536             MAXMSG("DataUtil",Msg::kInfo,1)
00537               << "EnergyCorrections -- Applying R_1_24_2 (Fall 2007) Near MC Correction Factor"
00538               << " (" << EnergyCorrections::cgffCedarR1_24_2MCND << ")\n";
00539             retval*=EnergyCorrections::cgffCedarR1_24_2MCND;
00540           }
00541         }
00542       }
00543       else if (vc.GetSimFlag()==SimFlag::kData) {
00544         //Data corrections only available for Cedar_Phy
00545         //Once again we are going to have the option to use the old or
00546         // the new numbers
00547         if (whichCor==kVersion3) {
00548           //Use the old numbers from the Summer 2007 analysis
00549           if (recoVers>=ReleaseType::kCedarPhy) {
00550             if (vc.GetDetector()==Detector::kFar) {
00551               MAXMSG("DataUtil",Msg::kInfo,1)
00552                 << "EnergyCorrections -- Applying CedarPhy (Summer 2007) Far Correction Factor"
00553                 << " (" << EnergyCorrections::cgffCedarPhyDataFDOld << ")\n";
00554               retval*=EnergyCorrections::cgffCedarPhyDataFDOld;
00555             }
00556             else if (vc.GetDetector()==Detector::kNear) {
00557               MAXMSG("DataUtil",Msg::kInfo,1)
00558                 << "EnergyCorrections -- Applying CedarPhy (Summer 2007) Near Correction Factor"
00559                 << " (" << EnergyCorrections::cgffCedarPhyDataNDOld << ")\n";
00560               retval*=EnergyCorrections::cgffCedarPhyDataNDOld;
00561             }
00562           }
00563         }
00564         else {
00565           //Use the latest greatest numbers
00566           if (recoVers>=ReleaseType::kCedarPhy) {
00567             if (vc.GetDetector()==Detector::kFar) {
00568               MAXMSG("DataUtil",Msg::kInfo,1)
00569                 << "EnergyCorrections -- Applying CedarPhy (Fall 2007) Far Correction Factor"
00570                 << " (" << EnergyCorrections::cgffCedarPhyDataFD << ")\n";
00571               retval*=EnergyCorrections::cgffCedarPhyDataFD;
00572             }
00573             else if (vc.GetDetector()==Detector::kNear) {
00574               MAXMSG("DataUtil",Msg::kInfo,1)
00575                 << "EnergyCorrections -- Applying CedarPhy (Fall 2007) Near Correction Factor"
00576                 << " (" << EnergyCorrections::cgffCedarPhyDataND << ")\n";
00577               retval*=EnergyCorrections::cgffCedarPhyDataND;
00578             }
00579           }
00580         }
00581       }
00582     }
00583   }
00584 
00585   return retval;
00586 }

float EnergyCorrections::CorrectEnergyFromRange ( float  E,
bool  isdata = true,
Detector::Detector_t  det = Detector::kNear 
)

Definition at line 781 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CorrectMomentumFromRange(), and Munits::m.

00782 {
00783   const float m=0.1057;// mon mass
00784   float p = sqrt(E*E -m*m);
00785   float pcor = CorrectMomentumFromRange(p,isdata,det);
00786   return sqrt(pcor*pcor +m*m);
00787 }

float EnergyCorrections::CorrectMomentumFromRange ( float  p,
bool  isdata = true,
Detector::Detector_t  det = Detector::kNear 
)
float EnergyCorrections::CorrectMomentumFromRange_Birch ( float  p,
bool  isdata = true,
Detector::Detector_t  det = Detector::kNear 
)

Definition at line 870 of file DataUtil/HEAD/EnergyCorrections.cxx.

References Detector::kFar, and Detector::kNear.

Referenced by CorrectMomentumFromRange().

00872 {
00873   static const float c[4]={1.01334,0.05563,-0.05346,0.01205};
00874 
00875   // correction for difference in data mc steel density
00876   if (isdata){
00877     // inital correction, pre-Oxford 2006
00878     //static const float dcor=7.755/7.87;// data/mc density
00879     float dcor=1;
00880     if (det==Detector::kNear) dcor=(7.85*2.563)/(7.87*2.54);
00881     else if (det==Detector::kFar) dcor=(7.85*2.558)/(7.87*2.54);
00882 
00883     p*=dcor;
00884   }
00885   //
00886   float pcor=p/(c[0] + c[1]*log(p) + c[2]*pow(log(p), 2) + c[3]*pow(log(p),3));
00887   return pcor;
00888 }

float EnergyCorrections::CorrectMomentumFromRange_Cedar ( float  p,
bool  isdata = true,
Detector::Detector_t  det = Detector::kNear 
)

Definition at line 963 of file DataUtil/HEAD/EnergyCorrections.cxx.

Referenced by CorrectMomentumFromRange().

00964 {
00965   return p;
00966 }

float EnergyCorrections::CorrectShowerEnergy ( float  E,
const Detector::Detector_t det,
const CandShowerHandle::ShowerType_t st,
int  mode = 1,
bool  isdata = true 
)

Definition at line 851 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CorrectShowerEnergyFar(), CorrectShowerEnergyNear(), Detector::kFar, and Detector::kNear.

Referenced by MadScanDisplay::Display(), MadEvDisplay::DrawTextBox(), MadScanDisplay::DrawTextBox(), NtpTools::FillRecoEInfo(), NCAnalysisCuts::IsGoodShower(), ANtpShowerInfoAna::RecoShwEnergy(), and MadMKAnalysis::RecoShwEnergy().

00855 {
00856   //People should not be using this function
00857   float ecor=E;
00858   if (det==Detector::kNear) {
00859     ecor = CorrectShowerEnergyNear(E,st,mode,isdata);
00860   }
00861   else if (det==Detector::kFar) {
00862     ecor = CorrectShowerEnergyFar(E,st,mode,isdata);
00863   }
00864 
00865   return ecor;
00866 }

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

Definition at line 813 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CorrectShowerEnergyFar_Birch(), CorrectShowerEnergyFar_Cedar(), fVersion, kBirch, kCedar, kUnknown, and WarnUnknownVersion().

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

00814 {
00815   //People should not be using this function
00816 
00817   float ecor=E;
00818   switch(fVersion){
00819   case kCedar:
00820     ecor=CorrectShowerEnergyFar_Cedar(E,st,mode,isdata);
00821     break;
00822   case kBirch:
00823     if (isdata) {
00824       // a correction for the FD MIP scale
00825       // for the beam data, one measured MIP
00826       // actually corresponds to 1.018 MIPs
00827       // so we must correct shower energy up
00828       const float mip_scale_correction=1.018;
00829       E*=mip_scale_correction;
00830     }
00831     ecor=CorrectShowerEnergyFar_Birch(E,st,mode,isdata);
00832     break;
00833   case kUnknown:
00834   default:
00835     WarnUnknownVersion("CorrectShowerEnergyFar()");
00836     if (isdata) {
00837       // a correction for the FD MIP scale
00838       // for the beam data, one measured MIP
00839       // actually corresponds to 1.018 MIPs
00840       // so we must correct shower energy up
00841       const float mip_scale_correction=1.018;
00842       E*=mip_scale_correction;
00843     }
00844     ecor=CorrectShowerEnergyFar_Birch(E,st,mode,isdata);
00845     break;
00846   }
00847   return ecor;
00848 
00849 }

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

Definition at line 932 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, and CandShowerHandle::kWtCC.

Referenced by CorrectShowerEnergyFar(), and FullyCorrectShowerEnergy().

00933 {
00934   //   std::cout << "CorrectShowerEnergyFar_Birch: " << E << std::endl;
00935   float ecor=E;
00936   if (st==CandShowerHandle::kCC){
00937     if (mode==1){
00938       // Niki Correction
00939       ecor=((E)*(1.-0.12*exp(-0.12*E)));
00940     }
00941     else if (mode==2){
00942       // Andy Correction
00943       //     ecor=(E)*(1.-0.2*exp(-0.2*E));
00944       ecor=E*(0.99-0.035*E*exp(-0.25*E));
00945     }
00946   }
00947   else if (st==CandShowerHandle::kWtCC){
00948     if (mode==1){
00949       // Niki Correction
00950       ecor=((E)*(1.+0.18*exp(-0.35*E)));
00951     }
00952     else if (mode==2){
00953       // Andy Correction
00954       E=ecor;
00955     }
00956   }
00957   return ecor;
00958 }

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

Definition at line 985 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, and CandShowerHandle::kWtCC.

Referenced by CorrectShowerEnergyFar(), and ShowerEnergyCorrectionFarCedar().

00986 {
00987   float ecor=E;
00988   if (st==CandShowerHandle::kCC){
00989     ecor = ecor*(0.950+0.277*exp(-ecor*1.64));
00990   }
00991   else if (st==CandShowerHandle::kWtCC){
00992     ecor = ecor*(0.957+0.271*exp(-ecor*1.64));
00993   }
00994   return ecor;
00995 }

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

Definition at line 790 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CorrectShowerEnergyNear_Birch(), CorrectShowerEnergyNear_Cedar(), fVersion, kBirch, kCedar, kUnknown, and WarnUnknownVersion().

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

00791 {
00792   //People should not be using this function
00793 
00794   float ecor=E;
00795   switch(fVersion){
00796   case kCedar:
00797     ecor=CorrectShowerEnergyNear_Cedar(E,st,mode,isdata);
00798     break;
00799   case kBirch:
00800     ecor=CorrectShowerEnergyNear_Birch(E,st,mode,isdata);
00801     break;
00802   case kUnknown:
00803   default:
00804     WarnUnknownVersion("CorrectShowerEnergyNear()");
00805     ecor=CorrectShowerEnergyNear_Birch(E,st,mode,isdata);
00806     break;
00807   }
00808   return ecor;
00809 }

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

Definition at line 904 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, and CandShowerHandle::kWtCC.

Referenced by CorrectShowerEnergyNear(), and FullyCorrectShowerEnergy().

00905 {
00906 
00907   //   std::cout << "CorrectShowerEnergyNear_Birch: " << E << "\t" << mode <<  std::endl;
00908   float ecor=E;
00909   if (st==CandShowerHandle::kCC){
00910     if (mode==1){
00911       // Niki Correction
00912       ecor=E/1.18;
00913     }
00914     else if (mode==2){
00915       // Andy Correction
00916       ecor=((E/1.05)*(1.-0.35*exp(-0.18*E/1.06)));
00917     }
00918   }
00919   else if (st==CandShowerHandle::kWtCC){
00920     if (mode==1){
00921       // Niki Correction
00922       ecor=((E)*(1.+0.50*exp(-1.00*E)));
00923     }
00924     else if (mode==2){
00925       // Andy Correction
00926       ecor=E/1.03;
00927     }
00928   }
00929   return ecor;
00930 }

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

Definition at line 973 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, and CandShowerHandle::kWtCC.

Referenced by CorrectShowerEnergyNear(), and ShowerEnergyCorrectionNearCedar().

00974 {
00975   float ecor=E;
00976   if (st==CandShowerHandle::kCC){
00977     ecor = ecor*(0.921+0.231*exp(-ecor*1.63));
00978   }
00979   else if (st==CandShowerHandle::kWtCC){
00980     ecor = ecor*(0.924+0.235*exp(-ecor*1.63));
00981   }
00982   return ecor;
00983 }

float EnergyCorrections::CorrectSignedMomentumFromCurvature ( float  p,
bool  isdata = true,
Detector::Detector_t  det = Detector::kNear 
)

Definition at line 758 of file DataUtil/HEAD/EnergyCorrections.cxx.

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

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

00761 {
00762 
00763   float pcor=p;
00764   switch(fVersion){
00765   case kCedar:
00766     pcor=CorrectSignedMomentumFromCurvature_Cedar(p,isdata,det);
00767     break;
00768   case kBirch:
00769     pcor=CorrectSignedMomentumFromCurvature_Birch(p,isdata,det);
00770     break;
00771   case kUnknown:
00772   default:
00773     WarnUnknownVersion("CorrectSignedMomentumFromCurvature()");
00774     pcor=CorrectSignedMomentumFromCurvature_Birch(p,isdata,det);
00775     break;
00776   }
00777   return pcor;
00778 }

float EnergyCorrections::CorrectSignedMomentumFromCurvature_Birch ( float  p,
bool  isdata = true,
Detector::Detector_t  det = Detector::kNear 
)

Definition at line 890 of file DataUtil/HEAD/EnergyCorrections.cxx.

Referenced by CorrectSignedMomentumFromCurvature().

00891 {
00892   // input is the signed momentum (e.g. p/q)
00893   // isdata and det are not used... but maybe in the future
00894   float pcor=p;
00895   if (pcor!=0) {
00896     // correction advertised in 1430-v2, J. Musser
00897     // note: for 1/p < 0   C=1, so correction only matters for mu+
00898     float C = (1.01+0.1*fabs(1/p))/(1.01-0.1*(1/p));
00899     pcor*=(1.0/C);
00900   }
00901   return pcor;
00902 }

float EnergyCorrections::CorrectSignedMomentumFromCurvature_Cedar ( float  p,
bool  isdata = true,
Detector::Detector_t  det = Detector::kNear 
)

Definition at line 968 of file DataUtil/HEAD/EnergyCorrections.cxx.

Referenced by CorrectSignedMomentumFromCurvature().

00969 {
00970   return p;
00971 }

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

Definition at line 1410 of file DataUtil/HEAD/EnergyCorrections.cxx.

References VldContext::GetDetector(), VldContext::GetSimFlag(), SimFlag::kData, Msg::kInfo, Detector::kNear, and MAXMSG.

Referenced by FullyCorrectEnergyFromRange(), and MomentumRangeCorrectionCedar().

01411 {
01412   MAXMSG("DataUtil",Msg::kInfo,1)
01413     << "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";
01414   float eCor=E;
01415   if (vc.GetSimFlag()==SimFlag::kData && vc.GetDetector()==Detector::kNear) {
01416     eCor=(1.018*E)-0.009;
01417   }
01418   else {
01419     eCor=(1.010*E)-0.009;
01420   }
01421 
01422   return eCor;
01423 }

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

Definition at line 289 of file DataUtil/HEAD/EnergyCorrections.cxx.

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

00293 {
00294   if (ReleaseType::IsBirch(release)) {
00295     const float m=0.1057;// muon mass
00296     float p = sqrt(E*E -m*m);
00297     float pcor = EnergyCorrections::FullyCorrectMomentumFromRange(p,vc,release,whichCor);
00298     return sqrt(pcor*pcor +m*m);
00299   }
00300   else if (ReleaseType::IsCedar(release)) {
00301     return EnergyCorrections::EnergyRangeCorrectionCedar(E,vc,whichCor);
00302   }
00303   return E;
00304 }

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 273 of file DataUtil/HEAD/EnergyCorrections.cxx.

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

Referenced by MNtpModule::Ana(), MuonRemovalInfoAna::Analyze(), MadTVAnalysis::CreatePAN(), FullyCorrectEnergyFromRange(), NCEventInfo::GetTrackEnergy(), NuReco::GetTrackEnergyFromRangeCor(), MergeEvent::Reco(), ANtpTrackInfoAna::RecoMuEnergyNew(), MadQuantities::RecoMuEnergyNew(), and Anp::FillTrack::Run().

00277 {
00278   float pcor=p;
00279   if (ReleaseType::IsBirch(release)) {
00280     pcor=EnergyCorrections::MomentumRangeCorrectionBirch(p,vc,whichCor);
00281   }
00282   else if (ReleaseType::IsCedar(release)) {
00283     pcor=EnergyCorrections::MomentumRangeCorrectionCedar(p,vc,whichCor);
00284   }
00285   return pcor;
00286 
00287 }

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 195 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CalibrationGroupEnergyCorrections(), CorrectShowerEnergyFar_Birch(), CorrectShowerEnergyNear_Birch(), VldContext::GetDetector(), ReleaseType::GetRecoInfo(), ReleaseType::IsBirch(), ReleaseType::IsCedar(), ReleaseType::IsDogwood(), Detector::kFar, Detector::kNear, ReleaseType::kR1_24_3, kVersion2, mode, ShowerEnergyCorrectionFarCedar(), ShowerEnergyCorrectionFarCedarPhyBhcurve(), ShowerEnergyCorrectionFarDogwood(), ShowerEnergyCorrectionNearCedar(), ShowerEnergyCorrectionNearCedarPhyBhcurve(), and ShowerEnergyCorrectionNearDogwood().

Referenced by MNtpModule::Ana(), MuonRemovalInfoAna::Analyze(), NCEventInfo::GetShowerEnergy(), NuReco::GetShowerEnergyCor(), ANtpShowerInfoAna::RecoShwEnergyNew(), MadQuantities::RecoShwEnergyNew(), Anp::FillShower::Run(), and Anp::FillEnergy::Run().

00200 {
00201   
00202   //First step is to apply Calibration Group Corrections
00203   float eCor=EnergyCorrections::CalibrationGroupEnergyCorrections(E,vc,release,whichCor);
00204   
00205   // Get the reconstruction version.
00206   ReleaseType::Release_t recoVers = ReleaseType::GetRecoInfo(release);
00207 
00208   //Now need to apply Masaki's correction
00209   if (ReleaseType::IsBirch(release)) {
00210     int mode=1;
00211     if (whichCor==EnergyCorrections::kVersion2)
00212       mode=2;
00213     if (vc.GetDetector()==Detector::kNear)
00214       return EnergyCorrections::CorrectShowerEnergyNear_Birch(eCor,st,mode);
00215     else if (vc.GetDetector()==Detector::kFar)
00216       return EnergyCorrections::CorrectShowerEnergyFar_Birch(eCor,st,mode);
00217 
00218   }
00219   else if (ReleaseType::IsCedar(release)) {
00220     //Now need to check version
00221     if (recoVers >= ReleaseType::kR1_24_3) {
00222       if (vc.GetDetector()==Detector::kNear) {
00223         return EnergyCorrections::ShowerEnergyCorrectionNearCedarPhyBhcurve
00224           (eCor,st,whichCor);
00225       }
00226       else if (vc.GetDetector()==Detector::kFar) {
00227         return EnergyCorrections::ShowerEnergyCorrectionFarCedarPhyBhcurve
00228           (eCor,st,whichCor);
00229       }
00230     }
00231     else {
00232       if (vc.GetDetector()==Detector::kNear) {
00233         return EnergyCorrections::ShowerEnergyCorrectionNearCedar
00234           (eCor,st,whichCor);
00235       }
00236       else if (vc.GetDetector()==Detector::kFar) {
00237         return EnergyCorrections::ShowerEnergyCorrectionFarCedar
00238           (eCor,st,whichCor);
00239       }
00240     }
00241   }
00242   else if (ReleaseType::IsDogwood(release)) {
00243     if (vc.GetDetector()==Detector::kNear) {
00244       return EnergyCorrections::ShowerEnergyCorrectionNearDogwood
00245         (eCor,st,whichCor);
00246     }
00247     else if (vc.GetDetector()==Detector::kFar) {
00248       return EnergyCorrections::ShowerEnergyCorrectionFarDogwood
00249         (eCor,st,whichCor);
00250     }
00251   }
00252 
00253   return E;
00254 }

float EnergyCorrections::FullyCorrectSignedMomentumFromCurvature ( float  p,
VldContext  vc,
ReleaseType::Release_t  release,
EnergyCorrections::WhichCorrection_t  whichCor = EnergyCorrections::kDefault 
)
std::string EnergyCorrections::GetCorrectionAsString (  ) 

Definition at line 685 of file DataUtil/HEAD/EnergyCorrections.cxx.

References fSubVersion, fVersion, kBirch, kCedar, and kUnknown.

Referenced by WarnUnknownVersion().

00686 {
00687   std::string s;
00688   switch(fVersion){
00689   case kBirch:
00690     s+="BIRCH"; break;
00691   case kCedar:
00692     s+="CEDAR"; break;
00693   case kUnknown:
00694   default:
00695     s+="???";
00696     break;
00697   }
00698   std::ostringstream os; os<<"-v"<<fSubVersion<<std::ends;
00699   s+=os.str();
00700 
00701   return s;
00702 }

float EnergyCorrections::MasakiFar_forDogwood0 ( float  energy,
const CandShowerHandle::ShowerType_t st 
)

Definition at line 1187 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

Referenced by ShowerEnergyCorrectionFarDogwood0().

01189 {
01190   MAXMSG("DataUtil",Msg::kInfo,1)
01191     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Far Detector Dogwood0\n";
01192   float recoE=energy;
01193   float le = log10(fmin(fmax(energy,0.3),20));
01194   float we=0;
01195   if (st==CandShowerHandle::kCC){
01196     recoE = energy*(1.02473 + 0.0429276*le + -0.016319*(2.*pow(le,2)-1) + -0.000380156*(4.*pow(le,3)-3.*le));
01197   }
01198   //Warning: weight shower energy is not used after Cedar_phy_bhcurv                                                                                         
01199   else if (st==CandShowerHandle::kWtCC) {
01200     we = fmin(fmax(energy,0.3),20);
01201     recoE= energy*(1.02473 + 0.0429276*le + -0.016319*(2.*pow(le,2)-1) + -0.000380156*(4.*pow(le,3)-3.*le));
01202   }
01203   return recoE;
01204 }

float EnergyCorrections::MasakiFarDec15th ( float  energy,
const CandShowerHandle::ShowerType_t st 
)

Definition at line 1228 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

Referenced by ShowerEnergyCorrectionFarCedarPhyBhcurve().

01230 {
01231   //From DocDB 3077_v3
01232   MAXMSG("DataUtil",Msg::kInfo,1)
01233     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Far Detector from DocDB 3895_v4\n";
01234   float recoE=energy;
01235   float le = log10(fmin(fmax(energy,0.3),20));
01236   float we=0;
01237   if (st==CandShowerHandle::kCC){
01238     recoE = energy*( 1.15566-0.286445*le+ 0.122705*(2.*pow(le,2)-1)-0.0183855*(4.*pow(le,3)-3.*le));
01239   }
01240   else if (st==CandShowerHandle::kWtCC) {
01241     we = fmin(fmax(energy,0.3),20);
01242     recoE= energy*(0.971346+0.00314063*we-0.000135242*pow(we,2)+0.626512*TMath::Exp(-we*3.26053));
01243   }
01244   return recoE;
01245 }

float EnergyCorrections::MasakiFarDec15thScaled ( float  energy,
const CandShowerHandle::ShowerType_t st 
)

Definition at line 1269 of file DataUtil/HEAD/EnergyCorrections.cxx.

References cgffCedarPhyDaikonFD, CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

01271 {
01272   //From DocDB 3077_v3
01273   MAXMSG("DataUtil",Msg::kInfo,1)
01274     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Far Detector from DocDB 3895_v4\n";
01275   float tempE=energy/EnergyCorrections::cgffCedarPhyDaikonFD;
01276   float recoE=tempE;
01277   float le = log10(fmin(fmax(tempE,0.3),20));
01278   float we=0;
01279   if (st==CandShowerHandle::kCC){
01280     recoE = tempE*( 1.15566-0.286445*le+ 0.122705*(2.*pow(le,2)-1)-0.0183855*(4.*pow(le,3)-3.*le));
01281   }
01282   else if (st==CandShowerHandle::kWtCC) {
01283     we = fmin(fmax(energy,0.3),20);
01284     recoE= energy*(0.971346+0.00314063*we-0.000135242*pow(we,2)+0.626512*TMath::Exp(-we*3.26053));
01285   }
01286   return recoE;
01287 }

float EnergyCorrections::MasakiFarJune30_2009 ( float  energy,
const CandShowerHandle::ShowerType_t st 
)

Definition at line 1148 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

Referenced by ShowerEnergyCorrectionFarDogwood().

01150 {
01151   MAXMSG("DataUtil",Msg::kInfo,1)
01152     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Far Detector from DocDB XXXX_v4\n";
01153   float recoE=energy;
01154   float le = log10(fmin(fmax(energy,0.3),20));
01155   float we=0;
01156   if (st==CandShowerHandle::kCC){
01157     recoE = energy*(1.01397 + 0.0646697*le -0.0258817*(2.*pow(le,2)-1) + 0.00117583*(4.*pow(le,3)-3.*le));
01158   }
01159   //Warning: weight shower energy is not used after Cedar_phy_bhcurv
01160   else if (st==CandShowerHandle::kWtCC) {
01161     we = fmin(fmax(energy,0.3),20);
01162     recoE= energy*(1.01397 + 0.0646697*le -0.0258817*(2.*pow(le,2)-1) + 0.00117583*(4.*pow(le,3)-3.*le));
01163   }
01164   return recoE;
01165 }

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

Definition at line 1307 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

Referenced by ShowerEnergyCorrectionFarCedar().

01309 {
01310   //From DocDB 3077_v3
01311   MAXMSG("DataUtil",Msg::kInfo,1)
01312     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Far Detector from DocDB 3077_v3\n";
01313   float recoE=energy;
01314   //   std::cout << "Old:\t" << recoE << std::endl;
01315   float le = log10(fmax(energy,0.2));
01316   if (st==CandShowerHandle::kCC){
01317     recoE = energy*(1.113584-0.299139*le+0.145169*(2.*pow(le,2)-1)-0.0232853*(4.*pow(le,3)-3.*le));
01318   }
01319   else if (st==CandShowerHandle::kWtCC){
01320     recoE= energy*(1.052872-0.19185*le+0.102449*(2.*pow(le,2)-1)-0.0182317*(4.*pow(le,3)-3.*le));
01321   }
01322   return recoE;
01323 }

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

Definition at line 1346 of file DataUtil/HEAD/EnergyCorrections.cxx.

References cgffCedarR1_24_1MCFD, CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

Referenced by ShowerEnergyCorrectionFarCedar(), and ShowerEnergyCorrectionFarCedarPhyBhcurve().

01348 {
01349   //From DocDB 3077_v3
01350   MAXMSG("DataUtil",Msg::kInfo,1)
01351     << "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";
01352   float tempE=energy/EnergyCorrections::cgffCedarR1_24_1MCFD;
01353   float recoE=tempE;
01354   //   std::cout <<  "New:\t" <<recoE << std::endl;
01355   float le = log10(fmax(tempE,0.2));
01356   if (st==CandShowerHandle::kCC){
01357     recoE = tempE*(1.113584-0.299139*le+0.145169*(2.*pow(le,2)-1)-0.0232853*(4.*pow(le,3)-3.*le));
01358   }
01359   else if (st==CandShowerHandle::kWtCC){
01360     recoE= tempE*(1.052872-0.19185*le+0.102449*(2.*pow(le,2)-1)-0.0182317*(4.*pow(le,3)-3.*le));
01361   }
01362   return recoE;
01363 }

float EnergyCorrections::MasakiNear_forDogwood0 ( float  energy,
const CandShowerHandle::ShowerType_t st 
)

Definition at line 1168 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

Referenced by ShowerEnergyCorrectionNearDogwood0().

01170 {
01171   MAXMSG("DataUtil",Msg::kInfo,1)
01172     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Near Detector Dogwood0\n";
01173   float recoE=energy;
01174   float le = log10(fmin(fmax(energy,0.3),20));
01175   float we=0;
01176   if (st==CandShowerHandle::kCC){
01177     recoE = energy*(0.978739 + 0.156093*le + -0.0608388*(2.*pow(le,2)-1) + 0.00818386*(4.*pow(le,3)-3.*le));
01178   }
01179   //Warning: weight shower energy is not used after Cedar_phy_bhcurv                                                                                         
01180   else if (st==CandShowerHandle::kWtCC) {
01181     we = fmin(fmax(energy,0.3),20);
01182     recoE = energy*(0.978739 + 0.156093*le + -0.0608388*(2.*pow(le,2)-1) + 0.00818386*(4.*pow(le,3)-3.*le));
01183   }
01184   return recoE;
01185 }

float EnergyCorrections::MasakiNearDec15th ( float  energy,
const CandShowerHandle::ShowerType_t st 
)

Definition at line 1209 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

Referenced by ShowerEnergyCorrectionNearCedarPhyBhcurve().

01211 {
01212   //From DocDB 3077_v3
01213   MAXMSG("DataUtil",Msg::kInfo,1)
01214     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Near Detector from DocDB 3895_v4\n";
01215   float recoE=energy;
01216   float le = log10(fmin(fmax(energy,0.3),20));
01217   float we=0;
01218   if (st==CandShowerHandle::kCC){
01219     recoE = energy*(1.10973-0.248714*le +0.116769*(2.*pow(le,2)-1)-0.0200268*(4.*pow(le,3)-3.*le));
01220   }
01221   else if (st==CandShowerHandle::kWtCC) {
01222     we = fmin(fmax(energy,0.3),20);
01223     recoE= energy*(0.999461-0.00334628*we+0.0000563316*pow(we,2)+0.35232*TMath::Exp(-we*1.76594));
01224   }
01225   return recoE;
01226 }

float EnergyCorrections::MasakiNearDec15thScaled ( float  energy,
const CandShowerHandle::ShowerType_t st 
)

Definition at line 1249 of file DataUtil/HEAD/EnergyCorrections.cxx.

References cgffCedarPhyDaikonND, CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

01251 {
01252   //From DocDB 3077_v3
01253   MAXMSG("DataUtil",Msg::kInfo,1)
01254     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Near Detector from DocDB 3895_v4\n";
01255   float tempE=energy/EnergyCorrections::cgffCedarPhyDaikonND;
01256   float recoE=tempE;
01257   float le = log10(fmin(fmax(tempE,0.3),20));
01258   float we=0;
01259   if (st==CandShowerHandle::kCC){
01260     recoE = tempE*(1.10973-0.248714*le +0.116769*(2.*pow(le,2)-1)-0.0200268*(4.*pow(le,3)-3.*le));
01261   }
01262   else if (st==CandShowerHandle::kWtCC) {
01263     we = fmin(fmax(energy,0.3),20);
01264     recoE= energy*(0.999461-0.00334628*we+0.0000563316*pow(we,2)+0.35232*TMath::Exp(-we*1.76594));
01265   }
01266   return recoE;
01267 }

float EnergyCorrections::MasakiNearJune30_2009 ( float  energy,
const CandShowerHandle::ShowerType_t st 
)

Definition at line 1128 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

Referenced by ShowerEnergyCorrectionNearDogwood().

01130 {
01131   MAXMSG("DataUtil",Msg::kInfo,1)
01132     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Near Detector from DocDB XXXX_v4\n";
01133   float recoE=energy;
01134   float le = log10(fmin(fmax(energy,0.3),20));
01135   float we=0;
01136   if (st==CandShowerHandle::kCC){
01137     recoE = energy*(0.96922+0.175773*le -0.0684406*(2.*pow(le,2)-1)+0.00940122*(4.*pow(le,3)-3.*le));
01138   }
01139   //Warning: weight shower energy is not used after Cedar_phy_bhcurv
01140   else if (st==CandShowerHandle::kWtCC) {
01141     we = fmin(fmax(energy,0.3),20);
01142     recoE = energy*(0.96922+0.175773*le -0.0684406*(2.*pow(le,2)-1)+0.00940122*(4.*pow(le,3)-3.*le));
01143   }
01144   return recoE;
01145 }

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

Definition at line 1290 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

Referenced by ShowerEnergyCorrectionNearCedar().

01292 {
01293   //From DocDB 3077_v3
01294   MAXMSG("DataUtil",Msg::kInfo,1)
01295     << "EnergyCorrections -- Applying Masaki (Reco to True) Correction for Near Detector from DocDB 3077_v3\n";
01296   float recoE=energy;
01297   float le = log10(fmax(energy,0.2));
01298   if (st==CandShowerHandle::kCC){
01299     recoE = energy*(1.078984-0.249843*le+0.134518*(2.*pow(le,2)-1)-0.025613*(4.*pow(le,3)-3.*le));
01300   }
01301   else if (st==CandShowerHandle::kWtCC) {
01302     recoE= energy*(1.070553-0.207148*le+0.0943124*(2.*pow(le,2)-1)-0.0153231*(4.*pow(le,3)-3.*le));
01303   }
01304   return recoE;
01305 }

float EnergyCorrections::MasakiNearMay17thScaled ( float  energy,
const CandShowerHandle::ShowerType_t st 
)

Definition at line 1327 of file DataUtil/HEAD/EnergyCorrections.cxx.

References cgffCedarR1_24_1MCND, CandShowerHandle::kCC, Msg::kInfo, CandShowerHandle::kWtCC, and MAXMSG.

Referenced by ShowerEnergyCorrectionNearCedar(), and ShowerEnergyCorrectionNearCedarPhyBhcurve().

01329 {
01330   //From DocDB 3077_v3
01331   MAXMSG("DataUtil",Msg::kInfo,1)
01332     << "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";
01333   float tempE=energy/EnergyCorrections::cgffCedarR1_24_1MCND;
01334   float recoE=tempE;
01335   float le = log10(fmax(tempE,0.2));
01336   if (st==CandShowerHandle::kCC){
01337     recoE = tempE*(1.078984-0.249843*le+0.134518*(2.*pow(le,2)-1)-0.025613*(4.*pow(le,3)-3.*le));
01338   }
01339   else if (st==CandShowerHandle::kWtCC) {
01340     recoE= tempE*(1.070553-0.207148*le+0.0943124*(2.*pow(le,2)-1)-0.0153231*(4.*pow(le,3)-3.*le));
01341   }
01342   return recoE;
01343 }

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

Definition at line 1367 of file DataUtil/HEAD/EnergyCorrections.cxx.

References VldContext::GetDetector(), VldContext::GetSimFlag(), SimFlag::kData, Detector::kFar, and Detector::kNear.

Referenced by FullyCorrectMomentumFromRange().

01368 {
01369   static const float c[4]={1.01334,0.05563,-0.05346,0.01205};
01370 
01371   // correction for difference in data mc steel density
01372   if (vc.GetSimFlag()==SimFlag::kData){
01373     // inital correction, pre-Oxford 2006
01374     //static const float dcor=7.755/7.87;// data/mc density
01375     float dcor=1;
01376     if (vc.GetDetector()==Detector::kNear) dcor=(7.85*2.563)/(7.87*2.54);
01377     else if (vc.GetDetector()==Detector::kFar) dcor=(7.85*2.558)/(7.87*2.54);
01378 
01379     p*=dcor;
01380   }
01381   //
01382   float pcor=p/(c[0] + c[1]*log(p) + c[2]*pow(log(p), 2) + c[3]*pow(log(p),3));
01383   return pcor;
01384 }

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

Definition at line 1401 of file DataUtil/HEAD/EnergyCorrections.cxx.

References EnergyRangeCorrectionCedar(), and Munits::m.

Referenced by FullyCorrectMomentumFromRange().

01402 {
01403   //return p;
01404   const float m=0.1057;// muon mass
01405   float E = sqrt(p*p+m*m);
01406   float eCor = EnergyCorrections::EnergyRangeCorrectionCedar(E,vc,whichCor);
01407   return sqrt(eCor*eCor-m*m);
01408 }

void EnergyCorrections::SetCorrectionVersion ( const CorrectionVersion_t &  ver,
Short_t  subver = 0 
)
float EnergyCorrections::ShowerEnergyConversionDogwood ( float  E,
VldContext  vc 
)

Definition at line 596 of file DataUtil/HEAD/EnergyCorrections.cxx.

References cgffDogwood1DaikonFD, cgffDogwood1DaikonND, cgffDogwood1DataFD, cgffDogwood1DataND, VldContext::GetDetector(), VldContext::GetSimFlag(), CandShowerHandle::kCC, SimFlag::kData, kDefault, Detector::kFar, SimFlag::kMC, Detector::kNear, ShowerEnergyCorrectionFarDogwood(), and ShowerEnergyCorrectionNearDogwood().

00597 {
00598   //Two things to do:
00599   //i) apply Calibration Group tweaks
00600   //ii) apply Maskai's Reco->Truth formula
00601   float eCor=E;
00602   if (vc.GetDetector()==Detector::kFar) {
00603     //Cal group corrections
00604     if (vc.GetSimFlag()==SimFlag::kData) {
00605       eCor*=EnergyCorrections::cgffDogwood1DataFD;
00606     }
00607     else if (vc.GetSimFlag()==SimFlag::kMC) {
00608       eCor*=EnergyCorrections::cgffDogwood1DaikonFD;
00609     }
00610     //Reco-Truth Conversion
00611     eCor=EnergyCorrections::ShowerEnergyCorrectionFarDogwood(eCor,CandShowerHandle::kCC,EnergyCorrections::kDefault);
00612   }
00613   else if (vc.GetDetector()==Detector::kNear) {
00614     //Cal group corrections
00615     if (vc.GetSimFlag()==SimFlag::kData) {
00616       eCor*=EnergyCorrections::cgffDogwood1DataND;
00617     }
00618     else if (vc.GetSimFlag()==SimFlag::kMC) {
00619       eCor*=EnergyCorrections::cgffDogwood1DaikonND;
00620     }
00621     //Reco-Truth Conversion
00622     eCor=EnergyCorrections::ShowerEnergyCorrectionNearDogwood(eCor,CandShowerHandle::kCC,EnergyCorrections::kDefault);
00623   }
00624 
00625   return eCor;
00626 
00627 }

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

Definition at line 1107 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CorrectShowerEnergyFar_Cedar(), kDefault, kVersion1, kVersion2, kVersion3, MasakiFarMay17th(), and MasakiFarMay17thScaled().

Referenced by FullyCorrectShowerEnergy().

01110 {
01111   switch(whichCor) {
01112   case EnergyCorrections::kVersion2:
01113     return EnergyCorrections::CorrectShowerEnergyFar_Cedar(energy,st);
01114   case EnergyCorrections::kVersion1:
01115     return EnergyCorrections::MasakiFarMay17th(energy,st);
01116   case EnergyCorrections::kVersion3:
01117   case EnergyCorrections::kDefault:
01118   default:
01119     return EnergyCorrections::MasakiFarMay17thScaled(energy,st);
01120   }
01121   return energy;
01122 }

float EnergyCorrections::ShowerEnergyCorrectionFarCedarPhyBhcurve ( float  energy,
const CandShowerHandle::ShowerType_t st,
EnergyCorrections::WhichCorrection_t  whichCor 
)

Definition at line 1074 of file DataUtil/HEAD/EnergyCorrections.cxx.

References kDefault, kVersion4, MasakiFarDec15th(), and MasakiFarMay17thScaled().

Referenced by FullyCorrectShowerEnergy().

01077 {
01078   switch(whichCor) {
01079   case EnergyCorrections::kVersion4:
01080     return EnergyCorrections::MasakiFarMay17thScaled(energy,st);
01081   case EnergyCorrections::kDefault:
01082   default:
01083     return EnergyCorrections::MasakiFarDec15th(energy,st);
01084   }
01085   return energy;
01086 }

float EnergyCorrections::ShowerEnergyCorrectionFarDogwood ( float  energy,
const CandShowerHandle::ShowerType_t st,
EnergyCorrections::WhichCorrection_t  whichCor 
)

Definition at line 1013 of file DataUtil/HEAD/EnergyCorrections.cxx.

References kDefault, kVersion4, and MasakiFarJune30_2009().

Referenced by FullyCorrectShowerEnergy(), ShowerEnergyConversionDogwood(), and WeightedShowerEnergyConversionDogwood().

01016 {
01017   switch(whichCor) {
01018   case EnergyCorrections::kVersion4:
01019     return EnergyCorrections::MasakiFarJune30_2009(energy,st);
01020   case EnergyCorrections::kDefault:
01021   default:
01022     return EnergyCorrections::MasakiFarJune30_2009(energy,st);
01023   }
01024   return energy;
01025 }

float EnergyCorrections::ShowerEnergyCorrectionFarDogwood0 ( float  energy,
const CandShowerHandle::ShowerType_t st,
EnergyCorrections::WhichCorrection_t  whichCor 
)

Definition at line 1041 of file DataUtil/HEAD/EnergyCorrections.cxx.

References kDefault, kVersion4, and MasakiFar_forDogwood0().

01044 {
01045   switch(whichCor) {
01046   case EnergyCorrections::kVersion4:
01047     return EnergyCorrections::MasakiFar_forDogwood0(energy,st);
01048   case EnergyCorrections::kDefault:
01049   default:
01050     return EnergyCorrections::MasakiFar_forDogwood0(energy,st);
01051   }
01052   return energy;
01053 }

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

Definition at line 1090 of file DataUtil/HEAD/EnergyCorrections.cxx.

References CorrectShowerEnergyNear_Cedar(), kDefault, kVersion1, kVersion2, kVersion3, MasakiNearMay17th(), and MasakiNearMay17thScaled().

Referenced by FullyCorrectShowerEnergy().

01093 {
01094   switch(whichCor) {
01095   case EnergyCorrections::kVersion2:
01096     return EnergyCorrections::CorrectShowerEnergyNear_Cedar(energy,st);
01097   case EnergyCorrections::kVersion1:
01098     return EnergyCorrections::MasakiNearMay17th(energy,st);
01099   case EnergyCorrections::kVersion3:
01100   case EnergyCorrections::kDefault:
01101   default:
01102     return EnergyCorrections::MasakiNearMay17thScaled(energy,st);
01103   }
01104   return energy;
01105 }

float EnergyCorrections::ShowerEnergyCorrectionNearCedarPhyBhcurve ( float  energy,
const CandShowerHandle::ShowerType_t st,
EnergyCorrections::WhichCorrection_t  whichCor 
)

Definition at line 1060 of file DataUtil/HEAD/EnergyCorrections.cxx.

References kDefault, kVersion4, MasakiNearDec15th(), and MasakiNearMay17thScaled().

Referenced by FullyCorrectShowerEnergy().

01063 {
01064   switch(whichCor) {
01065   case EnergyCorrections::kVersion4:
01066     return EnergyCorrections::MasakiNearMay17thScaled(energy,st);
01067   case EnergyCorrections::kDefault:
01068   default:
01069     return EnergyCorrections::MasakiNearDec15th(energy,st);
01070   }
01071   return energy;
01072 }

float EnergyCorrections::ShowerEnergyCorrectionNearDogwood ( float  energy,
const CandShowerHandle::ShowerType_t st,
EnergyCorrections::WhichCorrection_t  whichCor 
)

Definition at line 999 of file DataUtil/HEAD/EnergyCorrections.cxx.

References kDefault, kVersion4, and MasakiNearJune30_2009().

Referenced by FullyCorrectShowerEnergy(), ShowerEnergyConversionDogwood(), and WeightedShowerEnergyConversionDogwood().

01002 {
01003   switch(whichCor) {
01004   case EnergyCorrections::kVersion4:
01005     return EnergyCorrections::MasakiNearJune30_2009(energy,st);
01006   case EnergyCorrections::kDefault:
01007   default:
01008     return EnergyCorrections::MasakiNearJune30_2009(energy,st);
01009   }
01010   return energy;
01011 }

float EnergyCorrections::ShowerEnergyCorrectionNearDogwood0 ( float  energy,
const CandShowerHandle::ShowerType_t st,
EnergyCorrections::WhichCorrection_t  whichCor 
)

Definition at line 1027 of file DataUtil/HEAD/EnergyCorrections.cxx.

References kDefault, kVersion4, and MasakiNear_forDogwood0().

01030 {
01031   switch(whichCor) {
01032   case EnergyCorrections::kVersion4:
01033     return EnergyCorrections::MasakiNear_forDogwood0(energy,st);
01034   case EnergyCorrections::kDefault:
01035   default:
01036     return EnergyCorrections::MasakiNear_forDogwood0(energy,st);
01037   }
01038   return energy;
01039 }

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

Definition at line 1386 of file DataUtil/HEAD/EnergyCorrections.cxx.

Referenced by FullyCorrectSignedMomentumFromCurvature().

01386                                                                                                                          {
01387   // input is the signed momentum (e.g. p/q)
01388   // isdata and det are not used... but maybe in the future
01389   float pcor=p;
01390   if (pcor!=0) {
01391     // correction advertised in 1430-v2, J. Musser
01392     // note: for 1/p < 0   C=1, so correction only matters for mu+
01393     float C = (1.01+0.1*fabs(1/p))/(1.01-0.1*(1/p));
01394     pcor*=(1.0/C);
01395   }
01396   return pcor;
01397 }

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

Definition at line 1425 of file DataUtil/HEAD/EnergyCorrections.cxx.

References Msg::kInfo, and MAXMSG.

Referenced by FullyCorrectSignedMomentumFromCurvature().

01426 {
01427   MAXMSG("DataUtil",Msg::kInfo,1)
01428     << "EnergyCorrections -- Not applying momentum from curvature correction for Cedar\n";
01429   return p;
01430 }

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

Definition at line 722 of file DataUtil/HEAD/EnergyCorrections.cxx.

References kBirch, kCedar, and kUnknown.

00723 {
00724   CorrectionVersion_t ver = kUnknown;
00725   std::string s=name;
00726 
00727   if (s.find("R1_18")!=std::string::npos) {
00728     ver=EnergyCorrections::kBirch;
00729   }
00730   else if (s.find("cedar")!=std::string::npos) {
00731     ver=EnergyCorrections::kCedar;
00732   }
00733   return ver;
00734 }

void EnergyCorrections::WarnUnknownVersion ( const char *  caller_routine  ) 

Definition at line 704 of file DataUtil/HEAD/EnergyCorrections.cxx.

References GetCorrectionAsString().

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

00705 {
00706   static Short_t nwarn=0;
00707   if (nwarn<=9) {
00708     std::cerr<<"Energy Corrections: In "<<caller_routine
00709              <<"Energy Corrections: Warning, unknown correction version "
00710              <<GetCorrectionAsString()
00711              <<"Energy Corrections: Defaulting to Birch era corrections.\n"
00712              <<"Energy Corrections: Please Call SetCorrectionVersion() in the future.\n"
00713              <<std::endl;
00714     nwarn++;
00715   }
00716   if (nwarn==9) {
00717     std::cerr<<"Energy Corrections: last message of this type..."<<std::endl;
00718   }
00719 
00720 }

float EnergyCorrections::WeightedShowerEnergyConversionDogwood ( float  E,
VldContext  vc 
)

Definition at line 634 of file DataUtil/HEAD/EnergyCorrections.cxx.

References cgffDogwood1DaikonFD, cgffDogwood1DaikonND, cgffDogwood1DataFD, cgffDogwood1DataND, VldContext::GetDetector(), VldContext::GetSimFlag(), SimFlag::kData, kDefault, Detector::kFar, SimFlag::kMC, Detector::kNear, CandShowerHandle::kWtCC, ShowerEnergyCorrectionFarDogwood(), and ShowerEnergyCorrectionNearDogwood().

00635 {
00636   //Two things to do:
00637   //i) apply Calibration Group tweaks
00638   //ii) apply Maskai's Reco->Truth formula
00639   float eCor=E;
00640   if (vc.GetDetector()==Detector::kFar) {
00641     //Cal group corrections
00642     if (vc.GetSimFlag()==SimFlag::kData) {
00643       eCor*=EnergyCorrections::cgffDogwood1DataFD;
00644     }
00645     else if (vc.GetSimFlag()==SimFlag::kMC) {
00646       eCor*=EnergyCorrections::cgffDogwood1DaikonFD;
00647     }
00648     //Reco-Truth Conversion
00649     eCor=EnergyCorrections::ShowerEnergyCorrectionFarDogwood(eCor,CandShowerHandle::kWtCC,EnergyCorrections::kDefault);
00650   }
00651   else if (vc.GetDetector()==Detector::kNear) {
00652     //Cal group corrections
00653     if (vc.GetSimFlag()==SimFlag::kData) {
00654       eCor*=EnergyCorrections::cgffDogwood1DataND;
00655     }
00656     else if (vc.GetSimFlag()==SimFlag::kMC) {
00657       eCor*=EnergyCorrections::cgffDogwood1DaikonND;
00658     }
00659     //Reco-Truth Conversion
00660     eCor=EnergyCorrections::ShowerEnergyCorrectionNearDogwood(eCor,CandShowerHandle::kWtCC,EnergyCorrections::kDefault);
00661   }
00662 
00663   return eCor;
00664 
00665 }


Variable Documentation

const float EnergyCorrections::cgffBirchDataFD = 1.018 [static]
const float EnergyCorrections::cgffCedarPhyDaikonFD = 1 [static]

Definition at line 394 of file DataUtil/HEAD/EnergyCorrections.cxx.

Referenced by MasakiFarDec15thScaled().

const float EnergyCorrections::cgffCedarPhyDaikonND = 1 [static]

Definition at line 393 of file DataUtil/HEAD/EnergyCorrections.cxx.

Referenced by MasakiNearDec15thScaled().

const float EnergyCorrections::cgffCedarPhyDataFD = 0.9988 [static]
const float EnergyCorrections::cgffCedarPhyDataFDOld = 0.996 [static]
const float EnergyCorrections::cgffCedarPhyDataND = 1.0039 [static]
const float EnergyCorrections::cgffCedarPhyDataNDOld = 1.003 [static]
const float EnergyCorrections::cgffCedarR1_24_1MCFD = (0.001737/0.001786) [static]
const float EnergyCorrections::cgffCedarR1_24_1MCFDOld = 0.986 [static]
const float EnergyCorrections::cgffCedarR1_24_1MCND = (0.001759/0.001792) [static]
const float EnergyCorrections::cgffCedarR1_24_1MCNDOld = 0.994 [static]
const float EnergyCorrections::cgffCedarR1_24_2MCFD = cgffCedarR1_24_1MCFD*(0.001786/0.001737) [static]
const float EnergyCorrections::cgffCedarR1_24_2MCND = cgffCedarR1_24_1MCND*(0.001792/0.001759) [static]
const float EnergyCorrections::cgffDogwood1DaikonFD = 1.0 [static]
const float EnergyCorrections::cgffDogwood1DaikonND = 1.0 [static]
const float EnergyCorrections::cgffDogwood1DataFD = 1.0 [static]
const float EnergyCorrections::cgffDogwood1DataND = 1.0 [static]
Short_t EnergyCorrections::fSubVersion = 0 [static]
CorrectionVersion_t EnergyCorrections::fVersion = EnergyCorrections::kUnknown [static]

Generated on 16 Apr 2018 for loon by  doxygen 1.6.1