11 #include "TEfficiency.h"
13 const float GeV = 1000.;
18 :
EL::AnaAlgorithm(
name, svcLoc ) {}
31 std::vector<std::string> recoTypes{
"All",
"Matched",
"Merged",
"Fake",
"Split",
"Other"};
32 std::vector<std::string> truthTypes{
"Inclusive",
"Reconstructable",
"Accepted",
"Seeded",
"Reconstructed",
"ReconstructedSplit"};
34 std::vector<std::string> smOriginTypes;
36 smOriginTypes = {
"FakeOrigin",
"Pileup",
"KshortDecay",
"StrangeMesonDecay",
"LambdaDecay",
37 "StrangeBaryonDecay",
"TauDecay",
"GammaConversion",
"OtherDecay",
38 "HadronicInteraction",
"OtherSecondary",
"BHadronDecay",
"DHadronDecay",
39 "Fragmentation",
"OtherOrigin",
"Signal"};
46 float maxZ =
m_doMuSA ? 10000 : 1500;
47 float maxLxy =
m_doMuSA ? 8000 : 500;
51 float maxTrackd0 =
m_doMuSA ? 3000 : 300;
52 float maxTrackz0 =
m_doMuSA ? 5000 : 500;
53 float maxErrd0 =
m_doMuSA ? 300 : 30;
54 float maxErrz0 =
m_doMuSA ? 500 : 50;
56 float maxResR =
m_doMuSA ? 2000 : 20;
57 float maxResZ =
m_doMuSA ? 2000 : 20;
59 ANA_CHECK (
book(
TH1F(
"RecoVertex/matchType",
"Vertex Match Type", 65, -0.5, 64.5)));
61 ANA_CHECK (
book(
TH1F(
"RecoVertex/smOriginType",
"Vertex SM Origin Type", 65537, -0.5, 65536.5)));
65 for(
const auto& recoType : recoTypes) {
66 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_x").c_str(),
"Reco vertex x [mm]", 1000, -maxX, maxX)));
67 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_y").c_str(),
"Reco vertex y [mm]", 1000, -maxY, maxY)));
68 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_z").c_str(),
"Reco vertex z [mm]", 1000, -maxZ, maxZ)));
69 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Lxy").c_str(),
"Reco vertex L_{xy} [mm]", 500, 0, maxLxy)));
70 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_pT").c_str(),
"Reco vertex p_{T} [GeV]", 100, 0, 100)));
71 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_eta").c_str(),
"Reco vertex #eta", 100, -5, 5)));
72 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_phi").c_str(),
"Reco vertex #phi", 100, -TMath::Pi(), TMath::Pi())));
73 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_mass").c_str(),
"Reco vertex mass [GeV]", 500, 0, 100)));
74 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_mu").c_str(),
"Reco vertex Red. Mass [GeV]", 500, 0, 100)));
75 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_chi2").c_str(),
"Reco vertex recoChi2", 100, 0, 10)));
76 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_dir").c_str(),
"Reco vertex recoDirection", 100, -1, 1)));
77 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_charge").c_str(),
"Reco vertex recoCharge", 20, -10, 10)));
78 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_H").c_str(),
"Reco vertex H [GeV]", 100, 0, 100)));
79 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_HT").c_str(),
"Reco vertex Mass [GeV]", 100, 0, 100)));
80 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_minOpAng").c_str(),
"Reco vertex minOpAng", 100, -1, 1)));
81 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_maxOpAng").c_str(),
"Reco vertex maxOpAng", 100, -1, 1)));
82 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_maxdR").c_str(),
"Reco vertex maxDR", 100, 0, 10)));
83 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_mind0").c_str(),
"Reco vertex min d0 [mm]", 100, 0, mind0)));
84 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_maxd0").c_str(),
"Reco vertex max d0 [mm]", 100, 0, maxd0)));
85 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_ntrk").c_str(),
"Reco vertex n tracks", 30, 0, 30)));
88 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_qOverP").c_str(),
"Reco track qOverP ", 100, 0, .01)));
89 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_theta").c_str(),
"Reco track theta ", 64, 0, 3.2)));
90 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_E").c_str(),
"Reco track E ", 100, 0, 100)));
91 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_M").c_str(),
"Reco track M ", 100, 0, 10)));
92 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_Pt").c_str(),
"Reco track Pt ", 100, 0, 100)));
93 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_Px").c_str(),
"Reco track Px ", 100, 0, 100)));
94 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_Py").c_str(),
"Reco track Py ", 100, 0, 100)));
95 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_Pz").c_str(),
"Reco track Pz ", 100, 0, 100)));
96 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_Eta").c_str(),
"Reco track Eta ", 100, -5, 5)));
97 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_Phi").c_str(),
"Reco track Phi ", 63, -3.2, 3.2)));
98 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_D0").c_str(),
"Reco track D0 ", 300, -maxTrackd0, maxTrackd0)));
99 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_Z0").c_str(),
"Reco track Z0 ", 500, -maxTrackz0, maxTrackz0)));
100 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_errD0").c_str(),
"Reco track errD0 ", 300, 0, maxErrd0)));
101 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_errZ0").c_str(),
"Reco track errZ0 ", 500, 0, maxErrz0)));
102 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_Chi2").c_str(),
"Reco track Chi2 ", 100, 0, 10)));
103 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_nDoF").c_str(),
"Reco track nDoF ", 100, 0, 100)));
104 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_Trk_charge").c_str(),
"Reco track charge ", 3, -1.5, 1.5)));
107 if ( recoType !=
"All" and recoType !=
"Fake" ) {
108 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_positionRes_R").c_str(),
"Position resolution for vertices matched to truth decays", 400, -maxResR, maxResR)));
109 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_positionRes_Z").c_str(),
"Position resolution for vertices matched to truth decays", 400, -maxResZ, maxResZ)));
110 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_matchScore_weight").c_str(),
"Vertex Match Score (weight)", 101, 0, 1.01)));
111 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_matchScore_pt").c_str(),
"Vertex Match Score (pT)", 101, 0, 1.01)));
112 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + recoType +
"_matchedTruthID").c_str(),
"Vertex Truth Match ID", 100, 0, 100)));
118 for(
const auto& smOriginType : smOriginTypes) {
119 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_x").c_str(),
"Reco vertex x [mm]", 1000, -maxX, maxX)));
120 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_y").c_str(),
"Reco vertex y [mm]", 1000, -maxY, maxY)));
121 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_z").c_str(),
"Reco vertex z [mm]", 1000, -maxZ, maxZ)));
122 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Lxy").c_str(),
"Reco vertex L_{xy} [mm]", 500, 0, maxLxy)));
123 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_pT").c_str(),
"Reco vertex p_{T} [GeV]", 100, 0, 100)));
124 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_eta").c_str(),
"Reco vertex #eta", 100, -5, 5)));
125 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_phi").c_str(),
"Reco vertex #phi", 100, -TMath::Pi(), TMath::Pi())));
126 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_mass").c_str(),
"Reco vertex mass [GeV]", 500, 0, 100)));
127 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_mu").c_str(),
"Reco vertex Red. Mass [GeV]", 500, 0, 100)));
128 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_chi2").c_str(),
"Reco vertex recoChi2", 100, 0, 10)));
129 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_dir").c_str(),
"Reco vertex recoDirection", 100, -1, 1)));
130 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_charge").c_str(),
"Reco vertex recoCharge", 20, -10, 10)));
131 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_H").c_str(),
"Reco vertex H [GeV]", 100, 0, 100)));
132 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_HT").c_str(),
"Reco vertex Mass [GeV]", 100, 0, 100)));
133 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_minOpAng").c_str(),
"Reco vertex minOpAng", 100, -1, 1)));
134 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_maxOpAng").c_str(),
"Reco vertex maxOpAng", 100, -1, 1)));
135 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_maxdR").c_str(),
"Reco vertex maxDR", 100, 0, 10)));
136 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_mind0").c_str(),
"Reco vertex min d0 [mm]", 100, 0, mind0)));
137 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_maxd0").c_str(),
"Reco vertex max d0 [mm]", 100, 0, maxd0)));
138 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_ntrk").c_str(),
"Reco vertex n tracks", 30, 0, 30)));
141 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_qOverP").c_str(),
"Reco track qOverP ", 100, 0, .01)));
142 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_theta").c_str(),
"Reco track theta ", 64, 0, 3.2)));
143 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_E").c_str(),
"Reco track E ", 100, 0, 100)));
144 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_M").c_str(),
"Reco track M ", 100, 0, 10)));
145 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_Pt").c_str(),
"Reco track Pt ", 100, 0, 100)));
146 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_Px").c_str(),
"Reco track Px ", 100, 0, 100)));
147 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_Py").c_str(),
"Reco track Py ", 100, 0, 100)));
148 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_Pz").c_str(),
"Reco track Pz ", 100, 0, 100)));
149 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_Eta").c_str(),
"Reco track Eta ", 100, -5, 5)));
150 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_Phi").c_str(),
"Reco track Phi ", 63, -3.2, 3.2)));
151 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_D0").c_str(),
"Reco track D0 ", 300, -maxTrackd0, maxTrackd0)));
152 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_Z0").c_str(),
"Reco track Z0 ", 500, -maxTrackz0, maxTrackz0)));
153 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_errD0").c_str(),
"Reco track errD0 ", 300, 0, maxErrd0)));
154 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_errZ0").c_str(),
"Reco track errZ0 ", 500, 0, maxErrz0)));
155 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_Chi2").c_str(),
"Reco track Chi2 ", 100, 0, 10)));
156 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_nDoF").c_str(),
"Reco track nDoF ", 100, 0, 100)));
157 ANA_CHECK (
book(
TH1F((
"RecoVertex/" + smOriginType +
"_Trk_charge").c_str(),
"Reco track charge ", 3, -1.5, 1.5)));
164 for(
const auto&
truthType : truthTypes) {
179 ANA_CHECK (
book(
TH1F((
"TruthVertex/" +
truthType +
"_ParentProdX").c_str(),
"truthParentProd vertex x [mm]", 500, -500, 500)));
180 ANA_CHECK (
book(
TH1F((
"TruthVertex/" +
truthType +
"_ParentProdY").c_str(),
"truthParentProd vertex y [mm]", 500, -500, 500)));
181 ANA_CHECK (
book(
TH1F((
"TruthVertex/" +
truthType +
"_ParentProdZ").c_str(),
"truthParentProd vertex z [mm]", 500, -500, 500)));
183 ANA_CHECK (
book(
TH1F((
"TruthVertex/" +
truthType +
"_ParentProddistFromPV").c_str(),
"truthParentProd vertex distFromPV [mm]", 500, 0, 500)));
189 Double_t standard_bins[] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 100, 125, 150, 200, 300, 500};
190 Double_t muSA_bins[] = {0.0, 1, 5, 10, 20, 50, 100, 200, 300, 500, 750, 1000, 1500, 2000, 2500, 3000, 4000, 5000, 6000, 7000, 8000};
194 size_t nbins =
m_doMuSA ?
sizeof(muSA_bins)/
sizeof(muSA_bins[0])-1 :
sizeof(standard_bins)/
sizeof(standard_bins[0])-1;
204 return StatusCode::SUCCESS;
214 std::vector<const xAOD::Vertex*> recoVerticesToMatch;
215 std::vector<const xAOD::TruthVertex*> truthVerticesToMatch;
217 for(
const auto recoVertex : *recoVertexContainer) {
224 recoVerticesToMatch.push_back(recoVertex);
227 for(
const auto truthVertex : *truthVertexContainer) {
228 if(truthVertex->nIncomingParticles() != 1) {
238 if(truthVertex->nOutgoingParticles() < 2) {
241 truthVerticesToMatch.push_back(truthVertex);
245 ATH_CHECK(
m_matchTool->matchVertices( recoVerticesToMatch, truthVerticesToMatch, trackParticleContainer.
cptr() ) );
249 for(
const auto& secVtx : recoVerticesToMatch) {
250 int matchTypeBitset = matchTypeDecor(*secVtx);
251 hist(
"RecoVertex/matchType")->Fill(matchTypeBitset);
272 for(
const auto& truthVtx : truthVerticesToMatch) {
273 int truthTypeBitset = truthTypeDecor(*truthVtx);
301 static const std::map<InDetSecVtxTruthMatchUtils::VertexMatchOriginType, std::string> originTypeMap = {
320 for(
const auto& secVtx : recoVerticesToMatch) {
321 int smOriginTypeBitset = originTypeDecor(*secVtx);
322 hist(
"RecoVertex/smOriginType")->Fill(smOriginTypeBitset);
324 for(
const auto&
entry : originTypeMap) {
334 return StatusCode::SUCCESS;
346 TVector3 reco_pos(secVtx->
x(), secVtx->
y(), secVtx->
z());
347 float Lxy = reco_pos.Perp();
351 ntracks = trkParts.size();
353 TLorentzVector sumP4(0,0,0,0);
357 double minOpAng = -1.0* 1.e10;
358 double maxOpAng = 1.0* 1.e10;
359 double minD0 = 1.0* 1.e10;
366 for(
size_t t = 0;
t < ntracks;
t++){
376 if(trk_d0 < minD0){ minD0 = trk_d0; }
377 if(trk_d0 > maxD0){ maxD0 = trk_d0; }
381 vv.SetPtEtaPhiM(trk.
pt(),trk.
eta(), trk.
phi0(), trk.
m());
383 H +=
vv.Vect().Mag();
386 TLorentzVector v_minus_iv(0,0,0,0);
387 for(
size_t j = 0; j < ntracks; j++){
388 if (j ==
t){
continue; }
398 tmp.SetPtEtaPhiM(trk_2.
pt(),trk_2.
eta(), trk_2.
phi0(), trk_2.
m());
402 double tm =
vv *
tmp / (
vv.Mag() *
tmp.Mag() );
403 if( minOpAng < tm ) minOpAng = tm;
404 if( maxOpAng > tm ) maxOpAng = tm;
407 double DR =
vv.DeltaR(v_minus_iv);
408 if( DR > maxDR ){ maxDR = DR;}
416 hist(
"RecoVertex/" + matchType +
"_Trk_Chi2")->Fill(Trk_Chi2(trk) / Trk_nDoF(trk));
417 hist(
"RecoVertex/" + matchType +
"_Trk_nDoF")->Fill(Trk_nDoF(trk));
419 hist(
"RecoVertex/" + matchType +
"_Trk_D0")->Fill(trk_d0);
420 hist(
"RecoVertex/" + matchType +
"_Trk_Z0")->Fill(trk_z0);
423 hist(
"RecoVertex/" + matchType +
"_Trk_Eta")->Fill(trk.
eta());
424 hist(
"RecoVertex/" + matchType +
"_Trk_Phi")->Fill(trk.
phi0());
425 hist(
"RecoVertex/" + matchType +
"_Trk_E")->Fill(trk.
e() /
GeV);
426 hist(
"RecoVertex/" + matchType +
"_Trk_M")->Fill(trk.
m() /
GeV);
427 hist(
"RecoVertex/" + matchType +
"_Trk_Pt")->Fill(trk.
pt() /
GeV);
428 hist(
"RecoVertex/" + matchType +
"_Trk_Px")->Fill(trk.
p4().Px() /
GeV);
429 hist(
"RecoVertex/" + matchType +
"_Trk_Py")->Fill(trk.
p4().Py() /
GeV);
430 hist(
"RecoVertex/" + matchType +
"_Trk_Pz")->Fill(trk.
p4().Pz() /
GeV);
431 hist(
"RecoVertex/" + matchType +
"_Trk_charge")->Fill(trk.
charge());
437 const double dir = sumP4.Vect().Dot( reco_pos ) / sumP4.Vect().Mag() / reco_pos.Mag();
442 hist(
"RecoVertex/" + matchType +
"_x")->Fill(secVtx->
x());
443 hist(
"RecoVertex/" + matchType +
"_y")->Fill(secVtx->
y());
444 hist(
"RecoVertex/" + matchType +
"_z")->Fill(secVtx->
z());
445 hist(
"RecoVertex/" + matchType +
"_Lxy")->Fill(Lxy);
446 hist(
"RecoVertex/" + matchType +
"_ntrk")->Fill(ntracks);
447 hist(
"RecoVertex/" + matchType +
"_pT")->Fill(sumP4.Pt() /
GeV);
448 hist(
"RecoVertex/" + matchType +
"_eta")->Fill(sumP4.Eta());
449 hist(
"RecoVertex/" + matchType +
"_phi")->Fill(sumP4.Phi());
450 hist(
"RecoVertex/" + matchType +
"_mass")->Fill(sumP4.M() /
GeV);
451 hist(
"RecoVertex/" + matchType +
"_mu")->Fill(sumP4.M()/maxDR /
GeV);
452 hist(
"RecoVertex/" + matchType +
"_chi2")->Fill(Chi2(*secVtx)/nDoF(*secVtx));
453 hist(
"RecoVertex/" + matchType +
"_dir")->Fill(
dir);
454 hist(
"RecoVertex/" + matchType +
"_charge")->Fill(
charge);
455 hist(
"RecoVertex/" + matchType +
"_H")->Fill(
H /
GeV);
456 hist(
"RecoVertex/" + matchType +
"_HT")->Fill(HT /
GeV);
457 hist(
"RecoVertex/" + matchType +
"_minOpAng")->Fill(minOpAng);
458 hist(
"RecoVertex/" + matchType +
"_maxOpAng")->Fill(maxOpAng);
459 hist(
"RecoVertex/" + matchType +
"_mind0")->Fill(minD0);
460 hist(
"RecoVertex/" + matchType +
"_maxd0")->Fill(maxD0);
461 hist(
"RecoVertex/" + matchType +
"_maxdR")->Fill(maxDR);
463 std::vector<InDetSecVtxTruthMatchUtils::VertexTruthMatchInfo> truthmatchinfo;
464 truthmatchinfo = matchInfoDecor(*secVtx);
467 if (matchType !=
"All" and matchType !=
"Fake") {
468 if(not truthmatchinfo.empty()){
469 float matchScore_weight = std::get<1>(truthmatchinfo.at(0));
470 float matchScore_pt = std::get<2>(truthmatchinfo.at(0));
472 ATH_MSG_DEBUG(
"Match Score and probability: " << matchScore_weight <<
" " << matchScore_pt/0.01);
477 hist(
"RecoVertex/" + matchType +
"_positionRes_R")->Fill(Lxy - truthVtx.
perp());
478 hist(
"RecoVertex/" + matchType +
"_positionRes_Z")->Fill(secVtx->
z() - truthVtx.
z());
479 hist(
"RecoVertex/" + matchType +
"_matchScore_weight")->Fill(matchScore_weight);
480 hist(
"RecoVertex/" + matchType +
"_matchScore_pt")->Fill(matchScore_pt);
542 TVector3 reco_pos(secVtx->
x(), secVtx->
y(), secVtx->
z());
543 float Lxy = reco_pos.Perp();
547 ntracks = trkParts.size();
549 TLorentzVector sumP4(0,0,0,0);
553 double minOpAng = -1.0* 1.e10;
554 double maxOpAng = 1.0* 1.e10;
555 double minD0 = 1.0* 1.e10;
562 for(
size_t t = 0;
t < ntracks;
t++){
571 if(trk_d0 < minD0){ minD0 = trk_d0; }
572 if(trk_d0 > maxD0){ maxD0 = trk_d0; }
575 vv.SetPtEtaPhiM(trk.
pt(), trk.
eta(), trk.
phi0(), trk.
m());
577 H +=
vv.Vect().Mag();
580 TLorentzVector v_minus_iv(0,0,0,0);
581 for(
size_t j = 0; j < ntracks; j++){
582 if (j ==
t){
continue; }
590 tmp.SetPtEtaPhiM(trk_2.
pt(), trk_2.
eta(), trk_2.
phi0(), trk_2.
m());
594 double tm =
vv *
tmp / (
vv.Mag() *
tmp.Mag() );
595 if( minOpAng < tm ) minOpAng = tm;
596 if( maxOpAng > tm ) maxOpAng = tm;
599 double DR =
vv.DeltaR(v_minus_iv);
600 if( DR > maxDR ){ maxDR = DR;}
609 hist(
"RecoVertex/" + originType +
"_Trk_Chi2")->Fill(Trk_Chi2(trk) / Trk_nDoF(trk));
610 hist(
"RecoVertex/" + originType +
"_Trk_nDoF")->Fill(Trk_nDoF(trk));
612 hist(
"RecoVertex/" + originType +
"_Trk_D0")->Fill(trk_d0);
613 hist(
"RecoVertex/" + originType +
"_Trk_Z0")->Fill(trk_z0);
616 hist(
"RecoVertex/" + originType +
"_Trk_Eta")->Fill(trk.
eta());
617 hist(
"RecoVertex/" + originType +
"_Trk_Phi")->Fill(trk.
phi0());
618 hist(
"RecoVertex/" + originType +
"_Trk_E")->Fill(trk.
e() /
GeV);
619 hist(
"RecoVertex/" + originType +
"_Trk_M")->Fill(trk.
m() /
GeV);
620 hist(
"RecoVertex/" + originType +
"_Trk_Pt")->Fill(trk.
pt() /
GeV);
621 hist(
"RecoVertex/" + originType +
"_Trk_Px")->Fill(trk.
p4().Px() /
GeV);
622 hist(
"RecoVertex/" + originType +
"_Trk_Py")->Fill(trk.
p4().Py() /
GeV);
623 hist(
"RecoVertex/" + originType +
"_Trk_Pz")->Fill(trk.
p4().Pz() /
GeV);
624 hist(
"RecoVertex/" + originType +
"_Trk_charge")->Fill(trk.
charge());
629 const double dir = sumP4.Vect().Dot( reco_pos ) / sumP4.Vect().Mag() / reco_pos.Mag();
635 hist(
"RecoVertex/" + originType +
"_x")->Fill(secVtx->
x());
636 hist(
"RecoVertex/" + originType +
"_y")->Fill(secVtx->
y());
637 hist(
"RecoVertex/" + originType +
"_z")->Fill(secVtx->
z());
638 hist(
"RecoVertex/" + originType +
"_Lxy")->Fill(Lxy);
639 hist(
"RecoVertex/" + originType +
"_ntrk")->Fill(ntracks);
640 hist(
"RecoVertex/" + originType +
"_pT")->Fill(sumP4.Pt() /
GeV);
641 hist(
"RecoVertex/" + originType +
"_eta")->Fill(sumP4.Eta());
642 hist(
"RecoVertex/" + originType +
"_phi")->Fill(sumP4.Phi());
643 hist(
"RecoVertex/" + originType +
"_mass")->Fill(sumP4.M() /
GeV);
644 hist(
"RecoVertex/" + originType +
"_mu")->Fill(sumP4.M()/maxDR /
GeV);
645 hist(
"RecoVertex/" + originType +
"_chi2")->Fill(Chi2(*secVtx)/nDoF(*secVtx));
646 hist(
"RecoVertex/" + originType +
"_dir")->Fill(
dir);
647 hist(
"RecoVertex/" + originType +
"_charge")->Fill(
charge);
648 hist(
"RecoVertex/" + originType +
"_H")->Fill(
H /
GeV);
649 hist(
"RecoVertex/" + originType +
"_HT")->Fill(HT /
GeV);
650 hist(
"RecoVertex/" + originType +
"_minOpAng")->Fill(minOpAng);
651 hist(
"RecoVertex/" + originType +
"_maxOpAng")->Fill(maxOpAng);
652 hist(
"RecoVertex/" + originType +
"_mind0")->Fill(minD0);
653 hist(
"RecoVertex/" + originType +
"_maxd0")->Fill(maxD0);
654 hist(
"RecoVertex/" + originType +
"_maxdR")->Fill(maxDR);