CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Calibration/EcalCalibAlgos/src/ZeeRescaleFactorPlots.cc

Go to the documentation of this file.
00001 
00002 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00003 
00004 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00005 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00006 #include "DataFormats/DetId/interface/DetId.h"
00007 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
00008 #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h"
00009 #include "Calibration/Tools/interface/calibXMLwriter.h"
00010 #include "Calibration/Tools/interface/CalibrationCluster.h"
00011 #include "Calibration/Tools/interface/HouseholderDecomposition.h"
00012 #include "Calibration/Tools/interface/MinL3Algorithm.h"
00013 #include "Calibration/EcalCalibAlgos/interface/ZeeRescaleFactorPlots.h"
00014 #include "DataFormats/EgammaCandidates/interface/Electron.h"
00015 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00016 #include "DataFormats/TrackReco/interface/Track.h"
00017 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00018 #include "DataFormats/TrackReco/interface/TrackExtraFwd.h"
00019 #include "TFile.h"
00020 #include "TH1.h"
00021 #include "TH2.h"
00022 #include "TF1.h"
00023 #include "TRandom.h"
00024 
00025 
00026 #include <iostream>
00027 #include <string>
00028 #include <stdexcept>
00029 #include <vector>
00030 
00031 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
00032 
00033 ZeeRescaleFactorPlots::ZeeRescaleFactorPlots( char* fileName )
00034 {
00035 
00036   fileName_ = fileName;
00037   file_ = new TFile(fileName_, "RECREATE");
00038 }
00039 
00040 
00041 ZeeRescaleFactorPlots::~ZeeRescaleFactorPlots()
00042 {
00043 
00044   file_->Close();
00045 
00046   delete file_;
00047 
00048 }
00049 
00050 //========================================================================
00051 
00052 void ZeeRescaleFactorPlots::writeHistograms(ZIterativeAlgorithmWithFit* theAlgorithm_){
00053 
00054   file_ -> cd();
00055 
00056   
00057   const ZIterativeAlgorithmWithFit::ZIterativeAlgorithmWithFitPlots* algoHistos = theAlgorithm_->getHistos();
00058 
00059   for (int iIteration=0;iIteration<theAlgorithm_->getNumberOfIterations();iIteration++)
00060     for (int iChannel=0;iChannel<theAlgorithm_->getNumberOfChannels();iChannel++)
00061       {
00062 
00063         if(iChannel%20==0){
00064           
00065           file_ -> cd();
00066           
00067           algoHistos->weightedRescaleFactor[iIteration][iChannel]->Write();
00068           algoHistos->unweightedRescaleFactor[iIteration][iChannel]->Write();
00069           algoHistos->weight[iIteration][iChannel]->Write();
00070         }
00071 
00072 
00073       }
00074 
00075 
00076 }
00077 
00078