ATLAS Offline Software
TauPi0Cluster.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <iostream>
7 #include "tauEvent/TauDetails.h"
8 
9 namespace Analysis {
10 
11  // default constructor
13  m_DELTA_PHI(TauDetails::DEFAULT),
14  m_DELTA_THETA(TauDetails::DEFAULT),
15  m_ENG_FRAC_EM(TauDetails::DEFAULT),
16  m_ENG_FRAC_MAX(TauDetails::DEFAULT),
17  m_ENG_FRAC_CORE(TauDetails::DEFAULT),
18  m_SECOND_ENG_DENS(TauDetails::DEFAULT),
19  m_LATERAL(TauDetails::DEFAULT),
20  m_LONGITUDINAL(TauDetails::DEFAULT),
21  m_EM1CoreFrac(TauDetails::DEFAULT),
22  m_asymmetryInEM1WRTTrk(TauDetails::DEFAULT),
23  m_NHitsInEM1(TauDetails::DEFAULT_INT),
24  m_NPosECells_PS(TauDetails::DEFAULT_INT),
25  m_NPosECells_EM1(TauDetails::DEFAULT_INT),
26  m_NPosECells_EM2(TauDetails::DEFAULT_INT),
27  m_firstEtaWRTClusterPosition_EM1(TauDetails::DEFAULT),
28  m_firstEtaWRTClusterPosition_EM2(TauDetails::DEFAULT),
29  m_secondEtaWRTClusterPosition_EM1(TauDetails::DEFAULT),
30  m_secondEtaWRTClusterPosition_EM2(TauDetails::DEFAULT),
31  m_BDTScore(TauDetails::DEFAULT)
32  {
33  }
34 
35  // copy constructor
37  m_cluster(rhs.m_cluster),
38  m_tauShotVector(rhs.m_tauShotVector),
39  m_DELTA_PHI(rhs.m_DELTA_PHI),
40  m_DELTA_THETA(rhs.m_DELTA_THETA),
41  m_ENG_FRAC_EM(rhs.m_ENG_FRAC_EM),
42  m_ENG_FRAC_MAX(rhs.m_ENG_FRAC_MAX),
43  m_ENG_FRAC_CORE(rhs.m_ENG_FRAC_CORE),
44  m_SECOND_ENG_DENS(rhs.m_SECOND_ENG_DENS),
45  m_LATERAL(rhs.m_LATERAL),
46  m_LONGITUDINAL(rhs.m_LONGITUDINAL),
47  m_EM1CoreFrac(rhs.m_EM1CoreFrac),
48  m_asymmetryInEM1WRTTrk(rhs.m_asymmetryInEM1WRTTrk),
49  m_NHitsInEM1(rhs.m_NHitsInEM1),
50  m_NPosECells_PS(rhs.m_NPosECells_PS),
51  m_NPosECells_EM1(rhs.m_NPosECells_EM1),
52  m_NPosECells_EM2(rhs.m_NPosECells_EM2),
53  m_firstEtaWRTClusterPosition_EM1(rhs.m_firstEtaWRTClusterPosition_EM1),
54  m_firstEtaWRTClusterPosition_EM2(rhs.m_firstEtaWRTClusterPosition_EM2),
55  m_secondEtaWRTClusterPosition_EM1(rhs.m_secondEtaWRTClusterPosition_EM1),
56  m_secondEtaWRTClusterPosition_EM2(rhs.m_secondEtaWRTClusterPosition_EM2),
57  m_BDTScore(rhs.m_BDTScore)
58  {
59  }
60 
61  // Assignment operator
63  {
64  if (this!=&rhs) {
65  m_cluster = rhs.m_cluster;
73  m_LATERAL = rhs.m_LATERAL;
85  m_BDTScore = rhs.m_BDTScore;
86  }
87  return *this;
88  }
89 
90  bool TauPi0Cluster::operator==( const TauPi0Cluster& rhs ) const{
91  if(m_cluster != rhs.m_cluster) return false;
92  if(m_tauShotVector.size() != rhs.m_tauShotVector.size()) return false;
93  for(unsigned iShot=0; iShot!=m_tauShotVector.size();++iShot){
94  if(!(*(m_tauShotVector.at(iShot))==*(rhs.m_tauShotVector.at(iShot)))) return false;
95  }
96  if(m_DELTA_PHI != rhs.m_DELTA_PHI) return false;
97  if(m_DELTA_THETA != rhs.m_DELTA_THETA) return false;
98  if(m_ENG_FRAC_EM != rhs.m_ENG_FRAC_EM) return false;
99  if(m_ENG_FRAC_MAX != rhs.m_ENG_FRAC_MAX) return false;
100  if(m_ENG_FRAC_CORE != rhs.m_ENG_FRAC_CORE) return false;
101  if(m_SECOND_ENG_DENS != rhs.m_SECOND_ENG_DENS) return false;
102  if(m_LATERAL != rhs.m_LATERAL) return false;
103  if(m_LONGITUDINAL != rhs.m_LONGITUDINAL) return false;
104  if(m_EM1CoreFrac != rhs.m_EM1CoreFrac) return false;
105  if(m_asymmetryInEM1WRTTrk != rhs.m_asymmetryInEM1WRTTrk) return false;
106  if(m_NHitsInEM1 != rhs.m_NHitsInEM1) return false;
107  if(m_NPosECells_PS != rhs.m_NPosECells_PS) return false;
108  if(m_NPosECells_EM1 != rhs.m_NPosECells_EM1) return false;
109  if(m_NPosECells_EM2 != rhs.m_NPosECells_EM2) return false;
114  if(m_BDTScore != rhs.m_BDTScore) return false;
115  return true;
116  }
117 
118  bool TauPi0Cluster::operator!=( const TauPi0Cluster& rhs ) const{
119  if(m_cluster != rhs.m_cluster) return true;
120  if(m_tauShotVector.size() != rhs.m_tauShotVector.size()) return true;
121  for(unsigned iShot=0; iShot!=m_tauShotVector.size();++iShot){
122  if(!(*(m_tauShotVector.at(iShot))==*(rhs.m_tauShotVector.at(iShot)))) return true;
123  }
124  if(m_DELTA_PHI != rhs.m_DELTA_PHI) return true;
125  if(m_DELTA_THETA != rhs.m_DELTA_THETA) return true;
126  if(m_ENG_FRAC_EM != rhs.m_ENG_FRAC_EM) return true;
127  if(m_ENG_FRAC_MAX != rhs.m_ENG_FRAC_MAX) return true;
128  if(m_ENG_FRAC_CORE != rhs.m_ENG_FRAC_CORE) return true;
129  if(m_SECOND_ENG_DENS != rhs.m_SECOND_ENG_DENS) return true;
130  if(m_LATERAL != rhs.m_LATERAL) return true;
131  if(m_LONGITUDINAL != rhs.m_LONGITUDINAL) return true;
132  if(m_EM1CoreFrac != rhs.m_EM1CoreFrac) return true;
133  if(m_asymmetryInEM1WRTTrk != rhs.m_asymmetryInEM1WRTTrk) return true;
134  if(m_NHitsInEM1 != rhs.m_NHitsInEM1) return true;
135  if(m_NPosECells_PS != rhs.m_NPosECells_PS) return true;
136  if(m_NPosECells_EM1 != rhs.m_NPosECells_EM1) return true;
137  if(m_NPosECells_EM2 != rhs.m_NPosECells_EM2) return true;
142  if(m_BDTScore != rhs.m_BDTScore) return true;
143  return false;
144  }
145 
146  // destructor
148  {
149  }
150 
151  // just for testing.
153  {
154  int oldpr = std::cout.precision(5); // store and change precision
155  std::cout << "in TauPi0Cluster::dump()" << std::endl;
156  std::cout << "-------------------------" << std::endl;
157  std::cout << "m_DELTA_PHI = " << m_DELTA_PHI << std::endl;
158  std::cout << "m_DELTA_THETA = " << m_DELTA_THETA << std::endl;
159  std::cout << "m_ENG_FRAC_EM = " << m_ENG_FRAC_EM << std::endl;
160  std::cout << "m_ENG_FRAC_MAX = " << m_ENG_FRAC_MAX << std::endl;
161  std::cout << "m_ENG_FRAC_CORE = " << m_ENG_FRAC_CORE << std::endl;
162  std::cout << "m_SECOND_ENG_DENS = " << m_SECOND_ENG_DENS << std::endl;
163  if (m_SECOND_ENG_DENS>0)
164  std::cout << "log(m_SECOND_ENG_DENS) = " << log(m_SECOND_ENG_DENS) << std::endl;
165  std::cout << "m_LATERAL = " << m_LATERAL << std::endl;
166  std::cout << "m_LONGITUDINAL = " << m_LONGITUDINAL << std::endl;
167  std::cout << "m_EM1CoreFrac = " << m_EM1CoreFrac << std::endl;
168  std::cout << "m_asymmetryInEM1WRTTrk = " << m_asymmetryInEM1WRTTrk << std::endl;
169  std::cout << "m_NHitsInEM1 = " << m_NHitsInEM1 << std::endl;
170  std::cout << "m_NPosECells_PS = " << m_NPosECells_PS << std::endl;
171  std::cout << "m_NPosECells_EM1 = " << m_NPosECells_EM1 << std::endl;
172  std::cout << "m_NPosECells_EM2 = " << m_NPosECells_EM2 << std::endl;
173  std::cout << "m_firstEtaWRTClusterPosition_EM1 = " << m_firstEtaWRTClusterPosition_EM1 << std::endl;
174  std::cout << "m_firstEtaWRTClusterPosition_EM2 = " << m_firstEtaWRTClusterPosition_EM2 << std::endl;
175  std::cout << "m_secondEtaWRTClusterPosition_EM1 = " << m_secondEtaWRTClusterPosition_EM1 << std::endl;
176  std::cout << "m_secondEtaWRTClusterPosition_EM2 = " << m_secondEtaWRTClusterPosition_EM2 << std::endl;
177  std::cout << "m_BDTScore = " << m_BDTScore << std::endl;
178  if (m_cluster.isValid()) {
179  std::cout << "this->cluster()->e() = " << this->cluster()->e() << std::endl;
180  std::cout << "this->cluster()->pt() = " << this->cluster()->pt() << std::endl;
181  std::cout << "this->cluster()->eta() = " << this->cluster()->eta() << std::endl;
182  std::cout << "this->cluster()->phi() = " << this->cluster()->phi() << std::endl;
183  }
184  std::cout << std::endl <<std::endl;
185  std::cout << "-------------------------" <<std::endl;
186  std::cout.precision(oldpr); //restore previous precision
187  }
188 }
Analysis::TauPi0Cluster::m_asymmetryInEM1WRTTrk
float m_asymmetryInEM1WRTTrk
Definition: TauPi0Cluster.h:429
P4EEtaPhiMBase::pt
virtual double pt() const
transverse momentum
Definition: P4EEtaPhiMBase.cxx:101
Analysis::TauPi0Cluster::~TauPi0Cluster
virtual ~TauPi0Cluster()
destructor (virtual)
Definition: TauPi0Cluster.cxx:147
Analysis::TauPi0Cluster::m_DELTA_THETA
float m_DELTA_THETA
Definition: TauPi0Cluster.h:421
Analysis::TauPi0Cluster::m_LATERAL
float m_LATERAL
Definition: TauPi0Cluster.h:426
Analysis::TauPi0Cluster::m_ENG_FRAC_CORE
float m_ENG_FRAC_CORE
Definition: TauPi0Cluster.h:424
Analysis::TauPi0Cluster::m_firstEtaWRTClusterPosition_EM2
float m_firstEtaWRTClusterPosition_EM2
Definition: TauPi0Cluster.h:435
Analysis::TauPi0Cluster::m_tauShotVector
std::vector< TauShot * > m_tauShotVector
Definition: TauPi0Cluster.h:417
Analysis::TauPi0Cluster::cluster
const CaloCluster * cluster() const
Get cluster Consider using direct access through clusterLink() instead.
TauDetails.h
Analysis::TauDetails
Definition: TauDetails.h:26
Analysis::TauPi0Cluster::dump
void dump()
Definition: TauPi0Cluster.cxx:152
Analysis::TauPi0Cluster::m_BDTScore
float m_BDTScore
Definition: TauPi0Cluster.h:438
Analysis::TauPi0Cluster
Definition: TauPi0Cluster.h:28
Analysis::TauPi0Cluster::TauPi0Cluster
TauPi0Cluster()
default constructor
Definition: TauPi0Cluster.cxx:12
Analysis::TauPi0Cluster::m_NPosECells_EM2
int m_NPosECells_EM2
Definition: TauPi0Cluster.h:433
TauPi0Cluster.h
Analysis::TauPi0Cluster::m_firstEtaWRTClusterPosition_EM1
float m_firstEtaWRTClusterPosition_EM1
Definition: TauPi0Cluster.h:434
Analysis::TauPi0Cluster::m_SECOND_ENG_DENS
float m_SECOND_ENG_DENS
Definition: TauPi0Cluster.h:425
Analysis::TauPi0Cluster::m_ENG_FRAC_MAX
float m_ENG_FRAC_MAX
Definition: TauPi0Cluster.h:423
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
Analysis::TauPi0Cluster::m_secondEtaWRTClusterPosition_EM2
float m_secondEtaWRTClusterPosition_EM2
Definition: TauPi0Cluster.h:437
Analysis::TauPi0Cluster::operator==
bool operator==(const TauPi0Cluster &rhs) const
Equality operator.
Definition: TauPi0Cluster.cxx:90
Analysis::TauPi0Cluster::m_secondEtaWRTClusterPosition_EM1
float m_secondEtaWRTClusterPosition_EM1
Definition: TauPi0Cluster.h:436
Analysis::TauPi0Cluster::m_DELTA_PHI
float m_DELTA_PHI
cluster external properties
Definition: TauPi0Cluster.h:420
Analysis::TauPi0Cluster::m_NPosECells_PS
int m_NPosECells_PS
Definition: TauPi0Cluster.h:431
Analysis::TauPi0Cluster::m_EM1CoreFrac
float m_EM1CoreFrac
Definition: TauPi0Cluster.h:428
CaloCluster::eta
virtual double eta() const
Retrieve eta independent of signal state.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:755
Analysis::TauPi0Cluster::operator=
TauPi0Cluster & operator=(const TauPi0Cluster &rhs)
assignment operator
Definition: TauPi0Cluster.cxx:62
Analysis::TauPi0Cluster::m_cluster
ElementLink< CaloClusterContainer > m_cluster
cluster
Definition: TauPi0Cluster.h:414
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
CaloCluster::e
virtual double e() const
Retrieve energy independent of signal state.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:753
Analysis::TauPi0Cluster::m_ENG_FRAC_EM
float m_ENG_FRAC_EM
Definition: TauPi0Cluster.h:422
Analysis::TauPi0Cluster::m_NPosECells_EM1
int m_NPosECells_EM1
Definition: TauPi0Cluster.h:432
Analysis::TauPi0Cluster::m_NHitsInEM1
int m_NHitsInEM1
Definition: TauPi0Cluster.h:430
Analysis::TauPi0Cluster::m_LONGITUDINAL
float m_LONGITUDINAL
Definition: TauPi0Cluster.h:427
Analysis::TauPi0Cluster::operator!=
bool operator!=(const TauPi0Cluster &rhs) const
Inequality operator.
Definition: TauPi0Cluster.cxx:118
CaloCluster::phi
virtual double phi() const
Retrieve phi independent of signal state.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:759