Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:23

0001 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0002 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0003 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0004 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
0005 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0006 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0007 #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h"
0008 #include "Calibration/Tools/interface/calibXMLwriter.h"
0009 #include "CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibTools.h"
0010 #include "CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapEcal.h"
0011 #include "CalibCalorimetry/CaloMiscalibTools/interface/MiscalibReaderFromXMLEcalBarrel.h"
0012 #include "CalibCalorimetry/CaloMiscalibTools/interface/MiscalibReaderFromXMLEcalEndcap.h"
0013 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
0014 #include "FWCore/Framework/interface/EventSetup.h"
0015 #include "FWCore/Framework/interface/ESHandle.h"
0016 
0017 #include "TFile.h"
0018 
0019 int main() {
0020   calibXMLwriter endcapWriter(EcalEndcap);
0021   CaloMiscalibMapEcal map;
0022   std::string endcapfile =
0023       "/afs/cern.ch/user/p/presotto/CMSSW_1_6_0/src/CalibCalorimetry/CaloMiscalibTools/data/ecal_endcap_startup.xml";
0024   map.prefillMap();
0025   MiscalibReaderFromXMLEcalEndcap endcapreader(map);
0026   if (!endcapfile.empty())
0027     endcapreader.parseXMLMiscalibFile(endcapfile);
0028 
0029   EcalIntercalibConstants* constants = new EcalIntercalibConstants(map.get());
0030   const EcalIntercalibConstantMap& imap = constants->getMap();
0031 
0032   std::string endcapfile2 = "EEcalib.xml";
0033   CaloMiscalibMapEcal map2;
0034   map2.prefillMap();
0035   MiscalibReaderFromXMLEcalEndcap endcapreader2(map2);
0036   if (!endcapfile2.empty())
0037     endcapreader2.parseXMLMiscalibFile(endcapfile2);
0038   EcalIntercalibConstants* constants2 = new EcalIntercalibConstants(map2.get());
0039   const EcalIntercalibConstantMap& imap2 = constants2->getMap();
0040   for (int x = 1; x <= 100; ++x)
0041     for (int y = 1; y < 100; ++y) {
0042       if (!EEDetId::validDetId(x, y, -1))
0043         continue;
0044       EEDetId ee(x, y, -1, EEDetId::XYMODE);
0045       endcapWriter.writeLine(ee, *(imap.find(ee.rawId())) * *(imap2.find(ee.rawId())));
0046       if (!EEDetId::validDetId(x, y, 1))
0047         continue;
0048       EEDetId e2(x, y, 1, EEDetId::XYMODE);
0049       endcapWriter.writeLine(e2, *(imap.find(e2.rawId())) * *(imap2.find(e2.rawId())));
0050     }
0051 }