CMS 3D CMS Logo

DTprimitive.cc
Go to the documentation of this file.
3 #include <iostream>
4 #include <iomanip>
5 
6 using namespace cmsdt;
7 //------------------------------------------------------------------
8 //--- Constructors and destructor
9 //------------------------------------------------------------------
11  cameraId_ = -1;
12  superLayerId_ = -1;
13  layerId_ = -1;
14  channelId_ = -1;
15  tdcTimeStamp_ = -1;
16  orbit_ = -1;
17  timeCorrection_ = 0;
18  laterality_ = NONE;
19 
20  for (int i = 0; i < PAYLOAD_ENTRIES; i++)
21  setPayload(0.0, i);
22 }
23 
25  setTimeCorrection(ptr->timeCorrection());
26  setTDCTimeStamp(ptr->tdcTimeStamp());
27  setOrbit(ptr->orbit());
28  setChannelId(ptr->channelId());
29  setLayerId(ptr->layerId());
30  setCameraId(ptr->cameraId());
31  setSuperLayerId(ptr->superLayerId());
32  setLaterality(ptr->laterality());
33 
34  for (int i = 0; i < PAYLOAD_ENTRIES; i++)
35  setPayload(ptr->payLoad(i), i);
36 }
37 
39  setTimeCorrection(ptr->timeCorrection());
40  setTDCTimeStamp(ptr->tdcTimeStamp());
41  setOrbit(ptr->orbit());
42  setChannelId(ptr->channelId());
43  setLayerId(ptr->layerId());
44  setCameraId(ptr->cameraId());
45  setSuperLayerId(ptr->superLayerId());
46  setLaterality(ptr->laterality());
47 
48  for (int i = 0; i < PAYLOAD_ENTRIES; i++)
49  setPayload(ptr->payLoad(i), i);
50 }
51 
53 
54 //------------------------------------------------------------------
55 //--- Public Methods
56 //------------------------------------------------------------------
57 bool DTPrimitive::isValidTime(void) { return (tdcTimeStamp_ >= 0 ? true : false); }
58 
60  // For layers with odd-number
61  float wireHorizPos = CELL_LENGTH * channelId();
62  // If layer is even, you must correct by half a cell
63  if (layerId() == 0 || layerId() == 2)
64  wireHorizPos += CELL_SEMILENGTH;
65  return wireHorizPos;
66 }
const int channelId() const
Definition: DTprimitive.h:34
const cmsdt::LATERAL_CASES laterality() const
Definition: DTprimitive.h:38
bool isValidTime()
Definition: DTprimitive.cc:57
constexpr int CELL_LENGTH
Definition: constants.h:186
constexpr int CELL_SEMILENGTH
Definition: constants.h:187
const int layerId() const
Definition: DTprimitive.h:35
virtual ~DTPrimitive()
Definition: DTprimitive.cc:52
const int tdcTimeStamp() const
Definition: DTprimitive.h:30
float wireHorizPos()
Definition: DTprimitive.cc:59
const double payLoad(int idx) const
Definition: DTprimitive.h:33
const int orbit() const
Definition: DTprimitive.h:31
const int timeCorrection() const
Definition: DTprimitive.h:29
const int cameraId() const
Definition: DTprimitive.h:36
std::shared_ptr< DTPrimitive > DTPrimitivePtr
Definition: DTprimitive.h:54
constexpr int PAYLOAD_ENTRIES
Definition: constants.h:249
const int superLayerId() const
Definition: DTprimitive.h:37