ATLAS Offline Software
Loading...
Searching...
No Matches
ZdcByteStreamRawData.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*
6 * ZdcByteStreamRawData.cxx
7 *
8 * Created on: Jun 29, 2009
9 * Author: leite
10 *
11 * Based on Athena Algorithm this class must provide 3 methods:
12 *
13 * ZdcByteStreamRawData::initialize (run once at run start)
14 * ZdcByteStreamRawData::execute (run for every event)
15 * ZdcByteStreamRawData::finalize (run one at run end)
16 *
17 * plus some helpers
18 */
19
20#include <utility>
21
22#include "GaudiKernel/ISvcLocator.h"
23#include "GaudiKernel/MsgStream.h"
24#include "GaudiKernel/StatusCode.h"
26
27#include "ZdcEvent/ZdcDigits.h"
29
32
33//==================================================================================================
34ZdcByteStreamRawData::ZdcByteStreamRawData(const std::string& name, ISvcLocator* pSvcLocator) :
35 AthAlgorithm(name, pSvcLocator)
36{
37}
38//==================================================================================================
39
40
41//==================================================================================================
42StatusCode ZdcByteStreamRawData::execute(const EventContext& /*ctx*/)
43{
44 if (!msgLvl(MSG::INFO)) return StatusCode::SUCCESS;
45 msg(MSG::INFO);
46
50
51 const ZdcDigitsCollection* ttCollection = nullptr;
52
53 msg(MSG::DEBUG) << "Looking for ZDC Digits Collection at " << m_ZdcDigitsCollectionLocation.value() << endmsg;
54 //std::cout << "Looking for ZDC Digits Collection at " << m_ZdcDigitsCollectionLocation << std::endl;
55 StatusCode sc = evtStore()->retrieve(ttCollection, m_ZdcDigitsCollectionLocation.value());
56 if (sc.isFailure() || !ttCollection || ttCollection->empty())
57 {
58 msg() << "No Zdc Digits found" << endmsg;
59 return StatusCode::SUCCESS;
60 }
61
62 return StatusCode::SUCCESS;
63}
64//==================================================================================================
65
66
67
68//==================================================================================================
69//FIXME There is no such thing like ZdcDigitsMap
71{
72 msg() << "Number of ZdcDigits = " << m_ZdcDigitsMap.size() << endmsg;
73// ZdcDigitsMap::const_iterator mapIter = m_ZdcDigitsMap.begin();
74// ZdcDigitsMap::const_iterator mapEnd = m_ZdcDigitsMap.end();
75}
76//==================================================================================================
77
78
79//==================================================================================================
80void ZdcByteStreamRawData::printVec(const std::vector<int>& vec) const
81{
82 std::vector<int>::const_iterator pos;
83 for (pos = vec.begin(); pos != vec.end(); ++pos)
84 {
85 if (pos != vec.begin()) msg() << ",";
86 msg() << *pos;
87 }
88 msg() << "/";
89}
90//==================================================================================================
91
92/* REMOVE
93
94 // Set up trigger tower map
95 void ZdcByteStreamRawData::setupZdcDigitsMap(const ZdcDigitsCollection* const ttCollection)
96 {
97 m_ZdcDigitsMap.clear();
98 ZdcDigitsCollection::const_iterator pos = ttCollection->begin();
99 ZdcDigitsCollection::const_iterator pose = ttCollection->end();
100 for (; pos != pose; ++pos) {
101 const ZdcDigits* const tt = *pos;
102 tt->get_ID();
103
104 //const unsigned int key = m_towerKey->ttKey(tt->phi(), tt->eta());
105 //m_ttMap.insert(std::make_pair(key, tt));
106 }
107 }
108 */
#define endmsg
std::vector< size_t > vec
static Double_t sc
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
ServiceHandle< StoreGateSvc > & evtStore()
bool msgLvl(const MSG::Level lvl) const
bool empty() const noexcept
Returns true if the collection is empty.
void printVec(const std::vector< int > &vec) const
Gaudi::Property< std::string > m_ZdcDigitsCollectionLocation
ZdcByteStreamRawData(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) override
Execute method.