All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
truth::BackTrackerTruth Class Reference
Inheritance diagram for truth::BackTrackerTruth:
truth::IMCTruthMatching

Public Member Functions

 BackTrackerTruth (fhicl::ParameterSet const &pset)
 Constructor. More...
 
 ~BackTrackerTruth ()
 Destructor. More...
 
void Rebuild (const art::Event &evt) override
 This rebuilds the internal maps, is a noop for this module since the BackTracker is a service and rebuilds its maps at begin run. More...
 
void reconfigure (fhicl::ParameterSet const &pset) override
 
const sim::ParticleList & ParticleList () const override
 Get a reference to the ParticleList. More...
 
const simb::MCParticle * TrackIDToParticle (int const id) const override
 
const simb::MCParticle * TrackIDToMotherParticle (int const id) const override
 
const art::Ptr< simb::MCTruth > & TrackIDToMCTruth (int const id) const override
 
const art::Ptr< simb::MCTruth > & ParticleToMCTruth (const simb::MCParticle *p) const override
 
std::vector< const
simb::MCParticle * > 
MCTruthToParticles (art::Ptr< simb::MCTruth > const &mct) const override
 
const std::vector< art::Ptr
< simb::MCTruth > > & 
MCTruthVector () const override
 
std::vector< sim::TrackIDEHitToTrackID (detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const override
 
std::vector< sim::TrackIDEHitToTrackID (detinfo::DetectorClocksData const &clockData, art::Ptr< recob::Hit > const &hit) const override
 
std::vector< std::vector
< art::Ptr< recob::Hit > > > 
TrackIDsToHits (detinfo::DetectorClocksData const &clockData, std::vector< art::Ptr< recob::Hit >> const &allhits, std::vector< int > const &tkIDs) const override
 
std::vector< sim::TrackIDEHitToEveID (detinfo::DetectorClocksData const &clockData, art::Ptr< recob::Hit > const &hit) const override
 
std::vector< double > HitToXYZ (detinfo::DetectorClocksData const &clockData, art::Ptr< recob::Hit > const &hit) const override
 
std::vector< double > SpacePointToXYZ (detinfo::DetectorClocksData const &, art::Ptr< recob::SpacePoint > const &spt, art::Event const &evt, std::string const &label) const override
 
std::vector< double > SpacePointHitsToXYZ (detinfo::DetectorClocksData const &clockData, art::PtrVector< recob::Hit > const &hits) const override
 
double HitCollectionPurity (detinfo::DetectorClocksData const &clockData, std::set< int > const &trackIDs, std::vector< art::Ptr< recob::Hit > > const &hits) const override
 
double HitCollectionEfficiency (detinfo::DetectorClocksData const &clockData, std::set< int > const &trackIDs, std::vector< art::Ptr< recob::Hit > > const &hits, std::vector< art::Ptr< recob::Hit > > const &allhits, geo::View_t const view) const override
 
double HitChargeCollectionPurity (detinfo::DetectorClocksData const &clockData, std::set< int > const &trackIDs, std::vector< art::Ptr< recob::Hit > > const &hits) const override
 
double HitChargeCollectionEfficiency (detinfo::DetectorClocksData const &clockData, std::set< int > const &trackIDs, std::vector< art::Ptr< recob::Hit > > const &hits, std::vector< art::Ptr< recob::Hit > > const &allhits, geo::View_t const view) const override
 
std::set< int > GetSetOfEveIDs () const override
 
std::set< int > GetSetOfTrackIDs () const override
 
std::set< int > GetSetOfEveIDs (detinfo::DetectorClocksData const &clockData, std::vector< art::Ptr< recob::Hit > > const &hits) const override
 
std::set< int > GetSetOfTrackIDs (detinfo::DetectorClocksData const &clockData, std::vector< art::Ptr< recob::Hit > > const &hits) const override
 
- Public Member Functions inherited from truth::IMCTruthMatching
virtual ~IMCTruthMatching () noexcept=default
 Virtual Destructor. More...
 

Private Attributes

art::InputTag fTrackProducerLabel
 tag for finding the tracks More...
 
const geo::GeometryCorefGeometry
 pointer to Geometry service More...
 

Detailed Description

Definition at line 41 of file BackTrackerTruth_tool.cc.

Constructor & Destructor Documentation

truth::BackTrackerTruth::BackTrackerTruth ( fhicl::ParameterSet const &  pset)
explicit

Constructor.

Parameters
psetConstructor.

Arguments:

pset - Fcl parameters.

Definition at line 171 of file BackTrackerTruth_tool.cc.

172 {
173  fGeometry = lar::providerFrom<geo::Geometry>();
174 
175  reconfigure(pset);
176 
177  // Report.
178  mf::LogInfo("BackTrackerTruth") << "BackTrackerTruth configured\n";
179 }
void reconfigure(fhicl::ParameterSet const &pset) override
const geo::GeometryCore * fGeometry
pointer to Geometry service
truth::BackTrackerTruth::~BackTrackerTruth ( )

Destructor.

Definition at line 183 of file BackTrackerTruth_tool.cc.

184 {}

Member Function Documentation

std::set< int > truth::BackTrackerTruth::GetSetOfEveIDs ( ) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 292 of file BackTrackerTruth_tool.cc.

293 {
294  art::ServiceHandle<cheat::BackTrackerService> backTracker;
295  return backTracker->GetSetOfEveIds();
296 }
std::set< int > truth::BackTrackerTruth::GetSetOfEveIDs ( detinfo::DetectorClocksData const &  clockData,
std::vector< art::Ptr< recob::Hit > > const &  hits 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 306 of file BackTrackerTruth_tool.cc.

308 {
309  art::ServiceHandle<cheat::BackTrackerService> backTracker;
310  return backTracker->GetSetOfEveIds(clockData, hits);
311 }
std::set< int > truth::BackTrackerTruth::GetSetOfTrackIDs ( ) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 299 of file BackTrackerTruth_tool.cc.

300 {
301  art::ServiceHandle<cheat::BackTrackerService> backTracker;
302  return backTracker->GetSetOfTrackIds();
303 }
std::set< int > truth::BackTrackerTruth::GetSetOfTrackIDs ( detinfo::DetectorClocksData const &  clockData,
std::vector< art::Ptr< recob::Hit > > const &  hits 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 314 of file BackTrackerTruth_tool.cc.

316 {
317  art::ServiceHandle<cheat::BackTrackerService> backTracker;
318  return backTracker->GetSetOfTrackIds(clockData, hits);
319 }
double truth::BackTrackerTruth::HitChargeCollectionEfficiency ( detinfo::DetectorClocksData const &  clockData,
std::set< int > const &  trackIDs,
std::vector< art::Ptr< recob::Hit > > const &  hits,
std::vector< art::Ptr< recob::Hit > > const &  allhits,
geo::View_t const  view 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 352 of file BackTrackerTruth_tool.cc.

357 {
358  art::ServiceHandle<cheat::BackTrackerService> backTracker;
359  return backTracker->HitChargeCollectionEfficiency(clockData, trackIDs, hits, allhits, view);
360 }
double truth::BackTrackerTruth::HitChargeCollectionPurity ( detinfo::DetectorClocksData const &  clockData,
std::set< int > const &  trackIDs,
std::vector< art::Ptr< recob::Hit > > const &  hits 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 331 of file BackTrackerTruth_tool.cc.

334 {
335  art::ServiceHandle<cheat::BackTrackerService> backTracker;
336  return backTracker->HitChargeCollectionPurity(clockData, trackIDs, hits);
337 }
double truth::BackTrackerTruth::HitCollectionEfficiency ( detinfo::DetectorClocksData const &  clockData,
std::set< int > const &  trackIDs,
std::vector< art::Ptr< recob::Hit > > const &  hits,
std::vector< art::Ptr< recob::Hit > > const &  allhits,
geo::View_t const  view 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 341 of file BackTrackerTruth_tool.cc.

346 {
347  art::ServiceHandle<cheat::BackTrackerService> backTracker;
348  return backTracker->HitCollectionEfficiency(clockData, trackIDs, hits, allhits, view);
349 }
double truth::BackTrackerTruth::HitCollectionPurity ( detinfo::DetectorClocksData const &  clockData,
std::set< int > const &  trackIDs,
std::vector< art::Ptr< recob::Hit > > const &  hits 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 322 of file BackTrackerTruth_tool.cc.

325 {
326  art::ServiceHandle<cheat::BackTrackerService> backTracker;
327  return backTracker->HitCollectionPurity(clockData, trackIDs, hits);
328 }
std::vector< sim::TrackIDE > truth::BackTrackerTruth::HitToEveID ( detinfo::DetectorClocksData const &  clockData,
art::Ptr< recob::Hit > const &  hit 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 284 of file BackTrackerTruth_tool.cc.

286 {
287  art::ServiceHandle<cheat::BackTrackerService> backTracker;
288  return backTracker->HitToEveTrackIDEs(clockData, hit);
289 }
process_name hit
Definition: cheaterreco.fcl:51
std::vector< sim::TrackIDE > truth::BackTrackerTruth::HitToTrackID ( detinfo::DetectorClocksData const &  clockData,
recob::Hit const &  hit 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 249 of file BackTrackerTruth_tool.cc.

251 {
252  art::ServiceHandle<cheat::BackTrackerService> backTracker;
253  return backTracker->HitToTrackIDEs(clockData, hit);
254 }
process_name hit
Definition: cheaterreco.fcl:51
std::vector< sim::TrackIDE > truth::BackTrackerTruth::HitToTrackID ( detinfo::DetectorClocksData const &  clockData,
art::Ptr< recob::Hit > const &  hit 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 257 of file BackTrackerTruth_tool.cc.

259 {
260  return HitToTrackID(clockData, *hit);
261 }
process_name hit
Definition: cheaterreco.fcl:51
std::vector< sim::TrackIDE > HitToTrackID(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const override
std::vector< double > truth::BackTrackerTruth::HitToXYZ ( detinfo::DetectorClocksData const &  clockData,
art::Ptr< recob::Hit > const &  hit 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 363 of file BackTrackerTruth_tool.cc.

365 {
366  art::ServiceHandle<cheat::BackTrackerService> backTracker;
367  return backTracker->HitToXYZ(clockData, hit);
368 }
process_name hit
Definition: cheaterreco.fcl:51
std::vector< const simb::MCParticle * > truth::BackTrackerTruth::MCTruthToParticles ( art::Ptr< simb::MCTruth > const &  mct) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 235 of file BackTrackerTruth_tool.cc.

236 {
237  art::ServiceHandle<cheat::ParticleInventoryService> partInventory;
238  return partInventory->MCTruthToParticles_Ps(mct);
239 }
const std::vector< art::Ptr< simb::MCTruth > > & truth::BackTrackerTruth::MCTruthVector ( ) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 242 of file BackTrackerTruth_tool.cc.

243 {
244  art::ServiceHandle<cheat::ParticleInventoryService> partInventory;
245  return partInventory->MCTruthVector_Ps();
246 }
const sim::ParticleList & truth::BackTrackerTruth::ParticleList ( ) const
overridevirtual

Get a reference to the ParticleList.

Implements truth::IMCTruthMatching.

Definition at line 199 of file BackTrackerTruth_tool.cc.

200 {
201  art::ServiceHandle<cheat::ParticleInventoryService> partInventory;
202  return partInventory->ParticleList();
203 }
const art::Ptr< simb::MCTruth > & truth::BackTrackerTruth::ParticleToMCTruth ( const simb::MCParticle *  p) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 228 of file BackTrackerTruth_tool.cc.

229 {
230  art::ServiceHandle<cheat::ParticleInventoryService> partInventory;
231  return partInventory->ParticleToMCTruth_P(p);
232 }
pdgs p
Definition: selectors.fcl:22
void truth::BackTrackerTruth::Rebuild ( const art::Event &  evt)
inlineoverridevirtual

This rebuilds the internal maps, is a noop for this module since the BackTracker is a service and rebuilds its maps at begin run.

Implements truth::IMCTruthMatching.

Definition at line 60 of file BackTrackerTruth_tool.cc.

60 {};
void truth::BackTrackerTruth::reconfigure ( fhicl::ParameterSet const &  pset)
overridevirtual

Reconfigure method.

Arguments:

pset - Fcl parameter set.

Implements truth::IMCTruthMatching.

Definition at line 193 of file BackTrackerTruth_tool.cc.

194 {
195  fTrackProducerLabel = pset.get<art::InputTag>("TrackProducerLabel", "");
196 }
art::InputTag fTrackProducerLabel
tag for finding the tracks
std::vector< double > truth::BackTrackerTruth::SpacePointHitsToXYZ ( detinfo::DetectorClocksData const &  clockData,
art::PtrVector< recob::Hit > const &  hits 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 385 of file BackTrackerTruth_tool.cc.

387 {
388  std::vector<art::Ptr<recob::Hit>> hitVec;
389  for(size_t idx=0; idx<hits.size(); idx++) hitVec.push_back(hits.at(idx));
390 
391  art::ServiceHandle<cheat::BackTrackerService> backTracker;
392  return backTracker->SpacePointHitsToWeightedXYZ(clockData, hitVec);
393 }
std::vector< double > truth::BackTrackerTruth::SpacePointToXYZ ( detinfo::DetectorClocksData const &  ,
art::Ptr< recob::SpacePoint > const &  spt,
art::Event const &  evt,
std::string const &  label 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 371 of file BackTrackerTruth_tool.cc.

375 {
376  std::vector<double> hitVec = {0.,0.,0.};
377 
378  art::ServiceHandle<cheat::BackTrackerService> backTracker;
379  //backTracker->SpacePointHitsToWeightedXYZ(spt, evt, label);
380 
381  return hitVec;
382 }
std::vector< std::vector< art::Ptr< recob::Hit > > > truth::BackTrackerTruth::TrackIDsToHits ( detinfo::DetectorClocksData const &  clockData,
std::vector< art::Ptr< recob::Hit >> const &  allhits,
std::vector< int > const &  tkIDs 
) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 264 of file BackTrackerTruth_tool.cc.

267 {
268  std::vector<std::vector<art::Ptr<recob::Hit>>> tkIDsToHitsVec;
269  art::ServiceHandle<cheat::BackTrackerService> backTracker;
270 
271  for(const auto& tkID : tkIDs)
272  {
273  std::vector<art::Ptr<recob::Hit>> hitVec = backTracker->TrackIdToHits_Ps(clockData, tkID, allhits);
274  tkIDsToHitsVec.push_back(hitVec);
275  }
276 
277  return tkIDsToHitsVec;
278 }
const art::Ptr< simb::MCTruth > & truth::BackTrackerTruth::TrackIDToMCTruth ( int const  id) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 221 of file BackTrackerTruth_tool.cc.

222 {
223  art::ServiceHandle<cheat::ParticleInventoryService> partInventory;
224  return partInventory->TrackIdToMCTruth_P(id);
225 }
const simb::MCParticle * truth::BackTrackerTruth::TrackIDToMotherParticle ( int const  id) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 214 of file BackTrackerTruth_tool.cc.

215 {
216  art::ServiceHandle<cheat::ParticleInventoryService> partInventory;
217  return partInventory->TrackIdToMotherParticle_P(id);
218 }
const simb::MCParticle * truth::BackTrackerTruth::TrackIDToParticle ( int const  id) const
overridevirtual

Implements truth::IMCTruthMatching.

Definition at line 207 of file BackTrackerTruth_tool.cc.

208 {
209  art::ServiceHandle<cheat::ParticleInventoryService> partInventory;
210  return partInventory->TrackIdToParticle_P(id);
211 }

Member Data Documentation

const geo::GeometryCore* truth::BackTrackerTruth::fGeometry
private

pointer to Geometry service

Definition at line 161 of file BackTrackerTruth_tool.cc.

art::InputTag truth::BackTrackerTruth::fTrackProducerLabel
private

tag for finding the tracks

Definition at line 158 of file BackTrackerTruth_tool.cc.


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