96 void endJob()
override ;
180 firstOrbit = lastOrbit = thisOrbit = 0;
182 if (fillHistograms) {
184 theHistogramFile =
new TFile(histogramFileName.c_str(),
"RECREATE");
185 theHistogramFile->cd();
187 nWires =
new TH1F(
"nWires",
"number of wire digis", 121, -0.5, 120.5);
188 nStrips =
new TH1F(
"nStrips",
"number of strip digis", 201, -0.5, 200.5);
189 nWiresH =
new TH1F(
"nWiresH",
"number of wire digis HIGH", 121, -0.5, 120.5);
190 nStripsH =
new TH1F(
"nStripsH",
"number of strip digis HIGH", 201, -0.5, 200.5);
191 nDTDigis =
new TH1F(
"nDTDigis",
"number of DT digis",201,-0.5,200.5);
192 nDTDigisH =
new TH1F(
"nDTDigisH",
"number of DT digis HIGH",201,-0.5,200.5);
193 nDTDigisIn =
new TH1F(
"nDTDigisIn",
"N DT digis in window",75,0.,150.);
194 nDTDigisInH =
new TH1F(
"nDTDigisInH",
"N DT digis in window HIGH",75,0.,150.);
195 nDTDigisOut =
new TH1F(
"nDTDigisOut",
"N DT digis out window",75,0.,150.);
196 nDTDigisOutH =
new TH1F(
"nDTDigisOutH",
"N DT digis out window HIGH",75,0.,150.);
197 fDTDigisOut =
new TH1F(
"fDTDigisOut",
"fraction DT digis outside window",55,0.,1.1);
198 fDTDigisOutH =
new TH1F(
"fDTDigisOutH",
"fraction DT digis outside window HIGH",55,0.,1.1);
200 t0All =
new TH1F(
"t0All",
"t0",700,0.,7000.);
201 t0AllH =
new TH1F(
"t0AllH",
"t0 HIGH",700,0.,7000.);
202 RPCBX =
new TH1F(
"RPCBX",
"RPC BX",21,-10.5,10.5);
203 RPCBXH =
new TH1F(
"RPCBXH",
"RPC BX HIGH",21,-10.5,10.5);
204 RPCClSize =
new TH1F(
"RPCClSize",
"RPC cluster size",61,-0.5,60.5);
205 RPCClSizeH =
new TH1F(
"RPCClSizeH",
"RPC cluster size HIGH",61,-0.5,60.5);
207 nRPCRecHits =
new TH1F(
"nRPCRecHits",
"number of RPC RecHits",101,-0.5,100.5);
208 nRPCRecHitsLong =
new TH1F(
"nRPCRecHitsLong",
"number of RPC RecHits",601,-0.5,600.5);
209 hitsVsSerial =
new TProfile(
"hitsVsSerial",
"mean RPC hits vs serial event number",4000,0.,40000.,0.,1000.);
210 orbitVsSerial =
new TProfile(
"orbitVsSerial",
"relative orbit number vs serial event number",4000,0.,40000.,0.,1.e10);
211 hitsVsOrbit =
new TProfile(
"hitsVsOrbit",
"mean RPC hits vs orbit number",3000,0.,1200000.,0.,1000.);
212 dOrbit =
new TH1F(
"dOrbit",
"difference in orbit number",121,-0.5,120.5);
214 rpcStation =
new TH1F(
"rpcStation",
"RPC station", 6,-0.5,5.5);
215 rpcStationH =
new TH1F(
"rpcStationH",
"RPC station HIGH", 6,-0.5,5.5);
216 rpcRing =
new TH1F(
"rpcRing",
"RPC ring", 9,-4.5,4.5);
217 rpcRingH =
new TH1F(
"rpcRingH",
"RPC ring HIGH", 9,-4.5,4.5);
218 rpcSector =
new TH1F(
"rpcSector",
"RPC sector", 15,-0.5,14.5);
219 rpcSectorH =
new TH1F(
"rpcSectorH",
"RPC sector HIGH", 15,-0.5,14.5);
220 rpcLayer =
new TH1F(
"rpcLayer",
"RPC layer", 4,-0.5,3.5);
221 rpcLayerH =
new TH1F(
"rpcLayerH",
"RPC layer HIGH", 4,-0.5,3.5);
222 rpcStationVsOrbit =
new TProfile(
"rpcStationVsOrbit",
"mean RPC station vs. Orbit",3000,0.,1200000.,0.,20.);
223 rpcSectorVsOrbit =
new TProfile(
"rpcSectorVsOrbit",
"mean RPC sector vs. Orbit", 3000,0.,1200000.,0.,20.);
224 rpcRingVsOrbit =
new TProfile(
"rpcRingVsOrbit",
"mean RPC ring vs. Orbit", 3000,0.,1200000.,-20.,20.);
225 rpcCorner =
new TH1F(
"rpcCorner",
"special corner designation", 4,-0.5,3.5);
226 rpcCornerH =
new TH1F(
"rpcCornerH",
"special corner designation HIGH", 4,-0.5,3.5);
227 rpcCornerVsOrbit =
new TProfile(
"rpcCornerVsOrbit",
"special corner vs. Orbit",3000,0.,1200000.,-20.,20.);
235 std::cout <<
"\n\t===============================================================\n" 236 <<
"\tnumber of events analyzed = " << nEventsAnalyzed << std::endl
237 <<
"\tnumber of events selected = " << nEventsSelected << std::endl
238 <<
"\tfirst and last orbit number : " << firstOrbit <<
", " << lastOrbit <<
", " << lastOrbit-firstOrbit << std::endl
239 <<
"\t===============================================================\n\n";
242 if (fillHistograms) {
244 printf(
"\n\n======= write out my histograms ====\n\n");
245 theHistogramFile->cd();
253 nDTDigisInH->Write();
254 nDTDigisOut->Write();
255 nDTDigisOutH->Write();
256 fDTDigisOut->Write();
257 fDTDigisOutH->Write();
258 nRPCRecHits->Write();
259 nRPCRecHitsLong->Write();
260 hitsVsSerial->Write();
261 hitsVsOrbit->Write();
262 orbitVsSerial->Write();
270 rpcStationH->Write();
278 rpcStationVsOrbit->Write();
279 rpcSectorVsOrbit->Write();
280 rpcRingVsOrbit->Write();
283 rpcCornerVsOrbit->Write();
284 theHistogramFile->Close();
294 bool selectThisEvent =
false;
299 iRun =
event.id().run();
300 iEvent =
event.id().event();
302 bool printThisLine = (nEventsAnalyzed%100 == 0);
304 std::cout <<
"======================================" 305 <<
" analyzed= " << nEventsAnalyzed
306 <<
", selected= " << nEventsSelected
307 <<
"\trun,event: " << iRun <<
", " <<
iEvent << std::endl;
322 int bx =
event.bunchCrossing();
323 int thisOrbit =
event.orbitNumber();
324 long mTime = 3564*thisOrbit + bx;
325 if (firstOrbit == 0) {
326 firstOrbit = thisOrbit;
327 lastOrbit = thisOrbit;
329 int deltaOrbit = thisOrbit - lastOrbit;
330 lastOrbit = thisOrbit;
331 int relativeOrbit = thisOrbit - firstOrbit;
333 if (fillHistograms) {dOrbit->Fill(deltaOrbit);}
335 if (nEventsAnalyzed < 200) {
340 <<
"\torbit,bx,mTime: " << thisOrbit <<
"," << bx <<
"," << mTime
341 <<
"\tdelta= " << deltaOrbit
350 event.getByLabel(
"rpcRecHits",
"",rpcRecHits);
355 for (rpcIt = rpcRecHits->begin(); rpcIt != rpcRecHits->end(); rpcIt++) {
362 for (rpcIt = rpcRecHits->begin(); rpcIt != rpcRecHits->end(); rpcIt++) {
364 int kRegion =
id.
region();
365 int kStation =
id.station();
366 int kRing =
id.ring();
367 int kSector =
id.sector();
369 int bx = (*rpcIt).BunchX();
370 int clSize = (*rpcIt).clusterSize();
372 if ( (kStation>3) && (kSector<3) ) {
374 if (kRing < 0) cornerFlag = 2;
376 if (nEventsAnalyzed < 100) {
377 std::cout <<
"Region/Station/Ring/Sector/Layer: " 383 <<
"\tbx,clSize: " << bx <<
", " << clSize
386 if (fillHistograms) {
388 RPCClSize->Fill(
min((
float)clSize,(
float)60.));
389 rpcStation->Fill(kStation);
390 rpcRing->Fill(kRing);
391 rpcSector->Fill(kSector);
392 rpcLayer->Fill(kLayer);
393 rpcStationVsOrbit->Fill(relativeOrbit,kStation);
394 rpcSectorVsOrbit->Fill(relativeOrbit,kSector);
395 rpcRingVsOrbit->Fill(relativeOrbit,kRing);
396 rpcCorner->Fill(cornerFlag);
397 rpcCornerVsOrbit->Fill(relativeOrbit,cornerFlag);
398 if (nRPC > nRPCHitsCut) {
400 RPCClSizeH->Fill(
min((
float)clSize,(
float)60.));
401 rpcStationH->Fill(kStation);
402 rpcRingH->Fill(kRing);
403 rpcSectorH->Fill(kSector);
404 rpcLayerH->Fill(kLayer);
405 rpcCornerH->Fill(cornerFlag);
417 event.getByLabel(
"muonCSCDigis",
"MuonCSCWireDigi",wires);
418 event.getByLabel(
"muonCSCDigis",
"MuonCSCStripDigi",strips);
423 std::vector<CSCWireDigi>::const_iterator wireIterA = (*jW).second.first;
424 std::vector<CSCWireDigi>::const_iterator lWireA = (*jW).second.second;
425 for( ; wireIterA != lWireA; ++wireIterA) {
435 std::vector<CSCStripDigi>::const_iterator stripItA = (*jS).second.first;
436 std::vector<CSCStripDigi>::const_iterator lastStripA = (*jS).second.second;
437 for( ; stripItA != lastStripA; ++stripItA) {
438 std::vector<int> myADCVals = stripItA->getADCCounts();
439 int iDiff = myADCVals[4]+myADCVals[5]-myADCVals[0]-myADCVals[1];
452 event.getByLabel(
"muonDTDigis",dtDIGIs);
461 digi != digiRange.second;
463 double t0 = (*digi).countsTDC();
465 if ((t0>3050) && (t0<3700)) {
470 if (fillHistograms) {
472 if (nRPC > nRPCHitsCut) {t0AllH->Fill(t0);}
481 if (nEventsAnalyzed < 1000) {
std::cout <<
"\tnumber of CSC DIGIS = " << nW <<
", " << nS
482 <<
"\tDT DIGIS = " << nDT
483 <<
"\tRPC Rechits = " << nRPC << std::endl;}
485 if (fillHistograms) {
487 nWires->Fill(
min((
float)nW,(
float)120.));
488 nStrips->Fill(
min((
float)nS,(
float)200.));
490 nDTDigis->Fill(
min((
float)nDT,(
float)200.));
491 nDTDigisIn->Fill(
min((
float)nDTin,(
float)200.));
492 nDTDigisOut->Fill(
min((
float)nDTout,(
float)200.));
495 fDTDigisOut->Fill(fracOut);
497 nRPCRecHits->Fill(
min((
float)nRPC,(
float)100.));
498 nRPCRecHitsLong->Fill(
min((
float)nRPC,(
float)1000.));
499 hitsVsSerial->Fill(nEventsAnalyzed,nRPC);
500 hitsVsOrbit->Fill(relativeOrbit,nRPC);
501 orbitVsSerial->Fill(nEventsAnalyzed,relativeOrbit);
503 if (nRPC > nRPCHitsCut) {
504 nWiresH->Fill(
min((
float)nW,(
float)120.));
505 nStripsH->Fill(
min((
float)nS,(
float)200.));
506 nDTDigisH->Fill(
min((
float)nDT,(
float)200.));
507 nDTDigisInH->Fill(
min((
float)nDTin,(
float)200.));
508 nDTDigisOutH->Fill(
min((
float)nDTout,(
float)200.));
511 fDTDigisOutH->Fill(fracOut);
518 selectThisEvent = (nRPC > nRPCHitsCut) && (nW > nCSCWiresCut || nS > nCSCStripsCut) && (nDT > nDTDigisCut);
519 if (selectThisEvent) {nEventsSelected++;}
521 return selectThisEvent;
T getUntrackedParameter(std::string const &, T const &) const
TProfile * rpcStationVsOrbit
C::const_iterator const_iterator
constant access iterator type
#define DEFINE_FWK_MODULE(type)
TProfile * rpcSectorVsOrbit
static const std::string kLayer("layer")
TProfile * rpcCornerVsOrbit
std::vector< DigiType >::const_iterator const_iterator
bool filter(edm::Event &, const edm::EventSetup &) override
std::string histogramFileName
RPCNoise(const edm::ParameterSet &)
std::pair< const_iterator, const_iterator > Range
TProfile * rpcRingVsOrbit
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.