All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FillTrue.h
Go to the documentation of this file.
1 
2 #ifndef CAF_FILLTRUE_H
3 #define CAF_FILLTRUE_H
4 
5 #include "art/Framework/Services/Registry/ServiceHandle.h"
6 
7 #include "TRandom.h"
8 #include "TDatabasePDG.h"
9 
10 // LArSoft includes
17 
18 #include "nusimdata/SimulationBase/GTruth.h"
19 #include "nusimdata/SimulationBase/MCFlux.h"
20 #include "nusimdata/SimulationBase/MCNeutrino.h"
21 #include "nusimdata/SimulationBase/MCParticle.h"
22 #include "nusimdata/SimulationBase/MCTruth.h"
27 
29 
37 
38 namespace caf
39 {
40  struct HitsEnergy {
41  int nHits;
42  float totE;
43  };
44 
45  // Helpers
47  const TVector3 p0,
48  const TVector3 p1);
49 
50  caf::g4_process_ GetG4ProcessID(const std::string &name);
51 
53  caf::SRGlobal& srglobal,
54  std::map<std::string, unsigned int>& weightPSetIndex);
55 
56  void FillSliceTruth(const std::vector<art::Ptr<recob::Hit>> &hits,
57  const std::vector<art::Ptr<simb::MCTruth>> &neutrinos,
58  const caf::SRTruthBranch &srmc,
59  const cheat::ParticleInventoryService &inventory_service,
60  const detinfo::DetectorClocksData &clockData,
61  caf::SRSlice &srslice,
62  bool allowEmpty = false);
63 
64  void FillSliceFakeReco(const std::vector<art::Ptr<recob::Hit>> &hits,
65  const std::vector<art::Ptr<simb::MCTruth>> &neutrinos,
66  const caf::SRTruthBranch &srmc,
67  const cheat::ParticleInventoryService &inventory_service,
68  const detinfo::DetectorClocksData &clockData,
69  caf::SRSlice &srslice,
70  const std::vector<caf::SRTrueParticle> &srparticles,
71  const std::vector<art::Ptr<sim::MCTrack>> &mctracks,
72  const std::vector<geo::BoxBoundedGeo> &volumes, TRandom &rand);
73 
74  void FillTrueG4Particle(const simb::MCParticle &particle,
75  const std::vector<geo::BoxBoundedGeo> &active_volumes,
76  const std::vector<std::vector<geo::BoxBoundedGeo>> &tpc_volumes,
77  const std::map<int, std::vector<std::pair<geo::WireID, const sim::IDE *>>> &id_to_ide_map,
78  const std::map<int, std::vector<art::Ptr<recob::Hit>>> &id_to_truehit_map,
79  const cheat::BackTrackerService &backtracker,
80  const cheat::ParticleInventoryService &inventory_service,
81  const std::vector<art::Ptr<simb::MCTruth>> &neutrinos,
82  caf::SRTrueParticle &srparticle);
83 
85  const std::vector<geo::BoxBoundedGeo> &active_volumes,
86  caf::SRMeVPrtl &srtruth);
87 
88  void FillTrueNeutrino(const art::Ptr<simb::MCTruth> mctruth,
89  const simb::MCFlux &mcflux,
90  const simb::GTruth& gtruth,
91  const std::vector<caf::SRTrueParticle> &srparticles,
92  const std::map<int, std::vector<art::Ptr<recob::Hit>>> &id_to_truehit_map,
93  caf::SRTrueInteraction &srneutrino, size_t i,
94  const std::vector<geo::BoxBoundedGeo> &active_volumes);
95 
98  const std::map<std::string, unsigned int>& weightPSetIndex);
99 
100  void FillTrackTruth(const std::vector<art::Ptr<recob::Hit>> &hits,
101  const std::map<int, caf::HitsEnergy> &id_hits_map,
102  const std::vector<caf::SRTrueParticle> &particles,
103  const detinfo::DetectorClocksData &clockData,
104  caf::SRTrack& srtrack,
105  bool allowEmpty = false);
106 
107  void FillStubTruth(const std::vector<art::Ptr<recob::Hit>> &hits,
108  const std::map<int, caf::HitsEnergy> &id_hits_map,
109  const std::vector<caf::SRTrueParticle> &particles,
110  const detinfo::DetectorClocksData &clockData,
111  caf::SRStub& srstub,
112  bool allowEmpty = false);
113 
114  void FillShowerTruth(const std::vector<art::Ptr<recob::Hit>> &hits,
115  const std::map<int, caf::HitsEnergy> &id_hits_map,
116  const std::vector<caf::SRTrueParticle> &particles,
117  const detinfo::DetectorClocksData &clockData,
118  caf::SRShower& srshower,
119  bool allowEmpty = false);
120 
121  void FillFakeReco(const std::vector<art::Ptr<simb::MCTruth>> &mctruths,
122  const std::vector<caf::SRTrueParticle> &srparticles,
123  const std::vector<art::Ptr<sim::MCTrack>> &mctracks,
124  const std::vector<geo::BoxBoundedGeo> &volumes,
125  TRandom &rand,
126  std::vector<caf::SRFakeReco> &srfakereco);
127 
128  std::map<int, std::vector<std::pair<geo::WireID, const sim::IDE*>>> PrepSimChannels(const std::vector<art::Ptr<sim::SimChannel>> &simchannels, const geo::GeometryCore &geo);
129  std::map<int, std::vector<art::Ptr<recob::Hit>>> PrepTrueHits(const std::vector<art::Ptr<recob::Hit>> &allHits,
130  const detinfo::DetectorClocksData &clockData, const cheat::BackTrackerService &backtracker);
131  std::map<int, caf::HitsEnergy> SetupIDHitEnergyMap(const std::vector<art::Ptr<recob::Hit>> &allHits, const detinfo::DetectorClocksData &clockData,
132  const cheat::BackTrackerService &backtracker);
133 
134 }
135 
136 #endif
std::map< int, std::vector< std::pair< geo::WireID, const sim::IDE * > > > PrepSimChannels(const std::vector< art::Ptr< sim::SimChannel >> &simchannels, const geo::GeometryCore &geo)
Definition: FillTrue.cxx:685
std::map< std::string, std::vector< float > > EventWeightMap
Container for event-level weights.
void FillTrueNeutrino(const art::Ptr< simb::MCTruth > mctruth, const simb::MCFlux &mcflux, const simb::GTruth &gtruth, const std::vector< caf::SRTrueParticle > &srparticles, const std::map< int, std::vector< art::Ptr< recob::Hit >>> &id_to_truehit_map, caf::SRTrueInteraction &srneutrino, size_t i, const std::vector< geo::BoxBoundedGeo > &active_volumes)
Definition: FillTrue.cxx:258
void FillStubTruth(const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &id_hits_map, const std::vector< caf::SRTrueParticle > &particles, const detinfo::DetectorClocksData &clockData, caf::SRStub &srstub, bool allowEmpty)
Definition: FillTrue.cxx:147
The SRTrueInteraction is a representation of neutrino interaction information.
Wall_t
Definition: SREnums.h:22
void FillSliceTruth(const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, const caf::SRTruthBranch &srmc, const cheat::ParticleInventoryService &inventory_service, const detinfo::DetectorClocksData &clockData, caf::SRSlice &srslice, bool allowEmpty)
Definition: FillTrue.cxx:160
g4_process_
Which G4 process ?
Definition: SREnums.h:155
std::map< int, caf::HitsEnergy > SetupIDHitEnergyMap(const std::vector< art::Ptr< recob::Hit >> &allHits, const detinfo::DetectorClocksData &clockData, const cheat::BackTrackerService &backtracker)
Definition: FillTrue.cxx:657
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Access the description of detector geometry.
void FillShowerTruth(const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &id_hits_map, const std::vector< caf::SRTrueParticle > &particles, const detinfo::DetectorClocksData &clockData, caf::SRShower &srshower, bool allowEmpty)
Definition: FillTrue.cxx:134
Utilities for matching a recob::Hit or vector of recob::Hit to the ID of the most significantly contr...
caf::g4_process_ GetG4ProcessID(const std::string &name)
Definition: FillTrue.cxx:1094
Container for a set of reweightable parameters.
void FillFakeReco(const std::vector< art::Ptr< simb::MCTruth >> &mctruths, const std::vector< caf::SRTrueParticle > &srparticles, const std::vector< art::Ptr< sim::MCTrack >> &mctracks, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand, std::vector< caf::SRFakeReco > &srfakereco)
Definition: FillTrue.cxx:636
void FillMeVPrtlTruth(const evgen::ldm::MeVPrtlTruth &truth, const std::vector< geo::BoxBoundedGeo > &active_volumes, caf::SRMeVPrtl &srtruth)
Definition: FillTrue.cxx:182
Description of geometry of one entire detector.
Class def header for mctrack data container.
An SRSlice contains overarching information for a slice.
Definition: SRSlice.h:24
Provides a base class aware of world box coordinates.
void FillTrueG4Particle(const simb::MCParticle &particle, const std::vector< geo::BoxBoundedGeo > &active_volumes, const std::vector< std::vector< geo::BoxBoundedGeo >> &tpc_volumes, const std::map< int, std::vector< std::pair< geo::WireID, const sim::IDE * >>> &id_to_ide_map, const std::map< int, std::vector< art::Ptr< recob::Hit >>> &id_to_truehit_map, const cheat::BackTrackerService &backtracker, const cheat::ParticleInventoryService &inventory_service, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, caf::SRTrueParticle &srparticle)
Definition: FillTrue.cxx:434
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33
void FillTrackTruth(const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &id_hits_map, const std::vector< caf::SRTrueParticle > &particles, const detinfo::DetectorClocksData &clockData, caf::SRTrack &srtrack, bool allowEmpty)
Definition: FillTrue.cxx:118
Contains all timing reference information for the detector.
void FillSliceFakeReco(const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, const caf::SRTruthBranch &srmc, const cheat::ParticleInventoryService &inventory_service, const detinfo::DetectorClocksData &clockData, caf::SRSlice &srslice, const std::vector< caf::SRTrueParticle > &srparticles, const std::vector< art::Ptr< sim::MCTrack >> &mctracks, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand)
Definition: FillTrue.cxx:238
std::map< int, std::vector< art::Ptr< recob::Hit > > > PrepTrueHits(const std::vector< art::Ptr< recob::Hit >> &allHits, const detinfo::DetectorClocksData &clockData, const cheat::BackTrackerService &backtracker)
Definition: FillTrue.cxx:674
object containing MC truth information necessary for making RawDigits and doing back tracking ...
Vectors of reconstructed vertices found by various algorithms.
Definition: SRTruthBranch.h:15
Representation of a simb::MCParticle, knows energy, direction,.
then echo fcl name
void FillEventWeight(const sbn::evwgh::EventWeightMap &wgtmap, caf::SRTrueInteraction &srint, const std::map< std::string, unsigned int > &weightPSetIndex)
Definition: FillTrue.cxx:414
void FillSRGlobal(const sbn::evwgh::EventWeightParameterSet &pset, caf::SRGlobal &srglobal, std::map< std::string, unsigned int > &weightPSetIndex)
Definition: FillTrue.cxx:89
physics associatedGroupsWithLeft p1
art framework interface to geometry description
caf::Wall_t GetWallCross(const geo::BoxBoundedGeo &volume, const TVector3 p0, const TVector3 p1)
Definition: FillTrue.cxx:1052