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

 Slicer4D (fhicl::ParameterSet const &pset)
 
virtual ~Slicer4D ()
 
void beginRun (art::Run &run)
 
void produce (art::Event &evt)
 
void endJob ()
 
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

bool GenerateCluster (unsigned int point, int ClID)
 
CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Protected Attributes

std::string fCellHitInput
 Read CellHits from this input. More...
 
bool fDoNotSliceAnything
 If true, one big slice is written out. More...
 
bool fApplyNeighborhoodCleanUp
 scrub loner hits from the slice? More...
 
double fEpsilon
 Minimum causal separation value for neighbors. More...
 
unsigned int fMinPts
 minimum number of casual neighbors for a hit to be in a cluster More...
 
bool fUseLowPEPen
 Add a causal distance penalty for PE (low PE is INCREASES the distance) More...
 
double fPEPen
 PE value for which the low PE penalty will be 1. More...
 
double fDistPen
 Distance (in cm) for which the distance penalty will be 1 (roughly one strong interaction length.) More...
 
double fOpVPlPen
 Allowed plane gap for hits in opposite views for which the distance penalty will be 1. More...
 
unsigned int fMinHitsPerView
 Minimum number of hits per view to make a cluster. More...
 
int fMaxEventHits
 
fhicl::ParameterSet fPSetNDOS
 
fhicl::ParameterSet fPSetND
 
fhicl::ParameterSet fPSetFD
 
fhicl::ParameterSet fPSetTB
 
PointManager fPtMan
 Helper class for the 4D clustering. More...
 

Detailed Description

Definition at line 31 of file Slicer4D_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

slicer::Slicer4D::Slicer4D ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 74 of file Slicer4D_module.cc.

74  :
75  fCellHitInput (pset.get< std::string >("CellHitInput") ),
76  fDoNotSliceAnything(pset.get< bool >("DoNotSliceAnything")),
77  fApplyNeighborhoodCleanUp(pset.get< bool >("ApplyNeighborhoodCleanUp")),
78  fEpsilon (0),
79  fMinPts (0),
80  fUseLowPEPen (0),
81  fPEPen (0),
82  fDistPen (0),
83  fOpVPlPen (0),
84  fMinHitsPerView (0),
85  fMaxEventHits (pset.get< int >("MaxEventHits")),
86  fPSetNDOS (pset.get<fhicl::ParameterSet>("ndos")),
87  fPSetND (pset.get<fhicl::ParameterSet>("nd")),
88  fPSetFD (pset.get<fhicl::ParameterSet>("fd")),
89  fPSetTB (pset.get<fhicl::ParameterSet>("tb"))
90  {
91  produces< std::vector<rb::Cluster> >();
92  }
unsigned int fMinHitsPerView
Minimum number of hits per view to make a cluster.
fhicl::ParameterSet fPSetNDOS
double fDistPen
Distance (in cm) for which the distance penalty will be 1 (roughly one strong interaction length...
fhicl::ParameterSet fPSetTB
double fPEPen
PE value for which the low PE penalty will be 1.
double fEpsilon
Minimum causal separation value for neighbors.
fhicl::ParameterSet fPSetFD
double fOpVPlPen
Allowed plane gap for hits in opposite views for which the distance penalty will be 1...
unsigned int fMinPts
minimum number of casual neighbors for a hit to be in a cluster
std::string fCellHitInput
Read CellHits from this input.
fhicl::ParameterSet fPSetND
bool fDoNotSliceAnything
If true, one big slice is written out.
bool fUseLowPEPen
Add a causal distance penalty for PE (low PE is INCREASES the distance)
bool fApplyNeighborhoodCleanUp
scrub loner hits from the slice?
enum BeamMode string
slicer::Slicer4D::~Slicer4D ( )
virtual

Definition at line 95 of file Slicer4D_module.cc.

96  { }

Member Function Documentation

void slicer::Slicer4D::beginRun ( art::Run run)
virtual

Reimplemented from art::EDProducer.

Definition at line 99 of file Slicer4D_module.cc.

References ana::assert(), geo::GeometryBase::DetId(), fDistPen, fEpsilon, fMinHitsPerView, fMinPts, fOpVPlPen, fPEPen, fPSetFD, fPSetND, fPSetNDOS, fPSetTB, fUseLowPEPen, geom(), fhicl::ParameterSet::get(), novadaq::cnv::kFARDET, novadaq::cnv::kNDOS, novadaq::cnv::kNEARDET, and novadaq::cnv::kTESTBEAM.

100  {
102 
103  fhicl::ParameterSet pset;
104  switch(geom->DetId()){
105  case novadaq::cnv::kNDOS:
106  pset = fPSetNDOS;
107  break;
109  pset = fPSetND;
110  break;
112  pset = fPSetFD;
113  break;
115  pset = fPSetTB;
116  break;
117  default:
118  assert(0 && "Unknown detector");
119  }
120 
121  fEpsilon = pset.get<double >("Epsilon");
122  fMinPts = pset.get<unsigned int>("MinPts");
123  fUseLowPEPen = pset.get<bool >("UseLowPEPen");
124  fPEPen = pset.get<double >("PEPen");
125  fDistPen = pset.get<double >("DistPen");
126  fOpVPlPen = pset.get<double >("OppViewPlanePen");
127  fMinHitsPerView = pset.get<unsigned int>("MinHitsPerView");
128  }
unsigned int fMinHitsPerView
Minimum number of hits per view to make a cluster.
fhicl::ParameterSet fPSetNDOS
double fDistPen
Distance (in cm) for which the distance penalty will be 1 (roughly one strong interaction length...
fhicl::ParameterSet fPSetTB
double fPEPen
PE value for which the low PE penalty will be 1.
double fEpsilon
Minimum causal separation value for neighbors.
Far Detector at Ash River, MN.
Prototype Near Detector on the surface at FNAL.
T get(std::string const &key) const
Definition: ParameterSet.h:231
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
fhicl::ParameterSet fPSetFD
Near Detector in the NuMI cavern.
double fOpVPlPen
Allowed plane gap for hits in opposite views for which the distance penalty will be 1...
void geom(int which=0)
Definition: geom.C:163
unsigned int fMinPts
minimum number of casual neighbors for a hit to be in a cluster
assert(nhit_max >=nhit_nbins)
fhicl::ParameterSet fPSetND
bool fUseLowPEPen
Add a causal distance penalty for PE (low PE is INCREASES the distance)
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
void slicer::Slicer4D::endJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 131 of file Slicer4D_module.cc.

132  {
133  // Print statements used when tuning the slicer parameters.
134  /*
135  std::cout << "\n\n========== End Job ==========\n"
136  << "End Job: (eps, minpts, PEPen, DistPen, OpVPlPen, MinHitsPerView) "
137  << fEpsilon << " "
138  << fMinPts << " "
139  << fPEPen << " "
140  << fDistPen << " "
141  << fOpVPlPen << " "
142  << fMinHitsPerView << "\n";
143  */
144  }
bool slicer::Slicer4D::GenerateCluster ( unsigned int  point,
int  ClID 
)
protected

Definition at line 305 of file Slicer4D_module.cc.

References slicer::PointManager::changeClustID(), DEFINE_ART_MODULE(), slicer::PointManager::fClustIDs, fMinPts, fPtMan, slicer::PointManager::regionQuery(), and fillBadChanDBTables::result.

Referenced by produce().

306  {
307  // In the original DBSCAN paper, this is the function they called
308  // "ExpandCluster." How this function works is most easily understood
309  // by reading that paper (don't worry, it is pretty short...)
310 
311  // Get the list of neighbors for 'point.'
312  std::vector<unsigned int> seeds = fPtMan.regionQuery(point);
313 
314  // If 'point' is not a core point, label it as noise and return.
315  if(seeds.size() < fMinPts) {
316  fPtMan.changeClustID(point, 0);
317  return false;
318  }
319  else {
320  // Assign 'point' and the neighbors of 'point' to the cluster ClID.
321  for(unsigned int seedi = 0; seedi < seeds.size(); ++seedi)
322  fPtMan.changeClustID(seeds[seedi],ClID);
323  seeds.erase(seeds.begin());
324 
325  // Loop over the neighbors of 'point' to see if they are also core
326  // points.
327  while(seeds.size() > 0) {
328  // Get the list of neighbors for the first seed point.
329  std::vector<unsigned int> result = fPtMan.regionQuery(seeds[0]);
330 
331  // If the first seed point is also a core point, add its neighbors
332  // to the list of seeds and assigne them to the cluster ClID.
333  if(result.size() >= fMinPts) {
334  for(unsigned int resulti = 0; resulti < result.size(); ++resulti) {
335  // If the point is unassigned (-1) or previously labeled as
336  // noise (0), asign it ClID.
337  if(fPtMan.fClustIDs[result[resulti]] == -1 ||
338  fPtMan.fClustIDs[result[resulti]] == 0) {
339  // Only add this point to the list of seeds if it was
340  // previously unassigned.
341  if(fPtMan.fClustIDs[result[resulti]] == -1)
342  seeds.push_back(result[resulti]);
343  fPtMan.changeClustID(result[resulti], ClID);
344  } // end if(resulti is -1 or 0)
345 
346  } // end for resulti
347 
348  } // end if result.size() >= fMinPts
349  seeds.erase(seeds.begin());
350 
351  } // end while
352  return true;
353  } // end else
354 
355  } // end GenerateCluster function
std::vector< unsigned int > regionQuery(unsigned int point)
PointManager fPtMan
Helper class for the 4D clustering.
unsigned int fMinPts
minimum number of casual neighbors for a hit to be in a cluster
std::vector< int > fClustIDs
Assigned cluster ID for each hit.
Definition: PointManager.h:43
void changeClustID(unsigned int point, unsigned int id)
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 slicer::Slicer4D::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 147 of file Slicer4D_module.cc.

References rb::Cluster::Add(), slicer::PointManager::AddHit(), plot_validation_datamc::c, slicer::PointManager::CleanUpNeighborhood(), fApplyNeighborhoodCleanUp, fCellHitInput, slicer::PointManager::fClustIDs, fDistPen, fDoNotSliceAnything, fEpsilon, slicer::PointManager::FindNeighbors(), fMaxEventHits, fMinHitsPerView, fOpVPlPen, fPEPen, fPtMan, fUseLowPEPen, GenerateCluster(), art::DataViewImpl::getByLabel(), calib::Calibrator::GetTimeRes(), MECModelEnuComparisons::i, slicer::PointManager::Initalize(), calib::j, geo::kX, geo::kXorY, geo::kY, art::Event::put(), slicer::PointManager::Reset(), rb::Cluster::SetNoise(), and rb::SortByTime().

148  {
149  // NOTE: There is currently no requirement that a slice have hits in
150  // both views.
151 
153 
154  // Get the cell hits
156  evt.getByLabel(fCellHitInput, hitcol);
157 
158  // Load the cell hits into a vector for easy use
159  std::vector<art::Ptr<rb::CellHit > > hitlist;
160  hitlist.reserve(hitcol->size());
161  for(unsigned int i = 0; i < hitcol->size(); ++i){
162  art::Ptr<rb::CellHit> hit(hitcol, i);
163  hitlist.push_back(hit);
164  }
165 
166  // Safety in case of a very large number of hits in the event, which can
167  // take a long time to slice, and the results probably won't be useful for
168  // downstream modules anyway.
169  if(fMaxEventHits > 0 && int(hitlist.size()) > fMaxEventHits){
170  mf::LogWarning("Slicer4D") << "Very large number of hits ("
171  << hitlist.size()
172  << ") in event. Higher than configured limit ("
173  << fMaxEventHits
174  << "). Will put all hits in the noise slice.";
175  rb::Cluster noise;
176  for(art::Ptr<rb::CellHit> c: hitlist) noise.Add(c);
177  noise.SetNoise(true);
178  evt.put(std::make_unique<std::vector<rb::Cluster>>(1, noise));
179  return;
180  }
181 
182  // Sort the hits by time to improve the speed.
183  // WARNING: The rest of the code assumes that the hits are
184  // time sorted!
185  rb::SortByTime(hitlist);
186 
187 
188 
189  // Initalize PointManager to help with the 4D clustering,
190  // add the hit info to the point manager, and generate the
191  // initial neighbor map.
193 
194  fPtMan.Reset(hitlist.size());
195 
196  for(unsigned int i = 0; i < hitlist.size(); ++i) {
197  fPtMan.AddHit(hitlist[i]->TNS(), cal->GetTimeRes(*hitlist[i]),
198  hitlist[i]->Plane(), hitlist[i]->Cell(), hitlist[i]->PE(),
199  hitlist[i]->View());
200  }
201 
203 
204  // OPTIONAL: Clean up the neighborhood (Get off my lawn you damn kids!)
206 
207  std::unique_ptr< std::vector<rb::Cluster> >
208  clustercol(new std::vector<rb::Cluster>);
209 
210 
211 
212 
213  //
214  // Use alternate slicing methods if requested
215  //
216  int CurrentClusterID = 1;
217 
218  if(fDoNotSliceAnything) {
219 
220  // We will only put one BIG cluster into the event. I don't know
221  // if anyone uses this feature, but I grandfathered it in from
222  // the old slicer.
223 
224  rb::Cluster cluster;
225 
226  for(unsigned int i = 0; i < hitlist.size(); ++i)
227  cluster.Add(hitlist[i]);
228 
229  // Add the cluster to clustercol
230  clustercol->push_back(cluster);
231 
232  }
233  // otherwise do the standard DBSCAN slicing
234  else {
235  for(unsigned int i = 0; i < hitlist.size(); ++i) {
236  // If the point is unclassified, attempt to expand the cluster
237  if(fPtMan.fClustIDs[i] == -1) {
238  if(this->GenerateCluster(i,CurrentClusterID))
239  CurrentClusterID++;
240  } // end if point is unclassified
241  } // end loop over all hits, i
242 
243 
244 
245  //
246  // Construct the actual slices to be put into the event.
247  //
248  std::vector<rb::Cluster> clusters(CurrentClusterID);
249 
250  for(unsigned int i = 0; i < hitlist.size(); ++i)
251  clusters[fPtMan.fClustIDs[i]].Add(hitlist[i]);
252 
253  // Move hits in non-noise clusters that are too small
254  // to the noise cluster.
255  for(unsigned int i = 1; i < clusters.size(); ++i) {
256 
257  if(clusters[i].NXCell() >= fMinHitsPerView &&
258  clusters[i].NYCell() >= fMinHitsPerView) continue;
259 
260  // This cluster is too small. Put its hits into the noise
261  // cluster and clear it.
262  for(unsigned int j = 0; j < clusters[i].NCell(); ++j) {
263  art::Ptr<rb::CellHit> hit(clusters[i].Cell(j));
264  clusters[0].Add(hit);
265  } // end for j (loop over hits)
266  clusters[i].Clear();
267  } // end for i (loop over clusters)
268 
269  // Tag the noise cluster as such.
270  clusters[0].SetNoise(true);
271 
272  // Always put in the noise cluster even if it is empty.
273  clustercol->push_back(clusters[0]);
274 
275  // Add all non-empty, non-noise clusters to clustercol
276  for(unsigned int i = 1; i < clusters.size(); ++i) {
277 
278  if(clusters[i].NCell() == 0) continue;
279 
281  if(clusters[i].NXCell() == 0) V = geo::kY;
282  if(clusters[i].NYCell() == 0) V = geo::kX;
283 
284  rb::Cluster tempcluster(clusters[i].AllCells(),V);
285  clustercol->push_back(tempcluster);
286 
287  }
288 
289  } // end else { do the DBSCAN clustering }
290 
291  //
292  // Before saving the clusters, put the hits inside them into a
293  // standard order
294  //
295  for (unsigned int i=0; i<clustercol->size(); ++i) {
296  (*clustercol)[i].StandardSort();
297  }
298 
299  // put the slices into the event
300  evt.put(std::move(clustercol));
301 
302  } // end Produce function
unsigned int fMinHitsPerView
Minimum number of hits per view to make a cluster.
double GetTimeRes(rb::CellHit const &cellhit)
void Initalize(double eps, double pepen, double distpen, double opvplpen, bool usepepen)
double fDistPen
Distance (in cm) for which the distance penalty will be 1 (roughly one strong interaction length...
void SetNoise(bool noise)
Declare the cluster to consist of noise hits or not.
Definition: Cluster.h:161
X or Y views.
Definition: PlaneGeo.h:30
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
unsigned short Plane() const
Definition: CellHit.h:39
geo::View_t View() const
Definition: CellHit.h:41
void Reset(unsigned int n, bool skip=true)
Vertical planes which measure X.
Definition: PlaneGeo.h:28
double fPEPen
PE value for which the low PE penalty will be 1.
A collection of associated CellHits.
Definition: Cluster.h:47
void SortByTime(std::vector< art::Ptr< rb::CellHit > > &c)
Sort c in time order (earliest to latest).
Definition: CellHit.cxx:134
bool GenerateCluster(unsigned int point, int ClID)
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
virtual void Add(const art::Ptr< rb::CellHit > &cell, double weight=1)
Definition: Cluster.cxx:84
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
unsigned short Cell() const
Definition: CellHit.h:40
double fEpsilon
Minimum causal separation value for neighbors.
float PE() const
Definition: CellHit.h:42
const double j
Definition: BetheBloch.cxx:29
void AddHit(double t, double tres, unsigned int p, unsigned int c, double pe, geo::View_t v)
PointManager fPtMan
Helper class for the 4D clustering.
double fOpVPlPen
Allowed plane gap for hits in opposite views for which the distance penalty will be 1...
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Definition: structs.h:12
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::string fCellHitInput
Read CellHits from this input.
bool fDoNotSliceAnything
If true, one big slice is written out.
bool fUseLowPEPen
Add a causal distance penalty for PE (low PE is INCREASES the distance)
std::vector< int > fClustIDs
Assigned cluster ID for each hit.
Definition: PointManager.h:43
bool fApplyNeighborhoodCleanUp
scrub loner hits from the slice?
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 slicer::Slicer4D::fApplyNeighborhoodCleanUp
protected

scrub loner hits from the slice?

Definition at line 47 of file Slicer4D_module.cc.

Referenced by produce().

std::string slicer::Slicer4D::fCellHitInput
protected

Read CellHits from this input.

Definition at line 45 of file Slicer4D_module.cc.

Referenced by produce().

double slicer::Slicer4D::fDistPen
protected

Distance (in cm) for which the distance penalty will be 1 (roughly one strong interaction length.)

Definition at line 53 of file Slicer4D_module.cc.

Referenced by beginRun(), and produce().

bool slicer::Slicer4D::fDoNotSliceAnything
protected

If true, one big slice is written out.

Definition at line 46 of file Slicer4D_module.cc.

Referenced by produce().

double slicer::Slicer4D::fEpsilon
protected

Minimum causal separation value for neighbors.

Definition at line 49 of file Slicer4D_module.cc.

Referenced by beginRun(), and produce().

int slicer::Slicer4D::fMaxEventHits
protected

Definition at line 57 of file Slicer4D_module.cc.

Referenced by produce().

unsigned int slicer::Slicer4D::fMinHitsPerView
protected

Minimum number of hits per view to make a cluster.

Definition at line 55 of file Slicer4D_module.cc.

Referenced by beginRun(), and produce().

unsigned int slicer::Slicer4D::fMinPts
protected

minimum number of casual neighbors for a hit to be in a cluster

Definition at line 50 of file Slicer4D_module.cc.

Referenced by beginRun(), and GenerateCluster().

double slicer::Slicer4D::fOpVPlPen
protected

Allowed plane gap for hits in opposite views for which the distance penalty will be 1.

Definition at line 54 of file Slicer4D_module.cc.

Referenced by beginRun(), and produce().

double slicer::Slicer4D::fPEPen
protected

PE value for which the low PE penalty will be 1.

Definition at line 52 of file Slicer4D_module.cc.

Referenced by beginRun(), and produce().

fhicl::ParameterSet slicer::Slicer4D::fPSetFD
protected

Definition at line 59 of file Slicer4D_module.cc.

Referenced by beginRun().

fhicl::ParameterSet slicer::Slicer4D::fPSetND
protected

Definition at line 59 of file Slicer4D_module.cc.

Referenced by beginRun().

fhicl::ParameterSet slicer::Slicer4D::fPSetNDOS
protected

Definition at line 59 of file Slicer4D_module.cc.

Referenced by beginRun().

fhicl::ParameterSet slicer::Slicer4D::fPSetTB
protected

Definition at line 59 of file Slicer4D_module.cc.

Referenced by beginRun().

PointManager slicer::Slicer4D::fPtMan
protected

Helper class for the 4D clustering.

Definition at line 62 of file Slicer4D_module.cc.

Referenced by GenerateCluster(), and produce().

bool slicer::Slicer4D::fUseLowPEPen
protected

Add a causal distance penalty for PE (low PE is INCREASES the distance)

Definition at line 51 of file Slicer4D_module.cc.

Referenced by beginRun(), and produce().


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