CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCStubEfficiencyValidation Class Reference

#include <CSCStubEfficiencyValidation.h>

Inheritance diagram for CSCStubEfficiencyValidation:
CSCBaseValidation

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &)
 
 CSCStubEfficiencyValidation (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
 
std::shared_ptr< CSCStubMatchercscStubMatcher ()
 
void setCSCStubMatcher (std::shared_ptr< CSCStubMatcher > s)
 
 ~CSCStubEfficiencyValidation () override
 
- Public Member Functions inherited from CSCBaseValidation
 CSCBaseValidation (const edm::ParameterSet &ps)
 
void setGeometry (const CSCGeometry *geom)
 
void setSimHitMap (const PSimHitMap *simHitMap)
 
virtual ~CSCBaseValidation ()
 

Private Member Functions

bool isSimTrackGood (const SimTrack &t)
 

Private Attributes

edm::EDGetTokenT< CSCALCTDigiCollectionalcts_Token_
 
edm::EDGetTokenT< CSCCLCTDigiCollectionclcts_Token_
 
std::shared_ptr< CSCStubMatchercscStubMatcher_
 
MonitorElementetaALCTDenom [10]
 
MonitorElementetaALCTNum [10]
 
MonitorElementetaCLCTDenom [10]
 
MonitorElementetaCLCTNum [10]
 
MonitorElementetaLCTDenom [10]
 
MonitorElementetaLCTNum [10]
 
std::vector< double > etaMaxs_
 
std::vector< double > etaMins_
 
edm::InputTag inputTag_
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectionlcts_Token_
 
edm::EDGetTokenT< edm::SimTrackContainersimTrackInput_
 
double simTrackMaxEta_
 
double simTrackMinEta_
 
double simTrackMinPt_
 
edm::EDGetTokenT< edm::SimVertexContainersimVertexInput_
 

Additional Inherited Members

- Public Types inherited from CSCBaseValidation
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from CSCBaseValidation
const CSCLayerfindLayer (int detId) const
 
- Protected Attributes inherited from CSCBaseValidation
bool doSim_
 
const CSCGeometrytheCSCGeometry
 
const PSimHitMaptheSimHitMap
 

Detailed Description

Definition at line 22 of file CSCStubEfficiencyValidation.h.

Constructor & Destructor Documentation

◆ CSCStubEfficiencyValidation()

CSCStubEfficiencyValidation::CSCStubEfficiencyValidation ( const edm::ParameterSet pset,
edm::ConsumesCollector &&  iC 
)

Definition at line 9 of file CSCStubEfficiencyValidation.cc.

11  const auto& simVertex = pset.getParameter<edm::ParameterSet>("simVertex");
13  const auto& simTrack = pset.getParameter<edm::ParameterSet>("simTrack");
14  simTrackInput_ = iC.consumes<edm::SimTrackContainer>(simTrack.getParameter<edm::InputTag>("inputTag"));
15  simTrackMinPt_ = simTrack.getParameter<double>("minPt");
16  simTrackMinEta_ = simTrack.getParameter<double>("minEta");
17  simTrackMaxEta_ = simTrack.getParameter<double>("maxEta");
18 
19  // all CSC TPs have the same label
20  const auto& stubConfig = pset.getParameterSet("cscALCT");
21  inputTag_ = stubConfig.getParameter<edm::InputTag>("inputTag");
25 
26  // Initialize stub matcher
28 
29  // get the eta ranges
30  etaMins_ = pset.getParameter<std::vector<double>>("etaMins");
31  etaMaxs_ = pset.getParameter<std::vector<double>>("etaMaxs");
32 }

References alcts_Token_, clcts_Token_, cscStubMatcher_, etaMaxs_, etaMins_, inputTag_, lcts_Token_, eostools::move(), muonDTDigis_cfi::pset, cscDigiValidation_cfi::simTrack, simTrackInput_, simTrackMaxEta_, simTrackMinEta_, simTrackMinPt_, HLTEgPhaseIITestSequence_cff::simVertex, and simVertexInput_.

◆ ~CSCStubEfficiencyValidation()

CSCStubEfficiencyValidation::~CSCStubEfficiencyValidation ( )
override

Definition at line 34 of file CSCStubEfficiencyValidation.cc.

34 {}

Member Function Documentation

◆ analyze()

void CSCStubEfficiencyValidation::analyze ( const edm::Event e,
const edm::EventSetup eventSetup 
)
overridevirtual

Implements CSCBaseValidation.

Definition at line 61 of file CSCStubEfficiencyValidation.cc.

61  {
62  // Define handles
68 
69  // Use token to retreive event information
70  e.getByToken(simTrackInput_, sim_tracks);
71  e.getByToken(simVertexInput_, sim_vertices);
72  e.getByToken(alcts_Token_, alcts);
73  e.getByToken(clcts_Token_, clcts);
74  e.getByToken(lcts_Token_, lcts);
75 
76  // Initialize StubMatcher
77  cscStubMatcher_->init(e, eventSetup);
78 
79  const edm::SimTrackContainer& sim_track = *sim_tracks.product();
80  const edm::SimVertexContainer& sim_vert = *sim_vertices.product();
81 
82  if (!alcts.isValid()) {
83  edm::LogError("CSCStubEfficiencyValidation") << "Cannot get ALCTs by label " << inputTag_.encode();
84  }
85  if (!clcts.isValid()) {
86  edm::LogError("CSCStubEfficiencyValidation") << "Cannot get CLCTs by label " << inputTag_.encode();
87  }
88  if (!lcts.isValid()) {
89  edm::LogError("CSCStubEfficiencyValidation") << "Cannot get LCTs by label " << inputTag_.encode();
90  }
91 
92  // select simtracks for true muons
93  edm::SimTrackContainer sim_track_selected;
94  for (const auto& t : sim_track) {
95  if (!isSimTrackGood(t))
96  continue;
97  sim_track_selected.push_back(t);
98  }
99 
100  // Skip events with no selected simtracks
101  if (sim_track_selected.empty())
102  return;
103 
104  // Loop through good tracks, use corresponding vetrex to match stubs, then fill hists of chambers where the stub appears.
105  for (const auto& t : sim_track_selected) {
106  std::vector<bool> hitALCT(10);
107  std::vector<bool> hitCLCT(10);
108  std::vector<bool> hitLCT(10);
109 
110  // Match track to stubs with appropriate vertex
111  cscStubMatcher_->match(t, sim_vert[t.vertIndex()]);
112 
113  // Store matched stubs.
114  // Key: ChamberID, Value : CSCStubDigiContainer
115  const auto& alcts = cscStubMatcher_->alcts();
116  const auto& clcts = cscStubMatcher_->clcts();
117  const auto& lcts = cscStubMatcher_->lcts();
118 
119  // denominator histograms
120  for (int i = 0; i < 10; ++i) {
121  etaALCTDenom[i]->Fill(t.momentum().eta());
122  etaCLCTDenom[i]->Fill(t.momentum().eta());
123  etaLCTDenom[i]->Fill(t.momentum().eta());
124  }
125 
126  for (auto& [id, container] : alcts) {
127  const CSCDetId cscId(id);
128  const unsigned chamberType(cscId.iChamberType());
129  hitALCT[chamberType - 1] = true;
130  }
131 
132  for (auto& [id, container] : clcts) {
133  const CSCDetId cscId(id);
134  const unsigned chamberType(cscId.iChamberType());
135  hitCLCT[chamberType - 1] = true;
136  }
137 
138  for (auto& [id, container] : lcts) {
139  const CSCDetId cscId(id);
140  const unsigned chamberType(cscId.iChamberType());
141  hitLCT[chamberType - 1] = true;
142  }
143 
144  // numerator histograms
145  for (int i = 0; i < 10; ++i) {
146  if (hitALCT[i])
147  etaALCTNum[i]->Fill(t.momentum().eta());
148  if (hitCLCT[i])
149  etaCLCTNum[i]->Fill(t.momentum().eta());
150  if (hitLCT[i])
151  etaLCTNum[i]->Fill(t.momentum().eta());
152  }
153  }
154 }

References alcts_Token_, clcts_Token_, cscStubMatcher_, MillePedeFileConverter_cfg::e, edm::InputTag::encode(), etaALCTDenom, etaALCTNum, etaCLCTDenom, etaCLCTNum, etaLCTDenom, etaLCTNum, dqm::impl::MonitorElement::Fill(), mps_fire::i, CSCDetId::iChamberType(), inputTag_, isSimTrackGood(), edm::HandleBase::isValid(), lcts_Token_, edm::Handle< T >::product(), simTrackInput_, simVertexInput_, and submitPVValidationJobs::t.

◆ bookHistograms()

void CSCStubEfficiencyValidation::bookHistograms ( DQMStore::IBooker iBooker)

Definition at line 36 of file CSCStubEfficiencyValidation.cc.

36  {
37  iBooker.setCurrentFolder("MuonCSCDigisV/CSCDigiTask/Stub/Occupancy/");
38 
39  for (int i = 1; i <= 10; ++i) {
40  int j = i - 1;
42 
43  std::string t1 = "ALCTEtaDenom_" + cn;
44  std::string t2 = "CLCTEtaDenom_" + cn;
45  std::string t3 = "LCTEtaDenom_" + cn;
46 
47  etaALCTDenom[j] = iBooker.book1D(t1, t1 + ";True Muon |#eta|; Entries", 50, etaMins_[j], etaMaxs_[j]);
48  etaCLCTDenom[j] = iBooker.book1D(t2, t2 + ";True Muon |#eta|; Entries", 50, etaMins_[j], etaMaxs_[j]);
49  etaLCTDenom[j] = iBooker.book1D(t3, t3 + ";True Muon |#eta|; Entries", 50, etaMins_[j], etaMaxs_[j]);
50 
51  t1 = "ALCTEtaNum_" + cn;
52  t2 = "CLCTEtaNum_" + cn;
53  t3 = "LCTEtaNum_" + cn;
54 
55  etaALCTNum[j] = iBooker.book1D(t1, t1 + ";True Muon |#eta|; Entries", 50, etaMins_[j], etaMaxs_[j]);
56  etaCLCTNum[j] = iBooker.book1D(t2, t2 + ";True Muon |#eta|; Entries", 50, etaMins_[j], etaMaxs_[j]);
57  etaLCTNum[j] = iBooker.book1D(t3, t3 + ";True Muon |#eta|; Entries", 50, etaMins_[j], etaMaxs_[j]);
58  }
59 }

References dqm::implementation::IBooker::book1D(), CSCDetId::chamberName(), etaALCTDenom, etaALCTNum, etaCLCTDenom, etaCLCTNum, etaLCTDenom, etaLCTNum, etaMaxs_, etaMins_, mps_fire::i, dqmiolumiharvest::j, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, RandomServiceHelper::t1, RandomServiceHelper::t2, and RandomServiceHelper::t3.

◆ cscStubMatcher()

std::shared_ptr<CSCStubMatcher> CSCStubEfficiencyValidation::cscStubMatcher ( )
inline

Definition at line 31 of file CSCStubEfficiencyValidation.h.

31 { return cscStubMatcher_; }

References cscStubMatcher_.

◆ isSimTrackGood()

bool CSCStubEfficiencyValidation::isSimTrackGood ( const SimTrack t)
private

Definition at line 156 of file CSCStubEfficiencyValidation.cc.

156  {
157  // SimTrack selection
158  if (t.noVertex())
159  return false;
160  if (t.noGenpart())
161  return false;
162  // only muons
163  if (std::abs(t.type()) != 13)
164  return false;
165  // pt selection
166  if (t.momentum().pt() < simTrackMinPt_)
167  return false;
168  // eta selection
169  const float eta(std::abs(t.momentum().eta()));
171  return false;
172  return true;
173 }

References funct::abs(), PVValHelper::eta, simTrackMaxEta_, simTrackMinEta_, simTrackMinPt_, and submitPVValidationJobs::t.

Referenced by analyze().

◆ setCSCStubMatcher()

void CSCStubEfficiencyValidation::setCSCStubMatcher ( std::shared_ptr< CSCStubMatcher s)
inline

Definition at line 32 of file CSCStubEfficiencyValidation.h.

32 { cscStubMatcher_ = s; }

References cscStubMatcher_, and alignCSCRings::s.

Member Data Documentation

◆ alcts_Token_

edm::EDGetTokenT<CSCALCTDigiCollection> CSCStubEfficiencyValidation::alcts_Token_
private

Definition at line 37 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and CSCStubEfficiencyValidation().

◆ clcts_Token_

edm::EDGetTokenT<CSCCLCTDigiCollection> CSCStubEfficiencyValidation::clcts_Token_
private

Definition at line 38 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and CSCStubEfficiencyValidation().

◆ cscStubMatcher_

std::shared_ptr<CSCStubMatcher> CSCStubEfficiencyValidation::cscStubMatcher_
private

◆ etaALCTDenom

MonitorElement* CSCStubEfficiencyValidation::etaALCTDenom[10]
private

Definition at line 46 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and bookHistograms().

◆ etaALCTNum

MonitorElement* CSCStubEfficiencyValidation::etaALCTNum[10]
private

Definition at line 45 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and bookHistograms().

◆ etaCLCTDenom

MonitorElement* CSCStubEfficiencyValidation::etaCLCTDenom[10]
private

Definition at line 48 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and bookHistograms().

◆ etaCLCTNum

MonitorElement* CSCStubEfficiencyValidation::etaCLCTNum[10]
private

Definition at line 47 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and bookHistograms().

◆ etaLCTDenom

MonitorElement* CSCStubEfficiencyValidation::etaLCTDenom[10]
private

Definition at line 50 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and bookHistograms().

◆ etaLCTNum

MonitorElement* CSCStubEfficiencyValidation::etaLCTNum[10]
private

Definition at line 49 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and bookHistograms().

◆ etaMaxs_

std::vector<double> CSCStubEfficiencyValidation::etaMaxs_
private

Definition at line 59 of file CSCStubEfficiencyValidation.h.

Referenced by bookHistograms(), and CSCStubEfficiencyValidation().

◆ etaMins_

std::vector<double> CSCStubEfficiencyValidation::etaMins_
private

Definition at line 58 of file CSCStubEfficiencyValidation.h.

Referenced by bookHistograms(), and CSCStubEfficiencyValidation().

◆ inputTag_

edm::InputTag CSCStubEfficiencyValidation::inputTag_
private

Definition at line 40 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and CSCStubEfficiencyValidation().

◆ lcts_Token_

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCStubEfficiencyValidation::lcts_Token_
private

Definition at line 39 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and CSCStubEfficiencyValidation().

◆ simTrackInput_

edm::EDGetTokenT<edm::SimTrackContainer> CSCStubEfficiencyValidation::simTrackInput_
private

Definition at line 53 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and CSCStubEfficiencyValidation().

◆ simTrackMaxEta_

double CSCStubEfficiencyValidation::simTrackMaxEta_
private

Definition at line 56 of file CSCStubEfficiencyValidation.h.

Referenced by CSCStubEfficiencyValidation(), and isSimTrackGood().

◆ simTrackMinEta_

double CSCStubEfficiencyValidation::simTrackMinEta_
private

Definition at line 55 of file CSCStubEfficiencyValidation.h.

Referenced by CSCStubEfficiencyValidation(), and isSimTrackGood().

◆ simTrackMinPt_

double CSCStubEfficiencyValidation::simTrackMinPt_
private

Definition at line 54 of file CSCStubEfficiencyValidation.h.

Referenced by CSCStubEfficiencyValidation(), and isSimTrackGood().

◆ simVertexInput_

edm::EDGetTokenT<edm::SimVertexContainer> CSCStubEfficiencyValidation::simVertexInput_
private

Definition at line 52 of file CSCStubEfficiencyValidation.h.

Referenced by analyze(), and CSCStubEfficiencyValidation().

CSCStubEfficiencyValidation::etaLCTDenom
MonitorElement * etaLCTDenom[10]
Definition: CSCStubEfficiencyValidation.h:50
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
cscDigiValidation_cfi.simTrack
simTrack
Definition: cscDigiValidation_cfi.py:29
mps_fire.i
i
Definition: mps_fire.py:428
edm::Handle::product
T const * product() const
Definition: Handle.h:70
CSCStubEfficiencyValidation::simTrackMinPt_
double simTrackMinPt_
Definition: CSCStubEfficiencyValidation.h:54
CSCStubEfficiencyValidation::etaLCTNum
MonitorElement * etaLCTNum[10]
Definition: CSCStubEfficiencyValidation.h:49
CSCStubEfficiencyValidation::simTrackInput_
edm::EDGetTokenT< edm::SimTrackContainer > simTrackInput_
Definition: CSCStubEfficiencyValidation.h:53
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
CSCStubEfficiencyValidation::cscStubMatcher_
std::shared_ptr< CSCStubMatcher > cscStubMatcher_
Definition: CSCStubEfficiencyValidation.h:42
edm::Handle< edm::SimTrackContainer >
HLTEgPhaseIITestSequence_cff.simVertex
simVertex
Definition: HLTEgPhaseIITestSequence_cff.py:51
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CSCStubEfficiencyValidation::etaCLCTDenom
MonitorElement * etaCLCTDenom[10]
Definition: CSCStubEfficiencyValidation.h:48
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
CSCBaseValidation::CSCBaseValidation
CSCBaseValidation(const edm::ParameterSet &ps)
Definition: CSCBaseValidation.cc:4
PVValHelper::eta
Definition: PVValidationHelpers.h:70
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
CSCStubEfficiencyValidation::etaMins_
std::vector< double > etaMins_
Definition: CSCStubEfficiencyValidation.h:58
CSCStubEfficiencyValidation::alcts_Token_
edm::EDGetTokenT< CSCALCTDigiCollection > alcts_Token_
Definition: CSCStubEfficiencyValidation.h:37
RandomServiceHelper.t3
t3
Definition: RandomServiceHelper.py:258
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCStubEfficiencyValidation::clcts_Token_
edm::EDGetTokenT< CSCCLCTDigiCollection > clcts_Token_
Definition: CSCStubEfficiencyValidation.h:38
edm::ParameterSet
Definition: ParameterSet.h:47
CSCDetId
Definition: CSCDetId.h:26
CSCStubEfficiencyValidation::etaCLCTNum
MonitorElement * etaCLCTNum[10]
Definition: CSCStubEfficiencyValidation.h:47
CSCALCTDigiCollection
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
CSCStubEfficiencyValidation::simVertexInput_
edm::EDGetTokenT< edm::SimVertexContainer > simVertexInput_
Definition: CSCStubEfficiencyValidation.h:52
CSCCorrelatedLCTDigiCollection
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCStubEfficiencyValidation::isSimTrackGood
bool isSimTrackGood(const SimTrack &t)
Definition: CSCStubEfficiencyValidation.cc:156
CSCStubEfficiencyValidation::simTrackMinEta_
double simTrackMinEta_
Definition: CSCStubEfficiencyValidation.h:55
CSCStubEfficiencyValidation::etaMaxs_
std::vector< double > etaMaxs_
Definition: CSCStubEfficiencyValidation.h:59
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition: SimTrackContainer.h:12
CSCCLCTDigiCollection
CSCDetId::chamberName
std::string chamberName() const
Definition: CSCDetId.cc:74
CSCStubEfficiencyValidation::simTrackMaxEta_
double simTrackMaxEta_
Definition: CSCStubEfficiencyValidation.h:56
CSCStubEfficiencyValidation::inputTag_
edm::InputTag inputTag_
Definition: CSCStubEfficiencyValidation.h:40
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
CSCStubMatcher
Definition: CSCStubMatcher.h:22
CSCStubEfficiencyValidation::etaALCTDenom
MonitorElement * etaALCTDenom[10]
Definition: CSCStubEfficiencyValidation.h:46
edm::SimVertexContainer
std::vector< SimVertex > SimVertexContainer
Definition: SimVertexContainer.h:12
edm::InputTag
Definition: InputTag.h:15
CSCStubEfficiencyValidation::lcts_Token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lcts_Token_
Definition: CSCStubEfficiencyValidation.h:39
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
CSCStubEfficiencyValidation::etaALCTNum
MonitorElement * etaALCTNum[10]
Definition: CSCStubEfficiencyValidation.h:45
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37