ATLAS Offline Software
Loading...
Searching...
No Matches
TrigTrackCountsCnvTool.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
6// EDM include(s):
9
12
13// Local include(s):
15
16namespace xAODMaker {
17
19 const std::string& name,
20 const IInterface* parent )
21 : AthAlgTool( type, name, parent ) {
22
23 // Declare the interface(s) provided by the tool:
24 declareInterface< ITrigTrackCountsCnvTool >( this );
25 }
26
37 xAOD::TrigTrackCountsContainer* xaod ) const {
38
39 // A small sanity check. The output container should really be empty...
40 if( !xaod->empty() ) {
41 ATH_MSG_WARNING( "The output xAOD container is not empty (size=="
42 << xaod->size() << ")" );
43 }
44
45 ATH_MSG_VERBOSE("execute: TrigTrackCountsCnvTool::convert");
46 ATH_MSG_VERBOSE("AOD TrigTrackCountsCollection size::" <<aod->size());
49
50 for(;ttc_iter != ttc_iter_end; ++ttc_iter)
51 {
52 // Create a (single) output xAOD object.
54 xaod->push_back(xttcounts);
55 //
56 xttcounts->setZ0Bins((*ttc_iter)->z0_pt().nbins_x());
57 xttcounts->setZ0Min((*ttc_iter)->z0_pt().min_x());
58 xttcounts->setZ0Max((*ttc_iter)->z0_pt().max_x());
59 xttcounts->setPtBins((*ttc_iter)->z0_pt().nbins_y());
60 xttcounts->setPtMin((*ttc_iter)->z0_pt().min_y());
61 xttcounts->setPtMax((*ttc_iter)->z0_pt().max_y());
62
63 xttcounts->setZ0_pt((*ttc_iter)->z0_pt().contents());
64
65 xttcounts->setEtaBins((*ttc_iter)->eta_phi().nbins_x());
66 xttcounts->setEtaMin((*ttc_iter)->eta_phi().min_x());
67 xttcounts->setEtaMax((*ttc_iter)->eta_phi().max_x());
68 xttcounts->setPhiBins((*ttc_iter)->eta_phi().nbins_y());
69 xttcounts->setPhiMin((*ttc_iter)->eta_phi().min_y());
70 xttcounts->setPhiMax((*ttc_iter)->eta_phi().max_y());
71
72 xttcounts->setEta_phi((*ttc_iter)->eta_phi().contents());
73
74 //now some verbose stuff
75 ATH_MSG_VERBOSE("Orig vs xAOD: Z0Bins: " << (*ttc_iter)->z0_pt().nbins_x()<< " " << xttcounts->z0Bins());
76
77 }
78 // Return gracefully:
79 return StatusCode::SUCCESS;
80 }
81
82} // namespace xAODMaker
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
virtual StatusCode convert(const TrigTrackCountsCollection *aod, xAOD::TrigTrackCountsContainer *xaod) const override
Function that fills an existing xAOD::TrigTrackCountsContainer.
TrigTrackCountsCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
void setPtBins(unsigned int)
void setZ0Bins(unsigned int)
void setPhiBins(unsigned int)
void setEtaBins(unsigned int)
void setEta_phi(const std::vector< float > &eta_phi)
void setZ0_pt(const std::vector< float > &z0_pt)
unsigned int z0Bins() const
TrigTrackCountsContainer_v1 TrigTrackCountsContainer