Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 
0002 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0003 
0004 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0005 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0006 #include "DataFormats/DetId/interface/DetId.h"
0007 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
0008 #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h"
0009 #include "Calibration/Tools/interface/calibXMLwriter.h"
0010 #include "Calibration/Tools/interface/CalibrationCluster.h"
0011 #include "Calibration/Tools/interface/HouseholderDecomposition.h"
0012 #include "Calibration/Tools/interface/MinL3Algorithm.h"
0013 #include "Calibration/EcalCalibAlgos/interface/ZeeRescaleFactorPlots.h"
0014 #include "DataFormats/EgammaCandidates/interface/Electron.h"
0015 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
0016 #include "DataFormats/TrackReco/interface/Track.h"
0017 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0018 #include "DataFormats/TrackReco/interface/TrackExtraFwd.h"
0019 #include "TFile.h"
0020 #include "TH1.h"
0021 #include "TH2.h"
0022 #include "TF1.h"
0023 #include "TRandom.h"
0024 
0025 #include <iostream>
0026 #include <string>
0027 #include <stdexcept>
0028 #include <vector>
0029 
0030 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0031 
0032 ZeeRescaleFactorPlots::ZeeRescaleFactorPlots(char* fileName) {
0033   fileName_ = fileName;
0034   file_ = new TFile(fileName_, "RECREATE");
0035 }
0036 
0037 ZeeRescaleFactorPlots::~ZeeRescaleFactorPlots() {
0038   file_->Close();
0039 
0040   delete file_;
0041 }
0042 
0043 //========================================================================
0044 
0045 void ZeeRescaleFactorPlots::writeHistograms(ZIterativeAlgorithmWithFit* theAlgorithm_) {
0046   file_->cd();
0047 
0048   const ZIterativeAlgorithmWithFit::ZIterativeAlgorithmWithFitPlots* algoHistos = theAlgorithm_->getHistos();
0049 
0050   for (int iIteration = 0; iIteration < theAlgorithm_->getNumberOfIterations(); iIteration++)
0051     for (int iChannel = 0; iChannel < theAlgorithm_->getNumberOfChannels(); iChannel++) {
0052       if (iChannel % 20 == 0) {
0053         file_->cd();
0054 
0055         algoHistos->weightedRescaleFactor[iIteration][iChannel]->Write();
0056         algoHistos->unweightedRescaleFactor[iIteration][iChannel]->Write();
0057         algoHistos->weight[iIteration][iChannel]->Write();
0058       }
0059     }
0060 }