diff --git a/Control/CalypsoExample/WaveformDataAccessExample/src/ScintWaveformAccess.cxx b/Control/CalypsoExample/WaveformDataAccessExample/src/ScintWaveformAccess.cxx index 4dc33c5f2fd664c5fd24536be48936d213139a43..d3de51d50d765ad4c3ffc4908ab0f426ef80e0ca 100644 --- a/Control/CalypsoExample/WaveformDataAccessExample/src/ScintWaveformAccess.cxx +++ b/Control/CalypsoExample/WaveformDataAccessExample/src/ScintWaveformAccess.cxx @@ -32,6 +32,7 @@ ScintWaveformAccess::initialize() ATH_CHECK( m_TriggerWaveformContainer.initialize() ); ATH_CHECK( m_PreshowerWaveformContainer.initialize() ); ATH_CHECK( m_TestWaveformContainer.initialize() ); + ATH_CHECK( m_ClockWaveformContainer.initialize() ); return StatusCode::SUCCESS; } @@ -70,5 +71,9 @@ ScintWaveformAccess::execute(const EventContext& ctx) const ATH_MSG_INFO("Found ReadHandle for TestWaveforms"); ATH_MSG_INFO(*testHandle); + SG::ReadHandle<ScintWaveformContainer> clockHandle(m_ClockWaveformContainer, ctx); + ATH_MSG_INFO("Found ReadHandle for ClockWaveforms"); + ATH_MSG_INFO(*clockHandle); + return StatusCode::SUCCESS; } diff --git a/Control/CalypsoExample/WaveformDataAccessExample/src/ScintWaveformAccess.h b/Control/CalypsoExample/WaveformDataAccessExample/src/ScintWaveformAccess.h index bea751f299e09ac1429ca006fc04adae34aee1d7..ac73b688d35cf9a793c6868027f5b0c62165abbd 100644 --- a/Control/CalypsoExample/WaveformDataAccessExample/src/ScintWaveformAccess.h +++ b/Control/CalypsoExample/WaveformDataAccessExample/src/ScintWaveformAccess.h @@ -40,6 +40,8 @@ class ScintWaveformAccess: public AthReentrantAlgorithm { this, "PreshowerWaveformContainerKey", "PreshowerWaveforms", "ReadHandleKey for PreshowerWaveforms Container"}; SG::ReadHandleKey<ScintWaveformContainer> m_TestWaveformContainer { this, "TestWaveformContainerKey", "TestWaveforms", "ReadHandleKey for TestWaveforms Container"}; + SG::ReadHandleKey<ScintWaveformContainer> m_ClockWaveformContainer + { this, "ClockWaveformContainerKey", "ClockWaveforms", "ReadHandleKey for ClockWaveforms Container"}; }; #endif /* WAVEFORMDATAACCESSEXAMPLE_SCINTWAVEFORMACCESS_H */ diff --git a/Event/FaserByteStreamCnvSvcBase/python/FaserByteStreamCnvSvcBaseConfig.py b/Event/FaserByteStreamCnvSvcBase/python/FaserByteStreamCnvSvcBaseConfig.py index 63c95b01433b36ded24757b3c8a9849adb92bec0..3346c0fd651ad315fa861f1455558fdfc1520868 100644 --- a/Event/FaserByteStreamCnvSvcBase/python/FaserByteStreamCnvSvcBaseConfig.py +++ b/Event/FaserByteStreamCnvSvcBase/python/FaserByteStreamCnvSvcBaseConfig.py @@ -17,6 +17,7 @@ def FaserByteStreamCnvSvcBaseCfg(flags, **kwargs): "ScintWaveformContainer/VetoWaveforms", "ScintWaveformContainer/TriggerWaveforms", "ScintWaveformContainer/PreshowerWaveforms", + "ScintWaveformContainer/ClockWaveforms", "ScintWaveformContainer/TestWaveforms" ] diff --git a/Scintillator/ScintEventCnv/ScintByteStream/src/ScintWaveformDecoderTool.cxx b/Scintillator/ScintEventCnv/ScintByteStream/src/ScintWaveformDecoderTool.cxx index 8cb9a344e7507332ad2ecad3db069c148e0a9bb8..de415ef295d11ca6ca9fec2724edfa231f852560 100644 --- a/Scintillator/ScintEventCnv/ScintByteStream/src/ScintWaveformDecoderTool.cxx +++ b/Scintillator/ScintEventCnv/ScintByteStream/src/ScintWaveformDecoderTool.cxx @@ -22,18 +22,31 @@ ScintWaveformDecoderTool::ScintWaveformDecoderTool(const std::string& type, 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(1); + 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(2); + 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(3); + m_preshowerChannels.push_back(12); + m_preshowerChannels.push_back(13); declareProperty("TestChannels", m_testChannels); - m_testChannels.push_back(4); + m_testChannels.push_back(14); + + declareProperty("ClockChannels", m_clockChannels); + m_clockChannels.push_back(15); } @@ -104,6 +117,8 @@ ScintWaveformDecoderTool::convert(const DAQFormats::EventFull* re, channelList = &m_preshowerChannels; } else if (key == std::string("TestWaveforms")) { channelList = &m_testChannels; + } else if (key == std::string("ClockWaveforms")) { + channelList = &m_clockChannels; } else { ATH_MSG_ERROR("Unknown key " << key); return StatusCode::FAILURE; diff --git a/Scintillator/ScintEventCnv/ScintByteStream/src/ScintWaveformDecoderTool.h b/Scintillator/ScintEventCnv/ScintByteStream/src/ScintWaveformDecoderTool.h index 0c43dc0264062e368c7551334fc204f4849bb6d9..a5e7bd98261d1e25809953f3ecfdfb33ae139ba3 100644 --- a/Scintillator/ScintEventCnv/ScintByteStream/src/ScintWaveformDecoderTool.h +++ b/Scintillator/ScintEventCnv/ScintByteStream/src/ScintWaveformDecoderTool.h @@ -37,6 +37,7 @@ private: std::vector<unsigned int> m_triggerChannels; std::vector<unsigned int> m_preshowerChannels; std::vector<unsigned int> m_testChannels; + std::vector<unsigned int> m_clockChannels; }; diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/CMakeLists.txt b/Scintillator/ScintEventCnv/ScintEventAthenaPool/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..b68ac1d6083e5a7a3599ad45ffcf30731e14ac97 --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/CMakeLists.txt @@ -0,0 +1,28 @@ +# $Id: CMakeLists.txt 749562 2016-05-25 04:45:43Z krasznaa $ +################################################################################ +# Package: ScintEventAthenaPool +################################################################################ + +# Declare the package name: +atlas_subdir( ScintEventAthenaPool ) + +# Component(s) in the package: +atlas_add_poolcnv_library( ScintEventAthenaPoolPoolCnv + ScintEventAthenaPool/*.h src/*.h src/*.cxx + FILES ScintRawEvent/ScintWaveform.h + ScintRawEvent/ScintWaveformContainer.h + LINK_LIBRARIES Identifier GeneratorObjectsTPCnv AthAllocators AthContainers + AthenaBaseComps AthenaKernel SGTools StoreGateLib AthenaPoolCnvSvcLib + AthenaPoolUtilities AtlasSealCLHEP GaudiKernel ScintRawEvent + ) + +atlas_add_dictionary( ScintEventAthenaPoolCnvDict + ScintEventAthenaPool/ScintEventAthenaPoolCnvDict.h + ScintEventAthenaPool/selection.xml + LINK_LIBRARIES Identifier GeneratorObjectsTPCnv ) + +# Install files from the package: +atlas_install_headers( ScintEventAthenaPool ) + + + diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/ScintEventAthenaPoolCnvDict.h b/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/ScintEventAthenaPoolCnvDict.h new file mode 100644 index 0000000000000000000000000000000000000000..ddf45c6476d7fc12ed80b0ff8ea5b96e5575ecc4 --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/ScintEventAthenaPoolCnvDict.h @@ -0,0 +1,11 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCINTEVENTATHENAPOOLCNVDICT_H +#define SCINTEVENTATHENAPOOLCNVDICT_H + +#include "ScintEventAthenaPool/ScintWaveform_p0.h" +#include "ScintEventAthenaPool/ScintWaveformContainer_p0.h" + +#endif diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/ScintWaveformContainer_p0.h b/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/ScintWaveformContainer_p0.h new file mode 100644 index 0000000000000000000000000000000000000000..1c7b327d1dd4b642e89a8a3b640766e969c956b8 --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/ScintWaveformContainer_p0.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2020 CERN for the benefit of the FASER collaboration +*/ + +#ifndef SCINTWAVEFORMCONTAINER_P0_H +#define SCINTWAVEFORMCONTAINER_P0_H + +// Persistent represenation of a ScintWaveformContainer. + +#include <vector> +#include "ScintEventAthenaPool/ScintWaveform_p0.h" + +class ScintWaveformContainer_p0 { + public: + ScintWaveformContainer_p0(); + friend class ScintWaveformContainerCnv_p0; + private: + bool m_board_fail_flag; + unsigned int m_board_id; + unsigned int m_pattern_trig_options; + unsigned int m_channel_mask; + unsigned int m_event_counter; + unsigned int m_trigger_time_tag; + unsigned int m_samples; + std::vector<ScintWaveform_p0> m_waveforms; +}; + +inline +ScintWaveformContainer_p0::ScintWaveformContainer_p0() : m_board_fail_flag(0), + m_board_id(0), + m_pattern_trig_options(0), + m_channel_mask(0), + m_event_counter(0), + m_trigger_time_tag(0), + m_samples(0) { + m_waveforms.clear(); +} + +#endif diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/ScintWaveform_p0.h b/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/ScintWaveform_p0.h new file mode 100644 index 0000000000000000000000000000000000000000..e91c8811f07753ca4330aa9d7a30a617f7dc5f86 --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/ScintWaveform_p0.h @@ -0,0 +1,43 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCINTWAVEFORM_P0_H +#define SCINTWAVEFORM_P0_H + +#include <vector> +#include <iostream> +#include <iomanip> + +class ScintWaveform_p0 { + public: + ScintWaveform_p0(); + +// List of Cnv classes that convert this into Rdo objects + friend class ScintWaveformCnv_p0; + + private: + unsigned int m_ID; + unsigned int m_channel; + std::vector<unsigned int> m_adc_counts; + + public: + void print() const { + std::cout << "Persistent Waveform data:" << std::endl + << std::setw(30) << " channel: "<<std::setfill(' ')<<std::setw(32)<<std::dec<<m_channel<<std::setfill(' ')<<std::endl + << std::setw(30) << " length: "<<std::setfill(' ')<<std::setw(32)<<std::dec<<m_adc_counts.size()<<std::setfill(' ')<<std::endl; + } +}; + +inline +ScintWaveform_p0::ScintWaveform_p0() : m_channel(0) { + m_adc_counts.clear(); +} + +// Stream operator for debugging +//std::ostream +//&operator<<(std::ostream &out, const ScintWaveform_p0 &wfm) { +// return wfm.print(out); +//} + +#endif diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/selection.xml b/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..5c52a4cc6e9f4dbc3c13448549729f939a12f1c3 --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/ScintEventAthenaPool/selection.xml @@ -0,0 +1,4 @@ +<lcgdict> + <class name="ScintWaveform_p0" /> + <class name="ScintWaveformContainer_p0" id="344d904d-6338-41f1-94ee-ea609ea4ae44" /> +</lcgdict> diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformCnv_p0.cxx b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformCnv_p0.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ffc6f0d8df91fe68a4433b33c4784d2238a7c555 --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformCnv_p0.cxx @@ -0,0 +1,36 @@ +/* + Copyright (C) 2020 CERN for the benefit of the FASER collaboration +*/ + +#include "ScintWaveformCnv_p0.h" + +void +ScintWaveformCnv_p0::persToTrans(const ScintWaveform_p0* persObj, ScintWaveform* transObj, MsgStream& log) { + + // Just fill available data here + // Rest of it patched up in ScintWaveformContainerCnv_p0 + transObj->setIdentifier(persObj->m_ID); + transObj->setChannel(persObj->m_channel); + transObj->setCounts(persObj->m_adc_counts); + +} + +void +ScintWaveformCnv_p0::transToPers(const ScintWaveform* transObj, ScintWaveform_p0* persObj, MsgStream& log) { + + // log << MSG::DEBUG << "ScintWaveformCnv_p0::transToPers called" << endmsg; + // log << MSG::DEBUG << "Transient waveform:" << endmsg; + // log << MSG::DEBUG << (*transObj) << endmsg; + // log << MSG::DEBUG << "Persistent waveform (before):" << endmsg; + // persObj->print(); + persObj->m_ID = transObj->identify(); + persObj->m_channel = transObj->channel(); + + // Use copy here + persObj->m_adc_counts = transObj->adc_counts(); + + // log << MSG::DEBUG << "Persistent waveform (after):" << endmsg; + // persObj->print(); + // log << MSG::DEBUG << "ScintWaveformCnv_p0::transToPers done" << endmsg; + +} diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformCnv_p0.h b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformCnv_p0.h new file mode 100644 index 0000000000000000000000000000000000000000..41bb1530d9623e528b1c50fa4a4e680580f86451 --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformCnv_p0.h @@ -0,0 +1,27 @@ +/* + Copyright (C) 2020 CERN for the benefit of the FASER collaboration +*/ + +#ifndef SCINTWAVEFORMCNV_P0_H +#define SCINTWAVEFORMCNV_P0_H + +#include "ScintRawEvent/ScintWaveform.h" +#include "ScintEventAthenaPool/ScintWaveform_p0.h" + +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +class ScintWaveformCnv_p0 : public T_AthenaPoolTPCnvBase<ScintWaveform, ScintWaveform_p0> { + public: + ScintWaveformCnv_p0() {}; + + virtual void persToTrans(const ScintWaveform_p0* persObj, + ScintWaveform* transObj, + MsgStream& log); + + virtual void transToPers(const ScintWaveform* transObj, + ScintWaveform_p0* persObj, + MsgStream& log); + private: +}; + +#endif diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv.cxx b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv.cxx new file mode 100644 index 0000000000000000000000000000000000000000..afea1cac3c2143502dff9f2810e0f245260088ba --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv.cxx @@ -0,0 +1,42 @@ +/* + Copyright (C) 2020 CERN for the benefit of the FASER collaboration +*/ + +#include "ScintWaveformContainerCnv.h" + +ScintWaveformContainer_PERS* +ScintWaveformContainerCnv::createPersistent (ScintWaveformContainer* transCont) { + ATH_MSG_DEBUG("ScintWaveformContainerCnv::createPersistent()"); + + ScintWaveformContainerCnv_PERS converter; + + ScintWaveformContainer_PERS* persObj(nullptr); + persObj = converter.createPersistent( transCont, msg() ); + return persObj; +} + +ScintWaveformContainer* +ScintWaveformContainerCnv::createTransient() { + ATH_MSG_DEBUG("ScintWaveformContainerCnv::createTransient()"); + + static const pool::Guid p0_guid("344d904d-6338-41f1-94ee-ea609ea4ae44"); + ScintWaveformContainer* trans(0); + + // Check for GUID of each persistent type + if ( compareClassGuid(p0_guid) ) { + std::unique_ptr< ScintWaveformContainer_p0 > col_vect( poolReadObject< ScintWaveformContainer_p0 >() ); + + ScintWaveformContainerCnv_p0 converter_p0; + trans = converter_p0.createTransient( col_vect.get(), msg() ); + + } else { + + // Didn't find a known type + throw std::runtime_error("Unsupported persistent version of ScintWaveformContainer"); + } + + return trans; + +} + + diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv.h b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv.h new file mode 100644 index 0000000000000000000000000000000000000000..c0160c8ef2df1cb0c5cb555d01cf0e819757e860 --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv.h @@ -0,0 +1,33 @@ +/* + Copyright 2020 CERN for the benefit of the FASER collaboration +*/ + +#ifndef SCINTWAVEFORMCONTAINERCNV_H +#define SCINTWAVEFORMCONTAINERCNV_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" + +#include "ScintWaveformContainerCnv_p0.h" + +#include "ScintRawEvent/ScintWaveformContainer.h" +#include "ScintEventAthenaPool/ScintWaveformContainer_p0.h" + +// The latest persistent representation +typedef ScintWaveformContainer_p0 ScintWaveformContainer_PERS; +typedef ScintWaveformContainerCnv_p0 ScintWaveformContainerCnv_PERS; + +typedef T_AthenaPoolCustomCnv< ScintWaveformContainer, ScintWaveformContainer_PERS > ScintWaveformContainerCnvBase; + +class ScintWaveformContainerCnv : public ScintWaveformContainerCnvBase { + friend class CnvFactory<ScintWaveformContainerCnv>; + + public: + ScintWaveformContainerCnv (ISvcLocator* svcloc) : ScintWaveformContainerCnvBase(svcloc) {} + + protected: + virtual ScintWaveformContainer_PERS* createPersistent (ScintWaveformContainer* transCont); + virtual ScintWaveformContainer* createTransient (); + +}; + +#endif diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv_p0.cxx b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv_p0.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4312a0303af9573365a6d5e1168a81c050168b8b --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv_p0.cxx @@ -0,0 +1,71 @@ +/* + Copyright (C) 2020 CERN for the benefit of the FASER collaboration +*/ + +#include "ScintWaveformContainerCnv_p0.h" +#include "ScintWaveformCnv_p0.h" + +void +ScintWaveformContainerCnv_p0::persToTrans(const ScintWaveformContainer_p0* persCont, ScintWaveformContainer* transCont, MsgStream& log) { + + log << MSG::DEBUG << "ScintWaveformContainerCnv_p0::persToTrans called" << endmsg; + + ScintWaveformCnv_p0 waveformCnv; + + // Clear this, transient container is DataVector, which stores pointers + // Create them below and push back to fill + transCont->clear(); + + for (unsigned int index = 0; index < persCont->m_waveforms.size(); ++index) { + std::unique_ptr<ScintWaveform> data = std::make_unique<ScintWaveform>(); + const ScintWaveform_p0* pdata = &persCont->m_waveforms.at(index); + waveformCnv.persToTrans(pdata, data.get(), log); + + // Fill other values held by container in persistent class + data->setBoardFailFlag(persCont->m_board_fail_flag); + data->setBoardId(persCont->m_board_id); + data->setPatternTrigOptions(persCont->m_pattern_trig_options); + data->setChannelMask(persCont->m_channel_mask); + data->setEventCounter(persCont->m_event_counter); + data->setTriggerTime(persCont->m_trigger_time_tag); + data->setSamples(persCont->m_samples); + + transCont->push_back(data.release()); + } +} + +void +ScintWaveformContainerCnv_p0::transToPers(const ScintWaveformContainer* transCont,ScintWaveformContainer_p0* persCont, MsgStream& log) { + + log << MSG::DEBUG << "ScintWaveformContainerCnv_p0::transToPers preparing " << transCont->size() << " waveforms" << endmsg; + + ScintWaveformCnv_p0 waveformCnv; + + typedef ScintWaveformContainer TRANS; + TRANS::const_iterator it_Cont = transCont->begin(); + TRANS::const_iterator it_ContEnd = transCont->end(); + + // Fill common information + const ScintWaveform* transObj = (*it_Cont); + persCont->m_board_fail_flag = transObj->board_fail_flag(); + persCont->m_board_id = transObj->board_id(); + persCont->m_pattern_trig_options = transObj->pattern_trig_options(); + persCont->m_channel_mask = transObj->channel_mask(); + persCont->m_event_counter = transObj->event_counter(); + persCont->m_trigger_time_tag = transObj->trigger_time_tag(); + persCont->m_samples = transObj->n_samples(); + + // Loop over each waveform and convert those as well + persCont->m_waveforms.resize(transCont->size()); + + for (int index=0; it_Cont != it_ContEnd; it_Cont++, index++) { + // Add new collection + log << MSG::DEBUG << "Converting waveform " << index << endmsg; + const ScintWaveform* data = (*it_Cont); + ScintWaveform_p0* pdata = &(persCont->m_waveforms.at(index)); + waveformCnv.transToPers(data, pdata, log); + } + + log << MSG::DEBUG << "ScintWaveformContainerCnv_p0::transToPers finished" << endmsg; + +} diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv_p0.h b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv_p0.h new file mode 100644 index 0000000000000000000000000000000000000000..6792e2a2ea96287baa8fdcc431cb3bfc2ac769dd --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainerCnv_p0.h @@ -0,0 +1,28 @@ +/* + Copyright 2020 CERN for the benefit of the FASER collaboration +*/ + +#ifndef SCINTWAVEFORMCONTAINERCNV_P0_H +#define SCINTWAVEFORMCONTAINERCNV_P0_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +#include "ScintRawEvent/ScintWaveformContainer.h" +#include "ScintEventAthenaPool/ScintWaveformContainer_p0.h" + +class ScintWaveformContainerCnv_p0 : public T_AthenaPoolTPCnvBase<ScintWaveformContainer, ScintWaveformContainer_p0> { + + public: + ScintWaveformContainerCnv_p0() {}; + + virtual void persToTrans(const ScintWaveformContainer_p0* persCont, + ScintWaveformContainer* transCont, + MsgStream& log); + + virtual void transToPers(const ScintWaveformContainer* transCont, + ScintWaveformContainer_p0* persCont, + MsgStream& log); + +}; + +#endif diff --git a/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainer_p0.cxx b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainer_p0.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7d047238e8abbcc64fc0b819cef1edfd2f5d9406 --- /dev/null +++ b/Scintillator/ScintEventCnv/ScintEventAthenaPool/src/ScintWaveformContainer_p0.cxx @@ -0,0 +1 @@ +// Dummy source file so that cmake can find this diff --git a/Scintillator/ScintRawEvent/ScintRawEvent/ScintWaveform.h b/Scintillator/ScintRawEvent/ScintRawEvent/ScintWaveform.h index 0c211be6cc16c190c70311d88771b7b5d3c44c7d..c7598d4464abe81f202a30b1534962370f591262 100644 --- a/Scintillator/ScintRawEvent/ScintRawEvent/ScintWaveform.h +++ b/Scintillator/ScintRawEvent/ScintRawEvent/ScintWaveform.h @@ -73,6 +73,17 @@ public: void setHeader (const DigitizerDataFragment* frag); void setWaveform (unsigned int channel, const std::vector<uint16_t> waveform); + // Set functions for P->T conversion + void setBoardId(unsigned int id) {m_board_id = id;} + void setBoardFailFlag(bool flag) {m_board_fail_flag = flag;} + void setPatternTrigOptions(unsigned int pattern) {m_pattern_trig_options = pattern;} + void setChannelMask(unsigned int mask) {m_channel_mask = mask;} + void setEventCounter(unsigned int counter) {m_event_counter = counter;} + void setTriggerTime(unsigned int tag) {m_trigger_time_tag = tag;} + void setChannel(unsigned int chan) {m_channel = chan;} + void setSamples(unsigned int samp) {m_samples = samp;} + void setCounts(const std::vector<unsigned int>& counts) {m_adc_counts = counts;} + /////////////////////////////////////////////////////////////////// // Private data: ///////////////////////////////////////////////////////////////////