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 1648 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().

01648                                                                            {
01649 
01650   // This is only a temporary solution for the ANN11 PID for the 4th Analysis.
01651 
01652   static bool firstcall = true;
01653   static TMultiLayerPerceptron* fneuralNet_11ann4 = 0;
01654 
01655   double ann4pid = -9999.9;
01656   char annfile[1000];
01657 
01658   if (firstcall) {
01659     char *srt_dir = getenv("SRT_PRIVATE_CONTEXT");
01660 
01661     switch(sel) {
01662     case Selection::kANN4FHC:  
01663       sprintf(annfile,"%s/NueAna/data/ann11_ana4_fhc.root",srt_dir);  break;
01664     case Selection::kANN4RHC:
01665       sprintf(annfile,"%s/NueAna/data/ann11_ana4_rhc.root",srt_dir);  break;
01666     default:      break;
01667     }
01668       
01669     ifstream Test(annfile);
01670     if (!Test){
01671       srt_dir = getenv("SRT_PUBLIC_CONTEXT");
01672 
01673       switch(sel) {
01674       case Selection::kANN4FHC:
01675         sprintf(annfile,"%s/NueAna/data/ann11_ana4_fhc.root",srt_dir);  break;
01676       case Selection::kANN4RHC:
01677         sprintf(annfile,"%s/NueAna/data/ann11_ana4_rhc.root",srt_dir);  break;
01678       default:  break;
01679       }
01680 
01681       ifstream Test_again(annfile);
01682       if (!Test_again){
01683         cout<<"Couldn't find ANN root file, ask Xinjie"<<endl;
01684         exit(0);
01685       }
01686     }
01687 
01688     static TFile *f = TFile::Open(annfile);
01689     fneuralNet_11ann4 = (TMultiLayerPerceptron*) f->Get("mlp");
01690   }
01691 
01692   if (!fneuralNet_11ann4) {
01693     cout << "Couldn't find ANN object, ask Xinjie" << endl;
01694     exit(0);
01695   }
01696 
01697   if (firstcall) {
01698     cout << "Get ann11 value from : " << annfile << endl;
01699     firstcall = false;
01700   }
01701 
01702   double pars[11];
01703 
01704   pars[0] = nr->shwfit.par_a;
01705   pars[1] = nr->shwfit.par_b;
01706   pars[2] = nr->shwfit.uv_molrad_peak_9s_2pe_dw;
01707   pars[3] = nr->shwfit.uv_rms_9s_2pe_dw;
01708   pars[4] = nr->mstvars.e4w+nr->mstvars.o4w;
01709   pars[5] = nr->fracvars.fract_2_planes;
01710   pars[6] = nr->fracvars.fract_4_planes;
01711   pars[7] = nr->fracvars.fract_6_planes;
01712   pars[8] = nr->fracvars.fract_8_counters;
01713   pars[9] = nr->fracvars.fract_road;
01714   pars[10]= nr->shwfit.LongE;
01715   bool pass = true;
01716   if (nr->shwfit.par_a<-1000) pass = false;
01717   if (nr->shwfit.par_b<-1000) pass = false;
01718   if (nr->shwfit.uv_molrad_peak_9s_2pe_dw<-1000) pass = false;
01719   if (nr->shwfit.uv_rms_9s_2pe_dw<-1000) pass = false;
01720   if (nr->mstvars.e4w<-1000) pass = false;
01721   if (nr->mstvars.e4w>500) pass = false;
01722   if (nr->mstvars.o4w<-1000) pass = false;
01723   if (nr->mstvars.o4w>500) pass = false;
01724   if (nr->fracvars.fract_2_planes<-1000) pass = false;
01725   if (nr->fracvars.fract_4_planes<-1000) pass = false;
01726   if (nr->fracvars.fract_6_planes<-1000) pass = false;
01727   if (nr->fracvars.fract_8_counters<-1000) pass = false;
01728   if (nr->fracvars.fract_road<-1000) pass = false;
01729   if (nr->shwfit.LongE<-1000) pass = false;
01730   if (nr->shwfit.LongE>1000) pass = false;
01731 
01732   if (pass) {
01733       ann4pid = fneuralNet_11ann4->Evaluate(0,pars);
01734   }
01735 
01736   return ann4pid;
01737 }

void NueStandard::FillCosmicCut ( NueRecord nr  ) 

Definition at line 403 of file NueStandard.cxx.

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

Referenced by PassesCosmicCut().

00404 {
00405    int bv = 0;
00406    if (NueStandard::PassesCosmicCutFunction(nr)) bv=1;
00407    nr->dtree.bt_var1=bv;
00408 }

void NueStandard::FillDefaultOscParam ( double *  par  ) 

Definition at line 1218 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.

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

Double_t NueStandard::GetIntensityBeamWeight ( NueRecord nr  ) 

Definition at line 1481 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().

01481                                                          {
01482 
01483    Double_t eventWeight = 1.0;
01484 
01485    if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC &&
01486       nr->GetHeader().GetVldContext().GetDetector() == Detector::kNear &&
01487       IsRun3(nr)){
01488 
01489      switch(nr->GetHeader().GetBeamType()){
01490        case BeamType::kL010z185i_i124: eventWeight = 1.24932; break;
01491        case BeamType::kL010z185i_i191: eventWeight = 1.62047; break;
01492        case BeamType::kL010z185i_i213: eventWeight = 1.19021; break;
01493        case BeamType::kL010z185i_i224: eventWeight = 1.69376; break;
01494        case BeamType::kL010z185i_i232: eventWeight = 1.28621; break;
01495        case BeamType::kL010z185i_i243: eventWeight = 1.26755; break;
01496        case BeamType::kL010z185i_i257: eventWeight = 1.07360; break;
01497        case BeamType::kL010z185i_i282: eventWeight = 1.11812; break;
01498        case BeamType::kL010z185i_i303: eventWeight = 1.06092; break;
01499        case BeamType::kL010z185i_i324: eventWeight = 2.60657; break;
01500        default:                                               break;
01501      }
01502 
01503    }
01504 
01505    return(eventWeight);
01506  }

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

Definition at line 1214 of file NueStandard.cxx.

References fOscGen, and OscCalc::OscillateLSND().

01215 {
01216   return fOscGen.OscillateLSND(nuFlavor,nonOsc,E);
01217 }

Double_t NueStandard::GetMCWeights ( NueRecord nr  ) 

Definition at line 1465 of file NueStandard.cxx.

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

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

01466 {
01467   //Function to calculate MC event weights to correct for various effect
01468   Double_t eventWeight = 1.0;
01469   
01470   //Check if it is MC
01471   if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC)
01472    {
01473      //Correct MC flux (i.e. SKZP and Helium) 
01474      eventWeight *= NueStandard::GetIntensityBeamWeight(nr);
01475      eventWeight *= NueStandard::GetSKZPBeamWeight(nr);
01476    }
01477   
01478   return(eventWeight);   
01479 }

Double_t NueStandard::GetNDDataWeights ( NueRecord nr  ) 

Definition at line 1350 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().

01350                                                     {
01351   //Function to calculate Data event weights to correct for run proportions
01352    Double_t eventWeight = 1.0;
01353   
01354   //Check if it is MC
01355    if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kData &&
01356       nr->GetHeader().GetVldContext().GetDetector() == Detector::kNear)
01357    {
01358     
01359      //OLD ND DATA WEIGHTS FOR 3RD ANALYSIS
01360      //if(IsRun4(nr)) eventWeight *= 0.65625;
01361      //else if(IsRun5(nr)) eventWeight *= 0.701299;
01362      //else if(IsRun6(nr)) eventWeight *= 0.661466;
01363      //END OF OLD WEIGHTS
01364 
01365   if(!IsSpecialRun(nr)){
01366      //Period I 
01367     if(IsRun1(nr)) eventWeight *= 0.639286;
01368     else if(IsRun2(nr)) eventWeight *= 0.792391;
01369     else if(IsRun4(nr)) eventWeight *= 0.668901;
01370     else if(IsRun5(nr)) eventWeight *= 0.720630;
01371     else if(IsRun6(nr)) eventWeight *= 0.673991;
01372   
01373     //Period II
01374     else if(IsRun7RHC(nr)) eventWeight *= 1.13261095;
01375     else if(IsRun9RHC(nr)) eventWeight *= 0.91593815;
01376 
01377     //Period III
01378     else if(IsRun8(nr)) eventWeight *= 0.71409596;
01379     }
01380    }
01381    return(eventWeight);
01382  }

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

Definition at line 1210 of file NueStandard.cxx.

References fOscGen, and OscCalc::OscillateNSI().

01211 {
01212   return fOscGen.OscillateNSI(nuFlavor,nonOsc,E);
01213 }

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

Definition at line 1204 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().

01205 {
01206   if (isLSND){ return fOscGen.OscillateLSND(nuFlavor,nonOsc,E);}
01207   else if (isNSI){ return fOscGen.OscillateNSI(nuFlavor, nonOsc, E);}
01208   else{ return fOscGen.Oscillate(nuFlavor, nonOsc, E);}
01209 }

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

Definition at line 597 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, MCNNVars::mcnn_var1, MCNNVars::mcnn_var2, MCNNVars::mcnn_var3, MCNNVars::mcnn_var4, NueRecord::mcnnv, PassesParticlePIDPreselectionCut(), Ann::pid, SubShowerVar::pid, Ann::pid_11inp, Ann::pid_11inp_daikon04, Ann::pid_30inp, Ann::pid_6inp, Event::pidF, NueRecord::precord, NueRecord::subshowervars, and NueRecord::treepid.

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

00598 {
00599   double retval = -9999;
00600 
00601   switch(sel) {
00602   case Selection::kCuts:  retval = nr->treepid.fCutPID;           break;
00603   case Selection::kANN6:  retval = nr->ann.pid_6inp;              break;
00604   case Selection::kANN30:  retval = nr->ann.pid_30inp;            break;
00605   case Selection::kANN2PE:  retval = nr->ann.pid_11inp;           break;
00606   case Selection::kANN2PE_DAIKON04:  retval = nr->ann.pid_11inp_daikon04;         break;
00607   case Selection::kANN14_DAIKON04:   retval = nr->ann.pid;        break;
00608 //  case Selection::kANN14_DAIKON04:   retval = nr->ann.pid_14inp_daikon04;         break;
00609   case Selection::kANN4FHC: 
00610     retval = NueStandard::Calc4thAnaANN(nr, Selection::kANN4FHC); break;
00611   case Selection::kANN4RHC: 
00612     retval = NueStandard::Calc4thAnaANN(nr, Selection::kANN4RHC); break;
00613   case Selection::kSSPID: retval = nr->subshowervars.pid;  break;
00614   case Selection::kMCNN:
00615      if (nr->mcnnv.bestmatches < 50)  retval = -0.5;
00616      else        retval = nr->mcnnv.mcnn_var1;                         break;   
00617   
00618   case Selection::kLEMNNBAR:
00619       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00620       else{
00621         //Merged Method
00622         retval = nr->mcnnv.mcnn_var2;
00623         
00624         //Stand Alone Selector Method
00625         //LEMNNbarpid lemnnbarpid;
00626         //retval = lemnnbarpid.GetLEMNNbarpid(nr);
00627            }                                                           break;
00628 
00629   case Selection::kLEMBAR:
00630       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00631       else{
00632         //Stand Alone Selector Method
00633         LEMbarpid lembarpid;
00634         retval = lembarpid.GetLEMbarpid(nr);
00635       }                                                                break;
00636 
00637   case Selection::kLEMAmbyE50N491:
00638       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00639       else{
00640         retval = nr->mcnnv.mcnn_var3;       
00641         //Stand Alone Selector Method Obsolete at Trim
00642         //LEMAmbyE50N491 lemambye50n491;
00643         //retval = lemambye50n491.GetLEMAmbyE50N491(nr);
00644       }                                                                break;
00645 
00646 
00647   case Selection::kLEMAmbyE50S491:
00648       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00649       else{
00650         retval = nr->mcnnv.mcnn_var4;
00651         //Stand Alone Selector Method Obsolete at Trim
00652         //LEMAmbyE50S491 lemambye50s491;
00653         //retval = lemambye50s491.GetLEMAmbyE50S491(nr);
00654       }                                                                break;
00655 
00656   case Selection::kLEMAmbySAE50S491:
00657       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00658       else{
00659         LEMAmbyE50S491 lemambye50s491;
00660         retval = lemambye50s491.GetLEMAmbyE50S491(nr);
00661       }                                                                break;
00662 
00663       //ALL kLEMAmby/LSND's below this point are obsolete trials and should not be used in analysis
00664 
00665   case Selection::kLEM4:
00666       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00667       else{
00668         //Stand Alone Selector Method
00669         LEM4pid lem4pid;
00670         retval = lem4pid.GetLEM4pid(nr);
00671       }                                                                break;
00672 
00673   case Selection::kLEMAmby:
00674       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00675       else{
00676         //Stand Alone Selector Method
00677         LEMAmby lemamby;
00678         retval = lemamby.GetLEMAmby(nr);
00679       }                                                                break;
00680 
00681   case Selection::kLEMLSND:
00682       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00683       else{
00684         //Stand Alone Selector Method
00685         LEMLSND lemlsnd;
00686         retval = lemlsnd.GetLEMLSND(nr);
00687       }                                                                break;
00688 
00689   case Selection::kLEMAmbyE50N591:
00690       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00691       else{
00692         //Stand Alone Selector Method
00693         LEMAmbyE50N591 lemambye50n591;
00694         retval = lemambye50n591.GetLEMAmbyE50N591(nr);
00695       }                                                                break;
00696 
00697   case Selection::kLEMAmbyE50N691:
00698       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00699       else{
00700         //Stand Alone Selector Method
00701         LEMAmbyE50N691 lemambye50n691;
00702         retval = lemambye50n691.GetLEMAmbyE50N691(nr);
00703       }                                                                break;
00704 
00705   case Selection::kLEMAmbyE50N5111:
00706       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00707       else{
00708         //Stand Alone Selector Method
00709         LEMAmbyE50N5111 lemambye50n5111;
00710         retval = lemambye50n5111.GetLEMAmbyE50N5111(nr);
00711       }                                                                break;
00712 
00713    case Selection::kLEMAmbyE50N6111:
00714       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00715       else{
00716         //Stand Alone Selector Method
00717         LEMAmbyE50N6111 lemambye50n6111;
00718         retval = lemambye50n6111.GetLEMAmbyE50N6111(nr);
00719       }                                                                break;
00720 
00721 
00722   case Selection::kLEMAmbyE50S591:
00723       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00724       else{
00725         //Stand Alone Selector Method
00726         LEMAmbyE50S591 lemambye50s591;
00727         retval = lemambye50s591.GetLEMAmbyE50S591(nr);
00728       }                                                                break;
00729 
00730   case Selection::kLEMAmbyE50S691:
00731       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00732       else{
00733         //Stand Alone Selector Method
00734         LEMAmbyE50S691 lemambye50s691;
00735         retval = lemambye50s691.GetLEMAmbyE50S691(nr);
00736       }                                                                break;
00737 
00738   case Selection::kLEMAmbyE50S5111:
00739       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00740       else{
00741         //Stand Alone Selector Method
00742         LEMAmbyE50S5111 lemambye50s5111;
00743         retval = lemambye50s5111.GetLEMAmbyE50S5111(nr);
00744       }                                                                break;
00745 
00746    case Selection::kLEMAmbyE50S6111:
00747       if (nr->mcnnv.bestmatches < 50) retval = -0.5;
00748       else{
00749         //Stand Alone Selector Method
00750         LEMAmbyE50S6111 lemambye50s6111;
00751         retval = lemambye50s6111.GetLEMAmbyE50S6111(nr);
00752       }                                                                break;
00753 
00754 
00755   case Selection::kParticlePID:
00756         if(PassesParticlePIDPreselectionCut(nr))retval = nr->precord.event.pidF;
00757         break;  
00758   
00759   default:                                                        break;
00760   }
00761 
00762   return retval;
00763 }

Double_t NueStandard::GetPredWeights ( NueRecord nr  ) 

Definition at line 1419 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().

01419                                                   {
01420   //Function to return prediction-to-raw ratio for nominal FD MC events
01421   Double_t eventWeight = 1.0;
01422   NueConvention::NueEnergyCorrection(nr);
01423 
01424   if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC &&
01425      nr->GetHeader().GetVldContext().GetDetector() == Detector::kFar &&
01426      NueStandard::PassesSelection(nr,Selection::kPre)){
01427 
01428     int iaction = nr->mctrue.interactionType;
01429     int inu = nr->mctrue.nuFlavor;
01430     int inunoosc = nr->mctrue.nonOscNuFlavor;
01431     int bgtype = (int)Background::TranslateFromMC(iaction,inu,inunoosc);
01432     
01433     double lemval = NueStandard::GetPIDValue(nr,Selection::kMCNN);
01434     int pidint = 0;
01435     if (lemval < 0) cout << "Got negative LEM PID value!! " << lemval << endl;
01436     if (lemval >= 0 && lemval < 0.5) pidint = 0;
01437     if (lemval >= 0.5 && lemval < 0.6) pidint = 1;
01438     if (lemval >= 0.6 && lemval < 0.7) pidint = 2;
01439     if (lemval >= 0.7 && lemval < 0.8) pidint = 3;
01440     if (lemval >= 0.8) pidint = 4;
01441 
01442     double recoE = nr->srevent.phNueGeV;
01443     int recoint = 0;
01444     if (recoE >= 1 && recoE < 2) recoint = 0;
01445     if (recoE >= 2 && recoE < 3) recoint = 1;
01446     if (recoE >= 3 && recoE < 4) recoint = 2;
01447     if (recoE >= 4 && recoE < 5) recoint = 3;
01448     if (recoE >= 5 && recoE < 8) recoint = 4;
01449 
01450     if (bgtype < 0 || bgtype > 4) cout << "Unknown background type. No prediction-to-raw weights available!" << endl;
01451 
01452     if (bgtype == 0) eventWeight = predwts_nuecc[recoint][pidint];
01453     if (bgtype == 1) eventWeight = predwts_nc[recoint][pidint];
01454     if (bgtype == 2) eventWeight = predwts_numucc[recoint][pidint];
01455     if (bgtype == 3) eventWeight = predwts_bnuecc[recoint][pidint];
01456     if (bgtype == 4) eventWeight = predwts_nutaucc[recoint][pidint];
01457     
01458   }
01459 
01460   return eventWeight;
01461   }

Double_t NueStandard::GetPredWeights_DO_NOT_USE ( NueRecord nr  ) 

Definition at line 1387 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().

01387                                                             {
01388   //Function to return prediction-to-raw ratio for nominal FD MC events
01389   Double_t eventWeight = 1.0;
01390 
01391   if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC &&
01392      nr->GetHeader().GetVldContext().GetDetector() == Detector::kFar &&
01393      NueStandard::PassesSelection(nr,Selection::kPre)){
01394 
01395     int iaction = nr->mctrue.interactionType;
01396     int inu = nr->mctrue.nuFlavor;
01397     int inunoosc = nr->mctrue.nonOscNuFlavor;
01398     int bgtype = (int)Background::TranslateFromMC(iaction,inu,inunoosc);
01399     
01400     double lemval = NueStandard::GetPIDValue(nr,Selection::kMCNN);
01401     int pidint = 0;
01402     if (lemval < 0) cout << "Got negative LEM PID value!!" << endl;
01403     if (lemval >= 0 && lemval < 0.5) pidint = 0;
01404     if (lemval >= 0.5 && lemval < 0.6) pidint = 1;
01405     if (lemval >= 0.6 && lemval < 0.7) pidint = 2;
01406     if (lemval >= 0.7 && lemval < 0.8) pidint = 3;
01407     if (lemval >= 0.8) pidint = 4;
01408 
01409     if (bgtype < 0 || bgtype > 4) cout << "Unknown background type. No prediction-to-raw weights available!" << endl;
01410     eventWeight = predwts[bgtype][pidint];
01411 
01412   }
01413 
01414   return eventWeight;
01415   
01416 }

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

Definition at line 1078 of file NueStandard.cxx.

01079 {
01080 
01081   double w=0.;
01082   double p=0.;
01083   for(unsigned int i=0;i<weights.size();i++){
01084     w+=weights[i]*pots[i];
01085     p+=pots[i];
01086   }
01087 
01088   if (p==0){
01089     cout<<"Total pots is set to zero, can not compute a exposure weighted average beam weight.  Returning 1"<<endl;
01090     return 1;
01091   }
01092 
01093   return w/p;
01094 }

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

Definition at line 980 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().

00981 {
00982 
00983 
00984   std::vector<double> pots;
00985   
00986   Detector::Detector_t det = nr->GetHeader().GetVldContext().GetDetector();
00987   BeamType::BeamType_t beam = nr->GetHeader().GetBeamType();
00988 
00989   if(beam != BeamType::kL010z185i
00990      &&beam != BeamType::kL010z185i_i124 
00991      &&beam != BeamType::kL010z185i_i191   
00992      &&beam != BeamType::kL010z185i_i213
00993      &&beam != BeamType::kL010z185i_i224
00994      &&beam != BeamType::kL010z185i_i232
00995      &&beam != BeamType::kL010z185i_i243
00996      &&beam != BeamType::kL010z185i_i257
00997      &&beam != BeamType::kL010z185i_i282
00998      &&beam != BeamType::kL010z185i_i303
00999      &&beam != BeamType::kL010z185i_i324
01000    
01001      &&beam != BeamType::kL010z000i
01002      &&beam != BeamType::kL010z000i_i209
01003      &&beam != BeamType::kL010z000i_i225
01004      &&beam != BeamType::kL010z000i_i232
01005      &&beam != BeamType::kL010z000i_i259
01006      &&beam != BeamType::kL010z000i_i300
01007      &&beam != BeamType::kL010z000i_i317
01008      &&beam != BeamType::kL010z000i_i326
01009      &&beam != BeamType::kL010z000i_i380){
01010 
01011     MAXMSG("NueStandard",Msg::kWarning,5)<<"Can't use NueStandard::GetRPWBeamWeight for non L010185 or L010000 beams, stop it!"<<endl;
01012     return 0;
01013   }
01014 
01015   if (det==Detector::kNear){
01016     if (ismrcc){
01017       for(int i=0;i<NRUNPERIODS;i++){
01018         pots.push_back(pot_ndmrcc[i]);
01019       }
01020     }
01021     else if (beam == BeamType::kL010z185i
01022      ||beam == BeamType::kL010z185i_i124
01023      ||beam == BeamType::kL010z185i_i191
01024      ||beam == BeamType::kL010z185i_i213
01025      ||beam == BeamType::kL010z185i_i224
01026      ||beam == BeamType::kL010z185i_i232
01027      ||beam == BeamType::kL010z185i_i243
01028      ||beam == BeamType::kL010z185i_i257
01029      ||beam == BeamType::kL010z185i_i282
01030      ||beam == BeamType::kL010z185i_i303
01031      ||beam == BeamType::kL010z185i_i324){
01032       for(int i=0;i<NRUNPERIODS;i++){
01033         pots.push_back(pot_nd[i]);
01034       }
01035     }
01036     else if (beam==BeamType::kL010z000i
01037      ||beam == BeamType::kL010z000i_i209
01038      ||beam == BeamType::kL010z000i_i225
01039      ||beam == BeamType::kL010z000i_i232
01040      ||beam == BeamType::kL010z000i_i259
01041      ||beam == BeamType::kL010z000i_i300
01042      ||beam == BeamType::kL010z000i_i317  
01043      ||beam == BeamType::kL010z000i_i326
01044      ||beam == BeamType::kL010z000i_i380){
01045       for(int i=0;i<NRUNPERIODS;i++){
01046         pots.push_back(pot_ndhornoff[i]);
01047       }
01048     }
01049   }
01050   else{
01051     if (ismrcc){
01052       for(int i=0;i<NRUNPERIODS;i++){
01053         pots.push_back(pot_fdmrcc[i]);
01054       }
01055     }
01056     //FD has no intensity samples
01057     else if (beam==BeamType::kL010z185i){
01058       for(int i=0;i<NRUNPERIODS;i++){
01059         pots.push_back(pot_fd[i]);
01060       }
01061     }
01062     //FD has no intensity samples
01063     else if (beam==BeamType::kL010z000i){
01064       MAXMSG("NueStandard",Msg::kWarning,5)<<"Can't use NueStandard::GetRPWBeamWeight for FD L010000 beams, stop it!"<<endl;
01065       return 0;
01066     }
01067   }
01068 
01069   if(nr->mctrue.nuFlavor < -1000){
01070     MAXMSG("NueStandard",Msg::kWarning,5)<<"No truth info for this event returning 0 for beamweight"<<endl;
01071     return 0;
01072   }
01073 
01074   double weight = GetRPWBeamWeight(nr->fluxweights.RPtotbeamweight,pots);
01075   return weight;
01076 }

Double_t NueStandard::GetSKZPBeamWeight ( NueRecord nr  ) 

Definition at line 1509 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().

01510  {
01511   //One time intialization
01512    string skzpVersion="DetXs";
01513    const int release = nr->GetHeader().GetRelease();
01514    if(ReleaseType::IsDaikon(release) && ReleaseType::GetMCSubVersion(release) == 7) 
01515    {
01516     skzpVersion="Dogwood1_Daikon07_v2";
01517    }
01518    else if(ReleaseType::IsDaikon(release) && ReleaseType::GetMCSubVersion(release) == 10)
01519    {
01520     skzpVersion="MINOSplus_2014_v2";
01521    }
01522 
01523  
01524    static SKZPWeightCalculator skzpWC(skzpVersion,true);  //static because we only want this created once
01525                                                        //and not every time it's called within a loop
01526    static bool firstTimeFunctionCalled = true;
01527   
01528    if(firstTimeFunctionCalled)
01529    {
01530     //print out the configuration information once
01531      skzpWC.PrintReweightConfig(std::cout);
01532      firstTimeFunctionCalled = false;
01533    }
01534 
01535   //Now get the weight
01536    Double_t eventWeight = 1.0;
01537    //cout << "NS1" << endl;
01538   //Check if it is MC
01539    if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC)
01540    {
01541 
01542     //Correct MC flux (i.e. SKZP and Helium) 
01543     double pt = (nr->fluxinfo.tpx * nr->fluxinfo.tpx);
01544            pt += (nr->fluxinfo.tpy * nr->fluxinfo.tpy);
01545            pt = sqrt(pt);
01546            //cout << "NS2" << endl;
01547     eventWeight = skzpWC.GetBeamWeight(
01548                                 nr->GetHeader().GetVldContext().GetDetector() /*int det*/,
01549                                 BeamType::ToZarko( nr->GetHeader().GetBeamType() ) /*int Ibeam*/,
01550 
01551                                 nr->fluxinfo.tptype /*int tptype*/,
01552                                 pt /*double pt*/,
01553                                 nr->fluxinfo.tpz /*double pz*/,
01554                       
01555                                 nr->mctrue.nuEnergy /*double true_enu*/,
01556                                 nr->mctrue.nonOscNuFlavor /*int inu*/,  //want weight before neutrino oscillations
01557                                 nr->GetHeader().GetVldContext() /*VldContext vc*/
01558                                );
01559    }
01560    //cout << "NS3" << endl;
01561    return(eventWeight);   
01562  }

bool NueStandard::IsGoodFarRun ( NueRecord nr  ) 

Definition at line 245 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().

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

bool NueStandard::IsGoodNearRun ( NueRecord nr  ) 

Definition at line 204 of file NueStandard.cxx.

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

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

bool NueStandard::IsGoodRun ( NueRecord nr  ) 

Definition at line 189 of file NueStandard.cxx.

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

Referenced by Trimmer::EvaluateCuts().

00190 {
00191   if(nr->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC)
00192   {
00193     return true;
00194   }
00195   
00196   if(nr->GetHeader().GetVldContext().GetDetector() == Detector::kFar)
00197   {
00198     return NueStandard::IsGoodFarRun(nr);
00199   }
00200   
00201   return false;
00202 }

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

Definition at line 847 of file NueStandard.cxx.

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

Referenced by PassesPreSelectionBasicCuts().

00848 {
00849  if(nr->GetHeader().GetVldContext().GetDetector() == Detector::kFar){
00850     if(nr->srevent.largestEvent == 1) return true;
00851     return false;
00852  }
00853  return true;
00854 }

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

Definition at line 1322 of file NueStandard.cxx.

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

01323 {
01324  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1316101520 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1370000000);
01325 }

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 1268 of file NueStandard.cxx.

References IsRun3Prime().

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

01269 {
01270 //True Run3
01271 // return(IsRun3NotPrime(nr));
01272 
01273 //Run3Prime
01274  return(IsRun3Prime(nr));
01275 }

Bool_t NueStandard::IsRun3NotPrime ( NueRecord nr  ) 

Definition at line 1282 of file NueStandard.cxx.

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

01283 {
01284  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1190028111 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1249594050);
01285 }

Bool_t NueStandard::IsRun3Prime ( NueRecord nr  ) 

Definition at line 1277 of file NueStandard.cxx.

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

Referenced by IsRun3().

01278 {
01279   return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1190028111 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1370000000);
01280 }

Bool_t NueStandard::IsRun4 ( NueRecord nr  ) 

Definition at line 1287 of file NueStandard.cxx.

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

Referenced by GetNDDataWeights().

01288 {
01289  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1253039760 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1254248760);
01290 }

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

Definition at line 1297 of file NueStandard.cxx.

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

Referenced by GetNDDataWeights().

01298 {
01299  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1269298800 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1273028400);
01300 }

Bool_t NueStandard::IsRun6 ( NueRecord nr  ) 

Definition at line 1302 of file NueStandard.cxx.

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

Referenced by GetNDDataWeights().

01303 {
01304  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1273683600 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1278924900);
01305 }

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

Definition at line 1312 of file NueStandard.cxx.

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

Referenced by GetNDDataWeights().

01313 {
01314  return(nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() > 1299011200 && nr->GetHeader().GetVldContext().GetTimeStamp().GetSec() < 1311993300);
01315 }

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

Definition at line 1345 of file NueStandard.cxx.

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

Referenced by GetNDDataWeights().

01346 {
01347   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 ) ); 
01348 }

void NueStandard::ModifyANNPID ( NueRecord nr  ) 

Definition at line 1564 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.

01564                                             {
01565  
01566  // This is only a temporary solution for the ANN14 PID.
01567  
01568   static bool firstcall = true;
01569   static TMultiLayerPerceptron* fneuralNet_14inp_daikon04 = 0;
01570 
01571   double ann14pid = -9999.9;
01572 
01573   char *srt_dir = getenv("SRT_PRIVATE_CONTEXT");
01574   char annfile[1000];
01575 
01576   if (firstcall) {
01577     srt_dir = getenv("SRT_PRIVATE_CONTEXT");
01578     sprintf(annfile,"%s/NueAna/data/ann14_400_14_9.root",srt_dir);
01579     ifstream Test2(annfile);
01580     if (!Test2){
01581       srt_dir = getenv("SRT_PUBLIC_CONTEXT");
01582       sprintf(annfile,"%s/NueAna/data/ann14_400_14_9.root",srt_dir);
01583       ifstream Test_again2(annfile);
01584       if (!Test_again2){
01585         cout<<"Couldn't find ANN object, blame Jiajie"<<endl;
01586         exit(0);
01587       }
01588     }
01589 
01590     static TFile *f = TFile::Open(annfile);
01591     fneuralNet_14inp_daikon04 = (TMultiLayerPerceptron*) f->Get("mlp");
01592   }
01593 
01594   if (!fneuralNet_14inp_daikon04) {
01595     cout << "Couldn't find ANN object, blame Jiajie" << endl;
01596     exit(0);
01597   }
01598 
01599   if (firstcall) {
01600     cout << "Get ann14 value from : " << annfile << endl;
01601     firstcall = false;
01602   }
01603 
01604   NueConvention::NueEnergyCorrection(nr); 
01605 
01606   double paras[14];
01607   paras[0] = nr->shwfit.par_a;
01608   paras[1] = nr->shwfit.par_b;
01609   paras[2] = nr->shwfit.uv_rms_9s_2pe_dw;
01610   paras[3] = nr->fracvars.fract_road;
01611   paras[4] = nr->shwfit.LongE;
01612   paras[5] = nr->fracvars.shw_max;
01613   paras[6] = nr->fracvars.shw_slp;
01614   paras[7] = nr->srevent.phNueGeV;
01615   paras[8] = nr->fracvars.dis2stp;
01616   paras[9] = nr->fracvars.fract_1_plane;
01617   paras[10] = nr->fracvars.fract_5_planes;
01618   paras[11] = nr->fracvars.fract_6_counters;
01619   paras[12] = nr->fracvars.fract_20_counters;
01620   paras[13] = TMath::Abs(nr->srevent.endPlane - nr->srevent.begPlane);
01621 
01622   int pass = 1;
01623 
01624   if (nr->shwfit.par_a<-1000) pass = 0;
01625   if (nr->shwfit.par_b<-1000) pass = 0;
01626   if (nr->shwfit.uv_rms_9s_2pe_dw<-1000) pass = 0;
01627   if (nr->fracvars.fract_1_plane<-1000) pass = 0;
01628   if (nr->fracvars.fract_5_planes<-1000) pass = 0;
01629   if (nr->fracvars.fract_6_counters<-1000) pass = 0;
01630   if (nr->fracvars.fract_20_counters<-1000) pass = 0;
01631   if (nr->fracvars.fract_road<-1000) pass = 0;
01632   if (nr->shwfit.LongE<-1000) pass = 0;
01633   if (nr->shwfit.LongE>1000) pass = 0;
01634   if (nr->fracvars.shw_max<-1000) pass = 0;
01635   if (nr->fracvars.dis2stp<-1000) pass = 0;
01636   if (nr->fracvars.shw_slp<0) pass = 0;
01637   if (nr->srevent.endPlane<-1000) pass = 0;
01638   if (nr->srevent.begPlane<-1000) pass = 0;
01639   
01640   if (pass) {
01641     ann14pid = fneuralNet_14inp_daikon04->Evaluate(0, paras);
01642   } 
01643 
01644   // set the ann.pid value to be ANN14 
01645   nr->ann.pid = ann14pid;
01646 }

bool NueStandard::PassesCCSelection ( NueRecord nr  ) 

Definition at line 961 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().

00962 {
00963    int ntrack  = nr->srevent.tracks;
00964    int pass = nr->srtrack.passedFit;
00965    int endPlaneU = nr->srtrack.endPlaneU;
00966    int endPlaneV = nr->srtrack.endPlaneV;
00967    int deltaUVVtx = nr->srtrack.deltaUVVtx;   
00968 
00969    if (ntrack < 1){ pass = 0; endPlaneU = endPlaneV = deltaUVVtx = 300; }
00970 
00971    bool trackPass =  (pass == 1) || 
00972                 (deltaUVVtx <= 5 && TMath::Abs(endPlaneU - endPlaneV) <= 40
00973                    && endPlaneU < 270 && endPlaneV < 270);
00974 
00975 
00976    return  (ntrack > 0) && trackPass && nr->anainfo.roCCPID > 0.3;
00977 }

bool NueStandard::PassesCosmicCut ( NueRecord nr  ) 

Definition at line 381 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().

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

bool NueStandard::PassesCosmicCutFunction ( NueRecord nr  ) 

Definition at line 356 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().

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

bool NueStandard::PassesDataQuality ( NueRecord nr  ) 

Definition at line 132 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().

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

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

Definition at line 179 of file NueStandard.cxx.

References MuELoss::e.

Referenced by PassesDataQuality().

00181 {
00182   if (li == -1 && rc == 0 && dpfddq == 1
00183     && (tmin - spillt) > -20e-6 && (tmin - spillt) < 30e-6)
00184      return true;
00185                                                                                 
00186   return false;
00187 }

bool NueStandard::PassesFarDataTiming ( NueRecord nr  ) 

Definition at line 165 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.

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

bool NueStandard::PassesHighEnergyCut ( float  energy  ) 

Definition at line 438 of file NueStandard.cxx.

00439 {
00440    return (energy < 12.0);
00441 }

bool NueStandard::PassesHighEnergyCut ( NueRecord nr  ) 

Definition at line 432 of file NueStandard.cxx.

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

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

00433 {
00434    float energy = nr->srevent.phNueGeV;
00435    return PassesHighEnergyCut(energy);
00436 }

bool NueStandard::PassesLowEnergyCut ( float  energy  ) 

Definition at line 427 of file NueStandard.cxx.

00428 {
00429    return (energy > 1.0);
00430 }

bool NueStandard::PassesLowEnergyCut ( NueRecord nr  ) 

Definition at line 421 of file NueStandard.cxx.

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

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

00422 {
00423    float energy = nr->srevent.phNueGeV;
00424    return PassesLowEnergyCut(energy);
00425 }

bool NueStandard::PassesMinPlaneCut ( int  planes  ) 

Definition at line 340 of file NueStandard.cxx.

00341 {
00342    return (planes > 4);
00343 }

bool NueStandard::PassesMinPlaneCut ( NueRecord nr  ) 

Definition at line 334 of file NueStandard.cxx.

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

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

00335 {
00336    int planes = nr->shwfit.contPlaneCount050;
00337    return PassesMinPlaneCut(planes);
00338 }

bool NueStandard::PassesMRCCFiducial ( NueRecord nr  ) 

Definition at line 498 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().

00499 {
00500    float x = nr->mri.vtxx;
00501    float y = nr->mri.vtxy;
00502    float z = nr->mri.vtxz;
00503                                                                                 
00504    Detector::Detector_t fDet;
00505    fDet = nr->GetHeader().GetVldContext().GetDetector();
00506    
00507    SimFlag::SimFlag_t sim = nr->GetHeader().GetVldContext().GetSimFlag();
00508    bool isMC = (sim == SimFlag::kMC);
00509    int retval = 0;
00510                                                                                 
00511    if (fDet == Detector::kFar)
00512    {
00513      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)))
00514      {
00515        retval=1;
00516      }
00517    }
00518        
00519    if (fDet == Detector::kNear)
00520      retval = NueConvention::IsInsideNearFiducial_MRE_Standard(x,y,z, isMC);
00521 
00522    return (retval == 1);
00523 }

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

Definition at line 534 of file NueStandard.cxx.

00535 {
00536    //currently assumes RO-PID
00537    bool good = true;
00538    good = good && (bestComp > -10);
00539    good = good && (fitp == 1);
00540    good = good && (pid > 0.3);
00541                                                                                 
00542    return good;
00543 }

bool NueStandard::PassesMRCCPreSelection ( NueRecord nr  ) 

Definition at line 525 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().

00526 {
00527     double pid = nr->mri.orig_roCCPID;
00528     int fitp = nr->mri.fitp;
00529     float bestC = nr->mri.best_complete;
00530 
00531     return NueStandard::PassesMRCCPreSelection(bestC, fitp, pid);
00532 }

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

Definition at line 555 of file NueStandard.cxx.

References PassesMRCCPreSelection().

00556 {
00557     return NueStandard::PassesMRCCPreSelection(bestC, fitp, pid);
00558 }

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

Definition at line 1096 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.

01097 {                                                                                
01098   // 40ns timing cut
01099   if (TMath::Abs(nr->eventq.minTimeSeparation)<40e-9)
01100     return false;
01101                                                                                 
01102   // tiny events are mostly junk
01103   if (nr->srevent.totalStrips<5)    return false;
01104                                                                                 
01105   // this cuts very steep showers, leaking in
01106   if ( (nr->srevent.totalStrips/(nr->srevent.planes*nr->srevent.planes))>1.0)
01107     return false;
01108                                                                                 
01109   // this cuts leakage which leaves activity in partially instrumented
01110   // region
01111   if ( (nr->eventq.edgeActivityStrips>3)
01112        && (nr->eventq.edgeActivityPH>1000)
01113        && (nr->srevent.energyGeV<5.0)
01114        && (nr->srshower.planes>nr->srtrack.planes) ) // don't cut out CC
01115     return false;
01116   // also cut out events with too much activity in the opposite edge region
01117   if ( (nr->eventq.oppEdgeStrips>3)
01118        && (nr->eventq.oppEdgePH>1000)
01119        && (nr->srevent.energyGeV<5.0 )
01120          && (nr->srshower.planes>nr->srtrack.planes) ) // don't cut out CC
01121     return false;
01122                                                                                 
01123   // make additional deltaZ cuts if (40ns<|minDeltaT|<120ns)
01124   if (TMath::Abs(nr->eventq.closeTimeDeltaZ)<1.0
01125       && TMath::Abs(nr->eventq.minTimeSeparation)<120e-9)
01126     return false;
01127                                                                                 
01128   // Survived all cuts
01129   return true;
01130 }

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

Definition at line 155 of file NueStandard.cxx.

00156 {
00157   //Assumes it is taking:
00158   // nr->bmon.goodBeamMon, nr->srevent.coilCurrent, nr->srevent.spillType
00159   if (gbm == 1 && cc < -1000.0 && st != 3)
00160      return true;
00161                                                                                 
00162   return false;
00163 }

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

Definition at line 467 of file NueStandard.cxx.

References PassesLowEnergyCut(), and PassesPreSelectionTrackCuts().

00468 {
00469    bool temp = PassesPreSelectionTrackCuts(trkplane, tlp);
00470    temp = temp && PassesLowEnergyCut(energy);
00471    return temp;
00472 }

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

Definition at line 789 of file NueStandard.cxx.

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

Referenced by PassesPIDSelection().

00790 {
00791         bool passPID=true;
00792         
00793         passPID = passPID && nr->precord.event.pidF>0.7;
00794 
00795         if(!passPID)return false;
00796 
00797 
00798         return passPID && PassesParticlePIDPreselectionCut(nr);
00799         
00800 
00801 }

bool NueStandard::PassesParticlePIDPreselectionCut ( NueRecord nr  ) 

Definition at line 804 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().

00805 {
00806                 
00807         //fiducial cut
00808         bool passFid=true;
00809         passFid = passFid && (nr->precord.event.inFiducial==1); 
00810 
00811         if(!passFid)return false;
00812 
00813 
00814         double visenergy = nr->precord.event.visenergy;
00815                 
00816         //preselection cut
00817         int det = nr->GetHeader().GetVldContext().GetDetector();
00818         if(det == Detector::kFar)
00819         {
00820                 float offset =   0.489987;
00821                 float slope  =  0.0387301;
00822         visenergy = visenergy*slope+offset;
00823         }else if(det == Detector::kNear)
00824         {
00825                 float offset = 0.4803261;
00826                 float slope = 0.03799819;
00827                 visenergy = visenergy*slope+offset;
00828         }else{
00829                 printf("please don't run in a detector that is not near or far (NueStandard::PassesParticlePIDCut)\n");
00830                 exit(1);
00831         }
00832                 
00833         bool passPre=true;
00834                 
00835         double event_length=nr->precord.event.max_z-nr->precord.event.min_z;    
00836         passPre = passPre && event_length>0.1 && event_length<1.2;
00837         passPre = passPre && nr->precord.particles.longest_s_particle_s>0.1 && 
00838                 nr->precord.particles.longest_s_particle_s<1.2;
00839         passPre = passPre && nr->precord.particles.ntot>0;
00840         passPre = passPre && visenergy>0.5 && visenergy<8;      
00841 
00842         return passPre && passFid;
00843 
00844 }

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

Definition at line 765 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, and PassesParticlePIDCut().

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

00766 {
00767   bool pass = false;
00768   double val = GetPIDValue(nr, sel);
00769                                                                                                   
00770   switch(sel) {
00771   case Selection::kCuts:  pass = (int(val) == 1);       break;
00772   case Selection::kANN6:   pass = val > 0.5;            break;
00773   case Selection::kANN30:  pass = val > 0.5;            break;
00774   case Selection::kANN2PE:  pass = val > 0.7;           break;
00775   case Selection::kANN2PE_DAIKON04:  pass = val > 0.7;  break;
00776   case Selection::kANN14_DAIKON04:   pass = val > 0.75; break;
00777   case Selection::kANN4FHC: pass = val > 0.7;           break;
00778   case Selection::kANN4RHC: pass = val > 0.7;           break;
00779   case Selection::kSSPID: pass = val > 0.67;            break;
00780   case Selection::kMCNN:  pass = val > 0.80;            break;
00781   case Selection::kParticlePID:  pass = PassesParticlePIDCut(nr); break;
00782   case Selection::kLEMAmbyE50S491:  pass = val > 0.70;  break;
00783   default:                                              break;
00784   }
00785                                                                                                   
00786   return pass;
00787 }

bool NueStandard::PassesPOTStandards ( NueRecord nr  ) 

Definition at line 89 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().

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

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

Definition at line 452 of file NueStandard.cxx.

References PassesHighEnergyCut(), and PassesNonHEPreSelection().

00453 {
00454    bool temp = PassesNonHEPreSelection(trkplane, tlp, energy);
00455    temp = temp && PassesHighEnergyCut(energy);
00456    return temp;
00457 }

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

Definition at line 488 of file NueStandard.cxx.

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

Referenced by PassesNonHEPreSelection(), and PassesSelection().

00489 {
00490    bool one = PassesMinPlaneCut(nr);
00491    one = one && PassesCosmicCut(nr); 
00492    one = one && IsLargestEvent(nr);
00493    one = one && PassesShowerCut(nr);
00494 
00495    return one;
00496 }

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

Definition at line 481 of file NueStandard.cxx.

References PassesTrackLikePlaneCut(), and PassesTrackPlaneCut().

00482 {
00483    bool temp = PassesTrackPlaneCut(trkplane);
00484    temp = temp && PassesTrackLikePlaneCut(tlp);
00485    return temp;
00486 }

bool NueStandard::PassesPreSelectionTrackCuts ( NueRecord nr  ) 

Definition at line 474 of file NueStandard.cxx.

References PassesTrackLikePlaneCut(), and PassesTrackPlaneCut().

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

00475 {
00476    bool temp = PassesTrackPlaneCut(nr);
00477    temp = temp && PassesTrackLikePlaneCut(nr);
00478    return temp;  
00479 }

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

Definition at line 903 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, PassesCCSelection(), PassesDataQuality(), PassesMRCCPreSelection(), PassesPIDSelection(), PassesPreSelection(), and PassesPreSelectionBasicCuts().

00904 {
00905   bool pass = false;
00906 
00907   bool dq = NueStandard::PassesDataQuality(nr);
00908   bool infid = NueStandard::IsInFid(nr) && dq;
00909   bool basic = NueStandard::PassesPreSelectionBasicCuts(nr);
00910   bool presel = NueStandard::PassesPreSelection(nr);
00911   bool pid = NueStandard::PassesPIDSelection(nr,sel);
00912 
00913   switch(sel2) {
00914   case Selection::kDataQual:  dq = true;                  break;
00915   case Selection::kFid:       infid = true;               break;
00916   case Selection::kBasic:     basic = true;               break;
00917   case Selection::kPre:       presel = true;              break;
00918   default:                                                break;
00919   }
00920   
00921   bool isMR = nr->GetHeader().FoundMR();
00922 
00923   if(isMR){
00924     bool mrfid = true; //PassesMRCCFiducial(nr);
00925     bool mrps = PassesMRCCPreSelection(nr);
00926 
00927     infid = infid && mrfid && mrps;
00928   }
00929   
00930   basic = basic && infid;
00931   presel = dq && infid && presel;
00932 
00933   switch(sel) {
00934   case Selection::kNone:  pass = true;                    break;
00935   case Selection::kDataQual:  pass = dq;                  break;
00936   case Selection::kFid:   pass = infid;                   break;
00937   case Selection::kBasic: pass = basic;                   break;
00938   case Selection::kPre:   pass = presel;                  break;
00939   case Selection::kCuts:  pass = presel && pid;           break;
00940   case Selection::kANN6:   pass = presel && pid;          break;
00941   case Selection::kANN30:  pass = presel && pid;          break;
00942   case Selection::kANN2PE: pass = presel && pid;          break;
00943   case Selection::kANN2PE_DAIKON04: pass = presel && pid; break;
00944   case Selection::kANN14_DAIKON04: pass = presel && pid;  break;
00945   case Selection::kANN4FHC: pass = presel && pid;         break;
00946   case Selection::kANN4RHC: pass = presel && pid;         break;
00947   case Selection::kSSPID: pass = presel && pid;           break;
00948   case Selection::kMCNN:  pass = presel && pid;           break;
00949   case Selection::kMDA:   pass = presel && false;         break;
00950   case Selection::kBDT:   pass = presel && false;         break;
00951   case Selection::kKNue:  pass = presel && false;         break;
00952   case Selection::kCC:    pass = infid &&
00953                      NueStandard::PassesCCSelection(nr);  break;
00954   default:                                                break;
00955   }
00956 
00957   return pass;
00958 }

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

Definition at line 856 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, 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().

00857 {
00858   bool pass = false;
00859 
00860   bool dq = NueStandard::PassesDataQuality(nr);
00861   bool infid = NueStandard::IsInFid(nr) && dq;
00862   
00863   bool isMR = nr->GetHeader().FoundMR();
00864 
00865   if (isMR){
00866     bool mrfid = PassesMRCCFiducial(nr);
00867     bool mrps = PassesMRCCPreSelection(nr);
00868 
00869     infid = infid && mrfid && mrps;
00870   } 
00871   
00872   bool basic = NueStandard::PassesPreSelectionBasicCuts(nr) && infid;
00873   bool presel = infid && NueStandard::PassesPreSelection(nr);
00874   bool pid = NueStandard::PassesPIDSelection(nr,sel); 
00875 
00876   switch(sel) {
00877   case Selection::kNone:     pass = true;                 break;
00878   case Selection::kDataQual: pass = dq;                   break;
00879   case Selection::kFid:      pass = infid;                break;
00880   case Selection::kBasic:    pass = basic;                break;
00881   case Selection::kPre:   pass = presel;                  break;
00882   case Selection::kCuts:  pass = presel && pid;           break;
00883   case Selection::kANN6:  pass = presel && pid;           break;
00884   case Selection::kANN30: pass = presel && pid;           break;
00885   case Selection::kANN2PE: pass = presel && pid;          break;
00886   case Selection::kANN2PE_DAIKON04: pass = presel && pid; break;
00887   case Selection::kANN14_DAIKON04: pass = presel && pid;  break;
00888   case Selection::kANN4FHC: pass = presel && pid;         break;
00889   case Selection::kANN4RHC: pass = presel && pid;         break;
00890   case Selection::kSSPID: pass = presel && pid;           break;
00891   case Selection::kMCNN:  pass = presel && pid;           break;
00892   case Selection::kMDA:   pass = presel && false;         break;
00893   case Selection::kBDT:   pass = presel && false;         break;
00894   case Selection::kKNue:  pass = presel && false;         break;
00895   case Selection::kCC:    pass = infid && 
00896                      NueStandard::PassesCCSelection(nr);  break;
00897   default:                                                break;
00898   }
00899 
00900   return pass;
00901 }

bool NueStandard::PassesShowerCut ( int  nshw  ) 

Definition at line 351 of file NueStandard.cxx.

00352 {
00353   return (nshw > 0);
00354 }

bool NueStandard::PassesShowerCut ( NueRecord nr  ) 

Definition at line 345 of file NueStandard.cxx.

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

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

00346 {
00347   int nshw = nr->srevent.showers;
00348   return PassesShowerCut(nshw);
00349 }

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

Definition at line 588 of file NueStandard.cxx.

00589 {
00590    bool good = true;
00591    good = good && (trkplane < 28);
00592    good = good && (tlp < 18);
00593    good = good && (energy > 0.5 && energy < 10);
00594    return good;
00595 }

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

Definition at line 569 of file NueStandard.cxx.

00570 {
00571    bool good = true;
00572    good = good && (trkplane < 28);
00573    good = good && (tlp < 18);
00574    good = good && (energy > 0.5);
00575    return good;
00576 }

bool NueStandard::PassesSysPreSelectionNoHE ( NueRecord nr  ) 

Definition at line 560 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().

00561 {
00562    int tp = TMath::Abs(nr->srtrack.endPlane - nr->srtrack.begPlane);
00563    int tlp = nr->srtrack.trklikePlanes;
00564    float energy = nr->srevent.phNueGeV;
00565 
00566    return PassesSysPreSelectionNoHE(tp, tlp, energy);
00567 }

bool NueStandard::PassesTrackLikePlaneCut ( int  tlp  ) 

Definition at line 416 of file NueStandard.cxx.

00417 {       
00418    return (tlp < 16);
00419 }

bool NueStandard::PassesTrackLikePlaneCut ( NueRecord nr  ) 

Definition at line 410 of file NueStandard.cxx.

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

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

00411 {
00412    int tlp = nr->srtrack.trklikePlanes;
00413    return PassesTrackLikePlaneCut(tlp);
00414 }

bool NueStandard::PassesTrackPlaneCut ( int  trkplane  ) 

Definition at line 329 of file NueStandard.cxx.

00330 {
00331    return (trkplane < 25);
00332 }

bool NueStandard::PassesTrackPlaneCut ( NueRecord nr  ) 

Definition at line 322 of file NueStandard.cxx.

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

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

00323 {
00324    int tp = TMath::Abs(nr->srtrack.endPlane - nr->srtrack.begPlane);
00325 
00326    return PassesTrackPlaneCut(tp);
00327 }

void NueStandard::SetDefaultOscParam (  ) 

Definition at line 1132 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().

01133 {  
01134   Double_t dm2_12 = 8.0e-5;  // best fit SNO
01135   Double_t dm2_23 = 2.32e-3;
01136 
01137   Double_t par[OscPar::kNumParameters] = {};
01138   par[OscPar::kL] = 735.0;
01139   par[OscPar::kTh23] = 3.1415926/4.0;
01140   par[OscPar::kTh12] = 0.59365;    // Sin2(2Th12) = 0.86
01141   par[OscPar::kTh13] = 0.19885;  // Sin2(2Th13) = 0.15;
01142   par[OscPar::kDeltaM23] = dm2_23; //normal heirarchy
01143   par[OscPar::kDeltaM12] = dm2_12;
01144   par[OscPar::kDensity] = 2.75; //standard rock density
01145   par[OscPar::kDelta] = 0;
01146   par[OscPar::kNuAntiNu] = 1;
01147 
01148   // Add NSI parameters:
01149   par[OscPar::kEps_ee] =  0;
01150   par[OscPar::kEps_emu] =  0;
01151   par[OscPar::kEps_etau] =  0;
01152   par[OscPar::kEps_mumu] =  0;
01153   par[OscPar::kEps_mutau] = 0; 
01154   par[OscPar::kEps_tautau] = 0; 
01155   par[OscPar::kDelta_emu] = 0;
01156   par[OscPar::kDelta_etau] = 0;
01157   par[OscPar::kDelta_mutau] = 0;
01158 
01159   par[OscPar::kDm41] =  0;
01160   par[OscPar::kTh14] = 0; 
01161   par[OscPar::kTh24] = 0; 
01162   par[OscPar::kTh34] = 0;
01163   par[OscPar::kDelta14] = 0;
01164   par[OscPar::kDelta24] = 0;
01165 
01166 
01167   fOscGen.SetOscParam(par);  
01168 
01169 }

void NueStandard::SetDefaultOscParamNoNue (  ) 

Definition at line 1171 of file NueStandard.cxx.

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

void NueStandard::SetE50PID ( NueRecord nr  ) 

Definition at line 1743 of file NueStandard.cxx.

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

Referenced by Trimmer::RunTrimmer().

01743                                          {
01744  
01745   NueConvention::NueEnergyCorrection(nr); 
01746   
01747   double retval = -9999;
01748   double secval = -9999;
01749 
01750   //Standard nue 
01751   LEMAmbyE50N491 setlemambye50n491;
01752   retval = setlemambye50n491.GetLEMAmbyE50N491(nr);
01753 
01754   //Sterile search
01755   LEMAmbyE50S491 setlemambye50s491;
01756   secval = setlemambye50s491.GetLEMAmbyE50S491(nr);
01757   
01758 
01759   // set the E50 LEM shtuff
01760   nr->mcnnv.mcnn_var3 = retval;
01761   nr->mcnnv.mcnn_var4 = secval;
01762 }

void NueStandard::SetLSND ( bool  lsndflag = true  ) 

Definition at line 61 of file NueStandard.cxx.

References isLSND.

00061                                        { 
00062   isLSND = lsndflag; 
00063 }

void NueStandard::SetNSI ( bool  nsiflag = true  ) 

Definition at line 53 of file NueStandard.cxx.

References isNSI.

00053                                      { 
00054   isNSI = nsiflag; 
00055 }

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

Definition at line 1199 of file NueStandard.cxx.

References fOscGen, and OscCalc::SetOscParam().

01200 {
01201   fOscGen.SetOscParam(pos, val);
01202 }

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

Definition at line 1177 of file NueStandard.cxx.

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

01178 {
01179   NueStandard::SetDefaultOscParam();
01180   NueStandard::SetOscParam(OscPar::kTh13, 0.172088);
01181 }

void NueStandard::SetOscParamBestFitkNN (  ) 

Definition at line 1183 of file NueStandard.cxx.

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

01184 { 
01185   NueStandard::SetDefaultOscParam(); 
01186   NueStandard::SetOscParam(OscPar::kTh13, 0.145518);
01187 } 


Variable Documentation

bool NueStandard::isLSND = false [static]

Definition at line 58 of file NueStandard.cxx.

Referenced by GetOscWeight(), and SetLSND().

bool NueStandard::isNSI = false [static]

Definition at line 50 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 16 Jan 2018 for loon by  doxygen 1.6.1