33 #include <openssl/sha.h> 39 char tmp[SHA_DIGEST_LENGTH*2+1];
40 bzero(tmp,
sizeof(tmp));
42 if( !SHA1_Init( &ctx ) )
43 throw cms::Exception(
"L1TCaloParamsReader::hash")<<
"SHA1 initialization error";
45 if( !SHA1_Update( &ctx, buf, len ) )
46 throw cms::Exception(
"L1TCaloParamsReader::hash")<<
"SHA1 processing error";
48 unsigned char hash[SHA_DIGEST_LENGTH];
49 if( !SHA1_Final(hash, &ctx) )
50 throw cms::Exception(
"L1TCaloParamsReader::hash")<<
"SHA1 finalization error";
53 for(
unsigned int i=0;
i<20;
i++)
54 ::sprintf(&tmp[
i*2],
"%02x", hash[i]);
71 cout<<endl<<
" Towers: "<<endl;
72 cout<<
" towerLsbH= "<<ptr1->towerLsbH()<<endl;
73 cout<<
" towerLsbE= "<<ptr1->towerLsbE()<<endl;
74 cout<<
" towerLsbSum= "<<ptr1->towerLsbSum()<<endl;
75 cout<<
" towerNBitsH= "<<ptr1->towerNBitsH()<<endl;
76 cout<<
" towerNBitsE= "<<ptr1->towerNBitsE()<<endl;
77 cout<<
" towerNBitsSum= "<<ptr1->towerNBitsSum()<<endl;
78 cout<<
" towerNBitsRatio= "<<ptr1->towerNBitsRatio()<<endl;
79 cout<<
" towerMaskE= "<<ptr1->towerMaskE()<<endl;
80 cout<<
" towerMaskH= "<<ptr1->towerMaskH()<<endl;
81 cout<<
" towerMaskSum= "<<ptr1->towerMaskSum()<<endl;
82 cout<<
" towerEncoding= "<<ptr1->doTowerEncoding()<<endl;
84 cout<<endl<<
" Regions: "<<endl;
85 cout<<
" regionLsb= "<<ptr1->regionLsb()<<endl;
86 cout<<
" regionPUSType= "<<ptr1->regionPUSType()<<endl;
87 cout<<
" regionPUSParams= ["<<ptr1->regionPUSParams().size()<<
"] ";
88 double pusParams[ptr1->regionPUSParams().size()];
90 for(
unsigned int i=0;
i<ptr1->regionPUSParams().size();
i++){
91 pusParams[
i] = ceil(2*ptr1->regionPUSParams()[
i]);
95 if( ptr1->regionPUSParams().size() )
96 cout <<
hash(pusParams,
sizeof(
double)*ptr1->regionPUSParams().size()) << endl;
100 cout<<endl<<
" EG: "<<endl;
101 cout<<
" egLsb= "<<ptr1->egLsb()<<endl;
102 cout<<
" egSeedThreshold= "<<ptr1->egSeedThreshold()<<endl;
103 cout<<
" egNeighbourThreshold= "<<ptr1->egNeighbourThreshold()<<endl;
104 cout<<
" egHcalThreshold= "<<ptr1->egHcalThreshold()<<endl;
106 if( !ptr1->egTrimmingLUT()->empty() ){
107 cout<<
" egTrimmingLUT= ["<<ptr1->egTrimmingLUT()->maxSize()<<
"] "<<flush;
108 int egTrimming[ptr1->egTrimmingLUT()->maxSize()];
109 for(
unsigned int i=0;
i<ptr1->egTrimmingLUT()->maxSize();
i++) egTrimming[
i] = ptr1->egTrimmingLUT()->data(
i);
110 cout <<
hash( egTrimming,
sizeof(
int)*ptr1->egTrimmingLUT()->maxSize() ) << endl;
112 cout<<
" egTrimmingLUT= [0] "<<endl;
115 cout<<
" egMaxHcalEt= "<<ptr1->egMaxHcalEt()<<endl;
116 cout<<
" egMaxPtHOverE= "<<ptr1->egMaxPtHOverE()<<endl;
117 cout<<
" egMaxHcalEt= "<<ptr1->egMaxHcalEt()<<endl;
118 cout<<
" egMinPtJetIsolation= "<<ptr1->egMinPtJetIsolation()<<endl;
119 cout<<
" egMaxPtJetIsolation= "<<ptr1->egMaxPtJetIsolation()<<endl;
120 cout<<
" egMinPtHOverEIsolation= "<<ptr1->egMinPtHOverEIsolation()<<endl;
121 cout<<
" egMaxPtHOverEIsolation= "<<ptr1->egMaxPtHOverEIsolation()<<endl;
123 if( !ptr1->egMaxHOverELUT()->empty() ){
124 cout<<
" egMaxHOverELUT= ["<<ptr1->egMaxHOverELUT()->maxSize()<<
"] ";
125 int egMaxHOverE[ptr1->egMaxHOverELUT()->maxSize()];
126 for(
unsigned int i=0;
i<ptr1->egMaxHOverELUT()->maxSize();
i++) egMaxHOverE[
i] = ptr1->egMaxHOverELUT()->data(
i);
127 cout <<
hash( egMaxHOverE,
sizeof(
int)*ptr1->egMaxHOverELUT()->maxSize() ) << endl;
129 cout<<
" egMaxHOverELUT= [0]"<<endl;
132 if( !ptr1->egCompressShapesLUT()->empty() ){
133 cout<<
" egCompressShapesLUT= ["<<ptr1->egCompressShapesLUT()->maxSize()<<
"] ";
134 int egCompressShapes[ptr1->egCompressShapesLUT()->maxSize()];
135 for(
unsigned int i=0;
i<ptr1->egCompressShapesLUT()->maxSize();
i++) egCompressShapes[
i] = ptr1->egCompressShapesLUT()->data(
i);
136 cout <<
hash( egCompressShapes,
sizeof(
int)*ptr1->egCompressShapesLUT()->maxSize() ) << endl;
138 cout<<
" egCompressShapesLUT= [0]"<<endl;
143 if( !ptr1->egShapeIdLUT()->empty() ){
144 cout<<
" egShapeIdLUT= ["<<ptr1->egShapeIdLUT()->maxSize()<<
"] "<<flush;
145 int egShapeId[ptr1->egShapeIdLUT()->maxSize()];
146 for(
unsigned int i=0;
i<ptr1->egShapeIdLUT()->maxSize();
i++) egShapeId[
i] = ptr1->egShapeIdLUT()->data(
i);
147 cout <<
hash( egShapeId,
sizeof(
int)*ptr1->egShapeIdLUT()->maxSize() )<<endl;
149 cout<<
" egShapeIdLUT= [0]"<<endl;
152 cout<<
" egPUSType= "<<ptr1->egPUSType()<<endl;
154 if( !ptr1->egIsolationLUT()->empty() ){
155 cout<<
" egIsoLUT= ["<<ptr1->egIsolationLUT()->maxSize()<<
"] "<<flush;
156 int egIsolation[ptr1->egIsolationLUT()->maxSize()];
157 for(
unsigned int i=0;
i<ptr1->egIsolationLUT()->maxSize();
i++) egIsolation[
i] = ptr1->egIsolationLUT()->data(
i);
158 cout <<
hash( egIsolation,
sizeof(
int)*ptr1->egIsolationLUT()->maxSize() ) << endl;
160 cout<<
" egIsoLUT= [0]"<<endl;
163 cout<<
" egIsoAreaNrTowersEta= "<<ptr1->egIsoAreaNrTowersEta()<<endl;
164 cout<<
" egIsoAreaNrTowersPhi= "<<ptr1->egIsoAreaNrTowersPhi()<<endl;
165 cout<<
" egIsoVetoNrTowersPhi= "<<ptr1->egIsoVetoNrTowersPhi()<<endl;
166 cout<<
" egPUSParams= ["<<ptr1->egPUSParams().size()<<
"] "<<flush;
167 double egPUSParams[ptr1->egPUSParams().size()];
168 for(
unsigned int i=0;
i<ptr1->egPUSParams().size();
i++) egPUSParams[
i] = ptr1->egPUSParams()[
i];
170 if( ptr1->egPUSParams().size() )
171 cout <<
hash( egPUSParams,
sizeof(
double)*ptr1->egPUSParams().size() ) << endl;
174 cout<<
" egCalibrationType= "<<ptr1->egCalibrationType()<<endl;
176 if( !ptr1->egCalibrationLUT()->empty() ){
177 cout<<
" egCalibrationLUT= ["<<ptr1->egCalibrationLUT()->maxSize()<<
"] "<<flush;
178 int egCalibration[ptr1->egCalibrationLUT()->maxSize()];
179 for(
unsigned int i=0;
i<ptr1->egCalibrationLUT()->maxSize();
i++) egCalibration[
i] = ptr1->egCalibrationLUT()->data(
i);
180 cout <<
hash( egCalibration,
sizeof(
int)*ptr1->egCalibrationLUT()->maxSize() ) << endl;
182 cout<<
" egCalibrationLUT= [0]"<<endl;
185 cout<<endl<<
" Tau: "<<endl;
186 cout<<
" tauLsb= "<<ptr1->tauLsb()<<endl;
187 cout<<
" tauSeedThreshold= "<<ptr1->tauSeedThreshold()<<endl;
188 cout<<
" tauNeighbourThreshold= "<<ptr1->tauNeighbourThreshold()<<endl;
189 cout<<
" tauMaxPtTauVeto= "<<ptr1->tauMaxPtTauVeto()<<endl;
190 cout<<
" tauMinPtJetIsolationB= "<<ptr1->tauMinPtJetIsolationB()<<endl;
191 cout<<
" tauPUSType= "<<ptr1->tauPUSType()<<endl;
192 cout<<
" tauMaxJetIsolationB= "<<ptr1->tauMaxJetIsolationB()<<endl;
193 cout<<
" tauMaxJetIsolationA= "<<ptr1->tauMaxJetIsolationA()<<endl;
194 cout<<
" tauIsoAreaNrTowersEta= "<<ptr1->tauIsoAreaNrTowersEta()<<endl;
195 cout<<
" tauIsoAreaNrTowersPhi= "<<ptr1->tauIsoAreaNrTowersPhi()<<endl;
196 cout<<
" tauIsoVetoNrTowersPhi= "<<ptr1->tauIsoVetoNrTowersPhi()<<endl;
197 if( !ptr1->tauIsolationLUT()->empty() ){
198 cout<<
" tauIsoLUT= ["<<ptr1->tauIsolationLUT()->maxSize()<<
"] "<<flush;
199 int tauIsolation[ptr1->tauIsolationLUT()->maxSize()];
200 for(
unsigned int i=0;
i<ptr1->tauIsolationLUT()->maxSize();
i++) tauIsolation[
i] = ptr1->tauIsolationLUT()->data(
i);
201 cout <<
hash( tauIsolation,
sizeof(
int)*ptr1->tauIsolationLUT()->maxSize() ) << endl;
203 cout<<
" tauIsoLUT= [0]"<<endl;
206 if( !ptr1->tauCalibrationLUT()->empty() ){
207 cout<<
" tauCalibrationLUT= ["<<ptr1->tauCalibrationLUT()->maxSize()<<
"] "<<flush;
208 int tauCalibration[ptr1->tauCalibrationLUT()->maxSize()];
209 for(
unsigned int i=0;
i<ptr1->tauCalibrationLUT()->maxSize();
i++)
210 tauCalibration[
i] = ptr1->tauCalibrationLUT()->data(
i);
211 cout <<
hash( tauCalibration,
sizeof(
int)*ptr1->tauCalibrationLUT()->maxSize() ) << endl;
214 for(
unsigned int i=0;
i<ptr1->tauCalibrationLUT()->maxSize();
i++)
215 cout<<
i<<
" "<<tauCalibration[
i]<<endl;
218 cout<<
" tauCalibrationLUT= [0]"<<endl;
221 if( !ptr1->tauEtToHFRingEtLUT()->empty() ){
222 cout<<
" tauEtToHFRingEtLUT= ["<<ptr1->tauEtToHFRingEtLUT()->maxSize()<<
"] "<<flush;
223 int tauEtToHFRingEt[ptr1->tauEtToHFRingEtLUT()->maxSize()];
224 for(
unsigned int i=0;
i<ptr1->tauEtToHFRingEtLUT()->maxSize();
i++) tauEtToHFRingEt[
i] = ptr1->tauEtToHFRingEtLUT()->data(
i);
226 cout <<
hash( tauEtToHFRingEt,
sizeof(
int)*ptr1->tauEtToHFRingEtLUT()->maxSize() ) << endl;
228 cout<<
" tauEtToHFRingEtLUT= [0]"<<endl;
231 cout<<
" isoTauEtaMin= "<<ptr1->isoTauEtaMin()<<endl;
232 cout<<
" isoTauEtaMax= "<<ptr1->isoTauEtaMax()<<endl;
233 cout<<
" tauPUSParams= ["<<ptr1->tauPUSParams().size()<<
"] "<<flush;
234 double tauPUSParams[ptr1->tauPUSParams().size()];
235 for(
unsigned int i=0;
i<ptr1->tauPUSParams().size();
i++) tauPUSParams[
i] = ptr1->tauPUSParams()[
i];
237 if( ptr1->tauPUSParams().size() )
238 cout <<
hash( tauPUSParams,
sizeof(
double)*ptr1->tauPUSParams().size() ) << endl;
241 cout<<endl<<
" Jets: "<<endl;
242 cout<<
" jetLsb= "<<ptr1->jetLsb()<<endl;
243 cout<<
" jetSeedThreshold= "<<ptr1->jetSeedThreshold()<<endl;
244 cout<<
" jetNeighbourThreshold= "<<ptr1->jetNeighbourThreshold()<<endl;
245 cout<<
" jetPUSType= "<<ptr1->jetPUSType()<<endl;
246 cout<<
" jetCalibrationType= "<<ptr1->jetCalibrationType()<<endl;
247 cout<<
" jetCalibrationParams= ["<<ptr1->jetCalibrationParams().size()<<
"] "<<flush;
248 double jetCalibrationParams[ptr1->jetCalibrationParams().size()];
249 for(
unsigned int i=0;
i<ptr1->jetCalibrationParams().size();
i++) jetCalibrationParams[
i] = ptr1->jetCalibrationParams()[
i];
251 if( ptr1->jetCalibrationParams().size() )
252 cout <<
hash( jetCalibrationParams,
sizeof(
double)*ptr1->jetCalibrationParams().size() ) << endl;
255 if( !ptr1->jetCalibrationLUT()->empty() ){
256 cout<<
" jetCalibrationLUT= ["<<ptr1->jetCalibrationLUT()->maxSize()<<
"] "<<flush;
257 int jetCalibration[ptr1->jetCalibrationLUT()->maxSize()];
258 for(
unsigned int i=0;
i<ptr1->jetCalibrationLUT()->maxSize();
i++)
259 jetCalibration[
i] = ptr1->jetCalibrationLUT()->data(
i);
261 cout <<
hash( jetCalibration,
sizeof(
int)*ptr1->jetCalibrationLUT()->maxSize() ) << endl;
264 for(
unsigned int i=0;
i<ptr1->jetCalibrationLUT()->maxSize();
i++)
265 cout<<
i<<
" "<<jetCalibration[
i]<<endl;
268 cout<<
" jetCalibrationLUT= [0]"<<endl;
271 cout<<endl<<
" Sums: "<<endl;
272 cout<<
" etSumLsb= "<<ptr1->etSumLsb()<<endl;
277 cout<<endl<<
" HI centrality trigger: "<<endl;
278 cout<<
" centralityLUT= [";
for(
unsigned int i=0;
i<ptr1->centralityLUT()->maxSize();
i++)
cout<<(
i==0?
"":
",")<<ptr1->centralityLUT()->data(
i);
cout<<
"]"<<endl;
280 cout<<endl<<
"centralityRegionMask() = "<<ptr1->centralityRegionMask()<<endl;
281 cout<<endl<<
"jetRegionMask() = "<<ptr1->jetRegionMask()<<endl;
282 cout<<endl<<
"tauRegionMask() = "<<ptr1->tauRegionMask()<<endl;
284 cout<<endl<<
" HI Q2 trigger: "<<endl;
285 cout<<
" q2LUT= [";
for(
unsigned int i=0;
i<ptr1->q2LUT()->maxSize();
i++)
cout<<(
i==0?
"":
",")<<ptr1->q2LUT()->data(
i);
cout<<
"]"<<endl;
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
virtual ~L1TCaloParamsReader(void)
std::string hash(void *buf, size_t len) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< std::vector< double > > tmp
T const * product() const
L1TCaloParamsReader(const edm::ParameterSet &pset)