![]() |
![]() |
00001 #ifndef __CentralityProvider_h__ 00002 #define __CentralityProvider_h__ 00003 #include <iostream> 00004 00005 #include "FWCore/Framework/interface/Event.h" 00006 #include "DataFormats/HeavyIonEvent/interface/Centrality.h" 00007 #include "FWCore/ParameterSet/interface/Registry.h" 00008 #include "CondFormats/HIObjects/interface/CentralityTable.h" 00009 #include "CondFormats/DataRecord/interface/HeavyIonRcd.h" 00010 #include "FWCore/Framework/interface/ESHandle.h" 00011 #include "FWCore/Utilities/interface/CodedException.h" 00012 00013 class CentralityProvider : public CentralityBins { 00014 00015 public: 00016 CentralityProvider(const edm::EventSetup& iSetup); 00017 ~CentralityProvider(){;} 00018 00019 enum VariableType {HFtowers,HFhits,PixelHits,PixelTracks,Tracks,EB,EE,Missing}; 00020 00021 int getNbins() const {return table_.size();} 00022 double centralityValue() const; 00023 int getBin() const {return CentralityBins::getBin(centralityValue());} 00024 float lowEdge() const { return lowEdgeOfBin(getBin());} 00025 float NpartMean() const { return NpartMeanOfBin(getBin());} 00026 float NpartSigma() const { return NpartSigmaOfBin(getBin());} 00027 float NcollMean() const { return NcollMeanOfBin(getBin());} 00028 float NcollSigma()const { return NcollSigmaOfBin(getBin());} 00029 float NhardMean() const { return NhardMeanOfBin(getBin());} 00030 float NhardSigma() const { return NhardSigmaOfBin(getBin());} 00031 float bMean() const { return bMeanOfBin(getBin());} 00032 float bSigma() const { return bSigmaOfBin(getBin());} 00033 void newRun(const edm::EventSetup& iSetup); 00034 void newEvent(const edm::Event& ev,const edm::EventSetup& iSetup); 00035 void print(); 00036 const CentralityBins* table() const {return this;} 00037 const reco::Centrality* raw() const {return chandle_.product();} 00038 00039 private: 00040 edm::InputTag tag_; 00041 std::string centralityVariable_; 00042 std::string centralityLabel_; 00043 std::string centralityMC_; 00044 unsigned int prevRun_; 00045 mutable edm::Handle<reco::Centrality> chandle_; 00046 VariableType varType_; 00047 }; 00048 00049 #endif 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060