ATLAS Offline Software
Loading...
Searching...
No Matches
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):
15
16
17namespace 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
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Helpers for checking error return status codes and reporting errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
size_type size() const noexcept
Returns the number of elements in the collection.
virtual StatusCode initialize()
Function initialising the algorithm.
std::string m_xaodKey
StoreGate key for the output container.
virtual StatusCode execute()
Function executing the algorithm.
TrigxAODBphysReaderAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
TrigBphysContainer_v1 TrigBphysContainer