Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
novaddt::DBSlicer Class Reference
Inheritance diagram for novaddt::DBSlicer:
art::EDFilter art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
template<typename UserConfig >
using Table = ProducerBase::Table< UserConfig >
 

Public Member Functions

 DBSlicer (fhicl::ParameterSet const &p)
 
virtual ~DBSlicer ()
 
bool filter (art::Event &e) 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< 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 ()
 

Static Public Attributes

static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 

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

void expandSlice (unsigned int Point, std::vector< unsigned int > &Neighbors, unsigned int SliceID)
 
std::vector< unsigned intregionQuery (unsigned int Point)
 
void InitializeLists (const art::Handle< novaddt::HitList > &Hits)
 
double NeighborScore (const art::Handle< novaddt::HitList > &Hits, unsigned int i, unsigned int j)
 
void GetSingleViewSlice (const std::unique_ptr< std::vector< HitList > > &allClusters, std::unique_ptr< std::vector< HitList > > &desiredClusters, std::vector< double > &desiredTMean, std::vector< double > &desiredPMean, std::vector< double > &desiredTRMS, std::vector< double > &desiredPRMS, daqchannelmap::DetView_TYPE desiredView)
 
void MergeSlices (const std::unique_ptr< std::vector< HitList > > &XSlices, std::vector< double > &XTMean, std::vector< double > &XPMean, std::vector< double > &XTRMS, std::vector< double > &XPRMS, const std::unique_ptr< std::vector< HitList > > &YSlices, std::vector< double > &YTMean, std::vector< double > &YPMean, std::vector< double > &YTRMS, std::vector< double > &YPRMS, std::unique_ptr< std::vector< HitList > > &CombSlices)
 

Private Attributes

std::string fHLabel
 
std::string fInstance
 
float fDistPen
 
float fTimePen
 
float fTimeRes
 
float fEps
 
unsigned int fMinPts
 
int fTimeGap
 
double fMergeKnob
 
unsigned int fSliceID
 
std::vector< std::vector< unsigned int > > fNeighbors
 
std::vector< intfSliceIDs
 

Detailed Description

Definition at line 31 of file DBSlicer_module.cc.

Member Typedef Documentation

using art::EDFilter::ModuleType = EDFilter
inherited

Definition at line 37 of file EDFilter.h.

template<typename UserConfig >
using art::EDFilter::Table = ProducerBase::Table<UserConfig>
inherited

Definition at line 46 of file EDFilter.h.

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

Definition at line 38 of file EDFilter.h.

Constructor & Destructor Documentation

novaddt::DBSlicer::DBSlicer ( fhicl::ParameterSet const &  p)
explicit

Definition at line 78 of file DBSlicer_module.cc.

79 :
80 fHLabel (p.get< std::string >("hits_label")),
81 fInstance (p.get< std::string >("instance")),
82 fDistPen (p.get< float >("Distance_Penalty" )),
83 fTimePen (p.get< float >("Timing_Penalty" )),
84 fTimeRes (p.get< float >("Timing_Resolution" )),
85 fEps (p.get< float >("Epsilon" )),
86 fMinPts (p.get< unsigned int >("MinPts" )),
87 fTimeGap (p.get< int >("TimeGap")),
88 fMergeKnob(p.get< double >("ViewMergeKnob"))
89 {
90  produces<std::vector<HitList>>("DBSCANSlicesComb");
91  produces<std::vector<HitList>>("DBSCANSlicesX");
92  produces<std::vector<HitList>>("DBSCANSlicesY");
93 }
const char * p
Definition: xmltok.h:285
std::string fInstance
unsigned int fMinPts
enum BeamMode string
novaddt::DBSlicer::~DBSlicer ( )
virtual

Definition at line 95 of file DBSlicer_module.cc.

96 {
97  // Clean up dynamic memory and other resources here.
98 }

Member Function Documentation

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::EDFilter::currentContext ( ) const
protectedinherited
void novaddt::DBSlicer::expandSlice ( unsigned int  Point,
std::vector< unsigned int > &  Neighbors,
unsigned int  SliceID 
)
private

Definition at line 100 of file DBSlicer_module.cc.

References febshutoff_auto::end, fMinPts, fNeighbors, fSliceIDs, it, and regionQuery().

Referenced by filter().

101 {
102  // Impliment expandSlice
103  fSliceIDs[Point] = SliceID;
104  for(auto it:Neighbors){
105  if(fSliceIDs[it] == -5) {
106  fSliceIDs[it] = -1;
107  std::vector<unsigned int> MoreNeighbors = regionQuery(it);
108  if(MoreNeighbors.size() >= fMinPts) // Add the two neighborhoods
109  fNeighbors[Point].insert(fNeighbors[Point].end(), MoreNeighbors.begin(), MoreNeighbors.end());
110  // Add hit to slice if it doesn't belong to another one already
111  if(fSliceIDs[it] < 0) fSliceIDs[it] = SliceID;
112  }
113  }
114 }
set< int >::iterator it
std::vector< unsigned int > regionQuery(unsigned int Point)
std::vector< int > fSliceIDs
unsigned int fMinPts
std::vector< std::vector< unsigned int > > fNeighbors
bool novaddt::DBSlicer::filter ( art::Event e)
overridevirtual

Implements art::EDFilter.

Definition at line 216 of file DBSlicer_module.cc.

References DEFINE_ART_MODULE(), expandSlice(), fHLabel, fInstance, fMinPts, fSliceID, fSliceIDs, art::DataViewImpl::getByLabel(), GetSingleViewSlice(), hits(), InitializeLists(), it, MergeSlices(), stan::io::product(), art::Event::put(), regionQuery(), daqchannelmap::X_VIEW, and daqchannelmap::Y_VIEW.

217 {
219  e.getByLabel(fHLabel, fInstance, hits);
220 
221  // Now use that product to fill the things we are actually going to put in the event,
222  // view split 2D slices and a view combined slicelist of hitlists
223  std::unique_ptr< std::vector<HitList> >productcomb(new std::vector<HitList>);
224  std::unique_ptr< std::vector<HitList> >productx(new std::vector<HitList>);
225  std::unique_ptr< std::vector<HitList> >producty(new std::vector<HitList>);
226 
227  if(hits->empty()) {
228  e.put(std::move(productcomb),"DBSCANSlicesComb");
229  e.put(std::move(productx),"DBSCANSlicesX");
230  e.put(std::move(producty),"DBSCANSlicesY");
231  return false;
232  }
233  InitializeLists(hits);
234 
235  // Meat and Potatoes of DBSCAN
236  fSliceID = 0;
237  for(unsigned int it = 0; it < hits->size(); ++it) {
238  if(fSliceIDs[it] != -5) continue;
239  // Mark hit as "visited"
240  fSliceIDs[it] = -1;
241  std::vector<unsigned int> Neighbors = regionQuery(it);
242  // Bail if the hit doesn't have enough neighbors
243  if(Neighbors.size() < fMinPts) fSliceIDs[it] = 0;
244  else {
245  // Make a new slice and figure out who goes into the slice
246  fSliceID++;
247  expandSlice(it,Neighbors,fSliceID);
248  } // end else
249  } //for all unvisited hits
250 
251  // Initialize the product
252  std::unique_ptr< std::vector<HitList> >product(new std::vector<HitList>);
253 
254  // Resize it to the number of HitLists we'll be producing
255  product->resize(fSliceID);
256  // Fill the product HitLists with the corresponding DAQHits from the original Handle
257  for(unsigned int it = 0; it<fSliceIDs.size(); ++it)
258  product->at(fSliceIDs[it]).push_back(hits->at(it));
259 
260  // Containers for storing information to be used in the merging step
261  std::vector<double> XMeanTime, XMeanPlane, XRMSTime, XRMSPlane;
262  std::vector<double> YMeanTime, YMeanPlane, YRMSTime, YRMSPlane;
263 
264  GetSingleViewSlice(product, productx, XMeanTime, XMeanPlane, XRMSTime, XRMSPlane, daqchannelmap::X_VIEW);
265  GetSingleViewSlice(product, producty, YMeanTime, YMeanPlane, YRMSTime, YRMSPlane, daqchannelmap::Y_VIEW);
266  MergeSlices(productx, XMeanTime, XMeanPlane, XRMSTime, XRMSPlane,
267  producty, YMeanTime, YMeanPlane, YRMSTime, YRMSPlane, productcomb);
268 
269  //put the hits into the event for later use
270  e.put(std::move(productcomb),"DBSCANSlicesComb");
271  e.put(std::move(productx),"DBSCANSlicesX");
272  e.put(std::move(producty),"DBSCANSlicesY");
273  return true;
274 
275 }
void InitializeLists(const art::Handle< novaddt::HitList > &Hits)
set< int >::iterator it
void MergeSlices(const std::unique_ptr< std::vector< HitList > > &XSlices, std::vector< double > &XTMean, std::vector< double > &XPMean, std::vector< double > &XTRMS, std::vector< double > &XPRMS, const std::unique_ptr< std::vector< HitList > > &YSlices, std::vector< double > &YTMean, std::vector< double > &YPMean, std::vector< double > &YTRMS, std::vector< double > &YPRMS, std::unique_ptr< std::vector< HitList > > &CombSlices)
unsigned int fSliceID
std::string fInstance
std::vector< unsigned int > regionQuery(unsigned int Point)
void expandSlice(unsigned int Point, std::vector< unsigned int > &Neighbors, unsigned int SliceID)
std::vector< int > fSliceIDs
Identifier for the Y measuring view of the detector (side)
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
void hits()
Definition: readHits.C:15
Identifier for the X measuring view of the detector (top)
T product(std::vector< T > dims)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
unsigned int fMinPts
void GetSingleViewSlice(const std::unique_ptr< std::vector< HitList > > &allClusters, std::unique_ptr< std::vector< HitList > > &desiredClusters, std::vector< double > &desiredTMean, std::vector< double > &desiredPMean, std::vector< double > &desiredTRMS, std::vector< double > &desiredPRMS, daqchannelmap::DetView_TYPE desiredView)
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::EDFilter::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 131 of file EDFilter.h.

References art::EDFilter::moduleDescription_.

Referenced by novaddt::HoughTrackMaker::create_associations().

132  {
133  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
134  instanceName);
135  }
ModuleDescription moduleDescription_
Definition: EDFilter.h:124
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  }
void novaddt::DBSlicer::GetSingleViewSlice ( const std::unique_ptr< std::vector< HitList > > &  allClusters,
std::unique_ptr< std::vector< HitList > > &  desiredClusters,
std::vector< double > &  desiredTMean,
std::vector< double > &  desiredPMean,
std::vector< double > &  desiredTRMS,
std::vector< double > &  desiredPRMS,
daqchannelmap::DetView_TYPE  desiredView 
)
private

Definition at line 160 of file DBSlicer_module.cc.

References it, and std::sqrt().

Referenced by filter(), and regionQuery().

164 {
165  for(auto it=allClusters->begin(); it!=allClusters->end(); ++it){
166  if((*it)[0].View().val != desiredView) continue;
167  desiredClusters->push_back(*it);
168  double tsum = 0.0;
169  double psum = 0.0;
170  double tsum2 = 0.0;
171  double psum2 = 0.0;
172  for(auto jt:*it){
173  tsum += jt.TDC();
174  tsum2 += jt.TDC()*jt.TDC();
175  psum += jt.Plane();
176  psum2 += jt.Plane()*jt.Plane();
177  desiredTMean.push_back(tsum/it->size());
178  desiredPMean.push_back(psum/it->size());
179  desiredTRMS.push_back(sqrt(tsum2/it->size()));
180  desiredPRMS.push_back(sqrt(psum2/it->size()));
181  }
182  }
183 }
set< int >::iterator it
T sqrt(T number)
Definition: d0nt_math.hpp:156
void novaddt::DBSlicer::InitializeLists ( const art::Handle< novaddt::HitList > &  Hits)
private

Definition at line 135 of file DBSlicer_module.cc.

References fEps, fNeighbors, fSliceIDs, fTimeGap, it, NeighborScore(), and gen_flatrecord::size.

Referenced by filter(), and regionQuery().

136 {
137  fNeighbors.clear();
138  fSliceIDs.clear();
139  unsigned int size = Hits->size();
140 
141  // Initialize IDs to unset
142  fSliceIDs.resize(size,-5);
143 
144  // Find Neighbors
145  fNeighbors.resize(size);
146  for(unsigned int it=0; it<size; ++it) {
147  fNeighbors[it].push_back(it);
148  for(unsigned int jt=it+1; jt<size; ++jt) {
149  // If the hits are too far removed in time, don't include any more points
150  if(Hits->at(jt).TDC() - Hits->at(it).TDC() > (uint64_t) fTimeGap) break;
151  double score = NeighborScore(Hits, it, jt);
152  if(score <= fEps) {
153  fNeighbors[it].push_back(jt);
154  fNeighbors[jt].push_back(it);
155  } // end if
156  } // end second index
157  } // end first index
158 }
set< int >::iterator it
double NeighborScore(const art::Handle< novaddt::HitList > &Hits, unsigned int i, unsigned int j)
std::vector< int > fSliceIDs
std::vector< std::vector< unsigned int > > fNeighbors
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
void novaddt::DBSlicer::MergeSlices ( const std::unique_ptr< std::vector< HitList > > &  XSlices,
std::vector< double > &  XTMean,
std::vector< double > &  XPMean,
std::vector< double > &  XTRMS,
std::vector< double > &  XPRMS,
const std::unique_ptr< std::vector< HitList > > &  YSlices,
std::vector< double > &  YTMean,
std::vector< double > &  YPMean,
std::vector< double > &  YTRMS,
std::vector< double > &  YPRMS,
std::unique_ptr< std::vector< HitList > > &  CombSlices 
)
private

Definition at line 185 of file DBSlicer_module.cc.

References stan::math::fabs(), fMergeKnob, it, and std::sqrt().

Referenced by filter(), and regionQuery().

190 {
191  // This function will have to decide which Cluster from the X View to combine with which Cluster from the Y view
192  for(unsigned int it = 0; it<XSlices->size(); ++it){
193  // Initialize a few things to keep track of, the minimum score and which Slice it corresponds to
194  double minscore = DBL_MAX;
195  unsigned int YSlice = 0;
196  // A vector to mark which YSlices we have already used to combine with XSlices
197  std::vector<unsigned int> used(YSlices->size(),0);
198  for(unsigned int jt=0; jt<YSlices->size(); ++jt){
199  double score = fabs(XTMean[it]-YTMean[jt])/sqrt(XTRMS[it]*XTRMS[it]+YTRMS[jt]*YTRMS[jt]) +
200  fabs(XPMean[it]-YPMean[jt])/sqrt(XPRMS[it]*XPRMS[it]+YPRMS[jt]*YPRMS[jt]);
201  if(score < minscore && used[jt] == 0){
202  minscore = score;
203  YSlice = jt;
204  }
205  }
206  // If there is a YSlice that matches the XSlice, put them both into the Combslices, and mark the slice as used
207  if(minscore < fMergeKnob){
208  novaddt::HitList tmphits(XSlices->at(it));
209  tmphits.insert(tmphits.end(), YSlices->at(YSlice).begin(), YSlices->at(YSlice).end());
210  CombSlices->push_back(tmphits);
211  used[YSlice] = 1;
212  }
213  }
214 }
set< int >::iterator it
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
std::vector< DAQHit > HitList
Definition: HitList.h:15
T sqrt(T number)
Definition: d0nt_math.hpp:156
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  }
double novaddt::DBSlicer::NeighborScore ( const art::Handle< novaddt::HitList > &  Hits,
unsigned int  i,
unsigned int  j 
)
private

Definition at line 116 of file DBSlicer_module.cc.

References abs(), stan::math::fabs(), fDistPen, fTimePen, fTimeRes, T, and Z.

Referenced by InitializeLists(), and regionQuery().

117 {
118  // Ensure no merging of views at this stage
119  if(Hits->at(i).View() != Hits->at(j).View()) return DBL_MAX;
120 
121  // Use FHICL parameter to determine how tight to cluster in space, numbers are cell dimensions in cm
122  float DistPenPlane= fDistPen/6.2;
123  float TimePenalty = fTimePen/fTimeRes;
124 
125  //double dC = abs(Hits->at(i).Cell() - Hits->at(j).Cell());
126  double dT = fabs(Hits->at(i).TDC() - Hits->at(j).TDC()) * 15.625; // Conversion to TNS, for coarse timing
127  double dP = abs(Hits->at(i).Plane() - Hits->at(j).Plane());
128 
129  double Z = dP/DistPenPlane;
130  double T = dT/TimePenalty;
131 
132  return Z*Z+T*T;
133 }
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
void abs(TH1 *hist)
Float_t Z
Definition: plot.C:38
const double j
Definition: BetheBloch.cxx:29
double T
Definition: Xdiff_gwt.C:5
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::vector<unsigned int> novaddt::DBSlicer::regionQuery ( unsigned int  Point)
inlineprivate

Definition at line 59 of file DBSlicer_module.cc.

References GetSingleViewSlice(), MECModelEnuComparisons::i, InitializeLists(), calib::j, MergeSlices(), and NeighborScore().

Referenced by expandSlice(), and filter().

59 { return fNeighbors[Point]; }
std::vector< std::vector< unsigned int > > fNeighbors
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

constexpr bool art::EDFilter::Fail {false}
staticinherited

Definition at line 33 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().

float novaddt::DBSlicer::fDistPen
private

Definition at line 45 of file DBSlicer_module.cc.

Referenced by NeighborScore().

float novaddt::DBSlicer::fEps
private

Definition at line 48 of file DBSlicer_module.cc.

Referenced by InitializeLists().

std::string novaddt::DBSlicer::fHLabel
private

Definition at line 43 of file DBSlicer_module.cc.

Referenced by filter().

std::string novaddt::DBSlicer::fInstance
private

Definition at line 44 of file DBSlicer_module.cc.

Referenced by filter().

double novaddt::DBSlicer::fMergeKnob
private

Definition at line 51 of file DBSlicer_module.cc.

Referenced by MergeSlices().

unsigned int novaddt::DBSlicer::fMinPts
private

Definition at line 49 of file DBSlicer_module.cc.

Referenced by expandSlice(), and filter().

std::vector<std::vector< unsigned int> > novaddt::DBSlicer::fNeighbors
private

Definition at line 54 of file DBSlicer_module.cc.

Referenced by expandSlice(), and InitializeLists().

unsigned int novaddt::DBSlicer::fSliceID
private

Definition at line 53 of file DBSlicer_module.cc.

Referenced by filter().

std::vector<int> novaddt::DBSlicer::fSliceIDs
private

Definition at line 55 of file DBSlicer_module.cc.

Referenced by expandSlice(), filter(), and InitializeLists().

int novaddt::DBSlicer::fTimeGap
private

Definition at line 50 of file DBSlicer_module.cc.

Referenced by InitializeLists().

float novaddt::DBSlicer::fTimePen
private

Definition at line 46 of file DBSlicer_module.cc.

Referenced by NeighborScore().

float novaddt::DBSlicer::fTimeRes
private

Definition at line 47 of file DBSlicer_module.cc.

Referenced by NeighborScore().

constexpr bool art::EDFilter::Pass {true}
staticinherited

Definition at line 32 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().


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