ATLAS Offline Software
Loading...
Searching...
No Matches
Rec::NewVrtSecInclusiveAlg Class Reference

#include <NewVrtSecInclusiveAlg.h>

Inheritance diagram for Rec::NewVrtSecInclusiveAlg:
Collaboration diagram for Rec::NewVrtSecInclusiveAlg:

Public Member Functions

 NewVrtSecInclusiveAlg (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize () override
StatusCode execute (const EventContext &ctx) const override
StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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 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

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

void addInDetTracks (const EventContext &, std::unordered_set< const xAOD::TrackParticle * > &) const
void addGSFTracks (const EventContext &, std::unordered_set< const xAOD::TrackParticle * > &) const
void addMuonTracks (const EventContext &, std::unordered_set< const xAOD::TrackParticle * > &) const
void addElectronTracks (const EventContext &, std::unordered_set< const xAOD::TrackParticle * > &) const
bool vertexHasNoLep (const EventContext &, const xAOD::Vertex *) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< xAOD::TrackParticleContainerm_tpContainerKey {this,"TrackParticleContainer","InDetTrackParticles","Read TrackParticle container"}
SG::ReadHandleKey< xAOD::TrackParticleContainerm_gsfContainerKey {this,"GSFTrackParticleContainer","GSFTrackParticles","Read GSFTrackParticle container"}
SG::ReadHandleKey< xAOD::MuonContainerm_muonContainerKey {this,"MuonContainer","Muons","Read muon container"}
SG::ReadHandleKey< xAOD::ElectronContainerm_electronContainerKey {this,"ElectronContainer","Electrons","Read electron container"}
SG::ReadHandleKey< xAOD::VertexContainerm_pvContainerKey {this,"PrimaryVertexContainer","PrimaryVertices","Read PrimaryVertices container"}
SG::ReadHandleKey< xAOD::JetContainerm_jetContainerKey {this,"JetContainer","AntiKt4EMPFlowJets","Read Jets container"}
SG::ReadHandleKey< xAOD::VertexContainerm_btsvContainerKey {this,"BTagSVContainer","BTagging_AntiKt4EMPFlowSecVtx","Read BTagiingSV container"}
SG::WriteHandleKey< xAOD::VertexContainerm_foundVerticesKey {this,"BVertexContainerName","AllBVertices","Found vertices container"}
ToolHandle< Rec::IVrtInclusivem_bvertextool {this, "BVertexTool", "Rec::NewVrtSecInclusiveTool/SVTool"}
Gaudi::Property< bool > m_addIDTracks {this, "AddIDTracks", true, "Set to true if you want to add ID tracks to the pool"}
Gaudi::Property< bool > m_addGSFTracks {this, "AddGSFTracks", false, "Set to true if you want to add GSF tracks to the pool"}
Gaudi::Property< bool > m_addMuonTracks {this, "AddMuonTracks", false, "Set to true if you want to add ID tracks from muons to the pool"}
Gaudi::Property< bool > m_addElectronTracks {this, "AddElectronTracks", false, "Set to true if you want to add GSF tracks from electrons to the pool"}
Gaudi::Property< bool > m_removeNonLepVerts {this, "RemoveNonLepVertices", false, "Set to true if you want to remove vertices with no associated lepton tracks"}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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 34 of file NewVrtSecInclusiveAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ NewVrtSecInclusiveAlg()

Rec::NewVrtSecInclusiveAlg::NewVrtSecInclusiveAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 28 of file NewVrtSecInclusiveAlg.cxx.

28 :
29 AthReentrantAlgorithm( name, pSvcLocator )
30 {
31 }

Member Function Documentation

◆ addElectronTracks()

void Rec::NewVrtSecInclusiveAlg::addElectronTracks ( const EventContext & ctx,
std::unordered_set< const xAOD::TrackParticle * > & trkparticles ) const
private

Definition at line 200 of file NewVrtSecInclusiveAlg.cxx.

200 {
201 //-- Extract Electrons
202 SG::ReadHandle<xAOD::ElectronContainer> electron_cont(m_electronContainerKey, ctx);
203 if ( !electron_cont.isValid() ) {
204 ATH_MSG_WARNING( "No electron container found in TES" );
205 return;
206 }
207 trkparticles.reserve(trkparticles.size() + electron_cont->size());
208
209 for(const auto *electron : (*electron_cont)) {
210 if( 0 == electron->nTrackParticles() ) continue;
211 // the 0th GSF TP is the best matched one.
212 const auto *gsf = electron->trackParticle(0);
213 if (!gsf) continue;
214 trkparticles.insert(gsf);
215 // remove the corresponding ID track from the list if it exists already.
217 }
218 }
#define ATH_MSG_WARNING(x)
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronContainerKey
const xAOD::TrackParticle * getOriginalTrackParticleFromGSF(const xAOD::TrackParticle *trkPar)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the GSF Track Particle...

◆ addGSFTracks()

void Rec::NewVrtSecInclusiveAlg::addGSFTracks ( const EventContext & ctx,
std::unordered_set< const xAOD::TrackParticle * > & trkparticles ) const
private

Definition at line 184 of file NewVrtSecInclusiveAlg.cxx.

184 {
185 //-- Extract GSFTrackParticles
186 SG::ReadHandle<xAOD::TrackParticleContainer> gsf_cont(m_gsfContainerKey, ctx);
187 if ( !gsf_cont.isValid() ) {
188 ATH_MSG_WARNING( "No GSF container found in TES" );
189 return;
190 }
191 trkparticles.reserve(trkparticles.size() + gsf_cont->size());
192
193 for (const auto *gsf : (*gsf_cont)) {
194 trkparticles.insert(gsf);
195 // remove the corresponding ID track from the list if it exists already.
197 }
198 }
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_gsfContainerKey

◆ addInDetTracks()

void Rec::NewVrtSecInclusiveAlg::addInDetTracks ( const EventContext & ctx,
std::unordered_set< const xAOD::TrackParticle * > & trkparticles ) const
private

Definition at line 156 of file NewVrtSecInclusiveAlg.cxx.

156 {
157 //-- Extract IDTrackParticles
158 SG::ReadHandle<xAOD::TrackParticleContainer> tp_cont(m_tpContainerKey, ctx);
159 if ( !tp_cont.isValid() ) {
160 ATH_MSG_WARNING( "No TrackParticle container found in TES" );
161 return;
162 }
163 trkparticles.reserve(trkparticles.size() + tp_cont->size());
164
165 for (const auto *tp : (*tp_cont)) { trkparticles.insert(tp); }
166 }
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tpContainerKey

◆ addMuonTracks()

void Rec::NewVrtSecInclusiveAlg::addMuonTracks ( const EventContext & ctx,
std::unordered_set< const xAOD::TrackParticle * > & trkparticles ) const
private

Definition at line 168 of file NewVrtSecInclusiveAlg.cxx.

168 {
169 //-- Extract Muons
170 SG::ReadHandle<xAOD::MuonContainer> muon_cont(m_muonContainerKey, ctx);
171 if ( !muon_cont.isValid() ) {
172 ATH_MSG_WARNING( "No muon container found in TES" );
173 return;
174 }
175 trkparticles.reserve(trkparticles.size() + muon_cont->size());
176
177 for (const auto *muon : (*muon_cont)) {
178 const auto *tp = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
179 if (!tp) { continue; }
180 trkparticles.insert(tp);
181 }
182 }
SG::ReadHandleKey< xAOD::MuonContainer > m_muonContainerKey

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode Rec::NewVrtSecInclusiveAlg::execute ( const EventContext & ctx) const
override

Definition at line 52 of file NewVrtSecInclusiveAlg.cxx.

53 {
54
55 const xAOD::Vertex* pv = nullptr;
56 std::unordered_set<const xAOD::TrackParticle*> tp_set{};
57 if (m_addIDTracks) addInDetTracks(ctx, tp_set);
58 if (m_addMuonTracks) addMuonTracks(ctx, tp_set);
59 if (m_addGSFTracks) addGSFTracks(ctx, tp_set);
60 if (m_addElectronTracks) addElectronTracks(ctx, tp_set);
61 ATH_MSG_DEBUG("Found " << tp_set.size() << " useful tracks in this event" );
62
63 std::vector<const xAOD::TrackParticle*> trkparticles(tp_set.begin(), tp_set.end());
64
65 //-- Extract Primary Vertex
66 SG::ReadHandle<xAOD::VertexContainer> pv_cont(m_pvContainerKey, ctx);
67 if ( !pv_cont.isValid() ) {
68 ATH_MSG_WARNING( "No Primary Vertices container found in TDS" );
69 }else{
70 //-- Extract PV itself
71 for ( const auto *v : *pv_cont ) {
72 if (v->vertexType()==xAOD::VxType::PriVtx) { pv = v; break; }
73 }
74 }
75
76 //-- Extract SV from b-jets Vertices
77 SG::ReadHandle<xAOD::VertexContainer> btsv_cont(m_btsvContainerKey, ctx);
78 if ( !btsv_cont.isValid() ) {
79 ATH_MSG_WARNING( "No BTagging Vertices container found in TDS" );
80 }
81
82 //-- Extract Jets
83 SG::ReadHandle<xAOD::JetContainer> jet_cont(m_jetContainerKey, ctx);
84 if ( !jet_cont.isValid() ) {
85 ATH_MSG_WARNING( "No AntiKt4EMPFlowJet container found in TES" );
86 }
87
88 //-- create container for new vertices
89 auto bVertexContainer = std::make_unique<xAOD::VertexContainer>();
90 auto bVertexAuxContainer = std::make_unique<xAOD::VertexAuxContainer>();
91 bVertexContainer->setStore(bVertexAuxContainer.get());
92
93 if( pv && trkparticles.size()>1 ){
94 std::unique_ptr<Trk::VxSecVertexInfo> foundVrts = m_bvertextool->findAllVertices(trkparticles,*pv);
95 if(foundVrts && !foundVrts->vertices().empty()){
96 const std::vector<xAOD::Vertex*> vtmp=foundVrts->vertices();
97 double mindRSVPV=1.e3; // Check coincidence with existing SV1 vertex
98 for(const auto & iv : vtmp) {
99 if( btsv_cont.isValid() ){
100 for ( const auto *btsv : *btsv_cont ) mindRSVPV=std::min(Amg::deltaR(btsv->position()-pv->position(),iv->position()-pv->position()),mindRSVPV);
101 }
102 if (m_removeNonLepVerts && vertexHasNoLep(ctx, iv)) {
103 delete iv;
104 continue;
105 }
106 bVertexContainer->push_back(iv);
107 std::vector< Trk::VxTrackAtVertex > & vtrk = iv->vxTrackAtVertex();
108 TLorentzVector VSUM(0.,0.,0.,0.);
109 TLorentzVector tmp;
110 for(auto & it : vtrk){
111 const Trk::Perigee* mPer = dynamic_cast<const Trk::Perigee*>(it.perigeeAtVertex());
112 CxxUtils::sincos phi(mPer->parameters()[Trk::phi]);
113 CxxUtils::sincos theta(mPer->parameters()[Trk::theta]);
114 double absP = 1./std::abs(mPer->parameters()[Trk::qOverP]);
115 tmp.SetXYZM( phi.cs*theta.sn*absP, phi.sn*theta.sn*absP, theta.cs*absP, Trk::ParticleMasses::mass[Trk::pion]);
116 VSUM+=tmp;
117 }
118 bvrtM(*iv) =VSUM.M();
119 bvrtPt(*iv) =VSUM.Pt();
120 bvrtEta(*iv)=VSUM.Eta();
121 bvrtPhi(*iv)=VSUM.Phi();
122 TVector3 SVmPV(iv->x()-pv->x(),iv->y()-pv->y(),iv->z()-pv->z());
123 double mindRMOM=1.e3, mindRSV=1.e3;
124 if( jet_cont.isValid() ){
125 for(const auto *jet : (*jet_cont)) {
126 mindRMOM=std::min(VSUM.DeltaR(jet->p4()),mindRMOM);
127 mindRSV =std::min(SVmPV.DeltaR(jet->p4().Vect()),mindRSV);
128 }
129 }
130 mindRBTagSV(*iv) =mindRSVPV;
131 mindRjetP(*iv) =mindRMOM;
132 mindRjetV(*iv) =mindRSV;
133 }
134 }
135 }
136 ATH_MSG_DEBUG("Found Vertices in this event: " << bVertexContainer->size());
137 //
138 //--Update track ElementLinks
139 for(auto iv : (*bVertexContainer)){
140 std::vector< ElementLink< xAOD::TrackParticleContainer > > newLinkVec;
141 for(auto &it : iv->trackParticleLinks()){
142 ElementLink< xAOD::TrackParticleContainer > tmpLnk=it;
143 const xAOD::TrackParticleContainer* tp_cont = dynamic_cast<const xAOD:: TrackParticleContainer*>((*it)->container());
144 tmpLnk.setStorableObject(*tp_cont);
145 newLinkVec.push_back(tmpLnk);
146 }
147 iv->setTrackParticleLinks(newLinkVec);
148 }
149
150 SG::WriteHandle<xAOD::VertexContainer> vrtInThisEvent(m_foundVerticesKey,ctx);
151 ATH_CHECK( vrtInThisEvent.record (std::move(bVertexContainer),
152 std::move(bVertexAuxContainer)) );
153 return StatusCode::SUCCESS;
154 }
Scalar phi() const
phi method
Scalar theta() const
theta method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Gaudi::Property< bool > m_addElectronTracks
Gaudi::Property< bool > m_addGSFTracks
ToolHandle< Rec::IVrtInclusive > m_bvertextool
bool vertexHasNoLep(const EventContext &, const xAOD::Vertex *) const
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainerKey
void addGSFTracks(const EventContext &, std::unordered_set< const xAOD::TrackParticle * > &) const
Gaudi::Property< bool > m_removeNonLepVerts
Gaudi::Property< bool > m_addIDTracks
SG::ReadHandleKey< xAOD::VertexContainer > m_pvContainerKey
void addElectronTracks(const EventContext &, std::unordered_set< const xAOD::TrackParticle * > &) const
void addMuonTracks(const EventContext &, std::unordered_set< const xAOD::TrackParticle * > &) const
void addInDetTracks(const EventContext &, std::unordered_set< const xAOD::TrackParticle * > &) const
SG::WriteHandleKey< xAOD::VertexContainer > m_foundVerticesKey
Gaudi::Property< bool > m_addMuonTracks
SG::ReadHandleKey< xAOD::VertexContainer > m_btsvContainerKey
double deltaR(const Amg::Vector3D &v1, const Amg::Vector3D &v2)
static const SG::AuxElement::Decorator< float > bvrtPt("bvrtPt")
static const SG::AuxElement::Decorator< float > mindRBTagSV("mindRBTagSV")
static const SG::AuxElement::Decorator< float > mindRjetV("mindRjetV")
static const SG::AuxElement::Decorator< float > bvrtEta("bvrtEta")
static const SG::AuxElement::Decorator< float > bvrtPhi("bvrtPhi")
static const SG::AuxElement::Decorator< float > bvrtM("bvrtM")
static const SG::AuxElement::Decorator< float > mindRjetP("mindRjetP")
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ phi
Definition ParamDefs.h:75
@ PriVtx
Primary vertex.
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode Rec::NewVrtSecInclusiveAlg::finalize ( )
override

Definition at line 47 of file NewVrtSecInclusiveAlg.cxx.

48 {
49 return StatusCode::SUCCESS;
50 }

◆ initialize()

StatusCode Rec::NewVrtSecInclusiveAlg::initialize ( )
override

Definition at line 33 of file NewVrtSecInclusiveAlg.cxx.

34 {
35 ATH_CHECK( m_tpContainerKey.initialize() );
36 ATH_CHECK( m_gsfContainerKey.initialize() );
37 ATH_CHECK( m_muonContainerKey.initialize() );
38 ATH_CHECK( m_electronContainerKey.initialize() );
39 ATH_CHECK( m_pvContainerKey.initialize() );
40 ATH_CHECK( m_jetContainerKey.initialize() );
41 ATH_CHECK( m_btsvContainerKey.initialize() );
42 ATH_CHECK( m_foundVerticesKey.initialize() );
43 ATH_CHECK( m_bvertextool.retrieve() );
44 return StatusCode::SUCCESS;
45 }

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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.

◆ 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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_ERROR(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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 }

◆ vertexHasNoLep()

bool Rec::NewVrtSecInclusiveAlg::vertexHasNoLep ( const EventContext & ctx,
const xAOD::Vertex * vertex ) const
private

Definition at line 220 of file NewVrtSecInclusiveAlg.cxx.

220 {
221 std::unordered_set<const xAOD::TrackParticle*> trkparts{};
222 trkparts.reserve(vertex->nTrackParticles());
223 for (const auto &trk : vertex->trackParticleLinks()) {
224 trkparts.insert(*trk);
225 }
226
227 //-- Extract Muons
228 SG::ReadHandle<xAOD::MuonContainer> muon_cont(m_muonContainerKey, ctx);
229 if ( muon_cont.isValid() ) {
230 for (const auto *muon : (*muon_cont)) {
231 const auto *tp = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
232 if (!tp) { continue; }
233 if(trkparts.count(tp)) return false;
234 }
235 }
236
237 //-- Extract Electrons
238 SG::ReadHandle<xAOD::ElectronContainer> electron_cont(m_electronContainerKey, ctx);
239 if ( electron_cont.isValid() ) {
240 for(const auto *electron : (*electron_cont)) {
241 if( 0 == electron->nTrackParticles() ) continue;
242 // the 0th GSF TP is the best matched one.
243 const auto *gsf = electron->trackParticle(0);
244 if (!gsf) continue;
245 if(trkparts.count(gsf)) return false;
246 if(trkparts.count(xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(gsf))) return false;
247 }
248 }
249 // If both containers are missing, or no leptons are found in the vertex, return true.
250 return true;
251 }

Member Data Documentation

◆ m_addElectronTracks

Gaudi::Property<bool> Rec::NewVrtSecInclusiveAlg::m_addElectronTracks {this, "AddElectronTracks", false, "Set to true if you want to add GSF tracks from electrons to the pool"}
private

Definition at line 59 of file NewVrtSecInclusiveAlg.h.

59{this, "AddElectronTracks", false, "Set to true if you want to add GSF tracks from electrons to the pool"};

◆ m_addGSFTracks

Gaudi::Property<bool> Rec::NewVrtSecInclusiveAlg::m_addGSFTracks {this, "AddGSFTracks", false, "Set to true if you want to add GSF tracks to the pool"}
private

Definition at line 57 of file NewVrtSecInclusiveAlg.h.

57{this, "AddGSFTracks", false, "Set to true if you want to add GSF tracks to the pool"};

◆ m_addIDTracks

Gaudi::Property<bool> Rec::NewVrtSecInclusiveAlg::m_addIDTracks {this, "AddIDTracks", true, "Set to true if you want to add ID tracks to the pool"}
private

Definition at line 56 of file NewVrtSecInclusiveAlg.h.

56{this, "AddIDTracks", true, "Set to true if you want to add ID tracks to the pool"};

◆ m_addMuonTracks

Gaudi::Property<bool> Rec::NewVrtSecInclusiveAlg::m_addMuonTracks {this, "AddMuonTracks", false, "Set to true if you want to add ID tracks from muons to the pool"}
private

Definition at line 58 of file NewVrtSecInclusiveAlg.h.

58{this, "AddMuonTracks", false, "Set to true if you want to add ID tracks from muons to the pool"};

◆ m_btsvContainerKey

SG::ReadHandleKey<xAOD::VertexContainer> Rec::NewVrtSecInclusiveAlg::m_btsvContainerKey {this,"BTagSVContainer","BTagging_AntiKt4EMPFlowSecVtx","Read BTagiingSV container"}
private

Definition at line 51 of file NewVrtSecInclusiveAlg.h.

51{this,"BTagSVContainer","BTagging_AntiKt4EMPFlowSecVtx","Read BTagiingSV container"};

◆ m_bvertextool

ToolHandle< Rec::IVrtInclusive > Rec::NewVrtSecInclusiveAlg::m_bvertextool {this, "BVertexTool", "Rec::NewVrtSecInclusiveTool/SVTool"}
private

Definition at line 54 of file NewVrtSecInclusiveAlg.h.

54{this, "BVertexTool", "Rec::NewVrtSecInclusiveTool/SVTool"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_electronContainerKey

SG::ReadHandleKey<xAOD::ElectronContainer> Rec::NewVrtSecInclusiveAlg::m_electronContainerKey {this,"ElectronContainer","Electrons","Read electron container"}
private

Definition at line 48 of file NewVrtSecInclusiveAlg.h.

48{this,"ElectronContainer","Electrons","Read electron container"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_foundVerticesKey

SG::WriteHandleKey<xAOD::VertexContainer> Rec::NewVrtSecInclusiveAlg::m_foundVerticesKey {this,"BVertexContainerName","AllBVertices","Found vertices container"}
private

Definition at line 53 of file NewVrtSecInclusiveAlg.h.

53{this,"BVertexContainerName","AllBVertices","Found vertices container"};

◆ m_gsfContainerKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> Rec::NewVrtSecInclusiveAlg::m_gsfContainerKey {this,"GSFTrackParticleContainer","GSFTrackParticles","Read GSFTrackParticle container"}
private

Definition at line 46 of file NewVrtSecInclusiveAlg.h.

46{this,"GSFTrackParticleContainer","GSFTrackParticles","Read GSFTrackParticle container"};

◆ m_jetContainerKey

SG::ReadHandleKey<xAOD::JetContainer> Rec::NewVrtSecInclusiveAlg::m_jetContainerKey {this,"JetContainer","AntiKt4EMPFlowJets","Read Jets container"}
private

Definition at line 50 of file NewVrtSecInclusiveAlg.h.

50{this,"JetContainer","AntiKt4EMPFlowJets","Read Jets container"};

◆ m_muonContainerKey

SG::ReadHandleKey<xAOD::MuonContainer> Rec::NewVrtSecInclusiveAlg::m_muonContainerKey {this,"MuonContainer","Muons","Read muon container"}
private

Definition at line 47 of file NewVrtSecInclusiveAlg.h.

47{this,"MuonContainer","Muons","Read muon container"};

◆ m_pvContainerKey

SG::ReadHandleKey<xAOD::VertexContainer> Rec::NewVrtSecInclusiveAlg::m_pvContainerKey {this,"PrimaryVertexContainer","PrimaryVertices","Read PrimaryVertices container"}
private

Definition at line 49 of file NewVrtSecInclusiveAlg.h.

49{this,"PrimaryVertexContainer","PrimaryVertices","Read PrimaryVertices container"};

◆ m_removeNonLepVerts

Gaudi::Property<bool> Rec::NewVrtSecInclusiveAlg::m_removeNonLepVerts {this, "RemoveNonLepVertices", false, "Set to true if you want to remove vertices with no associated lepton tracks"}
private

Definition at line 60 of file NewVrtSecInclusiveAlg.h.

60{this, "RemoveNonLepVertices", false, "Set to true if you want to remove vertices with no associated lepton tracks"};

◆ m_tpContainerKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> Rec::NewVrtSecInclusiveAlg::m_tpContainerKey {this,"TrackParticleContainer","InDetTrackParticles","Read TrackParticle container"}
private

Definition at line 45 of file NewVrtSecInclusiveAlg.h.

45{this,"TrackParticleContainer","InDetTrackParticles","Read TrackParticle container"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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