CMS 3D CMS Logo

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