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  bool result;
30  result=EoPout > EMPoutMin_ ;
31  result = EoPout<EMPoutMax_;
32  return (poMpiOpi > PinMPoutOPinMin_ && poMpiOpi < PinMPoutOPinMax_ &&
33  EseedOPout > ESeedOPoutMin_ && EseedOPout < ESeedOPoutMax_ &&
34  EoPin > ESCOPinMin_ && EoPin < ESCOPinMax_ &&
35  EoPout > EMPoutMin_ && EoPout < EMPoutMax_) ;
36  }
37 private:
41 };
42 
43 
44 namespace reco {
45  namespace modules {
46  template<>
48  static IMASelector make(const edm::ParameterSet & cfg) {
49  return IMASelector(cfg.getParameter<double>("ESCOPinMin"),
50  cfg.getParameter<double>("ESeedOPoutMin"),
51  cfg.getParameter<double>("PinMPoutOPinMin"),
52  cfg.getParameter<double>("ESCOPinMax"),
53  cfg.getParameter<double>("ESeedOPoutMax"),
54  cfg.getParameter<double>("PinMPoutOPinMax"),
55  cfg.getParameter<double>("EMPoutMin"),
56  cfg.getParameter<double>("EMPoutMax")
57  );
58  }
59  };
60  }
61 }
62 
63 #endif
T getParameter(std::string const &) const
double ESCOPinMax_
Definition: IMASelector.h:39
SingleObjectSelector< reco::GsfElectronCollection,::IMASelector > IMASelector
Definition: SealModule.cc:29
double EMPoutMax_
Definition: IMASelector.h:40
double ESeedOPoutMax_
Definition: IMASelector.h:39
double PinMPoutOPinMax_
Definition: IMASelector.h:39
double ESCOPinMin_
Definition: IMASelector.h:38
IMASelector(double ESCOPinMin, double ESeedOPoutMin, double PinMPoutOPinMin, double ESCOPinMax, double ESeedOPoutMax, double PinMPoutOPinMax, double EMPoutMin, double EMPoutMax)
Definition: IMASelector.h:8
tuple result
Definition: query.py:137
double ESeedOPoutMin_
Definition: IMASelector.h:38
static IMASelector make(const edm::ParameterSet &cfg)
Definition: IMASelector.h:48
bool operator()(const T &t) const
Definition: IMASelector.h:21
double EMPoutMin_
Definition: IMASelector.h:40
double PinMPoutOPinMin_
Definition: IMASelector.h:38
long double T