Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:17:19

0001 
0002 // Copyright 2020, Jefferson Science Associates, LLC.
0003 // Subject to the terms in the LICENSE file found in the top-level directory.
0004 
0005 
0006 #ifndef _RootProcessor_h_
0007 #define _RootProcessor_h_
0008 
0009 #include <mutex>
0010 
0011 #include <JANA/JEventProcessor.h>
0012 
0013 #include <TFile.h>
0014 #include <TTree.h>
0015 
0016 using namespace std;
0017 
0018 //////////////////////////////////////////////////////////////////////////////////////////////////
0019 /// Brief class description.
0020 ///
0021 /// Detailed class description.
0022 //////////////////////////////////////////////////////////////////////////////////////////////////
0023 class RootProcessor : public JEventProcessor {
0024 
0025     public:
0026 
0027     RootProcessor();
0028     ~RootProcessor() override;
0029 
0030     void Init() override;
0031     void Process(const std::shared_ptr<const JEvent>& aEvent) override;
0032     void Finish() override;
0033 
0034     protected:
0035 
0036     private:
0037 
0038     // mutex objects
0039     mutex fillMutex;
0040 
0041     // root objects
0042     TString *outFileName{};
0043     TFile *outFile{};
0044     TTree *eventTree{}, *sampleTree{};
0045 
0046     // user defined data types
0047     // TODO: put these somewhere that make sense ('global' parameter?)
0048     static const uint numChans   = 80;
0049     static const uint numSamples = 1024;
0050 
0051     uint chan{}, event{}, nentries{};
0052     uint tdcSample{}, adcSample{};
0053 
0054     TBranch** adc_samples_chans;
0055     TBranch** tdc_samples_chans;
0056 
0057 };
0058 
0059 #endif // _RootProcessor_h_
0060