56 std::map<int, const simb::MCParticle*> trueParticles =
58 std::map<int, std::vector<int>> showersMothers =
68 std::vector<art::Ptr<recob::Cluster>> clusters = fmc.at(pfparticle.
key());
73 std::vector<art::Ptr<recob::Hit>> showerHits;
74 for (
auto const&
cluster : clusters) {
77 std::vector<art::Ptr<recob::Hit>> hits = fmhc.at(
cluster.key());
78 showerHits.insert(showerHits.end(), hits.begin(), hits.end());
82 auto const clockData =
85 std::pair<int, double> ShowerTrackInfo =
87 clockData, showersMothers, showerHits, 2);
89 if (ShowerTrackInfo.first == -99999) {
90 mf::LogError(
"ShowerStartPositionCheater") <<
"True Shower Not Found";
96 mf::LogError(
"ShowerDirectionCheater") <<
"True shower not found, returning";
102 TVector3 trueStartPos = {-999, -999, -999};
106 double initialEnergy = trueParticle->
E();
108 for (
unsigned int trajPoint = 0; trajPoint < TrajPoints; trajPoint++) {
109 if (trueParticle->
E(trajPoint) < initialEnergy) {
110 trueStartPos = trueParticle->
Position(trajPoint).Vect();
116 trueStartPos = trueParticle->
Position().Vect();
119 TVector3 trueStartPosErr = {-999, -999, -999};
double E(const int i=0) const
unsigned int NumberTrajectoryPoints() const
const TLorentzVector & Position(const int i=0) const
std::map< int, const simb::MCParticle * > GetTrueParticleMap() const
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
Cluster finding and building.
key_type key() const noexcept
std::map< int, std::vector< int > > GetTrueChain(std::map< int, const simb::MCParticle * > &trueParticles) const
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
std::pair< int, double > TrueParticleIDFromTrueChain(detinfo::DetectorClocksData const &clockData, std::map< int, std::vector< int >> const &ShowersMothers, std::vector< art::Ptr< recob::Hit >> const &hits, int planeid) const