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

 SPCluster (fhicl::ParameterSet const &pset)
 
virtual ~SPCluster ()
 
void produce (art::Event &evt)
 
void beginJob ()
 
void endJob ()
 
bool SurfAssign (art::Ptr< rb::CellHit > const &hptr)
 
bool ContaineAssign (art::Ptr< rb::CellHit > const &hptr)
 
bool ViewCheck (art::Ptr< rb::CellHit > const &, art::Ptr< rb::CellHit > const &)
 
float Dist (art::Ptr< rb::CellHit > const &, art::Ptr< rb::CellHit > const &)
 
unsigned IndexLocator (std::vector< art::Ptr< rb::CellHit > > &hit_ptrs, float tns)
 
bool dupCheck (std::vector< art::Ptr< rb::CellHit > > &hit_ptrs, art::Ptr< rb::CellHit > &chit)
 
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 fCellHitInput
 
float _hf_min
 
unsigned _sigmaT
 
unsigned _deltaT
 
unsigned _minHits
 
float _deltaP_S
 
float _deltaC_S
 
float _deltaP_C
 
float _deltaC_C
 
float _sigmaL
 
float _Xmax
 
float _Ymax
 
float _DistMin
 
float _vproMin
 
float _vproMax
 
float _df
 

Detailed Description

Definition at line 39 of file SPCluster_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

zcl::SPCluster::SPCluster ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 88 of file SPCluster_module.cc.

88  :
89  fCellHitInput (p.get< std::string >("CellHitInput") ),
90  _hf_min (p.get< float >("hf_min")), //Min hit number density in unit distance(in cell unit)
91  _sigmaT (1500), //100TDC = 1562.5ns
92  _deltaT (4687), //300TDC
93  _minHits (30),
94  _deltaP_S (4),
95  _deltaC_S (10),
96  _deltaP_C (2),
97  _deltaC_C (2),
98  _sigmaL (0.02),
99  _Xmax (p.get<float>("Xmax")),
100  _Ymax (p.get<float>("Ymax")),
101  _DistMin (p.get<float>("DistMin")),
102  _vproMin (p.get<float>("vproMin")),
103  _vproMax (p.get<float>("vproMax")),
104  _df (0.1)
105 {
106  // Call appropriate Produces<>() functions here.
107  produces< std::vector<rb::Cluster> >();
108 }
const char * p
Definition: xmltok.h:285
std::string fCellHitInput
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
zcl::SPCluster::~SPCluster ( )
virtual

Definition at line 110 of file SPCluster_module.cc.

111 {
112  // Clean up dynamic memory and other resources here.
113 }

Member Function Documentation

void zcl::SPCluster::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 115 of file SPCluster_module.cc.

116 {
117 }
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
bool zcl::SPCluster::ContaineAssign ( art::Ptr< rb::CellHit > const &  hptr)

Definition at line 336 of file SPCluster_module.cc.

References _deltaC_C, _deltaP_C, _Xmax, _Ymax, rb::CellHit::Cell(), and rb::CellHit::Plane().

Referenced by produce().

337 {
338  if ( hptr->Cell() > _Ymax - _deltaC_C ) return false;
339  else if ( hptr->Cell() < _deltaC_C ) return false;
340  else if ( hptr->Plane() < _deltaP_C ) return false;
341  else if ( hptr->Plane() > _Xmax - _deltaP_C ) return false;
342 
343  return true;
344 }
unsigned short Plane() const
Definition: CellHit.h:39
unsigned short Cell() const
Definition: CellHit.h:40
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
float zcl::SPCluster::Dist ( art::Ptr< rb::CellHit > const &  hptr1,
art::Ptr< rb::CellHit > const &  hptr2 
)

Definition at line 359 of file SPCluster_module.cc.

References rb::CellHit::Cell(), dx, dy, rb::CellHit::Plane(), and std::sqrt().

Referenced by produce().

361 {
362  float dx = ((hptr1->Plane() )- (hptr2->Plane()) )*1.6795;
363  float dy = (hptr1->Cell() ) - (hptr2->Cell());
364  return sqrt(dx*dx+dy*dy);
365 }
unsigned short Plane() const
Definition: CellHit.h:39
T sqrt(T number)
Definition: d0nt_math.hpp:156
unsigned short Cell() const
Definition: CellHit.h:40
double dy[NP][NC]
double dx[NP][NC]
bool zcl::SPCluster::dupCheck ( std::vector< art::Ptr< rb::CellHit > > &  hit_ptrs,
art::Ptr< rb::CellHit > &  chit 
)

Definition at line 385 of file SPCluster_module.cc.

References DEFINE_ART_MODULE(), MakeMiniprodValidationCuts::f, MECModelEnuComparisons::i, compare_h5_caf::idx, m, confusionMatrixTree::t, and rb::CellHit::TNS().

387 {
388  if (hit_ptrs.empty()) return false;
389  float t = chit->TNS();
390 
391  unsigned f = hit_ptrs.size()-1;
392  if (t > hit_ptrs[f]->TNS()) return false;
393  unsigned i = 0;
394 
395  while (f>i+5) {
396  unsigned m = (f+i)/2;
397  if (t >= hit_ptrs[m]->TNS() ) i = m;
398  else f = m+1;
399  }
400 
401  for (unsigned idx = i; idx!=f; ++idx) {
402  if (chit==hit_ptrs[idx])
403  return true;
404  }
405 
406  return false;
407 
408 }
float TNS() const
Definition: CellHit.h:46
void zcl::SPCluster::endJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 321 of file SPCluster_module.cc.

321  {
322 
323 }
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  }
unsigned zcl::SPCluster::IndexLocator ( std::vector< art::Ptr< rb::CellHit > > &  hit_ptrs,
float  tns 
)

Definition at line 368 of file SPCluster_module.cc.

References MakeMiniprodValidationCuts::f, MECModelEnuComparisons::i, and m.

Referenced by produce().

370 {
371  unsigned i = 0;
372  unsigned f = hit_ptrs.size()-1;
373 
374  if (tns < (hit_ptrs[0])->TNS()) return i;
375  if (tns > (hit_ptrs[f])->TNS()) return f;
376 
377  while (f>i+1) {
378  unsigned m = (f+i)/2;
379  if (tns >= (hit_ptrs[m])->TNS() ) i = m;
380  else f = m;
381  }
382  return i;
383 }
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().

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 zcl::SPCluster::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 119 of file SPCluster_module.cc.

References _deltaT, _df, _DistMin, _hf_min, _minHits, _sigmaL, _sigmaT, _vproMax, _vproMin, _Xmax, abs(), rawdata::RawDigit::ADC(), rb::Cluster::Add(), rb::CellHit::Cell(), rb::Cluster::Cell(), ContaineAssign(), Dist(), Distance(), febshutoff_auto::end, fCellHitInput, fin, geom(), art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, compare_h5_caf::idx, IndexLocator(), it, calib::j, geo::kY, std::min(), rb::Cluster::NCell(), python.hepunit::pi, rb::CellHit::Plane(), art::Event::put(), gen_flatrecord::size, rb::SortByTime(), SurfAssign(), confusionMatrixTree::t, getGoodRuns4SAM::t1, t2, rb::CellHit::TNS(), registry_explorer::v, rb::CellHit::View(), and ViewCheck().

120 {
123  evt.getByLabel(fCellHitInput, hitcol);
124  // Load the cell hits into a vector for easy use
125  std::vector<art::Ptr<rb::CellHit > > hitlist[2];
126 
127  //This process imitated the ADC filtering process
128  for(unsigned int i = 0; i < hitcol->size(); ++i){
129  art::Ptr<rb::CellHit> hit_ptr(hitcol, i);
130  //Make a selection of hits here: first 2 diblocks
131 
132  if (hit_ptr->ADC() > 50 && hit_ptr->Plane() < _Xmax+1) {
133  unsigned v = 0;
134  if (hit_ptr->View()==geo::kY ) v = 1;
135  hitlist[v].emplace_back(hit_ptr);
136  }
137  }
138 
139 
140  //Sort the hits by time:
141  rb::SortByTime(hitlist[0]);
142  rb::SortByTime(hitlist[1]);
143 
144  //X, Y, T (plane, cell, tns)
145  std::vector<art::Ptr<rb::CellHit> > c_PS[2]; //They will contain all Valid non surface hits on each view
146  std::vector<art::Ptr<rb::CellHit> > s_PS[2]; //They will contain all Valid surface and mate hits on each view
147 
148  std::unique_ptr<std::vector<rb::Cluster> > clustercol(new std::vector<rb::Cluster>);
149 
150  //View Check and doing surface hits collecion
151  for (unsigned v = 0; v!=2; ++v) {
152  for (unsigned i = 0; i!= hitlist[v].size(); ++i ) {
153  art::Ptr<rb::CellHit> const& hit = hitlist[v][i];
154  float t = hit->TNS();
155  unsigned start_id = IndexLocator(hitlist[1-v], t-_deltaT);
156  unsigned stop_id = IndexLocator(hitlist[1-v], t+_deltaT);
157  bool met = false;
158  for (unsigned j = start_id; j<stop_id; ++j ) {
159  art::Ptr<rb::CellHit> const& buddy = hitlist[1-v][j];
160  if (ViewCheck(hit, buddy)) {
161  if (!met && ContaineAssign(hit) ) {
162  c_PS[v].emplace_back(hit);
163  met=true;
164  }
165  else if (SurfAssign(hit) || SurfAssign(buddy)) {
166  s_PS[v].emplace_back(hit);
167  break;
168  }
169  }
170  }
171  }
172  }
173 
174  for (unsigned v=0; v!=2; ++v) {
175  if (c_PS[v].size()<_minHits) {
176  evt.put(std::move(clustercol));
177  return;
178  }
179  if (s_PS[v].size()<2) {
180  evt.put(std::move(clustercol));
181  return;
182  }
183  }
184 
185  for (int v=0; v!=2; ++v) {
186  // std::cout<<"View: "<<v<<std::endl;
187  //If all X view hits have all been reviewed and no cluster has been reconstructed, you can stop here:
188  if (v==1 && clustercol->empty() ) break;
189 
190  //Try to find entry hit on valid surface hits containers
191  for (unsigned i=0; i<s_PS[v].size()-1; ++i) {
192  // bool found = false;
193  art::Ptr<rb::CellHit> hit1 = s_PS[v][i];
194  float ti = hit1->TNS();
195  int pi = hit1->Plane();
196  int ci = hit1->Cell();
197 
198  // std::cout<<"potential Pi: "<<pi<<" Ci: "<<ci<<std::endl;
199 
200 
201  unsigned ini = IndexLocator(c_PS[v], ti-_deltaT);
202  // std::cout<<"ini:"<<ini<<std::endl;
203 
204  if (ini+_minHits+1 > c_PS[v].size() ) break;
205 
206  for (unsigned j=s_PS[v].size()-1; j>i && ini+_minHits+1 < c_PS[v].size(); --j) {
207  art::Ptr<rb::CellHit> hit2 = s_PS[v][j];
208  float tf = hit2->TNS();
209  int pf = hit2->Plane();
210  int cf = hit2->Cell();
211 
212  if (tf +_deltaT < c_PS[v][ini+_minHits]->TNS()) {
213  // std::cout<<"break due to tf too small"<<std::endl;
214  break;
215  }
216  if (tf > c_PS[v][c_PS[v].size()-1]->TNS() +_deltaT ){
217  // std::cout<<"continue due to tf too large"<<std::endl;
218  continue;
219  }
220 
221  unsigned fin = IndexLocator(c_PS[v], tf+_deltaT);
222  float Distance = Dist(hit1, hit2);
223 
224  if (Distance < _DistMin) {
225  continue;
226  }
227  if (fin<ini+Distance*_hf_min) {
228  // std::cout<<"fin:"<<fin<<std::endl;
229  continue;
230  }
231 
232  float vpro = (tf-ti)/Distance;
233  // std::cout<<"vpro: "<<vpro<<std::endl;
234  if (tf > ti+Distance*_vproMax+_sigmaT) {
235  // std::cout<<"tf too large"<<std::endl;
236  continue;
237  }
238  else if (tf+_sigmaT < ti+Distance*_vproMin) {
239  // std::cout<<"tf too small"<<std::endl;
240  continue;
241  }
242 
243  //Here we implemente the CCB(continuity-check and break) mechanisim
244  //First, calculate the time window for checking the previous hit on track:
245  int _dP = abs(pf-pi)*_df;
246  float dt = (tf-ti)*_df;
247 
248  //Fish is coming!
249  unsigned h_counts = 0;
250  float disCut = std::min(Distance*_sigmaL,float(3));
251 
252  unsigned h_cut = Distance*_hf_min;
253  rb::Cluster Cluster;
254 
255  int last_P = pi;
256  float last_T = ti;
257  for (unsigned k=ini; k!=fin; ++k) {
258  art::Ptr<rb::CellHit> Mid = c_PS[v][k];
259  int pk = Mid->Plane();
260  int ck = Mid->Cell();
261  float tk = Mid->TNS();
262 
263  // std::cout<<"k-ini: "<<k-ini<<std::endl;
264  if (tk>last_T+dt+_sigmaT) {
265  // std::cout<<"hits attached: "<<h_counts<<" current Plane: "<<pk<<" curent time: "<<tk-last_T<<" view:"<<v<<std::endl;
266  if (pk> last_P+_dP || pk+_dP<last_P) break;
267  }
268 
269  if (pk > pi && pk > pf) continue;
270  else if (pk < pi && pk < pf) continue;
271  if (ck > ci && ck > cf) continue;
272  else if (ck < ci && ck < cf) continue;
273 
274  float t1 = tk-ti;
275  float t2 = tf-tk;
276  float d1 = Dist(hit1, Mid);
277  float d2 = Dist(hit2, Mid);
278 
279  if (d1+d2 > Distance+disCut) continue;
280 
281  if (d1>d2) {
282  if (t1 < d1*vpro + _sigmaT && t1 > d1*vpro - _sigmaT) {
283  ++h_counts;
284  Cluster.Add(Mid);
285  //refresh the previous hit:
286  last_P= pk;
287  last_T= tk;
288  }
289  }
290  else {
291  if (t2 > d2*vpro - _sigmaT && t2 < d2*vpro + _sigmaT) {
292  ++h_counts;
293  Cluster.Add(Mid);
294  //refresh the previous hit:
295  last_P= pk;
296  last_T= tk;
297  }
298  }
299  }
300 
301  if (h_counts > h_cut ) {
302  //Now delete the hits from the container:c_PS[v]
303  for (unsigned idx =0; idx != Cluster.NCell(); ++idx) {
304  auto it = find(c_PS[v].begin(), c_PS[v].end(), Cluster.Cell(idx));
305  c_PS[v].erase(it);
306  }
307 
308  Cluster.Add(hit1);
309  Cluster.Add(hit2);
310  clustercol->emplace_back(Cluster);
311 
312 
313  }
314  }
315  } // 1 view finished
316  }
317 
318  evt.put(std::move(clustercol));
319 } //end production function
float TNS() const
Definition: CellHit.h:46
TString fin
Definition: Style.C:24
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
set< int >::iterator it
unsigned short Plane() const
Definition: CellHit.h:39
bool ContaineAssign(art::Ptr< rb::CellHit > const &hptr)
A collection of associated CellHits.
Definition: Cluster.h:47
double Distance(double x1, double y1, double x2, double y2)
void abs(TH1 *hist)
void SortByTime(std::vector< art::Ptr< rb::CellHit > > &c)
Sort c in time order (earliest to latest).
Definition: CellHit.cxx:134
Timing fit.
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
Definition: Cand.cxx:23
std::string fCellHitInput
bool ViewCheck(art::Ptr< rb::CellHit > const &, art::Ptr< rb::CellHit > const &)
bool SurfAssign(art::Ptr< rb::CellHit > const &hptr)
const double j
Definition: BetheBloch.cxx:29
double t2
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Definition: structs.h:12
void geom(int which=0)
Definition: geom.C:163
T min(const caf::Proxy< T > &a, T b)
unsigned IndexLocator(std::vector< art::Ptr< rb::CellHit > > &hit_ptrs, float tns)
float Dist(art::Ptr< rb::CellHit > const &, art::Ptr< rb::CellHit > const &)
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

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

bool zcl::SPCluster::SurfAssign ( art::Ptr< rb::CellHit > const &  hptr)

Definition at line 325 of file SPCluster_module.cc.

References _deltaC_S, _deltaP_S, _Xmax, _Ymax, rb::CellHit::Cell(), and rb::CellHit::Plane().

Referenced by produce().

326 {
327  if ( hptr->Cell() > _Ymax - _deltaC_S ) return true;
328  else if ( hptr->Cell() < _deltaC_S ) return true;
329  else if ( hptr->Plane() < _deltaP_S ) return true;
330  else if ( hptr->Plane() > _Xmax - _deltaP_S ) return true;
331 
332  return false;
333 
334 }
unsigned short Plane() const
Definition: CellHit.h:39
unsigned short Cell() const
Definition: CellHit.h:40
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool zcl::SPCluster::ViewCheck ( art::Ptr< rb::CellHit > const &  hptr1,
art::Ptr< rb::CellHit > const &  hptr2 
)

Definition at line 347 of file SPCluster_module.cc.

References _deltaP_S, _deltaT, rb::CellHit::Plane(), and rb::CellHit::TNS().

Referenced by produce().

349 {
350  if (hptr1->TNS() > hptr2->TNS()+_deltaT) return false;
351  if (hptr2->TNS() > hptr1->TNS()+_deltaT) return false;
352  if (hptr1->Plane() > hptr2->Plane() ) {
353  if (hptr1->Plane() - hptr2->Plane() < _deltaP_S ) return true;
354  }
355  else if (hptr2->Plane() - hptr1->Plane() < _deltaP_S ) return true;
356  return false;
357 }
float TNS() const
Definition: CellHit.h:46
unsigned short Plane() const
Definition: CellHit.h:39

Member Data Documentation

float zcl::SPCluster::_deltaC_C
private

Definition at line 77 of file SPCluster_module.cc.

Referenced by ContaineAssign().

float zcl::SPCluster::_deltaC_S
private

Definition at line 75 of file SPCluster_module.cc.

Referenced by SurfAssign().

float zcl::SPCluster::_deltaP_C
private

Definition at line 76 of file SPCluster_module.cc.

Referenced by ContaineAssign().

float zcl::SPCluster::_deltaP_S
private

Definition at line 74 of file SPCluster_module.cc.

Referenced by SurfAssign(), and ViewCheck().

unsigned zcl::SPCluster::_deltaT
private

Definition at line 72 of file SPCluster_module.cc.

Referenced by produce(), and ViewCheck().

float zcl::SPCluster::_df
private

Definition at line 84 of file SPCluster_module.cc.

Referenced by produce().

float zcl::SPCluster::_DistMin
private

Definition at line 81 of file SPCluster_module.cc.

Referenced by produce().

float zcl::SPCluster::_hf_min
private

Definition at line 68 of file SPCluster_module.cc.

Referenced by produce().

unsigned zcl::SPCluster::_minHits
private

Definition at line 73 of file SPCluster_module.cc.

Referenced by produce().

float zcl::SPCluster::_sigmaL
private

Definition at line 78 of file SPCluster_module.cc.

Referenced by produce().

unsigned zcl::SPCluster::_sigmaT
private

Definition at line 71 of file SPCluster_module.cc.

Referenced by produce().

float zcl::SPCluster::_vproMax
private

Definition at line 83 of file SPCluster_module.cc.

Referenced by produce().

float zcl::SPCluster::_vproMin
private

Definition at line 82 of file SPCluster_module.cc.

Referenced by produce().

float zcl::SPCluster::_Xmax
private

Definition at line 79 of file SPCluster_module.cc.

Referenced by ContaineAssign(), produce(), and SurfAssign().

float zcl::SPCluster::_Ymax
private

Definition at line 80 of file SPCluster_module.cc.

Referenced by ContaineAssign(), and SurfAssign().

std::string zcl::SPCluster::fCellHitInput
private

Definition at line 67 of file SPCluster_module.cc.

Referenced by produce().


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