ATLAS Offline Software
Loading...
Searching...
No Matches
TgcCoinData.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6// TgcCoinData.h
7// Header file for class TgcCoinData
9// (c) ATLAS Detector software
11
12#ifndef MUONTRIGCOINDATA_TGCCOINDATA_H
13#define MUONTRIGCOINDATA_TGCCOINDATA_H
14
19#include "Identifier/Identifier.h"
22#include "TrkSurfaces/Surface.h"
23
24#include "GaudiKernel/MsgStream.h"
25
26#include <inttypes.h>
27#include <iostream>
28
30
31namespace Muon
32{
36
38
40 // Public methods:
42 public:
43
44 friend class ::TgcCoinDataContainerCnv;
48
56
59 TgcCoinData(const TgcCoinData &);
61
63 friend MsgStream& operator << (MsgStream& sl, const TgcCoinData& coin);
64
66 friend std::ostream& operator << (std::ostream& sl, const TgcCoinData& coin);
67
69
70 //for HIPT and TRACKLET
73 const IdentifierHash &collectionIdHash,
74 const MuonGM::TgcReadoutElement* detElIn,
75 const MuonGM::TgcReadoutElement* detElOut,
76 const CoinDataType type,
77 const bool isAside,
78 const int phi,
79 const bool isInner,
80 const bool isForward,
81 const bool isStrip,
82 const int trackletId,
83 const Amg::Vector2D *posIn,
84 const Amg::Vector2D *posOut,
85 const double widthIn,
86 const double widthOut,
87 const int delta,
88 const int sub,
89 const int inner,
90 const int roi = 0,
91 const int pt = 0,
92 const int trackletIdStrip = 0,
93 const Amg::MatrixX* errMat = nullptr,
94 const bool isPositiveDeltaR = false,
95 const bool veto = false);
96
97 //for TYPE_TRACKLET_EIFI
99 const IdentifierHash &collectionIdHash,
100 const MuonGM::TgcReadoutElement* detElIn,
101 const CoinDataType type,
102 const bool isAside,
103 const int phi,
104 const bool isForward,
105 const bool isStrip,
106 const Amg::Vector2D *posIn,
107 const double widthIn,
108 const int sub);
109
110 //for SL
112 const IdentifierHash &collectionIdHash,
113 const MuonGM::TgcReadoutElement* detElOut,
114 const CoinDataType type,
115 const bool isAside,
116 const int phi,
117 const bool isForward,
118 const int trackletId,
119 const int trackletIdStrip,
120 const Amg::Vector2D *posOut,
121 const Amg::MatrixX *errMat,
122 const int roi,
123 const int pt,
124 const bool veto,
125 const bool isPositiveDeltaR);
126
128 ~TgcCoinData();
129
131 Identifier identify() const;
132
135
137 void setIdentifier(Identifier in, Identifier out);
138
139
140 void setHashAndIndex(unsigned short collHash, unsigned short objIndex);
141 void setHashAndIndex(unsigned int indexAndHash);
142 const IdentContIndex& getHashAndIndex() const;
143
145 Identifier channelIdIn() const;
146
148 Identifier channelIdOut() const;
149
151 CoinDataType type() const;
152
154 bool isAside() const;
155
157 int phi() const;
158
160 bool isInner() const;
161
163 bool isForward() const;
164
166 bool isStrip() const;
167
169 int trackletId() const;
170
172 int trackletIdStrip() const;
173
175 const Amg::Vector2D &posIn() const;
176 const Amg::Vector2D *posInPtr() const;
177
179 const Amg::Vector2D &posOut() const;
180 const Amg::Vector2D *posOutPtr() const;
181
183 bool hasErrMat() const;
184
186 const Amg::MatrixX &errMat() const;
187
189 double widthIn() const;
190
192 double widthOut() const;
193
195 int delta() const;
196
198 int roi() const;
199
201 int pt() const;
202
204 bool veto() const;
205
207 int sub() const;
208
210 int inner() const;
211
213 bool isPositiveDeltaR() const;
214
217
220
222 const Amg::Vector3D& globalposIn() const;
223
225 const Amg::Vector3D& globalposOut() const;
226
228 static constexpr uint32_t INNER_NSW_R_BITSHIFT = 0;
229 static constexpr uint32_t INNER_NSW_R_BIT = 0xFF;
230 static constexpr uint32_t INNER_NSW_PHI_BITSHIFT = 8;
231 static constexpr uint32_t INNER_NSW_PHI_BIT = 0x3F;
232 static constexpr uint32_t INNER_NSW_DTHETA_BITSHIFT = 14;
233 static constexpr uint32_t INNER_NSW_DTHETA_BIT = 0x1F;
234 static constexpr uint32_t INNER_NSW_PHIRES_BITSHIFT = 19;
235 static constexpr uint32_t INNER_NSW_PHIRES_BIT = 0x1;
236 static constexpr uint32_t INNER_NSW_LOWRES_BITSHIFT = 20;
237 static constexpr uint32_t INNER_NSW_LOWRES_BIT = 0x1;
238 static constexpr uint32_t INNER_NSW_ID_BITSHIFT = 21;
239 static constexpr uint32_t INNER_NSW_ID_BIT = 0xF;
240 static constexpr uint32_t INNER_NSW_BCID_BITSHIFT = 25;
241 static constexpr uint32_t INNER_NSW_BCID_BIT = 0xF;
242 static constexpr uint32_t INNER_NSW_INPUT_BITSHIFT = 29;
243 static constexpr uint32_t INNER_NSW_INPUT_BIT = 0x7;
244
246 static constexpr uint32_t INNER_RPC_ETA_BITSHIFT = 0;
247 static constexpr uint32_t INNER_RPC_ETA_BIT = 0x3F;
248 static constexpr uint32_t INNER_RPC_PHI_BITSHIFT = 6;
249 static constexpr uint32_t INNER_RPC_PHI_BIT = 0x3F;
250 static constexpr uint32_t INNER_RPC_DETA_BITSHIFT = 12;
251 static constexpr uint32_t INNER_RPC_DETA_BIT = 0x7;
252 static constexpr uint32_t INNER_RPC_DPHI_BITSHIFT = 15;
253 static constexpr uint32_t INNER_RPC_DPHI_BIT = 0x7;
254 static constexpr uint32_t INNER_RPC_FLAG_BITSHIFT = 18;
255 static constexpr uint32_t INNER_RPC_FLAG_BIT = 0x3;
256 static constexpr uint32_t INNER_RPC_BCID_BITSHIFT = 20;
257 static constexpr uint32_t INNER_RPC_BCID_BIT = 0xF;
258
260 static constexpr uint32_t INNER_EIFI_EI_BITSHIFT = 0;
261 static constexpr uint32_t INNER_EIFI_EI_BIT = 0xFF;
262 static constexpr uint32_t INNER_EIFI_FI_BITSHIFT = 8;
263 static constexpr uint32_t INNER_EIFI_FI_BIT = 0xFF;
264 static constexpr uint32_t INNER_EIFI_CID_BITSHIFT = 16;
265 static constexpr uint32_t INNER_EIFI_CID_BIT = 0x7;
266
268 static constexpr uint32_t INNER_TILE_MODULE_BITSHIFT = 0;
269 static constexpr uint32_t INNER_TILE_MODULE_BIT = 0xFFF;
270 static constexpr uint32_t INNER_TILE_BCID_BITSHIFT = 12;
271 static constexpr uint32_t INNER_TILE_BCID_BIT = 0xF;
272
273 private:
274
278
280
283
286 int m_phi;
295 double m_widthIn;
297
299 int m_roi;
300 int m_pt;
301 bool m_veto;
302
303 int m_sub;
306
309 };
310
311 // inline methods:
313
316 return m_channelIdOut;
317 }
318
320
322 {
323 m_channelIdIn = in; m_channelIdOut = out;
324 }
325
326 inline void TgcCoinData::setHashAndIndex(unsigned short collHash, unsigned short objIndex)
327 {
328 m_indexAndHash.setCollHash(collHash);
329 m_indexAndHash.setObjIndex(objIndex);
330 }
331
332 inline void TgcCoinData::setHashAndIndex(unsigned int indexAndHash)
333 {
334 m_indexAndHash.setHashAndIndex(indexAndHash);
335 }
336
338 {
339 return m_indexAndHash;
340 }
341
343
345
347
348 inline bool TgcCoinData::isAside() const{ return m_isAside; }
349
350 inline int TgcCoinData::phi() const{ return m_phi; }
351
352 inline bool TgcCoinData::isInner() const{ return m_isInner; }
353
354 inline bool TgcCoinData::isForward() const{ return m_isForward; }
355
356 inline bool TgcCoinData::isStrip() const{ return m_isStrip; }
357
358 inline int TgcCoinData::trackletId() const{ return m_trackletId; }
359
361
362 inline const Amg::Vector2D& TgcCoinData::posIn() const{ return *m_posIn; }
363 inline const Amg::Vector2D* TgcCoinData::posInPtr() const{ return m_posIn; }
364
365 inline const Amg::Vector2D& TgcCoinData::posOut() const{ return *m_posOut; }
366 inline const Amg::Vector2D* TgcCoinData::posOutPtr() const{ return m_posOut; }
367
368 inline bool TgcCoinData::hasErrMat() const{ return m_errMat != nullptr; }
369
370 inline const Amg::MatrixX& TgcCoinData::errMat() const{ return *m_errMat; }
371
372 inline double TgcCoinData::widthIn() const{ return m_widthIn; }
373
374 inline double TgcCoinData::widthOut() const{ return m_widthOut; }
375
376 inline int TgcCoinData::delta() const{ return m_delta; }
377
378 inline int TgcCoinData::roi() const{ return m_roi; }
379
380 inline int TgcCoinData::pt() const{ return m_pt; }
381
382 inline bool TgcCoinData::veto() const{ return m_veto; }
383
384 inline int TgcCoinData::sub() const{ return m_sub; }
385
386 inline int TgcCoinData::inner() const{ return m_inner; }
387
389
391 {
392 return m_detElIn;
393 }
394
396 {
397 return m_detElOut;
398 }
399
401 {
402 if(not m_globalposIn) {
403 if (m_detElIn) {
404 m_globalposIn.set(std::make_unique<const Amg::Vector3D>(
405 m_detElIn->surface(m_channelIdIn)
406 .Trk::Surface::localToGlobal(*m_posIn)));
407 } else {
408 m_globalposIn.set(std::make_unique<const Amg::Vector3D>(0., 0., 0.));
409 }
410 }
411 return *m_globalposIn;
412 }
413
415 {
416 if(not m_globalposOut) {
417 if (m_detElOut && m_posOut) {
418 m_globalposOut.set(std::make_unique<const Amg::Vector3D>(
419 m_detElOut->surface(m_channelIdOut)
420 .Trk::Surface::localToGlobal(*m_posOut)));
421 } else {
422 m_globalposOut.set(std::make_unique<const Amg::Vector3D>(0., 0., 0.));
423 }
424 }
425 return *m_globalposOut;
426 }
427}
428
429#endif // MUONTRIGCOINDATA_TGCCOINDATA_H
Scalar phi() const
phi method
Cached unique_ptr with atomic update.
Identifiable container index to a contained object.
This is a "hash" representation of an Identifier.
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
int roi() const
return ROI number
static constexpr uint32_t INNER_NSW_ID_BITSHIFT
double widthOut() const
return region width of hit on TGC2(TRACKLET) or TGC3(HIPT)
const Amg::Vector2D & posOut() const
return Local position of track on TGC3
TgcCoinData()
Public, Copy, operator=, constructor.
CoinDataType type() const
return the coincidence type (HIPT, LPT, SL)
static constexpr uint32_t INNER_TILE_MODULE_BITSHIFT
Bit info in int inner for the Tile inner-coincidence.
const MuonGM::TgcReadoutElement * m_detElIn
static constexpr uint32_t INNER_EIFI_CID_BIT
int trackletId() const
return trackletId (Identifier for each track)
double widthIn() const
return region width of hit on TGC1
static constexpr uint32_t INNER_TILE_BCID_BIT
Identifier identify() const
return OfflineID of Outer Hit
const IdentContIndex & getHashAndIndex() const
const MuonGM::TgcReadoutElement * m_detElOut
const MuonGM::TgcReadoutElement * detectorElementIn() const
return TgcReadoutElement of track on TGC1(HIPT) or TGC2(TRACKLET)
int trackletIdStrip() const
return trackletId for strip (Identifier for each track)
static constexpr uint32_t INNER_NSW_PHIRES_BITSHIFT
static constexpr uint32_t INNER_EIFI_CID_BITSHIFT
const Amg::Vector2D * m_posOut
static constexpr uint32_t INNER_RPC_PHI_BIT
static constexpr uint32_t INNER_NSW_BCID_BIT
const Amg::Vector2D & posIn() const
return Local position of track on TGC1(HIPT) or TGC2(TRACKLET)
bool isPositiveDeltaR() const
return isPositiveDeltaR (isMuplus) of SL
IdentContIndex m_indexAndHash
static constexpr uint32_t INNER_RPC_FLAG_BIT
static constexpr uint32_t INNER_NSW_PHIRES_BIT
const Amg::Vector3D & globalposOut() const
return global position of track on TGC3
static constexpr uint32_t INNER_RPC_ETA_BIT
int sub() const
return subMatrix of Tracklet or hsub of HiPt
static constexpr uint32_t INNER_NSW_LOWRES_BIT
TgcCoinData & operator=(const TgcCoinData &)
static constexpr uint32_t INNER_RPC_DPHI_BIT
const Amg::MatrixX & errMat() const
return 2d width of ROI for SL: errMat[0][0]==(width for R), errMat[1][1]==(width for phi)
static constexpr uint32_t INNER_TILE_MODULE_BIT
IdentifierHash identifyHash() const
return the identifierHash of Outer Hit
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalposIn
bool isAside() const
Aside or Cside.
static constexpr uint32_t INNER_RPC_BCID_BITSHIFT
const Amg::Vector2D * posInPtr() const
const Amg::Vector3D & globalposIn() const
return global position of track on TGC1(HIPT) or TGC2(TRACKLET)
static constexpr uint32_t INNER_RPC_ETA_BITSHIFT
Bit info in int inner for the RPC inner-coincidence.
static constexpr uint32_t INNER_EIFI_EI_BITSHIFT
Bit info in int inner for the EI/FI inner-coincidence.
void setIdentifier(Identifier in, Identifier out)
set the OfflineID of Inner and Outer Hits
static constexpr uint32_t INNER_NSW_ID_BIT
static constexpr uint32_t INNER_RPC_PHI_BITSHIFT
static constexpr uint32_t INNER_RPC_DPHI_BITSHIFT
bool veto() const
return veto bit
int phi() const
return phi number of trigger sector
bool isForward() const
Forward region or Endcap region.
Identifier m_channelIdOut
void setHashAndIndex(unsigned short collHash, unsigned short objIndex)
bool hasErrMat() const
Test to see if the error matrix is present.
friend MsgStream & operator<<(MsgStream &sl, const TgcCoinData &coin)
Overload of << operator for MsgStream for debug output.
static constexpr uint32_t INNER_NSW_PHI_BITSHIFT
~TgcCoinData()
Destructor:
const MuonGM::TgcReadoutElement * detectorElementOut() const
return TgcReadoutElement of track on TGC3
bool isInner() const
Inner layers or BW.
int pt() const
return pt threshold value
static constexpr uint32_t INNER_RPC_DETA_BIT
static constexpr uint32_t INNER_RPC_BCID_BIT
static constexpr uint32_t INNER_EIFI_FI_BITSHIFT
static constexpr uint32_t INNER_RPC_FLAG_BITSHIFT
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalposOut
static constexpr uint32_t INNER_NSW_BCID_BITSHIFT
Identifier channelIdIn() const
return offlineID on TGC1(HIPT) or TGC2(TRACKLET)
const Amg::MatrixX * m_errMat
static constexpr uint32_t INNER_RPC_DETA_BITSHIFT
CoinDataType m_type
Identifier m_channelIdIn
static constexpr uint32_t INNER_EIFI_EI_BIT
IdentifierHash m_collectionIdHash
Identifier channelIdOut() const
return offlineID on track on TGC3
int delta() const
return the deviation from Pt=oo track
static constexpr uint32_t INNER_NSW_R_BITSHIFT
Bit info in int inner for the NSW inner-coincidence.
const Amg::Vector2D * posOutPtr() const
static constexpr uint32_t INNER_TILE_BCID_BITSHIFT
static constexpr uint32_t INNER_NSW_PHI_BIT
const Amg::Vector2D * m_posIn
static constexpr uint32_t INNER_NSW_LOWRES_BITSHIFT
static constexpr uint32_t INNER_EIFI_FI_BIT
static constexpr uint32_t INNER_NSW_INPUT_BITSHIFT
static constexpr uint32_t INNER_NSW_DTHETA_BITSHIFT
bool isStrip() const
Strip hit or Wire hit?
static constexpr uint32_t INNER_NSW_R_BIT
static constexpr uint32_t INNER_NSW_INPUT_BIT
int inner() const
return InnerCoincidecne trigger bits
static constexpr uint32_t INNER_NSW_DTHETA_BIT
Create derived converter to customize the saving of identifiable container.
std::vector< std::string > veto
these patterns are anded
Definition listroot.cxx:191
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
CachedUniquePtrT< const T > CachedUniquePtr
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.