#include <Calibration/EcalCalibAlgos/src/miscalibExample.cc>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob (edm::EventSetup const &) |
virtual void | endJob () |
miscalibExample (const edm::ParameterSet &) | |
~miscalibExample () | |
Private Attributes | |
std::string | BarrelHitsCollection_ |
std::string | correctedHybridSuperClusterCollection_ |
std::string | correctedHybridSuperClusterProducer_ |
std::string | ecalHitsProducer_ |
int | read_events |
std::string | rootfile_ |
TH1F * | scEnergy |
Description: Perform single electron calibration (tested on TB data only).
Implementation: \
Implementation: <Notes on="" implementation>="">Definition at line 37 of file miscalibExample.h.
miscalibExample::miscalibExample | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 81 of file miscalibExample.cc.
References correctedHybridSuperClusterCollection_, correctedHybridSuperClusterProducer_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and rootfile_.
00082 { 00083 00084 rootfile_ = iConfig.getUntrackedParameter<std::string>("rootfile","ecalSimpleTBanalysis.root"); 00085 correctedHybridSuperClusterProducer_ = iConfig.getParameter<std::string>("correctedHybridSuperClusterProducer"); 00086 correctedHybridSuperClusterCollection_ = iConfig.getParameter<std::string>("correctedHybridSuperClusterCollection"); 00087 00088 }
miscalibExample::~miscalibExample | ( | ) |
void miscalibExample::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 130 of file miscalibExample.cc.
References correctedHybridSuperClusterCollection_, correctedHybridSuperClusterProducer_, correctedHybridSuperClusters_cfi::correctedHybridSuperClusters, edm::Event::getByLabel(), read_events, scEnergy, and std.
00131 { 00132 //================================================================================= 00133 using namespace edm; 00134 using namespace std; 00135 00136 read_events++; 00137 00138 // Get hybrid super clusters after energy correction 00139 00140 Handle<reco::SuperClusterCollection> pCorrectedHybridSuperClusters; 00141 iEvent.getByLabel(correctedHybridSuperClusterProducer_, correctedHybridSuperClusterCollection_, pCorrectedHybridSuperClusters); 00142 if (!pCorrectedHybridSuperClusters.isValid()) { 00143 LogError("EgammaSimpleAnalyzer") << "Error! can't get collection with label " << correctedHybridSuperClusterCollection_.c_str() ; 00144 } 00145 const reco::SuperClusterCollection* correctedHybridSuperClusters = pCorrectedHybridSuperClusters.product(); 00146 00147 00148 reco::SuperClusterCollection::const_iterator superClusterIt; 00149 for(superClusterIt=correctedHybridSuperClusters->begin(); superClusterIt!=correctedHybridSuperClusters->end(); superClusterIt++ ) 00150 { 00151 00152 scEnergy->Fill(superClusterIt->energy()); 00153 00154 } 00155 00156 }
void miscalibExample::beginJob | ( | edm::EventSetup const & | iSetup | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 99 of file miscalibExample.cc.
References read_events, and scEnergy.
00099 { 00100 //======================================================================== 00101 00102 // Book histograms 00103 scEnergy = new TH1F("scEnergy","SuperCluster energy", 100, 20., 80.); 00104 read_events=0; 00105 00106 }
Reimplemented from edm::EDAnalyzer.
Definition at line 110 of file miscalibExample.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), f, read_events, rootfile_, and scEnergy.
00110 { 00111 //======================================================================== 00112 00113 std::cout << "************* STATISTICS **************" << std::endl; 00114 std::cout << "Read Events: " << read_events << std::endl; 00115 00116 00118 00119 TFile f(rootfile_.c_str(),"RECREATE"); 00120 00121 scEnergy->Write(); 00122 f.Close(); 00123 00124 }
std::string miscalibExample::BarrelHitsCollection_ [private] |
Definition at line 52 of file miscalibExample.h.
std::string miscalibExample::correctedHybridSuperClusterCollection_ [private] |
std::string miscalibExample::correctedHybridSuperClusterProducer_ [private] |
std::string miscalibExample::ecalHitsProducer_ [private] |
Definition at line 53 of file miscalibExample.h.
int miscalibExample::read_events [private] |
std::string miscalibExample::rootfile_ [private] |
TH1F* miscalibExample::scEnergy [private] |