Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Private Member Functions | Private Attributes | List of all members
bpf::BPFCVNAna Class Reference
Inheritance diagram for bpf::BPFCVNAna:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 BPFCVNAna (fhicl::ParameterSet const &pset)
 
 ~BPFCVNAna ()
 
void analyze (const art::Event &evt)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void beginJob ()
 
void endJob ()
 
void beginRun (art::Run const &)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static bool CompareE (const art::Ptr< rb::Prong > &a, const art::Ptr< rb::Prong > &b)
 
static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Static Private Member Functions

static bool byScore (std::pair< int, float > i, std::pair< int, float > j)
 
static bool scoreCompare (const art::Ptr< rb::PID > &pidA, const art::Ptr< rb::PID > &pidB)
 

Private Attributes

const art::ProductToken< std::vector< rb::Cluster > > fClusterToken
 
std::string fVertexLabel
 
std::string fPixelMapInput
 
std::string fProngModLabel
 
std::string fProng3DLabel
 
std::string fProng2DLabel
 
std::string fCVNLabel
 
std::string fTrackLabel
 
std::string fFitSumLabel
 
std::string fBPFPidLabel
 
std::string fEnergyModuleLabel
 
std::string fCVNSliceLabel
 
std::string fShowerLabel
 
std::string fShowerLIDLabel
 
std::vector< std::stringfPreselectionLabels
 
std::string fCosRejLabel
 
art::ServiceHandle< cheat::BackTrackerbt
 
TTree * fCVNBPFslice
 
SliceSummaryfInfo
 
unsigned int Nprongs
 
unsigned int Nprongs2D
 

Detailed Description

Definition at line 69 of file BPFCVNAna_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

bpf::BPFCVNAna::BPFCVNAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 121 of file BPFCVNAna_module.cc.

References reconfigure().

122  : EDAnalyzer(pset)
123  , fClusterToken(consumes<std::vector<rb::Cluster>>(pset.get<std::string>("ClusterLabel")))
124 // , fFile(nullptr)
125  {
126  this->reconfigure(pset);
127 
128  }
const art::ProductToken< std::vector< rb::Cluster > > fClusterToken
void reconfigure(const fhicl::ParameterSet &pset)
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
ProductToken< T > consumes(InputTag const &)
enum BeamMode string
bpf::BPFCVNAna::~BPFCVNAna ( )

Definition at line 131 of file BPFCVNAna_module.cc.

132  {
133  }

Member Function Documentation

void bpf::BPFCVNAna::analyze ( const art::Event evt)

Definition at line 183 of file BPFCVNAna_module.cc.

References std::acos(), rb::Cluster::Add(), cheat::BackTracker::allMCTruth(), bpf::SliceSummary::anglekal, std::atan2(), bt, simb::MCNeutrino::CCNC(), rb::CellHit::Cell(), rb::Cluster::Cell(), CompareE(), bpf::SliceSummary::concospid, bpf::SliceSummary::cvnID_NUE, bpf::SliceSummary::cvnID_NUMU, DEFINE_ART_MODULE(), rb::Prong::Dir(), rb::Energy::E(), simb::MCParticle::E(), cheat::EnergyMetric(), bpf::SliceSummary::event, art::EventID::event(), fBPFPidLabel, fClusterToken, fCosRejLabel, fCVNBPFslice, fCVNLabel, fCVNSliceLabel, fEnergyModuleLabel, fInfo, cvn::Result::fOutput, fPreselectionLabels, fProng2DLabel, fProng3DLabel, fProngModLabel, fShowerLabel, fShowerLIDLabel, fTrackLabel, art::Ptr< T >::get(), cvn::Get2DProngEfficiencyByPDG(), cvn::Get2DProngEnergyByPDG(), cvn::Get2DProngPurityByPDG(), art::DataViewImpl::getByToken(), simb::MCTruth::GetNeutrino(), cvn::GetProngEfficiencyByPDG(), cvn::GetProngEnergyByPDG(), cvn::GetProngPurityByPDG(), make_syst_table_plots::h, MECModelEnuComparisons::i, art::Event::id(), makeTrainCVSamples::int, rb::IsFiltered(), rb::Cluster::IsNoise(), geo::kXorY, simb::MCNeutrino::Lepton(), M_PI, std::min(), rb::Cluster::NCell(), simb::MCTruth::NeutrinoSet(), rb::Cluster::NMissingPlanes(), bpf::SliceSummary::Npids, bpf::SliceSummary::Nprongs, Nprongs, bpf::SliceSummary::Nprongs2D, Nprongs2D, simb::MCNeutrino::Nu(), bpf::SliceSummary::numuE_had, bpf::SliceSummary::numuE_lep, bpf::SliceSummary::numuE_nu, bpf::SliceSummary::orph_nhits, bpf::SliceSummary::orph_totalGeV, simb::MCParticle::PdgCode(), bpf::SliceSummary::prng2D_length, bpf::SliceSummary::prng2D_missingpln, bpf::SliceSummary::prng2D_nhits, bpf::SliceSummary::prng2D_totalGeV, bpf::SliceSummary::prng2D_trueE, bpf::SliceSummary::prng2D_trueeff, bpf::SliceSummary::prng2D_truePDG, bpf::SliceSummary::prng2D_truepur, bpf::SliceSummary::prng_cvnpPDG, bpf::SliceSummary::prng_cvnscore, bpf::SliceSummary::prng_length, bpf::SliceSummary::prng_missingpln, bpf::SliceSummary::prng_nhits3D, bpf::SliceSummary::prng_nhitsX, bpf::SliceSummary::prng_nhitsY, bpf::SliceSummary::prng_pur3D, bpf::SliceSummary::prng_purX, bpf::SliceSummary::prng_purY, bpf::SliceSummary::prng_totalGeV, bpf::SliceSummary::prng_trueE, bpf::SliceSummary::prng_trueeff, bpf::SliceSummary::prng_trueID, bpf::SliceSummary::prng_trueIDx, bpf::SliceSummary::prng_trueIDy, bpf::SliceSummary::prng_truePDG, bpf::SliceSummary::prng_truepur, cvn::ProngClassify(), art::PtrVector< T >::push_back(), numue::NumuE::RecoMuonE(), numue::NumuE::RecoTrkCCHadE(), bpf::SliceSummary::run, art::Event::run(), scoreCompare(), moon_position_table_new3::second, bpf::SliceSummary::shwLID_ePID, bpf::SliceSummary::shwLID_shwE, bpf::SliceSummary::shwLID_trueeff, bpf::SliceSummary::shwLID_truePDG, bpf::SliceSummary::shwLID_truepur, bpf::SliceSummary::slice, bpf::SliceSummary::slice_nhits, bpf::SliceSummary::slice_totalGeV, cheat::BackTracker::SlicesToMCTruthsTable(), cheat::BackTracker::SliceToOrderedNuIds(), bpf::SliceSummary::subrun, art::Event::subRun(), rb::Cluster::TotalGeV(), rb::Prong::TotalLength(), rb::Track::TotalLength(), bpf::SliceSummary::trkBPF_E, bpf::SliceSummary::trkBPF_len, bpf::SliceSummary::trkBPF_PDG, bpf::SliceSummary::trkBPF_phi, bpf::SliceSummary::trkBPF_pID, bpf::SliceSummary::trkBPF_theta, bpf::SliceSummary::trkBPF_trueeff, bpf::SliceSummary::trkBPF_truePDG, bpf::SliceSummary::trkBPF_truepur, bpf::SliceSummary::trkKal_len, bpf::SliceSummary::trkKal_phi, bpf::SliceSummary::trkKal_pID, bpf::SliceSummary::trkKal_theta, bpf::SliceSummary::trkKal_trueeff, bpf::SliceSummary::trkKal_truePDG, bpf::SliceSummary::trkKal_truepur, bpf::SliceSummary::true_CCNC, bpf::SliceSummary::trueE_had, bpf::SliceSummary::trueE_lep, bpf::SliceSummary::trueE_nu, and bpf::SliceSummary::truePDG_lep.

184  {
185 
187 
189  evt.getByToken(fClusterToken, sliceHandle);
190 
191  const std::vector<rb::Cluster> & clusters = *sliceHandle;
193  for ( unsigned int i=0; i<sliceHandle->size(); ++i )
194  slices.push_back(art::Ptr<rb::Cluster>(sliceHandle, i));
195 
196  art::FindOneP<cvn::Result> foSliceCVN(sliceHandle, evt, fCVNSliceLabel);
197  if ( !foSliceCVN.isValid() ) return;
198 
199  // Get Numu Energy objects
200  art::FindOneP<numue::NumuE> foNumuE(sliceHandle, evt, fEnergyModuleLabel);
201  if ( !foNumuE.isValid() ) return;
202 
203  // Get MCNeutrino Idx vector matched to the slices
204  std::vector<cheat::NeutrinoWithIndex> nus = bt->allMCTruth();
205  std::vector<std::vector<cheat::NeutrinoEffPur>> slTruth = bt->SlicesToMCTruthsTable(slices);
206  std::vector<int> sliceNuId = bt->SliceToOrderedNuIds(nus, slTruth, cheat::EnergyMetric, cheat::EnergyMetric);
207  art::FindManyP<rb::Track> fmSliceKalman(sliceHandle, evt, "kalmantrackmerge");
208  for ( size_t iSlice = 0; iSlice < clusters.size(); ++iSlice ) {
209 
210  fInfo = new SliceSummary;
211 
212  const rb::Cluster& slice = clusters[iSlice];
213 
214  if ( rb::IsFiltered(evt,sliceHandle,iSlice,fPreselectionLabels) ) continue;
215  if ( sliceNuId[iSlice] == -1 ) continue;
216  if ( slice.IsNoise() ) continue;
217 
218  // Fill slice info
219  fInfo->slice = iSlice;
220  fInfo->slice_totalGeV = slice.TotalGeV();
221  fInfo->slice_nhits = slice.NCell(geo::kXorY);
222  truth = slTruth[iSlice][sliceNuId[iSlice]].neutrinoInt;
223  if ( !truth->NeutrinoSet() ) continue;
224 
225  // Fill true nu info
226  simb::MCNeutrino thisNu = truth->GetNeutrino();
227  fInfo->trueE_nu = thisNu.Nu().E();
228  fInfo->trueE_lep = thisNu.Lepton().E();
229  fInfo->trueE_had = thisNu.Nu().E() - thisNu.Lepton().E();
230  fInfo->truePDG_lep = thisNu.Lepton().PdgCode();
231  fInfo->true_CCNC = thisNu.CCNC();
232 
233  // Fill CVN ID
234  art::Ptr<cvn::Result> cvnSliceResult = foSliceCVN.at(iSlice);
235  if (!cvnSliceResult) continue;
236 
237  // from CAFMaker::FillCVNResultVars
238  fInfo->cvnID_NUMU = cvnSliceResult->fOutput[0] + cvnSliceResult->fOutput[1]
239  + cvnSliceResult->fOutput[2] + cvnSliceResult->fOutput[3];
240  fInfo->cvnID_NUE = cvnSliceResult->fOutput[4] + cvnSliceResult->fOutput[5]
241  + cvnSliceResult->fOutput[6] + cvnSliceResult->fOutput[7];
242 
243  // Get 3D Prongs
244  std::vector<art::Ptr<rb::Prong>> prongs3D;
245  art::FindManyP<rb::Prong> fmProng3D(sliceHandle, evt,
247  if ( !fmProng3D.isValid() ) continue;
248  if ( fmProng3D.isValid() ) prongs3D = fmProng3D.at(iSlice);
249 
250  // Get prongs by energy
251  std::sort(prongs3D.begin(),prongs3D.end(), CompareE);
252  Nprongs = std::min((int)prongs3D.size(), 20);
253 
254  // Find CVN result and BPF track
255  art::FindManyP<rb::PID> fmCVNID(prongs3D, evt, fCVNLabel);
256  art::FindOneP<cvn::Result> foCVN(prongs3D, evt, fCVNLabel);
257  art::FindManyP<rb::Track> fmTrack(prongs3D, evt, fTrackLabel);
258  art::FindOneP<rb::Shower> foSh(prongs3D, evt, fShowerLabel);
259 
260  // Make container to contain all hits
261  rb::Cluster hitsMPP; //hits for muon, proton, pions
262  rb::Cluster hits3DProngsOther;
263 
264  for ( unsigned int iProng = 0; iProng < Nprongs; ++iProng ){
265 
266  if (fmCVNID.isValid()) {
267  std::vector< art::Ptr<rb::PID> > cvnPIDs = fmCVNID.at(iProng);
268 
269  // Get cvn results by PID value
270  std::sort(cvnPIDs.begin(), cvnPIDs.end(), scoreCompare);
271  for( unsigned int iPID = 0; iPID < cvnPIDs.size(); ++iPID ){
272  fInfo->prng_cvnscore[iProng][iPID] = cvnPIDs[iPID]->Value();
273  fInfo->prng_cvnpPDG[iProng][iPID] = cvnPIDs[iPID]->Pdg();
274  }
275 
276  } // end if(fmCVNID.isValid())
277 
278  // Get 2D and 3D truth and max purity
279  cvn::ProngType ptype3D, ptypeX, ptypeY;
280  double purity3D, purityX, purityY, recE;
281  unsigned int ncellX, ncellY;
282  bool isprimary;
283 
284  ptype3D = ProngClassify(*prongs3D[iProng], &ptype3D, &ptypeX, &ptypeY, &isprimary,
285  &purity3D, &purityX, &purityY, &recE, &ncellX, &ncellY);
286 
287  // Get particle contrubutions by purity
288  std::vector< std::pair<int, double> > purPDG = cvn::GetProngPurityByPDG(*prongs3D[iProng]);
289  std::vector< std::pair<int, double> > enePDG = cvn::GetProngEnergyByPDG(*prongs3D[iProng]);
290  std::vector< std::pair<int, double> > effPDG = cvn::GetProngEfficiencyByPDG(*prongs3D[iProng], slice);
291 
292  if(purPDG.size()==0) continue;
293  for( int iPur = 0; iPur < std::min((int)purPDG.size(),20); ++iPur ){
294  fInfo->prng_truePDG[iProng][iPur] = (int)purPDG[iPur].first;
295  fInfo->prng_truepur[iProng][iPur] = (double)purPDG[iPur].second;
296  fInfo->prng_trueeff[iProng][iPur] = (double)effPDG[iPur].second;
297  fInfo->prng_trueE[iProng][iPur] = (double)enePDG[iPur].second;
298  }
299 
300  // account for hits that are in prongs that are muon, proton, or pion (by truth)
301  // TODO - this, but for prongs that are muon, proton, or pion by CVN...?
302 
303  if ((int)purPDG[0].first == 13 || (int)purPDG[0].first == 2212 || (int)purPDG[0].first == 211){
304 
305  // loop over all hits in prong
306  for(unsigned int h = 0; h < prongs3D[iProng]->NCell(); ++h){
307 
308  const rb::CellHit *pronghit = prongs3D[iProng]->Cell(h).get();
309 
310  //check to see if this hit is already in the list
311  bool onlist = false;
312  for(unsigned int hpr = 0; hpr < hitsMPP.NCell(); ++hpr) {
313  const rb::CellHit *prongHitInList = hitsMPP.Cell(hpr).get();
314  if((*pronghit) == (*prongHitInList)) {
315  onlist = true;
316  break;
317  }
318  } // end loop over hits in list (hpr)
319 
320  // Add the hit if it's not already on the MPP list
321  if(!onlist) hitsMPP.Add(prongs3D[iProng]->Cell(h));
322  } // end loop over hits
323  }
324 
325  // hits that are in 3D prongs that are *not* muon, proton, or pion by truth
326  else {
327 
328  // loop over all hits in prong
329  for(unsigned int h = 0; h < prongs3D[iProng]->NCell(); ++h){
330 
331  const rb::CellHit *pronghit = prongs3D[iProng]->Cell(h).get();
332 
333  // check to see if this hit is already in the MPP list
334  bool onlist = false;
335  for(unsigned int hpr = 0; hpr < hitsMPP.NCell(); ++hpr) {
336  const rb::CellHit *prongHitInList = hitsMPP.Cell(hpr).get();
337  if((*pronghit) == (*prongHitInList)) {
338  onlist = true;
339  break;
340  }
341  } // end loop over hits in MPP list (hpr)
342 
343  // if not already in the MPP list, check to see if this is already in the "other" 3D prong list
344  if (!onlist){
345  for(unsigned int hpr = 0; hpr < hits3DProngsOther.NCell(); ++hpr) {
346  const rb::CellHit *prongHitInList = hits3DProngsOther.Cell(hpr).get();
347  if((*pronghit) == (*prongHitInList)) {
348  onlist = true;
349  break;
350  }
351  }
352  }
353 
354  // Add the hit if its not already on the "other" list
355  if(!onlist) hits3DProngsOther.Add(prongs3D[iProng]->Cell(h));
356  } // end loop over hits
357  } //end else for non-{muon, proton, pion}
358 
359  // get LID info
360  if ( foSh.isValid() ){
361  cet::maybe_ref<art::Ptr<rb::Shower> const> roSh(foSh.at(iProng));
362  art::Ptr<rb::Shower> shower = roSh.ref();
363 
364  std::vector<art::Ptr<rb::Shower>> showers;
365  showers.push_back(shower);
366 
367  art::FindOneP<slid::ShowerLID> foShLID(showers, evt,fShowerLIDLabel);
368  if ( foShLID.isValid() ){
369  cet::maybe_ref<art::Ptr<slid::ShowerLID> const> roShLID(foShLID.at(0));
370  art::Ptr<slid::ShowerLID> showerLID = roShLID.ref();
371  if ( roShLID.ref() ) {
372  fInfo->shwLID_ePID[iProng] = showerLID->Value();
373  fInfo->shwLID_shwE[iProng] = showerLID->ShowerEnergy();
374 
375  // Get particle contrubutions by purity
376  std::vector< std::pair<int,double> > purPDGs=cvn::GetProngPurityByPDG(*showers[0]);
377  std::vector< std::pair<int,double> > enePDGs=cvn::GetProngEnergyByPDG(*showers[0]);
378  std::vector< std::pair<int,double> > effPDGs=cvn::GetProngEfficiencyByPDG(*showers[0], slice);
379 
380  if(purPDGs.size()==0) continue;
381  for( int iPur = 0; iPur < std::min((int)purPDGs.size(),20); ++iPur ){
382  fInfo->shwLID_truePDG[iProng][iPur] = (int)purPDGs[iPur].first;
383  fInfo->shwLID_truepur[iProng][iPur] = (double)purPDGs[iPur].second;
384  fInfo->shwLID_trueeff[iProng][iPur] = (double)effPDGs[iPur].second;
385  }
386  }
387  }
388  } // end shower LID
389 
390  art::Ptr<rb::Prong> prong = prongs3D[iProng];
391  // Get the tracks associated with this prong
392  std::vector< art::Ptr< rb::Track > > tracks;
393  if (!fmTrack.isValid()) continue;
394  tracks = fmTrack.at(iProng);
395 
396  art::FindManyP<rb::FitSum> fitsumFMP(tracks, evt, fTrackLabel);
397  // loop over BPF tracks
398  art::FindManyP<bpfit::BPFPId> fmBPFTrackBPFPid(tracks, evt, fBPFPidLabel);
399  for ( unsigned int itrack = 0; itrack < tracks.size(); ++itrack ){
400  std::vector< art::Ptr< rb::FitSum > > fitsums;
401  if ( fitsumFMP.isValid() ) fitsums = fitsumFMP.at(itrack);
402  if ( fitsums.size() != 1 ) continue;
403 
404  art::Ptr< rb::Track > track = tracks.at(itrack);
405 
406  double phi = atan2(track->Dir().Y(), track->Dir().X())*180.0/M_PI;
407  if(phi<0.0) phi += 360.0;
408 
409  fInfo->trkBPF_PDG[iProng][itrack] = fitsums[0]->PDG();
410  fInfo->trkBPF_E[iProng][itrack] = fitsums[0]->FourMom().E();
411  fInfo->trkBPF_len[iProng][itrack] = track->TotalLength();
412  fInfo->trkBPF_theta[iProng][itrack] = acos(track->Dir().Z())*180.0/M_PI;
413  fInfo->trkBPF_phi[iProng][itrack] = phi;
414 
415  std::vector< std::pair<int, double> > purPDG = cvn::GetProngPurityByPDG(*(tracks[itrack]));
416  std::vector< std::pair<int, double> > effPDG = cvn::GetProngEfficiencyByPDG(*(tracks[itrack]), slice);
417 
418  // loop over particle contributors to this track
419  if(purPDG.size() == 0) continue;
420  for(int iMatch = 0; iMatch < std::min((int)purPDG.size(),20); ++iMatch) {
421 
422  fInfo->trkBPF_truePDG[iProng][itrack][iMatch] = (int)purPDG[iMatch].first;
423  fInfo->trkBPF_truepur[iProng][itrack][iMatch] = (double)purPDG[iMatch].second;
424  fInfo->trkBPF_trueeff[iProng][itrack][iMatch] = (double)effPDG[iMatch].second;
425 
426  } // end loop over matches (iMatch)
427 
428  // get the BPFpid value for this track...
429  if(fmBPFTrackBPFPid.isValid()) {
430  std::vector<art::Ptr<bpfit::BPFPId>> bpfpids = fmBPFTrackBPFPid.at(itrack);
431  if(bpfpids.size() < 1) continue;
432  // NOTE: There should only be one PID associated with each track. PIDs for different particle assumptions
433  // are expected to be associated with the appropriate BPF track
434  fInfo->trkBPF_pID[iProng][itrack] = bpfpids[0]->Value();
435  }
436  }//bpf tracks
437 
438  // Fill other prong information
439  fInfo->prng_trueIDx[iProng] = ptypeX;
440  fInfo->prng_trueIDy[iProng] = ptypeY;
441  fInfo->prng_trueID[iProng] = ptype3D;
442  fInfo->prng_nhitsX[iProng] = ncellX;
443  fInfo->prng_nhitsY[iProng] = ncellY;
444  fInfo->prng_nhits3D[iProng] = ncellX+ncellY;
445  fInfo->prng_purX[iProng] = purityX;
446  fInfo->prng_purY[iProng] = purityY;
447  fInfo->prng_pur3D[iProng] = purity3D;
448  fInfo->prng_length[iProng] = prong->TotalLength();
449  fInfo->prng_totalGeV[iProng] = prong->TotalGeV();
450  fInfo->prng_missingpln[iProng] = prong->NMissingPlanes(geo::kXorY);
451 
452  }// over prongs
453 
454  // Get nu, muon, hadronic energies as calculated by SA numu analysis
455  const art::Ptr<numue::NumuE> sliceEnergy = foNumuE.at(iSlice);
456  if ( sliceEnergy ){
457  fInfo->numuE_nu = sliceEnergy->E();
458  fInfo->numuE_lep = sliceEnergy->RecoMuonE();
459  fInfo->numuE_had = sliceEnergy->RecoTrkCCHadE();
460  }
461 
462  // Fill info for Kalman tracks
463  std::vector< art::Ptr<rb::Track> > sliceKalmanTracks;
464  if ( fmSliceKalman.isValid() ){
465 
466  sliceKalmanTracks = fmSliceKalman.at(iSlice);
467  art::FindOneP<remid::ReMId> foKalmanRemid(sliceKalmanTracks, evt, "remid");
468  // loop over all tracks
469  for(int iTrk = 0; iTrk < std::min((int)sliceKalmanTracks.size(),20); ++iTrk) {
470  art::Ptr< rb::Track > track = sliceKalmanTracks.at(iTrk);
471 
472  std::vector< std::pair<int, double> > purPDG = cvn::GetProngPurityByPDG(*track);
473  std::vector< std::pair<int, double> > effPDG = cvn::GetProngEfficiencyByPDG(*track, slice);
474 
475  double phi = atan2(track->Dir().Y(), track->Dir().X())*180.0/M_PI;
476  if(phi<0.0) phi += 360.0;
477 
478  fInfo->trkKal_len[iTrk] = track->TotalLength();
479  fInfo->trkKal_theta[iTrk] = acos(track->Dir().Z())*180.0/M_PI;
480  fInfo->trkKal_phi[iTrk] = phi;
481 
482  // loop over particle contributors to this track
483  if(purPDG.size() == 0) continue; // don't need this line
484  for(int iMatch = 0; iMatch < std::min((int)purPDG.size(),20); ++iMatch) {
485 
486  fInfo->trkKal_truePDG[iTrk][iMatch] = (int)purPDG[iMatch].first;
487  fInfo->trkKal_truepur[iTrk][iMatch] = (double)purPDG[iMatch].second;
488  fInfo->trkKal_trueeff[iTrk][iMatch] = (double)effPDG[iMatch].second;
489 
490  } // end loop over matches (iMatch)
491 
492  // Get the remid values for each track and fill...
493  if(foKalmanRemid.isValid()) {
494  fInfo->trkKal_pID[iTrk] = (foKalmanRemid.at(iTrk))->Value();
495  }
496 
497  } // end loop over tracks (iTrk)
498 
499  } //kalmantrk
500 
501  // Get 2D Prongs
502  std::vector<art::Ptr<rb::Prong>> prongs2D;
503  art::FindManyP<rb::Prong> fmProng2D(sliceHandle, evt,
505 
506  rb::Cluster hits2DProngs;
507  if ( fmProng2D.isValid() ) {
508  prongs2D = fmProng2D.at(iSlice);
509 
510  std::sort(prongs2D.begin(),prongs2D.end(),CompareE);
511  Nprongs2D = std::min((int)prongs2D.size(), 20);
512 
513  for (unsigned int iProng = 0; iProng < Nprongs2D; ++iProng){
514  std::vector< std::pair<int, double> > purPDG = cvn::Get2DProngPurityByPDG(*prongs2D[iProng]);
515  std::vector< std::pair<int, double> > enePDG = cvn::Get2DProngEnergyByPDG(*prongs2D[iProng]);
516  std::vector< std::pair<int, double> > effPDG = cvn::Get2DProngEfficiencyByPDG(*prongs2D[iProng], slice);
517 
518  if(purPDG.size()==0) continue;
519  for (int iPur = 0; iPur < std::min((int)purPDG.size(),20); ++iPur ){
520  fInfo->prng2D_truePDG[iProng][iPur] = (int)purPDG[iPur].first;
521  fInfo->prng2D_truepur[iProng][iPur] = (double)purPDG[iPur].second;
522  fInfo->prng2D_trueeff[iProng][iPur] = (double)effPDG[iPur].second;
523  fInfo->prng2D_trueE[iProng][iPur] = (double)enePDG[iPur].second;
524  }
525 
526  for(unsigned int h2D = 0; h2D < prongs2D[iProng]->NCell(); ++ h2D){
527  const rb::CellHit *pronghit = prongs2D[iProng]->Cell(h2D).get();
528  // check to see if this hit is already in the 3D lists
529  bool onlist = false;
530  for(unsigned int hpr = 0; hpr < hitsMPP.NCell(); ++hpr) {
531  const rb::CellHit *prongHitInList = hitsMPP.Cell(hpr).get();
532  if((*pronghit) == (*prongHitInList)) {
533  onlist = true;
534  break;
535  }
536  } // end loop over hits in MPP list (hpr)
537 
538  // if not already in the MPP list, check to see if this is already in the "other" 3D prong list
539  if (!onlist){
540  for(unsigned int hpr = 0; hpr < hits3DProngsOther.NCell(); ++hpr) {
541  const rb::CellHit *prongHitInList = hits3DProngsOther.Cell(hpr).get();
542  if((*pronghit) == (*prongHitInList)) {
543  onlist = true;
544  break;
545  }
546  }
547  }
548 
549  // if not on either of those lists, check to see if it's already on 2D prong list
550  if (!onlist){
551  for(unsigned int hpr = 0; hpr < hits2DProngs.NCell(); ++hpr) {
552  const rb::CellHit *prongHitInList = hits2DProngs.Cell(hpr).get();
553  if((*pronghit) == (*prongHitInList)) {
554  onlist = true;
555  break;
556  }
557  }
558  }
559  if (!onlist) hits2DProngs.Add(prongs2D[iProng]->Cell(h2D));
560  }//end loop over hits
561 
562  art::Ptr<rb::Prong> prong2D = prongs2D[iProng];
563  // Misc 2D prong info
564  fInfo->prng2D_length[iProng] = prong2D->TotalLength();
565  fInfo->prng2D_totalGeV[iProng] = prong2D->TotalGeV();
566  fInfo->prng2D_missingpln[iProng] = prong2D->NMissingPlanes(geo::kXorY);
567  fInfo->prng2D_nhits[iProng] = prong2D->NCell(geo::kXorY);
568  }//end 2D prong loop
569  }// end 2D prongs isValid
570 
571  // orphaned hits - adapted from BPFEnergyEstimator
572  rb::Cluster orphanedHits;
573  int nOrphHits = 0;
574  // Loop over all hits in the slice
575  for (unsigned int hsl = 0; hsl < slice.NCell(); ++hsl) {
576  const rb::CellHit *sliceHit = slice.Cell(hsl).get();
577 
578  // check to see if this hit is in any of the lists
579  bool onlist = false;
580  for(unsigned int hpr = 0; hpr < hitsMPP.NCell(); ++hpr) {
581  const rb::CellHit *prongHitInList = hitsMPP.Cell(hpr).get();
582  if((*sliceHit) == (*prongHitInList)) {
583  onlist = true;
584  break;
585  }
586  } // end loop over hits in MPP list (hpr)
587 
588  // if not already in the MPP list, check to see if this is already in the "other" 3D prong list
589  if (!onlist){
590  for(unsigned int hpr = 0; hpr < hits3DProngsOther.NCell(); ++hpr) {
591  const rb::CellHit *prongHitInList = hits3DProngsOther.Cell(hpr).get();
592  if((*sliceHit) == (*prongHitInList)) {
593  onlist = true;
594  break;
595  }
596  }
597  }
598 
599  // if not on either of those lists, check to see if it's already on 2D prong list
600  if (!onlist){
601  for(unsigned int hpr = 0; hpr < hits2DProngs.NCell(); ++hpr) {
602  const rb::CellHit *prongHitInList = hits2DProngs.Cell(hpr).get();
603  if((*sliceHit) == (*prongHitInList)) {
604  onlist = true;
605  break;
606  }
607  }
608  }
609  // if it's not on a 3D prong or a 2D prong, put it in the list of orphaned hits
610  if(!onlist) {
611  orphanedHits.Add(slice.Cell(hsl));
612  nOrphHits++;
613  }
614  }
615  fInfo->orph_nhits = nOrphHits;
616  if(orphanedHits.NCell()>0) fInfo->orph_totalGeV = orphanedHits.TotalGeV();
617 
618  // for cosmic rejection cuts
619  art::FindManyP<cosrej::CosRejObj> fmCosRej(sliceHandle,evt,fCosRejLabel);
620  if (fmCosRej.isValid()) {
621  const std::vector<art::Ptr<cosrej::CosRejObj> > cosrej = fmCosRej.at(iSlice);
622  if (cosrej.size() > 0){
623  fInfo->anglekal = cosrej[0]->AngleKal();
624  fInfo->concospid = cosrej[0]->ConCosPID();
625  }
626 
627  }
628 
629  fInfo->Nprongs = Nprongs;
631  fInfo->Npids = 10; //arbitrarily larger than expected contributions to one prong
632  fInfo->run = evt.run();
633  fInfo->subrun = evt.subRun();
634  fInfo->event = evt.id().event();
635 
636  fCVNBPFslice->Fill();
637  }// slices
638 
639  }
double E(const int i=0) const
Definition: MCParticle.h:232
int prng_trueIDx[20]
Definition: SliceSummary.h:44
double trkBPF_pID[20][3]
Definition: SliceSummary.h:93
int prng_cvnpPDG[20][20]
Definition: SliceSummary.h:52
std::vector< std::pair< int, double > > Get2DProngPurityByPDG(const rb::Cluster &prong)
std::string fShowerLIDLabel
SubRunNumber_t subRun() const
Definition: Event.h:72
int PdgCode() const
Definition: MCParticle.h:211
int CCNC() const
Definition: MCNeutrino.h:148
enum cvn::PType ProngType
double prng_totalGeV[20]
Definition: SliceSummary.h:48
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:76
double trkBPF_phi[20][3]
Definition: SliceSummary.h:95
unsigned int Nprongs2D
float E() const
Definition: Energy.cxx:27
double trkBPF_E[20][3]
Definition: SliceSummary.h:91
double prng_trueE[20][20]
Definition: SliceSummary.h:56
std::vector< std::string > fPreselectionLabels
X or Y views.
Definition: PlaneGeo.h:30
double trkBPF_truepur[20][3][20]
Definition: SliceSummary.h:100
const art::ProductToken< std::vector< rb::Cluster > > fClusterToken
double prng2D_nhits[20]
Definition: SliceSummary.h:63
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:146
std::vector< NeutrinoWithIndex > allMCTruth() const
double trkBPF_theta[20][3]
Definition: SliceSummary.h:94
double trkBPF_trueeff[20][3][20]
Definition: SliceSummary.h:101
double prng2D_length[20]
Definition: SliceSummary.h:61
std::string fTrackLabel
double shwLID_ePID[20]
Definition: SliceSummary.h:83
std::vector< std::pair< int, double > > Get2DProngEfficiencyByPDG(const rb::Cluster &prong, const rb::Cluster &slice)
Definition: event.h:19
A collection of associated CellHits.
Definition: Cluster.h:47
int prng2D_missingpln[20]
Definition: SliceSummary.h:62
std::string fCosRejLabel
std::string fProng3DLabel
T acos(T number)
Definition: d0nt_math.hpp:54
std::vector< std::vector< cheat::NeutrinoEffPur > > SlicesToMCTruthsTable(const std::vector< const rb::Cluster * > &sliceList) const
Given ALL the slices in an event, including the noise slice, returns a vector of vector of structures...
#define M_PI
Definition: SbMath.h:34
double prng_purX[20]
Definition: SliceSummary.h:40
std::string fEnergyModuleLabel
std::vector< float > fOutput
Vector of outputs from neural net.
Definition: Result.h:30
double prng_purY[20]
Definition: SliceSummary.h:41
double prng_truepur[20][20]
Definition: SliceSummary.h:54
SliceSummary * fInfo
std::vector< std::pair< int, double > > GetProngEfficiencyByPDG(const rb::Cluster &prong, const rb::Cluster &slice)
float RecoTrkCCHadE() const
Definition: NumuE.cxx:274
double shwLID_truepur[20][20]
Definition: SliceSummary.h:86
std::vector< int > SliceToOrderedNuIds(const std::vector< cheat::NeutrinoWithIndex > &nusWithIdx, const std::vector< std::vector< cheat::NeutrinoEffPur >> &slTruthTable, std::function< double(const cheat::NeutrinoEffPur &)> slMetric, std::function< double(const cheat::NeutrinoEffPur &)> nuMetric) const
Given a vector of indexed neutrino interaction and a vector of slice truth tables, returns a vector of neutrino interaction indices ordered by best match to the corresponding slice. Here, best match is determined according to the given cheat::NeutrinoEffPur functions for the slice and the nu.
double prng2D_truepur[20][20]
Definition: SliceSummary.h:66
art::ServiceHandle< cheat::BackTracker > bt
virtual void Add(const art::Ptr< rb::CellHit > &cell, double weight=1)
Definition: Cluster.cxx:84
float RecoMuonE() const
Definition: NumuE.cxx:269
static bool CompareE(const art::Ptr< rb::Prong > &a, const art::Ptr< rb::Prong > &b)
virtual double TotalLength() const
Length (cm) of all the track segments.
Definition: Track.cxx:213
unsigned int Nprongs
Definition: SliceSummary.h:12
unsigned short Cell() const
Definition: CellHit.h:40
std::vector< std::pair< int, double > > Get2DProngEnergyByPDG(const rb::Cluster &prong)
double prng_cvnscore[20][20]
Definition: SliceSummary.h:57
virtual double TotalLength() const
Distance along prong to reach last cell hit.
Definition: Prong.cxx:186
const simb::MCParticle & Lepton() const
Definition: MCNeutrino.h:147
unsigned int Nprongs
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
double trkKal_pID[20]
Definition: SliceSummary.h:104
double prng2D_trueE[20][20]
Definition: SliceSummary.h:68
double prng_trueeff[20][20]
Definition: SliceSummary.h:55
virtual TVector3 Dir() const
Unit vector describing prong direction.
Definition: Prong.h:77
double EnergyMetric(const cheat::NeutrinoEffPur &ep)
Function for NeutrinoEffPur&#39;s nu interaction to slice energy.
int prng_nhits3D[20]
Definition: SliceSummary.h:38
static bool scoreCompare(const art::Ptr< rb::PID > &pidA, const art::Ptr< rb::PID > &pidB)
bool IsFiltered(const art::Event &evt, art::Ptr< T > x, const std::vector< std::string > &labels)
Is this Ptr marked "filtered out"?
Definition: FilterList.h:96
std::string fProng2DLabel
double trkKal_trueeff[20][20]
Definition: SliceSummary.h:110
unsigned int Nprongs2D
Definition: SliceSummary.h:13
std::string fShowerLabel
EventNumber_t event() const
Definition: EventID.h:116
double trkKal_len[20]
Definition: SliceSummary.h:105
int NMissingPlanes(geo::View_t view) const
Total number of missing planes in cluster.
Definition: Cluster.cxx:693
int trkBPF_truePDG[20][3][20]
Definition: SliceSummary.h:99
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
Cosmic Rejection PIDs for Numu analysis.
Definition: FillParentInfo.h:9
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
double trkKal_phi[20]
Definition: SliceSummary.h:107
double prng_pur3D[20]
Definition: SliceSummary.h:42
std::string fCVNLabel
T const * get() const
Definition: Ptr.h:321
int prng_missingpln[20]
Definition: SliceSummary.h:50
std::vector< std::pair< int, double > > GetProngPurityByPDG(const rb::Cluster &prong)
int trkBPF_PDG[20][3]
Definition: SliceSummary.h:90
int prng2D_truePDG[20][20]
Definition: SliceSummary.h:65
ProngType ProngClassify(const rb::Prong &prong, ProngType *pType3D, ProngType *pTypeX, ProngType *pTypeY, bool *isprimary, double *purity3D, double *purityX, double *purityY, double *recE, unsigned int *ncellX, unsigned int *ncellY)
double prng_length[20]
Definition: SliceSummary.h:49
double trkKal_theta[20]
Definition: SliceSummary.h:106
double prng2D_trueeff[20][20]
Definition: SliceSummary.h:67
double TotalGeV(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple sum of the estimated GeV of all the hits.
Definition: Cluster.cxx:378
double trkKal_truepur[20][20]
Definition: SliceSummary.h:109
double trkBPF_len[20][3]
Definition: SliceSummary.h:92
std::string fCVNSliceLabel
int shwLID_truePDG[20][20]
Definition: SliceSummary.h:85
bool NeutrinoSet() const
Definition: MCTruth.h:77
double shwLID_trueeff[20][20]
Definition: SliceSummary.h:87
double shwLID_shwE[20]
Definition: SliceSummary.h:84
T min(const caf::Proxy< T > &a, T b)
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
bool getByToken(ProductToken< PROD > const &token, Handle< PROD > &result) const
Definition: DataViewImpl.h:387
RunNumber_t run() const
Definition: Event.h:77
Event generator information.
Definition: MCNeutrino.h:18
std::string fProngModLabel
EventID id() const
Definition: Event.h:56
std::vector< std::pair< int, double > > GetProngEnergyByPDG(const rb::Cluster &prong)
double prng2D_totalGeV[20]
Definition: SliceSummary.h:60
int prng_trueIDy[20]
Definition: SliceSummary.h:45
std::string fBPFPidLabel
T atan2(T number)
Definition: d0nt_math.hpp:72
int trkKal_truePDG[20][20]
Definition: SliceSummary.h:108
int prng_truePDG[20][20]
Definition: SliceSummary.h:53
void bpf::BPFCVNAna::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 156 of file BPFCVNAna_module.cc.

References fCVNBPFslice, fInfo, and art::TFileDirectory::make().

157  {
159 
160  fCVNBPFslice = tfs->make<TTree>("CVNBPFnu","CVNBPFnu");
161  fCVNBPFslice->Branch("fSlice", "bpf::SliceSummary", &fInfo);
162 
163  }
SliceSummary * fInfo
T * make(ARGS...args) const
void bpf::BPFCVNAna::beginRun ( art::Run const &  )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 173 of file BPFCVNAna_module.cc.

174  {
175  }
static bool bpf::BPFCVNAna::byScore ( std::pair< int, float >  i,
std::pair< int, float >  j 
)
inlinestaticprivate

Definition at line 109 of file BPFCVNAna_module.cc.

109  {
110  return ( (i.second > j.second) );
111  }
const double j
Definition: BetheBloch.cxx:29
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
bool bpf::BPFCVNAna::CompareE ( const art::Ptr< rb::Prong > &  a,
const art::Ptr< rb::Prong > &  b 
)
static

Definition at line 177 of file BPFCVNAna_module.cc.

References rb::Cluster::TotalGeV().

Referenced by analyze().

178  {
179  return a->TotalGeV() > b->TotalGeV();
180  }
double TotalGeV(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple sum of the estimated GeV of all the hits.
Definition: Cluster.cxx:378
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
void bpf::BPFCVNAna::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 166 of file BPFCVNAna_module.cc.

167  {
168 
169  }
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void bpf::BPFCVNAna::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 136 of file BPFCVNAna_module.cc.

References fBPFPidLabel, fCosRejLabel, fCVNLabel, fCVNSliceLabel, fEnergyModuleLabel, fFitSumLabel, fPixelMapInput, fPreselectionLabels, fProng2DLabel, fProng3DLabel, fProngModLabel, fShowerLabel, fShowerLIDLabel, fTrackLabel, fVertexLabel, fhicl::ParameterSet::get(), and string.

Referenced by BPFCVNAna().

137  {
138  fPixelMapInput = pset.get<std::string>("PixelMapInput");
139  fVertexLabel = pset.get<std::string>("VertexLabel");
140  fProngModLabel = pset.get<std::string>("ProngModLabel");
141  fProng3DLabel = pset.get<std::string>("Prong3DLabel");
142  fProng2DLabel = pset.get<std::string>("Prong2DLabel");
143  fCVNLabel = pset.get<std::string>("CVNLabel");
144  fCVNSliceLabel = pset.get<std::string>("CVNSliceLabel");
145  fFitSumLabel = pset.get<std::string>("FitSumLabel");
146  fBPFPidLabel = pset.get<std::string>("BPFPidLabel");
147  fTrackLabel = pset.get<std::string>("TrackLabel");
148  fEnergyModuleLabel = pset.get<std::string>("EnergyModuleLabel");
149  fShowerLabel = pset.get<std::string>("ShowerLabel");
150  fShowerLIDLabel = pset.get<std::string>("ShowerLIDLabel");
151  fPreselectionLabels = pset.get<std::vector<std::string>>("PreselectionLabels");
152  fCosRejLabel = pset.get<std::string>("CosRejLabel");
153  }
std::string fShowerLIDLabel
std::vector< std::string > fPreselectionLabels
std::string fTrackLabel
std::string fPixelMapInput
std::string fCosRejLabel
std::string fProng3DLabel
std::string fEnergyModuleLabel
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::string fVertexLabel
std::string fProng2DLabel
std::string fShowerLabel
std::string fCVNLabel
std::string fFitSumLabel
std::string fCVNSliceLabel
std::string fProngModLabel
std::string fBPFPidLabel
enum BeamMode string
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
static bool bpf::BPFCVNAna::scoreCompare ( const art::Ptr< rb::PID > &  pidA,
const art::Ptr< rb::PID > &  pidB 
)
inlinestaticprivate

Definition at line 113 of file BPFCVNAna_module.cc.

References rb::PID::Value().

Referenced by analyze().

113  {
114  return pidA->Value() > pidB->Value();
115  }
double Value() const
Definition: PID.h:22
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

art::ServiceHandle<cheat::BackTracker> bpf::BPFCVNAna::bt
private

Definition at line 99 of file BPFCVNAna_module.cc.

Referenced by analyze().

std::string bpf::BPFCVNAna::fBPFPidLabel
private

Definition at line 91 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

const art::ProductToken<std::vector<rb::Cluster> > bpf::BPFCVNAna::fClusterToken
private

Definition at line 81 of file BPFCVNAna_module.cc.

Referenced by analyze().

std::string bpf::BPFCVNAna::fCosRejLabel
private

Definition at line 97 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

TTree* bpf::BPFCVNAna::fCVNBPFslice
private

Definition at line 101 of file BPFCVNAna_module.cc.

Referenced by analyze(), and beginJob().

std::string bpf::BPFCVNAna::fCVNLabel
private

Definition at line 88 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string bpf::BPFCVNAna::fCVNSliceLabel
private

Definition at line 93 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string bpf::BPFCVNAna::fEnergyModuleLabel
private

Definition at line 92 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string bpf::BPFCVNAna::fFitSumLabel
private

Definition at line 90 of file BPFCVNAna_module.cc.

Referenced by reconfigure().

SliceSummary* bpf::BPFCVNAna::fInfo
private

Definition at line 102 of file BPFCVNAna_module.cc.

Referenced by analyze(), and beginJob().

std::string bpf::BPFCVNAna::fPixelMapInput
private

Definition at line 84 of file BPFCVNAna_module.cc.

Referenced by reconfigure().

std::vector<std::string> bpf::BPFCVNAna::fPreselectionLabels
private

Definition at line 96 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string bpf::BPFCVNAna::fProng2DLabel
private

Definition at line 87 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string bpf::BPFCVNAna::fProng3DLabel
private

Definition at line 86 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string bpf::BPFCVNAna::fProngModLabel
private

Definition at line 85 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string bpf::BPFCVNAna::fShowerLabel
private

Definition at line 94 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string bpf::BPFCVNAna::fShowerLIDLabel
private

Definition at line 95 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string bpf::BPFCVNAna::fTrackLabel
private

Definition at line 89 of file BPFCVNAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string bpf::BPFCVNAna::fVertexLabel
private

Definition at line 83 of file BPFCVNAna_module.cc.

Referenced by reconfigure().

unsigned int bpf::BPFCVNAna::Nprongs
private

Definition at line 104 of file BPFCVNAna_module.cc.

Referenced by analyze().

unsigned int bpf::BPFCVNAna::Nprongs2D
private

Definition at line 105 of file BPFCVNAna_module.cc.

Referenced by analyze().


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