Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:08

0001 #include "CalibCalorimetry/HcalAlgos/interface/HcalShapeIntegrator.h"
0002 #include "CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h"
0003 #include <iostream>
0004 #include <cassert>
0005 #include <cmath>
0006 
0007 int main() {
0008   HcalPulseShapes shapes;
0009   const HcalPulseShapes::Shape& shape(shapes.hbShape());
0010   HcalShapeIntegrator i(&shape);
0011   float maxdiff = 0.;
0012   float maxtime = 0.;
0013 
0014   for (float t = -100; t < 200; t += 0.25) {
0015     float v1 = shape.integrate(t, t + 100.);
0016     float v2 = i(t, t + 100.);
0017     // only print interesting quantities
0018     if (v1 > 0. && v1 < 1.) {
0019       float diff = fabs(v1 - v2);
0020       if (diff > maxdiff) {
0021         maxdiff = diff;
0022         maxtime = t;
0023       }
0024     }
0025   }
0026   std::cout << "Biggest discrepancy is " << maxdiff << " at time " << maxtime << std::endl;
0027 }