CMS 3D CMS Logo

CSCWireDigiValidation.cc
Go to the documentation of this file.
4 
8 
10  : CSCBaseValidation(inputTag), doSim_(doSim), theTimeBinPlots(), theNDigisPerLayerPlots() {
12 }
13 
15 
17  theNDigisPerEventPlot = iBooker.book1D("CSCWireDigisPerEvent", "CSC Wire Digis per event", 100, 0, 100);
18  for (int i = 0; i < 10; ++i) {
19  char title1[200], title2[200], title3[200];
20  sprintf(title1, "CSCWireDigiTimeType%d", i + 1);
21  sprintf(title2, "CSCWireDigisPerLayerType%d", i + 1);
22  sprintf(title3, "CSCWireDigiResolution%d", i + 1);
23  theTimeBinPlots[i] = iBooker.book1D(title1, title1, 9, 0, 8);
24  theNDigisPerLayerPlots[i] = iBooker.book1D(title2, title2, 100, 0, 20);
25  theResolutionPlots[i] = iBooker.book1D(title3, title3, 100, -10, 10);
26  }
27 }
28 
31 
32  e.getByToken(wires_Token_, wires);
33 
34  if (!wires.isValid()) {
35  edm::LogError("CSCDigiDump") << "Cannot get wires by label " << theInputTag.encode();
36  }
37 
38  unsigned nDigisPerEvent = 0;
39 
40  for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); j != wires->end(); j++) {
41  std::vector<CSCWireDigi>::const_iterator beginDigi = (*j).second.first;
42  std::vector<CSCWireDigi>::const_iterator endDigi = (*j).second.second;
43  int detId = (*j).first.rawId();
44 
45  const CSCLayer *layer = findLayer(detId);
46  int chamberType = layer->chamber()->specs()->chamberType();
47  int nDigis = endDigi - beginDigi;
48  nDigisPerEvent += nDigis;
49  theNDigisPerLayerPlots[chamberType - 1]->Fill(nDigis);
50 
51  for (std::vector<CSCWireDigi>::const_iterator digiItr = beginDigi; digiItr != endDigi; ++digiItr) {
52  theTimeBinPlots[chamberType - 1]->Fill(digiItr->getTimeBin());
53  }
54 
55  if (doSim_) {
57  if (nDigis == 1 && simHits.size() == 1) {
58  plotResolution(simHits[0], *beginDigi, layer, chamberType);
59  }
60  }
61  }
62 
63  theNDigisPerEventPlot->Fill(nDigisPerEvent);
64 }
65 
67  const CSCWireDigi &digi,
68  const CSCLayer *layer,
69  int chamberType) {
70  double hitX = hit.localPosition().x();
71  double hitY = hit.localPosition().y();
72  double digiY = layer->geometry()->yOfWireGroup(digi.getWireGroup(), hitX);
73  theResolutionPlots[chamberType - 1]->Fill(digiY - hitY);
74 }
CSCWireDigiValidation::doSim_
bool doSim_
Definition: CSCWireDigiValidation.h:21
CSCWireDigiValidation::theResolutionPlots
MonitorElement * theResolutionPlots[10]
Definition: CSCWireDigiValidation.h:24
Handle.h
CSCWireDigiValidation::CSCWireDigiValidation
CSCWireDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC, bool doSim)
Definition: CSCWireDigiValidation.cc:9
mps_fire.i
i
Definition: mps_fire.py:355
MessageLogger.h
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
cscDigiValidation_cfi.doSim
doSim
Definition: cscDigiValidation_cfi.py:12
CSCLayer::chamber
const CSCChamber * chamber() const
Definition: CSCLayer.h:49
CSCWireDigi::getWireGroup
int getWireGroup() const
default
Definition: CSCWireDigi.h:22
DigiDM_cff.wires
wires
Definition: DigiDM_cff.py:33
CSCChamberSpecs::chamberType
int chamberType() const
Definition: CSCChamberSpecs.cc:154
CSCBaseValidation::theInputTag
edm::InputTag theInputTag
Definition: CSCBaseValidation.h:28
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:29
CSCWireDigiValidation::~CSCWireDigiValidation
~CSCWireDigiValidation() override
Definition: CSCWireDigiValidation.cc:14
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
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
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
CSCBaseValidation::theSimHitMap
const PSimHitMap * theSimHitMap
Definition: CSCBaseValidation.h:29
edm::LogError
Definition: MessageLogger.h:183
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:57
CSCChamber::specs
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:39
CSCWireDigiCollection
CSCWireDigiValidation::theNDigisPerEventPlot
MonitorElement * theNDigisPerEventPlot
Definition: CSCWireDigiValidation.h:25
PSimHitMap::hits
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:19
CSCWireDigiValidation::theNDigisPerLayerPlots
MonitorElement * theNDigisPerLayerPlots[10]
Definition: CSCWireDigiValidation.h:23
dqm::implementation::IBooker
Definition: DQMStore.h:43
CSCBaseValidation
Definition: CSCBaseValidation.h:15
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
CSCLayerGeometry::yOfWireGroup
float yOfWireGroup(int wireGroup, float x=0.) const
Definition: CSCLayerGeometry.h:201
PSimHit
Definition: PSimHit.h:15
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
DigiContainerIterator
Definition: MuonDigiCollection.h:30
edm::Event
Definition: Event.h:73
CSCWireDigiValidation::plotResolution
void plotResolution(const PSimHit &hit, const CSCWireDigi &digi, const CSCLayer *layer, int chamberType)
Definition: CSCWireDigiValidation.cc:66
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
CSCWireDigiValidation::bookHistograms
void bookHistograms(DQMStore::IBooker &)
Definition: CSCWireDigiValidation.cc:16
hit
Definition: SiStripHitEffFromCalibTree.cc:88
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