CMS 3D CMS Logo

EcalSkim Class Reference

#include <DPGAnalysis/Skims/interface/EcalSkim.h>

Inheritance diagram for EcalSkim:

edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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

Private Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)

Private Attributes

edm::InputTag BarrelClusterCollection
edm::InputTag EndcapClusterCollection
double EnergyCutEB
double EnergyCutEE


Detailed Description

Definition at line 44 of file EcalSkim.h.


Constructor & Destructor Documentation

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

Definition at line 37 of file EcalSkim.cc.

References BarrelClusterCollection, EndcapClusterCollection, EnergyCutEB, EnergyCutEE, edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

00038 {
00039   BarrelClusterCollection = iConfig.getParameter<edm::InputTag>("barrelClusterCollection");
00040   EndcapClusterCollection = iConfig.getParameter<edm::InputTag>("endcapClusterCollection");
00041 
00042   EnergyCutEB = iConfig.getUntrackedParameter<double>("energyCutEB");
00043   EnergyCutEE = iConfig.getUntrackedParameter<double>("energyCutEE");
00044 
00045 }

EcalSkim::~EcalSkim (  ) 

Definition at line 47 of file EcalSkim.cc.

00048 {
00049 }


Member Function Documentation

bool EcalSkim::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDFilter.

Definition at line 51 of file EcalSkim.cc.

References BarrelClusterCollection, EndcapClusterCollection, EnergyCutEB, EnergyCutEE, edm::EventID::event(), edm::Event::getByLabel(), edm::Event::id(), edm::Handle< T >::isValid(), and edm::Handle< T >::product().

00052 {
00053  int ievt = iEvent.id().event();
00054 
00055  edm::Handle<reco::SuperClusterCollection> bccHandle; // barrel
00056  edm::Handle<reco::SuperClusterCollection> eccHandle; // endcap 
00057  
00058  iEvent.getByLabel("cosmicSuperClusters","CosmicBarrelSuperClusters", bccHandle);
00059  if (!(bccHandle.isValid()))
00060  {
00061    LogWarning("EcalSkim") << BarrelClusterCollection << " not available in event " << ievt;
00062    return false;
00063  }
00064  else 
00065  {
00066    //   edm::LogVerbatim("") << "I took the right barrel collection" ;
00067  }
00068  iEvent.getByLabel("cosmicSuperClusters","CosmicEndcapSuperClusters", eccHandle);
00069  
00070  if (!(eccHandle.isValid()))
00071  {
00072    LogWarning("EcalSkim") << EndcapClusterCollection << " not available";
00073    //return false;
00074  }
00075  else 
00076  {
00077    //edm::LogVerbatim("") << "I took the right endcap collection " ;
00078  }
00079 
00080  bool accepted = false;
00081  bool acceptedEB = false;
00082  bool acceptedEE = false;
00083 
00084  // barrel
00085  const reco::SuperClusterCollection *clusterCollectionEB = bccHandle.product();
00086  for (reco::SuperClusterCollection::const_iterator clus = clusterCollectionEB->begin(); clus != clusterCollectionEB->end(); ++clus)
00087    {
00088      if ( clus->energy() >= EnergyCutEB )
00089        {
00090          acceptedEB = true;
00091          break;
00092        }
00093    }
00094  
00095  // endcap
00096  const reco::SuperClusterCollection *clusterCollectionEE = eccHandle.product();
00097  for (reco::SuperClusterCollection::const_iterator clus = clusterCollectionEE->begin(); clus != clusterCollectionEE->end(); ++clus)
00098    {
00099      if ( clus->energy() >= EnergyCutEE )
00100        {
00101          acceptedEE = true;
00102          break;
00103        }
00104    }
00105  
00106  // if there is at least one high energy cluster in EB OR EE, accept
00107  if (acceptedEB||acceptedEE) accepted = true;  
00108 
00109  return accepted;
00110 
00111 }


Member Data Documentation

edm::InputTag EcalSkim::BarrelClusterCollection [private]

Definition at line 52 of file EcalSkim.h.

Referenced by EcalSkim(), and filter().

edm::InputTag EcalSkim::EndcapClusterCollection [private]

Definition at line 53 of file EcalSkim.h.

Referenced by EcalSkim(), and filter().

double EcalSkim::EnergyCutEB [private]

Definition at line 54 of file EcalSkim.h.

Referenced by EcalSkim(), and filter().

double EcalSkim::EnergyCutEE [private]

Definition at line 55 of file EcalSkim.h.

Referenced by EcalSkim(), and filter().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:55 2009 for CMSSW by  doxygen 1.5.4