ATLAS Offline Software
TrigInDetTrack.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8  : m_algId (other.m_algId),
9  m_param (other.m_param),
10  m_endParam (other.m_endParam),
11  m_chi2 (other.m_chi2),
12  m_NStrawHits (other.m_NStrawHits),
13  m_NStraw (other.m_NStraw),
14  m_NStrawTime (other.m_NStrawTime),
15  m_NTRHits (other.m_NTRHits),
16  m_NPixelSpacePoints (other.m_NPixelSpacePoints),
17  m_NSCT_SpacePoints (other.m_NSCT_SpacePoints),
18  m_HitPattern (other.m_HitPattern),
19  m_siSpacePoints (other.m_siSpacePoints),
20  m_trtDriftCircles (other.m_trtDriftCircles),
21  m_rdoList (std::move (other.m_rdoList))
22 {
23  other.m_param = nullptr;
24  other.m_endParam = nullptr;
25  other.m_siSpacePoints = nullptr;
26  other.m_trtDriftCircles = nullptr;
27 }
28 
30 {
31  eraseRdoList();
32  if(m_siSpacePoints==NULL) return;
35  it!= m_siSpacePoints->end();++it)
36  {
37 
38  std::pair < const InDet::SiCluster*, const InDet::SiCluster* > cls = (*it)->clusters();
39  if(cls.second==NULL) {//i.e pixel
41  }
42  else {
44  }
45 
46  long layer = (*it)->layer();
47  long mask = 1 << layer;
48  m_HitPattern |= mask;
49  }
50 }
51 
53  if(m_siSpacePoints==NULL) return;
54  m_rdoList.clear();
56  it!= m_siSpacePoints->end();++it)
57  {
58  std::pair < const InDet::SiCluster*, const InDet::SiCluster* > cls = (*it)->clusters();
59  if(cls.first!=NULL) {
60  std::copy(cls.first->rdoList().begin(),cls.first->rdoList().end(),std::back_inserter(m_rdoList));
61  }
62  if(cls.second!=NULL) {
63  std::copy(cls.second->rdoList().begin(),cls.second->rdoList().end(),std::back_inserter(m_rdoList));
64  }
65  }
66 }
67 
68 std::string str( const TrigInDetTrack& t ) //<! printing helper
69 {
70  std::stringstream ss;
71  const TrigInDetTrackFitPar* p = t.param();
72 
73  ss << "AlgorithmID: "<<t.algorithmId()
74  << "d0: "<<p->a0()
75  <<" z0: "<<p->z0()
76  <<" phi0: "<<p->phi0()
77  <<" eta: "<<p->eta()
78  <<" pT: "<<p->pT()
79  <<" chi2: "<<t.chi2()
80  <<" NpixSPs: "<<t.NPixelSpacePoints()
81  <<" NsctSPs: "<<t.NSCT_SpacePoints()
82  <<" NstrawHits: "<<t.NStrawHits()
83  <<" HitPattern: "<<t.HitPattern();
84  return ss.str();
85 }
86 
87 MsgStream& operator<< ( MsgStream& m, const TrigInDetTrack& t ) //<! printing helper (wraps above)
88 {
89  m << str(t);
90  return m;
91 }
92 
94 {
95  const double epsilon = 1e-8;
96 
97  const TrigInDetTrackFitPar* pA = a.param();
98  const TrigInDetTrackFitPar* pB = b.param();
99 
100  if(a.algorithmId() != b.algorithmId()) return false;
101  if(a.HitPattern() != b.HitPattern()) return false;
102  if(a.NStrawHits() != b.NStrawHits()) return false;
103  if(fabs(a.chi2()-b.chi2())>epsilon) return false;
104  if(fabs(pA->a0()-pB->a0())>epsilon) return false;
105  if(fabs(pA->z0()-pB->z0())>epsilon) return false;
106  if(fabs(pA->phi0()-pB->phi0())>epsilon) return false;
107  if(fabs(pA->eta()-pB->eta())>epsilon) return false;
108  if(fabs(pA->pT()-pB->pT())>epsilon) return false;
109  return true;
110 }
111 
112 void diff( const TrigInDetTrack& a, const TrigInDetTrack& b, std::map<std::string, double>& variableChange )
113 {
114  const TrigInDetTrackFitPar* pA = a.param();
115  const TrigInDetTrackFitPar* pB = b.param();
116 
117  variableChange["d0"] = pA->a0() - pB->a0();
118  variableChange["z0"] = pA->z0() - pB->z0();
119  variableChange["phi0"] = pA->phi0() - pB->phi0();
120  variableChange["eta"] = pA->eta() - pB->eta();
121  variableChange["pT"] = pA->pT() - pB->pT();
122  variableChange["chi2"] = a.chi2() - b.chi2();
123 }
124 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
TrigInDetTrack::m_rdoList
std::vector< Identifier > m_rdoList
Definition: TrigInDetTrack.h:216
operator==
bool operator==(const TrigInDetTrack &a, const TrigInDetTrack &b)
Definition: TrigInDetTrack.cxx:93
TrigInDetTrackFitPar
Definition: TrigInDetTrackFitPar.h:67
skel.it
it
Definition: skel.GENtoEVGEN.py:423
CaloClusterListBadChannel.cls
cls
Definition: CaloClusterListBadChannel.py:8
TrigInDetTrackFitPar::eta
void eta(const double eta)
Setter: pseudorapidity.
Definition: TrigInDetTrackFitPar.h:219
TrigInDetTrackFitPar::z0
void z0(const double z0)
Setter: longitudinal impact parameter.
Definition: TrigInDetTrackFitPar.h:215
TrigInDetTrack::eraseRdoList
void eraseRdoList()
Definition: TrigInDetTrack.h:193
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
str
std::string str(const TrigInDetTrack &t)
Definition: TrigInDetTrack.cxx:68
TrigInDetTrack::m_HitPattern
long m_HitPattern
Definition: TrigInDetTrack.h:211
TrigInDetTrack
Definition: TrigInDetTrack.h:34
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
TrigInDetTrack::TrigInDetTrack
TrigInDetTrack()
Constructors: POOL needs default constructor.
Definition: TrigInDetTrack.h:42
TrigInDetTrack.h
TrigInDetTrack::m_siSpacePoints
std::vector< const TrigSiSpacePoint * > * m_siSpacePoints
Definition: TrigInDetTrack.h:212
TrigInDetTrack::m_NPixelSpacePoints
int m_NPixelSpacePoints
Definition: TrigInDetTrack.h:209
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
TrigInDetTrack::fillSiHitInfo
void fillSiHitInfo()
Definition: TrigInDetTrack.cxx:29
TrigInDetTrack::fillRdoList
void fillRdoList()
Definition: TrigInDetTrack.cxx:52
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TrigInDetTrackFitPar::a0
void a0(const double a0)
Setter: transverse impact parameter.
Definition: TrigInDetTrackFitPar.h:213
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
operator<<
MsgStream & operator<<(MsgStream &m, const TrigInDetTrack &t)
Definition: TrigInDetTrack.cxx:87
TrigInDetTrack::m_NSCT_SpacePoints
int m_NSCT_SpacePoints
Definition: TrigInDetTrack.h:210
calibdata.copy
bool copy
Definition: calibdata.py:27
TrigInDetTrackFitPar::phi0
void phi0(const double phi0)
Setter: azimuthal angle of the momentum.
Definition: TrigInDetTrackFitPar.h:217
TrigInDetTrackFitPar::pT
void pT(const double pT)
Setter: transverse momentum.
Definition: TrigInDetTrackFitPar.h:221
diff
void diff(const TrigInDetTrack &a, const TrigInDetTrack &b, std::map< std::string, double > &variableChange)
comparison with feedback Function compares two objects and returns "semi verbose" output in the form ...
Definition: TrigInDetTrack.cxx:112