CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalTangentFilter Class Reference

#include <EcalTangentFilter.h>

Inheritance diagram for EcalTangentFilter:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 EcalTangentFilter (const edm::ParameterSet &)
 
 ~EcalTangentFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

Private Attributes

int fEvt
 
std::string fMuLabel
 
double fMuonD0Max
 
double fMuonD0Min
 
int fNgood
 
int fNtot
 
bool fVerbose
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 22 of file EcalTangentFilter.h.

Constructor & Destructor Documentation

EcalTangentFilter::EcalTangentFilter ( const edm::ParameterSet iConfig)
explicit

Definition at line 5 of file EcalTangentFilter.cc.

References gather_cfg::cout, and edm::ParameterSet::getParameter().

5  {
6  fMuLabel = iConfig.getParameter<std::string>("MuLabel");
7  fMuonD0Min = iConfig.getParameter<double>("MuD0Min");
8  fMuonD0Max = iConfig.getParameter<double>("MuD0Max");
9  fVerbose = iConfig.getParameter<bool>("Verbose");
10  cout << "----------------------------------------------------------------------" << std::endl;
11  cout << "--- EcalTangentFilter constructor" << std::endl;
12  cout << "--- MuLabel: " << fMuLabel << std::endl;
13  cout << "--- MuonD0Min: " << fMuonD0Min << std::endl;
14  cout << "--- MuonD0Max: " << fMuonD0Max << std::endl;
15  cout << "--- Verbose: " << fVerbose << std::endl;
16  cout << "----------------------------------------------------------------------" << std::endl;
17  fNgood = 0;
18  fNtot = 0;
19 }
T getParameter(std::string const &) const
tuple cout
Definition: gather_cfg.py:121
EcalTangentFilter::~EcalTangentFilter ( )

Definition at line 22 of file EcalTangentFilter.cc.

References gather_cfg::cout.

22  {
23  std::cout << "==> EcalTangentFilter> Number of accepted/total events = " << fNgood << "/" << fNtot << std::endl;
24 }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

void EcalTangentFilter::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 52 of file EcalTangentFilter.cc.

52  {
53 }
void EcalTangentFilter::endJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 56 of file EcalTangentFilter.cc.

56  {
57 }
bool EcalTangentFilter::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDFilter.

Definition at line 28 of file EcalTangentFilter.cc.

References gather_cfg::cout, edm::EventID::event(), edm::Event::getByLabel(), edm::EventBase::id(), metsig::muon, dt_dqm_sourceclient_common_cff::reco, and edm::EventID::run().

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

28  {
29  ++fNtot;
30  bool goodEvent(false);
31  using namespace edm;
32  using namespace reco;
34  iEvent.getByLabel(fMuLabel, Muons);
35  for (MuonCollection::const_iterator muon=Muons->begin(); muon!=Muons->end(); ++muon){
36  reco::TrackRef ref;
37  if(muon->outerTrack().isNonnull()){
38  ref = muon->outerTrack();
39  // Cut on impact parameter
40  double d0 = ref->d0();
41  if(fabs(d0) > fMuonD0Min && fabs(d0) < fMuonD0Max) goodEvent = true;
42  }
43  }
44  if(goodEvent){
45  ++fNgood;
46  if(fVerbose) std::cout << "==> EcalTangentFilter> new event r" << iEvent.id().run() << "/ev" << iEvent.id().event() << " accepted, so far: " << fNgood << std::endl;
47  }
48  return goodEvent;
49 }
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::EventID id() const
Definition: EventBase.h:56
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

int EcalTangentFilter::fEvt
private

Definition at line 33 of file EcalTangentFilter.h.

std::string EcalTangentFilter::fMuLabel
private

Definition at line 34 of file EcalTangentFilter.h.

double EcalTangentFilter::fMuonD0Max
private

Definition at line 36 of file EcalTangentFilter.h.

double EcalTangentFilter::fMuonD0Min
private

Definition at line 35 of file EcalTangentFilter.h.

int EcalTangentFilter::fNgood
private

Definition at line 33 of file EcalTangentFilter.h.

int EcalTangentFilter::fNtot
private

Definition at line 33 of file EcalTangentFilter.h.

bool EcalTangentFilter::fVerbose
private

Definition at line 37 of file EcalTangentFilter.h.