ATLAS Offline Software
JetConstituent.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 /***************************************************************************
6  JetConstituents.h - Description
7  -------------------
8  begin : January, 2005
9  authors : Kyle Cranmer, Andreas Wildauer
10  email : cranmer@cern.ch, andreas.wildauer@cern.ch
11 
12  changes :
13 
14 ***************************************************************************/
15 
17 
18 namespace Analysis
19 {
20 
21 
23  m_wtCryoLocal ( 0 ),
24  m_energyInSample ( CaloSampling::Unknown )
25  { }
26 
27  JetConstituent::JetConstituent(NameType& name):
28  m_name (name),
29  m_wtCryoLocal ( 0 ),
30  m_energyInSample ( CaloSampling::Unknown )//reserve space in vector
31  { }
32 
33 
34  void JetConstituent::setName(NameType& name) {m_name = name;}
35 
36  NameType JetConstituent::name() const { return m_name;}
37 
39  { return new JetConstituent( *this );}
40 
41  const Jet* JetConstituent::jet() const
42  {
43  //get jet from Navigable
44  if (this->size() ==0)
45  return 0;
46  else if (this->size() > 1)
47  return 0;
48  // this shouldn't happen
49  else
50  return getConstituentPtr((this->getConstituents()).begin());
51  }
52 
53  void JetConstituent::set_jet(const JetCollection* theContainer,
54  const Jet* the_jet,
55  double weight)
56  {
57  double newWeight = weight;
58  // jet already in collection
59  if ( this->contains(the_jet) )
60  {
61  // update weight
62  newWeight *= this->getJetWeight(the_jet);
63  // remove the previous jet
64  this->remove(the_jet);
65  }
66 
67  // from Navigable base
68  this->putElement(theContainer,the_jet,newWeight);
69 
70  }
71 
72  void JetConstituent::set_jet(const JetCollection* theContainer,
73  index_type& theIndex,
74  double weight)
75  {
76  double newWeight = weight;
77  // jet already in collection
78  if ( this->contains(theContainer,theIndex) )
79  {
80  // update weight
81  newWeight *= this->getJetWeight(theContainer,theIndex);
82  // remove the previous jet
83  this->remove(theContainer,theIndex);
84  }
85 
86  // from Navigable base
87  this->putElement(theContainer,theIndex,newWeight);
88 
89  }
90 
91  double JetConstituent::getJetWeight(const Jet* the_jet) const
92  {
93  // from Navigable
94  return (this->contains(the_jet) )
95  ? this->getParameter(the_jet)
96  : 0.;
97  }
98 
99  double JetConstituent::getJetWeight(const JetCollection* theContainer,
100  index_type& theIndex) const
101  {
102  // from Navigable
103  return (this->contains(theContainer,theIndex))
104  ? this->getParameter(theContainer,theIndex)
105  : 0.;
106  }
107 
108 
110  double JetConstituent::energyInSample( CaloSampling::CaloSample s ) const
111  {
112  return m_energyInSample[s];
113  }
114 
126  double JetConstituent::energyInCryostat() const
127  {
128  return m_wtCryoLocal*sqrt( fabs(m_energyInSample[CaloSampling::EMB3])
129  *fabs(m_energyInSample[CaloSampling::TileBar0]) );
130  }
131 
133  void JetConstituent::set_energyInSample(CaloSampling::CaloSample s, double e)
134  {
135  m_energyInSample[s] = e;
136  }
137 
140  void JetConstituent::set_wtCryo(double wtCryoLocal)
141  {
142  m_wtCryoLocal = wtCryoLocal;
143  }
144 
145 }
Analysis::NameType
std::string NameType
string to identify the constituent
Definition: IConstituent.h:39
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Jet
Basic data class defines behavior for all Jet objects The Jet class is the principal data class for...
Definition: Reconstruction/Jet/JetEvent/JetEvent/Jet.h:47
Analysis::IConstituent
Class IConstituent: This is the abstract base class for additional jet constituents to be put into th...
Definition: IConstituent.h:52
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
CaloSampling
provides Calorimeter Sampling enum
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:17
Analysis::JetConstituent
Class JetConstituent: This is the implemntation of the JetConstituent class for ParticleJet.
Definition: JetConstituent.h:53
python.Utilities.clone
clone
Definition: Utilities.py:134
JetConstituent.h
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
PixelConditionsData::getParameter
std::vector< T > getParameter(const std::string &varName, const std::vector< std::string > &buffer)
Definition: PixelConditionsDataStringUtils.h:51
PixelModuleFeMask_create_db.remove
string remove
Definition: PixelModuleFeMask_create_db.py:83
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Analysis::JetConstituent::JetConstituent
JetConstituent()
constructor
Definition: JetConstituent.cxx:31
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
Analysis::JetConstituent::index_type
Navigable< JetCollection, double >::external_index_type index_type
Definition: JetConstituent.h:55
contains
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition: hcg.cxx:111
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
JetCollection
Container for Jets
Definition: JetCollection.h:30
NameType
std::string NameType
Definition: JetINav4MomAssociation.h:29
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
index_type
unsigned int index_type
Definition: FPGATrackSimSGToRawHitsTool.h:37