ATLAS Offline Software
Loading...
Searching...
No Matches
TrigT2MbtsBitsCnvTool.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
11// Local include(s):
13
14namespace xAODMaker {
15
17 const std::string& name,
18 const IInterface* parent )
19 : AthAlgTool( type, name, parent ) {
20
21 // Declare the interface(s) provided by the tool:
22 declareInterface< ITrigT2MbtsBitsCnvTool >( this );
23 }
24
25
36 xAOD::TrigT2MbtsBitsContainer* xaod ) const {
37
38 // A small sanity check. The output container should really be empty...
39 if( !xaod->empty() ) {
40 ATH_MSG_WARNING( "The output xAOD container is not empty (size=="
41 << xaod->size() << ")" );
42 }
43
45 TrigT2MbtsBitsContainer::const_iterator t2mbts_iter_end = aod->end();
46
47 ATH_MSG_VERBOSE("AOD TrigT2MbtsBitsContainer size:: "<< aod->size());
48
49 for(;t2mbts_iter != t2mbts_iter_end; ++t2mbts_iter){
50 // Create a (single) output xAOD object.
51 xAOD::TrigT2MbtsBits* xT2MbtsBits = new xAOD::TrigT2MbtsBits();
52 xaod->push_back(xT2MbtsBits);
53
54 //
55 xT2MbtsBits->setTriggerEnergies( (*t2mbts_iter)-> triggerEnergies() );
56 xT2MbtsBits->setTriggerTimes( (*t2mbts_iter) -> triggerTimes() );
57
58 ATH_MSG_VERBOSE("AOD vs xAOD::triggerEnergies size:: "<< (*t2mbts_iter)->triggerEnergies().size()<<" "<<xT2MbtsBits->triggerEnergies().size());
59 ATH_MSG_VERBOSE("AOD vs xAOD:triggerTimes size:: "<< (*t2mbts_iter)->triggerTimes().size()<<" "<<xT2MbtsBits->triggerTimes().size());
60 }
61 // Return gracefully:
62 return StatusCode::SUCCESS;
63 }
64
65} // 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.
TrigT2MbtsBitsCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
virtual StatusCode convert(const TrigT2MbtsBitsContainer *aod, xAOD::TrigT2MbtsBitsContainer *xaod) const override
Function that fills an existing xAOD::TrigT2MbtsBitsContainer.
void setTriggerTimes(const std::vector< float > &trigTm)
const std::vector< float > & triggerEnergies() const
Return the trigger energies of each counter.
const std::vector< float > & triggerTimes() const
Return the relative times of the triggers.
void setTriggerEnergies(const std::vector< float > &trigEg)