CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Calibration/EcalCalibAlgos/interface/Pi0FixedMassWindowCalibration.h

Go to the documentation of this file.
00001 #ifndef Calibration_EcalCalibAlgos_Pi0FixedMassWindowCalibration_h
00002 #define Calibration_EcalCalibAlgos_Pi0FixedMassWindowCalibration_h
00003 
00004 #include <memory>
00005 #include <string>
00006 #include <iostream>
00007 
00008 #include <vector>
00009 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00010 
00011 // Framework
00012 #include "FWCore/Framework/interface/LooperFactory.h"
00013 #include "FWCore/Framework/interface/ESProducerLooper.h"
00014 #include "FWCore/Framework/interface/ESHandle.h"
00015 #include "FWCore/Framework/interface/Frameworkfwd.h"
00016 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00017 #include "FWCore/Framework/interface/EDProducer.h"
00018 #include "FWCore/Framework/interface/Event.h"
00019 #include "FWCore/Framework/interface/EventSetup.h"
00020 #include "FWCore/Framework/interface/ESHandle.h"
00021 
00022 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
00023 #include "DataFormats/DetId/interface/DetId.h"
00024 
00025 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00026 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00027 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00028 #include "DataFormats/HcalRecHit/interface/HBHERecHit.h"
00029 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
00030 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00031 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00032 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00033 #include "DataFormats/EcalDetId/interface/ESDetId.h"
00034 #include "DataFormats/DetId/interface/DetId.h"
00035 
00036 #include "FWCore/Framework/interface/Frameworkfwd.h"
00037 #include "FWCore/Framework/interface/EDProducer.h"
00038 #include "FWCore/Framework/interface/Event.h"
00039 #include "FWCore/Framework/interface/EventSetup.h"
00040 
00041 
00042 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00043 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00044 #include "RecoEcal/EgammaClusterAlgos/interface/IslandClusterAlgo.h"
00045 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
00046 #include "RecoEcal/EgammaCoreTools/interface/ClusterShapeAlgo.h"
00047 
00048 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
00049 
00050 
00051 #include "TFile.h"
00052 #include "TTree.h"
00053 #include "TH1F.h"
00054 #include "TF1.h"
00055 #include "TGraph.h"
00056 #include "TCanvas.h"
00057 
00058 class Pi0FixedMassWindowCalibration :  public edm::ESProducerLooper
00059 {
00060 
00061  public:
00062 
00064   Pi0FixedMassWindowCalibration( const edm::ParameterSet& iConfig );
00065   
00067   ~Pi0FixedMassWindowCalibration();
00068 
00070   virtual void produce(edm::Event&, const edm::EventSetup&) {};
00071 
00073   virtual void beginOfJob();
00074 
00076   virtual void endOfJob();
00077 
00079   virtual void startingNewLoop( unsigned int iLoop );
00080 
00082   virtual Status endOfLoop( const edm::EventSetup&, unsigned int iLoop );
00083 
00085   virtual Status duringLoop( const edm::Event&, const edm::EventSetup& );
00086 
00087  private:
00088 
00089   //  static const double PDGPi0Mass;
00090 
00091   int nevent;
00092 
00093   unsigned int theMaxLoops;   
00094   std::string ecalHitsProducer_;
00095   std::string barrelHits_;
00096 
00097 
00098   IslandClusterAlgo::VerbosityLevel verbosity;
00099 
00100   std::string barrelHitProducer_;
00101   std::string barrelHitCollection_;
00102   std::string barrelClusterCollection_;
00103   std::string clustershapecollectionEB_;
00104   std::string barrelClusterShapeAssociation_;
00105 
00106   PositionCalc posCalculator_; // position calculation algorithm
00107   ClusterShapeAlgo shapeAlgo_; // cluster shape algorithm
00108   IslandClusterAlgo * island_p;
00109 
00110   // Selection algorithm parameters
00111   double selePi0PtGammaOneMin_;
00112   double selePi0PtGammaTwoMin_;
00113 
00114   double selePi0DRBelt_;
00115   double selePi0DetaBelt_;
00116 
00117   double selePi0PtPi0Min_;
00118 
00119   double selePi0S4S9GammaOneMin_;
00120   double selePi0S4S9GammaTwoMin_;
00121   double selePi0S9S25GammaOneMin_;
00122   double selePi0S9S25GammaTwoMin_;
00123 
00124   double selePi0EtBeltIsoRatioMax_;
00125  
00126   double selePi0MinvMeanFixed_;
00127   double selePi0MinvSigmaFixed_;
00128 
00129 
00130 
00131   std::vector<DetId> barrelCells;
00132 
00133   // input calibration constants
00134   double oldCalibs_barl[85][360][2];
00135   double newCalibs_barl[85][360][2];
00136   double wxtals[85][360][2];
00137   double mwxtals[85][360][2];
00138 
00139   // steering parameters
00140 
00141   edm::ParameterSet theParameterSet;
00142 
00143 
00144   
00145 
00146   // map for all RecHits from ECal:
00147   std::map<DetId, EcalRecHit> *recHitsEB_map;
00148 
00149   const EcalRecHitCollection* ecalRecHitBarrelCollection;
00150   const EcalRecHitCollection* recalibEcalRecHitCollection;
00151 
00152 
00153   // root tree
00154   TFile* theFile;
00155 
00156   bool isfirstcall_;
00157 
00158 };
00159 
00160 #endif