CMS 3D CMS Logo

TTCluster.h
Go to the documentation of this file.
1 
14 #ifndef L1_TRACK_TRIGGER_CLUSTER_FORMAT_H
15 #define L1_TRACK_TRIGGER_CLUSTER_FORMAT_H
16 
25 
26 template <typename T>
27 class TTCluster {
28 public:
30  TTCluster();
31  TTCluster(std::vector<T> aHits, DetId aDetId, unsigned int aStackMember, bool storeLocal);
32 
34  ~TTCluster();
35 
38 
40  std::vector<T> getHits() const { return theHits; }
41  void setHits(std::vector<T> aHits) { theHits = aHits; }
42 
44  DetId getDetId() const { return theDetId; }
45  void setDetId(DetId aDetId) { theDetId = aDetId; }
46  unsigned int getStackMember() const { return theStackMember; }
47  void setStackMember(unsigned int aStackMember) { theStackMember = aStackMember; }
48 
50  std::vector<int> findRows() const;
51  std::vector<int> findCols() const;
52  void setCoordinates(std::vector<int> a, std::vector<int> b) {
53  theRows = a;
54  theCols = b;
55  }
56  std::vector<int> getRows() const { return theRows; }
57  std::vector<int> getCols() const { return theCols; }
58 
60  unsigned int findWidth() const;
61 
64  MeasurementPoint findHitLocalCoordinates(unsigned int hitIdx) const;
67 
69  std::string print(unsigned int i = 0) const;
70 
71 private:
73  std::vector<T> theHits;
75  unsigned int theStackMember;
76 
77  std::vector<int> theRows;
78  std::vector<int> theCols;
79 
80 };
81 
89 template <typename T>
94  theHits.clear();
95  theDetId = 0;
96  theStackMember = 0;
97 
98  theRows.clear();
99  theCols.clear();
100 }
101 
103 template <typename T>
104 TTCluster<T>::TTCluster(std::vector<T> aHits, DetId aDetId, unsigned int aStackMember, bool storeLocal) {
106  this->setHits(aHits);
107  this->setDetId(aDetId);
108  this->setStackMember(aStackMember);
109 
110  theRows.clear();
111  theCols.clear();
112  if (storeLocal) {
113  this->setCoordinates(this->findRows(), this->findCols());
114  }
115 }
116 
118 template <typename T>
120 
122 template <>
124 
127 template <>
129  unsigned int hitIdx) const;
130 
131 template <>
133 TTCluster<edm::Ref<edm::DetSetVector<Phase2TrackerDigi>, Phase2TrackerDigi> >::findAverageLocalCoordinates() const;
134 
136 template <typename T>
137 std::vector<int> TTCluster<T>::findRows() const {
138  std::vector<int> temp;
139  return temp;
140 }
141 
142 template <typename T>
143 std::vector<int> TTCluster<T>::findCols() const {
144  std::vector<int> temp;
145  return temp;
146 }
147 
148 template <>
150 
151 template <>
153 
155 template <typename T>
156 std::string TTCluster<T>::print(unsigned int i) const {
157  std::string padding("");
158  for (unsigned int j = 0; j != i; ++j) {
159  padding += "\t";
160  }
161 
162  std::stringstream output;
163  output << padding << "TTCluster:\n";
164  padding += '\t';
165  output << padding << "DetId: " << theDetId.rawId() << '\n';
166  output << padding << "member: " << theStackMember << ", cluster size: " << theHits.size() << '\n';
167  return output.str();
168 }
169 
170 template <typename T>
171 std::ostream& operator<<(std::ostream& os, const TTCluster<T>& aTTCluster) {
172  return (os << aTTCluster.print());
173 }
174 
175 #endif
Point2DBase
Definition: Point2DBase.h:9
TTCluster::findWidth
unsigned int findWidth() const
Cluster width.
TTCluster::print
std::string print(unsigned int i=0) const
Information.
Definition: TTCluster.h:156
mps_fire.i
i
Definition: mps_fire.py:355
TTCluster::setCoordinates
void setCoordinates(std::vector< int > a, std::vector< int > b)
Definition: TTCluster.h:52
TTCluster::theCols
std::vector< int > theCols
Definition: TTCluster.h:78
TTCluster::setDetId
void setDetId(DetId aDetId)
Definition: TTCluster.h:45
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
TTCluster::setStackMember
void setStackMember(unsigned int aStackMember)
Definition: TTCluster.h:47
TTCluster::findHitLocalCoordinates
MeasurementPoint findHitLocalCoordinates(unsigned int hitIdx) const
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
TTCluster::getRows
std::vector< int > getRows() const
Definition: TTCluster.h:56
operator<<
std::ostream & operator<<(std::ostream &os, const TTCluster< T > &aTTCluster)
Definition: TTCluster.h:171
DetId
Definition: DetId.h:17
TTCluster::findAverageLocalCoordinates
MeasurementPoint findAverageLocalCoordinates() const
TTCluster::theRows
std::vector< int > theRows
Definition: TTCluster.h:77
b
double b
Definition: hdecay.h:118
TTCluster::findAverageLocalCoordinatesCentered
MeasurementPoint findAverageLocalCoordinatesCentered() const
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Phase2TrackerDigi.h
TTCluster::theDetId
DetId theDetId
Definition: TTCluster.h:74
a
double a
Definition: hdecay.h:119
Ptr.h
TTCluster::theStackMember
unsigned int theStackMember
Definition: TTCluster.h:75
TTCluster::~TTCluster
~TTCluster()
Destructor.
Definition: TTCluster.h:119
MeasurementPoint.h
TTCluster::findRows
std::vector< int > findRows() const
Rows and columns to get rid of Digi collection.
Definition: TTCluster.h:137
DetSetVector.h
TTCluster::TTCluster
TTCluster()
Constructors.
Definition: TTCluster.h:92
TTCluster::getStackMember
unsigned int getStackMember() const
Definition: TTCluster.h:46
TTCluster::theHits
std::vector< T > theHits
Data members.
Definition: TTCluster.h:73
Phase2TrackerDigi
Definition: Phase2TrackerDigi.h:12
HLT_2018_cff.setDetId
setDetId
Definition: HLT_2018_cff.py:8162
Ref.h
bscTrigger_cfi.theHits
theHits
Definition: bscTrigger_cfi.py:18
DetId.h
TTCluster::setHits
void setHits(std::vector< T > aHits)
Definition: TTCluster.h:41
TTCluster::getDetId
DetId getDetId() const
Detector element.
Definition: TTCluster.h:44
TTCluster::getCols
std::vector< int > getCols() const
Definition: TTCluster.h:57
TTCluster::findCols
std::vector< int > findCols() const
Definition: TTCluster.h:143
TTCluster
NOTE: this is needed even if it seems not.
Definition: TTCluster.h:27
DetSet.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
GlobalPoint.h
TTCluster::getHits
std::vector< T > getHits() const
Hits in the Cluster.
Definition: TTCluster.h:40