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

#include <LArCollisionTimeDecorator.h>

Inheritance diagram for DerivationFramework::LArCollisionTimeDecorator:
Collaboration diagram for DerivationFramework::LArCollisionTimeDecorator:

Public Member Functions

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

Private Types

enum  EIntDecor { kncellA, kncellC, kNIntDecor }
 
enum  EFloatDecor {
  kenergyA, kenergyC, ktimeA, ktimeC,
  kNFloatDecor
}
 

Private Attributes

Gaudi::Property< std::string > m_sgName { this, "DecorationPrefix", "", ""}
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey { this, "ContainerName", "EventInfo", "" }
 
SG::ReadHandleKey< LArCollisionTimem_larCollisionTimeKey { this, "LArCollisionTimeKey", "LArCollisionTime", ""}
 
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_intDecorKeys
 
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_floatDecorKeys
 

Detailed Description

Definition at line 30 of file LArCollisionTimeDecorator.h.

Member Enumeration Documentation

◆ EFloatDecor

Enumerator
kenergyA 
kenergyC 
ktimeA 
ktimeC 
kNFloatDecor 

Definition at line 48 of file LArCollisionTimeDecorator.h.

◆ EIntDecor

Enumerator
kncellA 
kncellC 
kNIntDecor 

Definition at line 47 of file LArCollisionTimeDecorator.h.

Constructor & Destructor Documentation

◆ LArCollisionTimeDecorator()

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

Definition at line 21 of file LArCollisionTimeDecorator.cxx.

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

Member Function Documentation

◆ addBranches()

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

Definition at line 67 of file LArCollisionTimeDecorator.cxx.

68  {
69  ATH_MSG_DEBUG("Adding LAr time info to EventInfo");
70  const EventContext& ctx = Gaudi::Hive::currentContext();
72  CHECK( eventInfo.isValid() ? StatusCode::SUCCESS : StatusCode::FAILURE);
73 
75 
76  std::vector<SG::WriteDecorHandle<xAOD::EventInfo,int> > int_decor_handles(createDecorators<xAOD::EventInfo,int>(m_intDecorKeys,ctx));
77  std::vector<SG::WriteDecorHandle<xAOD::EventInfo,float> > float_decor_handles(createDecorators<xAOD::EventInfo,float>(m_floatDecorKeys,ctx));
78  assert( int_decor_handles.size() == kNIntDecor);
79  assert( float_decor_handles.size() == kNFloatDecor);
80  if (tps.isValid()) {
81  int_decor_handles[kncellA](*eventInfo) = tps->ncellA();
82  int_decor_handles[kncellC](*eventInfo) = tps->ncellC();
83  float_decor_handles[kenergyA](*eventInfo) = tps->energyA();
84  float_decor_handles[kenergyC](*eventInfo) = tps->energyC();
85  float_decor_handles[ktimeA](*eventInfo) = tps->timeA();
86  float_decor_handles[ktimeC](*eventInfo) = tps->timeC();
87  float LArECtimeDiff = tps->timeA()-tps->timeC();
88  ATH_MSG_DEBUG("Decorating LAr time info, LArECTimeDiff = " << LArECtimeDiff);
89  }
90  else {
91  ATH_MSG_WARNING("Missing LArCollisionTime information.");
92  }
93 
94  return StatusCode::SUCCESS;
95  }

◆ finalize()

StatusCode DerivationFramework::LArCollisionTimeDecorator::finalize ( )

Definition at line 62 of file LArCollisionTimeDecorator.cxx.

63  {
64  return StatusCode::SUCCESS;
65  }

◆ initialize()

StatusCode DerivationFramework::LArCollisionTimeDecorator::initialize ( )

Definition at line 28 of file LArCollisionTimeDecorator.cxx.

29  {
30 
31  if (m_sgName.empty()) {
32  ATH_MSG_WARNING("No decoration prefix name provided for the output of LArCollisionTimeDecorator!");
33  }
34 
35  if (m_eventInfoKey.key().empty()) {
36  ATH_MSG_ERROR("No EventInfo collection provided for LArCollisionTimeDecorator!");
37  return StatusCode::FAILURE;
38  }
41  {
42  std::vector<std::string> names;
43  names.resize(kNIntDecor);
44  names[kncellA]="ncellA";
45  names[kncellC]="ncellC";
46  createDecoratorKeys(*this,m_eventInfoKey,"" /* common prefix */,names, m_intDecorKeys);
47  }
48 
49  {
50  std::vector<std::string> names;
51  names.resize(kNFloatDecor);
52  names[kenergyA] = "energyA";
53  names[kenergyC] = "energyC";
54  names[ktimeA] = "timeA";
55  names[ktimeC] = "timeC";
56  createDecoratorKeys(*this,m_eventInfoKey,"" /* common prefix */,names, m_floatDecorKeys);
57  }
58 
59  return StatusCode::SUCCESS;
60  }

Member Data Documentation

◆ m_eventInfoKey

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

Definition at line 42 of file LArCollisionTimeDecorator.h.

◆ m_floatDecorKeys

std::vector<SG::WriteDecorHandleKey<xAOD::EventInfo> > DerivationFramework::LArCollisionTimeDecorator::m_floatDecorKeys
private

Definition at line 51 of file LArCollisionTimeDecorator.h.

◆ m_intDecorKeys

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

Definition at line 50 of file LArCollisionTimeDecorator.h.

◆ m_larCollisionTimeKey

SG::ReadHandleKey<LArCollisionTime> DerivationFramework::LArCollisionTimeDecorator::m_larCollisionTimeKey { this, "LArCollisionTimeKey", "LArCollisionTime", ""}
private

Definition at line 44 of file LArCollisionTimeDecorator.h.

◆ m_sgName

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

Definition at line 40 of file LArCollisionTimeDecorator.h.


The documentation for this class was generated from the following files:
DerivationFramework::LArCollisionTimeDecorator::kncellC
@ kncellC
Definition: LArCollisionTimeDecorator.h:47
DerivationFramework::LArCollisionTimeDecorator::m_larCollisionTimeKey
SG::ReadHandleKey< LArCollisionTime > m_larCollisionTimeKey
Definition: LArCollisionTimeDecorator.h:45
DerivationFramework::LArCollisionTimeDecorator::kenergyC
@ kenergyC
Definition: LArCollisionTimeDecorator.h:48
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
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
DerivationFramework::LArCollisionTimeDecorator::m_floatDecorKeys
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_floatDecorKeys
Definition: LArCollisionTimeDecorator.h:51
DerivationFramework::LArCollisionTimeDecorator::kNIntDecor
@ kNIntDecor
Definition: LArCollisionTimeDecorator.h:47
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
DerivationFramework::LArCollisionTimeDecorator::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: LArCollisionTimeDecorator.h:43
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
DerivationFramework::LArCollisionTimeDecorator::ktimeA
@ ktimeA
Definition: LArCollisionTimeDecorator.h:48
test_pyathena.parent
parent
Definition: test_pyathena.py:15
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
DerivationFramework::LArCollisionTimeDecorator::kenergyA
@ kenergyA
Definition: LArCollisionTimeDecorator.h:48
DerivationFramework::LArCollisionTimeDecorator::ktimeC
@ ktimeC
Definition: LArCollisionTimeDecorator.h:48
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
columnar::ContainerId::eventInfo
@ eventInfo
DerivationFramework::LArCollisionTimeDecorator::m_intDecorKeys
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_intDecorKeys
Definition: LArCollisionTimeDecorator.h:50
DerivationFramework::LArCollisionTimeDecorator::kNFloatDecor
@ kNFloatDecor
Definition: LArCollisionTimeDecorator.h:48
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DerivationFramework::LArCollisionTimeDecorator::m_sgName
Gaudi::Property< std::string > m_sgName
Definition: LArCollisionTimeDecorator.h:41
DerivationFramework::LArCollisionTimeDecorator::kncellA
@ kncellA
Definition: LArCollisionTimeDecorator.h:47