33 for (
unsigned int i = 0;
i < 4;
i++) {
75 hCaloSegmentCompat[
i] =
dbe_->
book2D(
"hCaloSegmentCompat",
"Calo Compatibility vs. Segment Compatibility", 101, -0.05, 1.05, 101, -0.05, 1.05);
108 sprintf(name,
"hDT%iPullxPropErr",
station+1);
109 sprintf(title,
"DT Station %i Pull X w/ Propagation Error Only",
station+1);
112 sprintf(name,
"hDT%iPulldXdZPropErr",
station+1);
113 sprintf(title,
"DT Station %i Pull DxDz w/ Propagation Error Only",
station+1);
117 sprintf(name,
"hDT%iPullyPropErr",
station+1);
118 sprintf(title,
"DT Station %i Pull Y w/ Propagation Error Only",
station+1);
121 sprintf(name,
"hDT%iPulldYdZPropErr",
station+1);
122 sprintf(title,
"DT Station %i Pull DyDz w/ Propagation Error Only",
station+1);
126 sprintf(name,
"hDT%iDistWithSegment",
station+1);
127 sprintf(title,
"DT Station %i Dist When There Is A Segment",
station+1);
130 sprintf(name,
"hDT%iDistWithNoSegment",
station+1);
131 sprintf(title,
"DT Station %i Dist When There Is No Segment",
station+1);
134 sprintf(name,
"hDT%iPullDistWithSegment",
station+1);
135 sprintf(title,
"DT Station %i Pull Dist When There Is A Segment",
station+1);
138 sprintf(name,
"hDT%iPullDistWithNoSegment",
station+1);
139 sprintf(title,
"DT Station %i Pull Dist When There Is No Segment",
station+1);
142 sprintf(name,
"hCSC%iPullxPropErr",
station+1);
143 sprintf(title,
"CSC Station %i Pull X w/ Propagation Error Only",
station+1);
146 sprintf(name,
"hCSC%iPulldXdZPropErr",
station+1);
147 sprintf(title,
"CSC Station %i Pull DxDz w/ Propagation Error Only",
station+1);
150 sprintf(name,
"hCSC%iPullyPropErr",
station+1);
151 sprintf(title,
"CSC Station %i Pull Y w/ Propagation Error Only",
station+1);
154 sprintf(name,
"hCSC%iPulldYdZPropErr",
station+1);
155 sprintf(title,
"CSC Station %i Pull DyDz w/ Propagation Error Only",
station+1);
158 sprintf(name,
"hCSC%iDistWithSegment",
station+1);
159 sprintf(title,
"CSC Station %i Dist When There Is A Segment",
station+1);
162 sprintf(name,
"hCSC%iDistWithNoSegment",
station+1);
163 sprintf(title,
"CSC Station %i Dist When There Is No Segment",
station+1);
166 sprintf(name,
"hCSC%iPullDistWithSegment",
station+1);
167 sprintf(title,
"CSC Station %i Pull Dist When There Is A Segment",
station+1);
170 sprintf(name,
"hCSC%iPullDistWithNoSegment",
station+1);
171 sprintf(title,
"CSC Station %i Pull Dist When There Is No Segment",
station+1);
194 for(
int wheel = 0; wheel < 5; ++wheel) {
196 for(
int sector = 0; sector < 14; ++sector)
198 sprintf(name,
"hDTChamberDx_%i_%i_%i",
station+1, wheel-2, sector+1);
199 sprintf(title,
"DT Chamber Delta X: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
203 sprintf(name,
"hDTChamberDy_%i_%i_%i",
station+1, wheel-2, sector+1);
204 sprintf(title,
"DT Chamber Delta Y: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
208 sprintf(name,
"hDTChamberEdgeXWithSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
209 sprintf(title,
"DT Chamber Edge X When There Is A Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
212 sprintf(name,
"hDTChamberEdgeXWithNoSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
213 sprintf(title,
"DT Chamber Edge X When There Is No Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
216 sprintf(name,
"hDTChamberEdgeYWithSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
217 sprintf(title,
"DT Chamber Edge Y When There Is A Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
220 sprintf(name,
"hDTChamberEdgeYWithNoSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
221 sprintf(title,
"DT Chamber Edge Y When There Is No Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
231 for(
int chamber = 0; chamber < 36; ++chamber)
233 sprintf(name,
"hCSCChamberDx_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
234 sprintf(title,
"CSC Chamber Delta X: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1, chamber+1);
237 sprintf(name,
"hCSCChamberDy_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
238 sprintf(title,
"CSC Chamber Delta Y: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1, chamber+1);
241 sprintf(name,
"hCSCChamberEdgeXWithSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
242 sprintf(title,
"CSC Chamber Edge X When There Is A Segment: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1, chamber+1);
245 sprintf(name,
"hCSCChamberEdgeXWithNoSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
246 sprintf(title,
"CSC Chamber Edge X When There Is No Segment: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1, chamber+1);
249 sprintf(name,
"hCSCChamberEdgeYWithSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
250 sprintf(title,
"CSC Chamber Edge Y When There Is A Segment: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1, chamber+1);
253 sprintf(name,
"hCSCChamberEdgeYWithNoSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
254 sprintf(title,
"CSC Chamber Edge Y When There Is No Segment: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1, chamber+1);
267 using namespace reco;
279 unsigned int muonIdx = 0;
284 for (
unsigned int i = 0;
i < 4;
i++) {
292 if (fabs(
muon->eta()) > 1.479)
297 if (fabs(
muon->eta()) > 1.4)
302 if (fabs(
muon->eta()) < 1.26)
307 if (
muon->isTimeValid()) {
316 MuonTimeExtra combinedMuonTimeExtra = (*combinedMuonTimeExtraValueMapH_)[muonRef];
317 MuonTimeExtra cscMuonTimeExtra = (*cscMuonTimeExtraValueMapH_)[muonRef];
318 MuonTimeExtra dtMuonTimeExtra = (*dtMuonTimeExtraValueMapH_)[muonRef];
337 if (
muon->isCaloCompatibilityValid())
342 if (
muon->isQualityValid()) {
388 if (error == 0) error = 0.000001;
405 if (error == 0) error = 0.000001;
420 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
421 chamberMatch !=
muon->matches().end(); ++chamberMatch)
423 int station = chamberMatch->station();
427 int wheel = dtId.
wheel();
428 int sector = dtId.sector();
430 if (chamberMatch->segmentMatches.empty()) {
437 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
438 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
440 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
441 Fill(
hDTChamberDx[station-1][wheel+2][sector-1], chamberMatch->x-segmentMatch->x);
442 if (station < 4)
Fill(
hDTChamberDy[station-1][wheel+2][sector-1], chamberMatch->y-segmentMatch->y);
452 CSCDetId cscId(chamberMatch->id.rawId());
453 int endcap = cscId.endcap();
454 int ring = cscId.ring();
455 int chamber = cscId.chamber();
457 if (chamberMatch->segmentMatches.empty()) {
464 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
465 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
467 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
468 Fill(
hCSCChamberDx[endcap-1][station-1][ring-1][chamber-1], chamberMatch->x-segmentMatch->x);
469 Fill(
hCSCChamberDy[endcap-1][station-1][ring-1][chamber-1], chamberMatch->y-segmentMatch->y);
485 LocalPoint segmentLocalPosition = segment->localPosition();
486 LocalVector segmentLocalDirection = segment->localDirection();
487 LocalError segmentLocalPositionError = segment->localPositionError();
488 LocalError segmentLocalDirectionError = segment->localDirectionError();
489 const GeomDet* segmentGeomDet =
geometry_->idToDet(segment->geographicalId());
491 bool segmentFound =
false;
492 bool segmentBestDrFound =
false;
497 if (!
muon->isMatchesValid())
500 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
501 chamberMatch !=
muon->matches().end(); ++chamberMatch) {
502 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
503 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
505 if (fabs(segmentMatch->x - segmentLocalPosition.
x() ) < 1E-6 &&
506 fabs(segmentMatch->y - segmentLocalPosition.
y() ) < 1E-6 &&
507 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x()/segmentLocalDirection.
z()) < 1E-6 &&
508 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y()/segmentLocalDirection.
z()) < 1E-6 &&
509 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx()) ) < 1E-6 &&
510 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy()) ) < 1E-6 &&
511 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx()) ) < 1E-6 &&
512 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy()) ) < 1E-6)
519 if (segmentFound)
break;
521 if (segmentFound)
break;
528 if (segmentBestDrFound) {
543 LocalPoint segmentLocalPosition = segment->localPosition();
544 LocalVector segmentLocalDirection = segment->localDirection();
545 LocalError segmentLocalPositionError = segment->localPositionError();
546 LocalError segmentLocalDirectionError = segment->localDirectionError();
547 const GeomDet* segmentGeomDet =
geometry_->idToDet(segment->geographicalId());
549 bool segmentFound =
false;
550 bool segmentBestDrFound =
false;
555 if (!
muon->isMatchesValid())
558 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
559 chamberMatch !=
muon->matches().end(); ++chamberMatch) {
560 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
561 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
563 if (fabs(segmentMatch->x - segmentLocalPosition.
x() ) < 1E-6 &&
564 fabs(segmentMatch->y - segmentLocalPosition.
y() ) < 1E-6 &&
565 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x()/segmentLocalDirection.
z()) < 1E-6 &&
566 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y()/segmentLocalDirection.
z()) < 1E-6 &&
567 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx()) ) < 1E-6 &&
568 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy()) ) < 1E-6 &&
569 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx()) ) < 1E-6 &&
570 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy()) ) < 1E-6)
577 if (segmentFound)
break;
579 if (segmentFound)
break;
586 if (segmentBestDrFound) {
603 if (fabs(f) > 900000)
return;
T getParameter(std::string const &) const
MonitorElement * hDTChamberEdgeXWithSegment[4][5][14]
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * hDTDistWithNoSegment[4][4]
MonitorElement * hMuonTimeExtraDTTimeAtIpInOut[4]
MonitorElement * hDTDistWithSegment[4][4]
MonitorElement * hCSCChamberEdgeXWithNoSegment[2][4][4][36]
MonitorElement * hDTPulldYdZPropErr[4][3]
MonitorElement * hDTChamberEdgeXWithNoSegment[4][5][14]
MonitorElement * hSegmentCompat[4]
MonitorElement * hMuonTimeTimeAtIpInOut[4]
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * hMuonTimeTimeAtIpOutIn[4]
edm::Handle< reco::MuonTimeExtraMap > cscMuonTimeExtraValueMapH_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * hSegmentIsAssociatedXY
MonitorElement * hTMLastStationOptimizedLowPtLooseBool[4]
MonitorElement * hTMLastStationLooseBool[4]
#define DEFINE_FWK_MODULE(type)
MonitorElement * hEnergyHAEndcap[4]
MonitorElement * hDTPullDistWithNoSegment[4][4]
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
MonitorElement * hCSCChamberEdgeYWithNoSegment[2][4][4][36]
MonitorElement * hSegmentIsBestDrNotAssociatedRZ
MonitorElement * hMuonTimeExtraCombinedTimeAtIpInOutErr[4]
MonitorElement * hMuonTimeTimeAtIpInOutErr[4]
MonitorElement * hB2BCosmicCompat[4]
virtual void Fill(MonitorElement *, float)
edm::Handle< DTRecSegment4DCollection > dtSegmentCollectionH_
MonitorElement * hCSCChamberDy[2][4][4][36]
edm::InputTag inputMuonTimeExtraValueMap_
MonitorElement * hEnergyEMEndcap[4]
MonitorElement * hTMLastStationOptimizedBarrelLowPtLooseBool[4]
MonitorElement * hCSCPullxPropErr[4][4]
MonitorElement * hMuonTimeExtraDTNDOF[4]
MonitorElement * hMuonTimeExtraCSCTimeAtIpOutIn[4]
MonitorElement * hCSCPulldXdZPropErr[4][4]
MonitorElement * hEnergyHABarrel[4]
MonitorElement * hCSCPulldYdZPropErr[4][4]
MonitorElement * hMuonTimeExtraCSCTimeAtIpOutInErr[4]
MonitorElement * hTMLastStationAngLooseBool[4]
MonitorElement * hMuonTimeExtraDTTimeAtIpOutInErr[4]
MonitorElement * hMuonTimeNDOF[4]
MonitorElement * hMuonTimeExtraCSCTimeAtIpInOut[4]
MonitorElement * hTMOneStationAngTightBool[4]
static const unsigned int BestInStationByDR
MonitorElement * hMuonTimeExtraCombinedNDOF[4]
MonitorElement * hMuonTimeTimeAtIpOutInErr[4]
MonitorElement * hGMStaChiCompatibilityBool[4]
MonitorElement * hDTChamberDx[4][5][14]
MonitorElement * hGMTkChiCompatibilityBool[4]
float backToBackCompatibility
cosmic-likeness based on presence of a track in opp side: 0 == no matching opp tracks ...
C::const_iterator const_iterator
constant access iterator type
edm::ESHandle< GlobalTrackingGeometry > geometry_
MonitorElement * hSegmentIsBestDrNotAssociatedXY
MonitorElement * hTMLastStationTightBool[4]
edm::Handle< CSCSegmentCollection > cscSegmentCollectionH_
edm::InputTag inputMuonCosmicCompatibilityValueMap_
MonitorElement * hTMLastStationOptimizedBarrelLowPtTightBool[4]
MonitorElement * hDTPulldXdZPropErr[4][4]
MonitorElement * hCombinedCosmicCompat[4]
edm::Handle< reco::MuonCollection > muonCollectionH_
edm::Handle< reco::MuonTimeExtraMap > combinedMuonTimeExtraValueMapH_
MonitorElement * hOverlapCosmicCompat[4]
MonitorElement * hCSCDistWithNoSegment[4][4]
MonitorElement * hSegmentIsBestDrAssociatedXY
MonitorElement * hCSCChamberEdgeYWithSegment[2][4][4][36]
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
MonitorElement * hCSCChamberDx[2][4][4][36]
MonitorElement * hTMLastStationAngTightBool[4]
MonitorElement * hMuonQualityStaRelChi2[4]
MonitorElement * hMuonQualityTrkKink[4]
MonitorElement * hSegmentIsNotAssociatedXY
MonitorElement * hTM2DCompatibilityLooseBool[4]
MonitorElement * hMuonTimeExtraCSCTimeAtIpInOutErr[4]
MonitorElement * hCaloSegmentCompat[4]
MonitorElement * hGMTkKinkTightBool[4]
MonitorElement * hMuonTimeExtraCombinedTimeAtIpInOut[4]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool makeAllChamberPlots_
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
edm::Handle< edm::ValueMap< reco::MuonCosmicCompatibility > > muonCosmicCompatibilityValueMapH_
float timeCompatibility
cosmic-likeness based on time: 0 == prompt-like
MonitorElement * hGlobalMuonPromptTightBool[4]
MonitorElement * hDTChamberEdgeYWithSegment[4][5][14]
MonitorElement * hMuonTimeExtraCombinedTimeAtIpOutIn[4]
MonitorElement * hSegmentIsAssociatedRZ
MonitorElement * hDTPullDistWithSegment[4][4]
MonitorElement * hCSCPullDistWithSegment[4][4]
bool makeCosmicCompatibilityPlots_
edm::InputTag inputDTRecSegment4DCollection_
MonitorElement * hCSCDistWithSegment[4][4]
MuonIdVal(const edm::ParameterSet &)
MonitorElement * hTMOneStationTightBool[4]
MonitorElement * hTM2DCompatibilityTightBool[4]
edm::Handle< reco::MuonTimeExtraMap > dtMuonTimeExtraValueMapH_
MonitorElement * hMuonTimeExtraDTTimeAtIpOutIn[4]
MonitorElement * hSegmentIsNotAssociatedRZ
MonitorElement * hSegmentIsBestDrAssociatedRZ
MonitorElement * hTMOneStationLooseBool[4]
MonitorElement * hCSCChamberEdgeXWithSegment[2][4][4][36]
MonitorElement * hDTChamberDy[3][5][14]
MonitorElement * hTMOneStationAngLooseBool[4]
edm::InputTag inputCSCSegmentCollection_
MonitorElement * hDTPullyPropErr[4][3]
MonitorElement * hMuonQualityTrkRelChi2[4]
MonitorElement * hCSCPullyPropErr[4][4]
MonitorElement * hEnergyEMBarrel[4]
MonitorElement * hMuonTimeExtraCombinedTimeAtIpOutInErr[4]
bool useGlobalMuonsNotTrackerMuons_
edm::InputTag inputMuonCollection_
MonitorElement * hTMLastStationOptimizedLowPtTightBool[4]
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * hCaloCompat[4]
bool useTrackerMuonsNotGlobalMuons_
MonitorElement * hMuonTimeExtraDTTimeAtIpInOutErr[4]
int wheel() const
Return the wheel number.
MonitorElement * hDTPullxPropErr[4][4]
float cosmicCompatibility
combined cosmic-likeness: 0 == not cosmic-like
float overlapCompatibility
cosmic-likeness based on overlap with traversing cosmic muon (only muon/STA hits are used) ...
MonitorElement * hDTChamberEdgeYWithNoSegment[4][5][14]
MonitorElement * hTimeCosmicCompat[4]
void setCurrentFolder(const std::string &fullpath)
MonitorElement * hCSCPullDistWithNoSegment[4][4]
MonitorElement * hMuonTimeExtraCSCNDOF[4]
MonitorElement * hEnergyHO[4]