CMS 3D CMS Logo

miscalibExample Class Reference

Description: Analyzer to fetch collection of objects from event and make simple plots. More...

#include <Calibration/EcalCalibAlgos/src/miscalibExample.cc>

Inheritance diagram for miscalibExample:

edm::EDAnalyzer

List of all members.

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


Detailed Description

Description: Analyzer to fetch collection of objects from event and make simple plots.

Description: Perform single electron calibration (tested on TB data only).

Implementation: \

Author:
: Lorenzo Agostino, September 2006
Implementation: <Notes on="" implementation>="">

Definition at line 37 of file miscalibExample.h.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 91 of file miscalibExample.cc.

00092 {
00093  
00094 
00095 }


Member Function Documentation

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  }

void miscalibExample::endJob ( void   )  [virtual]

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 }


Member Data Documentation

std::string miscalibExample::BarrelHitsCollection_ [private]

Definition at line 52 of file miscalibExample.h.

std::string miscalibExample::correctedHybridSuperClusterCollection_ [private]

Definition at line 51 of file miscalibExample.h.

Referenced by analyze(), and miscalibExample().

std::string miscalibExample::correctedHybridSuperClusterProducer_ [private]

Definition at line 50 of file miscalibExample.h.

Referenced by analyze(), and miscalibExample().

std::string miscalibExample::ecalHitsProducer_ [private]

Definition at line 53 of file miscalibExample.h.

int miscalibExample::read_events [private]

Definition at line 54 of file miscalibExample.h.

Referenced by analyze(), beginJob(), and endJob().

std::string miscalibExample::rootfile_ [private]

Definition at line 49 of file miscalibExample.h.

Referenced by endJob(), and miscalibExample().

TH1F* miscalibExample::scEnergy [private]

Definition at line 56 of file miscalibExample.h.

Referenced by analyze(), beginJob(), and endJob().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:17 2009 for CMSSW by  doxygen 1.5.4