Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:53:50

0001 /* -*- C++ -*- */
0002 #ifndef HcalTBSource_h_included
0003 #define HcalTBSource_h_included 1
0004 
0005 #include <map>
0006 #include <string>
0007 #include <vector>
0008 
0009 #include "FWCore/Framework/interface/Event.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 #include "FWCore/Sources/interface/ProducerSourceFromFiles.h"
0012 
0013 class TFile;
0014 class TTree;
0015 class CDFChunk;
0016 class CDFEventInfo;
0017 
0018 /** \class HcalTBSource
0019    \note Notice that there is a hack to renumber events from runs where the first event number was zero.
0020 */
0021 class HcalTBSource : public edm::ProducerSourceFromFiles {
0022 public:
0023   explicit HcalTBSource(const edm::ParameterSet& pset, edm::InputSourceDescription const& desc);
0024   ~HcalTBSource() override;
0025 
0026 private:
0027   bool setRunAndEventInfo(edm::EventID& id, edm::TimeValue_t& time, edm::EventAuxiliary::ExperimentType&) override;
0028   void produce(edm::Event& e) override;
0029   void unpackSetup(const std::vector<std::string>& params);
0030   void openFile(const std::string& filename);
0031   TTree* m_tree;
0032   TFile* m_file;
0033   int m_i, m_fileCounter;
0034   bool m_quiet, m_onlyRemapped;
0035   int n_chunks;
0036   static const int CHUNK_COUNT = 64;  // MAX Chunks
0037   CDFChunk* m_chunks[CHUNK_COUNT];
0038   int m_chunkIds[CHUNK_COUNT];
0039   std::map<std::string, int> m_sourceIdRemap;
0040   CDFEventInfo* m_eventInfo;
0041   int m_eventNumberOffset, m_skip;
0042 };
0043 
0044 #endif  // HcalTBSource_h_included