CMS 3D CMS Logo

DTprimitive.h
Go to the documentation of this file.
1 #ifndef L1Trigger_DTTriggerPhase2_DTprimitive_h
2 #define L1Trigger_DTTriggerPhase2_DTprimitive_h
3 
5 #include <ostream>
6 #include <memory>
7 #include <vector>
8 
9 class DTPrimitive {
10 public:
11  DTPrimitive();
12  DTPrimitive(std::shared_ptr<DTPrimitive>& ptr);
14  virtual ~DTPrimitive();
15 
16  bool isValidTime();
17  float wireHorizPos();
18 
20  void setTDCTimeStamp(int tstamp) { tdcTimeStamp_ = tstamp; };
21  void setOrbit(int orb) { orbit_ = orb; }
22  void setPayload(double hitTag, int idx) { this->payLoad_[idx] = hitTag; };
23  void setChannelId(int channel) { channelId_ = channel; };
24  void setLayerId(int layer) { layerId_ = layer; };
25  void setCameraId(int camera) { cameraId_ = camera; };
26  void setSuperLayerId(int lay) { superLayerId_ = lay; };
28 
29  const int timeCorrection() const { return timeCorrection_; };
30  const int tdcTimeStamp() const { return tdcTimeStamp_; };
31  const int orbit() const { return orbit_; };
32  const int tdcTimeStampNoOffset() const { return tdcTimeStamp_ - timeCorrection_; };
33  const double payLoad(int idx) const { return payLoad_[idx]; };
34  const int channelId() const { return channelId_; };
35  const int layerId() const { return layerId_; };
36  const int cameraId() const { return cameraId_; };
37  const int superLayerId() const { return superLayerId_; };
38  const cmsdt::LATERAL_CASES laterality() const { return laterality_; };
39 
40  bool operator==(const DTPrimitive& dtp) {
41  return (tdcTimeStamp() == dtp.tdcTimeStamp() && channelId() == dtp.channelId() && layerId() == dtp.layerId() &&
42  cameraId() == dtp.cameraId() && cameraId() == dtp.cameraId() && superLayerId() == dtp.superLayerId());
43  }
44 
45 private:
46  int cameraId_; // Chamber ID
47  int superLayerId_; // SL ID
48  int layerId_; // Layer ID
49  int channelId_; // Wire number
50  cmsdt::LATERAL_CASES laterality_; // LEFT, RIGHT, NONE
51 
54  int orbit_;
56 };
57 
58 typedef std::vector<DTPrimitive> DTPrimitives;
59 typedef std::shared_ptr<DTPrimitive> DTPrimitivePtr;
60 typedef std::vector<DTPrimitivePtr> DTPrimitivePtrs;
61 
62 #endif
std::vector< DTPrimitivePtr > DTPrimitivePtrs
Definition: DTprimitive.h:60
int tdcTimeStamp_
Definition: DTprimitive.h:53
void setTimeCorrection(int time)
Definition: DTprimitive.h:19
const int channelId() const
Definition: DTprimitive.h:34
const cmsdt::LATERAL_CASES laterality() const
Definition: DTprimitive.h:38
void setPayload(double hitTag, int idx)
Definition: DTprimitive.h:22
LATERAL_CASES
Definition: constants.h:47
void setLayerId(int layer)
Definition: DTprimitive.h:24
bool isValidTime()
Definition: DTprimitive.cc:57
bool operator==(const DTPrimitive &dtp)
Definition: DTprimitive.h:40
int timeCorrection_
Definition: DTprimitive.h:52
int channelId_
Definition: DTprimitive.h:49
const int tdcTimeStampNoOffset() const
Definition: DTprimitive.h:32
const int layerId() const
Definition: DTprimitive.h:35
void setChannelId(int channel)
Definition: DTprimitive.h:23
void setTDCTimeStamp(int tstamp)
Definition: DTprimitive.h:20
double payLoad_[cmsdt::PAYLOAD_ENTRIES]
Definition: DTprimitive.h:55
virtual ~DTPrimitive()
Definition: DTprimitive.cc:52
const int tdcTimeStamp() const
Definition: DTprimitive.h:30
float wireHorizPos()
Definition: DTprimitive.cc:59
int superLayerId_
Definition: DTprimitive.h:47
void setLaterality(cmsdt::LATERAL_CASES lat)
Definition: DTprimitive.h:27
const double payLoad(int idx) const
Definition: DTprimitive.h:33
const int orbit() const
Definition: DTprimitive.h:31
void setSuperLayerId(int lay)
Definition: DTprimitive.h:26
const int timeCorrection() const
Definition: DTprimitive.h:29
void setCameraId(int camera)
Definition: DTprimitive.h:25
cmsdt::LATERAL_CASES laterality_
Definition: DTprimitive.h:50
void setOrbit(int orb)
Definition: DTprimitive.h:21
std::vector< DTPrimitive > DTPrimitives
Definition: DTprimitive.h:58
const int cameraId() const
Definition: DTprimitive.h:36
std::shared_ptr< DTPrimitive > DTPrimitivePtr
Definition: DTprimitive.h:59
constexpr int PAYLOAD_ENTRIES
Definition: constants.h:388
const int superLayerId() const
Definition: DTprimitive.h:37