48 for (
unsigned int i = 0;
i < 4;
i++) {
87 hCaloCompat[
i] = ibooker.
book1D(
"hCaloCompat",
"Calo Compatibility", 101, -0.05, 1.05);
90 hCaloSegmentCompat[
i] = ibooker.
book2D(
"hCaloSegmentCompat",
"Calo Compatibility vs. Segment Compatibility", 101, -0.05, 1.05, 101, -0.05, 1.05);
125 sprintf(name,
"hMuonShowerSizeT%i",
station+1);
126 sprintf(title,
"Station %i Transverse Cluster Size",
station+1);
128 sprintf(name,
"hMuonShowerDeltaR%i",
station+1);
129 sprintf(title,
"Station %i DeltaR",
station+1);
131 sprintf(name,
"hMuonAllHits%i",
station+1);
132 sprintf(title,
"Station %i Number of 1D DT or 2D CSC RecHits",
station+1);
134 sprintf(name,
"hMuonHitsFromSegments%i",
station+1);
135 sprintf(title,
"Station %i Hits used by 4D DT or 3D CSC Segments",
station+1);
137 sprintf(name,
"hMuonUncorrelatedHits%i",
station+1);
138 sprintf(title,
"Station %i Uncorrelated Hits",
station+1);
142 sprintf(name,
"hDT%iPullxPropErr",
station+1);
143 sprintf(title,
"DT Station %i Pull X w/ Propagation Error Only",
station+1);
146 sprintf(name,
"hDT%iPulldXdZPropErr",
station+1);
147 sprintf(title,
"DT Station %i Pull DxDz w/ Propagation Error Only",
station+1);
151 sprintf(name,
"hDT%iPullyPropErr",
station+1);
152 sprintf(title,
"DT Station %i Pull Y w/ Propagation Error Only",
station+1);
155 sprintf(name,
"hDT%iPulldYdZPropErr",
station+1);
156 sprintf(title,
"DT Station %i Pull DyDz w/ Propagation Error Only",
station+1);
160 sprintf(name,
"hDT%iDistWithSegment",
station+1);
161 sprintf(title,
"DT Station %i Dist When There Is A Segment",
station+1);
164 sprintf(name,
"hDT%iDistWithNoSegment",
station+1);
165 sprintf(title,
"DT Station %i Dist When There Is No Segment",
station+1);
168 sprintf(name,
"hDT%iPullDistWithSegment",
station+1);
169 sprintf(title,
"DT Station %i Pull Dist When There Is A Segment",
station+1);
172 sprintf(name,
"hDT%iPullDistWithNoSegment",
station+1);
173 sprintf(title,
"DT Station %i Pull Dist When There Is No Segment",
station+1);
176 sprintf(name,
"hCSC%iPullxPropErr",
station+1);
177 sprintf(title,
"CSC Station %i Pull X w/ Propagation Error Only",
station+1);
180 sprintf(name,
"hCSC%iPulldXdZPropErr",
station+1);
181 sprintf(title,
"CSC Station %i Pull DxDz w/ Propagation Error Only",
station+1);
184 sprintf(name,
"hCSC%iPullyPropErr",
station+1);
185 sprintf(title,
"CSC Station %i Pull Y w/ Propagation Error Only",
station+1);
188 sprintf(name,
"hCSC%iPulldYdZPropErr",
station+1);
189 sprintf(title,
"CSC Station %i Pull DyDz w/ Propagation Error Only",
station+1);
192 sprintf(name,
"hCSC%iDistWithSegment",
station+1);
193 sprintf(title,
"CSC Station %i Dist When There Is A Segment",
station+1);
196 sprintf(name,
"hCSC%iDistWithNoSegment",
station+1);
197 sprintf(title,
"CSC Station %i Dist When There Is No Segment",
station+1);
200 sprintf(name,
"hCSC%iPullDistWithSegment",
station+1);
201 sprintf(title,
"CSC Station %i Pull Dist When There Is A Segment",
station+1);
204 sprintf(name,
"hCSC%iPullDistWithNoSegment",
station+1);
205 sprintf(title,
"CSC Station %i Pull Dist When There Is No Segment",
station+1);
216 hSegmentIsBestDrAssociatedRZ = ibooker.
book2D(
"hSegmentIsBestDrAssociatedRZ",
"R-Z of Best in Station by #DeltaR Associated Segments", 2140, -1070., 1070., 850, 0., 850.);
217 hSegmentIsBestDrAssociatedXY = ibooker.
book2D(
"hSegmentIsBestDrAssociatedXY",
"X-Y of Best in Station by #DeltaR Associated Segments", 1700, -850., 850., 1700, -850., 850.);
218 hSegmentIsBestDrNotAssociatedRZ = ibooker.
book2D(
"hSegmentIsBestDrNotAssociatedRZ",
"R-Z of Best in Station by #DeltaR Not Associated Segments", 2140, -1070., 1070., 850, 0., 850.);
219 hSegmentIsBestDrNotAssociatedXY = ibooker.
book2D(
"hSegmentIsBestDrNotAssociatedXY",
"X-Y of Best in Station by #DeltaR Not Associated Segments", 1700, -850., 850., 1700, -850., 850.);
230 for(
int sector = 0; sector < 14; ++sector)
232 sprintf(name,
"hDTChamberDx_%i_%i_%i",
station+1,
wheel-2, sector+1);
233 sprintf(title,
"DT Chamber Delta X: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
237 sprintf(name,
"hDTChamberDy_%i_%i_%i",
station+1,
wheel-2, sector+1);
238 sprintf(title,
"DT Chamber Delta Y: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
242 sprintf(name,
"hDTChamberEdgeXWithSegment_%i_%i_%i",
station+1,
wheel-2, sector+1);
243 sprintf(title,
"DT Chamber Edge X When There Is A Segment: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
246 sprintf(name,
"hDTChamberEdgeXWithNoSegment_%i_%i_%i",
station+1,
wheel-2, sector+1);
247 sprintf(title,
"DT Chamber Edge X When There Is No Segment: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
250 sprintf(name,
"hDTChamberEdgeYWithSegment_%i_%i_%i",
station+1,
wheel-2, sector+1);
251 sprintf(title,
"DT Chamber Edge Y When There Is A Segment: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
254 sprintf(name,
"hDTChamberEdgeYWithNoSegment_%i_%i_%i",
station+1,
wheel-2, sector+1);
255 sprintf(title,
"DT Chamber Edge Y When There Is No Segment: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
268 sprintf(title,
"CSC Chamber Delta X: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1,
chamber+1);
272 sprintf(title,
"CSC Chamber Delta Y: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1,
chamber+1);
276 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);
280 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);
284 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);
288 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);
301 using namespace reco;
314 unsigned int muonIdx = 0;
319 for (
unsigned int i = 0;
i < 4;
i++) {
327 if (fabs(
muon->eta()) > 1.479)
332 if (fabs(
muon->eta()) > 1.4)
337 if (fabs(
muon->eta()) < 1.26)
342 if (
muon->isTimeValid()) {
351 MuonTimeExtra combinedMuonTimeExtra = (*combinedMuonTimeExtraValueMapH_)[muonRef];
352 MuonTimeExtra cscMuonTimeExtra = (*cscMuonTimeExtraValueMapH_)[muonRef];
353 MuonTimeExtra dtMuonTimeExtra = (*dtMuonTimeExtraValueMapH_)[muonRef];
372 if (
muon->isCaloCompatibilityValid())
377 if (
muon->isQualityValid()) {
436 if (error == 0) error = 0.000001;
453 if (error == 0) error = 0.000001;
468 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
469 chamberMatch !=
muon->matches().end(); ++chamberMatch)
471 int station = chamberMatch->station();
475 int wheel = dtId.wheel();
476 int sector = dtId.sector();
478 if (chamberMatch->segmentMatches.empty()) {
485 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
486 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
488 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
489 Fill(
hDTChamberDx[station-1][wheel+2][sector-1], chamberMatch->x-segmentMatch->x);
490 if (station < 4)
Fill(
hDTChamberDy[station-1][wheel+2][sector-1], chamberMatch->y-segmentMatch->y);
500 CSCDetId cscId(chamberMatch->id.rawId());
501 int endcap = cscId.endcap();
502 int ring = cscId.ring();
505 if (chamberMatch->segmentMatches.empty()) {
512 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
513 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
515 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
516 Fill(
hCSCChamberDx[endcap-1][station-1][ring-1][chamber-1], chamberMatch->x-segmentMatch->x);
517 Fill(
hCSCChamberDy[endcap-1][station-1][ring-1][chamber-1], chamberMatch->y-segmentMatch->y);
533 LocalPoint segmentLocalPosition = segment->localPosition();
534 LocalVector segmentLocalDirection = segment->localDirection();
535 LocalError segmentLocalPositionError = segment->localPositionError();
536 LocalError segmentLocalDirectionError = segment->localDirectionError();
539 bool segmentFound =
false;
540 bool segmentBestDrFound =
false;
545 if (!
muon->isMatchesValid())
548 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
549 chamberMatch !=
muon->matches().end(); ++chamberMatch) {
550 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
551 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
553 if (fabs(segmentMatch->x - segmentLocalPosition.
x() ) < 1E-6 &&
554 fabs(segmentMatch->y - segmentLocalPosition.
y() ) < 1E-6 &&
555 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x()/segmentLocalDirection.
z()) < 1E-6 &&
556 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y()/segmentLocalDirection.
z()) < 1E-6 &&
557 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx()) ) < 1E-6 &&
558 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy()) ) < 1E-6 &&
559 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx()) ) < 1E-6 &&
560 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy()) ) < 1E-6)
567 if (segmentFound)
break;
569 if (segmentFound)
break;
576 if (segmentBestDrFound) {
591 LocalPoint segmentLocalPosition = segment->localPosition();
592 LocalVector segmentLocalDirection = segment->localDirection();
593 LocalError segmentLocalPositionError = segment->localPositionError();
594 LocalError segmentLocalDirectionError = segment->localDirectionError();
597 bool segmentFound =
false;
598 bool segmentBestDrFound =
false;
603 if (!
muon->isMatchesValid())
606 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
607 chamberMatch !=
muon->matches().end(); ++chamberMatch) {
608 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
609 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
611 if (fabs(segmentMatch->x - segmentLocalPosition.
x() ) < 1E-6 &&
612 fabs(segmentMatch->y - segmentLocalPosition.
y() ) < 1E-6 &&
613 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x()/segmentLocalDirection.
z()) < 1E-6 &&
614 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y()/segmentLocalDirection.
z()) < 1E-6 &&
615 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx()) ) < 1E-6 &&
616 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy()) ) < 1E-6 &&
617 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx()) ) < 1E-6 &&
618 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy()) ) < 1E-6)
625 if (segmentFound)
break;
627 if (segmentFound)
break;
634 if (segmentBestDrFound) {
651 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 * hMuonAllHits[4][4]
edm::EDGetTokenT< CSCSegmentCollection > inputCSCSegmentCollectionToken_
MonitorElement * hDTDistWithNoSegment[4][4]
MonitorElement * hMuonTimeExtraDTTimeAtIpInOut[4]
MonitorElement * hDTDistWithSegment[4][4]
bool makeShowerInformationPlots_
MonitorElement * hCSCChamberEdgeXWithNoSegment[2][4][4][36]
MonitorElement * hDTPulldYdZPropErr[4][3]
MonitorElement * hDTChamberEdgeXWithNoSegment[4][5][14]
MonitorElement * hSegmentCompat[4]
MonitorElement * hMuonTimeTimeAtIpInOut[4]
MonitorElement * hMuonTimeTimeAtIpOutIn[4]
edm::Handle< reco::MuonTimeExtraMap > cscMuonTimeExtraValueMapH_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * hSegmentIsAssociatedXY
edm::EDGetTokenT< reco::MuonCollection > inputMuonCollectionToken_
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * hTMLastStationOptimizedLowPtLooseBool[4]
MonitorElement * hTMLastStationLooseBool[4]
#define DEFINE_FWK_MODULE(type)
MonitorElement * hMuonUncorrelatedHits[4][4]
MonitorElement * hEnergyHAEndcap[4]
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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]
edm::EDGetTokenT< edm::ValueMap< reco::MuonCosmicCompatibility > > inputMuonCosmicCompatibilityValueMapToken_
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]
edm::EDGetTokenT< reco::MuonTimeExtraMap > inputMuonTimeExtraValueMapDTToken_
MonitorElement * hMuonTimeExtraCSCTimeAtIpOutIn[4]
MonitorElement * hCSCPulldXdZPropErr[4][4]
MonitorElement * hEnergyHABarrel[4]
MonitorElement * hCSCPulldYdZPropErr[4][4]
std::vector< int > nStationHits
number of all the muon RecHits per chamber crossed by a track (1D hits)
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 ...
edm::ESHandle< GlobalTrackingGeometry > geometry_
virtual const GeomDet * idToDet(DetId) const
MonitorElement * hSegmentIsBestDrNotAssociatedXY
MonitorElement * hTMLastStationTightBool[4]
std::vector< int > nStationCorrelatedHits
number of the muon RecHits used by segments per chamber crossed by a track
edm::EDGetTokenT< reco::MuonTimeExtraMap > inputMuonTimeExtraValueMapCSCToken_
edm::Handle< CSCSegmentCollection > cscSegmentCollectionH_
edm::EDGetTokenT< edm::ValueMap< reco::MuonShower > > inputMuonShowerInformationValueMapToken_
edm::InputTag inputMuonCosmicCompatibilityValueMap_
MonitorElement * hTMLastStationOptimizedBarrelLowPtTightBool[4]
MonitorElement * hDTPulldXdZPropErr[4][4]
MonitorElement * hCombinedCosmicCompat[4]
edm::EDGetTokenT< DTRecSegment4DCollection > inputDTRecSegment4DCollectionToken_
edm::Handle< reco::MuonCollection > muonCollectionH_
edm::Handle< reco::MuonTimeExtraMap > combinedMuonTimeExtraValueMapH_
MonitorElement * hOverlapCosmicCompat[4]
MonitorElement * hCSCDistWithNoSegment[4][4]
MonitorElement * hSegmentIsBestDrAssociatedXY
MonitorElement * book1D(Args &&...args)
MonitorElement * hCSCChamberEdgeYWithSegment[2][4][4][36]
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
edm::Handle< edm::ValueMap< reco::MuonShower > > muonShowerInformationValueMapH_
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 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 * hMuonShowerDeltaR[4][4]
MonitorElement * hGlobalMuonPromptTightBool[4]
MonitorElement * hDTChamberEdgeYWithSegment[4][5][14]
MonitorElement * hMuonTimeExtraCombinedTimeAtIpOutIn[4]
MonitorElement * hSegmentIsAssociatedRZ
std::string subsystemname_
MonitorElement * hDTPullDistWithSegment[4][4]
edm::EDGetTokenT< reco::MuonTimeExtraMap > inputMuonTimeExtraValueMapCombToken_
MonitorElement * hCSCPullDistWithSegment[4][4]
bool makeCosmicCompatibilityPlots_
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
edm::InputTag inputDTRecSegment4DCollection_
MonitorElement * hMuonHitsFromSegments[4][4]
MonitorElement * hCSCDistWithSegment[4][4]
edm::ParameterSet iConfig
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]
std::vector< float > stationShowerSizeT
the transverse size of the hit cluster
MonitorElement * hMuonQualityTrkRelChi2[4]
MonitorElement * hCSCPullyPropErr[4][4]
MonitorElement * hEnergyEMBarrel[4]
MonitorElement * hMuonTimeExtraCombinedTimeAtIpOutInErr[4]
bool useGlobalMuonsNotTrackerMuons_
edm::InputTag inputMuonCollection_
MonitorElement * hTMLastStationOptimizedLowPtTightBool[4]
MonitorElement * hCaloCompat[4]
bool useTrackerMuonsNotGlobalMuons_
MonitorElement * hMuonTimeExtraDTTimeAtIpInOutErr[4]
MonitorElement * hDTPullxPropErr[4][4]
float cosmicCompatibility
combined cosmic-likeness: 0 == not cosmic-like
MonitorElement * hMuonShowerSizeT[4][4]
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]
MonitorElement * hCSCPullDistWithNoSegment[4][4]
MonitorElement * hMuonTimeExtraCSCNDOF[4]
MonitorElement * hEnergyHO[4]
edm::InputTag inputMuonShowerInformationValueMap_
std::vector< float > stationShowerDeltaR
the radius of the cone containing the all the hits around the track