ATLAS Offline Software
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):
14 #include "TrigTrackCountsCnvTool.h"
15 
16 namespace 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());
48  TrigTrackCountsCollection::const_iterator ttc_iter_end = aod->end();
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
xAOD::TrigTrackCounts_v1::setZ0Bins
void setZ0Bins(unsigned int)
xAOD::TrigTrackCounts_v1
Definition: TrigTrackCounts_v1.h:12
xAOD::TrigTrackCounts_v1::setZ0Max
void setZ0Max(float)
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
xAOD::TrigTrackCounts_v1::setZ0Min
void setZ0Min(float)
TrigTrackCountsCnvTool.h
xAOD::TrigTrackCounts_v1::setPtMin
void setPtMin(float)
TrigHisto2D.h
xAOD::TrigTrackCounts_v1::z0Bins
unsigned int z0Bins() const
TrigTrackCountsContainer.h
xAOD::TrigTrackCounts_v1::setEtaMin
void setEtaMin(float)
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
xAODMaker
Definition: StoreGateSvc.h:72
xAOD::TrigTrackCounts_v1::setEtaBins
void setEtaBins(unsigned int)
xAOD::TrigTrackCounts
TrigTrackCounts_v1 TrigTrackCounts
Definition: Event/xAOD/xAODTrigMinBias/xAODTrigMinBias/TrigTrackCounts.h:11
xAOD::TrigTrackCounts_v1::setPhiBins
void setPhiBins(unsigned int)
xAOD::TrigTrackCounts_v1::setPhiMin
void setPhiMin(float)
TrigTrackCountsCollection
Definition: TrigTrackCountsCollection.h:13
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TrigTrackCounts_v1::setEta_phi
void setEta_phi(const std::vector< float > &eta_phi)
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigTrackCounts.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::TrigTrackCounts_v1::setEtaMax
void setEtaMax(float)
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::TrigTrackCounts_v1::setPtBins
void setPtBins(unsigned int)
xAOD::TrigTrackCounts_v1::setZ0_pt
void setZ0_pt(const std::vector< float > &z0_pt)
xAOD::TrigTrackCounts_v1::setPhiMax
void setPhiMax(float)
xAODMaker::TrigTrackCountsCnvTool::TrigTrackCountsCnvTool
TrigTrackCountsCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: TrigTrackCountsCnvTool.cxx:18
TrigTrackCountsCollection.h
xAODMaker::TrigTrackCountsCnvTool::convert
virtual StatusCode convert(const TrigTrackCountsCollection *aod, xAOD::TrigTrackCountsContainer *xaod) const override
Function that fills an existing xAOD::TrigTrackCountsContainer.
Definition: TrigTrackCountsCnvTool.cxx:36
AthAlgTool
Definition: AthAlgTool.h:26
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
xAOD::TrigTrackCounts_v1::setPtMax
void setPtMax(float)