45 for (
unsigned int i = 0;
i < 4;
i++) {
84 hCaloCompat[
i] = ibooker.
book1D(
"hCaloCompat",
"Calo Compatibility", 101, -0.05, 1.05);
87 hCaloSegmentCompat[
i] = ibooker.
book2D(
"hCaloSegmentCompat",
"Calo Compatibility vs. Segment Compatibility", 101, -0.05, 1.05, 101, -0.05, 1.05);
122 sprintf(name,
"hMuonShowerSizeT%i",
station+1);
123 sprintf(title,
"Station %i Transverse Cluster Size",
station+1);
125 sprintf(name,
"hMuonShowerDeltaR%i",
station+1);
126 sprintf(title,
"Station %i DeltaR",
station+1);
128 sprintf(name,
"hMuonAllHits%i",
station+1);
129 sprintf(title,
"Station %i Number of 1D DT or 2D CSC RecHits",
station+1);
131 sprintf(name,
"hMuonHitsFromSegments%i",
station+1);
132 sprintf(title,
"Station %i Hits used by 4D DT or 3D CSC Segments",
station+1);
134 sprintf(name,
"hMuonUncorrelatedHits%i",
station+1);
135 sprintf(title,
"Station %i Uncorrelated Hits",
station+1);
139 sprintf(name,
"hDT%iPullxPropErr",
station+1);
140 sprintf(title,
"DT Station %i Pull X w/ Propagation Error Only",
station+1);
143 sprintf(name,
"hDT%iPulldXdZPropErr",
station+1);
144 sprintf(title,
"DT Station %i Pull DxDz w/ Propagation Error Only",
station+1);
148 sprintf(name,
"hDT%iPullyPropErr",
station+1);
149 sprintf(title,
"DT Station %i Pull Y w/ Propagation Error Only",
station+1);
152 sprintf(name,
"hDT%iPulldYdZPropErr",
station+1);
153 sprintf(title,
"DT Station %i Pull DyDz w/ Propagation Error Only",
station+1);
157 sprintf(name,
"hDT%iDistWithSegment",
station+1);
158 sprintf(title,
"DT Station %i Dist When There Is A Segment",
station+1);
161 sprintf(name,
"hDT%iDistWithNoSegment",
station+1);
162 sprintf(title,
"DT Station %i Dist When There Is No Segment",
station+1);
165 sprintf(name,
"hDT%iPullDistWithSegment",
station+1);
166 sprintf(title,
"DT Station %i Pull Dist When There Is A Segment",
station+1);
169 sprintf(name,
"hDT%iPullDistWithNoSegment",
station+1);
170 sprintf(title,
"DT Station %i Pull Dist When There Is No Segment",
station+1);
173 sprintf(name,
"hCSC%iPullxPropErr",
station+1);
174 sprintf(title,
"CSC Station %i Pull X w/ Propagation Error Only",
station+1);
177 sprintf(name,
"hCSC%iPulldXdZPropErr",
station+1);
178 sprintf(title,
"CSC Station %i Pull DxDz w/ Propagation Error Only",
station+1);
181 sprintf(name,
"hCSC%iPullyPropErr",
station+1);
182 sprintf(title,
"CSC Station %i Pull Y w/ Propagation Error Only",
station+1);
185 sprintf(name,
"hCSC%iPulldYdZPropErr",
station+1);
186 sprintf(title,
"CSC Station %i Pull DyDz w/ Propagation Error Only",
station+1);
189 sprintf(name,
"hCSC%iDistWithSegment",
station+1);
190 sprintf(title,
"CSC Station %i Dist When There Is A Segment",
station+1);
193 sprintf(name,
"hCSC%iDistWithNoSegment",
station+1);
194 sprintf(title,
"CSC Station %i Dist When There Is No Segment",
station+1);
197 sprintf(name,
"hCSC%iPullDistWithSegment",
station+1);
198 sprintf(title,
"CSC Station %i Pull Dist When There Is A Segment",
station+1);
201 sprintf(name,
"hCSC%iPullDistWithNoSegment",
station+1);
202 sprintf(title,
"CSC Station %i Pull Dist When There Is No Segment",
station+1);
213 hSegmentIsBestDrAssociatedRZ = ibooker.
book2D(
"hSegmentIsBestDrAssociatedRZ",
"R-Z of Best in Station by #DeltaR Associated Segments", 2140, -1070., 1070., 850, 0., 850.);
214 hSegmentIsBestDrAssociatedXY = ibooker.
book2D(
"hSegmentIsBestDrAssociatedXY",
"X-Y of Best in Station by #DeltaR Associated Segments", 1700, -850., 850., 1700, -850., 850.);
215 hSegmentIsBestDrNotAssociatedRZ = ibooker.
book2D(
"hSegmentIsBestDrNotAssociatedRZ",
"R-Z of Best in Station by #DeltaR Not Associated Segments", 2140, -1070., 1070., 850, 0., 850.);
216 hSegmentIsBestDrNotAssociatedXY = ibooker.
book2D(
"hSegmentIsBestDrNotAssociatedXY",
"X-Y of Best in Station by #DeltaR Not Associated Segments", 1700, -850., 850., 1700, -850., 850.);
227 for(
int sector = 0; sector < 14; ++sector)
229 sprintf(name,
"hDTChamberDx_%i_%i_%i",
station+1,
wheel-2, sector+1);
230 sprintf(title,
"DT Chamber Delta X: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
234 sprintf(name,
"hDTChamberDy_%i_%i_%i",
station+1,
wheel-2, sector+1);
235 sprintf(title,
"DT Chamber Delta Y: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
239 sprintf(name,
"hDTChamberEdgeXWithSegment_%i_%i_%i",
station+1,
wheel-2, sector+1);
240 sprintf(title,
"DT Chamber Edge X When There Is A Segment: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
243 sprintf(name,
"hDTChamberEdgeXWithNoSegment_%i_%i_%i",
station+1,
wheel-2, sector+1);
244 sprintf(title,
"DT Chamber Edge X When There Is No Segment: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
247 sprintf(name,
"hDTChamberEdgeYWithSegment_%i_%i_%i",
station+1,
wheel-2, sector+1);
248 sprintf(title,
"DT Chamber Edge Y When There Is A Segment: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
251 sprintf(name,
"hDTChamberEdgeYWithNoSegment_%i_%i_%i",
station+1,
wheel-2, sector+1);
252 sprintf(title,
"DT Chamber Edge Y When There Is No Segment: Station %i Wheel %i Sector %i",
station+1,
wheel-2, sector+1);
265 sprintf(title,
"CSC Chamber Delta X: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1,
chamber+1);
269 sprintf(title,
"CSC Chamber Delta Y: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1,
chamber+1);
273 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);
277 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);
281 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);
285 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);
298 using namespace reco;
311 unsigned int muonIdx = 0;
316 for (
unsigned int i = 0;
i < 4;
i++) {
324 if (fabs(
muon->eta()) > 1.479)
329 if (fabs(
muon->eta()) > 1.4)
334 if (fabs(
muon->eta()) < 1.26)
339 if (
muon->isTimeValid()) {
348 MuonTimeExtra combinedMuonTimeExtra = (*combinedMuonTimeExtraValueMapH_)[muonRef];
349 MuonTimeExtra cscMuonTimeExtra = (*cscMuonTimeExtraValueMapH_)[muonRef];
350 MuonTimeExtra dtMuonTimeExtra = (*dtMuonTimeExtraValueMapH_)[muonRef];
369 if (
muon->isCaloCompatibilityValid())
374 if (
muon->isQualityValid()) {
433 if (error == 0) error = 0.000001;
450 if (error == 0) error = 0.000001;
465 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
466 chamberMatch !=
muon->matches().end(); ++chamberMatch)
468 int station = chamberMatch->station();
472 int wheel = dtId.wheel();
473 int sector = dtId.sector();
475 if (chamberMatch->segmentMatches.empty()) {
482 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
483 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
485 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
486 Fill(
hDTChamberDx[station-1][wheel+2][sector-1], chamberMatch->x-segmentMatch->x);
487 if (station < 4)
Fill(
hDTChamberDy[station-1][wheel+2][sector-1], chamberMatch->y-segmentMatch->y);
497 CSCDetId cscId(chamberMatch->id.rawId());
498 int endcap = cscId.endcap();
499 int ring = cscId.ring();
502 if (chamberMatch->segmentMatches.empty()) {
509 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
510 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
512 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
513 Fill(
hCSCChamberDx[endcap-1][station-1][ring-1][chamber-1], chamberMatch->x-segmentMatch->x);
514 Fill(
hCSCChamberDy[endcap-1][station-1][ring-1][chamber-1], chamberMatch->y-segmentMatch->y);
530 LocalPoint segmentLocalPosition = segment->localPosition();
531 LocalVector segmentLocalDirection = segment->localDirection();
532 LocalError segmentLocalPositionError = segment->localPositionError();
533 LocalError segmentLocalDirectionError = segment->localDirectionError();
536 bool segmentFound =
false;
537 bool segmentBestDrFound =
false;
542 if (!
muon->isMatchesValid())
545 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
546 chamberMatch !=
muon->matches().end(); ++chamberMatch) {
547 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
548 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
550 if (fabs(segmentMatch->x - segmentLocalPosition.
x() ) < 1E-6 &&
551 fabs(segmentMatch->y - segmentLocalPosition.
y() ) < 1E-6 &&
552 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x()/segmentLocalDirection.
z()) < 1E-6 &&
553 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y()/segmentLocalDirection.
z()) < 1E-6 &&
554 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx()) ) < 1E-6 &&
555 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy()) ) < 1E-6 &&
556 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx()) ) < 1E-6 &&
557 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy()) ) < 1E-6)
564 if (segmentFound)
break;
566 if (segmentFound)
break;
573 if (segmentBestDrFound) {
588 LocalPoint segmentLocalPosition = segment->localPosition();
589 LocalVector segmentLocalDirection = segment->localDirection();
590 LocalError segmentLocalPositionError = segment->localPositionError();
591 LocalError segmentLocalDirectionError = segment->localDirectionError();
594 bool segmentFound =
false;
595 bool segmentBestDrFound =
false;
600 if (!
muon->isMatchesValid())
603 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
604 chamberMatch !=
muon->matches().end(); ++chamberMatch) {
605 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
606 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
608 if (fabs(segmentMatch->x - segmentLocalPosition.
x() ) < 1E-6 &&
609 fabs(segmentMatch->y - segmentLocalPosition.
y() ) < 1E-6 &&
610 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x()/segmentLocalDirection.
z()) < 1E-6 &&
611 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y()/segmentLocalDirection.
z()) < 1E-6 &&
612 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx()) ) < 1E-6 &&
613 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy()) ) < 1E-6 &&
614 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx()) ) < 1E-6 &&
615 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy()) ) < 1E-6)
622 if (segmentFound)
break;
624 if (segmentFound)
break;
631 if (segmentBestDrFound) {
645 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_
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_
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]
const GeomDet * idToDet(DetId) const override
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