NCAnalysisCuts Class Reference

Base class for the various cuts suites. More...

#include <NCAnalysisCuts.h>

Inheritance diagram for NCAnalysisCuts:
NCAnalysisCutsCC NCAnalysisCutsNC NCAnalysisCutsNCCCFid NCAnalysisCutsNCCCFid

List of all members.

Public Member Functions

 NCAnalysisCuts ()
virtual ~NCAnalysisCuts ()
virtual bool IsGoodBeamEvent ()=0
virtual bool IsStoppingBeamMuon ()=0
virtual bool InBeamFiducialVolume ()=0
virtual bool PassesFinalSelection ()=0
virtual bool PassesFinalSelection (ANtpRecoInfo *recoInfo)=0
bool IsGoodSpill ()
bool IsGoodBeamSnarl ()
bool IsGoodTarget ()
bool IsCleanLowMultSnarl ()
bool IsMultiCutsClean ()
bool IsSimpleCutsClean ()
bool IsNewSnarl ()
bool IsGoodShower ()
void SetInfoObjects (ANtpHeaderInfo *, ANtpBeamInfo *, ANtpEventInfoNC *, ANtpTrackInfoNC *, ANtpShowerInfoNC *, ANtpTruthInfoBeam *=0)
void SetBeamType (BeamType::BeamType_t type)
void SetUseAllBeams (bool useAll)
void SetUseAllL010z (bool useAll)
void SetUseAll185i (bool useAll)

Protected Member Functions

Int_t GetReleaseType ()

Protected Attributes

BeamType::BeamType_t fBeamType
int fCurrentRun
int fCurrentSnarl
int fCurrentSubRun
bool fUseAllBeams
bool fUseAll185i
bool fUseAllL010z
NCEventInfo fEventInfo

Detailed Description

Base class for the various cuts suites.

Definition at line 25 of file NCAnalysisCuts.h.


Constructor & Destructor Documentation

NCAnalysisCuts::NCAnalysisCuts (  ) 

Definition at line 41 of file NCAnalysisCuts.cxx.

00041                                :
00042   fBeamType(BeamType::kUnknown),
00043   fCurrentRun(-1),
00044   fCurrentSnarl(-1),
00045   fCurrentSubRun(-1)
00046 {
00047 }

NCAnalysisCuts::~NCAnalysisCuts (  )  [virtual]

Definition at line 50 of file NCAnalysisCuts.cxx.

00051 {
00052 }


Member Function Documentation

Int_t NCAnalysisCuts::GetReleaseType (  )  [protected]

Definition at line 375 of file NCAnalysisCuts.cxx.

References fEventInfo, NCEventInfo::header, ANtpHeaderInfo::softVersion, and ReleaseType::StringToType().

Referenced by NCAnalysisCutsNC::IsFibreNoiseInSpillOx(), NCAnalysisCutsNC::IsGoodBeamEvent(), and NCAnalysisCutsNC::IsLIInSpillOx().

00376 {
00377   // Get the ReleaseType from the string.
00378 
00379   //const char* asCharArray= (const char*)fEventInfo.header->softVersion;
00380   ReleaseType::Release_t softType =
00381     ReleaseType::StringToType(fEventInfo.header->softVersion);
00382 
00383   assert(softType != -1);
00384 
00385   return softType;
00386 }

virtual bool NCAnalysisCuts::InBeamFiducialVolume (  )  [pure virtual]
bool NCAnalysisCuts::IsCleanLowMultSnarl (  ) 

Definition at line 192 of file NCAnalysisCuts.cxx.

References NCEventInfo::event, ANtpHeaderInfo::events, fEventInfo, NCEventInfo::header, and ANtpEventInfoNC::minTimeSeparation.

Referenced by MicroDSTMaker::FillRecoInfo().

00193 {
00194   return fEventInfo.header->events == 1 ||
00195     (fEventInfo.header->events == 2 &&
00196      TMath::Abs(fEventInfo.event->minTimeSeparation*1e6) > 0.2);
00197 }

virtual bool NCAnalysisCuts::IsGoodBeamEvent (  )  [pure virtual]
bool NCAnalysisCuts::IsGoodBeamSnarl (  ) 

Definition at line 263 of file NCAnalysisCuts.cxx.

References ANtpHeaderInfo::coilCurrent, ANtpHeaderInfo::coilStatus, ANtpHeaderInfo::dataType, ANtpHeaderInfo::detector, fEventInfo, NCEventInfo::header, ANtpHeaderInfo::isGoodData, IsGoodSpill(), Detector::kFar, SimFlag::kMC, and Detector::kNear.

Referenced by MicroDSTMaker::ExtractNCCC().

00264 {
00265   //MC snarls are always good
00266   if(fEventInfo.header->dataType == int(SimFlag::kMC)) return true;
00267 
00268 
00269   // check that there were no problems with the detector
00270   // Don't take reversed field data for uDSTs
00271   if(fEventInfo.header->coilStatus < 1 ||
00272      (fEventInfo.header->detector == int(Detector::kFar) &&
00273       fEventInfo.header->isGoodData < 1))
00274     return false;
00275 
00276   //the cuts in this method come from MINOS-doc-1342
00277   if(!IsGoodSpill()) return false;
00278 
00279   if(fEventInfo.header->detector == int(Detector::kNear) &&
00280      (fEventInfo.header->coilCurrent > -1000 ||
00281       fEventInfo.header->isGoodData < 1))
00282     return false;
00283 
00284   return true;
00285 }

bool NCAnalysisCuts::IsGoodShower (  ) 

Definition at line 291 of file NCAnalysisCuts.cxx.

References ANtpTrackInfoNC::aTrkvtx_ns, EnergyCorrections::CorrectShowerEnergy(), ANtpHeaderInfo::dataType, det, ANtpHeaderInfo::detector, NCEventInfo::event, fEventInfo, NCEventInfo::header, EnergyCorrections::kBirch, CandShowerHandle::kCC, EnergyCorrections::kCedar, ANtpDefaultValue::kDouble, Detector::kFar, SimFlag::kMC, Detector::kNear, ANtpShowerInfo::linearCCGeV, EnergyCorrections::SetCorrectionVersion(), NCEventInfo::shower, ANtpHeaderInfo::softVersion, NCEventInfo::track, ANtpEventInfo::tracks, and ANtpShowerInfo::vtxZ.

Referenced by MicroDSTMaker::FillRecoInfo().

00292 {
00293   //set the version for the energy corrections.  mike uses R1_18 and cedar, the
00294   //values in ANtpHeaderInfo are Birch(Cedar) Data(Carrot/Daikon/Etc)
00295   if( fEventInfo.header->softVersion.Contains("Cedar") ){
00296     const EnergyCorrections::CorrectionVersion_t ver = EnergyCorrections::kCedar;
00297     SetCorrectionVersion(ver);
00298   }
00299   else if( fEventInfo.header->softVersion.Contains("Birch") ){
00300     const EnergyCorrections::CorrectionVersion_t ver = EnergyCorrections::kBirch;
00301     SetCorrectionVersion(ver);
00302   }
00303 
00304 
00305   bool isdata = true;
00306   if(fEventInfo.header->dataType == (int)SimFlag::kMC) isdata = false;
00307 
00308   Detector::Detector_t det = Detector::kNear;
00309   if(fEventInfo.header->detector == (int)Detector::kFar)
00310     det = Detector::kFar;
00311 
00312   double showerEnergy;
00313   //Protect against events without showers.
00314   if(fEventInfo.shower->linearCCGeV > 0.){
00315       showerEnergy = CorrectShowerEnergy(fEventInfo.shower->linearCCGeV,
00316                                          det,
00317                                          CandShowerHandle::kCC,
00318                                          1, isdata);
00319   }
00320   else showerEnergy = ANtpDefaultValue::kDouble;
00321 
00322   if(fEventInfo.event->tracks < 1
00323      || TMath::Abs(fEventInfo.shower->vtxZ - fEventInfo.track->aTrkvtx_ns) < 0.5
00324      ||  showerEnergy > 2. )
00325     return true;
00326 
00327   return false;
00328 }

bool NCAnalysisCuts::IsGoodSpill (  ) 

Definition at line 240 of file NCAnalysisCuts.cxx.

References NCEventInfo::beam, ANtpHeaderInfo::dataType, ANtpBeamInfo::deltaSecToSpillGPS, ANtpHeaderInfo::detector, fEventInfo, ANtpBeamInfo::goodSpill, ANtpBeamInfo::gpsError, NCEventInfo::header, IsGoodTarget(), Detector::kFar, SimFlag::kMC, and ANtpHeaderInfo::spillType.

Referenced by IsGoodBeamSnarl().

00241 {
00242   //mc beam is always perfect and only using the
00243   //correct mc files with each beamType, so no need to
00244   //check the target
00245   if(fEventInfo.header->dataType == int(SimFlag::kMC)) return true;
00246 
00247   if(!IsGoodTarget()) return false;
00248 
00249   //check the beam quality cuts, the spill type and
00250   //error on the gps - error has to be big within 5 minutes of the
00251   //spill - only check the gps for far detector
00252   if(fEventInfo.beam->goodSpill < 1 ||
00253      (fEventInfo.header->detector == int(Detector::kFar) &&
00254       fEventInfo.beam->deltaSecToSpillGPS < 360 &&
00255       fEventInfo.beam->gpsError > 1000) ||
00256      fEventInfo.header->spillType == 3)
00257     return false;
00258 
00259   return true;
00260 }

bool NCAnalysisCuts::IsGoodTarget (  ) 

Definition at line 58 of file NCAnalysisCuts.cxx.

References bfld::AsString(), NCEventInfo::beam, ANtpBeamInfo::beamType, fBeamType, fEventInfo, fUseAll185i, fUseAllBeams, fUseAllL010z, Msg::kDebug, BeamType::kL010z000i, BeamType::kL010z170i, BeamType::kL010z185i, BeamType::kL010z185i_lowintensity, BeamType::kL010z200i, BeamType::kL100z200i, BeamType::kL250z200i, and MAXMSG.

Referenced by IsGoodSpill().

00059 {
00060   bool goodTarget = false;
00061 
00062   BeamType::BeamType_t bt = (BeamType::BeamType_t)(fEventInfo.beam->beamType);
00063 
00064   bool is185i = (bt == BeamType::kL010z185i
00065                  || bt == BeamType::kL010z185i_lowintensity);
00066   bool isL010z = (bt == BeamType::kL010z185i
00067                   || bt == BeamType::kL010z185i_lowintensity
00068                   || bt == BeamType::kL010z000i
00069                   || bt == BeamType::kL010z170i
00070                   || bt == BeamType::kL010z200i);
00071 
00072   //take any thing if the target position is set to all
00073   //beams or pME or pHE
00074   if(fUseAllBeams)
00075     goodTarget = true;
00076   else if(fBeamType == BeamType::kL100z200i && bt == fBeamType)
00077     goodTarget = true;
00078   else if(fBeamType == BeamType::kL250z200i && bt == fBeamType)
00079     goodTarget = true;
00080   else if(fBeamType == BeamType::kL010z185i
00081           && !fUseAll185i && !fUseAllL010z && bt == fBeamType)
00082     goodTarget = true;
00083   else if(fBeamType == BeamType::kL010z170i
00084           && !fUseAllL010z && bt == fBeamType)
00085     goodTarget = true;
00086   else if(fBeamType == BeamType::kL010z200i
00087           && !fUseAllL010z && bt == fBeamType)
00088     goodTarget = true;
00089   else if(fBeamType == BeamType::kL010z185i_lowintensity
00090           && !fUseAll185i && !fUseAllL010z && bt == fBeamType)
00091     goodTarget = true;
00092   else if(fBeamType == BeamType::kL010z000i
00093           && !fUseAllL010z && bt == fBeamType)
00094     goodTarget = true;
00095   else if(fUseAllL010z && isL010z)
00096     goodTarget = true;
00097   else if(fUseAll185i && is185i)
00098     goodTarget = true;
00099 
00100 
00101   MAXMSG("NCAnalysisCuts", Msg::kDebug, 10) << fEventInfo.beam->beamType << " "
00102                                            << BeamType::AsString(bt) << " "
00103                                            << goodTarget << " "
00104                                            << (int)fUseAllBeams << " "
00105                                            << is185i << " " << isL010z << endl;
00106 
00107 
00108   return goodTarget;
00109 }

bool NCAnalysisCuts::IsMultiCutsClean (  ) 

Definition at line 143 of file NCAnalysisCuts.cxx.

References ANtpEventInfoNC::closeTimeDeltaZ, MuELoss::e, ANtpEventInfoNC::edgeActivityPH, ANtpEventInfoNC::edgeActivityStrips, ANtpEventInfo::energyGeV, NCEventInfo::event, fEventInfo, ANtpEventInfoNC::minTimeSeparation, ANtpEventInfoNC::oppEdgeStrips, ANtpShowerInfo::planes, ANtpTrackInfo::planes, ANtpEventInfo::planes, NCEventInfo::shower, SQR, ANtpEventInfo::totalStrips, and NCEventInfo::track.

Referenced by MicroDSTMaker::FillRecoInfo().

00144 {
00145   // 40ns timing cut
00146   if(TMath::Abs(fEventInfo.event->minTimeSeparation) < 40e-9) return false;
00147 
00148   // tiny events are mostly junk
00149   if(fEventInfo.event->totalStrips < 5) return false;
00150 
00151   // this cuts very steep showers, leaking in
00152   if(float(fEventInfo.event->totalStrips)/SQR(fEventInfo.event->planes)>1.3)
00153     return false;
00154 
00155   // this cuts leakage which leaves activity in partially instrumented
00156   // region
00157   if(fEventInfo.event->edgeActivityStrips > 2 &&
00158      fEventInfo.event->edgeActivityPH > 1000 &&
00159      fEventInfo.event->energyGeV < 5.0 &&
00160      fEventInfo.shower->planes > fEventInfo.track->planes) // don't cut out CC
00161     return false;
00162 
00163   // also cut out events with too much activity in the opposite edge region
00164   if(fEventInfo.event->oppEdgeStrips > 2 &&
00165      fEventInfo.event->energyGeV < 5.0 &&
00166      fEventInfo.shower->planes > fEventInfo.track->planes) // don't cut out CC
00167     return false;
00168 
00169   // make additional deltaZ cuts if (|minDeltaT|<175ns)
00170   if(TMath::Abs(fEventInfo.event->closeTimeDeltaZ) < 1.0 &&
00171      TMath::Abs(fEventInfo.event->minTimeSeparation) < 150e-9)
00172     return false;
00173 
00174   // Survived all cuts
00175   return true;
00176 }

bool NCAnalysisCuts::IsNewSnarl (  ) 

Definition at line 112 of file NCAnalysisCuts.cxx.

References fCurrentRun, fCurrentSnarl, fCurrentSubRun, fEventInfo, NCEventInfo::header, ANtpHeaderInfo::run, ANtpHeaderInfo::snarl, and ANtpHeaderInfo::subRun.

Referenced by MicroDSTMaker::ExtractNCCC().

00113 {
00114   bool newSnarl = false;
00115 
00116   if(fEventInfo.header->run != fCurrentRun){
00117     newSnarl       = true;
00118     fCurrentRun    = fEventInfo.header->run;
00119     fCurrentSubRun = fEventInfo.header->subRun;
00120     fCurrentSnarl  = fEventInfo.header->snarl;
00121   }
00122   else if(fEventInfo.header->run == fCurrentRun &&
00123           fEventInfo.header->subRun != fCurrentSubRun){
00124     newSnarl = true;
00125     fCurrentRun = fEventInfo.header->run;
00126     fCurrentSubRun = fEventInfo.header->subRun;
00127     fCurrentSnarl = fEventInfo.header->snarl;
00128   }
00129   else if(fEventInfo.header->run == fCurrentRun &&
00130           fEventInfo.header->subRun == fCurrentSubRun &&
00131           fEventInfo.header->snarl != fCurrentSnarl){
00132     newSnarl = true;
00133     fCurrentRun = fEventInfo.header->run;
00134     fCurrentSubRun = fEventInfo.header->subRun;
00135     fCurrentSnarl = fEventInfo.header->snarl;
00136   }
00137 
00138   return newSnarl;
00139 }

bool NCAnalysisCuts::IsSimpleCutsClean (  ) 

Definition at line 179 of file NCAnalysisCuts.cxx.

References NCEventInfo::event, fEventInfo, ANtpEventInfoNC::maxConsecutivePlanes, and ANtpEventInfoNC::slicePHFraction.

Referenced by MicroDSTMaker::FillRecoInfo().

00180 {
00181   //cut on portion of the slice in the event                              
00182   if(fEventInfo.event->slicePHFraction<0.5)  return false;
00183  
00184   //cut maximum consecutive planes
00185   if(fEventInfo.event->maxConsecutivePlanes<2.99)  return false;
00186 
00187   // Survived all cuts                                                    
00188   return true;
00189 }

virtual bool NCAnalysisCuts::IsStoppingBeamMuon (  )  [pure virtual]
virtual bool NCAnalysisCuts::PassesFinalSelection ( ANtpRecoInfo recoInfo  )  [pure virtual]
virtual bool NCAnalysisCuts::PassesFinalSelection (  )  [pure virtual]
void NCAnalysisCuts::SetBeamType ( BeamType::BeamType_t  type  ) 

Definition at line 216 of file NCAnalysisCuts.cxx.

References fBeamType.

Referenced by MicroDSTMaker::MakeuDST().

00217 {
00218   fBeamType = type;
00219 }

void NCAnalysisCuts::SetInfoObjects ( ANtpHeaderInfo headerInfo,
ANtpBeamInfo beamInfo,
ANtpEventInfoNC eventInfo,
ANtpTrackInfoNC trackInfo,
ANtpShowerInfoNC showerInfo,
ANtpTruthInfoBeam truthInfo = 0 
)

Definition at line 200 of file NCAnalysisCuts.cxx.

References NCEventInfo::beam, NCEventInfo::event, fEventInfo, NCEventInfo::header, NCEventInfo::shower, NCEventInfo::track, and NCEventInfo::truth.

Referenced by MicroDSTMaker::ExtractNCCC(), and MicroDSTMaker::MakeuDST().

00206 {
00207   fEventInfo.header = headerInfo;
00208   fEventInfo.beam = beamInfo;
00209   fEventInfo.event = eventInfo;
00210   fEventInfo.track = trackInfo;
00211   fEventInfo.shower = showerInfo;
00212   fEventInfo.truth = truthInfo;
00213 }

void NCAnalysisCuts::SetUseAll185i ( bool  useAll  ) 

Definition at line 234 of file NCAnalysisCuts.cxx.

References fUseAll185i.

Referenced by MicroDSTMaker::MakeuDST().

00235 {
00236   fUseAll185i = useAll;
00237 }

void NCAnalysisCuts::SetUseAllBeams ( bool  useAll  ) 

Definition at line 222 of file NCAnalysisCuts.cxx.

References fUseAllBeams.

Referenced by MicroDSTMaker::MakeuDST().

00223 {
00224   fUseAllBeams = useAll;
00225 }

void NCAnalysisCuts::SetUseAllL010z ( bool  useAll  ) 

Definition at line 228 of file NCAnalysisCuts.cxx.

References fUseAllL010z.

Referenced by MicroDSTMaker::MakeuDST().

00229 {
00230   fUseAllL010z = useAll;
00231 }


Member Data Documentation

Definition at line 56 of file NCAnalysisCuts.h.

Referenced by IsGoodTarget(), and SetBeamType().

int NCAnalysisCuts::fCurrentRun [protected]

Definition at line 57 of file NCAnalysisCuts.h.

Referenced by IsNewSnarl().

Definition at line 58 of file NCAnalysisCuts.h.

Referenced by IsNewSnarl().

Definition at line 59 of file NCAnalysisCuts.h.

Referenced by IsNewSnarl().

bool NCAnalysisCuts::fUseAll185i [protected]

Definition at line 61 of file NCAnalysisCuts.h.

Referenced by IsGoodTarget(), and SetUseAll185i().

bool NCAnalysisCuts::fUseAllBeams [protected]

Definition at line 60 of file NCAnalysisCuts.h.

Referenced by IsGoodTarget(), and SetUseAllBeams().

bool NCAnalysisCuts::fUseAllL010z [protected]

Definition at line 62 of file NCAnalysisCuts.h.

Referenced by IsGoodTarget(), and SetUseAllL010z().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1