ATLAS Offline Software
TauPi0Details.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // implementation of TauPi0Details
6 
10 #include "tauEvent/TauPi0Cluster.h"
11 
12 using namespace CLHEP;
13 
14 namespace Analysis {
15 
16  // default constructor
17  TauPi0Details::TauPi0Details() :
18  TauDetails(),
19  m_pi0CandContainer(0),
20  m_visTau_hlv(HepLorentzVector(0.,0.,0.,0.))
21  {
22  }
23 
24  // copy constructor
26  TauDetails(),
27  m_pi0CandContainer()
28  {
29  std::vector<Analysis::TauPi0Candidate*>::const_iterator candIt = rhs.m_pi0CandContainer.begin();
30  std::vector<Analysis::TauPi0Candidate*>::const_iterator candItEnd = rhs.m_pi0CandContainer.end();
31  // create new copies and take ownership
32  for (; candIt!=candItEnd; ++candIt) m_pi0CandContainer.push_back( new TauPi0Candidate( *(*candIt) ) );
33 
34  // Same for TauPi0Clusters
35  std::vector<Analysis::TauPi0Cluster*>::const_iterator clusIt = rhs.m_pi0ClusContainer.begin();
36  std::vector<Analysis::TauPi0Cluster*>::const_iterator clusItEnd = rhs.m_pi0ClusContainer.end();
37  // create new copies and take ownership
38  for (; clusIt!=clusItEnd; ++clusIt) m_pi0ClusContainer.push_back( new TauPi0Cluster( *(*clusIt) ) );
39 
40  // Same for TauShots
41  std::vector<Analysis::TauShot*>::const_iterator shotIt = rhs.m_shotContainer.begin();
42  std::vector<Analysis::TauShot*>::const_iterator shotItEnd = rhs.m_shotContainer.end();
43  // create new copies and take ownership
44  for (; shotIt!=shotItEnd; ++shotIt) m_shotContainer.push_back( new TauShot( *(*shotIt) ) );
45 
47  }
48 
49  // Assignment operator
51  {
52  if (this!=&rhs) {
53  std::vector<Analysis::TauPi0Candidate*>::const_iterator candIt = m_pi0CandContainer.begin();
54  std::vector<Analysis::TauPi0Candidate*>::const_iterator candItEnd = m_pi0CandContainer.end();
55  // delete existing objects
56  for (; candIt!=candItEnd; ++candIt) delete (*candIt);
57  candIt = rhs.m_pi0CandContainer.begin();
58  candItEnd = rhs.m_pi0CandContainer.end();
59  // create new copies and take ownership
60  for (; candIt!=candItEnd; ++candIt) m_pi0CandContainer.push_back( new TauPi0Candidate( *(*candIt) ) );
61 
62  // Same for TauPi0Clusters
63  std::vector<Analysis::TauPi0Cluster*>::const_iterator clusIt = m_pi0ClusContainer.begin();
64  std::vector<Analysis::TauPi0Cluster*>::const_iterator clusItEnd = m_pi0ClusContainer.end();
65  // delete existing objects
66  for (; clusIt!=clusItEnd; ++clusIt) delete (*clusIt);
67  clusIt = rhs.m_pi0ClusContainer.begin();
68  clusItEnd = rhs.m_pi0ClusContainer.end();
69  // create new copies and take ownership
70  for (; clusIt!=clusItEnd; ++clusIt) m_pi0ClusContainer.push_back( new TauPi0Cluster( *(*clusIt) ) );
71 
72  // Same for TauShots
73  std::vector<Analysis::TauShot*>::const_iterator shotIt = m_shotContainer.begin();
74  std::vector<Analysis::TauShot*>::const_iterator shotItEnd = m_shotContainer.end();
75  // delete existing objects
76  for (; shotIt!=shotItEnd; ++shotIt) delete (*shotIt);
77  shotIt = rhs.m_shotContainer.begin();
78  shotItEnd = rhs.m_shotContainer.end();
79  // create new copies and take ownership
80  for (; shotIt!=shotItEnd; ++shotIt) m_shotContainer.push_back( new TauShot( *(*shotIt) ) );
81 
83  }
84  return *this;
85  }
86 
87  // destructor
89  {
90  std::vector<Analysis::TauPi0Candidate*>::const_iterator candIt = m_pi0CandContainer.begin();
91  std::vector<Analysis::TauPi0Candidate*>::const_iterator candItEnd = m_pi0CandContainer.end();
92  // delete existing objects
93  for (; candIt!=candItEnd; ++candIt) delete (*candIt);
94 
95  // Same for TauPi0Clusters
96  std::vector<Analysis::TauPi0Cluster*>::const_iterator clusIt = m_pi0ClusContainer.begin();
97  std::vector<Analysis::TauPi0Cluster*>::const_iterator clusItEnd = m_pi0ClusContainer.end();
98  // delete existing objects
99  for (; clusIt!=clusItEnd; ++clusIt) delete (*clusIt);
100 
101  // Same for TauShots
102  std::vector<Analysis::TauShot*>::const_iterator shotIt = m_shotContainer.begin();
103  std::vector<Analysis::TauShot*>::const_iterator shotItEnd = m_shotContainer.end();
104  // delete existing objects
105  for (; shotIt!=shotItEnd; ++shotIt) delete (*shotIt);
106 
107  }
108 
109  //Class name
111 
112  const std::string& TauPi0Details::className() const
113  {
114  return s_className;
115  }
116 
117 } //end of namespace Analysis
Analysis::TauPi0Details
Definition: TauPi0Details.h:35
Analysis::TauPi0Details::~TauPi0Details
virtual ~TauPi0Details()
destructor (virtual)
Definition: TauPi0Details.cxx:88
Analysis::TauPi0Details::m_pi0ClusContainer
std::vector< TauPi0Cluster * > m_pi0ClusContainer
Definition: TauPi0Details.h:107
TauPi0Candidate.h
Analysis::TauDetails
Definition: TauDetails.h:26
Analysis::TauPi0Details::m_pi0CandContainer
std::vector< TauPi0Candidate * > m_pi0CandContainer
Definition: TauPi0Details.h:106
TauPi0Details.h
Analysis::TauPi0Cluster
Definition: TauPi0Cluster.h:28
Analysis::TauShot
Definition: TauShot.h:48
ClassName.h
An interface for getting the name of a class as a string.
Analysis::TauPi0Candidate
Definition: TauPi0Candidate.h:28
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
ClassName::name
static std::string name()
Return the name of class T as a string.
TauPi0Cluster.h
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
Analysis::TauPi0Details::s_className
static const std::string s_className
Definition: TauPi0Details.h:101
Analysis::TauPi0Details::m_visTau_hlv
CLHEP::HepLorentzVector m_visTau_hlv
Definition: TauPi0Details.h:109
Analysis::TauPi0Details::m_shotContainer
std::vector< TauShot * > m_shotContainer
Definition: TauPi0Details.h:108
Analysis::TauPi0Details::className
virtual const std::string & className() const
Get name of class.
Definition: TauPi0Details.cxx:112
Analysis::TauPi0Details::operator=
TauPi0Details & operator=(const TauPi0Details &rhs)
Assignment operator.
Definition: TauPi0Details.cxx:50
Analysis::TauPi0Details::TauPi0Details
TauPi0Details()
default constructor
Definition: TauPi0Details.cxx:17