File indexing completed on 2024-04-06 11:59:28
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 barrelWriter(EcalBarrel);
0021 CaloMiscalibMapEcal map;
0022 std::string barrelfile =
0023 "/afs/cern.ch/user/p/presotto/CMSSW_1_6_0/src/CalibCalorimetry/CaloMiscalibTools/data/ecal_barrel_startup.xml";
0024 map.prefillMap();
0025 MiscalibReaderFromXMLEcalBarrel barrelreader(map);
0026 if (!barrelfile.empty())
0027 barrelreader.parseXMLMiscalibFile(barrelfile);
0028
0029 EcalIntercalibConstants* constants = new EcalIntercalibConstants(map.get());
0030 const EcalIntercalibConstantMap& imap = constants->getMap();
0031
0032 std::string barrelfile2 = "EBcalib.xml";
0033 CaloMiscalibMapEcal map2;
0034 map2.prefillMap();
0035 MiscalibReaderFromXMLEcalBarrel barrelreader2(map2);
0036 if (!barrelfile2.empty())
0037 barrelreader2.parseXMLMiscalibFile(barrelfile2);
0038 EcalIntercalibConstants* constants2 = new EcalIntercalibConstants(map2.get());
0039 const EcalIntercalibConstantMap& imap2 = constants2->getMap();
0040 for (int eta = -85; eta <= 85; ++eta)
0041 for (int phi = 1; phi <= 360; ++phi) {
0042 if (!EBDetId::validDetId(eta, phi))
0043 continue;
0044 EBDetId eb(eta, phi, EBDetId::ETAPHIMODE);
0045 barrelWriter.writeLine(eb, *(imap.find(eb.rawId())) * *(imap2.find(eb.rawId())));
0046 }
0047 }