ATLAS Offline Software
TgcCoinData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TgcCoinData.cxx
7 // Implementation file for class TgcCoinData
9 // (c) ATLAS Detector software
11 
12 #include <new>
14 #include "GaudiKernel/MsgStream.h"
15 
16 namespace Muon
17 {
18  //for HPT and LPT
19  TgcCoinData::TgcCoinData( const Identifier& channelIdIn,
20  const Identifier& channelIdOut,
21  const IdentifierHash &collectionIdHash,
22  const MuonGM::TgcReadoutElement* detElIn,
23  const MuonGM::TgcReadoutElement* detElOut,
24  const CoinDataType type,
25  const bool isAside,
26  const int phi,
27  const bool isInner,
28  const bool isForward,
29  const bool isStrip,
30  const int trackletId,
31  const Amg::Vector2D *posIn,
32  const Amg::Vector2D *posOut,
33  const double widthIn,
34  const double widthOut,
35  const int delta,
36  const int sub,
37  const int inner,
38  const int roi,
39  const int pt,
40  const int trackletIdStrip,
41  const Amg::MatrixX* errMat,
42  const bool isPositiveDeltaR,
43  const bool veto) :
44  m_channelIdIn(channelIdIn),
45  m_channelIdOut(channelIdOut),
46  m_collectionIdHash(collectionIdHash),
47  m_indexAndHash(),
48  m_detElIn(detElIn),
49  m_detElOut(detElOut),
50  m_type(type),
51  m_isAside(isAside),
52  m_phi(phi),
53  m_isInner(isInner),
54  m_isForward(isForward),
55  m_isStrip(isStrip),
56  m_trackletId(trackletId),
57  m_trackletIdStrip(trackletIdStrip),
58  m_posIn(posIn),
59  m_posOut(posOut),
60  m_errMat(errMat),
61  m_widthIn(widthIn),
62  m_widthOut(widthOut),
63  m_delta(delta),
64  m_roi(roi),
65  m_pt(pt),
66  m_veto(veto),
67  m_sub(sub),
68  m_inner(inner),
69  m_isPositiveDeltaR(isPositiveDeltaR),
70  m_globalposIn(),
71  m_globalposOut()
72 { }
73 
74  //for TYPE_TRACKLET_EIFI
75  TgcCoinData::TgcCoinData( const Identifier& channelIdIn,
76  const IdentifierHash &collectionIdHash,
77  const MuonGM::TgcReadoutElement* detElIn,
78  const CoinDataType type,
79  const bool isAside,
80  const int phi,
81  const bool isForward,
82  const bool isStrip,
83  const Amg::Vector2D *posIn,
84  const double widthIn,
85  const int sub) :
86  m_channelIdIn(channelIdIn),
87  m_channelIdOut(0),
88  m_collectionIdHash(collectionIdHash),
89  m_indexAndHash(),
90  m_detElIn(detElIn),
91  m_detElOut(nullptr),
92  m_type(type),
93  m_isAside(isAside),
94  m_phi(phi),
95  m_isInner(false),
96  m_isForward(isForward),
97  m_isStrip(isStrip),
98  m_trackletId(0),
99  m_trackletIdStrip(0),
100  m_posIn(posIn),
101  m_posOut(nullptr),
102  m_errMat(nullptr),
103  m_widthIn(widthIn),
104  m_widthOut(0),
105  m_delta(0),
106  m_roi(0),
107  m_pt(0),
108  m_veto(false),
109  m_sub(sub),
110  m_inner(0),
111  m_isPositiveDeltaR(false),
112  m_globalposIn(),
113  m_globalposOut()
114 { }
115 
116  //for SL
117  TgcCoinData::TgcCoinData( const Identifier& channelIdOut,
118  const IdentifierHash &collectionIdHash,
119  const MuonGM::TgcReadoutElement* detElOut,
120  const CoinDataType type,
121  const bool isAside,
122  const int phi,
123  const bool isForward,
124  const int trackletId,
125  const int trackletIdStrip,
126  const Amg::Vector2D *posOut,
127  const Amg::MatrixX *errMat,
128  const int roi,
129  const int pt,
130  const bool veto,
131  const bool isPositiveDeltaR) :
132  m_channelIdIn(0),
133  m_channelIdOut(channelIdOut),
134  m_collectionIdHash(collectionIdHash),
135  m_indexAndHash(),
136  m_detElIn(nullptr),
137  m_detElOut(detElOut),
138  m_type(type),
139  m_isAside(isAside),
140  m_phi(phi),
141  m_isInner(false),
142  m_isForward(isForward),
143  m_isStrip(false),
144  m_trackletId(trackletId),
145  m_trackletIdStrip(trackletIdStrip),
146  m_posIn(nullptr),
147  m_posOut(posOut),
148  m_errMat(errMat),
149  m_widthIn(0),
150  m_widthOut(0),
151  m_delta(0),
152  m_roi(roi),
153  m_pt(pt),
154  m_veto(veto),
155  m_sub(0),
156  m_inner(0),
157  m_isPositiveDeltaR(isPositiveDeltaR),
158  m_globalposIn(),
159  m_globalposOut()
160 { }
161 
162 // Destructor:
164 {
165  if(m_posIn) { delete m_posIn; m_posIn=nullptr;}
166  if(m_posOut) { delete m_posOut; m_posOut=nullptr;}
167  if(m_errMat) { delete m_errMat; m_errMat=nullptr;}
168  }
169 
170 // Default constructor:
172  m_channelIdIn(0),
173  m_channelIdOut(0),
174  m_collectionIdHash(),
175  m_indexAndHash(),
176  m_detElIn(nullptr),
177  m_detElOut(nullptr),
178  m_type(TgcCoinData::TYPE_UNKNOWN),
179  m_isAside(true),
180  m_phi(0),
181  m_isInner(false),
182  m_isForward(false),
183  m_isStrip(false),
184  m_trackletId(0),
185  m_trackletIdStrip(0),
186  m_posIn(nullptr),
187  m_posOut(nullptr),
188  m_errMat(nullptr),
189  m_widthIn(0),
190  m_widthOut(0),
191  m_delta(0),
192  m_roi(0),
193  m_pt(0),
194  m_veto(false),
195  m_sub(0),
196  m_inner(0),
197  m_isPositiveDeltaR(false),
198  m_globalposIn(),
199  m_globalposOut()
200 { }
201 
202 //copy constructor:
204  m_channelIdIn(RIO.m_channelIdIn),
205  m_channelIdOut(RIO.m_channelIdOut),
206  m_collectionIdHash(RIO.m_collectionIdHash),
207  m_indexAndHash(RIO.m_indexAndHash),
208  m_detElIn(RIO.m_detElIn),
209  m_detElOut(RIO.m_detElOut),
210  m_type(RIO.m_type),
211  m_isAside(RIO.m_isAside),
212  m_phi(RIO.m_phi),
213  m_isInner(RIO.m_isInner),
214  m_isForward(RIO.m_isForward),
215  m_isStrip(RIO.m_isStrip),
216  m_trackletId(RIO.m_trackletId),
217  m_trackletIdStrip(RIO.m_trackletIdStrip),
218  m_widthIn(RIO.m_widthIn),
219  m_widthOut(RIO.m_widthOut),
220  m_delta(RIO.m_delta),
221  m_roi(RIO.m_roi),
222  m_pt(RIO.m_pt),
223  m_veto(RIO.m_veto),
224  m_sub(RIO.m_sub),
225  m_inner(RIO.m_inner),
226  m_isPositiveDeltaR(RIO.m_isPositiveDeltaR),
227  m_globalposIn(),
228  m_globalposOut()
229 {
230  m_posIn = ((RIO.m_posIn) ? new Amg::Vector2D(*RIO.m_posIn) : nullptr );
231  m_posOut = ((RIO.m_posOut) ? new Amg::Vector2D(*RIO.m_posOut) : nullptr );
232  m_errMat = ((RIO.m_errMat) ? new Amg::MatrixX(*RIO.m_errMat) : nullptr );
233  if (RIO.m_globalposIn) m_globalposIn.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposIn));
234  if (RIO.m_globalposOut) m_globalposOut.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposOut));
235 }
236 
237 //assignment operator
239 {
240  if(&RIO !=this)
241  {
246  delete m_detElIn;
247  m_detElIn = RIO.m_detElIn;
248  delete m_detElOut;
249  m_detElOut = RIO.m_detElOut;
250  m_type = RIO.m_type;
251  m_phi = RIO.m_phi;
252  m_isAside = RIO.m_isAside;
253  m_isInner = RIO.m_isInner;
254  m_isForward = RIO.m_isForward;
255  m_isStrip = RIO.m_isStrip;
258  delete m_posIn;
259  m_posIn = ((RIO.m_posIn) ? new Amg::Vector2D(*RIO.m_posIn) : nullptr );
260  delete m_posOut;
261  m_posOut = ((RIO.m_posOut) ? new Amg::Vector2D(*RIO.m_posOut) : nullptr );
262  delete m_errMat;
263  m_errMat = ((RIO.m_errMat) ? new Amg::MatrixX(*RIO.m_errMat) : nullptr );
264  m_widthIn = RIO.m_widthIn;
265  m_widthOut = RIO.m_widthOut;
266  m_delta = RIO.m_delta;
267  m_roi = RIO.m_roi;
268  m_pt = RIO.m_pt;
269  m_veto = RIO.m_veto;
270  m_inner = RIO.m_inner;
271  m_sub = RIO.m_sub;
273  if (RIO.m_globalposIn) m_globalposIn.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposIn));
274  else if (m_globalposIn) m_globalposIn.release().reset();
275  if (RIO.m_globalposOut) m_globalposOut.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposOut));
276  else if (m_globalposOut) m_globalposOut.release().reset();
277  }
278  return *this;
279 }
280 
281 // << operator
282 MsgStream& operator << ( MsgStream& sl, const TgcCoinData& coin)
283 {
284  sl<<"### TgcCoinData Object ###"<<endmsg;
285  sl<<"DataType = "<<coin.type()
286  <<", isAside = "<<coin.isAside()
287  <<", phi = "<<coin.phi()
288  <<", isForward = "<<coin.isForward()
289  <<", isStrip = "<<coin.isStrip()
290  <<", trackletId = "<<coin.trackletId()
291  <<", trackletIdStrip = "<<coin.trackletIdStrip();
292 
293  if(coin.m_posIn) sl<<", posIn = "<<coin.posIn();
294  else sl<<", posIn = NULL";
295  if(coin.m_posOut) sl<<", posOut = "<<coin.posOut();
296  else sl<<", posOut = NULL";
297  if(coin.m_errMat) sl<<", errMat = "<<coin.errMat();
298  else sl<<", errMat = NULL";
299 
300  sl<<", widthIn = "<<coin.widthIn()
301  <<", widthOut = "<<coin.widthOut()
302  <<", delta = "<<coin.delta()
303  <<", roi = "<<coin.roi()
304  <<", pt = "<<coin.pt()
305  <<", veto = "<<coin.veto()
306  <<", sub = "<<coin.sub()
307  <<", isPositiveDeltaR = "<<coin.isPositiveDeltaR()
308  <<endmsg;
309  return sl;
310 }
311 
312 std::ostream& operator << ( std::ostream& sl, const TgcCoinData& coin)
313 {
314  sl<<"### TgcCoinData Object ###"<<std::endl;
315  sl<<"DataType = "<<coin.type()
316  <<", isAside = "<<coin.isAside()
317  <<", phi = "<<coin.phi()
318  <<", isForward = "<<coin.isForward()
319  <<", isStrip = "<<coin.isStrip()
320  <<", trackletId = "<<coin.trackletId()
321  <<", trackletIdStrip = "<<coin.trackletIdStrip();
322 
323  if(coin.m_posIn) sl<<", posIn = "<<coin.posIn();
324  else sl<<", posIn = NULL";
325  if(coin.m_posOut) sl<<", posOut = "<<coin.posOut();
326  else sl<<", posOut = NULL";
327  if(coin.m_errMat) sl<<", errMat = "<<coin.errMat();
328  else sl<<", errMat = NULL";
329 
330  sl<<", widthIn = "<<coin.widthIn()
331  <<", widthOut = "<<coin.widthOut()
332  <<", delta = "<<coin.delta()
333  <<", roi = "<<coin.roi()
334  <<", pt = "<<coin.pt()
335  <<", veto = "<<coin.veto()
336  <<", sub = "<<coin.sub()
337  <<", isPositiveDeltaR = "<<coin.isPositiveDeltaR()
338  <<std::endl;
339  return sl;
340 }
341 
342 }//end of ns
343 
Muon::TgcCoinData::m_detElIn
const MuonGM::TgcReadoutElement * m_detElIn
Definition: TgcCoinData.h:281
Muon::TgcCoinData::m_type
CoinDataType m_type
Definition: TgcCoinData.h:284
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Muon::TgcCoinData::m_pt
int m_pt
Definition: TgcCoinData.h:300
Muon::TgcCoinData::operator=
TgcCoinData & operator=(const TgcCoinData &)
Definition: TgcCoinData.cxx:238
Muon::TgcCoinData::m_isPositiveDeltaR
bool m_isPositiveDeltaR
Definition: TgcCoinData.h:305
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Muon::TgcCoinData::isAside
bool isAside() const
Aside or Cside.
Definition: TgcCoinData.h:348
Muon::TgcCoinData::type
CoinDataType type() const
return the coincidence type (HIPT, LPT, SL)
Definition: TgcCoinData.h:346
Muon::TgcCoinData::m_isAside
bool m_isAside
Definition: TgcCoinData.h:285
Muon::TgcCoinData::m_widthOut
double m_widthOut
Definition: TgcCoinData.h:296
Muon::TgcCoinData::TgcCoinData
TgcCoinData()
Public, Copy, operator=, constructor.
Definition: TgcCoinData.cxx:171
Muon::TgcCoinData::isStrip
bool isStrip() const
Strip hit or Wire hit?
Definition: TgcCoinData.h:356
test_pyathena.pt
pt
Definition: test_pyathena.py:11
Muon::TgcCoinData::m_roi
int m_roi
Definition: TgcCoinData.h:299
Muon::TgcCoinData::trackletId
int trackletId() const
return trackletId (Identifier for each track)
Definition: TgcCoinData.h:358
Muon::TgcCoinData::veto
bool veto() const
return veto bit
Definition: TgcCoinData.h:382
Muon::TgcCoinData::m_collectionIdHash
IdentifierHash m_collectionIdHash
Definition: TgcCoinData.h:277
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::TgcCoinData::m_indexAndHash
IdentContIndex m_indexAndHash
Definition: TgcCoinData.h:279
Muon::TgcCoinData::isPositiveDeltaR
bool isPositiveDeltaR() const
return isPositiveDeltaR (isMuplus) of SL
Definition: TgcCoinData.h:388
Muon::TgcCoinData
Definition: TgcCoinData.h:37
Muon::TgcCoinData::m_channelIdIn
Identifier m_channelIdIn
Definition: TgcCoinData.h:275
Muon::TgcCoinData::trackletIdStrip
int trackletIdStrip() const
return trackletId for strip (Identifier for each track)
Definition: TgcCoinData.h:360
m_type
TokenType m_type
the type
Definition: TProperty.cxx:44
Muon::TgcCoinData::delta
int delta() const
return the deviation from Pt=oo track
Definition: TgcCoinData.h:376
Muon::TgcCoinData::CoinDataType
CoinDataType
Definition: TgcCoinData.h:49
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Muon::TgcCoinData::m_isForward
bool m_isForward
Definition: TgcCoinData.h:288
Muon::TgcCoinData::posIn
const Amg::Vector2D & posIn() const
return Local position of track on TGC1(HIPT) or TGC2(TRACKLET)
Definition: TgcCoinData.h:362
Muon::TgcCoinData::m_sub
int m_sub
Definition: TgcCoinData.h:303
Muon::TgcCoinData::m_veto
bool m_veto
Definition: TgcCoinData.h:301
Muon::TgcCoinData::widthIn
double widthIn() const
return region width of hit on TGC1
Definition: TgcCoinData.h:372
Muon::TgcCoinData::errMat
const Amg::MatrixX & errMat() const
return 2d width of ROI for SL: errMat[0][0]==(width for R), errMat[1][1]==(width for phi)
Definition: TgcCoinData.h:370
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
Muon::TgcCoinData::m_errMat
const Amg::MatrixX * m_errMat
Definition: TgcCoinData.h:294
Muon::TgcCoinData::m_trackletIdStrip
int m_trackletIdStrip
Definition: TgcCoinData.h:291
Muon::TgcCoinData::widthOut
double widthOut() const
return region width of hit on TGC2(TRACKLET) or TGC3(HIPT)
Definition: TgcCoinData.h:374
Muon::TgcCoinData::m_isInner
bool m_isInner
Definition: TgcCoinData.h:287
Muon::TgcCoinData::~TgcCoinData
~TgcCoinData()
Destructor:
Definition: TgcCoinData.cxx:163
Muon::TgcCoinData::m_detElOut
const MuonGM::TgcReadoutElement * m_detElOut
Definition: TgcCoinData.h:282
Muon::TgcCoinData::m_posOut
const Amg::Vector2D * m_posOut
Definition: TgcCoinData.h:293
Muon::TgcCoinData::m_posIn
const Amg::Vector2D * m_posIn
Definition: TgcCoinData.h:292
Muon::TgcCoinData::m_widthIn
double m_widthIn
Definition: TgcCoinData.h:295
dumpTgcDigiThreshold.isStrip
list isStrip
Definition: dumpTgcDigiThreshold.py:33
Muon::TgcCoinData::roi
int roi() const
return ROI number
Definition: TgcCoinData.h:378
Muon::TgcCoinData::m_globalposOut
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalposOut
Definition: TgcCoinData.h:308
Muon::TgcCoinData::m_globalposIn
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalposIn
Definition: TgcCoinData.h:307
Muon::operator<<
std::ostream & operator<<(std::ostream &ostr, const Muon::HedgehogBoard &board)
Definition: HedgehogBoard.cxx:11
Muon::TgcCoinData::posOut
const Amg::Vector2D & posOut() const
return Local position of track on TGC3
Definition: TgcCoinData.h:365
Muon::TgcCoinData::isForward
bool isForward() const
Forward region or Endcap region.
Definition: TgcCoinData.h:354
Muon::TgcCoinData::m_isStrip
bool m_isStrip
Definition: TgcCoinData.h:289
Muon::TgcCoinData::sub
int sub() const
return subMatrix of Tracklet or hsub of HiPt
Definition: TgcCoinData.h:384
Muon::TgcCoinData::m_trackletId
int m_trackletId
Definition: TgcCoinData.h:290
Muon::TgcCoinData::pt
int pt() const
return pt threshold value
Definition: TgcCoinData.h:380
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Muon::TgcCoinData::m_inner
int m_inner
Definition: TgcCoinData.h:304
Muon::TgcCoinData::m_channelIdOut
Identifier m_channelIdOut
Definition: TgcCoinData.h:276
veto
std::vector< std::string > veto
these patterns are anded
Definition: listroot.cxx:191
Muon::TgcCoinData::m_phi
int m_phi
Definition: TgcCoinData.h:286
TgcCoinData.h
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
Muon::TgcCoinData::m_delta
int m_delta
Definition: TgcCoinData.h:298
Muon::TgcCoinData::phi
int phi() const
return phi number of trigger sector
Definition: TgcCoinData.h:350
Identifier
Definition: IdentifierFieldParser.cxx:14