58 pset.
get<
std::string>(
"InitialTrackSpacePointsOutputLabel"))
69 auto const clockData =
75 std::vector<art::Ptr<recob::Cluster>> clusters = fmc.at(pfparticle.
key());
80 std::vector<art::Ptr<recob::Hit>> showerHits;
81 for (
auto const&
cluster : clusters) {
84 std::vector<art::Ptr<recob::Hit>>
hits = fmhc.at(
cluster.key());
85 showerHits.insert(showerHits.end(), hits.begin(), hits.end());
94 std::map<int, const simb::MCParticle*> trueParticles =
96 std::map<int, std::vector<int>> showersMothers =
100 std::pair<int, double> ShowerTrackInfo =
102 clockData, showersMothers, showerHits, 2);
104 if (ShowerTrackInfo.first == -99999) {
105 mf::LogError(
"ShowerStartPosition") <<
"True Shower Not Found";
108 trueParticle = trueParticles[ShowerTrackInfo.first];
113 mf::LogError(
"ShowerDirectionCheater") <<
"True shower not found, returning";
119 mf::LogError(
"ShowerTrackFinderCheater") <<
"Start position not set, returning " << std::endl;
123 mf::LogError(
"ShowerTrackFinderCheater") <<
"Direction not set, returning " << std::endl;
137 if (!fmsph.isValid()) {
139 <<
"Spacepoint and hit association not valid. Stopping.";
142 std::vector<int> trueParticleIdVec;
146 if (trueParticle->
PdgCode() != 22) { trueParticleIdVec.push_back(trueParticle->
TrackId()); }
150 if (nDaughters == 0) {
152 trueParticleIdVec.push_back(-trueParticle->
TrackId());
156 for (
int i = 0; i < nDaughters; i++) {
157 trueParticleIdVec.push_back(trueParticle->
Daughter(i));
162 std::vector<art::Ptr<recob::Hit>> trackHits;
163 std::vector<art::Ptr<recob::SpacePoint>> trackSpacePoints;
166 for (
auto hit : showerHits) {
168 if (std::find(trueParticleIdVec.cbegin(), trueParticleIdVec.cend(), trueHitId) !=
169 trueParticleIdVec.cend()) {
170 trackHits.push_back(
hit);
171 std::vector<art::Ptr<recob::SpacePoint>> sps = fmsph.at(
hit.key());
172 if (sps.size() == 1) { trackSpacePoints.push_back(sps.front()); }
176 if (trackHits.empty() || trackSpacePoints.empty())
178 <<
"Creating intial track with " << trackHits.size() <<
" hits and " 179 << trackSpacePoints.size() <<
" spacepoints" << std::endl;
186 clockData, trueParticle, Event, ShowerEleHolder, pfparticle);
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
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.
int NumberDaughters() const
int Daughter(const int i) const
key_type key() const noexcept
std::map< int, std::vector< int > > GetTrueChain(std::map< int, const simb::MCParticle * > &trueParticles) const
bool CheckElement(const std::string &Name) const
void CheatDebugEVD(detinfo::DetectorClocksData const &clockData, const simb::MCParticle *trueParticle, art::Event const &Event, reco::shower::ShowerElementHolder &ShowerEleHolder, const art::Ptr< recob::PFParticle > &pfparticle) const
int GetElement(const std::string &Name, T &Element) const
Declaration of cluster object.
int TrueParticleID(detinfo::DetectorClocksData const &clockData, const art::Ptr< recob::Hit > &hit) const
Detector simulation of raw signals on wires.
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
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
cet::coded_exception< error, detail::translate > exception