NuCuts Class Reference

#include <NuCuts.h>

List of all members.

Public Types

enum  ENuAnaVersion {
  kUnknown = 0, kCC0093Std = 1, kJJH1 = 2, kCC0250Std = 3,
  kFullDST = 4, kJJE1 = 5, kCC0325Std = 6, kNMB0325Alpha = 11,
  kNMB0325Bravo = 9, kNMB0325Charlie = 8, kNMB0325Delta = 7, kNMB0325Echo = 10,
  kRM1 = 12, kJJE2 = 13, kNMB0325BravoTwo = 14, kRM2 = 15,
  kNMB0720RM = 30, kNMBFree = 16, kRHC = 17, kNMB0325ChairSound = 18,
  kCC0720Std = 19, kCC1070Std = 29, kCC0720Test = 20, kRHC0150Std = 21,
  kNMB0720Bravo = 22, kNMB0720Charlie = 23, kRHC0350Std = 24, kMSRock = 100,
  kNSI2011Fhc = 25, kNSI2011Rhc = 26, kRHC0350BFnu = 24, kRHC0350BFnuBravo = 24,
  kNMB0720BravoBFnu = 22, kCC0720BFnu = 19, kPreselectionNC2012 = 43, kNCPRLNC = 44,
  kNCPRLCC = 45, kPreselection2014 = 46, kCC2014 = 47, kCC2014NewCoilCut = 48
}
typedef enum NuCuts::ENuAnaVersion NuAnaVersion_t

Public Member Functions

 NuCuts ()
 ~NuCuts ()
const Char_t * AsString (NuAnaVersion_t v) const
void CalcTotalPot (Float_t &totalPotHist, Float_t &totalPotBadHist) const
void CheckTrackDirectionIsPositive (const NuEvent &nu) const
Double_t FiducialMass (const NuEvent &nu) const
Double_t FiducialMass (const Int_t detector, const Int_t simFlag, const Int_t anaVersion) const
void FindZCuts () const
Bool_t IsCoilOk (const NuEvent &nu) const
Bool_t IsGoodAbID (const NuEvent &nu) const
Bool_t IsGoodBeam (const NuEvent &nu) const
Bool_t IsGoodBeamDetPOTCountingStage (const NuEvent &nu) const
Bool_t IsGoodCoilCurrent (const NuEvent &nu) const
Bool_t IsGoodDataQuality (const NuEvent &nu) const
Bool_t IsGoodDirCos (const NuEvent &nu) const
Bool_t IsGoodDpID (const NuEvent &nu) const
Bool_t IsGoodRoID (const NuEvent &nu) const
Bool_t IsGoodJmID (const NuEvent &nu) const
Bool_t IsGoodNtID (const NuEvent &nu) const
Bool_t IsGoodPoKIN (const NuEvent &nu) const
Bool_t IsGoodFitChi2PerNdof (const NuEvent &nu) const
Bool_t IsGoodFitProb (const NuEvent &nu) const
Bool_t IsGoodMajorityCurvature (const NuEvent &nu) const
Bool_t IsGoodNumberOfTracks (const NuEvent &nu) const
Bool_t IsGoodPID (const NuEvent &nu) const
Bool_t IsGoodQP (const NuEvent &nu) const
Bool_t IsGoodRelAngle (const NuEvent &nu) const
Bool_t IsGoodSigmaQP_QP (const NuEvent &nu) const
Bool_t IsGoodTimeToNearestSpill (const NuEvent &nu) const
Bool_t IsGoodTrackLength (const NuEvent &nu) const
Bool_t IsGoodTrackLengthInUV (const NuEvent &nu) const
Bool_t IsGoodTrackFitPass (const NuEvent &nu) const
Bool_t IsGoodUVVtx (const NuEvent &nu) const
Bool_t IsInCylindricalVolume (Float_t x, Float_t y, Float_t z, Float_t zerox, Float_t zeroy, Float_t minZ, Float_t maxZ, Float_t maxR) const
Bool_t IsInFidVol (Float_t x, Float_t y, Float_t z, Float_t u, Float_t v, Int_t planeTrkVtx, Float_t rTrkVtx, Int_t detector, Int_t anaVersion, Int_t releaseType, Int_t simFlag) const
Bool_t IsInFidVolTrk (const NuEvent &nu) const
Bool_t IsInFidVolEvt (const NuEvent &nu) const
Bool_t IsInFidVolTrueEvt (const NuMCEvent &mc) const
Bool_t IsInFidVolTrueEvt (const NuEvent &nu) const
Bool_t IsInFidVolLoose (Float_t x, Float_t y, Float_t z, Int_t detector) const
Bool_t IsInFidVolLoose (const NuEvent &nu) const
Bool_t IsInFidVolOffset (const NuEvent &nu) const
Bool_t IsInFidVolOffset (Float_t x, Float_t y, Float_t z) const
Bool_t IsInFidVolPitt (Float_t x, Float_t y, Float_t z, Float_t u, Float_t v) const
Bool_t IsInFidVolNDCC0093Std (Float_t x, Float_t y, Float_t z) const
Bool_t IsInFidVolNDCC0250Std (Float_t x, Float_t y, Float_t z) const
Bool_t IsInFidVolNDNuMuBar (Float_t x, Float_t y, Float_t z) const
Bool_t IsInFidVolFDCC0093Std (Float_t x, Float_t y, Float_t z) const
Bool_t IsInFidVolFDCC0250Std (Int_t planeTrkVtx, Float_t rTrkVtx) const
Bool_t IsInFidVolFDNuMuBar (Int_t planeTrkVtx, Float_t rTrkVtx) const
Bool_t IsLI (const NuEvent &nu) const
Bool_t FreeCuts (const NuEvent &nu, const NuXMLConfig *xmlConfig) const
Bool_t IsGoodCosPr (const NuEvent &nu) const
Bool_t IsGoodTrackDr (const NuEvent &nu) const
Bool_t IsGoodNearShowerEn (const NuEvent &nu) const

Static Public Member Functions

static Bool_t IsNMB (const NuEvent &nu)
static Bool_t IsNMBPQ (const NuEvent &nu)
static Bool_t IsNMBNQ (const NuEvent &nu)
static Bool_t IsGoodBeamTypeCC2008 (const NuEvent &nu)
static Bool_t IsGoodBeamTypeRHC2010 (const NuEvent &nu)
static Bool_t IsGoodCoilCurrentDirectionCC2008 (const NuEvent &nu)
static Bool_t IsGoodCoilCurrentDirectionRHC2010 (const NuEvent &nu)
static Bool_t IsGoodTrackFitPassReclamation (const NuEvent &nu)
static Bool_t GoodTimeToNearestSpill (const NuEvent &nu, Double_t lower_us, Double_t upper_us)

Detailed Description

Definition at line 15 of file NuCuts.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
kUnknown 
kCC0093Std 
kJJH1 
kCC0250Std 
kFullDST 
kJJE1 
kCC0325Std 
kNMB0325Alpha 
kNMB0325Bravo 
kNMB0325Charlie 
kNMB0325Delta 
kNMB0325Echo 
kRM1 
kJJE2 
kNMB0325BravoTwo 
kRM2 
kNMB0720RM 
kNMBFree 
kRHC 
kNMB0325ChairSound 
kCC0720Std 
kCC1070Std 
kCC0720Test 
kRHC0150Std 
kNMB0720Bravo 
kNMB0720Charlie 
kRHC0350Std 
kMSRock 
kNSI2011Fhc 
kNSI2011Rhc 
kRHC0350BFnu 
kRHC0350BFnuBravo 
kNMB0720BravoBFnu 
kCC0720BFnu 
kPreselectionNC2012 
kNCPRLNC 
kNCPRLCC 
kPreselection2014 
kCC2014 
kCC2014NewCoilCut 

Definition at line 22 of file NuCuts.h.

00022                              {
00023     kUnknown    = 0,
00024     kCC0093Std  = 1,
00025     kJJH1       = 2,
00026     kCC0250Std  = 3,
00027     kFullDST    = 4, //used when making full DSTs (e.g. loose fidvol)
00028     kJJE1       = 5,
00029     kCC0325Std  = 6, //official 2008 CC PRL
00030     kNMB0325Alpha  = 11,//Random ordering of 5 NuBar
00031     kNMB0325Bravo  = 9, //selectors (some left over from the
00032     kNMB0325Charlie= 8, //blind systematics study).
00033     kNMB0325Delta  = 7, //
00034     kNMB0325Echo   = 10,//
00035     kRM1        = 12, //Rashid's selector
00036     kJJE2       = 13, //Justin's thesis selection. Unlucky for some...
00037     kNMB0325BravoTwo = 14,//Alternate Bravo without a Q/P Cut
00038     kRM2        =15,//RoID with a cut on UV track lenght
00039     kNMB0720RM  =30,//RoID with a cut on UV track lenght (for 7e20) 
00040     kNMBFree    =16,//only Pre cuts
00041     kRHC        =17,//charge == +1 & roID > 0.3 
00042     kNMB0325ChairSound=18,//Matt's front face rock event cross check
00043     kCC0720Std=19,//official 2010 charged current analysis
00044     kCC1070Std=29,//official 2012 charged current analysis
00045     kCC0720Test=20,//Jasmine's study of stuff
00046     kRHC0150Std=21,//official 2010 RHC analysis.
00047     kNMB0720Bravo=22,//official NMB 7.2e20 primary selector
00048     kNMB0720Charlie=23,//official NMB 7.2e20 backup selector
00049     kRHC0350Std=24,//official 2011 RHC analysis.
00050     kMSRock=100,
00051     kNSI2011Fhc=25, //NSI Fhc selector
00052     kNSI2011Rhc=26, //NSI Rhc selector
00053     kRHC0350BFnu=24, //2011 RHC analysis Beam Fits neutrino selector (same as RHC0350Std but no containment cut)
00054     kRHC0350BFnuBravo=24, //2011 RHC analysis Beam Fits neutrino selector (bravo-like)
00055     kNMB0720BravoBFnu=22, //NMB 7.2e20 primary selector - same as 2010 bravo to select numubar, but with new cuts for Beam Fits
00056     kCC0720BFnu=19, // 2010 charged current analysis selector but with new cuts 2011 cuts for Beam Fits
00057     kPreselectionNC2012=43, // Preselection to reproduce the NC PRL
00058     kNCPRLNC=44, // NC selector to reproduce NC PRL
00059     kNCPRLCC=45,  // CC selector to reproduce NC PRL
00060     kPreselection2014=46,  // Preselection to combine NC and CC microdsts
00061     kCC2014=47,  // Preselection to combine NC and CC microdsts
00062     kCC2014NewCoilCut=48  // Preselection to combine NC and CC microdsts
00063   } NuAnaVersion_t;


Constructor & Destructor Documentation

NuCuts::NuCuts (  ) 

Definition at line 62 of file NuCuts.cxx.

References Msg::kDebug, and MSG.

00063 {
00064   MSG("NuCuts",Msg::kDebug)
00065     <<"Running NuCuts Constructor..."<<endl;
00066 
00067 
00068   MSG("NuCuts",Msg::kDebug)
00069     <<"Finished NuCuts Constructor"<<endl;
00070 }

NuCuts::~NuCuts (  ) 

Definition at line 74 of file NuCuts.cxx.

References Msg::kDebug, and MSG.

00075 {
00076   MSG("NuCuts",Msg::kDebug)
00077     <<"Running NuCuts Destructor..."<<endl;
00078 
00079 
00080   MSG("NuCuts",Msg::kDebug)
00081     <<"Finished NuCuts Destructor"<<endl;
00082 }


Member Function Documentation

const Char_t * NuCuts::AsString ( NuAnaVersion_t  v  )  const

Definition at line 3013 of file NuCuts.cxx.

References kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, kFullDST, kJJE1, kJJE2, kJJH1, kMSRock, kNCPRLCC, kNCPRLNC, kNSI2011Fhc, kPreselectionNC2012, and kUnknown.

Referenced by IsGoodBeam(), IsGoodBeamTypeCC2008(), IsGoodBeamTypeRHC2010(), IsGoodCoilCurrentDirectionCC2008(), IsGoodCoilCurrentDirectionRHC2010(), NuAnalysis::LIRejectionTest(), NuDSTAna::SanityCheckAnaVersionSameAsPrevious(), and NuAnalysis::SetAnaFlags().

03014 {
03015   // return char string
03016   switch (v) {
03017   case kCC0093Std: return "Std CC 1.27e20 POT";
03018   case kJJH1:      return "JJH NuMuBar";
03019   case kJJE1:      return "JJE NuMuBar";
03020   case kJJE2:      return "JJE thesis NuMuBar";
03021   case kCC0250Std: return "Std CC 2.50e20 POT";
03022   case kCC0325Std: return "Std CC 3.25e20 POT";
03023   case kCC0720Test: return "Std CC (with JMCUTS) for 2010 analysis";
03024   case kFullDST:   return "Full DST w/ loose cuts";
03025   case kMSRock:    return "Matt Straits Ely2009 Rock muon selection";
03026   case kCC0720Std: return "Std CC 7.20e20 POT";
03027   case kCC1070Std: return "Std CC 9.70e20 POT";
03028   case kCC2014: return "Std CC MINOS+";
03029   case kCC2014NewCoilCut: return "Std CC MINOS+ No Coil Cut";
03030   case kNSI2011Fhc: return "NSI FHC";
03031   case kPreselectionNC2012: return "NC PRL Preselection";
03032   case kNCPRLNC:   return "NC PRL NC selector";
03033   case kNCPRLCC:   return "NC PRL CC selector";
03034   case kUnknown:   return "Unknown"; break;
03035   default:         return "!?Bad Value Passed?!"; break;
03036   }
03037 }

void NuCuts::CalcTotalPot ( Float_t &  totalPotHist,
Float_t &  totalPotBadHist 
) const

Definition at line 2943 of file NuCuts.cxx.

References Msg::kDebug, Msg::kInfo, MAXMSG, and MSG.

Referenced by NuAnalysis::ChargeSignCut(), NuAnalysis::Efficiencies(), NuAnalysis::EnergySpect(), NuAnalysis::NuMuBarAppearance(), NuCounter::Print(), NuCounter::PrintFullDST(), NuCounter::PrintMicroDST(), and NuCounter::PrintNMB().

02945 {
02946   //calc the total POT
02947   TH1F* hPottortgt=dynamic_cast<TH1F*>(gROOT->FindObject("hPottortgt"));
02948   TH1F* hPotBadtortgt=
02949     dynamic_cast<TH1F*>(gROOT->FindObject("hPotBadtortgt"));
02950 
02951   if (hPottortgt && hPotBadtortgt) {
02952     //hPottortgt->Print();
02953     //hPotBadtortgt->Print();
02954 
02955     for (Int_t i=0;i<hPotBadtortgt->GetNbinsX();i++) {
02956       Float_t num=hPottortgt->GetBinContent(i);
02957       Float_t val=hPottortgt->GetBinLowEdge(i);
02958       val+=hPottortgt->GetBinWidth(i)/2.;
02959       Float_t sum=num*val;
02960       if (sum<0) {
02961         MAXMSG("NuCuts",Msg::kInfo,10)
02962           <<"sum<0, sum="<<sum
02963           <<", num="<<num
02964           <<", val="<<val<<endl;
02965         sum=0;
02966       }
02967       totalPotHist+=sum;
02968 
02969       Float_t numBad=hPotBadtortgt->GetBinContent(i);
02970       Float_t valBad=hPotBadtortgt->GetBinLowEdge(i);
02971       valBad+=hPotBadtortgt->GetBinWidth(i)/2.;
02972       Float_t sumBad=numBad*valBad;
02973       if (sumBad<0) {
02974         MAXMSG("NuCuts",Msg::kInfo,10)
02975           <<"sumBad<0, sumBad="<<sumBad
02976           <<", num="<<numBad
02977           <<", val="<<valBad<<endl;
02978         sumBad=0;
02979       }
02980       totalPotBadHist+=sumBad;
02981 
02982       MSG("NuCuts",Msg::kDebug)
02983         <<"i="<<i<<", Good: num="<<num
02984         <<", val="<<val<<", sum="<<sum
02985         <<", totalPot="<<totalPotHist<<endl;
02986 
02987       MSG("NuCuts",Msg::kDebug)
02988         <<"i="<<i<<", Bad:      num="<<numBad
02989         <<", val="<<valBad<<", sum="<<sumBad
02990         <<", totalPotBad="<<totalPotBadHist<<endl;
02991     }
02992   }
02993   else cout<<"Can't find histograms to calc total POT"<<endl;
02994 }

void NuCuts::CheckTrackDirectionIsPositive ( const NuEvent nu  )  const

Definition at line 2998 of file NuCuts.cxx.

References Msg::kWarning, MSG, NuEvent::planeTrkEnd, and NuEvent::planeTrkVtx.

02999 {
03000   if (nu.planeTrkEnd-nu.planeTrkVtx<0) {
03001     //NuPlots plots;
03002     //plots.PrintRunSnarlEvent(cout,nu);
03003     MSG("NuAnalysis",Msg::kWarning)
03004       <<endl<<endl<<endl
03005       <<"Track direction wrong!!!, vtx plane="<<nu.planeTrkVtx
03006       <<", end plane="<<nu.planeTrkEnd
03007       <<endl<<endl<<endl<<endl;
03008   }
03009 }

Double_t NuCuts::FiducialMass ( const Int_t  detector,
const Int_t  simFlag,
const Int_t  anaVersion 
) const

Definition at line 3048 of file NuCuts.cxx.

References kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, SimFlag::kData, Detector::kFar, Munits::kilotonne, kJJE1, kJJE2, kJJH1, SimFlag::kMC, Detector::kNear, kNMB0325Alpha, kNMB0325Bravo, kNMB0325BravoTwo, kNMB0325Charlie, kNMB0325Delta, kNMB0325Echo, kNMB0720RM, kNMBFree, kNSI2011Fhc, kRHC, kRM1, kRM2, Msg::kWarning, MAXMSG, and Munits::tonne.

03051 {
03052   if (detector == Detector::kNear){
03053     if (anaVersion==NuCuts::kJJH1 ||
03054         anaVersion==NuCuts::kJJE1 ||
03055         anaVersion==NuCuts::kJJE2 ||
03056         anaVersion == NuCuts::kCC0325Std ||
03057         anaVersion == NuCuts::kCC0720Std ||
03058         anaVersion == NuCuts::kCC1070Std ||
03059         anaVersion == NuCuts::kCC2014 ||
03060         anaVersion == NuCuts::kCC2014NewCoilCut ||
03061         anaVersion == NuCuts::kNSI2011Fhc ||
03062         anaVersion == NuCuts::kNMB0325Alpha ||
03063         anaVersion == NuCuts::kNMB0325Bravo ||
03064         anaVersion == NuCuts::kNMB0325BravoTwo ||
03065         anaVersion == NuCuts::kNMB0325Charlie ||
03066         anaVersion == NuCuts::kNMB0325Delta ||
03067         anaVersion == NuCuts::kNMB0325Echo ||
03068         anaVersion == NuCuts::kRM1 ||
03069         anaVersion == NuCuts::kRM2 ||
03070         anaVersion == NuCuts::kNMB0720RM ||
03071         anaVersion == NuCuts::kNMBFree ||
03072         anaVersion == NuCuts::kRHC){
03073       //return 23.4200178*Munits::tonne;//JJE
03074       if (simFlag==SimFlag::kData) return 23.7217*
03075                                      Munits::tonne;//JJH
03076       else if (simFlag==SimFlag::kMC) return 23.4989*
03077                                         Munits::tonne;//JJH
03078       else {
03079         cout<<"Ahhhh simFlag="<<simFlag<<endl;
03080         return -1;
03081       }
03082     }
03083     else if (anaVersion == NuCuts::kCC0093Std){
03084       return -1.0;
03085     }
03086     else if (anaVersion == NuCuts::kCC0250Std){
03087       return 44.66068761*Munits::tonne;
03088     }
03089     else {
03090       //PittFidVol
03091       return -1.0;
03092     }
03093   }
03094   else if (detector == Detector::kFar){
03095     if (anaVersion==NuCuts::kJJH1 ||
03096         anaVersion==NuCuts::kJJE1 ||
03097         anaVersion==NuCuts::kJJE2 ||
03098         anaVersion == NuCuts::kCC0325Std ||
03099         anaVersion == NuCuts::kCC0720Std ||
03100         anaVersion == NuCuts::kCC1070Std ||
03101         anaVersion == NuCuts::kCC2014 ||
03102         anaVersion == NuCuts::kCC2014NewCoilCut ||
03103         anaVersion == NuCuts::kCC0720Test ||
03104         anaVersion==NuCuts::kNSI2011Fhc ||
03105         anaVersion == NuCuts::kNMB0325Alpha ||
03106         anaVersion == NuCuts::kNMB0325Bravo ||
03107         anaVersion == NuCuts::kNMB0325BravoTwo ||
03108         anaVersion == NuCuts::kNMB0325Charlie ||
03109         anaVersion == NuCuts::kNMB0325Delta ||
03110         anaVersion == NuCuts::kNMB0325Echo ||
03111         anaVersion == NuCuts::kRM1 ||
03112         anaVersion == NuCuts::kRM2 ||
03113         anaVersion == NuCuts::kNMB0720RM ||
03114         anaVersion == NuCuts::kNMBFree ||
03115         anaVersion == NuCuts::kRHC) {
03116       //return 4.119215650*Munits::kilotonne;//JJE
03117       if (simFlag==SimFlag::kData) return 4.17235*
03118                                      Munits::kilotonne;//JJH
03119       else if (simFlag==SimFlag::kMC) return 4.13923*
03120                                         Munits::kilotonne;//JJH
03121       else {
03122         cout<<"Ahhhh simFlag="<<simFlag<<endl;
03123         return -1;
03124       }
03125     }
03126     else if (anaVersion == NuCuts::kCC0093Std){
03127       return -1.0;
03128     }
03129     else if (anaVersion == NuCuts::kCC0250Std){
03130       return 4.164776186*Munits::kilotonne;
03131       //Neglecting the existance of the coil hole!
03132     }
03133     else {
03134       //IsInFidVolFDCC0093Std
03135       return -1.0;
03136     }
03137   }
03138   else{
03139     MAXMSG("NuCuts",Msg::kWarning,5)
03140       << "Bad detector: returning 0 fiducial mass." << endl;
03141     return 0;
03142   }
03143 }

Double_t NuCuts::FiducialMass ( const NuEvent nu  )  const
void NuCuts::FindZCuts (  )  const

demo how to use Robert's little tool to determine z-cuts The plane numbers depend on the value of EAirRegion

Definition at line 2570 of file NuCuts.cxx.

References FidVol::find_z_cuts(), FidVol::kBetweenScintAndSteel, FidVol::kDownstreamOfSteel, FidVol::kMiddle, and Munits::micrometer.

02571 {
02574 
02575   //NOTE: using trk.vtx.z-0.0392 for CC analysis to move vtx from scint
02576   //to steel where interaction happened
02577 
02578   //steel planes 14-68 inclusive for CC2008 analysis
02579   //ND LOWER CUT: actually want cut to be in the large air gap
02580   //upstream of plane 14, so use 13
02581   //ND UPPER CUT: want cut to be in large air gap downstream
02582   //of 68, so use 68
02583 
02584   //FD SM1 LOWER CUT: use plane 3 (based on trk.vtx.z-0.0392)
02585   //FD SM2 UPPER CUT: use plane 239
02586   //FD SM1 LOWER CUT: use plane 252
02587   //FD SM2 UPPER CUT: use plane 464
02588 
02589   //ND: trk.vtx.z-0.0392>0.809 && trk.vtx.z-0.0392<4.076
02590 
02591   //(trk.vtx.z-0.0392>0.215 && trk.vtx.z-0.0392<14.255) ||                      (trk.vtx.z-0.0392>16.122 && trk.vtx.z-0.0392<28.722)
02592   //These positions are based on MC (FD data is shifted by ~0.7-1.4cm wrt to MC)
02593   //Andy's cuts are currently in plane form:
02594   //(trk.vtx.plane>4 && trk.vtx.plane<241) || (trk.vtx.plane>253 && trk.vtx.plane<466)
02595 
02596   //enum EAirRegion {
02597   //kBetweenScintAndSteel =  0,
02598   //kDownstreamOfSteel          = +1
02599   //};
02600   //enum EPosition {
02601   //kUpstream           = -1,
02602   //kMiddle                     =  0,
02603   //kDownstream = +1
02604   //};
02605 
02606   FidVol::find_z_cuts(17,84,8,240,255,452,
02607                       FidVol::kBetweenScintAndSteel,
02608                       FidVol::kMiddle,Munits::micrometer);
02609 
02610   FidVol::find_z_cuts(17,84,8,240,255,452,
02611                       FidVol::kDownstreamOfSteel,
02612                       FidVol::kMiddle,Munits::micrometer);
02613 
02614   //use CC2008 cuts
02615   FidVol::find_z_cuts(13,68,3,239,252,464,
02616                       FidVol::kDownstreamOfSteel,
02617                       FidVol::kMiddle,Munits::micrometer);
02618 }

Bool_t NuCuts::FreeCuts ( const NuEvent nu,
const NuXMLConfig xmlConfig 
) const

Definition at line 3146 of file NuCuts.cxx.

References NuXMLConfig::DpID(), NuEvent::dpID, NuEvent::jmEventknnID, NuXMLConfig::JmID(), NuEvent::jmID, Msg::kInfo, NuXMLConfig::MajorityCurvature(), MSG, NuXMLConfig::NtID(), NuEvent::poIDKin, NuXMLConfig::PoKIN(), NuEvent::prob, NuXMLConfig::RelativeAngle(), NuEvent::relativeAngle, NuEvent::roID, NuXMLConfig::RoID(), NuXMLConfig::Sigqp(), NuEvent::sigqp_qp, NuEvent::smoothMajC, NuXMLConfig::TrackLength(), NuEvent::trkLength, and NuXMLConfig::Trkpro().

Referenced by NuDSTAna::MMRereco(), and NuDSTAna::MMTransSME().

03146                                                                            {
03147   if(nu.roID<=xmlConfig->RoID()||
03148      nu.jmID<=xmlConfig->JmID()||
03149      nu.jmEventknnID <= xmlConfig->NtID()||
03150      nu.dpID<=xmlConfig->DpID() ||
03151      nu.poIDKin<=xmlConfig->PoKIN() ||
03152      fabs(1./nu.sigqp_qp)<=xmlConfig->Sigqp() ||
03153      fabs(nu.relativeAngle - TMath::Pi())<= xmlConfig->RelativeAngle() ||
03154      nu.trkLength<=xmlConfig->TrackLength() ||
03155      nu.prob<=xmlConfig->Trkpro() ||
03156      nu.smoothMajC<=xmlConfig->MajorityCurvature())
03157     {
03158       MSG("NuCuts",Msg::kInfo)
03159         <<"Inside free cuts true"<<endl;
03160       return false;}
03161   else
03162     {MSG("NuCuts",Msg::kInfo)
03163         <<"Inside free cuts false"<<endl;
03164       return true;}
03165 }

Bool_t NuCuts::GoodTimeToNearestSpill ( const NuEvent nu,
Double_t  lower_us,
Double_t  upper_us 
) [static]

Applies the spill timing cut.

Parameters:
lower_us The lower cut, in microseconds
upper_us The upper cut, in microseconds

Definition at line 3213 of file NuCuts.cxx.

References Munits::microsecond, NuEvent::timeEvtMin, and NuEvent::timeToNearestSpill.

Referenced by NuCutImps::Preselection2014::Preselection(), NuCutImps::PreselectionNC2012::Preselection(), NuCutImps::ChairSound::Preselection(), NuCutImps::CC0325Std::Preselection(), NuCutImps::MSRock_Nov09::Preselection(), and NuCutImps::Preselection2010::Preselection().

03214 {
03215   // Convert the timings to microseconds
03216   lower_us *= (Munits::microsecond);
03217   upper_us *= (Munits::microsecond);
03218 
03219   if (nu.timeEvtMin-nu.timeToNearestSpill>lower_us &&
03220       nu.timeEvtMin-nu.timeToNearestSpill<upper_us) {
03221     return true;
03222   }
03223   else return false;
03224 
03225 }

Bool_t NuCuts::IsCoilOk ( const NuEvent nu  )  const

Definition at line 1178 of file NuCuts.cxx.

References NuEvent::coilIsOk, NuEvent::cutOnDataQuality, SimFlag::kData, Msg::kInfo, Msg::kWarning, MAXMSG, and NuEvent::simFlag.

01179 {
01180   //check if MC or data
01181   if (nu.simFlag!=SimFlag::kData) {
01182     MAXMSG("NuCuts",Msg::kInfo,1)
01183       <<"Not cutting on IsCoilOk for simFlag="<<nu.simFlag<<endl;
01184     return true;
01185   }
01186 
01187   //check if the flag is set to cut
01188   if (!nu.cutOnDataQuality) {//use data quality flag
01189     MAXMSG("NuCuts",Msg::kWarning,1)
01190       <<"Not cutting on IsCoilOk (flag set to not cut)"<<endl;
01191     return true;
01192   }
01193 
01194   MAXMSG("NuCuts",Msg::kInfo,1)
01195     <<"Cutting on coilIsOk"<<endl;
01196 
01197   //check if coil is ok (can be forward or reversed)
01198   if (nu.coilIsOk) {
01199     return true;
01200   }
01201   else {
01202     MAXMSG("NuCuts",Msg::kInfo,10)
01203       <<"Bad magnetic coil, coilIsOk="<<nu.coilIsOk<<endl;
01204     return false;
01205   }
01206 }

Bool_t NuCuts::IsGoodAbID ( const NuEvent nu  )  const

Definition at line 540 of file NuCuts.cxx.

References NuEvent::abID, NuEvent::anaVersion, NuEvent::charge, NuEvent::detector, IsNMBNQ(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, Detector::kFar, Msg::kInfo, kJJE1, kJJH1, Detector::kNear, kNSI2011Fhc, and MAXMSG.

Referenced by IsGoodPID(), NuDSTAna::NMBAna(), and NuAnalysis::NMBSummaryTreeAna().

00541 {
00542   Float_t cutValue=0.85;
00543 
00544   if (nu.anaVersion==NuCuts::kJJH1) {
00545     cutValue=0.99;
00546 
00547     if (nu.charge==+1){
00548       MAXMSG("NuCuts",Msg::kInfo,1)
00549         <<"Making cut on +ve track: IsGoodAbID>"<<cutValue<<endl;
00550       if (nu.abID>cutValue) return true;
00551       else return false;
00552     }
00553     else if (nu.charge==-1){
00554       if (nu.detector==Detector::kNear) cutValue=0.85;
00555       else if (nu.detector==Detector::kFar) cutValue=0.85;
00556       else {
00557         cout<<"Ahhh, detector="<<nu.detector<<endl;
00558         return false;
00559       }
00560 
00561       MAXMSG("NuCuts",Msg::kInfo,1)
00562         <<"Making cut on -ve track: IsGoodAbID>"<<cutValue<<endl;
00563       if (nu.abID>cutValue) return true;
00564       else return false;
00565     }
00566     else {
00567       cout<<"Bad charge"<<endl;
00568       return false;
00569     }
00570   }
00571   else if (nu.anaVersion==NuCuts::kJJE1){
00572     MAXMSG("NuCuts",Msg::kInfo,1)
00573       <<"Making cut: IsGoodAbID>"<<cutValue<<endl;
00574     if (nu.abID>cutValue) return true;
00575     else return false;
00576   }
00577   else if (nu.anaVersion==NuCuts::kCC0093Std) {
00578     MAXMSG("NuCuts",Msg::kInfo,1)
00579       <<"Making cut: IsGoodAbID>"<<cutValue<<endl;
00580     if (nu.abID>cutValue) return true;
00581     else return false;
00582   }
00583   else if (nu.anaVersion==NuCuts::kCC0250Std ||
00584            nu.anaVersion==NuCuts::kCC0325Std ||
00585            nu.anaVersion==NuCuts::kCC0720Std ||
00586            nu.anaVersion==NuCuts::kCC1070Std ||
00587            nu.anaVersion==NuCuts::kCC2014 ||
00588            nu.anaVersion==NuCuts::kCC2014NewCoilCut ||
00589            nu.anaVersion==NuCuts::kCC0720Test ||  IsNMBNQ(nu) ||
00590            nu.anaVersion==NuCuts::kNSI2011Fhc) {
00591     MAXMSG("NuCuts",Msg::kInfo,1)
00592       <<"Making cut: IsGoodAbID>"<<cutValue<<endl;
00593     if (nu.abID>cutValue) return true;
00594     else return false;
00595   }
00596   else {
00597     MAXMSG("NuCuts",Msg::kInfo,1)
00598       <<"Making cut: IsGoodAbID>"<<cutValue<<endl;
00599     if (nu.abID>cutValue) return true;
00600     else return false;
00601   }
00602   return true;
00603 }

Bool_t NuCuts::IsGoodBeam ( const NuEvent nu  )  const

This can mess up pot counting, have to be very careful with it!

Definition at line 1319 of file NuCuts.cxx.

References NuEvent::anaVersion, AsString(), NuEvent::beamTypeDB, NuEvent::cutOnBeamInfo, NuEvent::detector, NuEvent::goodBeam, NuEvent::goodBeamSntp, NuEvent::hornCur, NuEvent::hornIsReverse, IsNMB(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, SimFlag::kData, Msg::kError, Detector::kFar, Msg::kInfo, BeamType::kL010z000i, BeamType::kL010z170i, BeamType::kL010z185i, BeamType::kL010z185i_rev, BeamType::kL010z200i, BeamType::kL250z200i, Detector::kNear, kNSI2011Fhc, Msg::kWarning, MAXMSG, NuEvent::run, NuEvent::simFlag, NuEvent::snarl, and NuEvent::subRun.

Referenced by NuDemoModule::Ana(), NuAnalysis::ChargeSeparationOneSnarl(), NuCutImps::NuCutsSelection::IsGoodPreSelectionCuts(), and NuFluctuator::SelectedAs().

01320 {
01322 
01323   //return if MC
01324   if (nu.simFlag!=SimFlag::kData) {
01325     MAXMSG("NuCuts",Msg::kInfo,1)
01326       <<"Not cutting on GoodBeam for simFlag="<<nu.simFlag<<endl;
01327     return true;
01328   }
01329 
01330   //check if the flag is set to cut
01331   if (!nu.cutOnBeamInfo) {
01332     MAXMSG("NuCuts",Msg::kWarning,1)
01333       <<"Not cutting on BeamInfo (flag set to not cut)"<<endl;
01334     return true;
01335   }
01336 
01337   //Trish's cuts:
01338   //goodbeam==1&&hornI<-10&&(beamcnf==3||beamcnf==10||beamcnf==11)
01339 
01340   //3=kL010z185i - LE-std
01341   //7=kL250z200i - phe (removed for CC0250 results)
01342   //10=kL010z170i - LE lower horn cur
01343   //11=kL010z200i - LE higher horn cur
01344   //15=kL150z200i - pmhe (removed for CC0250 results)
01345 
01346   if (nu.anaVersion==NuCuts::kCC0093Std ||
01347       nu.anaVersion==NuCuts::kCC0250Std) {
01348     MAXMSG("NuCuts",Msg::kInfo,1)
01349       <<"Cutting on GoodBeam with CC0250Std cuts"<<endl;
01350     if (nu.goodBeam &&
01351         nu.hornCur<-10 && nu.hornCur!=-999999 &&
01352         (nu.beamTypeDB==BeamType::kL010z185i ||
01353          nu.beamTypeDB==BeamType::kL010z170i ||
01354          nu.beamTypeDB==BeamType::kL010z200i)){
01355       return true;
01356     }
01357     else {
01358       MAXMSG("NuCuts",Msg::kInfo,100)
01359         <<"Bad beam: goodBeam="<<nu.goodBeam
01360         <<", goodBeamSntp="<<nu.goodBeamSntp
01361         <<", hornCur="<<nu.hornCur
01362         <<", nu.beamTypeDB="<<nu.beamTypeDB
01363         <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01364         <<"), hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01365         << endl;
01366       if (nu.detector==Detector::kNear) {
01367         MAXMSG("NuCuts",Msg::kError,1000)
01368           <<"IsGoodBeam: cutting on Bad beam here messes"
01369           <<" up POT counting.  Event: " << nu.run << "/" << nu.subRun << ", " <<  nu.snarl <<endl;
01370       }
01371       return false;
01372     }
01373   }
01374   else if (nu.anaVersion == NuCuts::kCC0325Std ||
01375            nu.anaVersion == NuCuts::kCC0720Std ||
01376            nu.anaVersion == NuCuts::kCC1070Std ||          
01377            nu.anaVersion == NuCuts::kCC2014 ||  
01378            nu.anaVersion == NuCuts::kCC2014NewCoilCut ||           
01379            nu.anaVersion == NuCuts::kCC0720Test || IsNMB(nu) ||
01380            nu.anaVersion==NuCuts::kNSI2011Fhc ){
01381     MAXMSG("NuCuts",Msg::kInfo,1)
01382       <<"Cutting on GoodBeam with CC0325Std cuts"<<endl;
01383 
01384 
01385     bool isGood = true;
01386 
01387     // Check current
01388     if (!nu.goodBeam)
01389       isGood = false;
01390     if (nu.hornCur==-999999)
01391       isGood = false;
01392 
01393     if (nu.hornCur < -10) {
01394       if (nu.beamTypeDB != BeamType::kL010z185i &&
01395           nu.beamTypeDB != BeamType::kL010z170i &&
01396           nu.beamTypeDB != BeamType::kL010z200i &&
01397           nu.beamTypeDB != BeamType::kL250z200i) {
01398         isGood = false;
01399       }
01400       if (nu.hornIsReverse) {
01401         MAXMSG("NuCuts",Msg::kError,1000)
01402           << "nu.hornIsReverse is true but it shouldn't be for beamTypeDB="
01403           << nu.beamTypeDB << "("
01404           << BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01405           << ")" << endl;
01406       }
01407     }
01408     else if (nu.hornCur >  10) {
01409       if (nu.beamTypeDB != BeamType::kL010z185i_rev)
01410         isGood = false;
01411       if (!nu.hornIsReverse) {
01412         MAXMSG("NuCuts",Msg::kError,1000)
01413           << "nu.hornIsReverse is false but it shouldn't be for beamTypeDB="
01414           << nu.beamTypeDB << "("
01415           << BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01416           << ")" << endl;
01417       }
01418     }
01419     else {
01420       if (nu.beamTypeDB != BeamType::kL010z000i)
01421         isGood = false;
01422     }
01423 
01424 
01425     if (!isGood) {
01426       MAXMSG("NuCuts",Msg::kInfo,100)
01427         <<"Bad beam: goodBeam="<<nu.goodBeam
01428         <<", goodBeamSntp="<<nu.goodBeamSntp
01429         <<", hornCur="<<nu.hornCur
01430         <<", nu.beamTypeDB="<<nu.beamTypeDB
01431         <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01432         <<"), hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01433         << endl;
01434       if (nu.detector==Detector::kNear) {
01435         MAXMSG("NuCuts",Msg::kError,1000)
01436           <<"IsGoodBeam: cutting on Bad beam here messes"
01437           <<" up POT counting.  Event: " << nu.run << "/" << nu.subRun << ", " <<  nu.snarl <<endl;
01438       }
01439       return false;
01440     }
01441 
01442     //Make sure we're not getting mixed beam
01443     static Bool_t firstGoodEvent = true;
01444     static Int_t firstType = 0;
01445 
01446     if (firstGoodEvent){
01447       firstGoodEvent = false;
01448       firstType = nu.beamTypeDB;
01449       // Treat le10 170, 185, 200 as all the same
01450       if (firstType == BeamType::kL010z170i ||
01451           firstType == BeamType::kL010z200i) {
01452         firstType = BeamType::kL010z185i;
01453       }
01454     }
01455     else{
01456       Int_t thisType = nu.beamTypeDB;
01457       // Treat le10 170, 185, 200 as all the same
01458       if (nu.simFlag==SimFlag::kData && nu.detector==Detector::kFar){
01459         if (thisType == BeamType::kL010z170i ||
01460             thisType == BeamType::kL010z200i) {
01461           thisType = BeamType::kL010z185i;
01462         }
01463       }
01464 
01465       if (thisType != firstType) {
01466         MAXMSG("NuCuts",Msg::kWarning,100)
01467           << "Seeing mixed beam: firstType=" << firstType
01468           << ", thisType=" << thisType
01469           << ", beamTypeDB=" << nu.beamTypeDB
01470           << "(" << BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01471           << ")" << endl;
01472         if (nu.detector==Detector::kNear) {
01473           MAXMSG("NuCuts",Msg::kError,1000)
01474             <<"IsGoodBeam: cutting on Bad beam here messes"
01475             <<" up POT counting.  Event: " << nu.run << "/" << nu.subRun << ", " << nu.snarl <<endl;
01476         }
01477         return false;
01478       }
01479     }
01480     //Beam consistent with first event in DST, so we can let it pass
01481     return true;
01482   }
01483   else {
01484     MAXMSG("NuCuts",Msg::kInfo,1)
01485       <<"Not cutting on GoodBeam"<<endl;
01486     return true;
01487   }
01488 }

Bool_t NuCuts::IsGoodBeamDetPOTCountingStage ( const NuEvent nu  )  const

This can mess up pot counting, have to be very careful with it!

Definition at line 1289 of file NuCuts.cxx.

References NuEvent::coilIsOk, NuEvent::goodBeamSntp, SimFlag::kData, Msg::kInfo, MAXMSG, and NuEvent::simFlag.

Referenced by NuCutImps::NuCutsSelection::IsGoodPreSelectionCuts().

01290 {
01292 
01293   //return if MC
01294   if (nu.simFlag!=SimFlag::kData) {
01295     MAXMSG("NuCuts",Msg::kInfo,1)
01296       <<"Not cutting on GoodBeam for simFlag="<<nu.simFlag<<endl;
01297     return true;
01298   }
01299 
01300   //don't do this here, since this is the sntp beam data
01301   //check if the flag is set to cut
01302   //if (!nu.cutOnBeamInfo) {
01303   //MAXMSG("NuCuts",Msg::kWarning,1)
01304   //    <<"Not cutting on BeamInfo (flag set to not cut)"<<endl;
01305   //return true;
01306   //}
01307 
01308   MAXMSG("NuCuts",Msg::kInfo,1)
01309     <<"Cutting on IsGoodBeamDetPOTCountingStage"<<endl;
01310 
01311   if (nu.goodBeamSntp && nu.coilIsOk) {
01312     return true;
01313   }
01314   return false;
01315 }

Bool_t NuCuts::IsGoodBeamTypeCC2008 ( const NuEvent nu  )  [static]

This can mess up pot counting, have to be very careful with it!

Definition at line 1492 of file NuCuts.cxx.

References AsString(), NuEvent::beamTypeDB, NuEvent::coilIsOk, NuEvent::coilIsReverse, NuEvent::cutOnBeamInfo, NuEvent::detector, NuEvent::goodBeam, NuEvent::goodBeamSntp, NuEvent::hornCur, NuEvent::hornIsReverse, NuEvent::isGoodDataQuality, SimFlag::kData, Msg::kError, Detector::kFar, Msg::kInfo, BeamType::kL010z170i, BeamType::kL010z185i, BeamType::kL010z200i, BeamType::kL250z200i, BeamType::kM000z200i_nova, BeamType::kM000z200i_nova_rev, Detector::kNear, Msg::kWarning, MAXMSG, MSG, NuEvent::run, NuEvent::simFlag, NuEvent::snarl, and NuEvent::subRun.

Referenced by NuCutImps::CC1070Std::Selection(), NuCutImps::RAF0720Std::Selection(), NuCutImps::RAF0720Ext::Selection(), NuCutImps::CC0720Std::Selection(), NuCutImps::NC0720Std::Selection(), NuCutImps::CC2014NewCoilCut::Selection(), and NuCutImps::CC2014::Selection().

01493 {
01495 
01496   Bool_t goodBeamToUse = nu.goodBeamSntp;
01497   if (Detector::kFar == nu.detector &&
01498       SimFlag::kData == nu.simFlag){
01499     goodBeamToUse = nu.goodBeam;
01500   }
01501 
01502   //return if MC
01503   if (nu.simFlag!=SimFlag::kData) {
01504     MAXMSG("NuCuts",Msg::kInfo,1)
01505       <<"Not cutting on IsGoodBeamTypeCC2008 for simFlag="
01506       <<nu.simFlag<<endl;
01507     return true;
01508   }
01509 
01510   //return if not good beam (sometimes isolated events have garbage
01511   //beam data which messes up the sanity check)
01512   //the events with bad beam quality will be removed elsewhere
01513   //as is standard practice
01514   if (!goodBeamToUse) {
01515     MAXMSG("NuCuts",Msg::kInfo,1)
01516       <<"Not cutting on IsGoodBeamTypeCC2008 for"
01517       <<" events with bad beam data"
01518       <<", goodBeamToUse="<<goodBeamToUse
01519       <<endl;
01520     return true;
01521   }
01522 
01523   //check if the flag is set to cut
01524   if (!nu.cutOnBeamInfo) {
01525     MAXMSG("NuCuts",Msg::kWarning,1)
01526       <<"Not cutting on BeamInfo (flag set to not cut)"<<endl;
01527     return true;
01528   }
01529 
01530   Bool_t isGoodBeamType=false;
01531 
01532   MAXMSG("NuCuts",Msg::kInfo,1)
01533     <<"Cutting on beamTypeDB"<<endl;
01534   if (nu.beamTypeDB==BeamType::kL010z185i ||
01535       nu.beamTypeDB==BeamType::kL010z170i ||
01536       nu.beamTypeDB==BeamType::kL010z200i ||
01537       //nu.beamTypeDB==BeamType::kM000z000i_nova || //normally dont want horn off data
01538       nu.beamTypeDB==BeamType::kM000z200i_nova ||
01539       nu.beamTypeDB==BeamType::kM000z200i_nova_rev ||
01540       nu.beamTypeDB==BeamType::kL250z200i) {
01541     //check that the horn current is well away from zero
01542     //and not its initial value
01543     if (nu.hornCur < -155 && nu.hornCur!=-999999) isGoodBeamType = true;
01544   }
01545   else isGoodBeamType=false;
01546 
01547   //count the number of wrong beam types in a row
01548   //very occassionally you get a single bad beam type in a file
01549   static Int_t errorCounterBeamType=0;
01550   if (isGoodBeamType) errorCounterBeamType=0;
01551 
01552   //print warning messages and/or assert if bad beam type
01553   if (!isGoodBeamType) {
01554     errorCounterBeamType++;
01555     if (nu.detector==Detector::kNear) {
01556 
01557       //check if the number of sequential mixed beam type
01558       //events is greater than the upper limit
01559       Int_t upperLimit=10;
01560       if (errorCounterBeamType>upperLimit) {
01561         MAXMSG("NuCuts",Msg::kError,100)
01562           <<"Bad beamType: "
01563           <<" beamTypeDB="<<nu.beamTypeDB
01564           <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01565           <<"), goodBeamToUse="<<goodBeamToUse
01566           <<", hornCur="<<nu.hornCur
01567           <<", hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01568           <<", coilIsOk="<<nu.coilIsOk
01569           <<", coilIsReverse="<<nu.coilIsReverse
01570           <<", isGoodDataQuality="<<nu.isGoodDataQuality
01571           <<", run="<<nu.run<<", subRun="<<nu.subRun
01572           <<", snarl="<<nu.snarl
01573           << endl;
01574         MSG("NuCutImps",Msg::kError)
01575           <<"Asserting on wrong beam type"
01576           <<" when we get more than "<<upperLimit<<" events with"
01577           <<" wrong beam in a row"
01578           <<", errorCounterBeamType="<<errorCounterBeamType
01579           <<endl;
01580         assert(isGoodBeamType);
01581       }
01582       else {
01583         MSG("NuCutImps",Msg::kWarning)
01584           <<"Not asserting on wrong beam type until"
01585           <<" we get more than "<<upperLimit<<" events with"
01586           <<" mixed beam in a row"
01587           <<", errorCounterBeamType="<<errorCounterBeamType
01588           <<", beamTypeDB="<<nu.beamTypeDB
01589           <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01590           <<"), goodBeamToUse="<<goodBeamToUse
01591           <<", hornCur="<<nu.hornCur
01592           <<", hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01593           <<", coilIsOk="<<nu.coilIsOk
01594           <<", coilIsReverse="<<nu.coilIsReverse
01595           <<", isGoodDataQuality="<<nu.isGoodDataQuality
01596           <<", run="<<nu.run<<", subRun="<<nu.subRun
01597           <<", snarl="<<nu.snarl
01598           <<endl;
01599       }
01600     }
01601     else if (nu.detector==Detector::kFar) {
01602       MSG("NuCuts",Msg::kWarning)
01603         <<"Bad beamType: "
01604         <<" beamTypeDB="<<nu.beamTypeDB
01605         <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01606         <<"), goodBeamToUse="<<goodBeamToUse
01607         <<", hornCur="<<nu.hornCur
01608         <<", hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01609         <<", coilIsOk="<<nu.coilIsOk
01610         <<", coilIsReverse="<<nu.coilIsReverse
01611         <<", isGoodDataQuality="<<nu.isGoodDataQuality
01612         <<", run="<<nu.run<<", subRun="<<nu.subRun
01613         <<", snarl="<<nu.snarl
01614         << endl;
01615       //NOTE: for the FD data, the pot counting is less of an issue
01616       //the crucial thing is that the value of pot used was obtained
01617       //using the same cuts as are applied here
01618     }
01619     else {
01620       cout<<"Ahhh, detector not known..."<<endl;
01621     }
01622   }
01623 
01624   return isGoodBeamType;
01625 }

Bool_t NuCuts::IsGoodBeamTypeRHC2010 ( const NuEvent nu  )  [static]

This can mess up pot counting, have to be very careful with it!

Definition at line 1629 of file NuCuts.cxx.

References AsString(), NuEvent::beamTypeDB, NuEvent::coilIsOk, NuEvent::coilIsReverse, NuEvent::cutOnBeamInfo, NuEvent::detector, NuEvent::goodBeam, NuEvent::goodBeamSntp, NuEvent::hornCur, NuEvent::hornIsReverse, NuEvent::isGoodDataQuality, SimFlag::kData, Msg::kError, Detector::kFar, Msg::kInfo, BeamType::kL010z185i_rev, Detector::kNear, Msg::kWarning, MAXMSG, MSG, NuEvent::run, NuEvent::simFlag, NuEvent::snarl, and NuEvent::subRun.

Referenced by NuCutImps::RHC0150Std::Selection(), and NuCutImps::RHC0350BFnuBravo::Selection().

01630 {
01632 
01633     Bool_t goodBeamToUse = nu.goodBeamSntp;
01634     if (Detector::kFar == nu.detector &&
01635         SimFlag::kData == nu.simFlag){
01636       goodBeamToUse = nu.goodBeam;
01637     }
01638 
01639   //return if MC
01640   if (nu.simFlag!=SimFlag::kData) {
01641     MAXMSG("NuCuts",Msg::kInfo,1)
01642       <<"Not cutting on IsGoodBeamTypeRHC2010 for simFlag="
01643       <<nu.simFlag<<endl;
01644     return true;
01645   }
01646 
01647   //return if not good beam (sometimes isolated events have garbage
01648   //beam data which messes up the sanity check)
01649   //the events with bad beam quality will be removed elsewhere
01650   //as is standard practice
01651   if (!goodBeamToUse) {
01652     MAXMSG("NuCuts",Msg::kInfo,1)
01653       <<"Not cutting on IsGoodBeamTypeRHC2010 for"
01654       <<" events with bad beam data"
01655       <<", goodBeamToUse="<<goodBeamToUse
01656       <<endl;
01657     return true;
01658   }
01659 
01660   //check if the flag is set to cut
01661   if (!nu.cutOnBeamInfo) {
01662     MAXMSG("NuCuts",Msg::kWarning,1)
01663       <<"Not cutting on BeamInfo (flag set to not cut)"<<endl;
01664     return true;
01665   }
01666 
01667   Bool_t isGoodBeamType=false;
01668 
01669   MAXMSG("NuCuts",Msg::kInfo,1)
01670     <<"Cutting on beamTypeDB"<<endl;
01671   if (nu.beamTypeDB==BeamType::kL010z185i_rev &&
01672       nu.hornIsReverse) {
01673     //check that the horn current is well away from zero
01674     //and not its initial value
01675     //in DSTs we ensure that for RHC periods, hornCur is positive
01676     if (nu.hornCur > 155 && nu.hornCur!=-999999) isGoodBeamType = true;
01677   }
01678   else isGoodBeamType=false;
01679 
01680   //count the number of wrong beam types in a row
01681   //very occassionally you get a single bad beam type in a file
01682   static Int_t errorCounterBeamType=0;
01683   if (isGoodBeamType) errorCounterBeamType=0;
01684 
01685   //print warning messages and/or assert if bad beam type
01686   if (!isGoodBeamType) {
01687     errorCounterBeamType++;
01688     if (nu.detector==Detector::kNear) {
01689 
01690       //check if the number of sequential mixed beam type
01691       //events is greater than the upper limit
01692       Int_t upperLimit=10;
01693       if (errorCounterBeamType>upperLimit) {
01694         MAXMSG("NuCuts",Msg::kError,100)
01695           <<"Bad beamType: "
01696           <<" beamTypeDB="<<nu.beamTypeDB
01697           <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01698           <<"), goodBeamToUse="<<goodBeamToUse
01699           <<", hornCur="<<nu.hornCur
01700           <<", hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01701           <<", coilIsOk="<<nu.coilIsOk
01702           <<", coilIsReverse="<<nu.coilIsReverse
01703           <<", isGoodDataQuality="<<nu.isGoodDataQuality
01704           <<", run="<<nu.run<<", subRun="<<nu.subRun
01705           <<", snarl="<<nu.snarl
01706           << endl;
01707         MSG("NuCutImps",Msg::kError)
01708           <<"Asserting on wrong beam type"
01709           <<" when we get more than "<<upperLimit<<" events with"
01710           <<" wrong beam in a row"
01711           <<", errorCounterBeamType="<<errorCounterBeamType
01712           <<endl;
01713         assert(isGoodBeamType);
01714       }
01715       else {
01716         MSG("NuCutImps",Msg::kWarning)
01717           <<"Not asserting on wrong beam type until"
01718           <<" we get more than "<<upperLimit<<" events with"
01719           <<" mixed beam in a row"
01720           <<", errorCounterBeamType="<<errorCounterBeamType
01721           <<", beamTypeDB="<<nu.beamTypeDB
01722           <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01723           <<"), goodBeamToUse="<<goodBeamToUse
01724           <<", hornCur="<<nu.hornCur
01725           <<", hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01726           <<", coilIsOk="<<nu.coilIsOk
01727           <<", coilIsReverse="<<nu.coilIsReverse
01728           <<", isGoodDataQuality="<<nu.isGoodDataQuality
01729           <<", run="<<nu.run<<", subRun="<<nu.subRun
01730           <<", snarl="<<nu.snarl
01731           <<endl;
01732       }
01733     }
01734     else if (nu.detector==Detector::kFar) {
01735       MSG("NuCuts",Msg::kWarning)
01736         <<"Bad beamType: "
01737         <<" beamTypeDB="<<nu.beamTypeDB
01738         <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01739         <<"), goodBeamToUse="<<goodBeamToUse
01740         <<", hornCur="<<nu.hornCur
01741         <<", hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01742         <<", coilIsOk="<<nu.coilIsOk
01743         <<", coilIsReverse="<<nu.coilIsReverse
01744         <<", isGoodDataQuality="<<nu.isGoodDataQuality
01745         <<", run="<<nu.run<<", subRun="<<nu.subRun
01746         <<", snarl="<<nu.snarl
01747         << endl;
01748       //NOTE: for the FD data, the pot counting is less of an issue
01749       //the crucial thing is that the value of pot used was obtained
01750       //using the same cuts as are applied here
01751     }
01752     else {
01753       cout<<"Ahhh, detector not known..."<<endl;
01754     }
01755   }
01756 
01757   return isGoodBeamType;
01758 }

Bool_t NuCuts::IsGoodCoilCurrent ( const NuEvent nu  )  const

Definition at line 1210 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::coilCurrent, NuEvent::cutOnDataQuality, NuEvent::detector, IsNMB(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, SimFlag::kData, Msg::kInfo, kJJE1, kJJH1, Detector::kNear, kNSI2011Fhc, Msg::kWarning, MAXMSG, and NuEvent::simFlag.

01211 {
01212   //check if MC or data
01213   if (nu.simFlag!=SimFlag::kData) {
01214     MAXMSG("NuCuts",Msg::kInfo,1)
01215       <<"Not cutting on CoilCurrent for simFlag="<<nu.simFlag<<endl;
01216     return true;
01217   }
01218 
01219   //check if Near or not
01220   if (nu.detector!=Detector::kNear) {
01221     MAXMSG("NuCuts",Msg::kInfo,1)
01222       <<"Not cutting on ND CoilCurrent for detector="<<nu.detector
01223       <<endl;
01224     return true;
01225   }
01226 
01227   //check if the flag is set to cut
01228   if (!nu.cutOnDataQuality) {//use data quality flag
01229     MAXMSG("NuCuts",Msg::kWarning,1)
01230       <<"Not cutting on CoilCurrent (flag set to not cut)"<<endl;
01231     return true;
01232   }
01233 
01234   Float_t valueLow=-1000;
01235   Float_t valueHigh=1000;
01236 
01237   if (nu.anaVersion==NuCuts::kJJH1 ||
01238       nu.anaVersion==NuCuts::kJJE1 ||
01239       IsNMB(nu)) {
01240     //allow reversed field currents
01241     if (nu.coilCurrent<valueLow || nu.coilCurrent>valueHigh) {
01242       MAXMSG("NuCuts",Msg::kInfo,1)
01243         <<"Cutting on CoilCurrent < "<<valueLow
01244         <<" || CoilCurrent > "<<valueHigh<<endl;
01245       return true;
01246     }
01247     else {
01248       MAXMSG("NuCuts",Msg::kInfo,10)
01249         <<"Bad coil current="<<nu.coilCurrent<<endl;
01250       return false;
01251     }
01252   }
01253   else if (nu.anaVersion==NuCuts::kCC0093Std ||
01254            nu.anaVersion==NuCuts::kCC0250Std ||
01255            nu.anaVersion==NuCuts::kCC0325Std ||
01256            nu.anaVersion==NuCuts::kCC0720Std ||
01257            nu.anaVersion==NuCuts::kCC1070Std ||
01258            nu.anaVersion==NuCuts::kCC2014 ||
01259            nu.anaVersion==NuCuts::kCC2014NewCoilCut ||
01260            nu.anaVersion==NuCuts::kCC0720Test ||
01261            nu.anaVersion==NuCuts::kNSI2011Fhc) {
01262     if (nu.coilCurrent<valueLow) {
01263       MAXMSG("NuCuts",Msg::kInfo,1)
01264         <<"Cutting on CoilCurrent < "<<valueLow<<endl;
01265       return true;
01266     }
01267     else {
01268       MAXMSG("NuCuts",Msg::kInfo,10)
01269         <<"Bad coil current="<<nu.coilCurrent<<endl;
01270       return false;
01271     }
01272   }
01273   else {
01274     if (nu.coilCurrent<valueLow) {
01275       MAXMSG("NuCuts",Msg::kInfo,1)
01276         <<"Cutting on CoilCurrent < "<<valueLow<<endl;
01277       return true;
01278     }
01279     else {
01280       MAXMSG("NuCuts",Msg::kInfo,10)
01281         <<"Bad coil current="<<nu.coilCurrent<<endl;
01282       return false;
01283     }
01284   }
01285 }

Bool_t NuCuts::IsGoodCoilCurrentDirectionCC2008 ( const NuEvent nu  )  [static]

This can mess up pot counting, have to be very careful with it!

Definition at line 1844 of file NuCuts.cxx.

References AsString(), NuEvent::beamTypeDB, NuEvent::coilIsOk, NuEvent::coilIsReverse, NuEvent::detector, NuEvent::goodBeam, NuEvent::goodBeamSntp, NuEvent::hornCur, NuEvent::hornIsReverse, NuEvent::isGoodDataQuality, SimFlag::kData, Msg::kError, Detector::kFar, Msg::kInfo, Detector::kNear, Msg::kWarning, MAXMSG, MSG, NuEvent::run, NuEvent::simFlag, NuEvent::snarl, and NuEvent::subRun.

Referenced by NuCutImps::CC1070Std::Selection(), NuCutImps::RAF0720Std::Selection(), NuCutImps::RAF0720Ext::Selection(), NuCutImps::CC0720Std::Selection(), NuCutImps::NC0720Std::Selection(), NuCutImps::CC2014NewCoilCut::Selection(), and NuCutImps::CC2014::Selection().

01845 {
01847 
01848   //return if MC
01849   if (nu.simFlag!=SimFlag::kData) {
01850     MAXMSG("NuCuts",Msg::kInfo,1)
01851       <<"Not cutting on IsGoodCoilCurrentCC2008 for simFlag="
01852       <<nu.simFlag<<endl;
01853     return true;
01854   }
01855 
01856   //return if not good coil (guards against isolated events
01857   //that have garbage coil data, which could mess up the sanity check)
01858   //the events with bad coil quality will be removed elsewhere
01859   //as is standard practice
01860   if (!nu.coilIsOk) {
01861     MAXMSG("NuCuts",Msg::kInfo,1)
01862       <<"Not cutting on IsGoodCoilCurrentCC2008 for"
01863       <<" events with bad coil current data"
01864       <<", coilIsOk="<<nu.coilIsOk
01865       <<endl;
01866     return true;
01867   }
01868 
01869   Bool_t isGoodCoilCurrent=false;
01870 
01871   MAXMSG("NuCuts",Msg::kInfo,1)
01872     <<"Cutting on IsGoodCoilCurrentCC2008"<<endl;
01873   if (!nu.coilIsReverse) {
01874     isGoodCoilCurrent = true;
01875   }
01876   else isGoodCoilCurrent=false;
01877 
01878   if (!isGoodCoilCurrent) {
01879     if (nu.detector==Detector::kNear) {
01880       MAXMSG("NuCuts",Msg::kError,100)
01881         <<"Bad coil current: "
01882         <<" coilIsReverse="<<nu.coilIsReverse
01883         <<", coilIsOk="<<nu.coilIsOk
01884         <<", beamTypeDB="<<nu.beamTypeDB
01885         <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01886         <<"), goodBeamSntp="<<nu.goodBeamSntp
01887         <<", goodBeam="<<nu.goodBeam
01888         <<", hornCur="<<nu.hornCur
01889         <<", hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01890         <<", isGoodDataQuality="<<nu.isGoodDataQuality
01891         <<", run="<<nu.run<<", subRun="<<nu.subRun
01892         <<", snarl="<<nu.snarl
01893         << endl;
01894       assert(isGoodCoilCurrent);
01895     }
01896     else if (nu.detector==Detector::kFar) {
01897       MSG("NuCuts",Msg::kWarning)
01898         <<"Bad coil current: "
01899         <<" coilIsReverse="<<nu.coilIsReverse
01900         <<", coilIsOk="<<nu.coilIsOk
01901         <<", beamTypeDB="<<nu.beamTypeDB
01902         <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01903         <<"), goodBeamSntp="<<nu.goodBeamSntp
01904         <<", goodBeam="<<nu.goodBeam
01905         <<", hornCur="<<nu.hornCur
01906         <<", hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01907         <<", isGoodDataQuality="<<nu.isGoodDataQuality
01908         <<", run="<<nu.run<<", subRun="<<nu.subRun
01909         <<", snarl="<<nu.snarl
01910         << endl;
01911       //NOTE: for the FD data, the pot counting is less of an issue
01912       //the crucial thing is that the value of pot used was obtained
01913       //using the same cuts as are applied here
01914     }
01915     else {
01916       cout<<"Ahhh, detector not known..."<<endl;
01917     }
01918   }
01919 
01920   return isGoodCoilCurrent;
01921 }

Bool_t NuCuts::IsGoodCoilCurrentDirectionRHC2010 ( const NuEvent nu  )  [static]

This can mess up pot counting, have to be very careful with it!

Definition at line 1762 of file NuCuts.cxx.

References AsString(), NuEvent::beamTypeDB, NuEvent::coilIsOk, NuEvent::coilIsReverse, NuEvent::detector, NuEvent::goodBeam, NuEvent::goodBeamSntp, NuEvent::hornCur, NuEvent::hornIsReverse, NuEvent::isGoodDataQuality, SimFlag::kData, Msg::kError, Detector::kFar, Msg::kInfo, Detector::kNear, Msg::kWarning, MAXMSG, MSG, NuEvent::run, NuEvent::simFlag, NuEvent::snarl, and NuEvent::subRun.

Referenced by NuCutImps::RHC0150Std::Selection(), and NuCutImps::RHC0350BFnuBravo::Selection().

01763 {
01765 
01766   //return if MC
01767   if (nu.simFlag!=SimFlag::kData) {
01768     MAXMSG("NuCuts",Msg::kInfo,1)
01769       <<"Not cutting on IsGoodCoilCurrentRHC2010 for simFlag="
01770       <<nu.simFlag<<endl;
01771     return true;
01772   }
01773 
01774   //return if not good coil (guards against isolated events
01775   //that have garbage coil data, which could mess up the sanity check)
01776   //the events with bad coil quality will be removed elsewhere
01777   //as is standard practice
01778   if (!nu.coilIsOk) {
01779     MAXMSG("NuCuts",Msg::kInfo,1)
01780       <<"Not cutting on IsGoodCoilCurrentRHC2010 for"
01781       <<" events with bad coil current data"
01782       <<", coilIsOk="<<nu.coilIsOk
01783       <<endl;
01784     return true;
01785   }
01786 
01787   Bool_t isGoodCoilCurrent=false;
01788 
01789   MAXMSG("NuCuts",Msg::kInfo,1)
01790     <<"Cutting on IsGoodCoilCurrentRHC2010"<<endl;
01791   if (nu.coilIsReverse) {
01792     isGoodCoilCurrent = true;
01793   }
01794     else isGoodCoilCurrent=false;
01795   //  else isGoodCoilCurrent=true; //Anna for RHC-
01796 
01797   if (!isGoodCoilCurrent) {
01798     if (nu.detector==Detector::kNear) {
01799       MAXMSG("NuCuts",Msg::kError,100)
01800         <<"Bad coil current: "
01801         <<" coilIsReverse="<<nu.coilIsReverse
01802         <<", coilIsOk="<<nu.coilIsOk
01803         <<", beamTypeDB="<<nu.beamTypeDB
01804         <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01805         <<"), goodBeamSntp="<<nu.goodBeamSntp
01806         <<", goodBeam="<<nu.goodBeam
01807         <<", hornCur="<<nu.hornCur
01808         <<", hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01809         <<", isGoodDataQuality="<<nu.isGoodDataQuality
01810         <<", run="<<nu.run<<", subRun="<<nu.subRun
01811         <<", snarl="<<nu.snarl
01812         << endl;
01813       assert(isGoodCoilCurrent);
01814     }
01815     else if (nu.detector==Detector::kFar) {
01816       MSG("NuCuts",Msg::kWarning)
01817         <<"Bad coil current: "
01818         <<" coilIsReverse="<<nu.coilIsReverse
01819         <<", coilIsOk="<<nu.coilIsOk
01820         <<", beamTypeDB="<<nu.beamTypeDB
01821         <<"("<<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
01822         <<"), goodBeamSntp="<<nu.goodBeamSntp
01823         <<", goodBeam="<<nu.goodBeam
01824         <<", hornCur="<<nu.hornCur
01825         <<", hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
01826         <<", isGoodDataQuality="<<nu.isGoodDataQuality
01827         <<", run="<<nu.run<<", subRun="<<nu.subRun
01828         <<", snarl="<<nu.snarl
01829         << endl;
01830       //NOTE: for the FD data, the pot counting is less of an issue
01831       //the crucial thing is that the value of pot used was obtained
01832       //using the same cuts as are applied here
01833     }
01834     else {
01835       cout<<"Ahhh, detector not known..."<<endl;
01836     }
01837   }
01838 
01839     return isGoodCoilCurrent;
01840 }

Bool_t NuCuts::IsGoodCosPr ( const NuEvent nu  )  const

Definition at line 3169 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::cosPrTrkVtx, Msg::kInfo, kMSRock, and MAXMSG.

03170 {
03171   if (nu.anaVersion==NuCuts::kMSRock) {
03172     // Rock-like if cosPrTrkVtx < -0.2
03173     MAXMSG("NuCuts",Msg::kInfo,1)
03174       <<"Making Cut: IsGoodCosPr < -0.2" << endl;
03175     if (nu.cosPrTrkVtx >= -0.2) return false;
03176   }
03177 
03178   return true;
03179 }

Bool_t NuCuts::IsGoodDataQuality ( const NuEvent nu  )  const

Definition at line 1925 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::cutOnDataQuality, NuEvent::detector, NuEvent::isGoodDataQuality, kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, SimFlag::kData, Detector::kFar, Msg::kInfo, kJJE1, kJJE2, kJJH1, Detector::kNear, kNMB0325Alpha, kNMB0325Bravo, kNMB0325BravoTwo, kNMB0325Charlie, kNMB0325Delta, kNMB0325Echo, kNMBFree, kNSI2011Fhc, kRM1, kRM2, Msg::kWarning, MAXMSG, and NuEvent::simFlag.

Referenced by NuDemoModule::Ana(), NuAnalysis::ChargeSeparationOneSnarl(), NuCutImps::NuCutsSelection::IsGoodPreSelectionCuts(), NuAnalysis::LIRejectionTest(), and NuFluctuator::SelectedAs().

01926 {
01927   //return if MC
01928   if (nu.simFlag!=SimFlag::kData) {
01929     MAXMSG("NuCuts",Msg::kInfo,1)
01930       <<"Not cutting on DataQuality for simFlag="<<nu.simFlag<<endl;
01931     return true;
01932   }
01933 
01934   //check if the flag is set to cut
01935   if (!nu.cutOnDataQuality) {
01936     MAXMSG("NuCuts",Msg::kWarning,1)
01937       <<"Not cutting on DataQuality (flag set to not cut)"
01938       <<", isGoodDataQuality="<<nu.isGoodDataQuality<<endl;
01939     return true;
01940   }
01941 
01942   //make the cut
01943   if (nu.detector==Detector::kFar) {
01944     MAXMSG("NuCuts",Msg::kInfo,1)
01945       <<"Cutting on IsGoodDataQuality"<<endl;
01946     return nu.isGoodDataQuality;
01947   }
01948   else if (nu.detector==Detector::kNear) {
01949     if (nu.anaVersion==NuCuts::kCC0093Std ||
01950         nu.anaVersion==NuCuts::kJJH1 ||
01951         nu.anaVersion==NuCuts::kCC0250Std ||
01952         nu.anaVersion==NuCuts::kJJE1 ||
01953         nu.anaVersion==NuCuts::kCC0325Std ||
01954         nu.anaVersion == NuCuts::kCC0720Std ||
01955         nu.anaVersion == NuCuts::kCC1070Std ||
01956         nu.anaVersion == NuCuts::kCC2014 ||
01957         nu.anaVersion == NuCuts::kCC2014NewCoilCut ||
01958         nu.anaVersion==NuCuts::kCC0720Test ||
01959         nu.anaVersion==NuCuts::kNSI2011Fhc ||
01960         nu.anaVersion==NuCuts::kJJE2 ||
01961         nu.anaVersion == NuCuts::kNMB0325Alpha ||
01962         nu.anaVersion == NuCuts::kNMB0325Bravo ||
01963         nu.anaVersion == NuCuts::kNMB0325BravoTwo ||
01964         nu.anaVersion == NuCuts::kNMB0325Charlie ||
01965         nu.anaVersion == NuCuts::kNMB0325Delta ||
01966         nu.anaVersion == NuCuts::kNMB0325Echo  ||
01967         nu.anaVersion == NuCuts::kRM1  ||
01968         nu.anaVersion == NuCuts::kRM2  ||
01969         nu.anaVersion == NuCuts::kNMBFree) {
01970       MAXMSG("NuCuts",Msg::kInfo,1)
01971         <<"NOT cutting on IsGoodDataQuality for anaVersion="<<nu.anaVersion<<endl;
01972       //don't cut on coil current or data quality here due to
01973       //POT counting (now changed so that the "good" pot is
01974       //after data quality and coil current)
01975       //the data quality information was not available before the 7e20 analyses
01976       return true;
01977     }
01978     else {
01979       MAXMSG("NuCuts",Msg::kInfo,1)
01980         <<"Cutting on IsGoodDataQuality"<<endl;
01981       return nu.isGoodDataQuality;
01982     }
01983   }
01984   else {
01985     cout<<"Ahhh, det="<<nu.detector<<endl;
01986     return false;
01987   }
01988 }

Bool_t NuCuts::IsGoodDirCos ( const NuEvent nu  )  const

Definition at line 2044 of file NuCuts.cxx.

References NuEvent::detector, NuEvent::dirCosNu, Detector::kFar, Msg::kInfo, Detector::kNear, and MAXMSG.

Referenced by NuDemoModule::Ana(), NuAnalysis::ChargeSeparationOneSnarl(), NuCutImps::NuCutsSelection::IsGoodPreSelectionCuts(), NuAnalysis::LIRejectionTest(), and NuFluctuator::SelectedAs().

02045 {
02046   Float_t cutValue=0.6;
02047   //trkvtxdcosz //dirCosNu
02048   Float_t value=nu.dirCosNu;
02049 
02050   if (nu.detector==Detector::kNear) {
02051     MAXMSG("NuCuts",Msg::kInfo,1)
02052       <<"Not cutting on track direction cosine for ND"<<endl;
02053     return true;
02054   }
02055   else if (nu.detector==Detector::kFar) {
02056     MAXMSG("NuCuts",Msg::kInfo,1)
02057       <<"Making cut on track direction cosine>"<<cutValue<<endl;
02058     if (value>cutValue) return true;
02059     else return false;
02060   }
02061   else {
02062     cout<<"Ahhh, detector="<<nu.detector<<endl;
02063     return false;
02064   }
02065 }

Bool_t NuCuts::IsGoodDpID ( const NuEvent nu  )  const

Definition at line 296 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::charge, NuEvent::detector, NuEvent::dpID, IsNMBNQ(), IsNMBPQ(), NuEvent::jitter, kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, Detector::kFar, Msg::kInfo, kJJE1, kJJE2, kJJH1, Detector::kNear, kNMB0325Bravo, kNMB0325BravoTwo, kNSI2011Fhc, and MAXMSG.

Referenced by NuAnalysis::EnergySpect(), IsGoodPID(), and NuAnalysis::N_1().

00297 {
00298   if (nu.anaVersion==NuCuts::kJJH1) {
00299     Float_t cutValue=0.4;//my numubar cut
00300     //Float_t cutValue=0.1;//get away from NC disagreement
00301     //Float_t cutValue=0.0;//my less harsh numubar cut
00302     //Float_t cutValue=-0.4;//MK's cut
00303 
00304     if (nu.charge==+1){
00305       MAXMSG("NuCuts",Msg::kInfo,1)
00306         <<"Making cut on +ve track: IsGoodDpID>"<<cutValue<<endl;
00307       if (nu.dpID>cutValue) return true;
00308       else return false;
00309     }
00310     else if (nu.charge==-1){
00311       if (nu.detector==Detector::kNear) cutValue=-0.1;
00312       else if (nu.detector==Detector::kFar) cutValue=-0.2;
00313       else {
00314         cout<<"Ahhh, detector="<<nu.detector<<endl;
00315         return false;
00316       }
00317 
00318       //override cutValue
00319       //cutValue=0.1;//get away from NC disagreement
00320 
00321       MAXMSG("NuCuts",Msg::kInfo,1)
00322         <<"Making cut on -ve track: IsGoodDpID>"<<cutValue<<endl;
00323       if (nu.dpID>cutValue) return true;
00324       else return false;
00325     }
00326     else {
00327       cout<<"Bad charge"<<endl;
00328       return false;
00329     }
00330   }
00331   else if (nu.anaVersion==NuCuts::kJJE1){
00332     if (nu.charge==1){
00333       MAXMSG("NuCuts",Msg::kInfo,1)
00334         <<"Making combined dpID and track jitter cut" <<endl;
00335       if (nu.dpID < 0.0){return false;}
00336       if (nu.jitter > 0.5){return false;}
00337       if (nu.jitter > (0.59*nu.dpID + 0.2)){return false;}
00338       return true;
00339     }
00340     else if(nu.charge==-1){
00341       Float_t cutValue=-0.1;
00342       if (nu.detector==Detector::kNear) cutValue=-0.1;
00343       else if (nu.detector==Detector::kFar) cutValue=-0.2;
00344       else {
00345         cout<<"Ahhh, detector="<<nu.detector<<endl;
00346         return false;
00347       }
00348       MAXMSG("NuCuts",Msg::kInfo,1)
00349         <<"Making cut: IsGoodDpID>"<<cutValue<<endl;
00350 
00351       if (nu.dpID>cutValue) return true;
00352       else return false;
00353     }
00354     else{
00355       cout<<"Bad charge"<<endl;
00356       return false;
00357     }
00358   }
00359   else if (nu.anaVersion==NuCuts::kJJE2 && nu.charge==1){
00360     MAXMSG("NuCuts",Msg::kInfo,1)
00361       <<"Making combined dpID and track jitter cut" <<endl;
00362     if (nu.dpID < 0.0){return false;}
00363     if (nu.jitter > 0.5){return false;}
00364     if (nu.jitter > (0.59*nu.dpID + 0.2)){return false;}
00365     return true;
00366   }
00367   else if (nu.anaVersion==NuCuts::kCC0093Std) {
00368     Float_t cutValue=-0.1;
00369     if (nu.detector==Detector::kNear) cutValue=-0.1;
00370     else if (nu.detector==Detector::kFar) cutValue=-0.2;
00371     else {
00372       cout<<"Ahhh, detector="<<nu.detector<<endl;
00373       return false;
00374     }
00375     MAXMSG("NuCuts",Msg::kInfo,1)
00376       <<"Making cut: IsGoodDpID>"<<cutValue<<endl;
00377 
00378     if (nu.dpID>cutValue) return true;
00379     else return false;
00380   }
00381   else if (nu.anaVersion==NuCuts::kCC0250Std ||
00382            nu.anaVersion==NuCuts::kCC0325Std ||
00383            nu.anaVersion==NuCuts::kCC0720Std ||
00384            nu.anaVersion==NuCuts::kCC1070Std ||
00385            nu.anaVersion==NuCuts::kCC2014 ||
00386            nu.anaVersion==NuCuts::kCC2014NewCoilCut ||
00387            nu.anaVersion==NuCuts::kCC0720Test || IsNMBNQ(nu) ||
00388            nu.anaVersion==NuCuts::kNSI2011Fhc) {
00389     Float_t cutValue=-0.1;
00390     if (nu.detector==Detector::kNear) cutValue=-0.1;
00391     else if (nu.detector==Detector::kFar) cutValue=-0.2;
00392     else {
00393       cout<<"Ahhh, detector="<<nu.detector<<endl;
00394       return false;
00395     }
00396     MAXMSG("NuCuts",Msg::kInfo,1)
00397       <<"Making cut: IsGoodDpID>"<<cutValue<<endl;
00398 
00399     if (nu.dpID>cutValue) return true;
00400     else return false;
00401   }
00402   else if ((nu.anaVersion == NuCuts::kNMB0325Bravo ||
00403             nu.anaVersion == NuCuts::kNMB0325BravoTwo) && IsNMBPQ(nu)) {
00404     Float_t cutValue=0.25;
00405 
00406     if (nu.anaVersion == NuCuts::kNMB0325BravoTwo) {
00407       cutValue = 0.32;
00408     }
00409     MAXMSG("NuCuts",Msg::kInfo,1)
00410       << "Making +ve  cut: IsGoodDpID>"<<cutValue<<endl;
00411     if (nu.dpID>cutValue)
00412       return true;
00413     else
00414       return false;
00415   }
00416   else {
00417     //Float_t cutValue=0.4;//my numubar cut
00418     Float_t cutValue=0.0;//my less harsh numubar cut
00419     //Float_t cutValue=-0.4;//MK's cut
00420 
00421     if (nu.charge==+1){
00422       MAXMSG("NuCuts",Msg::kInfo,1)
00423         <<"Making cut on +ve track: IsGoodDpID>"<<cutValue<<endl;
00424       if (nu.dpID>cutValue) return true;
00425       else return false;
00426     }
00427     else if (nu.charge==-1){
00428       if (nu.detector==Detector::kNear) cutValue=-0.1;
00429       else if (nu.detector==Detector::kFar) cutValue=-0.2;
00430       else {
00431         cout<<"Ahhh, detector="<<nu.detector<<endl;
00432         return false;
00433       }
00434       MAXMSG("NuCuts",Msg::kInfo,1)
00435         <<"Making cut on -ve track: IsGoodDpID>"<<cutValue<<endl;
00436 
00437       if (nu.dpID>cutValue) return true;
00438       else return false;
00439     }
00440     else {
00441       cout<<"Bad charge"<<endl;
00442       return false;
00443     }
00444   }
00445   return true;
00446 }

Bool_t NuCuts::IsGoodFitChi2PerNdof ( const NuEvent nu  )  const

Definition at line 929 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::chi2PerNdof, IsNMB(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, Msg::kInfo, kJJE1, kJJH1, kNSI2011Fhc, and MAXMSG.

Referenced by NuAnalysis::EnergySpect(), NuAnalysis::N_1(), NuDSTAna::NMBAna(), and NuAnalysis::NMBSummaryTreeAna().

00930 {
00931   Float_t cutValue=10;
00932 
00933   if (nu.anaVersion==NuCuts::kJJH1) {
00934     Bool_t doCut=false;
00935     if (doCut) {
00936       MAXMSG("NuCuts",Msg::kInfo,1)
00937         <<"Making cut on chi2PerNdof<"<<cutValue<<endl;
00938       //make cut
00939       if (nu.chi2PerNdof>cutValue) {
00940         return false;
00941       }
00942       else return true;
00943     }
00944     else {
00945       MAXMSG("NuCuts",Msg::kInfo,1)
00946         <<"Not cutting on Chi2PerNdof"<<endl;
00947       return true;
00948     }
00949   }
00950 
00951   else if (nu.anaVersion==NuCuts::kCC0093Std ||
00952            nu.anaVersion==NuCuts::kCC0250Std ||
00953            nu.anaVersion==NuCuts::kJJE1 ||
00954            nu.anaVersion==NuCuts::kCC0325Std ||
00955            nu.anaVersion==NuCuts::kCC0720Std ||
00956            nu.anaVersion==NuCuts::kCC1070Std ||
00957            nu.anaVersion==NuCuts::kCC2014 ||
00958            nu.anaVersion==NuCuts::kCC2014NewCoilCut ||
00959            nu.anaVersion==NuCuts::kCC0720Test || IsNMB(nu) ||
00960            nu.anaVersion==NuCuts::kNSI2011Fhc ) {
00961     //no cut
00962     MAXMSG("NuCuts",Msg::kInfo,1)
00963       <<"Not cutting on Chi2PerNdof"<<endl;
00964     return true;
00965   }
00966   else {
00967     //no cut
00968     MAXMSG("NuCuts",Msg::kInfo,1)
00969       <<"Not cutting on Chi2PerNdof"<<endl;
00970     return true;
00971   }
00972 }

Bool_t NuCuts::IsGoodFitProb ( const NuEvent nu  )  const

Definition at line 976 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::charge, IsNMBNQ(), IsNMBPQ(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, Msg::kInfo, kJJE1, kJJE2, kJJH1, kNMB0325Delta, kNSI2011Fhc, MAXMSG, and NuEvent::prob.

Referenced by NuDemoModule::Ana(), NuAnalysis::ChargeSeparationOneSnarl(), NuAnalysis::Efficiencies(), NuAnalysis::EnergySpect(), NuPlots::FillN_1Plots(), NuCutImps::NuCutsSelection::IsGoodStdCuts(), NuDSTAna::JeffsTestAna(), NuAnalysis::LIRejectionTest(), NuAnalysis::N_1(), NuDSTAna::NMBAna(), NuAnalysis::NMBSummaryTreeAna(), and NuFluctuator::SelectedAs().

00977 {
00978   Float_t cutValue=0.1;
00979 
00980   if (nu.anaVersion==NuCuts::kJJH1) {
00981     if (nu.charge==+1){
00982       cutValue=0.1;
00983       MAXMSG("NuCuts",Msg::kInfo,1)
00984         <<"Making cut on +ve track: Fit Prob>"<<cutValue<<endl;
00985       if (nu.prob>cutValue) return true;
00986       else return false;
00987     }
00988     else if (nu.charge==-1){
00989       Bool_t doCut=false;
00990 
00991       if (doCut) {
00992         //if (nu.detector==Detector::kNear) cutValue=-0.1;
00993         //else if (nu.detector==Detector::kFar) cutValue=-0.2;
00994         //else {
00995         //cout<<"Ahhh, detector="<<nu.detector<<endl;
00996         //return false;
00997         //}
00998         cutValue=0.0;
00999 
01000         MAXMSG("NuCuts",Msg::kInfo,1)
01001           <<"Making cut on -ve track: Fit Prob>="<<cutValue<<endl;
01002         if (nu.prob>=cutValue) return true;
01003         else return false;
01004       }
01005       else {
01006         //no cut
01007         MAXMSG("NuCuts",Msg::kInfo,1)
01008           <<"Not cutting on trk fit probability for -ve tracks"<<endl;
01009         return true;
01010       }
01011     }
01012     else {
01013       cout<<"Bad charge"<<endl;
01014       return false;
01015     }
01016   }
01017   else if (nu.anaVersion==NuCuts::kJJE1){
01018     if (1==nu.charge){
01019       MAXMSG("NuCuts",Msg::kInfo,1)
01020         <<"Making cut on tfProb>" << cutValue <<endl;
01021       cutValue = 0.1;
01022       if (nu.prob<0.1){return false;}
01023       else{return true;}
01024     }
01025     else if (-1==nu.charge){
01026       //no cut
01027       MAXMSG("NuCuts",Msg::kInfo,1)
01028         <<"Not cutting on Fit Prob"<<endl;
01029       return true;
01030     }
01031     else {
01032       cout<<"Bad charge"<<endl;
01033       return false;
01034     }
01035   }
01036   else if (nu.anaVersion==NuCuts::kJJE2 && nu.charge==1){
01037     MAXMSG("NuCuts",Msg::kInfo,1)
01038       <<"Making cut on tfProb>" << cutValue <<endl;
01039     cutValue = 0.1;
01040     if (nu.prob<0.1){return false;}
01041     else{return true;}
01042   }
01043   else if (nu.anaVersion==NuCuts::kCC0093Std ||
01044            nu.anaVersion==NuCuts::kCC0250Std ||
01045            nu.anaVersion==NuCuts::kCC0325Std ||
01046            nu.anaVersion==NuCuts::kCC0720Std ||
01047            nu.anaVersion==NuCuts::kCC1070Std ||
01048            nu.anaVersion==NuCuts::kCC2014 ||
01049            nu.anaVersion==NuCuts::kCC2014NewCoilCut ||
01050            nu.anaVersion==NuCuts::kCC0720Test ||
01051            nu.anaVersion==NuCuts::kNSI2011Fhc ||
01052            IsNMBNQ(nu) ) {
01053     //no cut
01054     MAXMSG("NuCuts",Msg::kInfo,1)
01055       <<"Not cutting on Fit Prob"<<endl;
01056     return true;
01057   }
01058   else if ((nu.anaVersion == NuCuts::kNMB0325Delta) && IsNMBPQ(nu))
01059     {
01060       MAXMSG("NuCuts",Msg::kInfo,1) << "Cutting on prob>0.003" << endl;
01061       if (nu.prob <= 0.003)
01062         return false;
01063       else
01064         return true;
01065     } else {
01066     //no cut
01067     MAXMSG("NuCuts",Msg::kInfo,1)
01068       <<"Not cutting on Fit Prob"<<endl;
01069     return true;
01070   }
01071   return true;
01072 }

Bool_t NuCuts::IsGoodJmID ( const NuEvent nu  )  const

Definition at line 505 of file NuCuts.cxx.

References NuEvent::jmID, Msg::kInfo, and MAXMSG.

Referenced by IsGoodPID().

00506 {
00507   Float_t cutValue=0.5;
00508   MAXMSG("NuCuts",Msg::kInfo,1)
00509     <<"Making cut: IsGoodJmID>"<<cutValue<<endl;
00510   return (nu.jmID>cutValue);
00511   return true;
00512 }

Bool_t NuCuts::IsGoodMajorityCurvature ( const NuEvent nu  )  const

Definition at line 1076 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::charge, IsNMBNQ(), IsNMBPQ(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, Msg::kInfo, kJJE1, kJJE2, kJJH1, kNMB0325Charlie, kNSI2011Fhc, MAXMSG, and NuEvent::smoothMajC.

Referenced by NuPlots::FillN_1Plots(), NuCutImps::NuCutsSelection::IsGoodStdCuts(), and NuFluctuator::SelectedAs().

01077 {
01078   if (nu.anaVersion==NuCuts::kJJE1){
01079     if (1==nu.charge){
01080       MAXMSG("NuCuts",Msg::kInfo,1)
01081         <<"Making cut on Majority Curvature < 0" << endl;
01082       if (nu.smoothMajC<0.0){return false;}
01083       else{return true;}
01084     }
01085     else if (-1==nu.charge){
01086       //no cut
01087       MAXMSG("NuCuts",Msg::kInfo,1)
01088         <<"Not cutting on Majority Curvature for charge=-1"<<endl;
01089       return true;
01090     }
01091     else {
01092       cout<<"Bad charge"<<endl;
01093       return false;
01094     }
01095   }
01096   else if (nu.anaVersion==NuCuts::kJJE2 && nu.charge==1){
01097     MAXMSG("NuCuts",Msg::kInfo,1)
01098       <<"Making cut on Majority Curvature < 0" << endl;
01099     if (nu.smoothMajC<0.0){return false;}
01100     else{return true;}
01101   }
01102   else if (nu.anaVersion==NuCuts::kJJH1 ||
01103            nu.anaVersion==NuCuts::kCC0093Std ||
01104            nu.anaVersion==NuCuts::kCC0250Std ||
01105            nu.anaVersion==NuCuts::kCC0325Std ||
01106            nu.anaVersion==NuCuts::kCC0720Std ||
01107            nu.anaVersion==NuCuts::kCC1070Std ||
01108            nu.anaVersion==NuCuts::kCC2014 ||
01109            nu.anaVersion==NuCuts::kCC2014NewCoilCut ||
01110            nu.anaVersion==NuCuts::kCC0720Test ||
01111            nu.anaVersion==NuCuts::kNSI2011Fhc ||
01112            IsNMBNQ(nu) ) {
01113     //no cut
01114     MAXMSG("NuCuts",Msg::kInfo,1)
01115       <<"Not cutting on Majority Curvature"<<endl;
01116     return true;
01117   }
01118   else if ((nu.anaVersion == NuCuts::kNMB0325Charlie) && IsNMBPQ(nu)) {
01119     MAXMSG("NuCuts",Msg::kInfo,1)<<"Making cut on Majority Curvature > -0.22" << endl;
01120 
01121     // Make the numubar cut
01122     if (nu.smoothMajC > -0.22)
01123       return true;
01124     else
01125       return false;
01126   }
01127   else {
01128     //no cut
01129     MAXMSG("NuCuts",Msg::kInfo,1)
01130       <<"Not cutting on Majority Curvature"<<endl;
01131     return true;
01132   }
01133   return true;
01134 }

Bool_t NuCuts::IsGoodNearShowerEn ( const NuEvent nu  )  const

Definition at line 3198 of file NuCuts.cxx.

References NuEvent::anaVersion, Msg::kInfo, kMSRock, MAXMSG, and NuEvent::trkShwEnNear.

03199 {
03200   if (nu.anaVersion==NuCuts::kMSRock) {
03201     MAXMSG("NuCuts",Msg::kInfo,1)
03202       <<"Making Cut: IsGoodNearshowerEnergy < 0.5" << endl;
03203 
03204     // Rock-like if trkShwEnNear < 0.5
03205     if (nu.trkShwEnNear >= 0.5) return false;
03206   }
03207 
03208   return true;
03209 }

Bool_t NuCuts::IsGoodNtID ( const NuEvent nu  )  const

Definition at line 513 of file NuCuts.cxx.

References Msg::kInfo, and MAXMSG.

00514 {
00515   Float_t cutValue=0.8;
00516   MAXMSG("NuCuts",Msg::kInfo,1)
00517     <<"Making cut: ISGoodNtID>"<<cutValue<<endl;
00518   //  return (nu.ntID>cutValue);
00519   return true;
00520 }

Bool_t NuCuts::IsGoodNumberOfTracks ( const NuEvent nu  )  const

Definition at line 86 of file NuCuts.cxx.

References Msg::kInfo, MAXMSG, and NuEvent::ntrk.

Referenced by NuDemoModule::Ana(), NuAnalysis::ChargeSeparationOneSnarl(), NuCutImps::NuCutsSelection::IsGoodPreSelectionCuts(), NuAnalysis::LIRejectionTest(), NuFluctuator::SelectedAs(), and NuDSTAna::VsTime().

00087 {
00088   /*
00089     if (nu.anaVersion==NuCuts::kJJH1 ||
00090     nu.anaVersion==NuCuts::kJJE1) {
00091     MAXMSG("NuCuts",Msg::kInfo,1)
00092     <<"Making cut on number of tracks>=1"<<endl;
00093     return nu.ntrk>=1;
00094     }
00095     else if (nu.anaVersion==NuCuts::kCC0093Std ||
00096     nu.anaVersion==NuCuts::kCC0250Std ||
00097     nu.anaVersion==NuCuts::kCC0325Std) {
00098     MAXMSG("NuCuts",Msg::kInfo,1)
00099     <<"Making cut on number of tracks>=1"<<endl;
00100     return nu.ntrk>=1;
00101     }
00102     else {
00103     MAXMSG("NuCuts",Msg::kInfo,1)
00104     <<"Making cut on number of tracks>=1"<<endl;
00105     return nu.ntrk>=1;
00106     }
00107   */
00108 
00109   // For now, at least, all cuts make the same cut
00110   MAXMSG("NuCuts",Msg::kInfo,1)
00111     <<"Making cut on number of tracks>=1"<<endl;
00112   return nu.ntrk >= 1;
00113 }

Bool_t NuCuts::IsGoodPID ( const NuEvent nu  )  const

Definition at line 228 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::charge, IsGoodAbID(), IsGoodDpID(), IsGoodJmID(), IsGoodPoKIN(), IsGoodRoID(), IsNMBNQ(), IsNMBPQ(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, kJJE1, kJJE2, kJJH1, kMSRock, kNCPRLCC, kNMB0325Alpha, kNMB0325Bravo, kNMB0325BravoTwo, kNMB0325ChairSound, kNMB0325Charlie, kNMB0325Delta, kNMB0325Echo, kNMBFree, kNSI2011Fhc, kRHC, kRM1, and kRM2.

Referenced by NuDemoModule::Ana(), NuAnalysis::ChargeSeparationOneSnarl(), NuPlots::FillN_1Plots(), NuCutImps::NuCutsSelection::IsGoodStdCuts(), NuDSTAna::JeffsTestAna(), NuAnalysis::LIRejectionTest(), NuFluctuator::SelectedAs(), and NuDSTAna::VsTime().

00229 {
00230   if (nu.anaVersion==NuCuts::kJJH1) {
00231     return this->IsGoodAbID(nu);
00232   }
00233   else if (nu.anaVersion==NuCuts::kJJE1){
00234     if (nu.charge==1){
00235       return this->IsGoodDpID(nu);
00236     }
00237     else if (nu.charge==-1){
00238       return this->IsGoodAbID(nu);
00239     }
00240     else {
00241       cout<<"Bad charge"<<endl;
00242       return false;
00243     }
00244   }
00245   else if (nu.anaVersion==NuCuts::kJJE2 && nu.charge==1){
00246     return this->IsGoodDpID(nu);
00247   }
00248   else if (nu.anaVersion==NuCuts::kCC0093Std) {
00249     return this->IsGoodDpID(nu);
00250   }
00251   else if (nu.anaVersion==NuCuts::kCC0250Std) {
00252     return this->IsGoodAbID(nu);
00253   }
00254   else if (nu.anaVersion==NuCuts::kCC0325Std
00255            || nu.anaVersion == NuCuts::kCC0720Std
00256            || nu.anaVersion == NuCuts::kCC1070Std
00257            || nu.anaVersion == NuCuts::kCC2014
00258            || nu.anaVersion == NuCuts::kCC2014NewCoilCut
00259            || IsNMBNQ(nu)
00260            || nu.anaVersion == NuCuts::kNMB0325ChairSound
00261            || nu.anaVersion == NuCuts::kMSRock
00262            || nu.anaVersion == NuCuts::kNSI2011Fhc) {
00263     return this->IsGoodRoID(nu);
00264   }
00265   else if (nu.anaVersion==NuCuts::kCC0720Test){
00266     return (this->IsGoodRoID(nu) || this->IsGoodJmID(nu));
00267   }
00268   else if (((nu.anaVersion==NuCuts::kNMB0325Alpha) ||
00269             (nu.anaVersion==NuCuts::kNMB0325Charlie) ||
00270             (nu.anaVersion==NuCuts::kNMB0325Delta) ||
00271             (nu.anaVersion==NuCuts::kRM1) ||
00272             (nu.anaVersion==NuCuts::kRM2) ||
00273             (nu.anaVersion==NuCuts::kRHC) ) && IsNMBPQ(nu) ||
00274            (nu.anaVersion == NuCuts::kNCPRLCC)) {
00275     // Both nmb and CC selectors are the same here
00276     return this->IsGoodRoID(nu);
00277   }
00278   else if ((nu.anaVersion == NuCuts::kNMB0325Bravo ||
00279             nu.anaVersion == NuCuts::kNMB0325BravoTwo) && IsNMBPQ(nu)) {
00280     return this->IsGoodDpID(nu);
00281   }
00282   else if ((nu.anaVersion == NuCuts::kNMB0325Echo) && IsNMBPQ(nu)) {
00283     return this->IsGoodPoKIN(nu);
00284   }
00285   else if ((nu.anaVersion == NuCuts::kNMBFree)&& IsNMBPQ(nu)){
00286     return true;
00287   }
00288   else {
00289     return this->IsGoodAbID(nu);
00290   }
00291   return true;
00292 }

Bool_t NuCuts::IsGoodPoKIN ( const NuEvent nu  )  const

Definition at line 524 of file NuCuts.cxx.

References NuEvent::anaVersion, Msg::kInfo, kNMB0325Echo, MAXMSG, and NuEvent::poIDKin.

Referenced by IsGoodPID().

00525 {
00526   Float_t cutValue=-0.1;
00527   MAXMSG("NuCuts",Msg::kInfo,1)
00528     <<"Making Cut: IsGoodPoKIN>" << cutValue << endl;
00529   // Check the value!
00530   if (nu.anaVersion == NuCuts::kNMB0325Echo) {
00531     if (nu.poIDKin <= cutValue) return false;
00532   }
00533 
00534   // return true for all other cases (not cutting, is correct)
00535   return true;
00536 }

Bool_t NuCuts::IsGoodQP ( const NuEvent nu  )  const

Definition at line 896 of file NuCuts.cxx.

References NuEvent::anaVersion, Msg::kInfo, kNMB0325Alpha, kNMB0325Bravo, kNMB0325BravoTwo, kNMB0325Charlie, kNMB0325Delta, kNMB0325Echo, kNMBFree, kRHC, kRM2, Msg::kWarning, MAXMSG, and NuEvent::qp.

00897 {
00898   MAXMSG("NuCuts",Msg::kWarning,1) << "CUTTING ON QP. YOU PROBABLY DON'T WANT TO DO THIS" << endl;
00899 
00900   switch (nu.anaVersion)
00901     {
00902     case NuCuts::kNMB0325Alpha:
00903     case NuCuts::kNMB0325Bravo:
00904     case NuCuts::kNMB0325BravoTwo:
00905     case NuCuts::kNMB0325Charlie:
00906     case NuCuts::kNMB0325Delta:
00907     case NuCuts::kNMB0325Echo:
00908     case NuCuts::kRM2:
00909     case NuCuts::kNMBFree:
00910     case NuCuts::kRHC:
00911       { // brackets defeat "jump to case crosses intialization" errors
00912         MAXMSG("NuCuts",Msg::kInfo,1) << "Cutting on Q/P>0" << endl;
00913         if (nu.qp <= 0)
00914           return false;
00915         break;
00916       }
00917     default:
00918       {
00919         MAXMSG("NuCuts",Msg::kInfo,1) << "Not Cutting on Q/P" << endl;
00920       }
00921     }
00922 
00923   // Either not cutting or passed cut
00924   return true;
00925 }

Bool_t NuCuts::IsGoodRelAngle ( const NuEvent nu  )  const

Definition at line 735 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::charge, IsNMB(), Msg::kInfo, kNMB0325Alpha, kNMB0325Bravo, kNMB0325BravoTwo, kNMB0325Echo, kNMB0720RM, kRM1, kRM2, MAXMSG, and NuEvent::relativeAngle.

Referenced by NuPlots::FillN_1Plots(), and NuCutImps::NuCutsSelection::IsGoodStdCuts().

00736 {
00737   // Calculate relative angle - pi
00738   Float_t cutValue = 0;
00739 
00740   // Only cut on NMB Selectors
00741   if (!IsNMB(nu))
00742     return true;
00743 
00744   // Don't cut on NMB negative charge events
00745   if (nu.charge == -1)
00746     return true;
00747   else if (nu.charge != 1)
00748     {
00749       cout << "Bad Charge: " << nu.charge << endl;
00750       return false;
00751     }
00752 
00753   // Do Rashid's relA selector for RM1
00754   if (nu.anaVersion == NuCuts::kRM1)
00755     {
00756       if (nu.relativeAngle < 1.0 || nu.relativeAngle > 5.0)
00757         return true;
00758       else
00759         return false;
00760     }
00761 
00762   switch (nu.anaVersion)
00763     {
00764     case NuCuts::kNMB0325Alpha:
00765       cutValue = 2.12;
00766       break;
00767     case NuCuts::kNMB0325Bravo:
00768       cutValue = 2.12;
00769       break;
00770     case NuCuts::kNMB0325BravoTwo:
00771       cutValue = 2.12;
00772       break;
00773     case NuCuts::kNMB0325Echo:
00774       cutValue = 2.02;
00775       break;
00776     case NuCuts::kRM2:
00777       cutValue = 2.0;
00778       break;
00779     case NuCuts::kNMB0720RM:
00780       cutValue = 2.0;
00781       break;
00782     default:
00783       // Do not cut if not one of the above
00784       MAXMSG("NuCuts",Msg::kInfo,1)
00785         << "Not Cutting on |relA-Pi|" << endl;
00786       return true;
00787     }
00788 
00789   MAXMSG("NuCuts",Msg::kInfo,1)
00790     << "Cutting on |relA-Pi|>" << cutValue << endl;
00791   if (abs(nu.relativeAngle - TMath::Pi()) <= cutValue)
00792     return false;
00793 
00794   return true;
00795 }

Bool_t NuCuts::IsGoodRoID ( const NuEvent nu  )  const

Definition at line 450 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::detector, IsNMB(), IsNMBNQ(), IsNMBPQ(), Detector::kFar, Msg::kInfo, kMSRock, kNCPRLCC, Detector::kNear, kNMB0325Alpha, kNMB0325Charlie, kNMB0325Delta, kNMB0720RM, kRHC, kRM1, kRM2, MAXMSG, and NuEvent::roID.

Referenced by IsGoodPID().

00451 {
00452   Float_t cutValue=0.3;
00453 
00454   // Check for the NuMuBar cuts first, then drop down to the default (original)
00455   // routine if none of them are to be used.
00456   if (IsNMBPQ(nu)) {
00457     if ((nu.anaVersion == NuCuts::kNMB0325Alpha) ||
00458         (nu.anaVersion == NuCuts::kNMB0325Charlie) ||
00459         (nu.anaVersion == NuCuts::kRM1)) {
00460       cutValue = 0.625;
00461     }
00462     else if (nu.anaVersion == NuCuts::kRM2) {
00463       cutValue = 0.65;
00464     }
00465     else if (nu.anaVersion == NuCuts::kNMB0720RM) {
00466       cutValue = 0.65;
00467     }
00468     else if (nu.anaVersion == NuCuts::kNMB0325Delta) {
00469       cutValue = 0.55;
00470     }
00471     else if (nu.anaVersion == NuCuts::kRHC) {
00472       cutValue = 0.30; // Prelim. RHC cut the same as the CC cut
00473     }
00474     MAXMSG("NuCuts",Msg::kInfo,1)
00475       <<"Making +ve IsGoodRoID>"<<cutValue<<endl;
00476   }
00477 
00478   // Drop to original behaviour in two cases:
00479   // - Is NOT a numubar selector
00480   // - IS a nmb selector, but this event has negative charge (i.e. a neutrino event)
00481   if (!IsNMB(nu) || IsNMBNQ(nu)) {
00482     // Original Behaviour
00483     if (nu.detector==Detector::kNear) cutValue=0.3;
00484     else if (nu.detector==Detector::kFar) cutValue=0.3;
00485     else {
00486       cout<<"Ahhh, detector="<<nu.detector<<endl;
00487       return false;
00488     }
00489   }
00490   if (nu.anaVersion == NuCuts::kNCPRLCC) {
00491     cutValue = 0.3;
00492   }
00493 
00494   // Rock muons are different!
00495   if (nu.anaVersion == NuCuts::kMSRock) {
00496     cutValue = 0.20;
00497   }
00498 
00499   MAXMSG("NuCuts",Msg::kInfo,1)
00500     <<"Making cut: IsGoodRoID>"<<cutValue<<endl;
00501 
00502   return (nu.roID>cutValue);
00503   return true;
00504 }

Bool_t NuCuts::IsGoodSigmaQP_QP ( const NuEvent nu  )  const

Definition at line 607 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::charge, IsNMBNQ(), IsNMBPQ(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, Msg::kInfo, kJJE1, kJJE2, kJJH1, kNMB0325Bravo, kNMB0325Echo, kNMB0720RM, kNSI2011Fhc, kRM1, kRM2, Msg::kWarning, MAXMSG, NuEvent::sigqp, NuEvent::sigqp_qp, NuEvent::usedCurv, and NuEvent::usedRange.

Referenced by NuDemoModule::Ana(), NuAnalysis::ChargeSeparationOneSnarl(), NuAnalysis::Efficiencies(), NuAnalysis::EnergySpect(), NuPlots::FillN_1Plots(), NuCutImps::NuCutsSelection::IsGoodStdCuts(), NuDSTAna::JeffsTestAna(), NuAnalysis::LIRejectionTest(), NuAnalysis::N_1(), NuDSTAna::NMBAna(), NuAnalysis::NMBSummaryTreeAna(), and NuFluctuator::SelectedAs().

00608 {
00609   Float_t cutValue=0.3;
00610 
00611   if (nu.anaVersion==NuCuts::kJJH1) {
00612     //first cut on anti-neutrinos
00613     if (nu.charge>0){
00614       MAXMSG("NuCuts",Msg::kInfo,1)
00615         <<"Making cut on +ve track: SigmaQP/QP<"<<cutValue<<endl;
00616       if (fabs(nu.sigqp_qp)<cutValue) {
00617         return true;
00618       }
00619       else return false;
00620     }
00621     //now look at neutrinos
00622     else if (nu.charge<0) {
00623       Bool_t doCut=false;//switch
00624       if (doCut) {
00625         MAXMSG("NuCuts",Msg::kInfo,1)
00626           <<"If curv used, making cut on -ve track: SigmaQP/QP>"
00627           <<-1*cutValue<<"; if range used, no cut"<<endl;
00628         if (nu.usedRange) {
00629           return true;//don't cut on fit error if using range
00630           //neutrinos swamp anti-neutrinos so little background
00631         }
00632         else if (nu.usedCurv) {
00633           if (fabs(nu.sigqp_qp)<cutValue) return true;
00634           else return false;
00635         }
00636         else {
00637           MAXMSG("NuCuts",Msg::kWarning,10)
00638             <<"Ahh, usedRange="<<nu.usedRange
00639             <<"and usedCurv="<<nu.usedCurv<<endl;
00640           return false;
00641         }
00642       }
00643       else {
00644         //don't cut
00645         MAXMSG("NuCuts",Msg::kInfo,1)
00646           <<"Not cutting on SigmaQP/QP for -ve tracks"<<endl;
00647         return true;
00648       }
00649     }
00650     else {
00651       cout<<"Ahh, bad charge"<<endl;
00652       return false;
00653     }
00654   }
00655   else if (nu.anaVersion==NuCuts::kJJE1){
00656     if (1==nu.charge){
00657       cutValue = 0.065;
00658       MAXMSG("NuCuts",Msg::kInfo,1)
00659         <<"Making cut on sigmaQP>" << cutValue <<endl;
00660       if (nu.sigqp>cutValue){return false;}
00661       else{return true;}
00662     }
00663     else if (-1==nu.charge){
00664       //no cut
00665       MAXMSG("NuCuts",Msg::kInfo,1)
00666         <<"Not cutting on SigmaQP/QP"<<endl;
00667       return true;
00668     }
00669     else {
00670       cout<<"Bad charge"<<endl;
00671       return false;
00672     }
00673   }
00674   else if (nu.anaVersion==NuCuts::kJJE2 && nu.charge==1){
00675     cutValue = 0.065;
00676     MAXMSG("NuCuts",Msg::kInfo,1)
00677       <<"Making cut on sigmaQP>" << cutValue <<endl;
00678     if (nu.sigqp>cutValue){return false;}
00679     else{return true;}
00680   }
00681   else if (nu.anaVersion==NuCuts::kCC0093Std ||
00682            nu.anaVersion==NuCuts::kCC0250Std ||
00683            nu.anaVersion==NuCuts::kCC0325Std ||
00684            nu.anaVersion==NuCuts::kCC0720Std ||
00685            nu.anaVersion==NuCuts::kCC1070Std ||
00686            nu.anaVersion==NuCuts::kCC2014 ||
00687            nu.anaVersion==NuCuts::kCC2014NewCoilCut ||
00688            nu.anaVersion==NuCuts::kCC0720Test || IsNMBNQ(nu) ||
00689            nu.anaVersion==NuCuts::kNSI2011Fhc ) {
00690     //no cut
00691     MAXMSG("NuCuts",Msg::kInfo,1)
00692       <<"Not cutting on SigmaQP/QP"<<endl;
00693     return true;
00694   }
00695   else if (((nu.anaVersion == NuCuts::kNMB0325Bravo) ||
00696             (nu.anaVersion == NuCuts::kNMB0325Echo)) && IsNMBPQ(nu)){
00697     cutValue = 3.5;
00698     MAXMSG("NuCuts",Msg::kInfo,1)
00699       << "Making Cut on +ve, QP_sigmaQP>" << cutValue << endl;
00700     if (1./nu.sigqp_qp > cutValue)
00701       return true;
00702     else
00703       return false;
00704 
00705   }
00706   else if ( ((nu.anaVersion == NuCuts::kRM2) || (nu.anaVersion == NuCuts::kNMB0720RM)) && IsNMBPQ(nu)) {
00707     cutValue = 2.3;
00708     MAXMSG("NuCuts",Msg::kInfo,1)
00709       << "Making Cut on +ve, QP_sigmaQP>" << cutValue << endl;
00710     if (1./nu.sigqp_qp > cutValue)
00711       return true;
00712     else
00713       return false;
00714   }
00715   else if ((nu.anaVersion == NuCuts::kRM1) && IsNMBPQ(nu)) {
00716     cutValue = 2.0;
00717     MAXMSG("NuCuts",Msg::kInfo,1)
00718       << "Making Cut on +ve, QP_sigmaQP>" << cutValue << endl;
00719     if (1./nu.sigqp_qp > cutValue)
00720       return true;
00721     else
00722       return false;
00723   }
00724   else {
00725     //no cut
00726     MAXMSG("NuCuts",Msg::kInfo,1)
00727       <<"Not cutting on SigmaQP/QP"<<endl;
00728     return true;
00729   }
00730   return true;
00731 }

Bool_t NuCuts::IsGoodTimeToNearestSpill ( const NuEvent nu  )  const

code from FDSpecWErrs::RunFDSpec2007BoxOpen.C evttimemin-closestspill)>-20e-6&&(evttimemin-closestspill)<30e-6

Definition at line 1992 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::cutOnSpillTiming, NuEvent::detector, IsNMB(), SimFlag::kData, Detector::kFar, Msg::kInfo, kJJE1, Msg::kWarning, MAXMSG, Munits::microsecond, NuEvent::simFlag, NuEvent::timeEvtMin, and NuEvent::timeToNearestSpill.

Referenced by NuDemoModule::Ana(), NuAnalysis::ChargeSeparationOneSnarl(), NuCutImps::NuCutsSelection::IsGoodPreSelectionCuts(), NuAnalysis::LIRejectionTest(), NuFluctuator::SelectedAs(), and NuDSTAna::VsTime().

01993 {
01996 
01997   //return if MC
01998   if (nu.simFlag!=SimFlag::kData) {
01999     MAXMSG("NuCuts",Msg::kInfo,1)
02000       <<"Not cutting on TimeToNearestSpill for simFlag="<<nu.simFlag
02001       <<endl;
02002     return true;
02003   }
02004 
02005   //return if ND
02006   if (nu.detector!=Detector::kFar) {
02007     MAXMSG("NuCuts",Msg::kInfo,1)
02008       <<"Not cutting on TimeToNearestSpill for detector="<<nu.detector
02009       <<endl;
02010     return true;
02011   }
02012 
02013   //check if the flag is set to cut
02014   if (!nu.cutOnSpillTiming) {
02015     MAXMSG("NuCuts",Msg::kWarning,1)
02016       <<"Not cutting on SpillTiming (flag set to not cut)"<<endl;
02017     return true;
02018   }
02019 
02020   //define the default time cuts
02021   Double_t lowerTimeBound=-20*(Munits::microsecond);
02022   Double_t upperTimeBound=+30*(Munits::microsecond);
02023 
02024   if (this->IsNMB(nu) || NuCuts::kJJE1==nu.anaVersion){
02025     //New and improved spill timing cut.
02026     lowerTimeBound=-2*(Munits::microsecond);
02027     upperTimeBound=+12*(Munits::microsecond);
02028   }
02029 
02030   MAXMSG("NuCuts",Msg::kInfo,1)
02031     <<"Cutting on TimeToNearestSpill: "
02032     <<lowerTimeBound/(Munits::microsecond)<<"<t<"
02033     <<upperTimeBound/(Munits::microsecond)<<" us"<<endl;
02034 
02035   if (nu.timeEvtMin-nu.timeToNearestSpill>lowerTimeBound &&
02036       nu.timeEvtMin-nu.timeToNearestSpill<upperTimeBound) {
02037     return true;
02038   }
02039   else return false;
02040 }

Bool_t NuCuts::IsGoodTrackDr ( const NuEvent nu  )  const

Definition at line 3183 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::drTrkFidvtx, Msg::kInfo, kMSRock, and MAXMSG.

03184 {
03185   if (nu.anaVersion==NuCuts::kMSRock) {
03186     MAXMSG("NuCuts",Msg::kInfo,1)
03187       <<"Making Cut: IsGoodTrackDr < 0.06" << endl;
03188 
03189     // Rock-like if drTrkFidVtx < 0.06
03190     if (nu.drTrkFidvtx >= 0.06) return false;
03191   }
03192 
03193   return true;
03194 }

Bool_t NuCuts::IsGoodTrackFitPass ( const NuEvent nu  )  const

Definition at line 117 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::charge, NuEvent::detector, IsGoodTrackFitPassReclamation(), IsNMBNQ(), IsNMBPQ(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, Detector::kFar, Msg::kInfo, kJJE1, kJJE2, kJJH1, Detector::kNear, kNSI2011Fhc, MAXMSG, and NuEvent::trkfitpass.

Referenced by NuDemoModule::Ana(), NuAnalysis::ChargeSeparationOneSnarl(), NuCutImps::NuCutsSelection::IsGoodPreSelectionCuts(), NuAnalysis::LIRejectionTest(), NuDSTAna::NMBAna(), and NuFluctuator::SelectedAs().

00118 {
00119   if (nu.anaVersion==NuCuts::kJJH1) {
00120     MAXMSG("NuCuts",Msg::kInfo,1)
00121       <<"Cutting on trk.fit.pass"<<endl;
00122     return nu.trkfitpass==1;
00123   }
00124   else if (IsNMBPQ(nu))
00125     {
00126       MAXMSG("NuCuts",Msg::kInfo,1)
00127         <<"Cutting on trk.fit.pass for +ve tracks"<<endl;
00128       return nu.trkfitpass==1;
00129     }
00130   else if (nu.anaVersion==NuCuts::kJJE1)
00131     {
00132       MAXMSG("NuCuts",Msg::kInfo,1)
00133         <<"Cutting on trk.fit.pass for +ve tracks, "
00134         << "trk.fit.pass w/ trk reclamation for -ve tracks." <<endl;
00135       if (nu.charge==1){
00136         // Not currently using track reclamation for RHC - but we could
00137         //if (nu.detector==Detector::kNear){
00138         //  return this->IsGoodTrackFitPassReclamation(nu);
00139         //}
00140         //else if (nu.detector==Detector::kFar){
00141         //  return nu.trkfitpass==1;
00142         //}
00143         //else {
00144         //  cout<<"Ahhhh det not known"<<endl;
00145         //  return nu.trkfitpass==1;
00146         //}
00147         return nu.trkfitpass==1;
00148       }
00149       else if (nu.charge==-1)
00150         {
00151           if (nu.detector==Detector::kNear){
00152             return this->IsGoodTrackFitPassReclamation(nu);
00153           }
00154           else if (nu.detector==Detector::kFar){
00155             return nu.trkfitpass==1;
00156           }
00157           else {
00158             cout<<"Ahhhh det not known"<<endl;
00159             return nu.trkfitpass==1;
00160           }
00161         }
00162       else
00163         {
00164           cout<<"Bad charge"<<endl;
00165           return false;
00166         }
00167     }
00168   else if (nu.anaVersion==NuCuts::kJJE2 && nu.charge==1){
00169     MAXMSG("NuCuts",Msg::kInfo,1)
00170       <<"Cutting on trk.fit.pass for +ve tracks, "
00171       << "letting IsNMBNQ deal with -ve tracks." <<endl;
00172     return nu.trkfitpass==1;
00173   }
00174   else if (nu.anaVersion==NuCuts::kCC0093Std ||
00175            nu.anaVersion==NuCuts::kCC0250Std ||
00176            nu.anaVersion==NuCuts::kCC0325Std ||
00177            nu.anaVersion==NuCuts::kCC0720Std ||
00178            nu.anaVersion==NuCuts::kCC1070Std ||
00179            nu.anaVersion==NuCuts::kCC2014 ||
00180            nu.anaVersion==NuCuts::kCC2014NewCoilCut ||
00181            nu.anaVersion==NuCuts::kCC0720Test || IsNMBNQ(nu) ||
00182            nu.anaVersion==NuCuts::kNSI2011Fhc) {
00183       if (nu.detector==Detector::kNear) {
00184         MAXMSG("NuCuts",Msg::kInfo,1)
00185           <<"Cutting on trk.fit.pass w/ trk reclamation"<<endl;
00186         return this->IsGoodTrackFitPassReclamation(nu);
00187       }
00188       else if (nu.detector==Detector::kFar) {
00189         MAXMSG("NuCuts",Msg::kInfo,1)
00190           <<"Cutting on trk.fit.pass"
00191           <<", NOT doing track reclamation for the FD"<<endl;
00192         return nu.trkfitpass==1;
00193       }
00194       else {
00195         cout<<"Ahhhh det not known"<<endl;
00196         return nu.trkfitpass==1;
00197       }
00198     }
00199   else {
00200     MAXMSG("NuCuts",Msg::kInfo,1)
00201       <<"Cutting on trk.fit.pass"<<endl;
00202     return nu.trkfitpass==1;
00203   }
00204 }

Bool_t NuCuts::IsGoodTrackFitPassReclamation ( const NuEvent nu  )  [static]

Definition at line 208 of file NuCuts.cxx.

References NuEvent::planeTrkBegu, NuEvent::planeTrkBegv, NuEvent::planeTrkEndu, NuEvent::planeTrkEndv, and NuEvent::trkfitpass.

Referenced by NuReco::CalcEvtVariables(), IsGoodTrackFitPass(), NuCutImps::CC1070Std::Preselection(), NuCutImps::RetroToFCC::Preselection(), NuCutImps::RHC0150Std::Preselection(), NuCutImps::CC0720Std::Preselection(), NuCutImps::ChairSound::Preselection(), NuCutImps::CC2014::Preselection(), NuCutImps::CC0325Std::Preselection(), NuCutImps::MSRock_Nov09::Preselection(), and NuCutImps::CC2014NewCoilCut::Preselection().

00209 {
00210   // If the track passes the fitter, it passes
00211   if (nu.trkfitpass==1) return true;
00212 
00213   // Reclaim only +ve's in RHC and only -ve's in FHC
00214   //if (nu.hornIsReverse != (nu.charge == +1)) {
00215   //  return false;
00216   //}
00217 
00218   //got these numbers from Masaki's spectrum validation talks
00219   Bool_t goodTrack= ( abs(nu.planeTrkBegu-nu.planeTrkBegv)<=5  &&
00220                       abs(nu.planeTrkEndu-nu.planeTrkEndv)<=40 &&
00221                       nu.planeTrkEndu<270 &&
00222                       nu.planeTrkEndv<270 );
00223   return goodTrack;
00224 }

Bool_t NuCuts::IsGoodTrackLength ( const NuEvent nu  )  const

Definition at line 799 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::charge, IsNMB(), Msg::kInfo, kJJE2, kNMB0325Alpha, kNMB0325Charlie, kNMB0325Delta, kRM1, MAXMSG, and NuEvent::trkLength.

Referenced by NuPlots::FillN_1Plots(), and NuCutImps::NuCutsSelection::IsGoodStdCuts().

00800 {
00801   Int_t cutValue = 0;
00802 
00803   // Only cut on NMB Selectors
00804   if (!IsNMB(nu))
00805     return true;
00806 
00807   // Don't cut on NMB negative charge events
00808   if (nu.charge == -1)
00809     return true;
00810   else if (nu.charge != 1)
00811     {
00812       cout << "Bad Charge: " << nu.charge << endl;
00813       return false;
00814     }
00815 
00816   switch (nu.anaVersion)
00817     {
00818     case NuCuts::kNMB0325Alpha:
00819     case NuCuts::kNMB0325Charlie:
00820       cutValue = 35;
00821       break;
00822     case NuCuts::kNMB0325Delta:
00823       cutValue = 37;
00824       break;
00825     case NuCuts::kRM1:
00826       cutValue = 36;
00827       break;
00828     case NuCuts::kJJE2:
00829       cutValue = 34;
00830       break;
00831     default:
00832       // Do not cut if not one of the above
00833       MAXMSG("NuCuts",Msg::kInfo,1) << "Not Cutting on trkL" << endl;
00834       return true;
00835     }
00836 
00837   // Since this function only cuts for NuMuBar selectors at the moment,
00838   // we can make a blanket acceptance for NQ events
00839   if (nu.charge == -1)
00840     return true;
00841   else if (nu.charge != 1) {
00842     cout << "Bad Charge: " << nu.charge << endl;
00843     return false;
00844   }
00845 
00846   MAXMSG("NuCuts",Msg::kInfo,1)
00847     << "Cutting on trkL>" << cutValue << endl;
00848   if (nu.trkLength <= cutValue)
00849     return false;
00850 
00851   return true;
00852 }

Bool_t NuCuts::IsGoodTrackLengthInUV ( const NuEvent nu  )  const

Definition at line 857 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::charge, IsNMB(), Msg::kInfo, kNMB0720RM, kRM2, MAXMSG, NuEvent::planeTrkBegu, NuEvent::planeTrkBegv, NuEvent::planeTrkEndu, and NuEvent::planeTrkEndv.

Referenced by NuCutImps::NuCutsSelection::IsGoodStdCuts().

00858 {
00859   Int_t cutValue = 19;
00860   Int_t DiffU=0;
00861   Int_t DiffV=0;
00862 
00863   // Only cut on NMB Selectors
00864   if (!IsNMB(nu))
00865     return true;
00866 
00867   // Don't cut on NMB negative charge events
00868   if (nu.charge == -1)
00869     return true;
00870   else if (nu.charge != 1)
00871     {
00872       cout << "Bad Charge for TrkLenghInUV cut: " << nu.charge << endl;
00873       return false;
00874     }
00875 
00876   if ( (nu.anaVersion == NuCuts::kRM2) || (nu.anaVersion == NuCuts::kNMB0720RM)) {
00877     DiffV=nu.planeTrkEndv -nu.planeTrkBegv;
00878     DiffU=nu.planeTrkEndu -nu.planeTrkBegu;
00879     MAXMSG("NuCuts",Msg::kInfo,1)
00880       << "Making Cut on UV Track length >" << cutValue << endl;
00881     if (DiffU > cutValue && DiffV > cutValue)
00882       return true;
00883     else
00884       return false;
00885   }
00886   else {
00887     //no cut
00888     MAXMSG("NuCuts",Msg::kInfo,1)
00889       <<"Not cutting on UV Track length"<<endl;
00890     return true;
00891   }
00892 }

Bool_t NuCuts::IsGoodUVVtx ( const NuEvent nu  )  const

Definition at line 2622 of file NuCuts.cxx.

References NuEvent::anaVersion, IsNMB(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, Msg::kInfo, kJJE1, kJJH1, kNSI2011Fhc, MAXMSG, and NuEvent::trkVtxUVDiffPl.

Referenced by NuAnalysis::EnergySpect(), and NuAnalysis::N_1().

02623 {
02624   Float_t cutValue=5;
02625   if (false) {
02626     MAXMSG("NuCuts",Msg::kInfo,1)
02627       <<"Cutting on UV trk vtx<="<<cutValue<<endl;
02628     if (abs(nu.trkVtxUVDiffPl)<=cutValue) return true;
02629     else return false;
02630   }
02631   else if (nu.anaVersion==NuCuts::kCC0093Std ||
02632            nu.anaVersion==NuCuts::kCC0250Std ||
02633            nu.anaVersion==NuCuts::kJJE1 ||
02634            nu.anaVersion==NuCuts::kCC0325Std ||
02635            nu.anaVersion==NuCuts::kCC0720Std ||
02636            nu.anaVersion==NuCuts::kCC1070Std ||
02637            nu.anaVersion==NuCuts::kCC2014 ||
02638            nu.anaVersion==NuCuts::kCC2014NewCoilCut ||
02639            nu.anaVersion==NuCuts::kCC0720Test ||
02640            nu.anaVersion==NuCuts::kNSI2011Fhc ||
02641            nu.anaVersion==NuCuts::kJJH1 || IsNMB(nu) ) {
02642     MAXMSG("NuCuts",Msg::kInfo,1)
02643       <<"Not cutting on UV trk vtx"<<endl;
02644     return true;
02645   }
02646   else {
02647     MAXMSG("NuCuts",Msg::kInfo,1)
02648       <<"Cutting on UV trk vtx<="<<cutValue<<endl;
02649     if (abs(nu.trkVtxUVDiffPl)<=cutValue) return true;
02650     else return false;
02651   }
02652 }

Bool_t NuCuts::IsInCylindricalVolume ( Float_t  x,
Float_t  y,
Float_t  z,
Float_t  zerox,
Float_t  zeroy,
Float_t  minZ,
Float_t  maxZ,
Float_t  maxR 
) const

Definition at line 2557 of file NuCuts.cxx.

Referenced by NuPlots::FillTrueFidEnergySpectSpecial(), IsInFidVolLoose(), IsInFidVolNDCC0093Std(), IsInFidVolNDCC0250Std(), IsInFidVolNDNuMuBar(), IsInFidVolOffset(), NuDSTAna::JeffsTestAna(), and NuDSTAna::NMBAna().

02562 {
02563   Float_t r=sqrt(pow((x-zerox),2)+pow((y-zeroy),2));
02564   if(z>minZ && z<maxZ && r<maxR) return true;
02565   else return false;
02566 }

Bool_t NuCuts::IsInFidVol ( Float_t  x,
Float_t  y,
Float_t  z,
Float_t  u,
Float_t  v,
Int_t  planeTrkVtx,
Float_t  rTrkVtx,
Int_t  detector,
Int_t  anaVersion,
Int_t  releaseType,
Int_t  simFlag 
) const

Definition at line 2069 of file NuCuts.cxx.

References choose_infid_set(), infid(), ReleaseType::IsBirch(), IsInFidVolFDCC0093Std(), IsInFidVolFDCC0250Std(), IsInFidVolLoose(), IsInFidVolNDCC0093Std(), IsInFidVolNDCC0250Std(), IsInFidVolPitt(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, Msg::kError, Detector::kFar, Msg::kFatal, kFullDST, Msg::kInfo, kJJE1, kJJE2, kJJH1, kMSRock, Detector::kNear, kNMB0325Alpha, kNMB0325Bravo, kNMB0325BravoTwo, kNMB0325Charlie, kNMB0325Delta, kNMB0325Echo, kNMBFree, kNSI2011Fhc, kRHC, kRM1, kRM2, MAXMSG, and MSG.

Referenced by NuAnalysis::ChargeSignCut(), NuAnalysis::Efficiencies(), NuAnalysis::EnergySpect(), NuAnalysis::EnergySpectMC(), IsInFidVolEvt(), IsInFidVolTrk(), IsInFidVolTrueEvt(), NuFluxHelper::IsNDFiducial(), NuAnalysis::LoopOverTruthInfo(), NuAnalysis::N_1(), and NuAnalysis::NuMuBarAppearance().

02074 {
02075 
02076   static Bool_t infid_initialised=false;
02077 
02079   //NEAR detector
02081   if (detector==Detector::kNear){
02082     if (anaVersion==NuCuts::kCC0093Std) {
02083       MAXMSG("NuCuts",Msg::kInfo,1)
02084         <<"Cutting on ND xyz point being in kCC0093Std fid vol"<<endl;
02085       return this->IsInFidVolNDCC0093Std(x,y,z);
02086     }
02087     else if (anaVersion==NuCuts::kCC0250Std) {
02088       MAXMSG("NuCuts",Msg::kInfo,1)
02089         <<"Cutting on ND xyz point being in kCC0250Std fid vol"<<endl;
02090       return this->IsInFidVolNDCC0250Std(x,y,z);
02091     }
02092     else if ( anaVersion==NuCuts::kCC0325Std ||
02093               anaVersion == NuCuts::kCC0720Std ||
02094               anaVersion == NuCuts::kCC1070Std ||
02095               anaVersion == NuCuts::kCC2014 ||
02096               anaVersion == NuCuts::kCC2014NewCoilCut ||
02097               anaVersion==NuCuts::kCC0720Test ||
02098               anaVersion==NuCuts::kNSI2011Fhc ||
02099               anaVersion==NuCuts::kJJH1 ||
02100               anaVersion==NuCuts::kJJE1 ||
02101               anaVersion==NuCuts::kJJE2 ||
02102               anaVersion == NuCuts::kNMB0325Alpha ||
02103               anaVersion == NuCuts::kNMB0325Bravo ||
02104               anaVersion == NuCuts::kNMB0325BravoTwo ||
02105               anaVersion == NuCuts::kNMB0325Charlie ||
02106               anaVersion == NuCuts::kNMB0325Delta ||
02107               anaVersion == NuCuts::kNMB0325Echo  ||
02108               anaVersion == NuCuts::kRM1  ||
02109               anaVersion == NuCuts::kRM2  ||
02110               anaVersion == NuCuts::kNMBFree ||
02111               anaVersion == NuCuts::kRHC ||
02112               anaVersion == NuCuts::kMSRock ) {
02113       static Int_t msgCounter = 0;
02114       if (msgCounter < 20){
02115         MAXMSG("NuCuts",Msg::kInfo,1)
02116           <<"Cutting on ND xyz point being in kCC0325Std fid vol"<<endl;
02117         ++msgCounter;
02118       }
02119       if (!infid_initialised) {
02120         infid_initialised=true;
02121         choose_infid_set("cc2008");
02122       }
02123       return infid(static_cast<Detector::Detector_t>(detector),
02124                    static_cast<SimFlag::SimFlag_t>(simFlag),
02125                    x,y,z);
02126     }
02127     else if (anaVersion==NuCuts::kFullDST) {
02128       MAXMSG("NuCuts",Msg::kInfo,1)
02129         <<"For kFullDST cutting on ND xyz point being in"
02130         <<" \"loose\" fid vol"<<endl;
02131       return this->IsInFidVolLoose(x,y,z,detector);
02132     }
02133     else {
02134       MAXMSG("NuCuts",Msg::kInfo,1)
02135         <<"Cutting on ND xyz point being in Pitt fid vol"<<endl;
02136       return this->IsInFidVolPitt(x,y,z,u,v);
02137     }
02138   }
02140   //FAR detector
02142   else if (detector==Detector::kFar){
02143     if (anaVersion==NuCuts::kCC0093Std) {
02144       MAXMSG("NuCuts",Msg::kInfo,1)
02145         <<"Cutting on FD xyz point being in kCC0093Std fid vol"<<endl;
02146       return this->IsInFidVolFDCC0093Std(x,y,z);
02147     }
02148     else if (anaVersion==NuCuts::kCC0250Std) {
02149       if (ReleaseType::IsBirch(releaseType)) {
02150         MSG("NuCuts",Msg::kError)
02151           <<"You can't run kCC0250Std cuts on Birch data since not all"
02152           <<" the variables are available!"<<endl;
02153         MSG("NuCuts",Msg::kFatal)<<"This doesn't print"<<endl;
02154       }
02155       MAXMSG("NuCuts",Msg::kInfo,1)
02156         <<"Cutting on FD xyz point being in kCC0250Std fid vol"<<endl;
02157       return this->IsInFidVolFDCC0250Std(planeTrkVtx,rTrkVtx);
02158     }
02159     else if (anaVersion==NuCuts::kCC0325Std ||
02160              anaVersion == NuCuts::kCC0720Std ||
02161              anaVersion == NuCuts::kCC1070Std ||
02162              anaVersion == NuCuts::kCC2014 ||
02163              anaVersion == NuCuts::kCC2014NewCoilCut ||
02164              anaVersion==NuCuts::kCC0720Test ||
02165              anaVersion==NuCuts::kNSI2011Fhc ||
02166              anaVersion==NuCuts::kJJH1 ||
02167              anaVersion==NuCuts::kJJE1 ||
02168              anaVersion==NuCuts::kJJE2 ||
02169              anaVersion == NuCuts::kNMB0325Alpha ||
02170              anaVersion == NuCuts::kNMB0325Bravo ||
02171              anaVersion == NuCuts::kNMB0325BravoTwo ||
02172              anaVersion == NuCuts::kNMB0325Charlie ||
02173              anaVersion == NuCuts::kNMB0325Delta ||
02174              anaVersion == NuCuts::kNMB0325Echo ||
02175              anaVersion == NuCuts::kRM1 ||
02176              anaVersion == NuCuts::kRM2 ||
02177              anaVersion == NuCuts::kNMBFree ||
02178              anaVersion == NuCuts::kRHC ||
02179              anaVersion == NuCuts::kMSRock) {
02180       MAXMSG("NuCuts",Msg::kInfo,1)
02181         <<"Cutting on FD xyz point being in kCC0325Std fid vol"<<endl;
02182       if (!infid_initialised) {
02183         infid_initialised=true;
02184         choose_infid_set("cc2008");
02185       }
02186       Bool_t isin = infid(static_cast<Detector::Detector_t>(detector),
02187                           static_cast<SimFlag::SimFlag_t>(simFlag),
02188                           x,y,z);
02189       // Rock muons use an anti-fiducial cut
02190       if (anaVersion == NuCuts::kMSRock) {
02191         MAXMSG("NuCuts",Msg::kInfo,1)
02192           <<"Cutting on INVERSE fiducial volume"<<endl;
02193         return !isin;
02194       }
02195       return isin;
02196     }
02197     else if (anaVersion==NuCuts::kFullDST) {
02198       MAXMSG("NuCuts",Msg::kInfo,1)
02199         <<"For kFullDST cutting on FD xyz point being in"
02200         <<" \"loose\" fid vol"<<endl;
02201       return this->IsInFidVolLoose(x,y,z,detector);
02202     }
02203     else {
02204       //use kCC0093Std here since all the variables are safely defined
02205       MAXMSG("NuCuts",Msg::kInfo,1)
02206         <<"Cutting on FD xyz point being in kCC0093Std fid vol"<<endl;
02207       return this->IsInFidVolFDCC0093Std(x,y,z);
02208     }
02209   }
02210   else {
02211     cout<<"Ahhh, detector not recognised, det="<<detector<<endl;
02212     return false;
02213   }
02214 }

Bool_t NuCuts::IsInFidVolEvt ( const NuEvent nu  )  const

only select event with an event vtx in the fiducial volume

Definition at line 2287 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::detector, IsInFidVol(), Msg::kInfo, MAXMSG, NuEvent::planeEvtVtx, NuEvent::releaseType, NuEvent::rEvtVtx, NuEvent::simFlag, NuEvent::uEvtVtx, NuEvent::vEvtVtx, NuEvent::xEvtVtx, NuEvent::yEvtVtx, and NuEvent::zEvtVtx.

Referenced by NuCutImps::NuCutsSelection::InFidVolEvt().

02288 {
02291 
02292   //by default use the evt vtx as is
02293   Float_t z=nu.zEvtVtx;
02294 
02295   // TODO CJB I don't think we need to move the vertex, but I'm not sure
02296   /*
02297   //move trk vtx upstream by 3.92cm from scintillator to steel
02298   //for these analysis versions
02299   if (nu.anaVersion==NuCuts::kCC0325Std ||
02300   nu.anaVersion==NuCuts::kCC0720Std ||
02301   nu.anaVersion==NuCuts::kJJH1 ||
02302   nu.anaVersion==NuCuts::kJJE1 ||
02303   IsNMB(nu) ) {
02304   z=nu.zTrkVtx-(0.0392*Munits::m);
02305   }
02306   */
02307 
02308   MAXMSG("NuCuts",Msg::kInfo,1)
02309     <<"Cutting on IsInFidVolTrk()"<<endl;
02310   return this->IsInFidVol(nu.xEvtVtx,nu.yEvtVtx,
02311                           z,
02312                           nu.uEvtVtx,nu.vEvtVtx,
02313                           nu.planeEvtVtx,nu.rEvtVtx,
02314                           nu.detector,nu.anaVersion,
02315                           nu.releaseType,nu.simFlag);
02316 }

Bool_t NuCuts::IsInFidVolFDCC0093Std ( Float_t  x,
Float_t  y,
Float_t  z 
) const

Definition at line 2415 of file NuCuts.cxx.

Referenced by IsInFidVol().

02417 {
02418   //got these numbers from Masaki's spectrum validation talks
02419   //there is no coil cut!
02420   //fiducial criteria on vtx for far detector
02421   if(((z>0.50 && z<14.3) || (z>16.2 && z<28.0)) &&
02422      ((x*x)+(y*y))<14.0) return true;
02423   else return false;
02424 }

Bool_t NuCuts::IsInFidVolFDCC0250Std ( Int_t  planeTrkVtx,
Float_t  rTrkVtx 
) const

Definition at line 2428 of file NuCuts.cxx.

References Munits::m.

Referenced by IsInFidVol().

02430 {
02431   //fiducial criteria on vtx for far detector
02432   //these are Andy Blake's cuts in DocDB 2728
02433   //but without the coil cut
02434 
02435   //if (drTrkFidvtx>(0.2*Munits::m) &&
02436   //    rTrkVtx>(0.4*Munits::m) &&
02437   //    ((planeTrkVtx>4 && planeTrkVtx<241) ||
02438   //     (planeTrkVtx>253 && planeTrkVtx<466))) return true;
02439 
02440   //minos-doc-3156
02441   if (rTrkVtx<sqrt(14.)*Munits::m &&
02442       ((planeTrkVtx>4 && planeTrkVtx<241) ||
02443        (planeTrkVtx>253 && planeTrkVtx<466))) return true;
02444   else return false;
02445 }

Bool_t NuCuts::IsInFidVolFDNuMuBar ( Int_t  planeTrkVtx,
Float_t  rTrkVtx 
) const

Definition at line 2398 of file NuCuts.cxx.

References Munits::m.

02400 {
02401   //fiducial criteria on vtx for far detector
02402   //these are the CC-analysis 2.5e20 cuts
02403   //plus a coil hole cut based on John Marshall's talk DocDB 3644
02404 
02405   //minos-doc-3156
02406   if (rTrkVtx>(0.4*Munits::m) &&
02407       rTrkVtx<sqrt(14.)*Munits::m &&
02408       ((planeTrkVtx>4 && planeTrkVtx<241) ||
02409        (planeTrkVtx>253 && planeTrkVtx<466))) return true;
02410   else return false;
02411 }

Bool_t NuCuts::IsInFidVolLoose ( const NuEvent nu  )  const

loose preselection cut that writes out events in a large fiducial volume - far larger than should be used but if your analysis uses a large volume then double check this is actually big enough

Definition at line 2487 of file NuCuts.cxx.

References NuLibrary::cuts, NuEvent::detector, NuLibrary::Instance(), IsInFidVolLoose(), NuEvent::xEvtVtx, NuEvent::yEvtVtx, and NuEvent::zEvtVtx.

02488 {
02493 
02494   //get an instance of the code library
02495   const NuLibrary& lib = NuLibrary::Instance();
02496 
02497   // check all tracks, since different anaVersions use different ones
02498   for(int trkIdx = 1; trkIdx <= 3; ++trkIdx){
02499     if(get_trkExists(nu, trkIdx) &&
02500        lib.cuts.IsInFidVolLoose(get_xTrkVtx(nu, trkIdx),
02501                                 get_yTrkVtx(nu, trkIdx),
02502                                 get_zTrkVtx(nu, trkIdx),
02503                                 nu.detector)) return true;
02504   }
02505 
02506   // check all showers
02507   // TODO - shouldn't this be 5? Old code had 3.
02508   for(int shwIdx = 1; shwIdx <= 3; ++shwIdx){
02509     if(get_shwExists(nu, shwIdx) &&
02510        lib.cuts.IsInFidVolLoose(get_xShwVtx(nu, shwIdx),
02511                                 get_yShwVtx(nu, shwIdx),
02512                                 get_zShwVtx(nu, shwIdx),
02513                                 nu.detector)) return true;
02514   }
02515 
02516   if(lib.cuts.IsInFidVolLoose(nu.xEvtVtx,
02517                               nu.yEvtVtx,
02518                               nu.zEvtVtx,
02519                               nu.detector)) return true;
02520 
02521   //cut out events that don't have either trk or shw or evt
02522   //in loose fid vol
02523   return false;
02524 }

Bool_t NuCuts::IsInFidVolLoose ( Float_t  x,
Float_t  y,
Float_t  z,
Int_t  detector 
) const

loose preselection cut that writes out events in a large fiducial volume - far larger than should be used but if your analysis uses a large volume then double check this is actually big enough

Definition at line 2528 of file NuCuts.cxx.

References IsInCylindricalVolume(), Detector::kFar, and Munits::m.

Referenced by NuAnalysis::ChargeSeparationOneSnarl(), IsInFidVol(), IsInFidVolLoose(), NuAnalysis::LoopOverTruthInfo(), and NuAnalysis::MakeFullDST().

02530 {
02535 
02536   //return true for all FD events since almost all are in FV anyway
02537   if (detector==Detector::kFar) return true;
02538 
02539   //use the 0093CC analysis beam centre since it is more central
02540   //than the 0250CC analysis
02541   const Float_t beamzerox=1.4828*(Munits::m);
02542   const Float_t beamzeroy=0.1397*(Munits::m);
02543   const Float_t minZ=0.5*(Munits::m);
02544   const Float_t maxZ=5.1*(Munits::m);
02545   const Float_t maxR=1.4*(Munits::m);//allows 1m for zero-y & bc=0.23
02546 
02547   //check if in volume
02548   Bool_t passFid=this->IsInCylindricalVolume
02549     (x,y,z,beamzerox,beamzeroy,minZ,maxZ,maxR);
02550 
02551   //return selection
02552   return passFid;
02553 }

Bool_t NuCuts::IsInFidVolNDCC0093Std ( Float_t  x,
Float_t  y,
Float_t  z 
) const

Definition at line 2360 of file NuCuts.cxx.

References IsInCylindricalVolume(), and Munits::m.

Referenced by IsInFidVol().

02362 {
02363   //got these numbers from Masaki's spectrum validation talks
02364   //fiducial criteria on vtx for near detector
02365   const Float_t beamzerox=1.4885*(Munits::m);
02366   const Float_t beamzeroy=0.1397*(Munits::m);
02367   //Float_t beamzeroy = 0.1397-reco_vtxz*TMath::Tan(.058);
02368 
02369   //define this volume
02370   Float_t minZ=1.0*(Munits::m);
02371   Float_t maxZ=5.0*(Munits::m);
02372   Float_t maxR=1.0*(Munits::m);
02373 
02374   return this->IsInCylindricalVolume(x,y,z,beamzerox,beamzeroy,
02375                                      minZ,maxZ,maxR);
02376 }

Bool_t NuCuts::IsInFidVolNDCC0250Std ( Float_t  x,
Float_t  y,
Float_t  z 
) const

Definition at line 2380 of file NuCuts.cxx.

References IsInCylindricalVolume(), and Munits::m.

Referenced by IsInFidVol().

02382 {
02383   //fiducial criteria on vtx for near detector
02384   const Float_t beamzerox=1.4828*(Munits::m);//new for 2.5 analysis
02385   const Float_t beamzeroy=0.2384*(Munits::m);//new for 2.5 analysis
02386 
02387   //define this volume
02388   Float_t minZ=1.0*(Munits::m);
02389   Float_t maxZ=5.0*(Munits::m);
02390   Float_t maxR=1.0*(Munits::m);
02391 
02392   return this->IsInCylindricalVolume(x,y,z,beamzerox,beamzeroy,
02393                                      minZ,maxZ,maxR);
02394 }

Bool_t NuCuts::IsInFidVolNDNuMuBar ( Float_t  x,
Float_t  y,
Float_t  z 
) const

Definition at line 2342 of file NuCuts.cxx.

References IsInCylindricalVolume(), and Munits::m.

02344 {
02345   //fiducial criteria on vtx for near detector
02346   const Float_t beamzerox=1.4828*(Munits::m);//new for 2.5 analysis
02347   const Float_t beamzeroy=0.2384*(Munits::m);//new for 2.5 analysis
02348 
02349   //define this volume
02350   Float_t minZ=0.6*(Munits::m);
02351   Float_t maxZ=4.0*(Munits::m);
02352   Float_t maxR=0.8*(Munits::m);
02353 
02354   return this->IsInCylindricalVolume(x,y,z,beamzerox,beamzeroy,
02355                                      minZ,maxZ,maxR);
02356 }

Bool_t NuCuts::IsInFidVolOffset ( Float_t  x,
Float_t  y,
Float_t  z 
) const

Definition at line 2320 of file NuCuts.cxx.

References IsInCylindricalVolume(), and Munits::m.

02321 {
02322   const Float_t zerox=0.9*(Munits::m);
02323   const Float_t zeroy=0.0*(Munits::m);
02324   const Float_t minZ=1.0*(Munits::m);
02325   const Float_t maxZ=4.0*(Munits::m);
02326   const Float_t maxR=0.6*(Munits::m);
02327   Bool_t passFid=this->IsInCylindricalVolume(x,y,z,zerox,zeroy,
02328                                              minZ,maxZ,maxR);
02329   passFid=passFid && x>=0.7;
02330   return passFid;
02331 }

Bool_t NuCuts::IsInFidVolOffset ( const NuEvent nu  )  const

Definition at line 2335 of file NuCuts.cxx.

References NuEvent::xTrkVtx, NuEvent::yTrkVtx, and NuEvent::zTrkVtx.

Referenced by NuPlots::FillTrueFidEnergySpectSpecial().

02336 {
02337   return this->IsInFidVolOffset(nu.xTrkVtx,nu.yTrkVtx,nu.zTrkVtx);
02338 }

Bool_t NuCuts::IsInFidVolPitt ( Float_t  x,
Float_t  y,
Float_t  z,
Float_t  u,
Float_t  v 
) const

Definition at line 2470 of file NuCuts.cxx.

Referenced by IsInFidVol().

02472 {
02473   // Is the event vertex, (x,y,u,v,z) inside the fiducial volume
02474   // used by the pittsburgh group?
02475   // code from Mike
02476   if( !( z>0.6 && z<3.56) ) return kFALSE;
02477   if( !( u>0.3 && u<1.8) ) return kFALSE;
02478   if( !( v>-1.8 && v< -0.3) ) return kFALSE;
02479   if( x>=2.4) return kFALSE;
02480   const Float_t coil_cut=0.8*0.8;
02481   if( (x*x + y*y) <= coil_cut) return kFALSE;
02482   return kTRUE;
02483 }

Bool_t NuCuts::IsInFidVolTrk ( const NuEvent nu  )  const

only select event with a track vtx in the fiducial volume

Definition at line 2252 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::detector, IsInFidVol(), IsNMB(), kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, Msg::kInfo, kJJE1, kJJH1, kNSI2011Fhc, Munits::m, MAXMSG, NuEvent::planeTrkVtx, NuEvent::releaseType, NuEvent::rTrkVtx, NuEvent::simFlag, NuEvent::uTrkVtx, NuEvent::vTrkVtx, NuEvent::xTrkVtx, NuEvent::yTrkVtx, and NuEvent::zTrkVtx.

Referenced by NuDemoModule::Ana(), NuAnalysis::ChargeSeparationOneSnarl(), NuCutImps::NuCutsSelection::InFidVol(), NuCutImps::NuCutsSelection::IsGoodPreSelectionCuts(), NuAnalysis::LIRejectionTest(), NuDSTAna::NMBAna(), NuFluctuator::SelectedAs(), and NuDSTAna::VsTime().

02253 {
02256 
02257   //by default use the trk vtx as is
02258   Float_t z=nu.zTrkVtx;
02259 
02260   //move trk vtx upstream by 3.92cm from scintillator to steel
02261   //for these analysis versions
02262   if (nu.anaVersion==NuCuts::kCC0325Std ||
02263       nu.anaVersion==NuCuts::kCC0720Std ||
02264       nu.anaVersion==NuCuts::kCC1070Std ||
02265       nu.anaVersion==NuCuts::kCC2014 ||
02266       nu.anaVersion==NuCuts::kCC2014NewCoilCut ||
02267       nu.anaVersion==NuCuts::kCC0720Test ||
02268       nu.anaVersion==NuCuts::kNSI2011Fhc ||
02269       nu.anaVersion==NuCuts::kJJH1 ||
02270       nu.anaVersion==NuCuts::kJJE1 ||
02271       IsNMB(nu) ) {
02272     z=nu.zTrkVtx-(0.0392*Munits::m);
02273   }
02274 
02275   MAXMSG("NuCuts",Msg::kInfo,1)
02276     <<"Cutting on IsInFidVolTrk()"<<endl;
02277   return this->IsInFidVol(nu.xTrkVtx,nu.yTrkVtx,
02278                           z,
02279                           nu.uTrkVtx,nu.vTrkVtx,
02280                           nu.planeTrkVtx,nu.rTrkVtx,
02281                           nu.detector,nu.anaVersion,
02282                           nu.releaseType,nu.simFlag);
02283 }

Bool_t NuCuts::IsInFidVolTrueEvt ( const NuEvent nu  )  const

only select event with a true vtx in the fiducial volume NOTE: no need to shift z-vtx for truth

Definition at line 2233 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::detector, IsInFidVol(), Msg::kError, Msg::kFatal, SimFlag::kMC, MSG, NuEvent::planeTrkVtxMC, NuEvent::releaseType, NuEvent::rTrkVtxMC, NuEvent::simFlag, NuEvent::vtxuMC, NuEvent::vtxvMC, NuEvent::vtxxMC, NuEvent::vtxyMC, and NuEvent::vtxzMC.

02234 {
02238   //MAXMSG("NuCuts",Msg::kInfo,1) <<"Cutting on IsInFidVolTrueEvt()"<<endl;
02239   if (nu.simFlag != SimFlag::kMC) {
02240     MSG("NuCuts",Msg::kError) << "Cannot do true cut on data" << endl;
02241     MSG("NuCuts",Msg::kFatal) << "Cannot do true cut on data" << endl;
02242   }
02243   // Not sure if this needs to handle rock muons - but apply anyway
02244   return this->IsInFidVol
02245     (nu.vtxxMC,nu.vtxyMC,nu.vtxzMC,nu.vtxuMC, nu.vtxvMC,
02246      nu.planeTrkVtxMC,nu.rTrkVtxMC,
02247      nu.detector,nu.anaVersion,nu.releaseType,nu.simFlag);
02248 }

Bool_t NuCuts::IsInFidVolTrueEvt ( const NuMCEvent mc  )  const
Bool_t NuCuts::IsLI ( const NuEvent nu  )  const

Definition at line 1138 of file NuCuts.cxx.

References NuEvent::anaVersion, NuEvent::detector, NuEvent::isLI, IsNMB(), kCC0093Std, kCC0250Std, kCC0325Std, kCC0720Std, kCC0720Test, kCC1070Std, kCC2014, kCC2014NewCoilCut, Msg::kInfo, kJJE1, kJJH1, Detector::kNear, kNSI2011Fhc, NuEvent::litag, NuEvent::litime, and MAXMSG.

Referenced by NuDemoModule::Ana(), NuAnalysis::ChargeSeparationOneSnarl(), NuCutImps::NuCutsSelection::IsGoodPreSelectionCuts(), NuFluctuator::SelectedAs(), and NuDSTAna::VsTime().

01139 {
01140   //for the ND just cut on litime
01141   if (nu.detector==Detector::kNear) {
01142     MAXMSG("NuCuts",Msg::kInfo,1)
01143       <<"Cutting on ND LI events using litime!=-1"<<endl;
01144     return (nu.litime!=-1);
01145   }
01146 
01147   //for the FD cut depending on the analysis version
01148   if (nu.anaVersion==NuCuts::kJJH1 ||
01149       nu.anaVersion==NuCuts::kJJE1 ||
01150       nu.anaVersion==NuCuts::kCC0325Std ||
01151       nu.anaVersion==NuCuts::kCC0720Std ||
01152       nu.anaVersion==NuCuts::kCC1070Std ||
01153       nu.anaVersion==NuCuts::kCC2014 ||
01154       nu.anaVersion==NuCuts::kCC2014NewCoilCut ||
01155       nu.anaVersion==NuCuts::kCC0720Test ||
01156       nu.anaVersion==NuCuts::kNSI2011Fhc ||
01157       IsNMB(nu)) {
01158     //cut on LI
01159     MAXMSG("NuCuts",Msg::kInfo,1)
01160       <<"Cutting on LI events using LISieve and litime!=-1"<<endl;
01161     return (nu.isLI || nu.litime!=-1);
01162   }
01163   else if (nu.anaVersion==NuCuts::kCC0093Std ||
01164            nu.anaVersion==NuCuts::kCC0250Std) {
01165     MAXMSG("NuCuts",Msg::kInfo,1)
01166       <<"Cutting on LI events using FDRCBoundary and litime!=-1"<<endl;
01167     return (nu.litag>0 || nu.litime!=-1);
01168   }
01169   else {
01170     MAXMSG("NuCuts",Msg::kInfo,1)
01171       <<"Cutting on LI events using LISieve and litime!=-1"<<endl;
01172     return (nu.isLI || nu.litime!=-1);
01173   }
01174 }

Bool_t NuCuts::IsNMB ( const NuEvent nu  )  [static]
Bool_t NuCuts::IsNMBNQ ( const NuEvent nu  )  [static]

Definition at line 56 of file NuCuts.cxx.

References NuEvent::charge, and IsNMB().

Referenced by IsGoodAbID(), IsGoodDpID(), IsGoodFitProb(), IsGoodMajorityCurvature(), IsGoodPID(), IsGoodRoID(), IsGoodSigmaQP_QP(), and IsGoodTrackFitPass().

00056                                         {
00057   return IsNMB(nu) && (nu.charge == -1);
00058 }

Bool_t NuCuts::IsNMBPQ ( const NuEvent nu  )  [static]

Definition at line 50 of file NuCuts.cxx.

References NuEvent::charge, and IsNMB().

Referenced by IsGoodDpID(), IsGoodFitProb(), IsGoodMajorityCurvature(), IsGoodPID(), IsGoodRoID(), IsGoodSigmaQP_QP(), and IsGoodTrackFitPass().

00050                                         {
00051   return IsNMB(nu) && (nu.charge == 1);
00052 }


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1