CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IMASelector.h
Go to the documentation of this file.
1 #ifndef UtilAlgos_IMASelector_h
2 #define UtilAlgos_IMASelector_h
4 #include <iostream>
5 
6 
7 struct IMASelector {
8  IMASelector( double ESCOPinMin, double ESeedOPoutMin, double PinMPoutOPinMin,
9  double ESCOPinMax, double ESeedOPoutMax, double PinMPoutOPinMax,
10  double EMPoutMin, double EMPoutMax) :
11  ESCOPinMin_ (ESCOPinMin),
12  ESeedOPoutMin_ (ESeedOPoutMin),
13  PinMPoutOPinMin_ (PinMPoutOPinMin),
14  ESCOPinMax_ (ESCOPinMax),
15  ESeedOPoutMax_ (ESeedOPoutMax),
16  PinMPoutOPinMax_ (PinMPoutOPinMax),
17  EMPoutMin_ (EMPoutMin),
18  EMPoutMax_ (EMPoutMax) {}
19 
20  template<typename T>
21  bool operator()( const T & t ) const {
22  double pin = t.trackMomentumAtVtx ().R () ;
23  double poMpiOpi = (pin - t.trackMomentumOut ().R ()) / pin ;
24  double ESC = t.energy () ;
25  double pOut = t.trackMomentumOut().R();
26  double EseedOPout = t.eSeedClusterOverPout () ;
27  double EoPin = t.eSuperClusterOverP () ;
28  double EoPout = (ESC)/pOut;
29  return (poMpiOpi > PinMPoutOPinMin_ && poMpiOpi < PinMPoutOPinMax_ &&
30  EseedOPout > ESeedOPoutMin_ && EseedOPout < ESeedOPoutMax_ &&
31  EoPin > ESCOPinMin_ && EoPin < ESCOPinMax_ &&
32  EoPout > EMPoutMin_ && EoPout < EMPoutMax_) ;
33  }
34 private:
38 };
39 
40 
41 namespace reco {
42  namespace modules {
43  template<>
45  static IMASelector make(const edm::ParameterSet & cfg) {
46  return IMASelector(cfg.getParameter<double>("ESCOPinMin"),
47  cfg.getParameter<double>("ESeedOPoutMin"),
48  cfg.getParameter<double>("PinMPoutOPinMin"),
49  cfg.getParameter<double>("ESCOPinMax"),
50  cfg.getParameter<double>("ESeedOPoutMax"),
51  cfg.getParameter<double>("PinMPoutOPinMax"),
52  cfg.getParameter<double>("EMPoutMin"),
53  cfg.getParameter<double>("EMPoutMax")
54  );
55  }
56  };
57  }
58 }
59 
60 #endif
T getParameter(std::string const &) const
double ESCOPinMax_
Definition: IMASelector.h:36
SingleObjectSelector< reco::GsfElectronCollection,::IMASelector > IMASelector
Definition: SealModule.cc:29
double EMPoutMax_
Definition: IMASelector.h:37
double ESeedOPoutMax_
Definition: IMASelector.h:36
double PinMPoutOPinMax_
Definition: IMASelector.h:36
double ESCOPinMin_
Definition: IMASelector.h:35
IMASelector(double ESCOPinMin, double ESeedOPoutMin, double PinMPoutOPinMin, double ESCOPinMax, double ESeedOPoutMax, double PinMPoutOPinMax, double EMPoutMin, double EMPoutMax)
Definition: IMASelector.h:8
double ESeedOPoutMin_
Definition: IMASelector.h:35
static IMASelector make(const edm::ParameterSet &cfg)
Definition: IMASelector.h:45
bool operator()(const T &t) const
Definition: IMASelector.h:21
double EMPoutMin_
Definition: IMASelector.h:37
double PinMPoutOPinMin_
Definition: IMASelector.h:35
long double T