40 #include <openssl/sha.h>
46 char tmp[SHA_DIGEST_LENGTH*2+1];
47 bzero(tmp,
sizeof(tmp));
49 if( !SHA1_Init( &ctx ) )
50 throw cms::Exception(
"L1TCaloParamsViewer::hash")<<
"SHA1 initialization error";
52 if( !SHA1_Update( &ctx, buf, len ) )
53 throw cms::Exception(
"L1TCaloParamsViewer::hash")<<
"SHA1 processing error";
55 unsigned char hash[SHA_DIGEST_LENGTH];
56 if( !SHA1_Final(hash, &ctx) )
57 throw cms::Exception(
"L1TCaloParamsViewer::hash")<<
"SHA1 finalization error";
60 for(
unsigned int i=0;
i<20;
i++)
61 ::sprintf(&tmp[
i*2],
"%02x", hash[i]);
78 cout<<endl<<
" Towers: "<<endl;
79 cout<<
" towerLsbH= "<<ptr1->towerLsbH()<<endl;
80 cout<<
" towerLsbE= "<<ptr1->towerLsbE()<<endl;
81 cout<<
" towerLsbSum= "<<ptr1->towerLsbSum()<<endl;
82 cout<<
" towerNBitsH= "<<ptr1->towerNBitsH()<<endl;
83 cout<<
" towerNBitsE= "<<ptr1->towerNBitsE()<<endl;
84 cout<<
" towerNBitsSum= "<<ptr1->towerNBitsSum()<<endl;
85 cout<<
" towerNBitsRatio= "<<ptr1->towerNBitsRatio()<<endl;
86 cout<<
" towerMaskE= "<<ptr1->towerMaskE()<<endl;
87 cout<<
" towerMaskH= "<<ptr1->towerMaskH()<<endl;
88 cout<<
" towerMaskSum= "<<ptr1->towerMaskSum()<<endl;
89 cout<<
" towerEncoding= "<<ptr1->doTowerEncoding()<<endl;
91 cout<<endl<<
" Regions: "<<endl;
92 cout<<
" regionLsb= "<<ptr1->regionLsb()<<endl;
93 cout<<
" regionPUSType= "<<ptr1->regionPUSType()<<endl;
94 cout<<
" regionPUSParams= ["<<ptr1->regionPUSParams().size()<<
"] ";
95 float pusParams[ptr1->regionPUSParams().size()];
97 for(
unsigned int i=0;
i<ptr1->regionPUSParams().size();
i++){
98 pusParams[
i] = ceil(2*ptr1->regionPUSParams()[
i]);
99 if( printPUSParams )
cout<<
" "<<ceil(2*pusParams[
i])<<endl;
102 if( ptr1->regionPUSParams().size() )
103 cout <<
hash(pusParams,
sizeof(
float)*ptr1->regionPUSParams().size()) << endl;
107 cout<<endl<<
" EG: "<<endl;
108 cout<<
" egLsb= "<<ptr1->egLsb()<<endl;
109 cout<<
" egSeedThreshold= "<<ptr1->egSeedThreshold()<<endl;
110 cout<<
" egNeighbourThreshold= "<<ptr1->egNeighbourThreshold()<<endl;
111 cout<<
" egHcalThreshold= "<<ptr1->egHcalThreshold()<<endl;
113 if( !ptr1->egTrimmingLUT()->empty() ){
114 cout<<
" egTrimmingLUT= ["<<ptr1->egTrimmingLUT()->maxSize()<<
"] "<<flush;
115 int egTrimming[ptr1->egTrimmingLUT()->maxSize()];
116 for(
unsigned int i=0;
i<ptr1->egTrimmingLUT()->maxSize();
i++) egTrimming[
i] = ptr1->egTrimmingLUT()->data(
i);
117 cout <<
hash( egTrimming,
sizeof(
int)*ptr1->egTrimmingLUT()->maxSize() ) << endl;
119 cout<<
" egTrimmingLUT= [0] "<<endl;
122 cout<<
" egMaxHcalEt= "<<ptr1->egMaxHcalEt()<<endl;
123 cout<<
" egMaxPtHOverE= "<<ptr1->egMaxPtHOverE()<<endl;
124 cout<<
" egMaxHcalEt= "<<ptr1->egMaxHcalEt()<<endl;
125 cout<<
" egMinPtJetIsolation= "<<ptr1->egMinPtJetIsolation()<<endl;
126 cout<<
" egMaxPtJetIsolation= "<<ptr1->egMaxPtJetIsolation()<<endl;
127 cout<<
" egMinPtHOverEIsolation= "<<ptr1->egMinPtHOverEIsolation()<<endl;
128 cout<<
" egMaxPtHOverEIsolation= "<<ptr1->egMaxPtHOverEIsolation()<<endl;
130 if( !ptr1->egMaxHOverELUT()->empty() ){
131 cout<<
" egMaxHOverELUT= ["<<ptr1->egMaxHOverELUT()->maxSize()<<
"] ";
132 int egMaxHOverE[ptr1->egMaxHOverELUT()->maxSize()];
133 for(
unsigned int i=0;
i<ptr1->egMaxHOverELUT()->maxSize();
i++) egMaxHOverE[
i] = ptr1->egMaxHOverELUT()->data(
i);
134 cout <<
hash( egMaxHOverE,
sizeof(
int)*ptr1->egMaxHOverELUT()->maxSize() ) << endl;
136 cout<<
" egMaxHOverELUT= [0]"<<endl;
139 if( !ptr1->egCompressShapesLUT()->empty() ){
140 cout<<
" egCompressShapesLUT= ["<<ptr1->egCompressShapesLUT()->maxSize()<<
"] ";
141 int egCompressShapes[ptr1->egCompressShapesLUT()->maxSize()];
142 for(
unsigned int i=0;
i<ptr1->egCompressShapesLUT()->maxSize();
i++) egCompressShapes[
i] = ptr1->egCompressShapesLUT()->data(
i);
143 cout <<
hash( egCompressShapes,
sizeof(
int)*ptr1->egCompressShapesLUT()->maxSize() ) << endl;
145 cout<<
" egCompressShapesLUT= [0]"<<endl;
150 if( !ptr1->egShapeIdLUT()->empty() ){
151 cout<<
" egShapeIdLUT= ["<<ptr1->egShapeIdLUT()->maxSize()<<
"] "<<flush;
152 int egShapeId[ptr1->egShapeIdLUT()->maxSize()];
153 for(
unsigned int i=0;
i<ptr1->egShapeIdLUT()->maxSize();
i++) egShapeId[
i] = ptr1->egShapeIdLUT()->data(
i);
154 cout <<
hash( egShapeId,
sizeof(
int)*ptr1->egShapeIdLUT()->maxSize() )<<endl;
156 cout<<
" egShapeIdLUT= [0]"<<endl;
159 cout<<
" egPUSType= "<<ptr1->egPUSType()<<endl;
161 if( !ptr1->egIsolationLUT()->empty() ){
162 cout<<
" egIsoLUT= ["<<ptr1->egIsolationLUT()->maxSize()<<
"] "<<flush;
163 int egIsolation[ptr1->egIsolationLUT()->maxSize()];
164 for(
unsigned int i=0;
i<ptr1->egIsolationLUT()->maxSize();
i++) egIsolation[
i] = ptr1->egIsolationLUT()->data(
i);
165 cout <<
hash( egIsolation,
sizeof(
int)*ptr1->egIsolationLUT()->maxSize() ) << endl;
167 for(
unsigned int i=0;
i<ptr1->egIsolationLUT()->maxSize();
i++)
168 cout<<
i<<
" " << egIsolation[
i]<<endl;
170 cout<<
" egIsoLUT= [0]"<<endl;
173 cout<<
" egIsoAreaNrTowersEta= "<<ptr1->egIsoAreaNrTowersEta()<<endl;
174 cout<<
" egIsoAreaNrTowersPhi= "<<ptr1->egIsoAreaNrTowersPhi()<<endl;
175 cout<<
" egIsoVetoNrTowersPhi= "<<ptr1->egIsoVetoNrTowersPhi()<<endl;
176 cout<<
" egPUSParams= ["<<ptr1->egPUSParams().size()<<
"] "<<flush;
177 float egPUSParams[ptr1->egPUSParams().size()];
178 for(
unsigned int i=0;
i<ptr1->egPUSParams().size();
i++) egPUSParams[
i] = ptr1->egPUSParams()[
i];
180 if( ptr1->egPUSParams().size() )
181 cout <<
hash( egPUSParams,
sizeof(
float)*ptr1->egPUSParams().size() ) << endl;
184 cout<<
" egCalibrationType= "<<ptr1->egCalibrationType()<<endl;
186 if( !ptr1->egCalibrationLUT()->empty() ){
187 cout<<
" egCalibrationLUT= ["<<ptr1->egCalibrationLUT()->maxSize()<<
"] "<<flush;
188 int egCalibration[ptr1->egCalibrationLUT()->maxSize()];
189 for(
unsigned int i=0;
i<ptr1->egCalibrationLUT()->maxSize();
i++) egCalibration[
i] = ptr1->egCalibrationLUT()->data(
i);
190 cout <<
hash( egCalibration,
sizeof(
int)*ptr1->egCalibrationLUT()->maxSize() ) << endl;
191 if( printEgCalibLUT )
192 for(
unsigned int i=0;
i<ptr1->egCalibrationLUT()->maxSize();
i++)
193 cout<<
i<<
" " << egCalibration[
i]<<endl;
195 cout<<
" egCalibrationLUT= [0]"<<endl;
198 cout<<endl<<
" Tau: "<<endl;
199 cout<<
" tauLsb= "<<ptr1->tauLsb()<<endl;
200 cout<<
" tauSeedThreshold= "<<ptr1->tauSeedThreshold()<<endl;
201 cout<<
" tauNeighbourThreshold= "<<ptr1->tauNeighbourThreshold()<<endl;
202 cout<<
" tauMaxPtTauVeto= "<<ptr1->tauMaxPtTauVeto()<<endl;
203 cout<<
" tauMinPtJetIsolationB= "<<ptr1->tauMinPtJetIsolationB()<<endl;
204 cout<<
" tauPUSType= "<<ptr1->tauPUSType()<<endl;
205 cout<<
" tauMaxJetIsolationB= "<<ptr1->tauMaxJetIsolationB()<<endl;
206 cout<<
" tauMaxJetIsolationA= "<<ptr1->tauMaxJetIsolationA()<<endl;
207 cout<<
" tauIsoAreaNrTowersEta= "<<ptr1->tauIsoAreaNrTowersEta()<<endl;
208 cout<<
" tauIsoAreaNrTowersPhi= "<<ptr1->tauIsoAreaNrTowersPhi()<<endl;
209 cout<<
" tauIsoVetoNrTowersPhi= "<<ptr1->tauIsoVetoNrTowersPhi()<<endl;
210 if( !ptr1->tauIsolationLUT()->empty() ){
211 cout<<
" tauIsoLUT= ["<<ptr1->tauIsolationLUT()->maxSize()<<
"] "<<flush;
212 int tauIsolation[ptr1->tauIsolationLUT()->maxSize()];
213 for(
unsigned int i=0;
i<ptr1->tauIsolationLUT()->maxSize();
i++) tauIsolation[
i] = ptr1->tauIsolationLUT()->data(
i);
214 cout <<
hash( tauIsolation,
sizeof(
int)*ptr1->tauIsolationLUT()->maxSize() ) << endl;
216 cout<<
" tauIsoLUT= [0]"<<endl;
219 if( !ptr1->tauCalibrationLUT()->empty() ){
220 cout<<
" tauCalibrationLUT= ["<<ptr1->tauCalibrationLUT()->maxSize()<<
"] "<<flush;
221 int tauCalibration[ptr1->tauCalibrationLUT()->maxSize()];
222 for(
unsigned int i=0;
i<ptr1->tauCalibrationLUT()->maxSize();
i++)
223 tauCalibration[
i] = ptr1->tauCalibrationLUT()->data(
i);
224 cout <<
hash( tauCalibration,
sizeof(
int)*ptr1->tauCalibrationLUT()->maxSize() ) << endl;
226 if( printTauCalibLUT )
227 for(
unsigned int i=0;
i<ptr1->tauCalibrationLUT()->maxSize();
i++)
228 cout<<
i<<
" "<<tauCalibration[
i]<<endl;
231 cout<<
" tauCalibrationLUT= [0]"<<endl;
234 if( !ptr1->tauEtToHFRingEtLUT()->empty() ){
235 cout<<
" tauEtToHFRingEtLUT= ["<<ptr1->tauEtToHFRingEtLUT()->maxSize()<<
"] "<<flush;
236 int tauEtToHFRingEt[ptr1->tauEtToHFRingEtLUT()->maxSize()];
237 for(
unsigned int i=0;
i<ptr1->tauEtToHFRingEtLUT()->maxSize();
i++) tauEtToHFRingEt[
i] = ptr1->tauEtToHFRingEtLUT()->data(
i);
239 cout <<
hash( tauEtToHFRingEt,
sizeof(
int)*ptr1->tauEtToHFRingEtLUT()->maxSize() ) << endl;
241 cout<<
" tauEtToHFRingEtLUT= [0]"<<endl;
244 cout<<
" isoTauEtaMin= "<<ptr1->isoTauEtaMin()<<endl;
245 cout<<
" isoTauEtaMax= "<<ptr1->isoTauEtaMax()<<endl;
246 cout<<
" tauPUSParams= ["<<ptr1->tauPUSParams().size()<<
"] "<<flush;
247 float tauPUSParams[ptr1->tauPUSParams().size()];
248 for(
unsigned int i=0;
i<ptr1->tauPUSParams().size();
i++) tauPUSParams[
i] = ptr1->tauPUSParams()[
i];
250 if( ptr1->tauPUSParams().size() )
251 cout <<
hash( tauPUSParams,
sizeof(
float)*ptr1->tauPUSParams().size() ) << endl;
254 cout<<endl<<
" Jets: "<<endl;
255 cout<<
" jetLsb= "<<ptr1->jetLsb()<<endl;
256 cout<<
" jetSeedThreshold= "<<ptr1->jetSeedThreshold()<<endl;
257 cout<<
" jetNeighbourThreshold= "<<ptr1->jetNeighbourThreshold()<<endl;
258 cout<<
" jetPUSType= "<<ptr1->jetPUSType()<<endl;
259 cout<<
" jetCalibrationType= "<<ptr1->jetCalibrationType()<<endl;
260 cout<<
" jetCalibrationParams= ["<<ptr1->jetCalibrationParams().size()<<
"] "<<flush;
261 float jetCalibrationParams[ptr1->jetCalibrationParams().size()];
262 for(
unsigned int i=0;
i<ptr1->jetCalibrationParams().size();
i++) jetCalibrationParams[
i] = ptr1->jetCalibrationParams()[
i];
264 if( ptr1->jetCalibrationParams().size() ){
265 cout <<
hash( jetCalibrationParams,
sizeof(
float)*ptr1->jetCalibrationParams().size() ) << endl;
266 if( printJetCalibPar )
267 for(
unsigned int i=0;
i<ptr1->jetCalibrationParams().size();
i++)
268 cout<<
i<<
" " << std::setprecision(14) << jetCalibrationParams[
i]<<endl;
272 if( !ptr1->jetCalibrationLUT()->empty() ){
273 cout<<
" jetCalibrationLUT= ["<<ptr1->jetCalibrationLUT()->maxSize()<<
"] "<<flush;
274 int jetCalibration[ptr1->jetCalibrationLUT()->maxSize()];
275 for(
unsigned int i=0;
i<ptr1->jetCalibrationLUT()->maxSize();
i++)
276 jetCalibration[
i] = ptr1->jetCalibrationLUT()->data(
i);
278 cout <<
hash( jetCalibration,
sizeof(
int)*ptr1->jetCalibrationLUT()->maxSize() ) << endl;
280 if( printJetCalibLUT )
281 for(
unsigned int i=0;
i<ptr1->jetCalibrationLUT()->maxSize();
i++)
282 cout<<
i<<
" "<<jetCalibration[
i]<<endl;
285 cout<<
" jetCalibrationLUT= [0]"<<endl;
288 cout<<endl<<
" Sums: "<<endl;
289 unsigned int nEntities = 0;
290 cout<<
" etSumLsb= "<<ptr1->etSumLsb()<<endl;
291 cout<<
" etSumEtaMin= [";
for(
unsigned int i=0; ptr1->etSumEtaMin(
i)>0.001;
i++)
cout<<(
i==0?
"":
",")<<ptr1->etSumEtaMin(
i);
cout<<
"]"<<endl;
292 cout<<
" etSumEtaMax= [";
for(
unsigned int i=0; ptr1->etSumEtaMax(
i)>0.001;
i++,nEntities++)
cout<<(
i==0?
"":
",")<<ptr1->etSumEtaMax(
i);
cout<<
"]"<<endl;
293 cout<<
" etSumEtThreshold= [";
for(
unsigned int i=0;
i<nEntities;
i++)
cout<<(
i==0?
"":
",")<<ptr1->etSumEtThreshold(
i);
cout<<
"]"<<endl;
295 cout<<endl<<
" HI centrality trigger: "<<endl;
296 cout<<
" centralityLUT= [";
for(
unsigned int i=0;
i<ptr1->centralityLUT()->maxSize();
i++)
cout<<(
i==0?
"":
",")<<ptr1->centralityLUT()->data(
i);
cout<<
"]"<<endl;
298 std::vector<int> mbt = ptr1->minimumBiasThresholds();
299 cout<<
" minimumBiasThresholds= [";
for(
unsigned int i=0;
i<mbt.size();
i++)
cout<<mbt[
i];
cout<<
"]"<<endl;
301 cout<<endl<<
"centralityRegionMask() = "<<ptr1->centralityRegionMask()<<endl;
302 cout<<endl<<
"jetRegionMask() = "<<ptr1->jetRegionMask()<<endl;
303 cout<<endl<<
"tauRegionMask() = "<<ptr1->tauRegionMask()<<endl;
305 cout<<endl<<
" HI Q2 trigger: "<<endl;
306 cout<<
" q2LUT= [";
for(
unsigned int i=0;
i<ptr1->q2LUT()->maxSize();
i++)
cout<<(
i==0?
"":
",")<<ptr1->q2LUT()->data(
i);
cout<<
"]"<<endl;
308 cout<<endl<<
" Layer1: "<<endl;
309 std::vector<double> ecalSF = ptr1->layer1ECalScaleFactors();
310 cout<<
" layer1ECalScaleFactors= ["<< ecalSF.size()<<
"] "<<flush;
311 float _ecalSF[ ecalSF.size() ];
312 for(
unsigned int i=0;
i<ecalSF.size();
i++) _ecalSF[
i] = ecalSF[
i];
313 cout <<
hash( _ecalSF ,
sizeof(
float)*ecalSF.size() ) << endl;
315 std::vector<double> hcalSF = ptr1->layer1HCalScaleFactors();
316 cout<<
" layer1HCalScaleFactors= ["<< hcalSF.size()<<
"] "<<flush;
317 float _hcalSF[ hcalSF.size() ];
318 for(
unsigned int i=0;
i<hcalSF.size();
i++){
324 _hcalSF[
i] = int(hcalSF[
i]*1000.)/1000.;
326 cout <<
hash( _hcalSF,
sizeof(
float)*hcalSF.size() ) << endl;
328 std::vector<double> hfSF = ptr1->layer1HFScaleFactors();
329 cout<<
" layer1HFScaleFactors= ["<< hfSF.size()<<
"] "<<flush;
330 float _hfSF[ hfSF.size() ];
331 for(
unsigned int i=0;
i<hfSF.size();
i++) _hfSF[
i] = hfSF[
i];
332 cout <<
hash( _hfSF,
sizeof(
float)*hfSF.size() ) << endl;
335 std::vector<int> ecalScaleET = ptr1->layer1ECalScaleETBins();
336 cout<<
" layer1ECalScaleETBins= [";
for(
unsigned int i=0;
i<ecalScaleET.size();
i++)
cout<<(
i==0?
"":
",")<<ecalScaleET[
i];
cout<<
"]"<<endl;
337 std::vector<int> hcalScaleET = ptr1->layer1HCalScaleETBins();
338 cout<<
" layer1HCalScaleETBins= [";
for(
unsigned int i=0;
i<hcalScaleET.size();
i++)
cout<<(
i==0?
"":
",")<<hcalScaleET[
i];
cout<<
"]"<<endl;
339 std::vector<int> hfScaleET = ptr1->layer1HFScaleETBins();
340 cout<<
" layer1HFScaleETBins= [";
for(
unsigned int i=0;
i<hfScaleET.size();
i++)
cout<<(
i==0?
"":
",")<<hfScaleET[
i];
cout<<
"]"<<endl;
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
virtual ~L1TCaloParamsViewer(void)
L1TCaloParamsViewer(const edm::ParameterSet &pset)
T const * product() const
std::vector< std::vector< double > > tmp
std::string hash(void *buf, size_t len) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)