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
5 #include <iostream>
6 
7 
8 struct IMASelector {
9  IMASelector( double ESCOPinMin, double ESeedOPoutMin, double PinMPoutOPinMin,
10  double ESCOPinMax, double ESeedOPoutMax, double PinMPoutOPinMax,
11  double EMPoutMin, double EMPoutMax) :
12  ESCOPinMin_ (ESCOPinMin),
13  ESeedOPoutMin_ (ESeedOPoutMin),
14  PinMPoutOPinMin_ (PinMPoutOPinMin),
15  ESCOPinMax_ (ESCOPinMax),
16  ESeedOPoutMax_ (ESeedOPoutMax),
17  PinMPoutOPinMax_ (PinMPoutOPinMax),
18  EMPoutMin_ (EMPoutMin),
19  EMPoutMax_ (EMPoutMax) {}
20 
21  template<typename T>
22  bool operator()( const T & t ) const {
23  double pin = t.trackMomentumAtVtx ().R () ;
24  double poMpiOpi = (pin - t.trackMomentumOut ().R ()) / pin ;
25  double ESC = t.energy () ;
26  double pOut = t.trackMomentumOut().R();
27  double EseedOPout = t.eSeedClusterOverPout () ;
28  double EoPin = t.eSuperClusterOverP () ;
29  double EoPout = (ESC)/pOut;
30  return (poMpiOpi > PinMPoutOPinMin_ && poMpiOpi < PinMPoutOPinMax_ &&
31  EseedOPout > ESeedOPoutMin_ && EseedOPout < ESeedOPoutMax_ &&
32  EoPin > ESCOPinMin_ && EoPin < ESCOPinMax_ &&
33  EoPout > EMPoutMin_ && EoPout < EMPoutMax_) ;
34  }
35 private:
39 };
40 
41 
42 namespace reco {
43  namespace modules {
44  template<>
47  return IMASelector(cfg.getParameter<double>("ESCOPinMin"),
48  cfg.getParameter<double>("ESeedOPoutMin"),
49  cfg.getParameter<double>("PinMPoutOPinMin"),
50  cfg.getParameter<double>("ESCOPinMax"),
51  cfg.getParameter<double>("ESeedOPoutMax"),
52  cfg.getParameter<double>("PinMPoutOPinMax"),
53  cfg.getParameter<double>("EMPoutMin"),
54  cfg.getParameter<double>("EMPoutMax")
55  );
56  }
57  };
58  }
59 }
60 
61 #endif
T getParameter(std::string const &) const
double ESCOPinMax_
Definition: IMASelector.h:37
SingleObjectSelector< reco::GsfElectronCollection,::IMASelector > IMASelector
Definition: SealModule.cc:29
double EMPoutMax_
Definition: IMASelector.h:38
double ESeedOPoutMax_
Definition: IMASelector.h:37
double PinMPoutOPinMax_
Definition: IMASelector.h:37
double ESCOPinMin_
Definition: IMASelector.h:36
IMASelector(double ESCOPinMin, double ESeedOPoutMin, double PinMPoutOPinMin, double ESCOPinMax, double ESeedOPoutMax, double PinMPoutOPinMax, double EMPoutMin, double EMPoutMax)
Definition: IMASelector.h:9
double ESeedOPoutMin_
Definition: IMASelector.h:36
bool operator()(const T &t) const
Definition: IMASelector.h:22
double EMPoutMin_
Definition: IMASelector.h:38
double PinMPoutOPinMin_
Definition: IMASelector.h:36
long double T
static IMASelector make(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
Definition: IMASelector.h:46