58 pset.
get<
std::string>(
"InitialTrackSpacePointsOutputLabel"))
70 auto const clockData =
76 std::vector<art::Ptr<recob::Cluster>> clusters = fmc.at(pfparticle.
key());
81 std::vector<art::Ptr<recob::Hit>> showerHits;
82 for (
auto const&
cluster : clusters) {
85 std::vector<art::Ptr<recob::Hit>>
hits = fmhc.at(
cluster.key());
86 showerHits.insert(showerHits.end(), hits.begin(), hits.end());
95 std::map<int, const simb::MCParticle*> trueParticles =
97 std::map<int, std::vector<int>> showersMothers =
101 std::pair<int, double> ShowerTrackInfo =
103 clockData, showersMothers, showerHits, 2);
105 if (ShowerTrackInfo.first == -99999) {
106 mf::LogError(
"ShowerStartPosition") <<
"True Shower Not Found";
109 trueParticle = trueParticles[ShowerTrackInfo.first];
114 mf::LogError(
"ShowerDirectionCheater") <<
"True shower not found, returning";
120 mf::LogError(
"ShowerTrackFinderCheater") <<
"Start position not set, returning " << std::endl;
124 mf::LogError(
"ShowerTrackFinderCheater") <<
"Direction not set, returning " << std::endl;
138 if (!fmsph.isValid()) {
140 <<
"Spacepoint and hit association not valid. Stopping.";
143 std::vector<int> trueParticleIdVec;
147 if (trueParticle->
PdgCode() != 22) { trueParticleIdVec.push_back(trueParticle->
TrackId()); }
151 if (nDaughters == 0) {
153 trueParticleIdVec.push_back(-trueParticle->
TrackId());
157 for (
int i = 0; i < nDaughters; i++) {
158 trueParticleIdVec.push_back(trueParticle->
Daughter(i));
163 std::vector<art::Ptr<recob::Hit>> trackHits;
164 std::vector<art::Ptr<recob::SpacePoint>> trackSpacePoints;
167 for (
auto hit : showerHits) {
169 if (std::find(trueParticleIdVec.cbegin(), trueParticleIdVec.cend(), trueHitId) !=
170 trueParticleIdVec.cend()) {
171 trackHits.push_back(
hit);
172 std::vector<art::Ptr<recob::SpacePoint>> sps = fmsph.at(
hit.key());
173 if (sps.size() == 1) { trackSpacePoints.push_back(sps.front()); }
177 if (trackHits.empty() || trackSpacePoints.empty())
179 <<
"Creating intial track with " << trackHits.size() <<
" hits and " 180 << trackSpacePoints.size() <<
" spacepoints" << std::endl;
187 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