53 for (
unsigned int i = 0;
i < 4;
i++) {
95 hCaloSegmentCompat[
i] =
dbe_->
book2D(
"hCaloSegmentCompat",
"Calo Compatibility vs. Segment Compatibility", 101, -0.05, 1.05, 101, -0.05, 1.05);
130 sprintf(name,
"hMuonShowerSizeT%i",
station+1);
131 sprintf(title,
"Station %i Transverse Cluster Size",
station+1);
133 sprintf(name,
"hMuonShowerDeltaR%i",
station+1);
134 sprintf(title,
"Station %i DeltaR",
station+1);
136 sprintf(name,
"hMuonAllHits%i",
station+1);
137 sprintf(title,
"Station %i Number of 1D DT or 2D CSC RecHits",
station+1);
139 sprintf(name,
"hMuonHitsFromSegments%i",
station+1);
140 sprintf(title,
"Station %i Hits used by 4D DT or 3D CSC Segments",
station+1);
142 sprintf(name,
"hMuonUncorrelatedHits%i",
station+1);
143 sprintf(title,
"Station %i Uncorrelated Hits",
station+1);
147 sprintf(name,
"hDT%iPullxPropErr",
station+1);
148 sprintf(title,
"DT Station %i Pull X w/ Propagation Error Only",
station+1);
151 sprintf(name,
"hDT%iPulldXdZPropErr",
station+1);
152 sprintf(title,
"DT Station %i Pull DxDz w/ Propagation Error Only",
station+1);
156 sprintf(name,
"hDT%iPullyPropErr",
station+1);
157 sprintf(title,
"DT Station %i Pull Y w/ Propagation Error Only",
station+1);
160 sprintf(name,
"hDT%iPulldYdZPropErr",
station+1);
161 sprintf(title,
"DT Station %i Pull DyDz w/ Propagation Error Only",
station+1);
165 sprintf(name,
"hDT%iDistWithSegment",
station+1);
166 sprintf(title,
"DT Station %i Dist When There Is A Segment",
station+1);
169 sprintf(name,
"hDT%iDistWithNoSegment",
station+1);
170 sprintf(title,
"DT Station %i Dist When There Is No Segment",
station+1);
173 sprintf(name,
"hDT%iPullDistWithSegment",
station+1);
174 sprintf(title,
"DT Station %i Pull Dist When There Is A Segment",
station+1);
177 sprintf(name,
"hDT%iPullDistWithNoSegment",
station+1);
178 sprintf(title,
"DT Station %i Pull Dist When There Is No Segment",
station+1);
181 sprintf(name,
"hCSC%iPullxPropErr",
station+1);
182 sprintf(title,
"CSC Station %i Pull X w/ Propagation Error Only",
station+1);
185 sprintf(name,
"hCSC%iPulldXdZPropErr",
station+1);
186 sprintf(title,
"CSC Station %i Pull DxDz w/ Propagation Error Only",
station+1);
189 sprintf(name,
"hCSC%iPullyPropErr",
station+1);
190 sprintf(title,
"CSC Station %i Pull Y w/ Propagation Error Only",
station+1);
193 sprintf(name,
"hCSC%iPulldYdZPropErr",
station+1);
194 sprintf(title,
"CSC Station %i Pull DyDz w/ Propagation Error Only",
station+1);
197 sprintf(name,
"hCSC%iDistWithSegment",
station+1);
198 sprintf(title,
"CSC Station %i Dist When There Is A Segment",
station+1);
201 sprintf(name,
"hCSC%iDistWithNoSegment",
station+1);
202 sprintf(title,
"CSC Station %i Dist When There Is No Segment",
station+1);
205 sprintf(name,
"hCSC%iPullDistWithSegment",
station+1);
206 sprintf(title,
"CSC Station %i Pull Dist When There Is A Segment",
station+1);
209 sprintf(name,
"hCSC%iPullDistWithNoSegment",
station+1);
210 sprintf(title,
"CSC Station %i Pull Dist When There Is No Segment",
station+1);
233 for(
int wheel = 0; wheel < 5; ++wheel) {
235 for(
int sector = 0; sector < 14; ++sector)
237 sprintf(name,
"hDTChamberDx_%i_%i_%i",
station+1, wheel-2, sector+1);
238 sprintf(title,
"DT Chamber Delta X: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
242 sprintf(name,
"hDTChamberDy_%i_%i_%i",
station+1, wheel-2, sector+1);
243 sprintf(title,
"DT Chamber Delta Y: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
247 sprintf(name,
"hDTChamberEdgeXWithSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
248 sprintf(title,
"DT Chamber Edge X When There Is A Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
251 sprintf(name,
"hDTChamberEdgeXWithNoSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
252 sprintf(title,
"DT Chamber Edge X When There Is No Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
255 sprintf(name,
"hDTChamberEdgeYWithSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
256 sprintf(title,
"DT Chamber Edge Y When There Is A Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
259 sprintf(name,
"hDTChamberEdgeYWithNoSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
260 sprintf(title,
"DT Chamber Edge Y When There Is No Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
270 for(
int chamber = 0; chamber < 36; ++chamber)
272 sprintf(name,
"hCSCChamberDx_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
273 sprintf(title,
"CSC Chamber Delta X: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1, chamber+1);
276 sprintf(name,
"hCSCChamberDy_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
277 sprintf(title,
"CSC Chamber Delta Y: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1, chamber+1);
280 sprintf(name,
"hCSCChamberEdgeXWithSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
281 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);
284 sprintf(name,
"hCSCChamberEdgeXWithNoSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
285 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);
288 sprintf(name,
"hCSCChamberEdgeYWithSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
289 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);
292 sprintf(name,
"hCSCChamberEdgeYWithNoSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
293 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);
306 using namespace reco;
319 unsigned int muonIdx = 0;
324 for (
unsigned int i = 0;
i < 4;
i++) {
332 if (fabs(
muon->eta()) > 1.479)
337 if (fabs(
muon->eta()) > 1.4)
342 if (fabs(
muon->eta()) < 1.26)
347 if (
muon->isTimeValid()) {
356 MuonTimeExtra combinedMuonTimeExtra = (*combinedMuonTimeExtraValueMapH_)[muonRef];
357 MuonTimeExtra cscMuonTimeExtra = (*cscMuonTimeExtraValueMapH_)[muonRef];
358 MuonTimeExtra dtMuonTimeExtra = (*dtMuonTimeExtraValueMapH_)[muonRef];
377 if (
muon->isCaloCompatibilityValid())
382 if (
muon->isQualityValid()) {
441 if (error == 0) error = 0.000001;
458 if (error == 0) error = 0.000001;
473 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
474 chamberMatch !=
muon->matches().end(); ++chamberMatch)
476 int station = chamberMatch->station();
480 int wheel = dtId.
wheel();
481 int sector = dtId.sector();
483 if (chamberMatch->segmentMatches.empty()) {
490 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
491 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
493 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
494 Fill(
hDTChamberDx[station-1][wheel+2][sector-1], chamberMatch->x-segmentMatch->x);
495 if (station < 4)
Fill(
hDTChamberDy[station-1][wheel+2][sector-1], chamberMatch->y-segmentMatch->y);
505 CSCDetId cscId(chamberMatch->id.rawId());
506 int endcap = cscId.endcap();
507 int ring = cscId.ring();
508 int chamber = cscId.chamber();
510 if (chamberMatch->segmentMatches.empty()) {
517 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
518 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
520 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
521 Fill(
hCSCChamberDx[endcap-1][station-1][ring-1][chamber-1], chamberMatch->x-segmentMatch->x);
522 Fill(
hCSCChamberDy[endcap-1][station-1][ring-1][chamber-1], chamberMatch->y-segmentMatch->y);
538 LocalPoint segmentLocalPosition = segment->localPosition();
539 LocalVector segmentLocalDirection = segment->localDirection();
540 LocalError segmentLocalPositionError = segment->localPositionError();
541 LocalError segmentLocalDirectionError = segment->localDirectionError();
542 const GeomDet* segmentGeomDet =
geometry_->idToDet(segment->geographicalId());
544 bool segmentFound =
false;
545 bool segmentBestDrFound =
false;
550 if (!
muon->isMatchesValid())
553 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
554 chamberMatch !=
muon->matches().end(); ++chamberMatch) {
555 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
556 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
558 if (fabs(segmentMatch->x - segmentLocalPosition.
x() ) < 1E-6 &&
559 fabs(segmentMatch->y - segmentLocalPosition.
y() ) < 1E-6 &&
560 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x()/segmentLocalDirection.
z()) < 1E-6 &&
561 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y()/segmentLocalDirection.
z()) < 1E-6 &&
562 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx()) ) < 1E-6 &&
563 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy()) ) < 1E-6 &&
564 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx()) ) < 1E-6 &&
565 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy()) ) < 1E-6)
572 if (segmentFound)
break;
574 if (segmentFound)
break;
581 if (segmentBestDrFound) {
596 LocalPoint segmentLocalPosition = segment->localPosition();
597 LocalVector segmentLocalDirection = segment->localDirection();
598 LocalError segmentLocalPositionError = segment->localPositionError();
599 LocalError segmentLocalDirectionError = segment->localDirectionError();
600 const GeomDet* segmentGeomDet =
geometry_->idToDet(segment->geographicalId());
602 bool segmentFound =
false;
603 bool segmentBestDrFound =
false;
608 if (!
muon->isMatchesValid())
611 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
612 chamberMatch !=
muon->matches().end(); ++chamberMatch) {
613 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
614 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
616 if (fabs(segmentMatch->x - segmentLocalPosition.
x() ) < 1E-6 &&
617 fabs(segmentMatch->y - segmentLocalPosition.
y() ) < 1E-6 &&
618 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x()/segmentLocalDirection.
z()) < 1E-6 &&
619 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y()/segmentLocalDirection.
z()) < 1E-6 &&
620 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx()) ) < 1E-6 &&
621 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy()) ) < 1E-6 &&
622 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx()) ) < 1E-6 &&
623 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy()) ) < 1E-6)
630 if (segmentFound)
break;
632 if (segmentFound)
break;
639 if (segmentBestDrFound) {
656 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]
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.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * hSegmentIsAssociatedXY
edm::EDGetTokenT< reco::MuonCollection > inputMuonCollectionToken_
MonitorElement * hTMLastStationOptimizedLowPtLooseBool[4]
MonitorElement * hTMLastStationLooseBool[4]
#define DEFINE_FWK_MODULE(type)
MonitorElement * hMuonUncorrelatedHits[4][4]
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]
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 * 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
MonitorElement * hDTPullDistWithSegment[4][4]
edm::EDGetTokenT< reco::MuonTimeExtraMap > inputMuonTimeExtraValueMapCombToken_
MonitorElement * hCSCPullDistWithSegment[4][4]
bool makeCosmicCompatibilityPlots_
edm::InputTag inputDTRecSegment4DCollection_
MonitorElement * hMuonHitsFromSegments[4][4]
MonitorElement * hCSCDistWithSegment[4][4]
MuonIdVal(const edm::ParameterSet &)
MonitorElement * hTMOneStationTightBool[4]
MonitorElement * hTM2DCompatibilityTightBool[4]
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
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 * 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
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]
void setCurrentFolder(const std::string &fullpath)
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