CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MCProcessRangeFilter.cc
Go to the documentation of this file.
1 
3 
5 #include <iostream>
6 
7 using namespace edm;
8 using namespace std;
9 
10 
12 label_(iConfig.getUntrackedParameter("moduleLabel",std::string("generator"))),
13 minProcessID(iConfig.getUntrackedParameter("MinProcessID",0)),
14 maxProcessID(iConfig.getUntrackedParameter("MaxProcessID",500)),
15 pthatMin(iConfig.getUntrackedParameter("MinPthat",0)),
16 pthatMax(iConfig.getUntrackedParameter("MaxPthat",14000))
17 {
18 
19 }
20 
21 
23 {
24 
25  // do anything here that needs to be done at desctruction time
26  // (e.g. close files, deallocate resources etc.)
27 
28 }
29 
30 
31 // ------------ method called to skim the data ------------
33 {
34  using namespace edm;
35  bool accepted = false;
37  iEvent.getByLabel(label_, evt);
38 
39  const HepMC::GenEvent * myGenEvent = evt->GetEvent();
40 
41 
42  // do the selection -- processID 0 is always accepted
43 
44  if (myGenEvent->signal_process_id() > minProcessID && myGenEvent->signal_process_id() < maxProcessID) {
45 
46  if ( myGenEvent->event_scale() > pthatMin && myGenEvent->event_scale() < pthatMax ) {
47  accepted = true;
48  }
49 
50  }
51 
52 
53  if (accepted){ return true; } else {return false;}
54 
55 }
56 
MCProcessRangeFilter(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:243
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
virtual bool filter(edm::Event &, const edm::EventSetup &)