13 #define TRG_SHORT_NAMES
14 #define TRGCDC_SHORT_NAMES
16 #include "trg/trg/Clock.h"
17 #include "trg/trg/Utilities.h"
18 #include "trg/cdc/TRGCDC.h"
19 #include "trg/cdc/Wire.h"
20 #include "trg/cdc/WireHit.h"
21 #include "trg/cdc/WireHitMC.h"
22 #include "trg/cdc/Segment.h"
24 #define P3D HepGeom::Point3D<double>
34 TRGCDCWire::TRGCDCWire(
unsigned id,
40 : TCCell(id, localId, l, fp, bp),
61 if (msg.find(
"neighbor") != string::npos) {
62 for (
unsigned i = 0; i < 7; i++)
64 neighbor(i)->
dump(
"", pre + TRGUtil::itostring(i) +
" ");
66 if (msg.find(
"trigger") != string::npos ||
67 msg.find(
"detail") != string::npos) {
75 static bool first =
false;
77 cout <<
"TRGCDCWire::neighbor !!! "
78 <<
"this function is not tested yet"
85 const unsigned nLayers = cdc.superLayer(
superLayerId)->size();
86 const int local = int(
localId());
91 if (
layer().offset() != 0) {
93 return cdc.wire(
layerId - 1, local);
95 return cdc.wire(
layerId - 1, local + 1);
98 return cdc.wire(
layerId - 1, local - 1);
100 return cdc.wire(
layerId - 1, local);
104 return cdc.wire(
layerId, local - 1);
106 return cdc.wire(
layerId, local + 1);
110 if (
layer().offset() != 0) {
112 return cdc.wire(
layerId + 1, local);
114 return cdc.wire(
layerId + 1, local + 1);
117 return cdc.wire(
layerId + 1, local - 1);
119 return cdc.wire(
layerId + 1, local);
372 for (
unsigned i = 0; i <
_mcHits.size(); i++)
385 TRGUtil::itostring(
layerId()) +
389 TRGUtil::itostring(
layerId()) +
A class to represent a wire in CDC.
TRGSignal _signal
Trigger output.
std::vector< const TRGCDCWireHitMC * > _mcHits
MC wire hit.
The instance of TRGCDC is a singleton.
A class to represent a digitized signal. Unit is nano second.
#define WireInnerRight
type of the wire
#define WireLeft
type of the wire
static TRGCDC * getTRGCDC(void)
returns TRGCDC object.
virtual ~TRGCDCWire()
Destructor.
unsigned id(void) const
returns id.
#define WireRight
type of the wire
#define WireInnerLeft
type of the wire
unsigned layerId(void) const
returns layer id.
unsigned localLayerId(void) const
returns local layer id in a super layer.
#define WireOuterRight
type of the wire
const std::string & name(void) const
returns name.
unsigned superLayerId(void) const
returns super layer id.
const TRGSignal & signal(void) const override
returns an input to the trigger. This is sync'ed to 1GHz clock.
const TRGCDCWire * neighbor(unsigned) const
returns a pointer to a neighbor wire. This function is expensive.
std::string name(void) const override
returns name.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const override
dumps debug information.
void clear(void) override
clears information.
#define WireOuterLeft
type of the wire
const TRGCDCLayer & layer(void) const
returns a pointer to a layer.
void clear(void)
clears contents.
bool axial(void) const
returns true if this wire is in an axial layer.
unsigned localId(void) const
returns local id in a layer.
void dump(const std::string &message="", const std::string &pre="") const
dumps contents.
Abstract base class for different kinds of events.