ATLAS Offline Software
Public Member Functions | Private Types | Private Attributes | List of all members
DerivationFramework::UnassociatedHitsDecorator Class Reference

#include <UnassociatedHitsDecorator.h>

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

Public Member Functions

 UnassociatedHitsDecorator (const std::string &type, const std::string &name, const IInterface *parent)
 
StatusCode initialize ()
 
StatusCode finalize ()
 
virtual StatusCode addBranches () const
 

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 32 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 51 of file UnassociatedHitsDecorator.h.

Constructor & Destructor Documentation

◆ UnassociatedHitsDecorator()

DerivationFramework::UnassociatedHitsDecorator::UnassociatedHitsDecorator ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 20 of file UnassociatedHitsDecorator.cxx.

22  :
23  base_class(type,name,parent)
24  {
25  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::UnassociatedHitsDecorator::addBranches ( ) const
virtual

Definition at line 68 of file UnassociatedHitsDecorator.cxx.

69  {
70  ATH_MSG_DEBUG("Adding unassociated hits info to EventInfo");
71  const EventContext& ctx = Gaudi::Hive::currentContext();
72 
74  CHECK( eventInfo.isValid() ? StatusCode::SUCCESS : StatusCode::FAILURE );
75 
76  const MinBiasPRDAssociation* prdAssoc = m_UnassociatedHitsGetterTool->get();
77  std::vector<SG::WriteDecorHandle<xAOD::EventInfo,int> >
78  intDecorators = createDecorators<xAOD::EventInfo,int>(m_intDecorKeys,ctx);
79  if (prdAssoc) {
80  intDecorators[knPixelUADecor](*eventInfo) = prdAssoc->nPixelUA;
81  intDecorators[knBlayerUADecor](*eventInfo) = prdAssoc->nBlayerUA;
82  intDecorators[knPixelBarrelUADecor](*eventInfo) = prdAssoc->nPixelBarrelUA;
83  intDecorators[knPixelEndCapAUADecor](*eventInfo) = prdAssoc->nPixelEndCapAUA;
84  intDecorators[knPixelEndCapCUADecor](*eventInfo) = prdAssoc->nPixelEndCapCUA;
85  intDecorators[knSCTUADecor](*eventInfo) = prdAssoc->nSCTUA;
86  intDecorators[knSCTBarrelUADecor](*eventInfo) = prdAssoc->nSCTBarrelUA;
87  intDecorators[knSCTEndCapAUADecor](*eventInfo) = prdAssoc->nSCTEndCapAUA;
88  intDecorators[knSCTEndCapCUADecor](*eventInfo) = prdAssoc->nSCTEndCapCUA;
89  intDecorators[knTRTUADecor](*eventInfo) = prdAssoc->nTRTUA;
90  intDecorators[knTRTBarrelUADecor](*eventInfo) = prdAssoc->nTRTBarrelUA;
91  intDecorators[knTRTEndCapAUADecor](*eventInfo) = prdAssoc->nTRTEndCapAUA;
92  intDecorators[knTRTEndCapCUADecor](*eventInfo) = prdAssoc->nTRTEndCapCUA;
93 
94  ATH_MSG_DEBUG("Decorating unassociated hits with nPixelBarrelUA = ");
95  ATH_MSG_DEBUG(prdAssoc->nPixelBarrelUA);
96 
97  m_UnassociatedHitsGetterTool->releaseObject(prdAssoc);
98  }
99  else
100  ATH_MSG_WARNING("Could not retrieve Unassociated hits information");
101 
102  return StatusCode::SUCCESS;
103  }

◆ finalize()

StatusCode DerivationFramework::UnassociatedHitsDecorator::finalize ( )

Definition at line 63 of file UnassociatedHitsDecorator.cxx.

64  {
65  return StatusCode::SUCCESS;
66  }

◆ initialize()

StatusCode DerivationFramework::UnassociatedHitsDecorator::initialize ( )

Definition at line 27 of file UnassociatedHitsDecorator.cxx.

28  {
29 
30  if (m_sgName.empty()) {
31  ATH_MSG_WARNING("No decoration prefix name provided for the output of UnassociatedHitsDecorator!");
32  }
33 
34  if (m_eventInfoKey.empty()) {
35  ATH_MSG_ERROR("No EventInfo collection provided for UnassociatedHitsDecorator!");
36  return StatusCode::FAILURE;
37  }
39  // retrieve PRD association tool
41 
42  {
43  std::vector<std::string> names;
44  names.resize(kNIntDecor);
45  names[knPixelUADecor] ="nPixelUA";
46  names[knBlayerUADecor] ="nBlayerUA";
47  names[knPixelBarrelUADecor] ="nPixelBarrelUA";
48  names[knPixelEndCapAUADecor] ="nPixelEndCapAUA";
49  names[knPixelEndCapCUADecor] ="nPixelEndCapCUA";
50  names[knSCTUADecor] ="nSCTUA";
51  names[knSCTBarrelUADecor] ="nSCTBarrelUA";
52  names[knSCTEndCapAUADecor] ="nSCTEndCapAUA";
53  names[knSCTEndCapCUADecor] ="nSCTEndCapCUA";
54  names[knTRTUADecor] ="nTRTUA";
55  names[knTRTBarrelUADecor] ="nTRTBarrelUA";
56  names[knTRTEndCapAUADecor] ="nTRTEndCapAUA";
57  names[knTRTEndCapCUADecor] ="nTRTEndCapCUA";
59  }
60  return StatusCode::SUCCESS;
61  }

Member Data Documentation

◆ m_eventInfoKey

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

Definition at line 45 of file UnassociatedHitsDecorator.h.

◆ m_intDecorKeys

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

Definition at line 65 of file UnassociatedHitsDecorator.h.

◆ m_sgName

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

Definition at line 42 of file UnassociatedHitsDecorator.h.

◆ m_UnassociatedHitsGetterTool

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

Definition at line 48 of file UnassociatedHitsDecorator.h.


The documentation for this class was generated from the following files:
DerivationFramework::createDecoratorKeys
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)
Definition: DecoratorUtils.h:20
MinBiasPRDAssociation::nPixelBarrelUA
int nPixelBarrelUA
Definition: MinBiasPRDAssociation.h:20
MinBiasPRDAssociation::nPixelUA
int nPixelUA
Definition: MinBiasPRDAssociation.h:18
MinBiasPRDAssociation::nPixelEndCapAUA
int nPixelEndCapAUA
Definition: MinBiasPRDAssociation.h:21
DerivationFramework::UnassociatedHitsDecorator::m_intDecorKeys
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_intDecorKeys
Definition: UnassociatedHitsDecorator.h:65
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
DerivationFramework::UnassociatedHitsDecorator::knPixelEndCapCUADecor
@ knPixelEndCapCUADecor
Definition: UnassociatedHitsDecorator.h:55
MinBiasPRDAssociation::nSCTEndCapCUA
int nSCTEndCapCUA
Definition: MinBiasPRDAssociation.h:27
DerivationFramework::UnassociatedHitsDecorator::knSCTEndCapCUADecor
@ knSCTEndCapCUADecor
Definition: UnassociatedHitsDecorator.h:59
DerivationFramework::UnassociatedHitsDecorator::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: UnassociatedHitsDecorator.h:46
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
MinBiasPRDAssociation::nSCTUA
int nSCTUA
Definition: MinBiasPRDAssociation.h:24
DerivationFramework::UnassociatedHitsDecorator::knPixelUADecor
@ knPixelUADecor
Definition: UnassociatedHitsDecorator.h:51
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
DerivationFramework::UnassociatedHitsDecorator::kNIntDecor
@ kNIntDecor
Definition: UnassociatedHitsDecorator.h:64
MinBiasPRDAssociation::nTRTEndCapCUA
int nTRTEndCapCUA
Definition: MinBiasPRDAssociation.h:32
DerivationFramework::UnassociatedHitsDecorator::m_sgName
Gaudi::Property< std::string > m_sgName
Definition: UnassociatedHitsDecorator.h:43
MinBiasPRDAssociation::nTRTEndCapAUA
int nTRTEndCapAUA
Definition: MinBiasPRDAssociation.h:31
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
python.subdetectors.mmg.names
names
Definition: mmg.py:8
MinBiasPRDAssociation::nSCTBarrelUA
int nSCTBarrelUA
Definition: MinBiasPRDAssociation.h:25
test_pyathena.parent
parent
Definition: test_pyathena.py:15
DerivationFramework::UnassociatedHitsDecorator::knSCTBarrelUADecor
@ knSCTBarrelUADecor
Definition: UnassociatedHitsDecorator.h:57
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
MinBiasPRDAssociation::nSCTEndCapAUA
int nSCTEndCapAUA
Definition: MinBiasPRDAssociation.h:26
MinBiasPRDAssociation
Definition: MinBiasPRDAssociation.h:11
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DerivationFramework::UnassociatedHitsDecorator::knBlayerUADecor
@ knBlayerUADecor
Definition: UnassociatedHitsDecorator.h:52
columnar::ContainerId::eventInfo
@ eventInfo
MinBiasPRDAssociation::nTRTBarrelUA
int nTRTBarrelUA
Definition: MinBiasPRDAssociation.h:30
DerivationFramework::UnassociatedHitsDecorator::knTRTBarrelUADecor
@ knTRTBarrelUADecor
Definition: UnassociatedHitsDecorator.h:61
DerivationFramework::UnassociatedHitsDecorator::knPixelEndCapAUADecor
@ knPixelEndCapAUADecor
Definition: UnassociatedHitsDecorator.h:54
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DerivationFramework::UnassociatedHitsDecorator::knTRTEndCapCUADecor
@ knTRTEndCapCUADecor
Definition: UnassociatedHitsDecorator.h:63
DerivationFramework::UnassociatedHitsDecorator::knSCTUADecor
@ knSCTUADecor
Definition: UnassociatedHitsDecorator.h:56
MinBiasPRDAssociation::nPixelEndCapCUA
int nPixelEndCapCUA
Definition: MinBiasPRDAssociation.h:22
DerivationFramework::UnassociatedHitsDecorator::knTRTUADecor
@ knTRTUADecor
Definition: UnassociatedHitsDecorator.h:60
DerivationFramework::UnassociatedHitsDecorator::m_UnassociatedHitsGetterTool
ToolHandle< IUnassociatedHitsGetterTool > m_UnassociatedHitsGetterTool
Definition: UnassociatedHitsDecorator.h:49
DerivationFramework::UnassociatedHitsDecorator::knTRTEndCapAUADecor
@ knTRTEndCapAUADecor
Definition: UnassociatedHitsDecorator.h:62
MinBiasPRDAssociation::nBlayerUA
int nBlayerUA
Definition: MinBiasPRDAssociation.h:19
MinBiasPRDAssociation::nTRTUA
int nTRTUA
Definition: MinBiasPRDAssociation.h:29
DerivationFramework::UnassociatedHitsDecorator::knPixelBarrelUADecor
@ knPixelBarrelUADecor
Definition: UnassociatedHitsDecorator.h:53
DerivationFramework::UnassociatedHitsDecorator::knSCTEndCapAUADecor
@ knSCTEndCapAUADecor
Definition: UnassociatedHitsDecorator.h:58