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