ATLAS Offline Software
TrigVertexCountsCnvTool.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 
10 // Local include(s):
12 
13 namespace xAODMaker {
14 
16  const std::string& name,
17  const IInterface* parent )
18  : AthAlgTool( type, name, parent ) {
19 
20  // Declare the interface(s) provided by the tool:
21  declareInterface< ITrigVertexCountsCnvTool >( this );
22  }
23 
34  xAOD::TrigVertexCountsContainer* xaod ) const {
35 
36  // A small sanity check. The output container should really be empty...
37  if( !xaod->empty() ) {
38  ATH_MSG_WARNING( "The output xAOD container is not empty (size=="
39  << xaod->size() << ")" );
40  }
41  ATH_MSG_VERBOSE("AOD TrigVertexCountsCollection size:: "<< aod->size());
42 
44  TrigVertexCountsCollection::const_iterator tvc_iter_end = aod->end();
45 
46  for(;tvc_iter != tvc_iter_end;++tvc_iter){
47  // Create a (single) output xAOD object.
49  xaod->push_back(xtvc);
50 
51  xtvc->setVtxNtrks((*tvc_iter)->vtxNtrks());
52  xtvc->setVtxTrkPtSqSum((*tvc_iter)->vtxTrkPtSqSum());
53 
54  ATH_MSG_VERBOSE("AOD vs xAOD::vtxNtrks size:: "<< (*tvc_iter)->vtxNtrks().size()<<" "<<xtvc->vtxNtrks().size());
55  ATH_MSG_VERBOSE("AOD vs xAOD:vtxTrkPtSqSum size:: "<< (*tvc_iter)->vtxTrkPtSqSum().size()<<" "<<xtvc->vtxTrkPtSqSum().size());
56  //
57  }
58  // Return gracefully:
59  return StatusCode::SUCCESS;
60  }
61 
62 } // namespace xAODMaker
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
xAOD::TrigVertexCounts_v1::vtxTrkPtSqSum
const std::vector< float > & vtxTrkPtSqSum() const
TrigVertexCountsCnvTool.h
xAODMaker::TrigVertexCountsCnvTool::convert
virtual StatusCode convert(const TrigVertexCountsCollection *aod, xAOD::TrigVertexCountsContainer *xaod) const override
Function that fills an existing xAOD::TrigVertexCountsContainer.
Definition: TrigVertexCountsCnvTool.cxx:33
xAOD::TrigVertexCounts_v1::vtxNtrks
const std::vector< unsigned int > & vtxNtrks() const
getters
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
xAODMaker
Definition: StoreGateSvc.h:72
xAODMaker::TrigVertexCountsCnvTool::TrigVertexCountsCnvTool
TrigVertexCountsCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: TrigVertexCountsCnvTool.cxx:15
xAOD::TrigVertexCounts_v1::setVtxNtrks
void setVtxNtrks(const std::vector< unsigned int > &m_vtxNtrks)
TrigVertexCountsCollection.h
xAOD::TrigVertexCounts
TrigVertexCounts_v1 TrigVertexCounts
Definition: Event/xAOD/xAODTrigMinBias/xAODTrigMinBias/TrigVertexCounts.h:11
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TrigVertexCounts_v1
Definition: TrigVertexCounts_v1.h:12
test_pyathena.parent
parent
Definition: test_pyathena.py:15
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.
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
xAOD::TrigVertexCounts_v1::setVtxTrkPtSqSum
void setVtxTrkPtSqSum(const std::vector< float > &m_vtxTrkPtSqSum)
TrigVertexCountsCollection
Definition: TrigVertexCountsCollection.h:13
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigVertexCounts.h
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.