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 //--- Constructores y destructores
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 }
mps_fire.i
i
Definition: mps_fire.py:428
DTPrimitive::laterality
const cmsdt::LATERAL_CASES laterality() const
Definition: DTprimitive.h:38
cmsdt::PAYLOAD_ENTRIES
constexpr int PAYLOAD_ENTRIES
Definition: constants.h:234
DTPrimitive::isValidTime
bool isValidTime()
Definition: DTprimitive.cc:57
DTPrimitive::channelId
const int channelId() const
Definition: DTprimitive.h:34
DTprimitive.h
cmsdt
Definition: constants.h:39
constants.h
cmsdt::CELL_SEMILENGTH
constexpr int CELL_SEMILENGTH
Definition: constants.h:180
DTPrimitive::layerId
const int layerId() const
Definition: DTprimitive.h:35
DTPrimitive::~DTPrimitive
virtual ~DTPrimitive()
Definition: DTprimitive.cc:52
DTPrimitive
Definition: DTprimitive.h:9
DTPrimitive::tdcTimeStamp
const int tdcTimeStamp() const
Definition: DTprimitive.h:30
cmsdt::CELL_LENGTH
constexpr int CELL_LENGTH
Definition: constants.h:179
DTPrimitivePtr
std::shared_ptr< DTPrimitive > DTPrimitivePtr
Definition: DTprimitive.h:54
DTPrimitive::wireHorizPos
float wireHorizPos()
Definition: DTprimitive.cc:59
DTPrimitive::cameraId
const int cameraId() const
Definition: DTprimitive.h:36
DTPrimitive::payLoad
const double payLoad(int idx) const
Definition: DTprimitive.h:33
DTPrimitive::superLayerId
const int superLayerId() const
Definition: DTprimitive.h:37
DTPrimitive::orbit
const int orbit() const
Definition: DTprimitive.h:31
DTPrimitive::timeCorrection
const int timeCorrection() const
Definition: DTprimitive.h:29
DTPrimitive::DTPrimitive
DTPrimitive()
Definition: DTprimitive.cc:10
cmsdt::NONE
Definition: constants.h:44