ATLAS Offline Software
NSW_PadTriggerDataContainerCnv_p1.cxx
Go to the documentation of this file.
2 
3 namespace Muon {
5  if (log.level() <= MSG::VERBOSE) {
6  log << MSG::VERBOSE <<
7  "Converting persistent NSW_PadTriggerDataContainer_p1 to transient NSW_PadTriggerDataContainer" << endmsg;
8  }
9  for (const auto& pCollection : persistentObj->m_collections) {
10  auto tCollection = std::make_unique<NSW_PadTriggerData>(
11  pCollection.m_sourceid,
12  pCollection.m_flags,
13  pCollection.m_ec,
14  pCollection.m_fragid,
15  pCollection.m_secid,
16  pCollection.m_spare,
17  pCollection.m_orbit,
18  pCollection.m_bcid,
19  pCollection.m_l1id,
20  pCollection.m_orbitid,
21  pCollection.m_orbit1,
22  pCollection.m_status,
23  pCollection.m_hit_n,
24  pCollection.m_pfeb_n,
25  pCollection.m_trigger_n,
26  pCollection.m_bcid_n,
27  pCollection.m_hit_relbcid,
28  pCollection.m_hit_pfeb,
29  pCollection.m_hit_tdschannel,
30  pCollection.m_hit_vmmchannel,
31  pCollection.m_hit_vmm,
32  pCollection.m_hit_padchannel,
33  pCollection.m_pfeb_addr,
34  pCollection.m_pfeb_nchan,
35  pCollection.m_pfeb_disconnected,
36  pCollection.m_trigger_bandid,
37  pCollection.m_trigger_phiid,
38  pCollection.m_trigger_relbcid,
39  pCollection.m_bcid_rel,
40  pCollection.m_bcid_status,
41  pCollection.m_bcid_multzero,
42  pCollection.m_bcid_multiplicity
43  );
44  if(transientObj->addCollection(tCollection.release(), transientObj->numberOfCollections()).isFailure()) {
45  throw std::runtime_error{ "Could not add collection to transient container!" };
46  }
47  }
48 }
49 
50 
52  if (log.level() <= MSG::VERBOSE) {
53  log << MSG::VERBOSE <<
54  "Converting transient NSW_PadTriggerDataContainer to persistent NSW_PadTriggerDataContainer_p1" << endmsg;
55  }
56  persistentObj->m_collections.reserve(transientObj->size());
57  // Iterate over collections
58  for (const NSW_PadTriggerData* tCollection : *transientObj) {
59  NSW_PadTriggerData_p1 pCollection{};
60  pCollection.m_sourceid = tCollection->getSourceid();
61  pCollection.m_flags = tCollection->getFlags();
62  pCollection.m_ec = tCollection->getEc();
63  pCollection.m_fragid = tCollection->getFragid();
64  pCollection.m_secid = tCollection->getSecid();
65  pCollection.m_spare = tCollection->getSpare();
66  pCollection.m_orbit = tCollection->getOrbit();
67  pCollection.m_bcid = tCollection->getBcid();
68  pCollection.m_l1id = tCollection->getL1id();
69  pCollection.m_orbitid = tCollection->getOrbitid();
70  pCollection.m_orbit1 = tCollection->getOrbit1();
71  pCollection.m_status = tCollection->getStatus();
72  pCollection.m_hit_n = tCollection->getNumberOfHits();
73  pCollection.m_pfeb_n = tCollection->getNumberOfPfebs();
74  pCollection.m_trigger_n = tCollection->getNumberOfTriggers();
75  pCollection.m_bcid_n = tCollection->getNumberOfBcids();
76  pCollection.m_hit_relbcid = tCollection->getHitRelBcids();
77  pCollection.m_hit_pfeb = tCollection->getHitPfebs();
78  pCollection.m_hit_tdschannel = tCollection->getHitTdsChannels();
79  pCollection.m_hit_vmmchannel = tCollection->getHitVmmChannels();
80  pCollection.m_hit_vmm = tCollection->getHitVmms();
81  pCollection.m_hit_padchannel = tCollection->getHitPadChannels();
82  pCollection.m_pfeb_addr = tCollection->getPfebAddrs();
83  pCollection.m_pfeb_nchan = tCollection->getPfebNChannels();
84  pCollection.m_pfeb_disconnected = tCollection->getPfebDisconnecteds();
85  pCollection.m_trigger_bandid = tCollection->getTriggerBandIds();
86  pCollection.m_trigger_phiid = tCollection->getTriggerPhiIds();
87  pCollection.m_trigger_relbcid = tCollection->getTriggerRelBcids();
88  pCollection.m_bcid_rel = tCollection->getBcidRels();
89  pCollection.m_bcid_status = tCollection->getBcidStatuses();
90  pCollection.m_bcid_multzero = tCollection->getBcidMultZeros();
91  pCollection.m_bcid_multiplicity = tCollection->getBcidMultiplicities();
92  persistentObj->m_collections.push_back(std::move(pCollection));
93  }
94 }
95 
96 } // namespace Muon
IdentifiableContainerMT::addCollection
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
Definition: IdentifiableContainerMT.h:300
Muon::NSW_PadTriggerData_p1::m_sourceid
uint32_t m_sourceid
Definition: NSW_PadTriggerData_p1.h:10
Muon::NSW_PadTriggerDataContainer_p1
Definition: NSW_PadTriggerDataContainer_p1.h:10
Muon::NSW_PadTriggerDataContainer
Definition: NSW_PadTriggerDataContainer.h:15
Muon::NSW_PadTriggerData_p1
Definition: NSW_PadTriggerData_p1.h:8
IdentifiableContainerMT::size
size_t size() const
Duplicate of fullSize for backwards compatability.
Definition: IdentifiableContainerMT.h:209
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
IdentifiableContainerMT::numberOfCollections
virtual size_t numberOfCollections() const override final
return number of collections
Definition: IdentifiableContainerMT.h:216
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
NSW_PadTriggerDataContainerCnv_p1.h
Muon::NSW_PadTriggerData
Definition: NSW_PadTriggerData.h:12
Muon::NSW_PadTriggerDataContainerCnv_p1::persToTrans
void persToTrans(const NSW_PadTriggerDataContainer_p1 *persistentObj, NSW_PadTriggerDataContainer *transientObj, MsgStream &log) final
Definition: NSW_PadTriggerDataContainerCnv_p1.cxx:4
Muon::NSW_PadTriggerDataContainer_p1::m_collections
std::vector< NSW_PadTriggerData_p1 > m_collections
Definition: NSW_PadTriggerDataContainer_p1.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
Muon::NSW_PadTriggerDataContainerCnv_p1::transToPers
void transToPers(const NSW_PadTriggerDataContainer *transientObj, NSW_PadTriggerDataContainer_p1 *persistentObj, MsgStream &log) final
Definition: NSW_PadTriggerDataContainerCnv_p1.cxx:51