CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

HLTAlCaMonPi0 Class Reference

#include <HLTAlCaMonPi0.h>

Inheritance diagram for HLTAlCaMonPi0:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
void beginJob ()
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
void beginRun (const edm::Run &r, const edm::EventSetup &c)
void convxtalid (int &, int &)
int diff_neta_s (int, int)
int diff_nphi_s (int, int)
void endJob ()
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void endRun (const edm::Run &r, const edm::EventSetup &c)

Private Attributes

int clusEtaSize_
int clusPhiSize_
double clusSeedThr_
double clusSeedThrEndCap_
DQMStoredbe_
std::vector< EBDetIddetIdEBRecHits
std::vector< EEDetIddetIdEERecHits
std::vector< EcalRecHitEBRecHits
std::vector< EcalRecHitEERecHits
int eventCounter_
std::string fileName_
 Output file name if required.
std::string folderName_
 DQM folder name.
int gammaCandEtaSize_
int gammaCandPhiSize_
MonitorElementhEventEnergyEBeta_
 Distribution of total event energy EB (eta)
MonitorElementhEventEnergyEBpi0_
 Distribution of total event energy EB (pi0)
MonitorElementhEventEnergyEEeta_
 Distribution of total event energy EE (eta)
MonitorElementhEventEnergyEEpi0_
 Distribution of total event energy EE (pi0)
MonitorElementhiEtaDistrEBeta_
 Distribution of rechits in iEta (eta)
MonitorElementhiEtaDistrEBpi0_
 Distribution of rechits in iEta (pi0)
MonitorElementhiPhiDistrEBeta_
 Distribution of rechits in iPhi (eta)
MonitorElementhiPhiDistrEBpi0_
 Distribution of rechits in iPhi (pi0)
MonitorElementhIsoEtaEB_
 Eta Iso EB.
MonitorElementhIsoEtaEE_
 Eta Iso EE.
MonitorElementhIsoPi0EB_
 Pi0 Iso EB.
MonitorElementhIsoPi0EE_
 Pi0 Iso EE.
MonitorElementhiXDistrEEeta_
 Distribution of rechits in ix EE (eta)
MonitorElementhiXDistrEEpi0_
 Distribution of rechits in ix EE (pi0)
MonitorElementhiYDistrEEeta_
 Distribution of rechits in iy EE (eta)
MonitorElementhiYDistrEEpi0_
 Distribution of rechits in iy EE (pi0)
MonitorElementhMeanRecHitEnergyEBeta_
 Distribution of Mean energy per rechit EB (eta)
MonitorElementhMeanRecHitEnergyEBpi0_
 Distribution of Mean energy per rechit EB (pi0)
MonitorElementhMeanRecHitEnergyEEeta_
 Distribution of Mean energy per rechit EE (eta)
MonitorElementhMeanRecHitEnergyEEpi0_
 Distribution of Mean energy per rechit EE (pi0)
MonitorElementhMinvEtaEB_
 Eta invariant mass in EB.
MonitorElementhMinvEtaEE_
 Eta invariant mass in EE.
MonitorElementhMinvPi0EB_
 Pi0 invariant mass in EB.
MonitorElementhMinvPi0EE_
 Pi0 invariant mass in EE.
MonitorElementhNRecHitsEBeta_
 Distribution of number of RecHits EB (eta)
MonitorElementhNRecHitsEBpi0_
 Distribution of number of RecHits EB (pi0)
MonitorElementhNRecHitsEEeta_
 Distribution of number of RecHits EE (eta)
MonitorElementhNRecHitsEEpi0_
 Distribution of number of RecHits EE (pi0)
MonitorElementhPt1EtaEB_
 Pt of the 1st most energetic Eta photon in EB.
MonitorElementhPt1EtaEE_
 Pt of the 1st most energetic Eta photon in EE.
MonitorElementhPt1Pi0EB_
 Pt of the 1st most energetic Pi0 photon in EB.
MonitorElementhPt1Pi0EE_
 Pt of the 1st most energetic Pi0 photon in EE.
MonitorElementhPt2EtaEB_
 Pt of the 2nd most energetic Eta photon in EB.
MonitorElementhPt2EtaEE_
 Pt of the 2nd most energetic Eta photon in EE.
MonitorElementhPt2Pi0EB_
 Pt of the 2nd most energetic Pi0 photon in EB.
MonitorElementhPt2Pi0EE_
 Pt of the 2nd most energetic Pi0 photon in EE.
MonitorElementhPtEtaEB_
 Eta Pt in EB.
MonitorElementhPtEtaEE_
 Eta Pt in EE.
MonitorElementhPtPi0EB_
 Pi0 Pt in EB.
MonitorElementhPtPi0EE_
 Pi0 Pt in EE.
MonitorElementhRechitEnergyEBeta_
 Energy Distribution of rechits EB (eta)
MonitorElementhRechitEnergyEBpi0_
 Energy Distribution of rechits EB (pi0)
MonitorElementhRechitEnergyEEeta_
 Energy Distribution of rechits EE (eta)
MonitorElementhRechitEnergyEEpi0_
 Energy Distribution of rechits EE (pi0)
MonitorElementhS4S91EtaEB_
 S4S9 of the 1st most energetic eta photon.
MonitorElementhS4S91EtaEE_
 S4S9 of the 1st most energetic eta photon EE.
MonitorElementhS4S91Pi0EB_
 S4S9 of the 1st most energetic pi0 photon.
MonitorElementhS4S91Pi0EE_
 S4S9 of the 1st most energetic pi0 photon EE.
MonitorElementhS4S92EtaEB_
 S4S9 of the 2nd most energetic eta photon.
MonitorElementhS4S92EtaEE_
 S4S9 of the 2nd most energetic eta photon EE.
MonitorElementhS4S92Pi0EB_
 S4S9 of the 2nd most energetic pi0 photon.
MonitorElementhS4S92Pi0EE_
 S4S9 of the 2nd most energetic pi0 photon EE.
bool isMonEBeta_
bool isMonEBpi0_
 which subdet will be monitored
bool isMonEEeta_
bool isMonEEpi0_
bool ParameterLogWeighted_
double ParameterT0_barl_
double ParameterT0_endc_
double ParameterT0_endcPresh_
double ParameterW0_
double ParameterX0_
PositionCalc posCalculator_
unsigned int prescaleFactor_
 Monitor every prescaleFactor_ events.
edm::InputTag productMonitoredEBeta_
edm::InputTag productMonitoredEBpi0_
 object to monitor
edm::InputTag productMonitoredEEeta_
edm::InputTag productMonitoredEEpi0_
 object to monitor
double ptMinForIsolation_
double ptMinForIsolationEndCap_
double ptMinForIsolationEta_
double ptMinForIsolationEtaEndCap_
bool saveToFile_
 Write to file.
double seleEtaBeltDeta_
double seleEtaBeltDetaEndCap_
double seleEtaBeltDR_
double seleEtaBeltDREndCap_
double seleEtaIso_
double seleEtaIsoEndCap_
double seleMinvMaxEta_
double seleMinvMaxEtaEndCap_
double seleMinvMaxPi0_
double seleMinvMaxPi0EndCap_
double seleMinvMinEta_
double seleMinvMinEtaEndCap_
double seleMinvMinPi0_
double seleMinvMinPi0EndCap_
double selePi0BeltDeta_
double selePi0BeltDetaEndCap_
double selePi0BeltDR_
double selePi0BeltDREndCap_
double selePi0Iso_
double selePi0IsoEndCap_
double selePtEta_
double selePtEtaEndCap_
double selePtGamma_
double selePtGammaEndCap_
 for pi0->gg endcap
double selePtGammaEta_
 for eta->gg barrel
double selePtGammaEtaEndCap_
 for eta->gg endcap
double selePtPi0_
double selePtPi0EndCap_
double seleS4S9Gamma_
double seleS4S9GammaEndCap_
double seleS4S9GammaEta_
double seleS4S9GammaEtaEndCap_
double seleS9S25GammaEta_
double seleS9S25GammaEtaEndCap_
double seleXtalMinEnergy_
double seleXtalMinEnergyEndCap_

Detailed Description

Definition at line 41 of file HLTAlCaMonPi0.h.


Constructor & Destructor Documentation

HLTAlCaMonPi0::HLTAlCaMonPi0 ( const edm::ParameterSet ps)

for Pi0 barrel selection

for Pi0 endcap selection

for Eta barrel selection

for Eta endcap selection

Definition at line 54 of file HLTAlCaMonPi0.cc.

References clusEtaSize_, clusPhiSize_, clusSeedThr_, clusSeedThrEndCap_, dbe_, fileName_, folderName_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), isMonEBeta_, isMonEBpi0_, isMonEEeta_, isMonEEpi0_, cppFunctionSkipper::operator, posCalculator_, prescaleFactor_, productMonitoredEBeta_, productMonitoredEBpi0_, productMonitoredEEeta_, productMonitoredEEpi0_, ptMinForIsolation_, ptMinForIsolationEndCap_, ptMinForIsolationEta_, ptMinForIsolationEtaEndCap_, saveToFile_, seleEtaBeltDeta_, seleEtaBeltDetaEndCap_, seleEtaBeltDR_, seleEtaBeltDREndCap_, seleEtaIso_, seleEtaIsoEndCap_, seleMinvMaxEta_, seleMinvMaxEtaEndCap_, seleMinvMaxPi0_, seleMinvMaxPi0EndCap_, seleMinvMinEta_, seleMinvMinEtaEndCap_, seleMinvMinPi0_, seleMinvMinPi0EndCap_, selePi0BeltDeta_, selePi0BeltDetaEndCap_, selePi0BeltDR_, selePi0BeltDREndCap_, selePi0Iso_, selePi0IsoEndCap_, selePtEta_, selePtEtaEndCap_, selePtGamma_, selePtGammaEndCap_, selePtGammaEta_, selePtGammaEtaEndCap_, selePtPi0_, selePtPi0EndCap_, seleS4S9Gamma_, seleS4S9GammaEndCap_, seleS4S9GammaEta_, seleS4S9GammaEtaEndCap_, seleS9S25GammaEta_, seleS9S25GammaEtaEndCap_, seleXtalMinEnergy_, and seleXtalMinEnergyEndCap_.

                                                        :
eventCounter_(0)
{
  dbe_ = Service<DQMStore>().operator->();
  folderName_ = ps.getUntrackedParameter<std::string>("FolderName","HLT/AlCaEcalPi0");
  prescaleFactor_ = ps.getUntrackedParameter<int>("prescaleFactor",1);
  productMonitoredEBpi0_= ps.getUntrackedParameter<edm::InputTag>("AlCaStreamEBpi0Tag");
  productMonitoredEBeta_= ps.getUntrackedParameter<edm::InputTag>("AlCaStreamEBetaTag");
  productMonitoredEEpi0_= ps.getUntrackedParameter<edm::InputTag>("AlCaStreamEEpi0Tag");
  productMonitoredEEeta_= ps.getUntrackedParameter<edm::InputTag>("AlCaStreamEEetaTag");

  isMonEBpi0_ = ps.getUntrackedParameter<bool>("isMonEBpi0",false);
  isMonEBeta_ = ps.getUntrackedParameter<bool>("isMonEBeta",false);
  isMonEEpi0_ = ps.getUntrackedParameter<bool>("isMonEEpi0",false);
  isMonEEeta_ = ps.getUntrackedParameter<bool>("isMonEEeta",false);

  saveToFile_=ps.getUntrackedParameter<bool>("SaveToFile",false);
  fileName_=  ps.getUntrackedParameter<std::string>("FileName","MonitorAlCaEcalPi0.root");

  clusSeedThr_ = ps.getParameter<double> ("clusSeedThr");
  clusSeedThrEndCap_ = ps.getParameter<double> ("clusSeedThrEndCap");
  clusEtaSize_ = ps.getParameter<int> ("clusEtaSize");
  clusPhiSize_ = ps.getParameter<int> ("clusPhiSize");
  if ( clusPhiSize_ % 2 == 0 ||  clusEtaSize_ % 2 == 0)
    edm::LogError("AlCaPi0RecHitsProducerError") << "Size of eta/phi for simple clustering should be odd numbers";


  seleXtalMinEnergy_ = ps.getParameter<double>("seleXtalMinEnergy");
  seleXtalMinEnergyEndCap_ = ps.getParameter<double>("seleXtalMinEnergyEndCap");

    selePtGamma_ = ps.getParameter<double> ("selePtGamma");  
    selePtPi0_ = ps.getParameter<double> ("selePtPi0");  
    seleMinvMaxPi0_ = ps.getParameter<double> ("seleMinvMaxPi0");  
    seleMinvMinPi0_ = ps.getParameter<double> ("seleMinvMinPi0");  
    seleS4S9Gamma_ = ps.getParameter<double> ("seleS4S9Gamma");  
    selePi0Iso_ = ps.getParameter<double> ("selePi0Iso");  
    ptMinForIsolation_ = ps.getParameter<double> ("ptMinForIsolation");
    selePi0BeltDR_ = ps.getParameter<double> ("selePi0BeltDR");  
    selePi0BeltDeta_ = ps.getParameter<double> ("selePi0BeltDeta");  

  
    selePtGammaEndCap_ = ps.getParameter<double> ("selePtGammaEndCap");  
    selePtPi0EndCap_ = ps.getParameter<double> ("selePtPi0EndCap");   
    seleS4S9GammaEndCap_ = ps.getParameter<double> ("seleS4S9GammaEndCap");  
    seleMinvMaxPi0EndCap_ = ps.getParameter<double> ("seleMinvMaxPi0EndCap");  
    seleMinvMinPi0EndCap_ = ps.getParameter<double> ("seleMinvMinPi0EndCap");  
    ptMinForIsolationEndCap_ = ps.getParameter<double> ("ptMinForIsolationEndCap");
    selePi0BeltDREndCap_ = ps.getParameter<double> ("selePi0BeltDREndCap");  
    selePi0BeltDetaEndCap_ = ps.getParameter<double> ("selePi0BeltDetaEndCap");  
    selePi0IsoEndCap_ = ps.getParameter<double> ("selePi0IsoEndCap");  


    selePtGammaEta_ = ps.getParameter<double> ("selePtGammaEta");  
    selePtEta_ = ps.getParameter<double> ("selePtEta");   
    seleS4S9GammaEta_ = ps.getParameter<double> ("seleS4S9GammaEta");  
    seleS9S25GammaEta_ = ps.getParameter<double> ("seleS9S25GammaEta");  
    seleMinvMaxEta_ = ps.getParameter<double> ("seleMinvMaxEta");  
    seleMinvMinEta_ = ps.getParameter<double> ("seleMinvMinEta");  
    ptMinForIsolationEta_ = ps.getParameter<double> ("ptMinForIsolationEta");
    seleEtaIso_ = ps.getParameter<double> ("seleEtaIso");  
    seleEtaBeltDR_ = ps.getParameter<double> ("seleEtaBeltDR");  
    seleEtaBeltDeta_ = ps.getParameter<double> ("seleEtaBeltDeta");  

  
    selePtGammaEtaEndCap_ = ps.getParameter<double> ("selePtGammaEtaEndCap");  
    selePtEtaEndCap_ = ps.getParameter<double> ("selePtEtaEndCap");   
    seleS4S9GammaEtaEndCap_ = ps.getParameter<double> ("seleS4S9GammaEtaEndCap");  
    seleS9S25GammaEtaEndCap_ = ps.getParameter<double> ("seleS9S25GammaEtaEndCap");  
    seleMinvMaxEtaEndCap_ = ps.getParameter<double> ("seleMinvMaxEtaEndCap");  
    seleMinvMinEtaEndCap_ = ps.getParameter<double> ("seleMinvMinEtaEndCap");  
    ptMinForIsolationEtaEndCap_ = ps.getParameter<double> ("ptMinForIsolationEtaEndCap");
    seleEtaIsoEndCap_ = ps.getParameter<double> ("seleEtaIsoEndCap");  
    seleEtaBeltDREndCap_ = ps.getParameter<double> ("seleEtaBeltDREndCap");  
    seleEtaBeltDetaEndCap_ = ps.getParameter<double> ("seleEtaBeltDetaEndCap");  


  // Parameters for the position calculation:
  edm::ParameterSet posCalcParameters = 
    ps.getParameter<edm::ParameterSet>("posCalcParameters");
  posCalculator_ = PositionCalc(posCalcParameters);

}
HLTAlCaMonPi0::~HLTAlCaMonPi0 ( )

Definition at line 142 of file HLTAlCaMonPi0.cc.

{}

Member Function Documentation

void HLTAlCaMonPi0::analyze ( const edm::Event e,
const edm::EventSetup c 
) [protected, virtual]

EcalRecHit

check s4s9

calculate e5x5

already clustered

check s4s9

calculate e5x5

already clustered

EcalRecHit

EcalRecHit

Implements edm::EDAnalyzer.

Definition at line 345 of file HLTAlCaMonPi0.cc.

References abs, PositionCalc::Calculate_Location(), clusEtaSize_, clusPhiSize_, clusSeedThr_, clusSeedThrEndCap_, convxtalid(), funct::cos(), detIdEBRecHits, detIdEERecHits, diff_neta_s(), diff_nphi_s(), EBRecHits, DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, EERecHits, relval_parameters_module::energy, edm::EventAuxiliary::event(), edm::Event::eventAuxiliary(), eventCounter_, exception, create_public_lumi_plots::exp, MonitorElement::Fill(), spr::find(), edm::EventSetup::get(), edm::Event::getByLabel(), CaloSubdetectorTopology::getWindow(), hEventEnergyEBeta_, hEventEnergyEBpi0_, hEventEnergyEEeta_, hEventEnergyEEpi0_, hiEtaDistrEBeta_, hiEtaDistrEBpi0_, hiPhiDistrEBeta_, hiPhiDistrEBpi0_, hIsoEtaEB_, hIsoEtaEE_, hIsoPi0EB_, hIsoPi0EE_, hiXDistrEEeta_, hiXDistrEEpi0_, hiYDistrEEeta_, hiYDistrEEpi0_, hMeanRecHitEnergyEBeta_, hMeanRecHitEnergyEBpi0_, hMeanRecHitEnergyEEeta_, hMeanRecHitEnergyEEpi0_, hMinvEtaEB_, hMinvEtaEE_, hMinvPi0EB_, hMinvPi0EE_, hNRecHitsEBeta_, hNRecHitsEBpi0_, hNRecHitsEEeta_, hNRecHitsEEpi0_, hPt1EtaEB_, hPt1EtaEE_, hPt1Pi0EB_, hPt1Pi0EE_, hPt2EtaEB_, hPt2EtaEE_, hPt2Pi0EB_, hPt2Pi0EE_, hPtEtaEB_, hPtEtaEE_, hPtPi0EB_, hPtPi0EE_, hRechitEnergyEBeta_, hRechitEnergyEBpi0_, hRechitEnergyEEeta_, hRechitEnergyEEpi0_, hS4S91EtaEB_, hS4S91EtaEE_, hS4S91Pi0EB_, hS4S91Pi0EE_, hS4S92EtaEB_, hS4S92EtaEE_, hS4S92Pi0EB_, hS4S92Pi0EE_, i, errorMatrix2Lands_multiChannel::id, EBDetId::ieta(), EBDetId::iphi(), isMonEBeta_, isMonEBpi0_, isMonEEeta_, isMonEEpi0_, edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), j, gen::k, LogDebug, posCalculator_, prescaleFactor_, edm::Handle< T >::product(), productMonitoredEBeta_, productMonitoredEBpi0_, productMonitoredEEeta_, productMonitoredEEpi0_, ptMinForIsolation_, ptMinForIsolationEndCap_, ptMinForIsolationEta_, ptMinForIsolationEtaEndCap_, edm::EventAuxiliary::run(), seleEtaBeltDeta_, seleEtaBeltDetaEndCap_, seleEtaBeltDR_, seleEtaBeltDREndCap_, seleEtaIso_, seleEtaIsoEndCap_, seleMinvMaxEta_, seleMinvMaxEtaEndCap_, seleMinvMaxPi0_, seleMinvMaxPi0EndCap_, seleMinvMinEta_, seleMinvMinEtaEndCap_, seleMinvMinPi0_, seleMinvMinPi0EndCap_, selePi0BeltDeta_, selePi0BeltDetaEndCap_, selePi0BeltDR_, selePi0BeltDREndCap_, selePi0Iso_, selePi0IsoEndCap_, selePtEta_, selePtEtaEndCap_, selePtGamma_, selePtGammaEndCap_, selePtGammaEta_, selePtGammaEtaEndCap_, selePtPi0_, selePtPi0EndCap_, seleS4S9Gamma_, seleS4S9GammaEndCap_, seleS4S9GammaEta_, seleS4S9GammaEtaEndCap_, seleXtalMinEnergy_, seleXtalMinEnergyEndCap_, funct::sin(), python::multivaluedict::sort(), and mathSSE::sqrt().

                                                         {  
 
  if (eventCounter_% prescaleFactor_ ) return; 
  eventCounter_++;

  edm::ESHandle<CaloTopology> theCaloTopology;
  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);


  std::vector<EcalRecHit> seeds;
  seeds.clear();

  std::vector<EBDetId> usedXtals;
  usedXtals.clear();

  detIdEBRecHits.clear(); 
  EBRecHits.clear();  





    
  edm::Handle<EcalRecHitCollection> rhEBpi0;
  edm::Handle<EcalRecHitCollection> rhEBeta;
  edm::Handle<EcalRecHitCollection> rhEEpi0;
  edm::Handle<EcalRecHitCollection> rhEEeta;

 bool GetRecHitsCollectionEBpi0 = true;
 if(isMonEBpi0_) {
   try { 
     iEvent.getByLabel(productMonitoredEBpi0_, rhEBpi0); 
   }catch( cms::Exception& exception ) {
     LogDebug("HLTAlCaPi0DQMSource") << "no EcalRecHits EB_pi0, can not run all stuffs" << iEvent.eventAuxiliary ().event() <<" run: "<<iEvent.eventAuxiliary ().run()  << std::endl;
     GetRecHitsCollectionEBpi0 = false;
   }
 }

 bool GetRecHitsCollectionEBeta = true;
 if(isMonEBeta_) {
   try { 
     if(isMonEBeta_) iEvent.getByLabel(productMonitoredEBeta_, rhEBeta); 
     if(isMonEEpi0_) iEvent.getByLabel(productMonitoredEEpi0_, rhEEpi0);
     if(isMonEEeta_) iEvent.getByLabel(productMonitoredEEeta_, rhEEeta);
   }catch( cms::Exception& exception ) {
     LogDebug("HLTAlCaPi0DQMSource") << "no EcalRecHits EB_Eta, can not run all stuffs" << iEvent.eventAuxiliary ().event() <<" run: "<<iEvent.eventAuxiliary ().run()  << std::endl;
     GetRecHitsCollectionEBeta = false;
   }
 }

 bool GetRecHitsCollectionEEpi0 = true;
 if(isMonEEpi0_) {
   try { 
     if(isMonEEpi0_) iEvent.getByLabel(productMonitoredEEpi0_, rhEEpi0);
   }catch( cms::Exception& exception ) {
     LogDebug("HLTAlCaPi0DQMSource") << "no EcalRecHits EE_Pi0, can not run all stuffs" << iEvent.eventAuxiliary ().event() <<" run: "<<iEvent.eventAuxiliary ().run()  << std::endl;
     GetRecHitsCollectionEEpi0 = false;
   }
 }

 bool GetRecHitsCollectionEEeta = true;
 if(isMonEEeta_) {
   try { 
     if(isMonEEeta_) iEvent.getByLabel(productMonitoredEEeta_, rhEEeta);
   }catch( cms::Exception& exception ) {
     LogDebug("HLTAlCaPi0DQMSource") << "no EcalRecHits EE_Eta, can not run all stuffs" << iEvent.eventAuxiliary ().event() <<" run: "<<iEvent.eventAuxiliary ().run()  << std::endl;
     GetRecHitsCollectionEEeta = false;
   }
 }




  // Initialize the Position Calc
  const CaloSubdetectorGeometry *geometry_p; 
  const CaloSubdetectorGeometry *geometryEE_p;    
  const CaloSubdetectorGeometry *geometryES_p;
  
  const CaloSubdetectorTopology *topology_p;
  const CaloSubdetectorTopology *topology_ee;
  


  edm::ESHandle<CaloGeometry> geoHandle;
  iSetup.get<CaloGeometryRecord>().get(geoHandle);     
  geometry_p = geoHandle->getSubdetectorGeometry(DetId::Ecal,EcalBarrel);
  geometryEE_p = geoHandle->getSubdetectorGeometry(DetId::Ecal,EcalEndcap);
  geometryES_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalPreshower);
  topology_p = theCaloTopology->getSubdetectorTopology(DetId::Ecal,EcalBarrel);
  topology_ee = theCaloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap);
  
  
  
  EcalRecHitCollection::const_iterator itb;
  
  // fill EB pi0 histos 
  if(isMonEBpi0_ ){
    if (rhEBpi0.isValid() && (rhEBpi0->size() > 0) && GetRecHitsCollectionEBpi0){


      const EcalRecHitCollection *hitCollection_p = rhEBpi0.product();
      float etot =0;
      for(itb=rhEBpi0->begin(); itb!=rhEBpi0->end(); ++itb){
        
        EBDetId id(itb->id());
        double energy = itb->energy();
        if( energy < seleXtalMinEnergy_) continue; 

        EBDetId det = itb->id();


        detIdEBRecHits.push_back(det);
        EBRecHits.push_back(*itb);

        if (energy > clusSeedThr_) seeds.push_back(*itb);

        hiPhiDistrEBpi0_->Fill(id.iphi());
        hiEtaDistrEBpi0_->Fill(id.ieta());
        hRechitEnergyEBpi0_->Fill(itb->energy());
        
        etot+= itb->energy();    
      } // Eb rechits
      
      hNRecHitsEBpi0_->Fill(rhEBpi0->size());
      hMeanRecHitEnergyEBpi0_->Fill(etot/rhEBpi0->size());
      hEventEnergyEBpi0_->Fill(etot);

      //      std::cout << " EB RH Pi0 collection: #, mean rh_e, event E "<<rhEBpi0->size()<<" "<<etot/rhEBpi0->size()<<" "<<etot<<std::endl;   


      // Pi0 maker

      //std::cout<< " RH coll size: "<<rhEBpi0->size()<<std::endl;
      //std::cout<< " Pi0 seeds: "<<seeds.size()<<std::endl;

      int nClus;
      std::vector<float> eClus;
      std::vector<float> etClus;
      std::vector<float> etaClus; 
      std::vector<float> thetaClus;
      std::vector<float> phiClus;
      std::vector<EBDetId> max_hit;

      std::vector< std::vector<EcalRecHit> > RecHitsCluster;
      std::vector< std::vector<EcalRecHit> > RecHitsCluster5x5;
      std::vector<float> s4s9Clus;
      std::vector<float> s9s25Clus;


      nClus=0;


      // Make own simple clusters (3x3, 5x5 or clusPhiSize_ x clusEtaSize_)
      sort(seeds.begin(), seeds.end(), ecalRecHitLess());

      for (std::vector<EcalRecHit>::iterator itseed=seeds.begin(); itseed!=seeds.end(); itseed++) {
        EBDetId seed_id = itseed->id();
        std::vector<EBDetId>::const_iterator usedIds;

        bool seedAlreadyUsed=false;
        for(usedIds=usedXtals.begin(); usedIds!=usedXtals.end(); usedIds++){
          if(*usedIds==seed_id){
            seedAlreadyUsed=true;
            //std::cout<< " Seed with energy "<<itseed->energy()<<" was used !"<<std::endl;
            break; 
          }
        }
        if(seedAlreadyUsed)continue;
        std::vector<DetId> clus_v = topology_p->getWindow(seed_id,clusEtaSize_,clusPhiSize_);       
        std::vector< std::pair<DetId, float> > clus_used;
        //Reject the seed if not able to build the cluster around it correctly
        //if(clus_v.size() < clusEtaSize_*clusPhiSize_){std::cout<<" Not enough RecHits "<<std::endl; continue;}
        vector<EcalRecHit> RecHitsInWindow;
        vector<EcalRecHit> RecHitsInWindow5x5;

        double simple_energy = 0; 

        for (std::vector<DetId>::iterator det=clus_v.begin(); det!=clus_v.end(); det++) {
          EBDetId EBdet = *det;
          //      std::cout<<" det "<< EBdet<<" ieta "<<EBdet.ieta()<<" iphi "<<EBdet.iphi()<<std::endl;
          bool  HitAlreadyUsed=false;
          for(usedIds=usedXtals.begin(); usedIds!=usedXtals.end(); usedIds++){
            if(*usedIds==*det){
              HitAlreadyUsed=true;
              break;
            }
          }
          if(HitAlreadyUsed)continue;


          std::vector<EBDetId>::iterator itdet = find( detIdEBRecHits.begin(),detIdEBRecHits.end(),EBdet);
          if(itdet == detIdEBRecHits.end()) continue; 
      
          int nn = int(itdet - detIdEBRecHits.begin());
          usedXtals.push_back(*det);
          RecHitsInWindow.push_back(EBRecHits[nn]);
          clus_used.push_back(std::pair<DetId, float>(*det, 1) );
          simple_energy = simple_energy + EBRecHits[nn].energy();


        }

        if(simple_energy <= 0) continue;
   
        math::XYZPoint clus_pos = posCalculator_.Calculate_Location(clus_used,hitCollection_p,geometry_p,geometryES_p);
        //std::cout<< "       Simple Clustering: Total energy for this simple cluster : "<<simple_energy<<std::endl; 
        //std::cout<< "       Simple Clustering: eta phi : "<<clus_pos.eta()<<" "<<clus_pos.phi()<<std::endl; 
        //std::cout<< "       Simple Clustering: x y z : "<<clus_pos.x()<<" "<<clus_pos.y()<<" "<<clus_pos.z()<<std::endl; 

        float theta_s = 2. * atan(exp(-clus_pos.eta()));
        //      float p0x_s = simple_energy * sin(theta_s) * cos(clus_pos.phi());
        //float p0y_s = simple_energy * sin(theta_s) * sin(clus_pos.phi());
        //    float p0z_s = simple_energy * cos(theta_s);
        //float et_s = sqrt( p0x_s*p0x_s + p0y_s*p0y_s);
        
        float et_s = simple_energy * sin(theta_s);
        //std::cout << "       Simple Clustering: E,Et,px,py,pz: "<<simple_energy<<" "<<et_s<<" "<<p0x_s<<" "<<p0y_s<<" "<<std::endl;

        //Compute S4/S9 variable
        //We are not sure to have 9 RecHits so need to check eta and phi:
        float s4s9_tmp[4];
        for(int i=0;i<4;i++)s4s9_tmp[i]= 0;

        int seed_ieta = seed_id.ieta();
        int seed_iphi = seed_id.iphi();
    
        convxtalid( seed_iphi,seed_ieta);
    
        float e3x3 = 0; 
        float e5x5 = 0; 

        for(unsigned int j=0; j<RecHitsInWindow.size();j++){
          EBDetId det = (EBDetId)RecHitsInWindow[j].id(); 
      
          int ieta = det.ieta();
          int iphi = det.iphi();
      
          convxtalid(iphi,ieta);
      
          float en = RecHitsInWindow[j].energy(); 
      
          int dx = diff_neta_s(seed_ieta,ieta);
          int dy = diff_nphi_s(seed_iphi,iphi);
      
          if(dx <= 0 && dy <=0) s4s9_tmp[0] += en; 
          if(dx >= 0 && dy <=0) s4s9_tmp[1] += en; 
          if(dx <= 0 && dy >=0) s4s9_tmp[2] += en; 
          if(dx >= 0 && dy >=0) s4s9_tmp[3] += en; 

          if(abs(dx)<=1 && abs(dy)<=1) e3x3 += en; 
          if(abs(dx)<=2 && abs(dy)<=2) e5x5 += en; 

      
        }
    
        if(e3x3 <= 0) continue;

        float s4s9_max = *max_element( s4s9_tmp,s4s9_tmp+4)/e3x3; 


    std::vector<DetId> clus_v5x5 = topology_p->getWindow(seed_id,5,5); 
    for( std::vector<DetId>::const_iterator idItr = clus_v5x5.begin(); idItr != clus_v5x5.end(); idItr++){
      EBDetId det = *idItr;
      

      std::vector<EBDetId>::iterator itdet0 = find(usedXtals.begin(),usedXtals.end(),det);

      if(itdet0 != usedXtals.end()) continue; 
      
      //inside collections
      std::vector<EBDetId>::iterator itdet = find( detIdEBRecHits.begin(),detIdEBRecHits.end(),det);
      if(itdet == detIdEBRecHits.end()) continue; 

      int nn = int(itdet - detIdEBRecHits.begin());
      
      RecHitsInWindow5x5.push_back(EBRecHits[nn]);
      e5x5 += EBRecHits[nn].energy();
      
    }



        if(e5x5 <= 0) continue;

            eClus.push_back(simple_energy);
            etClus.push_back(et_s);
            etaClus.push_back(clus_pos.eta());
            thetaClus.push_back(theta_s);
            phiClus.push_back(clus_pos.phi());
            s4s9Clus.push_back(s4s9_max);
            s9s25Clus.push_back(e3x3/e5x5);
            RecHitsCluster.push_back(RecHitsInWindow);
            RecHitsCluster5x5.push_back(RecHitsInWindow5x5);
            
            //      std::cout<<" EB pi0 cluster (n,nxt,e,et eta,phi,s4s9) "<<nClus<<" "<<int(RecHitsInWindow.size())<<" "<<eClus[nClus]<<" "<<" "<<etClus[nClus]<<" "<<etaClus[nClus]<<" "<<phiClus[nClus]<<" "<<s4s9Clus[nClus]<<std::endl;

            nClus++;


  }
    
      // std::cout<< " Pi0 clusters: "<<nClus<<std::endl;

      // Selection, based on Simple clustering
      //pi0 candidates
      int npi0_s=0;


      //      if (nClus <= 1) return;
      for(Int_t i=0 ; i<nClus ; i++){
        for(Int_t j=i+1 ; j<nClus ; j++){
          //      std::cout<<" i "<<i<<"  etClus[i] "<<etClus[i]<<" j "<<j<<"  etClus[j] "<<etClus[j]<<std::endl;
          if( etClus[i]>selePtGamma_ && etClus[j]>selePtGamma_ && s4s9Clus[i]>seleS4S9Gamma_ && s4s9Clus[j]>seleS4S9Gamma_){


          float p0x = etClus[i] * cos(phiClus[i]);
          float p1x = etClus[j] * cos(phiClus[j]);
          float p0y = etClus[i] * sin(phiClus[i]);
          float p1y = etClus[j] * sin(phiClus[j]);
          float p0z = eClus[i] * cos(thetaClus[i]);
          float p1z = eClus[j] * cos(thetaClus[j]);
        
        
          float pt_pair = sqrt( (p0x+p1x)*(p0x+p1x) + (p0y+p1y)*(p0y+p1y));

          if (pt_pair < selePtPi0_)continue;

          float m_inv = sqrt ( (eClus[i] + eClus[j])*(eClus[i] + eClus[j]) - (p0x+p1x)*(p0x+p1x) - (p0y+p1y)*(p0y+p1y) - (p0z+p1z)*(p0z+p1z) );  
            if ( (m_inv<seleMinvMaxPi0_) && (m_inv>seleMinvMinPi0_) ){

              //New Loop on cluster to measure isolation:
              std::vector<int> IsoClus;
              IsoClus.clear();
              float Iso = 0;
              TVector3 pairVect = TVector3((p0x+p1x), (p0y+p1y), (p0z+p1z));
              for(Int_t k=0 ; k<nClus ; k++){


                if(etClus[k] < ptMinForIsolation_) continue;

                if(k==i || k==j)continue;
              TVector3 ClusVect = TVector3(etClus[k] *cos(phiClus[k]), etClus[k] * sin(phiClus[k]) , eClus[k] * cos(thetaClus[k]));

                float dretacl = fabs(etaClus[k] - pairVect.Eta());
                float drcl = ClusVect.DeltaR(pairVect);
                //      std::cout<< "   Iso: k, E, drclpi0, detaclpi0, dphiclpi0 "<<k<<" "<<eClus[k]<<" "<<drclpi0<<" "<<dretaclpi0<<std::endl;
                if((drcl<selePi0BeltDR_) && (dretacl<selePi0BeltDeta_) ){
                  //              std::cout<< "   ... good iso cluster #: "<<k<<" etClus[k] "<<etClus[k] <<std::endl;
                  Iso = Iso + etClus[k];
                  IsoClus.push_back(k);
                }
              }

              //      std::cout<<"  Iso/pt_pi0 "<<Iso/pt_pi0<<std::endl;
              if(Iso/pt_pair<selePi0Iso_){
                //for(unsigned int Rec=0;Rec<RecHitsCluster[i].size();Rec++)pi0EBRecHitCollection->push_back(RecHitsCluster[i][Rec]);
                //for(unsigned int Rec2=0;Rec2<RecHitsCluster[j].size();Rec2++)pi0EBRecHitCollection->push_back(RecHitsCluster[j][Rec2]);


                hMinvPi0EB_->Fill(m_inv);
                hPt1Pi0EB_->Fill(etClus[i]);
                hPt2Pi0EB_->Fill(etClus[j]);
                hPtPi0EB_->Fill(pt_pair);
                hIsoPi0EB_->Fill(Iso/pt_pair);
                hS4S91Pi0EB_->Fill(s4s9Clus[i]);
                hS4S92Pi0EB_->Fill(s4s9Clus[j]);
                
                //              cout <<"  EB Simple Clustering: pi0 Candidate pt, eta, phi, Iso, m_inv, i, j :   "<<pt_pair<<" "<<pairVect.Eta()<<" "<<pairVect.Phi()<<" "<<Iso<<" "<<m_inv<<" "<<i<<" "<<j<<" "<<std::endl;  

                npi0_s++;
                
              }
            


          
            }
          }
        } // End of the "j" loop over Simple Clusters
      } // End of the "i" loop over Simple Clusters

      //      std::cout<<"  (Simple Clustering) EB Pi0 candidates #: "<<npi0_s<<std::endl;

    } // rhEBpi0.valid() ends

  } //  isMonEBpi0 ends

  //------------------ End of pi0 in EB --------------------------//

  // fill EB eta histos 
  if(isMonEBeta_ ){
    if (rhEBeta.isValid() && (rhEBeta->size() > 0) && GetRecHitsCollectionEBeta){


      const EcalRecHitCollection *hitCollection_p = rhEBeta.product();
      float etot =0;
      for(itb=rhEBeta->begin(); itb!=rhEBeta->end(); ++itb){
        
        EBDetId id(itb->id());
        double energy = itb->energy();
        if( energy < seleXtalMinEnergy_) continue; 

        EBDetId det = itb->id();


        detIdEBRecHits.push_back(det);
        EBRecHits.push_back(*itb);

        if (energy > clusSeedThr_) seeds.push_back(*itb);

        hiPhiDistrEBeta_->Fill(id.iphi());
        hiEtaDistrEBeta_->Fill(id.ieta());
        hRechitEnergyEBeta_->Fill(itb->energy());
        
        etot+= itb->energy();    
      } // Eb rechits
      
      hNRecHitsEBeta_->Fill(rhEBeta->size());
      hMeanRecHitEnergyEBeta_->Fill(etot/rhEBeta->size());
      hEventEnergyEBeta_->Fill(etot);

      //      std::cout << " EB RH Eta collection: #, mean rh_e, event E "<<rhEBeta->size()<<" "<<etot/rhEBeta->size()<<" "<<etot<<std::endl;   


      // Eta maker

      //std::cout<< " RH coll size: "<<rhEBeta->size()<<std::endl;
      //std::cout<< " Eta seeds: "<<seeds.size()<<std::endl;

      int nClus;
      std::vector<float> eClus;
      std::vector<float> etClus;
      std::vector<float> etaClus; 
      std::vector<float> thetaClus;
      std::vector<float> phiClus;
      std::vector<EBDetId> max_hit;

      std::vector< std::vector<EcalRecHit> > RecHitsCluster;
      std::vector< std::vector<EcalRecHit> > RecHitsCluster5x5;
      std::vector<float> s4s9Clus;
      std::vector<float> s9s25Clus;


      nClus=0;

      // Make own simple clusters (3x3, 5x5 or clusPhiSize_ x clusEtaSize_)
      sort(seeds.begin(), seeds.end(), ecalRecHitLess());

      for (std::vector<EcalRecHit>::iterator itseed=seeds.begin(); itseed!=seeds.end(); itseed++) {
        EBDetId seed_id = itseed->id();
        std::vector<EBDetId>::const_iterator usedIds;

        bool seedAlreadyUsed=false;
        for(usedIds=usedXtals.begin(); usedIds!=usedXtals.end(); usedIds++){
          if(*usedIds==seed_id){
            seedAlreadyUsed=true;
            //std::cout<< " Seed with energy "<<itseed->energy()<<" was used !"<<std::endl;
            break; 
          }
        }
        if(seedAlreadyUsed)continue;
        std::vector<DetId> clus_v = topology_p->getWindow(seed_id,clusEtaSize_,clusPhiSize_);       
        std::vector< std::pair<DetId, float> > clus_used;
        //Reject the seed if not able to build the cluster around it correctly
        //if(clus_v.size() < clusEtaSize_*clusPhiSize_){std::cout<<" Not enough RecHits "<<std::endl; continue;}
        vector<EcalRecHit> RecHitsInWindow;
        vector<EcalRecHit> RecHitsInWindow5x5;

        double simple_energy = 0; 

        for (std::vector<DetId>::iterator det=clus_v.begin(); det!=clus_v.end(); det++) {
          EBDetId EBdet = *det;
          //      std::cout<<" det "<< EBdet<<" ieta "<<EBdet.ieta()<<" iphi "<<EBdet.iphi()<<std::endl;
          bool  HitAlreadyUsed=false;
          for(usedIds=usedXtals.begin(); usedIds!=usedXtals.end(); usedIds++){
            if(*usedIds==*det){
              HitAlreadyUsed=true;
              break;
            }
          }
          if(HitAlreadyUsed)continue;


          std::vector<EBDetId>::iterator itdet = find( detIdEBRecHits.begin(),detIdEBRecHits.end(),EBdet);
          if(itdet == detIdEBRecHits.end()) continue; 
      
          int nn = int(itdet - detIdEBRecHits.begin());
          usedXtals.push_back(*det);
          RecHitsInWindow.push_back(EBRecHits[nn]);
          clus_used.push_back(std::pair<DetId, float>(*det, 1));
          simple_energy = simple_energy + EBRecHits[nn].energy();


        }

        if(simple_energy <= 0) continue;
   
        math::XYZPoint clus_pos = posCalculator_.Calculate_Location(clus_used,hitCollection_p,geometry_p,geometryES_p);
        //std::cout<< "       Simple Clustering: Total energy for this simple cluster : "<<simple_energy<<std::endl; 
        //std::cout<< "       Simple Clustering: eta phi : "<<clus_pos.eta()<<" "<<clus_pos.phi()<<std::endl; 
        //std::cout<< "       Simple Clustering: x y z : "<<clus_pos.x()<<" "<<clus_pos.y()<<" "<<clus_pos.z()<<std::endl; 

        float theta_s = 2. * atan(exp(-clus_pos.eta()));
        //      float p0x_s = simple_energy * sin(theta_s) * cos(clus_pos.phi());
        //float p0y_s = simple_energy * sin(theta_s) * sin(clus_pos.phi());
        //    float p0z_s = simple_energy * cos(theta_s);
        //float et_s = sqrt( p0x_s*p0x_s + p0y_s*p0y_s);
        
        float et_s = simple_energy * sin(theta_s);
        //std::cout << "       Simple Clustering: E,Et,px,py,pz: "<<simple_energy<<" "<<et_s<<" "<<p0x_s<<" "<<p0y_s<<" "<<std::endl;

        //Compute S4/S9 variable
        //We are not sure to have 9 RecHits so need to check eta and phi:
        float s4s9_tmp[4];
        for(int i=0;i<4;i++)s4s9_tmp[i]= 0;

        int seed_ieta = seed_id.ieta();
        int seed_iphi = seed_id.iphi();
    
        convxtalid( seed_iphi,seed_ieta);
    
        float e3x3 = 0; 
        float e5x5 = 0; 

        for(unsigned int j=0; j<RecHitsInWindow.size();j++){
          EBDetId det = (EBDetId)RecHitsInWindow[j].id(); 
      
          int ieta = det.ieta();
          int iphi = det.iphi();
      
          convxtalid(iphi,ieta);
      
          float en = RecHitsInWindow[j].energy(); 
      
          int dx = diff_neta_s(seed_ieta,ieta);
          int dy = diff_nphi_s(seed_iphi,iphi);
      
          if(dx <= 0 && dy <=0) s4s9_tmp[0] += en; 
          if(dx >= 0 && dy <=0) s4s9_tmp[1] += en; 
          if(dx <= 0 && dy >=0) s4s9_tmp[2] += en; 
          if(dx >= 0 && dy >=0) s4s9_tmp[3] += en; 

          if(abs(dx)<=1 && abs(dy)<=1) e3x3 += en; 
          if(abs(dx)<=2 && abs(dy)<=2) e5x5 += en; 

      
        }
    
        if(e3x3 <= 0) continue;

        float s4s9_max = *max_element( s4s9_tmp,s4s9_tmp+4)/e3x3; 


    std::vector<DetId> clus_v5x5 = topology_p->getWindow(seed_id,5,5); 
    for( std::vector<DetId>::const_iterator idItr = clus_v5x5.begin(); idItr != clus_v5x5.end(); idItr++){
      EBDetId det = *idItr;
      

      std::vector<EBDetId>::iterator itdet0 = find(usedXtals.begin(),usedXtals.end(),det);

      if(itdet0 != usedXtals.end()) continue; 
      
      //inside collections
      std::vector<EBDetId>::iterator itdet = find( detIdEBRecHits.begin(),detIdEBRecHits.end(),det);
      if(itdet == detIdEBRecHits.end()) continue; 

      int nn = int(itdet - detIdEBRecHits.begin());
      
      RecHitsInWindow5x5.push_back(EBRecHits[nn]);
      e5x5 += EBRecHits[nn].energy();
      
    }



        if(e5x5 <= 0) continue;

            eClus.push_back(simple_energy);
            etClus.push_back(et_s);
            etaClus.push_back(clus_pos.eta());
            thetaClus.push_back(theta_s);
            phiClus.push_back(clus_pos.phi());
            s4s9Clus.push_back(s4s9_max);
            s9s25Clus.push_back(e3x3/e5x5);
            RecHitsCluster.push_back(RecHitsInWindow);
            RecHitsCluster5x5.push_back(RecHitsInWindow5x5);
            
            //      std::cout<<" EB Eta cluster (n,nxt,e,et eta,phi,s4s9) "<<nClus<<" "<<int(RecHitsInWindow.size())<<" "<<eClus[nClus]<<" "<<" "<<etClus[nClus]<<" "<<etaClus[nClus]<<" "<<phiClus[nClus]<<" "<<s4s9Clus[nClus]<<std::endl;

            nClus++;
            

  }
    
      // std::cout<< " Eta clusters: "<<nClus<<std::endl;

      // Selection, based on Simple clustering
      //eta candidates
      int npi0_s=0;


      //      if (nClus <= 1) return;
      for(Int_t i=0 ; i<nClus ; i++){
        for(Int_t j=i+1 ; j<nClus ; j++){
          //      std::cout<<" i "<<i<<"  etClus[i] "<<etClus[i]<<" j "<<j<<"  etClus[j] "<<etClus[j]<<std::endl;
          if( etClus[i]>selePtGammaEta_ && etClus[j]>selePtGammaEta_ && s4s9Clus[i]>seleS4S9GammaEta_ && s4s9Clus[j]>seleS4S9GammaEta_){


          float p0x = etClus[i] * cos(phiClus[i]);
          float p1x = etClus[j] * cos(phiClus[j]);
          float p0y = etClus[i] * sin(phiClus[i]);
          float p1y = etClus[j] * sin(phiClus[j]);
          float p0z = eClus[i] * cos(thetaClus[i]);
          float p1z = eClus[j] * cos(thetaClus[j]);
        
        
          float pt_pair = sqrt( (p0x+p1x)*(p0x+p1x) + (p0y+p1y)*(p0y+p1y));

          if (pt_pair < selePtEta_)continue;

          float m_inv = sqrt ( (eClus[i] + eClus[j])*(eClus[i] + eClus[j]) - (p0x+p1x)*(p0x+p1x) - (p0y+p1y)*(p0y+p1y) - (p0z+p1z)*(p0z+p1z) );  
            if ( (m_inv<seleMinvMaxEta_) && (m_inv>seleMinvMinEta_) ){

              //New Loop on cluster to measure isolation:
              std::vector<int> IsoClus;
              IsoClus.clear();
              float Iso = 0;
              TVector3 pairVect = TVector3((p0x+p1x), (p0y+p1y), (p0z+p1z));
              for(Int_t k=0 ; k<nClus ; k++){


                if(etClus[k] < ptMinForIsolationEta_) continue;

                if(k==i || k==j)continue;
              TVector3 ClusVect = TVector3(etClus[k] *cos(phiClus[k]), etClus[k] * sin(phiClus[k]) , eClus[k] * cos(thetaClus[k]));

                float dretacl = fabs(etaClus[k] - pairVect.Eta());
                float drcl = ClusVect.DeltaR(pairVect);
                //      std::cout<< "   Iso: k, E, drclpi0, detaclpi0, dphiclpi0 "<<k<<" "<<eClus[k]<<" "<<drclpi0<<" "<<dretaclpi0<<std::endl;
                if((drcl<seleEtaBeltDR_) && (dretacl<seleEtaBeltDeta_) ){
                  //              std::cout<< "   ... good iso cluster #: "<<k<<" etClus[k] "<<etClus[k] <<std::endl;
                  Iso = Iso + etClus[k];
                  IsoClus.push_back(k);
                }
              }

              //      std::cout<<"  Iso/pt_pi0 "<<Iso/pt_pi0<<std::endl;
              if(Iso/pt_pair<seleEtaIso_){
                //for(unsigned int Rec=0;Rec<RecHitsCluster[i].size();Rec++)pi0EBRecHitCollection->push_back(RecHitsCluster[i][Rec]);
                //for(unsigned int Rec2=0;Rec2<RecHitsCluster[j].size();Rec2++)pi0EBRecHitCollection->push_back(RecHitsCluster[j][Rec2]);


                hMinvEtaEB_->Fill(m_inv);
                hPt1EtaEB_->Fill(etClus[i]);
                hPt2EtaEB_->Fill(etClus[j]);
                hPtEtaEB_->Fill(pt_pair);
                hIsoEtaEB_->Fill(Iso/pt_pair);
                hS4S91EtaEB_->Fill(s4s9Clus[i]);
                hS4S92EtaEB_->Fill(s4s9Clus[j]);
                
                //              cout <<"  EB Simple Clustering: Eta Candidate pt, eta, phi, Iso, m_inv, i, j :   "<<pt_pair<<" "<<pairVect.Eta()<<" "<<pairVect.Phi()<<" "<<Iso<<" "<<m_inv<<" "<<i<<" "<<j<<" "<<std::endl;  

                npi0_s++;
                
              }
            


          
            }
          }
        } // End of the "j" loop over Simple Clusters
      } // End of the "i" loop over Simple Clusters

      //      std::cout<<"  (Simple Clustering) EB Eta candidates #: "<<npi0_s<<std::endl;

    } // rhEBeta.valid() ends

  } //  isMonEBeta ends

  //------------------ End of Eta in EB --------------------------//



      //----------------- End of the EB --------------------------//




      //----------------- Start of the EE --------------------//

      // fill pi0 EE histos
      if(isMonEEpi0_){
        if (rhEEpi0.isValid() && (rhEEpi0->size() > 0) && GetRecHitsCollectionEEpi0){

          const EcalRecHitCollection *hitCollection_ee = rhEEpi0.product();
          float etot =0;


      detIdEERecHits.clear(); 
      EERecHits.clear();  


      std::vector<EcalRecHit> seedsEndCap;
      seedsEndCap.clear();

      std::vector<EEDetId> usedXtalsEndCap;
      usedXtalsEndCap.clear();


      EERecHitCollection::const_iterator ite;
      for (ite=rhEEpi0->begin(); ite!=rhEEpi0->end(); ite++) {
        double energy = ite->energy();
        if( energy < seleXtalMinEnergyEndCap_) continue; 
    
        EEDetId det = ite->id();
        EEDetId id(ite->id());

    
        detIdEERecHits.push_back(det);
        EERecHits.push_back(*ite);
    
        hiXDistrEEpi0_->Fill(id.ix());
        hiYDistrEEpi0_->Fill(id.iy());
        hRechitEnergyEEpi0_->Fill(ite->energy());

        if (energy > clusSeedThrEndCap_) seedsEndCap.push_back(*ite);
        
        etot+= ite->energy();    
      } // EE rechits
      
      hNRecHitsEEpi0_->Fill(rhEEpi0->size());
      hMeanRecHitEnergyEEpi0_->Fill(etot/rhEEpi0->size());
      hEventEnergyEEpi0_->Fill(etot);

      //      std::cout << " EE RH Pi0 collection: #, mean rh_e, event E "<<rhEEpi0->size()<<" "<<etot/rhEEpi0->size()<<" "<<etot<<std::endl;   
  
      int nClusEndCap;
      std::vector<float> eClusEndCap;
      std::vector<float> etClusEndCap;
      std::vector<float> etaClusEndCap;
      std::vector<float> thetaClusEndCap;
      std::vector<float> phiClusEndCap;
      std::vector< std::vector<EcalRecHit> > RecHitsClusterEndCap;
      std::vector< std::vector<EcalRecHit> > RecHitsCluster5x5EndCap;
      std::vector<float> s4s9ClusEndCap;
      std::vector<float> s9s25ClusEndCap;


      nClusEndCap=0;
  
  
      // Make own simple clusters (3x3, 5x5 or clusPhiSize_ x clusEtaSize_)
      sort(seedsEndCap.begin(), seedsEndCap.end(), ecalRecHitLess());
  
      for (std::vector<EcalRecHit>::iterator itseed=seedsEndCap.begin(); itseed!=seedsEndCap.end(); itseed++) {
        EEDetId seed_id = itseed->id();
        std::vector<EEDetId>::const_iterator usedIds;
    
        bool seedAlreadyUsed=false;
        for(usedIds=usedXtalsEndCap.begin(); usedIds!=usedXtalsEndCap.end(); usedIds++){
          if(*usedIds==seed_id){
            seedAlreadyUsed=true;
            break; 
          }
        }

        if(seedAlreadyUsed)continue;
        std::vector<DetId> clus_v = topology_ee->getWindow(seed_id,clusEtaSize_,clusPhiSize_);      
        std::vector< std::pair<DetId, float> > clus_used;   

        vector<EcalRecHit> RecHitsInWindow;
        vector<EcalRecHit> RecHitsInWindow5x5;
    
        float simple_energy = 0; 

        for (std::vector<DetId>::iterator det=clus_v.begin(); det!=clus_v.end(); det++) {
          EEDetId EEdet = *det;
      
          bool  HitAlreadyUsed=false;
          for(usedIds=usedXtalsEndCap.begin(); usedIds!=usedXtalsEndCap.end(); usedIds++){
            if(*usedIds==*det){
              HitAlreadyUsed=true;
              break;
            }
          }
     
          if(HitAlreadyUsed)continue;
      
          std::vector<EEDetId>::iterator itdet = find( detIdEERecHits.begin(),detIdEERecHits.end(),EEdet);
          if(itdet == detIdEERecHits.end()) continue; 
      
      
          int nn = int(itdet - detIdEERecHits.begin());
          usedXtalsEndCap.push_back(*det);
          RecHitsInWindow.push_back(EERecHits[nn]);
          clus_used.push_back(std::pair<DetId, float>(*det, 1));
          simple_energy = simple_energy + EERecHits[nn].energy();
      
      
        }
    
        if( simple_energy <= 0) continue;
        
        math::XYZPoint clus_pos = posCalculator_.Calculate_Location(clus_used,hitCollection_ee,geometryEE_p,geometryES_p);
    

        float theta_s = 2. * atan(exp(-clus_pos.eta()));
        float et_s = simple_energy * sin(theta_s);
        //      float p0x_s = simple_energy * sin(theta_s) * cos(clus_pos.phi());
        //float p0y_s = simple_energy * sin(theta_s) * sin(clus_pos.phi());
        //float et_s = sqrt( p0x_s*p0x_s + p0y_s*p0y_s);
    
    
        //Compute S4/S9 variable
        //We are not sure to have 9 RecHits so need to check eta and phi:
        float s4s9_tmp[4];
        for(int i=0;i<4;i++) s4s9_tmp[i]= 0; 
    
        int ixSeed = seed_id.ix();
        int iySeed = seed_id.iy();
        float e3x3 = 0; 
        float e5x5 = 0;

        for(unsigned int j=0; j<RecHitsInWindow.size();j++){
          EEDetId det_this = (EEDetId)RecHitsInWindow[j].id(); 
          int dx = ixSeed - det_this.ix();
          int dy = iySeed - det_this.iy();
      
          float en = RecHitsInWindow[j].energy(); 
      
          if(dx <= 0 && dy <=0) s4s9_tmp[0] += en; 
          if(dx >= 0 && dy <=0) s4s9_tmp[1] += en; 
          if(dx <= 0 && dy >=0) s4s9_tmp[2] += en; 
          if(dx >= 0 && dy >=0) s4s9_tmp[3] += en; 

          if( abs(dx)<=1 && abs(dy)<=1) e3x3 += en; 
          if( abs(dx)<=2 && abs(dy)<=2) e5x5 += en; 

        }

      
        if(e3x3 <= 0) continue;

        eClusEndCap.push_back(simple_energy);
        etClusEndCap.push_back(et_s);
        etaClusEndCap.push_back(clus_pos.eta());
        thetaClusEndCap.push_back(theta_s);
        phiClusEndCap.push_back(clus_pos.phi());
        s4s9ClusEndCap.push_back(*max_element( s4s9_tmp,s4s9_tmp+4)/e3x3);
        s9s25ClusEndCap.push_back(e3x3/e5x5);
        RecHitsClusterEndCap.push_back(RecHitsInWindow);
        RecHitsCluster5x5EndCap.push_back(RecHitsInWindow5x5);
        

        //      std::cout<<" EE pi0 cluster (n,nxt,e,et eta,phi,s4s9) "<<nClusEndCap<<" "<<int(RecHitsInWindow.size())<<" "<<eClusEndCap[nClusEndCap]<<" "<<" "<<etClusEndCap[nClusEndCap]<<" "<<etaClusEndCap[nClusEndCap]<<" "<<phiClusEndCap[nClusEndCap]<<" "<<s4s9ClusEndCap[nClusEndCap]<<std::endl;


        nClusEndCap++;


      }



      // Selection, based on Simple clustering
      //pi0 candidates
      int npi0_se=0;


      for(Int_t i=0 ; i<nClusEndCap ; i++){
        for(Int_t j=i+1 ; j<nClusEndCap ; j++){
      
          if( etClusEndCap[i]>selePtGammaEndCap_ && etClusEndCap[j]>selePtGammaEndCap_ && s4s9ClusEndCap[i]>seleS4S9GammaEndCap_ && s4s9ClusEndCap[j]>seleS4S9GammaEndCap_){

          float p0x = etClusEndCap[i] * cos(phiClusEndCap[i]);
          float p1x = etClusEndCap[j] * cos(phiClusEndCap[j]);
          float p0y = etClusEndCap[i] * sin(phiClusEndCap[i]);
          float p1y = etClusEndCap[j] * sin(phiClusEndCap[j]);
          float p0z = eClusEndCap[i] * cos(thetaClusEndCap[i]);
          float p1z = eClusEndCap[j] * cos(thetaClusEndCap[j]);

        
            float pt_pair = sqrt( (p0x+p1x)*(p0x+p1x) + (p0y+p1y)*(p0y+p1y));
            if (pt_pair < selePtPi0EndCap_)continue;
            float m_inv = sqrt ( (eClusEndCap[i] + eClusEndCap[j])*(eClusEndCap[i] + eClusEndCap[j]) - (p0x+p1x)*(p0x+p1x) - (p0y+p1y)*(p0y+p1y) - (p0z+p1z)*(p0z+p1z) );  
 

            if ( (m_inv<seleMinvMaxPi0EndCap_) && (m_inv>seleMinvMinPi0EndCap_) ){
          

              //New Loop on cluster to measure isolation:
              std::vector<int> IsoClus;
              IsoClus.clear();
              float Iso = 0;
              TVector3 pairVect = TVector3((p0x+p1x), (p0y+p1y), (p0z+p1z));
              for(Int_t k=0 ; k<nClusEndCap ; k++){

                if(etClusEndCap[k] < ptMinForIsolationEndCap_) continue; 
            
            
                if(k==i || k==j)continue;
            
            
              TVector3 clusVect = TVector3(etClusEndCap[k] * cos(phiClusEndCap[k]), etClusEndCap[k] * sin(phiClusEndCap[k]) , eClusEndCap[k] * cos(thetaClusEndCap[k]) ) ;
              float dretacl = fabs(etaClusEndCap[k] - pairVect.Eta());
              float drcl = clusVect.DeltaR(pairVect);
              
              if(drcl < selePi0BeltDREndCap_ && dretacl < selePi0BeltDetaEndCap_ ){
                Iso = Iso + etClusEndCap[k];
                IsoClus.push_back(k);
              }
            }

          
              if(Iso/pt_pair<selePi0IsoEndCap_){
                //std::cout <<"  EE Simple Clustering: pi0 Candidate pt, eta, phi, Iso, m_inv, i, j :   "<<pt_pair<<" "<<pairVect.Eta()<<" "<<pairVect.Phi()<<" "<<Iso<<" "<<m_inv<<" "<<i<<" "<<j<<" "<<std::endl;  

                hMinvPi0EE_->Fill(m_inv);
                hPt1Pi0EE_->Fill(etClusEndCap[i]);
                hPt2Pi0EE_->Fill(etClusEndCap[j]);
                hPtPi0EE_->Fill(pt_pair);
                hIsoPi0EE_->Fill(Iso/pt_pair);
                hS4S91Pi0EE_->Fill(s4s9ClusEndCap[i]);
                hS4S92Pi0EE_->Fill(s4s9ClusEndCap[j]);

                npi0_se++;
              }
          
            }
          }
        } // End of the "j" loop over Simple Clusters
      } // End of the "i" loop over Simple Clusters

      //      std::cout<<"  (Simple Clustering) EE Pi0 candidates #: "<<npi0_se<<std::endl;

        } //rhEEpi0
      } //isMonEEpi0

      //================End of Pi0 endcap=======================//


      //================ Eta in EE===============================//

      // fill pi0 EE histos
      if(isMonEEeta_){
        if (rhEEeta.isValid() && (rhEEeta->size() > 0) && GetRecHitsCollectionEEeta){

          const EcalRecHitCollection *hitCollection_ee = rhEEeta.product();
          float etot =0;

      detIdEERecHits.clear(); 
      EERecHits.clear();  


      std::vector<EcalRecHit> seedsEndCap;
      seedsEndCap.clear();

      std::vector<EEDetId> usedXtalsEndCap;
      usedXtalsEndCap.clear();


      EERecHitCollection::const_iterator ite;
      for (ite=rhEEeta->begin(); ite!=rhEEeta->end(); ite++) {
        double energy = ite->energy();
        if( energy < seleXtalMinEnergyEndCap_) continue; 
    
        EEDetId det = ite->id();
        EEDetId id(ite->id());

    
        detIdEERecHits.push_back(det);
        EERecHits.push_back(*ite);
    
        hiXDistrEEeta_->Fill(id.ix());
        hiYDistrEEeta_->Fill(id.iy());
        hRechitEnergyEEeta_->Fill(ite->energy());

        if (energy > clusSeedThrEndCap_) seedsEndCap.push_back(*ite);
        
        etot+= ite->energy();    
      } // EE rechits
      
      hNRecHitsEEeta_->Fill(rhEEeta->size());
      hMeanRecHitEnergyEEeta_->Fill(etot/rhEEeta->size());
      hEventEnergyEEeta_->Fill(etot);

      //      std::cout << " EE RH Eta collection: #, mean rh_e, event E "<<rhEEeta->size()<<" "<<etot/rhEEeta->size()<<" "<<etot<<std::endl;   
  
      int nClusEndCap;
      std::vector<float> eClusEndCap;
      std::vector<float> etClusEndCap;
      std::vector<float> etaClusEndCap;
      std::vector<float> thetaClusEndCap;
      std::vector<float> phiClusEndCap;
      std::vector< std::vector<EcalRecHit> > RecHitsClusterEndCap;
      std::vector< std::vector<EcalRecHit> > RecHitsCluster5x5EndCap;
      std::vector<float> s4s9ClusEndCap;
      std::vector<float> s9s25ClusEndCap;


      nClusEndCap=0;
  
  
      // Make own simple clusters (3x3, 5x5 or clusPhiSize_ x clusEtaSize_)
      sort(seedsEndCap.begin(), seedsEndCap.end(), ecalRecHitLess());
  
      for (std::vector<EcalRecHit>::iterator itseed=seedsEndCap.begin(); itseed!=seedsEndCap.end(); itseed++) {
        EEDetId seed_id = itseed->id();
        std::vector<EEDetId>::const_iterator usedIds;
    
        bool seedAlreadyUsed=false;
        for(usedIds=usedXtalsEndCap.begin(); usedIds!=usedXtalsEndCap.end(); usedIds++){
          if(*usedIds==seed_id){
            seedAlreadyUsed=true;
            break; 
          }
        }

        if(seedAlreadyUsed)continue;
        std::vector<DetId> clus_v = topology_ee->getWindow(seed_id,clusEtaSize_,clusPhiSize_);      
        std::vector< std::pair<DetId, float> > clus_used;

        vector<EcalRecHit> RecHitsInWindow;
        vector<EcalRecHit> RecHitsInWindow5x5;
    
        float simple_energy = 0; 

        for (std::vector<DetId>::iterator det=clus_v.begin(); det!=clus_v.end(); det++) {
          EEDetId EEdet = *det;
      
          bool  HitAlreadyUsed=false;
          for(usedIds=usedXtalsEndCap.begin(); usedIds!=usedXtalsEndCap.end(); usedIds++){
            if(*usedIds==*det){
              HitAlreadyUsed=true;
              break;
            }
          }
     
          if(HitAlreadyUsed)continue;
      
          std::vector<EEDetId>::iterator itdet = find( detIdEERecHits.begin(),detIdEERecHits.end(),EEdet);
          if(itdet == detIdEERecHits.end()) continue; 
      
      
          int nn = int(itdet - detIdEERecHits.begin());
          usedXtalsEndCap.push_back(*det);
          RecHitsInWindow.push_back(EERecHits[nn]);
          clus_used.push_back(std::pair<DetId, float>(*det, 1));
          simple_energy = simple_energy + EERecHits[nn].energy();
      
      
        }
    
        if( simple_energy <= 0) continue;
        
        math::XYZPoint clus_pos = posCalculator_.Calculate_Location(clus_used,hitCollection_ee,geometryEE_p,geometryES_p);
    

        float theta_s = 2. * atan(exp(-clus_pos.eta()));
        float et_s = simple_energy * sin(theta_s);
        //      float p0x_s = simple_energy * sin(theta_s) * cos(clus_pos.phi());
        //float p0y_s = simple_energy * sin(theta_s) * sin(clus_pos.phi());
        //float et_s = sqrt( p0x_s*p0x_s + p0y_s*p0y_s);
    
    
        //Compute S4/S9 variable
        //We are not sure to have 9 RecHits so need to check eta and phi:
        float s4s9_tmp[4];
        for(int i=0;i<4;i++) s4s9_tmp[i]= 0; 
    
        int ixSeed = seed_id.ix();
        int iySeed = seed_id.iy();
        float e3x3 = 0; 
        float e5x5 = 0;

        for(unsigned int j=0; j<RecHitsInWindow.size();j++){
          EEDetId det_this = (EEDetId)RecHitsInWindow[j].id(); 
          int dx = ixSeed - det_this.ix();
          int dy = iySeed - det_this.iy();
      
          float en = RecHitsInWindow[j].energy(); 
      
          if(dx <= 0 && dy <=0) s4s9_tmp[0] += en; 
          if(dx >= 0 && dy <=0) s4s9_tmp[1] += en; 
          if(dx <= 0 && dy >=0) s4s9_tmp[2] += en; 
          if(dx >= 0 && dy >=0) s4s9_tmp[3] += en; 

          if( abs(dx)<=1 && abs(dy)<=1) e3x3 += en; 
          if( abs(dx)<=2 && abs(dy)<=2) e5x5 += en; 

        }

      
        if(e3x3 <= 0) continue;

        eClusEndCap.push_back(simple_energy);
        etClusEndCap.push_back(et_s);
        etaClusEndCap.push_back(clus_pos.eta());
        thetaClusEndCap.push_back(theta_s);
        phiClusEndCap.push_back(clus_pos.phi());
        s4s9ClusEndCap.push_back(*max_element( s4s9_tmp,s4s9_tmp+4)/e3x3);
        s9s25ClusEndCap.push_back(e3x3/e5x5);
        RecHitsClusterEndCap.push_back(RecHitsInWindow);
        RecHitsCluster5x5EndCap.push_back(RecHitsInWindow5x5);
        
        //      std::cout<<" EE Eta cluster (n,nxt,e,et eta,phi,s4s9) "<<nClusEndCap<<" "<<int(RecHitsInWindow.size())<<" "<<eClusEndCap[nClusEndCap]<<" "<<" "<<etClusEndCap[nClusEndCap]<<" "<<etaClusEndCap[nClusEndCap]<<" "<<phiClusEndCap[nClusEndCap]<<" "<<s4s9ClusEndCap[nClusEndCap]<<std::endl;

        nClusEndCap++;

      }



      // Selection, based on Simple clustering
      //pi0 candidates
      int npi0_se=0;


      for(Int_t i=0 ; i<nClusEndCap ; i++){
        for(Int_t j=i+1 ; j<nClusEndCap ; j++){
      
          if( etClusEndCap[i]>selePtGammaEtaEndCap_ && etClusEndCap[j]>selePtGammaEtaEndCap_ && s4s9ClusEndCap[i]>seleS4S9GammaEtaEndCap_ && s4s9ClusEndCap[j]>seleS4S9GammaEtaEndCap_){

          float p0x = etClusEndCap[i] * cos(phiClusEndCap[i]);
          float p1x = etClusEndCap[j] * cos(phiClusEndCap[j]);
          float p0y = etClusEndCap[i] * sin(phiClusEndCap[i]);
          float p1y = etClusEndCap[j] * sin(phiClusEndCap[j]);
          float p0z = eClusEndCap[i] * cos(thetaClusEndCap[i]);
          float p1z = eClusEndCap[j] * cos(thetaClusEndCap[j]);

        
            float pt_pair = sqrt( (p0x+p1x)*(p0x+p1x) + (p0y+p1y)*(p0y+p1y));
            if (pt_pair < selePtEtaEndCap_)continue;
            float m_inv = sqrt ( (eClusEndCap[i] + eClusEndCap[j])*(eClusEndCap[i] + eClusEndCap[j]) - (p0x+p1x)*(p0x+p1x) - (p0y+p1y)*(p0y+p1y) - (p0z+p1z)*(p0z+p1z) );  
 

            if ( (m_inv<seleMinvMaxEtaEndCap_) && (m_inv>seleMinvMinEtaEndCap_) ){
          

              //New Loop on cluster to measure isolation:
              std::vector<int> IsoClus;
              IsoClus.clear();
              float Iso = 0;
              TVector3 pairVect = TVector3((p0x+p1x), (p0y+p1y), (p0z+p1z));
              for(Int_t k=0 ; k<nClusEndCap ; k++){

                if(etClusEndCap[k] < ptMinForIsolationEtaEndCap_) continue; 
            
            
                if(k==i || k==j)continue;
            
            
              TVector3 clusVect = TVector3(etClusEndCap[k] * cos(phiClusEndCap[k]), etClusEndCap[k] * sin(phiClusEndCap[k]) , eClusEndCap[k] * cos(thetaClusEndCap[k]) ) ;
              float dretacl = fabs(etaClusEndCap[k] - pairVect.Eta());
              float drcl = clusVect.DeltaR(pairVect);
              
              if(drcl < seleEtaBeltDREndCap_ && dretacl < seleEtaBeltDetaEndCap_ ){
                Iso = Iso + etClusEndCap[k];
                IsoClus.push_back(k);
              }
            }

          
              if(Iso/pt_pair<seleEtaIsoEndCap_){
                //      cout <<"  EE Simple Clustering: Eta Candidate pt, eta, phi, Iso, m_inv, i, j :   "<<pt_pair<<" "<<pairVect.Eta()<<" "<<pairVect.Phi()<<" "<<Iso<<" "<<m_inv<<" "<<i<<" "<<j<<" "<<std::endl;  

                hMinvEtaEE_->Fill(m_inv);
                hPt1EtaEE_->Fill(etClusEndCap[i]);
                hPt2EtaEE_->Fill(etClusEndCap[j]);
                hPtEtaEE_->Fill(pt_pair);
                hIsoEtaEE_->Fill(Iso/pt_pair);
                hS4S91EtaEE_->Fill(s4s9ClusEndCap[i]);
                hS4S92EtaEE_->Fill(s4s9ClusEndCap[j]);

                npi0_se++;
              }
          
            }
          }
        } // End of the "j" loop over Simple Clusters
      } // End of the "i" loop over Simple Clusters

      //      std::cout<<"  (Simple Clustering) EE Eta candidates #: "<<npi0_se<<std::endl;

        } //rhEEeta
      } //isMonEEeta

      //================End of Pi0 endcap=======================//






} 
void HLTAlCaMonPi0::beginJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 147 of file HLTAlCaMonPi0.cc.

References DQMStore::book1D(), dbe_, folderName_, hEventEnergyEBeta_, hEventEnergyEBpi0_, hEventEnergyEEeta_, hEventEnergyEEpi0_, hiEtaDistrEBeta_, hiEtaDistrEBpi0_, hiPhiDistrEBeta_, hiPhiDistrEBpi0_, hIsoEtaEB_, hIsoEtaEE_, hIsoPi0EB_, hIsoPi0EE_, hiXDistrEEeta_, hiXDistrEEpi0_, hiYDistrEEeta_, hiYDistrEEpi0_, hMeanRecHitEnergyEBeta_, hMeanRecHitEnergyEBpi0_, hMeanRecHitEnergyEEeta_, hMeanRecHitEnergyEEpi0_, hMinvEtaEB_, hMinvEtaEE_, hMinvPi0EB_, hMinvPi0EE_, hNRecHitsEBeta_, hNRecHitsEBpi0_, hNRecHitsEEeta_, hNRecHitsEEpi0_, hPt1EtaEB_, hPt1EtaEE_, hPt1Pi0EB_, hPt1Pi0EE_, hPt2EtaEB_, hPt2EtaEE_, hPt2Pi0EB_, hPt2Pi0EE_, hPtEtaEB_, hPtEtaEE_, hPtPi0EB_, hPtPi0EE_, hRechitEnergyEBeta_, hRechitEnergyEBpi0_, hRechitEnergyEEeta_, hRechitEnergyEEpi0_, hS4S91EtaEB_, hS4S91EtaEE_, hS4S91Pi0EB_, hS4S91Pi0EE_, hS4S92EtaEB_, hS4S92EtaEE_, hS4S92Pi0EB_, hS4S92Pi0EE_, MonitorElement::setAxisTitle(), and DQMStore::setCurrentFolder().

                            {


  // create and cd into new folder
  dbe_->setCurrentFolder(folderName_);

  // book some histograms 1D

  hiPhiDistrEBpi0_ = dbe_->book1D("iphiDistributionEBpi0", "RechitEB pi0 iphi", 361, 1,361);
  hiPhiDistrEBpi0_->setAxisTitle("i#phi ", 1);
  hiPhiDistrEBpi0_->setAxisTitle("# rechits", 2);

  hiXDistrEEpi0_ = dbe_->book1D("iXDistributionEEpi0", "RechitEE pi0 ix", 100, 0,100);
  hiXDistrEEpi0_->setAxisTitle("ix ", 1);
  hiXDistrEEpi0_->setAxisTitle("# rechits", 2);

  hiPhiDistrEBeta_ = dbe_->book1D("iphiDistributionEBeta", "RechitEB eta iphi", 361, 1,361);
  hiPhiDistrEBeta_->setAxisTitle("i#phi ", 1);
  hiPhiDistrEBeta_->setAxisTitle("# rechits", 2);

  hiXDistrEEeta_ = dbe_->book1D("iXDistributionEEeta", "RechitEE eta ix", 100, 0,100);
  hiXDistrEEeta_->setAxisTitle("ix ", 1);
  hiXDistrEEeta_->setAxisTitle("# rechits", 2);


  hiEtaDistrEBpi0_ = dbe_->book1D("iEtaDistributionEBpi0", "RechitEB pi0 ieta", 171, -85, 86);
  hiEtaDistrEBpi0_->setAxisTitle("i#eta", 1);
  hiEtaDistrEBpi0_->setAxisTitle("#rechits", 2);

  hiYDistrEEpi0_ = dbe_->book1D("iYDistributionEBpi0", "RechitEE pi0 iY", 100, 0, 100);
  hiYDistrEEpi0_->setAxisTitle("iy", 1);
  hiYDistrEEpi0_->setAxisTitle("#rechits", 2);

  hiEtaDistrEBeta_ = dbe_->book1D("iEtaDistributionEBeta", "RechitEB eta ieta", 171, -85, 86);
  hiEtaDistrEBeta_->setAxisTitle("i#eta", 1);
  hiEtaDistrEBeta_->setAxisTitle("#rechits", 2);

  hiYDistrEEeta_ = dbe_->book1D("iYDistributionEBeta", "RechitEE eta iY", 100, 0, 100);
  hiYDistrEEeta_->setAxisTitle("iy", 1);
  hiYDistrEEeta_->setAxisTitle("#rechits", 2);


  hRechitEnergyEBpi0_ = dbe_->book1D("rhEnergyEBpi0","Pi0 rechits energy EB",160,0.,2.0);
  hRechitEnergyEBpi0_->setAxisTitle("energy (GeV) ",1);
  hRechitEnergyEBpi0_->setAxisTitle("#rechits",2);

  hRechitEnergyEEpi0_ = dbe_->book1D("rhEnergyEEpi0","Pi0 rechits energy EE",160,0.,3.0);
  hRechitEnergyEEpi0_->setAxisTitle("energy (GeV) ",1);
  hRechitEnergyEEpi0_->setAxisTitle("#rechits",2);

  hRechitEnergyEBeta_ = dbe_->book1D("rhEnergyEBeta","Eta rechits energy EB",160,0.,2.0);
  hRechitEnergyEBeta_->setAxisTitle("energy (GeV) ",1);
  hRechitEnergyEBeta_->setAxisTitle("#rechits",2);

  hRechitEnergyEEeta_ = dbe_->book1D("rhEnergyEEeta","Eta rechits energy EE",160,0.,3.0);
  hRechitEnergyEEeta_->setAxisTitle("energy (GeV) ",1);
  hRechitEnergyEEeta_->setAxisTitle("#rechits",2);

  hEventEnergyEBpi0_ = dbe_->book1D("eventEnergyEBpi0","Pi0 event energy EB",100,0.,20.0);
  hEventEnergyEBpi0_->setAxisTitle("energy (GeV) ",1);

  hEventEnergyEEpi0_ = dbe_->book1D("eventEnergyEEpi0","Pi0 event energy EE",100,0.,50.0);
  hEventEnergyEEpi0_->setAxisTitle("energy (GeV) ",1);

  hEventEnergyEBeta_ = dbe_->book1D("eventEnergyEBeta","Eta event energy EB",100,0.,20.0);
  hEventEnergyEBeta_->setAxisTitle("energy (GeV) ",1);

  hEventEnergyEEeta_ = dbe_->book1D("eventEnergyEEeta","Eta event energy EE",100,0.,50.0);
  hEventEnergyEEeta_->setAxisTitle("energy (GeV) ",1);

  hNRecHitsEBpi0_ = dbe_->book1D("nRechitsEBpi0","#rechits in pi0 collection EB",100,0.,250.);
  hNRecHitsEBpi0_->setAxisTitle("rechits ",1);
  
  hNRecHitsEEpi0_ = dbe_->book1D("nRechitsEEpi0","#rechits in pi0 collection EE",100,0.,250.);
  hNRecHitsEEpi0_->setAxisTitle("rechits ",1);
  
  hNRecHitsEBeta_ = dbe_->book1D("nRechitsEBeta","#rechits in eta collection EB",100,0.,250.);
  hNRecHitsEBeta_->setAxisTitle("rechits ",1);
  
  hNRecHitsEEeta_ = dbe_->book1D("nRechitsEEeta","#rechits in eta collection EE",100,0.,250.);
  hNRecHitsEEeta_->setAxisTitle("rechits ",1);
  
  hMeanRecHitEnergyEBpi0_ = dbe_->book1D("meanEnergyEBpi0","Mean rechit energy in pi0 collection EB",50,0.,2.);
  hMeanRecHitEnergyEBpi0_->setAxisTitle("Mean Energy [GeV] ",1);
  
  hMeanRecHitEnergyEEpi0_ = dbe_->book1D("meanEnergyEEpi0","Mean rechit energy in pi0 collection EE",100,0.,5.);
  hMeanRecHitEnergyEEpi0_->setAxisTitle("Mean Energy [GeV] ",1);
  
  hMeanRecHitEnergyEBeta_ = dbe_->book1D("meanEnergyEBeta","Mean rechit energy in eta collection EB",50,0.,2.);
  hMeanRecHitEnergyEBeta_->setAxisTitle("Mean Energy [GeV] ",1);
  
  hMeanRecHitEnergyEEeta_ = dbe_->book1D("meanEnergyEEeta","Mean rechit energy in eta collection EE",100,0.,5.);
  hMeanRecHitEnergyEEeta_->setAxisTitle("Mean Energy [GeV] ",1);
  
  hMinvPi0EB_ = dbe_->book1D("Pi0InvmassEB","Pi0 Invariant Mass in EB",100,0.,0.5);
  hMinvPi0EB_->setAxisTitle("Inv Mass [GeV] ",1);

  hMinvPi0EE_ = dbe_->book1D("Pi0InvmassEE","Pi0 Invariant Mass in EE",100,0.,0.5);
  hMinvPi0EE_->setAxisTitle("Inv Mass [GeV] ",1);
  
  hMinvEtaEB_ = dbe_->book1D("EtaInvmassEB","Eta Invariant Mass in EB",100,0.,0.85);
  hMinvEtaEB_->setAxisTitle("Inv Mass [GeV] ",1);

  hMinvEtaEE_ = dbe_->book1D("EtaInvmassEE","Eta Invariant Mass in EE",100,0.,0.85);
  hMinvEtaEE_->setAxisTitle("Inv Mass [GeV] ",1);

  
  hPt1Pi0EB_ = dbe_->book1D("Pt1Pi0EB","Pt 1st most energetic Pi0 photon in EB",100,0.,20.);
  hPt1Pi0EB_->setAxisTitle("1st photon Pt [GeV] ",1);
  
  hPt1Pi0EE_ = dbe_->book1D("Pt1Pi0EE","Pt 1st most energetic Pi0 photon in EE",100,0.,20.);
  hPt1Pi0EE_->setAxisTitle("1st photon Pt [GeV] ",1);

  hPt1EtaEB_ = dbe_->book1D("Pt1EtaEB","Pt 1st most energetic Eta photon in EB",100,0.,20.);
  hPt1EtaEB_->setAxisTitle("1st photon Pt [GeV] ",1);
  
  hPt1EtaEE_ = dbe_->book1D("Pt1EtaEE","Pt 1st most energetic Eta photon in EE",100,0.,20.);
  hPt1EtaEE_->setAxisTitle("1st photon Pt [GeV] ",1);
  
  hPt2Pi0EB_ = dbe_->book1D("Pt2Pi0EB","Pt 2nd most energetic Pi0 photon in EB",100,0.,20.);
  hPt2Pi0EB_->setAxisTitle("2nd photon Pt [GeV] ",1);

  hPt2Pi0EE_ = dbe_->book1D("Pt2Pi0EE","Pt 2nd most energetic Pi0 photon in EE",100,0.,20.);
  hPt2Pi0EE_->setAxisTitle("2nd photon Pt [GeV] ",1);

  hPt2EtaEB_ = dbe_->book1D("Pt2EtaEB","Pt 2nd most energetic Eta photon in EB",100,0.,20.);
  hPt2EtaEB_->setAxisTitle("2nd photon Pt [GeV] ",1);

  hPt2EtaEE_ = dbe_->book1D("Pt2EtaEE","Pt 2nd most energetic Eta photon in EE",100,0.,20.);
  hPt2EtaEE_->setAxisTitle("2nd photon Pt [GeV] ",1);

  
  hPtPi0EB_ = dbe_->book1D("PtPi0EB","Pi0 Pt in EB",100,0.,20.);
  hPtPi0EB_->setAxisTitle("Pi0 Pt [GeV] ",1);

  hPtPi0EE_ = dbe_->book1D("PtPi0EE","Pi0 Pt in EE",100,0.,20.);
  hPtPi0EE_->setAxisTitle("Pi0 Pt [GeV] ",1);

  hPtEtaEB_ = dbe_->book1D("PtEtaEB","Eta Pt in EB",100,0.,20.);
  hPtEtaEB_->setAxisTitle("Eta Pt [GeV] ",1);

  hPtEtaEE_ = dbe_->book1D("PtEtaEE","Eta Pt in EE",100,0.,20.);
  hPtEtaEE_->setAxisTitle("Eta Pt [GeV] ",1);

  hIsoPi0EB_ = dbe_->book1D("IsoPi0EB","Pi0 Iso in EB",50,0.,1.);
  hIsoPi0EB_->setAxisTitle("Pi0 Iso",1);

  hIsoPi0EE_ = dbe_->book1D("IsoPi0EE","Pi0 Iso in EE",50,0.,1.);
  hIsoPi0EE_->setAxisTitle("Pi0 Iso",1);

  hIsoEtaEB_ = dbe_->book1D("IsoEtaEB","Eta Iso in EB",50,0.,1.);
  hIsoEtaEB_->setAxisTitle("Eta Iso",1);

  hIsoEtaEE_ = dbe_->book1D("IsoEtaEE","Eta Iso in EE",50,0.,1.);
  hIsoEtaEE_->setAxisTitle("Eta Iso",1);

  hS4S91Pi0EB_ = dbe_->book1D("S4S91Pi0EB","S4S9 1st most energetic Pi0 photon in EB",50,0.,1.);
  hS4S91Pi0EB_->setAxisTitle("S4S9 of the 1st Pi0 Photon ",1);

  hS4S91Pi0EE_ = dbe_->book1D("S4S91Pi0EE","S4S9 1st most energetic Pi0 photon in EE",50,0.,1.);
  hS4S91Pi0EE_->setAxisTitle("S4S9 of the 1st Pi0 Photon ",1);

  hS4S91EtaEB_ = dbe_->book1D("S4S91EtaEB","S4S9 1st most energetic Eta photon in EB",50,0.,1.);
  hS4S91EtaEB_->setAxisTitle("S4S9 of the 1st Eta Photon ",1);

  hS4S91EtaEE_ = dbe_->book1D("S4S91EtaEE","S4S9 1st most energetic Eta photon in EE",50,0.,1.);
  hS4S91EtaEE_->setAxisTitle("S4S9 of the 1st Eta Photon ",1);

  hS4S92Pi0EB_ = dbe_->book1D("S4S92Pi0EB","S4S9 2nd most energetic Pi0 photon in EB",50,0.,1.);
  hS4S92Pi0EB_->setAxisTitle("S4S9 of the 2nd Pi0 Photon",1);

  hS4S92Pi0EE_ = dbe_->book1D("S4S92Pi0EE","S4S9 2nd most energetic Pi0 photon in EE",50,0.,1.);
  hS4S92Pi0EE_->setAxisTitle("S4S9 of the 2nd Pi0 Photon",1);

  hS4S92EtaEB_ = dbe_->book1D("S4S92EtaEB","S4S9 2nd most energetic Pi0 photon in EB",50,0.,1.);
  hS4S92EtaEB_->setAxisTitle("S4S9 of the 2nd Eta Photon",1);

  hS4S92EtaEE_ = dbe_->book1D("S4S92EtaEE","S4S9 2nd most energetic Pi0 photon in EE",50,0.,1.);
  hS4S92EtaEE_->setAxisTitle("S4S9 of the 2nd Eta Photon",1);

  


}
void HLTAlCaMonPi0::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 338 of file HLTAlCaMonPi0.cc.

                                {
  
}
void HLTAlCaMonPi0::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 333 of file HLTAlCaMonPi0.cc.

                                                                       {

}
void HLTAlCaMonPi0::convxtalid ( int &  ,
int &   
) [protected]

Referenced by analyze().

int HLTAlCaMonPi0::diff_neta_s ( int  ,
int   
) [protected]

Referenced by analyze().

int HLTAlCaMonPi0::diff_nphi_s ( int  ,
int   
) [protected]

Referenced by analyze().

void HLTAlCaMonPi0::endJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 1564 of file HLTAlCaMonPi0.cc.

References dbe_, fileName_, DQMStore::save(), and saveToFile_.

                          {

  if(dbe_) {  
    if (saveToFile_) {
      dbe_->save(fileName_);
    }
  }
}
void HLTAlCaMonPi0::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 1556 of file HLTAlCaMonPi0.cc.

                                                                     {
}
void HLTAlCaMonPi0::endRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 1560 of file HLTAlCaMonPi0.cc.

                                                                 {

}

Member Data Documentation

Definition at line 255 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 256 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

double HLTAlCaMonPi0::clusSeedThr_ [private]

Definition at line 254 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 258 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 75 of file HLTAlCaMonPi0.h.

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

std::vector<EBDetId> HLTAlCaMonPi0::detIdEBRecHits [private]

Definition at line 316 of file HLTAlCaMonPi0.h.

Referenced by analyze().

std::vector<EEDetId> HLTAlCaMonPi0::detIdEERecHits [private]

Definition at line 320 of file HLTAlCaMonPi0.h.

Referenced by analyze().

std::vector<EcalRecHit> HLTAlCaMonPi0::EBRecHits [private]

Definition at line 317 of file HLTAlCaMonPi0.h.

Referenced by analyze().

std::vector<EcalRecHit> HLTAlCaMonPi0::EERecHits [private]

Definition at line 321 of file HLTAlCaMonPi0.h.

Referenced by analyze().

Definition at line 76 of file HLTAlCaMonPi0.h.

Referenced by analyze().

std::string HLTAlCaMonPi0::fileName_ [private]

Output file name if required.

Definition at line 341 of file HLTAlCaMonPi0.h.

Referenced by endJob(), and HLTAlCaMonPi0().

std::string HLTAlCaMonPi0::folderName_ [private]

DQM folder name.

Definition at line 329 of file HLTAlCaMonPi0.h.

Referenced by beginJob(), and HLTAlCaMonPi0().

Definition at line 248 of file HLTAlCaMonPi0.h.

Definition at line 249 of file HLTAlCaMonPi0.h.

Distribution of total event energy EB (eta)

Definition at line 122 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of total event energy EB (pi0)

Definition at line 116 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of total event energy EE (eta)

Definition at line 125 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of total event energy EE (pi0)

Definition at line 119 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of rechits in iEta (eta)

Definition at line 98 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of rechits in iEta (pi0)

Definition at line 92 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of rechits in iPhi (eta)

Definition at line 86 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of rechits in iPhi (pi0)

Definition at line 80 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Eta Iso EB.

Definition at line 208 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Eta Iso EE.

Definition at line 211 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pi0 Iso EB.

Definition at line 202 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pi0 Iso EE.

Definition at line 205 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of rechits in ix EE (eta)

Definition at line 89 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of rechits in ix EE (pi0)

Definition at line 83 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of rechits in iy EE (eta)

Definition at line 101 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of rechits in iy EE (pi0)

Definition at line 95 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of Mean energy per rechit EB (eta)

Definition at line 146 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of Mean energy per rechit EB (pi0)

Definition at line 140 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of Mean energy per rechit EE (eta)

Definition at line 149 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of Mean energy per rechit EE (pi0)

Definition at line 143 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Eta invariant mass in EB.

Definition at line 158 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Eta invariant mass in EE.

Definition at line 161 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pi0 invariant mass in EB.

Definition at line 152 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pi0 invariant mass in EE.

Definition at line 155 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of number of RecHits EB (eta)

Definition at line 134 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of number of RecHits EB (pi0)

Definition at line 128 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of number of RecHits EE (eta)

Definition at line 137 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Distribution of number of RecHits EE (pi0)

Definition at line 131 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pt of the 1st most energetic Eta photon in EB.

Definition at line 170 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pt of the 1st most energetic Eta photon in EE.

Definition at line 173 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pt of the 1st most energetic Pi0 photon in EB.

Definition at line 164 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pt of the 1st most energetic Pi0 photon in EE.

Definition at line 167 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pt of the 2nd most energetic Eta photon in EB.

Definition at line 183 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pt of the 2nd most energetic Eta photon in EE.

Definition at line 186 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pt of the 2nd most energetic Pi0 photon in EB.

Definition at line 177 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pt of the 2nd most energetic Pi0 photon in EE.

Definition at line 180 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Eta Pt in EB.

Definition at line 196 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Eta Pt in EE.

Definition at line 199 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pi0 Pt in EB.

Definition at line 190 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Pi0 Pt in EE.

Definition at line 193 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Energy Distribution of rechits EB (eta)

Definition at line 110 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Energy Distribution of rechits EB (pi0)

Definition at line 104 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Energy Distribution of rechits EE (eta)

Definition at line 113 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Energy Distribution of rechits EE (pi0)

Definition at line 107 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

S4S9 of the 1st most energetic eta photon.

Definition at line 220 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

S4S9 of the 1st most energetic eta photon EE.

Definition at line 223 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

S4S9 of the 1st most energetic pi0 photon.

Definition at line 214 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

S4S9 of the 1st most energetic pi0 photon EE.

Definition at line 217 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

S4S9 of the 2nd most energetic eta photon.

Definition at line 232 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

S4S9 of the 2nd most energetic eta photon EE.

Definition at line 235 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

S4S9 of the 2nd most energetic pi0 photon.

Definition at line 226 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

S4S9 of the 2nd most energetic pi0 photon EE.

Definition at line 229 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and beginJob().

Definition at line 336 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

which subdet will be monitored

Definition at line 335 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 338 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 337 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 307 of file HLTAlCaMonPi0.h.

Definition at line 309 of file HLTAlCaMonPi0.h.

Definition at line 310 of file HLTAlCaMonPi0.h.

Definition at line 311 of file HLTAlCaMonPi0.h.

double HLTAlCaMonPi0::ParameterW0_ [private]

Definition at line 312 of file HLTAlCaMonPi0.h.

double HLTAlCaMonPi0::ParameterX0_ [private]

Definition at line 308 of file HLTAlCaMonPi0.h.

Definition at line 77 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

unsigned int HLTAlCaMonPi0::prescaleFactor_ [private]

Monitor every prescaleFactor_ events.

Definition at line 326 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 242 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

object to monitor

Definition at line 241 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 246 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

object to monitor

Definition at line 245 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 269 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 280 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 289 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 301 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Write to file.

Definition at line 332 of file HLTAlCaMonPi0.h.

Referenced by endJob(), and HLTAlCaMonPi0().

Definition at line 292 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 304 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 291 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 303 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

double HLTAlCaMonPi0::seleEtaIso_ [private]

Definition at line 290 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 302 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 287 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 299 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 263 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 274 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 288 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 300 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 264 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 275 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 267 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 279 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 266 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 278 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

double HLTAlCaMonPi0::selePi0Iso_ [private]

Definition at line 268 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 277 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

double HLTAlCaMonPi0::selePtEta_ [private]

Definition at line 284 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 298 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

double HLTAlCaMonPi0::selePtGamma_ [private]

Definition at line 261 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

for pi0->gg endcap

Definition at line 272 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

for eta->gg barrel

Definition at line 283 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

for eta->gg endcap

Definition at line 295 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

double HLTAlCaMonPi0::selePtPi0_ [private]

Definition at line 262 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 273 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 265 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 276 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 285 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 296 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 286 of file HLTAlCaMonPi0.h.

Referenced by HLTAlCaMonPi0().

Definition at line 297 of file HLTAlCaMonPi0.h.

Referenced by HLTAlCaMonPi0().

Definition at line 251 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().

Definition at line 252 of file HLTAlCaMonPi0.h.

Referenced by analyze(), and HLTAlCaMonPi0().