Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:30:30

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/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 
0050 class L1RCTLookupTables;
0051 class L1RCT;
0052 
0053 class L1RCTSaveInput : public edm::EDAnalyzer {
0054 public:
0055   explicit L1RCTSaveInput(const edm::ParameterSet &);
0056   ~L1RCTSaveInput() override;
0057   void analyze(const edm::Event &, const edm::EventSetup &) override;
0058 
0059 private:
0060   std::string fileName;
0061   L1RCTLookupTables *rctLookupTables;
0062   L1RCT *rct;
0063   bool useEcal;
0064   bool useHcal;
0065   edm::InputTag ecalDigisLabel;
0066   edm::InputTag hcalDigisLabel;
0067   edm::ESGetToken<L1RCTParameters, L1RCTParametersRcd> rctParametersToken_;
0068   edm::ESGetToken<L1RCTChannelMask, L1RCTChannelMaskRcd> channelMaskToken_;
0069   edm::ESGetToken<L1CaloEtScale, L1EmEtScaleRcd> emScaleToken_;
0070   edm::ESGetToken<CaloTPGTranscoder, CaloTPGRecord> transcoderToken_;
0071   edm::ESGetToken<L1CaloHcalScale, L1CaloHcalScaleRcd> hcalScaleToken_;
0072   edm::ESGetToken<L1CaloEcalScale, L1CaloEcalScaleRcd> ecalScaleToken_;
0073   bool useDebugTpgScales;
0074   std::ofstream ofs;
0075   EcalTPGScale::Tokens tokens_;
0076 };