72 makeHistogramsForMessyEvents = pset.
getUntrackedParameter<
bool>(
"makeHistogramsForMessyEvebts",
false);
90 <<
"\n\t===== CSCSkim =====\n"
91 <<
"\t\ttype of skim ...............................\t" << typeOfSkim
92 <<
"\t\tminimum number of layers with hits .........\t" << nLayersWithHitsMinimum
93 <<
"\n\t\tminimum number of chambers w/ hit layers..\t" << minimumHitChambers
94 <<
"\n\t\tminimum number of segments ...............\t" << minimumSegments
95 <<
"\n\t\tdemand chambers on both sides.............\t" << demandChambersBothSides
96 <<
"\n\t\tmake histograms...........................\t" << makeHistograms
97 <<
"\n\t\t..for messy events........................\t" << makeHistogramsForMessyEvents
98 <<
"\n\t===================\n\n";
119 nEventsChambersBothSides = 0;
120 nEventsOverlappingChambers = 0;
122 nEventsCertainChamber = 0;
123 nEventsDTOverlap = 0;
125 nEventsLongSATrack = 0;
126 nEventsForBFieldStudies = 0;
130 if (makeHistograms || makeHistogramsForMessyEvents) {
134 theHistogramFile->cd();
136 if (makeHistograms) {
138 hxnRecHits =
new TH1F(
"hxnRecHits",
"n RecHits",61,-0.5,60.5);
139 hxnSegments =
new TH1F(
"hxnSegments",
"n Segments",11,-0.5,10.5);
140 hxnHitChambers =
new TH1F(
"hxnHitsChambers",
"n chambers with hits",11,-0.5,10.5);
141 hxnRecHitsSel =
new TH1F(
"hxnRecHitsSel",
"n RecHits selected",61,-0.5,60.5);
143 xxP =
new TH1F(
"xxP",
"P global",100,0.,200.);
144 xxnValidHits =
new TH1F(
"xxnValidHits",
"n valid hits global",61,-0.5,60.5);
145 xxnTrackerHits =
new TH1F(
"xxnTrackerHits",
"n tracker hits global",61,-0.5,60.5);
146 xxnCSCHits =
new TH1F(
"xxnCSCHits",
"n CSC hits global",41,-0.5,40.5);
147 xxredChiSq =
new TH1F(
"xxredChiSq",
"red chisq global",100,0.,100.);
152 if (makeHistogramsForMessyEvents) {
154 mevnRecHits0 =
new TH1F(
"mevnRecHits0",
"n RecHits",121,-0.5,120.5);
155 mevnChambers0 =
new TH1F(
"mevnChambers0",
"n chambers with hits",21,-0.5,20.5);
156 mevnSegments0 =
new TH1F(
"mevnSegments0",
"n Segments",21,-0.5,20.5);
157 mevnRecHits1 =
new TH1F(
"mevnRecHits1",
"n RecHits",100,0.,300.);
158 mevnChambers1 =
new TH1F(
"mevnChambers1",
"n chambers with hits",50,0.,50.);
159 mevnSegments1 =
new TH1F(
"mevnSegments1",
"n Segments",30,0.,30.);
174 if (nEventsAnalyzed > 0) {fraction = (float)nEventsSelected / (
float)nEventsAnalyzed;}
177 <<
"\n\n\t====== CSCSkim ==========================================================\n"
178 <<
"\t\ttype of skim ...............................\t" << typeOfSkim <<
"\n"
179 <<
"\t\tevents analyzed ..............\t" << nEventsAnalyzed <<
"\n"
180 <<
"\t\tevents selected ..............\t" << nEventsSelected <<
"\tfraction= " << fraction << std::endl
181 <<
"\t\tevents chambers both sides ...\t" << nEventsChambersBothSides <<
"\n"
182 <<
"\t\tevents w/ overlaps .......... \t" << nEventsOverlappingChambers <<
"\n"
183 <<
"\t\tevents lots of hit chambers . \t" << nEventsMessy <<
"\n"
184 <<
"\t\tevents from certain chamber . \t" << nEventsCertainChamber <<
"\n"
185 <<
"\t\tevents in DT-CSC overlap .... \t" << nEventsDTOverlap <<
"\n"
186 <<
"\t\tevents halo-like ............ \t" << nEventsHaloLike <<
"\n"
187 <<
"\t\tevents w/ long SA track ..... \t" << nEventsLongSATrack <<
"\n"
188 <<
"\t\tevents good for BField ..... \t" << nEventsForBFieldStudies <<
"\n"
189 <<
"\t=========================================================================\n\n";
191 if (makeHistograms || makeHistogramsForMessyEvents) {
193 LogDebug(
"[CSCSkim]") <<
"======= write out my histograms ====\n" ;
194 theHistogramFile->cd();
195 if (makeHistograms) {
197 hxnSegments->Write();
198 hxnHitChambers->Write();
199 hxnRecHitsSel->Write();
201 if (makeHistogramsForMessyEvents) {
202 mevnRecHits0->Write();
203 mevnChambers0->Write();
204 mevnSegments0->Write();
205 mevnRecHits1->Write();
206 mevnChambers1->Write();
207 mevnSegments1->Write();
209 theHistogramFile->Close();
222 iRun =
event.id().run();
223 iEvent =
event.id().event();
225 LogDebug(
"[CSCSkim] EventInfo") <<
"Run: " << iRun <<
"\tEvent: " <<
iEvent <<
"\tn Analyzed: " << nEventsAnalyzed;
236 event.getByLabel(
"muonCSCDigis",
"MuonCSCWireDigi",wires);
237 event.getByLabel(
"muonCSCDigis",
"MuonCSCStripDigi",strips);
240 event.getByLabel(
"simMuonCSCDigis",
"MuonCSCWireDigi",wires);
241 event.getByLabel(
"simMuonCSCDigis",
"MuonCSCStripDigi",strips);
246 event.getByLabel(cscRecHitTag,cscRecHits);
250 event.getByLabel(cscSegmentTag, cscSegments);
254 if (typeOfSkim == 8) {
255 event.getByLabel(SAMuonTag,saMuons);
261 if (typeOfSkim == 9) {
262 event.getByLabel(SAMuonTag,saMuons);
263 event.getByLabel(trackTag,tracks);
264 event.getByLabel(GLBMuonTag,gMuons);
274 bool basicEvent =
false;
275 if (typeOfSkim == 1 || typeOfSkim == 2) {
276 basicEvent = doCSCSkimming(cscRecHits,cscSegments);
280 bool goodOverlapEvent =
false;
281 if (typeOfSkim == 3) {
282 goodOverlapEvent = doOverlapSkimming(cscSegments);
283 if (goodOverlapEvent) {nEventsOverlappingChambers++;}
287 bool messyEvent =
false;
288 if (typeOfSkim == 4) {
289 messyEvent = doMessyEventSkimming(cscRecHits,cscSegments);
290 if (messyEvent) {nEventsMessy++;}
294 bool hasChamber =
false;
295 if (typeOfSkim == 5) {
296 hasChamber = doCertainChamberSelection(wires,strips);
297 if (hasChamber) {nEventsCertainChamber++;}
301 bool DTOverlapCandidate =
false;
302 if (typeOfSkim == 6) {
303 DTOverlapCandidate = doDTOverlap(cscSegments);
304 if (DTOverlapCandidate) {nEventsDTOverlap++;}
308 bool HaloLike =
false;
309 if (typeOfSkim == 7) {
310 HaloLike = doHaloLike(cscSegments);
311 if (HaloLike) {nEventsHaloLike++;}
315 bool LongSATrack =
false;
316 if (typeOfSkim == 8) {
317 LongSATrack = doLongSATrack(saMuons);
318 if (LongSATrack) {nEventsLongSATrack++;}
322 bool GoodForBFieldStudy =
false;
323 if (typeOfSkim == 9) {
324 GoodForBFieldStudy = doBFieldStudySelection(saMuons,tracks,gMuons);
325 if (GoodForBFieldStudy) {nEventsForBFieldStudies++;}
330 bool selectThisEvent =
false;
331 if (typeOfSkim == 1 || typeOfSkim == 2) {selectThisEvent = basicEvent;}
332 if (typeOfSkim == 3) {selectThisEvent = goodOverlapEvent;}
333 if (typeOfSkim == 4) {selectThisEvent = messyEvent;}
334 if (typeOfSkim == 5) {selectThisEvent = hasChamber;}
335 if (typeOfSkim == 6) {selectThisEvent = DTOverlapCandidate;}
336 if (typeOfSkim == 7) {selectThisEvent = HaloLike;}
337 if (typeOfSkim == 8) {selectThisEvent = LongSATrack;}
338 if (typeOfSkim == 9) {selectThisEvent = GoodForBFieldStudy;}
340 if (selectThisEvent) {nEventsSelected++;}
342 return selectThisEvent;
355 int nRecHits = cscRecHits->size();
359 for (
int i = 0;
i < 600;
i++) {
368 for (recIt = cscRecHits->begin(); recIt != cscRecHits->end(); recIt++) {
372 int kEndcap = idrec.
endcap();
373 int kRing = idrec.
ring();
374 int kStation = idrec.
station();
375 int kChamber = idrec.
chamber();
379 int kSerial = chamberSerial( kEndcap, kStation, kRing, kChamber ) ;
383 int kDigit = (int)
pow((
float)10.,(float)(kLayer-1));
384 cntRecHit[kSerial] += kDigit;
393 int nChambersWithMinimalHits = 0;
394 int nChambersWithMinimalHitsPOS = 0;
395 int nChambersWithMinimalHitsNEG = 0;
397 for (
int i = 0;
i < 600;
i++) {
398 if (cntRecHit[
i] > 0) {
399 int nLayersWithHits = 0;
400 float dummy = (float) cntRecHit[
i];
401 for (
int j = 5;
j > -1;
j--) {
402 float digit = dummy /
pow( (
float)10., (
float)
j );
403 int kCount = (int) digit;
404 if (kCount > 0) nLayersWithHits++;
405 dummy = dummy - ( (float) kCount) *
pow( (
float)10., (
float)j );
407 if (nLayersWithHits > nLayersWithHitsMinimum) {
408 if (
i < 300) {nChambersWithMinimalHitsPOS++;}
409 else {nChambersWithMinimalHitsNEG++;}
413 nChambersWithMinimalHits = nChambersWithMinimalHitsPOS + nChambersWithMinimalHitsNEG;
417 int nSegments = cscSegments->size();
423 if (makeHistograms) {
424 hxnRecHits->Fill(nRecHits);
426 hxnSegments->Fill(nSegments);
427 hxnHitChambers->Fill(nChambersWithMinimalHits);
429 if (nChambersWithMinimalHits > 0) {
430 hxnRecHitsSel->Fill(nRecHits);
437 bool basicEvent = ( nChambersWithMinimalHits >= minimumHitChambers ) && ( nSegments >= minimumSegments );
439 bool chambersOnBothSides = ((nChambersWithMinimalHitsPOS >= minimumHitChambers) && (nChambersWithMinimalHitsNEG >= minimumHitChambers));
441 if (chambersOnBothSides) {nEventsChambersBothSides++;}
443 bool selectEvent =
false;
444 if (typeOfSkim == 1) {selectEvent = basicEvent;}
445 if (typeOfSkim == 2) {selectEvent = chambersOnBothSides;}
449 LogDebug(
"[CSCSkim]") <<
"----- nRecHits = " << nRecHits
450 <<
"\tnChambersWithMinimalHits = " << nChambersWithMinimalHits
451 <<
"\tnSegments = " << nSegments
452 <<
"\tselect? " << selectEvent << std::endl;
482 const int nhitsMinimum = 4;
483 const float chisqMaximum = 100.;
484 const int nAllMaximum = 3;
492 for (
int i=0;
i<600;
i++) {
504 int kEndcap =
id.
endcap();
505 int kStation =
id.station();
506 int kRing =
id.ring();
507 int kChamber =
id.chamber();
508 int kSerial = chamberSerial( kEndcap, kStation, kRing, kChamber);
511 float chisq = (*it).chi2();
512 int nhits = (*it).nRecHits();
515 bool goodSegment = (nhits >= nhitsMinimum) && (chisq < chisqMaximum) ;
529 if (goodSegment) nGood[kSerial]++;
538 bool messyChamber =
false;
539 for (
int i = 0;
i < 600;
i++) {
540 if (nAll[
i] > nAllMaximum) messyChamber =
true;
545 bool consecutiveChambers =
false;
546 for (
int i = 0;
i < 599;
i++) {
547 if ( (nGood[
i]>0) && (nGood[
i+1]>0) ) consecutiveChambers =
true;
550 bool selectThisEvent = !messyChamber && consecutiveChambers;
552 return selectThisEvent;
565 int nRecHits = cscRecHits->size();
569 for (
int i = 0;
i < 600;
i++) {
578 for (recIt = cscRecHits->begin(); recIt != cscRecHits->end(); recIt++) {
582 int kEndcap = idrec.
endcap();
583 int kRing = idrec.
ring();
584 int kStation = idrec.
station();
585 int kChamber = idrec.
chamber();
589 int kSerial = chamberSerial( kEndcap, kStation, kRing, kChamber ) ;
593 int kDigit = (int)
pow((
float)10.,(float)(kLayer-1));
594 cntRecHit[kSerial] += kDigit;
603 int nChambersWithMinimalHits = 0;
604 int nChambersWithMinimalHitsPOS = 0;
605 int nChambersWithMinimalHitsNEG = 0;
607 for (
int i = 0;
i < 600;
i++) {
608 if (cntRecHit[
i] > 0) {
609 int nLayersWithHits = 0;
610 float dummy = (float) cntRecHit[
i];
611 for (
int j = 5;
j > -1;
j--) {
612 float digit = dummy /
pow( (
float)10., (
float)
j );
613 int kCount = (int) digit;
614 if (kCount > 0) nLayersWithHits++;
615 dummy = dummy - ( (float) kCount) *
pow( (
float)10., (
float)j );
617 if (nLayersWithHits > nLayersWithHitsMinimum) {
618 if (
i < 300) {nChambersWithMinimalHitsPOS++;}
619 else {nChambersWithMinimalHitsNEG++;}
623 nChambersWithMinimalHits = nChambersWithMinimalHitsPOS + nChambersWithMinimalHitsNEG;
627 int nSegments = cscSegments->size();
633 if (makeHistogramsForMessyEvents) {
635 mevnRecHits0->Fill(nRecHits);
636 mevnChambers0->Fill(nChambersWithMinimalHits);
637 mevnSegments0->Fill(nSegments);
640 double dummy = (double) nRecHits;
641 if (dummy > 299.9) dummy = 299.9;
642 mevnRecHits1->Fill(dummy);
643 dummy = (double) nChambersWithMinimalHits;
644 if (dummy > 49.9) dummy = 49.9;
645 mevnChambers1->Fill(dummy);
646 dummy = (double) nSegments;
647 if (dummy > 29.9) dummy = 29.9;
648 mevnSegments1->Fill(dummy);
656 bool selectEvent =
false;
657 if ( (nRecHits > 54) && (nChambersWithMinimalHits > 5) ) {selectEvent =
true;}
660 LogDebug(
"[CSCSkim]") <<
"----- nRecHits = " << nRecHits
661 <<
"\tnChambersWithMinimalHits = " << nChambersWithMinimalHits
662 <<
"\tnSegments = " << nSegments
663 <<
"\tselect? " << selectEvent << std::endl;
697 bool certainChamberIsPresentInWires =
false;
700 int kEndcap =
id.
endcap();
701 int kRing =
id.ring();
702 int kStation =
id.station();
703 int kChamber =
id.chamber();
704 if ( (kEndcap == whichEndcap) &&
705 (kStation == whichStation) &&
706 (kRing == whichRing) &&
707 (kChamber == whichChamber) )
708 {certainChamberIsPresentInWires =
true;}
713 bool certainChamberIsPresentInStrips =
false;
716 int kEndcap =
id.
endcap();
717 int kRing =
id.ring();
718 int kStation =
id.station();
719 int kChamber =
id.chamber();
720 if ( (kEndcap == whichEndcap) &&
721 (kStation == whichStation) &&
722 (kRing == whichRing) &&
723 (kChamber == whichChamber) )
724 {certainChamberIsPresentInStrips =
true;}
727 bool certainChamberIsPresent = certainChamberIsPresentInWires || certainChamberIsPresentInStrips;
729 return certainChamberIsPresent;
740 const float chisqMax = 100.;
741 const int nhitsMin = 5;
742 const int maxNSegments = 3;
745 bool DTOverlapCandidate =
false;
752 for (
int i=0;
i<36; ++
i) {
765 int nSegments = cscSegments->size();
766 if (nSegments < 2)
return DTOverlapCandidate;
771 int kEndcap =
id.
endcap();
772 int kStation =
id.station();
773 int kRing =
id.ring();
774 int kChamber =
id.chamber();
776 float chisq = (*it).chi2();
777 int nhits = (*it).nRecHits();
778 bool goodSegment = (chisq < chisqMax) && (nhits >= nhitsMin) ;
780 if ( (kStation == 1) && (kRing == 3) ) {
781 if (kEndcap == 1) {cntMEP13[kChamber-1]++;}
782 if (kEndcap == 2) {cntMEN13[kChamber-1]++;}
784 if ( (kStation == 2) && (kRing == 2) ) {
785 if (kEndcap == 1) {cntMEP22[kChamber-1]++;}
786 if (kEndcap == 2) {cntMEN22[kChamber-1]++;}
788 if ( (kStation == 3) && (kRing == 2) ) {
789 if (kEndcap == 1) {cntMEP32[kChamber-1]++;}
790 if (kEndcap == 2) {cntMEN32[kChamber-1]++;}
798 bool tooManySegments =
false;
799 for (
int i=0;
i<36; ++
i) {
800 if ( (cntMEP13[
i] > maxNSegments) ||
801 (cntMEN13[
i] > maxNSegments) ||
802 (cntMEP22[
i] > maxNSegments) ||
803 (cntMEN22[
i] > maxNSegments) ||
804 (cntMEP32[
i] > maxNSegments) ||
805 (cntMEN32[
i] > maxNSegments) ) tooManySegments =
true;
807 if (tooManySegments) {
808 return DTOverlapCandidate;
814 bool matchup =
false;
815 for (
int i=0;
i<36; ++
i) {
816 if ( (cntMEP13[
i] > 0) && (cntMEP22[
i]+cntMEP32[
i] > 0) ) {matchup =
true;}
817 if ( (cntMEN13[
i] > 0) && (cntMEN22[
i]+cntMEN32[
i] > 0) ) {matchup =
true;}
834 DTOverlapCandidate = matchup;
835 return DTOverlapCandidate;
848 const float chisqMax = 100.;
849 const int nhitsMin = 5;
850 const int maxNSegments = 3;
853 bool HaloLike =
false;
864 for (
int i=0;
i<36; ++
i) {
880 int nSegments = cscSegments->size();
881 if (nSegments < 4)
return HaloLike;
886 int kEndcap =
id.
endcap();
887 int kStation =
id.station();
888 int kRing =
id.ring();
889 int kChamber =
id.chamber();
891 float chisq = (*it).chi2();
892 int nhits = (*it).nRecHits();
893 bool goodSegment = (chisq < chisqMax) && (nhits >= nhitsMin) ;
895 if ( (kStation == 1) && (kRing == 1) ) {
896 if (kEndcap == 1) {cntMEP11[kChamber-1]++;}
897 if (kEndcap == 2) {cntMEN11[kChamber-1]++;}
899 if ( (kStation == 1) && (kRing == 2) ) {
900 if (kEndcap == 1) {cntMEP12[kChamber-1]++;}
901 if (kEndcap == 2) {cntMEN12[kChamber-1]++;}
903 if ( (kStation == 2) && (kRing == 1) ) {
904 if (kEndcap == 1) {cntMEP21[kChamber-1]++;}
905 if (kEndcap == 2) {cntMEN21[kChamber-1]++;}
907 if ( (kStation == 3) && (kRing == 1) ) {
908 if (kEndcap == 1) {cntMEP31[kChamber-1]++;}
909 if (kEndcap == 2) {cntMEN31[kChamber-1]++;}
911 if ( (kStation == 4) && (kRing == 1) ) {
912 if (kEndcap == 1) {cntMEP41[kChamber-1]++;}
913 if (kEndcap == 2) {cntMEN41[kChamber-1]++;}
921 bool tooManySegments =
false;
922 for (
int i=0;
i<36; ++
i) {
923 if ( (cntMEP11[
i] > 3*maxNSegments) ||
924 (cntMEN11[
i] > 3*maxNSegments) ||
925 (cntMEP12[
i] > maxNSegments) ||
926 (cntMEN12[
i] > maxNSegments) ||
927 (cntMEP21[
i] > maxNSegments) ||
928 (cntMEN21[
i] > maxNSegments) ||
929 (cntMEP31[
i] > maxNSegments) ||
930 (cntMEN31[
i] > maxNSegments) ||
931 (cntMEP41[
i] > maxNSegments) ||
932 (cntMEN41[
i] > maxNSegments) ) tooManySegments =
true;
934 if (tooManySegments) {
941 bool matchup =
false;
942 for (
int i=0;
i<36; ++
i) {
943 if ( (cntMEP11[
i]+cntMEP12[
i] > 0) &&
946 (cntMEP41[
i] > 0) ) {matchup =
true;}
947 if ( (cntMEN11[
i]+cntMEN12[
i] > 0) &&
950 (cntMEN41[
i] > 0) ) {matchup =
true;}
994 const float zDistanceMax = 2500.;
995 const float zDistanceMin = 700.;
996 const int nCSCHitsMin = 25;
997 const int nCSCHitsMax = 50;
998 const float zInnerMax = 80000.;
1000 const int nNiceMuonsMin = 1;
1008 for(reco::TrackCollection::const_iterator
muon = saMuons->begin();
muon != saMuons->end(); ++
muon ) {
1014 GlobalPoint ip(innerPo.x(), innerPo.y(),innerPo.z());
1016 GlobalPoint op(outerPo.x(), outerPo.y(),outerPo.z());
1017 float zInner = ip.
z();
1018 float zOuter = op.z();
1019 float zDistance = fabs(zOuter-zInner);
1027 const DetId detId( (*hit)->geographicalId() );
1043 if ( (zDistance < zDistanceMax) && (zDistance > zDistanceMin)
1044 && (nCSCHits > nCSCHitsMin) && (nCSCHits < nCSCHitsMax)
1045 && (
min ( fabs(zInner), fabs(zOuter) ) < zInnerMax)
1046 && (fabs(innerMo.z()) > 0.000000001) ) {
1051 bool select = (nNiceMuons >= nNiceMuonsMin);
1070 bool acceptThisEvent =
false;
1075 int nGoodSAMuons = 0;
1076 for (reco::TrackCollection::const_iterator
muon = saMuons->begin();
muon != saMuons->end(); ++
muon ) {
1077 float preco =
muon->p();
1080 GlobalPoint iPnt(innerPo.x(), innerPo.y(),innerPo.z());
1082 GlobalPoint oPnt(outerPo.x(), outerPo.y(),outerPo.z());
1083 float zLength =
abs( iPnt.z() - oPnt.z() );
1086 GlobalVector iP(innerMom.x(), innerMom.y(), innerMom.z() );
1088 GlobalVector oP(outerMom.x(), outerMom.y(), outerMom.z() );
1090 const float zRef = 300.;
1091 float xExt = 10000.;
1092 float yExt = 10000.;
1093 if (
abs(oPnt.z()) <
abs(iPnt.z())) {
1096 deltaZ = zRef - oPnt.
z();
1098 deltaZ = -zRef - oPnt.z();
1100 xExt = oPnt.x() + deltaZ * oP.x() / oP.z();
1101 yExt = oPnt.y() + deltaZ * oP.y() / oP.z();
1105 deltaZ = zRef - iPnt.z();
1107 deltaZ = -zRef - iPnt.z();
1109 xExt = iPnt.x() + deltaZ * iP.x() / iP.z();
1110 yExt = iPnt.y() + deltaZ * iP.y() / iP.z();
1112 float rExt =
sqrt( xExt*xExt + yExt*yExt );
1119 const DetId detId( (*hit)->geographicalId() );
1131 if (nCSCHits >= nCSCHitsMin) {
1132 if (
abs(iPnt.z()) <
abs(iPnt.z())) {
1139 bool goodSAMuon = (preco > pMin)
1140 && ( zLength > zLengthMin )
1141 && ( nCSCHits >= nCSCHitsMin )
1142 && ( zInner < zInnerMax )
1143 && ( rExt < rExtMax ) ;
1145 if (goodSAMuon) {nGoodSAMuons++;}
1155 int nGoodTracks = 0;
1156 for (reco::TrackCollection::const_iterator track = tracks->begin(); track != tracks->end(); ++ track ) {
1157 float preco = track->p();
1158 int n = track->recHitsSize();
1161 GlobalPoint iPnt(innerPo.x(), innerPo.y(),innerPo.z());
1163 GlobalPoint oPnt(outerPo.x(), outerPo.y(),outerPo.z());
1164 float zLength =
abs( iPnt.z() - oPnt.z() );
1167 GlobalVector iP(innerMom.x(), innerMom.y(), innerMom.z() );
1169 GlobalVector oP(outerMom.x(), outerMom.y(), outerMom.z() );
1171 const float zRef = 300.;
1172 float xExt = 10000.;
1173 float yExt = 10000.;
1174 if (
abs(oPnt.z()) >
abs(iPnt.z())) {
1177 deltaZ = zRef - oPnt.
z();
1179 deltaZ = -zRef - oPnt.z();
1181 xExt = oPnt.x() + deltaZ * oP.x() / oP.z();
1182 yExt = oPnt.y() + deltaZ * oP.y() / oP.z();
1186 deltaZ = zRef - iPnt.z();
1188 deltaZ = -zRef - iPnt.z();
1190 xExt = iPnt.x() + deltaZ * iP.x() / iP.z();
1191 yExt = iPnt.y() + deltaZ * iP.y() / iP.z();
1193 float rExt =
sqrt( xExt*xExt + yExt*yExt );
1196 && (n >= nTrHitsMin)
1197 && (zLength > zLengthTrMin)
1198 && ( rExt < rExtMax ) ;
1200 if (goodTrack) {nGoodTracks++;}
1208 int nGoodGlobalMuons = 0;
1209 for (reco::MuonCollection::const_iterator global = gMuons->begin(); global != gMuons->end(); ++global ) {
1211 if (global->isGlobalMuon()) {
1213 float pDef = global->p();
1214 float redChiSq = global->globalTrack()->normalizedChi2();
1225 const DetId detId( (*hit)->geographicalId() );
1236 bool goodGlobalMuon = (pDef > pMin)
1237 && ( nTrackerHits >= nValidHitsMin )
1238 && ( nCSCHits >= nCSCHitsMin )
1239 && ( redChiSq < redChiSqMax );
1241 if (goodGlobalMuon) {nGoodGlobalMuons++;}
1250 acceptThisEvent = ( (nGoodSAMuons > 0) && (nGoodTracks > 0) ) || (nGoodGlobalMuons > 0) ;
1252 return acceptThisEvent;
1260 int kSerial = kChamber;
1261 if (kStation == 1 && kRing == 1) {kSerial = kChamber;}
1262 if (kStation == 1 && kRing == 2) {kSerial = kChamber + 36;}
1263 if (kStation == 1 && kRing == 3) {kSerial = kChamber + 72;}
1264 if (kStation == 1 && kRing == 4) {kSerial = kChamber;}
1265 if (kStation == 2 && kRing == 1) {kSerial = kChamber + 108;}
1266 if (kStation == 2 && kRing == 2) {kSerial = kChamber + 126;}
1267 if (kStation == 3 && kRing == 1) {kSerial = kChamber + 162;}
1268 if (kStation == 3 && kRing == 2) {kSerial = kChamber + 180;}
1269 if (kStation == 4 && kRing == 1) {kSerial = kChamber + 216;}
1270 if (kStation == 4 && kRing == 2) {kSerial = kChamber + 234;}
1271 if (kEndcap == 2) {kSerial = kSerial + 300;}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual bool filter(edm::Event &event, const edm::EventSetup &eventSetup) override
#define DEFINE_FWK_MODULE(type)
bool doLongSATrack(edm::Handle< reco::TrackCollection > saTracks)
bool doOverlapSkimming(edm::Handle< CSCSegmentCollection > cscSegments)
bool doDTOverlap(edm::Handle< CSCSegmentCollection > cscSegments)
C::const_iterator const_iterator
constant access iterator type
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
static const std::string kLayer("layer")
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool doCSCSkimming(edm::Handle< CSCRecHit2DCollection > cscRecHits, edm::Handle< CSCSegmentCollection > cscSegments)
bool doCertainChamberSelection(edm::Handle< CSCWireDigiCollection > wires, edm::Handle< CSCStripDigiCollection > strips)
bool doBFieldStudySelection(edm::Handle< reco::TrackCollection > saTracks, edm::Handle< reco::TrackCollection > Tracks, edm::Handle< reco::MuonCollection > gMuons)
EventAuxiliary const & eventAuxiliary() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
int numberOfValidTrackerHits() const
bool doMessyEventSkimming(edm::Handle< CSCRecHit2DCollection > cscRecHits, edm::Handle< CSCSegmentCollection > cscSegments)
int chamberSerial(int kE, int kS, int kR, int kCh)
CSCSkim(const edm::ParameterSet &pset)
Power< A, B >::type pow(const A &a, const B &b)
bool doHaloLike(edm::Handle< CSCSegmentCollection > cscSegments)