CMS 3D CMS Logo

CSCOfflineMonitor.cc
Go to the documentation of this file.
1 /*
2  * Offline DQM module for CSC local reconstruction - based on CSCValidation
3  *
4  */
5 
7 
8 using namespace std;
9 
11 // CONSTRUCTOR //
14  rd_token = consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("FEDRawDataCollectionTag"));
15  sd_token = consumes<CSCStripDigiCollection>(pset.getParameter<edm::InputTag>("stripDigiTag"));
16  wd_token = consumes<CSCWireDigiCollection>(pset.getParameter<edm::InputTag>("wireDigiTag"));
17  al_token = consumes<CSCALCTDigiCollection>(pset.getParameter<edm::InputTag>("alctDigiTag"));
18  cl_token = consumes<CSCCLCTDigiCollection>(pset.getParameter<edm::InputTag>("clctDigiTag"));
19  rh_token = consumes<CSCRecHit2DCollection>(pset.getParameter<edm::InputTag>("cscRecHitTag"));
20  se_token = consumes<CSCSegmentCollection>(pset.getParameter<edm::InputTag>("cscSegTag"));
21 }
22 
24  edm::Run const& iRun,
25  edm::EventSetup const& /* iSetup */) {
26  // occupancies
27  ibooker.cd();
28  ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/Occupancy");
29 
30  hCSCOccupancy = ibooker.book1D("hCSCOccupancy", "overall CSC occupancy", 13, -0.5, 12.5);
31  hCSCOccupancy->setBinLabel(2, "Total Events");
32  hCSCOccupancy->setBinLabel(4, "# Events with Wires");
33  hCSCOccupancy->setBinLabel(6, "# Events with Strips");
34  hCSCOccupancy->setBinLabel(8, "# Events with Wires&Strips");
35  hCSCOccupancy->setBinLabel(10, "# Events with Rechits");
36  hCSCOccupancy->setBinLabel(12, "# Events with Segments");
37  hOWiresAndCLCT = ibooker.book2D("hOWiresAndCLCT", "Wire and CLCT Digi Occupancy ", 36, 0.5, 36.5, 20, 0.5, 20.5);
38  hOWires = ibooker.book2D("hOWires", "Wire Digi Occupancy", 36, 0.5, 36.5, 20, 0.5, 20.5);
39  hOWireSerial = ibooker.book1D("hOWireSerial", "Wire Occupancy by Chamber Serial", 601, -0.5, 600.5);
40  hOWireSerial->setAxisTitle("Chamber Serial Number");
41  hOStrips = ibooker.book2D("hOStrips", "Strip Digi Occupancy", 36, 0.5, 36.5, 20, 0.5, 20.5);
42  hOStripSerial = ibooker.book1D("hOStripSerial", "Strip Occupancy by Chamber Serial", 601, -0.5, 600.5);
43  hOStripSerial->setAxisTitle("Chamber Serial Number");
44  hOStripsAndWiresAndCLCT =
45  ibooker.book2D("hOStripsAndWiresAndCLCT", "Strip And Wire And CLCT Digi Occupancy", 36, 0.5, 36.5, 20, 0.5, 20.5);
46  hOStripsAndWiresAndCLCT->setAxisTitle("Chamber #");
47  hORecHits = ibooker.book2D("hORecHits", "RecHit Occupancy", 36, 0.5, 36.5, 20, 0.5, 20.5);
48  hORecHitsSerial = ibooker.book1D("hORecHitSerial", "RecHit Occupancy by Chamber Serial", 601, -0.5, 600.5);
49  hORecHitsSerial->setAxisTitle("Chamber Serial Number");
50  hOSegments = ibooker.book2D("hOSegments", "Segment Occupancy", 36, 0.5, 36.5, 20, 0.5, 20.5);
51  hOSegmentsSerial = ibooker.book1D("hOSegmentSerial", "Segment Occupancy by Chamber Serial", 601, -0.5, 600.5);
52  hOSegmentsSerial->setAxisTitle("Chamber Serial Number");
53 
54  // wire digis
55  ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/Digis");
56 
57  hWirenGroupsTotal =
58  ibooker.book1D("hWirenGroupsTotal", "Fired Wires per Event; # Wiregroups Fired", 500, -0.5, 499.5);
59  hWireTBin.push_back(ibooker.book1D("hWireTBin_m42", "Wire TBin Fired (ME -4/2); Time Bin (25ns)", 17, -0.5, 16.5));
60  hWireTBin.push_back(ibooker.book1D("hWireTBin_m41", "Wire TBin Fired (ME -4/1); Time Bin (25ns)", 17, -0.5, 16.5));
61  hWireTBin.push_back(ibooker.book1D("hWireTBin_m32", "Wire TBin Fired (ME -3/2); Time Bin (25ns)", 17, -0.5, 16.5));
62  hWireTBin.push_back(ibooker.book1D("hWireTBin_m31", "Wire TBin Fired (ME -3/1); Time Bin (25ns)", 17, -0.5, 16.5));
63  hWireTBin.push_back(ibooker.book1D("hWireTBin_m22", "Wire TBin Fired (ME -2/2); Time Bin (25ns)", 17, -0.5, 16.5));
64  hWireTBin.push_back(ibooker.book1D("hWireTBin_m21", "Wire TBin Fired (ME -2/1); Time Bin (25ns)", 17, -0.5, 16.5));
65  hWireTBin.push_back(ibooker.book1D("hWireTBin_m11a", "Wire TBin Fired (ME -1/1a); Time Bin (25ns)", 17, -0.5, 16.5));
66  hWireTBin.push_back(ibooker.book1D("hWireTBin_m13", "Wire TBin Fired (ME -1/3); Time Bin (25ns)", 17, -0.5, 16.5));
67  hWireTBin.push_back(ibooker.book1D("hWireTBin_m12", "Wire TBin Fired (ME -1/2); Time Bin (25ns)", 17, -0.5, 16.5));
68  hWireTBin.push_back(ibooker.book1D("hWireTBin_m11b", "Wire TBin Fired (ME -1/1b); Time Bin (25ns)", 17, -0.5, 16.5));
69  hWireTBin.push_back(ibooker.book1D("hWireTBin_p11b", "Wire TBin Fired (ME +1/1b); Time Bin (25ns)", 17, -0.5, 16.5));
70  hWireTBin.push_back(ibooker.book1D("hWireTBin_p12", "Wire TBin Fired (ME +1/2); Time Bin (25ns)", 17, -0.5, 16.5));
71  hWireTBin.push_back(ibooker.book1D("hWireTBin_p13", "Wire TBin Fired (ME +1/3); Time Bin (25ns)", 17, -0.5, 16.5));
72  hWireTBin.push_back(ibooker.book1D("hWireTBin_p11a", "Wire TBin Fired (ME +1/1a); Time Bin (25ns)", 17, -0.5, 16.5));
73  hWireTBin.push_back(ibooker.book1D("hWireTBin_p21", "Wire TBin Fired (ME +2/1); Time Bin (25ns)", 17, -0.5, 16.5));
74  hWireTBin.push_back(ibooker.book1D("hWireTBin_p22", "Wire TBin Fired (ME +2/2); Time Bin (25ns)", 17, -0.5, 16.5));
75  hWireTBin.push_back(ibooker.book1D("hWireTBin_p31", "Wire TBin Fired (ME +3/1); Time Bin (25ns)", 17, -0.5, 16.5));
76  hWireTBin.push_back(ibooker.book1D("hWireTBin_p32", "Wire TBin Fired (ME +3/2); Time Bin (25ns)", 17, -0.5, 16.5));
77  hWireTBin.push_back(ibooker.book1D("hWireTBin_p41", "Wire TBin Fired (ME +4/1); Time Bin (25ns)", 17, -0.5, 16.5));
78  hWireTBin.push_back(ibooker.book1D("hWireTBin_p42", "Wire TBin Fired (ME +4/2); Time Bin (25ns)", 17, -0.5, 16.5));
79  hWireNumber.push_back(
80  ibooker.book1D("hWireNumber_m42", "Wiregroup Number Fired (ME -4/2); Wiregroup #", 113, -0.5, 112.5));
81  hWireNumber.push_back(
82  ibooker.book1D("hWireNumber_m41", "Wiregroup Number Fired (ME -4/1); Wiregroup #", 113, -0.5, 112.5));
83  hWireNumber.push_back(
84  ibooker.book1D("hWireNumber_m32", "Wiregroup Number Fired (ME -3/2); Wiregroup #", 113, -0.5, 112.5));
85  hWireNumber.push_back(
86  ibooker.book1D("hWireNumber_m31", "Wiregroup Number Fired (ME -3/1); Wiregroup #", 113, -0.5, 112.5));
87  hWireNumber.push_back(
88  ibooker.book1D("hWireNumber_m22", "Wiregroup Number Fired (ME -2/2); Wiregroup #", 113, -0.5, 112.5));
89  hWireNumber.push_back(
90  ibooker.book1D("hWireNumber_m21", "Wiregroup Number Fired (ME -2/1); Wiregroup #", 113, -0.5, 112.5));
91  hWireNumber.push_back(
92  ibooker.book1D("hWireNumber_m11a", "Wiregroup Number Fired (ME -1/1a); Wiregroup #", 113, -0.5, 112.5));
93  hWireNumber.push_back(
94  ibooker.book1D("hWireNumber_m13", "Wiregroup Number Fired (ME -1/3); Wiregroup #", 113, -0.5, 112.5));
95  hWireNumber.push_back(
96  ibooker.book1D("hWireNumber_m12", "Wiregroup Number Fired (ME -1/2); Wiregroup #", 113, -0.5, 112.5));
97  hWireNumber.push_back(
98  ibooker.book1D("hWireNumber_m11b", "Wiregroup Number Fired (ME -1/1b); Wiregroup #", 113, -0.5, 112.5));
99  hWireNumber.push_back(
100  ibooker.book1D("hWireNumber_p11b", "Wiregroup Number Fired (ME +1/1b); Wiregroup #", 113, -0.5, 112.5));
101  hWireNumber.push_back(
102  ibooker.book1D("hWireNumber_p12", "Wiregroup Number Fired (ME +1/2); Wiregroup #", 113, -0.5, 112.5));
103  hWireNumber.push_back(
104  ibooker.book1D("hWireNumber_p13", "Wiregroup Number Fired (ME +1/3); Wiregroup #", 113, -0.5, 112.5));
105  hWireNumber.push_back(
106  ibooker.book1D("hWireNumber_p11a", "Wiregroup Number Fired (ME +1/1a); Wiregroup #", 113, -0.5, 112.5));
107  hWireNumber.push_back(
108  ibooker.book1D("hWireNumber_p21", "Wiregroup Number Fired (ME +2/1); Wiregroup #", 113, -0.5, 112.5));
109  hWireNumber.push_back(
110  ibooker.book1D("hWireNumber_p22", "Wiregroup Number Fired (ME +2/2); Wiregroup #", 113, -0.5, 112.5));
111  hWireNumber.push_back(
112  ibooker.book1D("hWireNumber_p31", "Wiregroup Number Fired (ME +3/1); Wiregroup #", 113, -0.5, 112.5));
113  hWireNumber.push_back(
114  ibooker.book1D("hWireNumber_p32", "Wiregroup Number Fired (ME +3/2); Wiregroup #", 113, -0.5, 112.5));
115  hWireNumber.push_back(
116  ibooker.book1D("hWireNumber_p41", "Wiregroup Number Fired (ME +4/1); Wiregroup #", 113, -0.5, 112.5));
117  hWireNumber.push_back(
118  ibooker.book1D("hWireNumber_p42", "Wiregroup Number Fired (ME +4/2); Wiregroup #", 113, -0.5, 112.5));
119 
120  // strip digis
121  hStripNFired =
122  ibooker.book1D("hStripNFired", "Fired Strips per Event; # Strips Fired (above 13 ADC)", 1000, -0.5, 999.5);
123  hStripNumber.push_back(
124  ibooker.book1D("hStripNumber_m42", "Strip Number Fired (ME -4/2); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
125  hStripNumber.push_back(
126  ibooker.book1D("hStripNumber_m41", "Strip Number Fired (ME -4/1); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
127  hStripNumber.push_back(
128  ibooker.book1D("hStripNumber_m32", "Strip Number Fired (ME -3/2); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
129  hStripNumber.push_back(
130  ibooker.book1D("hStripNumber_m31", "Strip Number Fired (ME -3/1); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
131  hStripNumber.push_back(
132  ibooker.book1D("hStripNumber_m22", "Strip Number Fired (ME -2/2); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
133  hStripNumber.push_back(
134  ibooker.book1D("hStripNumber_m21", "Strip Number Fired (ME -2/1); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
135  hStripNumber.push_back(ibooker.book1D(
136  "hStripNumber_m11a", "Strip Number Fired (ME -1/1a); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
137  hStripNumber.push_back(
138  ibooker.book1D("hStripNumber_m13", "Strip Number Fired (ME -1/3); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
139  hStripNumber.push_back(
140  ibooker.book1D("hStripNumber_m12", "Strip Number Fired (ME -1/2); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
141  hStripNumber.push_back(ibooker.book1D(
142  "hStripNumber_m11b", "Strip Number Fired (ME -1/1b); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
143  hStripNumber.push_back(ibooker.book1D(
144  "hStripNumber_p11b", "Strip Number Fired (ME +1/1b); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
145  hStripNumber.push_back(
146  ibooker.book1D("hStripNumber_p12", "Strip Number Fired (ME +1/2); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
147  hStripNumber.push_back(
148  ibooker.book1D("hStripNumber_p13", "Strip Number Fired (ME +1/3); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
149  hStripNumber.push_back(ibooker.book1D(
150  "hStripNumber_p11a", "Strip Number Fired (ME +1/1a); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
151  hStripNumber.push_back(
152  ibooker.book1D("hStripNumber_p21", "Strip Number Fired (ME +2/1); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
153  hStripNumber.push_back(
154  ibooker.book1D("hStripNumber_p22", "Strip Number Fired (ME +2/2); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
155  hStripNumber.push_back(
156  ibooker.book1D("hStripNumber_p31", "Strip Number Fired (ME +3/1); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
157  hStripNumber.push_back(
158  ibooker.book1D("hStripNumber_p32", "Strip Number Fired (ME +3/2); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
159  hStripNumber.push_back(
160  ibooker.book1D("hStripNumber_p41", "Strip Number Fired (ME +4/1); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
161  hStripNumber.push_back(ibooker.book1D(
162  "hStripNumber_p42", "Stripgroup Number Fired (ME +4/2); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5));
163 
164  // pedestal noise
165  ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/PedestalNoise");
166 
167  hStripPed.push_back(
168  ibooker.book1D("hStripPedMEm42", "Pedestal Noise Distribution Chamber ME -4/2; ADC Counts", 50, -25., 25.));
169  hStripPed.push_back(
170  ibooker.book1D("hStripPedMEm41", "Pedestal Noise Distribution Chamber ME -4/1; ADC Counts", 50, -25., 25.));
171  hStripPed.push_back(
172  ibooker.book1D("hStripPedMEm32", "Pedestal Noise Distribution Chamber ME -3/2; ADC Counts", 50, -25., 25.));
173  hStripPed.push_back(
174  ibooker.book1D("hStripPedMEm31", "Pedestal Noise Distribution Chamber ME -3/1; ADC Counts", 50, -25., 25.));
175  hStripPed.push_back(
176  ibooker.book1D("hStripPedMEm22", "Pedestal Noise Distribution Chamber ME -2/2; ADC Counts", 50, -25., 25.));
177  hStripPed.push_back(
178  ibooker.book1D("hStripPedMEm21", "Pedestal Noise Distribution Chamber ME -2/1; ADC Counts", 50, -25., 25.));
179  hStripPed.push_back(
180  ibooker.book1D("hStripPedMEm11a", "Pedestal Noise Distribution Chamber ME -1/1; ADC Counts", 50, -25., 25.));
181  hStripPed.push_back(
182  ibooker.book1D("hStripPedMEm13", "Pedestal Noise Distribution Chamber ME -1/3; ADC Counts", 50, -25., 25.));
183  hStripPed.push_back(
184  ibooker.book1D("hStripPedMEm12", "Pedestal Noise Distribution Chamber ME -1/2; ADC Counts", 50, -25., 25.));
185  hStripPed.push_back(
186  ibooker.book1D("hStripPedMEm11b", "Pedestal Noise Distribution Chamber ME -1/1; ADC Counts", 50, -25., 25.));
187  hStripPed.push_back(
188  ibooker.book1D("hStripPedMEp11b", "Pedestal Noise Distribution Chamber ME +1/1; ADC Counts", 50, -25., 25.));
189  hStripPed.push_back(
190  ibooker.book1D("hStripPedMEp12", "Pedestal Noise Distribution Chamber ME +1/2; ADC Counts", 50, -25., 25.));
191  hStripPed.push_back(
192  ibooker.book1D("hStripPedMEp13", "Pedestal Noise Distribution Chamber ME +1/3; ADC Counts", 50, -25., 25.));
193  hStripPed.push_back(
194  ibooker.book1D("hStripPedMEp11a", "Pedestal Noise Distribution Chamber ME +1/1; ADC Counts", 50, -25., 25.));
195  hStripPed.push_back(
196  ibooker.book1D("hStripPedMEp21", "Pedestal Noise Distribution Chamber ME +2/1; ADC Counts", 50, -25., 25.));
197  hStripPed.push_back(
198  ibooker.book1D("hStripPedMEp22", "Pedestal Noise Distribution Chamber ME +2/2; ADC Counts", 50, -25., 25.));
199  hStripPed.push_back(
200  ibooker.book1D("hStripPedMEp31", "Pedestal Noise Distribution Chamber ME +3/1; ADC Counts", 50, -25., 25.));
201  hStripPed.push_back(
202  ibooker.book1D("hStripPedMEp32", "Pedestal Noise Distribution Chamber ME +3/2; ADC Counts", 50, -25., 25.));
203  hStripPed.push_back(
204  ibooker.book1D("hStripPedMEp41", "Pedestal Noise Distribution Chamber ME +4/1; ADC Counts", 50, -25., 25.));
205  hStripPed.push_back(
206  ibooker.book1D("hStripPedMEp42", "Pedestal Noise Distribution Chamber ME +4/2; ADC Counts", 50, -25., 25.));
207 
208  // rechits
209  ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/recHits");
210 
211  hRHnrechits = ibooker.book1D("hRHnrechits", "recHits per Event (all chambers); # of RecHits", 500, -0.50, 499.5);
212  hRHGlobal.push_back(ibooker.book2D(
213  "hRHGlobalp1", "recHit global X,Y station +1; Global X (cm); Global Y (cm)", 100, -800., 800., 100, -800., 800.));
214  hRHGlobal.push_back(ibooker.book2D(
215  "hRHGlobalp2", "recHit global X,Y station +2; Global X (cm); Global Y (cm)", 100, -800., 800., 100, -800., 800.));
216  hRHGlobal.push_back(ibooker.book2D(
217  "hRHGlobalp3", "recHit global X,Y station +3; Global X (cm); Global Y (cm)", 100, -800., 800., 100, -800., 800.));
218  hRHGlobal.push_back(ibooker.book2D(
219  "hRHGlobalp4", "recHit global X,Y station +4; Global X (cm); Global Y (cm)", 100, -800., 800., 100, -800., 800.));
220  hRHGlobal.push_back(ibooker.book2D(
221  "hRHGlobalm1", "recHit global X,Y station -1; Global X (cm); Global Y (cm)", 100, -800., 800., 100, -800., 800.));
222  hRHGlobal.push_back(ibooker.book2D(
223  "hRHGlobalm2", "recHit global X,Y station -2; Global X (cm); Global Y (cm)", 100, -800., 800., 100, -800., 800.));
224  hRHGlobal.push_back(ibooker.book2D(
225  "hRHGlobalm3", "recHit global X,Y station -3; Global X (cm); Global Y (cm)", 100, -800., 800., 100, -800., 800.));
226  hRHGlobal.push_back(ibooker.book2D(
227  "hRHGlobalm4", "recHit global X,Y station -4; Global X (cm); Global Y (cm)", 100, -800., 800., 100, -800., 800.));
228  hRHSumQ.push_back(ibooker.book1D("hRHSumQm42", "Sum 3x3 recHit Charge (ME -4/2); ADC counts", 100, 0, 2000));
229  hRHSumQ.push_back(ibooker.book1D("hRHSumQm41", "Sum 3x3 recHit Charge (ME -4/1); ADC counts", 100, 0, 2000));
230  hRHSumQ.push_back(ibooker.book1D("hRHSumQm32", "Sum 3x3 recHit Charge (ME -3/2); ADC counts", 100, 0, 2000));
231  hRHSumQ.push_back(ibooker.book1D("hRHSumQm31", "Sum 3x3 recHit Charge (ME -3/1); ADC counts", 100, 0, 2000));
232  hRHSumQ.push_back(ibooker.book1D("hRHSumQm22", "Sum 3x3 recHit Charge (ME -2/2); ADC counts", 100, 0, 2000));
233  hRHSumQ.push_back(ibooker.book1D("hRHSumQm21", "Sum 3x3 recHit Charge (ME -2/1); ADC counts", 100, 0, 2000));
234  hRHSumQ.push_back(ibooker.book1D("hRHSumQm11a", "Sum 3x3 recHit Charge (ME -1/1a); ADC counts", 100, 0, 4000));
235  hRHSumQ.push_back(ibooker.book1D("hRHSumQm13", "Sum 3x3 recHit Charge (ME -1/3); ADC counts", 100, 0, 2000));
236  hRHSumQ.push_back(ibooker.book1D("hRHSumQm12", "Sum 3x3 recHit Charge (ME -1/2); ADC counts", 100, 0, 2000));
237  hRHSumQ.push_back(ibooker.book1D("hRHSumQm11b", "Sum 3x3 recHit Charge (ME -1/1b); ADC counts", 100, 0, 4000));
238  hRHSumQ.push_back(ibooker.book1D("hRHSumQp11b", "Sum 3x3 recHit Charge (ME +1/1b); ADC counts", 100, 0, 4000));
239  hRHSumQ.push_back(ibooker.book1D("hRHSumQp12", "Sum 3x3 recHit Charge (ME +1/2); ADC counts", 100, 0, 2000));
240  hRHSumQ.push_back(ibooker.book1D("hRHSumQp13", "Sum 3x3 recHit Charge (ME +1/3); ADC counts", 100, 0, 2000));
241  hRHSumQ.push_back(ibooker.book1D("hRHSumQp11a", "Sum 3x3 recHit Charge (ME +1/1a); ADC counts", 100, 0, 4000));
242  hRHSumQ.push_back(ibooker.book1D("hRHSumQp21", "Sum 3x3 recHit Charge (ME +2/1); ADC counts", 100, 0, 2000));
243  hRHSumQ.push_back(ibooker.book1D("hRHSumQp22", "Sum 3x3 recHit Charge (ME +2/2); ADC counts", 100, 0, 2000));
244  hRHSumQ.push_back(ibooker.book1D("hRHSumQp31", "Sum 3x3 recHit Charge (ME +3/1); ADC counts", 100, 0, 2000));
245  hRHSumQ.push_back(ibooker.book1D("hRHSumQp32", "Sum 3x3 recHit Charge (ME +3/2); ADC counts", 100, 0, 2000));
246  hRHSumQ.push_back(ibooker.book1D("hRHSumQp41", "Sum 3x3 recHit Charge (ME +4/1); ADC counts", 100, 0, 2000));
247  hRHSumQ.push_back(ibooker.book1D("hRHSumQp42", "Sum 3x3 recHit Charge (ME +4/2); ADC counts", 100, 0, 2000));
248  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQm42", "Charge Ratio (Ql+Qr)/Qt (ME -4/2); (Ql+Qr)/Qt", 100, -0.1, 1.1));
249  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQm41", "Charge Ratio (Ql+Qr)/Qt (ME -4/1); (Ql+Qr)/Qt", 100, -0.1, 1.1));
250  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQm32", "Charge Ratio (Ql+Qr)/Qt (ME -3/2); (Ql+Qr)/Qt", 100, -0.1, 1.1));
251  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQm31", "Charge Ratio (Ql+Qr)/Qt (ME -3/1); (Ql+Qr)/Qt", 100, -0.1, 1.1));
252  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQm22", "Charge Ratio (Ql+Qr)/Qt (ME -2/2); (Ql+Qr)/Qt", 100, -0.1, 1.1));
253  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQm21", "Charge Ratio (Ql+Qr)/Qt (ME -2/1); (Ql+Qr)/Qt", 100, -0.1, 1.1));
254  hRHRatioQ.push_back(
255  ibooker.book1D("hRHRatioQm11a", "Charge Ratio (Ql+Qr)/Qt (ME -1/1a); (Ql+Qr)/Qt", 100, -0.1, 1.1));
256  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQm13", "Charge Ratio (Ql+Qr)/Qt (ME -1/3); (Ql+Qr)/Qt", 100, -0.1, 1.1));
257  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQm12", "Charge Ratio (Ql+Qr)/Qt (ME -1/2); (Ql+Qr)/Qt", 100, -0.1, 1.1));
258  hRHRatioQ.push_back(
259  ibooker.book1D("hRHRatioQm11b", "Charge Ratio (Ql+Qr)/Qt (ME -1/1b); (Ql+Qr)/Qt", 100, -0.1, 1.1));
260  hRHRatioQ.push_back(
261  ibooker.book1D("hRHRatioQp11b", "Charge Ratio (Ql+Qr)/Qt (ME +1/1b); (Ql+Qr)/Qt", 100, -0.1, 1.1));
262  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQp12", "Charge Ratio (Ql+Qr)/Qt (ME +1/2); (Ql+Qr)/Qt", 100, -0.1, 1.1));
263  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQp13", "Charge Ratio (Ql+Qr)/Qt (ME +1/3); (Ql+Qr)/Qt", 100, -0.1, 1.1));
264  hRHRatioQ.push_back(
265  ibooker.book1D("hRHRatioQp11a", "Charge Ratio (Ql+Qr)/Qt (ME +1/1a); (Ql+Qr)/Qt", 100, -0.1, 1.1));
266  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQp21", "Charge Ratio (Ql+Qr)/Qt (ME +2/1); (Ql+Qr)/Qt", 100, -0.1, 1.1));
267  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQp22", "Charge Ratio (Ql+Qr)/Qt (ME +2/2); (Ql+Qr)/Qt", 100, -0.1, 1.1));
268  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQp31", "Charge Ratio (Ql+Qr)/Qt (ME +3/1); (Ql+Qr)/Qt", 100, -0.1, 1.1));
269  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQp32", "Charge Ratio (Ql+Qr)/Qt (ME +3/2); (Ql+Qr)/Qt", 100, -0.1, 1.1));
270  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQp41", "Charge Ratio (Ql+Qr)/Qt (ME +4/1); (Ql+Qr)/Qt", 100, -0.1, 1.1));
271  hRHRatioQ.push_back(ibooker.book1D("hRHRatioQp42", "Charge Ratio (Ql+Qr)/Qt (ME +4/2); (Ql+Qr)/Qt", 100, -0.1, 1.1));
272  hRHTiming.push_back(ibooker.book1D("hRHTimingm42", "recHit Time (ME -4/2); ns", 200, -500., 500.));
273  hRHTiming.push_back(ibooker.book1D("hRHTimingm41", "recHit Time (ME -4/1); ns", 200, -500., 500.));
274  hRHTiming.push_back(ibooker.book1D("hRHTimingm32", "recHit Time (ME -3/2); ns", 200, -500., 500.));
275  hRHTiming.push_back(ibooker.book1D("hRHTimingm31", "recHit Time (ME -3/1); ns", 200, -500., 500.));
276  hRHTiming.push_back(ibooker.book1D("hRHTimingm22", "recHit Time (ME -2/2); ns", 200, -500., 500.));
277  hRHTiming.push_back(ibooker.book1D("hRHTimingm21", "recHit Time (ME -2/1); ns", 200, -500., 500.));
278  hRHTiming.push_back(ibooker.book1D("hRHTimingm11a", "recHit Time (ME -1/1a); ns", 200, -500., 500.));
279  hRHTiming.push_back(ibooker.book1D("hRHTimingm13", "recHit Time (ME -1/3); ns", 200, -500., 500.));
280  hRHTiming.push_back(ibooker.book1D("hRHTimingm12", "recHit Time (ME -1/2); ns", 200, -500., 500.));
281  hRHTiming.push_back(ibooker.book1D("hRHTimingm11b", "recHit Time (ME -1/1b); ns", 200, -500., 500.));
282  hRHTiming.push_back(ibooker.book1D("hRHTimingp11b", "recHit Time (ME +1/1b); ns", 200, -500., 500.));
283  hRHTiming.push_back(ibooker.book1D("hRHTimingp12", "recHit Time (ME +1/2); ns", 200, -500., 500.));
284  hRHTiming.push_back(ibooker.book1D("hRHTimingp13", "recHit Time (ME +1/3); ns", 200, -500., 500.));
285  hRHTiming.push_back(ibooker.book1D("hRHTimingp11a", "recHit Time (ME +1/1a); ns", 200, -500., 500.));
286  hRHTiming.push_back(ibooker.book1D("hRHTimingp21", "recHit Time (ME +2/1); ns", 200, -500., 500.));
287  hRHTiming.push_back(ibooker.book1D("hRHTimingp22", "recHit Time (ME +2/2); ns", 200, -500., 500.));
288  hRHTiming.push_back(ibooker.book1D("hRHTimingp31", "recHit Time (ME +3/1); ns", 200, -500., 500.));
289  hRHTiming.push_back(ibooker.book1D("hRHTimingp32", "recHit Time (ME +3/2); ns", 200, -500., 500.));
290  hRHTiming.push_back(ibooker.book1D("hRHTimingp41", "recHit Time (ME +4/1); ns", 200, -500., 500.));
291  hRHTiming.push_back(ibooker.book1D("hRHTimingp42", "recHit Time (ME +4/2); ns", 200, -500., 500.));
292  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodem42", "Anode recHit Time (ME -4/2); ns", 80, -500., 500.));
293  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodem41", "Anode recHit Time (ME -4/1); ns", 80, -500., 500.));
294  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodem32", "Anode recHit Time (ME -3/2); ns", 80, -500., 500.));
295  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodem31", "Anode recHit Time (ME -3/1); ns", 80, -500., 500.));
296  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodem22", "Anode recHit Time (ME -2/2); ns", 80, -500., 500.));
297  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodem21", "Anode recHit Time (ME -2/1); ns", 80, -500., 500.));
298  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodem11a", "Anode recHit Time (ME -1/1a); ns", 80, -500., 500.));
299  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodem13", "Anode recHit Time (ME -1/3); ns", 80, -500., 500.));
300  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodem12", "Anode recHit Time (ME -1/2); ns", 80, -500., 500.));
301  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodem11b", "Anode recHit Time (ME -1/1b); ns", 80, -500., 500.));
302  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodep11b", "Anode recHit Time (ME +1/1b); ns", 80, -500., 500.));
303  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodep12", "Anode recHit Time (ME +1/2); ns", 80, -500., 500.));
304  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodep13", "Anode recHit Time (ME +1/3); ns", 80, -500., 500.));
305  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodep11a", "Anode recHit Time (ME +1/1a); ns", 80, -500., 500.));
306  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodep21", "Anode recHit Time (ME +2/1); ns", 80, -500., 500.));
307  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodep22", "Anode recHit Time (ME +2/2); ns", 80, -500., 500.));
308  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodep31", "Anode recHit Time (ME +3/1); ns", 80, -500., 500.));
309  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodep32", "Anode recHit Time (ME +3/2); ns", 80, -500., 500.));
310  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodep41", "Anode recHit Time (ME +4/1); ns", 80, -500., 500.));
311  hRHTimingAnode.push_back(ibooker.book1D("hRHTimingAnodep42", "Anode recHit Time (ME +4/2); ns", 80, -500., 500.));
312  hRHstpos.push_back(
313  ibooker.book1D("hRHstposm42", "Reconstructed Position on Strip (ME -4/2); Strip Widths", 120, -0.6, 0.6));
314  hRHstpos.push_back(
315  ibooker.book1D("hRHstposm41", "Reconstructed Position on Strip (ME -4/1); Strip Widths", 120, -0.6, 0.6));
316  hRHstpos.push_back(
317  ibooker.book1D("hRHstposm32", "Reconstructed Position on Strip (ME -3/2); Strip Widths", 120, -0.6, 0.6));
318  hRHstpos.push_back(
319  ibooker.book1D("hRHstposm31", "Reconstructed Position on Strip (ME -3/1); Strip Widths", 120, -0.6, 0.6));
320  hRHstpos.push_back(
321  ibooker.book1D("hRHstposm22", "Reconstructed Position on Strip (ME -2/2); Strip Widths", 120, -0.6, 0.6));
322  hRHstpos.push_back(
323  ibooker.book1D("hRHstposm21", "Reconstructed Position on Strip (ME -2/1); Strip Widths", 120, -0.6, 0.6));
324  hRHstpos.push_back(
325  ibooker.book1D("hRHstposm11a", "Reconstructed Position on Strip (ME -1/1a); Strip Widths", 120, -0.6, 0.6));
326  hRHstpos.push_back(
327  ibooker.book1D("hRHstposm13", "Reconstructed Position on Strip (ME -1/3); Strip Widths", 120, -0.6, 0.6));
328  hRHstpos.push_back(
329  ibooker.book1D("hRHstposm12", "Reconstructed Position on Strip (ME -1/2); Strip Widths", 120, -0.6, 0.6));
330  hRHstpos.push_back(
331  ibooker.book1D("hRHstposm11b", "Reconstructed Position on Strip (ME -1/1b); Strip Widths", 120, -0.6, 0.6));
332  hRHstpos.push_back(
333  ibooker.book1D("hRHstposp11b", "Reconstructed Position on Strip (ME +1/1b); Strip Widths", 120, -0.6, 0.6));
334  hRHstpos.push_back(
335  ibooker.book1D("hRHstposp12", "Reconstructed Position on Strip (ME +1/2); Strip Widths", 120, -0.6, 0.6));
336  hRHstpos.push_back(
337  ibooker.book1D("hRHstposp13", "Reconstructed Position on Strip (ME +1/3); Strip Widths", 120, -0.6, 0.6));
338  hRHstpos.push_back(
339  ibooker.book1D("hRHstposp11a", "Reconstructed Position on Strip (ME +1/1a); Strip Widths", 120, -0.6, 0.6));
340  hRHstpos.push_back(
341  ibooker.book1D("hRHstposp21", "Reconstructed Position on Strip (ME +2/1); Strip Widths", 120, -0.6, 0.6));
342  hRHstpos.push_back(
343  ibooker.book1D("hRHstposp22", "Reconstructed Position on Strip (ME +2/2); Strip Widths", 120, -0.6, 0.6));
344  hRHstpos.push_back(
345  ibooker.book1D("hRHstposp31", "Reconstructed Position on Strip (ME +3/1); Strip Widths", 120, -0.6, 0.6));
346  hRHstpos.push_back(
347  ibooker.book1D("hRHstposp32", "Reconstructed Position on Strip (ME +3/2); Strip Widths", 120, -0.6, 0.6));
348  hRHstpos.push_back(
349  ibooker.book1D("hRHstposp41", "Reconstructed Position on Strip (ME +4/1); Strip Widths", 120, -0.6, 0.6));
350  hRHstpos.push_back(
351  ibooker.book1D("hRHstposp42", "Reconstructed Position on Strip (ME +4/2); Strip Widths", 120, -0.6, 0.6));
352  hRHsterr.push_back(
353  ibooker.book1D("hRHsterrm42", "Estimated Error on Strip Measurement (ME -4/2); Strip Widths", 75, -0.01, 0.24));
354  hRHsterr.push_back(
355  ibooker.book1D("hRHsterrm41", "Estimated Error on Strip Measurement (ME -4/1); Strip Widths", 75, -0.01, 0.24));
356  hRHsterr.push_back(
357  ibooker.book1D("hRHsterrm32", "Estimated Error on Strip Measurement (ME -3/2); Strip Widths", 75, -0.01, 0.24));
358  hRHsterr.push_back(
359  ibooker.book1D("hRHsterrm31", "Estimated Error on Strip Measurement (ME -3/1); Strip Widths", 75, -0.01, 0.24));
360  hRHsterr.push_back(
361  ibooker.book1D("hRHsterrm22", "Estimated Error on Strip Measurement (ME -2/2); Strip Widths", 75, -0.01, 0.24));
362  hRHsterr.push_back(
363  ibooker.book1D("hRHsterrm21", "Estimated Error on Strip Measurement (ME -2/1); Strip Widths", 75, -0.01, 0.24));
364  hRHsterr.push_back(
365  ibooker.book1D("hRHsterrm11a", "Estimated Error on Strip Measurement (ME -1/1a); Strip Widths", 75, -0.01, 0.24));
366  hRHsterr.push_back(
367  ibooker.book1D("hRHsterrm13", "Estimated Error on Strip Measurement (ME -1/3); Strip Widths", 75, -0.01, 0.24));
368  hRHsterr.push_back(
369  ibooker.book1D("hRHsterrm12", "Estimated Error on Strip Measurement (ME -1/2); Strip Widths", 75, -0.01, 0.24));
370  hRHsterr.push_back(
371  ibooker.book1D("hRHsterrm11b", "Estimated Error on Strip Measurement (ME -1/1b); Strip Widths", 75, -0.01, 0.24));
372  hRHsterr.push_back(
373  ibooker.book1D("hRHsterrp11b", "Estimated Error on Strip Measurement (ME +1/1b); Strip Widths", 75, -0.01, 0.24));
374  hRHsterr.push_back(
375  ibooker.book1D("hRHsterrp12", "Estimated Error on Strip Measurement (ME +1/2); Strip Widths", 75, -0.01, 0.24));
376  hRHsterr.push_back(
377  ibooker.book1D("hRHsterrp13", "Estimated Error on Strip Measurement (ME +1/3); Strip Widths", 75, -0.01, 0.24));
378  hRHsterr.push_back(
379  ibooker.book1D("hRHsterrp11a", "Estimated Error on Strip Measurement (ME +1/1a); Strip Widths", 75, -0.01, 0.24));
380  hRHsterr.push_back(
381  ibooker.book1D("hRHsterrp21", "Estimated Error on Strip Measurement (ME +2/1); Strip Widths", 75, -0.01, 0.24));
382  hRHsterr.push_back(
383  ibooker.book1D("hRHsterrp22", "Estimated Error on Strip Measurement (ME +2/2); Strip Widths", 75, -0.01, 0.24));
384  hRHsterr.push_back(
385  ibooker.book1D("hRHsterrp31", "Estimated Error on Strip Measurement (ME +3/1); Strip Widths", 75, -0.01, 0.24));
386  hRHsterr.push_back(
387  ibooker.book1D("hRHsterrp32", "Estimated Error on Strip Measurement (ME +3/2); Strip Widths", 75, -0.01, 0.24));
388  hRHsterr.push_back(
389  ibooker.book1D("hRHsterrp41", "Estimated Error on Strip Measurement (ME +4/1); Strip Widths", 75, -0.01, 0.24));
390  hRHsterr.push_back(
391  ibooker.book1D("hRHsterrp42", "Estimated Error on Strip Measurement (ME +4/2); Strip Widths", 75, -0.01, 0.24));
392 
393  // segments
394  ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/Segments");
395 
396  hSnSegments = ibooker.book1D("hSnSegments", "Number of Segments per Event; # of Segments", 26, -0.5, 25.5);
397  hSnhitsAll = ibooker.book1D("hSnhits", "N hits on Segments; # of hits", 8, -0.5, 7.5);
398  hSnhits.push_back(ibooker.book1D("hSnhitsm42", "# of hits on Segments (ME -4/2); # of hits", 8, -0.5, 7.5));
399  hSnhits.push_back(ibooker.book1D("hSnhitsm41", "# of hits on Segments (ME -4/1); # of hits", 8, -0.5, 7.5));
400  hSnhits.push_back(ibooker.book1D("hSnhitsm32", "# of hits on Segments (ME -3/2); # of hits", 8, -0.5, 7.5));
401  hSnhits.push_back(ibooker.book1D("hSnhitsm31", "# of hits on Segments (ME -3/1); # of hits", 8, -0.5, 7.5));
402  hSnhits.push_back(ibooker.book1D("hSnhitsm22", "# of hits on Segments (ME -2/2); # of hits", 8, -0.5, 7.5));
403  hSnhits.push_back(ibooker.book1D("hSnhitsm21", "# of hits on Segments (ME -2/1); # of hits", 8, -0.5, 7.5));
404  hSnhits.push_back(ibooker.book1D("hSnhitsm11a", "# of hits on Segments (ME -1/1a); # of hits", 8, -0.5, 7.5));
405  hSnhits.push_back(ibooker.book1D("hSnhitsm13", "# of hits on Segments (ME -1/3); # of hits", 8, -0.5, 7.5));
406  hSnhits.push_back(ibooker.book1D("hSnhitsm12", "# of hits on Segments (ME -1/2); # of hits", 8, -0.5, 7.5));
407  hSnhits.push_back(ibooker.book1D("hSnhitsm11b", "# of hits on Segments (ME -1/1b); # of hits", 8, -0.5, 7.5));
408  hSnhits.push_back(ibooker.book1D("hSnhitsp11b", "# of hits on Segments (ME +1/1b); # of hits", 8, -0.5, 7.5));
409  hSnhits.push_back(ibooker.book1D("hSnhitsp12", "# of hits on Segments (ME +1/2); # of hits", 8, -0.5, 7.5));
410  hSnhits.push_back(ibooker.book1D("hSnhitsp13", "# of hits on Segments (ME +1/3); # of hits", 8, -0.5, 7.5));
411  hSnhits.push_back(ibooker.book1D("hSnhitsp11a", "# of hits on Segments (ME +1/1a); # of hits", 8, -0.5, 7.5));
412  hSnhits.push_back(ibooker.book1D("hSnhitsp21", "# of hits on Segments (ME +2/1); # of hits", 8, -0.5, 7.5));
413  hSnhits.push_back(ibooker.book1D("hSnhitsp22", "# of hits on Segments (ME +2/2); # of hits", 8, -0.5, 7.5));
414  hSnhits.push_back(ibooker.book1D("hSnhitsp31", "# of hits on Segments (ME +3/1); # of hits", 8, -0.5, 7.5));
415  hSnhits.push_back(ibooker.book1D("hSnhitsp32", "# of hits on Segments (ME +3/2); # of hits", 8, -0.5, 7.5));
416  hSnhits.push_back(ibooker.book1D("hSnhitsp41", "# of hits on Segments (ME +4/1); # of hits", 8, -0.5, 7.5));
417  hSnhits.push_back(ibooker.book1D("hSnhitsp42", "# of hits on Segments (ME +4/2); # of hits", 8, -0.5, 7.5));
418  hSChiSqAll = ibooker.book1D("hSChiSq", "Segment Normalized Chi2; Chi2/ndof", 110, -0.05, 10.5);
419  hSChiSq.push_back(ibooker.book1D("hSChiSqm42", "Segment Normalized Chi2 (ME -4/2); Chi2/ndof", 110, -0.05, 10.5));
420  hSChiSq.push_back(ibooker.book1D("hSChiSqm41", "Segment Normalized Chi2 (ME -4/1); Chi2/ndof", 110, -0.05, 10.5));
421  hSChiSq.push_back(ibooker.book1D("hSChiSqm32", "Segment Normalized Chi2 (ME -3/2); Chi2/ndof", 110, -0.05, 10.5));
422  hSChiSq.push_back(ibooker.book1D("hSChiSqm31", "Segment Normalized Chi2 (ME -3/1); Chi2/ndof", 110, -0.05, 10.5));
423  hSChiSq.push_back(ibooker.book1D("hSChiSqm22", "Segment Normalized Chi2 (ME -2/2); Chi2/ndof", 110, -0.05, 10.5));
424  hSChiSq.push_back(ibooker.book1D("hSChiSqm21", "Segment Normalized Chi2 (ME -2/1); Chi2/ndof", 110, -0.05, 10.5));
425  hSChiSq.push_back(ibooker.book1D("hSChiSqm11a", "Segment Normalized Chi2 (ME -1/1a); Chi2/ndof", 110, -0.05, 10.5));
426  hSChiSq.push_back(ibooker.book1D("hSChiSqm13", "Segment Normalized Chi2 (ME -1/3); Chi2/ndof", 110, -0.05, 10.5));
427  hSChiSq.push_back(ibooker.book1D("hSChiSqm12", "Segment Normalized Chi2 (ME -1/2); Chi2/ndof", 110, -0.05, 10.5));
428  hSChiSq.push_back(ibooker.book1D("hSChiSqm11b", "Segment Normalized Chi2 (ME -1/1b); Chi2/ndof", 110, -0.05, 10.5));
429  hSChiSq.push_back(ibooker.book1D("hSChiSqp11b", "Segment Normalized Chi2 (ME +1/1b); Chi2/ndof", 110, -0.05, 10.5));
430  hSChiSq.push_back(ibooker.book1D("hSChiSqp12", "Segment Normalized Chi2 (ME +1/2); Chi2/ndof", 110, -0.05, 10.5));
431  hSChiSq.push_back(ibooker.book1D("hSChiSqp13", "Segment Normalized Chi2 (ME +1/3); Chi2/ndof", 110, -0.05, 10.5));
432  hSChiSq.push_back(ibooker.book1D("hSChiSqp11a", "Segment Normalized Chi2 (ME +1/1a); Chi2/ndof", 110, -0.05, 10.5));
433  hSChiSq.push_back(ibooker.book1D("hSChiSqp21", "Segment Normalized Chi2 (ME +2/1); Chi2/ndof", 110, -0.05, 10.5));
434  hSChiSq.push_back(ibooker.book1D("hSChiSqp22", "Segment Normalized Chi2 (ME +2/2); Chi2/ndof", 110, -0.05, 10.5));
435  hSChiSq.push_back(ibooker.book1D("hSChiSqp31", "Segment Normalized Chi2 (ME +3/1); Chi2/ndof", 110, -0.05, 10.5));
436  hSChiSq.push_back(ibooker.book1D("hSChiSqp32", "Segment Normalized Chi2 (ME +3/2); Chi2/ndof", 110, -0.05, 10.5));
437  hSChiSq.push_back(ibooker.book1D("hSChiSqp41", "Segment Normalized Chi2 (ME +4/1); Chi2/ndof", 110, -0.05, 10.5));
438  hSChiSq.push_back(ibooker.book1D("hSChiSqp42", "Segment Normalized Chi2 (ME +4/2); Chi2/ndof", 110, -0.05, 10.5));
439  hSChiSqProbAll = ibooker.book1D("hSChiSqProb", "Segment chi2 Probability; Probability", 110, -0.05, 1.05);
440  hSChiSqProb.push_back(
441  ibooker.book1D("hSChiSqProbm42", "Segment chi2 Probability (ME -4/2); Probability", 110, -0.05, 1.05));
442  hSChiSqProb.push_back(
443  ibooker.book1D("hSChiSqProbm41", "Segment chi2 Probability (ME -4/1); Probability", 110, -0.05, 1.05));
444  hSChiSqProb.push_back(
445  ibooker.book1D("hSChiSqProbm32", "Segment chi2 Probability (ME -3/2); Probability", 110, -0.05, 1.05));
446  hSChiSqProb.push_back(
447  ibooker.book1D("hSChiSqProbm31", "Segment chi2 Probability (ME -3/1); Probability", 110, -0.05, 1.05));
448  hSChiSqProb.push_back(
449  ibooker.book1D("hSChiSqProbm22", "Segment chi2 Probability (ME -2/2); Probability", 110, -0.05, 1.05));
450  hSChiSqProb.push_back(
451  ibooker.book1D("hSChiSqProbm21", "Segment chi2 Probability (ME -2/1); Probability", 110, -0.05, 1.05));
452  hSChiSqProb.push_back(
453  ibooker.book1D("hSChiSqProbm11a", "Segment chi2 Probability (ME -1/1a); Probability", 110, -0.05, 1.05));
454  hSChiSqProb.push_back(
455  ibooker.book1D("hSChiSqProbm13", "Segment chi2 Probability (ME -1/3); Probability", 110, -0.05, 1.05));
456  hSChiSqProb.push_back(
457  ibooker.book1D("hSChiSqProbm12", "Segment chi2 Probability (ME -1/2); Probability", 110, -0.05, 1.05));
458  hSChiSqProb.push_back(
459  ibooker.book1D("hSChiSqProbm11b", "Segment chi2 Probability (ME -1/1b); Probability", 110, -0.05, 1.05));
460  hSChiSqProb.push_back(
461  ibooker.book1D("hSChiSqProbp11b", "Segment chi2 Probability (ME +1/1b); Probability", 110, -0.05, 1.05));
462  hSChiSqProb.push_back(
463  ibooker.book1D("hSChiSqProbp12", "Segment chi2 Probability (ME +1/2); Probability", 110, -0.05, 1.05));
464  hSChiSqProb.push_back(
465  ibooker.book1D("hSChiSqProbp13", "Segment chi2 Probability (ME +1/3); Probability", 110, -0.05, 1.05));
466  hSChiSqProb.push_back(
467  ibooker.book1D("hSChiSqProbp11a", "Segment chi2 Probability (ME +1/1a); Probability", 110, -0.05, 1.05));
468  hSChiSqProb.push_back(
469  ibooker.book1D("hSChiSqProbp21", "Segment chi2 Probability (ME +2/1); Probability", 110, -0.05, 1.05));
470  hSChiSqProb.push_back(
471  ibooker.book1D("hSChiSqProbp22", "Segment chi2 Probability (ME +2/2); Probability", 110, -0.05, 1.05));
472  hSChiSqProb.push_back(
473  ibooker.book1D("hSChiSqProbp31", "Segment chi2 Probability (ME +3/1); Probability", 110, -0.05, 1.05));
474  hSChiSqProb.push_back(
475  ibooker.book1D("hSChiSqProbp32", "Segment chi2 Probability (ME +3/2); Probability", 110, -0.05, 1.05));
476  hSChiSqProb.push_back(
477  ibooker.book1D("hSChiSqProbp41", "Segment chi2 Probability (ME +4/1); Probability", 110, -0.05, 1.05));
478  hSChiSqProb.push_back(
479  ibooker.book1D("hSChiSqProbp42", "Segment chi2 Probability (ME +4/2); Probability", 110, -0.05, 1.05));
480  hSGlobalTheta =
481  ibooker.book1D("hSGlobalTheta", "Segment Direction (Global Theta); Global Theta (radians)", 136, -0.1, 3.3);
482  hSGlobalPhi = ibooker.book1D("hSGlobalPhi", "Segment Direction (Global Phi); Global Phi (radians)", 128, -3.2, 3.2);
483 
484  hSTimeDiff = ibooker.book1D("hSTimeDiff", "Anode Minus Cathode Segment Time [ns]", 50, -50, 50);
485  hSTimeDiffByChamberType.push_back(
486  ibooker.book1D("hSTimeDiff_m42", "Anode Minus Cathode Segment Time (ME -4/2) [ns]", 50, -50, 50));
487  hSTimeDiffByChamberType.push_back(
488  ibooker.book1D("hSTimeDiff_m41", "Anode Minus Cathode Segment Time (ME -4/1) [ns]", 50, -50, 50));
489  hSTimeDiffByChamberType.push_back(
490  ibooker.book1D("hSTimeDiff_m32", "Anode Minus Cathode Segment Time (ME -3/2) [ns]", 50, -50, 50));
491  hSTimeDiffByChamberType.push_back(
492  ibooker.book1D("hSTimeDiff_m31", "Anode Minus Cathode Segment Time (ME -3/2) [ns]", 50, -50, 50));
493  hSTimeDiffByChamberType.push_back(
494  ibooker.book1D("hSTimeDiff_m22", "Anode Minus Cathode Segment Time (ME -2/2) [ns]", 50, -50, 50));
495  hSTimeDiffByChamberType.push_back(
496  ibooker.book1D("hSTimeDiff_m21", "Anode Minus Cathode Segment Time (ME -2/1) [ns]", 50, -50, 50));
497  hSTimeDiffByChamberType.push_back(
498  ibooker.book1D("hSTimeDiff_m11a", "Anode Minus Cathode Segment Time (ME -1/1a) [ns]", 50, -50, 50));
499  hSTimeDiffByChamberType.push_back(
500  ibooker.book1D("hSTimeDiff_m13", "Anode Minus Cathode Segment Time (ME -1/3) [ns]", 50, -50, 50));
501  hSTimeDiffByChamberType.push_back(
502  ibooker.book1D("hSTimeDiff_m12", "Anode Minus Cathode Segment Time (ME -1/2) [ns]", 50, -50, 50));
503  hSTimeDiffByChamberType.push_back(
504  ibooker.book1D("hSTimeDiff_m11b", "Anode Minus Cathode Segment Time (ME -1/1b) [ns]", 50, -50, 50));
505  hSTimeDiffByChamberType.push_back(
506  ibooker.book1D("hSTimeDiff_p11b", "Anode Minus Cathode Segment Time (ME +1/1b) [ns]", 50, -50, 50));
507  hSTimeDiffByChamberType.push_back(
508  ibooker.book1D("hSTimeDiff_p12", "Anode Minus Cathode Segment Time (ME +1/2) [ns]", 50, -50, 50));
509  hSTimeDiffByChamberType.push_back(
510  ibooker.book1D("hSTimeDiff_p13", "Anode Minus Cathode Segment Time (ME +1/3) [ns]", 50, -50, 50));
511  hSTimeDiffByChamberType.push_back(
512  ibooker.book1D("hSTimeDiff_p11a", "Anode Minus Cathode Segment Time (ME +1/1a) [ns]", 50, -50, 50));
513  hSTimeDiffByChamberType.push_back(
514  ibooker.book1D("hSTimeDiff_p21", "Anode Minus Cathode Segment Time (ME +2/1) [ns]", 50, -50, 50));
515  hSTimeDiffByChamberType.push_back(
516  ibooker.book1D("hSTimeDiff_p22", "Anode Minus Cathode Segment Time (ME +2/2) [ns]", 50, -50, 50));
517  hSTimeDiffByChamberType.push_back(
518  ibooker.book1D("hSTimeDiff_p31", "Anode Minus Cathode Segment Time (ME +3/1) [ns]", 50, -50, 50));
519  hSTimeDiffByChamberType.push_back(
520  ibooker.book1D("hSTimeDiff_p32", "Anode Minus Cathode Segment Time (ME +3/2) [ns]", 50, -50, 50));
521  hSTimeDiffByChamberType.push_back(
522  ibooker.book1D("hSTimeDiff_p41", "Anode Minus Cathode Segment Time (ME +4/1) [ns]", 50, -50, 50));
523  hSTimeDiffByChamberType.push_back(
524  ibooker.book1D("hSTimeDiff_p42", "Anode Minus Cathode Segment Time (ME +4/2) [ns]", 50, -50, 50));
525 
526  hSTimeAnode = ibooker.book1D("hSTimeAnode", "Anode Only Segment Time [ns]", 200, -200, 200);
527  hSTimeAnodeByChamberType.push_back(
528  ibooker.book1D("hSTimeAnode_m42", "Anode Only Segment Time (ME -4/2) [ns]", 200, -200, 200));
529  hSTimeAnodeByChamberType.push_back(
530  ibooker.book1D("hSTimeAnode_m41", "Anode Only Segment Time (ME -4/1) [ns]", 200, -200, 200));
531  hSTimeAnodeByChamberType.push_back(
532  ibooker.book1D("hSTimeAnode_m32", "Anode Only Segment Time (ME -3/2) [ns]", 200, -200, 200));
533  hSTimeAnodeByChamberType.push_back(
534  ibooker.book1D("hSTimeAnode_m31", "Anode Only Segment Time (ME -3/2) [ns]", 200, -200, 200));
535  hSTimeAnodeByChamberType.push_back(
536  ibooker.book1D("hSTimeAnode_m22", "Anode Only Segment Time (ME -2/2) [ns]", 200, -200, 200));
537  hSTimeAnodeByChamberType.push_back(
538  ibooker.book1D("hSTimeAnode_m21", "Anode Only Segment Time (ME -2/1) [ns]", 200, -200, 200));
539  hSTimeAnodeByChamberType.push_back(
540  ibooker.book1D("hSTimeAnode_m11a", "Anode Only Segment Time (ME -1/1a) [ns]", 200, -200, 200));
541  hSTimeAnodeByChamberType.push_back(
542  ibooker.book1D("hSTimeAnode_m13", "Anode Only Segment Time (ME -1/3) [ns]", 200, -200, 200));
543  hSTimeAnodeByChamberType.push_back(
544  ibooker.book1D("hSTimeAnode_m12", "Anode Only Segment Time (ME -1/2) [ns]", 200, -200, 200));
545  hSTimeAnodeByChamberType.push_back(
546  ibooker.book1D("hSTimeAnode_m11b", "Anode Only Segment Time (ME -1/1b) [ns]", 200, -200, 200));
547  hSTimeAnodeByChamberType.push_back(
548  ibooker.book1D("hSTimeAnode_p11b", "Anode Only Segment Time (ME +1/1b) [ns]", 200, -200, 200));
549  hSTimeAnodeByChamberType.push_back(
550  ibooker.book1D("hSTimeAnode_p12", "Anode Only Segment Time (ME +1/2) [ns]", 200, -200, 200));
551  hSTimeAnodeByChamberType.push_back(
552  ibooker.book1D("hSTimeAnode_p13", "Anode Only Segment Time (ME +1/3) [ns]", 200, -200, 200));
553  hSTimeAnodeByChamberType.push_back(
554  ibooker.book1D("hSTimeAnode_p11a", "Anode Only Segment Time (ME +1/1a) [ns]", 200, -200, 200));
555  hSTimeAnodeByChamberType.push_back(
556  ibooker.book1D("hSTimeAnode_p21", "Anode Only Segment Time (ME +2/1) [ns]", 200, -200, 200));
557  hSTimeAnodeByChamberType.push_back(
558  ibooker.book1D("hSTimeAnode_p22", "Anode Only Segment Time (ME +2/2) [ns]", 200, -200, 200));
559  hSTimeAnodeByChamberType.push_back(
560  ibooker.book1D("hSTimeAnode_p31", "Anode Only Segment Time (ME +3/1) [ns]", 200, -200, 200));
561  hSTimeAnodeByChamberType.push_back(
562  ibooker.book1D("hSTimeAnode_p32", "Anode Only Segment Time (ME +3/2) [ns]", 200, -200, 200));
563  hSTimeAnodeByChamberType.push_back(
564  ibooker.book1D("hSTimeAnode_p41", "Anode Only Segment Time (ME +4/1) [ns]", 200, -200, 200));
565  hSTimeAnodeByChamberType.push_back(
566  ibooker.book1D("hSTimeAnode_p42", "Anode Only Segment Time (ME +4/2) [ns]", 200, -200, 200));
567 
568  hSTimeCathode = ibooker.book1D("hSTimeCathode", "Cathode Only Segment Time [ns]", 200, -200, 200);
569  hSTimeCathodeByChamberType.push_back(
570  ibooker.book1D("hSTimeCathode_m42", "Cathode Only Segment Time (ME -4/2) [ns]", 200, -200, 200));
571  hSTimeCathodeByChamberType.push_back(
572  ibooker.book1D("hSTimeCathode_m41", "Cathode Only Segment Time (ME -4/1) [ns]", 200, -200, 200));
573  hSTimeCathodeByChamberType.push_back(
574  ibooker.book1D("hSTimeCathode_m32", "Cathode Only Segment Time (ME -3/2) [ns]", 200, -200, 200));
575  hSTimeCathodeByChamberType.push_back(
576  ibooker.book1D("hSTimeCathode_m31", "Cathode Only Segment Time (ME -3/2) [ns]", 200, -200, 200));
577  hSTimeCathodeByChamberType.push_back(
578  ibooker.book1D("hSTimeCathode_m22", "Cathode Only Segment Time (ME -2/2) [ns]", 200, -200, 200));
579  hSTimeCathodeByChamberType.push_back(
580  ibooker.book1D("hSTimeCathode_m21", "Cathode Only Segment Time (ME -2/1) [ns]", 200, -200, 200));
581  hSTimeCathodeByChamberType.push_back(
582  ibooker.book1D("hSTimeCathode_m11a", "Cathode Only Segment Time (ME -1/1a) [ns]", 200, -200, 200));
583  hSTimeCathodeByChamberType.push_back(
584  ibooker.book1D("hSTimeCathode_m13", "Cathode Only Segment Time (ME -1/3) [ns]", 200, -200, 200));
585  hSTimeCathodeByChamberType.push_back(
586  ibooker.book1D("hSTimeCathode_m12", "Cathode Only Segment Time (ME -1/2) [ns]", 200, -200, 200));
587  hSTimeCathodeByChamberType.push_back(
588  ibooker.book1D("hSTimeCathode_m11b", "Cathode Only Segment Time (ME -1/1b) [ns]", 200, -200, 200));
589  hSTimeCathodeByChamberType.push_back(
590  ibooker.book1D("hSTimeCathode_p11b", "Cathode Only Segment Time (ME +1/1b) [ns]", 200, -200, 200));
591  hSTimeCathodeByChamberType.push_back(
592  ibooker.book1D("hSTimeCathode_p12", "Cathode Only Segment Time (ME +1/2) [ns]", 200, -200, 200));
593  hSTimeCathodeByChamberType.push_back(
594  ibooker.book1D("hSTimeCathode_p13", "Cathode Only Segment Time (ME +1/3) [ns]", 200, -200, 200));
595  hSTimeCathodeByChamberType.push_back(
596  ibooker.book1D("hSTimeCathode_p11a", "Cathode Only Segment Time (ME +1/1a) [ns]", 200, -200, 200));
597  hSTimeCathodeByChamberType.push_back(
598  ibooker.book1D("hSTimeCathode_p21", "Cathode Only Segment Time (ME +2/1) [ns]", 200, -200, 200));
599  hSTimeCathodeByChamberType.push_back(
600  ibooker.book1D("hSTimeCathode_p22", "Cathode Only Segment Time (ME +2/2) [ns]", 200, -200, 200));
601  hSTimeCathodeByChamberType.push_back(
602  ibooker.book1D("hSTimeCathode_p31", "Cathode Only Segment Time (ME +3/1) [ns]", 200, -200, 200));
603  hSTimeCathodeByChamberType.push_back(
604  ibooker.book1D("hSTimeCathode_p32", "Cathode Only Segment Time (ME +3/2) [ns]", 200, -200, 200));
605  hSTimeCathodeByChamberType.push_back(
606  ibooker.book1D("hSTimeCathode_p41", "Cathode Only Segment Time (ME +4/1) [ns]", 200, -200, 200));
607  hSTimeCathodeByChamberType.push_back(
608  ibooker.book1D("hSTimeCathode_p42", "Cathode Only Segment Time (ME +4/2) [ns]", 200, -200, 200));
609 
610  hSTimeCombined = ibooker.book1D("hSTimeCombined", "Segment Time (anode+cathode times) [ns]", 200, -200, 200);
611  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
612  "hSTimeCombined_m42", "Segment Time (anode+cathode times) Segment Time (ME -4/2) [ns]", 200, -200, 200));
613  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
614  "hSTimeCombined_m41", "Segment Time (anode+cathode times) Segment Time (ME -4/1) [ns]", 200, -200, 200));
615  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
616  "hSTimeCombined_m32", "Segment Time (anode+cathode times) Segment Time (ME -3/2) [ns]", 200, -200, 200));
617  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
618  "hSTimeCombined_m31", "Segment Time (anode+cathode times) Segment Time (ME -3/2) [ns]", 200, -200, 200));
619  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
620  "hSTimeCombined_m22", "Segment Time (anode+cathode times) Segment Time (ME -2/2) [ns]", 200, -200, 200));
621  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
622  "hSTimeCombined_m21", "Segment Time (anode+cathode times) Segment Time (ME -2/1) [ns]", 200, -200, 200));
623  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
624  "hSTimeCombined_m11a", "Segment Time (anode+cathode times) Segment Time (ME -1/1a) [ns]", 200, -200, 200));
625  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
626  "hSTimeCombined_m13", "Segment Time (anode+cathode times) Segment Time (ME -1/3) [ns]", 200, -200, 200));
627  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
628  "hSTimeCombined_m12", "Segment Time (anode+cathode times) Segment Time (ME -1/2) [ns]", 200, -200, 200));
629  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
630  "hSTimeCombined_m11b", "Segment Time (anode+cathode times) Segment Time (ME -1/1b) [ns]", 200, -200, 200));
631  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
632  "hSTimeCombined_p11b", "Segment Time (anode+cathode times) Segment Time (ME +1/1b) [ns]", 200, -200, 200));
633  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
634  "hSTimeCombined_p12", "Segment Time (anode+cathode times) Segment Time (ME +1/2) [ns]", 200, -200, 200));
635  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
636  "hSTimeCombined_p13", "Segment Time (anode+cathode times) Segment Time (ME +1/3) [ns]", 200, -200, 200));
637  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
638  "hSTimeCombined_p11a", "Segment Time (anode+cathode times) Segment Time (ME +1/1a) [ns]", 200, -200, 200));
639  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
640  "hSTimeCombined_p21", "Segment Time (anode+cathode times) Segment Time (ME +2/1) [ns]", 200, -200, 200));
641  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
642  "hSTimeCombined_p22", "Segment Time (anode+cathode times) Segment Time (ME +2/2) [ns]", 200, -200, 200));
643  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
644  "hSTimeCombined_p31", "Segment Time (anode+cathode times) Segment Time (ME +3/1) [ns]", 200, -200, 200));
645  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
646  "hSTimeCombined_p32", "Segment Time (anode+cathode times) Segment Time (ME +3/2) [ns]", 200, -200, 200));
647  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
648  "hSTimeCombined_p41", "Segment Time (anode+cathode times) Segment Time (ME +4/1) [ns]", 200, -200, 200));
649  hSTimeCombinedByChamberType.push_back(ibooker.book1D(
650  "hSTimeCombined_p42", "Segment Time (anode+cathode times) Segment Time (ME +4/2) [ns]", 200, -200, 200));
651 
652  hSTimeDiffSerial =
653  ibooker.book2D("hSTimeDiffSerial", "Anode Minus Cathode Segment Time [ns]", 601, -0.5, 600.5, 200, -50, 50);
654  hSTimeAnodeSerial =
655  ibooker.book2D("hSTimeAnodeSerial", "Anode Only Segment Time [ns]", 601, -0.5, 600.5, 200, -200, 200);
656  hSTimeCathodeSerial =
657  ibooker.book2D("hSTimeCathodeSerial", "Cathode Only Segment Time [ns]", 601, -0.5, 600.5, 200, -200, 200);
658  hSTimeCombinedSerial = ibooker.book2D(
659  "hSTimeCombinedSerial", "Segment Time (anode+cathode times) [ns]", 601, -0.5, 600.5, 200, -200, 200);
660 
661  hSTimeVsZ = ibooker.book2D("hSTimeVsZ", "Segment Time vs. Z; [ns] vs. [cm]", 200, -1200, 1200, 200, -200, 200);
662  hSTimeVsTOF =
663  ibooker.book2D("hSTimeVsTOF", "Segment Time vs. Distance from IP; [ns] vs. [cm]", 180, 500, 1400, 200, -200, 200);
664 
665  // resolution
666  ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/Resolution");
667 
668  hSResid.push_back(ibooker.book1D(
669  "hSResidm42", "Fitted Position on Strip - Reconstructed for Layer 3 (ME -4/2); Strip Widths", 100, -0.5, 0.5));
670  hSResid.push_back(ibooker.book1D(
671  "hSResidm41", "Fitted Position on Strip - Reconstructed for Layer 3 (ME -4/1); Strip Widths", 100, -0.5, 0.5));
672  hSResid.push_back(ibooker.book1D(
673  "hSResidm32", "Fitted Position on Strip - Reconstructed for Layer 3 (ME -3/2); Strip Widths", 100, -0.5, 0.5));
674  hSResid.push_back(ibooker.book1D(
675  "hSResidm31", "Fitted Position on Strip - Reconstructed for Layer 3 (ME -3/1); Strip Widths", 100, -0.5, 0.5));
676  hSResid.push_back(ibooker.book1D(
677  "hSResidm22", "Fitted Position on Strip - Reconstructed for Layer 3 (ME -2/2); Strip Widths", 100, -0.5, 0.5));
678  hSResid.push_back(ibooker.book1D(
679  "hSResidm21", "Fitted Position on Strip - Reconstructed for Layer 3 (ME -2/1); Strip Widths", 100, -0.5, 0.5));
680  hSResid.push_back(ibooker.book1D(
681  "hSResidm11a", "Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/1a); Strip Widths", 100, -0.5, 0.5));
682  hSResid.push_back(ibooker.book1D(
683  "hSResidm13", "Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/3); Strip Widths", 100, -0.5, 0.5));
684  hSResid.push_back(ibooker.book1D(
685  "hSResidm12", "Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/2); Strip Widths", 100, -0.5, 0.5));
686  hSResid.push_back(ibooker.book1D(
687  "hSResidm11b", "Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/1b); Strip Widths", 100, -0.5, 0.5));
688  hSResid.push_back(ibooker.book1D(
689  "hSResidp11b", "Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/1b); Strip Widths", 100, -0.5, 0.5));
690  hSResid.push_back(ibooker.book1D(
691  "hSResidp12", "Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/2); Strip Widths", 100, -0.5, 0.5));
692  hSResid.push_back(ibooker.book1D(
693  "hSResidp13", "Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/3); Strip Widths", 100, -0.5, 0.5));
694  hSResid.push_back(ibooker.book1D(
695  "hSResidp11a", "Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/1a); Strip Widths", 100, -0.5, 0.5));
696  hSResid.push_back(ibooker.book1D(
697  "hSResidp21", "Fitted Position on Strip - Reconstructed for Layer 3 (ME +2/1); Strip Widths", 100, -0.5, 0.5));
698  hSResid.push_back(ibooker.book1D(
699  "hSResidp22", "Fitted Position on Strip - Reconstructed for Layer 3 (ME +2/2); Strip Widths", 100, -0.5, 0.5));
700  hSResid.push_back(ibooker.book1D(
701  "hSResidp31", "Fitted Position on Strip - Reconstructed for Layer 3 (ME +3/1); Strip Widths", 100, -0.5, 0.5));
702  hSResid.push_back(ibooker.book1D(
703  "hSResidp32", "Fitted Position on Strip - Reconstructed for Layer 3 (ME +3/2); Strip Widths", 100, -0.5, 0.5));
704  hSResid.push_back(ibooker.book1D(
705  "hSResidp41", "Fitted Position on Strip - Reconstructed for Layer 3 (ME +4/1); Strip Widths", 100, -0.5, 0.5));
706  hSResid.push_back(ibooker.book1D(
707  "hSResidp42", "Fitted Position on Strip - Reconstructed for Layer 3 (ME +4/2); Strip Widths", 100, -0.5, 0.5));
708 
709  // efficiency
710  ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/Efficiency");
711 
712  // hSSTE = ibooker.book1D("hSSTE","hSSTE",40,0.5,40.5);
713  // hRHSTE = ibooker.book1D("hRHSTE","hRHSTE",40,0.5,40.5);
714  hSnum = ibooker.book1D("hSnum", "CSC w rechits in 2+ layers && segment(s)", 20, 0.5, 20.5);
715  hSden = ibooker.book1D("hSden", "CSC w rechits in 2+ layers", 20, 0.5, 20.5);
716  hRHnum = ibooker.book1D("hRHnum", "CSC w segment(s) && rechits in 6 layers", 20, 0.5, 20.5);
717  hRHden = ibooker.book1D("hRHden", "CSC w segment(s)", 20, 0.5, 20.5);
718  applyCSClabels(hSnum, EXTENDED, X);
719  applyCSClabels(hSden, EXTENDED, X);
720  applyCSClabels(hRHnum, EXTENDED, X);
721  applyCSClabels(hRHden, EXTENDED, X);
722 
723  // hSEff = ibooker.book1D("hSEff","Segment Efficiency",20,0.5,20.5);
724  // hRHEff = ibooker.book1D("hRHEff","recHit Efficiency",20,0.5,20.5);
725  hSSTE2 = ibooker.book2D("hSSTE2", "hSSTE2", 36, 0.5, 36.5, 20, 0.5, 20.5);
726  hRHSTE2 = ibooker.book2D("hRHSTE2", "hRHSTE2", 36, 0.5, 36.5, 20, 0.5, 20.5);
727  hStripSTE2 = ibooker.book2D("hStripSTE2", "hStripSTE2", 36, 0.5, 36.5, 20, 0.5, 20.5);
728  hWireSTE2 = ibooker.book2D("hWireSTE2", "hWireSTE2", 36, 0.5, 36.5, 20, 0.5, 20.5);
729  hEffDenominator = ibooker.book2D("hEffDenominator", "hEffDenominator", 36, 0.5, 36.5, 20, 0.5, 20.5);
730  // hSEff2 = ibooker.book2D("hSEff2","Segment Efficiency 2D",36,0.5,36.5, 18, 0.5, 18.5);
731  // hRHEff2 = ibooker.book2D("hRHEff2","recHit Efficiency 2D",36,0.5,36.5, 18, 0.5, 18.5);
732  // hStripReadoutEff2 = ibooker.book2D("hStripReadoutEff2","strip readout ratio [(strip+clct+wires)/(clct+wires)] 2D",36,0.5,36.5, 20, 0.5, 20.5);
733  // hStripReadoutEff2->setAxisTitle("Chamber #");
734  // hStripEff2 = ibooker.book2D("hStripEff2","strip Efficiency 2D",36,0.5,36.5, 18, 0.5, 18.5);
735  // hWireEff2 = ibooker.book2D("hWireEff2","wire Efficiency 2D",36,0.5,36.5, 18, 0.5, 18.5);
736  hSensitiveAreaEvt =
737  ibooker.book2D("hSensitiveAreaEvt", "Events Passing Selection for Efficiency", 36, 0.5, 36.5, 20, 0.5, 20.5);
738 
739  // bx monitor for trigger synchronization
740  ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/BXMonitor");
741 
742  hALCTgetBX = ibooker.book1D("hALCTgetBX", "ALCT position in ALCT-L1A match window [BX]", 7, -0.5, 6.5);
743  // hALCTgetBXChamberMeans = ibooker.book1D("hALCTgetBXChamberMeans","Chamber Mean ALCT position in ALCT-L1A match window [BX]",60,0,6);
744  hALCTgetBXSerial =
745  ibooker.book2D("hALCTgetBXSerial", "ALCT position in ALCT-L1A match window [BX]", 601, -0.5, 600.5, 7, -0.5, 6.5);
746  hALCTgetBXSerial->setAxisTitle("Chamber Serial Number");
747  hALCTgetBX2DNumerator = ibooker.book2D(
748  "hALCTgetBX2DNumerator", "ALCT position in ALCT-L1A match window [BX] (sum)", 36, 0.5, 36.5, 20, 0.5, 20.5);
749  // hALCTgetBX2DMeans = ibooker.book2D("hALCTgetBX2DMeans","ALCT position in ALCT-L1A match window [BX]",36,0.5,36.5,20,0.5,20.5);
750  hALCTgetBX2Denominator =
751  ibooker.book2D("hALCTgetBX2Denominator", "Number of ALCT Digis checked", 36, 0.5, 36.5, 20, 0.5, 20.5);
752  // hALCTgetBX2DMeans->setAxisTitle("Chamber #");
753  hALCTgetBX2Denominator->setAxisTitle("Chamber #");
754  hALCTMatch = ibooker.book1D("hALCTMatch", "ALCT position in ALCT-CLCT match window [BX]", 7, -0.5, 6.5);
755  // hALCTMatchChamberMeans = ibooker.book1D("hALCTMatchChamberMeans","Chamber Mean ALCT position in ALCT-CLCT match window [BX]",60,0,6);
756  hALCTMatchSerial = ibooker.book2D(
757  "hALCTMatchSerial", "ALCT position in ALCT-CLCT match window [BX]", 601, -0.5, 600.5, 7, -0.5, 6.5);
758  hALCTMatchSerial->setAxisTitle("Chamber Serial Number");
759  hALCTMatch2DNumerator = ibooker.book2D(
760  "hALCTMatch2DNumerator", "ALCT position in ALCT-CLCT match window [BX] (sum)", 36, 0.5, 36.5, 20, 0.5, 20.5);
761  // hALCTMatch2DMeans = ibooker.book2D("hALCTMatch2DMeans","ALCT position in ALCT-CLCT match window [BX]",36,0.5,36.5,20,0.5,20.5);
762  hALCTMatch2Denominator =
763  ibooker.book2D("hALCTMatch2Denominator", "Number of ALCT-CLCT matches checked", 36, 0.5, 36.5, 20, 0.5, 20.5);
764  // hALCTMatch2DMeans->setAxisTitle("Chamber #");
765  hALCTMatch2Denominator->setAxisTitle("Chamber #");
766  hCLCTL1A = ibooker.book1D("hCLCTL1A", "L1A - CLCTpreTrigger at TMB [BX]", 40, 149.5, 189.5);
767  // hCLCTL1AChamberMeans = ibooker.book1D("hCLCTL1AChamberMeans","Chamber Mean L1A - CLCTpreTrigger at TMB [BX]",90,150,159);
768  hCLCTL1ASerial =
769  ibooker.book2D("hCLCTL1ASerial", "L1A - CLCTpreTrigger at TMB [BX]", 601, -0.5, 600.5, 40, 149.5, 189.5);
770  hCLCTL1ASerial->setAxisTitle("Chamber Serial Number");
771  hCLCTL1A2DNumerator =
772  ibooker.book2D("hCLCTL1A2DNumerator", "L1A - CLCTpreTrigger at TMB [BX] (sum)", 36, 0.5, 36.5, 20, 0.5, 20.5);
773  // hCLCTL1A2DMeans = ibooker.book2D("hCLCTL1A2DMeans","L1A - CLCTpreTrigger at TMB [BX]",36,0.5,36.5,20,0.5,20.5);
774  hCLCTL1A2Denominator =
775  ibooker.book2D("hCLCTL1A2Denominator", "Number of TMB CLCTs checked", 36, 0.5, 36.5, 20, 0.5, 20.5);
776 
777  // labels
778  applyCSClabels(hOWiresAndCLCT, EXTENDED, Y);
779  applyCSClabels(hOWires, EXTENDED, Y);
780  applyCSClabels(hOStrips, EXTENDED, Y);
781  applyCSClabels(hOStripsAndWiresAndCLCT, EXTENDED, Y);
782  applyCSClabels(hORecHits, EXTENDED, Y);
783  applyCSClabels(hOSegments, EXTENDED, Y);
784  // applyCSClabels(hSEff, EXTENDED, X);
785  // applyCSClabels(hRHEff, EXTENDED, X);
786  // applyCSClabels(hSEff2, SMALL, Y);
787  applyCSClabels(hSSTE2, EXTENDED, Y);
788  applyCSClabels(hEffDenominator, EXTENDED, Y);
789  // applyCSClabels(hRHEff2, SMALL, Y);
790  applyCSClabels(hRHSTE2, EXTENDED, Y);
791  // applyCSClabels(hStripReadoutEff2, EXTENDED, Y);
792  // applyCSClabels(hStripEff2, SMALL, Y);
793  applyCSClabels(hStripSTE2, EXTENDED, Y);
794  // applyCSClabels(hWireEff2, SMALL, Y);
795  applyCSClabels(hWireSTE2, EXTENDED, Y);
796  applyCSClabels(hSensitiveAreaEvt, EXTENDED, Y);
797  // applyCSClabels(hALCTgetBX2DMeans, EXTENDED, Y);
798  applyCSClabels(hALCTgetBX2Denominator, EXTENDED, Y);
799  // applyCSClabels(hALCTMatch2DMeans, EXTENDED, Y);
800  applyCSClabels(hALCTMatch2Denominator, EXTENDED, Y);
801  // applyCSClabels(hCLCTL1A2DMeans, EXTENDED, Y);
802  applyCSClabels(hCLCTL1A2Denominator, EXTENDED, Y);
803 }
804 
806 // Analysis //
813  event.getByToken(sd_token, strips);
814  event.getByToken(wd_token, wires);
815  event.getByToken(al_token, alcts);
816  event.getByToken(cl_token, clcts);
817 
818  // Get the CSC Geometry :
820  eventSetup.get<MuonGeometryRecord>().get(cscGeom);
821 
822  // Get the RecHits collection :
824  event.getByToken(rh_token, recHits);
825 
826  // get CSC segment collection
828  event.getByToken(se_token, cscSegments);
829 
830  doOccupancies(strips, wires, recHits, cscSegments, clcts);
831  doStripDigis(strips);
832  doWireDigis(wires);
833  doRecHits(recHits, strips, cscGeom);
834  doSegments(cscSegments, cscGeom);
835  doResolution(cscSegments, cscGeom);
836  doPedestalNoise(strips, cscGeom);
837  doEfficiencies(wires, strips, recHits, cscSegments, cscGeom);
838  doBXMonitor(alcts, clcts, event, eventSetup);
839 }
840 
841 // ==============================================
842 //
843 // look at Occupancies
844 //
845 // ==============================================
846 
852  bool clcto[2][4][4][36];
853  bool wireo[2][4][4][36];
854  bool stripo[2][4][4][36];
855  bool rechito[2][4][4][36];
856  bool segmento[2][4][4][36];
857 
858  bool hasWires = false;
859  bool hasStrips = false;
860  bool hasRecHits = false;
861  bool hasSegments = false;
862 
863  for (int e = 0; e < 2; e++) {
864  for (int s = 0; s < 4; s++) {
865  for (int r = 0; r < 4; r++) {
866  for (int c = 0; c < 36; c++) {
867  clcto[e][s][r][c] = false;
868  wireo[e][s][r][c] = false;
869  stripo[e][s][r][c] = false;
870  rechito[e][s][r][c] = false;
871  segmento[e][s][r][c] = false;
872  }
873  }
874  }
875  }
876 
877  //clcts
878  for (CSCCLCTDigiCollection::DigiRangeIterator j = clcts->begin(); j != clcts->end(); j++) {
879  CSCDetId id = (CSCDetId)(*j).first;
880  int kEndcap = id.endcap();
881  int kRing = id.ring();
882  int kStation = id.station();
883  int kChamber = id.chamber();
884  const CSCCLCTDigiCollection::Range& range = (*j).second;
885  for (CSCCLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) {
886  // Valid digi in the chamber (or in neighbouring chamber)
887  if ((*digiIt).isValid()) {
888  //Check whether this CLCT came from ME11a
889  if (kStation == 1 && kRing == 1 && (*digiIt).getKeyStrip() > 128)
890  kRing = 4;
891  clcto[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1] = true;
892  }
893  }
894  }
895 
896  //wires
897  for (CSCWireDigiCollection::DigiRangeIterator wi = wires->begin(); wi != wires->end(); wi++) {
898  CSCDetId id = (CSCDetId)(*wi).first;
899  int kEndcap = id.endcap();
900  int kRing = id.ring();
901  int kStation = id.station();
902  int kChamber = id.chamber();
903  std::vector<CSCWireDigi>::const_iterator wireIt = (*wi).second.first;
904  std::vector<CSCWireDigi>::const_iterator lastWire = (*wi).second.second;
905  for (; wireIt != lastWire; ++wireIt) {
906  if (!wireo[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1]) {
907  wireo[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1] = true;
908  hOWires->Fill(kChamber, typeIndex(id, 2));
909  hOWireSerial->Fill(chamberSerial(id));
910  hasWires = true;
911  if (clcto[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1])
912  hOWiresAndCLCT->Fill(kChamber, typeIndex(id, 2));
913  //Also check for a CLCT in ME11a if you're in ME11 already
914  if (kStation == 1 && kRing == 1 && clcto[kEndcap - 1][kStation - 1][3][kChamber - 1]) {
915  CSCDetId idME11a = CSCDetId(kEndcap, kStation, 4, kChamber);
916  hOWiresAndCLCT->Fill(kChamber, typeIndex(idME11a, 2));
917  }
918  }
919  } //end for loop
920  }
921 
922  //strips
923  for (CSCStripDigiCollection::DigiRangeIterator si = strips->begin(); si != strips->end(); si++) {
924  CSCDetId id = (CSCDetId)(*si).first;
925  int kEndcap = id.endcap();
926  int kRing = id.ring();
927  int kStation = id.station();
928  int kChamber = id.chamber();
929  std::vector<CSCStripDigi>::const_iterator stripIt = (*si).second.first;
930  std::vector<CSCStripDigi>::const_iterator lastStrip = (*si).second.second;
931  for (; stripIt != lastStrip; ++stripIt) {
932  std::vector<int> myADCVals = stripIt->getADCCounts();
933  bool thisStripFired = false;
934  float thisPedestal = 0.5 * (float)(myADCVals[0] + myADCVals[1]);
935  float threshold = 13.3;
936  float diff = 0.;
937  for (unsigned int iCount = 0; iCount < myADCVals.size(); iCount++) {
938  diff = (float)myADCVals[iCount] - thisPedestal;
939  if (diff > threshold) {
940  thisStripFired = true;
941  }
942  }
943  if (thisStripFired) {
944  if (!stripo[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1]) {
945  stripo[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1] = true;
946  hOStrips->Fill(kChamber, typeIndex(id, 2));
947  hOStripSerial->Fill(chamberSerial(id));
948  hasStrips = true;
949  if (clcto[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1]) {
950  // check if there is a wire digi in this chamber too
951  // for ME 1/4 check for a wire in ME 1/1
952  if (wireo[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1] ||
953  (kRing == 4 && wireo[kEndcap - 1][kStation - 1][0][kChamber - 1])) {
954  hOStripsAndWiresAndCLCT->Fill(kChamber, typeIndex(id, 2));
955  }
956  } //end clct and wire digi check
957  }
958  } //end if (thisStripFired)
959  }
960  }
961 
962  //rechits
964  for (recIt = recHits->begin(); recIt != recHits->end(); recIt++) {
965  CSCDetId idrec = (CSCDetId)(*recIt).cscDetId();
966  int kEndcap = idrec.endcap();
967  int kRing = idrec.ring();
968  int kStation = idrec.station();
969  int kChamber = idrec.chamber();
970  if (!rechito[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1]) {
971  rechito[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1] = true;
972  hORecHitsSerial->Fill(chamberSerial(idrec));
973  hORecHits->Fill(kChamber, typeIndex(idrec, 2));
974  hasRecHits = true;
975  }
976  }
977 
978  //segments
979  for (CSCSegmentCollection::const_iterator segIt = cscSegments->begin(); segIt != cscSegments->end(); segIt++) {
980  CSCDetId id = (CSCDetId)(*segIt).cscDetId();
981  int kEndcap = id.endcap();
982  int kRing = id.ring();
983  int kStation = id.station();
984  int kChamber = id.chamber();
985  if (!segmento[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1]) {
986  segmento[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1] = true;
987  hOSegmentsSerial->Fill(chamberSerial(id));
988  hOSegments->Fill(kChamber, typeIndex(id, 2));
989  hasSegments = true;
990  }
991  }
992 
993  //Overall CSC Occupancy
994  hCSCOccupancy->Fill(1);
995  if (hasWires)
996  hCSCOccupancy->Fill(3);
997  if (hasStrips)
998  hCSCOccupancy->Fill(5);
999  if (hasWires && hasStrips)
1000  hCSCOccupancy->Fill(7);
1001  if (hasRecHits)
1002  hCSCOccupancy->Fill(9);
1003  if (hasSegments)
1004  hCSCOccupancy->Fill(11);
1005 }
1006 
1007 // ==============================================
1008 //
1009 // look at WIRE DIGIs
1010 //
1011 // ==============================================
1012 
1014  int nWireGroupsTotal = 0;
1015  for (CSCWireDigiCollection::DigiRangeIterator dWDiter = wires->begin(); dWDiter != wires->end(); dWDiter++) {
1016  CSCDetId id = (CSCDetId)(*dWDiter).first;
1017  std::vector<CSCWireDigi>::const_iterator wireIter = (*dWDiter).second.first;
1018  std::vector<CSCWireDigi>::const_iterator lWire = (*dWDiter).second.second;
1019  for (; wireIter != lWire; ++wireIter) {
1020  int myWire = wireIter->getWireGroup();
1021  int myTBin = wireIter->getTimeBin();
1022  nWireGroupsTotal++;
1023  hWireTBin[typeIndex(id) - 1]->Fill(myTBin);
1024  hWireNumber[typeIndex(id) - 1]->Fill(myWire);
1025  }
1026  } // end wire loop
1027 
1028  // this way you can zero suppress but still store info on # events with no digis
1029  // Tim: I'm unhappy with that since it breaks hist statistics
1030  // if (nWireGroupsTotal == 0) nWireGroupsTotal = -1;
1031  hWirenGroupsTotal->Fill(nWireGroupsTotal);
1032 }
1033 
1034 // ==============================================
1035 //
1036 // look at STRIP DIGIs
1037 //
1038 // ==============================================
1039 
1041  int nStripsFired = 0;
1042  for (CSCStripDigiCollection::DigiRangeIterator dSDiter = strips->begin(); dSDiter != strips->end(); dSDiter++) {
1043  CSCDetId id = (CSCDetId)(*dSDiter).first;
1044  std::vector<CSCStripDigi>::const_iterator stripIter = (*dSDiter).second.first;
1045  std::vector<CSCStripDigi>::const_iterator lStrip = (*dSDiter).second.second;
1046  for (; stripIter != lStrip; ++stripIter) {
1047  int myStrip = stripIter->getStrip();
1048  std::vector<int> myADCVals = stripIter->getADCCounts();
1049  bool thisStripFired = false;
1050  float thisPedestal = 0.5 * (float)(myADCVals[0] + myADCVals[1]);
1051  float threshold = 13.3;
1052  float diff = 0.;
1053  for (unsigned int iCount = 0; iCount < myADCVals.size(); iCount++) {
1054  diff = (float)myADCVals[iCount] - thisPedestal;
1055  if (diff > threshold) {
1056  thisStripFired = true;
1057  }
1058  }
1059  if (thisStripFired) {
1060  nStripsFired++;
1061  hStripNumber[typeIndex(id) - 1]->Fill(myStrip);
1062  }
1063  }
1064  } // end strip loop
1065 
1066  // this way you can zero suppress but still store info on # events with no digis
1067  // Tim: I guess the above comment means 'zero suppress' because the hist range is from -0.5.
1068  // But doing this means the hist statistics are broken. If the zero bin is high, just apply log scale?
1069  // if (nStripsFired == 0) nStripsFired = -1;
1070  hStripNFired->Fill(nStripsFired);
1071  // fill n per event
1072 }
1073 
1074 //=======================================================
1075 //
1076 // Look at the Pedestal Noise Distributions
1077 //
1078 //=======================================================
1079 
1081  edm::ESHandle<CSCGeometry> cscGeom) {
1082  for (CSCStripDigiCollection::DigiRangeIterator dPNiter = strips->begin(); dPNiter != strips->end(); dPNiter++) {
1083  CSCDetId id = (CSCDetId)(*dPNiter).first;
1084  int kStation = id.station();
1085  int kRing = id.ring();
1086  std::vector<CSCStripDigi>::const_iterator pedIt = (*dPNiter).second.first;
1087  std::vector<CSCStripDigi>::const_iterator lStrip = (*dPNiter).second.second;
1088  for (; pedIt != lStrip; ++pedIt) {
1089  int myStrip = pedIt->getStrip();
1090  std::vector<int> myADCVals = pedIt->getADCCounts();
1091  float TotalADC = getSignal(*strips, id, myStrip);
1092  bool thisStripFired = false;
1093  float thisPedestal = 0.5 * (float)(myADCVals[0] + myADCVals[1]);
1094  float thisSignal =
1095  (1. / 6) * (myADCVals[2] + myADCVals[3] + myADCVals[4] + myADCVals[5] + myADCVals[6] + myADCVals[7]);
1096  float threshold = 13.3;
1097 
1098  // Why is this code block even here? Doesn't use myStrip after setting it (converts channel to strip
1099  // for ganged ME11A
1100  if ((kStation == 1 && kRing == 4) && cscGeom->gangedStrips()) {
1101  kRing = 1;
1102  if (myStrip <= 16)
1103  myStrip += 64; // no trapping for any bizarreness
1104  }
1105 
1106  if (TotalADC > threshold) {
1107  thisStripFired = true;
1108  }
1109  if (!thisStripFired) {
1110  float ADC = thisSignal - thisPedestal;
1111  hStripPed[typeIndex(id) - 1]->Fill(ADC);
1112  }
1113  }
1114  }
1115 }
1116 
1117 // ==============================================
1118 //
1119 // look at RECHITs
1120 //
1121 // ==============================================
1122 
1125  edm::ESHandle<CSCGeometry> cscGeom) {
1126  // Get the RecHits collection :
1127  int nRecHits = recHits->size();
1128 
1129  // ---------------------
1130  // Loop over rechits
1131  // ---------------------
1132  // Build iterator for rechits and loop :
1134  for (dRHIter = recHits->begin(); dRHIter != recHits->end(); dRHIter++) {
1135  // Find chamber with rechits in CSC
1136  CSCDetId idrec = (CSCDetId)(*dRHIter).cscDetId();
1137 
1138  // Store rechit as a Local Point:
1139  LocalPoint rhitlocal = (*dRHIter).localPosition();
1140  //float xreco = rhitlocal.x();
1141  //float yreco = rhitlocal.y();
1142 
1143  // Get the reconstucted strip position and error
1144  float stpos = (*dRHIter).positionWithinStrip();
1145  float sterr = (*dRHIter).errorWithinStrip();
1146 
1148 
1149  int adcsize = dRHIter->nStrips() * dRHIter->nTimeBins();
1150  float rHSumQ = 0;
1151  float sumsides = 0;
1152  for (unsigned int i = 0; i < dRHIter->nStrips(); i++) {
1153  for (unsigned int j = 0; j < dRHIter->nTimeBins() - 1; j++) {
1154  rHSumQ += dRHIter->adcs(i, j);
1155  if (i != 1)
1156  sumsides += dRHIter->adcs(i, j); // skip central strip
1157  }
1158  }
1159 
1160  float rHratioQ = sumsides / rHSumQ;
1161  if (adcsize != 12)
1162  rHratioQ = -99;
1163 
1164  // Get the signal timing of this hit
1165  float rHtime = (*dRHIter).tpeak(); //calculated from cathode SCA bins
1166  float rHtimeAnode = (*dRHIter).wireTime(); // calculated from anode wire bx
1167 
1168  // Get pointer to the layer:
1169  const CSCLayer* csclayer = cscGeom->layer(idrec);
1170 
1171  // Transform hit position from local chamber geometry to global CMS geom
1172  GlobalPoint rhitglobal = csclayer->toGlobal(rhitlocal);
1173  float grecx = rhitglobal.x();
1174  float grecy = rhitglobal.y();
1175 
1176  // Fill some histograms
1177  int sIndex = idrec.station() + ((idrec.endcap() - 1) * 4);
1178  int tIndex = typeIndex(idrec);
1179  hRHSumQ[tIndex - 1]->Fill(rHSumQ);
1180  hRHRatioQ[tIndex - 1]->Fill(rHratioQ);
1181  hRHstpos[tIndex - 1]->Fill(stpos);
1182  hRHsterr[tIndex - 1]->Fill(sterr);
1183  hRHTiming[tIndex - 1]->Fill(rHtime);
1184  hRHTimingAnode[tIndex - 1]->Fill(rHtimeAnode);
1185  hRHGlobal[sIndex - 1]->Fill(grecx, grecy);
1186 
1187  } //end rechit loop
1188 
1189  // if (nRecHits == 0) nRecHits = -1; // I see no point in doing this
1190  hRHnrechits->Fill(nRecHits);
1191 }
1192 
1193 // ==============================================
1194 //
1195 // look at SEGMENTs
1196 //
1197 // ===============================================
1198 
1200  // get CSC segment collection
1201  int nSegments = cscSegments->size();
1202 
1203  for (CSCSegmentCollection::const_iterator dSiter = cscSegments->begin(); dSiter != cscSegments->end(); dSiter++) {
1204  CSCDetId id = (CSCDetId)(*dSiter).cscDetId();
1205  float chisq = (*dSiter).chi2();
1206  int nhits = (*dSiter).nRecHits();
1207  int nDOF = 2 * nhits - 4;
1208  float nChi2 = chisq / nDOF;
1209  double chisqProb = ChiSquaredProbability((double)chisq, nDOF);
1210  LocalPoint localPos = (*dSiter).localPosition();
1211  LocalVector segDir = (*dSiter).localDirection();
1212 
1213  // prepare to calculate segment times
1214  float timeCathode = 0; //average from cathode information alone
1215  float timeAnode = 0; //average from pruned anode information alone
1216  float timeCombined = 0; //average from cathode hits and pruned anode list
1217  std::vector<float> cathodeTimes;
1218  std::vector<float> anodeTimes;
1219  // Get the CSC recHits that contribute to this segment.
1220  std::vector<CSCRecHit2D> theseRecHits = (*dSiter).specificRecHits();
1221  for (vector<CSCRecHit2D>::const_iterator iRH = theseRecHits.begin(); iRH != theseRecHits.end(); iRH++) {
1222  if (!((*iRH).isValid()))
1223  continue; // only interested in valid hits
1224  cathodeTimes.push_back((*iRH).tpeak());
1225  anodeTimes.push_back((*iRH).wireTime());
1226  } //end rechit loop
1227 
1228  // Calculate cathode average
1229  for (unsigned int i = 0; i < cathodeTimes.size(); i++)
1230  timeCathode += cathodeTimes[i] / cathodeTimes.size();
1231 
1232  // Prune the anode list to deal with the late tail
1233  float anodeMaxDiff;
1234  bool modified = false;
1235  std::vector<float>::iterator anodeMaxHit;
1236  do {
1237  if (anodeTimes.empty())
1238  continue;
1239  timeAnode = 0;
1240  anodeMaxDiff = 0;
1241  modified = false;
1242 
1243  // Find the average
1244  for (unsigned int j = 0; j < anodeTimes.size(); j++)
1245  timeAnode += anodeTimes[j] / anodeTimes.size();
1246 
1247  // Find the maximum outlier hit
1248  for (unsigned int j = 0; j < anodeTimes.size(); j++) {
1249  if (fabs(anodeTimes[j] - timeAnode) > anodeMaxDiff) {
1250  anodeMaxHit = anodeTimes.begin() + j;
1251  anodeMaxDiff = fabs(anodeTimes[j] - timeAnode);
1252  }
1253  }
1254 
1255  // Cut hit if its greater than some time away
1256  if (anodeMaxDiff > 26) {
1257  modified = true;
1258  anodeTimes.erase(anodeMaxHit);
1259  }
1260  } while (modified);
1261 
1262  // Calculate combined anode and cathode time average
1263  if (cathodeTimes.size() + anodeTimes.size() > 0)
1264  timeCombined = (timeCathode * cathodeTimes.size() + timeAnode * anodeTimes.size()) /
1265  (cathodeTimes.size() + anodeTimes.size());
1266 
1267  // global transformation
1268  float globX = 0.;
1269  float globY = 0.;
1270  float globZ = 0.;
1271  float globTOF = 0.;
1272  float globTheta = 0.;
1273  float globPhi = 0.;
1274  const CSCChamber* cscchamber = cscGeom->chamber(id);
1275  if (cscchamber) {
1276  GlobalPoint globalPosition = cscchamber->toGlobal(localPos);
1277  globX = globalPosition.x();
1278  globY = globalPosition.y();
1279  globZ = globalPosition.z();
1280  globTOF = sqrt(globX * globX + globY * globY + globZ * globZ);
1281  GlobalVector globalDirection = cscchamber->toGlobal(segDir);
1282  globTheta = globalDirection.theta();
1283  globPhi = globalDirection.phi();
1284  }
1285 
1286  // Fill histos
1287  int tIndex = typeIndex(id);
1288  hSnhitsAll->Fill(nhits);
1289  hSnhits[tIndex - 1]->Fill(nhits);
1290  hSChiSqAll->Fill(nChi2);
1291  hSChiSq[tIndex - 1]->Fill(nChi2);
1292  hSChiSqProbAll->Fill(chisqProb);
1293  hSChiSqProb[tIndex - 1]->Fill(chisqProb);
1294  hSGlobalTheta->Fill(globTheta);
1295  hSGlobalPhi->Fill(globPhi);
1296  hSTimeDiff->Fill(timeAnode - timeCathode);
1297  hSTimeDiffByChamberType[tIndex - 1]->Fill(timeAnode - timeCathode);
1298  hSTimeAnode->Fill(timeAnode);
1299  hSTimeAnodeByChamberType[tIndex - 1]->Fill(timeAnode);
1300  hSTimeCathode->Fill(timeCathode);
1301  hSTimeCathodeByChamberType[tIndex - 1]->Fill(timeCathode);
1302  hSTimeCombined->Fill(timeCombined);
1303  hSTimeCombinedByChamberType[tIndex - 1]->Fill(timeCombined);
1304  hSTimeDiffSerial->Fill(chamberSerial(id), timeAnode - timeCathode);
1305  hSTimeAnodeSerial->Fill(chamberSerial(id), timeAnode);
1306  hSTimeCathodeSerial->Fill(chamberSerial(id), timeCathode);
1307  hSTimeCombinedSerial->Fill(chamberSerial(id), timeCombined);
1308  hSTimeVsZ->Fill(globZ, timeCombined);
1309  hSTimeVsTOF->Fill(globTOF, timeCombined);
1310 
1311  } // end segment loop
1312 
1313  // if (nSegments == 0) nSegments = -1; // I see no point in doing this
1314  hSnSegments->Fill(nSegments);
1315 }
1316 
1317 // ==============================================
1318 //
1319 // look at hit Resolution
1320 //
1321 // ==============================================
1323  edm::ESHandle<CSCGeometry> cscGeom) {
1324  for (CSCSegmentCollection::const_iterator dSiter = cscSegments->begin(); dSiter != cscSegments->end(); dSiter++) {
1325  CSCDetId id = (CSCDetId)(*dSiter).cscDetId();
1326  //
1327  // try to get the CSC recHits that contribute to this segment.
1328  std::vector<CSCRecHit2D> theseRecHits = (*dSiter).specificRecHits();
1329  int nRH = (*dSiter).nRecHits();
1330  int jRH = 0;
1331  CLHEP::HepMatrix sp(6, 1);
1332  CLHEP::HepMatrix se(6, 1);
1333  for (vector<CSCRecHit2D>::const_iterator iRH = theseRecHits.begin(); iRH != theseRecHits.end(); iRH++) {
1334  jRH++;
1335  CSCDetId idRH = (CSCDetId)(*iRH).cscDetId();
1336  //int kEndcap = idRH.endcap();
1337  int kRing = idRH.ring();
1338  int kStation = idRH.station();
1339  //int kChamber = idRH.chamber();
1340  int kLayer = idRH.layer();
1341 
1343  int centerid = iRH->nStrips() / 2 + 1;
1344  int centerStrip = iRH->channels(centerid - 1);
1345 
1346  // If this segment has 6 hits, find the position of each hit on the strip in units of stripwidth and store values
1347  if (nRH == 6) {
1348  float stpos = (*iRH).positionWithinStrip();
1349  se(kLayer, 1) = (*iRH).errorWithinStrip();
1350  // Take into account half-strip staggering of layers (ME1/1 has no staggering)
1351  if (kStation == 1 && (kRing == 1 || kRing == 4))
1352  sp(kLayer, 1) = stpos + centerStrip;
1353  else {
1354  if (kLayer == 1 || kLayer == 3 || kLayer == 5)
1355  sp(kLayer, 1) = stpos + centerStrip;
1356  if (kLayer == 2 || kLayer == 4 || kLayer == 6)
1357  sp(kLayer, 1) = stpos - 0.5 + centerStrip;
1358  }
1359  }
1360  }
1361 
1362  // Fit all points except layer 3, then compare expected value for layer 3 to reconstructed value
1363  // float residual = -99.; // used to fill always
1364  if (nRH == 6) {
1365  float expected = fitX(sp, se);
1366  float residual = expected - sp(3, 1);
1367 
1368  hSResid[typeIndex(id) - 1]->Fill(residual); // fill here so stats make sense
1369  }
1370 
1371  // hSResid[typeIndex(id)-1]->Fill(residual); // used to fill here but then stats distorted by underflows
1372 
1373  } // end segment loop
1374 }
1375 
1376 //-------------------------------------------------------------------------------------
1377 // Fits a straight line to a set of 5 points with errors. Functions assumes 6 points
1378 // and removes hit in layer 3. It then returns the expected position value in layer 3
1379 // based on the fit.
1380 //-------------------------------------------------------------------------------------
1381 float CSCOfflineMonitor::fitX(const CLHEP::HepMatrix& points, const CLHEP::HepMatrix& errors) {
1382  float S = 0;
1383  float Sx = 0;
1384  float Sy = 0;
1385  float Sxx = 0;
1386  float Sxy = 0;
1387  float sigma2 = 0;
1388 
1389  for (int i = 1; i < 7; i++) {
1390  if (i != 3) {
1391  sigma2 = errors(i, 1) * errors(i, 1);
1392  S = S + (1 / sigma2);
1393  Sy = Sy + (points(i, 1) / sigma2);
1394  Sx = Sx + ((i) / sigma2);
1395  Sxx = Sxx + (i * i) / sigma2;
1396  Sxy = Sxy + (((i)*points(i, 1)) / sigma2);
1397  }
1398  }
1399 
1400  float delta = S * Sxx - Sx * Sx;
1401  float intercept = (Sxx * Sy - Sx * Sxy) / delta;
1402  float slope = (S * Sxy - Sx * Sy) / delta;
1403 
1404  return (intercept + slope * 3);
1405 }
1406 
1407 //---------------------------------------------------------------------------------------
1408 // Given a set of digis, the CSCDetId, and the central strip of your choosing, returns
1409 // the avg. Signal-Pedestal for 6 time bin x 5 strip .
1410 //
1411 // Author: P. Jindal
1412 //---------------------------------------------------------------------------------------
1413 
1414 float CSCOfflineMonitor::getSignal(const CSCStripDigiCollection& stripdigis, CSCDetId idCS, int centerStrip) {
1415  float SigADC[5];
1416  float TotalADC = 0;
1417  SigADC[0] = 0;
1418  SigADC[1] = 0;
1419  SigADC[2] = 0;
1420  SigADC[3] = 0;
1421  SigADC[4] = 0;
1422 
1423  // Loop over strip digis
1425 
1426  for (sIt = stripdigis.begin(); sIt != stripdigis.end(); sIt++) {
1427  CSCDetId id = (CSCDetId)(*sIt).first;
1428  if (id == idCS) {
1429  // First, find the Signal-Pedestal for center strip
1430  vector<CSCStripDigi>::const_iterator digiItr = (*sIt).second.first;
1431  vector<CSCStripDigi>::const_iterator last = (*sIt).second.second;
1432  for (; digiItr != last; ++digiItr) {
1433  int thisStrip = digiItr->getStrip();
1434  if (thisStrip == (centerStrip)) {
1435  std::vector<int> myADCVals = digiItr->getADCCounts();
1436  float thisPedestal = 0.5 * (float)(myADCVals[0] + myADCVals[1]);
1437  float thisSignal = (myADCVals[2] + myADCVals[3] + myADCVals[4] + myADCVals[5] + myADCVals[6] + myADCVals[7]);
1438  SigADC[0] = thisSignal - 6 * thisPedestal;
1439  }
1440  // Now,find the Signal-Pedestal for neighbouring 4 strips
1441  if (thisStrip == (centerStrip + 1)) {
1442  std::vector<int> myADCVals = digiItr->getADCCounts();
1443  float thisPedestal = 0.5 * (float)(myADCVals[0] + myADCVals[1]);
1444  float thisSignal = (myADCVals[2] + myADCVals[3] + myADCVals[4] + myADCVals[5] + myADCVals[6] + myADCVals[7]);
1445  SigADC[1] = thisSignal - 6 * thisPedestal;
1446  }
1447  if (thisStrip == (centerStrip + 2)) {
1448  std::vector<int> myADCVals = digiItr->getADCCounts();
1449  float thisPedestal = 0.5 * (float)(myADCVals[0] + myADCVals[1]);
1450  float thisSignal = (myADCVals[2] + myADCVals[3] + myADCVals[4] + myADCVals[5] + myADCVals[6] + myADCVals[7]);
1451  SigADC[2] = thisSignal - 6 * thisPedestal;
1452  }
1453  if (thisStrip == (centerStrip - 1)) {
1454  std::vector<int> myADCVals = digiItr->getADCCounts();
1455  float thisPedestal = 0.5 * (float)(myADCVals[0] + myADCVals[1]);
1456  float thisSignal = (myADCVals[2] + myADCVals[3] + myADCVals[4] + myADCVals[5] + myADCVals[6] + myADCVals[7]);
1457  SigADC[3] = thisSignal - 6 * thisPedestal;
1458  }
1459  if (thisStrip == (centerStrip - 2)) {
1460  std::vector<int> myADCVals = digiItr->getADCCounts();
1461  float thisPedestal = 0.5 * (float)(myADCVals[0] + myADCVals[1]);
1462  float thisSignal = (myADCVals[2] + myADCVals[3] + myADCVals[4] + myADCVals[5] + myADCVals[6] + myADCVals[7]);
1463  SigADC[4] = thisSignal - 6 * thisPedestal;
1464  }
1465  }
1466  TotalADC = 0.2 * (SigADC[0] + SigADC[1] + SigADC[2] + SigADC[3] + SigADC[4]);
1467  }
1468  }
1469  return TotalADC;
1470 }
1471 
1472 //----------------------------------------------------------------------------
1473 // Calculate basic efficiencies for recHits and Segments
1474 // Author: S. Stoynev
1475 //----------------------------------------------------------------------------
1476 
1481  edm::ESHandle<CSCGeometry> cscGeom) {
1482  bool allWires[2][4][4][36][6];
1483  bool allStrips[2][4][4][36][6];
1484  bool AllRecHits[2][4][4][36][6];
1485  bool AllSegments[2][4][4][36];
1486 
1487  //bool MultiSegments[2][4][4][36];
1488  for (int iE = 0; iE < 2; iE++) {
1489  for (int iS = 0; iS < 4; iS++) {
1490  for (int iR = 0; iR < 4; iR++) {
1491  for (int iC = 0; iC < 36; iC++) {
1492  AllSegments[iE][iS][iR][iC] = false;
1493  //MultiSegments[iE][iS][iR][iC] = false;
1494  for (int iL = 0; iL < 6; iL++) {
1495  allWires[iE][iS][iR][iC][iL] = false;
1496  allStrips[iE][iS][iR][iC][iL] = false;
1497  AllRecHits[iE][iS][iR][iC][iL] = false;
1498  }
1499  }
1500  }
1501  }
1502  }
1503 
1504  // Wires
1505  for (CSCWireDigiCollection::DigiRangeIterator dWDiter = wires->begin(); dWDiter != wires->end(); dWDiter++) {
1506  CSCDetId idrec = (CSCDetId)(*dWDiter).first;
1507  std::vector<CSCWireDigi>::const_iterator wireIter = (*dWDiter).second.first;
1508  std::vector<CSCWireDigi>::const_iterator lWire = (*dWDiter).second.second;
1509  for (; wireIter != lWire; ++wireIter) {
1510  allWires[idrec.endcap() - 1][idrec.station() - 1][idrec.ring() - 1][idrec.chamber() - 1][idrec.layer() - 1] =
1511  true;
1512  break;
1513  }
1514  }
1515 
1516  //---- STRIPS
1517  for (CSCStripDigiCollection::DigiRangeIterator dSDiter = strips->begin(); dSDiter != strips->end(); dSDiter++) {
1518  CSCDetId idrec = (CSCDetId)(*dSDiter).first;
1519  std::vector<CSCStripDigi>::const_iterator stripIter = (*dSDiter).second.first;
1520  std::vector<CSCStripDigi>::const_iterator lStrip = (*dSDiter).second.second;
1521  for (; stripIter != lStrip; ++stripIter) {
1522  std::vector<int> myADCVals = stripIter->getADCCounts();
1523  bool thisStripFired = false;
1524  float thisPedestal = 0.5 * (float)(myADCVals[0] + myADCVals[1]);
1525  float threshold = 13.3;
1526  float diff = 0.;
1527  for (unsigned int iCount = 0; iCount < myADCVals.size(); iCount++) {
1528  diff = (float)myADCVals[iCount] - thisPedestal;
1529  if (diff > threshold) {
1530  thisStripFired = true;
1531  break;
1532  }
1533  }
1534  if (thisStripFired) {
1535  allStrips[idrec.endcap() - 1][idrec.station() - 1][idrec.ring() - 1][idrec.chamber() - 1][idrec.layer() - 1] =
1536  true;
1537  break;
1538  }
1539  }
1540  }
1541 
1542  // Rechits
1543  for (CSCRecHit2DCollection::const_iterator recEffIt = recHits->begin(); recEffIt != recHits->end(); recEffIt++) {
1544  //CSCDetId idrec = (CSCDetId)(*recIt).cscDetId();
1545  CSCDetId idrec = (CSCDetId)(*recEffIt).cscDetId();
1546  AllRecHits[idrec.endcap() - 1][idrec.station() - 1][idrec.ring() - 1][idrec.chamber() - 1][idrec.layer() - 1] =
1547  true;
1548  }
1549 
1550  std::vector<uint> seg_ME2(2, 0);
1551  std::vector<uint> seg_ME3(2, 0);
1552  std::vector<pair<CSCDetId, CSCSegment> > theSegments(4);
1553  // Segments
1554  for (CSCSegmentCollection::const_iterator segEffIt = cscSegments->begin(); segEffIt != cscSegments->end();
1555  segEffIt++) {
1556  CSCDetId idseg = (CSCDetId)(*segEffIt).cscDetId();
1557  //if(AllSegments[idrec.endcap() -1][idrec.station() -1][idrec.ring() -1][idrec.chamber()]){
1558  //MultiSegments[idrec.endcap() -1][idrec.station() -1][idrec.ring() -1][idrec.chamber()] = true;
1559  //}
1560  AllSegments[idseg.endcap() - 1][idseg.station() - 1][idseg.ring() - 1][idseg.chamber() - 1] = true;
1561  // "Intrinsic" efficiency measurement relies on "good" segment extrapolation - we need the pre-selection below
1562  // station 2 "good" segment will be used for testing efficiencies in ME1 and ME3
1563  // station 3 "good" segment will be used for testing efficiencies in ME2 and ME4
1564  if (2 == idseg.station() || 3 == idseg.station()) {
1565  uint seg_tmp;
1566  if (2 == idseg.station()) {
1567  ++seg_ME2[idseg.endcap() - 1];
1568  seg_tmp = seg_ME2[idseg.endcap() - 1];
1569  } else {
1570  ++seg_ME3[idseg.endcap() - 1];
1571  seg_tmp = seg_ME3[idseg.endcap() - 1];
1572  }
1573  // is the segment good
1574  if (1 == seg_tmp && 6 == (*segEffIt).nRecHits() && (*segEffIt).chi2() / (*segEffIt).degreesOfFreedom() < 3.) {
1575  pair<CSCDetId, CSCSegment> specSeg = make_pair((CSCDetId)(*segEffIt).cscDetId(), *segEffIt);
1576  theSegments[2 * (idseg.endcap() - 1) + (idseg.station() - 2)] = specSeg;
1577  }
1578  }
1579  /*
1580  if(2==idseg.station()){
1581  ++seg_ME2[idseg.endcap() -1];
1582  if(1==seg_ME2[idseg.endcap() -1] && 6==(*segEffIt).nRecHits() && (*segEffIt).chi2()/(*segEffIt).degreesOfFreedom()<3.){
1583  pair <CSCDetId, CSCSegment> specSeg = make_pair( (CSCDetId)(*segEffIt).cscDetId(),*segEffIt);
1584  theSegments[2*(idseg.endcap()-1)+(idseg.station() -2)] = specSeg;
1585  }
1586  }
1587  else if(3==idseg.station()){
1588  ++seg_ME3[idseg.endcap() -1];
1589  if(1==seg_ME3[idseg.endcap() -1] && 6==(*segEffIt).nRecHits() && (*segEffIt).chi2()/(*segEffIt).degreesOfFreedom()<3.){
1590  pair <CSCDetId, CSCSegment> specSeg = make_pair( (CSCDetId)(*segEffIt).cscDetId(),*segEffIt);
1591  theSegments[2*(idseg.endcap()-1)+(idseg.station() -2)] = specSeg;
1592  }
1593  }
1594  */
1595  }
1596  // Simple efficiency calculations
1597  for (int iE = 0; iE < 2; iE++) {
1598  for (int iS = 0; iS < 4; iS++) {
1599  for (int iR = 0; iR < 4; iR++) {
1600  for (int iC = 0; iC < 36; iC++) {
1601  int NumberOfLayers = 0;
1602  for (int iL = 0; iL < 6; iL++) {
1603  if (AllRecHits[iE][iS][iR][iC][iL]) {
1604  NumberOfLayers++;
1605  }
1606  }
1607  int bin = 0;
1608  if (iS == 0)
1609  bin = iR + 1 + (iE * 10);
1610  else
1611  bin = (iS + 1) * 2 + (iR + 1) + (iE * 10);
1612  if (NumberOfLayers > 1) {
1613  //if(!(MultiSegments[iE][iS][iR][iC])){
1614  if (AllSegments[iE][iS][iR][iC]) {
1615  //---- Efficient segment evenents
1616  hSnum->Fill(bin);
1617  }
1618  //---- All segment events (normalization)
1619  hSden->Fill(bin);
1620  //}
1621  }
1622  if (AllSegments[iE][iS][iR][iC]) {
1623  if (NumberOfLayers == 6) {
1624  //---- Efficient rechit events
1625  hRHnum->Fill(bin);
1626  ;
1627  }
1628  //---- All rechit events (normalization)
1629  hRHden->Fill(bin);
1630  ;
1631  }
1632  }
1633  }
1634  }
1635  }
1636 
1637  // pick a segment only if there are no others in the station
1638  std::vector<pair<CSCDetId, CSCSegment>*> theSeg;
1639  if (1 == seg_ME2[0])
1640  theSeg.push_back(&theSegments[0]);
1641  if (1 == seg_ME3[0])
1642  theSeg.push_back(&theSegments[1]);
1643  if (1 == seg_ME2[1])
1644  theSeg.push_back(&theSegments[2]);
1645  if (1 == seg_ME3[1])
1646  theSeg.push_back(&theSegments[3]);
1647 
1648  // Needed for plots
1649  // at the end the chamber types will be numbered as 1 to 20
1650  // (ME-4./2, ME-4/1, -ME3/2, -ME3/1, ..., +ME3/1, +ME3/2, ME+4/1, ME+4/2)
1651  std::map<std::string, float> chamberTypes;
1652  chamberTypes["ME1/a"] = 0.5;
1653  chamberTypes["ME1/b"] = 1.5;
1654  chamberTypes["ME1/2"] = 2.5;
1655  chamberTypes["ME1/3"] = 3.5;
1656  chamberTypes["ME2/1"] = 4.5;
1657  chamberTypes["ME2/2"] = 5.5;
1658  chamberTypes["ME3/1"] = 6.5;
1659  chamberTypes["ME3/2"] = 7.5;
1660  chamberTypes["ME4/1"] = 8.5;
1661  chamberTypes["ME4/2"] = 9.5;
1662 
1663  if (!theSeg.empty()) {
1664  std::map<int, GlobalPoint> extrapolatedPoint;
1665  std::map<int, GlobalPoint>::iterator it;
1666  const CSCGeometry::ChamberContainer& ChamberContainer = cscGeom->chambers();
1667  // Pick which chamber with which segment to test
1668  for (unsigned int nCh = 0; nCh < ChamberContainer.size(); nCh++) {
1669  const CSCChamber* cscchamber = ChamberContainer[nCh];
1670  pair<CSCDetId, CSCSegment>* thisSegment = nullptr;
1671  for (uint iSeg = 0; iSeg < theSeg.size(); ++iSeg) {
1672  if (cscchamber->id().endcap() == theSeg[iSeg]->first.endcap()) {
1673  if (1 == cscchamber->id().station() || 3 == cscchamber->id().station()) {
1674  if (2 == theSeg[iSeg]->first.station()) {
1675  thisSegment = theSeg[iSeg];
1676  }
1677  } else if (2 == cscchamber->id().station() || 4 == cscchamber->id().station()) {
1678  if (3 == theSeg[iSeg]->first.station()) {
1679  thisSegment = theSeg[iSeg];
1680  }
1681  }
1682  }
1683  }
1684  // this chamber is to be tested with thisSegment
1685  if (thisSegment) {
1686  CSCSegment* seg = &(thisSegment->second);
1687  const CSCChamber* segChamber = cscGeom->chamber(thisSegment->first);
1688  LocalPoint localCenter(0., 0., 0);
1689  GlobalPoint cscchamberCenter = cscchamber->toGlobal(localCenter);
1690  // try to save some time (extrapolate a segment to a certain position only once)
1691  it = extrapolatedPoint.find(int(cscchamberCenter.z()));
1692  if (it == extrapolatedPoint.end()) {
1693  GlobalPoint segPos = segChamber->toGlobal(seg->localPosition());
1694  GlobalVector segDir = segChamber->toGlobal(seg->localDirection());
1695  double paramaterLine = lineParametrization(segPos.z(), cscchamberCenter.z(), segDir.z());
1696  double xExtrapolated = extrapolate1D(segPos.x(), segDir.x(), paramaterLine);
1697  double yExtrapolated = extrapolate1D(segPos.y(), segDir.y(), paramaterLine);
1698  GlobalPoint globP(xExtrapolated, yExtrapolated, cscchamberCenter.z());
1699  extrapolatedPoint[int(cscchamberCenter.z())] = globP;
1700  }
1701  // Where does the extrapolated point lie in the (tested) chamber local frame? Here:
1702  LocalPoint extrapolatedPointLocal = cscchamber->toLocal(extrapolatedPoint[int(cscchamberCenter.z())]);
1703  const CSCLayer* layer_p = cscchamber->layer(1); //layer 1
1704  const CSCLayerGeometry* layerGeom = layer_p->geometry();
1705  const std::array<const float, 4>& layerBounds = layerGeom->parameters();
1706  float shiftFromEdge = 15.; //cm
1707  float shiftFromDeadZone = 10.;
1708  // is the extrapolated point within a sensitive region
1709  bool pass = withinSensitiveRegion(extrapolatedPointLocal,
1710  layerBounds,
1711  cscchamber->id().station(),
1712  cscchamber->id().ring(),
1713  shiftFromEdge,
1714  shiftFromDeadZone);
1715  if (pass) { // the extrapolation point of the segment lies within sensitive region of that chamber
1716  // how many rechit layers are there in the chamber?
1717  // 0 - maybe the muon died or is deflected at large angle? do not use that case
1718  // 1 - could be noise...
1719  // 2 or more - this is promissing; this is our definition of a reliable signal; use it below
1720  // is other definition better?
1721  int nRHLayers = 0;
1722  for (int iL = 0; iL < 6; ++iL) {
1723  if (AllRecHits[cscchamber->id().endcap() - 1][cscchamber->id().station() - 1][cscchamber->id().ring() - 1]
1724  [cscchamber->id().chamber() - 1][iL]) {
1725  ++nRHLayers;
1726  }
1727  }
1728  //std::cout<<" nRHLayers = "<<nRHLayers<<std::endl;
1729  float verticalScale = chamberTypes[cscchamber->specs()->chamberTypeName()];
1730  if (cscchamberCenter.z() < 0) {
1731  verticalScale = -verticalScale;
1732  }
1733  verticalScale += 10.5;
1734  hSensitiveAreaEvt->Fill(float(cscchamber->id().chamber()), verticalScale);
1735  if (nRHLayers > 1) { // this chamber contains a reliable signal
1736  //chamberTypes[cscchamber->specs()->chamberTypeName()];
1737  // "intrinsic" efficiencies
1738  //std::cout<<" verticalScale = "<<verticalScale<<" chType = "<<cscchamber->specs()->chamberTypeName()<<std::endl;
1739  // this is the denominator forr all efficiencies
1740  hEffDenominator->Fill(float(cscchamber->id().chamber()), verticalScale);
1741  // Segment efficiency
1742  if (AllSegments[cscchamber->id().endcap() - 1][cscchamber->id().station() - 1][cscchamber->id().ring() - 1]
1743  [cscchamber->id().chamber() - 1]) {
1744  hSSTE2->Fill(float(cscchamber->id().chamber()), float(verticalScale));
1745  }
1746 
1747  for (int iL = 0; iL < 6; ++iL) {
1748  float weight = 1. / 6.;
1749  // one shold account for the weight in the efficiency...
1750  // Rechit efficiency
1751  if (AllRecHits[cscchamber->id().endcap() - 1][cscchamber->id().station() - 1][cscchamber->id().ring() - 1]
1752  [cscchamber->id().chamber() - 1][iL]) {
1753  hRHSTE2->Fill(float(cscchamber->id().chamber()), float(verticalScale), weight);
1754  }
1755  // Wire efficiency
1756  if (allWires[cscchamber->id().endcap() - 1][cscchamber->id().station() - 1][cscchamber->id().ring() - 1]
1757  [cscchamber->id().chamber() - 1][iL]) {
1758  // one shold account for the weight in the efficiency...
1759  hWireSTE2->Fill(float(cscchamber->id().chamber()), float(verticalScale), weight);
1760  }
1761  // Strip efficiency
1762  if (allStrips[cscchamber->id().endcap() - 1][cscchamber->id().station() - 1][cscchamber->id().ring() - 1]
1763  [cscchamber->id().chamber() - 1][iL]) {
1764  // one shold account for the weight in the efficiency...
1765  hStripSTE2->Fill(float(cscchamber->id().chamber()), float(verticalScale), weight);
1766  }
1767  }
1768  }
1769  }
1770  }
1771  }
1772  }
1773  //
1774 }
1775 
1776 // ==============================================
1777 //
1778 // Look at BX level trigger synchronization
1779 //
1780 // ==============================================
1781 
1784  const edm::Event& event,
1785  const edm::EventSetup& eventSetup) {
1786  // Loop over ALCTDigis
1787 
1788  for (CSCALCTDigiCollection::DigiRangeIterator j = alcts->begin(); j != alcts->end(); j++) {
1789  const CSCDetId& idALCT = (*j).first;
1790  const CSCALCTDigiCollection::Range& range = (*j).second;
1791  for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) {
1792  // Valid digi in the chamber (or in neighbouring chamber)
1793  if ((*digiIt).isValid()) {
1794  hALCTgetBX->Fill((*digiIt).getBX());
1795  hALCTgetBXSerial->Fill(chamberSerial(idALCT), (*digiIt).getBX());
1796  hALCTgetBX2DNumerator->Fill(idALCT.chamber(), typeIndex(idALCT, 2), (*digiIt).getBX());
1797  hALCTgetBX2Denominator->Fill(idALCT.chamber(), typeIndex(idALCT, 2));
1798  }
1799  }
1800  } // end ALCT Digi loop
1801 
1802  // Loop over raw data to get TMBHeader information
1803  // Taking code from EventFilter/CSCRawToDigis/CSCDCCUnpacker.cc
1805  eventSetup.get<CSCCrateMapRcd>().get(hcrate);
1806  const CSCCrateMap* pcrate = hcrate.product();
1807 
1808  // Try to get raw data
1810  if (!(event.getByToken(rd_token, rawdata))) {
1811  edm::LogWarning("CSCOfflineMonitor") << " FEDRawDataCollection not available";
1812  return;
1813  }
1814 
1815  bool goodEvent = false;
1816  unsigned long dccBinCheckMask = 0x06080016;
1817  unsigned int examinerMask = 0x1FEBF3F6;
1818  unsigned int errorMask = 0x0;
1819 
1820  // For new CSC readout layout, which doesn't include DCCs need to loop over DDU FED IDs.
1821  // DCC IDs are included for backward compatibility with old data
1822  std::vector<unsigned int> cscFEDids;
1823 
1824  for (unsigned int id = FEDNumbering::MINCSCFEDID; id <= FEDNumbering::MAXCSCFEDID; ++id) // loop over DCCs
1825  {
1826  cscFEDids.push_back(id);
1827  }
1828 
1829  for (unsigned int id = FEDNumbering::MINCSCDDUFEDID; id <= FEDNumbering::MAXCSCDDUFEDID; ++id) // loop over DDUs
1830  {
1831  cscFEDids.push_back(id);
1832  }
1833 
1834  for (unsigned int i = 0; i < cscFEDids.size(); i++) // loop over all CSC FEDs (DCCs and DDUs)
1835  {
1836  unsigned int id = cscFEDids[i];
1837  bool isDDU_FED = ((id >= FEDNumbering::MINCSCDDUFEDID) && (id <= FEDNumbering::MAXCSCDDUFEDID)) ? true : false;
1838 
1841 
1843  const FEDRawData& fedData = rawdata->FEDData(id);
1844  unsigned long length = fedData.size();
1845 
1846  if (length >= 32) {
1847  CSCDCCExaminer* examiner = nullptr;
1848  std::stringstream examiner_out, examiner_err;
1849  goodEvent = true;
1850  examiner = new CSCDCCExaminer();
1851  if (examinerMask & 0x40000)
1852  examiner->crcCFEB(true);
1853  if (examinerMask & 0x8000)
1854  examiner->crcTMB(true);
1855  if (examinerMask & 0x0400)
1856  examiner->crcALCT(true);
1857  examiner->setMask(examinerMask);
1858  const short unsigned int* data = (short unsigned int*)fedData.data();
1859 
1860  int res = examiner->check(data, long(fedData.size() / 2));
1861  if (res < 0) {
1862  goodEvent = false;
1863  } else {
1864  goodEvent = !(examiner->errors() & dccBinCheckMask);
1865  }
1866 
1867  if (goodEvent) {
1869 
1870  CSCDCCExaminer* ptrExaminer = examiner;
1871 
1872  std::vector<CSCDDUEventData> fed_Data;
1873  std::vector<CSCDDUEventData>* ptr_fedData = &fed_Data;
1874 
1875  if (isDDU_FED) // Use new DDU FED readout mode
1876  {
1877  CSCDDUEventData single_dduData((short unsigned int*)fedData.data(), ptrExaminer);
1878  fed_Data.push_back(single_dduData);
1879 
1880  } else // Use old DCC FED readout mode
1881  {
1882  CSCDCCEventData dccData((short unsigned int*)fedData.data(), ptrExaminer);
1883  fed_Data = dccData.dduData();
1884  }
1885 
1887  const std::vector<CSCDDUEventData>& dduData = *ptr_fedData;
1888 
1890  CSCDetId layer(1, 1, 1, 1, 1);
1891  for (unsigned int iDDU = 0; iDDU < dduData.size(); ++iDDU) { // loop over DDUs
1894  if (dduData[iDDU].trailer().errorstat() & errorMask) {
1895  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "DDU# " << iDDU << " has serious error - no digis unpacked! "
1896  << std::hex << dduData[iDDU].trailer().errorstat();
1897  continue; // to next iteration of DDU loop
1898  }
1899 
1901  const std::vector<CSCEventData>& cscData = dduData[iDDU].cscData();
1902 
1903  for (unsigned int iCSC = 0; iCSC < cscData.size(); ++iCSC) { // loop over CSCs
1904 
1906  int vmecrate = cscData[iCSC].dmbHeader()->crateID();
1907  int dmb = cscData[iCSC].dmbHeader()->dmbID();
1908 
1909  int icfeb = 0;
1910  int ilayer = 0;
1911 
1912  if ((vmecrate >= 1) && (vmecrate <= 60) && (dmb >= 1) && (dmb <= 10) && (dmb != 6)) {
1913  layer = pcrate->detId(vmecrate, dmb, icfeb, ilayer);
1914  } else {
1915  LogTrace("CSCOfflineMonitor") << " detID input out of range!!! ";
1916  LogTrace("CSCOfflineMonitor") << " skipping chamber vme= " << vmecrate << " dmb= " << dmb;
1917  continue; // to next iteration of iCSC loop
1918  }
1919 
1921  int nalct = cscData[iCSC].dmbHeader()->nalct();
1922  bool goodALCT = false;
1923  //if (nalct&&(cscData[iCSC].dataPresent>>6&0x1)==1) {
1924  if (nalct && cscData[iCSC].alctHeader()) {
1925  if (cscData[iCSC].alctHeader()->check()) {
1926  goodALCT = true;
1927  }
1928  }
1929 
1931  int nclct = cscData[iCSC].dmbHeader()->nclct();
1932  bool goodTMB = false;
1933  if (nclct && cscData[iCSC].tmbData()) {
1934  if (cscData[iCSC].tmbHeader()->check()) {
1935  if (cscData[iCSC].comparatorData()->check())
1936  goodTMB = true;
1937  }
1938  }
1939 
1940  if (goodTMB && goodALCT) {
1941  const CSCTMBHeader* tmbHead = cscData[iCSC].tmbHeader();
1942  std::vector<CSCCLCTDigi> clcts = cscData[iCSC].tmbHeader()->CLCTDigis(layer.rawId());
1943  if (clcts.empty() || !(clcts[0].isValid()))
1944  continue;
1945  // Check if the CLCT was in ME11a (ring 4)
1946  if (layer.station() == 1 && layer.ring() == 1 && clcts[0].getKeyStrip() > 128) {
1947  layer = CSCDetId(layer.endcap(), layer.station(), 4, layer.chamber());
1948  }
1949  hALCTMatch->Fill(tmbHead->ALCTMatchTime());
1950  hALCTMatchSerial->Fill(chamberSerial(layer), tmbHead->ALCTMatchTime());
1951  // Only fill big 2D display if ALCTMatchTime !=6, since this bin is polluted by the CLCT only triggers
1952  // One will have to look at the serial plots to see if the are a lot of entries here
1953  if (tmbHead->ALCTMatchTime() != 6) {
1954  hALCTMatch2DNumerator->Fill(layer.chamber(), typeIndex(layer, 2), tmbHead->ALCTMatchTime());
1955  hALCTMatch2Denominator->Fill(layer.chamber(), typeIndex(layer, 2));
1956  }
1957 
1958  int TMB_CLCTpre_rel_L1A = tmbHead->BXNCount() - clcts[0].getFullBX();
1959  if (TMB_CLCTpre_rel_L1A > 3563)
1960  TMB_CLCTpre_rel_L1A = TMB_CLCTpre_rel_L1A - 3564;
1961  if (TMB_CLCTpre_rel_L1A < 0)
1962  TMB_CLCTpre_rel_L1A = TMB_CLCTpre_rel_L1A + 3564;
1963 
1964  hCLCTL1A->Fill(TMB_CLCTpre_rel_L1A);
1965  hCLCTL1ASerial->Fill(chamberSerial(layer), TMB_CLCTpre_rel_L1A);
1966  hCLCTL1A2DNumerator->Fill(layer.chamber(), typeIndex(layer, 2), TMB_CLCTpre_rel_L1A);
1967  hCLCTL1A2Denominator->Fill(layer.chamber(), typeIndex(layer, 2));
1968 
1969  } // end if goodTMB and goodALCT
1970  } // end loop CSCData
1971  } // end loop DDU
1972  } // end if good event
1973  if (examiner != nullptr)
1974  delete examiner;
1975  } // end if non-zero fed data
1976  } // end DCC loop for NON-REFERENCE
1977 
1978  return;
1979 }
1980 
1982  const std::array<const float, 4>& layerBounds,
1983  int station,
1984  int ring,
1985  float shiftFromEdge,
1986  float shiftFromDeadZone) {
1987  //---- check if it is in a good local region (sensitive area - geometrical and HV boundaries excluded)
1988  bool pass = false;
1989 
1990  float y_center = 0.;
1991  double yUp = layerBounds[3] + y_center;
1992  double yDown = -layerBounds[3] + y_center;
1993  double xBound1Shifted = layerBounds[0] - shiftFromEdge; //
1994  double xBound2Shifted = layerBounds[1] - shiftFromEdge; //
1995  double lineSlope = (yUp - yDown) / (xBound2Shifted - xBound1Shifted);
1996  double lineConst = yUp - lineSlope * xBound2Shifted;
1997  double yBorder = lineSlope * abs(localPos.x()) + lineConst;
1998 
1999  //bool withinChamberOnly = false;// false = "good region"; true - boundaries only
2000  std::vector<float> deadZoneCenter(6);
2001  float cutZone = shiftFromDeadZone; //cm
2002  //---- hardcoded... not good
2003  if (station > 1 && station < 5) {
2004  if (2 == ring) {
2005  deadZoneCenter[0] = -162.48;
2006  deadZoneCenter[1] = -81.8744;
2007  deadZoneCenter[2] = -21.18165;
2008  deadZoneCenter[3] = 39.51105;
2009  deadZoneCenter[4] = 100.2939;
2010  deadZoneCenter[5] = 160.58;
2011 
2012  if (localPos.y() > yBorder &&
2013  ((localPos.y() > deadZoneCenter[0] + cutZone && localPos.y() < deadZoneCenter[1] - cutZone) ||
2014  (localPos.y() > deadZoneCenter[1] + cutZone && localPos.y() < deadZoneCenter[2] - cutZone) ||
2015  (localPos.y() > deadZoneCenter[2] + cutZone && localPos.y() < deadZoneCenter[3] - cutZone) ||
2016  (localPos.y() > deadZoneCenter[3] + cutZone && localPos.y() < deadZoneCenter[4] - cutZone) ||
2017  (localPos.y() > deadZoneCenter[4] + cutZone && localPos.y() < deadZoneCenter[5] - cutZone))) {
2018  pass = true;
2019  }
2020  } else if (1 == ring) {
2021  if (2 == station) {
2022  deadZoneCenter[0] = -95.80;
2023  deadZoneCenter[1] = -27.47;
2024  deadZoneCenter[2] = 33.67;
2025  deadZoneCenter[3] = 90.85;
2026  } else if (3 == station) {
2027  deadZoneCenter[0] = -89.305;
2028  deadZoneCenter[1] = -39.705;
2029  deadZoneCenter[2] = 20.195;
2030  deadZoneCenter[3] = 77.395;
2031  } else if (4 == station) {
2032  deadZoneCenter[0] = -75.645;
2033  deadZoneCenter[1] = -26.055;
2034  deadZoneCenter[2] = 23.855;
2035  deadZoneCenter[3] = 70.575;
2036  }
2037  if (localPos.y() > yBorder &&
2038  ((localPos.y() > deadZoneCenter[0] + cutZone && localPos.y() < deadZoneCenter[1] - cutZone) ||
2039  (localPos.y() > deadZoneCenter[1] + cutZone && localPos.y() < deadZoneCenter[2] - cutZone) ||
2040  (localPos.y() > deadZoneCenter[2] + cutZone && localPos.y() < deadZoneCenter[3] - cutZone))) {
2041  pass = true;
2042  }
2043  }
2044  } else if (1 == station) {
2045  if (3 == ring) {
2046  deadZoneCenter[0] = -83.155;
2047  deadZoneCenter[1] = -22.7401;
2048  deadZoneCenter[2] = 27.86665;
2049  deadZoneCenter[3] = 81.005;
2050  if (localPos.y() > yBorder &&
2051  ((localPos.y() > deadZoneCenter[0] + cutZone && localPos.y() < deadZoneCenter[1] - cutZone) ||
2052  (localPos.y() > deadZoneCenter[1] + cutZone && localPos.y() < deadZoneCenter[2] - cutZone) ||
2053  (localPos.y() > deadZoneCenter[2] + cutZone && localPos.y() < deadZoneCenter[3] - cutZone))) {
2054  pass = true;
2055  }
2056  } else if (2 == ring) {
2057  deadZoneCenter[0] = -86.285;
2058  deadZoneCenter[1] = -32.88305;
2059  deadZoneCenter[2] = 32.867423;
2060  deadZoneCenter[3] = 88.205;
2061  if (localPos.y() > (yBorder) &&
2062  ((localPos.y() > deadZoneCenter[0] + cutZone && localPos.y() < deadZoneCenter[1] - cutZone) ||
2063  (localPos.y() > deadZoneCenter[1] + cutZone && localPos.y() < deadZoneCenter[2] - cutZone) ||
2064  (localPos.y() > deadZoneCenter[2] + cutZone && localPos.y() < deadZoneCenter[3] - cutZone))) {
2065  pass = true;
2066  }
2067  } else {
2068  deadZoneCenter[0] = -81.0;
2069  deadZoneCenter[1] = 81.0;
2070  if (localPos.y() > (yBorder) &&
2071  (localPos.y() > deadZoneCenter[0] + cutZone && localPos.y() < deadZoneCenter[1] - cutZone)) {
2072  pass = true;
2073  }
2074  }
2075  }
2076  return pass;
2077 }
2078 
2080  // linearized index based on endcap, station, and ring
2081 
2082  if (flag == 1) {
2083  int index = 0;
2084  if (id.station() == 1)
2085  index = id.ring();
2086  else
2087  index = id.station() * 2 + id.ring();
2088  if (id.endcap() == 1)
2089  index = index + 10;
2090  if (id.endcap() == 2)
2091  index = 11 - index;
2092  return index;
2093  }
2094 
2095  else if (flag == 2) {
2096  int index = 0;
2097  if (id.station() == 1 && id.ring() != 4)
2098  index = id.ring() + 1;
2099  if (id.station() == 1 && id.ring() == 4)
2100  index = 1;
2101  if (id.station() != 1)
2102  index = id.station() * 2 + id.ring();
2103  if (id.endcap() == 1)
2104  index = index + 10;
2105  if (id.endcap() == 2)
2106  index = 11 - index;
2107  return index;
2108  }
2109 
2110  else
2111  return 0;
2112 }
2113 
2115  int st = id.station();
2116  int ri = id.ring();
2117  int ch = id.chamber();
2118  int ec = id.endcap();
2119  int kSerial = ch;
2120  if (st == 1 && ri == 1)
2121  kSerial = ch;
2122  if (st == 1 && ri == 2)
2123  kSerial = ch + 36;
2124  if (st == 1 && ri == 3)
2125  kSerial = ch + 72;
2126  if (st == 1 && ri == 4)
2127  kSerial = ch;
2128  if (st == 2 && ri == 1)
2129  kSerial = ch + 108;
2130  if (st == 2 && ri == 2)
2131  kSerial = ch + 126;
2132  if (st == 3 && ri == 1)
2133  kSerial = ch + 162;
2134  if (st == 3 && ri == 2)
2135  kSerial = ch + 180;
2136  if (st == 4 && ri == 1)
2137  kSerial = ch + 216;
2138  if (st == 4 && ri == 2)
2139  kSerial = ch + 234; // from 2014
2140  if (ec == 2)
2141  kSerial = kSerial + 300;
2142  return kSerial;
2143 }
2144 
2146  if (me != nullptr) {
2147  me->setAxisTitle("Chamber #");
2148  if (t == EXTENDED) {
2149  me->setBinLabel(1, "ME -4/2", a);
2150  me->setBinLabel(2, "ME -4/1", a);
2151  me->setBinLabel(3, "ME -3/2", a);
2152  me->setBinLabel(4, "ME -3/1", a);
2153  me->setBinLabel(5, "ME -2/2", a);
2154  me->setBinLabel(6, "ME -2/1", a);
2155  me->setBinLabel(7, "ME -1/3", a);
2156  me->setBinLabel(8, "ME -1/2", a);
2157  me->setBinLabel(9, "ME -1/1b", a);
2158  me->setBinLabel(10, "ME -1/1a", a);
2159  me->setBinLabel(11, "ME +1/1a", a);
2160  me->setBinLabel(12, "ME +1/1b", a);
2161  me->setBinLabel(13, "ME +1/2", a);
2162  me->setBinLabel(14, "ME +1/3", a);
2163  me->setBinLabel(15, "ME +2/1", a);
2164  me->setBinLabel(16, "ME +2/2", a);
2165  me->setBinLabel(17, "ME +3/1", a);
2166  me->setBinLabel(18, "ME +3/2", a);
2167  me->setBinLabel(19, "ME +4/1", a);
2168  me->setBinLabel(20, "ME +4/2", a);
2169  } else if (t == SMALL) {
2170  me->setBinLabel(1, "ME -4/1", a);
2171  me->setBinLabel(2, "ME -3/2", a);
2172  me->setBinLabel(3, "ME -3/1", a);
2173  me->setBinLabel(4, "ME -2/2", a);
2174  me->setBinLabel(5, "ME -2/1", a);
2175  me->setBinLabel(6, "ME -1/3", a);
2176  me->setBinLabel(7, "ME -1/2", a);
2177  me->setBinLabel(8, "ME -1/1b", a);
2178  me->setBinLabel(9, "ME -1/1a", a);
2179  me->setBinLabel(10, "ME +1/1a", a);
2180  me->setBinLabel(11, "ME +1/1b", a);
2181  me->setBinLabel(12, "ME +1/2", a);
2182  me->setBinLabel(13, "ME +1/3", a);
2183  me->setBinLabel(14, "ME +2/1", a);
2184  me->setBinLabel(15, "ME +2/2", a);
2185  me->setBinLabel(16, "ME +3/1", a);
2186  me->setBinLabel(17, "ME +3/2", a);
2187  me->setBinLabel(18, "ME +4/1", a);
2188  }
2189  }
2190 }
2191 
Vector3DBase< float, LocalTag >
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
change_name.diff
diff
Definition: change_name.py:13
CSCOfflineMonitor::chamberSerial
int chamberSerial(CSCDetId id)
Definition: CSCOfflineMonitor.cc:2114
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
mps_fire.i
i
Definition: mps_fire.py:428
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
CSCChamber::layer
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
Definition: CSCChamber.cc:30
CSCDCCEventData::dduData
const std::vector< CSCDDUEventData > & dduData() const
accessor to dduData
Definition: CSCDCCEventData.h:25
CSCDCCExaminer::errors
ExaminerStatusType errors(void) const
Definition: CSCDCCExaminer.h:169
CSCOfflineMonitor::getSignal
float getSignal(const CSCStripDigiCollection &stripdigis, CSCDetId idRH, int centerStrip)
Definition: CSCOfflineMonitor.cc:1414
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21455
CSCOfflineMonitor::doResolution
void doResolution(edm::Handle< CSCSegmentCollection > cscSegments, edm::ESHandle< CSCGeometry > cscGeom)
Definition: CSCOfflineMonitor.cc:1322
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
X
#define X(str)
Definition: MuonsGrabber.cc:38
edm::Run
Definition: Run.h:45
ChiSquaredProbability
float ChiSquaredProbability(double chiSquared, double nrDOF)
Definition: ChiSquaredProbability.cc:13
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCDetId::ring
int ring() const
Definition: CSCDetId.h:68
DigiDM_cff.wires
wires
Definition: DigiDM_cff.py:33
CSCOfflineMonitor::applyCSClabels
void applyCSClabels(MonitorElement *meHisto, LabelType t, AxisType a)
Definition: CSCOfflineMonitor.cc:2145
mps_merge.weight
weight
Definition: mps_merge.py:88
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
CSCStripDigiCollection
CSCDCCEventData
01/20/05 A.Tumanov
Definition: CSCDCCEventData.h:13
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
FEDNumbering::MAXCSCFEDID
Definition: FEDNumbering.h:52
CSCLayer
Definition: CSCLayer.h:24
dtChamberEfficiency_cfi.cscSegments
cscSegments
Definition: dtChamberEfficiency_cfi.py:15
CSCGeometry::gangedStrips
bool gangedStrips() const
Definition: CSCGeometry.h:110
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCOfflineMonitor::analyze
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
Definition: CSCOfflineMonitor.cc:808
CSCOfflineMonitor::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: CSCOfflineMonitor.cc:23
FEDNumbering::MAXCSCDDUFEDID
Definition: FEDNumbering.h:90
edm::Handle< CSCWireDigiCollection >
parallelization.uint
uint
Definition: parallelization.py:124
dqmdumpme.first
first
Definition: dqmdumpme.py:55
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
FEDRawData
Definition: FEDRawData.h:19
CSCOfflineMonitor::CSCOfflineMonitor
CSCOfflineMonitor(const edm::ParameterSet &pset)
Definition: CSCOfflineMonitor.cc:13
SMALL
static const double SMALL
Definition: herwig.h:289
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
alignCSCRings.s
s
Definition: alignCSCRings.py:92
RPCNoise_example.check
check
Definition: RPCNoise_example.py:71
dqmdumpme.last
last
Definition: dqmdumpme.py:56
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CSCOfflineMonitor::AxisType
AxisType
Definition: CSCOfflineMonitor.h:77
errors
Definition: errors.py:1
TrapezoidalPlaneBounds::parameters
virtual const std::array< const float, 4 > parameters() const
Definition: TrapezoidalPlaneBounds.cc:49
CSCLayerGeometry
Definition: CSCLayerGeometry.h:25
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CSCOfflineMonitor.h
CSCDetId::layer
int layer() const
Definition: CSCDetId.h:56
edm::ESHandle< CSCGeometry >
ADC
Definition: ZdcTBAnalysis.h:46
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
CSCChamber
Definition: CSCChamber.h:22
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
Point3DBase< float, LocalTag >
nhits
Definition: HIMultiTrackSelector.h:42
GeomDet::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
CSCOfflineMonitor
Definition: CSCOfflineMonitor.h:71
CSCSegment
Definition: CSCSegment.h:21
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
CSCOfflineMonitor::fitX
float fitX(const CLHEP::HepMatrix &sp, const CLHEP::HepMatrix &ep)
Definition: CSCOfflineMonitor.cc:1381
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
CSCDCCExaminer::setMask
void setMask(ExaminerMaskType mask)
Definition: CSCDCCExaminer.h:166
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
CSCDetId
Definition: CSCDetId.h:26
CSCChamberSpecs::chamberTypeName
std::string chamberTypeName() const
Definition: CSCChamberSpecs.cc:156
CSCSegment::localDirection
LocalVector localDirection() const override
Local direction.
Definition: CSCSegment.h:42
CSCOfflineMonitor::typeIndex
int typeIndex(CSCDetId id, int flag=1)
Definition: CSCOfflineMonitor.cc:2079
CSCDCCExaminer::check
int32_t check(const uint16_t *&buffer, int32_t length)
Definition: CSCDCCExaminer.cc:263
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
CSCDCCExaminer
Definition: CSCDCCExaminer.h:15
createfilelist.int
int
Definition: createfilelist.py:10
CSCGeometry::ChamberContainer
std::vector< const CSCChamber * > ChamberContainer
Definition: CSCGeometry.h:30
dqm::impl::MonitorElement::setBinLabel
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:771
CSCDetId::chamber
int chamber() const
Definition: CSCDetId.h:62
edm::EventSetup
Definition: EventSetup.h:57
FEDNumbering::MINCSCFEDID
Definition: FEDNumbering.h:51
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
CSCChamber::specs
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:39
CSCOfflineMonitor::doStripDigis
void doStripDigis(edm::Handle< CSCStripDigiCollection > strips)
Definition: CSCOfflineMonitor.cc:1040
get
#define get
res
Definition: Electron.h:6
cms::cuda::for
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
Definition: HistoContainer.h:27
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
CSCOfflineMonitor::doBXMonitor
void doBXMonitor(edm::Handle< CSCALCTDigiCollection > alcts, edm::Handle< CSCCLCTDigiCollection > clcts, const edm::Event &event, const edm::EventSetup &eventSetup)
Definition: CSCOfflineMonitor.cc:1782
alignCSCRings.r
r
Definition: alignCSCRings.py:93
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
CSCTMBHeader
Definition: CSCTMBHeader.h:26
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CSCDDUEventData
Definition: CSCDDUEventData.h:19
CSCGeometry::layer
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:105
CSCOfflineMonitor::doPedestalNoise
void doPedestalNoise(edm::Handle< CSCStripDigiCollection > strips, edm::ESHandle< CSCGeometry > cscGeom)
Definition: CSCOfflineMonitor.cc:1080
CSCDCCExaminer::crcTMB
void crcTMB(bool enable)
Definition: CSCDCCExaminer.cc:37
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CSCDetId::endcap
int endcap() const
Definition: CSCDetId.h:85
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
CSCOfflineMonitor::doSegments
void doSegments(edm::Handle< CSCSegmentCollection > cscSegments, edm::ESHandle< CSCGeometry > cscGeom)
Definition: CSCOfflineMonitor.cc:1199
CSCDCCExaminer::crcALCT
void crcALCT(bool enable)
Definition: CSCDCCExaminer.cc:29
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
CSCCrateMap::detId
CSCDetId detId(int vme, int dmb, int cfeb, int layer=0) const
Definition: CSCCrateMap.cc:9
CSCCrateMapRcd
Definition: CSCCrateMapRcd.h:5
MuonDigiCollection::Range
std::pair< const_iterator, const_iterator > Range
Definition: MuonDigiCollection.h:95
CSCOfflineMonitor::doWireDigis
void doWireDigis(edm::Handle< CSCWireDigiCollection > wires)
Definition: CSCOfflineMonitor.cc:1013
FEDNumbering::MINCSCDDUFEDID
Definition: FEDNumbering.h:89
BeamSpotPI::Y
Definition: BeamSpotPayloadInspectorHelper.h:31
CSCTMBHeader::BXNCount
uint16_t BXNCount() const
Definition: CSCTMBHeader.h:38
CSCGeometry::chambers
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:96
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
dqm::implementation::IBooker
Definition: DQMStore.h:43
S
Definition: CSCDBL1TPParametersExtended.h:16
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
CSCCrateMap
Definition: CSCCrateMap.h:11
CSCOfflineMonitor::doEfficiencies
void doEfficiencies(edm::Handle< CSCWireDigiCollection > wires, edm::Handle< CSCStripDigiCollection > strips, edm::Handle< CSCRecHit2DCollection > recHits, edm::Handle< CSCSegmentCollection > cscSegments, edm::ESHandle< CSCGeometry > cscGeom)
Definition: CSCOfflineMonitor.cc:1477
CSCDCCExaminer::crcCFEB
void crcCFEB(bool enable)
Definition: CSCDCCExaminer.cc:45
CSCTMBHeader::ALCTMatchTime
uint16_t ALCTMatchTime() const
Definition: CSCTMBHeader.h:39
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
CSCOfflineMonitor::withinSensitiveRegion
bool withinSensitiveRegion(LocalPoint localPos, const std::array< const float, 4 > &layerBounds, int station, int ring, float shiftFromEdge, float shiftFromDeadZone)
Definition: CSCOfflineMonitor.cc:1981
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
slope
static const double slope[3]
Definition: CastorTimeSlew.cc:6
CSCChamber::id
CSCDetId id() const
Get the (concrete) DetId.
Definition: CSCChamber.h:34
event
Definition: event.py:1
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
DigiContainerIterator
Definition: MuonDigiCollection.h:30
edm::Event
Definition: Event.h:73
CSCOfflineMonitor::doRecHits
void doRecHits(edm::Handle< CSCRecHit2DCollection > recHits, edm::Handle< CSCStripDigiCollection > strips, edm::ESHandle< CSCGeometry > cscGeom)
Definition: CSCOfflineMonitor.cc:1123
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
CSCSegment::localPosition
LocalPoint localPosition() const override
Definition: CSCSegment.h:39
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
edm::InputTag
Definition: InputTag.h:15
DigiDM_cff.strips
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers....
Definition: DigiDM_cff.py:32
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
CSCGeometry::chamber
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100
weight
Definition: weight.py:1
kLayer
static const std::string kLayer("layer")
CSCOfflineMonitor::LabelType
LabelType
Definition: CSCOfflineMonitor.h:76
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
CSCOfflineMonitor::doOccupancies
void doOccupancies(edm::Handle< CSCStripDigiCollection > strips, edm::Handle< CSCWireDigiCollection > wires, edm::Handle< CSCRecHit2DCollection > recHits, edm::Handle< CSCSegmentCollection > cscSegments, edm::Handle< CSCCLCTDigiCollection > clcts)
Definition: CSCOfflineMonitor.cc:847
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
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
debug_messages_cfi.errors
errors
Definition: debug_messages_cfi.py:54