Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef IORAWDATA_HCALTBINPUTSERVICE_HCALTBWRITER_H
0002 #define IORAWDATA_HCALTBINPUTSERVICE_HCALTBWRITER_H 1
0003 
0004 #include <map>
0005 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0006 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0007 #include "FWCore/Framework/interface/Event.h"
0008 #include "FWCore/Framework/interface/EventSetup.h"
0009 #include "DataFormats/Common/interface/Handle.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 #include "FWCore/ServiceRegistry/interface/Service.h"
0012 #include "FWCore/Utilities/interface/InputTag.h"
0013 #include "IORawData/HcalTBInputService/src/CDFRunInfo.h"
0014 
0015 class TFile;
0016 class TTree;
0017 class CDFChunk;
0018 class CDFEventInfo;
0019 
0020 /** \class HcalTBWriter
0021   *  
0022   * Writes HCAL-style ROOT files from the RawData block
0023   *
0024   * \author J. Mans - Minnesota
0025   */
0026 class HcalTBWriter : public edm::one::EDAnalyzer<> {
0027 public:
0028   explicit HcalTBWriter(const edm::ParameterSet& pset);
0029   ~HcalTBWriter() override = default;
0030   void analyze(const edm::Event& e, const edm::EventSetup& es) override;
0031   void endJob() override;
0032 
0033 private:
0034   std::string namePattern_;
0035   // chunk naming...
0036   std::map<int, std::string> blockToName_;
0037   void extractEventInfo(const FEDRawDataCollection& raw, const edm::EventID& id);
0038   void buildTree(const FEDRawDataCollection& raw);
0039   TFile* file_;
0040   TTree* tree_;
0041   CDFEventInfo* eventInfo_;
0042   CDFRunInfo ri_;
0043   std::map<int, int> chunkMap_;
0044   CDFChunk* chunkList_[1024];
0045   int trigChunk_;
0046   edm::EDGetTokenT<FEDRawDataCollection> tok_raw_;
0047 };
0048 #endif