NueStandard Namespace Reference

Functions

bool PassesDataQuality (NueRecord *nr)
bool PassesNearDataQuality (int gbm, float cc, int st)
bool PassesFarDataQuality (float li, int rc, int dpfddq, float tmin, double spillt)
bool PassesFarDataTiming (NueRecord *nr)
bool IsGoodRun (NueRecord *nr)
bool IsGoodNearRun (NueRecord *nr)
bool IsGoodFarRun (NueRecord *nr)
bool PassesPOTStandards (NueRecord *nr)
bool PassesCosmicCut (NueRecord *nr)
bool PassesCosmicCutFunction (NueRecord *nr)
void FillCosmicCut (NueRecord *nr)
bool IsInFid (NueRecord *nr)
bool PassesTrackPlaneCut (NueRecord *nr)
bool PassesTrackPlaneCut (int trkplane)
bool PassesTrackLikePlaneCut (NueRecord *nr)
bool PassesTrackLikePlaneCut (int tlp)
bool PassesLowEnergyCut (NueRecord *nr)
bool PassesLowEnergyCut (float energy)
bool PassesHighEnergyCut (NueRecord *nr)
bool PassesHighEnergyCut (float energy)
bool IsLargestEvent (NueRecord *nr)
bool PassesMinPlaneCut (NueRecord *nr)
bool PassesMinPlaneCut (int planes)
bool PassesShowerCut (NueRecord *nr)
bool PassesShowerCut (int nshw)
bool PassesPreSelection (NueRecord *nr)
bool PassesPreSelection (int tp, int tlp, float energy)
bool PassesNonHEPreSelection (NueRecord *nr)
bool PassesNonHEPreSelection (int tp, int tlp, float energy)
bool PassesPreSelectionTrackCuts (NueRecord *nr)
bool PassesPreSelectionTrackCuts (int trkplane, int tlp)
bool PassesPreSelectionBasicCuts (NueRecord *nr)
bool PassesSysPreSelectionNoHE (NueRecord *nr)
bool PassesSysPreSelectionNoHE (int tp, int tlp, float energy)
bool PassesSysPreSelection (NueRecord *nr)
bool PassesSysPreSelection (int tp, int tlp, float energy)
bool PassesMRCCFiducial (NueRecord *nr)
bool PassesMRCCPreSelection (NueRecord *nr)
bool PassesMRCCPreSelection (float bestComp, int fitp, double pid)
bool PassesMREFiducial (NueRecord *nr)
bool PassesMREPreSelection (NueRecord *nr)
bool PassesMREPreSelection (float bestComp, int fitp, double pid)
bool PassesPIDSelection (NueRecord *nr, Selection::Selection_t sel)
bool PassesSelection (NueRecord *nr, Selection::Selection_t sel)
bool PassesSelection (NueRecord *nr, Selection::Selection_t sel, Selection::Selection_t sel2)
bool PassesNCCleaningCuts (NueRecord *nr)
bool PassesParticlePIDCut (NueRecord *nr)
bool PassesParticlePIDPreselectionCut (NueRecord *nr)
double GetPIDValue (NueRecord *nr, Selection::Selection_t sel)
bool PassesCCSelection (NueRecord *nr)
double GetRPWBeamWeight (NueRecord *nr, bool ismrcc=false)
double GetRPWBeamWeight (std::vector< double > weights, std::vector< double > pots)
void SetDefaultOscParam ()
void SetDefaultOscParamNoNue ()
void SetOscParamBestFitANN ()
void SetOscParamBestFitkNN ()
void SetOscNoMatter ()
void GetOscParam (double *par)
void SetOscParam (double *par)
void SetOscParam (OscPar::OscPar_t pos, double val)
double GetOscWeight (int nuFlavor, int nonOsc, double E)
double GetNSIOscWeight (int nuFlavor, int nonOsc, double E)
double GetLSNDOscWeight (int nuFlavor, int nonOsc, double E)
void FillDefaultOscParam (double *par)
Bool_t IsRun1 (NueRecord *nr)
Bool_t IsRun2 (NueRecord *nr)
Bool_t IsRun3 (NueRecord *nr)
Bool_t IsRun3Prime (NueRecord *nr)
Bool_t IsRun3NotPrime (NueRecord *nr)
Bool_t IsRun4 (NueRecord *nr)
Bool_t IsRun4RHC (NueRecord *nr)
Bool_t IsRun5 (NueRecord *nr)
Bool_t IsRun6 (NueRecord *nr)
Bool_t IsRun7RHC (NueRecord *nr)
Bool_t IsRun8 (NueRecord *nr)
Bool_t IsRun9RHC (NueRecord *nr)
Bool_t IsRun10 (NueRecord *nr)
Bool_t IsRun11 (NueRecord *nr)
Bool_t IsRun12 (NueRecord *nr)
Bool_t IsRun13 (NueRecord *nr)
Bool_t IsSpecialRun (NueRecord *nr)
Double_t GetIntensityBeamWeight (NueRecord *nr)
Double_t GetSKZPBeamWeight (NueRecord *nr)
Double_t GetMCWeights (NueRecord *nr)
Double_t GetNDDataWeights (NueRecord *nr)
Double_t GetPredWeights_DO_NOT_USE (NueRecord *nr)
Double_t GetPredWeights (NueRecord *nr)
void ModifyANNPID (NueRecord *nr)
Double_t Calc4thAnaANN (NueRecord *nr, Selection::Selection_t sel)
void SetE50PID (NueRecord *nr)
void SetNSI (bool nsiflag=true)
void SetLSND (bool lsndflag=true)

Variables

static bool isNSI = false
static bool isLSND = false
static const int NRUNPERIODS = 2
static const double pot_fd [NRUNPERIODS] = {0.398,0.602}
static const double pot_nd [NRUNPERIODS] = {0.383,0.617}
static const double pot_ndmrcc [NRUNPERIODS] = {0.393161,0.606839}
static const double pot_fdmrcc [NRUNPERIODS] = {0.398,0.602}
static const double pot_ndhornoff [NRUNPERIODS] = {0.509,0.491}
static const Double_t kNormalizedNearPOT = 1.0e7
static const Double_t kNormalizedFarPOT_Run1 = 1.20963e8
static const Double_t kNormalizedFarPOT_Run2 = 1.93577e8
static const Double_t kNormalizedFarPOT_Run3 = 3.88063e8
static const Double_t kNormalizedFarPOT_Run4 = 0.0810616e8
static const Double_t kNormalizedFarPOT_Run4RHC = 1.6997e8
static const Double_t kNormalizedFarPOT_Run5 = 0.449622e8
static const Double_t kNormalizedFarPOT_Run6 = 0.61379e8
static const Double_t kNormalizedFarPOT_Run7RHC = 1.23052e8
static const Double_t kNormalizedFarPOT_Run8 = 0.122894e8
static const Double_t kNormalizedFarPOT_Run9RHC = 0.407265e8
static const Double_t kNormalizedFarPOT_Run10prelim = 1.51499e8 + 0.611644e8
static const Double_t kNormalizedFarPOT_Run10 = 2.34614e8
static const Double_t kNormalizedFarPOT = kNormalizedFarPOT_Run1 + kNormalizedFarPOT_Run2 + kNormalizedFarPOT_Run3
static const Double_t kNormalizedFarPOT_PerI = kNormalizedFarPOT_Run1 + kNormalizedFarPOT_Run2 + kNormalizedFarPOT_Run3 + kNormalizedFarPOT_Run4 + kNormalizedFarPOT_Run5 + kNormalizedFarPOT_Run6
static const Double_t kNormalizedFarPOT_RHC = kNormalizedFarPOT_Run4RHC + kNormalizedFarPOT_Run7RHC + kNormalizedFarPOT_Run9RHC
static const Double_t kNormalizedFarPOT_PerII = kNormalizedFarPOT_RHC
static const Double_t kNormalizedFarPOT_PerIII = kNormalizedFarPOT_Run8 + kNormalizedFarPOT_Run10
static const Double_t kNormalizedFarPOT_Run11 = 2.96697e8
static const Double_t kNormalizedFarPOT_Run12 = -5743.8
static const Double_t kNormalizedFarPOT_Run13 = -5743.8
static OscCalc fOscGen
static const Double_t predwts [5][5]
static const Double_t predwts_nuecc [5][5]
static const Double_t predwts_nc [5][5]
static const Double_t predwts_numucc [5][5]
static const Double_t predwts_bnuecc [5][5]
static const Double_t predwts_nutaucc [5][5]

Function Documentation

Double_t NueStandard::Calc4thAnaANN ( NueRecord nr,
Selection::Selection_t  sel 
)

Definition at line 1728 of file NueStandard.cxx.

References MSTCalc::e4w, exit(), FracVar::fract_2_planes, FracVar::fract_4_planes, FracVar::fract_6_planes, FracVar::fract_8_counters, FracVar::fract_road, NueRecord::fracvars, Selection::kANN4FHC, Selection::kANN4RHC, Shwfit::LongE, NueRecord::mstvars, MSTCalc::o4w, Shwfit::par_a, Shwfit::par_b, NueRecord::shwfit, Shwfit::uv_molrad_peak_9s_2pe_dw, and Shwfit::uv_rms_9s_2pe_dw.

Referenced by GetPIDValue().

01728                                                                            {
01729 
01730   // This is only a temporary solution for the ANN11 PID for the 4th Analysis.
01731 
01732   static bool firstcall = true;
01733   static TMultiLayerPerceptron* fneuralNet_11ann4 = 0;
01734 
01735   double ann4pid = -9999.9;
01736   char annfile[1000];
01737 
01738   if (firstcall) {
01739     char *srt_dir = getenv("SRT_PRIVATE_CONTEXT");
01740 
01741     switch(sel) {
01742     case Selection::kANN4FHC:  
01743       sprintf(annfile,"%s/NueAna/data/ann11_ana4_fhc.root",srt_dir);  break;
01744     case Selection::kANN4RHC:
01745       sprintf(annfile,"%s/NueAna/data/ann11_ana4_rhc.root",srt_dir);  break;
01746     default:      break;
01747     }
01748       
01749     ifstream Test(annfile);
01750     if (!Test){
01751       srt_dir = getenv("SRT_PUBLIC_CONTEXT");
01752 
01753       switch(sel) {
01754       case Selection::kANN4FHC:
01755         sprintf(annfile,"%s/NueAna/data/ann11_ana4_fhc.root",srt_dir);  break;
01756       case Selection::kANN4RHC:
01757         sprintf(annfile,"%s/NueAna/data/ann11_ana4_rhc.root",srt_dir);  break;
01758       default:  break;
01759       }
01760 
01761       ifstream Test_again(annfile);
01762       if (!Test_again){
01763         cout<<"Couldn't find ANN root file, ask Xinjie"<<endl;
01764         exit(0);
01765       }
01766     }
01767 
01768     static TFile *f = TFile::Open(annfile);
01769     fneuralNet_11ann4 = (TMultiLayerPerceptron*) f->Get("mlp");
01770   }
01771 
01772   if (!fneuralNet_11ann4) {
01773     cout << "Couldn't find ANN object, ask Xinjie" << endl;
01774     exit(0);
01775   }
01776 
01777   if (firstcall) {
01778     cout << "Get ann11 value from : " << annfile << endl;
01779     firstcall = false;
01780   }
01781 
01782   double pars[11];
01783 
01784   pars[0] = nr->shwfit.par_a;
01785   pars[1] = nr->shwfit.par_b;
01786   pars[2] = nr->shwfit.uv_molrad_peak_9s_2pe_dw;
01787   pars[3] = nr->shwfit.uv_rms_9s_2pe_dw;
01788   pars[4] = nr->mstvars.e4w+nr->mstvars.o4w;
01789   pars[5] = nr->fracvars.fract_2_planes;
01790   pars[6] = nr->fracvars.fract_4_planes;
01791   pars[7] = nr->fracvars.fract_6_planes;
01792   pars[8] = nr->fracvars.fract_8_counters;
01793   pars[9] = nr->fracvars.fract_road;
01794   pars[10]= nr->shwfit.LongE;
01795   bool pass = true;
01796   if (nr->shwfit.par_a<-1000) pass = false;
01797   if (nr->shwfit.par_b<-1000) pass = false;
01798   if (nr->shwfit.uv_molrad_peak_9s_2pe_dw<-1000) pass = false;
01799   if (nr->shwfit.uv_rms_9s_2pe_dw<-1000) pass = false;
01800   if (nr->mstvars.e4w<-1000) pass = false;
01801   if (nr->mstvars.e4w>500) pass = false;
01802   if (nr->mstvars.o4w<-1000) pass = false;
01803   if (nr->mstvars.o4w>500) pass = false;
01804   if (nr->fracvars.fract_2_planes<-1000) pass = false;
01805   if (nr->fracvars.fract_4_planes<-1000) pass = false;
01806   if (nr->fracvars.fract_6_planes<-1000) pass = false;
01807   if (nr->fracvars.fract_8_counters<-1000) pass = false;
01808   if (nr->fracvars.fract_road<-1000) pass = false;
01809   if (nr->shwfit.LongE<-1000) pass = false;
01810   if (nr->shwfit.LongE>1000) pass = false;
01811 
01812   if (pass) {
01813       ann4pid = fneuralNet_11ann4->Evaluate(0,pars);
01814   }
01815 
01816   return ann4pid;
01817 }

void NueStandard::FillCosmicCut ( NueRecord nr  ) 

Definition at line 408 of file NueStandard.cxx.

References BagTree::bt_var1, NueRecord::dtree, and PassesCosmicCutFunction().

Referenced by PassesCosmicCut().

00409 {
00410    int bv = 0;
00411    if (NueStandard::PassesCosmicCutFunction(nr)) bv=1;
00412    nr->dtree.bt_var1=bv;
00413 }

void NueStandard::FillDefaultOscParam ( double *  par  ) 

Definition at line 1298 of file NueStandard.cxx.

References OscPar::kDelta, OscPar::kDelta14, OscPar::kDelta24, OscPar::kDelta_emu, OscPar::kDelta_etau, OscPar::kDelta_mutau, OscPar::kDeltaM12, OscPar::kDeltaM23, OscPar::kDensity, OscPar::kDm41, OscPar::kEps_ee, OscPar::kEps_emu, OscPar::kEps_etau, OscPar::kEps_mumu, OscPar::kEps_mutau, OscPar::kEps_tautau, OscPar::kL, OscPar::kNuAntiNu, OscPar::kTh12, OscPar::kTh13, OscPar::kTh14, OscPar::kTh23, OscPar::kTh24, and OscPar::kTh34.

01299 {
01300   Double_t dm2_12 = 8.0e-5;  // best fit SNO
01301   Double_t dm2_23 = 2.32e-3;
01302                                                                                       
01303   par[OscPar::kL] = 735.0;
01304   par[OscPar::kTh23] = 3.1415926/4.0;
01305   par[OscPar::kTh12] = 0.59365;    // Sin2(2Th12) = 0.86
01306   par[OscPar::kTh13] = 0.19885;  // Sin2(2Th13) = 0.15;
01307   par[OscPar::kDeltaM23] = dm2_23; //normal heirarchy
01308   par[OscPar::kDeltaM12] = dm2_12;
01309   par[OscPar::kDensity] = 2.75; //standard rock density
01310   par[OscPar::kDelta] = 0;
01311   par[OscPar::kNuAntiNu] = 1;
01312 
01313   // Add NSI parameters:
01314   par[OscPar::kEps_ee] =  0;
01315   par[OscPar::kEps_emu] =  0;
01316   par[OscPar::kEps_etau] =  0;
01317   par[OscPar::kEps_mumu] =  0;
01318   par[OscPar::kEps_mutau] = 0; 
01319   par[OscPar::kEps_tautau] = 0; 
01320   par[OscPar::kDelta_emu] = 0;
01321   par[OscPar::kDelta_etau] = 0;
01322   par[OscPar::kDelta_mutau] = 0;
01323 
01324   par[OscPar::kDm41] =  0;
01325   par[OscPar::kTh14] = 0; 
01326   par[OscPar::kTh24] = 0; 
01327   par[OscPar::kTh34] = 0;
01328   par[OscPar::kDelta14] = 0;
01329   par[OscPar::kDelta24] = 0;
01330 
01331 }

Double_t NueStandard::GetIntensityBeamWeight ( NueRecord nr  ) 

Definition at line 1561 of file NueStandard.cxx.

References NueHeader::GetBeamType(), VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), IsRun3(), BeamType::kL010z185i_i124, BeamType::kL010z185i_i191, BeamType::kL010z185i_i213, BeamType::kL010z185i_i224, BeamType::kL010z185i_i232, BeamType::kL010z185i_i243, BeamType::kL010z185i_i257, BeamType::kL010z185i_i282, BeamType::kL010z185i_i303, BeamType::kL010z185i_i324, SimFlag::kMC, and Detector::kNear.

Referenced by GetMCWeights(), and Trimmer::RunTrimmer().

01561                                                          {
01562 
01563    Double_t eventWeight = 1.0;
01564 
01565    if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC &&
01566       nr->GetHeader().GetVldContext().GetDetector() == Detector::kNear &&
01567       IsRun3(nr)){
01568 
01569      switch(nr->GetHeader().GetBeamType()){
01570        case BeamType::kL010z185i_i124: eventWeight = 1.24932; break;
01571        case BeamType::kL010z185i_i191: eventWeight = 1.62047; break;
01572        case BeamType::kL010z185i_i213: eventWeight = 1.19021; break;
01573        case BeamType::kL010z185i_i224: eventWeight = 1.69376; break;
01574        case BeamType::kL010z185i_i232: eventWeight = 1.28621; break;
01575        case BeamType::kL010z185i_i243: eventWeight = 1.26755; break;
01576        case BeamType::kL010z185i_i257: eventWeight = 1.07360; break;
01577        case BeamType::kL010z185i_i282: eventWeight = 1.11812; break;
01578        case BeamType::kL010z185i_i303: eventWeight = 1.06092; break;
01579        case BeamType::kL010z185i_i324: eventWeight = 2.60657; break;
01580        default:                                               break;
01581      }
01582 
01583    }
01584 
01585    return(eventWeight);
01586  }

double NueStandard::GetLSNDOscWeight ( int  nuFlavor,
int  nonOsc,
double  E 
)

Definition at line 1294 of file NueStandard.cxx.

References fOscGen, and OscCalc::OscillateLSND().

01295 {
01296   return fOscGen.OscillateLSND(nuFlavor,nonOsc,E);
01297 }

Double_t NueStandard::GetMCWeights ( NueRecord nr  ) 

Definition at line 1545 of file NueStandard.cxx.

References RecRecordImp< T >::GetHeader(), GetIntensityBeamWeight(), VldContext::GetSimFlag(), GetSKZPBeamWeight(), RecHeader::GetVldContext(), and SimFlag::kMC.

Referenced by ExtrapHistsGen::FillHistograms(), and NueMiniAnaPID::FillMini().

01546 {
01547   //Function to calculate MC event weights to correct for various effect
01548   Double_t eventWeight = 1.0;
01549   
01550   //Check if it is MC
01551   if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC)
01552    {
01553      //Correct MC flux (i.e. SKZP and Helium) 
01554      eventWeight *= NueStandard::GetIntensityBeamWeight(nr);
01555      eventWeight *= NueStandard::GetSKZPBeamWeight(nr);
01556    }
01557   
01558   return(eventWeight);   
01559 }

Double_t NueStandard::GetNDDataWeights ( NueRecord nr  ) 

Definition at line 1430 of file NueStandard.cxx.

References VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), IsRun1(), IsRun2(), IsRun4(), IsRun5(), IsRun6(), IsRun7RHC(), IsRun8(), IsRun9RHC(), IsSpecialRun(), SimFlag::kData, and Detector::kNear.

Referenced by ExtrapHistsGen::FillHistograms(), NueUtilities::AnaNueProcessor::GetNDDataWeightedPOT(), and Trimmer::RunTrimmer().

01430                                                     {
01431   //Function to calculate Data event weights to correct for run proportions
01432    Double_t eventWeight = 1.0;
01433   
01434   //Check if it is MC
01435    if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kData &&
01436       nr->GetHeader().GetVldContext().GetDetector() == Detector::kNear)
01437    {
01438     
01439      //OLD ND DATA WEIGHTS FOR 3RD ANALYSIS
01440      //if(IsRun4(nr)) eventWeight *= 0.65625;
01441      //else if(IsRun5(nr)) eventWeight *= 0.701299;
01442      //else if(IsRun6(nr)) eventWeight *= 0.661466;
01443      //END OF OLD WEIGHTS
01444 
01445   if(!IsSpecialRun(nr)){
01446      //Period I 
01447     if(IsRun1(nr)) eventWeight *= 0.639286;
01448     else if(IsRun2(nr)) eventWeight *= 0.792391;
01449     else if(IsRun4(nr)) eventWeight *= 0.668901;
01450     else if(IsRun5(nr)) eventWeight *= 0.720630;
01451     else if(IsRun6(nr)) eventWeight *= 0.673991;
01452   
01453     //Period II
01454     else if(IsRun7RHC(nr)) eventWeight *= 1.13261095;
01455     else if(IsRun9RHC(nr)) eventWeight *= 0.91593815;
01456 
01457     //Period III
01458     else if(IsRun8(nr)) eventWeight *= 0.71409596;
01459     }
01460    }
01461    return(eventWeight);
01462  }

double NueStandard::GetNSIOscWeight ( int  nuFlavor,
int  nonOsc,
double  E 
)

Definition at line 1290 of file NueStandard.cxx.

References fOscGen, and OscCalc::OscillateNSI().

01291 {
01292   return fOscGen.OscillateNSI(nuFlavor,nonOsc,E);
01293 }

void NueStandard::GetOscParam ( double *  par  ) 
double NueStandard::GetOscWeight ( int  nuFlavor,
int  nonOsc,
double  E 
)

Definition at line 1284 of file NueStandard.cxx.

References fOscGen, isLSND, isNSI, OscCalc::Oscillate(), OscCalc::OscillateLSND(), and OscCalc::OscillateNSI().

Referenced by ExtrapHistsGen::FillHistograms(), NueUtilities::AnaNueProcessor::GetOscWeight_f210f213f214Separate(), NNTrain::MakeTrainTree(), and MiniMakerPID::RunMiniMakerPID().

01285 {
01286   if (isLSND){ return fOscGen.OscillateLSND(nuFlavor,nonOsc,E);}
01287   else if (isNSI){ return fOscGen.OscillateNSI(nuFlavor, nonOsc, E);}
01288   else{ return fOscGen.Oscillate(nuFlavor, nonOsc, E);}
01289 }

double NueStandard::GetPIDValue ( NueRecord nr,
Selection::Selection_t  sel 
)

Definition at line 602 of file NueStandard.cxx.

References NueRecord::ann, MCNNVars::bestmatches, Calc4thAnaANN(), PRecord::event, TreePID::fCutPID, LEM4pid::GetLEM4pid(), LEMAmby::GetLEMAmby(), LEMAmbyE50N5111::GetLEMAmbyE50N5111(), LEMAmbyE50N591::GetLEMAmbyE50N591(), LEMAmbyE50N6111::GetLEMAmbyE50N6111(), LEMAmbyE50N691::GetLEMAmbyE50N691(), LEMAmbyE50S491::GetLEMAmbyE50S491(), LEMAmbyE50S5111::GetLEMAmbyE50S5111(), LEMAmbyE50S591::GetLEMAmbyE50S591(), LEMAmbyE50S6111::GetLEMAmbyE50S6111(), LEMAmbyE50S691::GetLEMAmbyE50S691(), LEMbarpid::GetLEMbarpid(), LEMLSND::GetLEMLSND(), Selection::kANN14_DAIKON04, Selection::kANN2PE, Selection::kANN2PE_DAIKON04, Selection::kANN30, Selection::kANN4FHC, Selection::kANN4RHC, Selection::kANN6, Selection::kCuts, Selection::kLEM4, Selection::kLEMAmby, Selection::kLEMAmbyE50N491, Selection::kLEMAmbyE50N5111, Selection::kLEMAmbyE50N591, Selection::kLEMAmbyE50N6111, Selection::kLEMAmbyE50N691, Selection::kLEMAmbyE50S491, Selection::kLEMAmbyE50S5111, Selection::kLEMAmbyE50S591, Selection::kLEMAmbyE50S6111, Selection::kLEMAmbyE50S691, Selection::kLEMAmbySAE50S491, Selection::kLEMBAR, Selection::kLEMLSND, Selection::kLEMNNBAR, Selection::kMCNN, Selection::kParticlePID, Selection::kSSPID, Selection::kSSPIDME16, Selection::kSSPIDME22, Selection::kSSPIDME37, Selection::kSSPIDME43, Selection::kSSPIDME5, MCNNVars::mcnn_var1, MCNNVars::mcnn_var2, MCNNVars::mcnn_var3, MCNNVars::mcnn_var4, NueRecord::mcnnv, PassesParticlePIDPreselectionCut(), SubShowerVar::PHAvgDevU, SubShowerVar::PHAvgDevV, SubShowerVar::PHAvgIDU, SubShowerVar::PHAvgIDV, SubShowerVar::PHAvgProbEMU, SubShowerVar::PHAvgProbEMV, SubShowerVar::PHFracRMSU, SubShowerVar::PHFracRMSV, Ann::pid, SubShowerVar::pid, Ann::pid_11inp, Ann::pid_11inp_daikon04, Ann::pid_30inp, Ann::pid_6inp, Event::pidF, NueRecord::precord, NueRecord::subshowervars, NueRecord::treepid, SubShowerNN_ME43::Value(), SubShowerNN_ME22::Value(), SubShowerNN_ME5::Value(), SubShowerNN_ME37::Value(), and SubShowerNN_ME16::Value().

Referenced by NueSystematic::DoPIDSkew(), Trimmer::EvaluateCuts(), ExtrapHistsGen::FillHistograms(), GetPredWeights(), GetPredWeights_DO_NOT_USE(), NueModule::PassesBlindingCuts(), and PassesPIDSelection().

00603 {
00604   double retval = -9999;
00605 
00606   switch(sel) {
00607   case Selection::kCuts:  retval = nr->treepid.fCutPID;           break;
00608   case Selection::kANN6:  retval = nr->ann.pid_6inp;              break;
00609   case Selection::kANN30:  retval = nr->ann.pid_30inp;            break;
00610   case Selection::kANN2PE:  retval = nr->ann.pid_11inp;           break;
00611   case Selection::kANN2PE_DAIKON04:  retval = nr->ann.pid_11inp_daikon04;         break;
00612   case Selection::kANN14_DAIKON04:   retval = nr->ann.pid;        break;
00613 //  case Selection::kANN14_DAIKON04:   retval = nr->ann.pid_14inp_daikon04;         break;
00614   case Selection::kANN4FHC: 
00615     retval = NueStandard::Calc4thAnaANN(nr, Selection::kANN4FHC); break;
00616   case Selection::kANN4RHC: 
00617     retval = NueStandard::Calc4thAnaANN(nr, Selection::kANN4RHC); break;
00618   case Selection::kSSPID: retval = nr->subshowervars.pid;  break;
00619   case Selection::kMCNN:
00620      if (nr->mcnnv.bestmatches < 50)  retval = -0.5;
00621      else        retval = nr->mcnnv.mcnn_var1;                         break;   
00622   
00623   case Selection::kLEMNNBAR:
00624       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00625       else{
00626         //Merged Method
00627         retval = nr->mcnnv.mcnn_var2;
00628         
00629         //Stand Alone Selector Method
00630         //LEMNNbarpid lemnnbarpid;
00631         //retval = lemnnbarpid.GetLEMNNbarpid(nr);
00632            }                                                           break;
00633 
00634   case Selection::kLEMBAR:
00635       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00636       else{
00637         //Stand Alone Selector Method
00638         LEMbarpid lembarpid;
00639         retval = lembarpid.GetLEMbarpid(nr);
00640       }                                                                break;
00641 
00642   case Selection::kLEMAmbyE50N491:
00643       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00644       else{
00645         retval = nr->mcnnv.mcnn_var3;       
00646         //Stand Alone Selector Method Obsolete at Trim
00647         //LEMAmbyE50N491 lemambye50n491;
00648         //retval = lemambye50n491.GetLEMAmbyE50N491(nr);
00649       }                                                                break;
00650 
00651 
00652   case Selection::kLEMAmbyE50S491:
00653       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00654       else{
00655         retval = nr->mcnnv.mcnn_var4;
00656         //Stand Alone Selector Method Obsolete at Trim
00657         //LEMAmbyE50S491 lemambye50s491;
00658         //retval = lemambye50s491.GetLEMAmbyE50S491(nr);
00659       }                                                                break;
00660 
00661   case Selection::kLEMAmbySAE50S491:
00662       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00663       else{
00664         LEMAmbyE50S491 lemambye50s491;
00665         retval = lemambye50s491.GetLEMAmbyE50S491(nr);
00666       }                                                                break;
00667 
00668       //ALL kLEMAmby/LSND's below this point are obsolete trials and should not be used in analysis
00669 
00670   case Selection::kLEM4:
00671       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00672       else{
00673         //Stand Alone Selector Method
00674         LEM4pid lem4pid;
00675         retval = lem4pid.GetLEM4pid(nr);
00676       }                                                                break;
00677 
00678   case Selection::kLEMAmby:
00679       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00680       else{
00681         //Stand Alone Selector Method
00682         LEMAmby lemamby;
00683         retval = lemamby.GetLEMAmby(nr);
00684       }                                                                break;
00685 
00686   case Selection::kLEMLSND:
00687       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00688       else{
00689         //Stand Alone Selector Method
00690         LEMLSND lemlsnd;
00691         retval = lemlsnd.GetLEMLSND(nr);
00692       }                                                                break;
00693 
00694   case Selection::kLEMAmbyE50N591:
00695       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00696       else{
00697         //Stand Alone Selector Method
00698         LEMAmbyE50N591 lemambye50n591;
00699         retval = lemambye50n591.GetLEMAmbyE50N591(nr);
00700       }                                                                break;
00701 
00702   case Selection::kLEMAmbyE50N691:
00703       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00704       else{
00705         //Stand Alone Selector Method
00706         LEMAmbyE50N691 lemambye50n691;
00707         retval = lemambye50n691.GetLEMAmbyE50N691(nr);
00708       }                                                                break;
00709 
00710   case Selection::kLEMAmbyE50N5111:
00711       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00712       else{
00713         //Stand Alone Selector Method
00714         LEMAmbyE50N5111 lemambye50n5111;
00715         retval = lemambye50n5111.GetLEMAmbyE50N5111(nr);
00716       }                                                                break;
00717 
00718    case Selection::kLEMAmbyE50N6111:
00719       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00720       else{
00721         //Stand Alone Selector Method
00722         LEMAmbyE50N6111 lemambye50n6111;
00723         retval = lemambye50n6111.GetLEMAmbyE50N6111(nr);
00724       }                                                                break;
00725 
00726 
00727   case Selection::kLEMAmbyE50S591:
00728       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00729       else{
00730         //Stand Alone Selector Method
00731         LEMAmbyE50S591 lemambye50s591;
00732         retval = lemambye50s591.GetLEMAmbyE50S591(nr);
00733       }                                                                break;
00734 
00735   case Selection::kLEMAmbyE50S691:
00736       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00737       else{
00738         //Stand Alone Selector Method
00739         LEMAmbyE50S691 lemambye50s691;
00740         retval = lemambye50s691.GetLEMAmbyE50S691(nr);
00741       }                                                                break;
00742 
00743   case Selection::kLEMAmbyE50S5111:
00744       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00745       else{
00746         //Stand Alone Selector Method
00747         LEMAmbyE50S5111 lemambye50s5111;
00748         retval = lemambye50s5111.GetLEMAmbyE50S5111(nr);
00749       }                                                                break;
00750 
00751    case Selection::kLEMAmbyE50S6111:
00752       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00753       else{
00754         //Stand Alone Selector Method
00755         LEMAmbyE50S6111 lemambye50s6111;
00756         retval = lemambye50s6111.GetLEMAmbyE50S6111(nr);
00757       }                                                                break;
00758 
00759   case Selection::kParticlePID:
00760         if(PassesParticlePIDPreselectionCut(nr))retval = nr->precord.event.pidF;
00761         break;  
00762 
00763   case Selection::kSSPIDME5:
00764     if(nr->subshowervars.PHAvgIDU<-500||nr->subshowervars.PHAvgIDV<-500||nr->subshowervars.PHAvgProbEMU<-500||nr->subshowervars.PHAvgProbEMV<-500||nr->subshowervars.PHFracRMSU<-500||nr->subshowervars.PHFracRMSV<-500||nr->subshowervars.PHAvgDevU<-500||nr->subshowervars.PHAvgDevV<-500)  retval = -0.5;
00765     else{
00766       SubShowerNN_ME5 sspidme5;
00767       Double_t params[4];
00768       params[0] = nr->subshowervars.PHFracRMSU + nr->subshowervars.PHFracRMSV;
00769       params[1] = (nr->subshowervars.PHAvgProbEMU*nr->subshowervars.PHAvgProbEMU+nr->subshowervars.PHAvgProbEMV*nr->subshowervars.PHAvgProbEMV)/2.;
00770       params[2] = (nr->subshowervars.PHAvgIDU + nr->subshowervars.PHAvgIDV)/2.;
00771       params[3] = nr->subshowervars.PHAvgDevU + nr->subshowervars.PHAvgDevV;
00772       retval = sspidme5.Value(0,params[0],params[1],params[2],params[3]);
00773     }                                                        break;
00774 
00775   case Selection::kSSPIDME16:
00776     if(nr->subshowervars.PHAvgIDU<-500||nr->subshowervars.PHAvgIDV<-500||nr->subshowervars.PHAvgProbEMU<-500||nr->subshowervars.PHAvgProbEMV<-500||nr->subshowervars.PHFracRMSU<-500||nr->subshowervars.PHFracRMSV<-500||nr->subshowervars.PHAvgDevU<-500||nr->subshowervars.PHAvgDevV<-500)  retval = -0.5;
00777     else{
00778       SubShowerNN_ME16 sspidme16;
00779       Double_t params[4];
00780       params[0] = nr->subshowervars.PHFracRMSU + nr->subshowervars.PHFracRMSV;
00781       params[1] = (nr->subshowervars.PHAvgProbEMU*nr->subshowervars.PHAvgProbEMU+nr->subshowervars.PHAvgProbEMV*nr->subshowervars.PHAvgProbEMV)/2.;
00782       params[2] = (nr->subshowervars.PHAvgIDU + nr->subshowervars.PHAvgIDV)/2.;
00783       params[3] = nr->subshowervars.PHAvgDevU + nr->subshowervars.PHAvgDevV;
00784       retval = sspidme16.Value(0,params[0],params[1],params[2],params[3]);
00785     }                                                        break;
00786 
00787   case Selection::kSSPIDME22:
00788     if(nr->subshowervars.PHAvgIDU<-500||nr->subshowervars.PHAvgIDV<-500||nr->subshowervars.PHAvgProbEMU<-500||nr->subshowervars.PHAvgProbEMV<-500||nr->subshowervars.PHFracRMSU<-500||nr->subshowervars.PHFracRMSV<-500||nr->subshowervars.PHAvgDevU<-500||nr->subshowervars.PHAvgDevV<-500)  retval = -0.5;
00789     else{
00790       SubShowerNN_ME22 sspidme22;
00791       Double_t params[4];
00792       params[0] = nr->subshowervars.PHFracRMSU + nr->subshowervars.PHFracRMSV;
00793       params[1] = (nr->subshowervars.PHAvgProbEMU*nr->subshowervars.PHAvgProbEMU+nr->subshowervars.PHAvgProbEMV*nr->subshowervars.PHAvgProbEMV)/2.;
00794       params[2] = (nr->subshowervars.PHAvgIDU + nr->subshowervars.PHAvgIDV)/2.;
00795       params[3] = nr->subshowervars.PHAvgDevU + nr->subshowervars.PHAvgDevV;
00796       retval = sspidme22.Value(0,params[0],params[1],params[2],params[3]);
00797     }                                                        break;
00798 
00799   case Selection::kSSPIDME37:
00800     if(nr->subshowervars.PHAvgIDU<-500||nr->subshowervars.PHAvgIDV<-500||nr->subshowervars.PHAvgProbEMU<-500||nr->subshowervars.PHAvgProbEMV<-500||nr->subshowervars.PHFracRMSU<-500||nr->subshowervars.PHFracRMSV<-500||nr->subshowervars.PHAvgDevU<-500||nr->subshowervars.PHAvgDevV<-500)  retval = -0.5;
00801     else{
00802       SubShowerNN_ME37 sspidme37;
00803       Double_t params[4];
00804       params[0] = nr->subshowervars.PHFracRMSU + nr->subshowervars.PHFracRMSV;
00805       params[1] = (nr->subshowervars.PHAvgProbEMU*nr->subshowervars.PHAvgProbEMU+nr->subshowervars.PHAvgProbEMV*nr->subshowervars.PHAvgProbEMV)/2.;
00806       params[2] = (nr->subshowervars.PHAvgIDU + nr->subshowervars.PHAvgIDV)/2.;
00807       params[3] = nr->subshowervars.PHAvgDevU + nr->subshowervars.PHAvgDevV;
00808       retval = sspidme37.Value(0,params[0],params[1],params[2],params[3]);
00809     }                                                        break;
00810 
00811   case Selection::kSSPIDME43:
00812     if(nr->subshowervars.PHAvgIDU<-500||nr->subshowervars.PHAvgIDV<-500||nr->subshowervars.PHAvgProbEMU<-500||nr->subshowervars.PHAvgProbEMV<-500||nr->subshowervars.PHFracRMSU<-500||nr->subshowervars.PHFracRMSV<-500||nr->subshowervars.PHAvgDevU<-500||nr->subshowervars.PHAvgDevV<-500)  retval = -0.5;
00813     else{
00814       SubShowerNN_ME43 sspidme43;
00815       Double_t params[4];
00816       params[0] = nr->subshowervars.PHFracRMSU + nr->subshowervars.PHFracRMSV;
00817       params[1] = (nr->subshowervars.PHAvgProbEMU*nr->subshowervars.PHAvgProbEMU+nr->subshowervars.PHAvgProbEMV*nr->subshowervars.PHAvgProbEMV)/2.;
00818       params[2] = (nr->subshowervars.PHAvgIDU + nr->subshowervars.PHAvgIDV)/2.;
00819       params[3] = nr->subshowervars.PHAvgDevU + nr->subshowervars.PHAvgDevV;
00820       retval = sspidme43.Value(0,params[0],params[1],params[2],params[3]);
00821     }                                                        break;
00822 
00823   
00824   default:                                                        break;
00825   }
00826 
00827   return retval;
00828 }

Double_t NueStandard::GetPredWeights ( NueRecord nr  ) 

Definition at line 1499 of file NueStandard.cxx.

References VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), GetPIDValue(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), ANtpTruthInfo::interactionType, Detector::kFar, SimFlag::kMC, Selection::kMCNN, Selection::kPre, NueRecord::mctrue, ANtpTruthInfoBeam::nonOscNuFlavor, NueConvention::NueEnergyCorrection(), ANtpTruthInfo::nuFlavor, PassesSelection(), ANtpEventInfoNue::phNueGeV, predwts_bnuecc, predwts_nc, predwts_nuecc, predwts_numucc, predwts_nutaucc, NueRecord::srevent, and Background::TranslateFromMC().

01499                                                   {
01500   //Function to return prediction-to-raw ratio for nominal FD MC events
01501   Double_t eventWeight = 1.0;
01502   NueConvention::NueEnergyCorrection(nr);
01503 
01504   if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC &&
01505      nr->GetHeader().GetVldContext().GetDetector() == Detector::kFar &&
01506      NueStandard::PassesSelection(nr,Selection::kPre)){
01507 
01508     int iaction = nr->mctrue.interactionType;
01509     int inu = nr->mctrue.nuFlavor;
01510     int inunoosc = nr->mctrue.nonOscNuFlavor;
01511     int bgtype = (int)Background::TranslateFromMC(iaction,inu,inunoosc);
01512     
01513     double lemval = NueStandard::GetPIDValue(nr,Selection::kMCNN);
01514     int pidint = 0;
01515     if (lemval < 0) cout << "Got negative LEM PID value!! " << lemval << endl;
01516     if (lemval >= 0 && lemval < 0.5) pidint = 0;
01517     if (lemval >= 0.5 && lemval < 0.6) pidint = 1;
01518     if (lemval >= 0.6 && lemval < 0.7) pidint = 2;
01519     if (lemval >= 0.7 && lemval < 0.8) pidint = 3;
01520     if (lemval >= 0.8) pidint = 4;
01521 
01522     double recoE = nr->srevent.phNueGeV;
01523     int recoint = 0;
01524     if (recoE >= 1 && recoE < 2) recoint = 0;
01525     if (recoE >= 2 && recoE < 3) recoint = 1;
01526     if (recoE >= 3 && recoE < 4) recoint = 2;
01527     if (recoE >= 4 && recoE < 5) recoint = 3;
01528     if (recoE >= 5 && recoE < 8) recoint = 4;
01529 
01530     if (bgtype < 0 || bgtype > 4) cout << "Unknown background type. No prediction-to-raw weights available!" << endl;
01531 
01532     if (bgtype == 0) eventWeight = predwts_nuecc[recoint][pidint];
01533     if (bgtype == 1) eventWeight = predwts_nc[recoint][pidint];
01534     if (bgtype == 2) eventWeight = predwts_numucc[recoint][pidint];
01535     if (bgtype == 3) eventWeight = predwts_bnuecc[recoint][pidint];
01536     if (bgtype == 4) eventWeight = predwts_nutaucc[recoint][pidint];
01537     
01538   }
01539 
01540   return eventWeight;
01541   }

Double_t NueStandard::GetPredWeights_DO_NOT_USE ( NueRecord nr  ) 

Definition at line 1467 of file NueStandard.cxx.

References VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), GetPIDValue(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), ANtpTruthInfo::interactionType, Detector::kFar, SimFlag::kMC, Selection::kMCNN, Selection::kPre, NueRecord::mctrue, ANtpTruthInfoBeam::nonOscNuFlavor, ANtpTruthInfo::nuFlavor, PassesSelection(), predwts, and Background::TranslateFromMC().

01467                                                             {
01468   //Function to return prediction-to-raw ratio for nominal FD MC events
01469   Double_t eventWeight = 1.0;
01470 
01471   if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC &&
01472      nr->GetHeader().GetVldContext().GetDetector() == Detector::kFar &&
01473      NueStandard::PassesSelection(nr,Selection::kPre)){
01474 
01475     int iaction = nr->mctrue.interactionType;
01476     int inu = nr->mctrue.nuFlavor;
01477     int inunoosc = nr->mctrue.nonOscNuFlavor;
01478     int bgtype = (int)Background::TranslateFromMC(iaction,inu,inunoosc);
01479     
01480     double lemval = NueStandard::GetPIDValue(nr,Selection::kMCNN);
01481     int pidint = 0;
01482     if (lemval < 0) cout << "Got negative LEM PID value!!" << endl;
01483     if (lemval >= 0 && lemval < 0.5) pidint = 0;
01484     if (lemval >= 0.5 && lemval < 0.6) pidint = 1;
01485     if (lemval >= 0.6 && lemval < 0.7) pidint = 2;
01486     if (lemval >= 0.7 && lemval < 0.8) pidint = 3;
01487     if (lemval >= 0.8) pidint = 4;
01488 
01489     if (bgtype < 0 || bgtype > 4) cout << "Unknown background type. No prediction-to-raw weights available!" << endl;
01490     eventWeight = predwts[bgtype][pidint];
01491 
01492   }
01493 
01494   return eventWeight;
01495   
01496 }

double NueStandard::GetRPWBeamWeight ( std::vector< double >  weights,
std::vector< double >  pots 
)

Definition at line 1158 of file NueStandard.cxx.

01159 {
01160 
01161   double w=0.;
01162   double p=0.;
01163   for(unsigned int i=0;i<weights.size();i++){
01164     w+=weights[i]*pots[i];
01165     p+=pots[i];
01166   }
01167 
01168   if (p==0){
01169     cout<<"Total pots is set to zero, can not compute a exposure weighted average beam weight.  Returning 1"<<endl;
01170     return 1;
01171   }
01172 
01173   return w/p;
01174 }

double NueStandard::GetRPWBeamWeight ( NueRecord nr,
bool  ismrcc = false 
)

Definition at line 1060 of file NueStandard.cxx.

References det, NueRecord::fluxweights, NueHeader::GetBeamType(), VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), RecHeader::GetVldContext(), BeamType::kL010z000i, BeamType::kL010z000i_i209, BeamType::kL010z000i_i225, BeamType::kL010z000i_i232, BeamType::kL010z000i_i259, BeamType::kL010z000i_i300, BeamType::kL010z000i_i317, BeamType::kL010z000i_i326, BeamType::kL010z000i_i380, BeamType::kL010z185i, BeamType::kL010z185i_i124, BeamType::kL010z185i_i191, BeamType::kL010z185i_i213, BeamType::kL010z185i_i224, BeamType::kL010z185i_i232, BeamType::kL010z185i_i243, BeamType::kL010z185i_i257, BeamType::kL010z185i_i282, BeamType::kL010z185i_i303, BeamType::kL010z185i_i324, Detector::kNear, Msg::kWarning, MAXMSG, NueRecord::mctrue, NRUNPERIODS, ANtpTruthInfo::nuFlavor, pot_fd, pot_fdmrcc, pot_nd, pot_ndhornoff, pot_ndmrcc, and NueFluxWeights::RPtotbeamweight.

Referenced by NueExpBuilder::GenerateExperiment(), and NNTrain::MakeTrainTree().

01061 {
01062 
01063 
01064   std::vector<double> pots;
01065   
01066   Detector::Detector_t det = nr->GetHeader().GetVldContext().GetDetector();
01067   BeamType::BeamType_t beam = nr->GetHeader().GetBeamType();
01068 
01069   if(beam != BeamType::kL010z185i
01070      &&beam != BeamType::kL010z185i_i124 
01071      &&beam != BeamType::kL010z185i_i191   
01072      &&beam != BeamType::kL010z185i_i213
01073      &&beam != BeamType::kL010z185i_i224
01074      &&beam != BeamType::kL010z185i_i232
01075      &&beam != BeamType::kL010z185i_i243
01076      &&beam != BeamType::kL010z185i_i257
01077      &&beam != BeamType::kL010z185i_i282
01078      &&beam != BeamType::kL010z185i_i303
01079      &&beam != BeamType::kL010z185i_i324
01080    
01081      &&beam != BeamType::kL010z000i
01082      &&beam != BeamType::kL010z000i_i209
01083      &&beam != BeamType::kL010z000i_i225
01084      &&beam != BeamType::kL010z000i_i232
01085      &&beam != BeamType::kL010z000i_i259
01086      &&beam != BeamType::kL010z000i_i300
01087      &&beam != BeamType::kL010z000i_i317
01088      &&beam != BeamType::kL010z000i_i326
01089      &&beam != BeamType::kL010z000i_i380){
01090 
01091     MAXMSG("NueStandard",Msg::kWarning,5)<<"Can't use NueStandard::GetRPWBeamWeight for non L010185 or L010000 beams, stop it!"<<endl;
01092     return 0;
01093   }
01094 
01095   if (det==Detector::kNear){
01096     if (ismrcc){
01097       for(int i=0;i<NRUNPERIODS;i++){
01098         pots.push_back(pot_ndmrcc[i]);
01099       }
01100     }
01101     else if (beam == BeamType::kL010z185i
01102      ||beam == BeamType::kL010z185i_i124
01103      ||beam == BeamType::kL010z185i_i191
01104      ||beam == BeamType::kL010z185i_i213
01105      ||beam == BeamType::kL010z185i_i224
01106      ||beam == BeamType::kL010z185i_i232
01107      ||beam == BeamType::kL010z185i_i243
01108      ||beam == BeamType::kL010z185i_i257
01109      ||beam == BeamType::kL010z185i_i282
01110      ||beam == BeamType::kL010z185i_i303
01111      ||beam == BeamType::kL010z185i_i324){
01112       for(int i=0;i<NRUNPERIODS;i++){
01113         pots.push_back(pot_nd[i]);
01114       }
01115     }
01116     else if (beam==BeamType::kL010z000i
01117      ||beam == BeamType::kL010z000i_i209
01118      ||beam == BeamType::kL010z000i_i225
01119      ||beam == BeamType::kL010z000i_i232
01120      ||beam == BeamType::kL010z000i_i259
01121      ||beam == BeamType::kL010z000i_i300
01122      ||beam == BeamType::kL010z000i_i317  
01123      ||beam == BeamType::kL010z000i_i326
01124      ||beam == BeamType::kL010z000i_i380){
01125       for(int i=0;i<NRUNPERIODS;i++){
01126         pots.push_back(pot_ndhornoff[i]);
01127       }
01128     }
01129   }
01130   else{
01131     if (ismrcc){
01132       for(int i=0;i<NRUNPERIODS;i++){
01133         pots.push_back(pot_fdmrcc[i]);
01134       }
01135     }
01136     //FD has no intensity samples
01137     else if (beam==BeamType::kL010z185i){
01138       for(int i=0;i<NRUNPERIODS;i++){
01139         pots.push_back(pot_fd[i]);
01140       }
01141     }
01142     //FD has no intensity samples
01143     else if (beam==BeamType::kL010z000i){
01144       MAXMSG("NueStandard",Msg::kWarning,5)<<"Can't use NueStandard::GetRPWBeamWeight for FD L010000 beams, stop it!"<<endl;
01145       return 0;
01146     }
01147   }
01148 
01149   if(nr->mctrue.nuFlavor < -1000){
01150     MAXMSG("NueStandard",Msg::kWarning,5)<<"No truth info for this event returning 0 for beamweight"<<endl;
01151     return 0;
01152   }
01153 
01154   double weight = GetRPWBeamWeight(nr->fluxweights.RPtotbeamweight,pots);
01155   return weight;
01156 }

Double_t NueStandard::GetSKZPBeamWeight ( NueRecord nr  ) 

Definition at line 1589 of file NueStandard.cxx.

References NueRecord::fluxinfo, NueHeader::GetBeamType(), SKZPWeightCalculator::GetBeamWeight(), VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), ReleaseType::GetMCSubVersion(), NueHeader::GetRelease(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), ReleaseType::IsDaikon(), SimFlag::kMC, NueRecord::mctrue, ANtpTruthInfoBeam::nonOscNuFlavor, ANtpTruthInfo::nuEnergy, SKZPWeightCalculator::PrintReweightConfig(), BeamType::ToZarko(), NtpMCFluxInfo::tptype, NtpMCFluxInfo::tpx, NtpMCFluxInfo::tpy, and NtpMCFluxInfo::tpz.

Referenced by GetMCWeights().

01590  {
01591   //One time intialization
01592    string skzpVersion="DetXs";
01593    const int release = nr->GetHeader().GetRelease();
01594    if(ReleaseType::IsDaikon(release) && ReleaseType::GetMCSubVersion(release) == 7) 
01595    {
01596     skzpVersion="Dogwood1_Daikon07_v2";
01597    }
01598    else if(ReleaseType::IsDaikon(release) && ReleaseType::GetMCSubVersion(release) == 10)
01599    {
01600     skzpVersion="MINOSplus_2014_v2";
01601    }
01602 
01603  
01604    static SKZPWeightCalculator skzpWC(skzpVersion,true);  //static because we only want this created once
01605                                                        //and not every time it's called within a loop
01606    static bool firstTimeFunctionCalled = true;
01607   
01608    if(firstTimeFunctionCalled)
01609    {
01610     //print out the configuration information once
01611      skzpWC.PrintReweightConfig(std::cout);
01612      firstTimeFunctionCalled = false;
01613    }
01614 
01615   //Now get the weight
01616    Double_t eventWeight = 1.0;
01617    //cout << "NS1" << endl;
01618   //Check if it is MC
01619    if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC)
01620    {
01621 
01622     //Correct MC flux (i.e. SKZP and Helium) 
01623     double pt = (nr->fluxinfo.tpx * nr->fluxinfo.tpx);
01624            pt += (nr->fluxinfo.tpy * nr->fluxinfo.tpy);
01625            pt = sqrt(pt);
01626            //cout << "NS2" << endl;
01627     eventWeight = skzpWC.GetBeamWeight(
01628                                 nr->GetHeader().GetVldContext().GetDetector() /*int det*/,
01629                                 BeamType::ToZarko( nr->GetHeader().GetBeamType() ) /*int Ibeam*/,
01630 
01631                                 nr->fluxinfo.tptype /*int tptype*/,
01632                                 pt /*double pt*/,
01633                                 nr->fluxinfo.tpz /*double pz*/,
01634                       
01635                                 nr->mctrue.nuEnergy /*double true_enu*/,
01636                                 nr->mctrue.nonOscNuFlavor /*int inu*/,  //want weight before neutrino oscillations
01637                                 nr->GetHeader().GetVldContext() /*VldContext vc*/
01638                                );
01639    }
01640    //cout << "NS3" << endl;
01641    return(eventWeight);   
01642  }

bool NueStandard::IsGoodFarRun ( NueRecord nr  ) 

Definition at line 250 of file NueStandard.cxx.

References FilePosition::Event, Form(), VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), NueHeader::GetRun(), VldContext::GetSimFlag(), NueHeader::GetSubRun(), RecHeader::GetVldContext(), Msg::kError, SimFlag::kMC, Detector::kNear, MSG, FilePosition::Run, FilePosition::Snarl, and FilePosition::SubRun.

Referenced by IsGoodRun().

00251 {
00252   if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC)
00253   {
00254     return true;
00255   }
00256   
00257   if(nr->GetHeader().GetVldContext().GetDetector() == Detector::kNear)
00258   {
00259     return true;
00260   }
00261   
00262   //for far detector data
00263   static vector<FilePosition> badFDrunlist;
00264   static unsigned int listpos = 0;
00265   int Run, SubRun;
00266   
00267   // If this is the first call fill the file list
00268   if(badFDrunlist.size() == 0)
00269   {
00270     std::ifstream ins;
00271     char *srt_dir = getenv("SRT_PRIVATE_CONTEXT");
00272     ins.open(Form("%s/NueAna/badrunsFD_list.txt",srt_dir));
00273     if(!ins.is_open())
00274     {
00275       MSG("NueStandard", Msg::kError)<<"IsGoodFarRun(): Unable to open badrunsFD_list.txt"<<endl;
00276     }
00277 
00278     while(!ins.eof())
00279     {
00280       ins>>Run>>SubRun;
00281       FilePosition temp;
00282       if(!ins.eof()){
00283           temp.Run = Run;
00284           temp.SubRun = SubRun;
00285           temp.Snarl = -1;
00286           temp.Event = -1;
00287           badFDrunlist.push_back(temp);
00288       }
00289     }
00290     
00291     if(badFDrunlist.size() == 0)  return true;
00292    }
00293    
00294    FilePosition current;
00295    
00296    current.Snarl = -1;
00297    current.Event = -1;
00298    current.Run = nr->GetHeader().GetRun();
00299    current.SubRun = nr->GetHeader().GetSubRun();
00300    
00301    if(current < badFDrunlist[0]) return true;
00302 
00303    if(current > badFDrunlist[badFDrunlist.size() - 1]) return true;
00304 
00305    if(current > badFDrunlist[listpos] )
00306    {
00307       while(current > badFDrunlist[listpos] && listpos < badFDrunlist.size())
00308           listpos++;
00309    }
00310    else if(current < badFDrunlist[listpos] )
00311    {
00312       while(current < badFDrunlist[listpos] && listpos > 0)
00313           listpos--;
00314    }
00315 
00316    if(current == badFDrunlist[listpos])
00317    {
00318        return false;
00319    }
00320 
00321    
00322    return true;
00323 }

bool NueStandard::IsGoodNearRun ( NueRecord nr  ) 

Definition at line 209 of file NueStandard.cxx.

References VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), NueHeader::GetRun(), VldContext::GetSimFlag(), NueHeader::GetSubRun(), RecHeader::GetVldContext(), Detector::kFar, and SimFlag::kMC.

00210 {
00211   if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC)
00212   {
00213     return true;
00214   }
00215   
00216   if(nr->GetHeader().GetVldContext().GetDetector() == Detector::kFar)
00217   {
00218     return true;
00219   }
00220   
00221   //for near detector data
00222   if(nr->GetHeader().GetRun()==8165 || nr->GetHeader().GetRun()==11318)
00223   {
00224     return false;
00225   }
00226   
00227   if(nr->GetHeader().GetRun()==7942 && nr->GetHeader().GetSubRun()==0)
00228   {
00229     return false;
00230   }
00231   
00232   if(nr->GetHeader().GetRun()==7982 && nr->GetHeader().GetSubRun()==0)
00233   {
00234     return false;
00235   }
00236   
00237   if(nr->GetHeader().GetRun()==8214 && nr->GetHeader().GetSubRun()==0)
00238   {
00239     return false;
00240   }
00241   
00242   if(nr->GetHeader().GetRun()==9809 && nr->GetHeader().GetSubRun()==0)
00243   {
00244     return false;
00245   }
00246   
00247   return true;
00248 }

bool NueStandard::IsGoodRun ( NueRecord nr  ) 

Definition at line 194 of file NueStandard.cxx.

References VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), IsGoodFarRun(), Detector::kFar, and SimFlag::kMC.

Referenced by Trimmer::EvaluateCuts().

00195 {
00196   if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC)
00197   {
00198     return true;
00199   }
00200   
00201   if(nr->GetHeader().GetVldContext().GetDetector() == Detector::kFar)
00202   {
00203     return NueStandard::IsGoodFarRun(nr);
00204   }
00205   
00206   return false;
00207 }

bool NueStandard::IsInFid ( NueRecord nr  ) 
bool NueStandard::IsLargestEvent ( NueRecord nr  ) 

Definition at line 917 of file NueStandard.cxx.

References VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), RecHeader::GetVldContext(), Detector::kFar, ANtpEventInfoNue::largestEvent, and NueRecord::srevent.

Referenced by PassesPreSelectionBasicCuts().

00918 {
00919  if(nr->GetHeader().GetVldContext().GetDetector() == Detector::kFar){
00920     if(nr->srevent.largestEvent == 1) return true;
00921     return false;
00922  }
00923  return true;
00924 }

Bool_t NueStandard::IsRun1 ( NueRecord nr  ) 
Bool_t NueStandard::IsRun10 ( NueRecord nr  ) 

Definition at line 1402 of file NueStandard.cxx.

References RecRecordImp< T >::GetHeader(), VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), and RecHeader::GetVldContext().

01403 {
01404  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1316101520 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1370000000);
01405 }

Bool_t NueStandard::IsRun11 ( NueRecord nr  ) 
Bool_t NueStandard::IsRun12 ( NueRecord nr  ) 
Bool_t NueStandard::IsRun13 ( NueRecord nr  ) 
Bool_t NueStandard::IsRun2 ( NueRecord nr  ) 
Bool_t NueStandard::IsRun3 ( NueRecord nr  ) 

Definition at line 1348 of file NueStandard.cxx.

References IsRun3Prime().

Referenced by GetIntensityBeamWeight(), NueUtilities::AnaNueProcessor::isRun3(), NueUtilities::AnaNueProcessor::Normalization_RunSeparatedSample(), and Trimmer::RunTrimmer().

01349 {
01350 //True Run3
01351 // return(IsRun3NotPrime(nr));
01352 
01353 //Run3Prime
01354  return(IsRun3Prime(nr));
01355 }

Bool_t NueStandard::IsRun3NotPrime ( NueRecord nr  ) 

Definition at line 1362 of file NueStandard.cxx.

References RecRecordImp< T >::GetHeader(), VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), and RecHeader::GetVldContext().

01363 {
01364  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1190028111 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1249594050);
01365 }

Bool_t NueStandard::IsRun3Prime ( NueRecord nr  ) 

Definition at line 1357 of file NueStandard.cxx.

References RecRecordImp< T >::GetHeader(), VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), and RecHeader::GetVldContext().

Referenced by IsRun3().

01358 {
01359   return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1190028111 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1370000000);
01360 }

Bool_t NueStandard::IsRun4 ( NueRecord nr  ) 

Definition at line 1367 of file NueStandard.cxx.

References RecRecordImp< T >::GetHeader(), VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), and RecHeader::GetVldContext().

Referenced by GetNDDataWeights().

01368 {
01369  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1253039760 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1254248760);
01370 }

Bool_t NueStandard::IsRun4RHC ( NueRecord nr  ) 
Bool_t NueStandard::IsRun5 ( NueRecord nr  ) 

Definition at line 1377 of file NueStandard.cxx.

References RecRecordImp< T >::GetHeader(), VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), and RecHeader::GetVldContext().

Referenced by GetNDDataWeights().

01378 {
01379  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1269298800 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1273028400);
01380 }

Bool_t NueStandard::IsRun6 ( NueRecord nr  ) 

Definition at line 1382 of file NueStandard.cxx.

References RecRecordImp< T >::GetHeader(), VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), and RecHeader::GetVldContext().

Referenced by GetNDDataWeights().

01383 {
01384  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1273683600 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1278924900);
01385 }

Bool_t NueStandard::IsRun7RHC ( NueRecord nr  ) 
Bool_t NueStandard::IsRun8 ( NueRecord nr  ) 

Definition at line 1392 of file NueStandard.cxx.

References RecRecordImp< T >::GetHeader(), VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), and RecHeader::GetVldContext().

Referenced by GetNDDataWeights().

01393 {
01394  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1299011200 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1311993300);
01395 }

Bool_t NueStandard::IsRun9RHC ( NueRecord nr  ) 
Bool_t NueStandard::IsSpecialRun ( NueRecord nr  ) 

Definition at line 1425 of file NueStandard.cxx.

References NueRecord::bmon, RecRecordImp< T >::GetHeader(), VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), RecHeader::GetVldContext(), and BeamMon::hornI.

Referenced by GetNDDataWeights().

01426 {
01427   return(TMath::Abs(nr->bmon.hornI) < 1 || (TMath::Abs(nr->bmon.hornI) > 193 && TMath::Abs(nr->bmon.hornI) < 200 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1370000000 ) || ( nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1370000000 && TMath::Abs(nr->bmon.hornI) < 193 && TMath::Abs(nr->bmon.hornI) > 130 ) ); 
01428 }

void NueStandard::ModifyANNPID ( NueRecord nr  ) 

Definition at line 1644 of file NueStandard.cxx.

References NueRecord::ann, ANtpEventInfo::begPlane, FracVar::dis2stp, ANtpEventInfo::endPlane, exit(), FracVar::fract_1_plane, FracVar::fract_20_counters, FracVar::fract_5_planes, FracVar::fract_6_counters, FracVar::fract_road, NueRecord::fracvars, Shwfit::LongE, NueConvention::NueEnergyCorrection(), Shwfit::par_a, Shwfit::par_b, ANtpEventInfoNue::phNueGeV, Ann::pid, FracVar::shw_max, FracVar::shw_slp, NueRecord::shwfit, NueRecord::srevent, and Shwfit::uv_rms_9s_2pe_dw.

01644                                             {
01645  
01646  // This is only a temporary solution for the ANN14 PID.
01647  
01648   static bool firstcall = true;
01649   static TMultiLayerPerceptron* fneuralNet_14inp_daikon04 = 0;
01650 
01651   double ann14pid = -9999.9;
01652 
01653   char *srt_dir = getenv("SRT_PRIVATE_CONTEXT");
01654   char annfile[1000];
01655 
01656   if (firstcall) {
01657     srt_dir = getenv("SRT_PRIVATE_CONTEXT");
01658     sprintf(annfile,"%s/NueAna/data/ann14_400_14_9.root",srt_dir);
01659     ifstream Test2(annfile);
01660     if (!Test2){
01661       srt_dir = getenv("SRT_PUBLIC_CONTEXT");
01662       sprintf(annfile,"%s/NueAna/data/ann14_400_14_9.root",srt_dir);
01663       ifstream Test_again2(annfile);
01664       if (!Test_again2){
01665         cout<<"Couldn't find ANN object, blame Jiajie"<<endl;
01666         exit(0);
01667       }
01668     }
01669 
01670     static TFile *f = TFile::Open(annfile);
01671     fneuralNet_14inp_daikon04 = (TMultiLayerPerceptron*) f->Get("mlp");
01672   }
01673 
01674   if (!fneuralNet_14inp_daikon04) {
01675     cout << "Couldn't find ANN object, blame Jiajie" << endl;
01676     exit(0);
01677   }
01678 
01679   if (firstcall) {
01680     cout << "Get ann14 value from : " << annfile << endl;
01681     firstcall = false;
01682   }
01683 
01684   NueConvention::NueEnergyCorrection(nr); 
01685 
01686   double paras[14];
01687   paras[0] = nr->shwfit.par_a;
01688   paras[1] = nr->shwfit.par_b;
01689   paras[2] = nr->shwfit.uv_rms_9s_2pe_dw;
01690   paras[3] = nr->fracvars.fract_road;
01691   paras[4] = nr->shwfit.LongE;
01692   paras[5] = nr->fracvars.shw_max;
01693   paras[6] = nr->fracvars.shw_slp;
01694   paras[7] = nr->srevent.phNueGeV;
01695   paras[8] = nr->fracvars.dis2stp;
01696   paras[9] = nr->fracvars.fract_1_plane;
01697   paras[10] = nr->fracvars.fract_5_planes;
01698   paras[11] = nr->fracvars.fract_6_counters;
01699   paras[12] = nr->fracvars.fract_20_counters;
01700   paras[13] = TMath::Abs(nr->srevent.endPlane - nr->srevent.begPlane);
01701 
01702   int pass = 1;
01703 
01704   if (nr->shwfit.par_a<-1000) pass = 0;
01705   if (nr->shwfit.par_b<-1000) pass = 0;
01706   if (nr->shwfit.uv_rms_9s_2pe_dw<-1000) pass = 0;
01707   if (nr->fracvars.fract_1_plane<-1000) pass = 0;
01708   if (nr->fracvars.fract_5_planes<-1000) pass = 0;
01709   if (nr->fracvars.fract_6_counters<-1000) pass = 0;
01710   if (nr->fracvars.fract_20_counters<-1000) pass = 0;
01711   if (nr->fracvars.fract_road<-1000) pass = 0;
01712   if (nr->shwfit.LongE<-1000) pass = 0;
01713   if (nr->shwfit.LongE>1000) pass = 0;
01714   if (nr->fracvars.shw_max<-1000) pass = 0;
01715   if (nr->fracvars.dis2stp<-1000) pass = 0;
01716   if (nr->fracvars.shw_slp<0) pass = 0;
01717   if (nr->srevent.endPlane<-1000) pass = 0;
01718   if (nr->srevent.begPlane<-1000) pass = 0;
01719   
01720   if (pass) {
01721     ann14pid = fneuralNet_14inp_daikon04->Evaluate(0, paras);
01722   } 
01723 
01724   // set the ann.pid value to be ANN14 
01725   nr->ann.pid = ann14pid;
01726 }

bool NueStandard::PassesCCSelection ( NueRecord nr  ) 

Definition at line 1041 of file NueStandard.cxx.

References NueRecord::anainfo, ANtpTrackInfoNue::deltaUVVtx, ANtpTrackInfo::endPlaneU, ANtpTrackInfo::endPlaneV, ANtpTrackInfo::passedFit, AnalysisInfoNue::roCCPID, NueRecord::srevent, NueRecord::srtrack, and ANtpEventInfo::tracks.

Referenced by NueExtrapolationJB::BuildAppTrueHistExact(), NueExtrapolationJB::MakeDataHistograms(), PassesSelection(), and NueExtrapolationJB::PrepareExtrapHistograms().

01042 {
01043    int ntrack  = nr->srevent.tracks;
01044    int pass = nr->srtrack.passedFit;
01045    int endPlaneU = nr->srtrack.endPlaneU;
01046    int endPlaneV = nr->srtrack.endPlaneV;
01047    int deltaUVVtx = nr->srtrack.deltaUVVtx;   
01048 
01049    if (ntrack < 1){ pass = 0; endPlaneU = endPlaneV = deltaUVVtx = 300; }
01050 
01051    bool trackPass =  (pass == 1) || 
01052                 (deltaUVVtx <= 5 && TMath::Abs(endPlaneU - endPlaneV) <= 40
01053                    && endPlaneU < 270 && endPlaneV < 270);
01054 
01055 
01056    return  (ntrack > 0) && trackPass && nr->anainfo.roCCPID > 0.3;
01057 }

bool NueStandard::PassesCosmicCut ( NueRecord nr  ) 

Definition at line 386 of file NueStandard.cxx.

References BagTree::bt_var1, NueRecord::dtree, NueRecord::eventq, FillCosmicCut(), VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), RecHeader::GetVldContext(), Detector::kFar, Detector::kNear, and EventQual::passCosmicCut.

Referenced by NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), and PassesPreSelectionBasicCuts().

00387 {
00388   if(nr->GetHeader().GetVldContext().GetDetector() == Detector::kNear)
00389        return true;
00390 
00391    bool ret=true;
00392    if(nr->eventq.passCosmicCut > -10)
00393      return (nr->eventq.passCosmicCut == 1);
00394 
00395    //or we are still in Ent
00396  
00397    if(nr->dtree.bt_var1==0)ret = false;
00398    else if(nr->dtree.bt_var1==1)ret = true;
00399    else{ NueStandard::FillCosmicCut(nr); ret = nr->dtree.bt_var1; }
00400 
00401    Detector::Detector_t fDet;
00402    fDet = nr->GetHeader().GetVldContext().GetDetector();
00403    if (fDet != Detector::kFar) ret = true;
00404 
00405    return ret;
00406 }

bool NueStandard::PassesCosmicCutFunction ( NueRecord nr  ) 

Definition at line 361 of file NueStandard.cxx.

References ANtpTrackInfo::endX, ANtpTrackInfo::endY, ANtpTrackInfo::endZ, NueRecord::shwfit, NueRecord::srevent, NueRecord::srtrack, ANtpEventInfo::tracks, Shwfit::UVSlope, ANtpTrackInfo::vtxX, ANtpTrackInfo::vtxY, and ANtpTrackInfo::vtxZ.

Referenced by EventQualAna::Analyze(), and FillCosmicCut().

00362 {
00363    bool result=true;    
00364    //cosmicy shower cut
00365    result = result && !(nr->shwfit.UVSlope > 10);
00366 
00367    //cosmicy track cut
00368    if (nr->srevent.tracks<1) return result;  //require a track to apply this cut
00369 
00370    float ex =  nr->srtrack.endX;
00371    float ey =  nr->srtrack.endY;
00372    float ez =  nr->srtrack.endZ;
00373 
00374    float vx =  nr->srtrack.vtxX;
00375    float vy =  nr->srtrack.vtxY;
00376    float vz =  nr->srtrack.vtxZ;
00377 
00378    float cosy = acos(fabs(vy-ey)/sqrt((vx-ex)*(vx-ex)+(vy-ey)*(vy-ey)+(vz-ez)*(vz-ez))); 
00379    float dy=fabs(vy-ey);
00380 
00381    result = result && !(dy>2 && cosy < 0.6);
00382 
00383    return result;
00384 }

bool NueStandard::PassesDataQuality ( NueRecord nr  ) 

Definition at line 137 of file NueStandard.cxx.

References NueRecord::bmon, BeamMon::dt_stnd, NueRecord::eventq, ANtpEventInfoNue::eventTimeMin, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), isMC, Detector::kFar, SimFlag::kMC, Detector::kNear, PassesFarDataQuality(), PassesPOTStandards(), EventQual::rcBoundary, and NueRecord::srevent.

Referenced by NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), NNTrain::MakeTrainTree(), PassesSelection(), and MiniMaker::RunMiniMaker().

00138 {                                                 
00139    SimFlag::SimFlag_t sim = nr->GetHeader().GetVldContext().GetSimFlag();
00140    bool isMC = (sim == SimFlag::kMC);
00141    VldContext vld = nr->GetHeader().GetVldContext();
00142 
00143    if (isMC) return true;
00144    
00145    if(!PassesPOTStandards(nr)) return false;
00146 
00147    if(nr->GetHeader().GetVldContext().GetDetector() == Detector::kNear) return true;
00148 
00149    if (nr->GetHeader().GetVldContext().GetDetector() == Detector::kFar){
00150 
00151      int rcB = nr->eventq.rcBoundary;
00152      float tmin = nr->srevent.eventTimeMin;
00153      double spillT = nr->bmon.dt_stnd;   
00154      return PassesFarDataQuality(-1, rcB, 1, tmin, spillT);       
00155    }
00156 
00157    return false;
00158 }

bool NueStandard::PassesFarDataQuality ( float  li,
int  rc,
int  dpfddq,
float  tmin,
double  spillt 
)

Definition at line 184 of file NueStandard.cxx.

References MuELoss::e.

Referenced by PassesDataQuality().

00186 {
00187   if (li == -1 && rc == 0 && dpfddq == 1
00188     && (tmin - spillt) > -20e-6 && (tmin - spillt) < 30e-6)
00189      return true;
00190                                                                                 
00191   return false;
00192 }

bool NueStandard::PassesFarDataTiming ( NueRecord nr  ) 

Definition at line 170 of file NueStandard.cxx.

References NueRecord::bmon, BeamMon::dt_stnd, MuELoss::e, ANtpEventInfoNue::eventTimeMin, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), SimFlag::kData, Detector::kFar, and NueRecord::srevent.

00171 {
00172  if(
00173        Detector::kFar == nr->GetHeader().GetVldContext().GetDetector()
00174     && SimFlag::kData == nr->GetHeader().GetVldContext().GetSimFlag()
00175   )
00176  {
00177   float tmin = nr->srevent.eventTimeMin;
00178   double spillT = nr->bmon.dt_stnd;
00179   return( (tmin - spillT) > -2e-6 && (tmin - spillT) < 12e-6 );
00180  }
00181   return true;
00182 }

bool NueStandard::PassesHighEnergyCut ( float  energy  ) 

Definition at line 443 of file NueStandard.cxx.

00444 {
00445    return (energy < 12.0);
00446 }

bool NueStandard::PassesHighEnergyCut ( NueRecord nr  ) 

Definition at line 437 of file NueStandard.cxx.

References ANtpEventInfoNue::phNueGeV, and NueRecord::srevent.

Referenced by NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), and PassesPreSelection().

00438 {
00439    float energy = nr->srevent.phNueGeV;
00440    return PassesHighEnergyCut(energy);
00441 }

bool NueStandard::PassesLowEnergyCut ( float  energy  ) 

Definition at line 432 of file NueStandard.cxx.

00433 {
00434    return (energy > 1.0);
00435 }

bool NueStandard::PassesLowEnergyCut ( NueRecord nr  ) 

Definition at line 426 of file NueStandard.cxx.

References ANtpEventInfoNue::phNueGeV, and NueRecord::srevent.

Referenced by NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), and PassesNonHEPreSelection().

00427 {
00428    float energy = nr->srevent.phNueGeV;
00429    return PassesLowEnergyCut(energy);
00430 }

bool NueStandard::PassesMinPlaneCut ( int  planes  ) 

Definition at line 345 of file NueStandard.cxx.

00346 {
00347    return (planes > 4);
00348 }

bool NueStandard::PassesMinPlaneCut ( NueRecord nr  ) 

Definition at line 339 of file NueStandard.cxx.

References Shwfit::contPlaneCount050, and NueRecord::shwfit.

Referenced by NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), and PassesPreSelectionBasicCuts().

00340 {
00341    int planes = nr->shwfit.contPlaneCount050;
00342    return PassesMinPlaneCut(planes);
00343 }

bool NueStandard::PassesMRCCFiducial ( NueRecord nr  ) 

Definition at line 503 of file NueStandard.cxx.

References VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), NueConvention::IsInsideNearFiducial_MRE_Standard(), isMC, Detector::kFar, SimFlag::kMC, Detector::kNear, NueRecord::mri, MuonRemovalInfo::vtxx, MuonRemovalInfo::vtxy, and MuonRemovalInfo::vtxz.

Referenced by Trimmer::EvaluateCuts(), NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), PassesMREFiducial(), and PassesSelection().

00504 {
00505    float x = nr->mri.vtxx;
00506    float y = nr->mri.vtxy;
00507    float z = nr->mri.vtxz;
00508                                                                                 
00509    Detector::Detector_t fDet;
00510    fDet = nr->GetHeader().GetVldContext().GetDetector();
00511    
00512    SimFlag::SimFlag_t sim = nr->GetHeader().GetVldContext().GetSimFlag();
00513    bool isMC = (sim == SimFlag::kMC);
00514    int retval = 0;
00515                                                                                 
00516    if (fDet == Detector::kFar)
00517    {
00518      if(sqrt((x*x) + (y*y))>0.3 && sqrt((x*x) + (y*y))<sqrt(15.5) && ((z>0.3 && z<14.4)||(z>16.1 && z<28.2)))
00519      {
00520        retval=1;
00521      }
00522    }
00523        
00524    if (fDet == Detector::kNear)
00525      retval = NueConvention::IsInsideNearFiducial_MRE_Standard(x,y,z, isMC);
00526 
00527    return (retval == 1);
00528 }

bool NueStandard::PassesMRCCPreSelection ( float  bestComp,
int  fitp,
double  pid 
)

Definition at line 539 of file NueStandard.cxx.

00540 {
00541    //currently assumes RO-PID
00542    bool good = true;
00543    good = good && (bestComp > -10);
00544    good = good && (fitp == 1);
00545    good = good && (pid > 0.3);
00546                                                                                 
00547    return good;
00548 }

bool NueStandard::PassesMRCCPreSelection ( NueRecord nr  ) 

Definition at line 530 of file NueStandard.cxx.

References MuonRemovalInfo::best_complete, MuonRemovalInfo::fitp, NueRecord::mri, and MuonRemovalInfo::orig_roCCPID.

Referenced by Trimmer::EvaluateCuts(), NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), PassesMREPreSelection(), and PassesSelection().

00531 {
00532     double pid = nr->mri.orig_roCCPID;
00533     int fitp = nr->mri.fitp;
00534     float bestC = nr->mri.best_complete;
00535 
00536     return NueStandard::PassesMRCCPreSelection(bestC, fitp, pid);
00537 }

bool NueStandard::PassesMREFiducial ( NueRecord nr  ) 
bool NueStandard::PassesMREPreSelection ( float  bestComp,
int  fitp,
double  pid 
)

Definition at line 560 of file NueStandard.cxx.

References PassesMRCCPreSelection().

00561 {
00562     return NueStandard::PassesMRCCPreSelection(bestC, fitp, pid);
00563 }

bool NueStandard::PassesMREPreSelection ( NueRecord nr  ) 
bool NueStandard::PassesNCCleaningCuts ( NueRecord nr  ) 

Definition at line 1176 of file NueStandard.cxx.

References EventQual::closeTimeDeltaZ, MuELoss::e, EventQual::edgeActivityPH, EventQual::edgeActivityStrips, ANtpEventInfo::energyGeV, NueRecord::eventq, EventQual::minTimeSeparation, EventQual::oppEdgePH, EventQual::oppEdgeStrips, ANtpShowerInfo::planes, ANtpTrackInfo::planes, ANtpEventInfo::planes, NueRecord::srevent, NueRecord::srshower, NueRecord::srtrack, and ANtpEventInfo::totalStrips.

01177 {                                                                                
01178   // 40ns timing cut
01179   if (TMath::Abs(nr->eventq.minTimeSeparation)<40e-9)
01180     return false;
01181                                                                                 
01182   // tiny events are mostly junk
01183   if (nr->srevent.totalStrips<5)    return false;
01184                                                                                 
01185   // this cuts very steep showers, leaking in
01186   if ( (nr->srevent.totalStrips/(nr->srevent.planes*nr->srevent.planes))>1.0)
01187     return false;
01188                                                                                 
01189   // this cuts leakage which leaves activity in partially instrumented
01190   // region
01191   if ( (nr->eventq.edgeActivityStrips>3)
01192        && (nr->eventq.edgeActivityPH>1000)
01193        && (nr->srevent.energyGeV<5.0)
01194        && (nr->srshower.planes>nr->srtrack.planes) ) // don't cut out CC
01195     return false;
01196   // also cut out events with too much activity in the opposite edge region
01197   if ( (nr->eventq.oppEdgeStrips>3)
01198        && (nr->eventq.oppEdgePH>1000)
01199        && (nr->srevent.energyGeV<5.0 )
01200          && (nr->srshower.planes>nr->srtrack.planes) ) // don't cut out CC
01201     return false;
01202                                                                                 
01203   // make additional deltaZ cuts if (40ns<|minDeltaT|<120ns)
01204   if (TMath::Abs(nr->eventq.closeTimeDeltaZ)<1.0
01205       && TMath::Abs(nr->eventq.minTimeSeparation)<120e-9)
01206     return false;
01207                                                                                 
01208   // Survived all cuts
01209   return true;
01210 }

bool NueStandard::PassesNearDataQuality ( int  gbm,
float  cc,
int  st 
)

Definition at line 160 of file NueStandard.cxx.

00161 {
00162   //Assumes it is taking:
00163   // nr->bmon.goodBeamMon, nr->srevent.coilCurrent, nr->srevent.spillType
00164   if (gbm == 1 && cc < -1000.0 && st != 3)
00165      return true;
00166                                                                                 
00167   return false;
00168 }

bool NueStandard::PassesNonHEPreSelection ( int  tp,
int  tlp,
float  energy 
)

Definition at line 472 of file NueStandard.cxx.

References PassesLowEnergyCut(), and PassesPreSelectionTrackCuts().

00473 {
00474    bool temp = PassesPreSelectionTrackCuts(trkplane, tlp);
00475    temp = temp && PassesLowEnergyCut(energy);
00476    return temp;
00477 }

bool NueStandard::PassesNonHEPreSelection ( NueRecord nr  ) 
bool NueStandard::PassesParticlePIDCut ( NueRecord nr  ) 

Definition at line 859 of file NueStandard.cxx.

References PRecord::event, PassesParticlePIDPreselectionCut(), Event::pidF, and NueRecord::precord.

Referenced by PassesPIDSelection().

00860 {
00861         bool passPID=true;
00862         
00863         passPID = passPID && nr->precord.event.pidF>0.7;
00864 
00865         if(!passPID)return false;
00866 
00867 
00868         return passPID && PassesParticlePIDPreselectionCut(nr);
00869         
00870 
00871 }

bool NueStandard::PassesParticlePIDPreselectionCut ( NueRecord nr  ) 

Definition at line 874 of file NueStandard.cxx.

References det, PRecord::event, exit(), VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), RecHeader::GetVldContext(), Event::inFiducial, Detector::kFar, Detector::kNear, Particles::longest_s_particle_s, Event::max_z, Event::min_z, Particles::ntot, PRecord::particles, NueRecord::precord, and Event::visenergy.

Referenced by GetPIDValue(), and PassesParticlePIDCut().

00875 {
00876                 
00877         //fiducial cut
00878         bool passFid=true;
00879         passFid = passFid && (nr->precord.event.inFiducial==1); 
00880 
00881         if(!passFid)return false;
00882 
00883 
00884         double visenergy = nr->precord.event.visenergy;
00885                 
00886         //preselection cut
00887         int det = nr->GetHeader().GetVldContext().GetDetector();
00888         if(det == Detector::kFar)
00889         {
00890                 float offset =   0.489987;
00891                 float slope  =  0.0387301;
00892         visenergy = visenergy*slope+offset;
00893         }else if(det == Detector::kNear)
00894         {
00895                 float offset = 0.4803261;
00896                 float slope = 0.03799819;
00897                 visenergy = visenergy*slope+offset;
00898         }else{
00899                 printf("please don't run in a detector that is not near or far (NueStandard::PassesParticlePIDCut)\n");
00900                 exit(1);
00901         }
00902                 
00903         bool passPre=true;
00904                 
00905         double event_length=nr->precord.event.max_z-nr->precord.event.min_z;    
00906         passPre = passPre && event_length>0.1 && event_length<1.2;
00907         passPre = passPre && nr->precord.particles.longest_s_particle_s>0.1 && 
00908                 nr->precord.particles.longest_s_particle_s<1.2;
00909         passPre = passPre && nr->precord.particles.ntot>0;
00910         passPre = passPre && visenergy>0.5 && visenergy<8;      
00911 
00912         return passPre && passFid;
00913 
00914 }

bool NueStandard::PassesPIDSelection ( NueRecord nr,
Selection::Selection_t  sel 
)

Definition at line 830 of file NueStandard.cxx.

References GetPIDValue(), Selection::kANN14_DAIKON04, Selection::kANN2PE, Selection::kANN2PE_DAIKON04, Selection::kANN30, Selection::kANN4FHC, Selection::kANN4RHC, Selection::kANN6, Selection::kCuts, Selection::kLEMAmbyE50S491, Selection::kMCNN, Selection::kParticlePID, Selection::kSSPID, Selection::kSSPIDME16, Selection::kSSPIDME22, Selection::kSSPIDME37, Selection::kSSPIDME43, Selection::kSSPIDME5, and PassesParticlePIDCut().

Referenced by NueExtrapolationJB::MakeDataHistograms(), PassesSelection(), and NueExtrapolationJB::PrepareExtrapHistograms().

00831 {
00832   bool pass = false;
00833   double val = GetPIDValue(nr, sel);
00834                                                                                                   
00835   switch(sel) {
00836   case Selection::kCuts:  pass = (int(val) == 1);       break;
00837   case Selection::kANN6:   pass = val > 0.5;            break;
00838   case Selection::kANN30:  pass = val > 0.5;            break;
00839   case Selection::kANN2PE:  pass = val > 0.7;           break;
00840   case Selection::kANN2PE_DAIKON04:  pass = val > 0.7;  break;
00841   case Selection::kANN14_DAIKON04:   pass = val > 0.75; break;
00842   case Selection::kANN4FHC: pass = val > 0.7;           break;
00843   case Selection::kANN4RHC: pass = val > 0.7;           break;
00844   case Selection::kSSPID: pass = val > 0.67;            break;
00845   case Selection::kMCNN:  pass = val > 0.80;            break;
00846   case Selection::kParticlePID:  pass = PassesParticlePIDCut(nr); break;
00847   case Selection::kLEMAmbyE50S491:  pass = val > 0.70;  break;
00848   case Selection::kSSPIDME5: pass = val > 0.75;            break;
00849   case Selection::kSSPIDME16: pass = val > 0.84;            break;
00850   case Selection::kSSPIDME22: pass = val > 0.87;            break;
00851   case Selection::kSSPIDME37: pass = val > 0.78;            break;
00852   case Selection::kSSPIDME43: pass = val > 0.67;            break;
00853   default:                                              break;
00854   }
00855                                                                                                   
00856   return pass;
00857 }

bool NueStandard::PassesPOTStandards ( NueRecord nr  ) 

Definition at line 94 of file NueStandard.cxx.

References NueRecord::bmon, EventQual::coilDirection, EventQual::coilQuality, NueRecord::eventq, VldContext::GetDetector(), NueHeader::GetEventNo(), RecRecordImp< T >::GetHeader(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), VldContext::GetTimeStamp(), RecHeader::GetVldContext(), BeamMon::goodBeamMon, isMC, Detector::kFar, SimFlag::kMC, Detector::kNear, EventQual::passFarDetQuality, EventQual::passLI, EventQual::passNearDetQuality, and EventQual::spillType.

Referenced by NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), NueUtilities::AnaNueProcessor::GetNDDataWeightedPOT(), PassesDataQuality(), NueBeamMonModule::Reco(), MiniMakerPID::RunMiniMakerPID(), and Trimmer::RunTrimmer().

00095 {
00096    SimFlag::SimFlag_t sim = nr->GetHeader().GetVldContext().GetSimFlag();
00097    bool isMC = (sim == SimFlag::kMC);
00098    VldContext vld = nr->GetHeader().GetVldContext();
00099    int sec = nr->GetHeader().GetVldContext().GetTimeStamp().GetSec(); 
00100    if (isMC) return true;
00101    
00102    //common to both
00103    if (nr->bmon.goodBeamMon != 1) return false;
00104 
00105    
00106   //FHC ND
00107   //if(ND && (Run1-3 || Run5-6 || Run8 || Run10+))
00108   if (nr->GetHeader().GetVldContext().GetDetector() == Detector::kNear && (sec < 1254248760 || (sec > 1269298800 && sec < 1278924900) || (sec > 1299011200 && sec < 1311993300) || (sec > 1317803440) ) )
00109    {
00110      bool goodCoil =  nr->eventq.coilQuality && (nr->eventq.coilDirection ==1);
00111                       //CoilTools::IsOK(vld) && !CoilTools::IsReverse(vld);
00112      int dpDQ = nr->eventq.passNearDetQuality;
00113      return goodCoil && (dpDQ == 1);
00114    }
00115    
00116   //RHC ND
00117   //if(ND && (Run4 || Run7 || Run9))
00118   if (nr->GetHeader().GetVldContext().GetDetector() == Detector::kNear && ( (sec > 1254248760 && sec < 1269298800)|| (sec > 1278924900 && sec < 1299011200) || (sec > 1311993300 && sec < 1317803440) ) )
00119    {
00120      bool goodCoil =  nr->eventq.coilQuality && (nr->eventq.coilDirection ==-1);
00121      int dpDQ = nr->eventq.passNearDetQuality;
00122      return goodCoil && (dpDQ == 1);
00123    }
00124 
00125    if (nr->GetHeader().GetVldContext().GetDetector() == Detector::kFar)
00126    {
00127 
00128     if (nr->eventq.spillType != 1) return false;
00129     int dpDQ = nr->eventq.passFarDetQuality;
00130     if (nr->GetHeader().GetEventNo() < 0) return (dpDQ == 1);
00131 
00132      return (dpDQ == 1) && (nr->eventq.passLI == 1);
00133    }
00134 
00135    return false;
00136 }                                                                                                        

bool NueStandard::PassesPreSelection ( int  tp,
int  tlp,
float  energy 
)

Definition at line 457 of file NueStandard.cxx.

References PassesHighEnergyCut(), and PassesNonHEPreSelection().

00458 {
00459    bool temp = PassesNonHEPreSelection(trkplane, tlp, energy);
00460    temp = temp && PassesHighEnergyCut(energy);
00461    return temp;
00462 }

bool NueStandard::PassesPreSelection ( NueRecord nr  ) 
bool NueStandard::PassesPreSelectionBasicCuts ( NueRecord nr  ) 

Definition at line 493 of file NueStandard.cxx.

References IsLargestEvent(), one(), PassesCosmicCut(), PassesMinPlaneCut(), and PassesShowerCut().

Referenced by PassesNonHEPreSelection(), and PassesSelection().

00494 {
00495    bool one = PassesMinPlaneCut(nr);
00496    one = one && PassesCosmicCut(nr); 
00497    one = one && IsLargestEvent(nr);
00498    one = one && PassesShowerCut(nr);
00499 
00500    return one;
00501 }

bool NueStandard::PassesPreSelectionTrackCuts ( int  trkplane,
int  tlp 
)

Definition at line 486 of file NueStandard.cxx.

References PassesTrackLikePlaneCut(), and PassesTrackPlaneCut().

00487 {
00488    bool temp = PassesTrackPlaneCut(trkplane);
00489    temp = temp && PassesTrackLikePlaneCut(tlp);
00490    return temp;
00491 }

bool NueStandard::PassesPreSelectionTrackCuts ( NueRecord nr  ) 

Definition at line 479 of file NueStandard.cxx.

References PassesTrackLikePlaneCut(), and PassesTrackPlaneCut().

Referenced by Trimmer::EvaluateCuts(), and PassesNonHEPreSelection().

00480 {
00481    bool temp = PassesTrackPlaneCut(nr);
00482    temp = temp && PassesTrackLikePlaneCut(nr);
00483    return temp;  
00484 }

bool NueStandard::PassesSelection ( NueRecord nr,
Selection::Selection_t  sel,
Selection::Selection_t  sel2 
)

Definition at line 978 of file NueStandard.cxx.

References NueHeader::FoundMR(), RecRecordImp< T >::GetHeader(), infid(), IsInFid(), Selection::kANN14_DAIKON04, Selection::kANN2PE, Selection::kANN2PE_DAIKON04, Selection::kANN30, Selection::kANN4FHC, Selection::kANN4RHC, Selection::kANN6, Selection::kBasic, Selection::kBDT, Selection::kCC, Selection::kCuts, Selection::kDataQual, Selection::kFid, Selection::kKNue, Selection::kMCNN, Selection::kMDA, Selection::kNone, Selection::kPre, Selection::kSSPID, Selection::kSSPIDME16, Selection::kSSPIDME22, Selection::kSSPIDME37, Selection::kSSPIDME43, Selection::kSSPIDME5, PassesCCSelection(), PassesDataQuality(), PassesMRCCPreSelection(), PassesPIDSelection(), PassesPreSelection(), and PassesPreSelectionBasicCuts().

00979 {
00980   bool pass = false;
00981 
00982   bool dq = NueStandard::PassesDataQuality(nr);
00983   bool infid = NueStandard::IsInFid(nr) && dq;
00984   bool basic = NueStandard::PassesPreSelectionBasicCuts(nr);
00985   bool presel = NueStandard::PassesPreSelection(nr);
00986   bool pid = NueStandard::PassesPIDSelection(nr,sel);
00987 
00988   switch(sel2) {
00989   case Selection::kDataQual:  dq = true;                  break;
00990   case Selection::kFid:       infid = true;               break;
00991   case Selection::kBasic:     basic = true;               break;
00992   case Selection::kPre:       presel = true;              break;
00993   default:                                                break;
00994   }
00995   
00996   bool isMR = nr->GetHeader().FoundMR();
00997 
00998   if(isMR){
00999     bool mrfid = true; //PassesMRCCFiducial(nr);
01000     bool mrps = PassesMRCCPreSelection(nr);
01001 
01002     infid = infid && mrfid && mrps;
01003   }
01004   
01005   basic = basic && infid;
01006   presel = dq && infid && presel;
01007 
01008   switch(sel) {
01009   case Selection::kNone:  pass = true;                    break;
01010   case Selection::kDataQual:  pass = dq;                  break;
01011   case Selection::kFid:   pass = infid;                   break;
01012   case Selection::kBasic: pass = basic;                   break;
01013   case Selection::kPre:   pass = presel;                  break;
01014   case Selection::kCuts:  pass = presel && pid;           break;
01015   case Selection::kANN6:   pass = presel && pid;          break;
01016   case Selection::kANN30:  pass = presel && pid;          break;
01017   case Selection::kANN2PE: pass = presel && pid;          break;
01018   case Selection::kANN2PE_DAIKON04: pass = presel && pid; break;
01019   case Selection::kANN14_DAIKON04: pass = presel && pid;  break;
01020   case Selection::kANN4FHC: pass = presel && pid;         break;
01021   case Selection::kANN4RHC: pass = presel && pid;         break;
01022   case Selection::kSSPID: pass = presel && pid;           break;
01023   case Selection::kMCNN:  pass = presel && pid;           break;
01024   case Selection::kMDA:   pass = presel && false;         break;
01025   case Selection::kBDT:   pass = presel && false;         break;
01026   case Selection::kKNue:  pass = presel && false;         break;
01027   case Selection::kCC:    pass = infid &&
01028                      NueStandard::PassesCCSelection(nr);  break;
01029   case Selection::kSSPIDME5: pass = presel && pid;        break;
01030   case Selection::kSSPIDME16: pass = presel && pid;       break;
01031   case Selection::kSSPIDME22: pass = presel && pid;       break;
01032   case Selection::kSSPIDME37: pass = presel && pid;       break;
01033   case Selection::kSSPIDME43: pass = presel && pid;       break;
01034   default:                                                break;
01035   }
01036 
01037   return pass;
01038 }

bool NueStandard::PassesSelection ( NueRecord nr,
Selection::Selection_t  sel 
)

Definition at line 926 of file NueStandard.cxx.

References NueHeader::FoundMR(), RecRecordImp< T >::GetHeader(), infid(), IsInFid(), Selection::kANN14_DAIKON04, Selection::kANN2PE, Selection::kANN2PE_DAIKON04, Selection::kANN30, Selection::kANN4FHC, Selection::kANN4RHC, Selection::kANN6, Selection::kBasic, Selection::kBDT, Selection::kCC, Selection::kCuts, Selection::kDataQual, Selection::kFid, Selection::kKNue, Selection::kMCNN, Selection::kMDA, Selection::kNone, Selection::kPre, Selection::kSSPID, Selection::kSSPIDME16, Selection::kSSPIDME22, Selection::kSSPIDME37, Selection::kSSPIDME43, Selection::kSSPIDME5, PassesCCSelection(), PassesDataQuality(), PassesMRCCFiducial(), PassesMRCCPreSelection(), PassesPIDSelection(), PassesPreSelection(), and PassesPreSelectionBasicCuts().

Referenced by MiniMakerPID::EvaluateCuts(), MiniMaker::EvaluateCuts(), NueExpBuilder::EvaluateCuts(), Trimmer::EvaluateCuts(), ExtrapHistsGen::FillHistograms(), GetPredWeights(), GetPredWeights_DO_NOT_USE(), NueExtrapHelper::PassCuts(), and MiniMaker::RunMiniMaker().

00927 {
00928   bool pass = false;
00929 
00930   bool dq = NueStandard::PassesDataQuality(nr);
00931   bool infid = NueStandard::IsInFid(nr) && dq;
00932   
00933   bool isMR = nr->GetHeader().FoundMR();
00934 
00935   if (isMR){
00936     bool mrfid = PassesMRCCFiducial(nr);
00937     bool mrps = PassesMRCCPreSelection(nr);
00938 
00939     infid = infid && mrfid && mrps;
00940   } 
00941   
00942   bool basic = NueStandard::PassesPreSelectionBasicCuts(nr) && infid;
00943   bool presel = infid && NueStandard::PassesPreSelection(nr);
00944   bool pid = NueStandard::PassesPIDSelection(nr,sel); 
00945 
00946   switch(sel) {
00947   case Selection::kNone:     pass = true;                 break;
00948   case Selection::kDataQual: pass = dq;                   break;
00949   case Selection::kFid:      pass = infid;                break;
00950   case Selection::kBasic:    pass = basic;                break;
00951   case Selection::kPre:   pass = presel;                  break;
00952   case Selection::kCuts:  pass = presel && pid;           break;
00953   case Selection::kANN6:  pass = presel && pid;           break;
00954   case Selection::kANN30: pass = presel && pid;           break;
00955   case Selection::kANN2PE: pass = presel && pid;          break;
00956   case Selection::kANN2PE_DAIKON04: pass = presel && pid; break;
00957   case Selection::kANN14_DAIKON04: pass = presel && pid;  break;
00958   case Selection::kANN4FHC: pass = presel && pid;         break;
00959   case Selection::kANN4RHC: pass = presel && pid;         break;
00960   case Selection::kSSPID: pass = presel && pid;           break;
00961   case Selection::kMCNN:  pass = presel && pid;           break;
00962   case Selection::kMDA:   pass = presel && false;         break;
00963   case Selection::kBDT:   pass = presel && false;         break;
00964   case Selection::kKNue:  pass = presel && false;         break;
00965   case Selection::kCC:    pass = infid && 
00966                      NueStandard::PassesCCSelection(nr);  break;
00967   case Selection::kSSPIDME5: pass = presel && pid;        break;
00968   case Selection::kSSPIDME16: pass = presel && pid;       break;
00969   case Selection::kSSPIDME22: pass = presel && pid;       break;
00970   case Selection::kSSPIDME37: pass = presel && pid;       break;
00971   case Selection::kSSPIDME43: pass = presel && pid;       break;
00972   default:                                                break;
00973   }
00974 
00975   return pass;
00976 }

bool NueStandard::PassesShowerCut ( int  nshw  ) 

Definition at line 356 of file NueStandard.cxx.

00357 {
00358   return (nshw > 0);
00359 }

bool NueStandard::PassesShowerCut ( NueRecord nr  ) 

Definition at line 350 of file NueStandard.cxx.

References ANtpEventInfo::showers, and NueRecord::srevent.

Referenced by NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), and PassesPreSelectionBasicCuts().

00351 {
00352   int nshw = nr->srevent.showers;
00353   return PassesShowerCut(nshw);
00354 }

bool NueStandard::PassesSysPreSelection ( int  tp,
int  tlp,
float  energy 
)

Definition at line 593 of file NueStandard.cxx.

00594 {
00595    bool good = true;
00596    good = good && (trkplane < 28);
00597    good = good && (tlp < 18);
00598    good = good && (energy > 0.5 && energy < 10);
00599    return good;
00600 }

bool NueStandard::PassesSysPreSelection ( NueRecord nr  ) 
bool NueStandard::PassesSysPreSelectionNoHE ( int  tp,
int  tlp,
float  energy 
)

Definition at line 574 of file NueStandard.cxx.

00575 {
00576    bool good = true;
00577    good = good && (trkplane < 28);
00578    good = good && (tlp < 18);
00579    good = good && (energy > 0.5);
00580    return good;
00581 }

bool NueStandard::PassesSysPreSelectionNoHE ( NueRecord nr  ) 

Definition at line 565 of file NueStandard.cxx.

References ANtpTrackInfo::begPlane, ANtpTrackInfo::endPlane, ANtpEventInfoNue::phNueGeV, NueRecord::srevent, NueRecord::srtrack, and ANtpTrackInfoNue::trklikePlanes.

Referenced by Trimmer::EvaluateCuts(), and NueExpBuilder::EvaluateCuts().

00566 {
00567    int tp = TMath::Abs(nr->srtrack.endPlane - nr->srtrack.begPlane);
00568    int tlp = nr->srtrack.trklikePlanes;
00569    float energy = nr->srevent.phNueGeV;
00570 
00571    return PassesSysPreSelectionNoHE(tp, tlp, energy);
00572 }

bool NueStandard::PassesTrackLikePlaneCut ( int  tlp  ) 

Definition at line 421 of file NueStandard.cxx.

00422 {       
00423    return (tlp < 16);
00424 }

bool NueStandard::PassesTrackLikePlaneCut ( NueRecord nr  ) 

Definition at line 415 of file NueStandard.cxx.

References NueRecord::srtrack, and ANtpTrackInfoNue::trklikePlanes.

Referenced by NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), and PassesPreSelectionTrackCuts().

00416 {
00417    int tlp = nr->srtrack.trklikePlanes;
00418    return PassesTrackLikePlaneCut(tlp);
00419 }

bool NueStandard::PassesTrackPlaneCut ( int  trkplane  ) 

Definition at line 334 of file NueStandard.cxx.

00335 {
00336    return (trkplane < 25);
00337 }

bool NueStandard::PassesTrackPlaneCut ( NueRecord nr  ) 

Definition at line 327 of file NueStandard.cxx.

References ANtpTrackInfo::begPlane, ANtpTrackInfo::endPlane, and NueRecord::srtrack.

Referenced by NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), and PassesPreSelectionTrackCuts().

00328 {
00329    int tp = TMath::Abs(nr->srtrack.endPlane - nr->srtrack.begPlane);
00330 
00331    return PassesTrackPlaneCut(tp);
00332 }

void NueStandard::SetDefaultOscParam (  ) 

Definition at line 1212 of file NueStandard.cxx.

References fOscGen, OscPar::kDelta, OscPar::kDelta14, OscPar::kDelta24, OscPar::kDelta_emu, OscPar::kDelta_etau, OscPar::kDelta_mutau, OscPar::kDeltaM12, OscPar::kDeltaM23, OscPar::kDensity, OscPar::kDm41, OscPar::kEps_ee, OscPar::kEps_emu, OscPar::kEps_etau, OscPar::kEps_mumu, OscPar::kEps_mutau, OscPar::kEps_tautau, OscPar::kL, OscPar::kNuAntiNu, OscPar::kNumParameters, OscPar::kTh12, OscPar::kTh13, OscPar::kTh14, OscPar::kTh23, OscPar::kTh24, OscPar::kTh34, and OscCalc::SetOscParam().

Referenced by ExtrapHistsGen::Initialize(), NNTrain::MakeTrainTree(), MiniPlotMaker::MiniPlotMaker(), MiniMakerPID::RunMiniMakerPID(), SysFileGen2D::SetDefaultOsc(), SetDefaultOscParamNoNue(), SetOscParamBestFitANN(), and SetOscParamBestFitkNN().

01213 {  
01214   Double_t dm2_12 = 8.0e-5;  // best fit SNO
01215   Double_t dm2_23 = 2.32e-3;
01216 
01217   Double_t par[OscPar::kNumParameters] = {};
01218   par[OscPar::kL] = 735.0;
01219   par[OscPar::kTh23] = 3.1415926/4.0;
01220   par[OscPar::kTh12] = 0.59365;    // Sin2(2Th12) = 0.86
01221   par[OscPar::kTh13] = 0.19885;  // Sin2(2Th13) = 0.15;
01222   par[OscPar::kDeltaM23] = dm2_23; //normal heirarchy
01223   par[OscPar::kDeltaM12] = dm2_12;
01224   par[OscPar::kDensity] = 2.75; //standard rock density
01225   par[OscPar::kDelta] = 0;
01226   par[OscPar::kNuAntiNu] = 1;
01227 
01228   // Add NSI parameters:
01229   par[OscPar::kEps_ee] =  0;
01230   par[OscPar::kEps_emu] =  0;
01231   par[OscPar::kEps_etau] =  0;
01232   par[OscPar::kEps_mumu] =  0;
01233   par[OscPar::kEps_mutau] = 0; 
01234   par[OscPar::kEps_tautau] = 0; 
01235   par[OscPar::kDelta_emu] = 0;
01236   par[OscPar::kDelta_etau] = 0;
01237   par[OscPar::kDelta_mutau] = 0;
01238 
01239   par[OscPar::kDm41] =  0;
01240   par[OscPar::kTh14] = 0; 
01241   par[OscPar::kTh24] = 0; 
01242   par[OscPar::kTh34] = 0;
01243   par[OscPar::kDelta14] = 0;
01244   par[OscPar::kDelta24] = 0;
01245 
01246 
01247   fOscGen.SetOscParam(par);  
01248 
01249 }

void NueStandard::SetDefaultOscParamNoNue (  ) 

Definition at line 1251 of file NueStandard.cxx.

References OscPar::kTh13, SetDefaultOscParam(), and SetOscParam().

void NueStandard::SetE50PID ( NueRecord nr  ) 

Definition at line 1823 of file NueStandard.cxx.

References LEMAmbyE50N491::GetLEMAmbyE50N491(), LEMAmbyE50S491::GetLEMAmbyE50S491(), MCNNVars::mcnn_var3, MCNNVars::mcnn_var4, NueRecord::mcnnv, and NueConvention::NueEnergyCorrection().

Referenced by Trimmer::RunTrimmer().

01823                                          {
01824  
01825   NueConvention::NueEnergyCorrection(nr); 
01826   
01827   double retval = -9999;
01828   double secval = -9999;
01829 
01830   //Standard nue 
01831   LEMAmbyE50N491 setlemambye50n491;
01832   retval = setlemambye50n491.GetLEMAmbyE50N491(nr);
01833 
01834   //Sterile search
01835   LEMAmbyE50S491 setlemambye50s491;
01836   secval = setlemambye50s491.GetLEMAmbyE50S491(nr);
01837   
01838 
01839   // set the E50 LEM shtuff
01840   nr->mcnnv.mcnn_var3 = retval;
01841   nr->mcnnv.mcnn_var4 = secval;
01842 }

void NueStandard::SetLSND ( bool  lsndflag = true  ) 

Definition at line 66 of file NueStandard.cxx.

References isLSND.

00066                                        { 
00067   isLSND = lsndflag; 
00068 }

void NueStandard::SetNSI ( bool  nsiflag = true  ) 

Definition at line 58 of file NueStandard.cxx.

References isNSI.

00058                                      { 
00059   isNSI = nsiflag; 
00060 }

void NueStandard::SetOscNoMatter (  ) 
void NueStandard::SetOscParam ( OscPar::OscPar_t  pos,
double  val 
)

Definition at line 1279 of file NueStandard.cxx.

References fOscGen, and OscCalc::SetOscParam().

01280 {
01281   fOscGen.SetOscParam(pos, val);
01282 }

void NueStandard::SetOscParam ( double *  par  ) 
void NueStandard::SetOscParamBestFitANN (  ) 

Definition at line 1257 of file NueStandard.cxx.

References OscPar::kTh13, SetDefaultOscParam(), and SetOscParam().

01258 {
01259   NueStandard::SetDefaultOscParam();
01260   NueStandard::SetOscParam(OscPar::kTh13, 0.172088);
01261 }

void NueStandard::SetOscParamBestFitkNN (  ) 

Definition at line 1263 of file NueStandard.cxx.

References OscPar::kTh13, SetDefaultOscParam(), and SetOscParam().

01264 { 
01265   NueStandard::SetDefaultOscParam(); 
01266   NueStandard::SetOscParam(OscPar::kTh13, 0.145518);
01267 } 


Variable Documentation

bool NueStandard::isLSND = false [static]

Definition at line 63 of file NueStandard.cxx.

Referenced by GetOscWeight(), and SetLSND().

bool NueStandard::isNSI = false [static]

Definition at line 55 of file NueStandard.cxx.

Referenced by GetOscWeight(), and SetNSI().

Definition at line 53 of file NueStandard.h.

Definition at line 57 of file NueStandard.h.

Definition at line 59 of file NueStandard.h.

const Double_t NueStandard::kNormalizedFarPOT_Run1 = 1.20963e8 [static]
const Double_t NueStandard::kNormalizedFarPOT_Run10 = 2.34614e8 [static]

Definition at line 49 of file NueStandard.h.

const Double_t NueStandard::kNormalizedFarPOT_Run10prelim = 1.51499e8 + 0.611644e8 [static]

Definition at line 48 of file NueStandard.h.

const Double_t NueStandard::kNormalizedFarPOT_Run11 = 2.96697e8 [static]
const Double_t NueStandard::kNormalizedFarPOT_Run12 = -5743.8 [static]
const Double_t NueStandard::kNormalizedFarPOT_Run13 = -5743.8 [static]
const Double_t NueStandard::kNormalizedFarPOT_Run2 = 1.93577e8 [static]
const Double_t NueStandard::kNormalizedFarPOT_Run3 = 3.88063e8 [static]
const Double_t NueStandard::kNormalizedFarPOT_Run4 = 0.0810616e8 [static]

Definition at line 41 of file NueStandard.h.

const Double_t NueStandard::kNormalizedFarPOT_Run4RHC = 1.6997e8 [static]
const Double_t NueStandard::kNormalizedFarPOT_Run5 = 0.449622e8 [static]

Definition at line 43 of file NueStandard.h.

const Double_t NueStandard::kNormalizedFarPOT_Run6 = 0.61379e8 [static]

Definition at line 44 of file NueStandard.h.

const Double_t NueStandard::kNormalizedFarPOT_Run7RHC = 1.23052e8 [static]
const Double_t NueStandard::kNormalizedFarPOT_Run8 = 0.122894e8 [static]

Definition at line 46 of file NueStandard.h.

const Double_t NueStandard::kNormalizedFarPOT_Run9RHC = 0.407265e8 [static]

Definition at line 47 of file NueStandard.h.

const Double_t NueStandard::kNormalizedNearPOT = 1.0e7 [static]
const int NueStandard::NRUNPERIODS = 2 [static]

Definition at line 26 of file NueStandard.h.

Referenced by GetRPWBeamWeight().

const double NueStandard::pot_fd[NRUNPERIODS] = {0.398,0.602} [static]

Definition at line 27 of file NueStandard.h.

Referenced by GetRPWBeamWeight().

const double NueStandard::pot_fdmrcc[NRUNPERIODS] = {0.398,0.602} [static]

Definition at line 30 of file NueStandard.h.

Referenced by GetRPWBeamWeight().

const double NueStandard::pot_nd[NRUNPERIODS] = {0.383,0.617} [static]

Definition at line 28 of file NueStandard.h.

Referenced by GetRPWBeamWeight().

const double NueStandard::pot_ndhornoff[NRUNPERIODS] = {0.509,0.491} [static]

Definition at line 31 of file NueStandard.h.

Referenced by GetRPWBeamWeight().

const double NueStandard::pot_ndmrcc[NRUNPERIODS] = {0.393161,0.606839} [static]

Definition at line 29 of file NueStandard.h.

Referenced by GetRPWBeamWeight().

const Double_t NueStandard::predwts[5][5] [static]
Initial value:
 {{1.00232,1.00311,0.981931,0.981639,1.01361},
                                         {0.946369,1.03716,0.96031,0.80668,0.666657},
                                         {0.927385,1.00622,0.937925,0.794856,0.614556},
                                         {1.20908,1.0726,1.10532,0.938343,1.12485},
                                         {0.972292,0.972605,0.972527,0.972485,0.972984}}

Definition at line 71 of file NueStandard.h.

Referenced by GetPredWeights_DO_NOT_USE().

const Double_t NueStandard::predwts_bnuecc[5][5] [static]
Initial value:
 {{1.07792,1.02552,1.12685,1.04827,1.15549},
                                                {1.10753,0.998143,1.34637,0.821027,1.20424},
                                                {0.821103,0.950048,1.20129,0.757376,1.08648},
                                                {1.03969,1.18587,0.887482,1.06532,1.07671},
                                                {1.26007,1.00518,0.972437,1.10064,1.05491}}

Definition at line 95 of file NueStandard.h.

Referenced by GetPredWeights().

const Double_t NueStandard::predwts_nc[5][5] [static]
Initial value:
 {{0.863239,0.988428,0.931521,0.824146,0.708488},
                                            {0.921802,1.10491,1.03858,0.827883,0.636916},
                                            {0.956744,1.13551,0.963699,0.798763,0.622532},
                                            {0.983896,1.04438,0.925654,0.764158,0.761439},
                                            {1.02799,0.951312,0.939436,0.833891,0.899809}}

Definition at line 83 of file NueStandard.h.

Referenced by GetPredWeights().

const Double_t NueStandard::predwts_nuecc[5][5] [static]
Initial value:
 {{1.02611,1.02567,1.0064,1.00467,1.03611},
                                               {0.98242,0.982655,0.962493,0.96204,0.992857},
                                               {0.950664,0.952551,0.9306,0.931326,0.962668},
                                               {0.94193,0.945058,0.922595,0.923665,0.954923},
                                               {0.972311,0.972081,0.952034,0.951971,0.983061}}

Definition at line 77 of file NueStandard.h.

Referenced by GetPredWeights().

const Double_t NueStandard::predwts_numucc[5][5] [static]
Initial value:
 {{0.905015,1.06799,0.996018,0.899026,0.777587},
                                                {0.91316,1.0588,0.974574,0.832987,0.591156},
                                                {0.90616,0.933719,0.865338,0.66765,0.530119},
                                                {0.930668,0.938328,0.7928,0.712665,0.584523},
                                                {0.995441,0.801244,0.845764,0.695091,0.798452}}

Definition at line 89 of file NueStandard.h.

Referenced by GetPredWeights().

const Double_t NueStandard::predwts_nutaucc[5][5] [static]
Initial value:
 {{0.989861,0.992486,0.990626,0.986435,0.989023},
                                                 {0.986954,0.986549,0.98681,0.988837,0.988621},
                                                 {0.981899,0.982569,0.983938,0.982339,0.982898},
                                                 {0.975608,0.973232,0.977278,0.978017,0.977017},
                                                 {0.982638,0.984615,0.98071,0.98373,0.987868}}

Definition at line 101 of file NueStandard.h.

Referenced by GetPredWeights().


Generated on 8 Jul 2019 for loon by  doxygen 1.6.1