ATLAS Offline Software
Loading...
Searching...
No Matches
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
16namespace Muon
17{
18 //for HPT and LPT
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) :
46 m_collectionIdHash(collectionIdHash),
48 m_detElIn(detElIn),
49 m_detElOut(detElOut),
50 m_type(type),
52 m_phi(phi),
64 m_roi(roi),
65 m_pt(pt),
66 m_veto(veto),
67 m_sub(sub),
72{ }
73
74 //for TYPE_TRACKLET_EIFI
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) :
88 m_collectionIdHash(collectionIdHash),
90 m_detElIn(detElIn),
91 m_detElOut(nullptr),
92 m_type(type),
94 m_phi(phi),
95 m_isInner(false),
98 m_trackletId(0),
100 m_posIn(posIn),
101 m_posOut(nullptr),
102 m_errMat(nullptr),
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),
114{ }
115
116 //for SL
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),
134 m_collectionIdHash(collectionIdHash),
136 m_detElIn(nullptr),
137 m_detElOut(detElOut),
138 m_type(type),
140 m_phi(phi),
141 m_isInner(false),
143 m_isStrip(false),
146 m_posIn(nullptr),
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),
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),
176 m_detElIn(nullptr),
177 m_detElOut(nullptr),
179 m_isAside(true),
180 m_phi(0),
181 m_isInner(false),
182 m_isForward(false),
183 m_isStrip(false),
184 m_trackletId(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),
200{ }
201
202//copy constructor:
208 m_detElIn(RIO.m_detElIn),
210 m_type(RIO.m_type),
211 m_isAside(RIO.m_isAside),
212 m_phi(RIO.m_phi),
213 m_isInner(RIO.m_isInner),
215 m_isStrip(RIO.m_isStrip),
218 m_widthIn(RIO.m_widthIn),
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),
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;
250 m_type = RIO.m_type;
251 m_phi = RIO.m_phi;
252 m_isAside = RIO.m_isAside;
253 m_isInner = RIO.m_isInner;
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;
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
282MsgStream& 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
312std::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
#define endmsg
if(febId1==febId2)
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
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)
const MuonGM::TgcReadoutElement * m_detElIn
int trackletId() const
return trackletId (Identifier for each track)
double widthIn() const
return region width of hit on TGC1
const MuonGM::TgcReadoutElement * m_detElOut
int trackletIdStrip() const
return trackletId for strip (Identifier for each track)
const Amg::Vector2D * m_posOut
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
int sub() const
return subMatrix of Tracklet or hsub of HiPt
TgcCoinData & operator=(const TgcCoinData &)
const Amg::MatrixX & errMat() const
return 2d width of ROI for SL: errMat[0][0]==(width for R), errMat[1][1]==(width for phi)
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalposIn
bool isAside() const
Aside or Cside.
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
~TgcCoinData()
Destructor:
bool isInner() const
Inner layers or BW.
int pt() const
return pt threshold value
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalposOut
Identifier channelIdIn() const
return offlineID on TGC1(HIPT) or TGC2(TRACKLET)
const Amg::MatrixX * m_errMat
CoinDataType m_type
Identifier m_channelIdIn
IdentifierHash m_collectionIdHash
Identifier channelIdOut() const
return offlineID on track on TGC3
int delta() const
return the deviation from Pt=oo track
const Amg::Vector2D * m_posIn
bool isStrip() const
Strip hit or Wire hit?
int inner() const
return InnerCoincidecne trigger bits
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
std::ostream & operator<<(std::ostream &ostr, const Muon::HedgehogBoard &board)