CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCBaseValidation.cc
Go to the documentation of this file.
3 
5  : doSim_(ps.getParameter<bool>("doSim")), theSimHitMap(nullptr), theCSCGeometry(nullptr) {
6  const auto &simTrack = ps.getParameter<edm::ParameterSet>("simTrack");
7  simTrackMinPt_ = simTrack.getParameter<double>("minPt");
8  simTrackMinEta_ = simTrack.getParameter<double>("minEta");
9  simTrackMaxEta_ = simTrack.getParameter<double>("maxEta");
10 }
11 
12 const CSCLayer *CSCBaseValidation::findLayer(int detId) const {
13  assert(theCSCGeometry != nullptr);
14  const GeomDetUnit *detUnit = theCSCGeometry->idToDetUnit(CSCDetId(detId));
15  return dynamic_cast<const CSCLayer *>(detUnit);
16 }
17 
19  // SimTrack selection
20  if (t.noVertex())
21  return false;
22  if (t.noGenpart())
23  return false;
24  // only muons
25  if (std::abs(t.type()) != 13)
26  return false;
27  // pt selection
28  if (t.momentum().pt() < simTrackMinPt_)
29  return false;
30  // eta selection
31  const float eta(std::abs(t.momentum().eta()));
32  if (eta > simTrackMaxEta_ || eta < simTrackMinEta_)
33  return false;
34  return true;
35 }
const CSCGeometry * theCSCGeometry
bool isSimTrackGood(const SimTrack &t) const
assert(be >=bs)
bool noGenpart() const
Definition: SimTrack.h:38
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CSCBaseValidation(const edm::ParameterSet &ps)
bool noVertex() const
Definition: SimTrack.h:34
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:22
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
const CSCLayer * findLayer(int detId) const
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:89