Belle II Software development
Segment.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9//-----------------------------------------------------------------------------
10// Description : A class to represent a wire in CDC.
11//-----------------------------------------------------------------------------
12
13#define TRG_SHORT_NAMES
14#define TRGCDC_SHORT_NAMES
15
16#include <iostream>
17#include "trg/trg/Utilities.h"
18#include "trg/trg/Debug.h"
19#include "trg/cdc/Wire.h"
20#include "trg/cdc/WireHit.h"
21#include "trg/cdc/Segment.h"
22#include "trg/cdc/SegmentHit.h"
23#include "trg/cdc/LUT.h"
24
25#include <framework/datastore/StoreArray.h>
26#include <cdc/dataobjects/CDCHit.h>
27#include <trg/cdc/dataobjects/CDCTriggerSegmentHit.h>
28#include <mdst/dataobjects/MCParticle.h>
29
30#define P3D HepGeom::Point3D<double>
31
32namespace Belle2 {
37
39 const TCLayer& layer,
40 const TCWire& w,
41 const TRGClock& clock,
42 const std::string& TSLUTFile,
43 const std::vector<const TCWire*>& cells)
44 : TCCell(id,
45 layer.size(),
46 layer,
49 m_wires(cells),
50 m_signal(std::string("TS_") + TRGUtil::itostring(id), clock),
52 m_TSLUTFileName(TSLUTFile)
53 {
54 }
55
56
60
61 void
66
67 void
68 TRGCDCSegment::dump(const std::string& msg,
69 const std::string& pre) const
70 {
71 std::cout << pre << name() << " (ptn=" << hitPattern() << ")" << std::endl;
72 if ((msg.find("geometry") != std::string::npos) ||
73 (msg.find("detail") != std::string::npos)) {
74 std::cout << pre << "id " << id();
75 std::cout << ",local " << localId();
76 std::cout << ",layer " << layerId();
77 std::cout << ",super layer " << superLayerId();
78 std::cout << ",local layer " << localLayerId();
79 std::cout << std::endl;
80 }
81 if ((msg.find("hit") != std::string::npos) ||
82 (msg.find("detail") != std::string::npos)) {
83 std::cout << pre << "Wires ";
84 for (unsigned i = 0; i < m_wires.size(); i++) {
85 std::cout << m_wires[i]->name();
86 if (i < m_wires.size() - 1)
87 std::cout << ",";
88 else
89 std::cout << std::endl;
90 }
91 if (m_hits.size() == 0) {
92 std::cout << pre << "no wire hit" << std::endl;
93 } else {
94 std::cout << pre << "WHit dump : ";
95 for (unsigned i = 0; i < m_hits.size(); i++) {
96 std::cout << m_hits[i]->cell().name();
97 if (i < m_hits.size() - 1)
98 std::cout << ",";
99 else
100 std::cout << std::endl;
101 }
102 for (unsigned i = 0; i < m_hits.size(); i++) {
103 m_hits[i]->dump(msg, pre + " ");
104 }
105 }
106 if (hit()) {
107 std::cout << pre << "SHit dump" << std::endl;
108 hit()->dump(msg, pre + " ");
109 } else {
110 std::cout << pre << "no TSHit" << std::endl;
111 }
112 }
113// if (msg.find("neighbor") != std::string::npos ||
114// msg.find("detail") != std::string::npos) {
115// for (unsigned i = 0; i < 7; i++)
116// if (neighbor(i))
117// neighbor(i)->dump("", pre + TRGCDC::itostring(i) + " ");
118// }
119 if ((msg.find("trigger") != std::string::npos) ||
120 (msg.find("detail") != std::string::npos)) {
121 if (m_signal.active())
122 m_signal.dump(msg, pre + " ");
123 else
124 std::cout << pre << "no trigger signal" << std::endl;
125 }
126 }
127
128 void
130 {
131 TCCell::clear();
132 m_signal.clear();
133 m_hits.clear();
134 m_storeHits.clear();
135 }
136
137 std::string
139 {
140 std::string t;
141 if (axial())
142 t = "-";
143 else
144 t = "=";
145 std::string n0 = std::string("TS") + TRGUtil::itostring(layerId());
146 std::string n1 = TRGUtil::itostring(localId());
147 return n0 + t + n1;
148 }
149
150 void
151 TRGCDCSegment::simulate(bool clockSimulation, bool logicLUTFlag,
152 const std::string& cdcCollectionName, const std::string& tsCollectionName)
153 {
154 //...Get wire information for speed-up...
155 unsigned nHits = 0;
156 for (unsigned i = 0, n = m_wires.size(); i < n; i++) {
157 if (m_wires[i]->signal().active())
158 ++nHits;
159 }
160
161 //..No wire hit case...
162 if (nHits == 0)
163 return;
164
165 if (clockSimulation) {
166 simulateWithClock(cdcCollectionName, tsCollectionName);
167 } else {
168 simulateWithoutClock(logicLUTFlag);
169 }
170 }
171
172 void
174 {
175 TRGDebug::enterStage("TS sim");
176
177 //...Get wire information...
178 const unsigned n = m_wires.size();
179 unsigned nHits = 0;
180 std::vector<TRGSignal> signals;
181 signals.reserve(n);
182 m_hits.reserve(n);
183 for (unsigned i = 0; i < n; i++) {
184
185 //...Store wire hit information...
186 const TCWHit* h = m_wires[i]->hit();
187 if (h)
188 m_hits.push_back(h);
189
190 //...Copy signal from a wire...
191 const TRGSignal& s = m_wires[i]->signal();
192 signals.push_back(s);
193
194 //...Widen it...
195 const unsigned width = signals.back().clock().unit(1000);
196 signals.back().widen(width);
197
198 if (s.active())
199 ++nHits;
200 }
201
202 if (logicLUTFlag == 0) {
204 //...Check number of hit wires...
205 //std::cout<<"TSF: nHits is "<<nHits<<std::endl;
206 if (nHits < 4) {
207 TRGDebug::leaveStage("TS sim");
208 return;
209 }
210
211 //...Signal simulation...
212 TRGSignal l0, l1, l2, l3, l4;
213 TRGSignal wo1, wo2, wo3, wo4;
214 TRGSignal all;
215 if (n == 11) {
216
217 //...Simple simulation assuming 3:2:1:2:3 shape...
218 l0 = signals[0] | signals[1] | signals[2];
219 l1 = signals[3] | signals[4];
220 l2 = signals[5];
221 l3 = signals[6] | signals[7];
222 l4 = signals[8] | signals[9] | signals[10];
223 //l0.dump();
224 //l1.dump();
225 //l2.dump();
226 //l3.dump();
227 //l4.dump();
228 wo1 = l1 & l3 & l4;
229 wo2 = l0 & l3 & l4;
230 wo3 = l0 & l1 & l4;
231 wo4 = l0 & l1 & l3;
232 all = l2 & (wo1 | wo2 | wo3 | wo4);
233
234 } else if (n == 15) {
235
236 //...Simple simulation assuming 1:2:3:4:5 shape...
237 l0 = signals[0];
238 l1 = signals[1] | signals[2];
239 l2 = signals[3] | signals[4] | signals[5];
240 l3 = signals[6] | signals[7] | signals[8] | signals[9];
241 l4 = signals[10] | signals[11] | signals[12] | signals[13] | signals[14];
242 wo1 = l2 & l3 & l4;
243 wo2 = l1 & l3 & l4;
244 wo3 = l1 & l2 & l4;
245 wo4 = l1 & l2 & l3;
246 all = l0 & (wo1 | wo2 | wo3 | wo4);
247 }
248
249 //...Coincidence of all layers...
250// TRGSignal all = l0 & l1 & l2 & l3 & l4;
251
252 if (all.nEdges()) {
253 //std::cout<<"TSF is found"<<std::endl;
254 all.name(name());
255 m_signal = all;
256 //std::cout<<all.name()<<":#signals="<<all.nSignals()<<std::endl;;
257 //all.dump();
258 }
260 }
261
262 if (logicLUTFlag == 1) {
264 //... Find hit wires ...
265 std::vector<TRGSignal> hitSignals;
266 hitSignals.reserve(signals.size());
267 for (unsigned iWire = 0; iWire < signals.size(); iWire++) {
268 if (signals[iWire].active()) hitSignals.push_back(signals[iWire]);
269 }
270 //... Coincidence all hit wires ...
271 TRGSignal allSignals;
272 if (hitSignals.size() != 0) {
273 allSignals = hitSignals[0];
274 for (unsigned iHitWire = 1; iHitWire < hitSignals.size(); iHitWire++) {
275 allSignals = allSignals & hitSignals[iHitWire];
276 }
277 }
278
279 int lutValue = LUT()->getValue(lutPattern());
280 if ((lutValue != 0) && (priority().signal().active() != 0)) {
281 allSignals.name(name());
282 m_signal = allSignals;
283 }
285 }
286
287 TRGDebug::leaveStage("TS sim");
288 }
289
290 void
291 TRGCDCSegment::simulateWithClock(std::string cdcCollectionName, std::string tsCollectionName)
292 {
293 // check LUT pattern without clock -> if there is no hit, skip clock simulation
294 if (m_TSLUT->getValue(lutPattern()) == 0) return;
295
296 TRGDebug::enterStage("TS sim with clock");
297
298 StoreArray<CDCHit> cdcHits(cdcCollectionName);
299 StoreArray<CDCTriggerSegmentHit> segmentHits(tsCollectionName);
300 m_storeHits.reserve(segmentHits.getEntries());
301
302 // get data clock of first and last hit
303 const TRGClock& wireClock = m_wires[0]->signal().clock();
304 int clkMin = 1000;
305 int clkMax = -1000;
306 for (unsigned i = 0, n = m_wires.size(); i < n; ++i) {
307 const TRGSignal& s = m_wires[i]->signal();
308 if (s.active()) {
309 int clk0 = s[0]->time();
310 int clk1 = s[s.nEdges() - 2]->time();
311 if (clk0 < clkMin) clkMin = clk0;
312 if (clk1 > clkMax) clkMax = clk1;
313 }
314 }
315 // loop over data clock cycles
316 //const int step = wireClock.frequency() / TRGCDC::getTRGCDC()->dataClock().frequency();
317 const int step = wireClock.frequency() / signal().clock().frequency();
318 const int width = 16 * step;
319 clkMin -= clkMin % step;
320 clkMax -= clkMax % step;
321 int lastLutValue = 0;
322 int lastPriority = 0;
323 int lastFastest = 0;
324 for (int iclk = clkMin; iclk <= clkMax; iclk += step) {
325 // check pattern in the last width clock cycles
326 unsigned pattern = lutPattern(iclk - width, iclk + step);
327 int lutValue = m_TSLUT->getValue(pattern);
328 if (lutValue) {
329 int priorityPos = priorityPosition(iclk - width, iclk + step);
330 int fastest = fastestTime(iclk - width);
331 // make a new hit if L/R changes to known, if priority changes to first
332 // or if the fastest hit changes
333 if ((lastLutValue == 3 && lutValue != 3) ||
334 (lastPriority != 3 && priorityPos == 3) ||
335 fastest != lastFastest) {
336 // add new edge to signal
337 TRGTime rise = TRGTime(wireClock.absoluteTime(iclk), true, m_signal.clock());
338 TRGTime fall = rise;
339 fall.shift(1).reverse();
340 m_signal |= TRGSignal(rise & fall);
341 // get priority wire from position flag
342 int ipr = (priorityPos == 3) ? 0 : priorityPos;
343 const TRGCDCWire* priorityWire = (m_wires.size() == 15) ? m_wires[ipr] : m_wires[ipr + 5];
344 // get priority time (first hit on priority wire in time window)
345 int tdc = priorityWire->signal()[0]->time();
346 if (tdc < iclk - width) {
347 for (unsigned itdc = 2, edges = priorityWire->signal().nEdges(); itdc < edges; itdc += 2) {
348 tdc = priorityWire->signal()[itdc]->time();
349 if (tdc >= iclk - width) break;
350 }
351 }
352 // create hit
353 const CDCHit* priorityHit = cdcHits[priorityWire->hit()->iCDCHit()];
354 const CDCTriggerSegmentHit* storeHit =
355 segmentHits.appendNew(*priorityHit,
356 id(),
357 priorityPos,
358 lutValue,
359 tdc,
360 fastest,
361 iclk + step);
362 addStoreHit(storeHit);
363 // relation to all CDCHits in segment
364 for (unsigned iw = 0; iw < m_wires.size(); ++iw) {
365 if (m_wires[iw]->signal().active(iclk - width, iclk + step)) {
366 // priority wire has relation weight 2
367 double weight = (m_wires[iw] == priorityWire) ? 2. : 1.;
368 storeHit->addRelationTo(cdcHits[m_wires[iw]->hit()->iCDCHit()], weight);
369 }
370 }
371 // relation to MCParticles (same as priority hit)
373 for (unsigned imc = 0; imc < mcrel.size(); ++imc) {
374 mcrel[imc]->addRelationTo(storeHit, mcrel.weight(imc));
375 }
376 // store values of this hit to compare with the next hit
377 lastLutValue = lutValue;
378 lastPriority = priorityPos;
379 lastFastest = fastest;
380 }
381 }
382 }
383
384 TRGDebug::leaveStage("TS sim with clock");
385 }
386
387 float
389 {
390 if ((LUT()->getValue(lutPattern()))) {
391 float tmpFastTime = 9999;
392 for (unsigned i = 0; i < m_wires.size(); i++) {
393 if (m_wires[i]->signal().active()) {
394 float dt = m_wires[i]->signal()[0]->time();
395 if (dt < tmpFastTime) {
396 tmpFastTime = dt;
397 }
398 }
399 }
400 return tmpFastTime;
401 } else
402 return -1;
403 }
404
405 float
407 {
408 int fastest = 9999;
409 for (unsigned iw = 0; iw < m_wires.size(); ++iw) {
410 if (m_wires[iw]->signal().active()) {
411 for (unsigned itdc = 0, edges = m_wires[iw]->signal().nEdges(); itdc < edges; itdc += 2) {
412 float dt = m_wires[iw]->signal()[itdc]->time();
413 if (dt >= clk0) {
414 if (dt < fastest) fastest = dt;
415 break;
416 }
417 }
418 }
419 }
420 return fastest;
421 }
422
423 float
425 {
426 if ((LUT()->getValue(lutPattern()))) {
427 float tmpFoundTime[5] = {9999, 9999, 9999, 9999, 9999};
428 for (unsigned i = 0; i < m_wires.size(); i++) {
429 if (!m_wires[i]->signal().active()) continue;
430 float dt = m_wires[i]->signal()[0]->time();
431 if (m_wires.size() == 11) {
432 if (i < 3) {
433 if (tmpFoundTime[0] > dt) tmpFoundTime[0] = dt;
434 } else if (i < 5) {
435 if (tmpFoundTime[1] > dt) tmpFoundTime[1] = dt;
436 } else if (i == 5) {
437 if (tmpFoundTime[2] > dt) tmpFoundTime[2] = dt;
438 } else if (i < 8) {
439 if (tmpFoundTime[3] > dt) tmpFoundTime[3] = dt;
440 } else {
441 if (tmpFoundTime[4] > dt) tmpFoundTime[4] = dt;
442 }
443 } else {
444 if (i == 0) {
445 if (tmpFoundTime[0] > dt) tmpFoundTime[0] = dt;
446 } else if (i < 3) {
447 if (tmpFoundTime[1] > dt) tmpFoundTime[1] = dt;
448 } else if (i < 6) {
449 if (tmpFoundTime[2] > dt) tmpFoundTime[2] = dt;
450 } else if (i < 10) {
451 if (tmpFoundTime[3] > dt) tmpFoundTime[3] = dt;
452 } else {
453 if (tmpFoundTime[4] > dt) tmpFoundTime[4] = dt;
454 }
455 }
456 }
457 std::sort(tmpFoundTime, tmpFoundTime + 5);
458 return tmpFoundTime[3];
459 } else
460 return -1;
461 }
462
463 float
465 {
466 const TRGSignal& prioritySignal = priority().signal();
467 if (prioritySignal.active()) {
468 return prioritySignal[0]->time();
469 }
470 return -1;
471 }
472
473 int
475 {
476 if (center().signal().active()) {
477 return 3;
478 } else {
479 const TRGCDCWire* priorityL;
480 const TRGCDCWire* priorityR;
481 if (m_wires.size() == 15) {
482 priorityL = m_wires[2];
483 priorityR = m_wires[1];
484 } else {
485 priorityL = m_wires[7];
486 priorityR = m_wires[6];
487 }
488 if (priorityL->signal().active()) {
489 if (priorityR->signal().active()) {
490 if ((priorityL->signal()[0]->time()) >= (priorityR->signal()[0]->time())) return 1;
491 else return 2;
492 } else return 2;
493 } else if (priorityR->signal().active()) {
494 return 1;
495 } else return 0;
496 }
497 }
498
499 int
500 TRGCDCSegment::priorityPosition(int clk0, int clk1) const
501 {
502 if (center().signal().active(clk0, clk1)) {
503 return 3;
504 } else {
505 const TRGCDCWire* priorityL;
506 const TRGCDCWire* priorityR;
507 if (m_wires.size() == 15) {
508 priorityL = m_wires[2];
509 priorityR = m_wires[1];
510 } else {
511 priorityL = m_wires[7];
512 priorityR = m_wires[6];
513 }
514 if (priorityL->signal().active(clk0, clk1)) {
515 if (priorityR->signal().active(clk0, clk1)) {
516 if ((priorityL->signal()[0]->time()) >= (priorityR->signal()[0]->time())) return 1;
517 else return 2;
518 } else return 2;
519 } else if (priorityR->signal().active(clk0, clk1)) {
520 return 1;
521 } else return 0;
522 }
523 }
524
525 const TRGCDCWire&
527 {
529 int offset = (m_wires.size() == 15) ? 0 : 5;
530 if (priority == 1 || priority == 2)
531 return *m_wires[offset + priority];
532 return *m_wires[offset];
533 }
534
535 unsigned
537 {
538 unsigned ptn = 0;
539 for (unsigned i = 0; i < m_wires.size(); i++) {
540 const TRGSignal& s = m_wires[i]->signal();
541 if (s.active())
542 ptn |= (1 << i);
543 }
544 return ptn;
545 }
546 std::vector<float>
548 {
549 std::vector<float> timeptn;
550 timeptn.reserve(m_wires.size());
551 for (unsigned i = 0; i < m_wires.size(); i++) {
552 const TRGSignal& s = m_wires[i]->signal();
553 if (s.active())
554 timeptn.push_back(s[0]->time());
555 else
556 timeptn.push_back(-1);
557 }
558 return timeptn;
559 }
560
561 unsigned
563 {
564 unsigned ptn = 0;
565 for (unsigned i = 0; i < m_wires.size(); i++) {
566 const TRGSignal& s = m_wires[i]->signal_adc();
567 if (s.active())
568 ptn |= (1 << i);
569 }
570 return ptn;
571 }
572
573 unsigned
574 TRGCDCSegment::hitPattern(int clk0, int clk1) const
575 {
576 unsigned ptn = 0;
577 for (unsigned i = 0; i < m_wires.size(); i++) {
578 const TRGSignal& s = m_wires[i]->signal();
579 if (s.active(clk0, clk1))
580 ptn |= (1 << i);
581 }
582 return ptn;
583 }
584
585 unsigned
587 {
588 unsigned outValue = (hitPattern()) * 2;
589 if (priorityPosition() == 2) {
590 outValue += 1;
591 }
592 return outValue;
593 }
594
595 unsigned
596 TRGCDCSegment::lutPattern(int clk0, int clk1) const
597 {
598 unsigned outValue = (hitPattern(clk0, clk1)) * 2;
599 if (priorityPosition(clk0, clk1) == 2) {
600 outValue += 1;
601 }
602 return outValue;
603 }
604
605 bool
606 TRGCDCSegment::hasMember(const std::string& a) const
607 {
608 const unsigned n = m_wires.size();
609 for (unsigned i = 0; i < n; i++) {
610 if (m_wires[i]->hasMember(a))
611 return true;
612 }
613 return false;
614 }
615
617} // namespace Belle2
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition CDCHit.h:40
Combination of several CDCHits to a track segment hit for the trigger.
A Class to store the Monte Carlo particle information.
Definition MCParticle.h:32
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
float weight(int index) const
Get weight with index.
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
RelationVector< FROM > getRelationsFrom(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from another store array to this object.
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
T * appendNew()
Construct a new T object at the end of the array.
Definition StoreArray.h:247
int getEntries() const
Get the number of objects in the array.
Definition StoreArray.h:216
std::vector< const TRGCDCWire * > m_wires
Wires.
Definition Segment.h:169
std::vector< const CDCTriggerSegmentHit * > m_storeHits
list of DataStore hits.
Definition Segment.h:181
TRGSignal m_signal
Trigger signal.
Definition Segment.h:172
std::string m_TSLUTFileName
TS LUT file name.
Definition Segment.h:184
TRGCDCLUT * m_TSLUT
LookUp Table. 0: no hit, 1: right, 2: left, 3: not determined.
Definition Segment.h:166
std::vector< const TRGCDCWireHit * > m_hits
Wire hits.
Definition Segment.h:178
A class to represent a wire in CDC.
Definition Wire.h:56
A class to represent a digitized signal. Unit is nano second.
Definition Clock.h:38
A class to represent a digitized signal. Unit is nano second.
Definition Signal.h:23
A class to represent a signal timing in the trigger system.
Definition Time.h:25
virtual bool hasMember(const std::string &a) const override
returns true this has member named a.
Definition Segment.cc:606
std::string name(void) const override
returns name.
Definition Segment.cc:138
const TRGCDCWire & center(void) const
returns a center wire.
Definition Segment.h:261
unsigned nEdges(void) const
returns # of edges.
Definition Signal.h:258
const HepGeom::Point3D< double > & forwardPosition(void) const
returns position in forward endplate.
Definition Cell.h:317
double absoluteTime(int clockPosition) const
returns absolute time of clock position
Definition Clock.cc:128
int priorityPosition(void) const
return priority cell position in TSHit. 0: no hit, 3: 1st priority, 1: 2nd right, 2: 2nd left
Definition Segment.cc:474
float fastestTime(void) const
return fastest time in TSHit.
Definition Segment.cc:388
unsigned id(void) const
returns id.
Definition Cell.h:200
void addStoreHit(const CDCTriggerSegmentHit *)
sets a pointer to a CDCTriggerSegmentHit.
Definition Segment.h:240
virtual ~TRGCDCSegment()
Destructor.
Definition Segment.cc:57
void simulateWithoutClock(bool logicLUTFlag)
simulates time-indegrated TF hit
Definition Segment.cc:173
const TRGClock & clock(void) const
returns clock.
Definition Signal.h:331
unsigned layerId(void) const
returns layer id.
Definition Cell.h:214
void simulateWithClock(std::string cdcCollectionName, std::string tsCollectionName)
simulates TF hit time-dependently
Definition Segment.cc:291
unsigned localLayerId(void) const
returns local layer id in a super layer.
Definition Cell.h:228
unsigned hitPattern(void) const
returns hit pattern.
Definition Segment.cc:536
const HepGeom::Point3D< double > & backwardPosition(void) const
returns position in backward endplate.
Definition Cell.h:324
TRGTime & reverse(void)
reverse edge.
Definition Time.h:141
int getValue(unsigned) const
get LUT Values
Definition LUT.cc:47
const std::string & name(void) const
returns name.
Definition Signal.h:188
static void enterStage(const std::string &stageName)
Declare that you enter new stage.
Definition Debug.cc:24
unsigned superLayerId(void) const
returns super layer id.
Definition Cell.h:221
const TRGSignal & signal(void) const override
returns trigger output. Null will returned if no signal.
Definition Segment.h:210
const TRGCDCWire & priority(void) const
returns priority wire.
Definition Segment.cc:526
static TRGCDCLUT * getLUT(const std::string &filename, int)
get LUT from dictionary, load new LUT if it doesn't exist
Definition LUT.cc:83
TRGCDCSegment(unsigned id, const TRGCDCLayer &layer, const TRGCDCWire &w, const TRGClock &clock, const std::string &TSLUTFile, const std::vector< const TRGCDCWire * > &wires)
Constructor.
Definition Segment.cc:38
TRGTime & shift(int unit)
delays by clock unit.
Definition Time.h:163
const TRGCDCWireHit * hit(void) const
returns a pointer to a TRGCDCWireHit.
Definition Wire.h:153
void initialize(void)
initialize variables.
Definition Segment.cc:62
unsigned lutPattern(void) const
hit pattern containing bit for priority position
Definition Segment.cc:586
void simulate(bool clockSimulation, bool logicLUTFlag, const std::string &cdcCollectionName=std::string(""), const std::string &tsCollectionName=std::string(""))
simulates TF hit using wire information.
Definition Segment.cc:151
const TRGCDCLUT * LUT(void) const
returns LUT
Definition Segment.h:254
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const override
dumps debug information.
Definition Segment.cc:68
void clear(void) override
clears information.
Definition Segment.cc:129
unsigned iCDCHit(void) const
returns an index to CDCHit.
Definition CellHit.h:360
const TRGCDCLayer & layer(void) const
returns a pointer to a layer.
Definition Cell.h:235
bool active(void) const
returns true if there is a signal.
Definition Signal.h:277
float priorityTime(void) const
return priority time in TSHit.
Definition Segment.cc:464
static void leaveStage(const std::string &stageName)
Declare that you leave a stage.
Definition Debug.cc:34
unsigned hitPattern_adc(void) const
returns hit pattern with adc cut.
Definition Segment.cc:562
float foundTime(void) const
return found time in TSHit.
Definition Segment.cc:424
std::vector< float > hitPatternTime(void) const
returns hit pattern with hit time
Definition Segment.cc:547
const TRGCDCSegmentHit * hit(void) const
returns a pointer to a TRGCDCSegmentHit.
Definition Segment.h:232
bool axial(void) const
returns true if this wire is in an axial layer.
Definition Cell.h:256
double frequency(void) const
returns frequency in MHz.
Definition Clock.h:187
unsigned localId(void) const
returns local id in a layer.
Definition Cell.h:207
Abstract base class for different kinds of events.
STL namespace.