diff --git a/Waveform/WaveRecAlgs/CMakeLists.txt b/Waveform/WaveRecAlgs/CMakeLists.txt index c72671bf705ace3ad1935034564982a3b60a94a2..a982b17cf28379f5c6a5d4208bc6134efc042994 100644 --- a/Waveform/WaveRecAlgs/CMakeLists.txt +++ b/Waveform/WaveRecAlgs/CMakeLists.txt @@ -9,7 +9,7 @@ atlas_subdir( WaveRecAlgs ) atlas_add_component( WaveRecAlgs src/*.cxx src/*.h src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps StoreGateLib WaveRawEvent xAODFaserWaveform WaveRecToolsLib ) + LINK_LIBRARIES AthenaBaseComps StoreGateLib WaveRawEvent xAODFaserWaveform WaveRecToolsLib ScintSimEvent FaserCaloSimEvent) atlas_install_python_modules( python/*.py ) diff --git a/Waveform/WaveRecAlgs/python/WaveRecAlgsConfig.py b/Waveform/WaveRecAlgs/python/WaveRecAlgsConfig.py index 0c2d5ffc6c5d7cfff88cc74cf8d4b35f5f635ef8..0960aa0093c80f409e2c9db9813231e9b4c41f68 100644 --- a/Waveform/WaveRecAlgs/python/WaveRecAlgsConfig.py +++ b/Waveform/WaveRecAlgs/python/WaveRecAlgsConfig.py @@ -11,10 +11,18 @@ WaveformReconstructionTool = CompFactory.WaveformReconstructionTool ClockReconstructionTool = CompFactory.ClockReconstructionTool # One stop shopping for normal FASER data -def WaveformReconstructionCfg(flags): +def WaveformReconstructionCfg(flags, naive = False): """ Return all algorithms and tools for Waveform reconstruction """ acc = ComponentAccumulator() + if flags.Input.isMC and naive: + if not "TB" in flags.GeoModel.FaserVersion: + acc.merge(PseudoScintHitToWaveformRecCfg(flags, "PseudoVetoHitToWaveformRecAlg", "Veto")) + acc.merge(PseudoScintHitToWaveformRecCfg(flags, "PseudoTimingHitWaveformRecAlg", "Trigger")) + acc.merge(PseudoScintHitToWaveformRecCfg(flags, "PseudoPresehowerHitWaveformRecAlg", "Preshower")) + acc.merge(PseudoCaloHitToWaveformRecCfg(flags, "PseudoCaloHitWaveformRecAlg")) + return acc + acc.merge(WaveformClockRecCfg(flags, "ClockRecAlg")) acc.merge(WaveformHitRecCfg(flags, "VetoWaveformRecAlg", "Veto")) @@ -68,3 +76,41 @@ def WaveformReconstructionOutputCfg(flags, **kwargs): # ostream = acc.getEventAlgo("OutputStreamRDO") # ostream.TakeItemsFromInput = True # Don't know what this does return acc + +# Return configured "reconstruction" algorithm from scint SIM hits +# Specify data source (Veto, Trigger, Preshower) +def PseudoScintHitToWaveformRecCfg(flags, name="PseudoScintHitToWaveformRecAlg", source="", **kwargs): + + acc = ComponentAccumulator() + + tool = CompFactory.PseudoSimToWaveformRecTool(name=source+"PseudoSimToWaveformRecTool", **kwargs) + + kwargs.setdefault("ScintHitContainerKey", source+"Hits") + kwargs.setdefault("WaveformHitContainerKey", source+"WaveformHits") + kwargs.setdefault("PseudoSimToWaveformRecTool", tool) + + + recoAlg = CompFactory.PseudoScintHitToWaveformRecAlg(name, **kwargs) + recoAlg.PseudoSimToWaveformRecTool = tool + + acc.addEventAlgo(recoAlg) + + return acc + +# Return configured "reconstruction" algorithm from calo SIM hits +def PseudoCaloHitToWaveformRecCfg(flags, name="PseudoCaloHitToWaveformRecAlg", **kwargs): + + acc = ComponentAccumulator() + + tool = CompFactory.PseudoSimToWaveformRecTool(name="CaloPseudoSimToWaveformRecTool", **kwargs) + + kwargs.setdefault("CaloHitContainerKey", "EcalHits") + kwargs.setdefault("WaveformHitContainerKey", "CaloWaveformHits") + kwargs.setdefault("PseudoSimToWaveformRecTool", tool) + + recoAlg = CompFactory.PseudoCaloHitToWaveformRecAlg(name, **kwargs) + recoAlg.PseudoSimToWaveformRecTool = tool + + acc.addEventAlgo(recoAlg) + + return acc diff --git a/Waveform/WaveRecAlgs/share/PseudoSimToWaveformRecExample_jobOptions.py b/Waveform/WaveRecAlgs/share/PseudoSimToWaveformRecExample_jobOptions.py new file mode 100644 index 0000000000000000000000000000000000000000..bdfae43cfc3920eea95470937845cdc9de1bf60c --- /dev/null +++ b/Waveform/WaveRecAlgs/share/PseudoSimToWaveformRecExample_jobOptions.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python + +import sys + +if __name__ == "__main__": + + fileroot = "SimToRec" + naive = True + + from AthenaCommon.Logging import log, logging + from AthenaCommon.Constants import DEBUG, VERBOSE, INFO + from CalypsoConfiguration.AllConfigFlags import ConfigFlags + from AthenaCommon.Configurable import Configurable + + Configurable.configurableRun3Behavior = True + + log.setLevel(INFO) + + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion + ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" # Use MC conditions for now + ConfigFlags.Input.ProjectName = "mc21" # Needed to bypass autoconfig + ConfigFlags.Input.isMC = True # Needed to bypass autoconfig + ConfigFlags.GeoModel.FaserVersion = "FASER-TB00" # FASER geometry + ConfigFlags.Common.isOnline = False + ConfigFlags.GeoModel.Align.Dynamic = False + + ConfigFlags.Input.Files = [ + "/bundle/data/FASER/LC_output/BatchOutput/TestBeam/TB.Elec.8.r5.e100.SIM.root" + ] + + + ConfigFlags.addFlag("Output.xAODFileName", f"{fileroot}.xAOD.root") + ConfigFlags.Output.ESDFileName = f"{fileroot}.ESD.root" + + ConfigFlags.lock() + + from CalypsoConfiguration.MainServicesConfig import MainServicesCfg + + acc = MainServicesCfg(ConfigFlags) + + from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg + from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg + + acc.merge(PoolReadCfg(ConfigFlags)) + acc.merge(PoolWriteCfg(ConfigFlags)) + + from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg + itemList = [ + "xAOD::EventInfo#*", + "xAOD::WaveformHitContainer#*", + "xAOD::WaveformHitAuxContainer#*", + ] + + acc.merge(OutputStreamCfg(ConfigFlags, "xAOD", itemList, disableEventTag=True)) + + from WaveRecAlgs.WaveRecAlgsConfig import WaveformReconstructionCfg + acc.merge(WaveformReconstructionCfg(ConfigFlags, naive)) + + #acc.foreach_component("*").OutputLevel = VERBOSE + + # Execute and finish + sc = acc.run(maxEvents=1000) + + # Success should be 0 + sys.exit(not sc.isSuccess()) diff --git a/Waveform/WaveRecAlgs/src/PseudoCaloHitToWaveformRecAlg.cxx b/Waveform/WaveRecAlgs/src/PseudoCaloHitToWaveformRecAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5ead65452727c36307d8b4c038812ca9c3683f47 --- /dev/null +++ b/Waveform/WaveRecAlgs/src/PseudoCaloHitToWaveformRecAlg.cxx @@ -0,0 +1,68 @@ +#include "PseudoCaloHitToWaveformRecAlg.h" + +PseudoCaloHitToWaveformRecAlg::PseudoCaloHitToWaveformRecAlg(const std::string& name, + ISvcLocator* pSvcLocator) + : AthReentrantAlgorithm(name, pSvcLocator) { + +} + +StatusCode +PseudoCaloHitToWaveformRecAlg::initialize() { + ATH_MSG_INFO(name() << "::initalize()" ); + + // Initalize tools + ATH_CHECK( m_recoTool.retrieve() ); + + // Set key to read waveform from + ATH_CHECK( m_caloHitContainerKey.initialize() ); + + // Set key to write container + ATH_CHECK( m_waveformHitContainerKey.initialize() ); + + return StatusCode::SUCCESS; +} + +StatusCode +PseudoCaloHitToWaveformRecAlg::finalize() { + ATH_MSG_INFO(name() << "::finalize()"); + + return StatusCode::SUCCESS; +} + +StatusCode +PseudoCaloHitToWaveformRecAlg::execute(const EventContext& ctx) const { + ATH_MSG_DEBUG("Executing"); + + ATH_MSG_DEBUG("Run: " << ctx.eventID().run_number() + << " Event: " << ctx.eventID().event_number()); + + // Find the input HIT collection + SG::ReadHandle<CaloHitCollection> caloHitHandle(m_caloHitContainerKey, ctx); + + ATH_CHECK( caloHitHandle.isValid() ); + ATH_MSG_DEBUG("Found ReadHandle for CaloHitCollection " << m_caloHitContainerKey); + + if (caloHitHandle->size() == 0) { + ATH_MSG_DEBUG("CaloHitCollection found with zero length!"); + return StatusCode::SUCCESS; + } + + + // Find the output waveform container + SG::WriteHandle<xAOD::WaveformHitContainer> waveformHitContainerHandle(m_waveformHitContainerKey, ctx); + ATH_CHECK( waveformHitContainerHandle.record( std::make_unique<xAOD::WaveformHitContainer>(), + std::make_unique<xAOD::WaveformHitAuxContainer>() ) ); + + ATH_MSG_DEBUG("WaveformsHitContainer '" << waveformHitContainerHandle.name() << "' initialized"); + + + // "Reconstruct" the hits + CHECK( m_recoTool->reconstruct<CaloHitCollection>(caloHitHandle.ptr(), + waveformHitContainerHandle.ptr()) ); + + + ATH_MSG_DEBUG("WaveformsHitContainer '" << waveformHitContainerHandle.name() << "' filled with "<< waveformHitContainerHandle->size() <<" items"); + + return StatusCode::SUCCESS; +} + diff --git a/Waveform/WaveRecAlgs/src/PseudoCaloHitToWaveformRecAlg.h b/Waveform/WaveRecAlgs/src/PseudoCaloHitToWaveformRecAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..df8b4f2005aca4cb75e679580df72bfab037dd2a --- /dev/null +++ b/Waveform/WaveRecAlgs/src/PseudoCaloHitToWaveformRecAlg.h @@ -0,0 +1,75 @@ +#ifndef WAVERECALGS_PSEUDOCALOHITTOWAVEFORMRECALG_H +#define WAVERECALGS_PSEUDOCALOHITTOWAVEFORMRECALG_H + +// Base class +#include "AthenaBaseComps/AthReentrantAlgorithm.h" + +// Data classes +#include "FaserCaloSimEvent/CaloHitCollection.h" + +#include "xAODFaserWaveform/WaveformHit.h" +#include "xAODFaserWaveform/WaveformHitContainer.h" +#include "xAODFaserWaveform/WaveformHitAuxContainer.h" + +// Tool classes +#include "WaveRecTools/IPseudoSimToWaveformRecTool.h" + +// Handles +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" + +// Gaudi +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ToolHandle.h" + +// STL +#include <string> + +class PseudoCaloHitToWaveformRecAlg : public AthReentrantAlgorithm { + + public: + // Constructor + PseudoCaloHitToWaveformRecAlg(const std::string& name, ISvcLocator* pSvcLocator); + virtual ~PseudoCaloHitToWaveformRecAlg() = default; + + /** @name Usual algorithm methods */ + //@{ + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext& ctx) const override; + virtual StatusCode finalize() override; + //@} + + private: + + /** @name Disallow default instantiation, copy, assignment */ + //@{ + PseudoCaloHitToWaveformRecAlg() = delete; + PseudoCaloHitToWaveformRecAlg(const PseudoCaloHitToWaveformRecAlg&) = delete; + PseudoCaloHitToWaveformRecAlg &operator=(const PseudoCaloHitToWaveformRecAlg&) = delete; + //@} + + /** + * @name Reconstruction tool + */ + ToolHandle<IPseudoSimToWaveformRecTool> m_recoTool + {this, "PseudoSimToWaveformRecTool", "PseudoSimToWaveformRecTool"}; + + /** + * @name Input simulated HITS using SG::ReadHandleKey + */ + //@{ + SG::ReadHandleKey<CaloHitCollection> m_caloHitContainerKey + {this, "CaloHitContainerKey", ""}; + //@} + + /** + * @name Output data using SG::WriteHandleKey + */ + //@{ + SG::WriteHandleKey<xAOD::WaveformHitContainer> m_waveformHitContainerKey + {this, "WaveformHitContainerKey", ""}; + //@} + +}; + +#endif // WAVERECALGS_PSEUDOCALOHITTOWAVEFORMRECALG_H diff --git a/Waveform/WaveRecAlgs/src/PseudoScintHitToWaveformRecAlg.cxx b/Waveform/WaveRecAlgs/src/PseudoScintHitToWaveformRecAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2b896e63c8a67b845072b74489ffe5a39b162751 --- /dev/null +++ b/Waveform/WaveRecAlgs/src/PseudoScintHitToWaveformRecAlg.cxx @@ -0,0 +1,68 @@ +#include "PseudoScintHitToWaveformRecAlg.h" + +PseudoScintHitToWaveformRecAlg::PseudoScintHitToWaveformRecAlg(const std::string& name, + ISvcLocator* pSvcLocator) + : AthReentrantAlgorithm(name, pSvcLocator) { + +} + +StatusCode +PseudoScintHitToWaveformRecAlg::initialize() { + ATH_MSG_INFO(name() << "::initalize()" ); + + // Initalize tools + ATH_CHECK( m_recoTool.retrieve() ); + + // Set key to read waveform from + ATH_CHECK( m_scintHitContainerKey.initialize() ); + + // Set key to write container + ATH_CHECK( m_waveformHitContainerKey.initialize() ); + + return StatusCode::SUCCESS; +} + +StatusCode +PseudoScintHitToWaveformRecAlg::finalize() { + ATH_MSG_INFO(name() << "::finalize()"); + + return StatusCode::SUCCESS; +} + +StatusCode +PseudoScintHitToWaveformRecAlg::execute(const EventContext& ctx) const { + ATH_MSG_DEBUG("Executing"); + + ATH_MSG_DEBUG("Run: " << ctx.eventID().run_number() + << " Event: " << ctx.eventID().event_number()); + + // Find the input HIT collection + SG::ReadHandle<ScintHitCollection> scintHitHandle(m_scintHitContainerKey, ctx); + + ATH_CHECK( scintHitHandle.isValid() ); + ATH_MSG_DEBUG("Found ReadHandle for ScintHitCollection " << m_scintHitContainerKey); + + if (scintHitHandle->size() == 0) { + ATH_MSG_DEBUG("ScintHitCollection found with zero length!"); + return StatusCode::SUCCESS; + } + + + // Find the output waveform container + SG::WriteHandle<xAOD::WaveformHitContainer> waveformHitContainerHandle(m_waveformHitContainerKey, ctx); + ATH_CHECK( waveformHitContainerHandle.record( std::make_unique<xAOD::WaveformHitContainer>(), + std::make_unique<xAOD::WaveformHitAuxContainer>() ) ); + + ATH_MSG_DEBUG("WaveformsHitContainer '" << waveformHitContainerHandle.name() << "' initialized"); + + + // "Reconstruct" the hits + CHECK( m_recoTool->reconstruct<ScintHitCollection>(scintHitHandle.ptr(), + waveformHitContainerHandle.ptr()) ); + + + ATH_MSG_DEBUG("WaveformsHitContainer '" << waveformHitContainerHandle.name() << "' filled with "<< waveformHitContainerHandle->size() <<" items"); + + return StatusCode::SUCCESS; +} + diff --git a/Waveform/WaveRecAlgs/src/PseudoScintHitToWaveformRecAlg.h b/Waveform/WaveRecAlgs/src/PseudoScintHitToWaveformRecAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..741c291c92913fa7e16732e1891e6ce90a016c98 --- /dev/null +++ b/Waveform/WaveRecAlgs/src/PseudoScintHitToWaveformRecAlg.h @@ -0,0 +1,75 @@ +#ifndef WAVERECALGS_PSEUDOSCINTHITTOWAVEFORMRECALG_H +#define WAVERECALGS_PSEUDOSCINTHITTOWAVEFORMRECALG_H + +// Base class +#include "AthenaBaseComps/AthReentrantAlgorithm.h" + +// Data classes +#include "ScintSimEvent/ScintHitCollection.h" + +#include "xAODFaserWaveform/WaveformHit.h" +#include "xAODFaserWaveform/WaveformHitContainer.h" +#include "xAODFaserWaveform/WaveformHitAuxContainer.h" + +// Tool classes +#include "WaveRecTools/IPseudoSimToWaveformRecTool.h" + +// Handles +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" + +// Gaudi +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ToolHandle.h" + +// STL +#include <string> + +class PseudoScintHitToWaveformRecAlg : public AthReentrantAlgorithm { + + public: + // Constructor + PseudoScintHitToWaveformRecAlg(const std::string& name, ISvcLocator* pSvcLocator); + virtual ~PseudoScintHitToWaveformRecAlg() = default; + + /** @name Usual algorithm methods */ + //@{ + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext& ctx) const override; + virtual StatusCode finalize() override; + //@} + + private: + + /** @name Disallow default instantiation, copy, assignment */ + //@{ + PseudoScintHitToWaveformRecAlg() = delete; + PseudoScintHitToWaveformRecAlg(const PseudoScintHitToWaveformRecAlg&) = delete; + PseudoScintHitToWaveformRecAlg &operator=(const PseudoScintHitToWaveformRecAlg&) = delete; + //@} + + /** + * @name Reconstruction tool + */ + ToolHandle<IPseudoSimToWaveformRecTool> m_recoTool + {this, "PseudoSimToWaveformRecTool", "PseudoSimToWaveformRecTool"}; + + /** + * @name Input simulated HITS using SG::ReadHandleKey + */ + //@{ + SG::ReadHandleKey<ScintHitCollection> m_scintHitContainerKey + {this, "ScintHitContainerKey", ""}; + //@} + + /** + * @name Output data using SG::WriteHandleKey + */ + //@{ + SG::WriteHandleKey<xAOD::WaveformHitContainer> m_waveformHitContainerKey + {this, "WaveformHitContainerKey", ""}; + //@} + +}; + +#endif // WAVERECALGS_PSEUDOSCINTHITTOWAVEFORMRECALG_H diff --git a/Waveform/WaveRecAlgs/src/components/WaveRecAlgs_entries.cxx b/Waveform/WaveRecAlgs/src/components/WaveRecAlgs_entries.cxx index 21f97520a8e2da1093b5b4f929143cff32fd83a9..46d7f8980ad87690bc2a6eed5fd2de15a04a30dd 100644 --- a/Waveform/WaveRecAlgs/src/components/WaveRecAlgs_entries.cxx +++ b/Waveform/WaveRecAlgs/src/components/WaveRecAlgs_entries.cxx @@ -1,5 +1,9 @@ #include "../RawWaveformRecAlg.h" #include "../WaveClockRecAlg.h" +#include "../PseudoScintHitToWaveformRecAlg.h" +#include "../PseudoCaloHitToWaveformRecAlg.h" DECLARE_COMPONENT( RawWaveformRecAlg ) DECLARE_COMPONENT( WaveClockRecAlg ) +DECLARE_COMPONENT( PseudoScintHitToWaveformRecAlg ) +DECLARE_COMPONENT( PseudoCaloHitToWaveformRecAlg ) diff --git a/Waveform/WaveRecTools/WaveRecTools/IPseudoSimToWaveformRecTool.h b/Waveform/WaveRecTools/WaveRecTools/IPseudoSimToWaveformRecTool.h new file mode 100644 index 0000000000000000000000000000000000000000..6ba6e4eacdb8288a5f3667b02c3823aeaeb54d7e --- /dev/null +++ b/Waveform/WaveRecTools/WaveRecTools/IPseudoSimToWaveformRecTool.h @@ -0,0 +1,53 @@ +/* + Copyright (C) 2021 CERN for the benefit of the FASER collaboration +*/ + +/** + * @file IPseudoSimToWaveformRecTool.h + * Header file for the IPseudoSimToWaveformRecTool class + * @author Carl Gwilliam, 2021 + */ + + +#ifndef WAVERECTOOLS_IPSEUDOSIMTOWAVEFORMRECTOOL_H +#define WAVERECTOOLS_IPSEUDOSIMTOWAVEFORMRECTOOL_H + +// Base class +#include "GaudiKernel/IAlgTool.h" +#include "GaudiKernel/ToolHandle.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/IMessageSvc.h" +#include "GaudiKernel/MsgStream.h" + +#include "xAODFaserWaveform/WaveformHitContainer.h" +#include "xAODFaserWaveform/WaveformHit.h" + +///Interface for Pseudo waveform rec tools +class IPseudoSimToWaveformRecTool : virtual public IAlgTool +{ +public: + + // InterfaceID + DeclareInterfaceID(IPseudoSimToWaveformRecTool, 1, 0); + + IPseudoSimToWaveformRecTool(): + m_msgSvc ( "MessageSvc", "ITrkEventCnvTool" ) + {} + + virtual ~IPseudoSimToWaveformRecTool() = default; + + // Convert sim hit energies to pseudo-waveform + template<class CONT> + StatusCode reconstruct(const CONT* hitCollection, + xAOD::WaveformHitContainer* waveContainer) const; + +private: + ServiceHandle<IMessageSvc> m_msgSvc; + +}; + +#include "WaveRecTools/IPseudoSimToWaveformRecTool.icc" + + +#endif // SCINTRECTOOLS_IPSEUDOSIMTOWAVEFORMRECTOOL_H diff --git a/Waveform/WaveRecTools/WaveRecTools/IPseudoSimToWaveformRecTool.icc b/Waveform/WaveRecTools/WaveRecTools/IPseudoSimToWaveformRecTool.icc new file mode 100644 index 0000000000000000000000000000000000000000..9bcbd86c09ad0992032e123f0cd01281e7271e18 --- /dev/null +++ b/Waveform/WaveRecTools/WaveRecTools/IPseudoSimToWaveformRecTool.icc @@ -0,0 +1,35 @@ +template<class CONT> +StatusCode IPseudoSimToWaveformRecTool::reconstruct(const CONT* hitCollection, + xAOD::WaveformHitContainer* container) const { + + + // Check the container + if (!container) { + MsgStream log(&(*m_msgSvc), name()); + log << MSG::ERROR << "HitCollection passed to reconstruct() is null!" << endmsg; + return StatusCode::FAILURE; + } + + std::map<int, float> idSums; + + // Sum hits in each "channel" + for (const auto& hit : *hitCollection) { + idSums[hit.identify()] += hit.energyLoss(); + } + + for (const auto& id : idSums) { + xAOD::WaveformHit* hit = new xAOD::WaveformHit(); + container->push_back(hit); + + hit->set_channel(id.first); + hit->set_peak(0); + hit->set_mean(0); + hit->set_width(0); + hit->set_integral(id.second); // This should be updated to set the ID when exists + hit->set_localtime(0); + hit->set_raw_peak(0); + hit->set_raw_integral(0); + } + + return StatusCode::SUCCESS; +} diff --git a/Waveform/WaveRecTools/src/PseudoSimToWaveformRecTool.cxx b/Waveform/WaveRecTools/src/PseudoSimToWaveformRecTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6d894aeb64125274507105bd71ce37c7ad2bed31 --- /dev/null +++ b/Waveform/WaveRecTools/src/PseudoSimToWaveformRecTool.cxx @@ -0,0 +1,38 @@ +/* + Copyright (C) 2021 CERN for the benefit of the FASER collaboration +*/ + +/** + * @file PseudoSimToWaveformRec.cxx + * Implementation file for the PseudoSimToWaveformRec class + * @ author E. Torrence, 2021 + **/ + +#include "PseudoSimToWaveformRecTool.h" + +#include "xAODFaserWaveform/WaveformHit.h" + +#include "TH1F.h" +#include "TF1.h" +#include "TFitResult.h" +#include "TFitResultPtr.h" +#include "TGraph.h" + +#include <vector> +#include <tuple> +#include <math.h> + +// Constructor +PseudoSimToWaveformRecTool::PseudoSimToWaveformRecTool(const std::string& type, const std::string& name, const IInterface* parent) : + base_class(type, name, parent) +{ +} + +// Initialization +StatusCode +PseudoSimToWaveformRecTool::initialize() { + ATH_MSG_INFO( name() << "::initalize()" ); + return StatusCode::SUCCESS; +} + + diff --git a/Waveform/WaveRecTools/src/PseudoSimToWaveformRecTool.h b/Waveform/WaveRecTools/src/PseudoSimToWaveformRecTool.h new file mode 100644 index 0000000000000000000000000000000000000000..f3376f6ec4aa93becef3da8fc52c19d003d6dced --- /dev/null +++ b/Waveform/WaveRecTools/src/PseudoSimToWaveformRecTool.h @@ -0,0 +1,36 @@ +/* + Copyright (C) 2021 CERN for the benefit of the FASER collaboration +*/ + +/** @file PseduoSimToWaveformRecTool.h + * Header file for PseudoSimToWaveformRecTool.h + * + */ +#ifndef WAVERECTOOLS_PSEUDOSIMTOWAVEFORMRECTOOL_H +#define WAVERECTOOLS_PSEUDOSIMTOWAVEFORMRECTOOL_H + +//Athena +#include "AthenaBaseComps/AthAlgTool.h" +#include "WaveRecTools/IPseudoSimToWaveformRecTool.h" + +//Gaudi +#include "GaudiKernel/ToolHandle.h" + +//STL + +class PseudoSimToWaveformRecTool: public extends<AthAlgTool, IPseudoSimToWaveformRecTool> { + public: + + /// Normal constructor for an AlgTool; 'properties' are also declared here + PseudoSimToWaveformRecTool(const std::string& type, + const std::string& name, const IInterface* parent); + + /// Retrieve the necessary services in initialize + StatusCode initialize(); + + private: + // None + +}; + +#endif // WAVERECTOOLS_PSEUDOSIMTOWAVEFORMRECTOOL_H diff --git a/Waveform/WaveRecTools/src/components/WaveRecTools_entries.cxx b/Waveform/WaveRecTools/src/components/WaveRecTools_entries.cxx index a96a42c9b5e4a0007558650314ef6e1144281877..d801b8a121d49472a72c875389d778ccfb175b60 100644 --- a/Waveform/WaveRecTools/src/components/WaveRecTools_entries.cxx +++ b/Waveform/WaveRecTools/src/components/WaveRecTools_entries.cxx @@ -1,5 +1,7 @@ #include "../ClockReconstructionTool.h" #include "../WaveformReconstructionTool.h" +#include "../PseudoSimToWaveformRecTool.h" DECLARE_COMPONENT( ClockReconstructionTool ) DECLARE_COMPONENT( WaveformReconstructionTool ) +DECLARE_COMPONENT( PseudoSimToWaveformRecTool )