Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
slid::Recluster Class Reference
Inheritance diagram for slid::Recluster:
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

 Recluster (fhicl::ParameterSet const &pset)
 
 ~Recluster ()
 
void produce (art::Event &evt)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void beginRun (art::Run &run)
 
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< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (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< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (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< TmayConsumeView (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 Attributes

std::string fSliceLabel
 Label of slicer module. More...
 
bool fProngInput
 Lable of prong producing module. More...
 
std::string fProngLabel
 True = Prong input, False = Track input. More...
 
std::string fVertexLabel
 Lable of vertex producing module. More...
 
std::string fProng3DInstLabel
 Label of instance label of 3d prongs. More...
 
std::string fProng2DInstLabel
 Label of instance label of 2d prongs. More...
 
std::string fTrack3DLabel
 Label of 3d tracks. More...
 
std::string fTrack2DLabel
 Label of 2d tracks. More...
 
std::vector< std::stringfFilterLabels
 Labels of filter lists to obey. More...
 
bool fRespectFilter
 Skip slices that failed filter? More...
 
bool fRecluster
 Should shower reclustering be performed? More...
 
bool fDeconvolve
 Should cell-energy deconvolution be performed? More...
 
bool fConsider2D
 Should 2-D prongs be considered for reclustering/deconvolution? More...
 
bool fApplyPEThreshold
 If this parameter is true, cellhits with PE below fPEThreshold will not be reclustered. More...
 
float fMaxPlane
 The extent of the reclustering cylinder, beyond prong stop point. More...
 
float fMIPPlane
 The extent of the MIP cylinder from the prong start point. More...
 
float fMaxRadius
 The radius of the reclustering cylinder, in cell widths. More...
 
float fMIPRadius
 The radius of the MIP cylinder, in cell widths. More...
 
float fPEThreshold
 If a cell PE is less than this value, it will not be added to the shower. More...
 
DeconvolveAlgfDeconvolveAlg
 An object of DeconvolveAlg. More...
 
fhicl::ParameterSet fDeconvolveAlgPSet
 ParameterSet of DecolvolveAlg. More...
 
art::ServiceHandle< geo::GeometryfGeom
 A private handle to geometry service. More...
 

Detailed Description

Definition at line 33 of file Recluster_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

slid::Recluster::Recluster ( fhicl::ParameterSet const &  pset)

Definition at line 81 of file Recluster_module.cc.

References reconfigure().

82  : fDeconvolveAlg(0)
83  , fDeconvolveAlgPSet(pset.get< fhicl::ParameterSet >("DeconvolveAlgPSet") )
84  {
85  this->reconfigure(pset);
86 
87  // Produces a vector of reclustered showers and their
88  // association with slices
89  produces< std::vector <rb::Shower> >();
90  produces< art::Assns <rb::Shower, rb::Cluster> >();
91  produces< art::Assns <rb::Shower, rb::Prong> >();
92 
93  }// End of constructor
fhicl::ParameterSet fDeconvolveAlgPSet
ParameterSet of DecolvolveAlg.
void reconfigure(const fhicl::ParameterSet &pset)
DeconvolveAlg * fDeconvolveAlg
An object of DeconvolveAlg.
slid::Recluster::~Recluster ( )

Definition at line 99 of file Recluster_module.cc.

References fDeconvolveAlg.

100  {
101  if( fDeconvolveAlg )
102  delete fDeconvolveAlg;
103  }
DeconvolveAlg * fDeconvolveAlg
An object of DeconvolveAlg.

Member Function Documentation

void slid::Recluster::beginRun ( art::Run run)
virtual

Reimplemented from art::EDProducer.

Definition at line 137 of file Recluster_module.cc.

References fDeconvolveAlg, and fDeconvolveAlgPSet.

138  {
139  fDeconvolveAlg = new DeconvolveAlg(fDeconvolveAlgPSet);
140  }
fhicl::ParameterSet fDeconvolveAlgPSet
ParameterSet of DecolvolveAlg.
DeconvolveAlg * fDeconvolveAlg
An object of DeconvolveAlg.
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 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

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

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
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 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDProducer::currentContext ( ) const
protectedinherited
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
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_.

Referenced by skim::NueSkimmer::CopyMichelSlice(), and skim::NueSkimmer::CopyMichelTrack().

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 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  }
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 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

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

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
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 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

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

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void slid::Recluster::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 145 of file Recluster_module.cc.

References abs(), rb::Cluster::Add(), rb::Cluster::AllCells(), geo::PlaneGeo::Cell(), rb::Cluster::Cell(), geo::GeometryBase::CellId(), util::CreateAssn(), DEFINE_ART_MODULE(), dir, rb::Prong::Dir(), slid::DeconvolveAlg::DistanceToCore(), rb::Cluster::Exclude(), fApplyPEThreshold, fConsider2D, fDeconvolve, fDeconvolveAlg, fFilterLabels, fGeom, fMaxRadius, fMIPPlane, fMIPRadius, fPEThreshold, fProng2DInstLabel, fProng3DInstLabel, fProngInput, fProngLabel, fRecluster, fRespectFilter, fSliceLabel, fTrack2DLabel, fTrack3DLabel, fVertexLabel, art::DataViewImpl::getByLabel(), geo::GeometryBase::getPlaneID(), slid::DeconvolveAlg::GetWeights(), rb::Vertex::GetX(), rb::Vertex::GetXYZ(), rb::Vertex::GetY(), rb::Vertex::GetZ(), geo::CellGeo::HalfW(), MECModelEnuComparisons::i, makeTrainCVSamples::int, ip, rb::Cluster::Is2D(), rb::IsFiltered(), rb::Cluster::IsNoise(), Mag(), std::max(), rb::Cluster::MaxPlane(), std::min(), rb::Cluster::MinPlane(), nc, rb::Cluster::NCell(), rb::CellHit::PE(), geo::GeometryBase::Plane(), art::Event::put(), rb::Cluster::RemoveHit(), rb::Prong::SetDir(), rb::Cluster::SetID(), rb::Prong::SetStart(), rb::Shower::SetTotalLength(), rb::SortByPlaneAndCell(), febshutoff_auto::start, rb::Prong::Start(), std::swap(), APDHVSetting::temp, and rb::Prong::TotalLength().

146  {
147 
148  std::unique_ptr< std::vector< rb::Shower > >
149  reclustCol( new std::vector< rb::Shower > );
150  std::unique_ptr< art::Assns< rb::Shower, rb::Cluster > >
151  sliceAssassin( new art::Assns< rb::Shower, rb::Cluster > );
152  // TODO: This is strictly temporary. Once validation
153  // is over, we won't need prong-shower association any
154  // longer and shouldn't be produced.
155  std::unique_ptr< art::Assns< rb::Shower, rb::Prong > >
156  prongAssassin( new art::Assns< rb::Shower, rb::Prong > );
157 
158  // grab the slices in this event
160  evt.getByLabel( fSliceLabel, slices );
161 
162  std::vector< rb::Shower > showerVec;
163  // grab the prong-slice associations in this event
165  fmprong3D(slices, evt, art::InputTag(fProngLabel, fProng3DInstLabel));
167  fmprong2D(slices, evt, art::InputTag(fProngLabel, fProng2DInstLabel));
168 
170  fmtrack3D(slices, evt, fTrack3DLabel);
172  fmtrack2D(slices, evt, fTrack2DLabel);
173 
174 
175 
176  // grab the vertex-slice associations in this event
177  art::FindManyP<rb::Vertex> fmvertex(slices, evt, fVertexLabel);
178 
179  // If there are no vertices or no prongs in this event
180  // move on.
181 
182  if( ((fProngInput==true&&fmprong3D.isValid())||(fProngInput==false&&fmtrack3D.isValid())) || fmvertex.isValid() ) {
183 
184  int nSli = slices->size();
185  for(int iSli = 0; iSli < nSli; ++iSli){
186  //if there was nue preselection, skip slice if it failed
187  if(rb::IsFiltered(evt,slices,iSli, fFilterLabels)
188  && fRespectFilter )
189  continue;
190 
191  art::Ptr<rb::Cluster> thisSlice(slices, iSli);
192 
193  // if this slice is noise skip it
194  if( thisSlice->IsNoise())
195  continue;
196 
197 // std::vector<art::Ptr<rb::Prong> > prongs = fmprong3D.at(iSli);
198 
199  std::vector<art::Ptr<rb::Track> > tracks3D;
200  tracks3D.clear();
201  if(fProngInput==false) tracks3D = fmtrack3D.at(iSli);
202 
203 
204  std::vector<art::Ptr<rb::Prong> > prongs;
205  prongs.clear();
206  if(fProngInput==true){//prong input
207  std::vector<art::Ptr<rb::Prong> > prongs3D = fmprong3D.at(iSli);
208  for (unsigned int ip=0; ip<prongs3D.size(); ++ip){
209  prongs.push_back(prongs3D[ip]);
210  }
211  //if instance labels are in use, combine 2d and 3d
212  if ((fProng3DInstLabel != "")&&(fProng2DInstLabel != "")&&fmprong2D.isValid()){
213  std::vector<art::Ptr<rb::Prong> > prongs2D = fmprong2D.at(iSli);
214  for (unsigned int ip=0; ip<prongs2D.size(); ++ip){
215  prongs.push_back(prongs2D[ip]);
216  }
217  }
218  }
219 
220  if(fProngInput==false){// track input, convert tracks into prongs
221  std::vector<art::Ptr<rb::Track> > tracks3D = fmtrack3D.at(iSli);
222  for (unsigned int ip=0; ip<tracks3D.size(); ++ip){
223  prongs.push_back(tracks3D[ip]);
224  }
225  if(fmtrack2D.isValid()){
226  std::vector<art::Ptr<rb::Track> > tracks2D = fmtrack2D.at(iSli);
227  for (unsigned int ip=0; ip<tracks2D.size(); ++ip){
228  prongs.push_back(tracks2D[ip]);
229  }
230  }
231  }
232 
233  int nPro = prongs.size();
234 
235  std::vector< rb::Prong > newProngs;
236  std::vector< int > assProng;
237 
238  std::vector<art::Ptr<rb::Vertex> > vertices = fmvertex.at(iSli);
239  if( vertices.empty() )
240  continue;
241  // Right now we only use fuzzyk for vertices which makes
242  // one vertex per slice. If there comes along another
243  // vertex finder that makes more than one per slice,
244  // the hope is that the 0th one will be the primary vertex.
245  art::Ptr<rb::Vertex> vtx = vertices[0];
246 
247  // Make a list of hits in slice that were not in
248  // any prong. These will be subject to a PE cut
249  // since hits not on prongs are likely to be noise
250 
251  rb::Cluster orphans = *(thisSlice);
252  if( fApplyPEThreshold ){
253  for( int iPro = 0; iPro < nPro; ++iPro){
254  rb::Prong prong = *(prongs[iPro]);
255  if( prong.Is2D() && !fConsider2D)
256  continue;
257  int nc = prong.NCell();
258  for( int ic = 0; ic < nc; ++ic)
259  orphans.RemoveHit( prong.Cell(ic));
260  }
261 
262  for(int io = 0; io < (int)orphans.NCell(); ++io)
263  if( orphans.Cell(io)->PE() > fPEThreshold ){
264  orphans.RemoveHit( io );
265  io = io -1;
266  }
267  }
268  // We should now have a list of below threshold orphan hits
269 
270  for( int iPro = 0; iPro < nPro; ++iPro){
271 
272  rb::Prong thisProng = *(prongs[iPro]);
273  if( thisProng.Is2D() && !fConsider2D )
274  continue;
275 
276  if( fRecluster ){
277 
278  const rb::Cluster showerClust = (rb::Cluster)thisProng;
279 
280  // Get the cluster that is the slice minus this prong
281  rb::Cluster lesserSlice = (showerClust.NCell() < thisSlice->NCell()) ? thisSlice->Exclude( &showerClust ) : rb::Cluster();
282  if( fApplyPEThreshold ){
283  int norphans = orphans.NCell();
284  for(int io = 0; io < norphans; ++io)
285  lesserSlice.RemoveHit( orphans.Cell(io) );
286  }
287 
288  // Get all the hits in this cluster and sort by plane-
289  art::PtrVector<rb::CellHit> sliceHits = lesserSlice.AllCells();
290 
291  rb::SortByPlaneAndCell( sliceHits );
292 
293  // Reclustering is done to grab electron hits that may
294  // have been missed by the prong making algorithm.
295  // To recluster, a series of two collinear cylinders is
296  // defined. The first cylinder captures the MIP behav-
297  // -iour of the electron; the second cylinder captures the
298  // EM shower. Their radii and lengths are set in .fcl file
299 
300 
301  TVector3 dir = thisProng.Dir();
302  TVector3 start = thisProng.Start();
303  TVector3 stop = start + thisProng.TotalLength()*dir;
304  int stopPlane, startPlane, vtxPlane;
305 
306  if( (start - vtx->GetXYZ()).Mag() > (stop - vtx->GetXYZ()).Mag() ){
307  // vertex is closer to the stop point. Reverse
308  // the shower direction.
309  TVector3 temp = start;
310  start = stop;
311  stop = temp;
312  thisProng.SetDir( -1*dir);
313  thisProng.SetStart( start );
314  }
315 
316  startPlane = thisProng.MinPlane();
317  stopPlane = thisProng.MaxPlane();
318 
319 
320  // There is a better way of determining shower start and stop planes
321  // than just using the cluster min and max planes.
322  // And that is to use geo::CellID as follows. However, the following
323  // is being kept commented, to agree with RecoJMShower for now. (2014/07/11)
324 
325  // const geo::CellUniqueId cida = fGeom->CellId( start.X(), start.Y(),
326  // start.Z(), 1, 1, 0, 1 );
327  // if( cida )
328  // startPlane = fGeom->getPlaneID( cida );
329  // else
330  // startPlane = thisProng.MinPlane();
331 
332  // const geo::CellUniqueId cidb = fGeom->CellId( stop.X(), stop.Y(),
333  // stop.Z(), 1, 1, 0, 1 );
334  // if( cidb )
335  // stopPlane = fGeom->getPlaneID( cidb );
336  // else
337  // stopPlane = thisProng.MaxPlane();
338 
339  const geo::CellUniqueId cidv = fGeom->CellId( vtx->GetX(),
340  vtx->GetY(),
341  vtx->GetZ(),
342  1, 1, 0, 1 );
343 
344  if( cidv )
345  vtxPlane = fGeom->getPlaneID( cidv );
346  else
347  vtxPlane = thisProng.MinPlane();
348 
349  if( abs(vtxPlane - startPlane) > abs(vtxPlane-stopPlane))
350  std::swap(startPlane, stopPlane);
351 
352 
353  float cellW = 2*fGeom->Plane(1)->Cell(1)->HalfW();
354 
355  for( auto hit : sliceHits ){
356 
357  int thisPlane = hit->Plane();
358  int diffFromStart = thisPlane - startPlane;
359 
360  if( startPlane > stopPlane ){
361  diffFromStart = -diffFromStart;
362  }
363 
364  if( thisPlane < std::min(startPlane, stopPlane) ||
365  thisPlane > std::max(startPlane, stopPlane) )
366  continue;
367 
368  float distToCore = fDeconvolveAlg->DistanceToCore( hit,
369  thisProng );
370 
371  if( distToCore == 9999 )
372  continue;
373 
374  if( (diffFromStart < fMIPPlane &&
375  distToCore <= fMIPRadius*cellW) ||
376  (diffFromStart >= fMIPPlane &&
377  distToCore <= fMaxRadius*cellW))
378  thisProng.Add( hit );
379 
380  }// end loop over relevant cell hits
381  }// end if recluster
382  newProngs.push_back( thisProng );
383  assProng.push_back( iPro );
384  }// end loop over prongs
385 
386  std::vector< float > totpe;
387  for( int iPro = 0; iPro < nPro; ++iPro){
388  totpe.push_back( prongs[iPro]->TotalPE() );
389  }
390  if( fDeconvolve )
391  fDeconvolveAlg->GetWeights( newProngs, totpe );
392 
393  int nNewShower = newProngs.size();
394 
395  for( int i = 0; i < nNewShower; ++i){
396  rb::Shower newShower(newProngs[i]);
397  newShower.SetID(i + (100*iSli) );
398  newShower.SetTotalLength( newProngs[i].TotalLength() );
399  reclustCol->push_back( newShower );
400  util::CreateAssn( *this, evt, *reclustCol,
401  thisSlice ,*sliceAssassin);
402  util::CreateAssn( *this, evt, *reclustCol,
403  prongs[ assProng[i] ] ,*prongAssassin);
404  }
405 
406  }// end loop over slices
407 
408  }// end if slice-vertex or slice-prong associations are invalid
409 
410 
411  evt.put( std::move(reclustCol));
412  evt.put( std::move(sliceAssassin));
413  evt.put( std::move(prongAssassin));
414  }// End of producer
T max(const caf::Proxy< T > &a, T b)
bool fConsider2D
Should 2-D prongs be considered for reclustering/deconvolution?
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
art::ServiceHandle< geo::Geometry > fGeom
A private handle to geometry service.
bool fRespectFilter
Skip slices that failed filter?
bool fDeconvolve
Should cell-energy deconvolution be performed?
bool fApplyPEThreshold
If this parameter is true, cellhits with PE below fPEThreshold will not be reclustered.
bool Is2D() const
Definition: Cluster.h:96
float DistanceToCore(art::Ptr< rb::CellHit > cHit, rb::Prong &prong)
double GetX() const
Definition: Vertex.h:23
const CellGeo * Cell(int icell) const
Definition: PlaneGeo.h:48
std::string fSliceLabel
Label of slicer module.
double HalfW() const
Definition: CellGeo.cxx:191
A collection of associated CellHits.
Definition: Cluster.h:47
void abs(TH1 *hist)
void RemoveHit(const art::Ptr< rb::CellHit > hit)
Remove hit from current cluster.
Definition: Cluster.cxx:290
TString ip
Definition: loadincs.C:5
double GetY() const
Definition: Vertex.h:24
const PlaneGeo * Plane(unsigned int i) const
rb::Cluster Exclude(const rb::Cluster *excl) const
Create a cluster from this one, but with the hits of excl removed.
Definition: Cluster.cxx:233
virtual TVector3 Start() const
Definition: Prong.h:73
virtual void SetStart(TVector3 start)
Definition: Prong.cxx:75
float fPEThreshold
If a cell PE is less than this value, it will not be added to the shower.
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
Definition: Cluster.cxx:180
double GetZ() const
Definition: Vertex.h:25
virtual void Add(const art::Ptr< rb::CellHit > &cell, double weight=1)
Definition: Cluster.cxx:84
bool fRecluster
Should shower reclustering be performed?
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
std::string fTrack2DLabel
Label of 2d tracks.
virtual double TotalLength() const
Distance along prong to reach last cell hit.
Definition: Prong.cxx:186
TVector3 GetXYZ() const
Definition: Vertex.cxx:45
virtual void SetDir(TVector3 dir)
Definition: Prong.cxx:104
int getPlaneID(const CellUniqueId &id) const
virtual TVector3 Dir() const
Unit vector describing prong direction.
Definition: Prong.h:77
float PE() const
Definition: CellHit.h:42
const CellUniqueId CellId(const double &x, const double &y, const double &z, double dxds=0., double dyds=0., double dzds=1., double step=0.01) const
bool IsFiltered(const art::Event &evt, art::Ptr< T > x, const std::vector< std::string > &labels)
Is this Ptr marked "filtered out"?
Definition: FilterList.h:96
std::string fProngLabel
True = Prong input, False = Track input.
void GetWeights(std::vector< rb::Prong > &prong, const std::vector< float > &totpe)
unsigned int MinPlane(geo::View_t view=geo::kXorY) const
Definition: Cluster.cxx:462
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
unsigned long long int CellUniqueId
Definition: CellUniqueId.h:15
std::string fTrack3DLabel
Label of 3d tracks.
A Cluster with defined start position and direction.
Definition: Prong.h:19
TDirectory * dir
Definition: macro.C:5
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
std::string fProng2DInstLabel
Label of instance label of 2d prongs.
Definition: structs.h:12
A rb::Prong with a length.
Definition: Shower.h:18
float fMIPPlane
The extent of the MIP cylinder from the prong start point.
float Mag() const
std::string fProng3DInstLabel
Label of instance label of 3d prongs.
float fMaxRadius
The radius of the reclustering cylinder, in cell widths.
enum BeamMode nc
unsigned int MaxPlane(geo::View_t view=geo::kXorY) const
Definition: Cluster.cxx:508
float fMIPRadius
The radius of the MIP cylinder, in cell widths.
std::string fVertexLabel
Lable of vertex producing module.
T min(const caf::Proxy< T > &a, T b)
std::vector< std::string > fFilterLabels
Labels of filter lists to obey.
DeconvolveAlg * fDeconvolveAlg
An object of DeconvolveAlg.
void SortByPlaneAndCell(std::vector< art::Ptr< rb::CellHit > > &c)
Definition: CellHit.cxx:155
bool fProngInput
Lable of prong producing module.
void slid::Recluster::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 108 of file Recluster_module.cc.

References fApplyPEThreshold, fConsider2D, fDeconvolve, fFilterLabels, fMaxPlane, fMaxRadius, fMIPPlane, fMIPRadius, fPEThreshold, fProng2DInstLabel, fProng3DInstLabel, fProngInput, fProngLabel, fRecluster, fRespectFilter, fSliceLabel, fTrack2DLabel, fTrack3DLabel, fVertexLabel, fhicl::ParameterSet::get(), and string.

Referenced by Recluster().

109  {
110  fSliceLabel = pset.get< std::string >("SliceLabel");
111  fProngInput = pset.get< bool >("ProngInput");
112  fProngLabel = pset.get< std::string >("ProngLabel");
113  fVertexLabel = pset.get< std::string >("VertexLabel");
114  fProng3DInstLabel = pset.get< std::string >("Prong3DInstLabel");
115  fProng2DInstLabel = pset.get< std::string >("Prong2DInstLabel");
116  fTrack3DLabel = pset.get< std::string >("Track3DLabel");
117  fTrack2DLabel = pset.get< std::string >("Track2DLabel");
118 
119 
120  fMaxPlane = pset.get< float >("MaxPlane");
121  fMIPPlane = pset.get< float >("MIPPlane");
122  fMaxRadius = pset.get< float >("MaxRadius");
123  fMIPRadius = pset.get< float >("MIPRadius");
124  fPEThreshold = pset.get< float >("PEThreshold");
125 
126  fRespectFilter = pset.get< bool >("RespectFilter");
127  fRecluster = pset.get< bool >("Recluster");
128  fDeconvolve = pset.get< bool >("Deconvolve");
129  fConsider2D = pset.get< bool >("Consider2D");
130  fApplyPEThreshold = pset.get< bool >("ApplyPEThreshold");
131  fFilterLabels = pset.get< std::vector<std::string> >("FilterLabels");
132  }
bool fConsider2D
Should 2-D prongs be considered for reclustering/deconvolution?
bool fRespectFilter
Skip slices that failed filter?
bool fDeconvolve
Should cell-energy deconvolution be performed?
bool fApplyPEThreshold
If this parameter is true, cellhits with PE below fPEThreshold will not be reclustered.
std::string fSliceLabel
Label of slicer module.
float fPEThreshold
If a cell PE is less than this value, it will not be added to the shower.
bool fRecluster
Should shower reclustering be performed?
std::string fTrack2DLabel
Label of 2d tracks.
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::string fProngLabel
True = Prong input, False = Track input.
float fMaxPlane
The extent of the reclustering cylinder, beyond prong stop point.
std::string fTrack3DLabel
Label of 3d tracks.
std::string fProng2DInstLabel
Label of instance label of 2d prongs.
float fMIPPlane
The extent of the MIP cylinder from the prong start point.
std::string fProng3DInstLabel
Label of instance label of 3d prongs.
float fMaxRadius
The radius of the reclustering cylinder, in cell widths.
float fMIPRadius
The radius of the MIP cylinder, in cell widths.
std::string fVertexLabel
Lable of vertex producing module.
std::vector< std::string > fFilterLabels
Labels of filter lists to obey.
bool fProngInput
Lable of prong producing module.
enum BeamMode string
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

bool slid::Recluster::fApplyPEThreshold
private

If this parameter is true, cellhits with PE below fPEThreshold will not be reclustered.

Definition at line 61 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

bool slid::Recluster::fConsider2D
private

Should 2-D prongs be considered for reclustering/deconvolution?

Definition at line 60 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

bool slid::Recluster::fDeconvolve
private

Should cell-energy deconvolution be performed?

Definition at line 59 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

DeconvolveAlg* slid::Recluster::fDeconvolveAlg
private

An object of DeconvolveAlg.

Definition at line 70 of file Recluster_module.cc.

Referenced by beginRun(), produce(), and ~Recluster().

fhicl::ParameterSet slid::Recluster::fDeconvolveAlgPSet
private

ParameterSet of DecolvolveAlg.

Definition at line 71 of file Recluster_module.cc.

Referenced by beginRun().

std::vector<std::string> slid::Recluster::fFilterLabels
private

Labels of filter lists to obey.

Definition at line 55 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

art::ServiceHandle<geo::Geometry> slid::Recluster::fGeom
private

A private handle to geometry service.

Definition at line 72 of file Recluster_module.cc.

Referenced by produce().

float slid::Recluster::fMaxPlane
private

The extent of the reclustering cylinder, beyond prong stop point.

Definition at line 62 of file Recluster_module.cc.

Referenced by reconfigure().

float slid::Recluster::fMaxRadius
private

The radius of the reclustering cylinder, in cell widths.

Definition at line 64 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

float slid::Recluster::fMIPPlane
private

The extent of the MIP cylinder from the prong start point.

Definition at line 63 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

float slid::Recluster::fMIPRadius
private

The radius of the MIP cylinder, in cell widths.

Definition at line 65 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

float slid::Recluster::fPEThreshold
private

If a cell PE is less than this value, it will not be added to the shower.

Definition at line 67 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

std::string slid::Recluster::fProng2DInstLabel
private

Label of instance label of 2d prongs.

Definition at line 52 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

std::string slid::Recluster::fProng3DInstLabel
private

Label of instance label of 3d prongs.

Definition at line 51 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

bool slid::Recluster::fProngInput
private

Lable of prong producing module.

Definition at line 48 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

std::string slid::Recluster::fProngLabel
private

True = Prong input, False = Track input.

Definition at line 49 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

bool slid::Recluster::fRecluster
private

Should shower reclustering be performed?

Definition at line 58 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

bool slid::Recluster::fRespectFilter
private

Skip slices that failed filter?

Definition at line 57 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

std::string slid::Recluster::fSliceLabel
private

Label of slicer module.

Definition at line 47 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

std::string slid::Recluster::fTrack2DLabel
private

Label of 2d tracks.

Definition at line 54 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

std::string slid::Recluster::fTrack3DLabel
private

Label of 3d tracks.

Definition at line 53 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().

std::string slid::Recluster::fVertexLabel
private

Lable of vertex producing module.

Definition at line 50 of file Recluster_module.cc.

Referenced by produce(), and reconfigure().


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