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

Selec electrons and store a vector of cluster free of the electron ones. More...

#include <JetInputElRemovalTool.h>

Inheritance diagram for JetInputElRemovalTool:
Collaboration diagram for JetInputElRemovalTool:

Public Member Functions

 JetInputElRemovalTool (const std::string &t)
 ~JetInputElRemovalTool ()
StatusCode initialize ()
 Dummy implementation of the initialisation function.
int execute () const
 Method to be called for each event.
StatusCode finalize ()
int fillSelectedClusters (std::vector< const xAOD::Electron * > &selected_el, ConstDataVector< xAOD::CaloClusterContainer > &selected_cl) const
 : Select TopoClusters away of the electrons may select :
int fillSelectedClustersInJets (std::vector< const xAOD::Electron * > &selected_el, ConstDataVector< xAOD::CaloClusterContainer > &selected_cl) const
int fillSelectedTracks (std::vector< const xAOD::Electron * > &selected_el, ConstDataVector< xAOD::TrackParticleContainer > &selected_trk) 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
virtual int inputContainerNames (std::vector< std::string > &connames)
 Method to return the list of input containers.
virtual int outputContainerNames (std::vector< std::string > &connames)
 Method to return the list of output containers.
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

using ClOutHandleKey
using TrkOutHandleKey
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

std::vector< const xAOD::Electron * > selectElectron () const
 Select the electron of the event My select :
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::string m_elIDname = "DFCommonElectronsLHTight"
float m_elPt = 25000
bool m_useOnlyclInJets =false
float m_clRemovRadius =0.15
float m_clEMFrac = 0.8
SG::ReadHandleKey< xAOD::TrackParticleContainerm_trkInputContainer_key
SG::ReadHandleKey< xAOD::JetContainerm_jetInputContainer_key
SG::ReadHandleKey< xAOD::CaloClusterContainerm_clInputContainer_key
SG::ReadHandleKey< xAOD::EgammaContainerm_elInputContainer_key
ClOutHandleKey m_clOutputContainer_key
TrkOutHandleKey m_trkOutputContainer_key
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

Selec electrons and store a vector of cluster free of the electron ones.

Definition at line 41 of file JetInputElRemovalTool.h.

Member Typedef Documentation

◆ ClOutHandleKey

Initial value:
Property holding a SG store/key/clid from which a WriteHandle is made.

Definition at line 106 of file JetInputElRemovalTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ TrkOutHandleKey

Constructor & Destructor Documentation

◆ JetInputElRemovalTool()

JetInputElRemovalTool::JetInputElRemovalTool ( const std::string & t)

Definition at line 20 of file JetInputElRemovalTool.cxx.

21 :AsgTool(t)
22
23 ,m_elIDname("DFCommonElectronsLHTight")
24 ,m_elPt(25000)
25 ,m_useOnlyclInJets(false)
26 ,m_clRemovRadius(0.15)
27 ,m_clEMFrac(0.8)
28{
29 declareProperty("ElectronQuality",m_elIDname);
30 declareProperty("ElectronMinpT",m_elPt);
31 declareProperty("ClusterRemovRadius",m_clRemovRadius);
32 declareProperty("ClusterEMFrac",m_clEMFrac);
33 declareProperty("UseOnlyclInJets",m_useOnlyclInJets);
34
35 declareProperty("TrkInputContainer",
36 m_trkInputContainer_key="InDetTrackParticles");
37
38 declareProperty("JetINputContainer",
39 m_jetInputContainer_key="AntiKt4EMTopoJets");
40
41
42 declareProperty("ClusterContainerName",
43 m_clInputContainer_key="CaloCalTopoClusters");
44
45 declareProperty("ElectronContainerName",
46 m_elInputContainer_key="Electrons");
47
48 declareProperty("ClusterNoElName",
49 m_clOutputContainer_key="CaloCalTopoClustersNoEl");
50
51 declareProperty("TrkOutputContainer",
52 m_trkOutputContainer_key="InDetTrackParticlesNoEl");
53
54
55}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ClOutHandleKey m_clOutputContainer_key
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clInputContainer_key
SG::ReadHandleKey< xAOD::EgammaContainer > m_elInputContainer_key
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trkInputContainer_key
TrkOutHandleKey m_trkOutputContainer_key
SG::ReadHandleKey< xAOD::JetContainer > m_jetInputContainer_key
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58

◆ ~JetInputElRemovalTool()

JetInputElRemovalTool::~JetInputElRemovalTool ( )
default

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 }

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

◆ execute()

int JetInputElRemovalTool::execute ( ) const
virtual

Method to be called for each event.

Returns 0 for success.

Implements IJetExecuteTool.

Definition at line 75 of file JetInputElRemovalTool.cxx.

75 {
76
77 using OutContTypeCl = ConstDataVector<xAOD::CaloClusterContainer>;
78 OutContTypeCl* filtered_clusters = new OutContTypeCl(SG::VIEW_ELEMENTS);
79
80 //Select the electrons with given properties
81 std::vector<const xAOD::Electron*> el_vector=selectElectron();
82
83 //Select the clusters away from electrons
84
85 //Use all the clusters in the event
87 fillSelectedClusters(el_vector,*filtered_clusters);
88 }
89 //Use only the cluster from jets in the event
90 else{
91 fillSelectedClustersInJets(el_vector,*filtered_clusters);
92 }
93
94 //Record clusters vector
95 {
97 if(!handle.record(std::unique_ptr<OutContTypeCl>(filtered_clusters))){
98 ATH_MSG_WARNING("Unable to record new clusters vector");
99 return 1;
100 }
101 }
102
103 //Store vector only if data vector name not empty
104 if (!m_trkInputContainer_key.key().empty()){
105
106 using OutContTypeTr = ConstDataVector<xAOD::TrackParticleContainer>;
107
108 OutContTypeTr* filtered_tracks = new OutContTypeTr(SG::VIEW_ELEMENTS) ;
109
110 fillSelectedTracks(el_vector,*filtered_tracks);
111
112 auto handle_out = SG::makeHandle(m_trkOutputContainer_key);
113 if(!handle_out.record(std::unique_ptr<OutContTypeTr>(filtered_tracks))){
114 ATH_MSG_WARNING("Unable to record new tracks vector");
115 return 1;
116 }
117 }
118
119 return 0;
120}
#define ATH_MSG_WARNING(x)
int fillSelectedClusters(std::vector< const xAOD::Electron * > &selected_el, ConstDataVector< xAOD::CaloClusterContainer > &selected_cl) const
: Select TopoClusters away of the electrons may select :
int fillSelectedClustersInJets(std::vector< const xAOD::Electron * > &selected_el, ConstDataVector< xAOD::CaloClusterContainer > &selected_cl) const
std::vector< const xAOD::Electron * > selectElectron() const
Select the electron of the event My select :
int fillSelectedTracks(std::vector< const xAOD::Electron * > &selected_el, ConstDataVector< xAOD::TrackParticleContainer > &selected_trk) const
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ 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

◆ fillSelectedClusters()

int JetInputElRemovalTool::fillSelectedClusters ( std::vector< const xAOD::Electron * > & selected_el,
ConstDataVector< xAOD::CaloClusterContainer > & selected_cl ) const

: Select TopoClusters away of the electrons may select :

  • Match radius
  • Min EM frac of cluster to be removed

Create vector of cluster

Returns
The number of removed clusters

Definition at line 172 of file JetInputElRemovalTool.cxx.

172 {
173
174 //Initialize variables
175
176 int countRemoved_clusters=0;
177 double propEM=0;
178
179 //Get the Topo clusters of the event
180
182 if(!handle.isValid()){
183 ATH_MSG_WARNING("Unable to retrieve clusters");
184 return 0;
185 }
186
187 const auto *clusterContainer = handle.cptr();
188
189 //Loop over all the clusters
190 for (const xAOD::CaloCluster* cluster_itr : *clusterContainer){
191
192 //Compute the EMP proportion of the cluster
193 propEM=0;
194
195 double EMB_Enegy=cluster_itr->eSample(CaloSampling::CaloSample::PreSamplerB)+cluster_itr->eSample(CaloSampling::CaloSample::EMB1)+cluster_itr->eSample(CaloSampling::CaloSample::EMB2)+cluster_itr->eSample(CaloSampling::CaloSample::EMB3);
196
197 double EMEC_Energy=cluster_itr->eSample(CaloSampling::CaloSample::PreSamplerE)+cluster_itr->eSample(CaloSampling::CaloSample::EME1)+cluster_itr->eSample(CaloSampling::CaloSample::EME2)+cluster_itr->eSample(CaloSampling::CaloSample::EME3);
198
199 //Remove clusters w/o energy
200 if (cluster_itr->rawE()==0) {
201 continue;
202 }
203 propEM=(EMB_Enegy+EMEC_Energy)/cluster_itr->rawE();
204
205
206
207 //Check if close to electron
208 bool closetoel=false;
209
210 std::vector<const xAOD::Electron*>::iterator it=selected_el.begin();
211 std::vector<const xAOD::Electron*>::iterator itE =selected_el.end();
212 //For each el in the vector
213 for ( ; it != itE ;++it){
214 ATH_MSG_DEBUG( "Deleta R electron cluster = "<<(*it)->p4().DeltaR(cluster_itr->p4()) );
215 //Check if electron close to cluster
216 //if ((*it)->p4().DeltaR(cluster_itr->p4())<m_clRemovRadius){
217 if ((*it)->caloCluster()->p4().DeltaR(cluster_itr->p4())<m_clRemovRadius){
218
219 //if (TMath::Abs((*it)->caloCluster()->etaBE(2))<1.52 && TMath::Abs((*it)->caloCluster()->etaBE(2))>1.37){
220 if (TMath::Abs(cluster_itr->eta())<1.52 && TMath::Abs(cluster_itr->eta())>1.37){
221 closetoel=true;
222 }
223
224 //Check if the proportion of EM enegy above threshold
225 else if(propEM>=m_clEMFrac){
226 closetoel=true;
227 }
228 }
229
230 }
231 //If not close enough or not enough EM energy the cluster is kept
232 if (!closetoel){
233 selected_cl.push_back(dynamic_cast<const xAOD::CaloCluster*> (cluster_itr));
234 }
235 else{ //else it is removed
236 countRemoved_clusters+=1;
237 }
238 }//End loop over clusters
239
240
241 //ANA_CHECK(evtStore()->record( filtered_clusters , "CaloCalTopoClustersNoElec" ));
242
243 return countRemoved_clusters;
244}//End of SelectClusters()
#define ATH_MSG_DEBUG(x)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ fillSelectedClustersInJets()

int JetInputElRemovalTool::fillSelectedClustersInJets ( std::vector< const xAOD::Electron * > & selected_el,
ConstDataVector< xAOD::CaloClusterContainer > & selected_cl ) const

Definition at line 254 of file JetInputElRemovalTool.cxx.

254 {
255
256 int countRemoved_clusters=0;
257 double propEM=0;
258
260 if(!handle.isValid()){
261 ATH_MSG_WARNING("Unable to retrieve jets");
262 return 0;
263 }
264
265 const auto *jetsContainer = handle.cptr();
266
267 // const xAOD::JetContainer* jetsContainer;
268 // StatusCode sc=evtStore()->retrieve( jetsContainer, m_jetINputContainer );
269 // if (sc.isFailure()){
270 // ATH_MSG_WARNING("Unable to retrieve jets");
271 // return 0;
272 // }
273
274 for (const xAOD::Jet* jet_itr : *jetsContainer){
275
276
277 const xAOD::JetConstituentVector jetcons = jet_itr->getConstituents();
278
279
280 if (!jetcons.isValid()) continue ;
281
282 xAOD::JetConstituentVector::iterator jetcons_it = jetcons.begin();
283 xAOD::JetConstituentVector::iterator jetcons_itE = jetcons.end();
284
285 for( ; jetcons_it != jetcons_itE; ++jetcons_it){
286
287 propEM=0;
288 const xAOD::CaloCluster* cluster_itr= dynamic_cast<const xAOD::CaloCluster*> (jetcons_it->rawConstituent());
289
290
291 double EMB_Enegy=cluster_itr->eSample(CaloSampling::CaloSample::PreSamplerB)+cluster_itr->eSample(CaloSampling::CaloSample::EMB1)+cluster_itr->eSample(CaloSampling::CaloSample::EMB2)+cluster_itr->eSample(CaloSampling::CaloSample::EMB3);
292
293 double EMEC_Energy=cluster_itr->eSample(CaloSampling::CaloSample::PreSamplerE)+cluster_itr->eSample(CaloSampling::CaloSample::EME1)+cluster_itr->eSample(CaloSampling::CaloSample::EME2)+cluster_itr->eSample(CaloSampling::CaloSample::EME3);
294
295
296 //Remove Clusters w/o energy
297 if (cluster_itr->rawE()==0) {
298 continue;
299 };
300
301 propEM=(EMB_Enegy+EMEC_Energy)/cluster_itr->rawE();
302
303 bool closetoel=false;
304 std::vector<const xAOD::Electron*>::iterator it=selected_el.begin();
305 std::vector<const xAOD::Electron*>::iterator itE =selected_el.end();
306
307 for ( ; it != itE ;++it){
308 ATH_MSG_DEBUG( "Deleta R electron cluster = "<<(*it)->p4().DeltaR(cluster_itr->p4()) );
309 if ((*it)->p4().DeltaR(cluster_itr->p4())<m_clRemovRadius){
310 if(propEM>=m_clEMFrac){
311 closetoel=true;
312 }
313 }
314
315 }
316 if (!closetoel){
317 selected_cl.push_back(dynamic_cast<const xAOD::CaloCluster*> (cluster_itr));
318 }
319 else{
320 countRemoved_clusters+=1;
321 }
322 }//End loop over clusters
323
324 }//End loop over jets
325
326 //ANA_CHECK(evtStore()->record( filtered_clusters , "CaloCalTopoClustersNoElec" ));
327
328 return countRemoved_clusters;
329}
flt_t rawE() const
float eSample(const CaloSample sampling) const
virtual FourMom_t p4() const
The full 4-momentum of the particle.
iterator begin() const
iterator on the first constituent
bool isValid() const
Check if element links are valid.
iterator end() const
iterator after the last constituent
const IParticle * rawConstituent() const
Access the real underlying IParticle.
Jet_v1 Jet
Definition of the current "jet version".

◆ fillSelectedTracks()

int JetInputElRemovalTool::fillSelectedTracks ( std::vector< const xAOD::Electron * > & selected_el,
ConstDataVector< xAOD::TrackParticleContainer > & selected_trk ) const

Definition at line 332 of file JetInputElRemovalTool.cxx.

332 {
333
334 int countRemoved_trk=0;
335
337 if(!handle.isValid()){
338 ATH_MSG_WARNING("Unable to retrieve jets");
339 return 0;
340 }
341
342 const auto *tkPrtclContainer = handle.cptr();
343
344 // PS
345 // const xAOD::TrackParticleContainer* tkPrtclContainer;
346 // StatusCode sc=evtStore()->retrieve( tkPrtclContainer, m_trkInputContainer );
347 // if (sc.isFailure()){
348 // ATH_MSG_WARNING("Unable to retrieve jets");
349 // return 0;
350 // }
351
352 //Loop over all the tracks
353 for (const xAOD::TrackParticle* trk_itr : *tkPrtclContainer){
354
355 //Check if close to electron
356 bool is_eltrk=false;
357
358 std::vector<const xAOD::Electron*>::iterator it=selected_el.begin();
359 std::vector<const xAOD::Electron*>::iterator itE =selected_el.end();
360 //For each el in the vector
361 for ( ; it != itE ;++it){
362
363 const xAOD::TrackParticle* el_trk=(*it)->trackParticle();
364
365 ATH_MSG_DEBUG( "Deleta R electron trkack = "<<(*it)->p4().DeltaR(trk_itr->p4()) );
366 //Check if electron close to cluster
367 if (el_trk==trk_itr){
368 is_eltrk=true;
369 }
370
371 }
372 //If not close enough or not enough EM energy the cluster is kept
373 if (!is_eltrk){
374 selected_cl.push_back(dynamic_cast<const xAOD::TrackParticle*> (trk_itr));
375 }
376 else{ //else it is removed
377 countRemoved_trk+=1;
378 }
379 }//End loop over tracks
380
381
382 return countRemoved_trk;
383}
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ finalize()

StatusCode JetInputElRemovalTool::finalize ( )

Definition at line 122 of file JetInputElRemovalTool.cxx.

122 {
123 return StatusCode::SUCCESS;
124}

◆ 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::TEvent 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::TEvent, 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::TEvent 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::TEvent, 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.

◆ initialize()

StatusCode JetInputElRemovalTool::initialize ( void )
virtual

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 60 of file JetInputElRemovalTool.cxx.

60 {
61 ATH_MSG_INFO("Initializing tool " << name() << "...");
62 ATH_MSG_DEBUG("initializing version with data handles");
63
70
71 return StatusCode::SUCCESS;
72}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)

◆ inputContainerNames()

int IJetExecuteTool::inputContainerNames ( std::vector< std::string > & connames)
virtualinherited

Method to return the list of input containers.

The names of required input containers are appended to connames. Returns nonzero for error. Default returns 0 and adds no names.

Reimplemented in JetRecTool.

Definition at line 11 of file IJetExecuteTool.cxx.

11 {
12 return 0;
13}

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

◆ outputContainerNames()

int IJetExecuteTool::outputContainerNames ( std::vector< std::string > & connames)
virtualinherited

Method to return the list of output containers.

The names of produced output containers are appended to connames. Returns nonzero for error. Default returns 0 and adds no names.

Reimplemented in JetRecTool.

Definition at line 17 of file IJetExecuteTool.cxx.

17 {
18 return 0;
19}

◆ 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()

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

◆ selectElectron()

std::vector< const xAOD::Electron * > JetInputElRemovalTool::selectElectron ( ) const
private

Select the electron of the event My select :

  • pt cut
  • electron quality
Returns
Load an electron Vector in SG

Definition at line 128 of file JetInputElRemovalTool.cxx.

128 {
129
130 std::vector<const xAOD::Electron*> selected_electrons_v;
131
133 if(!handle.isValid()){
134 ATH_MSG_WARNING("Unable to retrieve electrons");
135 return selected_electrons_v;
136 }
137
138 const auto *electrons = handle.cptr();
139
140 selected_electrons_v.clear();
141 bool isTight=false;
142
143 SG::Decorator< char > idflagDec( m_elIDname );
144 for (const auto *electron_itr : *electrons){
145
146 isTight=false;
147
148 //Select only el with given quality
149 if (idflagDec (*electron_itr)==1){
150 isTight=true;
151 }
152
153 if (! isTight) continue ;
154
155
156 //Select only el with pt>25GeV
157 if (electron_itr->pt()<m_elPt) continue;
158
159 selected_electrons_v.push_back(dynamic_cast<const xAOD::Electron*>(electron_itr));
160
161
162 }
163
164 return selected_electrons_v ;
165}
Electron_v1 Electron
Definition of the current "egamma version".

◆ 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 >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

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

float JetInputElRemovalTool::m_clEMFrac = 0.8
private

Definition at line 99 of file JetInputElRemovalTool.h.

◆ m_clInputContainer_key

SG::ReadHandleKey<xAOD::CaloClusterContainer> JetInputElRemovalTool::m_clInputContainer_key
private

Definition at line 103 of file JetInputElRemovalTool.h.

◆ m_clOutputContainer_key

ClOutHandleKey JetInputElRemovalTool::m_clOutputContainer_key
private

Definition at line 109 of file JetInputElRemovalTool.h.

◆ m_clRemovRadius

float JetInputElRemovalTool::m_clRemovRadius =0.15
private

Definition at line 98 of file JetInputElRemovalTool.h.

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

std::string JetInputElRemovalTool::m_elIDname = "DFCommonElectronsLHTight"
private

Definition at line 94 of file JetInputElRemovalTool.h.

◆ m_elInputContainer_key

SG::ReadHandleKey<xAOD::EgammaContainer> JetInputElRemovalTool::m_elInputContainer_key
private

Definition at line 104 of file JetInputElRemovalTool.h.

◆ m_elPt

float JetInputElRemovalTool::m_elPt = 25000
private

Definition at line 95 of file JetInputElRemovalTool.h.

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

SG::ReadHandleKey<xAOD::JetContainer> JetInputElRemovalTool::m_jetInputContainer_key
private

Definition at line 102 of file JetInputElRemovalTool.h.

◆ m_trkInputContainer_key

SG::ReadHandleKey<xAOD::TrackParticleContainer> JetInputElRemovalTool::m_trkInputContainer_key
private

Definition at line 101 of file JetInputElRemovalTool.h.

◆ m_trkOutputContainer_key

TrkOutHandleKey JetInputElRemovalTool::m_trkOutputContainer_key
private

Definition at line 114 of file JetInputElRemovalTool.h.

◆ m_useOnlyclInJets

bool JetInputElRemovalTool::m_useOnlyclInJets =false
private

Definition at line 96 of file JetInputElRemovalTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

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