NueConvention Namespace Reference

Typedefs

typedef enum
NueConvention::ENueRelease 
NueRel_t

Enumerations

enum  ENueRelease {
  kUnknown = 0x00, kEnt = 0x01, kFirebird = 0x02, kGriffin = 0x03,
  kHydra = 0x04, kImp = 0x05, kJaberwocky = 0x06, kKraken = 0x07,
  kLeviathan = 0x08, kManticore = 0x09
}

Functions

Int_t DetermineClassType (Int_t inu, Int_t inunoosc, Int_t iaction)
int IsInsideNearFiducial_Nue_Extended (float x, float y, float z)
int IsInsideFarFiducial_Nue_Extended (float x, float y, float z)
int IsInsideNearFiducial_Nue_Standard (float x, float y, float z, bool isMC)
int IsInsideFarFiducial_Nue_Standard (float x, float y, float z, bool isMC)
int IsInsideNearFiducial_MRE_Standard (float x, float y, float z, bool isMC)
Int_t InPartialRegion (UShort_t plane, UShort_t strip)
float Oscillate (NtpMCTruth *mcth, float L, float dm2, float theta23, float UE32)
float Oscillate (ANtpTruthInfoBeam *ib, float L, float dm2, float theta23, float UE32)
float Oscillate (int nuFlavor, int nonOscNuFlavor, float Energy, float L, float dm2, float theta23, float U)
float Oscillate (ANtpTruthInfoBeamNue *ib)
void NueEnergyCorrection (NueRecord *nr, bool isLinearityFixMC=false)
float NueEnergyCorrection (float meu, int type, bool isMC, int detector, bool isLinearityFixMC)
void RHCNueEnergyCorrection (NueRecord *nr, bool isLinearityFixMC=false)
float RHCNueEnergyCorrection (float meu, int type, bool isMC, int detector, bool isLinearityFixMC=false)
void MINOSPLUSNueEnergyCorrection (NueRecord *nr, bool isLinearityFixMC=false)
float MINOSPLUSNueEnergyCorrection (float meu, int type, bool isMC, int detector, bool isLinearityFixMC=false)
void NueEnergyCorrectionNeverUseThisFunction (NueRecord *nr)
float NueEnergyCorrectionNeverUseThisFunction (float meu, int type, bool isMC, int detector)

Variables

static const Int_t NC = 0
static const Int_t numu = 1
static const Int_t nue = 2
static const Int_t nutau = 3
static const Int_t bnue = 4

Typedef Documentation


Enumeration Type Documentation

Enumerator:
kUnknown 
kEnt 
kFirebird 
kGriffin 
kHydra 
kImp 
kJaberwocky 
kKraken 
kLeviathan 
kManticore 

Definition at line 38 of file NueConvention.h.

00038                              {
00039       kUnknown  = 0x00,
00040       kEnt      = 0x01,
00041       kFirebird = 0x02,
00042       kGriffin  = 0x03,
00043       kHydra    = 0x04,    //Production began December 2006
00044       kImp      = 0x05,
00045       kJaberwocky = 0x06,
00046       kKraken   = 0x07,
00047       kLeviathan = 0x08,
00048       kManticore = 0x09
00049     } NueRel_t;


Function Documentation

Int_t NueConvention::DetermineClassType ( Int_t  inu,
Int_t  inunoosc,
Int_t  iaction 
)

Definition at line 30 of file NueConvention.cxx.

References bnue, ANtpDefaultValue::kInt, NC, nue, numu, and nutau.

Referenced by ANtpTruthInfoBeamAna::GetNueClass(), NueAnalysisCuts::IsBackground(), and NueAnalysisCuts::IsSignal().

00031 {
00032      int cType=ANtpDefVal::kInt;
00033 
00034      if(iaction ==0){ cType= ClassType::NC; // NC class
00035       }
00036      else if(iaction >=1){
00037        if(inu ==14 || inu==-14){ 
00038           cType=ClassType::numu;  // CC numu class
00039        }
00040        else
00041        if(inu==12 || inu==-12){
00042          if(inunoosc==14 || inunoosc==-14){
00043             cType=ClassType::nue; // CC osc nue class
00044          }
00045          else if(inunoosc==12 || inunoosc==-12){
00046             cType=ClassType::bnue; // CC beam nue class
00047          }
00048        }
00049        else if(inu==16 || inu==-16){
00050           cType= ClassType::nutau;  // CC nutau class
00051        }
00052     }
00053 
00054     return cType;
00055 }

Int_t NueConvention::InPartialRegion ( UShort_t  plane,
UShort_t  strip 
)

Definition at line 288 of file NueConvention.cxx.

Referenced by ANtpTrackInfoAna::DetermineSigInOut(), and ANtpEventInfoAna::FillStripVariables().

00288                                                                   {
00289   // figure out if this (plane,strip) corresponds to something in
00290   // the partially instrumented region
00291   //
00292   // this region is defined as:
00293   // v planes: (strip<=4 || strip>=67)
00294   // partial u: (strip==0 || strip=63)
00295   // full u: (strip<=26 || strip>=88)
00296   //
00297   // if so, return 1
00298   // if not, return -1
00299   // if error, return 0
00300 
00301 
00302   // make a lookup ptype to hold the type of each plane
00303   // 1 = v partial   2 = u partial
00304   // 3 = v full   4 = u full
00305   // 0 = uninstrumented
00306   static bool first=true;
00307   static UShort_t ptype[282];
00308   if(first){
00309     ptype[0]=0;
00310     for(int i=1; i<=281; i++){
00311       if(i%2==0) ptype[i]=1; // a v plane
00312       else ptype[i]=2; // a u plane
00313       if((i-1)%5 == 0) ptype[i]+=2; // fully instrumented
00314       else if(i>120) ptype[i]=0; // not instrumented
00315     }
00316     first=false;
00317   }
00318   if(plane>281){
00319     //    std::cerr<<"InPartialRegion passed plane = "<<plane<<std::endl;
00320     return 0;
00321   }
00322   UShort_t pt = ptype[plane];
00323 
00324   Int_t result;
00325   switch(pt){
00326   case 1:
00327   case 3:
00328     if(strip<=4 || strip>=67) result=1;
00329     else result = -1;
00330     break;
00331   case 2:
00332     if(strip==0 || strip == 63) result=1;
00333     else result = -1;
00334     break;
00335   case 4:
00336     if(strip<=26 || strip>=88) result=1;
00337     else result = -1;
00338     break;
00339   case 0:
00340   default:
00341     result=0;
00342     break;
00343   }
00344   return result;
00345 
00346 }

int NueConvention::IsInsideFarFiducial_Nue_Extended ( float  x,
float  y,
float  z 
)

Definition at line 159 of file NueConvention.cxx.

Referenced by AnalysisInfoAna::IsFidAll(), NueAnalysisCuts::IsInsideFarFiducial(), and NueDisplayModule::PassCuts().

00160 {
00161   Float_t SuperModule1Beg =  0.35;
00162   Float_t SuperModule2Beg = 16.20;
00163   Float_t SuperModule1End = 14.57;
00164   Float_t SuperModule2End = 29.62;
00165 
00166   Float_t radialInner = 0.40;
00167   Float_t radialOuter = 3.87;
00168   Bool_t zContained = false;
00169   Bool_t xyContained = false;
00170   Float_t r = TMath::Sqrt(x*x + y*y);
00171 
00172   if( (z >= SuperModule1Beg && z <=SuperModule1End) ||
00173       (z >= SuperModule2Beg && z <=SuperModule2End) )
00174      zContained = true;
00175 
00176   if( r >= radialInner && r <= radialOuter)
00177      xyContained = true;
00178 
00179   Int_t retVal = 0;
00180   if(zContained && xyContained) retVal = 1;
00181   if(!zContained) retVal = -1;
00182   if(!xyContained) retVal -= 2;
00183 
00184   return retVal;  //  1 contained, -1 out of bounds z
00185                   //  -2 oob xy, -3 oob both
00186 }

int NueConvention::IsInsideFarFiducial_Nue_Standard ( float  x,
float  y,
float  z,
bool  isMC 
)

Definition at line 216 of file NueConvention.cxx.

Referenced by AnalysisInfoAna::Analyze(), and NueStandard::IsInFid().

00216                                                                                        {
00217 
00218   Float_t SuperModule1Beg =  0.49080;   // These are data values
00219   Float_t SuperModule2Beg = 16.27110;
00220   Float_t SuperModule1End = 14.29300;
00221   Float_t SuperModule2End = 27.98270;
00222 
00223   if(isMC){
00224     SuperModule1Beg =  0.47692;   // These are mc values
00225     SuperModule2Beg = 16.26470;
00226     SuperModule1End = 14.27860;
00227     SuperModule2End = 27.97240;
00228   }
00229                                                                               
00230   Float_t radialInner = 0.50;
00231   Float_t radialOuter = TMath::Sqrt(14.0);
00232   Bool_t zContained = false;
00233   Bool_t xyContained = false;
00234 
00235   Float_t r = TMath::Sqrt(x*x + y*y);
00236                                                                                 
00237   if( (z >= SuperModule1Beg && z <=SuperModule1End) ||
00238       (z >= SuperModule2Beg && z <=SuperModule2End) )
00239      zContained = true;
00240                                                                                 
00241   if( r >= radialInner && r <= radialOuter)
00242      xyContained = true;
00243                                                                                 
00244   Int_t retVal = 0;
00245   if(zContained && xyContained) retVal = 1;
00246   if(!zContained) retVal = -1;
00247   if(!xyContained) retVal -= 2;
00248                                                                                 
00249   return retVal;  //  1 contained, -1 out of bounds z
00250                   //  -2 oob xy, -3 oob both
00251 }

int NueConvention::IsInsideNearFiducial_MRE_Standard ( float  x,
float  y,
float  z,
bool  isMC 
)

Definition at line 253 of file NueConvention.cxx.

Referenced by NueStandard::PassesMRCCFiducial().

00255 {
00256   Float_t SuperModule1Beg = 0.5;  //Data and MC values 
00257                                   //  (according to DataUtil/infid.h on 10/02/07
00258   Float_t SuperModule1End = 5.5;
00259                                                                                 
00260   Float_t radialInner = 0;
00261   Float_t radialOuter = 1.2;
00262   Float_t xCenter = 1.4885;
00263   Float_t yCenter = 0.1397;
00264                                                                                 
00265   Bool_t zContained = false;
00266   Bool_t xyContained = false;
00267                                                                                 
00268   Float_t r = TMath::Sqrt((x-xCenter)*(x-xCenter) + (y-yCenter)*(y-yCenter));
00269                                                                                 
00270   if( z >= SuperModule1Beg && z <=SuperModule1End)
00271      zContained = true;
00272   if( r >= radialInner && r <= radialOuter)
00273      xyContained = true;
00274                                                                                 
00275                                                                                 
00276   Int_t retVal = 0;
00277   if(zContained && xyContained) retVal = 1;
00278   if(!zContained) retVal = -1;
00279   if(!xyContained) retVal -= 2;
00280                                                                                 
00281   return retVal;
00282 }

int NueConvention::IsInsideNearFiducial_Nue_Extended ( float  x,
float  y,
float  z 
)

Definition at line 134 of file NueConvention.cxx.

Referenced by AnalysisInfoAna::IsFidAll(), NueAnalysisCuts::IsInsideNearFiducial(), and NueDisplayModule::PassCuts().

00135 {
00136   Float_t SuperModule1Beg = 0.50;
00137   Float_t SuperModule1End = 6.50;
00138 
00139   Float_t radialInner = 0;
00140   Float_t radialOuter = 1;
00141   Float_t xCenter = 1.4885;
00142   Float_t yCenter = 0.1397;
00143   Bool_t zContained = false;
00144   Bool_t xyContained = false;
00145   Float_t r = TMath::Sqrt((x-xCenter)*(x-xCenter) + (y-yCenter)*(y-yCenter));
00146   if( z >= SuperModule1Beg && z <=SuperModule1End)
00147      zContained = true;
00148   if( r >= radialInner && r <= radialOuter)
00149      xyContained = true;
00150 
00151   Int_t retVal = 0;
00152   if(zContained && xyContained) retVal = 1;
00153   if(!zContained) retVal = -1;
00154   if(!xyContained) retVal -= 2;
00155   return retVal;
00156 }

int NueConvention::IsInsideNearFiducial_Nue_Standard ( float  x,
float  y,
float  z,
bool  isMC 
)

Definition at line 188 of file NueConvention.cxx.

Referenced by AnalysisInfoAna::Analyze(), and NueStandard::IsInFid().

00189 {
00190   Float_t SuperModule1Beg = 1.01080;  //Data and MC values (according to DataUtil/infid.h on 10/02/07
00191   Float_t SuperModule1End = 4.99059;
00192 
00193   Float_t radialInner = 0;
00194   Float_t radialOuter = 0.8;
00195   Float_t xCenter = 1.4885;
00196   Float_t yCenter = 0.1397;
00197 
00198   Bool_t zContained = false;
00199   Bool_t xyContained = false;
00200 
00201   Float_t r = TMath::Sqrt((x-xCenter)*(x-xCenter) + (y-yCenter)*(y-yCenter));
00202 
00203   if( z >= SuperModule1Beg && z <=SuperModule1End)
00204      zContained = true;
00205   if( r >= radialInner && r <= radialOuter)
00206      xyContained = true;
00207                                                                                                                                      
00208   Int_t retVal = 0;
00209   if(zContained && xyContained) retVal = 1;
00210   if(!zContained) retVal = -1;
00211   if(!xyContained) retVal -= 2;
00212 
00213   return retVal;
00214 }

float NueConvention::MINOSPLUSNueEnergyCorrection ( float  meu,
int  type,
bool  isMC,
int  detector = 2,
bool  isLinearityFixMC = false 
)

Definition at line 597 of file NueConvention.cxx.

References ReleaseType::IsDaikon(), ReleaseType::IsData(), and ReleaseType::IsElm().

00598 {
00599  if(ReleaseType::IsElm(type)&& (ReleaseType::IsDaikon(type)||ReleaseType::IsData(type)))
00600  { 
00601   //The below numbers are from Adam using Elm5 Daikon10 MC
00602   //Note, at the behest of Andy Blake, we have inverted to flipping the axes
00603   //This is a 2-12 GeV fit
00604   if(detector==2) //far
00605   { 
00606     float offset_gev =  0.539882;
00607     float slope_GevPerMip  = 0.0391404;
00608     return (meu*slope_GevPerMip)+offset_gev;
00609   }
00610   else if(detector==1) //near
00611   {
00612     float offset_gev = 0.734848;
00613     float slope_GevPerMip  = 0.0383259;
00614     return (meu*slope_GevPerMip)+offset_gev;
00615   }
00616  }
00617 
00618  throw -1;
00619  return -1;
00620 }

void NueConvention::MINOSPLUSNueEnergyCorrection ( NueRecord nr,
bool  isLinearityFixMC = false 
)

Definition at line 573 of file NueConvention.cxx.

References MuELoss::e, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), NueHeader::GetRelease(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), isMC, Msg::kError, SimFlag::kMC, MSG, ANtpShowerInfoNue::phMeu, ANtpEventInfoNue::phMeu, ANtpTrackInfoNue::phMeu, ANtpTrackInfoNue::phNueGeV, ANtpEventInfoNue::phNueGeV, ANtpShowerInfoNue::phNueGeV, NueRecord::srevent, NueRecord::srshower, and NueRecord::srtrack.

Referenced by NueEnergyCorrection().

00574 {
00575 //scale all GeV values using MEU variables and constants contained in this method
00576 
00577 
00578 int release = nr->GetHeader().GetRelease();
00579 int detector = nr->GetHeader().GetVldContext().GetDetector();
00580 bool isMC = (nr->GetHeader().GetVldContext().GetSimFlag()==SimFlag::kMC);
00581 
00582  try
00583   {
00584    if(nr->srevent.phMeu>-9999)nr->srevent.phNueGeV=NueConvention::MINOSPLUSNueEnergyCorrection(nr->srevent.phMeu,release,isMC,detector, isLinearityFixMC);
00585    if(nr->srshower.phMeu>-9999)nr->srshower.phNueGeV=NueConvention::MINOSPLUSNueEnergyCorrection(nr->srshower.phMeu,release,isMC,detector, isLinearityFixMC);
00586    if(nr->srtrack.phMeu>-9999)nr->srtrack.phNueGeV=NueConvention::MINOSPLUSNueEnergyCorrection(nr->srtrack.phMeu,release,isMC,detector, isLinearityFixMC);
00587 
00588   }
00589  
00590   catch (int e)
00591   {
00592   MSG("NueConvention",Msg::kError)<<"MINOSPLUSNueEnergyCorrection - attempted to correct energy for unknown specification "<<release<<endl;
00593   }
00594 
00595 }

float NueConvention::NueEnergyCorrection ( float  meu,
int  type,
bool  isMC,
int  detector = 2,
bool  isLinearityFixMC = false 
)

Definition at line 384 of file NueConvention.cxx.

References ReleaseType::GetRecoSubVersion(), ReleaseType::IsCarrot(), ReleaseType::IsCedar(), ReleaseType::IsDaikon(), ReleaseType::IsData(), ReleaseType::IsDogwood(), ReleaseType::IsElm(), and MINOSPLUSNueEnergyCorrection().

00385 {
00386 
00387  //
00388  //Cedar Carrot
00389  //
00390  if(ReleaseType::IsCedar(type)&&ReleaseType::IsCarrot(type))//cedar carrot only
00391  {
00392   float offset =   -1.52;
00393   float slope  =   25.06;
00394   return (meu-offset)/slope;
00395  }
00396 
00397  //
00398  //Cedar Daikon/Data
00399  //
00400  else if(ReleaseType::IsCedar(type)&&(ReleaseType::IsDaikon(type)||ReleaseType::IsData(type))&&(ReleaseType::GetRecoSubVersion(type)==0 || ReleaseType::GetRecoSubVersion(type)==1 ) ) //cedar daikon or data
00401  {
00402   float offset =   -1.515;
00403   float slope  =   24.86;
00404   return (meu-offset)/slope;
00405  }
00406    
00407  //
00408  //Cedar_phy(_bhcurv) Daikon/Data
00409  //
00410  else if(ReleaseType::IsCedar(type)&&(ReleaseType::IsDaikon(type)||ReleaseType::IsData(type))&&(ReleaseType::GetRecoSubVersion(type)==2 || ReleaseType::GetRecoSubVersion(type)==3)) //cedar_phy or cedar_phy_bhcurv, daikon or data
00411  {
00412   if(isMC)
00413   {
00414    if(isLinearityFixMC)
00415    {
00416     //The below numbers are for quasielastic nue events from MC with the FIX for linearity bug
00417     if(detector==2) //far
00418     {
00419      float offset =   -1.17129;
00420      float slope  =   24.2273;
00421      return (meu-offset)/slope;
00422     }
00423     else if(detector==1) //near
00424     {
00425      float offset =   -0.820177;
00426      float slope  =   23.7963;
00427      return (meu-offset)/slope;
00428     }
00429    }
00430    else
00431    {
00432     //The below numbers are for quasielastic nue events from MC with the linearity bug
00433     //Hence the number are only correct for quasielastic nue events from MC with the linearity bug
00434     //The NC, numu CC, and pid selected nue events will be effected by the linearity bug differently
00435     //Hence the below numbers are just plain wrong for everything but QE nue events
00436     if(detector==2) //far
00437     {
00438      //Numbers from Greg based on PETrimmerTest_V5 files with linearity bug (August 26, 2008: docDB 5001-v1)
00439      float offset =   -1.29686;
00440      float slope  =   24.3332;
00441      return (meu-offset)/slope;
00442     }
00443     else if(detector==1) //near
00444     {
00445      //New Numbers from Greg based on PETrimmerTest_V5 files with linearity bug  (August 26, 2008: docDB 5001-v1)
00446      float offset =   -2.8176;
00447      float slope  =   25.7362;
00448      return (meu-offset)/slope;
00449     }
00450    }
00451   }//if it is MC do the above
00452   else
00453   {
00454    //The below numbers are for quasielastic nue events from MC with the linearity bug FIX
00455    //To the best of our knowledge these are the correct energy scales for data
00456    //There are also addition fudge factors to compensate for imperfect GeVPerMip tunning and incorrect DB MEU numbers
00457    if(detector==2) //far
00458    {
00459     //Numbers from Greg based on PETrimmerTest_V5 files with linearity bug (August 26, 2008: docDB 5001-v1)
00460     float offset =   -1.17129*(0.9978/0.9988);
00461     float slope  =   24.2273*(0.9978/0.9988);
00462     return (meu-offset)/slope;
00463    }
00464    else if(detector==1) //near
00465    {
00466     //New Numbers from Greg based on PETrimmerTest_V5 files with linearity bug  (August 26, 2008: docDB 5001-v1)
00467     float offset =   -1.17129*(0.9978/1.0039);
00468     float slope  =   24.2273*(0.9978/1.0039);
00469     return (meu-offset)/slope;
00470    }
00471   }//else is data
00472  }//if cedar_phy or cedar_phy_bhcurv, daikon or data
00473   
00474  //
00475  //Dogwood Daikon/Data
00476  //
00477  else if(ReleaseType::IsDogwood(type)&& (ReleaseType::IsDaikon(type)||ReleaseType::IsData(type)))
00478  { 
00479   //The below numbers are from Xiaobo using Dogwood1 Daikon04 MC
00480   //These are preliminary numbers.  We will need to run over the full MC samples
00481   //and will need to take into account Data/MC fudge factors determined with 
00482   //stopping muon study with dogwood1
00483   if(detector==2) //far
00484   { 
00485    float offset_mip =   -2.483;
00486    float slope_MipPerGev  =  23.56;
00487    return (meu-offset_mip)/slope_MipPerGev;
00488   }
00489   else if(detector==1) //near
00490   {
00491    float offset_mip =   -1.071;
00492    float slope_MipPerGev  =  22.87;
00493    return (meu-offset_mip)/slope_MipPerGev;
00494   }
00495  }
00496 
00497  //
00498  //Elm Daikon/Data calling MINOSPLUS CORRECTOR
00499  //
00500  else if(ReleaseType::IsElm(type)&& (ReleaseType::IsDaikon(type)||ReleaseType::IsData(type)))
00501  {
00502   return MINOSPLUSNueEnergyCorrection(meu, type, isMC, detector, isLinearityFixMC);
00503  }//CALL TO MINOSPLUS correction if Elm.
00504  //This function's dependence on release type seems really shortsighted.
00505 
00506  //msg asked for ecal change but can't determine which to use
00507 
00508  throw -1;
00509  return -1;
00510 }

void NueConvention::NueEnergyCorrection ( NueRecord nr,
bool  isLinearityFixMC = false 
)

Definition at line 354 of file NueConvention.cxx.

References NueRecord::anainfo, MuELoss::e, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), NueHeader::GetRelease(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), isMC, AnalysisInfoNue::isRHC, Msg::kError, SimFlag::kMC, MSG, ANtpShowerInfoNue::phMeu, ANtpEventInfoNue::phMeu, ANtpTrackInfoNue::phMeu, ANtpTrackInfoNue::phNueGeV, ANtpEventInfoNue::phNueGeV, ANtpShowerInfoNue::phNueGeV, RHCNueEnergyCorrection(), NueRecord::srevent, NueRecord::srshower, and NueRecord::srtrack.

Referenced by AnnAna::Analyze(), MiniMakerPID::EvaluateCuts(), MiniMaker::EvaluateCuts(), ExtrapHistsGen::FillHistograms(), NueStandard::GetPredWeights(), NueExtrapolationJB::LoadFiles(), NueStandard::ModifyANNPID(), NueModule::PassesBlindingCuts(), MCNNRunner::PassesMCNNPrecuts(), MCNNMergeModule::Reco(), Trimmer::RunTrimmer(), and NueStandard::SetE50PID().

00355 {
00356 //scale all GeV values using MEU variables and constants contained in this method
00357 
00358 //if these are RHC files, should be using that correction
00359 if(nr->anainfo.isRHC)
00360 {
00361   RHCNueEnergyCorrection(nr);
00362   return;
00363 }
00364 
00365 int release = nr->GetHeader().GetRelease();
00366 int detector = nr->GetHeader().GetVldContext().GetDetector();
00367 bool isMC = (nr->GetHeader().GetVldContext().GetSimFlag()==SimFlag::kMC);
00368 
00369 try
00370 {
00371 if(nr->srevent.phMeu>-9999)nr->srevent.phNueGeV=NueConvention::NueEnergyCorrection(nr->srevent.phMeu,release,isMC,detector, isLinearityFixMC);
00372 if(nr->srshower.phMeu>-9999)nr->srshower.phNueGeV=NueConvention::NueEnergyCorrection(nr->srshower.phMeu,release,isMC,detector, isLinearityFixMC);
00373 if(nr->srtrack.phMeu>-9999)nr->srtrack.phNueGeV=NueConvention::NueEnergyCorrection(nr->srtrack.phMeu,release,isMC,detector, isLinearityFixMC);
00374 
00375 }
00376 catch (int e)
00377 {
00378   MSG("NueConvention",Msg::kError)<<"NueEnergyCorrection - attempted to correct energy for unknown specification "<<release<<endl;
00379 }
00380 
00381 }

float NueConvention::NueEnergyCorrectionNeverUseThisFunction ( float  meu,
int  type,
bool  isMC,
int  detector = 2 
)

Definition at line 652 of file NueConvention.cxx.

References ReleaseType::GetRecoSubVersion(), ReleaseType::IsCedar(), ReleaseType::IsDaikon(), and ReleaseType::IsData().

00653 {
00654         if(ReleaseType::IsCedar(type)&&(ReleaseType::IsDaikon(type)||ReleaseType::IsData(type))&&(ReleaseType::GetRecoSubVersion(type)==2 || ReleaseType::GetRecoSubVersion(type)==3)) //cedar_phy or cedar_phy_bhcurv, daikon or data
00655         {
00656           if(isMC)
00657           {
00658             //The below numbers are the average E-scale from MC with and without the linearity bug
00659             //This is just plain wrong for everything
00660                   if(detector==2) //far
00661                   {
00662         float offset =   ( (-1.29686)+(-1.17129) )/2.0;
00663         float slope  =   (  (24.3332)+(24.2273)  )/2.0;
00664         return (meu-offset)/slope;
00665                   }
00666                   else if(detector==1) //near
00667                   {
00668         float offset =   ( (-2.8176)+(-0.820177) )/2.0;
00669         float slope  =   ( (25.7362)+(23.7963)   )/2.0;
00670         return (meu-offset)/slope;
00671                   }
00672           }//if it is MC do the above
00673           else
00674           {
00675             //The below numbers are for quasielastic nue events from MC with the linearity bug FIX
00676             //To the best of our knowledge these are the correct energy scales for data
00677             //There are also addition fudge factors to compensate for imperfect GeVPerMip tunning and incorrect DB MEU numbers
00678                   if(detector==2) //far
00679                   {
00680         //Numbers from Greg based on PETrimmerTest_V5 files with linearity bug (August 26, 2008: docDB 5001-v1)
00681         float offset =   -1.17129*(0.9978/0.9988);
00682         float slope  =   24.2273*(0.9978/0.9988);
00683         return (meu-offset)/slope;
00684                   }
00685                   else if(detector==1) //near
00686                   {
00687           //New Numbers from Greg based on PETrimmerTest_V5 files with linearity bug  (August 26, 2008: docDB 5001-v1)
00688         float offset =   -1.17129*(0.9978/1.0039);
00689         float slope  =   24.2273*(0.9978/1.0039);
00690         return (meu-offset)/slope;
00691                   }
00692           }//else is data
00693         }//if cedar_phy or cedar_phy_bhcurv, daikon or data
00694 
00695         //msg asked for ecal change but can't determine which to use
00696 
00697         throw -1;
00698         return -1;
00699 }

void NueConvention::NueEnergyCorrectionNeverUseThisFunction ( NueRecord nr  ) 

Definition at line 628 of file NueConvention.cxx.

References MuELoss::e, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), NueHeader::GetRelease(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), isMC, Msg::kError, SimFlag::kMC, MSG, ANtpShowerInfoNue::phMeu, ANtpEventInfoNue::phMeu, ANtpTrackInfoNue::phMeu, ANtpTrackInfoNue::phNueGeV, ANtpEventInfoNue::phNueGeV, ANtpShowerInfoNue::phNueGeV, NueRecord::srevent, NueRecord::srshower, and NueRecord::srtrack.

00629 {
00630 //scale all GeV values using MEU variables and constants contained in this method
00631 
00632 int release = nr->GetHeader().GetRelease();
00633 int detector = nr->GetHeader().GetVldContext().GetDetector();
00634 bool isMC = (nr->GetHeader().GetVldContext().GetSimFlag()==SimFlag::kMC);
00635 
00636 try
00637 {
00638 if(nr->srevent.phMeu>-9999)nr->srevent.phNueGeV=NueConvention::NueEnergyCorrectionNeverUseThisFunction(nr->srevent.phMeu,release,isMC,detector);
00639 if(nr->srshower.phMeu>-9999)nr->srshower.phNueGeV=NueConvention::NueEnergyCorrectionNeverUseThisFunction(nr->srshower.phMeu,release,isMC,detector);
00640 if(nr->srtrack.phMeu>-9999)nr->srtrack.phNueGeV=NueConvention::NueEnergyCorrectionNeverUseThisFunction(nr->srtrack.phMeu,release,isMC,detector);
00641 
00642 }
00643 catch (int e)
00644 {
00645         MSG("NueConvention",Msg::kError)<<"NueEnergyCorrectionNeverUseThisFunction - attempted to correct energy for unknown specification\n";
00646 }
00647 
00648 }

float NueConvention::Oscillate ( ANtpTruthInfoBeamNue ib  ) 
float NueConvention::Oscillate ( int  nuFlavor,
int  nonOscNuFlavor,
float  Energy,
float  L,
float  dm2,
float  theta23,
float  U 
)

Definition at line 84 of file NueConvention.cxx.

Referenced by NueExpBuilder::GenerateExperiment(), ANtpTruthInfoBeamAna::GetOscProb(), NuePrint::PrintValues(), NueReweight::Reco(), TrimModule::Reco(), MiniMaker::RunMiniMaker(), and Trimmer::RunTrimmer().

00086 {
00087    float oscterm = TMath::Sin(1.269*dm2*L/Energy);
00088 
00089 //   std::cout<<oscterm<<"  "<<pow(TMath::Sin(2*theta23),2)<<"  "
00090 //       <<pow((1-UE32),2)<<std::endl;
00091 
00092    float pmt=pow((1-UE32)*oscterm*TMath::Sin(2*theta23),2);
00093    float pme=pow(TMath::Sin(theta23),2)*4.*UE32*(1-UE32)*pow(oscterm,2);
00094    float pmm=1.-pmt-pme;
00095 
00096    float pet=4*(1-UE32)*UE32*pow(TMath::Cos(theta23)*oscterm,2);
00097    float pem=pow(TMath::Sin(theta23),2)*4.*UE32*(1-UE32)*pow(oscterm,2);
00098    float pee=1.-pet-pem;
00099 
00100 
00101    if(abs(nonOscNuFlavor)==14){
00102       if(abs(nuFlavor)==12){
00103          return pme;
00104       }
00105       else if(abs(nuFlavor)==14){
00106          return pmm;
00107       }
00108       else if(abs(nuFlavor)==16){
00109          return pmt;
00110       }
00111    }
00112    else if(abs(nonOscNuFlavor)==12){
00113       if(abs(nuFlavor)==12){
00114          return pee;
00115       }
00116       else if(abs(nuFlavor)==14){
00117          return pem;
00118       }
00119       else if(abs(nuFlavor)==16){
00120          return pet;
00121       }
00122    }
00123    else{
00124      std::cout<<"I don't know what to do with "<<nonOscNuFlavor
00125          <<" "<<nuFlavor<<" "<<pee<<std::endl;
00126    }
00127    return 0.;
00128 }

float NueConvention::Oscillate ( ANtpTruthInfoBeam ib,
float  L,
float  dm2,
float  theta23,
float  UE32 
)

Definition at line 70 of file NueConvention.cxx.

References ANtpTruthInfoBeam::nonOscNuFlavor, ANtpTruthInfo::nuEnergy, ANtpTruthInfo::nuFlavor, and Oscillate().

00072 {
00073   return NueConvention::Oscillate(ib->nuFlavor, ib->nonOscNuFlavor,ib->nuEnergy,
00074                                    L, dm2, theta23, UE32);
00075 }

float NueConvention::Oscillate ( NtpMCTruth mcth,
float  L,
float  dm2,
float  theta23,
float  UE32 
)

Definition at line 63 of file NueConvention.cxx.

References NtpMCTruth::inu, NtpMCTruth::inunoosc, and NtpMCTruth::p4neu.

Referenced by Oscillate().

00065 {
00066     return NueConvention::Oscillate(mcth->inu, mcth->inunoosc, mcth->p4neu[3],
00067                                    L, dm2, theta23, UE32);
00068 }

float NueConvention::RHCNueEnergyCorrection ( float  meu,
int  type,
bool  isMC,
int  detector = 2,
bool  isLinearityFixMC = false 
)

Definition at line 545 of file NueConvention.cxx.

References ReleaseType::IsDaikon(), ReleaseType::IsData(), and ReleaseType::IsDogwood().

00546 {
00547  if(ReleaseType::IsDogwood(type)&& (ReleaseType::IsDaikon(type)||ReleaseType::IsData(type)))
00548  { 
00549   //The below numbers are from Adam using Dogwood3 Daikon07 MC
00550   //We consider these numbers valid for Dogwood5 Data, as the two reconstructions are similar
00551   if(detector==2) //far
00552   { 
00553    float offset_mip =   -3.493;
00554    float slope_MipPerGev  =  23.46;
00555    return (meu-offset_mip)/slope_MipPerGev;
00556   }
00557   else if(detector==1) //near
00558   {
00559    float offset_mip =   -3.933;
00560    float slope_MipPerGev  =  23.28;
00561    return (meu-offset_mip)/slope_MipPerGev;
00562   }
00563  }
00564 
00565  throw -1;
00566  return -1;
00567 }

void NueConvention::RHCNueEnergyCorrection ( NueRecord nr,
bool  isLinearityFixMC = false 
)

Definition at line 521 of file NueConvention.cxx.

References MuELoss::e, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), NueHeader::GetRelease(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), isMC, Msg::kError, SimFlag::kMC, MSG, ANtpShowerInfoNue::phMeu, ANtpEventInfoNue::phMeu, ANtpTrackInfoNue::phMeu, ANtpTrackInfoNue::phNueGeV, ANtpEventInfoNue::phNueGeV, ANtpShowerInfoNue::phNueGeV, NueRecord::srevent, NueRecord::srshower, and NueRecord::srtrack.

Referenced by ExtrapHistsGen::FillHistograms(), NueEnergyCorrection(), and Trimmer::RunTrimmer().

00522 {
00523 //scale all GeV values using MEU variables and constants contained in this method
00524 
00525 
00526 int release = nr->GetHeader().GetRelease();
00527 int detector = nr->GetHeader().GetVldContext().GetDetector();
00528 bool isMC = (nr->GetHeader().GetVldContext().GetSimFlag()==SimFlag::kMC);
00529 
00530  try
00531   {
00532    if(nr->srevent.phMeu>-9999)nr->srevent.phNueGeV=NueConvention::RHCNueEnergyCorrection(nr->srevent.phMeu,release,isMC,detector, isLinearityFixMC);
00533    if(nr->srshower.phMeu>-9999)nr->srshower.phNueGeV=NueConvention::RHCNueEnergyCorrection(nr->srshower.phMeu,release,isMC,detector, isLinearityFixMC);
00534    if(nr->srtrack.phMeu>-9999)nr->srtrack.phNueGeV=NueConvention::RHCNueEnergyCorrection(nr->srtrack.phMeu,release,isMC,detector, isLinearityFixMC);
00535 
00536   }
00537  
00538   catch (int e)
00539   {
00540   MSG("NueConvention",Msg::kError)<<"NueEnergyCorrection - attempted to correct energy for unknown specification "<<release<<endl;
00541   }
00542 
00543 }


Variable Documentation

const Int_t NueConvention::bnue = 4 [static]
const Int_t NueConvention::NC = 0 [static]
const Int_t NueConvention::nue = 2 [static]
const Int_t NueConvention::numu = 1 [static]
const Int_t NueConvention::nutau = 3 [static]

Generated on 3 Oct 2018 for loon by  doxygen 1.6.1