LDMX Software
trigscint::TrigScintClusterProducer Class Reference

Public Member Functions

 TrigScintClusterProducer (const std::string &name, framework::Process &process)
 
void configure (framework::config::Parameters &ps) override
 Callback for the EventProcessor to configure itself from the given set of parameters.
 
void produce (framework::Event &event) override
 Process the event and put new data products into it.
 
virtual void addHit (uint idx, ldmx::TrigScintHit hit)
 add a hit at index idx to a cluster
 
void onProcessStart () override
 Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms.
 
void onProcessEnd () override
 Callback for the EventProcessor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities.
 
- Public Member Functions inherited from framework::Producer
 Producer (const std::string &name, Process &process)
 Class constructor.
 
virtual void beforeNewRun (ldmx::RunHeader &header)
 Handle allowing producers to modify run headers before the run begins.
 
- Public Member Functions inherited from framework::EventProcessor
 EventProcessor (const std::string &name, Process &process)
 Class constructor.
 
virtual ~EventProcessor ()
 Class destructor.
 
virtual void onNewRun (const ldmx::RunHeader &runHeader)
 Callback for the EventProcessor to take any necessary action when the run being processed changes.
 
virtual void onFileOpen (EventFile &eventFile)
 Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened.
 
virtual void onFileClose (EventFile &eventFile)
 Callback for the EventProcessor to take any necessary action when a event input ROOT file is closed.
 
template<class T >
const T & getCondition (const std::string &condition_name)
 Access a conditions object for the current event.
 
TDirectory * getHistoDirectory ()
 Access/create a directory in the histogram file for this event processor to create histograms and analysis tuples.
 
void setStorageHint (framework::StorageControl::Hint hint)
 Mark the current event as having the given storage control hint from this module.
 
void setStorageHint (framework::StorageControl::Hint hint, const std::string &purposeString)
 Mark the current event as having the given storage control hint from this module and the given purpose string.
 
int getLogFrequency () const
 Get the current logging frequency from the process.
 
int getRunNumber () const
 Get the run number from the process.
 
std::string getName () const
 Get the processor name.
 
void createHistograms (const std::vector< framework::config::Parameters > &histos)
 Internal function which is used to create histograms passed from the python configuration @parma histos vector of Parameters that configure histograms to create.
 

Private Attributes

std::vector< ldmx::TrigScintClusterclusters_
 
double seed_ {0.}
 
double minThr_ {0.}
 
int maxWidth_ {2}
 
int verbose_ {0}
 
double padTime_ {0.}
 
double timeTolerance_ {0.}
 
std::string input_collection_
 
std::string output_collection_
 
std::string passName_ {""}
 
int vertBarStartIdx_ {52}
 
float centroid_ {0.}
 
float centroidX_ {-1}
 
float centroidY_ {-1}
 
float val_ {0.}
 
float valE_ {0.}
 
std::vector< unsigned int > v_addedIndices_
 
std::vector< unsigned int > v_usedIndices_
 
float beamE_ {0.}
 
float time_ {0.}
 
std::map< int, int > hitChannelMap_
 

Additional Inherited Members

- Static Public Member Functions inherited from framework::EventProcessor
static void declare (const std::string &classname, int classtype, EventProcessorMaker *)
 Internal function which is part of the PluginFactory machinery.
 
- Static Public Attributes inherited from framework::Producer
static const int CLASSTYPE {1}
 Constant used to track EventProcessor types by the PluginFactory.
 
- Protected Member Functions inherited from framework::EventProcessor
void abortEvent ()
 Abort the event immediately.
 
- Protected Attributes inherited from framework::EventProcessor
HistogramHelper histograms_
 Interface class for making and filling histograms.
 
NtupleManagerntuple_ {NtupleManager::getInstance()}
 Manager for any ntuples.
 
logging::logger theLog_
 The logger for this EventProcessor.
 

Detailed Description

Definition at line 24 of file TrigScintClusterProducer.h.

Constructor & Destructor Documentation

◆ TrigScintClusterProducer()

trigscint::TrigScintClusterProducer::TrigScintClusterProducer ( const std::string & name,
framework::Process & process )
inline

Definition at line 26 of file TrigScintClusterProducer.h.

27 : Producer(name, process) {}
Producer(const std::string &name, Process &process)
Class constructor.

Member Function Documentation

◆ addHit()

void trigscint::TrigScintClusterProducer::addHit ( uint idx,
ldmx::TrigScintHit hit )
virtual

add a hit at index idx to a cluster

Definition at line 471 of file TrigScintClusterProducer.cxx.

471 {
472 float ampl = hit.getPE();
473 val_ += ampl;
474 float energy = hit.getEnergy();
475 valE_ += energy;
476
477 centroid_ += (idx + 1) * ampl; // need non-zero weight of channel 0. shifting
478 // centroid back by 1 in the end
479 // this number gets divided by val at the end
480 v_addedIndices_.push_back(idx);
481
482 beamE_ += hit.getBeamEfrac() * energy;
483 if (hit.getTime() > -990.) {
484 time_ += hit.getTime() * ampl;
485 }
486
487 v_usedIndices_.push_back(idx);
488 /* // not working properly, but i'd prefer this type of solution
489 hitChannelMap_.erase( idx ) ;
490 if (verbose_ > 1 ) {
491 ldmx_log(debug) << "Removed used hit " << idx << " from list";
492 }
493 if ( hitChannelMap_.find( idx) != hitChannelMap_.end() )
494 std::cerr << "----- WARNING! Hit still present in map after removal!! ";
495 */
496 if (verbose_ > 1) {
497 ldmx_log(debug) << " In addHit, adding hit at " << idx
498 << " with amplitude " << ampl
499 << ", updating cluster to current centroid "
500 << centroid_ / val_ - 1 << " and energy " << val_
501 << ". index vector now ends with "
502 << v_addedIndices_.back();
503 }
504
505 return;
506}
float getEnergy() const
Get the calorimetric energy of the hit, corrected for sampling factors [MeV].
float getTime() const
Get the time of the hit [ns].
float getPE() const
Get the hit pe.
float getBeamEfrac() const
Get the beam energy fraction.

References ldmx::TrigScintHit::getBeamEfrac(), ldmx::CalorimeterHit::getEnergy(), ldmx::TrigScintHit::getPE(), and ldmx::CalorimeterHit::getTime().

Referenced by produce().

◆ configure()

void trigscint::TrigScintClusterProducer::configure ( framework::config::Parameters & parameters)
overridevirtual

Callback for the EventProcessor to configure itself from the given set of parameters.

The parameters a processor has access to are the member variables of the python class in the sequence that has className equal to the EventProcessor class name.

For an example, look at MyProcessor.

Parameters
parametersParameters for configuration.

Reimplemented from framework::EventProcessor.

Definition at line 9 of file TrigScintClusterProducer.cxx.

9 {
10 seed_ = ps.getParameter<double>("seed_threshold");
11 minThr_ = ps.getParameter<double>("clustering_threshold");
12 maxWidth_ = ps.getParameter<int>("max_cluster_width");
13 input_collection_ = ps.getParameter<std::string>("input_collection");
14 passName_ = ps.getParameter<std::string>("input_pass_name");
15 output_collection_ = ps.getParameter<std::string>("output_collection");
16 verbose_ = ps.getParameter<int>("verbosity");
17 vertBarStartIdx_ = ps.getParameter<int>("vertical_bar_start_index");
18 timeTolerance_ = ps.getParameter<double>("time_tolerance");
19 padTime_ = ps.getParameter<double>("pad_time");
20 if (verbose_) {
21 ldmx_log(info) << "In TrigScintClusterProducer: configure done!";
22 ldmx_log(info) << "Got parameters: \nSeed threshold: " << seed_
23 << "\nClustering threshold: " << minThr_
24 << "\nMax cluster width: " << maxWidth_
25 << "\nExpected pad hit time: " << padTime_
26 << "\nMax hit time delay: " << timeTolerance_
27 << "\nVertical bar start index: " << vertBarStartIdx_
28 << "\nInput collection: " << input_collection_
29 << "\nInput pass name: " << passName_
30 << "\nOutput collection: " << output_collection_
31 << "\nVerbosity: " << verbose_;
32 }
33
34 return;
35}

◆ onProcessEnd()

void trigscint::TrigScintClusterProducer::onProcessEnd ( )
overridevirtual

Callback for the EventProcessor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities.

Reimplemented from framework::EventProcessor.

Definition at line 514 of file TrigScintClusterProducer.cxx.

514 {
515 ldmx_log(debug) << "Process ends!";
516
517 return;
518}

◆ onProcessStart()

void trigscint::TrigScintClusterProducer::onProcessStart ( )
overridevirtual

Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms.

Reimplemented from framework::EventProcessor.

Definition at line 508 of file TrigScintClusterProducer.cxx.

508 {
509 ldmx_log(debug) << "Process starts!";
510
511 return;
512}

◆ produce()

void trigscint::TrigScintClusterProducer::produce ( framework::Event & event)
overridevirtual

Process the event and put new data products into it.

Parameters
eventThe Event to process.

Implements framework::Producer.

Definition at line 37 of file TrigScintClusterProducer.cxx.

37 {
38 // parameters.
39 // a cluster seeding threshold
40 // a clustering threshold -- a lower boundary for being added at all (zero
41 // suppression)
42 // a maximum cluster width
43 //
44 // steps.
45 // 1. get an input collection of digi hits. at most one entry per channel.
46 // 2. access them by channel number
47 // 3. clustering:
48 // a. add first hit > seedThr to cluster(ling) . store content as
49 // localMax. track size of cluster (1) b. if not in beginning of array:
50 // add cell before while content < add next hit first hit > seedThr to
51 // cluster(ling) b. while content < add next hit first hit > seedThr to
52 // cluster(ling)
53
54 /*
55
56 The trigger pad geometry considered for this clustering algorithm is:
57
58
59 | | | | | |
60 | 0 | 2 | 4 | 6 | 8 | ... | 48|
61
62 | 1 | 3 | 5 | 7 | 9 | ... | 49|
63 | | | | | |
64
65 with hits in channels after digi looking something like this
66
67
68 ampl: _ _ _
69 | |_ | | | |
70 ----| | |---------------| |-----------------| |------- cluster seed
71 threshold | | |_ | |_ _ | |_
72 _| | | | _| | | | _| | | _
73 | | | | | vs | | | | | vs | | | | | |
74
75
76 | | |
77 split | seeds keep | disregard keep! | just move on
78 | next cl. | (later seed | (no explicit splitting)
79 might pick
80 it up)
81
82
83 The idea being that while there could be good reasons for an electron to
84 touch three pads in a row, there is no good reason for it to cross four.
85 This is noise, or, the start of an adjacent cluster. In any case, 4 is not a
86 healthy cluster. Proximity to a seed governs which below-seed channels to
87 include. By always starting in one end but going back (at most two
88 channels), this algo guarantees symmetric treatment on both sides of the
89 seed.
90
91
92 //Procedure: keep going until there is a seed. walk back at most 2 steps
93 // add all the hits. clusters of up to 3 is fine.
94 // if the cluster is > 3, then we need to do something.
95 // if it's == 4, we'd want to split in the middle if there are two potential
96 seeds. retain only the first half, cases are (seed = s, n - no/noise)
97 // nsns , nssn, snsn, ssnn. nnss won't happen (max 1 step back from s,
98 unless there is nothing in front)
99 // all these are ok to split like this bcs even if ssnn--> ss and some small
100 nPE is lost, that's probably pretty negligible wrt the centroid position,
101 with two seeds in one cluster
102
103 // if it's > 4, cases are
104 // nsnsn, nsnss, nssnn, nssns, snsnn, snsns, ssnnn, ssnns.
105 // these are also all ok to just truncate after 2. and then the same check
106 outlined above will happen to the next chunk.
107
108 // so in short we can
109 // 1. seed --> addHit
110 // 2. walk back once --> addHit
111 // 3. check next: if seed+1 exists && seed +2 exists,
112 // 3a. if seed-1 is in already, stop here.
113 // 3b. else if seed+3 exists, stop here.
114 // 3c. else addHit(seed+1), addHit(seed+2)
115 // 4. if seed+1 and !seed+2 --> addHit(seed+1)
116 // 5. at this point, if clusterSize is 2 hits and seed+1 didn't exist, we
117 can afford to walk back one more step and add whatever junk was there (we
118 know it's not a seed)
119
120
121 */
122
123 if (verbose_) {
124 ldmx_log(debug)
125 << "TrigScintClusterProducer: produce() starts! Event number: "
126 << event.getEventHeader().getEventNumber();
127 }
128
129 // looper over digi hits and aggregate energy depositions for each detID
130
131 const auto digis{
132 event.getCollection<ldmx::TrigScintHit>(input_collection_, passName_)};
133
134 if (verbose_) {
135 ldmx_log(debug) << "Got digi collection " << input_collection_ << "_"
136 << passName_ << " with " << digis.size() << " entries ";
137 }
138
139 // TODO remove this once verified that the noise overlap bug is gone
140 bool doDuplicate = true;
141
142 // 1. store all the channel digi content in channel order
143 auto iDigi{0};
144 for (const auto &digi : digis) {
145 // these are unordered hits, and this collection is zero-suppressed
146 // map the index of the digi to the channel index
147
148 if (digi.getPE() >
149 minThr_) { // cut on a min threshold (for a non-seeding hit to be added
150 // to seeded clusters) already here
151
152 int ID = digi.getBarID();
153
154 // first check if there is a (pure) noise hit at this channel, and
155 // replace it in that case. this is a protection against a problem that
156 // shouldn't be there in the first place.
157 if (doDuplicate && hitChannelMap_.find((ID)) != hitChannelMap_.end()) {
158 int idx = ID;
159 std::map<int, int>::iterator itr = hitChannelMap_.find(idx);
160 double oldVal = digis.at(itr->second).getPE();
161 if (verbose_) {
162 ldmx_log(debug) << "Got duplicate digis for channel " << idx
163 << ", with already inserted value " << oldVal
164 << " and new " << digi.getPE();
165 }
166 if (digi.getPE() > oldVal) {
167 hitChannelMap_.erase(itr->first);
168 if (verbose_) {
169 ldmx_log(debug)
170 << "Skipped duplicate digi with smaller value for channel "
171 << idx;
172 }
173 }
174 }
175
176 // don't add in late hits
177 if (digi.getTime() > padTime_ + timeTolerance_) {
178 iDigi++;
179 continue;
180 }
181
182 hitChannelMap_.insert(std::pair<int, int>(ID, iDigi));
183 // the channel number is the key, the digi list index is the value
184
185 if (verbose_) {
186 ldmx_log(debug) << "Mapping digi hit nb " << iDigi
187 << " with energy = " << digi.getEnergy()
188 << " MeV, nPE = " << digi.getPE() << " > " << minThr_
189 << " to key/channel " << ID;
190 }
191 }
192 iDigi++;
193 }
194
195 // 2. now step through all the channels in the map and cluster the hits
196
197 std::map<int, int>::iterator itr;
198
199 // Create the container to hold the digitized trigger scintillator hits.
200 std::vector<ldmx::TrigScintCluster> trigScintClusters;
201
202 // loop over channels
203 for (itr = hitChannelMap_.begin(); itr != hitChannelMap_.end(); ++itr) {
204 // this hit may have disappeared
205 if (hitChannelMap_.find(itr->first) == hitChannelMap_.end()) {
206 if (verbose_ > 1) {
207 ldmx_log(debug) << "Attempting to use removed hit at channel "
208 << itr->first << "; skipping.";
209 }
210 continue;
211 }
212
213 // i don't like this but for now, erasing elements in the map leads, as it
214 // turns out, to edge cases where i miss out on hits or run into
215 // non-existing indices. so while what i do below means that i don't need to
216 // erase hits, i'd rather find a way to do that and skip this book keeping:
217 bool hasUsed = false;
218 for (const auto &index : v_usedIndices_) {
219 if (index == itr->first) {
220 if (verbose_ > 1) {
221 ldmx_log(warn) << "Attempting to re-use hit at channel " << itr->first
222 << "; skipping.";
223 }
224 hasUsed = true;
225 }
226 }
227 if (hasUsed) continue;
228 if (verbose_ > 1) {
229 ldmx_log(debug) << "\t At hit with channel nb " << itr->first << ".";
230 }
231
232 if (hitChannelMap_.size() ==
233 0) // we removed them all..? shouldn't ever happen
234 {
235 if (verbose_)
236 ldmx_log(warn) << "Time flies, and all clusters have already been "
237 "removed! Unclear how we even got here; interfering "
238 "here to get out of the loop. ";
239 break;
240 }
241
242 ldmx::TrigScintHit digi = (ldmx::TrigScintHit)digis.at(itr->second);
243
244 // skip all until hit a seed
245 if (digi.getPE() >= seed_) {
246 if (verbose_ > 1) {
247 ldmx_log(debug) << "Seeding cluster with channel " << itr->first
248 << "; content " << digi.getPE();
249 }
250
251 // 1. add seeding hit to cluster
252
253 addHit(itr->first, digi);
254
255 if (verbose_ > 1) {
256 ldmx_log(debug) << "\t itr is pointing at hit with channel nb "
257 << itr->first << ".";
258 }
259
260 // ----- first look back one step
261
262 // we have added the hit from the neighbouring channel to the list only if
263 // it's above clustering threshold so no check needed now
264 std::map<int, int>::iterator itrBack =
265 hitChannelMap_.find(itr->first - 1);
266
267 bool hasBacked = false;
268
269 if (itrBack !=
270 hitChannelMap_.end()) { // there is an entry for the previous
271 // channel, so it had content above threshold
272 // but it wasn't enough to seed a cluster. so, unambiguous that it
273 // should be added here because it's its only chance to get in.
274
275 // need to check again for backwards hits
276 hasUsed = false;
277 for (const auto &index : v_usedIndices_) {
278 if (index == itrBack->first) {
279 if (verbose_ > 1) {
280 ldmx_log(warn) << "Attempting to re-use hit at channel "
281 << itrBack->first << "; skipping.";
282 }
283 hasUsed = true;
284 }
285 }
286 if (!hasUsed) {
287 digi = (ldmx::TrigScintHit)digis.at(itrBack->second);
288
289 // 2. add seed-1 to cluster
290 addHit(itrBack->first, digi);
291 hasBacked = true;
292
293 if (verbose_ > 1) {
294 ldmx_log(debug) << "Added -1 channel " << itrBack->first
295 << " to cluster; content " << digi.getPE();
296 ldmx_log(debug) << "\t itr is pointing at hit with channel nb "
297 << itr->first << ".";
298 }
299
300 } // if seed-1 wasn't used already
301 } // there exists a lower, unused neighbour
302
303 // 3. check next: if seed+1 exists && seed +2 exists,
304 // 3a. if seed-1 is in already, this is a case for a split, at seed. go
305 // directly to check on seed-2, don't add more here. 3b. else. addHit
306 // (seed+1) 3c. if seed+3 exists, this is a split, at seed+1. don't add
307 // more here. 3d. else addHit(seed+2)
308 // 4. if seed+1 and !seed+2 --> go to addHit(seed+1)
309
310 // --- now, step 3, 4: look ahead 1 step from seed
311
312 if (v_addedIndices_.size() < maxWidth_) {
313 // (in principle these don't need to be different iterators, but it
314 // makes the logic easier to follow)
315 std::map<int, int>::iterator itrNeighb =
316 hitChannelMap_.find(itr->first + 1);
317 if (itrNeighb !=
318 hitChannelMap_.end()) { // there is an entry for the next channel,
319 // so it had content above threshold
320 // seed+1 exists
321 // check if there is sth in position seed+2
322 if (hitChannelMap_.find(itrNeighb->first + 1) !=
323 hitChannelMap_.end()) { // a hit with that key exists, so seed+1
324 // and seed+2 exist
325 if (!hasBacked) { // there is no seed-1 in the cluster. room for at
326 // least seed+1, and for seed+2 only if there is
327 // no seed+3
328 // 3b
329 digi = (ldmx::TrigScintHit)digis.at(itrNeighb->second);
330 addHit(itrNeighb->first, digi);
331
332 if (verbose_ > 1) {
333 ldmx_log(debug)
334 << "No -1 hit. Added +1 channel " << itrNeighb->first
335 << " to cluster; content " << digi.getPE();
336 ldmx_log(debug) << "\t itr is pointing at hit with channel nb "
337 << itr->first << ".";
338 }
339
340 if (v_addedIndices_.size() < maxWidth_) {
341 if (hitChannelMap_.find(itrNeighb->first + 2) ==
342 hitChannelMap_
343 .end()) { // no seed+3. also no seed-1. so add seed+2
344 // 3d. add seed+2 to the cluster
345 itrNeighb = hitChannelMap_.find(itr->first + 2);
346 digi = (ldmx::TrigScintHit)digis.at(itrNeighb->second);
347 addHit(itrNeighb->first, digi);
348 if (verbose_ > 1) {
349 ldmx_log(debug)
350 << "No +3 hit. Added +2 channel " << itrNeighb->first
351 << " to cluster; content " << digi.getPE();
352 ldmx_log(debug)
353 << "\t itr is pointing at hit with channel nb "
354 << itr->first << ".";
355 }
356 }
357
358 } // if no seed+3 --> added seed+2
359 } // if seed-1 wasn't added
360 } // if seed+2 exists. then already added seed+1.
361 else { // so: if not, then we need to add seed+1 here. (step 4)
362 digi = (ldmx::TrigScintHit)digis.at(
363 itrNeighb->second); // itrNeighb hasn't moved since there was
364 // no seed+2
365 addHit(itrNeighb->first, digi);
366
367 if (verbose_ > 1) {
368 ldmx_log(debug)
369 << "Added +1 channel " << itrNeighb->first
370 << " as last channel to cluster; content " << digi.getPE();
371 ldmx_log(debug) << "\t itr is pointing at hit with channel nb "
372 << itr->first << ".";
373 }
374 }
375 } // if seed+1 exists
376 // 5. at this point, if clusterSize is 2 hits and seed+1 didn't exist,
377 // we can afford to walk back one more step and add whatever junk was
378 // there (we know it's not a seed)
379 else if (hasBacked &&
380 hitChannelMap_.find(itrBack->first - 1) !=
381 hitChannelMap_
382 .end()) { // seed-1 has been added, but not seed+1,
383 // and there is a hit in seed-2
384 itrBack = hitChannelMap_.find(itr->first - 2);
385 digi = (ldmx::TrigScintHit)digis.at(itrBack->second);
386 addHit(itrBack->first, digi);
387
388 if (verbose_ > 1) {
389 ldmx_log(debug) << "Added -2 channel " << itrBack->first
390 << " to cluster; content " << digi.getPE();
391 }
392 if (verbose_ > 1) {
393 ldmx_log(debug) << "\t itr is pointing at hit with channel nb "
394 << itr->first << ".";
395 }
396
397 } // check if add in seed -2
398
399 } // if adding another hit, going forward, was allowed
400
401 // done adding hits to cluster. calculate centroid
402 centroid_ /= val_; // final weighting step: divide by total
403 centroid_ -= 1; // shift back to actual channel center
404
406
407 if (verbose_ > 1) {
408 ldmx_log(debug) << "Now have " << v_addedIndices_.size()
409 << " hits in the cluster ";
410 }
411 cluster.setSeed(v_addedIndices_.at(0));
412 cluster.setIDs(v_addedIndices_);
413 cluster.setNHits(v_addedIndices_.size());
414 cluster.setCentroid(centroid_);
415 float cx;
416 float cy = centroid_;
417 float cz = -99999; // set to nonsense for now. could be set to module nb
418 if (centroid_ <
419 vertBarStartIdx_) // then in horizontal bars --> we don't know X
420 cx = -1; // set to nonsense in barID space. could translate to x=0 mm
421 else {
422 cx = (int)((centroid_ - vertBarStartIdx_) / 4); // start at 0
423 cy = (int)centroid_ % 4;
424 }
425 cluster.setCentroidXYZ(cx, cy, cz);
426 cluster.setEnergy(valE_);
427 cluster.setPE(val_);
428 cluster.setTime(time_ / val_);
429 cluster.setBeamEfrac(beamE_ / valE_);
430
431 trigScintClusters.push_back(cluster);
432
433 if (verbose_) cluster.Print();
434
435 centroid_ = 0;
436 centroidX_ = -1;
437 centroidY_ = -1;
438 val_ = 0;
439 valE_ = 0;
440 beamE_ = 0;
441 time_ = 0;
442 v_addedIndices_.resize(
443 0); // book keep which channels have already been added to a cluster
444
445 if (verbose_ > 1) {
446 ldmx_log(debug)
447 << "\t Finished processing of seeding hit with channel nb "
448 << itr->first << ".";
449 }
450
451 } // if content enough to seed a cluster
452
453 if (hitChannelMap_.begin() == hitChannelMap_.end()) {
454 if (verbose_)
455 ldmx_log(warn) << "Time flies, and all clusters have already been "
456 "removed! Interfering here to get out of the loop. ";
457 break;
458 }
459 } // over channels
460
461 if (trigScintClusters.size() > 0)
462 event.add(output_collection_, trigScintClusters);
463
464 hitChannelMap_.clear();
465 v_usedIndices_.resize(
466 0); // book keep which channels have already been added to a cluster
467
468 return;
469}
Stores cluster information from the trigger scintillator pads.
void setIDs(std::vector< unsigned int > &hitIDs)
The channel numbers of hits forming the cluster.
void setNHits(int nHits)
The number of hits forming the cluster.
void setCentroidXYZ(double x, double y, double z)
The cluster centroid in x,y,z.
void setEnergy(double energy)
Set the cluster energy.
void Print(Option_t *option="") const
Print a description of this object.
void setCentroid(double centroid)
void setPE(float PE)
Set the cluster photoelectron count (PE)
void setBeamEfrac(float e)
Set beam energy fraction of hit.
void setTime(float t)
Set time of hit.
virtual void addHit(uint idx, ldmx::TrigScintHit hit)
add a hit at index idx to a cluster

References addHit(), ldmx::TrigScintHit::getPE(), ldmx::TrigScintCluster::Print(), ldmx::TrigScintCluster::setBeamEfrac(), ldmx::TrigScintCluster::setCentroid(), ldmx::TrigScintCluster::setCentroidXYZ(), ldmx::TrigScintCluster::setEnergy(), ldmx::TrigScintCluster::setIDs(), ldmx::TrigScintCluster::setNHits(), ldmx::TrigScintCluster::setPE(), ldmx::TrigScintCluster::setSeed(), and ldmx::TrigScintCluster::setTime().

Member Data Documentation

◆ beamE_

float trigscint::TrigScintClusterProducer::beamE_ {0.}
private

Definition at line 99 of file TrigScintClusterProducer.h.

99{0.};

◆ centroid_

float trigscint::TrigScintClusterProducer::centroid_ {0.}
private

Definition at line 77 of file TrigScintClusterProducer.h.

77{0.};

◆ centroidX_

float trigscint::TrigScintClusterProducer::centroidX_ {-1}
private

Definition at line 80 of file TrigScintClusterProducer.h.

80{-1};

◆ centroidY_

float trigscint::TrigScintClusterProducer::centroidY_ {-1}
private

Definition at line 83 of file TrigScintClusterProducer.h.

83{-1};

◆ clusters_

std::vector<ldmx::TrigScintCluster> trigscint::TrigScintClusterProducer::clusters_
private

Definition at line 44 of file TrigScintClusterProducer.h.

◆ hitChannelMap_

std::map<int, int> trigscint::TrigScintClusterProducer::hitChannelMap_
private

Definition at line 105 of file TrigScintClusterProducer.h.

◆ input_collection_

std::string trigscint::TrigScintClusterProducer::input_collection_
private

Definition at line 65 of file TrigScintClusterProducer.h.

◆ maxWidth_

int trigscint::TrigScintClusterProducer::maxWidth_ {2}
private

Definition at line 53 of file TrigScintClusterProducer.h.

53{2};

◆ minThr_

double trigscint::TrigScintClusterProducer::minThr_ {0.}
private

Definition at line 50 of file TrigScintClusterProducer.h.

50{0.};

◆ output_collection_

std::string trigscint::TrigScintClusterProducer::output_collection_
private

Definition at line 68 of file TrigScintClusterProducer.h.

◆ padTime_

double trigscint::TrigScintClusterProducer::padTime_ {0.}
private

Definition at line 59 of file TrigScintClusterProducer.h.

59{0.};

◆ passName_

std::string trigscint::TrigScintClusterProducer::passName_ {""}
private

Definition at line 71 of file TrigScintClusterProducer.h.

71{""};

◆ seed_

double trigscint::TrigScintClusterProducer::seed_ {0.}
private

Definition at line 47 of file TrigScintClusterProducer.h.

47{0.};

◆ time_

float trigscint::TrigScintClusterProducer::time_ {0.}
private

Definition at line 102 of file TrigScintClusterProducer.h.

102{0.};

◆ timeTolerance_

double trigscint::TrigScintClusterProducer::timeTolerance_ {0.}
private

Definition at line 62 of file TrigScintClusterProducer.h.

62{0.};

◆ v_addedIndices_

std::vector<unsigned int> trigscint::TrigScintClusterProducer::v_addedIndices_
private

Definition at line 92 of file TrigScintClusterProducer.h.

◆ v_usedIndices_

std::vector<unsigned int> trigscint::TrigScintClusterProducer::v_usedIndices_
private

Definition at line 95 of file TrigScintClusterProducer.h.

◆ val_

float trigscint::TrigScintClusterProducer::val_ {0.}
private

Definition at line 86 of file TrigScintClusterProducer.h.

86{0.};

◆ valE_

float trigscint::TrigScintClusterProducer::valE_ {0.}
private

Definition at line 89 of file TrigScintClusterProducer.h.

89{0.};

◆ verbose_

int trigscint::TrigScintClusterProducer::verbose_ {0}
private

Definition at line 56 of file TrigScintClusterProducer.h.

56{0};

◆ vertBarStartIdx_

int trigscint::TrigScintClusterProducer::vertBarStartIdx_ {52}
private

Definition at line 74 of file TrigScintClusterProducer.h.

74{52};

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