Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:35

0001 // -*- C++ -*-
0002 //
0003 // Package:    L1RCTSaveInput
0004 // Class:      L1RCTSaveInput
0005 //
0006 /**\class L1RCTSaveInput L1RCTSaveInput.cc
0007  src/L1RCTSaveInput/src/L1RCTSaveInput.cc
0008 
0009  Description: Saves the input event from TPGs for loading
0010               simulated events in hardware
0011 
0012  Implementation: Kind of kludgy -- should think of a better way in future
0013 
0014 */
0015 //
0016 // Original Author:  Sridhara Dasu
0017 //         Created:  Tue Jul 31 17:10:13 CEST 2007
0018 //
0019 //
0020 
0021 #include <fstream>
0022 #include <iostream>
0023 #include <memory>
0024 
0025 #include "DataFormats/Common/interface/Handle.h"
0026 
0027 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0028 #include "FWCore/Framework/interface/ESHandle.h"
0029 #include "FWCore/Framework/interface/Event.h"
0030 #include "FWCore/Framework/interface/EventSetup.h"
0031 #include "FWCore/Framework/interface/Frameworkfwd.h"
0032 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0033 #include "FWCore/Utilities/interface/ESGetToken.h"
0034 
0035 #include "FWCore/Framework/interface/MakerMacros.h"
0036 #include "CondFormats/DataRecord/interface/L1RCTChannelMaskRcd.h"
0037 #include "CondFormats/DataRecord/interface/L1RCTParametersRcd.h"
0038 #include "CondFormats/L1TObjects/interface/L1RCTChannelMask.h"
0039 #include "CondFormats/L1TObjects/interface/L1RCTParameters.h"
0040 #include "CondFormats/DataRecord/interface/L1CaloEcalScaleRcd.h"
0041 #include "CondFormats/DataRecord/interface/L1CaloHcalScaleRcd.h"
0042 #include "CondFormats/L1TObjects/interface/L1CaloEcalScale.h"
0043 #include "CondFormats/L1TObjects/interface/L1CaloHcalScale.h"
0044 #include "CalibFormats/CaloTPG/interface/CaloTPGRecord.h"
0045 #include "CalibFormats/CaloTPG/interface/CaloTPGTranscoder.h"
0046 #include "CondFormats/DataRecord/interface/L1EmEtScaleRcd.h"
0047 #include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
0048 #include "CalibCalorimetry/EcalTPGTools/interface/EcalTPGScale.h"
0049 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0050 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0051 
0052 class L1RCTLookupTables;
0053 class L1RCT;
0054 
0055 class L1RCTSaveInput : public edm::one::EDAnalyzer<> {
0056 public:
0057   explicit L1RCTSaveInput(const edm::ParameterSet &);
0058   ~L1RCTSaveInput() override;
0059   void analyze(const edm::Event &, const edm::EventSetup &) override;
0060 
0061 private:
0062   std::string fileName;
0063   L1RCTLookupTables *rctLookupTables;
0064   L1RCT *rct;
0065   bool useEcal;
0066   bool useHcal;
0067   edm::EDGetTokenT<EcalTrigPrimDigiCollection> ecalDigisToken_;
0068   edm::EDGetTokenT<HcalTrigPrimDigiCollection> hcalDigisToken_;
0069   edm::ESGetToken<L1RCTParameters, L1RCTParametersRcd> rctParametersToken_;
0070   edm::ESGetToken<L1RCTChannelMask, L1RCTChannelMaskRcd> channelMaskToken_;
0071   edm::ESGetToken<L1CaloEtScale, L1EmEtScaleRcd> emScaleToken_;
0072   edm::ESGetToken<CaloTPGTranscoder, CaloTPGRecord> transcoderToken_;
0073   edm::ESGetToken<L1CaloHcalScale, L1CaloHcalScaleRcd> hcalScaleToken_;
0074   edm::ESGetToken<L1CaloEcalScale, L1CaloEcalScaleRcd> ecalScaleToken_;
0075   bool useDebugTpgScales;
0076   std::ofstream ofs;
0077   EcalTPGScale::Tokens tokens_;
0078 };