CMS 3D CMS Logo

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