CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloTPGTranscoderULUTs.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CaloTPGTranscoderULUTs
4 // Class: CaloTPGTranscoderULUTs
5 //
13 //
14 // Original Author: Jeremiah Mans
15 // Created: Fri Sep 15 11:49:44 CDT 2006
16 //
17 //
18 
19 
20 // system include files
21 #include <memory>
22 
23 // user include files
24 
28 
33 
34 
35 //
36 // class decleration
37 //
38 
41 public:
44 
45  typedef std::auto_ptr<CaloTPGTranscoder> ReturnType;
46 
48 
49  void setIntervalFor(const edm::eventsetup::EventSetupRecordKey& iKey, const edm::IOVSyncValue& iTime, edm::ValidityInterval& oInterval ) override {
51  }
52 private:
53  // ----------member data ---------------------------
58  std::vector<int> ietal;
59  std::vector<int> ietah;
60  std::vector<int> ZS;
61  std::vector<int> LUTfactor;
62  double nominal_gain;
63  double RCTLSB;
64 };
65 
66 //
67 // constants, enums and typedefs
68 //
69 
70 //
71 // static data member definitions
72 //
73 
74 //
75 // constructors and destructor
76 //
78  hfilename1_(iConfig.getParameter<edm::FileInPath>("hcalLUT1")),
79  hfilename2_(iConfig.getParameter<edm::FileInPath>("hcalLUT2"))
80 {
81  //the following line is needed to tell the framework what
82  // data is being produced
83  setWhatProduced(this);
84  findingRecord<CaloTPGRecord>();
85 
86  //now do what ever other initialization is needed
87  read_Ascii_Compression = false;
88  read_Ascii_RCT = false;
89  read_Ascii_Compression=iConfig.getParameter<bool>("read_Ascii_Compression_LUTs");
90  read_Ascii_RCT=iConfig.getParameter<bool>("read_Ascii_RCT_LUTs");
91 
92  ietal = iConfig.getParameter< std::vector<int> >("ietaLowerBound");
93  ietah = iConfig.getParameter< std::vector<int> >("ietaUpperBound");
94  ZS = iConfig.getParameter< std::vector<int> >("ZS");
95  LUTfactor = iConfig.getParameter< std::vector<int> >("LUTfactor");
96  nominal_gain = iConfig.getParameter<double>("nominal_gain");
97  RCTLSB = iConfig.getParameter<double>("RCTLSB");
98 
99 }
100 
101 
103 {
104 
105  // do anything here that needs to be done at desctruction time
106  // (e.g. close files, deallocate resources etc.)
107 
108 }
109 
110 
111 //
112 // member functions
113 //
114 
115 // ------------ method called to produce the data ------------
118 {
119  using namespace edm::es;
120  std::string file1="";
121  std::string file2="";
123  edm::LogInfo("Level1") << "Using " << hfilename1_.fullPath() << " & " << hfilename2_.fullPath()
124  << " for CaloTPGTranscoderULUTs HCAL initialization";
125  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(hfilename1_.fullPath(), hfilename2_.fullPath()));
126  //return pTCoder;
128  file2 = hfilename2_.fullPath();
129  } else if (read_Ascii_RCT && !read_Ascii_Compression) {
130  edm::LogInfo("Level1") << "Using analytical compression and " << hfilename2_.fullPath()
131  << " RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
132  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT("", hfilename2_.fullPath()));
133  //return pTCoder;
134  file2 = hfilename2_.fullPath();
135  } else if (read_Ascii_Compression && !read_Ascii_RCT) {
136  edm::LogInfo("Level1") << "Using ASCII compression tables " << hfilename1_.fullPath()
137  << " and automatic RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
138  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(hfilename1_.fullPath(),""));
139  //return pTCoder;
141  } else {
142  edm::LogInfo("Level1") << "Using analytical compression and RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
143  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT());
144  //return pTCoder;
145  }
146  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(ietal, ietah, ZS, LUTfactor, RCTLSB, nominal_gain, file1, file2));
147  std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(file1, file2));
148  return pTCoder;
149 }
150 
151 //define this as a plug-in
T getParameter(std::string const &) const
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &iKey, const edm::IOVSyncValue &iTime, edm::ValidityInterval &oInterval) override
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
CaloTPGTranscoderULUTs(const edm::ParameterSet &)
static const IOVSyncValue & beginOfTime()
ReturnType produce(const CaloTPGRecord &)
std::auto_ptr< CaloTPGTranscoder > ReturnType
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:92
std::string fullPath() const
Definition: FileInPath.cc:171