/*! * @file SClipboard.h * @author Dan Saunders, on behalf of the SoLid collaboration. * @date 16 Feb 2016 */ #ifndef SClipboard_h_ #define SClipboard_h_ #include #include #include "containerHeaders.h" #include "SDetector/SDetector.h" #include "STools/STools.h" #include "SCondition.h" #include "TFile.h" #include "SRunStatus/SRunStatus.h" //! Object to share reconstruction objects between algorithms. /*! The clipboard keeps pointers to all saffron reconsructed objects for a * single cycle of data. Each algorithm has access to the clipboard. The clipboard * is cleared each cycle. Nb SDetector also has pointers to reconstruction objects, * ordered by channel, and these are also cleared every cycle. Each reconstruction * object also has a pointer to the set of channels forming it. */ class ISAlgorithm; class SClipboard { private: SDetector * m_detector; std::vector m_timeblocks; //! See waveforms() std::vector m_waveforms; //! See peaks() std::vector m_peaks; //! See events() std::vector m_events; //! See simEnDeps() std::vector m_simEnDeps; //! See cycle() long long m_cycle; //! See histosFile(); TFile * h_histosFile; //! See fileNames() std::vector m_inputDataFileNames; //! See rawBuffer() SRawBuffer * m_rawBuffer; //! See conditions() std::map m_conditions; //! See algos() std::map m_algos; //! See currentFileName() std::string m_currentFileName; public: SClipboard(SDetector *); ~SClipboard(); void clear(); void addTimeBlock(STimeBlock *); void sortWaveforms(); ISAlgorithm * algo(std::string); void printConditions(); // Setters and getters _______________________________________________________ //! Container for conditions data. std::map * conditions() {return &m_conditions;} std::map * cdns() {return &m_conditions;} //! Container for time blocks containing trigger records and waveforms std::vector * timeblocks() {return &m_timeblocks;}; //! Container for raw input data in online mode. SRawBuffer * rawBuffer() {return m_rawBuffer;} //! Container of SWaveforms. std::vector * waveforms() {return &m_waveforms;} //! Container of peaks. std::vector * peaks() {return &m_peaks;} //! Container of events. std::vector * events() {return &m_events;} //! Container of simEnDeps. std::vector * simEnDeps() {return &m_simEnDeps;} //! Current cycle number. See also setCycle long long cycle() {return m_cycle;} void setCycle(long long cycle) {m_cycle = cycle;} //! Pointer to the saffron histos file - set by SSaffron and setHistosFile. TFile * histosFile() {return h_histosFile;} void setHistosFile(TFile * f) {h_histosFile = f;} //! List of input files. See also addInputDataFileNames() std::vector * inputDataFileNames() {return &m_inputDataFileNames;} void addInputDataFileNames(std::string name) {m_inputDataFileNames.push_back(name);} //! Map of pointers to all SAlgorithms (indexed by the algo name). std::map * algos() {return &m_algos;} //! Current file name. std::string currentFileName() {return m_currentFileName;} void setCurrentFileName(std::string fName) {m_currentFileName = fName;} }; #endif /* SClipboard_h_ */