File indexing completed on 2024-04-06 12:21:35
0001 #ifndef L1RCTLutWriter_h
0002 #define L1RCTLutWriter_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include <memory>
0025
0026 #include <fstream>
0027 #include <iostream>
0028
0029
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
0054
0055
0056
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
0073
0074 L1RCTLookupTables *lookupTable_;
0075 const L1RCTParameters *rctParameters_;
0076
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