15 #include "art_root_io/TFileService.h" 30 class ProtoDUNEBeamlineFilter;
101 fIsBeamTrigger = tfs->make<TH1F>(
"IsBeamTrigger",
"Is the CTB trigger from the beamline?", 2,0,1);
102 fBITriggerAll = tfs->make<TH1F>(
"BITriggerAll",
"Beam Instrumentation Trigger for All Events", 3,-1,1);
103 fBITriggerPass = tfs->make<TH1F>(
"BITriggerPass",
"Beam Instrumentation Trigger for Passing Events", 3,-1,1);
104 fBIAndTimingMatchAll = tfs->make<TH1F>(
"BIAndTimingMatchAll",
"Beam Instrumentation & Timing Triggers Match for All Events", 2,0,1);
105 fBIAndTimingMatchPass = tfs->make<TH1F>(
"BIAndTimingMatchPass",
"Beam Instrumentation & Timing Triggers Match for Passing Events", 2,0,1);
106 fPossiblePartsTOF = tfs->make<TH1F>(
"PossiblePartsTOF",
"Possible TOF Particles for All Events", 5,0,5);
107 fPossiblePartsCherenkov = tfs->make<TH1F>(
"PossiblePartsCherenkov",
"Possible Cherenkov Particles for All Events", 5,0,5);
108 fPossiblePartsAll = tfs->make<TH1F>(
"PossiblePartsAll",
"Possible Particles for All Events", 5,0,5);
109 fPossiblePartsPass = tfs->make<TH1F>(
"PossiblePartsPass",
"Possible Particles for Passing Events", 5,0,5);
110 fMomentumAll = tfs->make<TH1F>(
"MomentumAll",
"Momentum for All Events", 100,0,10);
111 fMomentumPass = tfs->make<TH1F>(
"MomentumPass",
"Momentum for Passing Events", 100,0,10);
112 fTOFAll = tfs->make<TH1F>(
"TOFAll",
"TOF for All Events", 350,-100,250);
113 fTOFPass = tfs->make<TH1F>(
"TOFPass",
"TOF for Passing Events", 350,-100,250);
114 fTOFChannelAll = tfs->make<TH1F>(
"TOFChannelAll",
"TOF Channel for All Events", 6,-1,5);
115 fTOFChannelPass = tfs->make<TH1F>(
"TOFChannelPass",
"TOF Channel for Passing Events", 6,-1,5);
116 fCKov0All = tfs->make<TH1F>(
"CKov0All",
"Cherenkov 0 for All Events", 3,-1,2);
117 fCKov0Pass = tfs->make<TH1F>(
"CKov0Pass",
"Cherenkov 0 for Passing Events", 3,-1,2);
118 fCKov1All = tfs->make<TH1F>(
"CKov1All",
"Cherenkov 1 for All Events", 3,-1,2);
119 fCKov1Pass = tfs->make<TH1F>(
"CKov1Pass",
"Cherenkov 1 for Passing Events", 3,-1,2);
120 fCKov0PressureAll = tfs->make<TH1F>(
"CKov0PressureAll",
"Cherenkov 0 Pressure for All Events", 100,0,10);
121 fCKov0PressurePass = tfs->make<TH1F>(
"CKov0PressurePass",
"Cherenkov 0 Pressure for Passing Events", 100,0,10);
122 fCKov1PressureAll = tfs->make<TH1F>(
"CKov1PressureAll",
"Cherenkov 1 Pressure for All Events", 100,0,10);
123 fCKov1PressurePass = tfs->make<TH1F>(
"CKov1PressurePass",
"Cherenkov 1 Pressure for Passing Events", 100,0,10);
124 fCKovAll = tfs->make<TH1F>(
"CKovAll",
"Both Cherenkovs for All Events", 5,-1,4);
125 fCKovPass = tfs->make<TH1F>(
"CKovPass",
"Both Cherenkovs for Passing Events", 5,-1,4);
126 fMassAll = tfs->make<TH1F>(
"MassAll",
"Beamline Particle Mass for All Events", 200,0,5);
127 fMassPass = tfs->make<TH1F>(
"MassPass",
"Beamline Particle Mass for Passing Events", 200,0,5);
159 if(
fIsElectron && !possibleParts.electron) result =
false;
160 else if(
fIsMuon && !possibleParts.muon) result =
false;
161 else if(
fIsPion && !possibleParts.pion) result =
false;
162 else if(
fIsKaon && !possibleParts.kaon) result =
false;
163 else if(
fIsProton && !possibleParts.proton) result =
false;
168 if(
fIsElectron && possibleParts.electron) result =
true;
169 else if(
fIsMuon && possibleParts.muon) result =
true;
170 else if(
fIsPion && possibleParts.pion) result =
true;
171 else if(
fIsKaon && possibleParts.kaon) result =
true;
172 else if(
fIsProton && possibleParts.proton) result =
true;
208 if (ckov0 >=0 && ckov1 >=0)
211 ckov += (ckov1 << 1);
216 mf::LogInfo(
"protoana::ProtoDUNEBeamlineFilter::filter") <<
"pass: " << result <<
"momentum: " <<
momentum <<
" GeV/c, TOF: "<<tof
217 <<
" ns, tofChannel: " << tofChannel <<
" cherenkov 0: " << ckov0 <<
" cherenkov 1: " << ckov1
218 <<
" ckov0Pressure: " << ckov0Pressure
219 <<
" ckov1Pressure: " << ckov1Pressure
220 <<
" timingTrigger: "<<timingTrigger<<
" BITrigger: "<<BITrigger
221 <<
" BIAndTimingMatched: "<<areBIAndTimingMatched;
223 for (
const auto& massSquared: massSquareds)
225 const auto& mass = std::sqrt(massSquared);
226 mf::LogInfo(
"protoana::ProtoDUNEBeamlineFilter::filter") <<
"mass^2: " << massSquared <<
" (GeV/c^2)^2 " <<
"mass: " << mass <<
" GeV/c^2";
PossibleParticleCands GetPIDCandidates(beam::ProtoDUNEBeamEvent const &beamevt, double nominal_momentum)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
bool filter(art::Event &evt)
const std::tuple< double, double, int, int, int, double, double, int, int, bool > GetBeamlineVarsAndStatus(art::Event const &evt) const
float fNominalBeamMomentum
std::vector< double > GetBeamlineMassSquared(art::Event const &evt) const
TH1F * fBIAndTimingMatchPass
virtual ~ProtoDUNEBeamlineFilter()
TH1F * fCKov0PressurePass
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
bool IsGoodBeamlineTrigger(art::Event const &evt) const
TH1F * fPossiblePartsPass
TH1F * fBIAndTimingMatchAll
TH1F * fPossiblePartsCherenkov
EDFilter(fhicl::ParameterSet const &pset)
auto const & get(AssnsNode< L, R, D > const &r)
def momentum(x1, x2, x3, scale=1.)
protoana::ProtoDUNEBeamlineUtils fBeamlineUtils
void reconfigure(fhicl::ParameterSet const &pset)
TH1F * fCKov1PressurePass
ProtoDUNEBeamlineFilter(fhicl::ParameterSet const &pset)