CMS 3D CMS Logo

CSCWireDigiValidation.cc
Go to the documentation of this file.
4 
8 
10  : CSCBaseValidation(ps), theTimeBinPlots(), theNDigisPerLayerPlots() {
11  const auto &pset = ps.getParameterSet("cscWireDigi");
12  inputTag_ = pset.getParameter<edm::InputTag>("inputTag");
14 }
15 
17 
20  iBooker.book1D("CSCWireDigisPerEvent", "CSC Wire Digis per event;CSC Wire Digis per event;Entries", 100, 0, 100);
21  for (int i = 1; i <= 10; ++i) {
22  const std::string t1("CSCWireDigiTime_" + CSCDetId::chamberName(i));
23  const std::string t2("CSCWireDigisPerLayer_" + CSCDetId::chamberName(i));
24  const std::string t3("CSCWireDigiResolution_" + CSCDetId::chamberName(i));
25  theTimeBinPlots[i - 1] =
26  iBooker.book1D(t1, "Wire Time Bin " + CSCDetId::chamberName(i) + ";Wire Time Bin; Entries", 16, 0, 16);
27  theNDigisPerLayerPlots[i - 1] = iBooker.book1D(
28  t2, "Number of Wire Digis " + CSCDetId::chamberName(i) + ";Number of Wire Digis; Entries", 100, 0, 20);
29  theResolutionPlots[i - 1] = iBooker.book1D(
30  t3,
31  "Wire Y Position Resolution " + CSCDetId::chamberName(i) + ";Wire Y Position Resolution; Entries",
32  100,
33  -10,
34  10);
35  }
36 }
37 
40 
41  e.getByToken(wires_Token_, wires);
42 
43  if (!wires.isValid()) {
44  edm::LogError("CSCWireDigiValidation") << "Cannot get wires by label " << inputTag_.encode();
45  }
46 
47  unsigned nDigisPerEvent = 0;
48 
49  for (auto j = wires->begin(); j != wires->end(); j++) {
50  auto beginDigi = (*j).second.first;
51  auto endDigi = (*j).second.second;
52  int detId = (*j).first.rawId();
53 
54  const CSCLayer *layer = findLayer(detId);
55  int chamberType = layer->chamber()->specs()->chamberType();
56  int nDigis = endDigi - beginDigi;
57  nDigisPerEvent += nDigis;
58  theNDigisPerLayerPlots[chamberType - 1]->Fill(nDigis);
59 
60  for (auto digiItr = beginDigi; digiItr != endDigi; ++digiItr) {
61  theTimeBinPlots[chamberType - 1]->Fill(digiItr->getTimeBin());
62  }
63 
64  if (doSim_) {
66  if (nDigis == 1 && simHits.size() == 1) {
67  plotResolution(simHits[0], *beginDigi, layer, chamberType);
68  }
69  }
70  }
71 
72  theNDigisPerEventPlot->Fill(nDigisPerEvent);
73 }
74 
76  const CSCWireDigi &digi,
77  const CSCLayer *layer,
78  int chamberType) {
79  double hitX = hit.localPosition().x();
80  double hitY = hit.localPosition().y();
81  double digiY = layer->geometry()->yOfWireGroup(digi.getWireGroup(), hitX);
82  theResolutionPlots[chamberType - 1]->Fill(digiY - hitY);
83 }
CSCWireDigiValidation::theResolutionPlots
MonitorElement * theResolutionPlots[10]
Definition: CSCWireDigiValidation.h:24
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
Handle.h
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
CSCWireDigi::getWireGroup
int getWireGroup() const
default
Definition: CSCWireDigi.h:22
DigiDM_cff.wires
wires
Definition: DigiDM_cff.py:33
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
CSCWireDigiValidation::theTimeBinPlots
MonitorElement * theTimeBinPlots[10]
Definition: CSCWireDigiValidation.h:22
DQMStore.h
CSCLayer
Definition: CSCLayer.h:24
edm::Handle< CSCWireDigiCollection >
CSCWireDigiValidation::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: CSCWireDigiValidation.cc:38
CSCWireDigiValidation::CSCWireDigiValidation
CSCWireDigiValidation(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
Definition: CSCWireDigiValidation.cc:9
CSCWireDigiValidation::~CSCWireDigiValidation
~CSCWireDigiValidation() override
Definition: CSCWireDigiValidation.cc:16
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
CSCBaseValidation::doSim_
bool doSim_
Definition: CSCBaseValidation.h:26
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
CSCLayerGeometry.h
CSCBaseValidation::findLayer
const CSCLayer * findLayer(int detId) const
Definition: CSCBaseValidation.cc:7
RandomServiceHelper.t3
t3
Definition: RandomServiceHelper.py:258
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CSCBaseValidation::theSimHitMap
const PSimHitMap * theSimHitMap
Definition: CSCBaseValidation.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
CSCWireDigiValidation::wires_Token_
edm::EDGetTokenT< CSCWireDigiCollection > wires_Token_
Definition: CSCWireDigiValidation.h:20
CSCWireDigiValidation.h
CSCWireDigi
Definition: CSCWireDigi.h:14
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCWireDigiCollection
CSCWireDigiValidation::theNDigisPerEventPlot
MonitorElement * theNDigisPerEventPlot
Definition: CSCWireDigiValidation.h:25
CSCDetId::chamberName
std::string chamberName() const
Definition: CSCDetId.cc:86
PSimHitMap::hits
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:20
CSCWireDigiValidation::theNDigisPerLayerPlots
MonitorElement * theNDigisPerLayerPlots[10]
Definition: CSCWireDigiValidation.h:23
CSCWireDigiValidation::inputTag_
edm::InputTag inputTag_
Definition: CSCWireDigiValidation.h:21
dqm::implementation::IBooker
Definition: DQMStore.h:43
CSCBaseValidation
Definition: CSCBaseValidation.h:14
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
PSimHit
Definition: PSimHit.h:15
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::Event
Definition: Event.h:73
CSCWireDigiValidation::plotResolution
void plotResolution(const PSimHit &hit, const CSCWireDigi &digi, const CSCLayer *layer, int chamberType)
Definition: CSCWireDigiValidation.cc:75
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
CSCWireDigiValidation::bookHistograms
void bookHistograms(DQMStore::IBooker &)
Definition: CSCWireDigiValidation.cc:18
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
hit
Definition: SiStripHitEffFromCalibTree.cc:88
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
CSCGeometry.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37