NuCutImps::CC0325Std Class Reference

#include <NuCutImps.h>

Inheritance diagram for NuCutImps::CC0325Std:
NuCut

List of all members.

Public Member Functions

 CC0325Std (const NuPlots *plots=0)
Bool_t InFidVol (const NuEvent &nu) const

Static Public Member Functions

static Bool_t IsGoodBeam (const NuEvent &nu)

Protected Member Functions

void Preselection (const NuEvent &nu)
void Selection (const NuEvent &nu)

Detailed Description

Definition at line 55 of file NuCutImps.h.


Constructor & Destructor Documentation

NuCutImps::CC0325Std::CC0325Std ( const NuPlots plots = 0  ) 

Definition at line 42 of file NuCutImps.cxx.

References NuCuts::kCC0325Std, NuCut::SetAnaVersion(), and NuCut::SetFidVol().

00042                                            :
00043     NuCut("CC0325Std", plots)
00044   {
00045     SetFidVol("cc2008");
00046     SetAnaVersion(NuCuts::kCC0325Std);
00047   }


Member Function Documentation

Bool_t NuCutImps::CC0325Std::InFidVol ( const NuEvent nu  )  const [virtual]

Fiducial volume calculation function. This is the basic 'infid' derived version, and should be overridden/passed to for any more complicated evaluations.

Reimplemented from NuCut.

Definition at line 49 of file NuCutImps.cxx.

References Munits::m, and NuEvent::zTrkVtx.

Referenced by Preselection().

00050   {
00051     // Move trk vtx upstream by 3.92cm from scintillator to steel
00052     // for this analysis version
00053     NuEvent nuc = nu;
00054     nuc.zTrkVtx = nu.zTrkVtx - (0.0392*Munits::m);
00055 
00056     return NuCut::InFidVol(nuc);
00057   }

Bool_t NuCutImps::CC0325Std::IsGoodBeam ( const NuEvent nu  )  [static]

Definition at line 124 of file NuCutImps.cxx.

References bfld::AsString(), NuEvent::beamTypeDB, NuEvent::cutOnBeamInfo, NuEvent::detector, NuEvent::goodBeam, NuEvent::goodBeamSntp, NuEvent::hornCur, NuEvent::hornIsReverse, SimFlag::kData, Msg::kError, Detector::kFar, Msg::kInfo, BeamType::kL010z000i, BeamType::kL010z170i, BeamType::kL010z185i, BeamType::kL010z185i_rev, BeamType::kL010z200i, BeamType::kL250z200i, Detector::kNear, Msg::kWarning, MAXMSG, NuEvent::run, NuEvent::simFlag, NuEvent::snarl, and NuEvent::subRun.

Referenced by NuCutImps::ChairSound::Preselection(), Preselection(), and NuCutImps::MSRock_Nov09::Preselection().

00125   {
00126     // Don't measure this unless we have data
00127     if (nu.simFlag!=SimFlag::kData) {
00128       // MAXMSG("NuCuts",Msg::kInfo,1)
00129       //   <<"Not cutting on GoodBeam for simFlag="<<nu.simFlag<<endl;
00130       return true;
00131     }
00132 
00133     // Don't cut on this if we've set not to
00134     if (!nu.cutOnBeamInfo) {
00135       MAXMSG("CC0325Std",Msg::kWarning,1)
00136         <<"Not cutting on BeamInfo (flag set to not cut)"<<endl;
00137       return true;
00138     }
00139 
00140     // Assume we are good, and start from there
00141     bool isGood = true;
00142 
00143     //check beam monitoring was good
00144     if (!nu.goodBeamSntp) isGood = false;
00145 
00146     //beam monitoring information is used primarily from the sntp files
00147     //but it is also pulled in from the DB
00148     //check that the two sources agree
00149     //the pot counting is only done using the sntp file data
00150     //so if they disagree then that could mess up pot counting if
00151     //a cut is made on nu.goodBeam
00152     if (nu.goodBeamSntp!=nu.goodBeam){
00153       MAXMSG("CC0325Std",Msg::kWarning,1000)
00154         <<"The beam monitoring information in the database and sntp files disagrees as to whether the spill is good"
00155         <<", goodBeam(DB)="<<nu.goodBeam
00156         <<", goodBeamSntp="<<nu.goodBeamSntp<<endl;
00157     }
00158 
00159     // Check current
00160     if (nu.hornCur==-999999) isGood = false;
00161 
00162     if (nu.hornCur < -10) {
00163       if (nu.beamTypeDB != BeamType::kL010z185i &&
00164           nu.beamTypeDB != BeamType::kL010z170i &&
00165           nu.beamTypeDB != BeamType::kL010z200i &&
00166           nu.beamTypeDB != BeamType::kL250z200i) {
00167         isGood = false;
00168       }
00169       if (nu.hornIsReverse) {
00170         MAXMSG("CC0325Std",Msg::kError,1000)
00171           << "nu.hornIsReverse is true but it shouldn't be for beamTypeDB="
00172           << nu.beamTypeDB << endl;
00173       }
00174     }
00175     else if (nu.hornCur >  10) {
00176       if (nu.beamTypeDB != BeamType::kL010z185i_rev)
00177         isGood = false;
00178       if (!nu.hornIsReverse) {
00179         MAXMSG("CC0325Std",Msg::kError,1000)
00180           << "nu.hornIsReverse is false but it shouldn't be for beamTypeDB="
00181           << nu.beamTypeDB << endl;
00182       }
00183     }
00184     else {
00185       if (nu.beamTypeDB != BeamType::kL010z000i)
00186         isGood = false;
00187     }
00188 
00189 
00190     if (!isGood) {
00191       MAXMSG("CC0325Std",Msg::kInfo,100)
00192         <<"Bad beam: goodBeam="<<nu.goodBeam
00193         <<", goodBeamSntp="<<nu.goodBeamSntp
00194         <<", hornCur="<<nu.hornCur
00195         <<", nu.beamTypeDB="<<nu.beamTypeDB<<"("
00196         <<BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
00197         <<"), hornIsReverse="<< (nu.hornIsReverse?"Yes":"No")
00198         << endl;
00199       if (nu.detector==Detector::kNear) {
00200         MAXMSG("CC0325Std",Msg::kError,1000)
00201           <<"IsGoodBeam: cutting on Bad beam here messes"
00202           <<" up POT counting.  Event: " << nu.run << "/" << nu.subRun << ", " <<  nu.snarl <<endl;
00203       }
00204       return false;
00205     }
00206 
00207     //Make sure we're not getting mixed beam
00208     static Bool_t firstGoodEvent = true;
00209     static Int_t firstType = 0;
00210 
00211     if (firstGoodEvent){
00212       firstGoodEvent = false;
00213       firstType = nu.beamTypeDB;
00214       // Treat le10 170, 185, 200 as all the same
00215       if (firstType == BeamType::kL010z170i ||
00216           firstType == BeamType::kL010z200i) {
00217         firstType = BeamType::kL010z185i;
00218       }
00219     } else {
00220       Int_t thisType = nu.beamTypeDB;
00221       // Treat le10 170, 185, 200 as all the same
00222       if (nu.simFlag==SimFlag::kData && nu.detector==Detector::kFar){
00223       if (thisType == BeamType::kL010z170i ||
00224           thisType == BeamType::kL010z200i)
00225       {
00226           thisType = BeamType::kL010z185i;
00227       }
00228     }
00229 
00230       if (thisType != firstType) {
00231         MAXMSG("CC0325Std",Msg::kWarning,100)
00232           << "Seeing mixed beam: firstType=" << firstType
00233           << "(" << BeamType::AsString(BeamType::BeamType_t(firstType))
00234           << "), thisType=" << thisType
00235           << "(" << BeamType::AsString(BeamType::BeamType_t(thisType))
00236           << "), beamTypeDB=" << nu.beamTypeDB
00237           << "(" << BeamType::AsString(BeamType::BeamType_t(nu.beamTypeDB))
00238           << ")" << endl;
00239         if (nu.detector==Detector::kNear) {
00240           MAXMSG("NuCuts",Msg::kError,1000)
00241             <<"IsGoodBeam: cutting on Bad beam here messes"
00242             <<" up POT counting..."<<endl;
00243         }
00244         return false;
00245       }
00246     }
00247     //Beam consistent with first event in DST, so we can let it pass
00248     return true;
00249 
00250   }

void NuCutImps::CC0325Std::Preselection ( const NuEvent nu  )  [protected, virtual]

Implements NuCut.

Definition at line 60 of file NuCutImps.cxx.

References NuEvent::coilCurrent, NuEvent::coilIsOk, NuCut::Cut_If(), NuEvent::cutOnBeamInfo, NuEvent::cutOnDataQuality, NuEvent::cutOnSpillTiming, NuEvent::detector, NuEvent::dirCosNu, NuEvent::goodBeamSntp, NuCuts::GoodTimeToNearestSpill(), InFidVol(), IsGoodBeam(), NuEvent::isGoodDataQuality, NuCuts::IsGoodTrackFitPassReclamation(), NuEvent::isLI, SimFlag::kData, NuCut::Keep_Data_If(), NuCut::Keep_If(), Detector::kFar, Detector::kNear, Msg::kWarning, NuEvent::litime, MAXMSG, NuEvent::ntrk, NuEvent::simFlag, and NuEvent::trkfitpass.

00061   {
00062     if (nu.simFlag==SimFlag::kData) {
00063       MAXMSG("CC0325Std",Msg::kWarning, 10)
00064         << "NuCut derivative CC0325Std has not been validated against data. "
00065         << "Use at your own risk! (Or validate it then remove this warning!)" << endl;
00066     }
00067     // Good tracks
00068     Keep_If(nu.ntrk >= 1, "GoodNumberofTracks");
00069 
00070     // Filter out LI events
00071     Cut_If(nu.isLI || nu.litime != -1, "LICut");
00072 
00073     // Is the coil okay? Only cut if we have the cutOnDataQuality flag
00074     // Keep_Data_If(fNuCuts.IsCoilOk(nu), nu);
00075     Keep_Data_If(!nu.cutOnDataQuality || nu.coilIsOk, nu, "IsCoilOkay");
00076 
00077     // IsGoodBeamDetPOTCountingStage
00078     // This can mess up POT counting apparently, so be careful!
00079     Keep_Data_If(nu.goodBeamSntp && nu.coilIsOk, nu,"GoodBeamDetPOT");
00080 
00081     // Cut on good beam (IsGoodBeam)
00082     Keep_Data_If(!nu.cutOnBeamInfo || IsGoodBeam(nu), nu, "GoodBeam");
00083 
00084     // Is it in the fiducial volume?
00085     Keep_If(InFidVol(nu), "FidVol");
00086 
00087     // Per-detector cuts
00088     if (nu.detector == Detector::kFar)
00089     {
00090       // TrackFitPass
00091       Keep_If(nu.trkfitpass == 1, "trackfitpass");
00092 
00093       // Data Quality
00094       Keep_Data_If(nu.isGoodDataQuality || !nu.cutOnDataQuality, nu, "DataQuality");
00095 
00096       // IsGoodTimeToNearestSpill (FD only)
00097       // CC0325Std Uses -20us, +30us
00098       Keep_Data_If(NuCuts::GoodTimeToNearestSpill(nu, -20, +30) || !nu.cutOnSpillTiming, nu, "SpillTime");
00099 
00100       // Cut on track direction angle
00101       Keep_If(nu.dirCosNu > 0.6, "dirCosNu");
00102     }
00103     else if (nu.detector == Detector::kNear)
00104     {
00105       // Need to implement ND Trackfitpass (uses reclamation)
00106       // See Zeynep talk DocDB-6382 - mentions 'Nikis Reclamation'
00107       Keep_If(NuCuts::IsGoodTrackFitPassReclamation(nu), "trackfitreclamation");
00108 
00109       // Cut on the coil current
00110       Keep_Data_If(nu.coilCurrent < -1000 || !nu.cutOnDataQuality, nu, "CoilCurrent");
00111 
00112     } // End of per-detector cuts
00113   } // Eend of preselection function

void NuCutImps::CC0325Std::Selection ( const NuEvent nu  )  [protected, virtual]

Implements NuCut.

Definition at line 116 of file NuCutImps.cxx.

References NuCut::Keep_If(), and NuEvent::roID.

00117   {
00118     Float_t cutValue=0.3;
00119     // Cut on RoID
00120     Keep_If(nu.roID > cutValue, "RoID");
00121 
00122   }


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

Generated on 24 Apr 2018 for loon by  doxygen 1.6.1