Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:32

0001 #include "SimCalorimetry/HcalSimAlgos/interface/HcalShape.h"
0002 #include "SimCalorimetry/HcalSimAlgos/interface/HFShape.h"
0003 #include "SimCalorimetry/CaloSimAlgos/interface/CaloShapeIntegrator.h"
0004 #include "SimCalorimetry/CaloSimAlgos/interface/CaloCachedShapeIntegrator.h"
0005 #include <iostream>
0006 #include <cassert>
0007 #include <cmath>
0008 
0009 int main() {
0010   HFShape shape;
0011   CaloShapeIntegrator i1(&shape);
0012   CaloCachedShapeIntegrator i2(&shape);
0013   float maxdiff = 0.;
0014   for (float t = -25; t < 256; t += 0.25) {
0015     double v1 = i1(t);
0016     double v2 = i2(t);
0017     float diff = fabs(v1 - v2);
0018     if (diff > maxdiff) {
0019       maxdiff = diff;
0020     }
0021   }
0022   std::cout << "Maximum discrepancy " << maxdiff << std::endl;
0023 }