Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1RCTLutWriter_h
0002 #define L1RCTLutWriter_h
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    L1RCTLutWriter
0007 // Class:      L1RCTLutWriter
0008 //
0009 /**\class L1RCTLutWriter L1RCTLutWriter.cc L1RCTLutWriter.h
0010  L1Trigger/L1RCTLutWriter/src/L1RCTLutWriter.cc
0011 
0012  Description: <one line class summary>
0013 
0014  Implementation:
0015      <Notes on implementation>
0016 */
0017 //
0018 // Original Author:  jleonard
0019 //         Created:  Fri Apr 11 16:27:07 CEST 2008
0020 //
0021 //
0022 
0023 // system include files
0024 #include <memory>
0025 
0026 #include <fstream>
0027 #include <iostream>
0028 
0029 // user include files
0030 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0031 #include "FWCore/Framework/interface/Frameworkfwd.h"
0032 
0033 #include "FWCore/Framework/interface/Event.h"
0034 #include "FWCore/Framework/interface/MakerMacros.h"
0035 #include "FWCore/Utilities/interface/ESGetToken.h"
0036 
0037 #include "FWCore/Framework/interface/ESHandle.h"    // why doesn't mkedanlzr
0038 #include "FWCore/Framework/interface/EventSetup.h"  // add these??
0039 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0040 #include "CondFormats/DataRecord/interface/L1RCTParametersRcd.h"
0041 #include "CondFormats/L1TObjects/interface/L1RCTParameters.h"
0042 #include "CondFormats/DataRecord/interface/L1CaloEcalScaleRcd.h"
0043 #include "CondFormats/DataRecord/interface/L1CaloHcalScaleRcd.h"
0044 #include "CondFormats/L1TObjects/interface/L1CaloEcalScale.h"
0045 #include "CondFormats/L1TObjects/interface/L1CaloHcalScale.h"
0046 #include "CalibFormats/CaloTPG/interface/CaloTPGRecord.h"
0047 #include "CalibFormats/CaloTPG/interface/CaloTPGTranscoder.h"
0048 #include "CondFormats/DataRecord/interface/L1EmEtScaleRcd.h"
0049 #include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
0050 #include "CalibCalorimetry/EcalTPGTools/interface/EcalTPGScale.h"
0051 class L1RCTLookupTables;
0052 class L1RCTParameters;
0053 // class L1RCTChannelMask;
0054 
0055 //
0056 // class declaration
0057 //
0058 
0059 class L1RCTLutWriter : public edm::one::EDAnalyzer<> {
0060 public:
0061   explicit L1RCTLutWriter(const edm::ParameterSet &);
0062   ~L1RCTLutWriter() override;
0063 
0064 private:
0065   void analyze(const edm::Event &, const edm::EventSetup &) override;
0066   void endJob() override;
0067   void writeRcLutFile(unsigned short card);
0068   void writeEicLutFile(unsigned short card);
0069   void writeJscLutFile();
0070   void writeThresholdsFile(unsigned int eicThreshold, unsigned int jscThresholdBarrel, unsigned int jscThresholdEndcap);
0071 
0072   // ----------member data ---------------------------
0073 
0074   L1RCTLookupTables *lookupTable_;
0075   const L1RCTParameters *rctParameters_;
0076   // const L1RCTChannelMask* channelMask_;
0077   std::ofstream lutFile_;
0078   std::string keyName_;
0079   edm::ESGetToken<L1RCTParameters, L1RCTParametersRcd> rctParametersToken_;
0080   edm::ESGetToken<L1CaloEtScale, L1EmEtScaleRcd> emScaleToken_;
0081   edm::ESGetToken<CaloTPGTranscoder, CaloTPGRecord> transcoderToken_;
0082   edm::ESGetToken<L1CaloHcalScale, L1CaloHcalScaleRcd> hcalScaleToken_;
0083   edm::ESGetToken<L1CaloEcalScale, L1CaloEcalScaleRcd> ecalScaleToken_;
0084   bool useDebugTpgScales_;
0085   EcalTPGScale::Tokens tokens_;
0086 };
0087 #endif