27 constexpr
double profile_x_label_size = 0.03;
28 constexpr
double profile_y_label_size = 0.03;
29 constexpr
double profile_msize = 0.5;
30 constexpr
int profile_mcolor = 2;
31 constexpr
int profile_mstyle = 2;
40 const std::string &
name,
43 m_pTRTHelper (nullptr),
90 return StatusCode::SUCCESS;
96 return StatusCode::SUCCESS;
133 MonGroup hl_monGroup_pcand (
this,
"TRT//HTMonitoring/ParticleCandidates",
run);
144 catch(
const char* hName)
146 ATH_MSG_FATAL(
"Could not register histogram " << hName <<
"!" );
147 return StatusCode::FAILURE;
150 return StatusCode::SUCCESS;
157 std::string ZRn =
"ZorR";
158 std::string ZRt =
"ZorR";
161 if(
name==
"BarrelA"||
name==
"BarrelC"){
167 if(
name==
"EndCapA"||
name==
"EndCapC"){
176 hists.hNTracks =
trtBookHistoLW(hl_monGroup_shift,
"hNTracks" ,
"Number of Tracks per Event in "+
name , 150 , 0, 150 , profile_x_label_size, profile_y_label_size,
"Number of Tracks",
"Frequency");
177 hists.hHTFracTrack =
trtBookHistoLW(hl_monGroup_shift,
"hHTFracTrack" ,
"HT Fraction per Track in "+
name , 50 , 0, 1 , profile_x_label_size, profile_y_label_size,
"HT Fraction",
"Frequency");
178 hists.pHTFracTrackPhi =
trtBookHistoLW(hl_monGroup_shift,
"pHTFracTrackPhi" ,
"HT Fraction per Track vs. Phi in "+
name ,
m_nPhiBins, 0, 360 , 0, 1 , profile_x_label_size, profile_y_label_size,
"PHI, degrees",
"HT Fraction", profile_msize,profile_mcolor,profile_mstyle);
179 hists.pHTFracStrawZR =
trtBookHistoLW(hl_monGroup_shift,
"pHTFracStraw"+ZRn ,
"HT Fraction per Track vs. "+ZRt+
" along the straw in "+
name ,
m_nZRBins, ZRMin, ZRMax , 0, 1 , profile_x_label_size, profile_y_label_size, ZRt+
", mm" ,
"HT Fraction", profile_msize,profile_mcolor,profile_mstyle);
180 if(
name==
"BarrelA"||
name==
"BarrelC"){
181 hists.pHTFracStrawZAI =
trtBookHistoLW(hl_monGroup_shift,
"pHTFracStraw"+ZRn+
"GinA" ,
"HT Fraction per Track vs. "+ZRt+
" along the straw in "+
name+
" (Gas in Side A)" ,
m_nZRBins, ZRMin, ZRMax , 0, 1 , profile_x_label_size, profile_y_label_size, ZRt+
", mm" ,
"HT Fraction", profile_msize,profile_mcolor,profile_mstyle);
182 hists.pHTFracStrawZCO =
trtBookHistoLW(hl_monGroup_shift,
"pHTFracStraw"+ZRn+
"GinC" ,
"HT Fraction per Track vs. "+ZRt+
" along the straw in "+
name+
" (Gas in Side C)" ,
m_nZRBins, ZRMin, ZRMax , 0, 1 , profile_x_label_size, profile_y_label_size, ZRt+
", mm" ,
"HT Fraction", profile_msize,profile_mcolor,profile_mstyle);
185 hists.pHTFracStrawZAI =
trtBookHistoLW(hl_monGroup_shift,
"pHTFracStraw"+ZRn+
"GinInner",
"HT Fraction per Track vs. "+ZRt+
" along the straw in "+
name+
" (Gas in Inner End)" ,
m_nZRBins, ZRMin, ZRMax , 0, 1 , profile_x_label_size, profile_y_label_size, ZRt+
", mm" ,
"HT Fraction", profile_msize,profile_mcolor,profile_mstyle);
186 hists.pHTFracStrawZCO =
trtBookHistoLW(hl_monGroup_shift,
"pHTFracStraw"+ZRn+
"GinOuter",
"HT Fraction per Track vs. "+ZRt+
" along the straw in "+
name+
" (Gas in Outer End)" ,
m_nZRBins, ZRMin, ZRMax , 0, 1 , profile_x_label_size, profile_y_label_size, ZRt+
", mm" ,
"HT Fraction", profile_msize,profile_mcolor,profile_mstyle);
189 hists.pHTFracGammaEl =
trtBookHistoLW(hl_monGroup_shift,
"pHTFracGammaEl" ,
"HT Fraction per e Candidate vs. Lorentz Gamma Factor in "+
name ,
NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size,
"Log10(Lorentz Gamma)" ,
"HT Fraction", profile_msize,profile_mcolor,profile_mstyle);
192 hists.pHTFracGammaMu =
trtBookHistoLW(hl_monGroup_shift,
"pHTFracGammaMu" ,
"HT Fraction per #mu Candidate vs. Lorentz Gamma Factor in "+
name ,
NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size,
"Log10(Lorentz Gamma)" ,
"HT Fraction", profile_msize,profile_mcolor,profile_mstyle);
195 hists.pHTFracGammaPi =
trtBookHistoLW(hl_monGroup_shift,
"pHTFracGammaPi" ,
"HT Fraction per #pi Candidate vs. Lorentz Gamma Factor in "+
name ,
NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size,
"Log10(Lorentz Gamma)" ,
"HT Fraction", profile_msize,profile_mcolor,profile_mstyle);
198 hists.pHTFracGammaAll =
trtBookHistoLW(hl_monGroup_shift,
"pHTFracGammaAll" ,
"HT Fraction per Candidate vs. Lorentz Gamma Factor in "+
name ,
NGAMMABINS, 0, 5 , 0, 1, profile_x_label_size, profile_y_label_size,
"Log10(Lorentz Gamma)" ,
"HT Fraction", profile_msize,profile_mcolor,profile_mstyle);
211 hists.hNCand =
trtBookHistoLW(
monGroup,
"hNCand"+
name ,
"Number of "+
name+
" Candidates per Event" , 150 , 0, 150 , profile_x_label_size, profile_y_label_size,
"Number of "+
name+
" Candidates",
"Frequency");
212 hists.hPIDProb =
trtBookHistoLW(
monGroup,
"hPIDProb"+
name ,
"PID Likelihood per "+
name+
" Candidate" , 50 , 0, 1 , profile_x_label_size, profile_y_label_size,
"PID Likelihood",
"Frequency");
213 hists.pPIDProbEta =
trtBookHistoLW(
monGroup,
"pPIDProbEta"+
name ,
"PID Likelihood per "+
name+
" Candidate vs. Eta" ,
m_nEtaBins, -2, 2 , 0, 1 , profile_x_label_size, profile_y_label_size,
"Eta",
"PID Likelihood", profile_msize,profile_mcolor,profile_mstyle);
214 hists.hHTFrac =
trtBookHistoLW(
monGroup,
"hHTFrac"+
name ,
"HT Fraction per "+
name+
" Candidate" , 50 , 0, 1 , profile_x_label_size, profile_y_label_size,
"HT Fraction",
"Frequency");
215 hists.pHTFracEta =
trtBookHistoLW(
monGroup,
"pHTFracEta"+
name ,
"HT Fraction per "+
name+
" Candidate vs. Eta" ,
m_nEtaBins, -2, 2 , 0, 1 , profile_x_label_size, profile_y_label_size,
"Eta",
"HTFraction", profile_msize,profile_mcolor,profile_mstyle);
232 std::vector<const Trk::Track*> v_usedTrks;
246 return StatusCode::SUCCESS;
265 const std::vector< ElementLink< xAOD::TrackParticleContainer > > tpLinks = conv_elem->trackParticleLinks();
267 for(
const auto& tp_elem : tpLinks ){
269 if(!trkTag)
continue;
271 v_usedTrks.push_back( trkTag->
track() );
278 if (
vertex->nTrackParticles() != 2)
continue;
279 if(
chi2 >= 5 )
continue;
280 if(
r <= 40 )
continue;
282 if(!trkProbe)
continue;
290 else ATH_MSG_DEBUG(
"Conv: fillStructHistograms succeeded!" );
294 else ATH_MSG_WARNING(
"Could not retrieve vertex container this event" );
308 if(not p_Electron)
continue;
313 const bool matched = (
std::find(v_usedTrks.begin(), v_usedTrks.end(), trk) != v_usedTrks.end());
315 v_usedTrks.push_back( trk );
324 else ATH_MSG_WARNING(
"Could not retrieve electron container this event" );
338 if(!(p_Muon))
continue;
340 const xAOD::TrackParticle* trkP = p_Muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
343 v_usedTrks.push_back( trk );
352 else ATH_MSG_WARNING(
"Could not retrieve muon container this event" );
376 else ATH_MSG_WARNING(
"Could not retrieve track container this event" );
387 if (perigeeTag) chargeTag =
int(perigeeTag->charge());
395 if (perigeeProbe) chargeProbe =
int(perigeeProbe->charge());
401 if(chargeTag!=-1*chargeProbe)
return false;
402 int nPix, nSCT, nTRT, nHT, nTRTOut, nHTOut;
412 HTRatioOut = nTRT+nTRTOut>0 ?
double(nHT+nHTOut)/
double(nTRT+nTRTOut) : 0;
414 if(nTRT+nTRTOut <= 19)
return false;
415 if(HTRatioOut <= 0.12)
return false;
425 if(nTRT+nTRTOut <= 19)
return false;
445 if(!
muon)
return false;
447 if(!trkM)
return false;
451 if(nTRT+nTRTOut <= 0)
return false;
458 if (
std::find(v_usedTrks.begin(), v_usedTrks.end(), trkP->
track()) != v_usedTrks.end())
return false;
470 if(dEdX >= 1.6 )
return false;
482 double phi(-999),
eta(-999);
486 phi = perigee->momentum().phi()*180/
M_PI;
488 eta = perigee->momentum().eta();
497 CLHEP::HepLorentzVector hlv;
498 hlv.setVectM( CLHEP::Hep3Vector(perigee->momentum().x(),perigee->momentum().y(),perigee->momentum().z() ),
mass);
499 if(hlv.isSpacelike())
501 ATH_MSG_DEBUG(
"Track has Spacelike Lorentz Vector!! Skipping..." );
505 if(hlv.isLightlike(1
e-12))
507 ATH_MSG_DEBUG(
"Track has Lightlike Lorentz Vector!! Skipping..." );
510 gamma = std::log10(hlv.gamma());
513 int nLLHits[4]={0,0,0,0};
514 int nHLHits[4]={0,0,0,0};
523 for(;TSOSItBegin!=TSOSItEnd; ++TSOSItBegin)
525 if((*TSOSItBegin)==
nullptr)
continue;
530 if(!trtCircle || !aTrackParam)
continue;
535 if(barrel_ec<0)
continue;
543 float zr = barrel_ec<2 ? TRThitZ : sqrt(
pow(TRThitX,2)+
pow(TRThitY,2));
546 bool inCorOuter =
isGasInCorOuter(barrel_ec,phi_or_plane,layer_or_wheel);
547 if(RawDriftCircle && !isTubeHit)
549 bool highL = RawDriftCircle->
highLevel();
556 if(
mass==0){
switch (barrel_ec){
600 if(!myGeoHists)
continue;
603 pHTFracGamma = myGeoHists->pHTFracGammaEl;
606 pHTFracGamma = myGeoHists->pHTFracGammaMu;
609 pHTFracGamma = myGeoHists->pHTFracGammaPi;
620 if(pHTFracTrackPhi) pHTFracTrackPhi->Fill(
phi,1);
621 if(pHTFracStrawZR) pHTFracStrawZR ->Fill(zr ,1);
622 if(pHTFracStrawZAI && !inCorOuter) pHTFracStrawZAI ->Fill(zr ,1);
623 if(pHTFracStrawZCO && inCorOuter) pHTFracStrawZCO ->Fill(zr ,1);
626 if(pHTFracGamma) pHTFracGamma->Fill(
gamma,1);
627 myGeoHists->pHTFracGammaAll->Fill(
gamma,1);
629 nHLHits[barrel_ec]++;
634 if(pHTFracTrackPhi) pHTFracTrackPhi->Fill(
phi,0);
635 if(pHTFracStrawZR) pHTFracStrawZR ->Fill(zr ,0);
636 if(pHTFracStrawZAI && !inCorOuter) pHTFracStrawZAI ->Fill(zr ,0);
637 if(pHTFracStrawZCO && inCorOuter) pHTFracStrawZCO ->Fill(zr ,0);
640 if(pHTFracGamma) pHTFracGamma->Fill(
gamma,0);
641 myGeoHists->pHTFracGammaAll->Fill(
gamma,0);
643 nLLHits[barrel_ec]++;
650 if(
mass==0)
for(
int i=0;
i<4;
i++){
666 if(!myGeoHists)
continue;
669 myGeoHists->hHTFracTrack->Fill(
float(nHLHits[
i])/
float(nLLHits[
i]));
700 if(hPIDProb) hPIDProb ->Fill(HTProb);
701 if(pPIDProbEta) pPIDProbEta ->Fill(
eta,HTProb);
702 if(hHTFrac && nTRTHits>0) hHTFrac ->Fill(
float(nTRTHTHits)/
float(nTRTHits));
703 if(pHTFracEta && nTRTHits>0) pHTFracEta ->Fill(
eta,
float(nTRTHTHits)/
float(nTRTHits));
713 if(
det>1)
return (phi_plane%8)<4;
717 if(module_wheel==2)
return phi_plane%2==0;
719 return ((phi_plane - module_wheel*2)%8)<4;
726 return StatusCode::SUCCESS;
734 const std::string& hName,
735 const std::string& hTitle,
741 const std::string& xTitle,
742 const std::string& yTitle)
746 hist->GetXaxis()->SetLabelSize(x_labelSize);
747 hist->GetYaxis()->SetLabelSize(y_labelSize);
748 hist->GetXaxis()->SetTitle(xTitle.c_str());
749 hist->GetYaxis()->SetTitle(yTitle.c_str());
761 const std::string& hName,
762 const std::string& hTitle,
770 const std::string& xTitle,
771 const std::string& yTitle,
779 hist->SetMarkerStyle(mstyle);
780 hist->SetMarkerColor(mcolor);
781 hist->GetXaxis()->SetLabelSize(x_labelSize);
782 hist->GetYaxis()->SetLabelSize(y_labelSize);
783 hist->GetXaxis()->SetTitle(xTitle.c_str());
784 hist->GetYaxis()->SetTitle(yTitle.c_str());
790 const std::string& hName,
791 const std::string& hTitle,
800 const std::string& xTitle,
801 const std::string& yTitle)
805 hist->GetXaxis()->SetLabelSize(x_labelSize);
806 hist->GetYaxis()->SetLabelSize(y_labelSize);
807 hist->GetXaxis()->SetTitle(xTitle.c_str());
808 hist->GetYaxis()->SetTitle(yTitle.c_str());