95 void endJob()
override;
172 firstOrbit = lastOrbit = thisOrbit = 0;
177 theHistogramFile->cd();
179 nWires =
new TH1F(
"nWires",
"number of wire digis", 121, -0.5, 120.5);
180 nStrips =
new TH1F(
"nStrips",
"number of strip digis", 201, -0.5, 200.5);
181 nWiresH =
new TH1F(
"nWiresH",
"number of wire digis HIGH", 121, -0.5, 120.5);
182 nStripsH =
new TH1F(
"nStripsH",
"number of strip digis HIGH", 201, -0.5, 200.5);
183 nDTDigis =
new TH1F(
"nDTDigis",
"number of DT digis", 201, -0.5, 200.5);
184 nDTDigisH =
new TH1F(
"nDTDigisH",
"number of DT digis HIGH", 201, -0.5, 200.5);
185 nDTDigisIn =
new TH1F(
"nDTDigisIn",
"N DT digis in window", 75, 0., 150.);
186 nDTDigisInH =
new TH1F(
"nDTDigisInH",
"N DT digis in window HIGH", 75, 0., 150.);
187 nDTDigisOut =
new TH1F(
"nDTDigisOut",
"N DT digis out window", 75, 0., 150.);
188 nDTDigisOutH =
new TH1F(
"nDTDigisOutH",
"N DT digis out window HIGH", 75, 0., 150.);
189 fDTDigisOut =
new TH1F(
"fDTDigisOut",
"fraction DT digis outside window", 55, 0., 1.1);
190 fDTDigisOutH =
new TH1F(
"fDTDigisOutH",
"fraction DT digis outside window HIGH", 55, 0., 1.1);
192 t0All =
new TH1F(
"t0All",
"t0", 700, 0., 7000.);
193 t0AllH =
new TH1F(
"t0AllH",
"t0 HIGH", 700, 0., 7000.);
194 RPCBX =
new TH1F(
"RPCBX",
"RPC BX", 21, -10.5, 10.5);
195 RPCBXH =
new TH1F(
"RPCBXH",
"RPC BX HIGH", 21, -10.5, 10.5);
196 RPCClSize =
new TH1F(
"RPCClSize",
"RPC cluster size", 61, -0.5, 60.5);
197 RPCClSizeH =
new TH1F(
"RPCClSizeH",
"RPC cluster size HIGH", 61, -0.5, 60.5);
199 nRPCRecHits =
new TH1F(
"nRPCRecHits",
"number of RPC RecHits", 101, -0.5, 100.5);
200 nRPCRecHitsLong =
new TH1F(
"nRPCRecHitsLong",
"number of RPC RecHits", 601, -0.5, 600.5);
201 hitsVsSerial =
new TProfile(
"hitsVsSerial",
"mean RPC hits vs serial event number", 4000, 0., 40000., 0., 1000.);
203 new TProfile(
"orbitVsSerial",
"relative orbit number vs serial event number", 4000, 0., 40000., 0., 1.e10);
204 hitsVsOrbit =
new TProfile(
"hitsVsOrbit",
"mean RPC hits vs orbit number", 3000, 0., 1200000., 0., 1000.);
205 dOrbit =
new TH1F(
"dOrbit",
"difference in orbit number", 121, -0.5, 120.5);
207 rpcStation =
new TH1F(
"rpcStation",
"RPC station", 6, -0.5, 5.5);
208 rpcStationH =
new TH1F(
"rpcStationH",
"RPC station HIGH", 6, -0.5, 5.5);
209 rpcRing =
new TH1F(
"rpcRing",
"RPC ring", 9, -4.5, 4.5);
210 rpcRingH =
new TH1F(
"rpcRingH",
"RPC ring HIGH", 9, -4.5, 4.5);
211 rpcSector =
new TH1F(
"rpcSector",
"RPC sector", 15, -0.5, 14.5);
212 rpcSectorH =
new TH1F(
"rpcSectorH",
"RPC sector HIGH", 15, -0.5, 14.5);
213 rpcLayer =
new TH1F(
"rpcLayer",
"RPC layer", 4, -0.5, 3.5);
214 rpcLayerH =
new TH1F(
"rpcLayerH",
"RPC layer HIGH", 4, -0.5, 3.5);
215 rpcStationVsOrbit =
new TProfile(
"rpcStationVsOrbit",
"mean RPC station vs. Orbit", 3000, 0., 1200000., 0., 20.);
216 rpcSectorVsOrbit =
new TProfile(
"rpcSectorVsOrbit",
"mean RPC sector vs. Orbit", 3000, 0., 1200000., 0., 20.);
217 rpcRingVsOrbit =
new TProfile(
"rpcRingVsOrbit",
"mean RPC ring vs. Orbit", 3000, 0., 1200000., -20., 20.);
218 rpcCorner =
new TH1F(
"rpcCorner",
"special corner designation", 4, -0.5, 3.5);
219 rpcCornerH =
new TH1F(
"rpcCornerH",
"special corner designation HIGH", 4, -0.5, 3.5);
220 rpcCornerVsOrbit =
new TProfile(
"rpcCornerVsOrbit",
"special corner vs. Orbit", 3000, 0., 1200000., -20., 20.);
225 std::cout <<
"\n\t===============================================================\n"
226 <<
"\tnumber of events analyzed = " << nEventsAnalyzed << std::endl
227 <<
"\tnumber of events selected = " << nEventsSelected << std::endl
228 <<
"\tfirst and last orbit number : " << firstOrbit <<
", " << lastOrbit <<
", "
229 << lastOrbit - firstOrbit << std::endl
230 <<
"\t===============================================================\n\n";
234 printf(
"\n\n======= write out my histograms ====\n\n");
235 theHistogramFile->cd();
243 nDTDigisInH->Write();
244 nDTDigisOut->Write();
245 nDTDigisOutH->Write();
246 fDTDigisOut->Write();
247 fDTDigisOutH->Write();
248 nRPCRecHits->Write();
249 nRPCRecHitsLong->Write();
250 hitsVsSerial->Write();
251 hitsVsOrbit->Write();
252 orbitVsSerial->Write();
260 rpcStationH->Write();
268 rpcStationVsOrbit->Write();
269 rpcSectorVsOrbit->Write();
270 rpcRingVsOrbit->Write();
273 rpcCornerVsOrbit->Write();
274 theHistogramFile->Close();
279 bool selectThisEvent =
false;
284 iRun =
event.id().run();
285 iEvent =
event.id().event();
287 bool printThisLine = (nEventsAnalyzed % 100 == 0);
289 std::cout <<
"======================================"
290 <<
" analyzed= " << nEventsAnalyzed <<
", selected= " << nEventsSelected <<
"\trun,event: " << iRun
291 <<
", " <<
iEvent << std::endl;
306 int bx =
event.bunchCrossing();
307 int thisOrbit =
event.orbitNumber();
308 long mTime = 3564 * thisOrbit +
bx;
309 if (firstOrbit == 0) {
310 firstOrbit = thisOrbit;
311 lastOrbit = thisOrbit;
313 int deltaOrbit = thisOrbit - lastOrbit;
314 lastOrbit = thisOrbit;
315 int relativeOrbit = thisOrbit - firstOrbit;
318 dOrbit->Fill(deltaOrbit);
321 if (nEventsAnalyzed < 200) {
326 <<
"\torbit,bx,mTime: " << thisOrbit <<
"," <<
bx <<
"," << mTime <<
"\tdelta= " << deltaOrbit
334 event.getByLabel(
"rpcRecHits",
"",
rpcRecHits);
348 int kRegion =
id.
region();
349 int kStation =
id.station();
350 int kRing =
id.ring();
351 int kSector =
id.sector();
353 int bx = (*rpcIt).BunchX();
354 int clSize = (*rpcIt).clusterSize();
356 if ((kStation > 3) && (kSector < 3)) {
361 if (nEventsAnalyzed < 100) {
362 std::cout <<
"Region/Station/Ring/Sector/Layer: " << kRegion <<
" / " << kStation <<
" / " << kRing <<
" / "
363 << kSector <<
" / " <<
kLayer <<
"\tbx,clSize: " <<
bx <<
", " << clSize << std::endl;
367 RPCClSize->Fill(
min((
float)clSize, (
float)60.));
368 rpcStation->Fill(kStation);
369 rpcRing->Fill(kRing);
370 rpcSector->Fill(kSector);
372 rpcStationVsOrbit->Fill(relativeOrbit, kStation);
373 rpcSectorVsOrbit->Fill(relativeOrbit, kSector);
374 rpcRingVsOrbit->Fill(relativeOrbit, kRing);
375 rpcCorner->Fill(cornerFlag);
376 rpcCornerVsOrbit->Fill(relativeOrbit, cornerFlag);
379 RPCClSizeH->Fill(
min((
float)clSize, (
float)60.));
380 rpcStationH->Fill(kStation);
381 rpcRingH->Fill(kRing);
382 rpcSectorH->Fill(kSector);
384 rpcCornerH->Fill(cornerFlag);
394 event.getByLabel(
"muonCSCDigis",
"MuonCSCWireDigi",
wires);
395 event.getByLabel(
"muonCSCDigis",
"MuonCSCStripDigi",
strips);
400 std::vector<CSCWireDigi>::const_iterator wireIterA = (*jW).second.first;
401 std::vector<CSCWireDigi>::const_iterator lWireA = (*jW).second.second;
402 for (; wireIterA != lWireA; ++wireIterA) {
412 std::vector<CSCStripDigi>::const_iterator stripItA = (*jS).second.first;
413 std::vector<CSCStripDigi>::const_iterator lastStripA = (*jS).second.second;
414 for (; stripItA != lastStripA; ++stripItA) {
415 std::vector<int> myADCVals = stripItA->getADCCounts();
416 int iDiff = myADCVals[4] + myADCVals[5] - myADCVals[0] - myADCVals[1];
428 event.getByLabel(
"muonDTDigis", dtDIGIs);
437 double t0 = (*digi).countsTDC();
439 if ((
t0 > 3050) && (
t0 < 3700)) {
457 if (nEventsAnalyzed < 1000) {
458 std::cout <<
"\tnumber of CSC DIGIS = " << nW <<
", " << nS <<
"\tDT DIGIS = " << nDT <<
"\tRPC Rechits = " << nRPC
463 nWires->Fill(
min((
float)nW, (
float)120.));
466 nDTDigis->Fill(
min((
float)nDT, (
float)200.));
467 nDTDigisIn->Fill(
min((
float)nDTin, (
float)200.));
468 nDTDigisOut->Fill(
min((
float)nDTout, (
float)200.));
471 fDTDigisOut->Fill(fracOut);
473 nRPCRecHits->Fill(
min((
float)nRPC, (
float)100.));
474 nRPCRecHitsLong->Fill(
min((
float)nRPC, (
float)1000.));
475 hitsVsSerial->Fill(nEventsAnalyzed, nRPC);
476 hitsVsOrbit->Fill(relativeOrbit, nRPC);
477 orbitVsSerial->Fill(nEventsAnalyzed, relativeOrbit);
480 nWiresH->Fill(
min((
float)nW, (
float)120.));
481 nStripsH->Fill(
min((
float)nS, (
float)200.));
482 nDTDigisH->Fill(
min((
float)nDT, (
float)200.));
483 nDTDigisInH->Fill(
min((
float)nDTin, (
float)200.));
484 nDTDigisOutH->Fill(
min((
float)nDTout, (
float)200.));
487 fDTDigisOutH->Fill(fracOut);
495 if (selectThisEvent) {
499 return selectThisEvent;