ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::UnassociatedHitsDecorator Class Reference

#include <UnassociatedHitsDecorator.h>

Inheritance diagram for DerivationFramework::UnassociatedHitsDecorator:
Collaboration diagram for DerivationFramework::UnassociatedHitsDecorator:

Public Member Functions

virtual StatusCode initialize () override final
virtual StatusCode addBranches (const EventContext &ctx) const override final

Private Types

enum  EIntDecor {
  knPixelUADecor , knBlayerUADecor , knPixelBarrelUADecor , knPixelEndCapAUADecor ,
  knPixelEndCapCUADecor , knSCTUADecor , knSCTBarrelUADecor , knSCTEndCapAUADecor ,
  knSCTEndCapCUADecor , knTRTUADecor , knTRTBarrelUADecor , knTRTEndCapAUADecor ,
  knTRTEndCapCUADecor , kNIntDecor
}

Private Attributes

Gaudi::Property< std::string > m_sgName { this, "DecorationPrefix", "", ""}
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey { this, "ContainerName", "EventInfo", ""}
ToolHandle< IUnassociatedHitsGetterToolm_UnassociatedHitsGetterTool { this, "UnassociatedHitsGetter", "" , ""}
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_intDecorKeys

Detailed Description

Definition at line 28 of file UnassociatedHitsDecorator.h.

Member Enumeration Documentation

◆ EIntDecor

Enumerator
knPixelUADecor 
knBlayerUADecor 
knPixelBarrelUADecor 
knPixelEndCapAUADecor 
knPixelEndCapCUADecor 
knSCTUADecor 
knSCTBarrelUADecor 
knSCTEndCapAUADecor 
knSCTEndCapCUADecor 
knTRTUADecor 
knTRTBarrelUADecor 
knTRTEndCapAUADecor 
knTRTEndCapCUADecor 
kNIntDecor 

Definition at line 47 of file UnassociatedHitsDecorator.h.

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::UnassociatedHitsDecorator::addBranches ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 54 of file UnassociatedHitsDecorator.cxx.

55 {
56 ATH_MSG_DEBUG("Adding unassociated hits info to EventInfo");
57
58 SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfoKey,ctx);
59 CHECK( eventInfo.isValid() ? StatusCode::SUCCESS : StatusCode::FAILURE );
60
61 const MinBiasPRDAssociation* prdAssoc = m_UnassociatedHitsGetterTool->get();
62 std::vector<SG::WriteDecorHandle<xAOD::EventInfo,int> >
64 if (prdAssoc) {
65 intDecorators[knPixelUADecor](*eventInfo) = prdAssoc->nPixelUA;
66 intDecorators[knBlayerUADecor](*eventInfo) = prdAssoc->nBlayerUA;
67 intDecorators[knPixelBarrelUADecor](*eventInfo) = prdAssoc->nPixelBarrelUA;
68 intDecorators[knPixelEndCapAUADecor](*eventInfo) = prdAssoc->nPixelEndCapAUA;
69 intDecorators[knPixelEndCapCUADecor](*eventInfo) = prdAssoc->nPixelEndCapCUA;
70 intDecorators[knSCTUADecor](*eventInfo) = prdAssoc->nSCTUA;
71 intDecorators[knSCTBarrelUADecor](*eventInfo) = prdAssoc->nSCTBarrelUA;
72 intDecorators[knSCTEndCapAUADecor](*eventInfo) = prdAssoc->nSCTEndCapAUA;
73 intDecorators[knSCTEndCapCUADecor](*eventInfo) = prdAssoc->nSCTEndCapCUA;
74 intDecorators[knTRTUADecor](*eventInfo) = prdAssoc->nTRTUA;
75 intDecorators[knTRTBarrelUADecor](*eventInfo) = prdAssoc->nTRTBarrelUA;
76 intDecorators[knTRTEndCapAUADecor](*eventInfo) = prdAssoc->nTRTEndCapAUA;
77 intDecorators[knTRTEndCapCUADecor](*eventInfo) = prdAssoc->nTRTEndCapCUA;
78
79 ATH_MSG_DEBUG("Decorating unassociated hits with nPixelBarrelUA = ");
81
82 m_UnassociatedHitsGetterTool->releaseObject(prdAssoc);
83 }
84 else
85 ATH_MSG_WARNING("Could not retrieve Unassociated hits information");
86
87 return StatusCode::SUCCESS;
88 }
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_intDecorKeys
ToolHandle< IUnassociatedHitsGetterTool > m_UnassociatedHitsGetterTool
std::vector< SG::WriteDecorHandle< T_Cont, T > > createDecorators(const std::vector< SG::WriteDecorHandleKey< T_Cont > > &keys, const EventContext &ctx)

◆ initialize()

StatusCode DerivationFramework::UnassociatedHitsDecorator::initialize ( )
finaloverridevirtual

Definition at line 17 of file UnassociatedHitsDecorator.cxx.

18 {
19
20 if (m_sgName.empty()) {
21 ATH_MSG_WARNING("No decoration prefix name provided for the output of UnassociatedHitsDecorator!");
22 }
23
24 if (m_eventInfoKey.empty()) {
25 ATH_MSG_ERROR("No EventInfo collection provided for UnassociatedHitsDecorator!");
26 return StatusCode::FAILURE;
27 }
28 ATH_CHECK(m_eventInfoKey.initialize() );
29 // retrieve PRD association tool
31
32 { // FIXME DecorHandleKeys should be properly configured in the python layer
33 std::vector<std::string> names;
34 names.resize(kNIntDecor);
35 names[knPixelUADecor] ="nPixelUA";
36 names[knBlayerUADecor] ="nBlayerUA";
37 names[knPixelBarrelUADecor] ="nPixelBarrelUA";
38 names[knPixelEndCapAUADecor] ="nPixelEndCapAUA";
39 names[knPixelEndCapCUADecor] ="nPixelEndCapCUA";
40 names[knSCTUADecor] ="nSCTUA";
41 names[knSCTBarrelUADecor] ="nSCTBarrelUA";
42 names[knSCTEndCapAUADecor] ="nSCTEndCapAUA";
43 names[knSCTEndCapCUADecor] ="nSCTEndCapCUA";
44 names[knTRTUADecor] ="nTRTUA";
45 names[knTRTBarrelUADecor] ="nTRTBarrelUA";
46 names[knTRTEndCapAUADecor] ="nTRTEndCapAUA";
47 names[knTRTEndCapCUADecor] ="nTRTEndCapCUA";
49 }
50 return StatusCode::SUCCESS;
51 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
void createDecoratorKeys(T_Parent &parent, const SG::ReadHandleKey< T_Cont > &container_key, const std::string &prefix, const std::vector< std::string > &decor_names, std::vector< SG::WriteDecorHandleKey< T_Cont > > &decor_out)

Member Data Documentation

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> DerivationFramework::UnassociatedHitsDecorator::m_eventInfoKey { this, "ContainerName", "EventInfo", ""}
private

Definition at line 41 of file UnassociatedHitsDecorator.h.

42{ this, "ContainerName", "EventInfo", ""};

◆ m_intDecorKeys

std::vector<SG::WriteDecorHandleKey<xAOD::EventInfo> > DerivationFramework::UnassociatedHitsDecorator::m_intDecorKeys
private

Definition at line 61 of file UnassociatedHitsDecorator.h.

◆ m_sgName

Gaudi::Property<std::string> DerivationFramework::UnassociatedHitsDecorator::m_sgName { this, "DecorationPrefix", "", ""}
private

Definition at line 38 of file UnassociatedHitsDecorator.h.

39{ this, "DecorationPrefix", "", ""};

◆ m_UnassociatedHitsGetterTool

ToolHandle<IUnassociatedHitsGetterTool> DerivationFramework::UnassociatedHitsDecorator::m_UnassociatedHitsGetterTool { this, "UnassociatedHitsGetter", "" , ""}
private

Definition at line 44 of file UnassociatedHitsDecorator.h.

45{ this, "UnassociatedHitsGetter", "" , ""};

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