12 matchesValid_ =
false;
13 isolationValid_ =
false;
14 pfIsolationValid_ =
false;
15 qualityValid_ =
false;
16 caloCompatibility_ = -9999.;
25 matchesValid_ =
false;
26 isolationValid_ =
false;
27 pfIsolationValid_ =
false;
28 qualityValid_ =
false;
29 caloCompatibility_ = -9999.;
38 return ( o !=
nullptr &&
48 return new Muon( *
this );
51 int Muon::numberOfChambersCSCorDT()
const 54 int nAll = numberOfChambers();
55 for (
int iC = 0; iC < nAll; ++iC){
63 int Muon::numberOfMatches( ArbitrationType
type )
const 66 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
67 chamberMatch != muMatches_.end(); chamberMatch++ )
69 if(type == RPCHitAndTrackArbitration) {
70 if(chamberMatch->rpcMatches.empty())
continue;
71 matches += chamberMatch->rpcMatches.size();
74 if(type == ME0SegmentAndTrackArbitration) {
75 if(chamberMatch->me0Matches.empty())
continue;
76 matches += chamberMatch->me0Matches.size();
79 if(type == GEMSegmentAndTrackArbitration) {
80 if(chamberMatch->gemMatches.empty())
continue;
81 matches += chamberMatch->gemMatches.size();
85 if(chamberMatch->segmentMatches.empty())
continue;
86 if(type == NoArbitration) {
91 for( std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
92 segmentMatch != chamberMatch->segmentMatches.end(); segmentMatch++ )
94 if(type == SegmentArbitration)
95 if(segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
99 if(type == SegmentAndTrackArbitration)
100 if(segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR) &&
101 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
105 if(type == SegmentAndTrackArbitrationCleaned)
106 if(segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR) &&
107 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
108 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
113 if(segmentMatch->isMask(type)) {
123 int Muon::numberOfMatchedStations( ArbitrationType type )
const 127 unsigned int theStationMask = stationMask(type);
129 for(
int it = 0; it < 8; ++it)
130 if (theStationMask & 1<<it)
136 unsigned int Muon::stationMask( ArbitrationType type )
const 138 unsigned int totMask(0);
139 unsigned int curMask(0);
141 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
142 chamberMatch != muMatches_.end(); chamberMatch++ )
144 if(type == RPCHitAndTrackArbitration) {
145 if(chamberMatch->rpcMatches.empty())
continue;
148 const int region = rollId.
region();
149 int rpcIndex = 1;
if (region!=0) rpcIndex = 2;
151 for( std::vector<MuonRPCHitMatch>::const_iterator rpcMatch = chamberMatch->rpcMatches.begin();
152 rpcMatch != chamberMatch->rpcMatches.end(); rpcMatch++ )
154 curMask = 1<<( (chamberMatch->station()-1)+4*(rpcIndex-1) );
157 if(!(totMask & curMask))
163 if(chamberMatch->segmentMatches.empty())
continue;
164 if(type == NoArbitration) {
165 curMask = 1<<( (chamberMatch->station()-1)+4*(chamberMatch->detector()-1) );
167 if(!(totMask & curMask))
172 for( std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
173 segmentMatch != chamberMatch->segmentMatches.end(); segmentMatch++ )
175 if(type == SegmentArbitration)
176 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR)) {
177 curMask = 1<<( (chamberMatch->station()-1)+4*(chamberMatch->detector()-1) );
179 if(!(totMask & curMask))
183 if(type == SegmentAndTrackArbitration)
184 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
185 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
186 curMask = 1<<( (chamberMatch->station()-1)+4*(chamberMatch->detector()-1) );
188 if(!(totMask & curMask))
192 if(type == SegmentAndTrackArbitrationCleaned)
193 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
194 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
195 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
196 curMask = 1<<( (chamberMatch->station()-1)+4*(chamberMatch->detector()-1) );
198 if(!(totMask & curMask))
203 if(segmentMatch->isMask(type)) {
204 curMask = 1<<( (chamberMatch->station()-1)+4*(chamberMatch->detector()-1) );
206 if(!(totMask & curMask))
216 int Muon::numberOfMatchedRPCLayers( ArbitrationType type )
const 220 unsigned int theRPCLayerMask = RPClayerMask(type);
222 for(
int it = 0; it < 10; ++it)
223 if (theRPCLayerMask & 1<<it)
229 unsigned int Muon::RPClayerMask( ArbitrationType type )
const 231 unsigned int totMask(0);
232 unsigned int curMask(0);
233 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
234 chamberMatch != muMatches_.end(); chamberMatch++ )
236 if(chamberMatch->rpcMatches.empty())
continue;
239 const int region = rollId.
region();
241 const int layer = rollId.
layer();
242 int rpcLayer = chamberMatch->station();
244 rpcLayer = chamberMatch->station()-1 + chamberMatch->station()*layer;
245 if ((chamberMatch->station()==2 && layer==2) || (chamberMatch->station()==4 && layer==1)) rpcLayer -= 1;
246 }
else rpcLayer += 6;
248 for( std::vector<MuonRPCHitMatch>::const_iterator rpcMatch = chamberMatch->rpcMatches.begin();
249 rpcMatch != chamberMatch->rpcMatches.end(); rpcMatch++ )
251 curMask = 1<<(rpcLayer-1);
254 if(!(totMask & curMask))
263 unsigned int Muon::stationGapMaskDistance(
float distanceCut )
const 265 unsigned int totMask(0);
268 for(
int detectorIndex = 1; detectorIndex < 4; detectorIndex++ )
270 unsigned int curMask(0);
271 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
272 chamberMatch != muMatches_.end(); chamberMatch++ )
274 if(!(chamberMatch->station()==
stationIndex && chamberMatch->detector()==detectorIndex))
continue;
276 float edgeX = chamberMatch->edgeX;
277 float edgeY = chamberMatch->edgeY;
278 if(edgeX<0 && fabs(edgeX)>fabs(distanceCut) &&
279 edgeY<0 && fabs(edgeY)>fabs(distanceCut))
284 if( ( fabs(edgeX) < fabs(distanceCut) && edgeY < fabs(distanceCut) ) ||
285 ( fabs(edgeY) < fabs(distanceCut) && edgeX < fabs(distanceCut) ) )
296 unsigned int Muon::stationGapMaskPull(
float sigmaCut )
const 298 unsigned int totMask(0);
301 for(
int detectorIndex = 1; detectorIndex < 4; detectorIndex++ )
303 unsigned int curMask(0);
304 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
305 chamberMatch != muMatches_.end(); chamberMatch++ )
307 if(!(chamberMatch->station()==
stationIndex && chamberMatch->detector()==detectorIndex))
continue;
309 float edgeX = chamberMatch->edgeX;
310 float edgeY = chamberMatch->edgeY;
311 float xErr = chamberMatch->xErr+0.000001;
312 float yErr = chamberMatch->yErr+0.000001;
313 if(edgeX<0 && fabs(edgeX/xErr)>fabs(sigmaCut) &&
314 edgeY<0 && fabs(edgeY/yErr)>fabs(sigmaCut))
319 if( ( fabs(edgeX/xErr) < fabs(sigmaCut) && edgeY/yErr < fabs(sigmaCut) ) ||
320 ( fabs(edgeY/yErr) < fabs(sigmaCut) && edgeX/xErr < fabs(sigmaCut) ) )
331 int Muon::numberOfSegments(
int station,
int muonSubdetId, ArbitrationType type )
const 334 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
335 chamberMatch != muMatches_.end(); chamberMatch++ )
337 if(chamberMatch->segmentMatches.empty())
continue;
338 if(!(chamberMatch->station()==station && chamberMatch->detector()==muonSubdetId))
continue;
340 if(type == NoArbitration) {
341 segments += chamberMatch->segmentMatches.size();
345 for( std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
346 segmentMatch != chamberMatch->segmentMatches.end(); segmentMatch++ )
348 if(type == SegmentArbitration)
349 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR)) {
353 if(type == SegmentAndTrackArbitration)
354 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
355 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
359 if(type == SegmentAndTrackArbitrationCleaned)
360 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
361 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
362 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
367 if(segmentMatch->isMask(type)) {
377 const std::vector<const MuonChamberMatch*>
Muon::chambers(
int station,
int muonSubdetId )
const 379 std::vector<const MuonChamberMatch*>
chambers;
380 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
381 chamberMatch != muMatches_.end(); chamberMatch++)
382 if(chamberMatch->station()==station && chamberMatch->detector()==muonSubdetId)
383 chambers.push_back(&(*chamberMatch));
387 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> Muon::pair(
const std::vector<const MuonChamberMatch*> &chambers,
388 ArbitrationType type )
const 392 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair(m,s);
394 if(chambers.empty())
return chamberSegmentPair;
395 for( std::vector<const MuonChamberMatch*>::const_iterator chamberMatch = chambers.begin();
396 chamberMatch != chambers.end(); chamberMatch++ )
398 if((*chamberMatch)->segmentMatches.empty())
continue;
399 if(type == NoArbitration)
400 return std::make_pair(*chamberMatch, &((*chamberMatch)->segmentMatches.front()));
402 for( std::vector<MuonSegmentMatch>::const_iterator segmentMatch = (*chamberMatch)->segmentMatches.begin();
403 segmentMatch != (*chamberMatch)->segmentMatches.end(); segmentMatch++ )
405 if(type == SegmentArbitration)
406 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR))
407 return std::make_pair(*chamberMatch, &(*segmentMatch));
408 if(type == SegmentAndTrackArbitration)
409 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
410 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR))
411 return std::make_pair(*chamberMatch, &(*segmentMatch));
412 if(type == SegmentAndTrackArbitrationCleaned)
413 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
414 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
415 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning))
416 return std::make_pair(*chamberMatch, &(*segmentMatch));
418 if(segmentMatch->isMask(type))
419 return std::make_pair(*chamberMatch, &(*segmentMatch));
423 return chamberSegmentPair;
426 float Muon::dX(
int station,
int muonSubdetId, ArbitrationType type )
const 428 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
429 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
430 if(! chamberSegmentPair.second->hasPhi())
return 999999;
431 return chamberSegmentPair.first->x-chamberSegmentPair.second->x;
434 float Muon::dY(
int station,
int muonSubdetId, ArbitrationType type )
const 437 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
438 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
439 if(! chamberSegmentPair.second->hasZed())
return 999999;
440 return chamberSegmentPair.first->y-chamberSegmentPair.second->y;
443 float Muon::dDxDz(
int station,
int muonSubdetId, ArbitrationType type )
const 445 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
446 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
447 if(! chamberSegmentPair.second->hasPhi())
return 999999;
448 return chamberSegmentPair.first->dXdZ-chamberSegmentPair.second->dXdZ;
451 float Muon::dDyDz(
int station,
int muonSubdetId, ArbitrationType type )
const 454 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
455 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
456 if(! chamberSegmentPair.second->hasZed())
return 999999;
457 return chamberSegmentPair.first->dYdZ-chamberSegmentPair.second->dYdZ;
460 float Muon::pullX(
int station,
int muonSubdetId, ArbitrationType type,
bool includeSegmentError )
const 462 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
463 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
464 if(! chamberSegmentPair.second->hasPhi())
return 999999;
465 if(includeSegmentError)
466 return (chamberSegmentPair.first->x-chamberSegmentPair.second->x)/
sqrt(
pow(chamberSegmentPair.first->xErr,2)+
pow(chamberSegmentPair.second->xErr,2));
467 return (chamberSegmentPair.first->x-chamberSegmentPair.second->x)/chamberSegmentPair.first->xErr;
470 float Muon::pullY(
int station,
int muonSubdetId, ArbitrationType type,
bool includeSegmentError)
const 473 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
474 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
475 if(! chamberSegmentPair.second->hasZed())
return 999999;
476 if(includeSegmentError)
477 return (chamberSegmentPair.first->y-chamberSegmentPair.second->y)/
sqrt(
pow(chamberSegmentPair.first->yErr,2)+
pow(chamberSegmentPair.second->yErr,2));
478 return (chamberSegmentPair.first->y-chamberSegmentPair.second->y)/chamberSegmentPair.first->yErr;
481 float Muon::pullDxDz(
int station,
int muonSubdetId, ArbitrationType type,
bool includeSegmentError )
const 483 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
484 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
485 if(! chamberSegmentPair.second->hasPhi())
return 999999;
486 if(includeSegmentError)
487 return (chamberSegmentPair.first->dXdZ-chamberSegmentPair.second->dXdZ)/
sqrt(
pow(chamberSegmentPair.first->dXdZErr,2)+
pow(chamberSegmentPair.second->dXdZErr,2));
488 return (chamberSegmentPair.first->dXdZ-chamberSegmentPair.second->dXdZ)/chamberSegmentPair.first->dXdZErr;
491 float Muon::pullDyDz(
int station,
int muonSubdetId, ArbitrationType type,
bool includeSegmentError )
const 494 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
495 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
496 if(! chamberSegmentPair.second->hasZed())
return 999999;
497 if(includeSegmentError)
498 return (chamberSegmentPair.first->dYdZ-chamberSegmentPair.second->dYdZ)/
sqrt(
pow(chamberSegmentPair.first->dYdZErr,2)+
pow(chamberSegmentPair.second->dYdZErr,2));
499 return (chamberSegmentPair.first->dYdZ-chamberSegmentPair.second->dYdZ)/chamberSegmentPair.first->dYdZErr;
502 float Muon::segmentX(
int station,
int muonSubdetId, ArbitrationType type )
const 504 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
505 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
506 if(! chamberSegmentPair.second->hasPhi())
return 999999;
507 return chamberSegmentPair.second->x;
510 float Muon::segmentY(
int station,
int muonSubdetId, ArbitrationType type )
const 513 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
514 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
515 if(! chamberSegmentPair.second->hasZed())
return 999999;
516 return chamberSegmentPair.second->y;
519 float Muon::segmentDxDz(
int station,
int muonSubdetId, ArbitrationType type )
const 521 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
522 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
523 if(! chamberSegmentPair.second->hasPhi())
return 999999;
524 return chamberSegmentPair.second->dXdZ;
527 float Muon::segmentDyDz(
int station,
int muonSubdetId, ArbitrationType type )
const 530 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
531 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
532 if(! chamberSegmentPair.second->hasZed())
return 999999;
533 return chamberSegmentPair.second->dYdZ;
536 float Muon::segmentXErr(
int station,
int muonSubdetId, ArbitrationType type )
const 538 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
539 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
540 if(! chamberSegmentPair.second->hasPhi())
return 999999;
541 return chamberSegmentPair.second->xErr;
544 float Muon::segmentYErr(
int station,
int muonSubdetId, ArbitrationType type )
const 547 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
548 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
549 if(! chamberSegmentPair.second->hasZed())
return 999999;
550 return chamberSegmentPair.second->yErr;
553 float Muon::segmentDxDzErr(
int station,
int muonSubdetId, ArbitrationType type )
const 555 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
556 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
557 if(! chamberSegmentPair.second->hasPhi())
return 999999;
558 return chamberSegmentPair.second->dXdZErr;
561 float Muon::segmentDyDzErr(
int station,
int muonSubdetId, ArbitrationType type )
const 564 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
565 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr)
return 999999;
566 if(! chamberSegmentPair.second->hasZed())
return 999999;
567 return chamberSegmentPair.second->dYdZErr;
570 float Muon::trackEdgeX(
int station,
int muonSubdetId, ArbitrationType type )
const 572 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
573 if(muonChambers.empty())
return 999999;
575 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
576 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
578 float supVar = 999999;
579 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
580 muonChamber != muonChambers.end(); ++muonChamber) {
581 float currDist = (*muonChamber)->dist();
584 supVar = (*muonChamber)->edgeX;
588 }
else return chamberSegmentPair.first->edgeX;
591 float Muon::trackEdgeY(
int station,
int muonSubdetId, ArbitrationType type )
const 593 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
594 if(muonChambers.empty())
return 999999;
596 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
597 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
599 float supVar = 999999;
600 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
601 muonChamber != muonChambers.end(); ++muonChamber) {
602 float currDist = (*muonChamber)->dist();
605 supVar = (*muonChamber)->edgeY;
609 }
else return chamberSegmentPair.first->edgeY;
612 float Muon::trackX(
int station,
int muonSubdetId, ArbitrationType type )
const 614 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
615 if(muonChambers.empty())
return 999999;
617 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
618 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
620 float supVar = 999999;
621 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
622 muonChamber != muonChambers.end(); ++muonChamber) {
623 float currDist = (*muonChamber)->dist();
626 supVar = (*muonChamber)->x;
630 }
else return chamberSegmentPair.first->x;
633 float Muon::trackY(
int station,
int muonSubdetId, ArbitrationType type )
const 635 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
636 if(muonChambers.empty())
return 999999;
638 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
639 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
641 float supVar = 999999;
642 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
643 muonChamber != muonChambers.end(); ++muonChamber) {
644 float currDist = (*muonChamber)->dist();
647 supVar = (*muonChamber)->y;
651 }
else return chamberSegmentPair.first->y;
654 float Muon::trackDxDz(
int station,
int muonSubdetId, ArbitrationType type )
const 656 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
657 if(muonChambers.empty())
return 999999;
659 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
660 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
662 float supVar = 999999;
663 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
664 muonChamber != muonChambers.end(); ++muonChamber) {
665 float currDist = (*muonChamber)->dist();
668 supVar = (*muonChamber)->dXdZ;
672 }
else return chamberSegmentPair.first->dXdZ;
675 float Muon::trackDyDz(
int station,
int muonSubdetId, ArbitrationType type )
const 677 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
678 if(muonChambers.empty())
return 999999;
680 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
681 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
683 float supVar = 999999;
684 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
685 muonChamber != muonChambers.end(); ++muonChamber) {
686 float currDist = (*muonChamber)->dist();
689 supVar = (*muonChamber)->dYdZ;
693 }
else return chamberSegmentPair.first->dYdZ;
696 float Muon::trackXErr(
int station,
int muonSubdetId, ArbitrationType type )
const 698 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
699 if(muonChambers.empty())
return 999999;
701 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
702 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
704 float supVar = 999999;
705 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
706 muonChamber != muonChambers.end(); ++muonChamber) {
707 float currDist = (*muonChamber)->dist();
710 supVar = (*muonChamber)->xErr;
714 }
else return chamberSegmentPair.first->xErr;
717 float Muon::trackYErr(
int station,
int muonSubdetId, ArbitrationType type )
const 719 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
720 if(muonChambers.empty())
return 999999;
722 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
723 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
725 float supVar = 999999;
726 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
727 muonChamber != muonChambers.end(); ++muonChamber) {
728 float currDist = (*muonChamber)->dist();
731 supVar = (*muonChamber)->yErr;
735 }
else return chamberSegmentPair.first->yErr;
738 float Muon::trackDxDzErr(
int station,
int muonSubdetId, ArbitrationType type )
const 740 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
741 if(muonChambers.empty())
return 999999;
743 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
744 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
746 float supVar = 999999;
747 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
748 muonChamber != muonChambers.end(); ++muonChamber) {
749 float currDist = (*muonChamber)->dist();
752 supVar = (*muonChamber)->dXdZErr;
756 }
else return chamberSegmentPair.first->dXdZErr;
759 float Muon::trackDyDzErr(
int station,
int muonSubdetId, ArbitrationType type )
const 761 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
762 if(muonChambers.empty())
return 999999;
764 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
765 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
767 float supVar = 999999;
768 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
769 muonChamber != muonChambers.end(); ++muonChamber) {
770 float currDist = (*muonChamber)->dist();
773 supVar = (*muonChamber)->dYdZErr;
777 }
else return chamberSegmentPair.first->dYdZErr;
780 float Muon::trackDist(
int station,
int muonSubdetId, ArbitrationType type )
const 782 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
783 if(muonChambers.empty())
return 999999;
785 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
786 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
788 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
789 muonChamber != muonChambers.end(); ++muonChamber) {
790 float currDist = (*muonChamber)->dist();
791 if(currDist<dist) dist = currDist;
794 }
else return chamberSegmentPair.first->dist();
797 float Muon::trackDistErr(
int station,
int muonSubdetId, ArbitrationType type )
const 799 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
800 if(muonChambers.empty())
return 999999;
802 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
803 if(chamberSegmentPair.first==
nullptr || chamberSegmentPair.second==
nullptr) {
805 float supVar = 999999;
806 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
807 muonChamber != muonChambers.end(); ++muonChamber) {
808 float currDist = (*muonChamber)->dist();
811 supVar = (*muonChamber)->distErr();
815 }
else return chamberSegmentPair.first->distErr();
820 isolationR03_ = isoR03;
821 isolationR05_ = isoR05;
822 isolationValid_ =
true;
828 if(label==
"pfIsolationR03")
829 pfIsolationR03_ = deposit;
831 if(label==
"pfIsolationR04")
832 pfIsolationR04_ = deposit;
834 if(label==
"pfIsoMeanDRProfileR03")
835 pfIsoMeanDRR03_ = deposit;
837 if(label==
"pfIsoMeanDRProfileR04")
838 pfIsoMeanDRR04_ = deposit;
840 if(label==
"pfIsoSumDRProfileR03")
841 pfIsoSumDRR03_ = deposit;
843 if(label==
"pfIsoSumDRProfileR04")
844 pfIsoSumDRR04_ = deposit;
846 pfIsolationValid_ =
true;
853 type_ = type_ | PFMuon;
858 void Muon::setOuterTrack(
const TrackRef &
t ) { outerTrack_ =
t; }
859 void Muon::setInnerTrack(
const TrackRef &
t ) { innerTrack_ =
t; }
860 void Muon::setTrack(
const TrackRef &
t ) { setInnerTrack(t); }
861 void Muon::setStandAlone(
const TrackRef &
t ) { setOuterTrack(t); }
862 void Muon::setGlobalTrack(
const TrackRef &
t ) { globalTrack_ =
t; }
863 void Muon::setCombined(
const TrackRef &
t ) { setGlobalTrack(t); }
866 bool Muon::isAValidMuonTrack(
const MuonTrackType& type)
const{
867 return muonTrack(type).isNonnull();
875 case TPFMS:
return tpfmsTrack();
876 case Picky:
return pickyTrack();
877 case DYT:
return dytTrack();
878 default:
return muonTrackFromMap(type);
885 case InnerTrack: setInnerTrack(t);
break;
886 case OuterTrack: setStandAlone(t);
break;
887 case CombinedTrack: setGlobalTrack(t);
break;
888 default: refittedTrackMap_[
type] =
t;
break;
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
LeafCandidate * clone() const override
returns a clone of the Candidate object
virtual reco::TrackRef standAloneMuon() const
reference to a stand-alone muon Track
virtual reco::TrackRef track() const
reference to a Track
uint32_t rawId() const
get the raw id
math::XYZTLorentzVector LorentzVector
const LorentzVector & p4() const final
four-momentum Lorentz vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
def checkOverlap(process)
bool overlap(const Candidate &) const override
check overlap with another Candidate
static char chambers[264][20]
Power< A, B >::type pow(const A &a, const B &b)
virtual reco::TrackRef combinedMuon() const
reference to a stand-alone muon Track
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.