File indexing completed on 2024-04-06 12:32:48
0001 #include "DQMServices/Core/interface/DQMStore.h"
0002 #include "Validation/MuonCSCDigis/interface/CSCBaseValidation.h"
0003
0004 CSCBaseValidation::CSCBaseValidation(const edm::ParameterSet &ps)
0005 : doSim_(ps.getParameter<bool>("doSim")), theSimHitMap(nullptr), theCSCGeometry(nullptr) {
0006 const auto &simTrack = ps.getParameter<edm::ParameterSet>("simTrack");
0007 simTrackMinPt_ = simTrack.getParameter<double>("minPt");
0008 simTrackMinEta_ = simTrack.getParameter<double>("minEta");
0009 simTrackMaxEta_ = simTrack.getParameter<double>("maxEta");
0010 }
0011
0012 const CSCLayer *CSCBaseValidation::findLayer(int detId) const {
0013 assert(theCSCGeometry != nullptr);
0014 const GeomDetUnit *detUnit = theCSCGeometry->idToDetUnit(CSCDetId(detId));
0015 return dynamic_cast<const CSCLayer *>(detUnit);
0016 }
0017
0018 bool CSCBaseValidation::isSimTrackGood(const SimTrack &t) const {
0019
0020 if (t.noVertex())
0021 return false;
0022 if (t.noGenpart())
0023 return false;
0024
0025 if (std::abs(t.type()) != 13)
0026 return false;
0027
0028 if (t.momentum().pt() < simTrackMinPt_)
0029 return false;
0030
0031 const float eta(std::abs(t.momentum().eta()));
0032 if (eta > simTrackMaxEta_ || eta < simTrackMinEta_)
0033 return false;
0034 return true;
0035 }