CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

PhotonAnalyzer Class Reference

EgammaCoreTools. More...

#include <PhotonAnalyzer.h>

Inheritance diagram for PhotonAnalyzer:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void endJob ()
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 PhotonAnalyzer (const edm::ParameterSet &)
virtual ~PhotonAnalyzer ()

Private Member Functions

void book2DHistoVector (std::vector< std::vector< MonitorElement * > > &toFill, std::string histoType, std::string histoName, std::string title, int xbin, double xmin, double xmax, int ybin=1, double ymin=1, double ymax=2)
void book3DHistoVector (std::vector< std::vector< std::vector< MonitorElement * > > > &toFill, std::string histoType, std::string histoName, std::string title, int xbin, double xmin, double xmax, int ybin=1, double ymin=1, double ymax=2)
MonitorElementbookHisto (std::string histoName, std::string title, int bin, double min, double max)
void fill2DHistoVector (std::vector< std::vector< MonitorElement * > > &histoVector, double x, int cut, int type)
void fill2DHistoVector (std::vector< std::vector< MonitorElement * > > &histoVector, double x, double y, int cut, int type)
void fill3DHistoVector (std::vector< std::vector< std::vector< MonitorElement * > > > &histoVector, double x, double y, int cut, int type, int part)
void fill3DHistoVector (std::vector< std::vector< std::vector< MonitorElement * > > > &histoVector, double x, int cut, int type, int part)
float phiNormalization (float &a)

Private Attributes

std::string barrelRecHitCollection_
std::string barrelRecHitProducer_
std::stringstream currentFolder_
double cutStep_
DQMStoredbe_
std::string endcapRecHitCollection_
std::string endcapRecHitProducer_
std::string fName_
MonitorElementh_convEt_Loose_
MonitorElementh_convEt_Tight_
MonitorElementh_convEta_Loose_
MonitorElementh_convEta_Tight_
std::vector< std::vector
< MonitorElement * > > 
h_convVtxR_
std::vector< std::vector
< MonitorElement * > > 
h_convVtxRvsZ_
std::vector< std::vector
< MonitorElement * > > 
h_convVtxYvsX_
std::vector< std::vector
< MonitorElement * > > 
h_convVtxZ_
std::vector< std::vector
< MonitorElement * > > 
h_convVtxZEndcap_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_dCotTracks_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_dEtaTracksAtEcal_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_dPhiTracksAtEcal_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_dPhiTracksAtVtx_
std::vector< std::vector
< MonitorElement * > > 
h_e1x5VsEt_
std::vector< std::vector
< MonitorElement * > > 
h_e1x5VsEta_
std::vector< std::vector
< MonitorElement * > > 
h_e2x5VsEt_
std::vector< std::vector
< MonitorElement * > > 
h_e2x5VsEta_
std::vector< std::vector
< MonitorElement * > > 
h_ecalSum_
std::vector< std::vector
< MonitorElement * > > 
h_ecalSumVsEt_
std::vector< std::vector
< MonitorElement * > > 
h_ecalSumVsEta_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_eOverPTracks_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_h1OverE_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_h2OverE_
std::vector< std::vector
< MonitorElement * > > 
h_hcalSum_
std::vector< std::vector
< MonitorElement * > > 
h_hcalSumVsEt_
std::vector< std::vector
< MonitorElement * > > 
h_hcalSumVsEta_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_hOverE_
MonitorElementh_invMassAllPhotons_
MonitorElementh_invMassOneWithTracks_
MonitorElementh_invMassTwoWithTracks_
MonitorElementh_invMassZeroWithTracks_
std::vector< std::vector
< MonitorElement * > > 
h_maxEXtalOver3x3VsEt_
std::vector< std::vector
< MonitorElement * > > 
h_maxEXtalOver3x3VsEta_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_nConv_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_nPho_
std::vector< std::vector
< MonitorElement * > > 
h_nTrackIsolHollow_
std::vector< std::vector
< MonitorElement * > > 
h_nTrackIsolHollowVsEt_
std::vector< std::vector
< MonitorElement * > > 
h_nTrackIsolHollowVsEta_
std::vector< std::vector
< MonitorElement * > > 
h_nTrackIsolSolid_
std::vector< std::vector
< MonitorElement * > > 
h_nTrackIsolSolidVsEt_
std::vector< std::vector
< MonitorElement * > > 
h_nTrackIsolSolidVsEta_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_phoConvE_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_phoConvEt_
std::vector< std::vector
< MonitorElement * > > 
h_phoConvEta_
std::vector< std::vector
< MonitorElement * > > 
h_phoConvEtaForEfficiency_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_phoConvPhi_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_phoConvPhiForEfficiency_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_phoConvR9_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_phoE_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_phoEt_
std::vector< std::vector
< MonitorElement * > > 
h_phoEt_BadChannels_
MonitorElementh_phoEt_Loose_
MonitorElementh_phoEt_postHLT_
MonitorElementh_phoEt_preHLT_
MonitorElementh_phoEt_Tight_
std::vector< std::vector
< MonitorElement * > > 
h_phoEta_
std::vector< std::vector
< MonitorElement * > > 
h_phoEta_BadChannels_
MonitorElementh_phoEta_Loose_
MonitorElementh_phoEta_postHLT_
MonitorElementh_phoEta_preHLT_
MonitorElementh_phoEta_Tight_
MonitorElementh_phoEta_Vertex_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_phoPhi_
std::vector< std::vector
< MonitorElement * > > 
h_phoPhi_BadChannels_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_phoSigmaIetaIeta_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_pOverETracks_
std::vector< std::vector
< MonitorElement * > > 
h_r1x5VsEt_
std::vector< std::vector
< MonitorElement * > > 
h_r1x5VsEta_
std::vector< std::vector
< MonitorElement * > > 
h_r2x5VsEt_
std::vector< std::vector
< MonitorElement * > > 
h_r2x5VsEta_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_r9_
std::vector< std::vector
< MonitorElement * > > 
h_r9VsEt_
std::vector< std::vector
< MonitorElement * > > 
h_r9VsEta_
std::vector< std::vector
< MonitorElement * > > 
h_scEta_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
h_scPhi_
std::vector< std::vector
< MonitorElement * > > 
h_sigmaIetaIetaVsEta_
std::vector< std::vector
< MonitorElement * > > 
h_tkChi2_
std::vector< std::vector
< MonitorElement * > > 
h_trackPtSumHollow_
std::vector< std::vector
< MonitorElement * > > 
h_trackPtSumHollowVsEt_
std::vector< std::vector
< MonitorElement * > > 
h_trackPtSumHollowVsEta_
std::vector< std::vector
< MonitorElement * > > 
h_trackPtSumSolid_
std::vector< std::vector
< MonitorElement * > > 
h_trackPtSumSolidVsEt_
std::vector< std::vector
< MonitorElement * > > 
h_trackPtSumSolidVsEta_
std::vector< std::vector
< MonitorElement * > > 
h_vertexChi2Prob_
int histo_index_conversions_
int histo_index_efficiency_
int histo_index_invMass_
int histo_index_photons_
double invMassEtCut_
bool isHeavyIon_
int isolationStrength_
double minPhoEtCut_
int nEntry_
int nEvt_
int numberOfSteps_
std::string outputFileName_
std::vector< std::vector
< MonitorElement * > > 
p_dCotTracksVsEta_
std::vector< std::vector
< MonitorElement * > > 
p_e1x5VsEt_
std::vector< std::vector
< MonitorElement * > > 
p_e1x5VsEta_
std::vector< std::vector
< MonitorElement * > > 
p_e2x5VsEt_
std::vector< std::vector
< MonitorElement * > > 
p_e2x5VsEta_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
p_ecalSumVsEt_
std::vector< std::vector
< MonitorElement * > > 
p_ecalSumVsEta_
std::vector< std::vector
< std::vector< MonitorElement * > > > 
p_hcalSumVsEt_
std::vector< std::vector
< MonitorElement * > > 
p_hcalSumVsEta_
std::vector< std::vector
< MonitorElement * > > 
p_hOverEVsEt_
std::vector< std::vector
< MonitorElement * > > 
p_hOverEVsEta_
std::vector< std::vector
< MonitorElement * > > 
p_maxEXtalOver3x3VsEt_
std::vector< std::vector
< MonitorElement * > > 
p_maxEXtalOver3x3VsEta_
std::vector< std::vector
< MonitorElement * > > 
p_nHitsVsEta_
std::vector< std::vector
< MonitorElement * > > 
p_nTrackIsolHollowVsEt_
std::vector< std::vector
< MonitorElement * > > 
p_nTrackIsolHollowVsEta_
std::vector< std::vector
< MonitorElement * > > 
p_nTrackIsolSolidVsEt_
std::vector< std::vector
< MonitorElement * > > 
p_nTrackIsolSolidVsEta_
std::vector< std::vector
< MonitorElement * > > 
p_r1x5VsEt_
std::vector< std::vector
< MonitorElement * > > 
p_r1x5VsEta_
std::vector< std::vector
< MonitorElement * > > 
p_r2x5VsEt_
std::vector< std::vector
< MonitorElement * > > 
p_r2x5VsEta_
std::vector< std::vector
< MonitorElement * > > 
p_r9VsEt_
std::vector< std::vector
< MonitorElement * > > 
p_r9VsEta_
std::vector< std::vector
< MonitorElement * > > 
p_sigmaIetaIetaVsEta_
std::vector< std::vector
< MonitorElement * > > 
p_tkChi2VsEta_
std::vector< std::vector
< MonitorElement * > > 
p_trackPtSumHollowVsEt_
std::vector< std::vector
< MonitorElement * > > 
p_trackPtSumHollowVsEta_
std::vector< std::vector
< MonitorElement * > > 
p_trackPtSumSolidVsEt_
std::vector< std::vector
< MonitorElement * > > 
p_trackPtSumSolidVsEta_
edm::ParameterSet parameters_
std::vector< std::string > parts_
std::string photonCollection_
std::string photonProducer_
unsigned int prescaleFactor_
bool standAlone_
MonitorElementtotalNumberOfHistos_conversionsFolder
MonitorElementtotalNumberOfHistos_efficiencyFolder
MonitorElementtotalNumberOfHistos_invMassFolder
MonitorElementtotalNumberOfHistos_photonsFolder
edm::InputTag triggerEvent_
std::vector< std::string > types_
bool useBinning_
bool useTriggerFiltering_
int verbosity_

Detailed Description

EgammaCoreTools.

$Id: PhotonAnalyzer

Date:
2011/05/23 15:01:04

authors: Nancy Marinelli, U. of Notre Dame, US Jamie Antonelli, U. of Notre Dame, US

$Id: PhotonAnalyzer

Date:
2011/05/23 15:01:13

authors: Nancy Marinelli, U. of Notre Dame, US Jamie Antonelli, U. of Notre Dame, US

Definition at line 105 of file PhotonAnalyzer.h.


Constructor & Destructor Documentation

PhotonAnalyzer::PhotonAnalyzer ( const edm::ParameterSet pset) [explicit]

Definition at line 22 of file PhotonAnalyzer.cc.

References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

{

    fName_                  = pset.getUntrackedParameter<string>("Name");
    verbosity_              = pset.getUntrackedParameter<int>("Verbosity");

    prescaleFactor_         = pset.getUntrackedParameter<int>("prescaleFactor",1);

    photonProducer_         = pset.getParameter<string>("phoProducer");
    photonCollection_       = pset.getParameter<string>("photonCollection");

    barrelRecHitProducer_   = pset.getParameter<string>("barrelRecHitProducer");
    barrelRecHitCollection_ = pset.getParameter<string>("barrelRecHitCollection");

    endcapRecHitProducer_   = pset.getParameter<string>("endcapRecHitProducer");
    endcapRecHitCollection_ = pset.getParameter<string>("endcapRecHitCollection");

    triggerEvent_           = pset.getParameter<edm::InputTag>("triggerEvent");

    minPhoEtCut_            = pset.getParameter<double>("minPhoEtCut");
    invMassEtCut_           = pset.getParameter<double>("invMassEtCut");

    cutStep_                = pset.getParameter<double>("cutStep");
    numberOfSteps_          = pset.getParameter<int>("numberOfSteps");

    useBinning_             = pset.getParameter<bool>("useBinning");
    useTriggerFiltering_    = pset.getParameter<bool>("useTriggerFiltering");

    standAlone_             = pset.getParameter<bool>("standAlone");
    outputFileName_         = pset.getParameter<string>("OutputFileName");

    isolationStrength_      = pset.getParameter<int>("isolationStrength");

    isHeavyIon_             = pset.getUntrackedParameter<bool>("isHeavyIon",false);

    parameters_ = pset;

    histo_index_photons_ = 0;
    histo_index_conversions_ = 0;
    histo_index_efficiency_ = 0;
    histo_index_invMass_ = 0;
}
PhotonAnalyzer::~PhotonAnalyzer ( ) [virtual]

Definition at line 67 of file PhotonAnalyzer.cc.

{}

Member Function Documentation

void PhotonAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup esup 
) [virtual]

End loop over Reco photons

Implements edm::EDAnalyzer.

Definition at line 428 of file PhotonAnalyzer.cc.

References edm::SortedCollection< T, SORT >::begin(), ChiSquaredProbability(), conversions_cfi::conversions, align_tpl::cut, deltaR(), deltaRMax, edm::SortedCollection< T, SORT >::end(), HcalObjRepresent::Fill(), edm::Event::getByLabel(), i, edm::EventBase::id(), edm::Ref< C, T, F >::isNonnull(), edm::HandleBase::isValid(), label, edm::Handle< T >::product(), edm::RefVector< C, T, F >::size(), python::multivaluedict::sort(), mathSSE::sqrt(), and testEve_cfg::tracks.

{
  using namespace edm;

  if (nEvt_% prescaleFactor_ ) return;
  nEvt_++;
  LogInfo("PhotonAnalyzer") << "PhotonAnalyzer Analyzing event number: " << e.id() << " Global Counter " << nEvt_ <<"\n";

  // Get the trigger results
  bool validTriggerEvent=true;
  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
  trigger::TriggerEvent triggerEvent;
  e.getByLabel(triggerEvent_,triggerEventHandle);
  if(!triggerEventHandle.isValid()) {
    edm::LogInfo("PhotonAnalyzer") << "Error! Can't get the product "<< triggerEvent_.label() << endl;
    validTriggerEvent=false;
  }
  if(validTriggerEvent) triggerEvent = *(triggerEventHandle.product());

  // Get the reconstructed photons
  bool validPhotons=true;
  Handle<reco::PhotonCollection> photonHandle;
  reco::PhotonCollection photonCollection;
  e.getByLabel(photonProducer_, photonCollection_ , photonHandle);
  if ( !photonHandle.isValid()) {
    edm::LogInfo("PhotonAnalyzer") << "Error! Can't get the product "<< photonCollection_ << endl;
    validPhotons=false;
  }
  if(validPhotons) photonCollection = *(photonHandle.product());

  // Get the PhotonId objects
  bool validloosePhotonID=true;
  Handle<edm::ValueMap<bool> > loosePhotonFlag;
  edm::ValueMap<bool> loosePhotonID;
  e.getByLabel("PhotonIDProd", "PhotonCutBasedIDLoose", loosePhotonFlag);
  if ( !loosePhotonFlag.isValid()) {
    edm::LogInfo("PhotonAnalyzer") << "Error! Can't get the product "<< "PhotonCutBasedIDLoose" << endl;
    validloosePhotonID=false;
  }
  if (validloosePhotonID) loosePhotonID = *(loosePhotonFlag.product());

  bool validtightPhotonID=true;
  Handle<edm::ValueMap<bool> > tightPhotonFlag;
  edm::ValueMap<bool> tightPhotonID;
  e.getByLabel("PhotonIDProd", "PhotonCutBasedIDTight", tightPhotonFlag);
  if ( !tightPhotonFlag.isValid()) {
    edm::LogInfo("PhotonAnalyzer") << "Error! Can't get the product "<< "PhotonCutBasedIDTight" << endl;
    validtightPhotonID=false;
  }
  if (validtightPhotonID) tightPhotonID = *(tightPhotonFlag.product());



  // Create array to hold #photons/event information
  int nPho[100][3][3];

  for (int cut=0; cut!=100; ++cut){
    for (int type=0; type!=3; ++type){
      for (int part=0; part!=3; ++part){
        nPho[cut][type][part] = 0;
      }
    }
  }
  // Create array to hold #conversions/event information
  int nConv[100][3][3];

  for (int cut=0; cut!=100; ++cut){
    for (int type=0; type!=3; ++type){
      for (int part=0; part!=3; ++part){
        nConv[cut][type][part] = 0;
      }
    }
  }



  //Prepare list of photon-related HLT filter names

  vector<int> Keys;

  for(uint filterIndex=0;filterIndex<triggerEvent.sizeFilters();++filterIndex){  //loop over all trigger filters in event (i.e. filters passed)

    string label = triggerEvent.filterTag(filterIndex).label();

    if(label.find( "Photon" ) != string::npos ) {  //get photon-related filters

      for(uint filterKeyIndex=0;filterKeyIndex<triggerEvent.filterKeys(filterIndex).size();++filterKeyIndex){  //loop over keys to objects passing this filter
        Keys.push_back(triggerEvent.filterKeys(filterIndex)[filterKeyIndex]);  //add keys to a vector for later reference
      }

    }

  }

  // sort Keys vector in ascending order
  // and erases duplicate entries from the vector
  sort(Keys.begin(),Keys.end());
  for ( uint i=0 ; i<Keys.size() ; )
   {
    if (i!=(Keys.size()-1))
     {
      if (Keys[i]==Keys[i+1]) Keys.erase(Keys.begin()+i+1) ;
      else ++i ;
     }
    else ++i ;
   }

  //We now have a vector of unique keys to TriggerObjects passing a photon-related filter

  int photonCounter = 0;


  for( reco::PhotonCollection::const_iterator  iPho = photonCollection.begin(); iPho != photonCollection.end(); iPho++) {


    //for HLT efficiency plots

    h_phoEta_preHLT_->Fill((*iPho).eta());
    h_phoEt_preHLT_->Fill( (*iPho).et());


    double deltaR=1000.;
    double deltaRMin=1000.;
    double deltaRMax=0.05;//sets deltaR threshold for matching photons to trigger objects


    for (vector<int>::const_iterator objectKey=Keys.begin();objectKey!=Keys.end();objectKey++){  //loop over keys to objects that fired photon triggers

      deltaR = reco::deltaR(triggerEvent.getObjects()[(*objectKey)].eta(),triggerEvent.getObjects()[(*objectKey)].phi(),(*iPho).superCluster()->eta(),(*iPho).superCluster()->phi());
      if(deltaR < deltaRMin) deltaRMin = deltaR;

    }

    if(deltaRMin > deltaRMax) {  //photon fails delta R cut
      if(useTriggerFiltering_) continue;  //throw away photons that haven't passed any photon filters
    }

    if(deltaRMin <= deltaRMax) { //photon passes delta R cut
      h_phoEta_postHLT_->Fill((*iPho).eta() );
      h_phoEt_postHLT_->Fill( (*iPho).et() );
    }

    if ((*iPho).et()  < minPhoEtCut_) continue;

    nEntry_++;

    edm::Ref<reco::PhotonCollection> photonref(photonHandle, photonCounter);
    photonCounter++;

    bool isLoosePhoton(false), isTightPhoton(false);
    if ( !isHeavyIon_ ) {
      isLoosePhoton = (loosePhotonID)[photonref];
      isTightPhoton = (tightPhotonID)[photonref];
    }


    //find out which part of the Ecal contains the photon

    bool  phoIsInBarrel=false;
    bool  phoIsInEndcap=false;
    float etaPho = (*iPho).superCluster()->eta();
    if ( fabs(etaPho) <  1.479 )
      phoIsInBarrel=true;
    else {
      phoIsInEndcap=true;
    }

    int part = 0;
    if ( phoIsInBarrel ) part = 1;
    if ( phoIsInEndcap ) part = 2;

    bool isIsolated=false;
    if ( isolationStrength_ == 0)  isIsolated = isLoosePhoton;
    if ( isolationStrength_ == 1)  isIsolated = isTightPhoton;

    int type=0;
    if ( isIsolated ) type=1;
    if ( !isIsolated ) type=2;


    //get rechit collection containing this photon
    bool validEcalRecHits=true;
    edm::Handle<EcalRecHitCollection>   ecalRecHitHandle;
    EcalRecHitCollection ecalRecHitCollection;
    if ( phoIsInBarrel ) {
      // Get handle to barrel rec hits
      e.getByLabel(barrelRecHitProducer_, barrelRecHitCollection_, ecalRecHitHandle);
      if (!ecalRecHitHandle.isValid()) {
        edm::LogError("PhotonAnalyzer") << "Error! Can't get the product "<<barrelRecHitProducer_;
        validEcalRecHits=false;
      }
    }
    else if ( phoIsInEndcap ) {
      // Get handle to endcap rec hits
      e.getByLabel(endcapRecHitProducer_, endcapRecHitCollection_, ecalRecHitHandle);
      if (!ecalRecHitHandle.isValid()) {
        edm::LogError("PhotonAnalyzer") << "Error! Can't get the product "<<endcapRecHitProducer_;
        validEcalRecHits=false;
      }
    }
    if (validEcalRecHits) ecalRecHitCollection = *(ecalRecHitHandle.product());


    //if ((*iPho).isEBEEGap()) continue;  //cut out gap photons


    //filling histograms to make isolation efficiencies
    if(isLoosePhoton){
      h_phoEta_Loose_->Fill((*iPho).eta());
      h_phoEt_Loose_->Fill( (*iPho).et() );
    }
    if(isTightPhoton){
      h_phoEta_Tight_->Fill((*iPho).eta());
      h_phoEt_Tight_->Fill( (*iPho).et() );
    }



    for (int cut = 0; cut !=numberOfSteps_; ++cut) {  //loop over different transverse energy cuts
      double Et =  (*iPho).et();
      bool passesCuts = false;

      //sorting the photon into the right Et-dependant folder
      if ( useBinning_ && Et > (cut+1)*cutStep_ && ( (Et < (cut+2)*cutStep_)  | (cut == numberOfSteps_-1) ) ){
        passesCuts = true;
      }
      else if ( !useBinning_ && Et > (cut+1)*cutStep_ ){
        passesCuts = true;
      }

      if (passesCuts){

        //filling isolation variable histograms

        //tracker isolation variables

        fill2DHistoVector(h_nTrackIsolSolid_, (*iPho).nTrkSolidConeDR04(), cut,type);
        fill2DHistoVector(h_nTrackIsolHollow_,(*iPho).nTrkHollowConeDR04(),cut,type);

        fill2DHistoVector(h_nTrackIsolSolidVsEta_, (*iPho).eta(),(*iPho).nTrkSolidConeDR04(), cut,type);
        fill2DHistoVector(p_nTrackIsolSolidVsEta_, (*iPho).eta(),(*iPho).nTrkSolidConeDR04(), cut,type);
        fill2DHistoVector(h_nTrackIsolHollowVsEta_,(*iPho).eta(),(*iPho).nTrkHollowConeDR04(),cut,type);
        fill2DHistoVector(p_nTrackIsolHollowVsEta_,(*iPho).eta(),(*iPho).nTrkHollowConeDR04(),cut,type);

        fill2DHistoVector(h_nTrackIsolSolidVsEt_,  (*iPho).et(), (*iPho).nTrkSolidConeDR04(), cut,type);
        fill2DHistoVector(p_nTrackIsolSolidVsEt_,  (*iPho).et(), (*iPho).nTrkSolidConeDR04(), cut,type);
        fill2DHistoVector(h_nTrackIsolHollowVsEt_, (*iPho).et(), (*iPho).nTrkHollowConeDR04(),cut,type);
        fill2DHistoVector(p_nTrackIsolHollowVsEt_, (*iPho).et(), (*iPho).nTrkHollowConeDR04(),cut,type);


        fill2DHistoVector(h_trackPtSumSolid_, (*iPho).trkSumPtSolidConeDR04(),cut,type);
        fill2DHistoVector(h_trackPtSumHollow_,(*iPho).trkSumPtSolidConeDR04(),cut,type);

        fill2DHistoVector(h_trackPtSumSolidVsEta_, (*iPho).eta(),(*iPho).trkSumPtSolidConeDR04(), cut,type);
        fill2DHistoVector(p_trackPtSumSolidVsEta_, (*iPho).eta(),(*iPho).trkSumPtSolidConeDR04(), cut,type);
        fill2DHistoVector(h_trackPtSumHollowVsEta_,(*iPho).eta(),(*iPho).trkSumPtHollowConeDR04(),cut,type);
        fill2DHistoVector(p_trackPtSumHollowVsEta_,(*iPho).eta(),(*iPho).trkSumPtHollowConeDR04(),cut,type);

        fill2DHistoVector(h_trackPtSumSolidVsEt_,  (*iPho).et(), (*iPho).trkSumPtSolidConeDR04(), cut,type);
        fill2DHistoVector(p_trackPtSumSolidVsEt_,  (*iPho).et(), (*iPho).trkSumPtSolidConeDR04(), cut,type);
        fill2DHistoVector(h_trackPtSumHollowVsEt_, (*iPho).et(), (*iPho).trkSumPtHollowConeDR04(),cut,type);
        fill2DHistoVector(p_trackPtSumHollowVsEt_, (*iPho).et(), (*iPho).trkSumPtHollowConeDR04(),cut,type);

        //calorimeter isolation variables

        fill2DHistoVector(h_ecalSum_,(*iPho).ecalRecHitSumEtConeDR04(),cut,type);
        fill2DHistoVector(h_ecalSumVsEta_,(*iPho).eta(),(*iPho).ecalRecHitSumEtConeDR04(),cut,type);
        fill2DHistoVector(p_ecalSumVsEta_,(*iPho).eta(),(*iPho).ecalRecHitSumEtConeDR04(),cut,type);
        fill2DHistoVector(h_ecalSumVsEt_, (*iPho).et(), (*iPho).ecalRecHitSumEtConeDR04(),cut,type);
        fill3DHistoVector(p_ecalSumVsEt_, (*iPho).et(), (*iPho).ecalRecHitSumEtConeDR04(),cut,type,part);


        fill2DHistoVector(h_hcalSum_,(*iPho).hcalTowerSumEtConeDR04(),cut,type);
        fill2DHistoVector(h_hcalSumVsEta_,(*iPho).eta(),(*iPho).hcalTowerSumEtConeDR04(),cut,type);
        fill2DHistoVector(p_hcalSumVsEta_,(*iPho).eta(),(*iPho).hcalTowerSumEtConeDR04(),cut,type);
        fill2DHistoVector(h_hcalSumVsEt_, (*iPho).et(), (*iPho).hcalTowerSumEtConeDR04(),cut,type);
        fill3DHistoVector(p_hcalSumVsEt_, (*iPho).et(), (*iPho).hcalTowerSumEtConeDR04(),cut,type,part);

        fill3DHistoVector(h_hOverE_,(*iPho).hadronicOverEm(),cut,type,part);
        fill2DHistoVector(p_hOverEVsEta_,(*iPho).eta(),(*iPho).hadronicOverEm(),cut,type);
        fill2DHistoVector(p_hOverEVsEt_, (*iPho).et(), (*iPho).hadronicOverEm(),cut,type);

        fill3DHistoVector(h_h1OverE_,(*iPho).hadronicDepth1OverEm(),cut,type,part);
        fill3DHistoVector(h_h2OverE_,(*iPho).hadronicDepth2OverEm(),cut,type,part);


        //filling photon histograms

        nPho[cut][0][0]++;
        nPho[cut][0][part]++;
        nPho[cut][type][0]++;
        nPho[cut][type][part]++;

        //energy variables

        fill3DHistoVector(h_phoE_, (*iPho).energy(),cut,type,part);
        fill3DHistoVector(h_phoEt_,(*iPho).et(),    cut,type,part);

        //geometrical variables

        fill2DHistoVector(h_phoEta_,(*iPho).eta(),cut,type);
        fill2DHistoVector(h_scEta_, (*iPho).superCluster()->eta(),cut,type);

        fill3DHistoVector(h_phoPhi_,(*iPho).phi(),cut,type,part);
        fill3DHistoVector(h_scPhi_, (*iPho).superCluster()->phi(),cut,type,part);

        //shower shape variables

        fill3DHistoVector(h_r9_,(*iPho).r9(),cut,type,part);
        fill2DHistoVector(h_r9VsEta_,(*iPho).eta(),(*iPho).r9(),cut,type);
        fill2DHistoVector(p_r9VsEta_,(*iPho).eta(),(*iPho).r9(),cut,type);
        fill2DHistoVector(h_r9VsEt_, (*iPho).et(), (*iPho).r9(),cut,type);
        fill2DHistoVector(p_r9VsEt_, (*iPho).et(), (*iPho).r9(),cut,type);

        fill2DHistoVector(h_e1x5VsEta_,(*iPho).eta(),(*iPho).e1x5(),cut,type);
        fill2DHistoVector(p_e1x5VsEta_,(*iPho).eta(),(*iPho).e1x5(),cut,type);
        fill2DHistoVector(h_e1x5VsEt_, (*iPho).et(), (*iPho).e1x5(),cut,type);
        fill2DHistoVector(p_e1x5VsEt_, (*iPho).et(), (*iPho).e1x5(),cut,type);

        fill2DHistoVector(h_e2x5VsEta_,(*iPho).eta(),(*iPho).e2x5(),cut,type);
        fill2DHistoVector(p_e2x5VsEta_,(*iPho).eta(),(*iPho).e2x5(),cut,type);
        fill2DHistoVector(h_e2x5VsEt_, (*iPho).et(), (*iPho).e2x5(),cut,type);
        fill2DHistoVector(p_e2x5VsEt_, (*iPho).et(), (*iPho).e2x5(),cut,type);

        fill2DHistoVector(h_maxEXtalOver3x3VsEta_,(*iPho).eta(),(*iPho).maxEnergyXtal()/(*iPho).e3x3(),cut,type);
        fill2DHistoVector(p_maxEXtalOver3x3VsEta_,(*iPho).eta(),(*iPho).maxEnergyXtal()/(*iPho).e3x3(),cut,type);
        fill2DHistoVector(h_maxEXtalOver3x3VsEt_, (*iPho).et(), (*iPho).maxEnergyXtal()/(*iPho).e3x3(),cut,type);
        fill2DHistoVector(p_maxEXtalOver3x3VsEt_, (*iPho).et(), (*iPho).maxEnergyXtal()/(*iPho).e3x3(),cut,type);

        fill2DHistoVector(h_r1x5VsEta_,(*iPho).eta(),(*iPho).r1x5(),cut,type);
        fill2DHistoVector(p_r1x5VsEta_,(*iPho).eta(),(*iPho).r1x5(),cut,type);
        fill2DHistoVector(h_r1x5VsEt_, (*iPho).et(), (*iPho).r1x5(),cut,type);
        fill2DHistoVector(p_r1x5VsEt_, (*iPho).et(), (*iPho).r1x5(),cut,type);

        fill2DHistoVector(h_r2x5VsEta_,(*iPho).eta(),(*iPho).r2x5(),cut,type);
        fill2DHistoVector(p_r2x5VsEta_,(*iPho).eta(),(*iPho).r2x5(),cut,type);
        fill2DHistoVector(h_r2x5VsEt_, (*iPho).et(), (*iPho).r2x5(),cut,type);
        fill2DHistoVector(p_r2x5VsEt_, (*iPho).et(), (*iPho).r2x5(),cut,type);

        fill3DHistoVector(h_phoSigmaIetaIeta_,(*iPho).sigmaIetaIeta(),cut,type,part);
        fill2DHistoVector(h_sigmaIetaIetaVsEta_,(*iPho).eta(),(*iPho).sigmaIetaIeta(),cut,type);
        fill2DHistoVector(p_sigmaIetaIetaVsEta_,(*iPho).eta(),(*iPho).sigmaIetaIeta(),cut,type);



        //filling histograms for photons containing a bad ECAL channel

        bool atLeastOneDeadChannel=false;
        for(reco::CaloCluster_iterator bcIt = (*iPho).superCluster()->clustersBegin();bcIt != (*iPho).superCluster()->clustersEnd(); ++bcIt) { //loop over basic clusters in SC
          for(vector< pair<DetId, float> >::const_iterator rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) { //loop over rec hits in basic cluster

            for(EcalRecHitCollection::const_iterator it = ecalRecHitCollection.begin(); it !=  ecalRecHitCollection.end(); ++it) { //loop over all rec hits to find the right ones
              if  (rhIt->first ==  (*it).id() ) { //found the matching rechit
                if (  (*it).recoFlag() == 9 ) { //has a bad channel
                  atLeastOneDeadChannel=true;
                  break;
                }
              }
            }
          }
        }
        if ( atLeastOneDeadChannel ) {
          fill2DHistoVector(h_phoPhi_BadChannels_,(*iPho).phi(),cut,type);
          fill2DHistoVector(h_phoEta_BadChannels_,(*iPho).eta(),cut,type);
          fill2DHistoVector(h_phoEt_BadChannels_, (*iPho).et(), cut,type);
        }


        // filling conversion-related histograms
        if((*iPho).hasConversionTracks()){
          nConv[cut][0][0]++;
          nConv[cut][0][part]++;
          nConv[cut][type][0]++;
          nConv[cut][type][part]++;
        }

        //loop over conversions (don't forget, we're still inside the photon loop,
        // i.e. these are all the conversions for this ONE photon, not for all the photons in the event)
        reco::ConversionRefVector conversions = (*iPho).conversions();
        for (unsigned int iConv=0; iConv<conversions.size(); iConv++) {

          reco::ConversionRef aConv=conversions[iConv];

          if ( aConv->nTracks() <2 ) continue;

          //fill histogram for denominator of vertex reconstruction efficiency plot
          if(cut==0) h_phoEta_Vertex_->Fill(aConv->refittedPairMomentum().eta());

          if ( !(aConv->conversionVertex().isValid()) ) continue;

          float chi2Prob = ChiSquaredProbability( aConv->conversionVertex().chi2(), aConv->conversionVertex().ndof() );

          if(chi2Prob<0.0005) continue;

          fill2DHistoVector(h_vertexChi2Prob_,chi2Prob,cut,type);



          fill3DHistoVector(h_phoConvE_, (*iPho).energy(),cut,type,part);
          fill3DHistoVector(h_phoConvEt_,(*iPho).et(),cut,type,part);
          fill3DHistoVector(h_phoConvR9_,(*iPho).r9(),cut,type,part);

          if (cut==0 && isLoosePhoton){
            h_convEta_Loose_->Fill((*iPho).eta());
            h_convEt_Loose_->Fill( (*iPho).et() );
          }
          if (cut==0 && isTightPhoton){
            h_convEta_Tight_->Fill((*iPho).eta());
            h_convEt_Tight_->Fill( (*iPho).et() );
          }

          fill2DHistoVector(h_phoConvEta_,aConv->refittedPairMomentum().eta(),cut,type);
          fill3DHistoVector(h_phoConvPhi_,aConv->refittedPairMomentum().phi(),cut,type,part);

          //we use the photon position because we'll be dividing it by a photon histogram (not a conversion histogram)
          fill2DHistoVector(h_phoConvEtaForEfficiency_,(*iPho).eta(),cut,type);
          fill3DHistoVector(h_phoConvPhiForEfficiency_,(*iPho).phi(),cut,type,part);


          //vertex histograms
          double convR= sqrt(aConv->conversionVertex().position().perp2());
          double scalar = aConv->conversionVertex().position().x()*aConv->refittedPairMomentum().x() + aConv->conversionVertex().position().y()*aConv->refittedPairMomentum().y();
          if ( scalar < 0 ) convR= -convR;

          fill2DHistoVector(h_convVtxRvsZ_,aConv->conversionVertex().position().z(), convR,cut,type);//trying to "see" R-Z view of tracker
          fill2DHistoVector(h_convVtxZ_,aConv->conversionVertex().position().z(), cut,type);

          if(fabs(aConv->caloCluster()[0]->eta()) > 1.5){//trying to "see" tracker endcaps
            fill2DHistoVector(h_convVtxZEndcap_,aConv->conversionVertex().position().z(), cut,type);
          }
          else if(fabs(aConv->caloCluster()[0]->eta()) < 1){//trying to "see" tracker barrel
            fill2DHistoVector(h_convVtxR_,convR,cut,type);
            fill2DHistoVector(h_convVtxYvsX_,aConv->conversionVertex().position().x(),aConv->conversionVertex().position().y(),cut,type);
          }

          const std::vector<edm::RefToBase<reco::Track> > tracks = aConv->tracks();


          for (unsigned int i=0; i<tracks.size(); i++) {
            fill2DHistoVector(h_tkChi2_,tracks[i]->normalizedChi2(),cut,type);
            fill2DHistoVector(p_tkChi2VsEta_,aConv->caloCluster()[0]->eta(),tracks[i]->normalizedChi2(),cut,type);
            fill2DHistoVector(p_dCotTracksVsEta_,aConv->caloCluster()[0]->eta(),aConv->pairCotThetaSeparation(),cut,type);
            fill2DHistoVector(p_nHitsVsEta_,aConv->caloCluster()[0]->eta(),float(tracks[i]->numberOfValidHits()),cut,type);
          }

          //calculating delta eta and delta phi of the two tracks

          float  DPhiTracksAtVtx = -99;
          float  dPhiTracksAtEcal= -99;
          float  dEtaTracksAtEcal= -99;

          float phiTk1= aConv->tracksPin()[0].phi();
          float phiTk2= aConv->tracksPin()[1].phi();
          DPhiTracksAtVtx = phiTk1-phiTk2;
          DPhiTracksAtVtx = phiNormalization( DPhiTracksAtVtx );

          if (aConv->bcMatchingWithTracks()[0].isNonnull() && aConv->bcMatchingWithTracks()[1].isNonnull() ) {
            float recoPhi1 = aConv->ecalImpactPosition()[0].phi();
            float recoPhi2 = aConv->ecalImpactPosition()[1].phi();
            float recoEta1 = aConv->ecalImpactPosition()[0].eta();
            float recoEta2 = aConv->ecalImpactPosition()[1].eta();

            recoPhi1 = phiNormalization(recoPhi1);
            recoPhi2 = phiNormalization(recoPhi2);

            dPhiTracksAtEcal = recoPhi1 -recoPhi2;
            dPhiTracksAtEcal = phiNormalization( dPhiTracksAtEcal );
            dEtaTracksAtEcal = recoEta1 -recoEta2;

          }


          fill3DHistoVector(h_dPhiTracksAtVtx_,DPhiTracksAtVtx,cut,type,part);
          fill3DHistoVector(h_dPhiTracksAtEcal_,fabs(dPhiTracksAtEcal),cut,type,part);
          fill3DHistoVector(h_dEtaTracksAtEcal_, dEtaTracksAtEcal,cut,type,part);
          fill3DHistoVector(h_eOverPTracks_,aConv->EoverPrefittedTracks(),cut,type,part);
          fill3DHistoVector(h_pOverETracks_,1./aConv->EoverPrefittedTracks(),cut,type,part);
          fill3DHistoVector(h_dCotTracks_,aConv->pairCotThetaSeparation(),cut,type,part);


        }//end loop over conversions

      }//end loop over photons passing cuts
    }//end loop over transverse energy cuts





    //make invariant mass plots

    if (isIsolated && iPho->et()>=invMassEtCut_){

      for (reco::PhotonCollection::const_iterator iPho2=iPho+1; iPho2!=photonCollection.end(); iPho2++){

        edm::Ref<reco::PhotonCollection> photonref2(photonHandle, photonCounter); //note: it's correct to use photonCounter and not photonCounter+1
                                                                                  //since it has already been incremented earlier

        bool  isTightPhoton2(false), isLoosePhoton2(false);

        if ( !isHeavyIon_ ) {
          isTightPhoton2 = (tightPhotonID)[photonref2];
          isLoosePhoton2 = (loosePhotonID)[photonref2];
        }

        bool isIsolated2=false;
        if ( isolationStrength_ == 0)  isIsolated2 = isLoosePhoton2;
        if ( isolationStrength_ == 1)  isIsolated2 = isTightPhoton2;

        reco::ConversionRefVector conversions = (*iPho).conversions();
        reco::ConversionRefVector conversions2 = (*iPho2).conversions();

        if(isIsolated2 && iPho2->et()>=invMassEtCut_){

          math::XYZTLorentzVector p12 = iPho->p4()+iPho2->p4();
          float gamgamMass2 = p12.Dot(p12);


          h_invMassAllPhotons_ -> Fill(sqrt( gamgamMass2 ));

          if(conversions.size()!=0 && conversions[0]->nTracks() >= 2){
            if(conversions2.size()!=0 && conversions2[0]->nTracks() >= 2) h_invMassTwoWithTracks_ -> Fill(sqrt( gamgamMass2 ));
            else h_invMassOneWithTracks_ -> Fill(sqrt( gamgamMass2 ));
          }
          else if(conversions2.size()!=0 && conversions2[0]->nTracks() >= 2) h_invMassOneWithTracks_ -> Fill(sqrt( gamgamMass2 ));
          else h_invMassZeroWithTracks_ -> Fill(sqrt( gamgamMass2 ));
        }

      }

    }



  }


  //filling number of photons/conversions per event histograms
  for (int cut = 0; cut !=numberOfSteps_; ++cut) {
    for(uint type=0;type!=types_.size();++type){
      for(uint part=0;part!=parts_.size();++part){
        h_nPho_[cut][type][part]-> Fill (float(nPho[cut][type][part]));
        h_nConv_[cut][type][part]-> Fill (float(nConv[cut][type][part]));
      }
    }
  }

}//End of Analyze method
void PhotonAnalyzer::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file PhotonAnalyzer.cc.

References DQMStore::book1D(), DQMStore::bookInt(), align_tpl::cut, dbe_, jptDQMConfig_cff::eMax, jptDQMConfig_cff::etaMax, jptDQMConfig_cff::etaMin, jptDQMConfig_cff::etMax, reco::tau::qcuts::etMin(), cmsCodeRules::cppFunctionSkipper::operator, jptDQMConfig_cff::phiMax, jptDQMConfig_cff::phiMin, and DQMStore::setCurrentFolder().

{

  nEvt_=0;
  nEntry_=0;

  dbe_ = 0;
  dbe_ = edm::Service<DQMStore>().operator->();



  double eMin = parameters_.getParameter<double>("eMin");
  double eMax = parameters_.getParameter<double>("eMax");
  int    eBin = parameters_.getParameter<int>("eBin");

  double etMin = parameters_.getParameter<double>("etMin");
  double etMax = parameters_.getParameter<double>("etMax");
  int    etBin = parameters_.getParameter<int>("etBin");

  double sumMin = parameters_.getParameter<double>("sumMin");
  double sumMax = parameters_.getParameter<double>("sumMax");
  int    sumBin = parameters_.getParameter<int>("sumBin");

  double etaMin = parameters_.getParameter<double>("etaMin");
  double etaMax = parameters_.getParameter<double>("etaMax");
  int    etaBin = parameters_.getParameter<int>("etaBin");

  double phiMin = parameters_.getParameter<double>("phiMin");
  double phiMax = parameters_.getParameter<double>("phiMax");
  int    phiBin = parameters_.getParameter<int>("phiBin");

  double r9Min = parameters_.getParameter<double>("r9Min");
  double r9Max = parameters_.getParameter<double>("r9Max");
  int    r9Bin = parameters_.getParameter<int>("r9Bin");

  double hOverEMin = parameters_.getParameter<double>("hOverEMin");
  double hOverEMax = parameters_.getParameter<double>("hOverEMax");
  int    hOverEBin = parameters_.getParameter<int>("hOverEBin");

  double xMin = parameters_.getParameter<double>("xMin");
  double xMax = parameters_.getParameter<double>("xMax");
  int    xBin = parameters_.getParameter<int>("xBin");

  double yMin = parameters_.getParameter<double>("yMin");
  double yMax = parameters_.getParameter<double>("yMax");
  int    yBin = parameters_.getParameter<int>("yBin");

  double numberMin = parameters_.getParameter<double>("numberMin");
  double numberMax = parameters_.getParameter<double>("numberMax");
  int    numberBin = parameters_.getParameter<int>("numberBin");

  double zMin = parameters_.getParameter<double>("zMin");
  double zMax = parameters_.getParameter<double>("zMax");
  int    zBin = parameters_.getParameter<int>("zBin");

  double rMin = parameters_.getParameter<double>("rMin");
  double rMax = parameters_.getParameter<double>("rMax");
  int    rBin = parameters_.getParameter<int>("rBin");

  double dPhiTracksMin = parameters_.getParameter<double>("dPhiTracksMin");
  double dPhiTracksMax = parameters_.getParameter<double>("dPhiTracksMax");
  int    dPhiTracksBin = parameters_.getParameter<int>("dPhiTracksBin");

  double dEtaTracksMin = parameters_.getParameter<double>("dEtaTracksMin");
  double dEtaTracksMax = parameters_.getParameter<double>("dEtaTracksMax");
  int    dEtaTracksBin = parameters_.getParameter<int>("dEtaTracksBin");

  double sigmaIetaMin = parameters_.getParameter<double>("sigmaIetaMin");
  double sigmaIetaMax = parameters_.getParameter<double>("sigmaIetaMax");
  int    sigmaIetaBin = parameters_.getParameter<int>("sigmaIetaBin");

  double eOverPMin = parameters_.getParameter<double>("eOverPMin");
  double eOverPMax = parameters_.getParameter<double>("eOverPMax");
  int    eOverPBin = parameters_.getParameter<int>("eOverPBin");

  double chi2Min = parameters_.getParameter<double>("chi2Min");
  double chi2Max = parameters_.getParameter<double>("chi2Max");
  int    chi2Bin = parameters_.getParameter<int>("chi2Bin");


  int reducedEtBin = etBin/4;
  int reducedEtaBin = etaBin/4;
  int reducedSumBin = sumBin/4;
  int reducedR9Bin = r9Bin/4;


  parts_.push_back("AllEcal");
  parts_.push_back("Barrel");
  parts_.push_back("Endcaps");

  types_.push_back("All");
  types_.push_back("GoodCandidate");
  types_.push_back("Background");




  if (dbe_) {

    dbe_->setCurrentFolder("Egamma/PhotonAnalyzer");

    //int values stored in MEs to keep track of how many histograms are in each folder
    totalNumberOfHistos_efficiencyFolder =  dbe_->bookInt("numberOfHistogramsInEfficiencyFolder");
    totalNumberOfHistos_photonsFolder =     dbe_->bookInt("numberOfHistogramsInPhotonsFolder");
    totalNumberOfHistos_conversionsFolder = dbe_->bookInt("numberOfHistogramsInConversionsFolder");
    totalNumberOfHistos_invMassFolder =     dbe_->bookInt("numberOfHistogramsInInvMassFolder");


    //Efficiency histograms

    dbe_->setCurrentFolder("Egamma/PhotonAnalyzer/Efficiencies");

    //don't number these histograms with the "bookHisto" method, since they'll be erased in the offline client
    h_phoEta_Loose_ = dbe_->book1D("phoEtaLoose","Loose Photon #eta",etaBin,etaMin,etaMax);
    h_phoEta_Tight_ = dbe_->book1D("phoEtaTight","Tight Photon #eta",etaBin,etaMin,etaMax);
    h_phoEt_Loose_  = dbe_->book1D("phoEtLoose", "Loose Photon E_{T}",etBin,etMin,etMax);
    h_phoEt_Tight_  = dbe_->book1D("phoEtTight", "Tight Photon E_{T}",etBin,etMin,etMax);


    h_phoEta_preHLT_  = dbe_->book1D("phoEtaPreHLT", "Photon #eta: before HLT",etaBin,etaMin,etaMax);
    h_phoEta_postHLT_ = dbe_->book1D("phoEtaPostHLT","Photon #eta: after HLT",etaBin,etaMin,etaMax);
    h_phoEt_preHLT_   = dbe_->book1D("phoEtPreHLT",  "Photon E_{T}: before HLT",etBin,etMin,etMax);
    h_phoEt_postHLT_  = dbe_->book1D("phoEtPostHLT", "Photon E_{T}: after HLT",etBin,etMin,etMax);

    h_convEta_Loose_ = dbe_->book1D("convEtaLoose","Converted Loose Photon #eta",etaBin,etaMin,etaMax);
    h_convEta_Tight_ = dbe_->book1D("convEtaTight","Converted Tight Photon #eta",etaBin,etaMin,etaMax);
    h_convEt_Loose_  = dbe_->book1D("convEtLoose", "Converted Loose Photon E_{T}",etBin,etMin,etMax);
    h_convEt_Tight_  = dbe_->book1D("convEtTight", "Converted Tight Photon E_{T}",etBin,etMin,etMax);

    h_phoEta_Vertex_ = dbe_->book1D("phoEtaVertex","Converted Photons before valid vertex cut: #eta",etaBin,etaMin,etaMax);


    vector<MonitorElement*> temp1DVectorEta;
    vector<MonitorElement*> temp1DVectorPhi;
    vector<vector<MonitorElement*> > temp2DVectorPhi;


    for(int cut = 0; cut != numberOfSteps_; ++cut){ //looping over Et cut values
      for(uint type=0;type!=types_.size();++type){  //looping over isolation type
        currentFolder_.str("");
        currentFolder_ << "Egamma/PhotonAnalyzer/" << types_[type] << "Photons/Et above " << (cut+1)*cutStep_ << " GeV/Conversions";
        dbe_->setCurrentFolder(currentFolder_.str());

        temp1DVectorEta.push_back(dbe_->book1D("phoConvEtaForEfficiency","Converted Photon #eta;#eta",etaBin,etaMin,etaMax));
        for(uint part=0;part!=parts_.size();++part){
          temp1DVectorPhi.push_back(dbe_->book1D("phoConvPhiForEfficiency"+parts_[part],"Converted Photon #phi;#phi",phiBin,phiMin,phiMax));
        }
        temp2DVectorPhi.push_back(temp1DVectorPhi);
        temp1DVectorPhi.clear();
      }
      h_phoConvEtaForEfficiency_.push_back(temp1DVectorEta);
      temp1DVectorEta.clear();
      h_phoConvPhiForEfficiency_.push_back(temp2DVectorPhi);
      temp2DVectorPhi.clear();
    }




    //Invariant mass plots

    dbe_->setCurrentFolder("Egamma/PhotonAnalyzer/InvMass");

    h_invMassAllPhotons_    = bookHisto("invMassAllIsolatedPhotons","Two photon invariant mass: All isolated photons;M (GeV)",etBin,etMin,etMax);
    h_invMassZeroWithTracks_= bookHisto("invMassZeroWithTracks",    "Two photon invariant mass: Neither has tracks;M (GeV)",  etBin,etMin,etMax);
    h_invMassOneWithTracks_ = bookHisto("invMassOneWithTracks",     "Two photon invariant mass: Only one has tracks;M (GeV)", etBin,etMin,etMax);
    h_invMassTwoWithTracks_ = bookHisto("invMassTwoWithTracks",     "Two photon invariant mass: Both have tracks;M (GeV)",    etBin,etMin,etMax);



    //ENERGY VARIABLES

    book3DHistoVector(h_phoE_, "1D","phoE","Energy;E (GeV)",eBin,eMin,eMax);
    book3DHistoVector(h_phoEt_, "1D","phoEt","E_{T};E_{T} (GeV)", etBin,etMin,etMax);

    //NUMBER OF PHOTONS

    book3DHistoVector(h_nPho_, "1D","nPho","Number of Photons per Event;# #gamma",numberBin,numberMin,numberMax);

    //GEOMETRICAL VARIABLES

    //photon eta/phi
    book2DHistoVector(h_phoEta_, "1D","phoEta","#eta;#eta",etaBin,etaMin,etaMax) ;
    book3DHistoVector(h_phoPhi_, "1D","phoPhi","#phi;#phi",phiBin,phiMin,phiMax) ;

    //supercluster eta/phi
    book2DHistoVector(h_scEta_, "1D","scEta","SuperCluster #eta;#eta",etaBin,etaMin,etaMax) ;
    book3DHistoVector(h_scPhi_, "1D","scPhi","SuperCluster #phi;#phi",phiBin,phiMin,phiMax) ;

    //SHOWER SHAPE VARIABLES

    //r9
    book3DHistoVector(h_r9_, "1D","r9","R9;R9",r9Bin,r9Min, r9Max);
    book2DHistoVector(h_r9VsEt_, "2D","r9VsEt2D","R9 vs E_{T};E_{T} (GeV);R9",reducedEtBin,etMin,etMax,reducedR9Bin,r9Min,r9Max);
    book2DHistoVector(p_r9VsEt_, "Profile","r9VsEt","Avg R9 vs E_{T};E_{T} (GeV);R9",etBin,etMin,etMax,r9Bin,r9Min,r9Max);
    book2DHistoVector(h_r9VsEta_, "2D","r9VsEta2D","R9 vs #eta;#eta;R9",reducedEtaBin,etaMin,etaMax,reducedR9Bin,r9Min,r9Max);
    book2DHistoVector(p_r9VsEta_, "Profile","r9VsEta","Avg R9 vs #eta;#eta;R9",etaBin,etaMin,etaMax,r9Bin,r9Min,r9Max);

    //sigma ieta ieta
    book3DHistoVector(h_phoSigmaIetaIeta_,   "1D","phoSigmaIetaIeta","#sigma_{i#etai#eta};#sigma_{i#etai#eta}",sigmaIetaBin,sigmaIetaMin,sigmaIetaMax);
    book2DHistoVector(h_sigmaIetaIetaVsEta_, "2D","sigmaIetaIetaVsEta2D","#sigma_{i#etai#eta} vs #eta;#eta;#sigma_{i#etai#eta}",reducedEtaBin,etaMin,etaMax,sigmaIetaBin,sigmaIetaMin,sigmaIetaMax);
    book2DHistoVector(p_sigmaIetaIetaVsEta_, "Profile","sigmaIetaIetaVsEta","Avg #sigma_{i#etai#eta} vs #eta;#eta;#sigma_{i#etai#eta}",etaBin,etaMin,etaMax,sigmaIetaBin,sigmaIetaMin,sigmaIetaMax);

    //e1x5
    book2DHistoVector(h_e1x5VsEt_,  "2D","e1x5VsEt2D","E1x5 vs E_{T};E_{T} (GeV);E1X5 (GeV)",reducedEtBin,etMin,etMax,reducedEtBin,etMin,etMax);
    book2DHistoVector(p_e1x5VsEt_,  "Profile","e1x5VsEt","Avg E1x5 vs E_{T};E_{T} (GeV);E1X5 (GeV)",etBin,etMin,etMax,etBin,etMin,etMax);
    book2DHistoVector(h_e1x5VsEta_, "2D","e1x5VsEta2D","E1x5 vs #eta;#eta;E1X5 (GeV)",reducedEtaBin,etaMin,etaMax,reducedEtBin,etMin,etMax);
    book2DHistoVector(p_e1x5VsEta_, "Profile","e1x5VsEta","Avg E1x5 vs #eta;#eta;E1X5 (GeV)",etaBin,etaMin,etaMax,etBin,etMin,etMax);

    //e2x5
    book2DHistoVector(h_e2x5VsEt_,  "2D","e2x5VsEt2D","E2x5 vs E_{T};E_{T} (GeV);E2X5 (GeV)",reducedEtBin,etMin,etMax,reducedEtBin,etMin,etMax);
    book2DHistoVector(p_e2x5VsEt_,  "Profile","e2x5VsEt","Avg E2x5 vs E_{T};E_{T} (GeV);E2X5 (GeV)",etBin,etMin,etMax,etBin,etMin,etMax);
    book2DHistoVector(h_e2x5VsEta_, "2D","e2x5VsEta2D","E2x5 vs #eta;#eta;E2X5 (GeV)",reducedEtaBin,etaMin,etaMax,reducedEtBin,etMin,etMax);
    book2DHistoVector(p_e2x5VsEta_, "Profile","e2x5VsEta","Avg E2x5 vs #eta;#eta;E2X5 (GeV)",etaBin,etaMin,etaMax,etBin,etMin,etMax);

    //r1x5
    book2DHistoVector(h_r1x5VsEt_,  "2D","r1x5VsEt2D","R1x5 vs E_{T};E_{T} (GeV);R1X5",reducedEtBin,etMin,etMax,reducedR9Bin,r9Min,r9Max);
    book2DHistoVector(p_r1x5VsEt_,  "Profile","r1x5VsEt","Avg R1x5 vs E_{T};E_{T} (GeV);R1X5",etBin,etMin,etMax,r9Bin,r9Min,r9Max);
    book2DHistoVector(h_r1x5VsEta_, "2D","r1x5VsEta2D","R1x5 vs #eta;#eta;R1X5",reducedEtaBin,etaMin,etaMax,reducedR9Bin,r9Min,r9Max);
    book2DHistoVector(p_r1x5VsEta_, "Profile","r1x5VsEta","Avg R1x5 vs #eta;#eta;R1X5",etaBin,etaMin,etaMax,r9Bin,r9Min,r9Max);

    //r2x5
    book2DHistoVector(    h_r2x5VsEt_  ,"2D","r2x5VsEt2D","R2x5 vs E_{T};E_{T} (GeV);R2X5",reducedEtBin,etMin,etMax,reducedR9Bin,r9Min,r9Max);
    book2DHistoVector(    p_r2x5VsEt_  ,"Profile","r2x5VsEt","Avg R2x5 vs E_{T};E_{T} (GeV);R2X5",etBin,etMin,etMax,r9Bin,r9Min,r9Max);
    book2DHistoVector(    h_r2x5VsEta_ ,"2D","r2x5VsEta2D","R2x5 vs #eta;#eta;R2X5",reducedEtaBin,etaMin,etaMax,reducedR9Bin,r9Min,r9Max);
    book2DHistoVector(    p_r2x5VsEta_ ,"Profile","r2x5VsEta","Avg R2x5 vs #eta;#eta;R2X5",etaBin,etaMin,etaMax,r9Bin,r9Min,r9Max);

    //maxEXtalOver3x3
    book2DHistoVector(    h_maxEXtalOver3x3VsEt_  ,"2D","maxEXtalOver3x3VsEt2D","(Max Xtal E)/E3x3 vs E_{T};E_{T} (GeV);(Max Xtal E)/E3x3",reducedEtBin,etMin,etMax,r9Bin,r9Min,r9Max);
    book2DHistoVector(    p_maxEXtalOver3x3VsEt_  ,"Profile","maxEXtalOver3x3VsEt","Avg (Max Xtal E)/E3x3 vs E_{T};E_{T} (GeV);(Max Xtal E)/E3x3",etBin,etMin,etMax,r9Bin,r9Min,r9Max);
    book2DHistoVector(    h_maxEXtalOver3x3VsEta_ ,"2D","maxEXtalOver3x3VsEta2D","(Max Xtal E)/E3x3 vs #eta;#eta;(Max Xtal E)/E3x3",reducedEtaBin,etaMin,etaMax,r9Bin,r9Min,r9Max);
    book2DHistoVector(    p_maxEXtalOver3x3VsEta_ ,"Profile","maxEXtalOver3x3VsEta","Avg (Max Xtal E)/E3x3 vs #eta;#eta;(Max Xtal E)/E3x3",etaBin,etaMin,etaMax,r9Bin,r9Min,r9Max);


    //TRACK ISOLATION VARIABLES

    //nTrackIsolSolid
    book2DHistoVector(    h_nTrackIsolSolid_       ,"1D","nIsoTracksSolid","Number Of Tracks in the Solid Iso Cone;# tracks",numberBin,numberMin,numberMax);
    book2DHistoVector(    h_nTrackIsolSolidVsEt_   ,"2D","nIsoTracksSolidVsEt2D","Number Of Tracks in the Solid Iso Cone vs E_{T};E_{T};# tracks",reducedEtBin,etMin, etMax,numberBin,numberMin,numberMax);
    book2DHistoVector(    p_nTrackIsolSolidVsEt_   ,"Profile","nIsoTracksSolidVsEt","Avg Number Of Tracks in the Solid Iso Cone vs E_{T};E_{T};# tracks",etBin,etMin,etMax,numberBin,numberMin,numberMax);
    book2DHistoVector(    h_nTrackIsolSolidVsEta_  ,"2D","nIsoTracksSolidVsEta2D","Number Of Tracks in the Solid Iso Cone vs #eta;#eta;# tracks",reducedEtaBin,etaMin, etaMax,numberBin,numberMin,numberMax);
    book2DHistoVector(    p_nTrackIsolSolidVsEta_  ,"Profile","nIsoTracksSolidVsEta","Avg Number Of Tracks in the Solid Iso Cone vs #eta;#eta;# tracks",etaBin,etaMin, etaMax,numberBin,numberMin,numberMax);

    //nTrackIsolHollow
    book2DHistoVector(    h_nTrackIsolHollow_      ,"1D","nIsoTracksHollow","Number Of Tracks in the Hollow Iso Cone;# tracks",numberBin,numberMin,numberMax);
    book2DHistoVector(    h_nTrackIsolHollowVsEt_  ,"2D","nIsoTracksHollowVsEt2D","Number Of Tracks in the Hollow Iso Cone vs E_{T};E_{T};# tracks",reducedEtBin,etMin, etMax,numberBin,numberMin,numberMax);
    book2DHistoVector(    p_nTrackIsolHollowVsEt_  ,"Profile","nIsoTracksHollowVsEt","Avg Number Of Tracks in the Hollow Iso Cone vs E_{T};E_{T};# tracks",etBin,etMin,etMax,numberBin,numberMin,numberMax);
    book2DHistoVector(    h_nTrackIsolHollowVsEta_ ,"2D","nIsoTracksHollowVsEta2D","Number Of Tracks in the Hollow Iso Cone vs #eta;#eta;# tracks",reducedEtaBin,etaMin, etaMax,numberBin,numberMin,numberMax);
    book2DHistoVector(    p_nTrackIsolHollowVsEta_ ,"Profile","nIsoTracksHollowVsEta","Avg Number Of Tracks in the Hollow Iso Cone vs #eta;#eta;# tracks",etaBin,etaMin, etaMax,numberBin,numberMin,numberMax);

    //trackPtSumSolid
    book2DHistoVector(    h_trackPtSumSolid_       ,"1D","isoPtSumSolid","Track P_{T} Sum in the Solid Iso Cone;P_{T} (GeV)",sumBin,sumMin,sumMax);
    book2DHistoVector(    h_trackPtSumSolidVsEt_   ,"2D","isoPtSumSolidVsEt2D","Track P_{T} Sum in the Solid Iso Cone;E_{T} (GeV);P_{T} (GeV)",reducedEtBin,etMin, etMax,reducedSumBin,sumMin,sumMax);
    book2DHistoVector(    p_trackPtSumSolidVsEt_   ,"Profile","isoPtSumSolidVsEt","Avg Track P_{T} Sum in the Solid Iso Cone vs E_{T};E_{T} (GeV);P_{T} (GeV)",etBin,etMin,etMax,sumBin,sumMin,sumMax);
    book2DHistoVector(    h_trackPtSumSolidVsEta_  ,"2D","isoPtSumSolidVsEta2D","Track P_{T} Sum in the Solid Iso Cone;#eta;P_{T} (GeV)",reducedEtaBin,etaMin, etaMax,reducedSumBin,sumMin,sumMax);
    book2DHistoVector(    p_trackPtSumSolidVsEta_  ,"Profile","isoPtSumSolidVsEta","Avg Track P_{T} Sum in the Solid Iso Cone vs #eta;#eta;P_{T} (GeV)",etaBin,etaMin, etaMax,sumBin,sumMin,sumMax);

    //trackPtSumHollow
    book2DHistoVector(    h_trackPtSumHollow_      ,"1D","isoPtSumHollow","Track P_{T} Sum in the Hollow Iso Cone;P_{T} (GeV)",sumBin,sumMin,sumMax);
    book2DHistoVector(    h_trackPtSumHollowVsEt_  ,"2D","isoPtSumHollowVsEt2D","Track P_{T} Sum in the Hollow Iso Cone;E_{T} (GeV);P_{T} (GeV)",reducedEtBin,etMin, etMax,reducedSumBin,sumMin,sumMax);
    book2DHistoVector(    p_trackPtSumHollowVsEt_  ,"Profile","isoPtSumHollowVsEt","Avg Track P_{T} Sum in the Hollow Iso Cone vs E_{T};E_{T} (GeV);P_{T} (GeV)",etBin,etMin,etMax,sumBin,sumMin,sumMax);
    book2DHistoVector(    h_trackPtSumHollowVsEta_ ,"2D","isoPtSumHollowVsEta2D","Track P_{T} Sum in the Hollow Iso Cone;#eta;P_{T} (GeV)",reducedEtaBin,etaMin, etaMax,reducedSumBin,sumMin,sumMax);
    book2DHistoVector(    p_trackPtSumHollowVsEta_ ,"Profile","isoPtSumHollowVsEta","Avg Track P_{T} Sum in the Hollow Iso Cone vs #eta;#eta;P_{T} (GeV)",etaBin,etaMin, etaMax,sumBin,sumMin,sumMax);


    //CALORIMETER ISOLATION VARIABLES

    //ecal sum
    book2DHistoVector(    h_ecalSum_      ,"1D","ecalSum","Ecal Sum in the Iso Cone;E (GeV)",sumBin,sumMin,sumMax);
    book2DHistoVector(    h_ecalSumVsEt_  ,"2D","ecalSumVsEt2D","Ecal Sum in the Iso Cone;E_{T} (GeV);E (GeV)",reducedEtBin,etMin, etMax,reducedSumBin,sumMin,sumMax);
    book3DHistoVector(    p_ecalSumVsEt_  ,"Profile","ecalSumVsEt","Avg Ecal Sum in the Iso Cone vs E_{T};E_{T} (GeV);E (GeV)",etBin,etMin, etMax,sumBin,sumMin,sumMax);
    book2DHistoVector(    h_ecalSumVsEta_ ,"2D","ecalSumVsEta2D","Ecal Sum in the Iso Cone;#eta;E (GeV)",reducedEtaBin,etaMin, etaMax,reducedSumBin,sumMin,sumMax);
    book2DHistoVector(    p_ecalSumVsEta_ ,"Profile","ecalSumVsEta","Avg Ecal Sum in the Iso Cone vs #eta;#eta;E (GeV)",etaBin,etaMin, etaMax,sumBin,sumMin,sumMax);

    //hcal sum
    book2DHistoVector(    h_hcalSum_      ,"1D","hcalSum","Hcal Sum in the Iso Cone;E (GeV)",sumBin,sumMin,sumMax);
    book2DHistoVector(    h_hcalSumVsEt_  ,"2D","hcalSumVsEt2D","Hcal Sum in the Iso Cone;E_{T} (GeV);E (GeV)",reducedEtBin,etMin, etMax,reducedSumBin,sumMin,sumMax);
    book3DHistoVector(    p_hcalSumVsEt_  ,"Profile","hcalSumVsEt","Avg Hcal Sum in the Iso Cone vs E_{T};E_{T} (GeV);E (GeV)",etBin,etMin, etMax,sumBin,sumMin,sumMax);
    book2DHistoVector(    h_hcalSumVsEta_ ,"2D","hcalSumVsEta2D","Hcal Sum in the Iso Cone;#eta;E (GeV)",reducedEtaBin,etaMin, etaMax,reducedSumBin,sumMin,sumMax);
    book2DHistoVector(    p_hcalSumVsEta_ ,"Profile","hcalSumVsEta","Avg Hcal Sum in the Iso Cone vs #eta;#eta;E (GeV)",etaBin,etaMin, etaMax,sumBin,sumMin,sumMax);

    //h over e
    book3DHistoVector(    h_hOverE_       ,"1D","hOverE","H/E;H/E",hOverEBin,hOverEMin,hOverEMax);
    book2DHistoVector(    p_hOverEVsEt_   ,"Profile","hOverEVsEt","Avg H/E vs Et;E_{T} (GeV);H/E",etBin,etMin,etMax,hOverEBin,hOverEMin,hOverEMax);
    book2DHistoVector(    p_hOverEVsEta_  ,"Profile","hOverEVsEta","Avg H/E vs #eta;#eta;H/E",etaBin,etaMin,etaMax,hOverEBin,hOverEMin,hOverEMax);
    book3DHistoVector(    h_h1OverE_      ,"1D","h1OverE","H/E for Depth 1;H/E",hOverEBin,hOverEMin,hOverEMax);
    book3DHistoVector(    h_h2OverE_      ,"1D","h2OverE","H/E for Depth 2;H/E",hOverEBin,hOverEMin,hOverEMax);


    //OTHER VARIABLES

    //bad channel histograms
    book2DHistoVector(    h_phoEt_BadChannels_  ,"1D","phoEtBadChannels", "Fraction Containing Bad Channels: E_{T};E_{T} (GeV)",etBin,etMin,etMax);
    book2DHistoVector(    h_phoEta_BadChannels_ ,"1D","phoEtaBadChannels","Fraction Containing Bad Channels: #eta;#eta",etaBin,etaMin,etaMax);
    book2DHistoVector(    h_phoPhi_BadChannels_ ,"1D","phoPhiBadChannels","Fraction Containing Bad Channels: #phi;#phi",phiBin,phiMin,phiMax);



    dbe_->setCurrentFolder("Egamma/PhotonAnalyzer/AllPhotons/Et Above 0 GeV/Conversions");

    //ENERGY VARIABLES

    book3DHistoVector(    h_phoConvE_  ,"1D","phoConvE","E;E (GeV)",eBin,eMin,eMax);
    book3DHistoVector(    h_phoConvEt_ ,"1D","phoConvEt","E_{T};E_{T} (GeV)",etBin,etMin,etMax);

    //GEOMETRICAL VARIABLES

    book2DHistoVector(    h_phoConvEta_ ,"1D","phoConvEta","#eta;#eta",etaBin,etaMin,etaMax);
    book3DHistoVector(    h_phoConvPhi_ ,"1D","phoConvPhi","#phi;#phi",phiBin,phiMin,phiMax);

    //NUMBER OF PHOTONS

    book3DHistoVector(    h_nConv_ ,"1D","nConv","Number Of Conversions per Event ;# conversions",numberBin,numberMin,numberMax);

    //SHOWER SHAPE VARIABLES

    book3DHistoVector(    h_phoConvR9_ ,"1D","phoConvR9","R9;R9",r9Bin,r9Min,r9Max);

    //TRACK RELATED VARIABLES

    book3DHistoVector(    h_eOverPTracks_ ,"1D","eOverPTracks","E/P;E/P",eOverPBin,eOverPMin,eOverPMax);
    book3DHistoVector(    h_pOverETracks_ ,"1D","pOverETracks","P/E;P/E",eOverPBin,eOverPMin,eOverPMax);

    book3DHistoVector(    h_dPhiTracksAtVtx_  ,"1D","dPhiTracksAtVtx", "#Delta#phi of Tracks at Vertex;#Delta#phi",dPhiTracksBin,dPhiTracksMin,dPhiTracksMax);
    book3DHistoVector(    h_dPhiTracksAtEcal_ ,"1D","dPhiTracksAtEcal", "Abs(#Delta#phi) of Tracks at Ecal;#Delta#phi",dPhiTracksBin,0.,dPhiTracksMax);
    book3DHistoVector(    h_dEtaTracksAtEcal_ ,"1D","dEtaTracksAtEcal", "#Delta#eta of Tracks at Ecal;#Delta#eta",dEtaTracksBin,dEtaTracksMin,dEtaTracksMax);

    book3DHistoVector(    h_dCotTracks_      ,"1D","dCotTracks","#Deltacot(#theta) of Tracks;#Deltacot(#theta)",dEtaTracksBin,dEtaTracksMin,dEtaTracksMax);
    book2DHistoVector(    p_dCotTracksVsEta_ ,"Profile","dCotTracksVsEta","Avg #Deltacot(#theta) of Tracks vs #eta;#eta;#Deltacot(#theta)",etaBin,etaMin,etaMax,dEtaTracksBin,dEtaTracksMin,dEtaTracksMax);

    book2DHistoVector(    p_nHitsVsEta_ ,"Profile","nHitsVsEta","Avg Number of Hits per Track vs #eta;#eta;# hits",etaBin,etaMin,etaMax,etaBin,0,16);

    book2DHistoVector(    h_tkChi2_      ,"1D","tkChi2","#chi^{2} of Track Fitting;#chi^{2}",chi2Bin,chi2Min,chi2Max);
    book2DHistoVector(    p_tkChi2VsEta_ ,"Profile","tkChi2VsEta","Avg #chi^{2} of Track Fitting vs #eta;#eta;#chi^{2}",etaBin,etaMin,etaMax,chi2Bin,chi2Min,chi2Max);

    //VERTEX RELATED VARIABLES

    book2DHistoVector(    h_convVtxRvsZ_ ,"2D","convVtxRvsZ","Vertex Position;Z (cm);R (cm)",500,zMin,zMax,rBin,rMin,rMax);
    book2DHistoVector(    h_convVtxZEndcap_    ,"1D","convVtxZEndcap",   "Vertex Position: #eta > 1.5;Z (cm)",zBin,zMin,zMax);
    book2DHistoVector(    h_convVtxZ_    ,"1D","convVtxZ",   "Vertex Position;Z (cm)",zBin,zMin,zMax);
    book2DHistoVector(    h_convVtxR_    ,"1D","convVtxR",   "Vertex Position: #eta < 1;R (cm)",rBin,rMin,rMax);
    book2DHistoVector(    h_convVtxYvsX_ ,"2D","convVtxYvsX","Vertex Position: #eta < 1;X (cm);Y (cm)",xBin,xMin,xMax,yBin,yMin,yMax);



    book2DHistoVector(    h_vertexChi2Prob_ ,"1D","vertexChi2Prob","#chi^{2} Probability of Vertex Fitting;#chi^{2}",100,0.,1.0);


  }//end if(dbe_)


}//end BeginJob
void PhotonAnalyzer::book2DHistoVector ( std::vector< std::vector< MonitorElement * > > &  toFill,
std::string  histoType,
std::string  histoName,
std::string  title,
int  xbin,
double  xmin,
double  xmax,
int  ybin = 1,
double  ymin = 1,
double  ymax = 2 
) [private]
void PhotonAnalyzer::book3DHistoVector ( std::vector< std::vector< std::vector< MonitorElement * > > > &  toFill,
std::string  histoType,
std::string  histoName,
std::string  title,
int  xbin,
double  xmin,
double  xmax,
int  ybin = 1,
double  ymin = 1,
double  ymax = 2 
) [private]
MonitorElement* PhotonAnalyzer::bookHisto ( std::string  histoName,
std::string  title,
int  bin,
double  min,
double  max 
) [private]
void PhotonAnalyzer::endJob ( void  ) [virtual]
void PhotonAnalyzer::endRun ( const edm::Run run,
const edm::EventSetup setup 
) [virtual]
void PhotonAnalyzer::fill2DHistoVector ( std::vector< std::vector< MonitorElement * > > &  histoVector,
double  x,
int  cut,
int  type 
) [private]
void PhotonAnalyzer::fill2DHistoVector ( std::vector< std::vector< MonitorElement * > > &  histoVector,
double  x,
double  y,
int  cut,
int  type 
) [private]
void PhotonAnalyzer::fill3DHistoVector ( std::vector< std::vector< std::vector< MonitorElement * > > > &  histoVector,
double  x,
int  cut,
int  type,
int  part 
) [private]
void PhotonAnalyzer::fill3DHistoVector ( std::vector< std::vector< std::vector< MonitorElement * > > > &  histoVector,
double  x,
double  y,
int  cut,
int  type,
int  part 
) [private]
float PhotonAnalyzer::phiNormalization ( float &  a) [private]

Definition at line 1021 of file PhotonAnalyzer.cc.

References phi, PI, and TWOPI.

{
 const float PI    = 3.1415927;
 const float TWOPI = 2.0*PI;

 if(phi >  PI) {phi = phi - TWOPI;}
 if(phi < -PI) {phi = phi + TWOPI;}

 return phi;
}

Member Data Documentation

Definition at line 159 of file PhotonAnalyzer.h.

Definition at line 158 of file PhotonAnalyzer.h.

std::stringstream PhotonAnalyzer::currentFolder_ [private]

Definition at line 187 of file PhotonAnalyzer.h.

double PhotonAnalyzer::cutStep_ [private]

Definition at line 169 of file PhotonAnalyzer.h.

Definition at line 186 of file PhotonAnalyzer.h.

Definition at line 162 of file PhotonAnalyzer.h.

Definition at line 161 of file PhotonAnalyzer.h.

std::string PhotonAnalyzer::fName_ [private]

Definition at line 150 of file PhotonAnalyzer.h.

Definition at line 221 of file PhotonAnalyzer.h.

Definition at line 222 of file PhotonAnalyzer.h.

Definition at line 219 of file PhotonAnalyzer.h.

Definition at line 220 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_convVtxR_ [private]

Definition at line 312 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_convVtxRvsZ_ [private]

Definition at line 308 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_convVtxYvsX_ [private]

Definition at line 311 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_convVtxZ_ [private]

Definition at line 310 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_convVtxZEndcap_ [private]

Definition at line 309 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_dCotTracks_ [private]

Definition at line 376 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_dEtaTracksAtEcal_ [private]

Definition at line 381 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_dPhiTracksAtEcal_ [private]

Definition at line 379 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_dPhiTracksAtVtx_ [private]

Definition at line 378 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_e1x5VsEt_ [private]

Definition at line 318 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_e1x5VsEta_ [private]

Definition at line 319 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_e2x5VsEt_ [private]

Definition at line 321 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_e2x5VsEta_ [private]

Definition at line 322 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_ecalSum_ [private]

Definition at line 255 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_ecalSumVsEt_ [private]

Definition at line 247 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_ecalSumVsEta_ [private]

Definition at line 239 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_eOverPTracks_ [private]

Definition at line 373 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_h1OverE_ [private]

Definition at line 360 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_h2OverE_ [private]

Definition at line 361 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_hcalSum_ [private]

Definition at line 256 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_hcalSumVsEt_ [private]

Definition at line 248 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_hcalSumVsEta_ [private]

Definition at line 240 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_hOverE_ [private]

Definition at line 359 of file PhotonAnalyzer.h.

Definition at line 230 of file PhotonAnalyzer.h.

Definition at line 228 of file PhotonAnalyzer.h.

Definition at line 227 of file PhotonAnalyzer.h.

Definition at line 229 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_maxEXtalOver3x3VsEt_ [private]

Definition at line 324 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_maxEXtalOver3x3VsEta_ [private]

Definition at line 325 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_nConv_ [private]

Definition at line 371 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_nPho_ [private]

Definition at line 365 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_nTrackIsolHollow_ [private]

Definition at line 253 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_nTrackIsolHollowVsEt_ [private]

Definition at line 245 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_nTrackIsolHollowVsEta_ [private]

Definition at line 237 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_nTrackIsolSolid_ [private]

Definition at line 251 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_nTrackIsolSolidVsEt_ [private]

Definition at line 243 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_nTrackIsolSolidVsEta_ [private]

Definition at line 235 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_phoConvE_ [private]

Definition at line 367 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_phoConvEt_ [private]

Definition at line 368 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_phoConvEta_ [private]

Definition at line 306 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_phoConvEtaForEfficiency_ [private]

Definition at line 300 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_phoConvPhi_ [private]

Definition at line 355 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_phoConvPhiForEfficiency_ [private]

Definition at line 354 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_phoConvR9_ [private]

Definition at line 369 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_phoE_ [private]

Definition at line 349 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_phoEt_ [private]

Definition at line 350 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_phoEt_BadChannels_ [private]

Definition at line 303 of file PhotonAnalyzer.h.

Definition at line 211 of file PhotonAnalyzer.h.

Definition at line 217 of file PhotonAnalyzer.h.

Definition at line 216 of file PhotonAnalyzer.h.

Definition at line 212 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_phoEta_ [private]

Definition at line 296 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_phoEta_BadChannels_ [private]

Definition at line 302 of file PhotonAnalyzer.h.

Definition at line 209 of file PhotonAnalyzer.h.

Definition at line 215 of file PhotonAnalyzer.h.

Definition at line 214 of file PhotonAnalyzer.h.

Definition at line 210 of file PhotonAnalyzer.h.

Definition at line 225 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_phoPhi_ [private]

Definition at line 352 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_phoPhi_BadChannels_ [private]

Definition at line 304 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_phoSigmaIetaIeta_ [private]

Definition at line 363 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_pOverETracks_ [private]

Definition at line 374 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_r1x5VsEt_ [private]

Definition at line 327 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_r1x5VsEta_ [private]

Definition at line 328 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_r2x5VsEt_ [private]

Definition at line 330 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_r2x5VsEta_ [private]

Definition at line 331 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_r9_ [private]

Definition at line 351 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_r9VsEt_ [private]

Definition at line 314 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_r9VsEta_ [private]

Definition at line 315 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_scEta_ [private]

Definition at line 297 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::h_scPhi_ [private]

Definition at line 353 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_sigmaIetaIetaVsEta_ [private]

Definition at line 333 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_tkChi2_ [private]

Definition at line 335 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_trackPtSumHollow_ [private]

Definition at line 254 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_trackPtSumHollowVsEt_ [private]

Definition at line 246 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_trackPtSumHollowVsEta_ [private]

Definition at line 238 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_trackPtSumSolid_ [private]

Definition at line 252 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_trackPtSumSolidVsEt_ [private]

Definition at line 244 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_trackPtSumSolidVsEta_ [private]

Definition at line 236 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::h_vertexChi2Prob_ [private]

Definition at line 337 of file PhotonAnalyzer.h.

Definition at line 190 of file PhotonAnalyzer.h.

Definition at line 191 of file PhotonAnalyzer.h.

Definition at line 192 of file PhotonAnalyzer.h.

Definition at line 189 of file PhotonAnalyzer.h.

Definition at line 167 of file PhotonAnalyzer.h.

Definition at line 180 of file PhotonAnalyzer.h.

Definition at line 178 of file PhotonAnalyzer.h.

double PhotonAnalyzer::minPhoEtCut_ [private]

Definition at line 166 of file PhotonAnalyzer.h.

int PhotonAnalyzer::nEntry_ [private]

Definition at line 196 of file PhotonAnalyzer.h.

int PhotonAnalyzer::nEvt_ [private]

Definition at line 195 of file PhotonAnalyzer.h.

Definition at line 170 of file PhotonAnalyzer.h.

std::string PhotonAnalyzer::outputFileName_ [private]

Definition at line 175 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_dCotTracksVsEta_ [private]

Definition at line 291 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_e1x5VsEt_ [private]

Definition at line 274 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_e1x5VsEta_ [private]

Definition at line 275 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_e2x5VsEt_ [private]

Definition at line 277 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_e2x5VsEta_ [private]

Definition at line 278 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::p_ecalSumVsEt_ [private]

Definition at line 346 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_ecalSumVsEta_ [private]

Definition at line 263 of file PhotonAnalyzer.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonAnalyzer::p_hcalSumVsEt_ [private]

Definition at line 347 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_hcalSumVsEta_ [private]

Definition at line 264 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_hOverEVsEt_ [private]

Definition at line 294 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_hOverEVsEta_ [private]

Definition at line 293 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_maxEXtalOver3x3VsEt_ [private]

Definition at line 280 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_maxEXtalOver3x3VsEta_ [private]

Definition at line 281 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_nHitsVsEta_ [private]

Definition at line 339 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_nTrackIsolHollowVsEt_ [private]

Definition at line 268 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_nTrackIsolHollowVsEta_ [private]

Definition at line 261 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_nTrackIsolSolidVsEt_ [private]

Definition at line 266 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_nTrackIsolSolidVsEta_ [private]

Definition at line 259 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_r1x5VsEt_ [private]

Definition at line 283 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_r1x5VsEta_ [private]

Definition at line 284 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_r2x5VsEt_ [private]

Definition at line 286 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_r2x5VsEta_ [private]

Definition at line 287 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_r9VsEt_ [private]

Definition at line 271 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_r9VsEta_ [private]

Definition at line 272 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_sigmaIetaIetaVsEta_ [private]

Definition at line 289 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_tkChi2VsEta_ [private]

Definition at line 341 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_trackPtSumHollowVsEt_ [private]

Definition at line 269 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_trackPtSumHollowVsEta_ [private]

Definition at line 262 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_trackPtSumSolidVsEt_ [private]

Definition at line 267 of file PhotonAnalyzer.h.

std::vector<std::vector<MonitorElement*> > PhotonAnalyzer::p_trackPtSumSolidVsEta_ [private]

Definition at line 260 of file PhotonAnalyzer.h.

Definition at line 182 of file PhotonAnalyzer.h.

std::vector<std::string> PhotonAnalyzer::parts_ [private]

Definition at line 199 of file PhotonAnalyzer.h.

std::string PhotonAnalyzer::photonCollection_ [private]

Definition at line 156 of file PhotonAnalyzer.h.

std::string PhotonAnalyzer::photonProducer_ [private]

Definition at line 155 of file PhotonAnalyzer.h.

unsigned int PhotonAnalyzer::prescaleFactor_ [private]

Definition at line 153 of file PhotonAnalyzer.h.

Definition at line 174 of file PhotonAnalyzer.h.

Definition at line 206 of file PhotonAnalyzer.h.

Definition at line 203 of file PhotonAnalyzer.h.

Definition at line 204 of file PhotonAnalyzer.h.

Definition at line 205 of file PhotonAnalyzer.h.

Definition at line 164 of file PhotonAnalyzer.h.

std::vector<std::string> PhotonAnalyzer::types_ [private]

Definition at line 198 of file PhotonAnalyzer.h.

Definition at line 172 of file PhotonAnalyzer.h.

Definition at line 173 of file PhotonAnalyzer.h.

Definition at line 151 of file PhotonAnalyzer.h.