CMS 3D CMS Logo

Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes

EERecoSummary Class Reference

#include <EERecoSummary.h>

Inheritance diagram for EERecoSummary:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Protected Attributes

edm::InputTag basicClusterCollection_EE_
double ethrEE_
edm::InputTag recHitCollection_EE_
edm::InputTag redRecHitCollection_EE_
double scEtThrEE_
edm::InputTag superClusterCollection_EE_

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void endJob ()

Private Attributes

DQMStoredqmStore_
MonitorElementh_basicClusters_recHits_EE_recoFlag
MonitorElementh_recHits_EE_recoFlag
MonitorElementh_recHits_EEM_Chi2
MonitorElementh_recHits_EEM_energyMax
MonitorElementh_recHits_EEM_time
MonitorElementh_recHits_EEP_Chi2
MonitorElementh_recHits_EEP_energyMax
MonitorElementh_recHits_EEP_time
MonitorElementh_redRecHits_EE_recoFlag
MonitorElementh_superClusters_EE_phi
MonitorElementh_superClusters_EEM_nBC
MonitorElementh_superClusters_EEP_nBC
MonitorElementh_superClusters_eta
std::string prefixME_

Detailed Description

Definition at line 42 of file EERecoSummary.h.


Constructor & Destructor Documentation

EERecoSummary::EERecoSummary ( const edm::ParameterSet ps) [explicit]

Definition at line 69 of file EERecoSummary.cc.

References basicClusterCollection_EE_, dqmStore_, ethrEE_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), h_basicClusters_recHits_EE_recoFlag, h_recHits_EE_recoFlag, h_recHits_EEM_Chi2, h_recHits_EEM_energyMax, h_recHits_EEM_time, h_recHits_EEP_Chi2, h_recHits_EEP_energyMax, h_recHits_EEP_time, h_redRecHits_EE_recoFlag, h_superClusters_EE_phi, h_superClusters_EEM_nBC, h_superClusters_EEP_nBC, h_superClusters_eta, cmsCodeRules::cppFunctionSkipper::operator, prefixME_, recHitCollection_EE_, redRecHitCollection_EE_, scEtThrEE_, and superClusterCollection_EE_.

{

  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");

  //now do what ever initialization is needed
  recHitCollection_EE_       = ps.getParameter<edm::InputTag>("recHitCollection_EE");
  redRecHitCollection_EE_    = ps.getParameter<edm::InputTag>("redRecHitCollection_EE");
  basicClusterCollection_EE_ = ps.getParameter<edm::InputTag>("basicClusterCollection_EE");
  superClusterCollection_EE_ = ps.getParameter<edm::InputTag>("superClusterCollection_EE");

  ethrEE_                    = ps.getParameter<double>("ethrEE");

  scEtThrEE_                 = ps.getParameter<double>("scEtThrEE");

  // DQM Store -------------------
  dqmStore_ = edm::Service<DQMStore>().operator->();

  // Monitor Elements (ex THXD)
  dqmStore_->setCurrentFolder(prefixME_ + "/RecoSummary"); // to organise the histos in folders
     
  // ReducedRecHits ----------------------------------------------
  // ... endcap 
  h_redRecHits_EE_recoFlag = dqmStore_->book1D("redRecHits_EE_recoFlag","redRecHits_EE_recoFlag",16,-0.5,15.5);  

  // RecHits ---------------------------------------------- 
  // ... endcap
  h_recHits_EE_recoFlag = dqmStore_->book1D("recHits_EE_recoFlag","recHits_EE_recoFlag",16,-0.5,15.5);  

  // ... endcap +
  h_recHits_EEP_energyMax     = dqmStore_->book1D("recHits_EEP_energyMax","recHitsEEP_energyMax",110,-10,100);
  h_recHits_EEP_Chi2          = dqmStore_->book1D("recHits_EEP_Chi2","recHits_EEP_Chi2",200,0,100);
  h_recHits_EEP_time          = dqmStore_->book1D("recHits_EEP_time","recHits_EEP_time",200,-50,50);

  // ... endcap -
  h_recHits_EEM_energyMax     = dqmStore_->book1D("recHits_EEM_energyMax","recHits_EEM_energyMax",110,-10,100);
  h_recHits_EEM_Chi2          = dqmStore_->book1D("recHits_EEM_Chi2","recHits_EEM_Chi2",200,0,100);
  h_recHits_EEM_time          = dqmStore_->book1D("recHits_EEM_time","recHits_EEM_time",200,-50,50);

  // Basic Clusters ----------------------------------------------    
  // ... associated endcap rec hits
  h_basicClusters_recHits_EE_recoFlag = dqmStore_->book1D("basicClusters_recHits_EE_recoFlag","basicClusters_recHits_EE_recoFlag",16,-0.5,15.5);  

  // Super Clusters ----------------------------------------------
  // ... endcap
  h_superClusters_EEP_nBC    = dqmStore_->book1D("superClusters_EEP_nBC","superClusters_EEP_nBC",100,0.,100.);
  h_superClusters_EEM_nBC    = dqmStore_->book1D("superClusters_EEM_nBC","superClusters_EEM_nBC",100,0.,100.);

  h_superClusters_eta        = dqmStore_->book1D("superClusters_EE_eta","superClusters_eta",150,-3.,3.);
  h_superClusters_EE_phi     = dqmStore_->book1D("superClusters_EE_phi","superClusters_EE_phi",360,-3.1415927,3.1415927);
  
}
EERecoSummary::~EERecoSummary ( )

Definition at line 124 of file EERecoSummary.cc.

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

Member Function Documentation

void EERecoSummary::analyze ( const edm::Event ev,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 136 of file EERecoSummary.cc.

References basicClusterCollection_EE_, edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), relval_parameters_module::energy, eta(), ethrEE_, funct::exp(), MonitorElement::Fill(), HcalObjRepresent::Fill(), edm::SortedCollection< T, SORT >::find(), edm::EventSetup::get(), edm::Event::getByLabel(), h_basicClusters_recHits_EE_recoFlag, h_recHits_EE_recoFlag, h_recHits_EEM_Chi2, h_recHits_EEM_energyMax, h_recHits_EEM_time, h_recHits_EEP_Chi2, h_recHits_EEP_energyMax, h_recHits_EEP_time, h_redRecHits_EE_recoFlag, h_superClusters_EE_phi, h_superClusters_EEM_nBC, h_superClusters_EEP_nBC, h_superClusters_eta, edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), phi, edm::Handle< T >::product(), recHitCollection_EE_, redRecHitCollection_EE_, scEtThrEE_, funct::sin(), superClusterCollection_EE_, cond::rpcobgas::time, z, and EEDetId::zside().

{
  
  //Get the magnetic field
  edm::ESHandle<MagneticField> theMagField;
  iSetup.get<IdealMagneticFieldRecord>().get(theMagField);

  // --- REDUCED REC HITS ------------------------------------------------------------------------------------- 
  // ... endcap
  edm::Handle<EcalRecHitCollection> redRecHitsEE;
  ev.getByLabel( redRecHitCollection_EE_, redRecHitsEE );
  const EcalRecHitCollection* theEndcapEcalredRecHits = redRecHitsEE.product () ;
  if ( ! redRecHitsEE.isValid() ) {
    edm::LogWarning("EERecoSummary") << "redRecHitsEE not found"; 
  }
  
  for ( EcalRecHitCollection::const_iterator itr = theEndcapEcalredRecHits->begin () ;
        itr != theEndcapEcalredRecHits->end () ; ++itr)
  {
      
    EEDetId eeid( itr -> id() );

    h_redRecHits_EE_recoFlag->Fill( itr -> recoFlag() );

  }

  // --- REC HITS ------------------------------------------------------------------------------------- 
  
  // ... endcap
  edm::Handle<EcalRecHitCollection> recHitsEE;
  ev.getByLabel( recHitCollection_EE_, recHitsEE );
  const EcalRecHitCollection* theEndcapEcalRecHits = recHitsEE.product () ;
  if ( ! recHitsEE.isValid() ) {
    edm::LogWarning("EERecoSummary") << "recHitsEE not found"; 
  }

  float maxRecHitEnergyEEP = -999.;
  float maxRecHitEnergyEEM = -999.;

  EEDetId eeid_MrecHitEEM;
  EEDetId eeid_MrecHitEEP;

  for ( EcalRecHitCollection::const_iterator itr = theEndcapEcalRecHits->begin () ;
        itr != theEndcapEcalRecHits->end () ; ++itr)
    {
      
      EEDetId eeid( itr -> id() );

      // EE+
      if ( eeid.zside() > 0 ){

        h_recHits_EE_recoFlag       -> Fill( itr -> recoFlag() );

        // max E rec hit
        if (itr -> energy() > maxRecHitEnergyEEP && 
            !(eeid.ix()>=41 && eeid.ix()<=60 && eeid.iy()>=41 && eeid.iy()<=60) ) {
          maxRecHitEnergyEEP = itr -> energy() ;
        }
        
        // only channels above noise
        if (  itr -> energy() > ethrEE_ ){
          h_recHits_EEP_Chi2          -> Fill( itr -> chi2() );
          h_recHits_EEP_time          -> Fill( itr -> time() );
        }
      }
      
      // EE-
      if ( eeid.zside() < 0 ){
        
        h_recHits_EE_recoFlag       -> Fill( itr -> recoFlag() );
        
        // max E rec hit
        if (itr -> energy() > maxRecHitEnergyEEM && 
            !(eeid.ix()>=41 && eeid.ix()<=60 && eeid.iy()>=41 && eeid.iy()<=60) ) {
          maxRecHitEnergyEEM = itr -> energy() ;
        }
        
        // only channels above noise
        if (  itr -> energy() > ethrEE_ ) {
          h_recHits_EEM_Chi2          -> Fill( itr -> chi2() );
          h_recHits_EEM_time          -> Fill( itr -> time() );
        }

      }
    } // end loop over EE rec hits

  // energy
  h_recHits_EEP_energyMax -> Fill( maxRecHitEnergyEEP );
  h_recHits_EEM_energyMax -> Fill( maxRecHitEnergyEEM );

  //--- BASIC CLUSTERS --------------------------------------------------------------

  // ... endcap
  edm::Handle<reco::BasicClusterCollection> basicClusters_EE_h;
  ev.getByLabel( basicClusterCollection_EE_, basicClusters_EE_h );
  if ( ! basicClusters_EE_h.isValid() ) {
    edm::LogWarning("EERecoSummary") << "basicClusters_EE_h not found"; 
  }

  for (unsigned int icl = 0; icl < basicClusters_EE_h->size(); ++icl) {
    
    //Get the associated RecHits
    const std::vector<std::pair<DetId,float> > & hits= (*basicClusters_EE_h)[icl].hitsAndFractions();
    for (std::vector<std::pair<DetId,float> > ::const_iterator rh = hits.begin(); rh!=hits.end(); ++rh){
      
      EBRecHitCollection::const_iterator itrechit = theEndcapEcalRecHits->find((*rh).first);
      if (itrechit==theEndcapEcalRecHits->end()) continue;
      h_basicClusters_recHits_EE_recoFlag -> Fill ( itrechit -> recoFlag() );
    }
  
  }

  // Super Clusters
  // ... endcap
  edm::Handle<reco::SuperClusterCollection> superClusters_EE_h;
  ev.getByLabel( superClusterCollection_EE_, superClusters_EE_h );
  const reco::SuperClusterCollection* theEndcapSuperClusters = superClusters_EE_h.product () ;
  if ( ! superClusters_EE_h.isValid() ) {
    edm::LogWarning("EERecoSummary") << "superClusters_EE_h not found"; 
  }

  for (reco::SuperClusterCollection::const_iterator itSC = theEndcapSuperClusters->begin(); 
       itSC != theEndcapSuperClusters->end(); ++itSC ) {

    double scEt = itSC -> energy() * sin(2.*atan( exp(- itSC->position().eta() )));

    if (scEt < scEtThrEE_ ) continue;

    h_superClusters_eta       -> Fill( itSC -> eta() );
    h_superClusters_EE_phi    -> Fill( itSC -> phi() );
    
    if  ( itSC -> z() > 0 ){
      h_superClusters_EEP_nBC    -> Fill( itSC -> clustersSize() );      
    }

    if  ( itSC -> z() < 0 ){
      h_superClusters_EEM_nBC    -> Fill( itSC -> clustersSize() );      
    }
  }

  //--------------------------------------------------------
 
}
void EERecoSummary::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 283 of file EERecoSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 289 of file EERecoSummary.cc.

{}

Member Data Documentation

Definition at line 94 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 56 of file EERecoSummary.h.

Referenced by EERecoSummary().

double EERecoSummary::ethrEE_ [protected]

Definition at line 97 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 79 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 68 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 75 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 74 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 76 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 71 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 70 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 72 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 64 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 87 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 84 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 83 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 86 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

std::string EERecoSummary::prefixME_ [private]

Definition at line 58 of file EERecoSummary.h.

Referenced by EERecoSummary().

Definition at line 92 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 93 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

double EERecoSummary::scEtThrEE_ [protected]

Definition at line 99 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().

Definition at line 95 of file EERecoSummary.h.

Referenced by analyze(), and EERecoSummary().