12 matchesValid_ =
false;
13 isolationValid_ =
false;
14 pfIsolationValid_ =
false;
15 qualityValid_ =
false;
16 caloCompatibility_ = -9999.;
24 matchesValid_ =
false;
25 isolationValid_ =
false;
26 pfIsolationValid_ =
false;
27 qualityValid_ =
false;
28 caloCompatibility_ = -9999.;
47 return new Muon( *
this );
50 int Muon::numberOfChambersCSCorDT()
const 53 int nAll = numberOfChambers();
54 for (
int iC = 0; iC < nAll; ++iC){
62 int Muon::numberOfMatches( ArbitrationType
type )
const 65 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
66 chamberMatch != muMatches_.end(); chamberMatch++ )
68 if(type == RPCHitAndTrackArbitration) {
69 if(chamberMatch->rpcMatches.empty())
continue;
70 matches += chamberMatch->rpcMatches.size();
73 if(type == ME0SegmentAndTrackArbitration) {
74 if(chamberMatch->me0Matches.empty())
continue;
75 matches += chamberMatch->me0Matches.size();
78 if(type == GEMSegmentAndTrackArbitration) {
79 if(chamberMatch->gemMatches.empty())
continue;
80 matches += chamberMatch->gemMatches.size();
84 if(chamberMatch->segmentMatches.empty())
continue;
85 if(type == NoArbitration) {
90 for( std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
91 segmentMatch != chamberMatch->segmentMatches.end(); segmentMatch++ )
93 if(type == SegmentArbitration)
94 if(segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
98 if(type == SegmentAndTrackArbitration)
99 if(segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR) &&
100 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
104 if(type == SegmentAndTrackArbitrationCleaned)
105 if(segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR) &&
106 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
107 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
112 if(segmentMatch->isMask(type)) {
122 int Muon::numberOfMatchedStations( ArbitrationType type )
const 126 unsigned int theStationMask = stationMask(type);
128 for(
int it = 0; it < 8; ++it)
129 if (theStationMask & 1<<it)
135 unsigned int Muon::stationMask( ArbitrationType type )
const 137 unsigned int totMask(0);
138 unsigned int curMask(0);
140 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
141 chamberMatch != muMatches_.end(); chamberMatch++ )
143 if(type == RPCHitAndTrackArbitration) {
144 if(chamberMatch->rpcMatches.empty())
continue;
147 const int region = rollId.
region();
148 int rpcIndex = 1;
if (region!=0) rpcIndex = 2;
150 for( std::vector<MuonRPCHitMatch>::const_iterator rpcMatch = chamberMatch->rpcMatches.begin();
151 rpcMatch != chamberMatch->rpcMatches.end(); rpcMatch++ )
153 curMask = 1<<( (chamberMatch->station()-1)+4*(rpcIndex-1) );
156 if(!(totMask & curMask))
162 if(chamberMatch->segmentMatches.empty())
continue;
163 if(type == NoArbitration) {
164 curMask = 1<<( (chamberMatch->station()-1)+4*(chamberMatch->detector()-1) );
166 if(!(totMask & curMask))
171 for( std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
172 segmentMatch != chamberMatch->segmentMatches.end(); segmentMatch++ )
174 if(type == SegmentArbitration)
175 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR)) {
176 curMask = 1<<( (chamberMatch->station()-1)+4*(chamberMatch->detector()-1) );
178 if(!(totMask & curMask))
182 if(type == SegmentAndTrackArbitration)
183 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
184 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
185 curMask = 1<<( (chamberMatch->station()-1)+4*(chamberMatch->detector()-1) );
187 if(!(totMask & curMask))
191 if(type == SegmentAndTrackArbitrationCleaned)
192 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
193 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
194 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
195 curMask = 1<<( (chamberMatch->station()-1)+4*(chamberMatch->detector()-1) );
197 if(!(totMask & curMask))
202 if(segmentMatch->isMask(type)) {
203 curMask = 1<<( (chamberMatch->station()-1)+4*(chamberMatch->detector()-1) );
205 if(!(totMask & curMask))
215 int Muon::numberOfMatchedRPCLayers( ArbitrationType type )
const 219 unsigned int theRPCLayerMask = RPClayerMask(type);
221 for(
int it = 0; it < 10; ++it)
222 if (theRPCLayerMask & 1<<it)
228 unsigned int Muon::RPClayerMask( ArbitrationType type )
const 230 unsigned int totMask(0);
231 unsigned int curMask(0);
232 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
233 chamberMatch != muMatches_.end(); chamberMatch++ )
235 if(chamberMatch->rpcMatches.empty())
continue;
238 const int region = rollId.
region();
240 const int layer = rollId.
layer();
241 int rpcLayer = chamberMatch->station();
243 rpcLayer = chamberMatch->station()-1 + chamberMatch->station()*layer;
244 if ((chamberMatch->station()==2 && layer==2) || (chamberMatch->station()==4 && layer==1)) rpcLayer -= 1;
245 }
else rpcLayer += 6;
247 for( std::vector<MuonRPCHitMatch>::const_iterator rpcMatch = chamberMatch->rpcMatches.begin();
248 rpcMatch != chamberMatch->rpcMatches.end(); rpcMatch++ )
250 curMask = 1<<(rpcLayer-1);
253 if(!(totMask & curMask))
262 unsigned int Muon::stationGapMaskDistance(
float distanceCut )
const 264 unsigned int totMask(0);
267 for(
int detectorIndex = 1; detectorIndex < 4; detectorIndex++ )
269 unsigned int curMask(0);
270 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
271 chamberMatch != muMatches_.end(); chamberMatch++ )
273 if(!(chamberMatch->station()==
stationIndex && chamberMatch->detector()==detectorIndex))
continue;
275 float edgeX = chamberMatch->edgeX;
276 float edgeY = chamberMatch->edgeY;
277 if(edgeX<0 && fabs(edgeX)>fabs(distanceCut) &&
278 edgeY<0 && fabs(edgeY)>fabs(distanceCut))
283 if( ( fabs(edgeX) < fabs(distanceCut) && edgeY < fabs(distanceCut) ) ||
284 ( fabs(edgeY) < fabs(distanceCut) && edgeX < fabs(distanceCut) ) )
295 unsigned int Muon::stationGapMaskPull(
float sigmaCut )
const 297 unsigned int totMask(0);
300 for(
int detectorIndex = 1; detectorIndex < 4; detectorIndex++ )
302 unsigned int curMask(0);
303 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
304 chamberMatch != muMatches_.end(); chamberMatch++ )
306 if(!(chamberMatch->station()==
stationIndex && chamberMatch->detector()==detectorIndex))
continue;
308 float edgeX = chamberMatch->edgeX;
309 float edgeY = chamberMatch->edgeY;
310 float xErr = chamberMatch->xErr+0.000001;
311 float yErr = chamberMatch->yErr+0.000001;
312 if(edgeX<0 && fabs(edgeX/xErr)>fabs(sigmaCut) &&
313 edgeY<0 && fabs(edgeY/yErr)>fabs(sigmaCut))
318 if( ( fabs(edgeX/xErr) < fabs(sigmaCut) && edgeY/yErr < fabs(sigmaCut) ) ||
319 ( fabs(edgeY/yErr) < fabs(sigmaCut) && edgeX/xErr < fabs(sigmaCut) ) )
330 int Muon::numberOfSegments(
int station,
int muonSubdetId, ArbitrationType type )
const 333 for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
334 chamberMatch != muMatches_.end(); chamberMatch++ )
336 if(chamberMatch->segmentMatches.empty())
continue;
337 if(!(chamberMatch->station()==station && chamberMatch->detector()==muonSubdetId))
continue;
339 if(type == NoArbitration) {
340 segments += chamberMatch->segmentMatches.size();
344 for( std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
345 segmentMatch != chamberMatch->segmentMatches.end(); segmentMatch++ )
347 if(type == SegmentArbitration)
348 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR)) {
352 if(type == SegmentAndTrackArbitration)
353 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
354 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
358 if(type == SegmentAndTrackArbitrationCleaned)
359 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
360 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
361 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
366 if(segmentMatch->isMask(type)) {
376 const std::vector<const MuonChamberMatch*>
Muon::chambers(
int station,
int muonSubdetId )
const 378 std::vector<const MuonChamberMatch*>
chambers;
379 for(std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
380 chamberMatch != muMatches_.end(); chamberMatch++)
381 if(chamberMatch->station()==station && chamberMatch->detector()==muonSubdetId)
382 chambers.push_back(&(*chamberMatch));
386 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> Muon::pair(
const std::vector<const MuonChamberMatch*> &chambers,
387 ArbitrationType type )
const 391 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair(m,s);
393 if(chambers.empty())
return chamberSegmentPair;
394 for( std::vector<const MuonChamberMatch*>::const_iterator chamberMatch = chambers.begin();
395 chamberMatch != chambers.end(); chamberMatch++ )
397 if((*chamberMatch)->segmentMatches.empty())
continue;
398 if(type == NoArbitration)
399 return std::make_pair(*chamberMatch, &((*chamberMatch)->segmentMatches.front()));
401 for( std::vector<MuonSegmentMatch>::const_iterator segmentMatch = (*chamberMatch)->segmentMatches.begin();
402 segmentMatch != (*chamberMatch)->segmentMatches.end(); segmentMatch++ )
404 if(type == SegmentArbitration)
405 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR))
406 return std::make_pair(*chamberMatch, &(*segmentMatch));
407 if(type == SegmentAndTrackArbitration)
408 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
409 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR))
410 return std::make_pair(*chamberMatch, &(*segmentMatch));
411 if(type == SegmentAndTrackArbitrationCleaned)
412 if(segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
413 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
414 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning))
415 return std::make_pair(*chamberMatch, &(*segmentMatch));
417 if(segmentMatch->isMask(type))
418 return std::make_pair(*chamberMatch, &(*segmentMatch));
422 return chamberSegmentPair;
425 float Muon::dX(
int station,
int muonSubdetId, ArbitrationType type )
const 427 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
428 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
429 if(! chamberSegmentPair.second->hasPhi())
return 999999;
430 return chamberSegmentPair.first->x-chamberSegmentPair.second->x;
433 float Muon::dY(
int station,
int muonSubdetId, ArbitrationType type )
const 436 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
437 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
438 if(! chamberSegmentPair.second->hasZed())
return 999999;
439 return chamberSegmentPair.first->y-chamberSegmentPair.second->y;
442 float Muon::dDxDz(
int station,
int muonSubdetId, ArbitrationType type )
const 444 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
445 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
446 if(! chamberSegmentPair.second->hasPhi())
return 999999;
447 return chamberSegmentPair.first->dXdZ-chamberSegmentPair.second->dXdZ;
450 float Muon::dDyDz(
int station,
int muonSubdetId, ArbitrationType type )
const 453 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
454 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
455 if(! chamberSegmentPair.second->hasZed())
return 999999;
456 return chamberSegmentPair.first->dYdZ-chamberSegmentPair.second->dYdZ;
459 float Muon::pullX(
int station,
int muonSubdetId, ArbitrationType type,
bool includeSegmentError )
const 461 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
462 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
463 if(! chamberSegmentPair.second->hasPhi())
return 999999;
464 if(includeSegmentError)
465 return (chamberSegmentPair.first->x-chamberSegmentPair.second->x)/
sqrt(
pow(chamberSegmentPair.first->xErr,2)+
pow(chamberSegmentPair.second->xErr,2));
466 return (chamberSegmentPair.first->x-chamberSegmentPair.second->x)/chamberSegmentPair.first->xErr;
469 float Muon::pullY(
int station,
int muonSubdetId, ArbitrationType type,
bool includeSegmentError)
const 472 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
473 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
474 if(! chamberSegmentPair.second->hasZed())
return 999999;
475 if(includeSegmentError)
476 return (chamberSegmentPair.first->y-chamberSegmentPair.second->y)/
sqrt(
pow(chamberSegmentPair.first->yErr,2)+
pow(chamberSegmentPair.second->yErr,2));
477 return (chamberSegmentPair.first->y-chamberSegmentPair.second->y)/chamberSegmentPair.first->yErr;
480 float Muon::pullDxDz(
int station,
int muonSubdetId, ArbitrationType type,
bool includeSegmentError )
const 482 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
483 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
484 if(! chamberSegmentPair.second->hasPhi())
return 999999;
485 if(includeSegmentError)
486 return (chamberSegmentPair.first->dXdZ-chamberSegmentPair.second->dXdZ)/
sqrt(
pow(chamberSegmentPair.first->dXdZErr,2)+
pow(chamberSegmentPair.second->dXdZErr,2));
487 return (chamberSegmentPair.first->dXdZ-chamberSegmentPair.second->dXdZ)/chamberSegmentPair.first->dXdZErr;
490 float Muon::pullDyDz(
int station,
int muonSubdetId, ArbitrationType type,
bool includeSegmentError )
const 493 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
494 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
495 if(! chamberSegmentPair.second->hasZed())
return 999999;
496 if(includeSegmentError)
497 return (chamberSegmentPair.first->dYdZ-chamberSegmentPair.second->dYdZ)/
sqrt(
pow(chamberSegmentPair.first->dYdZErr,2)+
pow(chamberSegmentPair.second->dYdZErr,2));
498 return (chamberSegmentPair.first->dYdZ-chamberSegmentPair.second->dYdZ)/chamberSegmentPair.first->dYdZErr;
501 float Muon::segmentX(
int station,
int muonSubdetId, ArbitrationType type )
const 503 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
504 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
505 if(! chamberSegmentPair.second->hasPhi())
return 999999;
506 return chamberSegmentPair.second->x;
509 float Muon::segmentY(
int station,
int muonSubdetId, ArbitrationType type )
const 512 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
513 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
514 if(! chamberSegmentPair.second->hasZed())
return 999999;
515 return chamberSegmentPair.second->y;
518 float Muon::segmentDxDz(
int station,
int muonSubdetId, ArbitrationType type )
const 520 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
521 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
522 if(! chamberSegmentPair.second->hasPhi())
return 999999;
523 return chamberSegmentPair.second->dXdZ;
526 float Muon::segmentDyDz(
int station,
int muonSubdetId, ArbitrationType type )
const 529 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
530 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
531 if(! chamberSegmentPair.second->hasZed())
return 999999;
532 return chamberSegmentPair.second->dYdZ;
535 float Muon::segmentXErr(
int station,
int muonSubdetId, ArbitrationType type )
const 537 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
538 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
539 if(! chamberSegmentPair.second->hasPhi())
return 999999;
540 return chamberSegmentPair.second->xErr;
543 float Muon::segmentYErr(
int station,
int muonSubdetId, ArbitrationType type )
const 546 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
547 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
548 if(! chamberSegmentPair.second->hasZed())
return 999999;
549 return chamberSegmentPair.second->yErr;
552 float Muon::segmentDxDzErr(
int station,
int muonSubdetId, ArbitrationType type )
const 554 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
555 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
556 if(! chamberSegmentPair.second->hasPhi())
return 999999;
557 return chamberSegmentPair.second->dXdZErr;
560 float Muon::segmentDyDzErr(
int station,
int muonSubdetId, ArbitrationType type )
const 563 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(
chambers(station,muonSubdetId),type);
564 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0)
return 999999;
565 if(! chamberSegmentPair.second->hasZed())
return 999999;
566 return chamberSegmentPair.second->dYdZErr;
569 float Muon::trackEdgeX(
int station,
int muonSubdetId, ArbitrationType type )
const 571 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
572 if(muonChambers.empty())
return 999999;
574 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
575 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
577 float supVar = 999999;
578 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
579 muonChamber != muonChambers.end(); ++muonChamber) {
580 float currDist = (*muonChamber)->dist();
583 supVar = (*muonChamber)->edgeX;
587 }
else return chamberSegmentPair.first->edgeX;
590 float Muon::trackEdgeY(
int station,
int muonSubdetId, ArbitrationType type )
const 592 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
593 if(muonChambers.empty())
return 999999;
595 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
596 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
598 float supVar = 999999;
599 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
600 muonChamber != muonChambers.end(); ++muonChamber) {
601 float currDist = (*muonChamber)->dist();
604 supVar = (*muonChamber)->edgeY;
608 }
else return chamberSegmentPair.first->edgeY;
611 float Muon::trackX(
int station,
int muonSubdetId, ArbitrationType type )
const 613 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
614 if(muonChambers.empty())
return 999999;
616 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
617 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
619 float supVar = 999999;
620 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
621 muonChamber != muonChambers.end(); ++muonChamber) {
622 float currDist = (*muonChamber)->dist();
625 supVar = (*muonChamber)->x;
629 }
else return chamberSegmentPair.first->x;
632 float Muon::trackY(
int station,
int muonSubdetId, ArbitrationType type )
const 634 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
635 if(muonChambers.empty())
return 999999;
637 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
638 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
640 float supVar = 999999;
641 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
642 muonChamber != muonChambers.end(); ++muonChamber) {
643 float currDist = (*muonChamber)->dist();
646 supVar = (*muonChamber)->y;
650 }
else return chamberSegmentPair.first->y;
653 float Muon::trackDxDz(
int station,
int muonSubdetId, ArbitrationType type )
const 655 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
656 if(muonChambers.empty())
return 999999;
658 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
659 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
661 float supVar = 999999;
662 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
663 muonChamber != muonChambers.end(); ++muonChamber) {
664 float currDist = (*muonChamber)->dist();
667 supVar = (*muonChamber)->dXdZ;
671 }
else return chamberSegmentPair.first->dXdZ;
674 float Muon::trackDyDz(
int station,
int muonSubdetId, ArbitrationType type )
const 676 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
677 if(muonChambers.empty())
return 999999;
679 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
680 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
682 float supVar = 999999;
683 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
684 muonChamber != muonChambers.end(); ++muonChamber) {
685 float currDist = (*muonChamber)->dist();
688 supVar = (*muonChamber)->dYdZ;
692 }
else return chamberSegmentPair.first->dYdZ;
695 float Muon::trackXErr(
int station,
int muonSubdetId, ArbitrationType type )
const 697 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
698 if(muonChambers.empty())
return 999999;
700 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
701 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
703 float supVar = 999999;
704 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
705 muonChamber != muonChambers.end(); ++muonChamber) {
706 float currDist = (*muonChamber)->dist();
709 supVar = (*muonChamber)->xErr;
713 }
else return chamberSegmentPair.first->xErr;
716 float Muon::trackYErr(
int station,
int muonSubdetId, ArbitrationType type )
const 718 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
719 if(muonChambers.empty())
return 999999;
721 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
722 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
724 float supVar = 999999;
725 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
726 muonChamber != muonChambers.end(); ++muonChamber) {
727 float currDist = (*muonChamber)->dist();
730 supVar = (*muonChamber)->yErr;
734 }
else return chamberSegmentPair.first->yErr;
737 float Muon::trackDxDzErr(
int station,
int muonSubdetId, ArbitrationType type )
const 739 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
740 if(muonChambers.empty())
return 999999;
742 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
743 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
745 float supVar = 999999;
746 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
747 muonChamber != muonChambers.end(); ++muonChamber) {
748 float currDist = (*muonChamber)->dist();
751 supVar = (*muonChamber)->dXdZErr;
755 }
else return chamberSegmentPair.first->dXdZErr;
758 float Muon::trackDyDzErr(
int station,
int muonSubdetId, ArbitrationType type )
const 760 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
761 if(muonChambers.empty())
return 999999;
763 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
764 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
766 float supVar = 999999;
767 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
768 muonChamber != muonChambers.end(); ++muonChamber) {
769 float currDist = (*muonChamber)->dist();
772 supVar = (*muonChamber)->dYdZErr;
776 }
else return chamberSegmentPair.first->dYdZErr;
779 float Muon::trackDist(
int station,
int muonSubdetId, ArbitrationType type )
const 781 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
782 if(muonChambers.empty())
return 999999;
784 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
785 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
787 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
788 muonChamber != muonChambers.end(); ++muonChamber) {
789 float currDist = (*muonChamber)->dist();
790 if(currDist<dist) dist = currDist;
793 }
else return chamberSegmentPair.first->dist();
796 float Muon::trackDistErr(
int station,
int muonSubdetId, ArbitrationType type )
const 798 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(station, muonSubdetId);
799 if(muonChambers.empty())
return 999999;
801 std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,type);
802 if(chamberSegmentPair.first==0 || chamberSegmentPair.second==0) {
804 float supVar = 999999;
805 for(std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin();
806 muonChamber != muonChambers.end(); ++muonChamber) {
807 float currDist = (*muonChamber)->dist();
810 supVar = (*muonChamber)->distErr();
814 }
else return chamberSegmentPair.first->distErr();
819 isolationR03_ = isoR03;
820 isolationR05_ = isoR05;
821 isolationValid_ =
true;
827 if(label==
"pfIsolationR03")
828 pfIsolationR03_ = deposit;
830 if(label==
"pfIsolationR04")
831 pfIsolationR04_ = deposit;
833 if(label==
"pfIsoMeanDRProfileR03")
834 pfIsoMeanDRR03_ = deposit;
836 if(label==
"pfIsoMeanDRProfileR04")
837 pfIsoMeanDRR04_ = deposit;
839 if(label==
"pfIsoSumDRProfileR03")
840 pfIsoSumDRR03_ = deposit;
842 if(label==
"pfIsoSumDRProfileR04")
843 pfIsoSumDRR04_ = deposit;
845 pfIsolationValid_ =
true;
852 type_ = type_ | PFMuon;
857 void Muon::setOuterTrack(
const TrackRef &
t ) { outerTrack_ =
t; }
858 void Muon::setInnerTrack(
const TrackRef &
t ) { innerTrack_ =
t; }
859 void Muon::setTrack(
const TrackRef &
t ) { setInnerTrack(t); }
860 void Muon::setStandAlone(
const TrackRef &
t ) { setOuterTrack(t); }
861 void Muon::setGlobalTrack(
const TrackRef &
t ) { globalTrack_ =
t; }
862 void Muon::setCombined(
const TrackRef &
t ) { setGlobalTrack(t); }
865 bool Muon::isAValidMuonTrack(
const MuonTrackType& type)
const{
866 return muonTrack(type).isNonnull();
874 case TPFMS:
return tpfmsTrack();
875 case Picky:
return pickyTrack();
876 case DYT:
return dytTrack();
877 default:
return muonTrackFromMap(type);
884 case InnerTrack: setInnerTrack(t);
break;
885 case OuterTrack: setStandAlone(t);
break;
886 case CombinedTrack: setGlobalTrack(t);
break;
887 default: refittedTrackMap_[
type] =
t;
break;
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
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
virtual bool overlap(const Candidate &) const
check overlap with another Candidate
math::XYZTLorentzVector LorentzVector
Lorentz vector.
def checkOverlap(process)
virtual LeafCandidate * clone() const
returns a clone of the Candidate object
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
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.