CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EvtPlaneFilter.cc
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  * Filename: EvtPlaneFilter.cc
4  * Description: Event plane Q2 filter
5  * Created: 05/11/15 14:37:29
6  * Author: Quan Wang
7  * =====================================================================================
8  */
9 
16 
19 
21 public:
22  explicit EvtPlaneFilter(const edm::ParameterSet&);
24 private:
25  virtual bool filter(edm::Event&, const edm::EventSetup&) override;
26 
27  const double vnlow_;
28  const double vnhigh_;
29  const int epidx_;
30  const int eplvl_;
32 };
33 
35  vnlow_(ps.getParameter<double>("Vnlow")),
36  vnhigh_(ps.getParameter<double>("Vnhigh")),
37  epidx_(ps.getParameter<int>("EPidx")),
38  eplvl_(ps.getParameter<int>("EPlvl"))
39 {
40  tag_ = consumes<reco::EvtPlaneCollection>( ps.getParameter<edm::InputTag>("EPlabel") );
41  return;
42 }
43 
45 {
46  return;
47 }
48 
50 {
52  evt.getByToken(tag_, ep_);
53  double qn = (*ep_)[epidx_].vn(eplvl_);
54  if ( qn < vnlow_ || qn > vnhigh_ ) return false;
55  return true;
56 }
57 
T getParameter(std::string const &) const
EvtPlaneFilter(const edm::ParameterSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
const int epidx_
virtual bool filter(edm::Event &, const edm::EventSetup &) override
const int eplvl_
edm::EDGetTokenT< reco::EvtPlaneCollection > tag_
const double vnlow_
const double vnhigh_