29 for (
const std::string
beam : {
"beamPosSigmaX",
"beamPosSigmaY",
"beamPosSigmaZ",
"beamPosSigmaXY"}) {
33 return StatusCode::SUCCESS;
62 Quality =
muon->quality();
68 tp =
muon->trackParticle(xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle);
71 tp =
muon->trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle);
82 deltaZ0 =
tp->z0() +
tp->vz() - pvtx->
z();
87 fill(
tool,
Author, Quality,
Type,
Eta,
Phi,
Pt, D0,
Z0, chi2ndof, deltaZ0, D0sig);
89 return StatusCode::SUCCESS;
132 for(
unsigned int n=0;
n<vecMuons.size();
n++) {
134 xAOD::Muon::MuonType muonType =
muon->muonType();
135 xAOD::Muon::Quality muonQuality =
muon->quality();
142 MuonPhi =
muon->phi();
147 idtp =
muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
153 uint8_t hitval_numberOfBLayerHits, hitval_numberOfPixelHits, hitval_numberOfSCTHits, hitval_numberOfTRTHits;
165 MuonsNBHits =
static_cast<unsigned int>(hitval_numberOfBLayerHits);
166 MuonsNPixHits =
static_cast<unsigned int>(hitval_numberOfPixelHits);
167 MuonsNSCTHits =
static_cast<unsigned int>(hitval_numberOfSCTHits);
168 MuonsNTRTHits =
static_cast<unsigned int>(hitval_numberOfTRTHits);
169 fill(
tool, MuonsNBHits, MuonsNPixHits, MuonsNSCTHits, MuonsNTRTHits);
170 MuonsNBHitsAvg = hitval_numberOfBLayerHits / vecMuons.size();
171 MuonsNPixHitsAvg = hitval_numberOfPixelHits / vecMuons.size();
172 MuonsNSCTHitsAvg = hitval_numberOfSCTHits / vecMuons.size();
173 MuonsNTRTHitsAvg = hitval_numberOfTRTHits / vecMuons.size();
174 fill(
tool, MuonsNBHitsAvg, MuonsNPixHitsAvg, MuonsNSCTHitsAvg, MuonsNTRTHitsAvg);
177 uint8_t hitval_nEtaLayer1{0}, hitval_nEtaLayer2{0}, hitval_nEtaLayer3{0}, hitval_nEtaLayer4{0};
178 uint8_t hitval_nPhiLayer1{0}, hitval_nPhiLayer2{0}, hitval_nPhiLayer3{0}, hitval_nPhiLayer4{0};
187 MuonsEtaHitsLayer1 =
static_cast<unsigned int>(hitval_nEtaLayer1);
188 MuonsEtaHitsLayer2 =
static_cast<unsigned int>(hitval_nEtaLayer2);
189 MuonsEtaHitsLayer3 =
static_cast<unsigned int>(hitval_nEtaLayer3);
190 MuonsEtaHitsLayer4 =
static_cast<unsigned int>(hitval_nEtaLayer4);
191 MuonsPhiHitsLayer1 =
static_cast<unsigned int>(hitval_nPhiLayer1);
192 MuonsPhiHitsLayer2 =
static_cast<unsigned int>(hitval_nPhiLayer2);
193 MuonsPhiHitsLayer3 =
static_cast<unsigned int>(hitval_nPhiLayer3);
194 MuonsPhiHitsLayer4 =
static_cast<unsigned int>(hitval_nPhiLayer4);
195 fill(
tool, MuonsEtaHitsLayer1, MuonsEtaHitsLayer2, MuonsEtaHitsLayer3, MuonsEtaHitsLayer4, MuonsPhiHitsLayer1, MuonsPhiHitsLayer2, MuonsPhiHitsLayer3, MuonsPhiHitsLayer4);
200 MuonEtaMedium = cbtp->
eta();
201 MuonPhiMedium = cbtp->
phi();
202 fill(
tool, MuonEtaMedium, MuonPhiMedium);
205 MuonEtaTight = cbtp->
eta();
206 MuonPhiTight = cbtp->
phi();
207 fill(
tool, MuonEtaTight, MuonPhiTight);
211 MuonDPTIDME = (idtp->
pt() - metp->
pt()) / idtp->
pt();
212 MuonDPTCBME = (cbtp->
pt() - metp->
pt()) / cbtp->
pt();
213 MuonDPTIDMECB = (idtp->
pt() - metp->
pt()) / cbtp->
pt();
216 fill(
tool, MuonDPTIDME, MuonsIDchi2ndof, MuonsMEchi2ndof);
230 uint8_t hitval_numberOfBLayerHits{0}, hitval_numberOfPixelHits{0}, hitval_numberOfSCTHits{0}, hitval_numberOfTRTHits{0};
235 MuonsNBHits =
static_cast<unsigned int>(hitval_numberOfBLayerHits);
236 MuonsNPixHits =
static_cast<unsigned int>(hitval_numberOfPixelHits);
237 MuonsNSCTHits =
static_cast<unsigned int>(hitval_numberOfSCTHits);
238 MuonsNTRTHits =
static_cast<unsigned int>(hitval_numberOfTRTHits);
239 fill(
tool, MuonsNBHits, MuonsNPixHits, MuonsNSCTHits, MuonsNTRTHits);
243 MuonDPTIDME = (idtp->
pt() - metp->
pt()) / idtp->
pt();
246 fill(
tool, MuonDPTIDME, MuonsIDchi2ndof, MuonsMEchi2ndof);
251 return StatusCode::SUCCESS;
288 xAOD::Muon::Quality muonQuality =
muon->quality();
289 xAOD::Muon::MuonType muonType =
muon->muonType();
291 MuonLumiBlock = lumiBlockID;
295 MuonAuthor = muonAuthor;
296 MuonQuality = muonQuality;
299 MuonPhi =
muon->phi();
305 MuonEtaHi =
muon->eta();
306 MuonPhiHi =
muon->phi();
308 fill(
tool, MuonEtaHi, MuonPhiHi, MuonPtHi);
312 for (
size_t nSeg=0; nSeg <
muon->nMuonSegments(); nSeg++) {
317 MuonSmallSectorR = MuonLargeSectorR = std::hypot(muonSegment->
x(), muonSegment->
y());
318 MuonSmallSectorZ = MuonLargeSectorZ = muonSegment->
z();
319 MuonSector = muonSegment->
sector();
321 int sector = muonSegment->
sector();
322 if(sector % 2 == 0) {
323 fill(
tool, MuonLargeSectorZ, MuonLargeSectorR, MuonSector, MuonCIndex);
325 fill(
tool, MuonSmallSectorZ, MuonSmallSectorR, MuonSector, MuonCIndex);
327 const double muonSegmentEta =
Amg::Vector3D(muonSegment->
px(), muonSegment->
py(), muonSegment->
pz()).eta();
328 if (std::abs(muonSegmentEta) > 1.05) {
329 SegmentXPosEndcap = muonSegment->
x();
330 SegmentYPosEndcap = muonSegment->
y();
331 fill(
tool, SegmentXPosEndcap, SegmentYPosEndcap);
333 SegmentXPosBarrel = muonSegment->
x();
334 SegmentYPosBarrel = muonSegment->
y();
335 fill(
tool, SegmentXPosBarrel, SegmentYPosBarrel);
340 return StatusCode::SUCCESS;
362 std::vector<const xAOD::Muon*> vecAllCombinedMuons;
363 std::vector<const xAOD::Muon*> vecCombinedMuons;
364 std::vector<const xAOD::Muon*> vecNoTrigCombinedMuons;
367 std::vector<const xAOD::Muon*> vecAllNonCombinedMuons;
368 std::vector<const xAOD::Muon*> vecNonCombinedMuons;
369 std::vector<const xAOD::Muon*> vecNoTrigNonCombinedMuons;
379 bool isTriggered =
false;
394 xAOD::Muon::MuonType muonType =
muon->muonType();
396 vecAllCombinedMuons.push_back(
muon);
398 vecCombinedMuons.push_back(
muon);
401 MuonPrefix =
"TrigCB";
404 vecNoTrigCombinedMuons.push_back(
muon);
405 MuonPrefix =
"NoTrigCB";
406 n_muons_no_trig_cb++;
410 vecAllNonCombinedMuons.push_back(
muon);
412 vecNonCombinedMuons.push_back(
muon);
414 n_muons_trig_noncb++;
415 MuonPrefix =
"TrigNonCB";
418 vecNoTrigNonCombinedMuons.push_back(
muon);
419 MuonPrefix =
"NoTrigNonCB";
420 n_muons_no_trig_noncb++;
424 for (
size_t nSeg=0; nSeg <
muon->nMuonSegments(); nSeg++) {
425 LumiBlockNumberOfSegments =
evt.lumiBlock();
426 fill(
tool, LumiBlockNumberOfSegments);
430 NMuonsTrig = n_muons_trig;
431 NMuonsTrigCB = n_muons_trig_cb;
432 NMuonsTrigNonCB = n_muons_trig_noncb;
433 NMuonsNoTrigCB = n_muons_no_trig_cb;
434 NMuonsNoTrigNonCB = n_muons_no_trig_noncb;
435 fill(
tool, NMuons, NMuonsTrig, NMuonsTrigCB, NMuonsTrigNonCB, NMuonsNoTrigCB, NMuonsNoTrigNonCB);
437 LumiBlockNumberOfMuonTracks =
evt.lumiBlock();
438 fill(
tool, LumiBlockNumberOfMuonTracks);
456 return StatusCode::SUCCESS;
478 std::map<int, int> mapTagged_Resonance;
479 std::vector<const xAOD::Muon*> vecMuons;
480 for (
unsigned int n=0;
n<muonCandidates.size();
n++)
481 mapTagged_Resonance[
n]=0;
482 for (
unsigned int n=0;
n<muonCandidates.size();
n++){
483 const TLorentzVector& tVec1 = muonCandidates[
n]->p4();
484 for (
unsigned int m=
n+1;
m<muonCandidates.size();
m++) {
485 const TLorentzVector& tVec2 = muonCandidates[
m]->p4();
486 const TLorentzVector candidate = tVec1 + tVec2;
487 const float resonance_Mass = candidate.M() *
MeVtoGeV;
488 const float resonance_Eta = candidate.Eta();
489 if (muonCandidates[
n]->
charge()==muonCandidates[
m]->
charge())
continue;
495 if (mapTagged_Resonance[
n]!=1) vecMuons.push_back(muonCandidates[
n]);
496 mapTagged_Resonance[
n]=1;
497 if (mapTagged_Resonance[
m]!=1) vecMuons.push_back(muonCandidates[
m]);
498 mapTagged_Resonance[
m]=1;
500 if (muonCandidates[
n]->
charge()<0){
501 muMinusEta = tVec1.Eta();
502 muPlusEta = tVec2.Eta();
505 muMinusEta = tVec2.Eta();
506 muPlusEta = tVec1.Eta();
508 const char* EtaReg =
"";
510 if ((muMinusEta>1.05)&&(muPlusEta>1.05)){
513 Mass2D = resonance_Mass;
515 }
else if ((muMinusEta>1.05)&&(muPlusEta>0.)&&(muPlusEta<1.05)){
518 Mass2D = resonance_Mass;
520 }
else if ((muMinusEta>1.05)&&(muPlusEta>-1.05)&&(muPlusEta<0.)){
523 Mass2D = resonance_Mass;
525 }
else if ((muMinusEta>1.05)&&(muPlusEta<-1.05)){
528 Mass2D = resonance_Mass;
530 }
else if ((muMinusEta>0.)&&(muMinusEta<1.05)&&(muPlusEta>1.05)){
533 Mass2D = resonance_Mass;
535 }
else if ((muMinusEta>0.)&&(muMinusEta<1.05)&&(muPlusEta>0.)&&(muPlusEta<1.05)){
538 Mass2D = resonance_Mass;
540 }
else if ((muMinusEta>0.)&&(muMinusEta<1.05)&&(muPlusEta>-1.05)&&(muPlusEta<0.)){
543 Mass2D = resonance_Mass;
545 }
else if ((muMinusEta>0.)&&(muMinusEta<1.05)&&(muPlusEta<-1.05)){
548 Mass2D = resonance_Mass;
550 }
else if ((muMinusEta>-1.05)&&(muMinusEta<0.)&&(muPlusEta>1.05)){
553 Mass2D = resonance_Mass;
555 }
else if ((muMinusEta>-1.05)&&(muMinusEta<0.)&&(muPlusEta>0.)&&(muPlusEta<1.05)){
558 Mass2D = resonance_Mass;
560 }
else if ((muMinusEta>-1.05)&&(muMinusEta<0.)&&(muPlusEta>-1.05)&&(muPlusEta<0.)){
563 Mass2D = resonance_Mass;
565 }
else if ((muMinusEta>-1.05)&&(muMinusEta<0.)&&(muPlusEta<-1.05)){
568 Mass2D = resonance_Mass;
570 }
else if ((muMinusEta<-1.05)&&(muPlusEta>1.05)){
573 Mass2D = resonance_Mass;
575 }
else if ((muMinusEta<-1.05)&&(muPlusEta>0.)&&(muPlusEta<1.05)){
578 Mass2D = resonance_Mass;
580 }
else if ((muMinusEta<-1.05)&&(muPlusEta>-1.05)&&(muPlusEta<0.)){
583 Mass2D = resonance_Mass;
585 }
else if ((muMinusEta<-1.05)&&(muPlusEta<-1.05)){
588 Mass2D = resonance_Mass;
594 Mass = resonance_Mass;
598 fill(
tool, Mass,
Eta, Eta2, Eta2D, muMinusEta, muPlusEta);
600 MuonLumiBlock = lumiBlockID;
608 return StatusCode::SUCCESS;
615 std::vector<const xAOD::Muon*> vecMuons_ZBoson_Candidates;
616 std::vector<const xAOD::Muon*> vecMuons_Jpsi_Candidates;
620 xAOD::Muon::MuonType muonType =
muon->muonType();
624 if (cbtpLink.
isValid()) cbtp = *cbtpLink;
636 vecMuons_ZBoson_Candidates.push_back(
muon);
644 vecMuons_Jpsi_Candidates.push_back(
muon);
652 return StatusCode::SUCCESS;
666 return StatusCode::FAILURE;
673 return StatusCode::FAILURE;
682 return StatusCode::FAILURE;
690 return StatusCode::SUCCESS;