ATLAS Offline Software
TrigxAODBphysReaderAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id:$ //
6 
7 // Gaudi/Athena include(s):
9 
10 // EDM include(s):
12 
13 // Local include(s):
14 #include "TrigxAODBphysReaderAlg.h"
15 
16 
17 namespace xAODMaker {
18 
20  ISvcLocator* svcLoc )
21  : AthAlgorithm( name, svcLoc )
22  {
23 
24  declareProperty( "xAODKey", m_xaodKey = "xAODTrigEFBphys" );
25  }
26 
27 
29 
30  // Greet the user:
31  ATH_MSG_INFO( "Initializing" );
32  ATH_MSG_DEBUG( "xAOD Key: " << m_xaodKey );
33 
34  // Return gracefully:
35  return StatusCode::SUCCESS;
36  }
37 
39 
40  xAOD::TrigBphysContainer * trigContainer(nullptr);
41  // Retrieve the AOD container:
42  if (evtStore()->retrieve( trigContainer, m_xaodKey ).isFailure()) {
43  ATH_MSG_WARNING("Requesting in Alg: xAOD::TrigBphysContainer " << m_xaodKey <<
44  ". Input container not found or incorrect type");
45  return StatusCode::SUCCESS;
46  }
47 
48  if (!trigContainer) {
49  ATH_MSG_WARNING("Null pointer");
50  return StatusCode::SUCCESS;
51  }
52 
53  ATH_MSG_INFO("Found container size: " << trigContainer->size() << " with name " << m_xaodKey);
54  for (auto obj: *trigContainer) {
55  ATH_MSG_INFO("Print for obj: "<< obj << "\n " <<
56  "roiId: "<< obj->roiId() << "\n " <<
57  "particleType: "<< obj->particleType() << "\n " <<
58  "level: " << obj->level() << "\n " <<
59  "eta: " << obj->eta() << "\n " <<
60  "phi: " << obj->phi() << "\n " <<
61  "mass: " << obj->mass() << "\n " <<
62  "fitmass: " << obj->fitmass() << "\n " <<
63  "fitchi2: " << obj->fitchi2() << "\n " <<
64  "fitndof: " << obj->fitndof() << "\n " <<
65  "fitx: " << obj->fitx() << "\n " <<
66  "fity: " << obj->fity() << "\n " <<
67  "fitz: " << obj->fitz() << "\n ");
68  } // for
69 
70 
71  // Return gracefully:
72  return StatusCode::SUCCESS;
73  }
74 
75 } // namespace xAODMaker
76 
77 
78 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TrigxAODBphysReaderAlg.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAODMaker::TrigxAODBphysReaderAlg::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition: TrigxAODBphysReaderAlg.cxx:28
xAODMaker
Definition: StoreGateSvc.h:72
xAODMaker::TrigxAODBphysReaderAlg::TrigxAODBphysReaderAlg
TrigxAODBphysReaderAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition: TrigxAODBphysReaderAlg.cxx:19
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
errorcheck.h
Helpers for checking error return status codes and reporting errors.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAODMaker::TrigxAODBphysReaderAlg::m_xaodKey
std::string m_xaodKey
StoreGate key for the output container.
Definition: TrigxAODBphysReaderAlg.h:40
xAODMaker::TrigxAODBphysReaderAlg::execute
virtual StatusCode execute()
Function executing the algorithm.
Definition: TrigxAODBphysReaderAlg.cxx:38
TrigBphysContainer.h
python.PyAthena.obj
obj
Definition: PyAthena.py:135
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.