ATLAS Offline Software
Loading...
Searching...
No Matches
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
18namespace Analysis
19{
20
21
26
28 m_name (name),
29 m_wtCryoLocal ( 0 ),
30 m_energyInSample ( CaloSampling::Unknown )//reserve space in vector
31 { }
32
33
35
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
114
127 {
128 return m_wtCryoLocal*sqrt( fabs(m_energyInSample[CaloSampling::EMB3])
129 *fabs(m_energyInSample[CaloSampling::TileBar0]) );
130 }
131
137
140 void JetConstituent::set_wtCryo(double wtCryoLocal)
141 {
142 m_wtCryoLocal = wtCryoLocal;
143 }
144
145}
@ Unknown
Definition TruthClasses.h:9
Class IConstituent: This is the abstract base class for additional jet constituents to be put into th...
virtual void setName(NameType &name)
to set the name
void set_jet(const JetCollection *theContainer, const Jet *the_jet, double weight=1)
const Jet * jet() const
get jet directly without token
std::vector< double > m_energyInSample
void set_wtCryo(double)
Set wtCryoLocal defined as wtCryoLocal = wtCryo / sqrt(average_TileBar0_weight * average_EMB3_weight)
double getJetWeight(const Jet *the_jet) const
void set_energyInSample(CaloSampling::CaloSample, double)
set energy in sample WITH hadronic weights
virtual IConstituent * clone() const
a clone method for the proper workings of the copy constructor
double energyInSample(CaloSampling::CaloSample) const
This is the energy in a sample with the navigation weight and hadronic calibration.
Navigable< JetCollection, double >::external_index_type index_type
double energyInCryostat() const
The estimate of the energy cryostat.
virtual NameType name() const
returns the infoType of the info objects.
const constituent_coll & getConstituents() const
Definition Navigable.h:290
virtual unsigned int size() const
virtual object_iter begin() const
bool remove(const constituent_type *aConstituent)
void putElement(const JetCollection *objectContainer, const constituent_type *constituentObject, const double &objectParameter=double(), size_t sizeHint=0)
double getParameter(const constituent_type *aConstituent) const
bool contains(const constituent_type *aConstituent) const
virtual const constituent_type * getConstituentPtr(constituent_iter iter) const
The namespace of all packages in PhysicsAnalysis/JetTagging.
std::string NameType
string to identify the constituent