ATLAS Offline Software
NSW_TrigRawDataContainerCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 
7 namespace Muon
8 {
10  if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Creating transient NSW_TrigRawDataContainer from persistent with size " << persCont->size() << endmsg;
11  auto transCont = std::make_unique<Muon::NSW_TrigRawDataContainer>();
12  persToTrans(persCont, transCont.get(), log);
13  if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Created transient NSW_TrigRawDataContainer with " << transCont->size() << " entries" << endmsg;
14  return(transCont.release());
15  }
16 
18  if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converting persistent NSW_TrigRawDataContainer_p1 to transient NSW_TrigRawDataContainer" << endmsg;
19 
20  for (const auto &raw : *persCont) {
21  auto rawData = std::make_unique<NSW_TrigRawData>(raw.m_sectorId, raw.m_sectorSide, raw.m_bcId);
22  if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Created empty NSW_TrigRawData contaier, to be filled with " << raw.size() << " segments" << endmsg;
23  for (unsigned int i = 0; i < raw.size(); ++i) {
24  const NSW_TrigRawDataSegment_p1* persRawSegObj = &( raw[i] );
25  auto transObj = std::make_unique<NSW_TrigRawDataSegment>();
26  m_segmentCnv_p1.persToTrans(persRawSegObj, transObj.get(), log);
27  rawData->push_back(std::move(transObj));
28  }
29  transCont->push_back(std::move(rawData));
30  }
31  if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Created transient NSW_TrigRawDataContainer representation with " << transCont->size() << " entries" << endmsg;
32  }
33 
35  if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converting transient NSW_TrigRawDataContainer to persistent NSW_TrigRawDataContainer_p1" << endmsg;
36 
37  for (const auto *const raw : *transCont) {
38  auto persRawData = std::make_unique<NSW_TrigRawData_p1>();
39  persRawData->m_sectorId = raw->sectorId();
40  persRawData->m_sectorSide = raw->sectorSide();
41  persRawData->m_bcId = raw->bcId();
42  for (const auto *const segment : *raw) {
43  auto persRawSegm = std::make_unique<NSW_TrigRawDataSegment_p1>();
44  m_segmentCnv_p1.transToPers(segment, persRawSegm.get(), log);
45  persRawData->push_back(*persRawSegm);
46  }
47  persCont->push_back(*persRawData);
48  }
49  if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Created persistent NSW_TrigRawDataContainer representation with " << persCont->size() << " entries" << endmsg;
50  }
51 }
Muon::NSW_TrigRawDataSegment_p1
Definition: NSW_TrigRawDataSegment_p1.h:12
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::NSW_TrigRawDataSegmentCnv_p1::transToPers
virtual void transToPers(const NSW_TrigRawDataSegment *transObj, NSW_TrigRawDataSegment_p1 *persObj, MsgStream &log) override final
Definition: NSW_TrigRawDataSegmentCnv_p1.cxx:29
Muon::NSW_TrigRawDataContainerCnv_p1::persToTrans
virtual void persToTrans(const NSW_TrigRawDataContainer_p1 *persCont, NSW_TrigRawDataContainer *transCont, MsgStream &log) override final
Definition: NSW_TrigRawDataContainerCnv_p1.cxx:17
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
NSW_TrigRawDataContainerCnv_p1.h
Muon::NSW_TrigRawDataContainer_p1
Definition: NSW_TrigRawDataContainer_p1.h:12
Muon::NSW_TrigRawDataContainerCnv_p1::m_segmentCnv_p1
NSW_TrigRawDataSegmentCnv_p1 m_segmentCnv_p1
Definition: NSW_TrigRawDataContainerCnv_p1.h:24
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Muon::NSW_TrigRawDataContainerCnv_p1::transToPers
virtual void transToPers(const NSW_TrigRawDataContainer *transCont, NSW_TrigRawDataContainer_p1 *persCont, MsgStream &log) override final
Definition: NSW_TrigRawDataContainerCnv_p1.cxx:34
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Muon::NSW_TrigRawDataSegmentCnv_p1::persToTrans
virtual void persToTrans(const NSW_TrigRawDataSegment_p1 *persObj, NSW_TrigRawDataSegment *transObj, MsgStream &log) override final
Definition: NSW_TrigRawDataSegmentCnv_p1.cxx:16
Muon::NSW_TrigRawDataContainer
Definition: NSW_TrigRawDataContainer.h:14
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
Muon::NSW_TrigRawDataContainerCnv_p1::createTransient
virtual NSW_TrigRawDataContainer * createTransient(const NSW_TrigRawDataContainer_p1 *persCont, MsgStream &log) override final
Definition: NSW_TrigRawDataContainerCnv_p1.cxx:9
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5