diff --git a/Waveform/WaveEventCnv/WaveByteStream/src/RawWaveformDecoderTool.cxx b/Waveform/WaveEventCnv/WaveByteStream/src/RawWaveformDecoderTool.cxx index ec7a6641e3df94a8ac0b3b989e5c99303e3b62d7..2081244c434b40e789bf268284a7b56b13a89929 100644 --- a/Waveform/WaveEventCnv/WaveByteStream/src/RawWaveformDecoderTool.cxx +++ b/Waveform/WaveEventCnv/WaveByteStream/src/RawWaveformDecoderTool.cxx @@ -20,16 +20,31 @@ RawWaveformDecoderTool::RawWaveformDecoderTool(const std::string& type, { declareInterface<RawWaveformDecoderTool>(this); - // These must be configured by job options declareProperty("CaloChannels", m_caloChannels); + m_caloChannels.push_back(0); + m_caloChannels.push_back(1); + m_caloChannels.push_back(2); + m_caloChannels.push_back(3); + declareProperty("VetoChannels", m_vetoChannels); + m_vetoChannels.push_back(4); + m_vetoChannels.push_back(5); + m_vetoChannels.push_back(6); + m_vetoChannels.push_back(7); + declareProperty("TriggerChannels", m_triggerChannels); + m_triggerChannels.push_back(8); + m_triggerChannels.push_back(9); + m_triggerChannels.push_back(10); + m_triggerChannels.push_back(11); + declareProperty("PreshowerChannels", m_preshowerChannels); + m_preshowerChannels.push_back(12); + m_preshowerChannels.push_back(13); - // Test channels is provided for conveniene, not normally used declareProperty("TestChannels", m_testChannels); + m_testChannels.push_back(14); - // Clock should always be in channel 15 declareProperty("ClockChannels", m_clockChannels); m_clockChannels.push_back(15); @@ -43,82 +58,6 @@ StatusCode RawWaveformDecoderTool::initialize() { ATH_MSG_DEBUG("RawWaveformDecoderTool::initialize()"); - - // Set up helpers - ATH_CHECK(detStore()->retrieve(m_ecalID, "EcalID")); - ATH_CHECK(detStore()->retrieve(m_vetoID, "VetoID")); - ATH_CHECK(detStore()->retrieve(m_triggerID, "TriggerID")); - ATH_CHECK(detStore()->retrieve(m_preshowerID, "PreshowerID")); - - // Take each channel list and create identifiers - - // Loop through digitizer channel lists creating Identifiers - m_identifierMap.clear(); - - // First, calorimeter. Can either be 4 or 6 channels - // Bottom row first from left to right, then top row - int index=0; - int module=0; - int row=0; - int pmt=0; - - int max_modules = m_caloChannels.size() / 2; - for (auto const& chan : m_caloChannels) { - row = index / max_modules; - module = index % max_modules; - index++; - // Only store in map if digitizer channel is valid - if (chan < 0) continue; - m_identifierMap[chan] = m_ecalID->pmt_id(row, module, pmt); - ATH_MSG_DEBUG("Mapped digitizer channel " << chan << " to calo ID: " << m_identifierMap[chan]); - } - - // Next, veto detector. Have station and plate here. - int station=0; - int plate=0; - pmt=0; - index=0; - - int max_stations=m_vetoChannels.size() / 2; - for (auto const& chan : m_vetoChannels) { - station = index / max_stations; - plate = index % max_stations; - index++; - // Only store in map if digitizer channel is valid - if (chan < 0) continue; - m_identifierMap[chan] = m_vetoID->pmt_id(station, plate, pmt); - ATH_MSG_DEBUG("Mapped digitizer channel " << chan << " to veto ID: " << m_identifierMap[chan]); - } - - // Next, trigger detector. Have pmt and plate. - pmt=0; - station=0; - index=0; - int max_plates=m_triggerChannels.size() / 2; - for (auto const& chan : m_triggerChannels) { - plate = index / max_plates; - pmt = index % max_plates; - index++; - // Only store in map if digitizer channel is valid - if (chan < 0) continue; - m_identifierMap[chan] = m_triggerID->pmt_id(station, plate, pmt); - ATH_MSG_DEBUG("Mapped dititizer channel " << chan << " to trigger ID: " << m_identifierMap[chan]); - } - - // Finally, preshower detector. - pmt=0; - station=0; - plate=0; - index=0; - for (auto const& chan : m_preshowerChannels) { - plate = index; - index++; - // Only store in map if digitizer channel is valid - if (chan < 0) continue; - m_identifierMap[chan] = m_preshowerID->pmt_id(station, plate, pmt); - ATH_MSG_DEBUG("Mapped digitizer channel " << chan << " to preshower ID: " << m_identifierMap[chan]); - } - return StatusCode::SUCCESS; } @@ -172,7 +111,7 @@ RawWaveformDecoderTool::convert(const DAQFormats::EventFull* re, ATH_MSG_DEBUG("Found valid digitizer fragment"); } - std::vector<int>* channelList; + std::vector<unsigned int>* channelList; if (key == std::string("CaloWaveforms")) { channelList = &m_caloChannels; @@ -191,7 +130,7 @@ RawWaveformDecoderTool::convert(const DAQFormats::EventFull* re, return StatusCode::FAILURE; } - for (int channel: *channelList) { + for (unsigned int channel: *channelList) { ATH_MSG_DEBUG("Converting channel "+std::to_string(channel)+" for "+key); // Check if this has data @@ -222,11 +161,6 @@ RawWaveformDecoderTool::convert(const DAQFormats::EventFull* re, << *frag); } - // Set ID if one exists (clock, for instance, doesn't have an identifier) - if (m_identifierMap.count(channel) == 1) { - wfm->setIdentifier(m_identifierMap[channel]); - } - container->push_back(wfm); // Sanity check diff --git a/Waveform/WaveEventCnv/WaveByteStream/src/RawWaveformDecoderTool.h b/Waveform/WaveEventCnv/WaveByteStream/src/RawWaveformDecoderTool.h index e2852f13772113d8e52a62c9655a18365cb80f61..252698c5fb975370945883d112a72c21ef7798a2 100644 --- a/Waveform/WaveEventCnv/WaveByteStream/src/RawWaveformDecoderTool.h +++ b/Waveform/WaveEventCnv/WaveByteStream/src/RawWaveformDecoderTool.h @@ -13,12 +13,6 @@ #include "EventFormats/DAQFormats.hpp" #include "WaveRawEvent/RawWaveformContainer.h" -#include "Identifier/Identifier.h" -#include "FaserCaloIdentifier/EcalID.h" -#include "ScintIdentifier/VetoID.h" -#include "ScintIdentifier/TriggerID.h" -#include "ScintIdentifier/PreshowerID.h" - // This class provides conversion between bytestream and Waveform objects class RawWaveformDecoderTool : public AthAlgTool { @@ -38,48 +32,13 @@ class RawWaveformDecoderTool : public AthAlgTool { private: // List of channels to include in each container - // List order must correspond to offline channel order - // All L/R designations refer to looking at the detector from - // the beam direction. - // - // In general, the ordering is layer (longitudinal), row (vertical), module (horizontal) - // Layers increase with longitudianl position downstream - // Rows increase from bottom to top - // Modules increase from right to left - // - // For all lists, use invalid channel (-1) to indicate detectors - // missing in sequence (i.e. 3 of 4 veto counters) - // - // TI12 detector: - // Calorimeter order: - // bottom right, bottom left, top right, top left - // Veto - // front to back. - // Trigger - // bottom right PMT, bottom left PMT, top right PMT, top left PMT - // Preshower - // front to back - // - // 2021 Testbeam detector: - // Calo order: - // bottom right, bottom center, bottom left, top R, top C, top L - // All others are just in order front to back - - std::vector<int> m_caloChannels; - std::vector<int> m_vetoChannels; - std::vector<int> m_triggerChannels; - std::vector<int> m_preshowerChannels; - std::vector<int> m_testChannels; - std::vector<int> m_clockChannels; - - // Identifiers keyed by digitizer channel - std::map<unsigned int, Identifier> m_identifierMap; + std::vector<unsigned int> m_caloChannels; + std::vector<unsigned int> m_vetoChannels; + std::vector<unsigned int> m_triggerChannels; + std::vector<unsigned int> m_preshowerChannels; + std::vector<unsigned int> m_testChannels; + std::vector<unsigned int> m_clockChannels; - // ID helpers - const EcalID* m_ecalID{nullptr}; - const VetoID* m_vetoID{nullptr}; - const TriggerID* m_triggerID{nullptr}; - const PreshowerID* m_preshowerID{nullptr}; }; diff --git a/Waveform/WaveEventCnv/WaveEventAthenaPool/src/RawWaveformCnv_p0.cxx b/Waveform/WaveEventCnv/WaveEventAthenaPool/src/RawWaveformCnv_p0.cxx index dedc71cbac77ccbdfa48dff63013cc6c16ab97f8..d298c0ff390393b6b8822bcc43167eee7c89ee9d 100644 --- a/Waveform/WaveEventCnv/WaveEventAthenaPool/src/RawWaveformCnv_p0.cxx +++ b/Waveform/WaveEventCnv/WaveEventAthenaPool/src/RawWaveformCnv_p0.cxx @@ -9,8 +9,7 @@ RawWaveformCnv_p0::persToTrans(const RawWaveform_p0* persObj, RawWaveform* trans // Just fill available data here // Rest of it patched up in RawWaveformContainerCnv_p0 - // Persistent object stores ID value, so instantiate Identifier here - transObj->setIdentifier(Identifier32(persObj->m_ID)); + transObj->setIdentifier(persObj->m_ID); transObj->setChannel(persObj->m_channel); transObj->setCounts(persObj->m_adc_counts); @@ -24,9 +23,7 @@ RawWaveformCnv_p0::transToPers(const RawWaveform* transObj, RawWaveform_p0* pers // log << MSG::DEBUG << (*transObj) << endmsg; // log << MSG::DEBUG << "Persistent waveform (before):" << endmsg; // persObj->print(); - - // Save actual ID number - persObj->m_ID = transObj->identify32().get_compact(); + persObj->m_ID = transObj->identify(); persObj->m_channel = transObj->channel(); // Use copy here