#include <ESRecoSummary.h>
Public Member Functions | |
ESRecoSummary (const edm::ParameterSet &) | |
~ESRecoSummary () | |
Protected Attributes | |
edm::InputTag | esClusterCollectionX_ |
edm::InputTag | esClusterCollectionY_ |
edm::InputTag | esRecHitCollection_ |
edm::InputTag | superClusterCollection_EE_ |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob () |
virtual void | endJob () |
Private Attributes | |
DQMStore * | dqmStore_ |
MonitorElement * | h_esClusters_energy_plane1 |
MonitorElement * | h_esClusters_energy_plane2 |
MonitorElement * | h_esClusters_energy_ratio |
MonitorElement * | h_recHits_ES_energyMax |
MonitorElement * | h_recHits_ES_time |
std::string | prefixME_ |
Definition at line 42 of file ESRecoSummary.h.
ESRecoSummary::ESRecoSummary | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 69 of file ESRecoSummary.cc.
References dqmStore_, esClusterCollectionX_, esClusterCollectionY_, esRecHitCollection_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), h_esClusters_energy_plane1, h_esClusters_energy_plane2, h_esClusters_energy_ratio, h_recHits_ES_energyMax, h_recHits_ES_time, cmsCodeRules::cppFunctionSkipper::operator, prefixME_, and superClusterCollection_EE_.
{ prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", ""); //now do what ever initialization is needed esRecHitCollection_ = ps.getParameter<edm::InputTag>("recHitCollection_ES"); esClusterCollectionX_ = ps.getParameter<edm::InputTag>("ClusterCollectionX_ES"); esClusterCollectionY_ = ps.getParameter<edm::InputTag>("ClusterCollectionY_ES"); dqmStore_ = edm::Service<DQMStore>().operator->(); // Monitor Elements (ex THXD) dqmStore_->setCurrentFolder(prefixME_ + "/ESRecoSummary"); // to organise the histos in folders superClusterCollection_EE_ = ps.getParameter<edm::InputTag>("superClusterCollection_EE"); // Preshower ---------------------------------------------- h_recHits_ES_energyMax = dqmStore_->book1D("recHits_ES_energyMax","recHits_ES_energyMax",200,0.,0.01); h_recHits_ES_time = dqmStore_->book1D("recHits_ES_time","recHits_ES_time",200,-100.,100.); h_esClusters_energy_plane1 = dqmStore_->book1D("esClusters_energy_plane1","esClusters_energy_plane1",200,0.,0.01); h_esClusters_energy_plane2 = dqmStore_->book1D("esClusters_energy_plane2","esClusters_energy_plane2",200,0.,0.01); h_esClusters_energy_ratio = dqmStore_->book1D("esClusters_energy_ratio","esClusters_energy_ratio",200,0.,20.); }
ESRecoSummary::~ESRecoSummary | ( | ) |
Definition at line 98 of file ESRecoSummary.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
void ESRecoSummary::analyze | ( | const edm::Event & | ev, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 110 of file ESRecoSummary.cc.
References edm::SortedCollection< T, SORT >::begin(), dtNoiseDBValidation_cfg::cerr, edm::SortedCollection< T, SORT >::end(), reco::CaloCluster::energy(), relval_parameters_module::energy, esClusterCollectionX_, esClusterCollectionY_, esRecHitCollection_, MonitorElement::Fill(), HcalObjRepresent::Fill(), edm::EventSetup::get(), edm::Event::getByLabel(), h_esClusters_energy_plane1, h_esClusters_energy_plane2, h_esClusters_energy_ratio, h_recHits_ES_energyMax, h_recHits_ES_time, edm::HandleBase::isValid(), edm::Handle< T >::product(), and superClusterCollection_EE_.
{ //Get the magnetic field edm::ESHandle<MagneticField> theMagField; iSetup.get<IdealMagneticFieldRecord>().get(theMagField); //Preshower RecHits edm::Handle<ESRecHitCollection> recHitsES; ev.getByLabel (esRecHitCollection_, recHitsES) ; const ESRecHitCollection* thePreShowerRecHits = recHitsES.product () ; if ( ! recHitsES.isValid() ) { std::cerr << "ESRecoSummary::analyze --> recHitsES not found" << std::endl; } float maxRecHitEnergyES = -999.; for (ESRecHitCollection::const_iterator esItr = thePreShowerRecHits->begin(); esItr != thePreShowerRecHits->end(); ++esItr) { h_recHits_ES_time -> Fill(esItr->time()); if (esItr -> energy() > maxRecHitEnergyES ) maxRecHitEnergyES = esItr -> energy() ; } // end loop over ES rec Hits h_recHits_ES_energyMax -> Fill(maxRecHitEnergyES ); // ES clusters in X plane edm::Handle<reco::PreshowerClusterCollection> esClustersX; ev.getByLabel( esClusterCollectionX_, esClustersX); const reco::PreshowerClusterCollection *ESclustersX = esClustersX.product(); // ES clusters in Y plane edm::Handle<reco::PreshowerClusterCollection> esClustersY; ev.getByLabel( esClusterCollectionY_, esClustersY); const reco::PreshowerClusterCollection *ESclustersY = esClustersY.product(); // ... 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() ) { std::cerr << "EcalRecHitSummary::analyze --> superClusters_EE_h not found" << std::endl; } // loop over all super clusters for (reco::SuperClusterCollection::const_iterator itSC = theEndcapSuperClusters->begin(); itSC != theEndcapSuperClusters->end(); ++itSC ) { if ( fabs(itSC->eta()) < 1.65 || fabs(itSC->eta()) > 2.6 ) continue; // Loop over all ECAL Basic clusters in the supercluster for (reco::CaloCluster_iterator ecalBasicCluster = itSC->clustersBegin(); ecalBasicCluster!= itSC->clustersEnd(); ecalBasicCluster++) { const reco::CaloClusterPtr ecalBasicClusterPtr = *(ecalBasicCluster); float ESenergyPlane1 = -999.; float ESenergyPlane2 = -999.; for (reco::PreshowerClusterCollection::const_iterator iESClus = ESclustersX->begin(); iESClus != ESclustersX->end(); ++iESClus) { const reco::CaloClusterPtr preshBasicCluster = iESClus->basicCluster(); const reco::PreshowerCluster *esCluster = &*iESClus; if (preshBasicCluster == ecalBasicClusterPtr) { ESenergyPlane1 = esCluster->energy(); h_esClusters_energy_plane1 ->Fill(esCluster->energy()); } } // end of x loop for (reco::PreshowerClusterCollection::const_iterator iESClus = ESclustersY->begin(); iESClus != ESclustersY->end(); ++iESClus) { const reco::CaloClusterPtr preshBasicCluster = iESClus->basicCluster(); const reco::PreshowerCluster *esCluster = &*iESClus; if (preshBasicCluster == ecalBasicClusterPtr) { ESenergyPlane2 = esCluster->energy(); h_esClusters_energy_plane2 -> Fill(esCluster->energy()); } } // end of y loop if ( ESenergyPlane1 != -999. && ESenergyPlane2 != -999. ) h_esClusters_energy_ratio -> Fill(ESenergyPlane1/ESenergyPlane2); } // end loop over all basic clusters in the supercluster }// end loop over superclusters }
void ESRecoSummary::beginJob | ( | void | ) | [private, virtual] |
void ESRecoSummary::endJob | ( | void | ) | [private, virtual] |
DQMStore* ESRecoSummary::dqmStore_ [private] |
Definition at line 55 of file ESRecoSummary.h.
Referenced by ESRecoSummary().
edm::InputTag ESRecoSummary::esClusterCollectionX_ [protected] |
Definition at line 73 of file ESRecoSummary.h.
Referenced by analyze(), and ESRecoSummary().
edm::InputTag ESRecoSummary::esClusterCollectionY_ [protected] |
Definition at line 74 of file ESRecoSummary.h.
Referenced by analyze(), and ESRecoSummary().
edm::InputTag ESRecoSummary::esRecHitCollection_ [protected] |
Definition at line 72 of file ESRecoSummary.h.
Referenced by analyze(), and ESRecoSummary().
Definition at line 63 of file ESRecoSummary.h.
Referenced by analyze(), and ESRecoSummary().
Definition at line 64 of file ESRecoSummary.h.
Referenced by analyze(), and ESRecoSummary().
Definition at line 65 of file ESRecoSummary.h.
Referenced by analyze(), and ESRecoSummary().
Definition at line 60 of file ESRecoSummary.h.
Referenced by analyze(), and ESRecoSummary().
MonitorElement* ESRecoSummary::h_recHits_ES_time [private] |
Definition at line 61 of file ESRecoSummary.h.
Referenced by analyze(), and ESRecoSummary().
std::string ESRecoSummary::prefixME_ [private] |
Definition at line 57 of file ESRecoSummary.h.
Referenced by ESRecoSummary().
Definition at line 71 of file ESRecoSummary.h.
Referenced by analyze(), and ESRecoSummary().