35 for (
unsigned int i = 0;
i < 4;
i++) {
77 hCaloSegmentCompat[
i] =
dbe_->
book2D(
"hCaloSegmentCompat",
"Calo Compatibility vs. Segment Compatibility", 101, -0.05, 1.05, 101, -0.05, 1.05);
112 sprintf(name,
"hMuonShowerSizeT%i",
station+1);
113 sprintf(title,
"Station %i Transverse Cluster Size",
station+1);
115 sprintf(name,
"hMuonShowerDeltaR%i",
station+1);
116 sprintf(title,
"Station %i DeltaR",
station+1);
118 sprintf(name,
"hMuonAllHits%i",
station+1);
119 sprintf(title,
"Station %i Number of 1D DT or 2D CSC RecHits",
station+1);
121 sprintf(name,
"hMuonHitsFromSegments%i",
station+1);
122 sprintf(title,
"Station %i Hits used by 4D DT or 3D CSC Segments",
station+1);
124 sprintf(name,
"hMuonUncorrelatedHits%i",
station+1);
125 sprintf(title,
"Station %i Uncorrelated Hits",
station+1);
129 sprintf(name,
"hDT%iPullxPropErr",
station+1);
130 sprintf(title,
"DT Station %i Pull X w/ Propagation Error Only",
station+1);
133 sprintf(name,
"hDT%iPulldXdZPropErr",
station+1);
134 sprintf(title,
"DT Station %i Pull DxDz w/ Propagation Error Only",
station+1);
138 sprintf(name,
"hDT%iPullyPropErr",
station+1);
139 sprintf(title,
"DT Station %i Pull Y w/ Propagation Error Only",
station+1);
142 sprintf(name,
"hDT%iPulldYdZPropErr",
station+1);
143 sprintf(title,
"DT Station %i Pull DyDz w/ Propagation Error Only",
station+1);
147 sprintf(name,
"hDT%iDistWithSegment",
station+1);
148 sprintf(title,
"DT Station %i Dist When There Is A Segment",
station+1);
151 sprintf(name,
"hDT%iDistWithNoSegment",
station+1);
152 sprintf(title,
"DT Station %i Dist When There Is No Segment",
station+1);
155 sprintf(name,
"hDT%iPullDistWithSegment",
station+1);
156 sprintf(title,
"DT Station %i Pull Dist When There Is A Segment",
station+1);
159 sprintf(name,
"hDT%iPullDistWithNoSegment",
station+1);
160 sprintf(title,
"DT Station %i Pull Dist When There Is No Segment",
station+1);
163 sprintf(name,
"hCSC%iPullxPropErr",
station+1);
164 sprintf(title,
"CSC Station %i Pull X w/ Propagation Error Only",
station+1);
167 sprintf(name,
"hCSC%iPulldXdZPropErr",
station+1);
168 sprintf(title,
"CSC Station %i Pull DxDz w/ Propagation Error Only",
station+1);
171 sprintf(name,
"hCSC%iPullyPropErr",
station+1);
172 sprintf(title,
"CSC Station %i Pull Y w/ Propagation Error Only",
station+1);
175 sprintf(name,
"hCSC%iPulldYdZPropErr",
station+1);
176 sprintf(title,
"CSC Station %i Pull DyDz w/ Propagation Error Only",
station+1);
179 sprintf(name,
"hCSC%iDistWithSegment",
station+1);
180 sprintf(title,
"CSC Station %i Dist When There Is A Segment",
station+1);
183 sprintf(name,
"hCSC%iDistWithNoSegment",
station+1);
184 sprintf(title,
"CSC Station %i Dist When There Is No Segment",
station+1);
187 sprintf(name,
"hCSC%iPullDistWithSegment",
station+1);
188 sprintf(title,
"CSC Station %i Pull Dist When There Is A Segment",
station+1);
191 sprintf(name,
"hCSC%iPullDistWithNoSegment",
station+1);
192 sprintf(title,
"CSC Station %i Pull Dist When There Is No Segment",
station+1);
215 for(
int wheel = 0; wheel < 5; ++wheel) {
217 for(
int sector = 0; sector < 14; ++sector)
219 sprintf(name,
"hDTChamberDx_%i_%i_%i",
station+1, wheel-2, sector+1);
220 sprintf(title,
"DT Chamber Delta X: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
224 sprintf(name,
"hDTChamberDy_%i_%i_%i",
station+1, wheel-2, sector+1);
225 sprintf(title,
"DT Chamber Delta Y: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
229 sprintf(name,
"hDTChamberEdgeXWithSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
230 sprintf(title,
"DT Chamber Edge X When There Is A Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
233 sprintf(name,
"hDTChamberEdgeXWithNoSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
234 sprintf(title,
"DT Chamber Edge X When There Is No Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
237 sprintf(name,
"hDTChamberEdgeYWithSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
238 sprintf(title,
"DT Chamber Edge Y When There Is A Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
241 sprintf(name,
"hDTChamberEdgeYWithNoSegment_%i_%i_%i",
station+1, wheel-2, sector+1);
242 sprintf(title,
"DT Chamber Edge Y When There Is No Segment: Station %i Wheel %i Sector %i",
station+1, wheel-2, sector+1);
252 for(
int chamber = 0; chamber < 36; ++chamber)
254 sprintf(name,
"hCSCChamberDx_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
255 sprintf(title,
"CSC Chamber Delta X: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1, chamber+1);
258 sprintf(name,
"hCSCChamberDy_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
259 sprintf(title,
"CSC Chamber Delta Y: Endcap %i Station %i Ring %i Chamber %i",
endcap+1,
station+1,
ring+1, chamber+1);
262 sprintf(name,
"hCSCChamberEdgeXWithSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
263 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);
266 sprintf(name,
"hCSCChamberEdgeXWithNoSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
267 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);
270 sprintf(name,
"hCSCChamberEdgeYWithSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
271 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);
274 sprintf(name,
"hCSCChamberEdgeYWithNoSegment_%i_%i_%i_%i",
endcap+1,
station+1,
ring+1, chamber+1);
275 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);
288 using namespace reco;
301 unsigned int muonIdx = 0;
306 for (
unsigned int i = 0;
i < 4;
i++) {
314 if (fabs(
muon->eta()) > 1.479)
319 if (fabs(
muon->eta()) > 1.4)
324 if (fabs(
muon->eta()) < 1.26)
329 if (
muon->isTimeValid()) {
338 MuonTimeExtra combinedMuonTimeExtra = (*combinedMuonTimeExtraValueMapH_)[muonRef];
339 MuonTimeExtra cscMuonTimeExtra = (*cscMuonTimeExtraValueMapH_)[muonRef];
340 MuonTimeExtra dtMuonTimeExtra = (*dtMuonTimeExtraValueMapH_)[muonRef];
359 if (
muon->isCaloCompatibilityValid())
364 if (
muon->isQualityValid()) {
423 if (error == 0) error = 0.000001;
440 if (error == 0) error = 0.000001;
455 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
456 chamberMatch !=
muon->matches().end(); ++chamberMatch)
458 int station = chamberMatch->station();
462 int wheel = dtId.
wheel();
463 int sector = dtId.sector();
465 if (chamberMatch->segmentMatches.empty()) {
472 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
473 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
475 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
476 Fill(
hDTChamberDx[station-1][wheel+2][sector-1], chamberMatch->x-segmentMatch->x);
477 if (station < 4)
Fill(
hDTChamberDy[station-1][wheel+2][sector-1], chamberMatch->y-segmentMatch->y);
487 CSCDetId cscId(chamberMatch->id.rawId());
488 int endcap = cscId.endcap();
489 int ring = cscId.ring();
490 int chamber = cscId.chamber();
492 if (chamberMatch->segmentMatches.empty()) {
499 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
500 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
502 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
503 Fill(
hCSCChamberDx[endcap-1][station-1][ring-1][chamber-1], chamberMatch->x-segmentMatch->x);
504 Fill(
hCSCChamberDy[endcap-1][station-1][ring-1][chamber-1], chamberMatch->y-segmentMatch->y);
520 LocalPoint segmentLocalPosition = segment->localPosition();
521 LocalVector segmentLocalDirection = segment->localDirection();
522 LocalError segmentLocalPositionError = segment->localPositionError();
523 LocalError segmentLocalDirectionError = segment->localDirectionError();
524 const GeomDet* segmentGeomDet =
geometry_->idToDet(segment->geographicalId());
526 bool segmentFound =
false;
527 bool segmentBestDrFound =
false;
532 if (!
muon->isMatchesValid())
535 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
536 chamberMatch !=
muon->matches().end(); ++chamberMatch) {
537 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
538 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
540 if (fabs(segmentMatch->x - segmentLocalPosition.
x() ) < 1E-6 &&
541 fabs(segmentMatch->y - segmentLocalPosition.
y() ) < 1E-6 &&
542 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x()/segmentLocalDirection.
z()) < 1E-6 &&
543 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y()/segmentLocalDirection.
z()) < 1E-6 &&
544 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx()) ) < 1E-6 &&
545 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy()) ) < 1E-6 &&
546 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx()) ) < 1E-6 &&
547 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy()) ) < 1E-6)
554 if (segmentFound)
break;
556 if (segmentFound)
break;
563 if (segmentBestDrFound) {
578 LocalPoint segmentLocalPosition = segment->localPosition();
579 LocalVector segmentLocalDirection = segment->localDirection();
580 LocalError segmentLocalPositionError = segment->localPositionError();
581 LocalError segmentLocalDirectionError = segment->localDirectionError();
582 const GeomDet* segmentGeomDet =
geometry_->idToDet(segment->geographicalId());
584 bool segmentFound =
false;
585 bool segmentBestDrFound =
false;
590 if (!
muon->isMatchesValid())
593 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
594 chamberMatch !=
muon->matches().end(); ++chamberMatch) {
595 for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
596 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch)
598 if (fabs(segmentMatch->x - segmentLocalPosition.
x() ) < 1E-6 &&
599 fabs(segmentMatch->y - segmentLocalPosition.
y() ) < 1E-6 &&
600 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x()/segmentLocalDirection.
z()) < 1E-6 &&
601 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y()/segmentLocalDirection.
z()) < 1E-6 &&
602 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx()) ) < 1E-6 &&
603 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy()) ) < 1E-6 &&
604 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx()) ) < 1E-6 &&
605 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy()) ) < 1E-6)
612 if (segmentFound)
break;
614 if (segmentFound)
break;
621 if (segmentBestDrFound) {
638 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]
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.
MonitorElement * hSegmentIsAssociatedXY
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]
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]
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 ...
C::const_iterator const_iterator
constant access iterator type
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::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)
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 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 * hMuonShowerDeltaR[4][4]
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 * hMuonHitsFromSegments[4][4]
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]
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