209 std::vector<art::Ptr<recob::PFParticle>> pfps;
216 const art::FindManyP<recob::Hit>& fmh =
218 const art::FindManyP<recob::Cluster>& fmcp =
220 const art::FindManyP<recob::SpacePoint>& fmspp =
235 for (
auto const& pfp : pfps) {
241 if (!
fUseAllParticles && pfp->PdgCode() != 11 && pfp->PdgCode() != 22)
continue;
244 const std::vector<art::Ptr<recob::Cluster>> showerClusters = fmcp.at(pfp.key());
245 const std::vector<art::Ptr<recob::SpacePoint>> showerSpacePoints = fmspp.at(pfp.key());
248 if (!showerClusters.size())
continue;
252 <<
"Running on shower: " << shower_iter <<
std::endl;
257 for (
unsigned int i = 0; i <
fShowerTools.size(); i++) {
266 err =
fShowerTools[i]->RunShowerTool(pfp, evt, showerEleHolder, evd_disp_append);
282 <<
"The start position is not set in the element holder. bailing" <<
std::endl;
288 <<
"The direction is not set in the element holder. bailing" <<
std::endl;
294 <<
"The energy is not set in the element holder. bailing" <<
std::endl;
300 <<
"The dEdx is not set in the element holder. bailing" <<
std::endl;
306 <<
"The BestPlane is not set in the element holder. bailing" <<
std::endl;
312 <<
"The length is not set in the element holder. bailing" <<
std::endl;
318 <<
"The opening angle is not set in the element holder. bailing" <<
std::endl;
324 if (!elements_are_set) {
327 <<
"Not all the elements in the property holder which should be set are not. Bailing. " 334 if (!producers_are_set) {
337 <<
"Not all the elements in the property holder which are produced are not set. " 345 TVector3 ShowerStartPosition(-999, -999, -999);
346 TVector3 ShowerDirection(-999, -999, -999);
348 std::vector<double> ShowerdEdx(
fNumPlanes, -999);
350 double ShowerLength(-999);
351 double ShowerOpeningAngle(-999);
353 TVector3 ShowerStartPositionErr(-999, -999, -999);
354 TVector3 ShowerDirectionErr(-999, -999, -999);
355 std::vector<double> ShowerEnergyErr(
fNumPlanes, -999);
356 std::vector<double> ShowerdEdxErr(
fNumPlanes, -999);
378 <<
"Error in LArPandoraModularShowerCreation Module. A Check on a shower property failed " 384 std::cout <<
"Shower Vertex: X:" << ShowerStartPosition.X()
385 <<
" Y: " << ShowerStartPosition.Y() <<
" Z: " << ShowerStartPosition.Z()
387 std::cout <<
"Shower Direction: X:" << ShowerDirection.X() <<
" Y: " << ShowerDirection.Y()
388 <<
" Z: " << ShowerDirection.Z() <<
std::endl;
389 std::cout <<
"Shower dEdx:";
390 for (
unsigned int i = 0; i <
fNumPlanes; i++) {
391 std::cout <<
" Plane " << i <<
": " << ShowerdEdx.at(i);
394 std::cout <<
"Shower Energy:";
395 for (
unsigned int i = 0; i <
fNumPlanes; i++) {
396 std::cout <<
" Plane " << i <<
": " <<
ShowerEnergy.at(i);
399 std::cout <<
"Shower Best Plane: " << BestPlane <<
std::endl;
400 std::cout <<
"Shower Length: " << ShowerLength <<
std::endl;
401 std::cout <<
"Shower Opening Angle: " << ShowerOpeningAngle <<
std::endl;
409 <<
"dEdx vector is wrong size: " << ShowerdEdx.size()
410 <<
" compared to Nplanes: " << fNumPlanes <<
std::endl;
414 <<
"Energy vector is wrong size: " <<
ShowerEnergy.size()
415 <<
" compared to Nplanes: " << fNumPlanes <<
std::endl;
434 this->GetProducedElementPtr<recob::Shower>(
"shower", showerEleHolder);
438 ShowerPtr, pfp,
"pfShowerAssociationsbase");
441 for (
auto const&
cluster : showerClusters) {
444 std::vector<art::Ptr<recob::Hit>> ClusterHits = fmh.at(
cluster.key());
446 ShowerPtr,
cluster,
"clusterAssociationsbase");
449 for (
auto const&
hit : ClusterHits) {
451 ShowerPtr,
hit,
"hitAssociationsbase");
456 for (
auto const& sp : showerSpacePoints) {
458 ShowerPtr, sp,
"spShowerAssociationsbase");
468 assn_err += fShowerTool->AddAssociations(pfp, evt, showerEleHolder);
473 <<
"A association failed and not allowing partial showers. The association will not be " 474 "added to the event " const std::string fShowerOpeningAngleLabel
void cluster(In first, In last, Out result, Pred *pred)
const std::string fShowerEnergyLabel
const std::string fShowerdEdxLabel
reco::shower::ShowerProducedPtrsHolder uniqueproducerPtrs
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
void AddDataProducts(const reco::shower::ShowerElementHolder &selement_holder)
std::string const & moduleLabel() const
const std::string fShowerDirectionLabel
std::vector< std::string > fShowerToolNames
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
const art::InputTag fPFParticleLabel
const bool fAllowPartialShowers
constexpr int kBogusI
obviously bogus integer value
Set of hits with a 2D structure.
const art::FindManyP< T1 > & GetFindManyP(const art::ValidHandle< std::vector< T2 > > &handle, const art::Event &evt, const art::InputTag &moduleTag)
double ShowerEnergy(const ShowerStruct3D &ss3)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
Cluster finding and building.
void MoveAllToEvent(art::Event &evt)
void PrintElements() const
void AddSingle(A &a, B &b, const std::string &Name)
const std::string fShowerStartPositionLabel
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
bool CheckElement(const std::string &Name) const
const std::string fShowerLengthLabel
void SetPtrMakers(art::Event &evt)
int GetElement(const std::string &Name, T &Element) const
void err(const char *fmt,...)
Detector simulation of raw signals on wires.
bool CheckAllProducedElements(reco::shower::ShowerElementHolder &selement_holder) const
const std::string fShowerBestPlaneLabel
void SetShowerNumber(int &shower_iter)
const bool fUseAllParticles
std::vector< std::unique_ptr< ShowerRecoTools::IShowerTool > > fShowerTools
int GetElementAndError(const std::string &Name, T &Element, T2 &ElementErr) const
2D representation of charge deposited in the TDC/wire plane
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
std::string to_string(ModuleType const mt)
bool CheckAllElementTags() const
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
ModuleDescription const & moduleDescription() const