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 // $Id: CaloTPGTranscoderULUTs.cc,v 1.4 2009/06/23 23:28:48 tulika Exp $
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 
24 // user include files
25 
29 
34 
35 
36 //
37 // class decleration
38 //
39 
42 public:
45 
46  typedef std::auto_ptr<CaloTPGTranscoder> ReturnType;
47 
49 
52  }
53 private:
54  // ----------member data ---------------------------
59  std::vector<int> ietal;
60  std::vector<int> ietah;
61  std::vector<int> ZS;
62  std::vector<int> LUTfactor;
63  double nominal_gain;
64  double RCTLSB;
65 };
66 
67 //
68 // constants, enums and typedefs
69 //
70 
71 //
72 // static data member definitions
73 //
74 
75 //
76 // constructors and destructor
77 //
79  hfilename1_(iConfig.getParameter<edm::FileInPath>("hcalLUT1")),
80  hfilename2_(iConfig.getParameter<edm::FileInPath>("hcalLUT2"))
81 {
82  //the following line is needed to tell the framework what
83  // data is being produced
84  setWhatProduced(this);
85  findingRecord<CaloTPGRecord>();
86 
87  //now do what ever other initialization is needed
88  read_Ascii_Compression = false;
89  read_Ascii_RCT = false;
90  read_Ascii_Compression=iConfig.getParameter<bool>("read_Ascii_Compression_LUTs");
91  read_Ascii_RCT=iConfig.getParameter<bool>("read_Ascii_RCT_LUTs");
92 
93  ietal = iConfig.getParameter< std::vector<int> >("ietaLowerBound");
94  ietah = iConfig.getParameter< std::vector<int> >("ietaUpperBound");
95  ZS = iConfig.getParameter< std::vector<int> >("ZS");
96  LUTfactor = iConfig.getParameter< std::vector<int> >("LUTfactor");
97  nominal_gain = iConfig.getParameter<double>("nominal_gain");
98  RCTLSB = iConfig.getParameter<double>("RCTLSB");
99 
100 }
101 
102 
104 {
105 
106  // do anything here that needs to be done at desctruction time
107  // (e.g. close files, deallocate resources etc.)
108 
109 }
110 
111 
112 //
113 // member functions
114 //
115 
116 // ------------ method called to produce the data ------------
119 {
120  using namespace edm::es;
121  std::string file1="";
122  std::string file2="";
124  edm::LogInfo("Level1") << "Using " << hfilename1_.fullPath() << " & " << hfilename2_.fullPath()
125  << " for CaloTPGTranscoderULUTs HCAL initialization";
126  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(hfilename1_.fullPath(), hfilename2_.fullPath()));
127  //return pTCoder;
128  file1 = hfilename1_.fullPath();
129  file2 = hfilename2_.fullPath();
130  } else if (read_Ascii_RCT && !read_Ascii_Compression) {
131  edm::LogInfo("Level1") << "Using analytical compression and " << hfilename2_.fullPath()
132  << " RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
133  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT("", hfilename2_.fullPath()));
134  //return pTCoder;
135  file2 = hfilename2_.fullPath();
136  } else if (read_Ascii_Compression && !read_Ascii_RCT) {
137  edm::LogInfo("Level1") << "Using ASCII compression tables " << hfilename1_.fullPath()
138  << " and automatic RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
139  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(hfilename1_.fullPath(),""));
140  //return pTCoder;
141  file1 = hfilename1_.fullPath();
142  } else {
143  edm::LogInfo("Level1") << "Using analytical compression and RCT decompression for CaloTPGTranscoderULUTs HCAL initialization";
144  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT());
145  //return pTCoder;
146  }
147  //std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(ietal, ietah, ZS, LUTfactor, RCTLSB, nominal_gain, file1, file2));
148  std::auto_ptr<CaloTPGTranscoder> pTCoder(new CaloTPGTranscoderULUT(file1, file2));
149  return pTCoder;
150 }
151 
152 //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 setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
CaloTPGTranscoderULUTs(const edm::ParameterSet &)
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &iKey, const edm::IOVSyncValue &iTime, edm::ValidityInterval &oInterval)
static const IOVSyncValue & beginOfTime()
ReturnType produce(const CaloTPGRecord &)
std::auto_ptr< CaloTPGTranscoder > ReturnType
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:74
std::string fullPath() const
Definition: FileInPath.cc:170