ATLAS Offline Software
Loading...
Searching...
No Matches
Analysis::BasicTrackGradeFactory Class Reference

#include <BasicTrackGradeFactory.h>

Inheritance diagram for Analysis::BasicTrackGradeFactory:
Collaboration diagram for Analysis::BasicTrackGradeFactory:

Public Member Functions

 BasicTrackGradeFactory (const std::string &, const std::string &, const IInterface *)
virtual ~BasicTrackGradeFactory ()
StatusCode initialize ()
 AlgTool initailize method.
StatusCode finalize ()
 AlgTool finalize method.
TrackGradegetGrade (const xAOD::TrackParticle &track, const xAOD::IParticle::FourMom_t &) const
virtual const TrackGradesDefinitiongetTrackGradesDefinition () 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 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

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool interface methods.

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

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

Private Attributes

TrackGradesDefinition m_trackGradesDefinition
bool m_useSharedHitInfo
int m_nSharedBLayer
 if false the following cuts are ignored
int m_nSharedPix
 max. number of shared hits in B layer
int m_nSharedSct
 max. number of shared hits in pixels
int m_nSharedSi
 max. number of shared hits in SCT
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 36 of file BasicTrackGradeFactory.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ BasicTrackGradeFactory()

Analysis::BasicTrackGradeFactory::BasicTrackGradeFactory ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 18 of file BasicTrackGradeFactory.cxx.

18 :
19 AthAlgTool( t, n, p )
20{
21
22 declareProperty("useSharedHitInfo", m_useSharedHitInfo = false);
23 declareProperty("nSharedBLayer", m_nSharedBLayer = 0);
24 declareProperty("nSharedPix", m_nSharedPix = 0);
25 declareProperty("nSharedSct", m_nSharedSct = 1);
26 declareProperty("nSharedSi", m_nSharedSi = 999);
27
28 declareInterface<ITrackGradeFactory>( this );
29}
int m_nSharedPix
max. number of shared hits in B layer
int m_nSharedBLayer
if false the following cuts are ignored
int m_nSharedSct
max. number of shared hits in pixels
int m_nSharedSi
max. number of shared hits in SCT
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ ~BasicTrackGradeFactory()

Analysis::BasicTrackGradeFactory::~BasicTrackGradeFactory ( )
virtual

Definition at line 31 of file BasicTrackGradeFactory.cxx.

32{}

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.

◆ 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 Analysis::BasicTrackGradeFactory::finalize ( )

AlgTool finalize method.

Definition at line 54 of file BasicTrackGradeFactory.cxx.

55{
56 return StatusCode::SUCCESS;
57}

◆ getGrade()

TrackGrade * Analysis::BasicTrackGradeFactory::getGrade ( const xAOD::TrackParticle & track,
const xAOD::IParticle::FourMom_t &  ) const
virtual

Implements Analysis::ITrackGradeFactory.

Definition at line 66 of file BasicTrackGradeFactory.cxx.

67{
68
69 bool sharedClass(false);
70
72 {
73
74 uint8_t nbs=0, nps=0, nss=0;
76 ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfBLayerSharedHists for TrackGrade!");
77 }
78
79 if (!track.summaryValue(nps, xAOD::numberOfPixelSharedHits)){
80 ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfPixelSharedHists for TrackGrade!");
81 }
82
83 if (!track.summaryValue(nss, xAOD::numberOfSCTSharedHits)){
84 ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfSCTSharedHists for TrackGrade!");
85 }
86 int nsht = nps+nss ;
87
88
89
90 if(nbs>m_nSharedBLayer) {
91 sharedClass = true;
92 }
93 if(nps>m_nSharedPix) {
94 sharedClass = true;
95 }
96 if(nss>m_nSharedSct) {
97 sharedClass = true;
98 }
99 if(nsht>m_nSharedSi) {
100 sharedClass = true;
101 }
102 }
103
104 const TrackGrade * gradeToReturn(0);
105
106 if (sharedClass)
107 {
108// gradeToReturn=trackGradesDefinition.getGrade(std::string("Shared"));
109 gradeToReturn=m_trackGradesDefinition.getGrade(1);
110 }
111 else
112 {
113// gradeToReturn=trackGradesDefinition.getGrade(std::string("Good"));
114 gradeToReturn=m_trackGradesDefinition.getGrade(0);
115 }
116
117 if (gradeToReturn==0)
118 {
119 ATH_MSG_ERROR("#BTAG# Grade not found. Internal error... ");
120 return nullptr;
121 }
122
123 return new TrackGrade(*gradeToReturn);
124
125}
#define ATH_MSG_ERROR(x)
TrackGradesDefinition m_trackGradesDefinition
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].

◆ getTrackGradesDefinition()

const TrackGradesDefinition & Analysis::BasicTrackGradeFactory::getTrackGradesDefinition ( ) const
virtual

Implements Analysis::ITrackGradeFactory.

Definition at line 60 of file BasicTrackGradeFactory.cxx.

61{
63}

◆ initialize()

StatusCode Analysis::BasicTrackGradeFactory::initialize ( )

AlgTool initailize method.

Definition at line 34 of file BasicTrackGradeFactory.cxx.

35{
36
37 std::vector<TrackGrade> myGrades;
38
40 {
41 myGrades.push_back(TrackGrade(0,std::string("Good")));
42 }
43 else
44 {
45 myGrades.push_back(TrackGrade(0,std::string("Good")));
46 myGrades.push_back(TrackGrade(1,std::string("Shared")));
47 }
48
49 m_trackGradesDefinition=TrackGradesDefinition(myGrades);
50
51 return StatusCode::SUCCESS;
52}

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

◆ interfaceID()

const InterfaceID & Analysis::ITrackGradeFactory::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 55 of file ITrackGradeFactory.h.

55{ return IID_ITrackGradeFactory; };
static const InterfaceID IID_ITrackGradeFactory("Analysis::ITrackGradeFactory", 1, 0)

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

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

Perform system initialization for an algorithm.

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

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, 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_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_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_nSharedBLayer

int Analysis::BasicTrackGradeFactory::m_nSharedBLayer
private

if false the following cuts are ignored

Definition at line 58 of file BasicTrackGradeFactory.h.

◆ m_nSharedPix

int Analysis::BasicTrackGradeFactory::m_nSharedPix
private

max. number of shared hits in B layer

Definition at line 59 of file BasicTrackGradeFactory.h.

◆ m_nSharedSct

int Analysis::BasicTrackGradeFactory::m_nSharedSct
private

max. number of shared hits in pixels

Definition at line 60 of file BasicTrackGradeFactory.h.

◆ m_nSharedSi

int Analysis::BasicTrackGradeFactory::m_nSharedSi
private

max. number of shared hits in SCT

Definition at line 61 of file BasicTrackGradeFactory.h.

◆ m_trackGradesDefinition

TrackGradesDefinition Analysis::BasicTrackGradeFactory::m_trackGradesDefinition
private

Definition at line 55 of file BasicTrackGradeFactory.h.

◆ m_useSharedHitInfo

bool Analysis::BasicTrackGradeFactory::m_useSharedHitInfo
private

Definition at line 57 of file BasicTrackGradeFactory.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: