LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_pandora::LArPandoraShowerCreation Class Reference
Inheritance diagram for lar_pandora::LArPandoraShowerCreation:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 LArPandoraShowerCreation (fhicl::ParameterSet const &pset)
 
 LArPandoraShowerCreation (LArPandoraShowerCreation const &)=delete
 
 LArPandoraShowerCreation (LArPandoraShowerCreation &&)=delete
 
LArPandoraShowerCreationoperator= (LArPandoraShowerCreation const &)=delete
 
LArPandoraShowerCreationoperator= (LArPandoraShowerCreation &&)=delete
 
void produce (art::Event &evt) override
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > mayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

recob::Shower BuildShower (const lar_content::LArShowerPCA &larShowerPCA, const pandora::CartesianVector &vertexPosition) const
 Build a recob::Shower object. More...
 
recob::PCAxis BuildPCAxis (const lar_content::LArShowerPCA &larShowerPCA) const
 Build a recob::PCAxis object. More...
 

Private Attributes

std::string m_pfParticleLabel
 The pf particle label. More...
 
bool m_useAllParticles
 Build a recob::Track for every recob::PFParticle. More...
 

Detailed Description

Definition at line 27 of file LArPandoraShowerCreation_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

using art::EDProducer::WorkerType = WorkerT<EDProducer>
inherited

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

lar_pandora::LArPandoraShowerCreation::LArPandoraShowerCreation ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 99 of file LArPandoraShowerCreation_module.cc.

99  :
100  m_pfParticleLabel(pset.get<std::string>("PFParticleLabel")),
101  m_useAllParticles(pset.get<bool>("UseAllParticles", false))
102 {
103  produces< std::vector<recob::Shower> >();
104  produces< std::vector<recob::PCAxis> >();
105  produces< art::Assns<recob::PFParticle, recob::Shower> >();
106  produces< art::Assns<recob::PFParticle, recob::PCAxis> >();
107  produces< art::Assns<recob::Shower, recob::Hit> >();
108  produces< art::Assns<recob::Shower, recob::PCAxis> >();
109 }
bool m_useAllParticles
Build a recob::Track for every recob::PFParticle.
std::string m_pfParticleLabel
The pf particle label.
lar_pandora::LArPandoraShowerCreation::LArPandoraShowerCreation ( LArPandoraShowerCreation const &  )
delete
lar_pandora::LArPandoraShowerCreation::LArPandoraShowerCreation ( LArPandoraShowerCreation &&  )
delete

Member Function Documentation

recob::PCAxis lar_pandora::LArPandoraShowerCreation::BuildPCAxis ( const lar_content::LArShowerPCA larShowerPCA) const
private

Build a recob::PCAxis object.

Parameters
larShowerPCAthe lar shower pca parameters extracted from pandora

< SVD Decomposition was successful

< Eigen values from SVD decomposition

< Average position of hits fed to PCA

The three principle axes

< Number of hits in the decomposition, not yet ready

< Average doca of hits used in PCA, not ready yet

< Axis ID, not ready yet

Definition at line 245 of file LArPandoraShowerCreation_module.cc.

References lar_content::LArShowerPCA::GetCentroid(), lar_content::LArShowerPCA::GetEigenValues(), lar_content::LArShowerPCA::GetPrimaryAxis(), lar_content::LArShowerPCA::GetSecondaryAxis(), lar_content::LArShowerPCA::GetTertiaryAxis(), and util::kBogusI.

Referenced by produce().

246 {
247  const pandora::CartesianVector &showerCentroid(larShowerPCA.GetCentroid());
248  const pandora::CartesianVector &showerDirection(larShowerPCA.GetPrimaryAxis());
249  const pandora::CartesianVector &showerSecondaryVector(larShowerPCA.GetSecondaryAxis());
250  const pandora::CartesianVector &showerTertiaryVector(larShowerPCA.GetTertiaryAxis());
251  const pandora::CartesianVector &showerEigenValues(larShowerPCA.GetEigenValues());
252 
253  const bool svdOK(true);
254  const double eigenValues[3] = {showerEigenValues.GetX(), showerEigenValues.GetY(), showerEigenValues.GetZ()};
255  const double avePosition[3] = {showerCentroid.GetX(), showerCentroid.GetY(), showerCentroid.GetZ()};
256 
257  std::vector< std::vector<double> > eigenVecs = {
258  { showerDirection.GetX(), showerDirection.GetY(), showerDirection.GetZ() },
259  { showerSecondaryVector.GetX(), showerSecondaryVector.GetY(), showerSecondaryVector.GetZ() },
260  { showerTertiaryVector.GetX(), showerTertiaryVector.GetY(), showerTertiaryVector.GetZ() }
261  };
262 
263  // TODO
264  const int numHitsUsed(100);
265  const double aveHitDoca(0.);
266  const size_t iD(util::kBogusI);
267 
268  return recob::PCAxis(svdOK, numHitsUsed, eigenValues, eigenVecs, avePosition, aveHitDoca, iD);
269 }
const pandora::CartesianVector & GetCentroid() const
Return centroid.
constexpr int kBogusI
obviously bogus integer value
const pandora::CartesianVector & GetEigenValues() const
Return vector of eigenvalues.
const pandora::CartesianVector & GetSecondaryAxis() const
Return secondary axis.
const pandora::CartesianVector & GetTertiaryAxis() const
Return tertiary axis.
const pandora::CartesianVector & GetPrimaryAxis() const
Return primary axis.
recob::Shower lar_pandora::LArPandoraShowerCreation::BuildShower ( const lar_content::LArShowerPCA larShowerPCA,
const pandora::CartesianVector &  vertexPosition 
) const
private

Build a recob::Shower object.

Parameters
larShowerPCAthe lar shower pca parameters extracted from pandora
vertexPositionthe shower vertex position

Definition at line 221 of file LArPandoraShowerCreation_module.cc.

References f, lar_content::LArShowerPCA::GetAxisLengths(), lar_content::LArShowerPCA::GetPrimaryAxis(), lar_content::LArShowerPCA::GetPrimaryLength(), lar_content::LArShowerPCA::GetSecondaryLength(), and util::kBogusI.

Referenced by produce().

222 {
223  const pandora::CartesianVector &showerLength(larShowerPCA.GetAxisLengths());
224  const pandora::CartesianVector &showerDirection(larShowerPCA.GetPrimaryAxis());
225 
226  const float length(showerLength.GetX());
227  const float openingAngle(larShowerPCA.GetPrimaryLength() > 0.f ? std::atan(larShowerPCA.GetSecondaryLength() / larShowerPCA.GetPrimaryLength()) : 0.f);
228  const TVector3 direction(showerDirection.GetX(), showerDirection.GetY(), showerDirection.GetZ());
229  const TVector3 vertex(vertexPosition.GetX(), vertexPosition.GetY(), vertexPosition.GetZ());
230 
231  // TODO
232  const TVector3 directionErr;
233  const TVector3 vertexErr;
234  const std::vector<double> totalEnergyErr;
235  const std::vector<double> dEdx;
236  const std::vector<double> dEdxErr;
237  const std::vector<double> totalEnergy;
238  const int bestplane(0);
239 
240  return recob::Shower(direction, directionErr, vertex, vertexErr, totalEnergy, totalEnergyErr, dEdx, dEdxErr, bestplane, util::kBogusI, length, openingAngle);
241 }
float GetPrimaryLength() const
Return primary length.
constexpr int kBogusI
obviously bogus integer value
TFile f
Definition: plotHisto.C:6
const pandora::CartesianVector & GetAxisLengths() const
Return vector of lengths.
float GetSecondaryLength() const
Return secondary length.
const pandora::CartesianVector & GetPrimaryAxis() const
Return primary axis.
vertex reconstruction
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 147 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

148 {
149  if (!moduleContext_)
150  return ProductToken<T>::invalid();
151 
152  consumables_[BT].emplace_back(ConsumableType::Product,
153  TypeID{typeid(T)},
154  it.label(),
155  it.instance(),
156  it.process());
157  return ProductToken<T>{it};
158 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 162 of file Consumer.h.

163 {
164  if (!moduleContext_)
165  return;
166 
167  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
168 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 172 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

173 {
174  if (!moduleContext_)
175  return ViewToken<T>::invalid();
176 
177  consumables_[BT].emplace_back(ConsumableType::ViewElement,
178  TypeID{typeid(T)},
179  it.label(),
180  it.instance(),
181  it.process());
182  return ViewToken<T>{it};
183 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

34 {
35  return rng()->createEngine(
36  placeholder_schedule_id(), seed, kind_of_engine_to_make);
37 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

43 {
44  return rng()->createEngine(
45  placeholder_schedule_id(), seed, kind_of_engine_to_make, engine_label);
46 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
CurrentProcessingContext const * art::EDProducer::currentContext ( ) const
protectedinherited

Definition at line 120 of file EDProducer.cc.

References art::EDProducer::current_context_.

121  {
122  return current_context_.get();
123  }
CPC_exempt_ptr current_context_
Definition: EDProducer.h:116
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

Referenced by art::MixFilter< T >::initEngine_().

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References B, and art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
Int_t B
Definition: plot.C:25
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 190 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

191 {
192  if (!moduleContext_)
193  return ProductToken<T>::invalid();
194 
195  consumables_[BT].emplace_back(ConsumableType::Product,
196  TypeID{typeid(T)},
197  it.label(),
198  it.instance(),
199  it.process());
200  return ProductToken<T>{it};
201 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 205 of file Consumer.h.

206 {
207  if (!moduleContext_)
208  return;
209 
210  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
211 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 215 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

216 {
217  if (!moduleContext_)
218  return ViewToken<T>::invalid();
219 
220  consumables_[BT].emplace_back(ConsumableType::ViewElement,
221  TypeID{typeid(T)},
222  it.label(),
223  it.instance(),
224  it.process());
225  return ViewToken<T>{it};
226 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID().

41  {
42  return true;
43  }
LArPandoraShowerCreation& lar_pandora::LArPandoraShowerCreation::operator= ( LArPandoraShowerCreation const &  )
delete
LArPandoraShowerCreation& lar_pandora::LArPandoraShowerCreation::operator= ( LArPandoraShowerCreation &&  )
delete
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

Referenced by art::EDProducer::doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
void lar_pandora::LArPandoraShowerCreation::produce ( art::Event evt)
overridevirtual

Implements art::EDProducer.

Definition at line 113 of file LArPandoraShowerCreation_module.cc.

References BuildPCAxis(), BuildShower(), lar_pandora::LArPandoraHelper::CollectPFParticles(), lar_pandora::LArPandoraHelper::CollectVertices(), util::CreateAssn(), lar_pandora::LArPandoraHelper::GetAssociatedHits(), lar_content::LArPfoHelper::GetPrincipalComponents(), lar_pandora::LArPandoraHelper::IsShower(), m_pfParticleLabel, m_useAllParticles, art::Event::put(), and recob::SpacePoint::XYZ().

114 {
115  std::unique_ptr< std::vector<recob::Shower> > outputShowers( new std::vector<recob::Shower> );
116  std::unique_ptr< std::vector<recob::PCAxis> > outputPCAxes( new std::vector<recob::PCAxis> );
117  std::unique_ptr< art::Assns<recob::PFParticle, recob::Shower> > outputParticlesToShowers( new art::Assns<recob::PFParticle, recob::Shower> );
118  std::unique_ptr< art::Assns<recob::PFParticle, recob::PCAxis> > outputParticlesToPCAxes( new art::Assns<recob::PFParticle, recob::PCAxis> );
119  std::unique_ptr< art::Assns<recob::Shower, recob::Hit> > outputShowersToHits( new art::Assns<recob::Shower, recob::Hit> );
120  std::unique_ptr< art::Assns<recob::Shower, recob::PCAxis> > outputShowersToPCAxes( new art::Assns<recob::Shower, recob::PCAxis> );
121 
122  const art::PtrMaker<recob::Shower> makeShowerPtr(evt, *this);
123  const art::PtrMaker<recob::PCAxis> makePCAxisPtr(evt, *this);
124 
125  // Organise inputs
126  PFParticleVector pfParticleVector, extraPfParticleVector;
127  PFParticlesToSpacePoints pfParticlesToSpacePoints;
128  PFParticlesToClusters pfParticlesToClusters;
129  LArPandoraHelper::CollectPFParticles(evt, m_pfParticleLabel, pfParticleVector, pfParticlesToSpacePoints);
130  LArPandoraHelper::CollectPFParticles(evt, m_pfParticleLabel, extraPfParticleVector, pfParticlesToClusters);
131 
132  VertexVector vertexVector;
133  PFParticlesToVertices pfParticlesToVertices;
134  LArPandoraHelper::CollectVertices(evt, m_pfParticleLabel, vertexVector, pfParticlesToVertices);
135 
136  for (const art::Ptr<recob::PFParticle> pPFParticle : pfParticleVector)
137  {
138  // Select shower-like pfparticles
139  if (!m_useAllParticles && !LArPandoraHelper::IsShower(pPFParticle))
140  continue;
141 
142  // Obtain associated spacepoints
143  PFParticlesToSpacePoints::const_iterator particleToSpacePointIter(pfParticlesToSpacePoints.find(pPFParticle));
144 
145  if (pfParticlesToSpacePoints.end() == particleToSpacePointIter)
146  {
147  mf::LogDebug("LArPandoraShowerCreation") << "No spacepoints associated to particle ";
148  continue;
149  }
150 
151  // Obtain associated clusters
152  PFParticlesToClusters::const_iterator particleToClustersIter(pfParticlesToClusters.find(pPFParticle));
153 
154  if (pfParticlesToClusters.end() == particleToClustersIter)
155  {
156  mf::LogDebug("LArPandoraShowerCreation") << "No clusters associated to particle ";
157  continue;
158  }
159 
160  // Obtain associated vertex
161  PFParticlesToVertices::const_iterator particleToVertexIter(pfParticlesToVertices.find(pPFParticle));
162 
163  if ((pfParticlesToVertices.end() == particleToVertexIter) || (1 != particleToVertexIter->second.size()))
164  {
165  mf::LogDebug("LArPandoraShowerCreation") << "Unexpected number of vertices for particle ";
166  continue;
167  }
168 
169  // Copy information into expected pandora form
170  pandora::CartesianPointVector cartesianPointVector;
171  for (const art::Ptr<recob::SpacePoint> spacePoint : particleToSpacePointIter->second)
172  cartesianPointVector.emplace_back(pandora::CartesianVector(spacePoint->XYZ()[0], spacePoint->XYZ()[1], spacePoint->XYZ()[2]));
173 
174  double vertexXYZ[3] = {0., 0., 0.};
175  particleToVertexIter->second.front()->XYZ(vertexXYZ);
176  const pandora::CartesianVector vertexPosition(vertexXYZ[0], vertexXYZ[1], vertexXYZ[2]);
177 
178  // Call pandora "fast" shower fitter
179  try
180  {
181  // Ensure successful creation of all structures before placing results in output containers
182  const lar_content::LArShowerPCA larShowerPCA(lar_content::LArPfoHelper::GetPrincipalComponents(cartesianPointVector, vertexPosition));
183  const recob::Shower shower(LArPandoraShowerCreation::BuildShower(larShowerPCA, vertexPosition));
184  const recob::PCAxis pcAxis(LArPandoraShowerCreation::BuildPCAxis(larShowerPCA));
185  outputShowers->emplace_back(shower);
186  outputPCAxes->emplace_back(pcAxis);
187  }
188  catch (const pandora::StatusCodeException &)
189  {
190  mf::LogDebug("LArPandoraShowerCreation") << "Unable to extract shower pca";
191  continue;
192  }
193 
194  // Output objects
195  art::Ptr<recob::Shower> pShower(makeShowerPtr(outputShowers->size() - 1));
196  art::Ptr<recob::PCAxis> pPCAxis(makePCAxisPtr(outputPCAxes->size() - 1));
197 
198  HitVector hitsInParticle;
199  LArPandoraHelper::GetAssociatedHits(evt, m_pfParticleLabel, particleToClustersIter->second, hitsInParticle);
200 
201  // Output associations, after output objects are in place
202  util::CreateAssn(*this, evt, pShower, pPFParticle, *(outputParticlesToShowers.get()));
203  util::CreateAssn(*this, evt, pPCAxis, pPFParticle, *(outputParticlesToPCAxes.get()));
204  util::CreateAssn(*this, evt, *(outputShowers.get()), hitsInParticle, *(outputShowersToHits.get()));
205  util::CreateAssn(*this, evt, pPCAxis, pShower, *(outputShowersToPCAxes.get()));
206  }
207 
208  mf::LogDebug("LArPandora") << " Number of new showers: " << outputShowers->size() << std::endl;
209  mf::LogDebug("LArPandora") << " Number of new pcaxes: " << outputPCAxes->size() << std::endl;
210 
211  evt.put(std::move(outputShowers));
212  evt.put(std::move(outputPCAxes));
213  evt.put(std::move(outputParticlesToShowers));
214  evt.put(std::move(outputParticlesToPCAxes));
215  evt.put(std::move(outputShowersToHits));
216  evt.put(std::move(outputShowersToPCAxes));
217 }
static LArShowerPCA GetPrincipalComponents(const pandora::CartesianPointVector &pointVector, const pandora::CartesianVector &vertexPosition)
Perform PCA analysis on a set of 3D points and return results.
recob::PCAxis BuildPCAxis(const lar_content::LArShowerPCA &larShowerPCA) const
Build a recob::PCAxis object.
std::map< art::Ptr< recob::PFParticle >, ClusterVector > PFParticlesToClusters
bool m_useAllParticles
Build a recob::Track for every recob::PFParticle.
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
recob::Shower BuildShower(const lar_content::LArShowerPCA &larShowerPCA, const pandora::CartesianVector &vertexPosition) const
Build a recob::Shower object.
static bool IsShower(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as shower-like.
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
std::string m_pfParticleLabel
The pf particle label.
intermediate_table::const_iterator const_iterator
static void GetAssociatedHits(const art::Event &evt, const std::string &label, const std::vector< art::Ptr< T > > &inputVector, HitVector &associatedHits, const pandora::IntVector *const indexVector=nullptr)
Get all hits associated with input clusters.
static void CollectVertices(const art::Event &evt, const std::string &label, VertexVector &vertexVector, PFParticlesToVertices &particlesToVertices)
Collect the reconstructed PFParticles and associated Vertices from the ART event record.
std::map< art::Ptr< recob::PFParticle >, VertexVector > PFParticlesToVertices
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
const Double32_t * XYZ() const
Definition: SpacePoint.h:65
static void CollectPFParticles(const art::Event &evt, const std::string &label, PFParticleVector &particleVector)
Collect the reconstructed PFParticles from the ART event record.
std::vector< art::Ptr< recob::Hit > > HitVector
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
std::map< art::Ptr< recob::PFParticle >, SpacePointVector > PFParticlesToSpacePoints
LArShowerPCA class.
std::vector< art::Ptr< recob::Vertex > > VertexVector
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Definition at line 125 of file Consumer.cc.

Referenced by art::EDProducer::doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().

126 {
127  if (!moduleContext_)
128  return;
129 
130  // If none of the branches have missing consumes statements, exit early.
131  if (std::all_of(cbegin(missingConsumes_),
132  cend(missingConsumes_),
133  [](auto const& perBranch) { return perBranch.empty(); }))
134  return;
135 
136  constexpr cet::HorizontalRule rule{60};
137  mf::LogPrint log{"MTdiagnostics"};
138  log << '\n'
139  << rule('=') << '\n'
140  << "The following consumes (or mayConsume) statements are missing from\n"
141  << module_context(moduleDescription_) << '\n'
142  << rule('-') << '\n';
143 
144  cet::for_all_with_index(
145  missingConsumes_, [&log](std::size_t const i, auto const& perBranch) {
146  for (auto const& pi : perBranch) {
147  log << " "
148  << assemble_consumes_statement(static_cast<BranchType>(i), pi)
149  << '\n';
150  }
151  });
152  log << rule('=');
153 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

103 {
104  // Early exits if consumes tracking has been disabled or if the
105  // consumed product is an allowed consumable.
106  if (!moduleContext_)
107  return;
108 
109  if (cet::binary_search_all(consumables_[bt], pi))
110  return;
111 
112  if (requireConsumes_) {
114  "Consumer: an error occurred during validation of a "
115  "retrieved product\n\n")
116  << "The following consumes (or mayConsume) statement is missing from\n"
117  << module_context(moduleDescription_) << ":\n\n"
118  << " " << assemble_consumes_statement(bt, pi) << "\n\n";
119  }
120 
121  missingConsumes_[bt].insert(pi);
122 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
bool requireConsumes_
Definition: Consumer.h:137
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139

Member Data Documentation

std::string lar_pandora::LArPandoraShowerCreation::m_pfParticleLabel
private

The pf particle label.

Definition at line 55 of file LArPandoraShowerCreation_module.cc.

Referenced by produce().

bool lar_pandora::LArPandoraShowerCreation::m_useAllParticles
private

Build a recob::Track for every recob::PFParticle.

Definition at line 56 of file LArPandoraShowerCreation_module.cc.

Referenced by produce().


The documentation for this class was generated from the following file: