Public Member Functions | Private Attributes | List of all members
t0::MCTruthT0Matching Class Reference
Inheritance diagram for t0::MCTruthT0Matching:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 MCTruthT0Matching (fhicl::ParameterSet const &p)
 
 MCTruthT0Matching (MCTruthT0Matching const &)=delete
 
 MCTruthT0Matching (MCTruthT0Matching &&)=delete
 
MCTruthT0Matchingoperator= (MCTruthT0Matching const &)=delete
 
MCTruthT0Matchingoperator= (MCTruthT0Matching &&)=delete
 
void produce (art::Event &e) override
 
void beginJob () override
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Attributes

art::InputTag fTrackModuleLabel
 
art::InputTag fShowerModuleLabel
 
art::InputTag fPFParticleModuleLabel
 
bool fMakeT0Assns
 
bool fMakePFParticleAssns
 
art::InputTag fHitModuleLabel
 
bool fMakeHitAssns
 
bool fOverrideRealData
 
TTree * fTree
 
int TrackID = 0
 
int TrueTrackID = 0
 
int TrueTriggerType = 0
 
double TrueTrackT0 = 0
 
int ShowerID = 0
 
int ShowerMatchID = 0
 
int ShowerTriggerType = 0
 
double ShowerT0 = 0
 

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 81 of file MCTruthT0Matching_module.cc.

Constructor & Destructor Documentation

t0::MCTruthT0Matching::MCTruthT0Matching ( fhicl::ParameterSet const &  p)
explicit

Definition at line 125 of file MCTruthT0Matching_module.cc.

125  : EDProducer{p}
126 {
127  // Call appropriate produces<>() functions here.
128  fTrackModuleLabel = (p.get<art::InputTag>("TrackModuleLabel"));
129  fShowerModuleLabel = (p.get<art::InputTag>("ShowerModuleLabel"));
130  fPFParticleModuleLabel = (p.get<art::InputTag>("PFParticleModuleLabel", "pandoraNu"));
131  fMakeT0Assns = (p.get<bool>("makeT0Assns", true));
132  fMakePFParticleAssns = (p.get<bool>("makePFParticleAssns", false));
133 
134  fMakeHitAssns = p.get<bool>("makeHitAssns", true);
135  if (fMakeHitAssns) fHitModuleLabel = p.get<art::InputTag>("HitModuleLabel");
136  fOverrideRealData = p.get<bool>("OverrideRealData", false);
137 
138  if (
139  fMakeT0Assns) { // T0 assns are deprecated - this allows one to use deprecated funcionality. Added 2017-08-15. Should not be kept around forever
140  std::cout << "WARNING - You are using deprecated functionality\n";
141  std::cout << "MCTruthT0Matching T0 assns will be removed soon\n";
142  std::cout << "set your fcl parameter makeT0Assns to false and use MCParticle direct "
143  "associations instead"
144  << std::endl;
145  produces<std::vector<anab::T0>>();
146  produces<art::Assns<recob::Track, anab::T0>>();
147  produces<art::Assns<recob::Shower, anab::T0>>();
148  if (fMakePFParticleAssns) {
149  produces<art::Assns<recob::PFParticle, anab::T0>>();
150  } // only do PFParticles if desired by the user
151  }
152 
153  produces<art::Assns<recob::Track, simb::MCParticle, anab::BackTrackerMatchingData>>();
154  produces<art::Assns<recob::Shower, simb::MCParticle, anab::BackTrackerMatchingData>>();
155  if (fMakePFParticleAssns) { // only do PFParticles if desired by the user
156  produces<art::Assns<recob::PFParticle, simb::MCParticle, anab::BackTrackerMatchingData>>();
157  }
158 
159  if (fMakeHitAssns)
160  produces<art::Assns<recob::Hit, simb::MCParticle, anab::BackTrackerHitMatchingData>>();
161 }
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
p
Definition: test.py:223
QTextStream & endl(QTextStream &s)
t0::MCTruthT0Matching::MCTruthT0Matching ( MCTruthT0Matching const &  )
delete
t0::MCTruthT0Matching::MCTruthT0Matching ( MCTruthT0Matching &&  )
delete

Member Function Documentation

void t0::MCTruthT0Matching::beginJob ( )
overridevirtual

Reimplemented from art::EDProducer.

Definition at line 164 of file MCTruthT0Matching_module.cc.

165 {
166  // Implementation of optional member function here.
168  fTree = tfs->make<TTree>("MCTruthT0Matching", "MCTruthT0");
169  fTree->Branch("TrueTrackT0", &TrueTrackT0, "TrueTrackT0/D");
170  fTree->Branch("TrueTrackID", &TrueTrackID, "TrueTrackID/D");
171 }
MCTruthT0Matching& t0::MCTruthT0Matching::operator= ( MCTruthT0Matching const &  )
delete
MCTruthT0Matching& t0::MCTruthT0Matching::operator= ( MCTruthT0Matching &&  )
delete
void t0::MCTruthT0Matching::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 174 of file MCTruthT0Matching_module.cc.

175 {
176  if (evt.isRealData() && !fOverrideRealData) return;
177 
178  // Access art services...
182  auto const clockData =
184 
185  //TrackList handle
186  art::Handle<std::vector<recob::Track>> trackListHandle;
187  std::vector<art::Ptr<recob::Track>> tracklist;
188  if (evt.getByLabel(fTrackModuleLabel, trackListHandle))
189  art::fill_ptr_vector(tracklist, trackListHandle);
190 
191  //ShowerList handle
192  art::Handle<std::vector<recob::Shower>> showerListHandle;
193  std::vector<art::Ptr<recob::Shower>> showerlist;
194  if (evt.getByLabel(fShowerModuleLabel, showerListHandle))
195  art::fill_ptr_vector(showerlist, showerListHandle);
196 
197  //PFParticleList handle
198  art::Handle<std::vector<recob::PFParticle>> pfparticleListHandle;
199  std::vector<art::Ptr<recob::PFParticle>> pfparticlelist;
200  if (evt.getByLabel(fPFParticleModuleLabel, pfparticleListHandle))
201  art::fill_ptr_vector(pfparticlelist, pfparticleListHandle);
202 
203  auto mcpartHandle = evt.getValidHandle<std::vector<simb::MCParticle>>("largeant");
204  // simb::MCParticle const *firstParticle = &mcpartHandle->front();
205  // Create anab::T0 objects and make association with recob::Track, recob::Shower, and recob::PFParticle objects
206  std::unique_ptr<std::vector<anab::T0>> T0col(new std::vector<anab::T0>);
207  // if (fMakeT0Assns){ // T0 assns are deprecated - this allows one to use deprecated funcionality. Added 2017-08-15. Should not be kept around forever
208  std::unique_ptr<art::Assns<recob::Track, anab::T0>> Trackassn(
210  std::unique_ptr<art::Assns<recob::Shower, anab::T0>> Showerassn(
212  std::unique_ptr<art::Assns<recob::PFParticle, anab::T0>> PFParticleassn(
214 
215  // Create associations directly between MCParticle and either recob::Track, recob::Shower, or recob::PFParticle
216  // These associations contain metadata summarising the quality of the match
217  std::unique_ptr<art::Assns<recob::Track, simb::MCParticle, anab::BackTrackerMatchingData>>
219  std::unique_ptr<art::Assns<recob::Shower, simb::MCParticle, anab::BackTrackerMatchingData>>
220  MCPartShowerassn(
222  std::unique_ptr<art::Assns<recob::PFParticle, simb::MCParticle, anab::BackTrackerMatchingData>>
223  MCPartPFParticleassn(
225  // Association block for the hits<-->MCParticles
226  std::unique_ptr<art::Assns<recob::Hit, simb::MCParticle, anab::BackTrackerHitMatchingData>>
228 
229  double maxe = -1;
230  double tote = 0;
231  // int trkid = -1;
232  int maxtrkid = -1;
233  double maxn = -1;
234  double totn = 0;
235  int maxntrkid = -1;
237 
238  std::unordered_map<int, int> trkid_lookup; //indexed by geant4trkid, delivers MC particle location
239 
240  //if we want to make per-hit assns
241  if (fMakeHitAssns) {
242 
244  evt.getByLabel(fHitModuleLabel, hitListHandle);
245 
246  if (hitListHandle.isValid()) {
247 
248  auto const& hitList(*hitListHandle);
249  auto const& mcpartList(*mcpartHandle);
250  for (size_t i_h = 0; i_h < hitList.size(); ++i_h) {
251  art::Ptr<recob::Hit> hitPtr(hitListHandle, i_h);
252  auto trkide_list = bt_serv->HitToTrackIDEs(clockData, hitPtr);
253  struct TrackIDEinfo {
254  float E;
255  float NumElectrons;
256  };
257  std::map<int, TrackIDEinfo> trkide_collector;
258  maxe = -1;
259  tote = 0;
260  maxtrkid = -1;
261  maxn = -1;
262  totn = 0;
263  maxntrkid = -1;
264  for (auto const& t : trkide_list) {
265  trkide_collector[t.trackID].E += t.energy;
266  tote += t.energy;
267  if (trkide_collector[t.trackID].E > maxe) {
268  maxe = trkide_collector[t.trackID].E;
269  maxtrkid = t.trackID;
270  }
271  trkide_collector[t.trackID].NumElectrons += t.numElectrons;
272  totn += t.numElectrons;
273  if (trkide_collector[t.trackID].NumElectrons > maxn) {
274  maxn = trkide_collector[t.trackID].NumElectrons;
275  maxntrkid = t.trackID;
276  }
277 
278  //if not found, find mc particle...
279  if (trkid_lookup.find(t.trackID) == trkid_lookup.end()) {
280  size_t i_p = 0;
281  while (i_p < mcpartList.size()) {
282  if (mcpartList[i_p].TrackId() == t.trackID) {
283  trkid_lookup[t.trackID] = (int)i_p;
284  break;
285  }
286  ++i_p;
287  }
288  if (i_p == mcpartList.size()) trkid_lookup[t.trackID] = -1;
289  }
290 
291  } //end loop on TrackIDs
292 
293  //now find the mcparticle and loop back through ...
294  for (auto const& t : trkide_collector) {
295  int mcpart_i = trkid_lookup[t.first];
296  if (mcpart_i == -1) continue; //no mcparticle here
297  art::Ptr<simb::MCParticle> mcpartPtr(mcpartHandle, mcpart_i);
298  bthmd.ideFraction = t.second.E / tote;
299  bthmd.isMaxIDE = (t.first == maxtrkid);
300  bthmd.ideNFraction = t.second.NumElectrons / totn;
301  bthmd.isMaxIDEN = (t.first == maxntrkid);
302  MCPartHitassn->addSingle(hitPtr, mcpartPtr, bthmd);
303  }
304 
305  } //end loop on hits
306 
307  } //end if handle valid
308 
309  } //end if make hit/mcpart assns
310 
311  if (trackListHandle.isValid()) {
312  //Access tracks and hits
313  art::FindManyP<recob::Hit> fmtht(trackListHandle, evt, fTrackModuleLabel);
314 
315  size_t NTracks = tracklist.size();
316 
317  // Now to access MCTruth for each track...
318  for (size_t iTrk = 0; iTrk < NTracks; ++iTrk) {
319  TrueTrackT0 = 0;
320  TrackID = 0;
321  TrueTrackID = 0;
323  std::vector<art::Ptr<recob::Hit>> allHits = fmtht.at(iTrk);
324 
325  std::map<int, double> trkide;
326  for (size_t h = 0; h < allHits.size(); ++h) {
327  art::Ptr<recob::Hit> hit = allHits[h];
328  std::vector<sim::IDE> ides;
329  std::vector<sim::TrackIDE> TrackIDs = bt_serv->HitToTrackIDEs(clockData, hit);
330 
331  for (size_t e = 0; e < TrackIDs.size(); ++e) {
332  trkide[TrackIDs[e].trackID] += TrackIDs[e].energy;
333  }
334  }
335  // Work out which IDE despoited the most charge in the hit if there was more than one.
336  maxe = -1;
337  tote = 0;
338  for (std::map<int, double>::iterator ii = trkide.begin(); ii != trkide.end(); ++ii) {
339  tote += ii->second;
340  if ((ii->second) > maxe) {
341  maxe = ii->second;
342  TrackID = ii->first;
343  }
344  }
345  btdata.cleanliness = maxe / tote;
346 
347  // Now have trackID, so get PdG code and T0 etc.
348  const simb::MCParticle* tmpParticle = pi_serv->TrackIdToParticle_P(TrackID);
349  if (!tmpParticle)
350  continue; // Retain this check that the BackTracker can find the right particle
351  // Now, loop through the MCParticle's myself to find the correct match
352  int mcpart_i(-1);
353  for (auto const particle : *mcpartHandle) {
354  mcpart_i++;
355  if (TrackID == particle.TrackId()) { break; }
356  }
357  const simb::MCParticle particle = mcpartHandle.product()->at(mcpart_i);
358  TrueTrackT0 = particle.T();
359  TrueTrackID = particle.TrackId();
360  TrueTriggerType = 2; // Using MCTruth as trigger, so tigger type is 2.
361 
362  T0col->push_back(anab::T0(TrueTrackT0, TrueTriggerType, TrueTrackID, (*T0col).size()));
363  //auto diff = particle - firstParticle;
364  auto diff = mcpart_i; // check I have a sensible value for this counter
365  if (diff >= (int)mcpartHandle->size()) {
366  std::cout << "Error, the backtracker is doing weird things to your pointers!" << std::endl;
367  throw std::exception();
368  }
369 
370  art::Ptr<simb::MCParticle> mcpartPtr(mcpartHandle, mcpart_i);
371  MCPartTrackassn->addSingle(tracklist[iTrk], mcpartPtr, btdata);
372  if (fMakeT0Assns) { util::CreateAssn(*this, evt, *T0col, tracklist[iTrk], *Trackassn); }
373  fTree->Fill();
374 
375  } // Loop over tracks
376  }
377 
378  if (showerListHandle.isValid()) {
379  art::FindManyP<recob::Hit> fmsht(showerListHandle, evt, fShowerModuleLabel);
380  // Now Loop over showers....
381  size_t NShowers = showerlist.size();
382  for (size_t Shower = 0; Shower < NShowers; ++Shower) {
383  ShowerMatchID = 0;
384  ShowerID = 0;
385  ShowerT0 = 0;
386  std::vector<art::Ptr<recob::Hit>> allHits = fmsht.at(Shower);
388 
389  std::map<int, double> showeride;
390  for (size_t h = 0; h < allHits.size(); ++h) {
391  art::Ptr<recob::Hit> hit = allHits[h];
392  std::vector<sim::IDE> ides;
393  std::vector<sim::TrackIDE> TrackIDs = bt_serv->HitToTrackIDEs(clockData, hit);
394 
395  for (size_t e = 0; e < TrackIDs.size(); ++e) {
396  showeride[TrackIDs[e].trackID] += TrackIDs[e].energy;
397  }
398  }
399  // Work out which IDE despoited the most charge in the hit if there was more than one.
400  maxe = -1;
401  tote = 0;
402  for (std::map<int, double>::iterator ii = showeride.begin(); ii != showeride.end(); ++ii) {
403  tote += ii->second;
404  if ((ii->second) > maxe) {
405  maxe = ii->second;
406  ShowerID = ii->first;
407  }
408  }
409  btdata.cleanliness = maxe / tote;
410 
411  // Now have MCParticle trackID corresponding to shower, so get PdG code and T0 etc.
412  const simb::MCParticle* tmpParticle = pi_serv->TrackIdToParticle_P(ShowerID);
413  if (!tmpParticle)
414  continue; // Retain this check that the BackTracker can find the right particle
415  // Now, loop through the MCParticle's myself to find the correct match
416  int mcpart_i(-1);
417  for (auto const particle : *mcpartHandle) {
418  mcpart_i++;
419  if (ShowerID == particle.TrackId()) { break; }
420  }
421  const simb::MCParticle particle = mcpartHandle.product()->at(mcpart_i);
422  ShowerT0 = particle.T();
423  ShowerID = particle.TrackId();
424  ShowerTriggerType = 2; // Using MCTruth as trigger, so tigger type is 2.
425  T0col->push_back(anab::T0(ShowerT0, ShowerTriggerType, ShowerID, (*T0col).size()));
426 
427  auto diff = mcpart_i; // check I have a sensible value for this counter
428  if (diff >= (int)mcpartHandle->size()) {
429  std::cout << "Error, the backtracker is doing weird things to your pointers!" << std::endl;
430  throw std::exception();
431  }
432  art::Ptr<simb::MCParticle> mcpartPtr(mcpartHandle, mcpart_i);
433  if (fMakeT0Assns) { util::CreateAssn(*this, evt, *T0col, showerlist[Shower], *Showerassn); }
434  MCPartShowerassn->addSingle(showerlist[Shower], mcpartPtr, btdata);
435 
436  } // Loop over showers
437  }
438 
439  if (pfparticleListHandle.isValid()) {
440  //Access pfparticles and hits
441  art::FindManyP<recob::Cluster> fmcp(pfparticleListHandle, evt, fPFParticleModuleLabel);
442 
443  size_t NPfparticles = pfparticlelist.size();
444 
445  // Now to access MCTruth for each pfparticle...
446  for (size_t iPfp = 0; iPfp < NPfparticles; ++iPfp) {
447  TrueTrackT0 = 0;
448  TrackID = 0;
449  TrueTrackID = 0;
451 
452  std::vector<art::Ptr<recob::Hit>> allHits;
453  //Get all hits through associated clusters
454  std::vector<art::Ptr<recob::Cluster>> allClusters = fmcp.at(iPfp);
455  art::FindManyP<recob::Hit> fmhcl(allClusters, evt, fPFParticleModuleLabel);
456  for (size_t iclu = 0; iclu < allClusters.size(); ++iclu) {
457  std::vector<art::Ptr<recob::Hit>> hits = fmhcl.at(iclu);
458  allHits.insert(allHits.end(), hits.begin(), hits.end());
459  }
460 
461  std::map<int, double> trkide;
462  for (size_t h = 0; h < allHits.size(); ++h) {
463  art::Ptr<recob::Hit> hit = allHits[h];
464  std::vector<sim::IDE> ides;
465  std::vector<sim::TrackIDE> TrackIDs = bt_serv->HitToTrackIDEs(clockData, hit);
466 
467  for (size_t e = 0; e < TrackIDs.size(); ++e) {
468  trkide[TrackIDs[e].trackID] += TrackIDs[e].energy;
469  }
470  }
471  // Work out which IDE despoited the most charge in the hit if there was more than one.
472  double maxe = -1;
473  double tote = 0;
474  for (std::map<int, double>::iterator ii = trkide.begin(); ii != trkide.end(); ++ii) {
475  tote += ii->second;
476  if ((ii->second) > maxe) {
477  maxe = ii->second;
478  TrackID = ii->first;
479  }
480  }
481  btdata.cleanliness = maxe / tote;
482 
483  // Now have trackID, so get PdG code and T0 etc.
484  const simb::MCParticle* tmpParticle = pi_serv->TrackIdToParticle_P(TrackID);
485  if (!tmpParticle)
486  continue; // Retain this check that the BackTracker can find the right particle
487  // Now, loop through the MCParticle's myself to find the correct match
488  int mcpart_i(-1);
489  for (auto const particle : *mcpartHandle) {
490  mcpart_i++;
491  if (TrackID == particle.TrackId()) { break; }
492  }
493  const simb::MCParticle particle = mcpartHandle.product()->at(mcpart_i);
494  TrueTrackT0 = particle.T();
495  TrueTrackID = particle.TrackId();
496  TrueTriggerType = 2; // Using MCTruth as trigger, so tigger type is 2.
497  //std::cout << "Got particle, PDG = " << particle.PdgCode() << std::endl;
498 
499  //std::cout << "Filling T0col with " << TrueTrackT0 << " " << TrueTriggerType << " " << TrueTrackID << " " << (*T0col).size() << std::endl;
500 
501  T0col->push_back(anab::T0(TrueTrackT0, TrueTriggerType, TrueTrackID, (*T0col).size()));
502  //auto diff = particle - firstParticle;
503  auto diff = mcpart_i; // check I have a sensible value for this counter
504  if (diff >= (int)mcpartHandle->size()) {
505  std::cout << "Error, the backtracker is doing weird things to your pointers!" << std::endl;
506  throw std::exception();
507  }
508  // art::Ptr<simb::MCParticle> mcpartPtr(mcpartHandle, particle - firstParticle);
509  art::Ptr<simb::MCParticle> mcpartPtr(mcpartHandle, mcpart_i);
510  //std::cout << "made MCParticle Ptr" << std::endl;
511  // const std::vertex< std::pair<double, std::string> > cleanlinessCompleteness;
512  // const std::pair<double, double> tmp(0.5, 0.5);
513  // MCPartassn->addSingle(tracklist[iPfp], mcpartPtr, tmp);
514  if (fMakePFParticleAssns) {
515  if (fMakeT0Assns) {
516  util::CreateAssn(*this, evt, *T0col, pfparticlelist[iPfp], *PFParticleassn);
517  }
518  MCPartPFParticleassn->addSingle(pfparticlelist[iPfp], mcpartPtr, btdata);
519  }
520  fTree->Fill();
521  } // Loop over tracks
522  }
523 
524  if (fMakeT0Assns) {
525  evt.put(std::move(T0col));
526  evt.put(std::move(Trackassn));
527  evt.put(std::move(Showerassn));
528  if (fMakePFParticleAssns) { evt.put(std::move(PFParticleassn)); }
529  }
530  evt.put(std::move(MCPartTrackassn));
531  evt.put(std::move(MCPartShowerassn));
532  if (fMakePFParticleAssns) { evt.put(std::move(MCPartPFParticleassn)); }
533  if (fMakeHitAssns) evt.put(std::move(MCPartHitassn));
534 } // Produce
intermediate_table::iterator iterator
std::vector< sim::TrackIDE > HitToTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
std::vector< TrackID > TrackIDs
const simb::MCParticle * TrackIdToParticle_P(int id) const
Definition: T0.h:16
int TrackId() const
Definition: MCParticle.h:210
bool isValid() const noexcept
Definition: Handle.h:191
const double e
def move(depos, offset)
Definition: depos.py:107
double T(const int i=0) const
Definition: MCParticle.h:224
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
Detector simulation of raw signals on wires.
E
Definition: 018_def.c:13
TCEvent evt
Definition: DataStructs.cxx:7
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)

Member Data Documentation

art::InputTag t0::MCTruthT0Matching::fHitModuleLabel
private

Definition at line 107 of file MCTruthT0Matching_module.cc.

bool t0::MCTruthT0Matching::fMakeHitAssns
private

Definition at line 108 of file MCTruthT0Matching_module.cc.

bool t0::MCTruthT0Matching::fMakePFParticleAssns
private

Definition at line 105 of file MCTruthT0Matching_module.cc.

bool t0::MCTruthT0Matching::fMakeT0Assns
private

Definition at line 104 of file MCTruthT0Matching_module.cc.

bool t0::MCTruthT0Matching::fOverrideRealData
private

Definition at line 110 of file MCTruthT0Matching_module.cc.

art::InputTag t0::MCTruthT0Matching::fPFParticleModuleLabel
private

Definition at line 103 of file MCTruthT0Matching_module.cc.

art::InputTag t0::MCTruthT0Matching::fShowerModuleLabel
private

Definition at line 102 of file MCTruthT0Matching_module.cc.

art::InputTag t0::MCTruthT0Matching::fTrackModuleLabel
private

Definition at line 101 of file MCTruthT0Matching_module.cc.

TTree* t0::MCTruthT0Matching::fTree
private

Definition at line 113 of file MCTruthT0Matching_module.cc.

int t0::MCTruthT0Matching::ShowerID = 0
private

Definition at line 119 of file MCTruthT0Matching_module.cc.

int t0::MCTruthT0Matching::ShowerMatchID = 0
private

Definition at line 120 of file MCTruthT0Matching_module.cc.

double t0::MCTruthT0Matching::ShowerT0 = 0
private

Definition at line 122 of file MCTruthT0Matching_module.cc.

int t0::MCTruthT0Matching::ShowerTriggerType = 0
private

Definition at line 121 of file MCTruthT0Matching_module.cc.

int t0::MCTruthT0Matching::TrackID = 0
private

Definition at line 114 of file MCTruthT0Matching_module.cc.

int t0::MCTruthT0Matching::TrueTrackID = 0
private

Definition at line 115 of file MCTruthT0Matching_module.cc.

double t0::MCTruthT0Matching::TrueTrackT0 = 0
private

Definition at line 117 of file MCTruthT0Matching_module.cc.

int t0::MCTruthT0Matching::TrueTriggerType = 0
private

Definition at line 116 of file MCTruthT0Matching_module.cc.


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