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

Calculate variables sensitive on electrons. More...

#include <TauElectronVetoVariables.h>

Inheritance diagram for TauElectronVetoVariables:
Collaboration diagram for TauElectronVetoVariables:

Public Member Functions

 TauElectronVetoVariables (const std::string &name)
virtual ~TauElectronVetoVariables ()=default
virtual StatusCode initialize () override
 Tool initializer.
virtual StatusCode executeTool (xAOD::TauJet &pTau, const EventContext &ctx) const override
 Execute - called for each tau candidate.
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, CaloConstCellContainer &, boost::dynamic_bitset<> &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, const xAOD::VertexContainer *) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::VertexContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::TauTrackContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::CaloClusterContainer &, xAOD::PFOContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::PFOContainer &, xAOD::PFOContainer &, const xAOD::CaloClusterContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::PFOContainer &, xAOD::PFOContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::PFOContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::ParticleContainer &, xAOD::PFOContainer &) const override
virtual StatusCode eventInitialize () override
 Event initializer - called at the beginning of each event.
virtual StatusCode eventFinalize () override
 Event finalizer - called at the end of each event.
virtual StatusCode finalize () override
 Finalizer.
std::string find_file (const std::string &fname) const
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
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

bool inTrigger () const
bool inAOD () const
bool inEleRM () const
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.

Protected Attributes

Gaudi::Property< bool > m_in_trigger {this, "inTrigger", false, "Indicate if the tool is running on trigger"}
Gaudi::Property< bool > m_in_AOD {this, "inAOD", false, "Indicate if the tool is running on AOD"}
Gaudi::Property< bool > m_in_EleRM {this, "inEleRM", false, "Indicate if the tool is running on EleRM routine"}
Gaudi::Property< std::string > m_tauRecToolsTag {this, "calibFolder", "tauRecTools/R22_preprod", "CVMFS path to the tau calibration folder"}

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< bool > m_doVertexCorrection {this, "VertexCorrection", true, "switch of vertex correction"}
Gaudi::Property< bool > m_useOldCalo {this,"useOldCalo",false,"If true, it uses the CaloExtensionTool for calculating track extrapolation. Otherwise, it allows the code to read from the cache created by CaloExtensionBuilderalg."}
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool
SG::ReadHandleKey< CaloExtensionCollection > m_ParticleCacheKey
Gaudi::Property< bool > m_useACTSExtrapolator {this, "useACTSExtrapolator", false}
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool {this, "ExtrapolationTool", "ExtrapolationTool", "Tool to run propagation in an ACTS tracking geometry" }
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc {this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}
std::map< unsigned int, std::string > m_caloNameGeoIDMap
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

Calculate variables sensitive on electrons.

The variables are mainly used by the electron veto in the TauDiscriminant package.

Author
Zofia Czyczula

Definition at line 31 of file TauElectronVetoVariables.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TauElectronVetoVariables()

TauElectronVetoVariables::TauElectronVetoVariables ( const std::string & name)

Definition at line 32 of file TauElectronVetoVariables.cxx.

32 :
33TauRecToolBase(name) {}
TauRecToolBase(const std::string &name)

◆ ~TauElectronVetoVariables()

virtual TauElectronVetoVariables::~TauElectronVetoVariables ( )
virtualdefault

Member Function Documentation

◆ 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.

◆ eventFinalize()

StatusCode TauRecToolBase::eventFinalize ( )
overridevirtualinherited

Event finalizer - called at the end of each event.

Implements ITauToolBase.

Definition at line 123 of file TauRecToolBase.cxx.

123 {
124 return StatusCode::SUCCESS;
125}

◆ eventInitialize()

StatusCode TauRecToolBase::eventInitialize ( )
overridevirtualinherited

Event initializer - called at the beginning of each event.

Implements ITauToolBase.

Definition at line 36 of file TauRecToolBase.cxx.

36 {
37 return StatusCode::SUCCESS;
38}

◆ 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.

◆ executeTool() [1/10]

StatusCode TauRecToolBase::executeTool ( xAOD::TauJet & ,
const EventContext & ,
CaloConstCellContainer & ,
boost::dynamic_bitset<> &  ) const
overridevirtual

Reimplemented from TauRecToolBase.

Definition at line 49 of file TauRecToolBase.cxx.

56 {
57 ATH_MSG_ERROR("function not implemented");
58 return StatusCode::FAILURE;
59}
#define ATH_MSG_ERROR(x,...)

◆ executeTool() [2/10]

StatusCode TauRecToolBase::executeTool ( xAOD::TauJet & ,
const EventContext & ,
const xAOD::VertexContainer *  ) const
overridevirtual

Reimplemented from TauRecToolBase.

Definition at line 54 of file TauRecToolBase.cxx.

64 {
65 ATH_MSG_ERROR("function not implemented");
66 return StatusCode::FAILURE;
67}

◆ executeTool() [3/10]

StatusCode TauRecToolBase::executeTool ( xAOD::TauJet & ,
const EventContext & ,
xAOD::CaloClusterContainer & ,
xAOD::PFOContainer &  ) const
overridevirtual

Reimplemented from TauRecToolBase.

Definition at line 66 of file TauRecToolBase.cxx.

86 {
87 ATH_MSG_ERROR("function not implemented");
88 return StatusCode::FAILURE;
89}

◆ executeTool() [4/10]

StatusCode TauRecToolBase::executeTool ( xAOD::TauJet & ,
const EventContext & ,
xAOD::ParticleContainer & ,
xAOD::PFOContainer &  ) const
overridevirtual

Reimplemented from TauRecToolBase.

Definition at line 86 of file TauRecToolBase.cxx.

118 {
119 ATH_MSG_ERROR("function not implemented");
120 return StatusCode::FAILURE;
121}

◆ executeTool() [5/10]

StatusCode TauRecToolBase::executeTool ( xAOD::TauJet & ,
const EventContext & ,
xAOD::PFOContainer &  ) const
overridevirtual

Reimplemented from TauRecToolBase.

Definition at line 82 of file TauRecToolBase.cxx.

110 {
111 ATH_MSG_ERROR("function not implemented");
112 return StatusCode::FAILURE;
113}

◆ executeTool() [6/10]

StatusCode TauRecToolBase::executeTool ( xAOD::TauJet & ,
const EventContext & ,
xAOD::PFOContainer & ,
xAOD::PFOContainer &  ) const
overridevirtual

Reimplemented from TauRecToolBase.

Definition at line 77 of file TauRecToolBase.cxx.

103 {
104 ATH_MSG_ERROR("function not implemented");
105 return StatusCode::FAILURE;
106}

◆ executeTool() [7/10]

StatusCode TauRecToolBase::executeTool ( xAOD::TauJet & ,
const EventContext & ,
xAOD::PFOContainer & ,
xAOD::PFOContainer & ,
const xAOD::CaloClusterContainer &  ) const
overridevirtual

Reimplemented from TauRecToolBase.

Definition at line 71 of file TauRecToolBase.cxx.

95 {
96 ATH_MSG_ERROR("function not implemented");
97 return StatusCode::FAILURE;
98}

◆ executeTool() [8/10]

StatusCode TauRecToolBase::executeTool ( xAOD::TauJet & ,
const EventContext & ,
xAOD::TauTrackContainer &  ) const
overridevirtual

Reimplemented from TauRecToolBase.

Definition at line 62 of file TauRecToolBase.cxx.

78 {
79 ATH_MSG_ERROR("function not implemented");
80 return StatusCode::FAILURE;
81}

◆ executeTool() [9/10]

StatusCode TauRecToolBase::executeTool ( xAOD::TauJet & ,
const EventContext & ,
xAOD::VertexContainer &  ) const
overridevirtual

Reimplemented from TauRecToolBase.

Definition at line 58 of file TauRecToolBase.cxx.

71 {
72 ATH_MSG_ERROR("function not implemented");
73 return StatusCode::FAILURE;
74}

◆ executeTool() [10/10]

StatusCode TauElectronVetoVariables::executeTool ( xAOD::TauJet & pTau,
const EventContext & ctx ) const
overridevirtual

Execute - called for each tau candidate.

Reimplemented from TauRecToolBase.

Definition at line 68 of file TauElectronVetoVariables.cxx.

69 {
70 if (pTau.nTracks() < 1) {
71 return StatusCode::SUCCESS;
72 }
73 ATH_MSG_DEBUG("in execute()");
74 float detPhiTrk = 0.;
75 float detEtaTrk = 0.;
76 float sumETCellsLAr = 0.;
77 float eta0cut = 0.075;
78 float eta1cut = 0.0475;
79 float eta2cut = 0.075;
80 float eta3cut = 1.5;
81 float phi0cut = 0.3;
82 float phi1cut = 0.3;
83 float phi2cut = 0.075;
84 float phi3cut = 0.075;
85 const CaloCell *pCell;
86 int trackIndex = -1;
87
88 //---------------------------------------------------------------------
89 // Calculate eta, phi impact point of leading track at calorimeter layers EM 0,1,2,3
90 //---------------------------------------------------------------------
91 Trk::TrackParametersIdHelper parsIdHelper;
92 constexpr size_t numberOfEM_Layers{4};
93 constexpr double invalidCoordinate{-11111.};
94 constexpr double invalidCoordinateThreshold{-11110.};
95 std::array<double, numberOfEM_Layers> extrapolatedEta{};
96 std::array<double, numberOfEM_Layers> extrapolatedPhi{};
97 extrapolatedEta.fill(invalidCoordinate);
98 extrapolatedPhi.fill(invalidCoordinate);
99
100 const xAOD::TrackParticle *orgTrack = pTau.track(0)->track();
101 trackIndex = orgTrack->index();
102
103 /*get the CaloExtension object*/
105 const Trk::CaloExtension * caloExtension = nullptr;
106 std::unique_ptr<Trk::CaloExtension> uniqueExtension ;
107 if (m_useOldCalo) {
108 /* If CaloExtensionBuilder is unavailable, use the calo extension tool */
109 ATH_MSG_VERBOSE("Using the CaloExtensionTool");
110 uniqueExtension = m_caloExtensionTool->caloExtension(ctx, *orgTrack);
111 caloExtension = uniqueExtension.get();
112 } else {
113 /*get the CaloExtension object*/
114 ATH_MSG_VERBOSE("Using the CaloExtensionBuilder Cache");
115 SG::ReadHandle<CaloExtensionCollection> particleCache {m_ParticleCacheKey, ctx};
116 caloExtension = (*particleCache)[trackIndex];
117 ATH_MSG_VERBOSE("Getting element " << trackIndex << " from the particleCache");
118 if( not caloExtension ){
119 ATH_MSG_VERBOSE("Cache does not contain a calo extension -> Calculating with the a CaloExtensionTool" );
120 uniqueExtension = m_caloExtensionTool->caloExtension(ctx, *orgTrack);
121 caloExtension = uniqueExtension.get();
122 }
123 }
124 if( not caloExtension){
125 ATH_MSG_DEBUG("extrapolation of leading track to calo surfaces failed : caloExtension is nullptr" );
126 return StatusCode::RECOVERABLE;
127 }
128 const std::vector<Trk::CurvilinearParameters>& clParametersVector = caloExtension->caloLayerIntersections();
129 if(clParametersVector.empty() ){
130 ATH_MSG_DEBUG("extrapolation of leading track to calo surfaces failed : caloLayerIntersection is empty" );
131 return StatusCode::RECOVERABLE;
132 }
133 // loop over calo layers
134 for( const Trk::CurvilinearParameters& cur : clParametersVector ){
135 // only use entry layer
136 if( !parsIdHelper.isEntryToVolume(cur.cIdentifier()) ) continue;
137 CaloSampling::CaloSample sample = parsIdHelper.caloSample(cur.cIdentifier());
138 int index = -1;
139 if( sample == CaloSampling::PreSamplerE || sample == CaloSampling::PreSamplerB ) index = 0;
140 else if( sample == CaloSampling::EME1 || sample == CaloSampling::EMB1 ) index = 1;
141 else if( sample == CaloSampling::EME2 || sample == CaloSampling::EMB2 ) index = 2;
142 else if( sample == CaloSampling::EME3 || sample == CaloSampling::EMB3 ) index = 3;
143 if( index < 0 ) continue;
144 extrapolatedEta[index] = cur.position().eta();
145 extrapolatedPhi[index] = cur.position().phi();
146 }
147 }
148 else
149 { // use ACTS Based extrapolation
150 unsigned int lastMeasIdx = 0;
151 if (!orgTrack->indexOfParameterAtPosition(lastMeasIdx, xAOD::LastMeasurement)) {
152 ATH_MSG_ERROR("TrackParticle has no last measurement parameters");
153 return StatusCode::FAILURE;
154 }
155
156 Acts::Vector3 lastPos{orgTrack->parameterX(lastMeasIdx),
157 orgTrack->parameterY(lastMeasIdx),
158 orgTrack->parameterZ(lastMeasIdx)};
159 Acts::Vector3 lastMom{ActsTrk::energyToActs(orgTrack->parameterPX(lastMeasIdx)),
160 ActsTrk::energyToActs(orgTrack->parameterPY(lastMeasIdx)),
161 ActsTrk::energyToActs(orgTrack->parameterPZ(lastMeasIdx))};
162
163 Acts::BoundVector lastBoundParams = Acts::BoundVector::Zero();
164 lastBoundParams[Acts::eBoundPhi] = lastMom.phi();
165 lastBoundParams[Acts::eBoundTheta] = lastMom.theta();
166 lastBoundParams[Acts::eBoundQOverP] = orgTrack->charge() / lastMom.norm();
167
168 std::shared_ptr<const Acts::Surface> lastSurface = Acts::CurvilinearSurface(lastPos, lastMom.normalized()).planeSurface()->getSharedPtr();
169
170 Acts::BoundTrackParameters boundPars{
171 std::move(lastSurface),
172 lastBoundParams,
173 std::nullopt,
174 Acts::ParticleHypothesis::pion()
175 };
176
177 Acts::Result<std::pair<std::vector<Acts::detail::Step>, Acts::RecordedMaterial>> result = m_extrapolationTool.get()->propagationSteps(ctx, boundPars);
178
179 if( !result.ok() ) {
180 ATH_MSG_WARNING("Error during extrapolation: " << result.error().message());
181 return StatusCode::RECOVERABLE;
182 }
183
184 const auto &[steps, _] = result.value();
185
186 for(const auto &step : steps) {
187
188 if( step.surface == nullptr || step.surface->geometryId().sensitive() == 0 ) {
189 continue;
190 }
191
192 Acts::GeometryIdentifier thisGeoID = step.geoID;
193 ATH_MSG_DEBUG("Got step with geoID " << thisGeoID);
194
195 if (m_caloNameGeoIDMap.contains(thisGeoID.volume())){
196 ATH_MSG_DEBUG("This step is in the calorimeter");
197 const auto &p = step.position;
198
199 // match to EM or Had calorimeter
200 std::string layer = m_caloNameGeoIDMap.at(thisGeoID.volume());
201
202 int index = -1;
203 if( layer.find("PreSampler") != std::string::npos) index = 0;
204 else if( (layer.find("EME1") != std::string::npos) || (layer.find("EMB1") != std::string::npos) ) index = 1;
205 else if( (layer.find("EME2") != std::string::npos) || (layer.find("EMB2") != std::string::npos) ) index = 2;
206 else if( (layer.find("EME3") != std::string::npos) || (layer.find("EMB3") != std::string::npos) ) index = 3;
207
208 if( index < 0 ) continue;
209
210 extrapolatedEta[index] = Acts::VectorHelpers::eta(p);
211 extrapolatedPhi[index] = Acts::VectorHelpers::phi(p);
212 }
213 }
214 }
215
216
217
218 for (size_t i = 0; i < numberOfEM_Layers; ++i) {
219 if ( extrapolatedEta[i] < invalidCoordinateThreshold || extrapolatedPhi[i] < invalidCoordinateThreshold ){
220 ATH_MSG_DEBUG("extrapolation of leading track to calo surfaces failed for sampling : " << i );
221 return StatusCode::SUCCESS;
222 }
223 }
224
225 // Loop through jets, get links to clusters
226 //Local variable cellSeen uses 25000 bytes of stack space
227 //coverity[STACK_USE]
228 std::bitset<200000> cellSeen{};
229 const std::unordered_map<int, int> samplingLookup{
230 {4,0}, {5,1}, {6,2}, {7,3}, {8,12},
231 {15, 12}, {16,13}, {17,14}, {18,12}, {19, 13}, {20,14}
232 };
233 const auto notFound{samplingLookup.end()};
234
235 std::vector<xAOD::CaloVertexedTopoCluster> vertexedClusterList = pTau.vertexedClusters();
236 for (const xAOD::CaloVertexedTopoCluster& vertexedCluster : vertexedClusterList){
237
238 const xAOD::CaloCluster& cluster = vertexedCluster.clust();
239 auto cell_links = cluster.getCellLinks();
240 if (cell_links == nullptr) {
241 ATH_MSG_DEBUG("NO Cell links found for cluster with pT " << cluster.pt());
242 continue;
243 }
244 CaloClusterCellLink::const_iterator pCellIter = cluster.getCellLinks()->begin();
245 CaloClusterCellLink::const_iterator pCellIterE = cluster.getCellLinks()->end();
246 for (; pCellIter != pCellIterE; ++pCellIter) {
247 double cellEta{}, cellPhi{}, cellET{};
248 pCell = *pCellIter;
249 if (cellSeen.test(pCell->caloDDE()->calo_hash())) continue;
250 else cellSeen.set(pCell->caloDDE()->calo_hash());
251 if (m_doVertexCorrection && pTau.vertex()!=nullptr) {
252 CaloVertexedCell vxCell (*pCell, pTau.vertex()->position());
253 cellPhi = vxCell.phi();
254 cellEta = vxCell.eta();
255 cellET = vxCell.et();
256 } else {
257 cellPhi = pCell->phi();
258 cellEta = pCell->eta();
259 cellET = pCell->et();
260 }
261 int sampling = pCell->caloDDE()->getSampling();
262 if (const auto & pElement {samplingLookup.find(sampling)};pElement != notFound){
263 sampling = pElement->second;
264 }
265 int i = 2;
266 if (sampling < 4) i = sampling;
267 if (sampling == 12 || sampling == 13 || sampling == 14) i = 3;
268 detPhiTrk = TVector2::Phi_mpi_pi(cellPhi-extrapolatedPhi[i]);
269 detEtaTrk = std::abs( cellEta - extrapolatedEta[i] );
270 if ((sampling == 0 && detEtaTrk < eta0cut && detPhiTrk < phi0cut) ||
271 (sampling == 1 && detEtaTrk < eta1cut && detPhiTrk < phi1cut) ||
272 (sampling == 2 && detEtaTrk < eta2cut && detPhiTrk < phi2cut) ||
273 (sampling == 3 && detEtaTrk < eta3cut && detPhiTrk < phi3cut)) {
274 sumETCellsLAr += cellET;
275 }
276 } //end cell loop
277 }// end jet constituent loop
278
279 pTau.setDetail(xAOD::TauJetParameters::sumEMCellEtOverLeadTrkPt , static_cast<float>( ( sumETCellsLAr / ( pTau.track(0)->pt() ) ) ) );
280 return StatusCode::SUCCESS;
281}
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
virtual double phi() const override final
get phi (through CaloDetDescrElement)
Definition CaloCell.h:375
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition CaloCell.h:321
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition CaloCell.h:382
virtual double et() const override final
get et
Definition CaloCell.h:423
CaloCell_ID::CaloSample getSampling() const
cell sampling
SG::ReadHandleKey< CaloExtensionCollection > m_ParticleCacheKey
std::map< unsigned int, std::string > m_caloNameGeoIDMap
Gaudi::Property< bool > m_useOldCalo
Gaudi::Property< bool > m_useACTSExtrapolator
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
Gaudi::Property< bool > m_doVertexCorrection
bool isEntryToVolume(TrackParametersIdentifier id) const
returns true if the id belongs to the volume entrance
CaloSampling::CaloSample caloSample(TrackParametersIdentifier id) const
CaloSample encoded in id, returns CaloSampling::Unknown if id is not valid.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version).
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters).
std::vector< xAOD::CaloVertexedTopoCluster > vertexedClusters() const
const TauTrack * track(size_t i, TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged, int *container_index=0) const
Get the pointer to a given tauTrack associated with this tau /*container index needed by trackNonCons...
void setDetail(TauJetParameters::Detail detail, int value)
const Vertex * vertex() const
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
virtual double pt() const
The transverse momentum ( ) of the particle.
const TrackParticle * track() const
bool indexOfParameterAtPosition(unsigned int &index, ParameterPosition position) const
Function to determine if this TrackParticle contains track parameters at a certain position,...
float parameterPX(unsigned int index) const
Returns the parameter x momentum component, for 'index'.
float parameterX(unsigned int index) const
Returns the parameter x position, for 'index'.
float parameterPY(unsigned int index) const
Returns the parameter y momentum component, for 'index'.
float parameterZ(unsigned int index) const
Returns the parameter z position, for 'index'.
float parameterY(unsigned int index) const
Returns the parameter y position, for 'index'.
float charge() const
Returns the charge.
float parameterPZ(unsigned int index) const
Returns the parameter z momentum component, for 'index'.
const Amg::Vector3D & position() const
Returns the 3-pos.
constexpr double energyToActs(const double athenaE)
Converts an energy scalar from Athena to Acts units.
str index
Definition DeMoScan.py:362
@ layer
Definition HitInfo.h:79
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
@ LastMeasurement
Parameter defined at the position of the last measurement.

◆ 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

◆ finalize()

StatusCode TauRecToolBase::finalize ( )
overridevirtualinherited

Finalizer.

Implements ITauToolBase.

Reimplemented in PanTau::PanTauProcessor.

Definition at line 127 of file TauRecToolBase.cxx.

127 {
128 return StatusCode::SUCCESS;
129}

◆ find_file()

std::string TauRecToolBase::find_file ( const std::string & fname) const
inherited

Definition at line 19 of file TauRecToolBase.cxx.

19 {
20 std::string full_path;
21 //offline calib files are in GroupData
22 //online calib files are in release
23 full_path = PathResolverFindCalibFile(m_tauRecToolsTag+"/"+fname);
24 if(full_path.empty()) full_path = PathResolverFindCalibFile(fname);
25 return full_path;
26}
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Gaudi::Property< std::string > m_tauRecToolsTag

◆ 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 }

◆ getProperty()

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

Get one of the tool's properties.

◆ inAOD()

bool TauRecToolBase::inAOD ( ) const
inlineprotectedinherited

Definition at line 116 of file TauRecToolBase.h.

116{ return m_in_AOD; }
Gaudi::Property< bool > m_in_AOD

◆ inEleRM()

bool TauRecToolBase::inEleRM ( ) const
inlineprotectedinherited

Definition at line 117 of file TauRecToolBase.h.

117{ return m_in_EleRM; }
Gaudi::Property< bool > m_in_EleRM

◆ initialize()

StatusCode TauElectronVetoVariables::initialize ( void )
overridevirtual

Tool initializer.

Reimplemented from TauRecToolBase.

Definition at line 35 of file TauElectronVetoVariables.cxx.

35 {
36
38 ATH_CHECK( m_caloExtensionTool.retrieve() );
39 if (!m_ParticleCacheKey.key().empty()) {
40 ATH_CHECK(m_ParticleCacheKey.initialize());
41 } else {
42 m_useOldCalo = true;
43 }
44 } else {
45
48
49 std::array<std::string,11> caloNames = { "PreSamplerENegZ_Layer", "PreSamplerEPosZ_Layer",
50 "EME1NegZ_Layer", "EME1PosZ_Layer", "EMB1_Layer",
51 "EME2NegZ_Layer", "EME2PosZ_Layer", "EMB2_Layer",
52 "EME3NegZ_Layer", "EME3PosZ_Layer", "EMB3_Layer",
53 };
54
55 m_trackingGeometrySvc->trackingGeometry()->visitVolumes([&](const Acts::TrackingVolume *vol) {
56 const auto & name = vol->volumeName();
57 ATH_MSG_DEBUG(name << " - " << vol->geometryId() << " - surfaces: " << vol->surfaces().size());
58 if (std::ranges::contains(caloNames, name)){
59 ATH_MSG_DEBUG("About to insert caloName " << name << " into map");
60 m_caloNameGeoIDMap[vol->geometryId().volume()] = name;
61 }
62 });
63 }
64 return StatusCode::SUCCESS;
65}
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc

◆ 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.

◆ inTrigger()

bool TauRecToolBase::inTrigger ( ) const
inlineprotectedinherited

Definition at line 115 of file TauRecToolBase.h.

115{ return m_in_trigger; }
Gaudi::Property< bool > m_in_trigger

◆ 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 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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 352 of file AthCommonDataStore.h.

352 {
354 }

◆ 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 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_caloExtensionTool

ToolHandle<Trk::IParticleCaloExtensionTool> TauElectronVetoVariables::m_caloExtensionTool
private
Initial value:
{this,
"ParticleCaloExtensionTool", "Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", "Tool for calculating track extrapolation"}

Definition at line 51 of file TauElectronVetoVariables.h.

51 {this,
52 "ParticleCaloExtensionTool", "Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", "Tool for calculating track extrapolation"};

◆ m_caloNameGeoIDMap

std::map<unsigned int, std::string> TauElectronVetoVariables::m_caloNameGeoIDMap
private

Definition at line 62 of file TauElectronVetoVariables.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_doVertexCorrection

Gaudi::Property<bool> TauElectronVetoVariables::m_doVertexCorrection {this, "VertexCorrection", true, "switch of vertex correction"}
private

Definition at line 49 of file TauElectronVetoVariables.h.

49{this, "VertexCorrection", true, "switch of vertex correction"};

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extrapolationTool

ToolHandle<ActsTrk::IExtrapolationTool> TauElectronVetoVariables::m_extrapolationTool {this, "ExtrapolationTool", "ExtrapolationTool", "Tool to run propagation in an ACTS tracking geometry" }
private

Definition at line 59 of file TauElectronVetoVariables.h.

59{this, "ExtrapolationTool", "ExtrapolationTool", "Tool to run propagation in an ACTS tracking geometry" };

◆ m_in_AOD

Gaudi::Property<bool> TauRecToolBase::m_in_AOD {this, "inAOD", false, "Indicate if the tool is running on AOD"}
protectedinherited

Definition at line 105 of file TauRecToolBase.h.

105{this, "inAOD", false, "Indicate if the tool is running on AOD"};

◆ m_in_EleRM

Gaudi::Property<bool> TauRecToolBase::m_in_EleRM {this, "inEleRM", false, "Indicate if the tool is running on EleRM routine"}
protectedinherited

Definition at line 106 of file TauRecToolBase.h.

106{this, "inEleRM", false, "Indicate if the tool is running on EleRM routine"};

◆ m_in_trigger

Gaudi::Property<bool> TauRecToolBase::m_in_trigger {this, "inTrigger", false, "Indicate if the tool is running on trigger"}
protectedinherited

Definition at line 104 of file TauRecToolBase.h.

104{this, "inTrigger", false, "Indicate if the tool is running on trigger"};

◆ m_ParticleCacheKey

SG::ReadHandleKey<CaloExtensionCollection> TauElectronVetoVariables::m_ParticleCacheKey
private
Initial value:
{this,
"tauEVParticleCache", "ParticleCaloExtension", "Name of the particle measurement extrapolation cache for TauEV Algorithm"}

Definition at line 53 of file TauElectronVetoVariables.h.

53 {this,
54 "tauEVParticleCache", "ParticleCaloExtension", "Name of the particle measurement extrapolation cache for TauEV Algorithm"};

◆ m_tauRecToolsTag

Gaudi::Property<std::string> TauRecToolBase::m_tauRecToolsTag {this, "calibFolder", "tauRecTools/R22_preprod", "CVMFS path to the tau calibration folder"}
protectedinherited

Definition at line 107 of file TauRecToolBase.h.

107{this, "calibFolder", "tauRecTools/R22_preprod", "CVMFS path to the tau calibration folder"};

◆ m_trackingGeometrySvc

ServiceHandle<ActsTrk::ITrackingGeometrySvc> TauElectronVetoVariables::m_trackingGeometrySvc {this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}
private

Definition at line 60 of file TauElectronVetoVariables.h.

60{this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"};

◆ m_useACTSExtrapolator

Gaudi::Property<bool> TauElectronVetoVariables::m_useACTSExtrapolator {this, "useACTSExtrapolator", false}
private

Definition at line 58 of file TauElectronVetoVariables.h.

58{this, "useACTSExtrapolator", false};

◆ m_useOldCalo

Gaudi::Property<bool> TauElectronVetoVariables::m_useOldCalo {this,"useOldCalo",false,"If true, it uses the CaloExtensionTool for calculating track extrapolation. Otherwise, it allows the code to read from the cache created by CaloExtensionBuilderalg."}
private

Definition at line 50 of file TauElectronVetoVariables.h.

50{this,"useOldCalo",false,"If true, it uses the CaloExtensionTool for calculating track extrapolation. Otherwise, it allows the code to read from the cache created by CaloExtensionBuilderalg."};

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.


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