CMS 3D CMS Logo

L1TCaloParamsViewer.cc
Go to the documentation of this file.
5 
8 
13 #include <iomanip>
14 
16 private:
28  bool printHfSF;
39 
41 
42  std::string hash(void* buf, size_t len) const;
43 
44 public:
45  void analyze(const edm::Event&, const edm::EventSetup&) override;
46 
48  printPUSParams = pset.getUntrackedParameter<bool>("printPUSParams", false);
49  printTauCalibLUT = pset.getUntrackedParameter<bool>("printTauCalibLUT", false);
50  printTauCompressLUT = pset.getUntrackedParameter<bool>("printTauCompressLUT", false);
51  printJetCalibLUT = pset.getUntrackedParameter<bool>("printJetCalibLUT", false);
52  printJetCalibPar = pset.getUntrackedParameter<bool>("printJetCalibParams", false);
53  printJetPUSPar = pset.getUntrackedParameter<bool>("printJetPUSPar", false);
54  printJetCompressPtLUT = pset.getUntrackedParameter<bool>("printJetCompressPtLUT", false);
55  printJetCompressEtaLUT = pset.getUntrackedParameter<bool>("printJetCompressEtaLUT", false);
56  printEgCalibLUT = pset.getUntrackedParameter<bool>("printEgCalibLUT", false);
57  printEgIsoLUT = pset.getUntrackedParameter<bool>("printEgIsoLUT", false);
58  printEtSumMetPUSLUT = pset.getUntrackedParameter<bool>("printEtSumMetPUSLUT", false);
59  printHfSF = pset.getUntrackedParameter<bool>("printHfSF", false);
60  printHcalSF = pset.getUntrackedParameter<bool>("printHcalSF", false);
61  printEcalSF = pset.getUntrackedParameter<bool>("printEcalSF", false);
62  printEtSumEttPUSLUT = pset.getUntrackedParameter<bool>("printEtSumEttPUSLUT", false);
63  printEtSumEcalSumPUSLUT = pset.getUntrackedParameter<bool>("printEtSumEcalSumPUSLUT", false);
64  printMetCalibrationLUT = pset.getUntrackedParameter<bool>("printMetCalibrationLUT", false);
65  printMetHFCalibrationLUT = pset.getUntrackedParameter<bool>("printMetHFCalibrationLUT", false);
66  printEtSumEttCalibrationLUT = pset.getUntrackedParameter<bool>("printEtSumEttCalibrationLUT", false);
67  printEtSumEcalSumCalibrationLUT = pset.getUntrackedParameter<bool>("printEtSumEcalSumCalibrationLUT", false);
68 
69  useStage2Rcd = pset.getUntrackedParameter<bool>("useStage2Rcd", false);
70  }
71 
72  ~L1TCaloParamsViewer(void) override {}
73 };
74 
76 #include <cmath>
77 #include <iostream>
78 using namespace std;
79 
80 std::string L1TCaloParamsViewer::hash(void* buf, size_t len) const {
82  EVP_MD_CTX* mdctx = EVP_MD_CTX_new();
83  const EVP_MD* md = EVP_get_digestbyname("SHA1");
84  if (!EVP_DigestInit_ex(mdctx, md, nullptr))
85  throw cms::Exception("L1TCaloParamsViewer::hash") << "SHA1 initialization error";
86 
87  if (!EVP_DigestUpdate(mdctx, buf, len))
88  throw cms::Exception("L1TCaloParamsViewer::hash") << "SHA1 processing error";
89 
90  unsigned char hash[EVP_MAX_MD_SIZE];
91  unsigned int md_len = 0;
92  if (!EVP_DigestFinal_ex(mdctx, hash, &md_len))
93  throw cms::Exception("L1TCaloParamsViewer::hash") << "SHA1 finalization error";
94 
95  EVP_MD_CTX_free(mdctx);
96 
97  // re-write bytes in hex
98  char tmp[EVP_MAX_MD_SIZE * 2 + 1];
99  if (md_len > 20)
100  md_len = 20;
101  for (unsigned int i = 0; i < md_len; i++)
102  ::sprintf(&tmp[i * 2], "%02x", hash[i]);
103 
104  tmp[md_len * 2] = 0;
105  return std::string(tmp);
106 }
107 
110  if (useStage2Rcd)
111  evSetup.get<L1TCaloStage2ParamsRcd>().get(handle1);
112  else
113  evSetup.get<L1TCaloParamsRcd>().get(handle1);
114 
115  std::shared_ptr<l1t::CaloParams> ptr(new l1t::CaloParams(*(handle1.product())));
116 
117  l1t::CaloParamsHelper* ptr1 = nullptr;
118  ptr1 = (l1t::CaloParamsHelper*)(&(*ptr));
119 
120  edm::LogInfo("") << "L1TCaloParamsViewer:";
121 
122  cout << endl << " Towers: " << endl;
123  cout << " towerLsbH= " << ptr1->towerLsbH() << endl;
124  cout << " towerLsbE= " << ptr1->towerLsbE() << endl;
125  cout << " towerLsbSum= " << ptr1->towerLsbSum() << endl;
126  cout << " towerNBitsH= " << ptr1->towerNBitsH() << endl;
127  cout << " towerNBitsE= " << ptr1->towerNBitsE() << endl;
128  cout << " towerNBitsSum= " << ptr1->towerNBitsSum() << endl;
129  cout << " towerNBitsRatio= " << ptr1->towerNBitsRatio() << endl;
130  cout << " towerMaskE= " << ptr1->towerMaskE() << endl;
131  cout << " towerMaskH= " << ptr1->towerMaskH() << endl;
132  cout << " towerMaskSum= " << ptr1->towerMaskSum() << endl;
133  cout << " towerEncoding= " << ptr1->doTowerEncoding() << endl;
134 
135  cout << endl << " Regions: " << endl;
136  cout << " regionLsb= " << ptr1->regionLsb() << endl;
137  cout << " regionPUSType= " << ptr1->regionPUSType() << endl;
138  cout << " regionPUSParams= [" << ptr1->regionPUSParams().size() << "] ";
139  float pusParams[ptr1->regionPUSParams().size()];
140  for (unsigned int i = 0; i < ptr1->regionPUSParams().size(); i++) {
141  pusParams[i] = ceil(2 * ptr1->regionPUSParams()[i]);
142  if (printPUSParams)
143  cout << " " << ceil(2 * pusParams[i]) << endl;
144  }
145 
146  if (!ptr1->regionPUSParams().empty())
147  cout << hash(pusParams, sizeof(float) * ptr1->regionPUSParams().size()) << endl;
148  else
149  cout << endl;
150 
151  if (!ptr1->regionPUSLUT()->empty()) {
152  cout << " regionPUSLUT= [" << ptr1->regionPUSLUT()->maxSize() << "] ";
153  int regionPUSLUT[ptr1->regionPUSLUT()->maxSize()];
154  for (unsigned int i = 0; i < ptr1->regionPUSLUT()->maxSize(); i++)
155  regionPUSLUT[i] = ptr1->regionPUSLUT()->data(i);
156  cout << hash(regionPUSLUT, sizeof(int) * ptr1->regionPUSLUT()->maxSize()) << endl;
157  } else {
158  cout << " regionPUSLUT= [0]" << endl;
159  }
160 
161  cout << " pileUpTowerThreshold= " << ptr1->pileUpTowerThreshold() << endl;
162 
163  cout << endl << " EG: " << endl;
164  cout << " egLsb= " << ptr1->egLsb() << endl;
165  cout << " egSeedThreshold= " << ptr1->egSeedThreshold() << endl;
166  cout << " egNeighbourThreshold= " << ptr1->egNeighbourThreshold() << endl;
167  cout << " egHcalThreshold= " << ptr1->egHcalThreshold() << endl;
168 
169  if (!ptr1->egTrimmingLUT()->empty()) {
170  cout << " egTrimmingLUT= [" << ptr1->egTrimmingLUT()->maxSize() << "] " << flush;
171  int egTrimming[ptr1->egTrimmingLUT()->maxSize()];
172  for (unsigned int i = 0; i < ptr1->egTrimmingLUT()->maxSize(); i++)
173  egTrimming[i] = ptr1->egTrimmingLUT()->data(i);
174  cout << hash(egTrimming, sizeof(int) * ptr1->egTrimmingLUT()->maxSize()) << endl;
175  } else {
176  cout << " egTrimmingLUT= [0] " << endl;
177  }
178 
179  cout << " egMaxHcalEt= " << ptr1->egMaxHcalEt() << endl;
180  cout << " egMaxPtHOverE= " << ptr1->egMaxPtHOverE() << endl;
181  cout << " egMinPtJetIsolation= " << ptr1->egMinPtJetIsolation() << endl;
182  cout << " egMaxPtJetIsolation= " << ptr1->egMaxPtJetIsolation() << endl;
183  cout << " egMinPtHOverEIsolation= " << ptr1->egMinPtHOverEIsolation() << endl;
184  cout << " egMaxPtHOverEIsolation= " << ptr1->egMaxPtHOverEIsolation() << endl;
185 
186  if (!ptr1->egMaxHOverELUT()->empty()) {
187  cout << " egMaxHOverELUT= [" << ptr1->egMaxHOverELUT()->maxSize() << "] ";
188  int egMaxHOverE[ptr1->egMaxHOverELUT()->maxSize()];
189  for (unsigned int i = 0; i < ptr1->egMaxHOverELUT()->maxSize(); i++)
190  egMaxHOverE[i] = ptr1->egMaxHOverELUT()->data(i);
191  cout << hash(egMaxHOverE, sizeof(int) * ptr1->egMaxHOverELUT()->maxSize()) << endl;
192  } else {
193  cout << " egMaxHOverELUT= [0]" << endl;
194  }
195 
196  if (!ptr1->egCompressShapesLUT()->empty()) {
197  cout << " egCompressShapesLUT= [" << ptr1->egCompressShapesLUT()->maxSize() << "] ";
198  int egCompressShapes[ptr1->egCompressShapesLUT()->maxSize()];
199  for (unsigned int i = 0; i < ptr1->egCompressShapesLUT()->maxSize(); i++)
200  egCompressShapes[i] = ptr1->egCompressShapesLUT()->data(i);
201  cout << hash(egCompressShapes, sizeof(int) * ptr1->egCompressShapesLUT()->maxSize()) << endl;
202  } else {
203  cout << " egCompressShapesLUT= [0]" << endl;
204  }
205 
206  cout << " egShapeIdType= " << ptr1->egShapeIdType() << endl;
207  cout << " egShapeIdVersion= " << ptr1->egShapeIdVersion() << endl;
208  if (!ptr1->egShapeIdLUT()->empty()) {
209  cout << " egShapeIdLUT= [" << ptr1->egShapeIdLUT()->maxSize() << "] " << flush;
210  int egShapeId[ptr1->egShapeIdLUT()->maxSize()];
211  for (unsigned int i = 0; i < ptr1->egShapeIdLUT()->maxSize(); i++)
212  egShapeId[i] = ptr1->egShapeIdLUT()->data(i);
213  cout << hash(egShapeId, sizeof(int) * ptr1->egShapeIdLUT()->maxSize()) << endl;
214  } else {
215  cout << " egShapeIdLUT= [0]" << endl;
216  }
217 
218  cout << " egBypassEGVetos= " << ptr1->egBypassEGVetos() << endl;
219  cout << " egBypassShape= " << ptr1->egBypassShape() << endl;
220  cout << " egBypassExtHoverE= " << ptr1->egBypassExtHOverE() << endl;
221  cout << " egBypassECALFG= " << ptr1->egBypassECALFG() << endl;
222  cout << " egHOverEcutBarrel= " << ptr1->egHOverEcutBarrel() << endl;
223  cout << " egHOverEcutEndcap= " << ptr1->egHOverEcutEndcap() << endl;
224 
225  cout << " egPUSType= " << ptr1->egPUSType() << endl;
226 
227  cout << " egIsolationType= " << ptr1->egIsolationType() << endl;
228  if (!ptr1->egIsolationLUT()->empty()) {
229  cout << " egIsoLUT= [" << ptr1->egIsolationLUT()->maxSize() << "] " << flush;
230  int egIsolation[ptr1->egIsolationLUT()->maxSize()];
231  for (unsigned int i = 0; i < ptr1->egIsolationLUT()->maxSize(); i++)
232  egIsolation[i] = ptr1->egIsolationLUT()->data(i);
233  cout << hash(egIsolation, sizeof(int) * ptr1->egIsolationLUT()->maxSize()) << endl;
234  if (printEgIsoLUT)
235  for (unsigned int i = 0; i < ptr1->egIsolationLUT()->maxSize(); i++)
236  cout << i << " " << egIsolation[i] << endl;
237  } else {
238  cout << " egIsoLUT= [0]" << endl;
239  }
240  if (!ptr1->egIsolationLUT2()->empty()) {
241  cout << " egIsoLUT2= [" << ptr1->egIsolationLUT2()->maxSize() << "] " << flush;
242  int egIsolation2[ptr1->egIsolationLUT2()->maxSize()];
243  for (unsigned int i = 0; i < ptr1->egIsolationLUT2()->maxSize(); i++)
244  egIsolation2[i] = ptr1->egIsolationLUT2()->data(i);
245  cout << hash(egIsolation2, sizeof(int) * ptr1->egIsolationLUT2()->maxSize()) << endl;
246  if (printEgIsoLUT)
247  for (unsigned int i = 0; i < ptr1->egIsolationLUT2()->maxSize(); i++)
248  cout << i << " " << egIsolation2[i] << endl;
249  } else {
250  cout << " egIsoLUT2= [0]" << endl;
251  }
252 
253  cout << " egIsoAreaNrTowersEta= " << ptr1->egIsoAreaNrTowersEta() << endl;
254  cout << " egIsoAreaNrTowersPhi= " << ptr1->egIsoAreaNrTowersPhi() << endl;
255  cout << " egIsoVetoNrTowersPhi= " << ptr1->egIsoVetoNrTowersPhi() << endl;
256  cout << " egPUSParams= [" << ptr1->egPUSParams().size() << "] " << flush;
257  float egPUSParams[ptr1->egPUSParams().size()];
258  for (unsigned int i = 0; i < ptr1->egPUSParams().size(); i++)
259  egPUSParams[i] = ptr1->egPUSParams()[i];
260 
261  if (!ptr1->egPUSParams().empty())
262  cout << hash(egPUSParams, sizeof(float) * ptr1->egPUSParams().size()) << endl;
263  else
264  cout << endl;
265 
266  cout << " egCalibrationParams= [" << ptr1->egCalibrationParams().size() << "] " << flush;
267  double egCalibrationParams[ptr1->egCalibrationParams().size()];
268  for (unsigned int i = 0; i < ptr1->egCalibrationParams().size(); i++)
269  egCalibrationParams[i] = ptr1->egCalibrationParams()[i];
270 
271  if (!ptr1->egCalibrationParams().empty())
272  cout << hash(egCalibrationParams, sizeof(double) * ptr1->egCalibrationParams().size()) << endl;
273  else
274  cout << endl;
275 
276  cout << " egCalibrationType= " << ptr1->egCalibrationType() << endl;
277  cout << " egCalibrationVersion= " << ptr1->egCalibrationVersion() << endl;
278  if (!ptr1->egCalibrationLUT()->empty()) {
279  cout << " egCalibrationLUT= [" << ptr1->egCalibrationLUT()->maxSize() << "] " << flush;
280  int egCalibration[ptr1->egCalibrationLUT()->maxSize()];
281  for (unsigned int i = 0; i < ptr1->egCalibrationLUT()->maxSize(); i++)
282  egCalibration[i] = ptr1->egCalibrationLUT()->data(i);
283  cout << hash(egCalibration, sizeof(int) * ptr1->egCalibrationLUT()->maxSize()) << endl;
284  if (printEgCalibLUT)
285  for (unsigned int i = 0; i < ptr1->egCalibrationLUT()->maxSize(); i++)
286  cout << i << " " << egCalibration[i] << endl;
287  } else {
288  cout << " egCalibrationLUT= [0]" << endl;
289  }
290 
291  cout << endl << " Tau: " << endl;
292  cout << " tauLsb= " << ptr1->tauLsb() << endl;
293  //cout<<" tauSeedThreshold= "<<ptr1->tauSeedThreshold()<<endl;
294  //cout<<" tauNeighbourThreshold= "<<ptr1->tauNeighbourThreshold()<<endl;
295  cout << " tauMaxPtTauVeto= " << ptr1->tauMaxPtTauVeto() << endl;
296  cout << " tauMinPtJetIsolationB= " << ptr1->tauMinPtJetIsolationB() << endl;
297  cout << " tauPUSType= " << ptr1->tauPUSType() << endl;
298  cout << " tauMaxJetIsolationB= " << ptr1->tauMaxJetIsolationB() << endl;
299  cout << " tauMaxJetIsolationA= " << ptr1->tauMaxJetIsolationA() << endl;
300  cout << " tauIsoAreaNrTowersEta= " << ptr1->tauIsoAreaNrTowersEta() << endl;
301  cout << " tauIsoAreaNrTowersPhi= " << ptr1->tauIsoAreaNrTowersPhi() << endl;
302  cout << " tauIsoVetoNrTowersPhi= " << ptr1->tauIsoVetoNrTowersPhi() << endl;
303  if (!ptr1->tauIsolationLUT()->empty()) {
304  cout << " tauIsoLUT= [" << ptr1->tauIsolationLUT()->maxSize() << "] " << flush;
305  int tauIsolation[ptr1->tauIsolationLUT()->maxSize()];
306  for (unsigned int i = 0; i < ptr1->tauIsolationLUT()->maxSize(); i++)
307  tauIsolation[i] = ptr1->tauIsolationLUT()->data(i);
308  cout << hash(tauIsolation, sizeof(int) * ptr1->tauIsolationLUT()->maxSize()) << endl;
309  } else {
310  cout << " tauIsoLUT= [0]" << endl;
311  }
312  if (!ptr1->tauIsolationLUT2()->empty()) {
313  cout << " tauIsoLUT2= [" << ptr1->tauIsolationLUT2()->maxSize() << "] " << flush;
314  int tauIsolation2[ptr1->tauIsolationLUT2()->maxSize()];
315  for (unsigned int i = 0; i < ptr1->tauIsolationLUT2()->maxSize(); i++)
316  tauIsolation2[i] = ptr1->tauIsolationLUT2()->data(i);
317  cout << hash(tauIsolation2, sizeof(int) * ptr1->tauIsolationLUT2()->maxSize()) << endl;
318  } else {
319  cout << " tauIsoLUT2= [0]" << endl;
320  }
321  if (!ptr1->tauTrimmingShapeVetoLUT()->empty()) {
322  cout << " tauTrimmingShapeVetoLUT=[" << ptr1->tauTrimmingShapeVetoLUT()->maxSize() << "] " << flush;
323  int tauTrimmingShapeVetoLUT[ptr1->tauTrimmingShapeVetoLUT()->maxSize()];
324  for (unsigned int i = 0; i < ptr1->tauTrimmingShapeVetoLUT()->maxSize(); i++)
325  tauTrimmingShapeVetoLUT[i] = ptr1->tauTrimmingShapeVetoLUT()->data(i);
326  cout << hash(tauTrimmingShapeVetoLUT, sizeof(int) * ptr1->tauTrimmingShapeVetoLUT()->maxSize()) << endl;
327  } else {
328  cout << " tauTrimmingShapeVetoLUT=[0]" << endl;
329  }
330 
331  if (!ptr1->tauCalibrationLUT()->empty()) {
332  cout << " tauCalibrationLUT= [" << ptr1->tauCalibrationLUT()->maxSize() << "] " << flush;
333  int tauCalibration[512]; //ptr1->tauCalibrationLUT()->maxSize()];
334  for (unsigned int i = 0; i < 512; i++) //ptr1->tauCalibrationLUT()->maxSize(); i++)
335  tauCalibration[i] = ptr1->tauCalibrationLUT()->data(i);
336  cout << hash(tauCalibration, sizeof(int) * 512 /*ptr1->tauCalibrationLUT()->maxSize() */) << endl;
337 
338  if (printTauCalibLUT)
339  for (unsigned int i = 0; i < 512 /*ptr1->tauCalibrationLUT()->maxSize()*/; i++)
340  cout << i << " " << tauCalibration[i] << endl;
341 
342  } else {
343  cout << " tauCalibrationLUT= [0]" << endl;
344  }
345 
346  cout << " tauCalibrationType= " << ptr1->tauCalibrationType() << endl;
347 
348  cout << " tauCalibrationParams= [" << ptr1->tauCalibrationParams().size() << "] " << flush;
349  double tauCalibrationParams[ptr1->tauCalibrationParams().size()];
350  for (unsigned int i = 0; i < ptr1->tauCalibrationParams().size(); i++)
351  tauCalibrationParams[i] = ptr1->tauCalibrationParams()[i];
352 
353  if (!ptr1->tauCalibrationParams().empty())
354  cout << hash(tauCalibrationParams, sizeof(double) * ptr1->tauCalibrationParams().size()) << endl;
355  else
356  cout << endl;
357 
358  if (!ptr1->tauCompressLUT()->empty()) {
359  cout << " tauCompressLUT= [" << ptr1->tauCompressLUT()->maxSize() << "] " << flush;
360  int tauCompress[ptr1->tauCompressLUT()->maxSize()];
361  for (unsigned int i = 0; i < ptr1->tauCompressLUT()->maxSize(); i++)
362  tauCompress[i] = ptr1->tauCompressLUT()->data(i);
363  cout << hash(tauCompress, sizeof(int) * ptr1->tauCompressLUT()->maxSize()) << endl;
364 
365  if (printTauCompressLUT)
366  for (unsigned int i = 0; i < ptr1->tauCompressLUT()->maxSize(); i++)
367  cout << i << " " << tauCompress[i] << endl;
368 
369  } else {
370  cout << " tauCompressLUT= [0]" << endl;
371  }
372 
373  if (!ptr1->tauEtToHFRingEtLUT()->empty()) {
374  cout << " tauEtToHFRingEtLUT= [" << ptr1->tauEtToHFRingEtLUT()->maxSize() << "] " << flush;
375  int tauEtToHFRingEt[ptr1->tauEtToHFRingEtLUT()->maxSize()];
376  for (unsigned int i = 0; i < ptr1->tauEtToHFRingEtLUT()->maxSize(); i++)
377  tauEtToHFRingEt[i] = ptr1->tauEtToHFRingEtLUT()->data(i);
378 
379  cout << hash(tauEtToHFRingEt, sizeof(int) * ptr1->tauEtToHFRingEtLUT()->maxSize()) << endl;
380  } else {
381  cout << " tauEtToHFRingEtLUT= [0]" << endl;
382  }
383 
384  cout << " isoTauEtaMin= " << ptr1->isoTauEtaMin() << endl;
385  cout << " isoTauEtaMax= " << ptr1->isoTauEtaMax() << endl;
386  cout << " tauPUSParams= [" << ptr1->tauPUSParams().size() << "] " << flush;
387  float tauPUSParams[ptr1->tauPUSParams().size()];
388  for (unsigned int i = 0; i < ptr1->tauPUSParams().size(); i++)
389  tauPUSParams[i] = ptr1->tauPUSParams()[i];
390 
391  if (!ptr1->tauPUSParams().empty())
392  cout << hash(tauPUSParams, sizeof(float) * ptr1->tauPUSParams().size()) << endl;
393  else
394  cout << endl;
395 
396  cout << endl << " Jets: " << endl;
397  cout << " jetLsb= " << ptr1->jetLsb() << endl;
398  cout << " jetSeedThreshold= " << ptr1->jetSeedThreshold() << endl;
399  cout << " jetNeighbourThreshold= " << ptr1->jetNeighbourThreshold() << endl;
400  cout << " jetRegionMask= " << ptr1->jetRegionMask() << endl;
401  cout << " jetBypassPUS= " << ptr1->jetBypassPUS() << endl;
402  //cout<<" jetPUSType= "<<ptr1->jetPUSType()<<endl;
403  cout << " jetPUSUsePhiRing= " << ptr1->jetPUSUsePhiRing() << endl;
404  cout << " jetCalibrationType= " << ptr1->jetCalibrationType() << endl;
405  //cout<<" jetCalibrationParams= ["<<ptr1->jetCalibrationParams().size()<<"] "<<flush;
406  //float jetCalibrationParams[ptr1->jetCalibrationParams().size()]; // deliberately drop double precision
407  //for(unsigned int i=0; i<ptr1->jetCalibrationParams().size(); i++) jetCalibrationParams[i] = ptr1->jetCalibrationParams()[i];
408 
409  /*if( !ptr1->jetCalibrationParams().empty() ){
410  cout << hash( jetCalibrationParams, sizeof(float)*ptr1->jetCalibrationParams().size() ) << endl;
411  if( printJetCalibPar )
412  for(unsigned int i=0; i<ptr1->jetCalibrationParams().size(); i++)
413  cout<<i<<" " << std::setprecision(14) << jetCalibrationParams[i]<<endl;
414 
415  } else cout<<endl;
416 
417  cout<<" jetPUSParams= ["<<ptr1->jetPUSParams().size()<<"] "<<flush;
418  float jetPUSParams[ptr1->jetPUSParams().size()]; // deliberately drop double precision
419  for(unsigned int i=0; i<ptr1->jetPUSParams().size(); i++) jetPUSParams[i] = ptr1->jetPUSParams()[i];
420  if( !ptr1->jetPUSParams().empty() ){
421  cout << hash( jetPUSParams, sizeof(float)*ptr1->jetPUSParams().size() ) << endl;
422  if( printJetPUSPar )
423  for(unsigned int i=0; i<ptr1->jetPUSParams().size(); i++)
424  cout<<i<<" " << std::setprecision(14) << jetPUSParams[i]<<endl;
425 
426  } else cout<<endl;
427  */
428 
429  if (!ptr1->jetCalibrationLUT()->empty()) {
430  cout << " jetCalibrationLUT= [" << ptr1->jetCalibrationLUT()->maxSize() << "] " << flush;
431  int jetCalibration[ptr1->jetCalibrationLUT()->maxSize()];
432  for (unsigned int i = 0; i < ptr1->jetCalibrationLUT()->maxSize(); i++)
433  jetCalibration[i] = ptr1->jetCalibrationLUT()->data(i);
434 
435  cout << hash(jetCalibration, sizeof(int) * ptr1->jetCalibrationLUT()->maxSize()) << endl;
436 
437  if (printJetCalibLUT)
438  for (unsigned int i = 0; i < ptr1->jetCalibrationLUT()->maxSize(); i++)
439  cout << i << " " << jetCalibration[i] << endl;
440 
441  } else {
442  cout << " jetCalibrationLUT= [0]" << endl;
443  }
444 
445  if (!ptr1->jetCompressPtLUT()->empty()) {
446  cout << " jetCompressPtLUT= [" << ptr1->jetCompressPtLUT()->maxSize() << "] " << flush;
447  int jetCompressPt[ptr1->jetCompressPtLUT()->maxSize()];
448  for (unsigned int i = 0; i < ptr1->jetCompressPtLUT()->maxSize(); i++)
449  jetCompressPt[i] = ptr1->jetCompressPtLUT()->data(i);
450 
451  cout << hash(jetCompressPt, sizeof(int) * ptr1->jetCompressPtLUT()->maxSize()) << endl;
452 
453  if (printJetCompressPtLUT)
454  for (unsigned int i = 0; i < ptr1->jetCompressPtLUT()->maxSize(); i++)
455  cout << i << " " << jetCompressPt[i] << endl;
456 
457  } else {
458  cout << " jetCompressPtLUT= [0]" << endl;
459  }
460 
461  if (!ptr1->jetCompressEtaLUT()->empty()) {
462  cout << " jetCompressEtaLUT= [" << ptr1->jetCompressEtaLUT()->maxSize() << "] " << flush;
463  int jetCompressEta[ptr1->jetCompressEtaLUT()->maxSize()];
464  for (unsigned int i = 0; i < ptr1->jetCompressEtaLUT()->maxSize(); i++)
465  jetCompressEta[i] = ptr1->jetCompressEtaLUT()->data(i);
466 
467  cout << hash(jetCompressEta, sizeof(int) * ptr1->jetCompressEtaLUT()->maxSize()) << endl;
468 
469  if (printJetCompressEtaLUT)
470  for (unsigned int i = 0; i < ptr1->jetCompressEtaLUT()->maxSize(); i++)
471  cout << i << " " << jetCompressEta[i] << endl;
472 
473  } else {
474  cout << " jetCompressEtaLUT= [0]" << endl;
475  }
476 
477  cout << endl << " Sums: " << endl;
478  unsigned int nEntities = 0;
479  cout << " etSumLsb= " << ptr1->etSumLsb() << endl;
480  cout << " etSumEtaMin= [";
481  for (unsigned int i = 0; ptr1->etSumEtaMin(i) > 0.001; i++)
482  cout << (i == 0 ? "" : ",") << ptr1->etSumEtaMin(i);
483  cout << "]" << endl;
484  cout << " etSumEtaMax= [";
485  for (unsigned int i = 0; ptr1->etSumEtaMax(i) > 0.001; i++, nEntities++)
486  cout << (i == 0 ? "" : ",") << ptr1->etSumEtaMax(i);
487  cout << "]" << endl;
488  cout << " etSumEtThreshold= [";
489  for (unsigned int i = 0; i < nEntities; i++)
490  cout << (i == 0 ? "" : ",") << ptr1->etSumEtThreshold(i);
491  cout << "]" << endl;
492 
493  cout << " etSumBypassMetPUS= " << ptr1->etSumBypassMetPUS() << endl;
494  cout << " etSumBypassEttPUS= " << ptr1->etSumBypassEttPUS() << endl;
495  cout << " etSumBypassEcalSumPUS " << ptr1->etSumBypassEcalSumPUS() << endl;
496 
497  cout << " etSumMetPUSType= " << ptr1->etSumMetPUSType() << endl;
498  cout << " etSumEttPUSType= " << ptr1->etSumEttPUSType() << endl;
499  cout << " etSumEcalSumPUSType= " << ptr1->etSumEcalSumPUSType() << endl;
500 
501  cout << " etSumCentralityUpper= [";
502  for (unsigned int i = 0; ptr1->etSumCentUpper(i) > 0.001; i++)
503  cout << (i == 0 ? "" : ",") << ptr1->etSumCentUpper(i);
504  cout << "]" << endl;
505  cout << " etSumCentralityLower= [";
506  for (unsigned int i = 0; ptr1->etSumCentLower(i) > 0.001; i++)
507  cout << (i == 0 ? "" : ",") << ptr1->etSumCentLower(i);
508  cout << "]" << endl;
509 
510  cout << " metCalibrationType= " << ptr1->metCalibrationType() << endl;
511  cout << " metHFCalibrationType= " << ptr1->metHFCalibrationType() << endl;
512  cout << " etSumEttCalibrationType=" << ptr1->etSumEttCalibrationType() << endl;
513  cout << " etSumEcalSumCalibrationType=" << ptr1->etSumEcalSumCalibrationType() << endl;
514 
515  if (!ptr1->etSumMetPUSLUT()->empty()) {
516  cout << " etSumMetPUSLUT= [" << ptr1->etSumMetPUSLUT()->maxSize() << "] " << flush;
517  int etSumMetPUSLUT[ptr1->etSumMetPUSLUT()->maxSize()];
518  for (unsigned int i = 0; i < ptr1->etSumMetPUSLUT()->maxSize(); i++)
519  etSumMetPUSLUT[i] = ptr1->etSumMetPUSLUT()->data(i);
520 
521  cout << hash(etSumMetPUSLUT, sizeof(int) * ptr1->etSumMetPUSLUT()->maxSize()) << endl;
522 
523  if (printEtSumMetPUSLUT)
524  for (unsigned int i = 0; i < ptr1->etSumMetPUSLUT()->maxSize(); i++)
525  cout << i << " " << etSumMetPUSLUT[i] << endl;
526 
527  } else {
528  cout << " etSumMetPUSLUT= [0]" << endl;
529  }
530 
531  if (!ptr1->etSumEttPUSLUT()->empty()) {
532  cout << " etSumEttPUSLUT= [" << ptr1->etSumEttPUSLUT()->maxSize() << "] " << flush;
533  int etSumEttPUSLUT[ptr1->etSumEttPUSLUT()->maxSize()];
534  for (unsigned int i = 0; i < ptr1->etSumEttPUSLUT()->maxSize(); i++)
535  etSumEttPUSLUT[i] = ptr1->etSumEttPUSLUT()->data(i);
536 
537  cout << hash(etSumEttPUSLUT, sizeof(int) * ptr1->etSumEttPUSLUT()->maxSize()) << endl;
538 
539  if (printEtSumEttPUSLUT)
540  for (unsigned int i = 0; i < ptr1->etSumEttPUSLUT()->maxSize(); i++)
541  cout << i << " " << etSumEttPUSLUT[i] << endl;
542 
543  } else {
544  cout << " etSumEttPUSLUT= [0]" << endl;
545  }
546 
547  if (!ptr1->etSumEcalSumPUSLUT()->empty()) {
548  cout << " etSumEcalSumPUSLUT= [" << ptr1->etSumEcalSumPUSLUT()->maxSize() << "] " << flush;
549  int etSumEcalSumPUSLUT[ptr1->etSumEcalSumPUSLUT()->maxSize()];
550  for (unsigned int i = 0; i < ptr1->etSumEcalSumPUSLUT()->maxSize(); i++)
551  etSumEcalSumPUSLUT[i] = ptr1->etSumEcalSumPUSLUT()->data(i);
552 
553  cout << hash(etSumEcalSumPUSLUT, sizeof(int) * ptr1->etSumEcalSumPUSLUT()->maxSize()) << endl;
554 
555  if (printEtSumEcalSumPUSLUT)
556  for (unsigned int i = 0; i < ptr1->etSumEcalSumPUSLUT()->maxSize(); i++)
557  cout << i << " " << etSumEcalSumPUSLUT[i] << endl;
558 
559  } else {
560  cout << " etSumEcalSumPUSLUT= [0]" << endl;
561  }
562 
563  if (!ptr1->metCalibrationLUT()->empty()) {
564  cout << " metCalibrationLUT= [" << ptr1->metCalibrationLUT()->maxSize() << "] " << flush;
565  int metCalibrationLUT[ptr1->metCalibrationLUT()->maxSize()];
566  for (unsigned int i = 0; i < ptr1->metCalibrationLUT()->maxSize(); i++)
567  metCalibrationLUT[i] = ptr1->metCalibrationLUT()->data(i);
568 
569  cout << hash(metCalibrationLUT, sizeof(int) * ptr1->metCalibrationLUT()->maxSize()) << endl;
570 
571  if (printMetCalibrationLUT)
572  for (unsigned int i = 0; i < ptr1->metCalibrationLUT()->maxSize(); i++)
573  cout << i << " " << metCalibrationLUT[i] << endl;
574 
575  } else {
576  cout << " metCalibrationLUT= [0]" << endl;
577  }
578 
579  if (!ptr1->metHFCalibrationLUT()->empty()) {
580  cout << " metHFCalibrationLUT= [" << ptr1->metHFCalibrationLUT()->maxSize() << "] " << flush;
581  int metHFCalibrationLUT[ptr1->metHFCalibrationLUT()->maxSize()];
582  for (unsigned int i = 0; i < ptr1->metHFCalibrationLUT()->maxSize(); i++)
583  metHFCalibrationLUT[i] = ptr1->metHFCalibrationLUT()->data(i);
584 
585  cout << hash(metHFCalibrationLUT, sizeof(int) * ptr1->metHFCalibrationLUT()->maxSize()) << endl;
586 
587  if (printMetHFCalibrationLUT)
588  for (unsigned int i = 0; i < ptr1->metHFCalibrationLUT()->maxSize(); i++)
589  cout << i << " " << metHFCalibrationLUT[i] << endl;
590 
591  } else {
592  cout << " metHFCalibrationLUT= [0]" << endl;
593  }
594 
595  if (!ptr1->metPhiCalibrationLUT()->empty()) {
596  cout << " metPhiCalibrationLUT= [" << ptr1->metPhiCalibrationLUT()->maxSize() << "] " << flush;
597  int metPhiCalibrationLUT[ptr1->metPhiCalibrationLUT()->maxSize()];
598  for (unsigned int i = 0; i < ptr1->metPhiCalibrationLUT()->maxSize(); i++)
599  metPhiCalibrationLUT[i] = ptr1->metPhiCalibrationLUT()->data(i);
600 
601  cout << hash(metPhiCalibrationLUT, sizeof(int) * ptr1->metPhiCalibrationLUT()->maxSize()) << endl;
602 
603  if (printMetPhiCalibrationLUT)
604  for (unsigned int i = 0; i < ptr1->metPhiCalibrationLUT()->maxSize(); i++)
605  cout << i << " " << metPhiCalibrationLUT[i] << endl;
606 
607  } else {
608  cout << " metPhiCalibrationLUT= [0]" << endl;
609  }
610 
611  if (!ptr1->metHFPhiCalibrationLUT()->empty()) {
612  cout << " metHFPhiCalibrationLUT= [" << ptr1->metHFPhiCalibrationLUT()->maxSize() << "] " << flush;
613  int metHFPhiCalibrationLUT[ptr1->metHFPhiCalibrationLUT()->maxSize()];
614  for (unsigned int i = 0; i < ptr1->metHFPhiCalibrationLUT()->maxSize(); i++)
615  metHFPhiCalibrationLUT[i] = ptr1->metHFPhiCalibrationLUT()->data(i);
616 
617  cout << hash(metHFPhiCalibrationLUT, sizeof(int) * ptr1->metHFPhiCalibrationLUT()->maxSize()) << endl;
618 
619  if (printMetHFCalibrationLUT)
620  for (unsigned int i = 0; i < ptr1->metHFPhiCalibrationLUT()->maxSize(); i++)
621  cout << i << " " << metHFPhiCalibrationLUT[i] << endl;
622 
623  } else {
624  cout << " metHFPhiCalibrationLUT= [0]" << endl;
625  }
626 
627  if (!ptr1->etSumEttCalibrationLUT()->empty()) {
628  cout << " etSumEttCalibrationLUT= [" << ptr1->etSumEttCalibrationLUT()->maxSize() << "] " << flush;
629  int etSumEttCalibrationLUT[ptr1->etSumEttCalibrationLUT()->maxSize()];
630  for (unsigned int i = 0; i < ptr1->etSumEttCalibrationLUT()->maxSize(); i++)
631  etSumEttCalibrationLUT[i] = ptr1->etSumEttCalibrationLUT()->data(i);
632 
633  cout << hash(etSumEttCalibrationLUT, sizeof(int) * ptr1->etSumEttCalibrationLUT()->maxSize()) << endl;
634 
635  if (printEtSumEttCalibrationLUT)
636  for (unsigned int i = 0; i < ptr1->etSumEttCalibrationLUT()->maxSize(); i++)
637  cout << i << " " << etSumEttCalibrationLUT[i] << endl;
638 
639  } else {
640  cout << " etSumEttCalibrationLUT= [0]" << endl;
641  }
642 
643  if (!ptr1->etSumEcalSumCalibrationLUT()->empty()) {
644  cout << " etSumEcalSumCalibrationLUT=[" << ptr1->etSumEttCalibrationLUT()->maxSize() << "] " << flush;
645  int etSumEcalSumCalibrationLUT[ptr1->etSumEcalSumCalibrationLUT()->maxSize()];
646  for (unsigned int i = 0; i < ptr1->etSumEcalSumCalibrationLUT()->maxSize(); i++)
647  etSumEcalSumCalibrationLUT[i] = ptr1->etSumEcalSumCalibrationLUT()->data(i);
648 
649  cout << hash(etSumEcalSumCalibrationLUT, sizeof(int) * ptr1->etSumEcalSumCalibrationLUT()->maxSize()) << endl;
650 
651  if (printEtSumEcalSumCalibrationLUT)
652  for (unsigned int i = 0; i < ptr1->etSumEcalSumCalibrationLUT()->maxSize(); i++)
653  cout << i << " " << etSumEcalSumCalibrationLUT[i] << endl;
654 
655  } else {
656  cout << " etSumEcalSumCalibrationLUT=[0]" << endl;
657  }
658 
659  cout << endl << " HI centrality trigger: " << endl;
660  cout << " centralityLUT= [";
661  for (unsigned int i = 0; i < ptr1->centralityLUT()->maxSize(); i++)
662  cout << (i == 0 ? "" : ",") << ptr1->centralityLUT()->data(i);
663  cout << "]" << endl;
664 
665  std::vector<int> mbt = ptr1->minimumBiasThresholds();
666  cout << " minimumBiasThresholds= [";
667  for (unsigned int i = 0; i < mbt.size(); i++)
668  cout << mbt[i];
669  cout << "]" << endl;
670 
671  cout << endl << "centralityRegionMask() = " << ptr1->centralityRegionMask() << endl;
672  cout << endl << "jetRegionMask() = " << ptr1->jetRegionMask() << endl;
673  cout << endl << "tauRegionMask() = " << ptr1->tauRegionMask() << endl;
674 
675  cout << endl << " HI Q2 trigger: " << endl;
676  cout << " q2LUT= [";
677  for (unsigned int i = 0; i < ptr1->q2LUT()->maxSize(); i++)
678  cout << (i == 0 ? "" : ",") << ptr1->q2LUT()->data(i);
679  cout << "]" << endl;
680 
681  cout << endl << " Layer1: " << endl;
682  std::vector<double> ecalSF = ptr1->layer1ECalScaleFactors();
683  cout << " layer1ECalScaleFactors= [" << ecalSF.size() << "] " << flush;
684  int _ecalSF[ecalSF.size()];
685  for (unsigned int i = 0; i < ecalSF.size(); i++)
686  _ecalSF[i] = int(ecalSF[i] * 100000.);
687  cout << hash(_ecalSF, sizeof(int) * ecalSF.size()) << endl;
688  if (printEcalSF) {
689  cout << endl << " [" << endl;
690  for (unsigned int i = 0; i < ecalSF.size(); i++)
691  cout << (i == 0 ? "" : ",") << int(ecalSF[i] * 1000.) / 1000.;
692  cout << "]" << endl;
693  }
694  std::vector<double> hcalSF = ptr1->layer1HCalScaleFactors();
695  cout << " layer1HCalScaleFactors= [" << hcalSF.size() << "] " << flush;
696  int _hcalSF[hcalSF.size()];
697  for (unsigned int i = 0; i < hcalSF.size(); i++) {
698  // round false precision
699  // double significand;
700  // int exponent;
701  // significand = frexp( hcalSF[i], &exponent );
702  // _hcalSF[i] = ldexp( int(significand*10000)/10000., exponent );
703  _hcalSF[i] = int(hcalSF[i] * 100000.);
704  }
705  cout << hash(_hcalSF, sizeof(int) * hcalSF.size()) << endl;
706  if (printHcalSF) {
707  cout << endl << " [" << endl;
708  for (unsigned int i = 0; i < hcalSF.size(); i++)
709  cout << (i == 0 ? "" : ",") << int(hcalSF[i] * 1000.) / 1000.;
710  cout << "]" << endl;
711  }
712  std::vector<double> hfSF = ptr1->layer1HFScaleFactors();
713  cout << " layer1HFScaleFactors= [" << hfSF.size() << "] " << flush;
714  int _hfSF[hfSF.size()];
715  for (unsigned int i = 0; i < hfSF.size(); i++)
716  _hfSF[i] = int(hfSF[i] * 100000.);
717  cout << hash(_hfSF, sizeof(int) * hfSF.size()) << endl;
718  if (printHfSF) {
719  cout << endl << " [" << endl;
720  for (unsigned int i = 0; i < hfSF.size(); i++)
721  cout << (i == 0 ? "" : ",") << int(hfSF[i] * 1000.) / 1000.;
722  cout << "]" << endl;
723  }
724 
725  std::vector<int> ecalScaleET = ptr1->layer1ECalScaleETBins();
726  cout << " layer1ECalScaleETBins= [";
727  for (unsigned int i = 0; i < ecalScaleET.size(); i++)
728  cout << (i == 0 ? "" : ",") << ecalScaleET[i];
729  cout << "]" << endl;
730  std::vector<int> hcalScaleET = ptr1->layer1HCalScaleETBins();
731  cout << " layer1HCalScaleETBins= [";
732  for (unsigned int i = 0; i < hcalScaleET.size(); i++)
733  cout << (i == 0 ? "" : ",") << hcalScaleET[i];
734  cout << "]" << endl;
735  std::vector<int> hfScaleET = ptr1->layer1HFScaleETBins();
736  cout << " layer1HFScaleETBins= [";
737  for (unsigned int i = 0; i < hfScaleET.size(); i++)
738  cout << (i == 0 ? "" : ",") << hfScaleET[i];
739  cout << "]" << endl;
740 
741  std::vector<unsigned> layer1ECalScalePhi = ptr1->layer1ECalScalePhiBins();
742  cout << " layer1ECalScalePhi= [";
743  for (unsigned int i = 0; i < layer1ECalScalePhi.size(); i++)
744  cout << (i == 0 ? "" : ",") << layer1ECalScalePhi[i];
745  cout << "]" << endl;
746  std::vector<unsigned> layer1HCalScalePhi = ptr1->layer1HCalScalePhiBins();
747  cout << " layer1HCalScalePhi= [";
748  for (unsigned int i = 0; i < layer1HCalScalePhi.size(); i++)
749  cout << (i == 0 ? "" : ",") << layer1HCalScalePhi[i];
750  cout << "]" << endl;
751  std::vector<unsigned> layer1HFScalePhiBins = ptr1->layer1HFScalePhiBins();
752  cout << " layer1HFScalePhiBins= [";
753  for (unsigned int i = 0; i < layer1HFScalePhiBins.size(); i++)
754  cout << (i == 0 ? "" : ",") << layer1HFScalePhiBins[i];
755  cout << "]" << endl;
756 
757  // std::vector<unsigned> layer1SecondStageLUT = ptr1->layer1SecondStageLUT();
758  // cout<<" layer1HFScalePhiBins= ["; for(unsigned int i=0; i<layer1SecondStageLUT.size(); i++) cout<<(i==0?"":",")<<layer1SecondStageLUT[i]; cout<<"]"<<endl;
759 }
760 
764 
constexpr int32_t ceil(float num)
void openssl_init()
Definition: openssl_init.cc:5
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::string hash(void *buf, size_t len) const
#define EVP_MD_CTX_free
Definition: openssl_init.h:7
int iEvent
Definition: GenABIO.cc:224
T const * product() const
Definition: ESHandle.h:86
#define EVP_MD_CTX_new
Definition: openssl_init.h:6
T get() const
Definition: EventSetup.h:82
~L1TCaloParamsViewer(void) override
L1TCaloParamsViewer(const edm::ParameterSet &pset)
Log< level::Info, false > LogInfo
HLT enums.
tmp
align.sh
Definition: createJobs.py:716
void analyze(const edm::Event &, const edm::EventSetup &) override