CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

EGEnergyAnalyzer Class Reference

#include <GBRWrap/EGEnergyAnalyzer/src/EGEnergyAnalyzer.cc>

Inheritance diagram for EGEnergyAnalyzer:
edm::EDAnalyzer

List of all members.

Public Member Functions

 EGEnergyAnalyzer (const edm::ParameterSet &)
 ~EGEnergyAnalyzer ()

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
virtual void endJob ()
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
virtual void endRun (edm::Run const &, edm::EventSetup const &)

Private Attributes

EGEnergyCorrector cordb
EGEnergyCorrector corfile

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 49 of file EGEnergyAnalyzer.cc.


Constructor & Destructor Documentation

EGEnergyAnalyzer::EGEnergyAnalyzer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 84 of file EGEnergyAnalyzer.cc.

{
   //now do what ever initialization is needed

}
EGEnergyAnalyzer::~EGEnergyAnalyzer ( )

Definition at line 92 of file EGEnergyAnalyzer.cc.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

void EGEnergyAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 107 of file EGEnergyAnalyzer.cc.

References cordb, corfile, EGEnergyCorrector::CorrectedEnergyWithError(), edm::Event::getByLabel(), EGEnergyCorrector::Initialize(), and EGEnergyCorrector::IsInitialized().

{
   using namespace edm;

  if (!corfile.IsInitialized()) {
    corfile.Initialize(iSetup,"/afs/cern.ch/user/b/bendavid/cmspublic/gbrv3ph.root");
    //corfile.Initialize(iSetup,"wgbrph",true);
  }

  if (!cordb.IsInitialized()) {
    //cordb.Initialize(iSetup,"/afs/cern.ch/user/b/bendavid/cmspublic/regweights/gbrph.root");
    cordb.Initialize(iSetup,"wgbrph",true);
  }

  // get photon collection
  Handle<reco::PhotonCollection> hPhotonProduct;
  iEvent.getByLabel("photons",hPhotonProduct);
  
  EcalClusterLazyTools lazyTools(iEvent, iSetup, edm::InputTag("reducedEcalRecHitsEB"), 
                                 edm::InputTag("reducedEcalRecHitsEE"));  
  
  Handle<reco::VertexCollection> hVertexProduct;
  iEvent.getByLabel("offlinePrimaryVerticesWithBS", hVertexProduct);      
  
  for (reco::PhotonCollection::const_iterator it = hPhotonProduct->begin(); it!=hPhotonProduct->end(); ++it) {
    std::pair<double,double> corsfile = corfile.CorrectedEnergyWithError(*it, *hVertexProduct, lazyTools, iSetup);
    std::pair<double,double> corsdb = cordb.CorrectedEnergyWithError(*it, *hVertexProduct, lazyTools, iSetup);


    printf("file: default = %5f, correction = %5f, uncertainty = %5f\n", it->energy(),corsfile.first,corsfile.second);
    printf("db:   default = %5f, correction = %5f, uncertainty = %5f\n", it->energy(),corsdb.first,corsdb.second);

  }  




}
void EGEnergyAnalyzer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 149 of file EGEnergyAnalyzer.cc.

{



}
void EGEnergyAnalyzer::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 176 of file EGEnergyAnalyzer.cc.

{
}
void EGEnergyAnalyzer::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 164 of file EGEnergyAnalyzer.cc.

{
}
void EGEnergyAnalyzer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 158 of file EGEnergyAnalyzer.cc.

{
}
void EGEnergyAnalyzer::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 182 of file EGEnergyAnalyzer.cc.

{
}
void EGEnergyAnalyzer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 170 of file EGEnergyAnalyzer.cc.

{
}
void EGEnergyAnalyzer::fillDescriptions ( edm::ConfigurationDescriptions descriptions) [static]

Reimplemented from edm::EDAnalyzer.

Definition at line 188 of file EGEnergyAnalyzer.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

                                                                             {
  //The following says we do not know what parameters are allowed so do no validation
  // Please change this to state exactly what you do use, even if it is no parameters
  edm::ParameterSetDescription desc;
  desc.setUnknown();
  descriptions.addDefault(desc);
}

Member Data Documentation

Definition at line 68 of file EGEnergyAnalyzer.cc.

Referenced by analyze().

Definition at line 67 of file EGEnergyAnalyzer.cc.

Referenced by analyze().