ATLAS Offline Software
Loading...
Searching...
No Matches
GSCCalibStep Class Reference

#include <GSCCalibStep.h>

Inheritance diagram for GSCCalibStep:
Collaboration diagram for GSCCalibStep:

Public Member Functions

 GSCCalibStep (const std::string &name="GSCCalibStep")
 Constructor with parameters:
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function.
virtual StatusCode calibrate (xAOD::JetContainer &) const override
 Apply calibration to a jet container.
virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
virtual StatusCode getNominalResolutionData (const xAOD::Jet &, const JetHelper::JetContext &, double &) const
virtual StatusCode getNominalResolutionMC (const xAOD::Jet &, const JetHelper::JetContext &, double &) const
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

float getChargedFractionResponse (const xAOD::Jet &jet, const JetHelper::JetContext &jc, uint etabin) const
 Functions for retrieving the correction factors.
float getTile0Response (const xAOD::Jet &jet, const JetHelper::JetContext &jc, uint etabin) const
float getEM3Response (const xAOD::Jet &jet, const JetHelper::JetContext &jc, uint etabin) const
float getPunchThroughResponse (const xAOD::Jet &jet, const JetHelper::JetContext &jc, double eta_det) const
float getNTrkResponse (const xAOD::Jet &jet, const JetHelper::JetContext &jc, uint etabin) const
float getTrackWIDTHResponse (const xAOD::Jet &jet, const JetHelper::JetContext &jc, uint etabin) const
const xAOD::VertexfindHSVertex (const xAOD::VertexContainer &vertices) const
 Retrieve hard scatter vertex for its index. Return nullptr if one cannot be found.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< std::string > m_jetInScale {this, "InScale", "JetEtaJESScaleMomentum", "Starting jet scale"}
Gaudi::Property< std::string > m_jetOutScale {this, "OutScale", "JetGSCScaleMomentum", "Ending jet scale"}
ToolHandleArray< JetHelper::IVarToolm_histTool_EM3 = {this , "histTool_EM3", {}, "EM3 histo reader" }
ToolHandleArray< JetHelper::IVarToolm_histTool_ChargedFraction = {this , "histTool_CharFrac", {}, "ChargedFraction histo reader" }
ToolHandleArray< JetHelper::IVarToolm_histTool_Tile0 = {this , "histTool_Tile0", {}, "Tile0 histo reader" }
ToolHandleArray< JetHelper::IVarToolm_histTool_PunchThrough = {this , "histTool_PunchThrough", {}, "PunchThrough histo reader" }
ToolHandleArray< JetHelper::IVarToolm_histTool_nTrk = {this , "histTool_nTrk", {}, "nTrk histo reader" }
ToolHandleArray< JetHelper::IVarToolm_histTool_trackWIDTH = {this , "histTool_trackWIDTH", {}, "trackWIDTH histo reader" }
Gaudi::Property< bool > m_applyChargedFraction {this, "applyChargedFraction", true, "Boolean to turn on/off chargedFraction corretion"}
 Booleans to apply calibration steps:
Gaudi::Property< bool > m_applyTile0 {this, "applyTile0", true, "Boolean to turn on/off Tile0 corretion"}
Gaudi::Property< bool > m_applyEM3 {this, "applyEM3", true, "Boolean to turn on/off EM3 corretion"}
Gaudi::Property< bool > m_applyNtrk {this, "applyNtrk", true, "Boolean to turn on/off Ntrk corretion"}
Gaudi::Property< bool > m_applyTrackWidth {this, "applyTrackWidth", true, "Boolean to turn on/off trackWidth corretion"}
Gaudi::Property< bool > m_applyPunchThrough {this, "applyPunchThrough", false, "Boolean to turn on punch-through corretion"}
 Properties for the punch-through correction:
Gaudi::Property< std::vector< double > > m_punchThroughEtaBins {this, "PunchThroughEtaBins", {}, "Eta bins for punch through correction"}
Gaudi::Property< float > m_punchThroughMinPt { this, "punchThroughMinPt", 50000., "Threshold for punch-through correction"}
SG::ReadHandleKey< xAOD::VertexContainerm_vertexContainer_key {this, "VertexContainer", "PrimaryVertices", "SG key for input vertex container"}
SG::ReadHandleKey< xAOD::EventInfom_eventInfo_key {this, "EventInfoKey", "EventInfo"}
 EventInfo to retrieve PV index for analyses choosing their own PV (e.g. H to yy).
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 29 of file GSCCalibStep.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ GSCCalibStep()

GSCCalibStep::GSCCalibStep ( const std::string & name = "GSCCalibStep")

Constructor with parameters:

Definition at line 13 of file GSCCalibStep.cxx.

14 : asg::AsgTool( name ){ }

Member Function Documentation

◆ calibrate()

StatusCode GSCCalibStep::calibrate ( xAOD::JetContainer & jets) const
overridevirtual

Apply calibration to a jet container.

Implements IJetCalibStep.

Definition at line 51 of file GSCCalibStep.cxx.

51 {
52
53 ATH_MSG_DEBUG("Calibrating jet collection with GSC.");
54
55 // Retrieve the primary vertex location:
56 int PVindex = 0;
57
58 // Check if an analysis choose their own PV vertex ("PVIndex")
59 static const SG::AuxElement::ConstAccessor<int> pvIndexAccessor("PVIndex");
60 SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfo_key);
61 if(eventInfo.isValid()) {
62 if(pvIndexAccessor.isAvailable(*eventInfo)){
63 PVindex = pvIndexAccessor(*eventInfo);
64 }
65 }
66 else{
67 // Get the PV index directly from the vertices
68 SG::ReadHandle<xAOD::VertexContainer> vertexHandle = SG::makeHandle (m_vertexContainer_key);
69 const xAOD::VertexContainer& vertices = *vertexHandle;
70 const xAOD::Vertex *HSvertex = findHSVertex(vertices);
71 if(!HSvertex) {
72 ATH_MSG_WARNING("Invalid primary vertex found, will not continue applying the GSC.");
73 return StatusCode::FAILURE;
74 }
75 PVindex = HSvertex->index();
76 }
77
78 ATH_MSG_DEBUG("PV index:" << PVindex);
79
80 // Needed for per-vertex reconstructed jets
81 static const SG::ConstAccessor<xAOD::Vertex> originVertexAcc("OriginVertex");
82
83 // Calibrate the jets
84 for (xAOD::Jet* jet : jets){
85
86 JetHelper::JetContext jc;
87
88 // For the per-vertex reconstructed jets, use the vertex the jet was reconstructed with respect to
89 if(originVertexAcc.isAvailable(*jet)){
90 PVindex = jet->getAssociatedObject<xAOD::Vertex>("OriginVertex")->index();
91 }
92
93 // get trackWIDTHPVX
94 float trackWIDTHPVX = 0;
95 static const SG::ConstAccessor<std::vector<float> > TrackWidthPt1000Acc ("TrackWidthPt1000");
96 if(TrackWidthPt1000Acc.isAvailable(*jet))
97 {
98 trackWIDTHPVX = TrackWidthPt1000Acc(*jet).at(PVindex);
99 ATH_MSG_DEBUG("trackWIDTHPVX found set to: " << trackWIDTHPVX);
100 }
101 jc.setValue("trackWIDTH", trackWIDTHPVX);
102
103 // get nTrkPVX
104 int nTrkPVX = 0;
105 static const SG::ConstAccessor<std::vector<int>> NumTrkPt1000Acc ("NumTrkPt1000");
106 if(NumTrkPt1000Acc.isAvailable(*jet))
107 {
108 nTrkPVX = NumTrkPt1000Acc(*jet).at(PVindex);
109 ATH_MSG_DEBUG("nTrkPVX found set to: " << nTrkPVX);
110 }
111 jc.setValue("nTrk", nTrkPVX);
112
113 // get Charged Fraction
114 xAOD::JetFourMom_t jetconstitP4 = jet->getAttribute<xAOD::JetFourMom_t>("JetConstitScaleMomentum");
115 float ChargedFraction = 0;
116 static const SG::ConstAccessor<std::vector<float>> SumPtChargedPFOPt500Acc ("SumPtChargedPFOPt500");
117 if(SumPtChargedPFOPt500Acc.isAvailable(*jet))
118 {
119 ChargedFraction = SumPtChargedPFOPt500Acc(*jet).at(PVindex)/jetconstitP4.Pt();
120 ATH_MSG_DEBUG("ChargedFraction found set to: " << ChargedFraction);
121 }
122 jc.setValue("ChargedFraction", ChargedFraction);
123
124 std::vector<float> samplingFrac = jet->getAttribute<std::vector<float> >("EnergyPerSampling");
125 // get EM3
126 float EM3 = (samplingFrac[3]+samplingFrac[7])/jetconstitP4.e();
127 ATH_MSG_DEBUG("EM3 found set to: " << EM3);
128 jc.setValue("EM3", EM3);
129 // get Tile0
130 float Tile0 = (samplingFrac[12]+samplingFrac[18])/jetconstitP4.e();
131 ATH_MSG_DEBUG("Tile0 found set to: " << Tile0);
132 jc.setValue("Tile0", Tile0);
133
134 // get Muon segments
135 int Nsegments = 0;
136 static const SG::ConstAccessor<int> GhostMuonSegmentCountAcc ("GhostMuonSegmentCount");
137 if(GhostMuonSegmentCountAcc.isAvailable(*jet))
138 {
139 Nsegments = GhostMuonSegmentCountAcc(*jet);
140 ATH_MSG_DEBUG("Nsegments found set to: " << Nsegments);
141 }
142 jc.setValue("Nsegments", Nsegments);
143
144 float getGSCCorrection = 1.0;
145
146 // get detector eta to determine bin
147 float detectorEta = jet->getAttribute<float>("DetectorEta");
148 int etabin = std::abs(detectorEta)/0.1;// m_binSize in old version
149
150 const xAOD::JetFourMom_t startingP4 = jet->getAttribute<xAOD::JetFourMom_t>(m_jetInScale);
151 jet->setJetP4(startingP4);
152
153 ATH_MSG_DEBUG("Jet pt original ("<<m_jetInScale<<"): " << jet->pt()*1e-3);
154
155 ATH_MSG_DEBUG("ChargedFraction Response: " << getChargedFractionResponse(*jet, jc, etabin));
156 ATH_MSG_DEBUG("Tile0 Response: " <<getTile0Response(*jet, jc, etabin));
157 ATH_MSG_DEBUG("EM3 Response: " << getEM3Response(*jet, jc, etabin));
158 ATH_MSG_DEBUG("NTrk Response: " <<getNTrkResponse(*jet, jc, etabin));
159 ATH_MSG_DEBUG("TrkWidth Response: " <<getTrackWIDTHResponse(*jet, jc, etabin));
160
162 getGSCCorrection*=1./getChargedFractionResponse(*jet, jc, etabin);
163 jet->setJetP4( startingP4*getGSCCorrection );
164 }
165 if(m_applyTile0){
166 getGSCCorrection*=1./getTile0Response(*jet, jc, etabin);
167 jet->setJetP4( startingP4*getGSCCorrection );
168 }
169 if(m_applyEM3){
170 getGSCCorrection*=1./getEM3Response(*jet, jc, etabin);
171 jet->setJetP4( startingP4*getGSCCorrection );
172 }
173 if(m_applyNtrk){
174 getGSCCorrection*=1./getNTrkResponse(*jet, jc, etabin);
175 jet->setJetP4( startingP4*getGSCCorrection );
176 }
178 getGSCCorrection*=1./getTrackWIDTHResponse(*jet, jc, etabin);
179 jet->setJetP4( startingP4*getGSCCorrection );
180 }
181 if(m_applyPunchThrough && startingP4.Pt() >= m_punchThroughMinPt){
182 jet->setJetP4( startingP4*getGSCCorrection );
183 getGSCCorrection*=1./getPunchThroughResponse(*jet, jc, std::abs(detectorEta));
184 }
185
186 ATH_MSG_DEBUG("GSC full correction: " << getGSCCorrection);
187
188 jet->setAttribute<xAOD::JetFourMom_t>(m_jetOutScale,startingP4*getGSCCorrection);
189 jet->setJetP4( startingP4*getGSCCorrection );
190
191 ATH_MSG_DEBUG("Jet pt calibrated:" << jet->pt()*1e-3);
192
193 }// loop jets
194
195 return StatusCode::SUCCESS;
196}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
float getPunchThroughResponse(const xAOD::Jet &jet, const JetHelper::JetContext &jc, double eta_det) const
Gaudi::Property< bool > m_applyEM3
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
EventInfo to retrieve PV index for analyses choosing their own PV (e.g. H to yy).
Gaudi::Property< bool > m_applyTile0
float getNTrkResponse(const xAOD::Jet &jet, const JetHelper::JetContext &jc, uint etabin) const
Gaudi::Property< std::string > m_jetInScale
float getTile0Response(const xAOD::Jet &jet, const JetHelper::JetContext &jc, uint etabin) const
Gaudi::Property< bool > m_applyNtrk
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer_key
Gaudi::Property< std::string > m_jetOutScale
const xAOD::Vertex * findHSVertex(const xAOD::VertexContainer &vertices) const
Retrieve hard scatter vertex for its index. Return nullptr if one cannot be found.
float getEM3Response(const xAOD::Jet &jet, const JetHelper::JetContext &jc, uint etabin) const
float getTrackWIDTHResponse(const xAOD::Jet &jet, const JetHelper::JetContext &jc, uint etabin) const
Gaudi::Property< bool > m_applyTrackWidth
Gaudi::Property< bool > m_applyChargedFraction
Booleans to apply calibration steps:
float getChargedFractionResponse(const xAOD::Jet &jet, const JetHelper::JetContext &jc, uint etabin) const
Functions for retrieving the correction factors.
Gaudi::Property< float > m_punchThroughMinPt
Gaudi::Property< bool > m_applyPunchThrough
Properties for the punch-through correction:
bool setValue(std::string_view name, const T value, bool allowOverwrite=false)
Definition JetContext.h:58
str index
Definition DeMoScan.py:362
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:570
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Jet_v1 Jet
Definition of the current "jet version".
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition JetTypes.h:17

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ findHSVertex()

const xAOD::Vertex * GSCCalibStep::findHSVertex ( const xAOD::VertexContainer & vertices) const
private

Retrieve hard scatter vertex for its index. Return nullptr if one cannot be found.

Definition at line 252 of file GSCCalibStep.cxx.

252 {
253 for ( const xAOD::Vertex* vertex : vertices ) {
254 if(vertex->vertexType() == xAOD::VxType::PriVtx) {
255 ATH_MSG_VERBOSE("GSCCalibStep " << name() << " Found HS vertex at index: "<< vertex->index());
256 return vertex;
257 }
258 }
259 if (vertices.size()==1) {
260 ATH_MSG_VERBOSE("GSCCalibStep " << name() << " Found no HS vertex, return dummy");
261 if (vertices.back()->vertexType() == xAOD::VxType::NoVtx)
262 return vertices.back();
263 }
264 ATH_MSG_VERBOSE("No vertex found in container.");
265 return nullptr;
266}
#define ATH_MSG_VERBOSE(x)
@ PriVtx
Primary vertex.
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.

◆ getChargedFractionResponse()

float GSCCalibStep::getChargedFractionResponse ( const xAOD::Jet & jet,
const JetHelper::JetContext & jc,
uint etabin ) const
private

Functions for retrieving the correction factors.

Definition at line 198 of file GSCCalibStep.cxx.

198 {
199 if (jc.getValue<float>("ChargedFraction")<=0) return 1; //ChargedFraction < 0 is unphysical, ChargedFraction = 0 is a special case, so we return 1 for ChargedFraction <= 0
200 if ( etabin >= m_histTool_ChargedFraction.size() ) return 1.;
201 double ChargedFractionResponse = m_histTool_ChargedFraction[etabin]->getValue(jet, jc);
202 return ChargedFractionResponse;
203}
ToolHandleArray< JetHelper::IVarTool > m_histTool_ChargedFraction
void getValue(std::string_view name, T &value) const
Definition JetContext.h:43

◆ getEM3Response()

float GSCCalibStep::getEM3Response ( const xAOD::Jet & jet,
const JetHelper::JetContext & jc,
uint etabin ) const
private

Definition at line 212 of file GSCCalibStep.cxx.

212 {
213 if (jc.getValue<float>("EM3")<=0) return 1; //EM3 < 0 is unphysical, EM3 = 0 is a special case, so we return 1 for EM3 <= 0
214 if ( etabin >= m_histTool_EM3.size() ) return 1.;
215 float EM3Response = m_histTool_EM3[etabin]->getValue(jet, jc);
216 return EM3Response;
217}
ToolHandleArray< JetHelper::IVarTool > m_histTool_EM3

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::Event, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::Event, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getNominalResolutionData()

virtual StatusCode IJetCalibStep::getNominalResolutionData ( const xAOD::Jet & ,
const JetHelper::JetContext & ,
double &  ) const
inlinevirtualinherited

Reimplemented in SmearingCalibStep.

Definition at line 38 of file IJetCalibStep.h.

38{ return StatusCode::FAILURE; }

◆ getNominalResolutionMC()

virtual StatusCode IJetCalibStep::getNominalResolutionMC ( const xAOD::Jet & ,
const JetHelper::JetContext & ,
double &  ) const
inlinevirtualinherited

Reimplemented in SmearingCalibStep.

Definition at line 39 of file IJetCalibStep.h.

39{ return StatusCode::FAILURE; }

◆ getNTrkResponse()

float GSCCalibStep::getNTrkResponse ( const xAOD::Jet & jet,
const JetHelper::JetContext & jc,
uint etabin ) const
private

Definition at line 237 of file GSCCalibStep.cxx.

237 {
238 if (jc.getValue<int>("nTrk")<=0) return 1; //nTrk < 0 is unphysical, nTrk = 0 is a special case, so return 1 for nTrk <= 0
239 if ( etabin >= m_histTool_nTrk.size() ) return 1.;
240 double nTrkResponse = m_histTool_nTrk[etabin]->getValue(jet, jc);
241 return nTrkResponse;
242}
ToolHandleArray< JetHelper::IVarTool > m_histTool_nTrk

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ getPunchThroughResponse()

float GSCCalibStep::getPunchThroughResponse ( const xAOD::Jet & jet,
const JetHelper::JetContext & jc,
double eta_det ) const
private

Definition at line 219 of file GSCCalibStep.cxx.

219 {
220 int etabin=-99;
222 ATH_MSG_WARNING("Please check that the punch through eta binning is properly set in your config file");
223 if ( eta_det >= m_punchThroughEtaBins[m_punchThroughEtaBins.size()-1] || jc.getValue<int>("Nsegments") < 20 ) return 1;
224 for (uint i=0; i<m_punchThroughEtaBins.size()-1; ++i) {
225 if(eta_det >= m_punchThroughEtaBins[i] && eta_det < m_punchThroughEtaBins[i+1]) etabin = i;
226 }
227 if(etabin<0) {
228 ATH_MSG_WARNING("There was a problem determining the eta bin to use for the punch through correction.");
229 //this could probably be improved, but to avoid a seg fault...
230 return 1;
231 }
232 double PunchThroughResponse = m_histTool_PunchThrough[etabin]->getValue(jet, jc);
233 if(PunchThroughResponse>1) return 1;
234 return PunchThroughResponse;
235}
unsigned int uint
Gaudi::Property< std::vector< double > > m_punchThroughEtaBins
ToolHandleArray< JetHelper::IVarTool > m_histTool_PunchThrough

◆ getTile0Response()

float GSCCalibStep::getTile0Response ( const xAOD::Jet & jet,
const JetHelper::JetContext & jc,
uint etabin ) const
private

Definition at line 205 of file GSCCalibStep.cxx.

205 {
206 if (jc.getValue<float>("Tile0")<0) return 1; //Tile0 < 0 is unphysical, so we return 1
207 if ( etabin >= m_histTool_Tile0.size() ) return 1.;
208 double Tile0Response = m_histTool_Tile0[etabin]->getValue(jet, jc);
209 return Tile0Response;
210}
ToolHandleArray< JetHelper::IVarTool > m_histTool_Tile0

◆ getTrackWIDTHResponse()

float GSCCalibStep::getTrackWIDTHResponse ( const xAOD::Jet & jet,
const JetHelper::JetContext & jc,
uint etabin ) const
private

Definition at line 244 of file GSCCalibStep.cxx.

244 {
245 if (jc.getValue<float>("trackWIDTH")<=0) return 1;
246 if ( etabin >= m_histTool_trackWIDTH.size() ) return 1.;
247 //jets with no tracks are assigned a trackWIDTH of -1, we use the trackWIDTH=0 correction in those cases
248 double trackWIDTHResponse = m_histTool_trackWIDTH[etabin]->getValue(jet, jc);
249 return trackWIDTHResponse;
250}
ToolHandleArray< JetHelper::IVarTool > m_histTool_trackWIDTH

◆ initialize()

StatusCode GSCCalibStep::initialize ( void )
overridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 20 of file GSCCalibStep.cxx.

20 {
21 ATH_MSG_DEBUG ("Initializing " << name() );
22
23 ATH_MSG_DEBUG("Reading from " << m_jetInScale << " and writing to " << m_jetOutScale);
24
27 }
28 if(m_applyEM3){
29 ATH_CHECK( m_histTool_EM3.retrieve());
30 }
31 if(m_applyTile0){
32 ATH_CHECK( m_histTool_Tile0.retrieve());
33 }
34 if(m_applyNtrk){
35 ATH_CHECK( m_histTool_nTrk.retrieve());
36 }
39 }
42 }
43
44 ATH_CHECK(m_vertexContainer_key.initialize());
45 ATH_CHECK(m_eventInfo_key.initialize());
46
47 return StatusCode::SUCCESS;
48}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print()

void asg::AsgTool::print ( ) const
virtualinherited

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_applyChargedFraction

Gaudi::Property<bool> GSCCalibStep::m_applyChargedFraction {this, "applyChargedFraction", true, "Boolean to turn on/off chargedFraction corretion"}
private

Booleans to apply calibration steps:

Definition at line 54 of file GSCCalibStep.h.

54{this, "applyChargedFraction", true, "Boolean to turn on/off chargedFraction corretion"};

◆ m_applyEM3

Gaudi::Property<bool> GSCCalibStep::m_applyEM3 {this, "applyEM3", true, "Boolean to turn on/off EM3 corretion"}
private

Definition at line 56 of file GSCCalibStep.h.

56{this, "applyEM3", true, "Boolean to turn on/off EM3 corretion"};

◆ m_applyNtrk

Gaudi::Property<bool> GSCCalibStep::m_applyNtrk {this, "applyNtrk", true, "Boolean to turn on/off Ntrk corretion"}
private

Definition at line 57 of file GSCCalibStep.h.

57{this, "applyNtrk", true, "Boolean to turn on/off Ntrk corretion"};

◆ m_applyPunchThrough

Gaudi::Property<bool> GSCCalibStep::m_applyPunchThrough {this, "applyPunchThrough", false, "Boolean to turn on punch-through corretion"}
private

Properties for the punch-through correction:

Definition at line 61 of file GSCCalibStep.h.

61{this, "applyPunchThrough", false, "Boolean to turn on punch-through corretion"};

◆ m_applyTile0

Gaudi::Property<bool> GSCCalibStep::m_applyTile0 {this, "applyTile0", true, "Boolean to turn on/off Tile0 corretion"}
private

Definition at line 55 of file GSCCalibStep.h.

55{this, "applyTile0", true, "Boolean to turn on/off Tile0 corretion"};

◆ m_applyTrackWidth

Gaudi::Property<bool> GSCCalibStep::m_applyTrackWidth {this, "applyTrackWidth", true, "Boolean to turn on/off trackWidth corretion"}
private

Definition at line 58 of file GSCCalibStep.h.

58{this, "applyTrackWidth", true, "Boolean to turn on/off trackWidth corretion"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_eventInfo_key

SG::ReadHandleKey<xAOD::EventInfo> GSCCalibStep::m_eventInfo_key {this, "EventInfoKey", "EventInfo"}
private

EventInfo to retrieve PV index for analyses choosing their own PV (e.g. H to yy).

Definition at line 77 of file GSCCalibStep.h.

77{this, "EventInfoKey", "EventInfo"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_histTool_ChargedFraction

ToolHandleArray<JetHelper::IVarTool> GSCCalibStep::m_histTool_ChargedFraction = {this , "histTool_CharFrac", {}, "ChargedFraction histo reader" }
private

Definition at line 47 of file GSCCalibStep.h.

47{this , "histTool_CharFrac", {}, "ChargedFraction histo reader" };

◆ m_histTool_EM3

ToolHandleArray<JetHelper::IVarTool> GSCCalibStep::m_histTool_EM3 = {this , "histTool_EM3", {}, "EM3 histo reader" }
private

Definition at line 46 of file GSCCalibStep.h.

46{this , "histTool_EM3", {}, "EM3 histo reader" };

◆ m_histTool_nTrk

ToolHandleArray<JetHelper::IVarTool> GSCCalibStep::m_histTool_nTrk = {this , "histTool_nTrk", {}, "nTrk histo reader" }
private

Definition at line 50 of file GSCCalibStep.h.

50{this , "histTool_nTrk", {}, "nTrk histo reader" };

◆ m_histTool_PunchThrough

ToolHandleArray<JetHelper::IVarTool> GSCCalibStep::m_histTool_PunchThrough = {this , "histTool_PunchThrough", {}, "PunchThrough histo reader" }
private

Definition at line 49 of file GSCCalibStep.h.

49{this , "histTool_PunchThrough", {}, "PunchThrough histo reader" };

◆ m_histTool_Tile0

ToolHandleArray<JetHelper::IVarTool> GSCCalibStep::m_histTool_Tile0 = {this , "histTool_Tile0", {}, "Tile0 histo reader" }
private

Definition at line 48 of file GSCCalibStep.h.

48{this , "histTool_Tile0", {}, "Tile0 histo reader" };

◆ m_histTool_trackWIDTH

ToolHandleArray<JetHelper::IVarTool> GSCCalibStep::m_histTool_trackWIDTH = {this , "histTool_trackWIDTH", {}, "trackWIDTH histo reader" }
private

Definition at line 51 of file GSCCalibStep.h.

51{this , "histTool_trackWIDTH", {}, "trackWIDTH histo reader" };

◆ m_jetInScale

Gaudi::Property<std::string> GSCCalibStep::m_jetInScale {this, "InScale", "JetEtaJESScaleMomentum", "Starting jet scale"}
private

Definition at line 43 of file GSCCalibStep.h.

43{this, "InScale", "JetEtaJESScaleMomentum", "Starting jet scale"};

◆ m_jetOutScale

Gaudi::Property<std::string> GSCCalibStep::m_jetOutScale {this, "OutScale", "JetGSCScaleMomentum", "Ending jet scale"}
private

Definition at line 44 of file GSCCalibStep.h.

44{this, "OutScale", "JetGSCScaleMomentum", "Ending jet scale"};

◆ m_punchThroughEtaBins

Gaudi::Property<std::vector<double> > GSCCalibStep::m_punchThroughEtaBins {this, "PunchThroughEtaBins", {}, "Eta bins for punch through correction"}
private

Definition at line 62 of file GSCCalibStep.h.

62{this, "PunchThroughEtaBins", {}, "Eta bins for punch through correction"};

◆ m_punchThroughMinPt

Gaudi::Property<float> GSCCalibStep::m_punchThroughMinPt { this, "punchThroughMinPt", 50000., "Threshold for punch-through correction"}
private

Definition at line 63 of file GSCCalibStep.h.

63{ this, "punchThroughMinPt", 50000., "Threshold for punch-through correction"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexContainer_key

SG::ReadHandleKey<xAOD::VertexContainer> GSCCalibStep::m_vertexContainer_key {this, "VertexContainer", "PrimaryVertices", "SG key for input vertex container"}
private

Definition at line 75 of file GSCCalibStep.h.

75{this, "VertexContainer", "PrimaryVertices", "SG key for input vertex container"};

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: