CMS 3D CMS Logo

RPCValidHistograms.cc
Go to the documentation of this file.
2 
3 #include "TAxis.h"
4 
6  if (booked_) {
7  edm::LogError("RPCValidHistograms") << "Histogram is already booked\n";
8  return;
9  }
10 
11  const std::string pwd = booker.pwd();
12  booker.setCurrentFolder(subDir);
13 
14  // Book histograms
15  booker.setCurrentFolder(subDir + "/HitProperty");
16  clusterSize = booker.book1D("ClusterSize", "Cluster size;Cluster size", 11, -0.5, 10.5);
17  clusterSizeBarrel = booker.book1D("ClusterSizeBarrel", "Cluster size in Barrel;Cluster size", 11, -0.5, 10.5);
18  clusterSizeEndcap = booker.book1D("ClusterSizeEndcap", "Cluster size in Endcap;Cluster size", 11, -0.5, 10.5);
19 
20  avgClusterSize = booker.book1D("AverageClusterSize", "Average cluster size;Average clsuter size", 11, -0.5, 10.5);
22  booker.book1D("AverageClusterSizeBarrel", "Average cluster size in Barrel;Average clsuter size", 11, -0.5, 10.5);
24  booker.book1D("AverageClusterSizeEndcap", "Average cluster size in Endcap;Average clsuter size", 11, -0.5, 10.5);
25 
27  booker.book1D("NRecHitBarrel", "Number of RPC recHits per event in Barrel;Number of RPC hits", 25, 0, 25);
29  booker.book1D("NRecHitEndcap", "Number of RPC recHits per event in Endcap;Number of RPC hits", 25, 0, 25);
30 
32  booker.book1D("NRefHitBarrel", "Number of reference hits per event in Barrel;Number of RPC hits", 25, 0, 25);
34  booker.book1D("NRefHitEndcap", "Number of reference hits per event in Endcap;Number of RPC hits", 25, 0, 25);
35 
36  nMatchHitBarrel = booker.book1D(
37  "nMatchBarrel", "Number of matched reference hits per event in Barrel;Number of RPC hits", 25, 0, 25);
38  nMatchHitEndcap = booker.book1D(
39  "nMatchEndcap", "Number of matched reference hits per event in Endcap;Number of RPC hits", 25, 0, 25);
40 
41  timeBarrel = booker.book1D("RecHitTimeBarrel", "RecHit time in Barrel;Time (ns)", 100, -12.5, 12.5);
42  timeEndcap = booker.book1D("RecHitTimeEndcap", "RecHit time in Endcap;Time (ns)", 100, -12.5, 12.5);
43  timeIRPC = booker.book1D("RecHitTimeIRPC", "RecHit time of iRPC;Time (ns)", 100, -12.5, 12.5);
44  timeCRPC = booker.book1D("RecHitTimeCPRC", "RecHit time in current RPC;Time (ns)", 100, -12.5, 12.5);
45 
46  clusterSize->getTH1()->SetMinimum(0);
47  clusterSizeBarrel->getTH1()->SetMinimum(0);
48  clusterSizeEndcap->getTH1()->SetMinimum(0);
49 
50  avgClusterSize->getTH1()->SetMinimum(0);
51  avgClusterSizeBarrel->getTH1()->SetMinimum(0);
52  avgClusterSizeEndcap->getTH1()->SetMinimum(0);
53 
54  nRecHitBarrel->getTH1()->SetMinimum(0);
55  nRecHitEndcap->getTH1()->SetMinimum(0);
56 
57  nRefHitBarrel->getTH1()->SetMinimum(0);
58  nRefHitEndcap->getTH1()->SetMinimum(0);
59 
60  nMatchHitBarrel->getTH1()->SetMinimum(0);
61  nMatchHitEndcap->getTH1()->SetMinimum(0);
62 
63  // Occupancy 1D
64  booker.setCurrentFolder(subDir + "/Occupancy");
65  refHitOccupancyBarrel_wheel = booker.book1D("RefHitOccupancyBarrel_wheel", "Reference Hit occupancy", 5, -2.5, 2.5);
66  refHitOccupancyEndcap_disk = booker.book1D("RefHitOccupancyEndcap_disk", "Reference Hit occupancy", 9, -4.5, 4.5);
68  booker.book1D("RefHitOccupancyBarrel_station", "Reference Hit occupancy", 4, 0.5, 4.5);
69 
70  recHitOccupancyBarrel_wheel = booker.book1D("RecHitOccupancyBarrel_wheel", "RecHit occupancy", 5, -2.5, 2.5);
71  recHitOccupancyEndcap_disk = booker.book1D("RecHitOccupancyEndcap_disk", "RecHit occupancy", 9, -4.5, 4.5);
72  recHitOccupancyBarrel_station = booker.book1D("RecHitOccupancyBarrel_station", "RecHit occupancy", 4, 0.5, 4.5);
73 
74  matchOccupancyBarrel_wheel = booker.book1D("MatchOccupancyBarrel_wheel", "Matched hit occupancy", 5, -2.5, 2.5);
75  matchOccupancyEndcap_disk = booker.book1D("MatchOccupancyEndcap_disk", "Matched hit occupancy", 9, -4.5, 4.5);
76  matchOccupancyBarrel_station = booker.book1D("MatchOccupancyBarrel_station", "Matched hit occupancy", 4, 0.5, 4.5);
77 
78  refHitOccupancyBarrel_wheel->getTH1()->SetMinimum(0);
79  refHitOccupancyEndcap_disk->getTH1()->SetMinimum(0);
80  refHitOccupancyBarrel_station->getTH1()->SetMinimum(0);
81 
82  recHitOccupancyBarrel_wheel->getTH1()->SetMinimum(0);
83  recHitOccupancyEndcap_disk->getTH1()->SetMinimum(0);
84  recHitOccupancyBarrel_station->getTH1()->SetMinimum(0);
85 
86  matchOccupancyBarrel_wheel->getTH1()->SetMinimum(0);
87  matchOccupancyEndcap_disk->getTH1()->SetMinimum(0);
88  matchOccupancyBarrel_station->getTH1()->SetMinimum(0);
89 
90  // Occupancy 2D
92  booker.book2D("RefHitOccupancyBarrel_wheel_station", "Reference hit occupancy", 5, -2.5, 2.5, 4, 0.5, 4.5);
94  booker.book2D("RefHitOccupancyEndcap_disk_ring", "Reference hit occupancy", 9, -4.5, 4.5, 4, 0.5, 4.5);
95 
97  booker.book2D("RecHitOccupancyBarrel_wheel_station", "RecHit occupancy", 5, -2.5, 2.5, 4, 0.5, 4.5);
99  booker.book2D("RecHitOccupancyEndcap_disk_ring", "RecHit occupancy", 9, -4.5, 4.5, 4, 0.5, 4.5);
100 
102  booker.book2D("MatchOccupancyBarrel_wheel_station", "Matched hit occupancy", 5, -2.5, 2.5, 4, 0.5, 4.5);
104  booker.book2D("MatchOccupancyEndcap_disk_ring", "Matched hit occupancy", 9, -4.5, 4.5, 4, 0.5, 4.5);
105 
107  refHitOccupancyEndcap_disk_ring->getTH2F()->SetMinimum(0);
108 
110  recHitOccupancyEndcap_disk_ring->getTH2F()->SetMinimum(0);
111 
113  matchOccupancyEndcap_disk_ring->getTH2F()->SetMinimum(0);
114 
115  // Residuals
116  booker.setCurrentFolder(subDir + "/Residual");
117  resBarrel = booker.book1D("ResBarrel", "Global Residuals for Barrel;Residual [cm]", 100, -8, 8);
118  resEndcap = booker.book1D("ResEndcap", "Global Residuals for Endcap;Residual [cm]", 100, -8, 8);
119 
120  resBarrel->getTH1()->SetMinimum(0);
121  resEndcap->getTH1()->SetMinimum(0);
122 
123  res_wheel_res = booker.book2D("Res_wheel_res", "Residuals vs Wheel;;Residual [cm]", 5, -2.5, 2.5, 50, -8, 8);
124  res_disk_res = booker.book2D("Res_disk_res", "Residuals vs Disk;;Residual [cm]", 9, -4.5, 4.5, 50, -8, 8);
125  res_station_res = booker.book2D("Res_station_res", "Redisuals vs Station;;Residual [cm]", 4, 0.5, 4.5, 50, -8, 8);
126  res_ring_res = booker.book2D("Res_ring_res", "Redisuals vs Ring;;Residual [cm]", 4, 0.5, 4.5, 50, -8, 8);
127 
128  res_wheel_res->getTH2F()->SetMinimum(0);
129  res_disk_res->getTH2F()->SetMinimum(0);
130  res_station_res->getTH2F()->SetMinimum(0);
131  res_ring_res->getTH2F()->SetMinimum(0);
132 
133  // Pulls
134  pullBarrel = booker.book1D("PullBarrel", "Global Pull for Barrel;Pull", 100, -3, 3);
135  pullEndcap = booker.book1D("PullEndcap", "Global Pull for Endcap;Pull", 100, -3, 3);
136 
137  pullBarrel->getTH1()->SetMinimum(0);
138  pullEndcap->getTH1()->SetMinimum(0);
139 
140  pull_wheel_pull = booker.book2D("Pull_wheel_pull", "Pull vs Wheel;;Pull", 5, -2.5, 2.5, 50, -3, 3);
141  pull_disk_pull = booker.book2D("Pull_disk_pull", "Pull vs Disk;;Pull", 9, -4.5, 4.5, 50, -3, 3);
142  pull_station_pull = booker.book2D("Pull_station_pull", "Pull vs Station;;Pull", 4, 0.5, 4.5, 50, -3, 3);
143  pull_ring_pull = booker.book2D("Pull_ring_pull", "Pull vs Ring;;Pull", 4, 0.5, 4.5, 50, -3, 3);
144 
145  pull_wheel_pull->getTH2F()->SetMinimum(0);
146  pull_disk_pull->getTH2F()->SetMinimum(0);
147  pull_station_pull->getTH2F()->SetMinimum(0);
148  pull_ring_pull->getTH2F()->SetMinimum(0);
149 
150  // Set plot options
151  refHitOccupancyBarrel_wheel_station->getTH2F()->SetOption("COLZ");
152  refHitOccupancyEndcap_disk_ring->getTH2F()->SetOption("COLZ");
153  recHitOccupancyBarrel_wheel_station->getTH2F()->SetOption("COLZ");
154  recHitOccupancyEndcap_disk_ring->getTH2F()->SetOption("COLZ");
155  matchOccupancyBarrel_wheel_station->getTH2F()->SetOption("COLZ");
156  matchOccupancyEndcap_disk_ring->getTH2F()->SetOption("COLZ");
157 
158  res_wheel_res->getTH2F()->SetOption("COLZ");
159  res_disk_res->getTH2F()->SetOption("COLZ");
160  res_station_res->getTH2F()->SetOption("COLZ");
161  res_ring_res->getTH2F()->SetOption("COLZ");
162 
163  pull_wheel_pull->getTH2F()->SetOption("COLZ");
164  pull_disk_pull->getTH2F()->SetOption("COLZ");
165  pull_station_pull->getTH2F()->SetOption("COLZ");
166  pull_ring_pull->getTH2F()->SetOption("COLZ");
167 
168  refHitOccupancyBarrel_wheel_station->getTH2F()->SetContour(10);
169  refHitOccupancyEndcap_disk_ring->getTH2F()->SetContour(10);
170  recHitOccupancyBarrel_wheel_station->getTH2F()->SetContour(10);
171  recHitOccupancyEndcap_disk_ring->getTH2F()->SetContour(10);
172  matchOccupancyBarrel_wheel_station->getTH2F()->SetContour(10);
173  matchOccupancyEndcap_disk_ring->getTH2F()->SetContour(10);
174 
175  res_wheel_res->getTH2F()->SetContour(10);
176  res_disk_res->getTH2F()->SetContour(10);
177  res_station_res->getTH2F()->SetContour(10);
178  res_ring_res->getTH2F()->SetContour(10);
179 
180  pull_wheel_pull->getTH2F()->SetContour(10);
181  pull_disk_pull->getTH2F()->SetContour(10);
182  pull_station_pull->getTH2F()->SetContour(10);
183  pull_ring_pull->getTH2F()->SetContour(10);
184 
185  refHitOccupancyBarrel_wheel_station->getTH2F()->SetStats(false);
186  refHitOccupancyEndcap_disk_ring->getTH2F()->SetStats(false);
187  recHitOccupancyBarrel_wheel_station->getTH2F()->SetStats(false);
188  recHitOccupancyEndcap_disk_ring->getTH2F()->SetStats(false);
189  matchOccupancyBarrel_wheel_station->getTH2F()->SetStats(false);
190  matchOccupancyEndcap_disk_ring->getTH2F()->SetStats(false);
191 
192  res_wheel_res->getTH2F()->SetStats(false);
193  res_disk_res->getTH2F()->SetStats(false);
194  res_station_res->getTH2F()->SetStats(false);
195  res_ring_res->getTH2F()->SetStats(false);
196 
197  pull_wheel_pull->getTH2F()->SetStats(false);
198  pull_disk_pull->getTH2F()->SetStats(false);
199  pull_station_pull->getTH2F()->SetStats(false);
200  pull_ring_pull->getTH2F()->SetStats(false);
201 
202  // Set bin labels
203  for (int i = 1; i <= 5; ++i) {
204  TString binLabel = Form("Wheel %d", i - 3);
205 
206  refHitOccupancyBarrel_wheel->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
207  recHitOccupancyBarrel_wheel->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
208  matchOccupancyBarrel_wheel->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
209 
210  refHitOccupancyBarrel_wheel_station->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
211  recHitOccupancyBarrel_wheel_station->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
212  matchOccupancyBarrel_wheel_station->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
213 
214  res_wheel_res->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
215  pull_wheel_pull->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
216  }
217 
218  for (int i = 1; i <= 9; ++i) {
219  TString binLabel = Form("Disk %d", i - 5);
220 
221  refHitOccupancyEndcap_disk->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
222  recHitOccupancyEndcap_disk->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
223  matchOccupancyEndcap_disk->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
224 
225  refHitOccupancyEndcap_disk_ring->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
226  recHitOccupancyEndcap_disk_ring->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
227  matchOccupancyEndcap_disk_ring->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
228 
229  res_disk_res->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
230  pull_disk_pull->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
231  }
232 
233  for (int i = 1; i <= 4; ++i) {
234  TString binLabel = Form("Station %d", i);
235 
236  refHitOccupancyBarrel_station->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
237  recHitOccupancyBarrel_station->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
238  matchOccupancyBarrel_station->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
239 
240  refHitOccupancyBarrel_wheel_station->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
241  recHitOccupancyBarrel_wheel_station->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
242  matchOccupancyBarrel_wheel_station->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
243 
244  res_station_res->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
245  pull_station_pull->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
246  }
247 
248  for (int i = 1; i <= 4; ++i) {
249  TString binLabel = Form("Ring %d", i);
250 
251  refHitOccupancyEndcap_disk_ring->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
252  recHitOccupancyEndcap_disk_ring->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
253  matchOccupancyEndcap_disk_ring->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
254  }
255 
256  booked_ = true;
257 
258  booker.setCurrentFolder(pwd);
259 }
RPCValidHistograms::refHitOccupancyBarrel_wheel_station
MEP refHitOccupancyBarrel_wheel_station
Definition: RPCValidHistograms.h:37
RPCValidHistograms::res_ring_res
MEP res_ring_res
Definition: RPCValidHistograms.h:43
mps_fire.i
i
Definition: mps_fire.py:428
alignCSCRings.pwd
pwd
Definition: alignCSCRings.py:57
RPCValidHistograms::refHitOccupancyEndcap_disk
MEP refHitOccupancyEndcap_disk
Definition: RPCValidHistograms.h:32
RPCValidHistograms::refHitOccupancyBarrel_wheel
MEP refHitOccupancyBarrel_wheel
Definition: RPCValidHistograms.h:32
RPCValidHistograms::recHitOccupancyBarrel_wheel_station
MEP recHitOccupancyBarrel_wheel_station
Definition: RPCValidHistograms.h:38
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
RPCValidHistograms::resEndcap
MEP resEndcap
Definition: RPCValidHistograms.h:42
RPCValidHistograms.h
RPCValidHistograms::timeEndcap
MEP timeEndcap
Definition: RPCValidHistograms.h:29
RPCValidHistograms::booked_
bool booked_
Definition: RPCValidHistograms.h:50
RPCValidHistograms::pull_station_pull
MEP pull_station_pull
Definition: RPCValidHistograms.h:47
RPCValidHistograms::pull_disk_pull
MEP pull_disk_pull
Definition: RPCValidHistograms.h:47
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:478
PostProcessorHcalIsoTrack_cfi.subDir
subDir
Definition: PostProcessorHcalIsoTrack_cfi.py:5
RPCValidHistograms::matchOccupancyBarrel_wheel
MEP matchOccupancyBarrel_wheel
Definition: RPCValidHistograms.h:34
RPCValidHistograms::bookHistograms
void bookHistograms(DQMStore::IBooker &booker, const std::string &subDir)
Definition: RPCValidHistograms.cc:5
RPCValidHistograms::timeCRPC
MEP timeCRPC
Definition: RPCValidHistograms.h:29
RPCValidHistograms::avgClusterSizeEndcap
MEP avgClusterSizeEndcap
Definition: RPCValidHistograms.h:23
RPCValidHistograms::res_station_res
MEP res_station_res
Definition: RPCValidHistograms.h:43
RPCValidHistograms::recHitOccupancyBarrel_station
MEP recHitOccupancyBarrel_station
Definition: RPCValidHistograms.h:33
RPCValidHistograms::clusterSize
MEP clusterSize
Definition: RPCValidHistograms.h:22
RPCValidHistograms::nRecHitEndcap
MEP nRecHitEndcap
Definition: RPCValidHistograms.h:26
dqm::implementation::NavigatorBase::pwd
virtual std::string pwd()
Definition: DQMStore.cc:16
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:474
RPCValidHistograms::resBarrel
MEP resBarrel
Definition: RPCValidHistograms.h:42
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RPCValidHistograms::nMatchHitEndcap
MEP nMatchHitEndcap
Definition: RPCValidHistograms.h:27
RPCValidHistograms::matchOccupancyBarrel_station
MEP matchOccupancyBarrel_station
Definition: RPCValidHistograms.h:34
RPCValidHistograms::timeIRPC
MEP timeIRPC
Definition: RPCValidHistograms.h:29
RPCValidHistograms::matchOccupancyBarrel_wheel_station
MEP matchOccupancyBarrel_wheel_station
Definition: RPCValidHistograms.h:39
RPCValidHistograms::avgClusterSizeBarrel
MEP avgClusterSizeBarrel
Definition: RPCValidHistograms.h:23
RPCValidHistograms::res_disk_res
MEP res_disk_res
Definition: RPCValidHistograms.h:43
RPCValidHistograms::pullBarrel
MEP pullBarrel
Definition: RPCValidHistograms.h:46
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
RPCValidHistograms::pullEndcap
MEP pullEndcap
Definition: RPCValidHistograms.h:46
RPCValidHistograms::matchOccupancyEndcap_disk_ring
MEP matchOccupancyEndcap_disk_ring
Definition: RPCValidHistograms.h:39
RPCValidHistograms::recHitOccupancyEndcap_disk
MEP recHitOccupancyEndcap_disk
Definition: RPCValidHistograms.h:33
RPCValidHistograms::recHitOccupancyEndcap_disk_ring
MEP recHitOccupancyEndcap_disk_ring
Definition: RPCValidHistograms.h:38
RPCValidHistograms::avgClusterSize
MEP avgClusterSize
Definition: RPCValidHistograms.h:23
RPCValidHistograms::res_wheel_res
MEP res_wheel_res
Definition: RPCValidHistograms.h:43
RPCValidHistograms::refHitOccupancyEndcap_disk_ring
MEP refHitOccupancyEndcap_disk_ring
Definition: RPCValidHistograms.h:37
RPCValidHistograms::nRefHitEndcap
MEP nRefHitEndcap
Definition: RPCValidHistograms.h:25
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
RPCValidHistograms::matchOccupancyEndcap_disk
MEP matchOccupancyEndcap_disk
Definition: RPCValidHistograms.h:34
RPCValidHistograms::refHitOccupancyBarrel_station
MEP refHitOccupancyBarrel_station
Definition: RPCValidHistograms.h:32
RPCValidHistograms::recHitOccupancyBarrel_wheel
MEP recHitOccupancyBarrel_wheel
Definition: RPCValidHistograms.h:33
RPCValidHistograms::pull_wheel_pull
MEP pull_wheel_pull
Definition: RPCValidHistograms.h:47
RPCValidHistograms::nMatchHitBarrel
MEP nMatchHitBarrel
Definition: RPCValidHistograms.h:27
dqm::implementation::IBooker
Definition: DQMStore.h:43
RPCValidHistograms::nRecHitBarrel
MEP nRecHitBarrel
Definition: RPCValidHistograms.h:26
RPCValidHistograms::pull_ring_pull
MEP pull_ring_pull
Definition: RPCValidHistograms.h:47
RPCValidHistograms::timeBarrel
MEP timeBarrel
Definition: RPCValidHistograms.h:29
RPCValidHistograms::nRefHitBarrel
MEP nRefHitBarrel
Definition: RPCValidHistograms.h:25
RPCValidHistograms::clusterSizeEndcap
MEP clusterSizeEndcap
Definition: RPCValidHistograms.h:22
RPCValidHistograms::clusterSizeBarrel
MEP clusterSizeBarrel
Definition: RPCValidHistograms.h:22
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
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:490