22 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
28 #include "AliHLTTPCCADisplay.h"
30 #include "AliHLTTPCCATracker.h"
31 #include "AliHLTTPCCAPerformance.h"
37 #include "TParticlePDG.h"
38 #include "TDatabasePDG.h"
45 #include "TProfile2D.h"
52 KFTopoPerformance::KFTopoPerformance():KFParticlePerformanceBase(),fTopoReconstructor(0),fPrimVertices(0), fMCTrackToMCPVMatch(0),
53 fPVPurity(0), fNCorrectPVTracks(0), fTrackMatch(0), vMCTracks(0), vMCParticles(0), fNeutralIndex(0), MCtoRParticleId(0), RtoMCParticleId(0),
54 MCtoRPVId(0), RtoMCPVId(0), fPrintEffFrequency(1), fCentralityBin(-1), fCentralityWeight(0.
f)
58 KFTopoPerformance::~KFTopoPerformance()
63 void KFTopoPerformance::SetNewEvent(
64 const AliHLTTPCCAGBTracker *
const tracker,
65 AliHLTResizableArray<AliHLTTPCCAHitLabel> *hitLabels,
66 AliHLTResizableArray<AliHLTTPCCAMCTrack> *mcTracks,
67 AliHLTResizableArray<AliHLTTPCCALocalMCPoint> *localMCPoints)
69 vMCTracks.resize(mcTracks->Size());
70 for(
int iTr=0; iTr<vMCTracks.size(); iTr++)
72 for(
int iP=0; iP<3; iP++)
73 vMCTracks[iTr].SetPar(iP, (*mcTracks)[iTr].Par(iP));
74 for(
int iP=3; iP<6; iP++)
75 vMCTracks[iTr].SetPar(iP, (*mcTracks)[iTr].Par(iP) * (*mcTracks)[iTr].P());
76 vMCTracks[iTr].SetPar(6, (*mcTracks)[iTr].Par(6));
78 vMCTracks[iTr].SetPDG( (*mcTracks)[iTr].
PDG() );
79 vMCTracks[iTr].SetMotherId( (*mcTracks)[iTr].MotherId() );
80 vMCTracks[iTr].SetNMCPoints( (*mcTracks)[iTr].NMCPoints() );
88 fTopoReconstructor = TopoReconstructor;
91 void KFTopoPerformance::CheckMCTracks()
94 fMCTrackToMCPVMatch.clear();
95 fPrimVertices.clear();
98 if (vMCTracks.size() <= 0)
return;
100 fMCTrackToMCPVMatch.resize(vMCTracks.size(),-1);
103 for(
unsigned int iTr=0; iTr<vMCTracks.size(); iTr++)
110 for(
unsigned int iPV=0; iPV<pvIndex.size(); iPV++)
112 if(motherID == pvIndex[iPV])
114 fPrimVertices[iPV].AddDaughterTrack(iTr);
115 fMCTrackToMCPVMatch[iTr] = iPV;
122 primVertex.
SetX( mctr.
X() );
123 primVertex.
SetY( mctr.
Y() );
124 primVertex.
SetZ( mctr.
Z() );
128 fPrimVertices.push_back(primVertex);
129 fMCTrackToMCPVMatch[iTr] = pvIndex.size();
130 pvIndex.push_back(motherID);
136 void KFTopoPerformance::GetMCParticles()
140 vMCParticles.clear();
141 vMCParticles.reserve(vMCTracks.size());
143 for(
unsigned int iMC=0; iMC < vMCTracks.size(); iMC++)
150 vMCParticles.push_back( part );
153 const int nMCParticles = vMCParticles.size();
154 for (
int iP = 0; iP < nMCParticles; iP++ ) {
157 if(motherId < 0)
continue;
158 if(motherId >= nMCParticles)
160 std::cout <<
"ERROR!!!!! KF Particle Performance: MC track mother Id is out of range." << std::endl;
167 fNeutralIndex.clear();
168 fNeutralIndex.resize(nMCParticles, -1);
170 for(
unsigned int iMC=0; iMC < vMCParticles.size(); iMC++)
176 const int NmmPDG = 7;
177 vector<int> mmMotherPDG(NmmPDG);
178 vector<int> mmChargedDaughterPDG(NmmPDG);
179 vector<int> mmNeutralDaughterPDG(NmmPDG);
180 vector<int> newMotherPDG(NmmPDG);
181 vector<int> newNeutralPDG(NmmPDG);
183 mmMotherPDG[ 0] = 3112; mmChargedDaughterPDG[ 0] = 211; mmNeutralDaughterPDG[ 0] = 2112;
184 mmMotherPDG[ 1] = 3222; mmChargedDaughterPDG[ 1] = 211; mmNeutralDaughterPDG[ 1] = 2112;
185 mmMotherPDG[ 2] = 3312; mmChargedDaughterPDG[ 2] = 211; mmNeutralDaughterPDG[ 2] = 3122;
186 mmMotherPDG[ 3] = 3334; mmChargedDaughterPDG[ 3] = 211; mmNeutralDaughterPDG[ 3] = 3322;
187 mmMotherPDG[ 4] = 321; mmChargedDaughterPDG[ 4] = 211; mmNeutralDaughterPDG[ 4] = 111;
188 mmMotherPDG[ 5] = 3334; mmChargedDaughterPDG[ 5] = 321; mmNeutralDaughterPDG[ 5] = 3122;
189 mmMotherPDG[ 6] = 3222; mmChargedDaughterPDG[ 6] = 2212; mmNeutralDaughterPDG[ 6] = 111;
191 newMotherPDG[ 0] = 7003112; newNeutralPDG[ 0] = 7002112;
192 newMotherPDG[ 1] = 7003222; newNeutralPDG[ 1] = 8002112;
193 newMotherPDG[ 2] = 7003312; newNeutralPDG[ 2] = 7003122;
194 newMotherPDG[ 3] = 7003334; newNeutralPDG[ 3] = 7003322;
195 newMotherPDG[ 4] = 9000321; newNeutralPDG[ 4] = 9000111;
196 newMotherPDG[ 5] = 8003334; newNeutralPDG[ 5] = 8003122;
197 newMotherPDG[ 6] = 8003222; newNeutralPDG[ 6] = 8000111;
200 for(
int iMC=0; iMC<nMCParticles; iMC++)
202 if( abs(vMCParticles[iMC].
GetPDG()) == 211 || abs(vMCParticles[iMC].
GetPDG()) == 321 )
205 for(
int iD=0; iD<vMCParticles[iMC].NDaughters(); iD++)
206 if( abs(vMCParticles[vMCParticles[iMC].GetDaughterIds()[iD]].
GetPDG()) == 13 )
207 muonIndex = vMCParticles[iMC].GetDaughterIds()[iD];
212 if(vMCParticles[iMC].
GetPDG() >0)
213 newPDG = vMCParticles[iMC].
GetPDG() + 7000000;
215 newPDG = vMCParticles[iMC].GetPDG() - 7000000;
218 motherTrack.
SetPDG(newPDG);
220 int newMotherIndex = vMCTracks.size();
221 motherPart.
SetPDG(newPDG);
224 const KFMCParticle& daughterPart = vMCParticles[muonIndex];
227 int neutrinoPDG = 7000014;
228 if(vMCParticles[iMC].
GetPDG() == -211) neutrinoPDG = -7000014;
229 if(vMCParticles[iMC].
GetPDG() == 321) neutrinoPDG = 8000014;
230 if(vMCParticles[iMC].
GetPDG() == -321) neutrinoPDG = -8000014;
232 int neutrinoIndex = vMCTracks.size()+1;
233 vMCParticles[iMC].AddDaughter(neutrinoIndex);
235 fNeutralIndex[iMC] = neutrinoIndex;
239 neutrinoTrack.
SetX(daughterTrack.
X());
240 neutrinoTrack.
SetY(daughterTrack.
Y());
241 neutrinoTrack.
SetZ(daughterTrack.
Z());
242 neutrinoTrack.
SetPx(motherTrack.
Px() - daughterTrack.
Px());
243 neutrinoTrack.
SetPy(motherTrack.
Py() - daughterTrack.
Py());
244 neutrinoTrack.
SetPz(motherTrack.
Pz() - daughterTrack.
Pz());
245 neutrinoTrack.
SetQP(0);
247 neutrinoTrack.
SetPDG(neutrinoPDG);
253 vMCTracks.push_back(motherTrack);
254 vMCParticles.push_back(motherPart);
255 fNeutralIndex.push_back(-1);
259 neutrinoPart.
SetPDG(neutrinoPDG);
262 vMCTracks.push_back(neutrinoTrack);
263 vMCParticles.push_back(neutrinoPart);
264 fNeutralIndex.push_back(-1);
266 vMCParticles[iMC].SetAsReconstructable(4);
267 vMCParticles[muonIndex].SetAsReconstructable(4);
272 (abs(vMCParticles[iMC].
GetPDG()) == 3112 ||
273 abs(vMCParticles[iMC].
GetPDG()) == 3222 ||
274 abs(vMCParticles[iMC].
GetPDG()) == 3312 ||
275 abs(vMCParticles[iMC].
GetPDG()) == 3334 ||
276 abs(vMCParticles[iMC].
GetPDG()) == 321) )
278 int neutralDaughterId = -1, chargedDaughterId = -1;
283 for(
int iPDG=0; iPDG<NmmPDG; iPDG++)
285 if(abs(vMCParticles[iMC].
GetPDG()) == mmMotherPDG[iPDG])
287 bool isDaughter[2] = {0,0};
289 vector<float> xDaughter;
290 vector<float> yDaughter;
291 vector<float> zDaughter;
292 vector< vector<int> > nDaughtersAtPoint;
294 for(
int iMCDaughter=0; iMCDaughter<vMCParticles[iMC].NDaughters(); iMCDaughter++)
296 bool isNewDecayPoint = 1;
298 for(
unsigned int iPoint=0; iPoint<xDaughter.size(); iPoint++)
300 float dx = fabs(vMCTracks[vMCParticles[iMC].GetDaughterIds()[iMCDaughter]].
X() - xDaughter[iPoint]);
301 float dy = fabs(vMCTracks[vMCParticles[iMC].GetDaughterIds()[iMCDaughter]].
Y() - yDaughter[iPoint]);
302 float dz = fabs(vMCTracks[vMCParticles[iMC].GetDaughterIds()[iMCDaughter]].
Z() - zDaughter[iPoint]);
304 bool isSamePoint = (dx < 1.e-5 && dy < 1.e-5 && dz < 1.e-5);
306 nDaughtersAtPoint[iPoint].push_back(iMCDaughter);
308 isNewDecayPoint &= !isSamePoint;
313 xDaughter.push_back(vMCTracks[vMCParticles[iMC].GetDaughterIds()[iMCDaughter]].
X());
314 yDaughter.push_back(vMCTracks[vMCParticles[iMC].GetDaughterIds()[iMCDaughter]].
Y());
315 zDaughter.push_back(vMCTracks[vMCParticles[iMC].GetDaughterIds()[iMCDaughter]].
Z());
316 vector<int> newPointIndex;
317 newPointIndex.push_back(iMCDaughter);
318 nDaughtersAtPoint.push_back(newPointIndex);
322 for(
unsigned int iPoint = 0; iPoint<nDaughtersAtPoint.size(); iPoint++)
324 if(nDaughtersAtPoint[iPoint].
size() == 2)
326 for(
unsigned int iDaughter=0; iDaughter<nDaughtersAtPoint[iPoint].size(); iDaughter++)
328 int iMCDaughter = nDaughtersAtPoint[iPoint][iDaughter];
329 if(abs(vMCParticles[vMCParticles[iMC].GetDaughterIds()[iMCDaughter]].
GetPDG()) == mmChargedDaughterPDG[iPDG])
332 chargedDaughterId = vMCParticles[iMC].GetDaughterIds()[iMCDaughter];
334 if(abs(vMCParticles[vMCParticles[iMC].GetDaughterIds()[iMCDaughter]].
GetPDG()) == mmNeutralDaughterPDG[iPDG])
337 neutralDaughterId = vMCParticles[iMC].GetDaughterIds()[iMCDaughter];
341 if(isDaughter[0] && isDaughter[1])
343 int signPDG = vMCParticles[iMC].GetPDG()/abs(vMCParticles[iMC].
GetPDG());
344 newPDG = signPDG * newMotherPDG[iPDG];
345 neutralPDG = signPDG * newNeutralPDG[iPDG];
356 motherTrack.
SetPDG(newPDG);
358 int newMotherIndex = vMCTracks.size();
359 motherPart.
SetPDG(newPDG);
362 int neutrinoIndex = vMCTracks.size()+1;
363 fNeutralIndex[iMC] = neutrinoIndex;
365 KFMCTrack neutralTrack = vMCTracks[neutralDaughterId];
367 neutralTrack.
SetPDG(neutralPDG);
373 vMCTracks.push_back(motherTrack);
374 vMCParticles.push_back(motherPart);
375 fNeutralIndex.push_back(-1);
380 neutralPart.
SetPDG(neutralPDG);
383 vMCTracks.push_back(neutralTrack);
384 vMCParticles.push_back(neutralPart);
385 fNeutralIndex.push_back(-1);
387 vMCParticles[iMC].SetAsReconstructable(4);
388 vMCParticles[chargedDaughterId].SetAsReconstructable(4);
394 for(
unsigned int iMC=0; iMC < vMCParticles.size(); iMC++)
401 vector<int> newDaughters;
405 if( abs(d.
GetPDG())==3224 ||
416 for(
unsigned int iDaughter=0; iDaughter<d.
GetDaughterIds().size(); iDaughter++)
427 for(
unsigned int iDaughter=0; iDaughter<newDaughters.size(); iDaughter++)
431 int indexPDG = fParteff.GetParticleIndex(part.
GetPDG());
432 for(
int iPDG=indexPDG; iPDG<indexPDG+10; iPDG++)
436 if(
int(fParteff.partDaughterPdg[iPDG].size()) != nDaughters)
439 vector<bool> isDaughterFound(nDaughters);
440 vector<bool> isDaughterUsed(nDaughters);
441 for(
int iDMC=0; iDMC<nDaughters; iDMC++)
443 isDaughterFound[iDMC] = 0;
444 isDaughterUsed[iDMC] = 0;
447 bool isCorrectPDG = 1;
448 for(
int iDMC=0; iDMC<nDaughters; iDMC++)
449 for(
int iD=0; iD<nDaughters; iD++)
451 if(isDaughterUsed[iD])
continue;
452 if(vMCParticles[part.
GetDaughterIds()[iD]].GetPDG() == fParteff.partDaughterPdg[iPDG][iDMC])
454 isDaughterUsed[iD] = 1;
455 isDaughterFound[iDMC] = 1;
460 for(
int iDMC=0; iDMC<nDaughters; iDMC++)
461 isCorrectPDG &= isDaughterFound[iDMC];
465 part.
SetPDG(fParteff.partPDG[iPDG]);
473 void KFTopoPerformance::FindReconstructableMCParticles()
476 const unsigned int nMCParticles = vMCParticles.size();
478 for (
unsigned int iP = 0; iP < nMCParticles; iP++ ) {
480 CheckMCParticleIsReconstructable(part);
484 void KFTopoPerformance::CheckMCParticleIsReconstructable(
KFMCParticle &part)
488 if ( vMCTracks[part.
GetMCTrackID()].IsOutOfDetector() )
return;
490 if( abs(part.
GetPDG()) == 211 ||
491 abs(part.
GetPDG()) == 2212 ||
492 abs(part.
GetPDG()) == 321 ||
493 abs(part.
GetPDG()) == 13 ||
494 abs(part.
GetPDG()) == 3112 ||
495 abs(part.
GetPDG()) == 3222 ||
496 abs(part.
GetPDG()) == 3312 ||
497 abs(part.
GetPDG()) == 3334 )
500 KFMCTrack &mcTrack = vMCTracks[iMCTrack];
507 if ( abs(part.
GetPDG()) == 211 ||
508 abs(part.
GetPDG()) == 2212 ||
509 abs(part.
GetPDG()) == 321 ||
510 abs(part.
GetPDG()) == 11 ||
511 abs(part.
GetPDG()) == 13 ||
512 abs(part.
GetPDG()) == 1000010020 ||
513 abs(part.
GetPDG()) == 1000010030 ||
514 abs(part.
GetPDG()) == 1000020030 ||
515 abs(part.
GetPDG()) == 1000020040 ||
519 KFMCTrack &mcTrack = vMCTracks[iMCTrack];
538 bool isPositiveDaughter[5] = {0,0,0,0,0};
539 bool isNegativeDaughter[5] = {0,0,0,0,0};
541 int nRecoDaughters[5] = {0,0,0,0,0};
546 CheckMCParticleIsReconstructable(daughter);
548 TParticlePDG* particlePDG = TDatabasePDG::Instance()->GetParticle(daughter.
GetPDG());
549 Double_t
charge = (particlePDG) ? particlePDG->Charge()/3 : 0;
551 for(
int iEff=0; iEff<5; iEff++)
559 nRecoDaughters[iEff]++;
566 for(
int iEff=0; iEff<3; iEff++)
567 if(nRecoDaughters[iEff] > 1)
571 for(
int iPart=0; iPart<fParteff.nParticles; iPart++)
573 if(part.
GetPDG() == fParteff.partPDG[iPart])
575 const unsigned int nDaughters = fParteff.partDaughterPdg[iPart].size();
577 vector<int>
pdg(nDaughters);
579 for(
unsigned int iD=0; iD<nDaughters; iD++)
582 vector<bool> isDaughterFound(nDaughters);
583 for(
unsigned int iDMC=0; iDMC<nDaughters; iDMC++)
584 isDaughterFound[iDMC] = 0;
587 for(
unsigned int iDMC=0; iDMC<nDaughters; iDMC++)
588 for(
unsigned int iD=0; iD<nDaughters; iD++)
589 if(
pdg[iD] == fParteff.partDaughterPdg[iPart][iDMC]) isDaughterFound[iDMC] = 1;
591 for(
unsigned int iDMC=0; iDMC<nDaughters; iDMC++)
592 isReco = isReco && isDaughterFound[iDMC];
599 const unsigned int nD = dIds.size();
608 for (
unsigned int iD = 0; iD < nD && (reco1 || reco2 || reco3 || reco4 || reco5); iD++ ) {
610 CheckMCParticleIsReconstructable(dp);
621 int iParticle = fParteff.GetParticleIndex(part.
GetPDG());
630 void KFTopoPerformance::FindReconstructableMCVertices()
633 const unsigned int nMCVertices = fPrimVertices.size();
635 for (
unsigned int iV = 0; iV < nMCVertices; iV++ ) {
638 int nReconstructableDaughters = 0;
639 int nMCReconstructableDaughters = 0;
658 void KFTopoPerformance::MatchParticles()
661 MCtoRParticleId.clear();
662 RtoMCParticleId.clear();
663 MCtoRParticleId.resize(vMCParticles.size());
664 RtoMCParticleId.resize(fTopoReconstructor->GetParticles().size() );
667 for(
unsigned int iRP = 0; iRP < fTopoReconstructor->GetParticles().size(); iRP++ )
669 const KFParticle &rPart = fTopoReconstructor->GetParticles()[iRP];
674 const int mcTrackId = fTrackMatch[rTrackId];
676 if(mcTrackId < 0)
continue;
681 MCtoRParticleId[mcTrackId].ids.push_back(iRP);
682 RtoMCParticleId[iRP].ids.push_back(mcTrackId);
685 MCtoRParticleId[mcTrackId].idsMI.push_back(iRP);
686 RtoMCParticleId[iRP].idsMI.push_back(mcTrackId);
691 for(
unsigned int iRP = 0; iRP < fTopoReconstructor->GetParticles().size(); iRP++ ) {
692 const KFParticle &rPart = fTopoReconstructor->GetParticles()[iRP];
693 const unsigned int NRDaughters = rPart.
NDaughters();
695 if (NRDaughters < 2)
continue;
697 bool isMissingMass = ((abs(rPart.
GetPDG()) == 7000211)||(abs(rPart.
GetPDG()) == 7000321)||(abs(rPart.
GetPDG()) == 7003112) || (abs(rPart.
GetPDG()) == 7003222)|| (abs(rPart.
GetPDG()) == 7003312)|| (abs(rPart.
GetPDG()) == 7003334)|| (abs(rPart.
GetPDG()) == 9000321)|| (abs(rPart.
GetPDG()) == 8003334)||(abs(rPart.
GetPDG()) == 8003222));
700 if ( (abs(rPart.
GetPDG()) == 7000014 ) || (abs(rPart.
GetPDG()) == 8000014 ) || (abs(rPart.
GetPDG()) == 7002112 ) ||
701 (abs(rPart.
GetPDG()) == 8002112 ) || (abs(rPart.
GetPDG()) == 7003122 ) || (abs(rPart.
GetPDG()) == 7003322 ) ||
702 (abs(rPart.
GetPDG()) == 9000111 ) || (abs(rPart.
GetPDG()) == 8003122 ) || (abs(rPart.
GetPDG()) == 8000111 ) )
706 int mcNeutralDaughterId = -1;
708 if ( !RtoMCParticleId[recoMotherId].
IsMatched() )
continue;
710 const int mcMotherId = RtoMCParticleId[recoMotherId].GetBestMatch();
712 const int recoChargedDaughterId = rPart.
DaughterIds()[1];
713 if ( !RtoMCParticleId[recoChargedDaughterId].
IsMatched() )
continue;
715 const int mcChargedDaughterId = RtoMCParticleId[recoChargedDaughterId].GetBestMatch();
716 const KFMCParticle& chargedDaughter = vMCParticles[mcChargedDaughterId];
718 if(chargedDaughter.
GetMotherId() != mcMotherId)
continue;
721 if(fNeutralIndex[mcMotherId] > -1)
722 mcNeutralDaughterId = fNeutralIndex[mcMotherId];
724 if(mcNeutralDaughterId > -1)
726 KFMCParticle &neutralDaughter = vMCParticles[mcNeutralDaughterId];
728 int iParticle = fParteff.GetParticleIndex(rPart.
GetPDG());
730 bool allCorrectDaughters = mother.
GetPDG() == fParteff.partDaughterPdg[iParticle][0] &&
731 chargedDaughter.
GetPDG() == fParteff.partDaughterPdg[iParticle][1];
735 allCorrectDaughters) {
736 MCtoRParticleId[mcNeutralDaughterId].ids.push_back(iRP);
737 RtoMCParticleId[iRP].ids.push_back(mcNeutralDaughterId);
740 MCtoRParticleId[mcNeutralDaughterId].idsMI.push_back(iRP);
741 RtoMCParticleId[iRP].idsMI.push_back(mcNeutralDaughterId);
752 vector<int> mcDaughterIds;
756 if ( !RtoMCParticleId[rdId].
IsMatched() )
continue;
757 const int mdId = RtoMCParticleId[rdId].GetBestMatch();
758 mcDaughterIds.push_back(mdId);
759 mmId = vMCParticles[mdId].GetMotherId();
763 for ( ; iD < NRDaughters; iD++ ) {
765 if ( !RtoMCParticleId[rdId].
IsMatched() )
break;
766 const int mdId = RtoMCParticleId[rdId].GetBestMatch();
767 mcDaughterIds.push_back(mdId);
771 const KFMCParticle &neutralDaughter = vMCParticles[mdId];
772 if(mmId != vMCParticles[neutralDaughter.
GetMotherId()].InitialParticleId())
break;
776 if( !(isMissingMass) && (vMCParticles[mdId].GetMotherId() != mmId) )
break;
780 sort(mcDaughterIds.begin(), mcDaughterIds.end());
781 for(
unsigned int ie=1; ie<mcDaughterIds.size(); ie++)
783 if(mcDaughterIds[ie] == mcDaughterIds[ie-1])
787 if(nClones > 0)
continue;
789 if ( iD == NRDaughters && mmId > -1 ) {
794 MCtoRParticleId[mmId].ids.push_back(iRP);
795 RtoMCParticleId[iRP].ids.push_back(mmId);
798 MCtoRParticleId[mmId].idsMI.push_back(iRP);
799 RtoMCParticleId[iRP].idsMI.push_back(mmId);
806 void KFTopoPerformance::MatchPV()
811 MCtoRPVId.resize(fPrimVertices.size());
812 RtoMCPVId.resize(fTopoReconstructor->NPrimaryVertices() );
815 fPVPurity.resize(fTopoReconstructor->NPrimaryVertices(), 0.);
816 fNCorrectPVTracks.clear();
817 fNCorrectPVTracks.resize(fTopoReconstructor->NPrimaryVertices(), 0);
819 for(
int iE = 0; iE<4; iE++)
821 fPVTracksRate[iE].clear();
822 fPVTracksRate[iE].resize(fTopoReconstructor->NPrimaryVertices(),0);
825 for(
unsigned int iMCPV=0; iMCPV<fPrimVertices.size(); iMCPV++)
828 int nReconstructedDaughters = 0;
831 nReconstructedDaughters++;
836 for(
int iPV = 0; iPV < fTopoReconstructor->NPrimaryVertices(); iPV++ ) {
838 vector<int> &
tracks = fTopoReconstructor->GetPVTrackIndexArray(iPV);
840 int nPVTracks = tracks.size()>0 ? tracks.size() : -1;
842 vector<short int> nTracksFromMCPV(fPrimVertices.size() + vMCParticles.size(), 0);
843 vector< vector<int> > mcIDs(fPrimVertices.size() + vMCParticles.size());
845 int nGhostTracks = 0;
846 int nTriggerTracks = 0;
847 int nPileupTracks = 0;
850 for(
int iRP=0; iRP < nPVTracks; iRP++)
852 const int rTrackId = tracks[iRP];
853 if ( !RtoMCParticleId[rTrackId].
IsMatched() )
859 int iMCPart = RtoMCParticleId[rTrackId].GetBestMatch();
862 KFMCTrack &mcTrack = vMCTracks[iMCTrack];
873 int iMCPV = fMCTrackToMCPVMatch[iMCTrack];
876 std::cout <<
"Error!!! iMCPV < 0" << std::endl;
880 nTracksFromMCPV[iMCPV]++;
881 mcIDs[iMCPV].push_back(iMCTrack);
889 int iMCPV = motherId + fPrimVertices.size();
891 nTracksFromMCPV[iMCPV]++;
892 mcIDs[iMCPV].push_back(iMCTrack);
899 for(
unsigned int iMCPV=0; iMCPV<nTracksFromMCPV.size(); iMCPV++)
903 for(
unsigned int ie=1; ie<mcIDs[iMCPV].size(); ie++)
905 if(mcIDs[iMCPV][ie] == mcIDs[iMCPV][ie-1])
908 nTracksFromMCPV[iMCPV] = nTracksFromMCPV[iMCPV] - nClones;
909 nPVTracks -= nClones;
913 fPVTracksRate[0][iPV] =
double(nGhostTracks)/
double(nPVTracks);
914 fPVTracksRate[1][iPV] =
double(nTriggerTracks)/
double(nPVTracks);
915 fPVTracksRate[2][iPV] =
double(nPileupTracks)/
double(nPVTracks);
916 fPVTracksRate[3][iPV] =
double(nBGTracks)/
double(nPVTracks);
919 int nTracksBestMCPV = 1;
920 for(
unsigned int iMCPV=0; iMCPV<nTracksFromMCPV.size(); iMCPV++ )
922 if(nTracksFromMCPV[iMCPV] > nTracksBestMCPV )
924 nTracksBestMCPV = nTracksFromMCPV[iMCPV];
929 if( (iBestMCPV > -1) && (iBestMCPV<int(fPrimVertices.size())) )
931 fNCorrectPVTracks[iPV] = nTracksFromMCPV[iBestMCPV];
934 fNCorrectPVTracks[iPV] = 0;
941 if(iBestMCPV < 0)
continue;
943 if(iBestMCPV <
int(fPrimVertices.size()))
945 fPrimVertices[iBestMCPV].SetReconstructed();
947 MCtoRPVId[iBestMCPV].ids.push_back(iPV);
948 RtoMCPVId[iPV].ids.push_back(iBestMCPV);
952 RtoMCPVId[iPV].idsMI.push_back(iBestMCPV);
957 void KFTopoPerformance::MatchTracks()
960 #ifdef KFPWITHTRACKER
961 for(
int iTr=0; iTr<vMCTracks.size(); iTr++)
963 if( (AliHLTTPCCAPerformance::Instance().GetSubPerformance(
"Global Performance")->GetMCData())[iTr].IsReconstructed() )
964 vMCTracks[iTr].SetReconstructed();
966 fTrackMatch.resize(AliHLTTPCCAPerformance::Instance().GetSubPerformance(
"Global Performance")->GetRecoData().
size());
967 for(
int iTr=0; iTr<fTrackMatch.size(); iTr++)
969 const AliHLTTPCCAPerformanceRecoTrackData& matchInfo = (AliHLTTPCCAPerformance::Instance().GetSubPerformance(
"Global Performance")->GetRecoData())[iTr];
970 if( matchInfo.IsGhost(PParameters::MinTrackPurity) || matchInfo.GetMCTrackId()<0 )
971 fTrackMatch[iTr] = -1;
973 fTrackMatch[iTr] = matchInfo.GetMCTrackId();
978 FindReconstructableMCParticles();
980 CalculateEfficiency();
982 FindReconstructableMCVertices();
984 CalculatePVEfficiency();
987 void KFTopoPerformance::CalculateEfficiency()
992 const int NRP = fTopoReconstructor->GetParticles().size();
993 for (
int iP = 0; iP < NRP; ++iP ) {
995 const KFParticle &part = fTopoReconstructor->GetParticles()[iP];
998 const bool isBG = RtoMCParticleId[iP].idsMI.size() != 0;
999 const bool isGhost = !RtoMCParticleId[iP].IsMatched();
1001 for(
int iPart=0; iPart<fParteff.nParticles; iPart++)
1002 if ( pdg == fParteff.partPDG[iPart] )
1003 partEff.
IncReco(isGhost, isBG, fParteff.partName[iPart].data());
1011 partEff.
IncReco(isGhost, 0, fParteff.partName[fParteff.nParticles - 1].data());
1015 const int NMP = vMCParticles.size();
1016 for (
int iP = 0; iP < NMP; ++iP ) {
1018 const int pdg = part.
GetPDG();
1021 vector<bool> isReco;
1022 vector<int> nClones;
1024 vector<int> iParticle;
1025 iParticle.push_back(fParteff.GetParticleIndex(pdg));
1026 vector< vector<bool> > isReconstructable;
1027 vector<bool> isRecPart;
1029 const std::map<int,bool>& decays = fTopoReconstructor->GetKFParticleFinder()->GetReconstructionList();
1030 if(!(decays.empty()) && (iParticle[0] < fParteff.fFirstStableParticleIndex || iParticle[0] > fParteff.fLastStableParticleIndex))
1031 if(decays.find(pdg) == decays.end())
continue;
1041 for(
int iEff = 0; iEff < 3; iEff++)
1044 isReconstructable.push_back(isRecPart);
1045 isReco.push_back( MCtoRParticleId[iP].
ids.size() != 0 );
1046 nClones.push_back( MCtoRParticleId[iP].
ids.size() - 1 );
1050 iParticle.push_back(fParteff.nParticles - 1);
1051 vector<bool> isRecV0;
1052 for(
int iEff = 0; iEff < 3; iEff++)
1054 isReconstructable.push_back(isRecV0);
1055 isReco.push_back( (MCtoRParticleId[iP].
ids.size() != 0) || (MCtoRParticleId[iP].idsMI.size() != 0) );
1057 int nClonesV0 = MCtoRParticleId[iP].ids.size() + MCtoRParticleId[iP].idsMI.size() - 1;
1058 nClones.push_back( nClonesV0 );
1062 for(
unsigned int iPType=0; iPType<iParticle.size(); iPType++)
1064 int iPart = iParticle[iPType];
1065 if(iPart<0)
continue;
1067 partEff.
Inc(isReco[iPType], nClones[iPType], isReconstructable[iPType][0], isReconstructable[iPType][1], isReconstructable[iPType][2], fParteff.partName[iPart].data());
1069 partEff.
Inc(isReco[iPType], nClones[iPType], isReconstructable[iPType][0], isReconstructable[iPType][1], isReconstructable[iPType][2], (fParteff.partName[iPart]+
"_prim").data());
1071 partEff.
Inc(isReco[iPType], nClones[iPType], isReconstructable[iPType][0], isReconstructable[iPType][1], isReconstructable[iPType][2], (fParteff.partName[iPart]+
"_sec").data());
1073 for(
int iEff=0; iEff<3; iEff++)
1075 if(!isReconstructable[iPType][iEff])
continue;
1078 KFMCTrack &mcTrack = vMCTracks[iMCTrack];
1080 Double_t massMC = fParteff.partMass[iPart];
1081 Double_t
E = sqrt(mcTrack.
P()*mcTrack.
P() + massMC*massMC);
1082 Double_t
Y = 0.5*log((E + mcTrack.
Pz())/(E - mcTrack.
Pz()));
1083 Double_t
Z = mcTrack.
Z();
1084 Double_t
R = -1,
L=-1;
1085 Double_t Mt_mc = sqrt(mcTrack.
Pt()*mcTrack.
Pt()+massMC*massMC)-massMC;
1086 Double_t cT = -1.e10;
1087 Double_t decayLength = -1.e10;
1092 KFMCTrack &mcDaughter = vMCTracks[mcDaughterId];
1093 R = sqrt(mcDaughter.
X()*mcDaughter.
X() + mcDaughter.
Y()*mcDaughter.
Y());
1094 L = sqrt(mcDaughter.
X()*mcDaughter.
X() + mcDaughter.
Y()*mcDaughter.
Y());
1100 float decayPoint[3] = { mcDaughter.
X(), mcDaughter.
Y(), mcDaughter.
Z() };
1101 for(
int iP=0; iP<6; iP++)
1106 int jParticlePDG = fParteff.GetParticleIndex(mcTrack.
PDG());
1107 Double_t massMC = (jParticlePDG>=0) ? fParteff.partMass[jParticlePDG] :0.13957;
1110 decayLength = s*mcTrack.
P();
1114 if(fStoreMCHistograms)
1116 hPartEfficiency[iPart][iEff][0]->Fill( mcTrack.
P(), isReco[iPType] );
1117 hPartEfficiency[iPart][iEff][1]->Fill( mcTrack.
Pt(), isReco[iPType] );
1118 hPartEfficiency[iPart][iEff][2]->Fill( Y, isReco[iPType] );
1119 hPartEfficiency[iPart][iEff][3]->Fill( Z, isReco[iPType] );
1120 if(cT > -1.e10) hPartEfficiency[iPart][iEff][4]->Fill( cT, isReco[iPType] );
1121 if(decayLength > -1.e10) hPartEfficiency[iPart][iEff][5]->Fill( decayLength, isReco[iPType] );
1122 hPartEfficiency[iPart][iEff][3]->Fill( Z, isReco[iPType] );
1123 hPartEfficiency[iPart][iEff][6]->Fill( L, isReco[iPType] );
1124 hPartEfficiency[iPart][iEff][7]->Fill( R, isReco[iPType] );
1125 hPartEfficiency[iPart][iEff][8]->Fill( Mt_mc, isReco[iPType] );
1127 hPartEfficiency2D[iPart][iEff][0]->Fill( Y, mcTrack.
Pt(), isReco[iPType] );
1128 hPartEfficiency2D[iPart][iEff][1]->Fill( Y, Mt_mc, isReco[iPType] );
1137 fParteff += partEff;
1142 if(fNEvents%fPrintEffFrequency == 0)
1144 std::cout <<
" ---- KF Particle finder --- " << std::endl;
1145 std::cout <<
"ACCUMULATED STAT : " << fNEvents <<
" EVENTS " << std::endl << std::endl;
1146 fParteff.PrintEff();
1147 std::cout<<std::endl;
1151 void KFTopoPerformance::CalculatePVEfficiency()
1158 for(
unsigned int iRP = 0; iRP < fTopoReconstructor->GetParticles().size(); iRP++ ) {
1160 const KFParticle &rPart = fTopoReconstructor->GetParticles()[iRP];
1167 const int NRecoPV = fTopoReconstructor->NPrimaryVertices();
1168 for (
int iP = 0; iP < NRecoPV; ++iP ) {
1170 const bool isBG = RtoMCPVId[iP].idsMI.size() != 0;
1171 const bool isGhost = !RtoMCPVId[iP].IsMatched();
1173 pvEff.
IncReco(isGhost, isBG,
"PV");
1174 pvEffMCReconstructable.
IncReco(isGhost, isBG,
"PV");
1177 const int NMCPV = fPrimVertices.size();
1178 for (
int iV = 0; iV < NMCPV; ++iV ) {
1183 const int nClones = MCtoRPVId[iV].ids.size() - 1;
1186 pvEff.
Inc(isReco, nClones,
"PV");
1189 pvEff.
Inc(isReco, nClones,
"PVtrigger");
1191 hPVefficiency[0][1]->Fill( NMCPV, isReco );
1192 hPVefficiency[0][2]->Fill( vMCTracks.size(), isReco );
1194 hPVefficiency[0][4]->Fill( NRecoPV, isReco );
1195 hPVefficiency[0][5]->Fill( nTracks, isReco );
1199 pvEff.
Inc(isReco, nClones,
"PVpileup");
1201 hPVefficiency[1][1]->Fill( NMCPV, isReco );
1202 hPVefficiency[1][2]->Fill( vMCTracks.size(), isReco );
1204 hPVefficiency[1][4]->Fill( NRecoPV, isReco );
1205 hPVefficiency[1][5]->Fill( nTracks, isReco );
1211 const int nClones = MCtoRPVId[iV].ids.size() - 1;
1214 pvEffMCReconstructable.
Inc(isReco, nClones,
"PV");
1217 pvEffMCReconstructable.
Inc(isReco, nClones,
"PVtrigger");
1219 hPVefficiency[2][1]->Fill( NMCPV, isReco );
1220 hPVefficiency[2][2]->Fill( vMCTracks.size(), isReco );
1222 hPVefficiency[2][4]->Fill( NRecoPV, isReco );
1223 hPVefficiency[2][5]->Fill( nTracks, isReco );
1227 pvEffMCReconstructable.
Inc(isReco, nClones,
"PVpileup");
1229 hPVefficiency[3][1]->Fill( NMCPV, isReco );
1230 hPVefficiency[3][2]->Fill( vMCTracks.size(), isReco );
1232 hPVefficiency[3][4]->Fill( NRecoPV, isReco );
1233 hPVefficiency[3][5]->Fill( nTracks, isReco );
1243 fPVeffMCReconstructable += pvEffMCReconstructable;
1244 pvEffMCReconstructable.
CalcEff();
1245 fPVeffMCReconstructable.CalcEff();
1247 if(fNEvents%fPrintEffFrequency == 0)
1249 std::cout <<
" ---- KF PV finder --- " << std::endl;
1250 std::cout <<
"ACCUMULATED STAT : " << fNEvents <<
" EVENTS " << std::endl << std::endl;
1251 std::cout <<
"PV with at least 2 reconstructed tracks is reconstructable:" << std::endl;
1253 std::cout << std::endl;
1254 std::cout <<
"PV with at least 2 MC tracks with 15 MC points is reconstructable:" << std::endl;
1255 fPVeffMCReconstructable.PrintEff();
1257 std::cout<<std::endl;
1261 void KFTopoPerformance::FillParticleParameters(
KFParticle& TempPart,
1271 vector<int>* multiplicities)
1275 const std::map<int,bool>& decays = fTopoReconstructor->GetKFParticleFinder()->GetReconstructionList();
1276 if(!(decays.empty()) && (iParticle < fParteff.fFirstStableParticleIndex || iParticle > fParteff.fLastStableParticleIndex))
1277 if(decays.find(TempPart.
GetPDG()) == decays.end())
return;
1292 Pt = TempPart.
GetPt();
1300 float chi2 = TempPart.
GetChi2();
1301 Int_t ndf = TempPart.
GetNDF();
1302 float prob = TMath::Prob(chi2, ndf);
1305 X = TempPart.
GetX();
1306 Y = TempPart.
GetY();
1307 Z = TempPart.
GetZ();
1309 if(Z>=1. && iParticle>=54 && iParticle<=64)
return;
1312 M_t = sqrt(Pt*Pt+fParteff.GetMass(iParticle)*fParteff.GetMass(iParticle))-fParteff.GetMass(iParticle);
1319 if( (l[0] > 0.2
f || Pt < 0.
f) && (abs( TempPart.
GetPDG() ) == 4122 ||
1320 abs( TempPart.
GetPDG() ) == 104122 ||
1321 abs( TempPart.
GetPDG() ) == 204122 ||
1322 abs( TempPart.
GetPDG() ) == 304122 ||
1323 abs( TempPart.
GetPDG() ) == 404122 ||
1324 abs( TempPart.
GetPDG() ) == 504122 ) )
return;
1325 if( (l[0] > 0.2
f || Pt < 0.
f) && (abs( TempPart.
GetPDG() ) == 421 ||
1326 abs( TempPart.
GetPDG() ) == 420 ||
1327 abs( TempPart.
GetPDG() ) == 425 ||
1328 abs( TempPart.
GetPDG() ) == 426 ||
1329 abs( TempPart.
GetPDG() ) == 427 ||
1330 abs( TempPart.
GetPDG() ) == 429) )
return;
1331 if( (l[0] > 0.4
f || Pt < 0.
f) && (abs( TempPart.
GetPDG() ) == 411 ||
1332 abs( TempPart.
GetPDG() ) == 100411 ||
1333 abs( TempPart.
GetPDG() ) == 200411 ||
1334 abs( TempPart.
GetPDG() ) == 300411) )
return;
1335 if( (l[0] > 0.2
f || Pt < 0.
f) && (abs( TempPart.
GetPDG() ) == 431 ||
1336 abs( TempPart.
GetPDG() ) == 100431 ||
1337 abs( TempPart.
GetPDG() ) == 200431 ||
1338 abs( TempPart.
GetPDG() ) == 300431 ||
1339 abs( TempPart.
GetPDG() ) == 400431) )
return;
1348 if(Pt < 0.5
f && (abs( TempPart.
GetPDG() ) == 3000 ||
1349 abs( TempPart.
GetPDG() ) == 3001) )
return;
1351 float parameters[17] = {M,
P,
Pt, Rapidity, dL, cT, chi2/ndf, prob,
Theta, Phi,
X,
Y,
Z,
R, l[0], l[0]/dl[0], M_t };
1354 for(
int iParam=0; iParam<17; iParam++)
1355 histoParameters[0][iParticle][iParam]->
Fill(parameters[iParam]);
1358 multiplicities[0][iParticle]++;
1360 histoParameters2D[0][iParticle][0]->Fill(Rapidity,Pt,1);
1361 histoParameters2D[0][iParticle][3]->Fill(Rapidity,M_t,1);
1363 const bool drawZR = IsCollectZRHistogram(iParticle);
1364 if(histoParameters2D[0][iParticle][1] && drawZR)
1366 histoParameters2D[0][iParticle][1]->Fill(Z,R,1);
1369 if(TempPart.
NDaughters() == 2 && IsCollectArmenteros(iParticle))
1373 if(index1 >=
int(fTopoReconstructor->GetParticles().size()) ||
1374 index2 >=
int(fTopoReconstructor->GetParticles().size()) ||
1375 index1 < 0 || index2 < 0 )
1379 if(
int(fTopoReconstructor->GetParticles()[
index1].Q()) > 0)
1381 posDaughter = fTopoReconstructor->GetParticles()[
index1];
1382 negDaughter = fTopoReconstructor->GetParticles()[
index2];
1386 negDaughter = fTopoReconstructor->GetParticles()[
index1];
1387 posDaughter = fTopoReconstructor->GetParticles()[
index2];
1394 histoParameters2D[0][iParticle][2]->Fill(QtAlpha[1],QtAlpha[0],1);
1398 if( histoParameters3D && IsCollect3DHistogram(iParticle))
1400 histoParameters3D[0][iParticle][0]->Fill(Rapidity,Pt,M,1);
1401 histoParameters3D[0][iParticle][1]->Fill(Rapidity,M_t,M,1);
1402 if(fCentralityBin>=0)
1404 histoParameters3D[0][iParticle][2]->Fill(fCentralityBin, Pt, M, fCentralityWeight);
1405 histoParameters3D[0][iParticle][3]->Fill(fCentralityBin, Rapidity, M, fCentralityWeight);
1406 histoParameters3D[0][iParticle][4]->Fill(fCentralityBin, M_t, M, fCentralityWeight);
1408 histoParameters3D[0][iParticle][5]->Fill(cT, Pt, M, 1);
1412 if(histoDSToParticleQA && IsCollect3DHistogram(iParticle))
1414 if(fabs(fParteff.GetMass(iParticle)-M) < 3.
f*fParteff.GetMassSigma(iParticle))
1416 for(
int iParam=0; iParam<17; iParam++)
1417 histoParameters[4][iParticle][iParam]->
Fill(parameters[iParam]);
1420 multiplicities[4][iParticle]++;
1422 histoParameters2D[4][iParticle][0]->Fill(Rapidity,Pt,1);
1423 histoParameters2D[4][iParticle][3]->Fill(Rapidity,M_t,1);
1427 if(histoParameters2D[4][iParticle][1])
1428 histoParameters2D[4][iParticle][1]->Fill(Z,R,1);
1429 if(histoParameters2D[4][iParticle][2])
1430 histoParameters2D[4][iParticle][2]->Fill(QtAlpha[1],QtAlpha[0],1);
1434 if( fabs(fParteff.GetMass(iParticle)-M) > 3.
f*fParteff.GetMassSigma(iParticle) &&
1435 fabs(fParteff.GetMass(iParticle)-M) <= 6.
f*fParteff.GetMassSigma(iParticle) )
1437 for(
int iParam=0; iParam<17; iParam++)
1438 histoParameters[5][iParticle][iParam]->
Fill(parameters[iParam]);
1441 multiplicities[5][iParticle]++;
1443 histoParameters2D[5][iParticle][0]->Fill(Rapidity,Pt,1);
1444 histoParameters2D[5][iParticle][3]->Fill(Rapidity,M_t,1);
1448 if(histoParameters2D[5][iParticle][1])
1449 histoParameters2D[5][iParticle][1]->Fill(Z,R,1);
1450 if(histoParameters2D[5][iParticle][2])
1451 histoParameters2D[5][iParticle][2]->Fill(QtAlpha[1],QtAlpha[0],1);
1456 if(!fStoreMCHistograms)
return;
1459 if(!RtoMCParticleId[iP].IsMatchedWithPdg())
1461 if(!RtoMCParticleId[iP].
IsMatched()) iSet = 3;
1466 if(!histoDSToParticleQA && iSet == 1)
1468 int iMCPart = RtoMCParticleId[iP].GetBestMatchWithPdg();
1471 KFMCTrack &mcTrack = vMCTracks[iMCTrack];
1473 bool isSecondaryParticle = motherId >= 0;
1477 if(isSecondaryParticle)
1482 if(RtoMCPVId[iPV].IsMatchedWithPdg())
1483 iMCPV = RtoMCPVId[iPV].GetBestMatch();
1485 int iMCPVFromParticle = fMCTrackToMCPVMatch[iMCTrack];
1486 if(iMCPV != iMCPVFromParticle)
1492 if(!isSecondaryParticle)
1498 for(
int iParam=0; iParam<17; iParam++)
1499 histoParameters[iSet][iParticle][iParam]->
Fill(parameters[iParam]);
1502 multiplicities[iSet][iParticle]++;
1504 histoParameters2D[iSet][iParticle][0]->Fill(Rapidity,Pt,1);
1507 if(histoParameters2D[iSet][iParticle][1])
1508 histoParameters2D[iSet][iParticle][1]->Fill(Z,R,1);
1509 if(histoParameters2D[iSet][iParticle][2])
1510 histoParameters2D[iSet][iParticle][2]->Fill(QtAlpha[1],QtAlpha[0],1);
1512 histoParameters2D[iSet][iParticle][3]->Fill(Rapidity,M_t,1);
1514 if(iSet != 1)
return;
1516 int iMCPart = RtoMCParticleId[iP].GetBestMatchWithPdg();
1522 KFMCTrack &mcTrack = vMCTracks[iMCTrack];
1523 int mcDaughterId = -1;
1524 if(iParticle >= fParteff.fFirstStableParticleIndex && iParticle <= fParteff.fLastStableParticleIndex)
1525 mcDaughterId = iMCTrack;
1527 mcDaughterId = iMCTrack;
1528 else if(iParticle >= fParteff.fFirstMissingMassParticleIndex && iParticle <= fParteff.fLastMissingMassParticleIndex)
1533 KFMCTrack &mcDaughter = vMCTracks[mcDaughterId];
1535 float mcX = mcTrack.
X();
1536 float mcY = mcTrack.
Y();
1537 float mcZ = mcTrack.
Z();
1538 if(histoDSToParticleQA || hPartParamPrimary == histoParameters)
1540 mcX = mcDaughter.
X();
1541 mcY = mcDaughter.
Y();
1542 mcZ = mcDaughter.
Z();
1544 const float mcPx = mcTrack.
Par(3);
1545 const float mcPy = mcTrack.
Par(4);
1546 const float mcPz = mcTrack.
Par(5);
1548 float decayVtx[3] = { mcTrack.
X(), mcTrack.
Y(), mcTrack.
Z() };
1549 float recParam[8] = { 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f };
1550 float errParam[8] = { 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f };
1552 for(
int iPar=0; iPar<3; iPar++)
1556 if(error < 0.) { error = 1.e20;}
1557 errParam[iPar] = TMath::Sqrt(error);
1560 for(
int iPar=3; iPar<7; iPar++)
1564 if(error < 0.) { error = 1.e20;}
1565 errParam[iPar] = TMath::Sqrt(error);
1568 int jParticlePDG = fParteff.GetParticleIndex(mcTrack.
PDG());
1569 Double_t massMC = (jParticlePDG>=0) ? fParteff.partMass[jParticlePDG] :0.13957;
1571 Double_t Emc = sqrt(mcTrack.
P()*mcTrack.
P() + massMC*massMC);
1572 Double_t res[8] = {0},
1574 mcParam[8] = { mcX, mcY, mcZ,
1575 mcPx, mcPy, mcPz, Emc, massMC };
1576 for(
int iPar=0; iPar < 7; iPar++ )
1578 res[iPar] = recParam[iPar] - mcParam[iPar];
1579 if(fabs(errParam[iPar]) > 1.e-20) pull[iPar] = res[iPar]/errParam[iPar];
1582 res[7] = M - mcParam[7];
1583 if(fabs(ErrM) > 1.e-20) pull[7] = res[7]/ErrM;
1585 for(
int iPar=0; iPar < 8; iPar++ )
1587 histoFit[iParticle][iPar]->Fill(res[iPar]);
1588 histoFit[iParticle][iPar+8]->Fill(pull[iPar]);
1592 int daughterIndex[2] = {-1, -1};
1594 if(histoFitDaughtersQA)
1600 if(!MCtoRParticleId[mcDaughterId].
IsMatched())
continue;
1601 KFMCTrack &mcTrack = vMCTracks[mcDaughterId];
1603 int recDaughterId = MCtoRParticleId[mcDaughterId].GetBestMatch();
1604 KFParticle Daughter = fTopoReconstructor->GetParticles()[recDaughterId];
1607 const float mcX = mcTrack.
X();
1608 const float mcY = mcTrack.
Y();
1609 const float mcZ = mcTrack.
Z();
1610 const float mcPx = mcTrack.
Px();
1611 const float mcPy = mcTrack.
Py();
1612 const float mcPz = mcTrack.
Pz();
1614 float_v decayVtx[3] = {mcX, mcY, mcZ};
1617 DaughterSIMD.TransportToPoint(decayVtx);
1619 int jParticlePDG = fParteff.GetParticleIndex(mcTrack.
PDG());
1620 Double_t massMC = (jParticlePDG>=0) ? fParteff.partMass[jParticlePDG] :0.13957;
1621 Double_t Emc = sqrt(mcTrack.
P()*mcTrack.
P() + massMC*massMC);
1623 Double_t res[8] = {0},
1625 mcParam[8] = { mcX, mcY, mcZ,
1626 mcPx, mcPy, mcPz, Emc, massMC };
1627 for(
int iPar=0; iPar < 7; iPar++ )
1629 Double_t error = DaughterSIMD.GetCovariance(iPar,iPar)[0];
1630 if(error < 0.) { error = 1.e20;}
1631 error = TMath::Sqrt(error);
1632 Double_t recoPar = DaughterSIMD.GetParameter(iPar)[0];
1633 res[iPar] = recoPar - mcParam[iPar];
1634 if(fabs(error) > 1.
e-20) pull[iPar] = res[iPar]/
error;
1636 res[7] = M - mcParam[7];
1637 if(fabs(ErrM) > 1.
e-20) pull[7] = res[7]/ErrM;
1639 for(
int iPar=0; iPar < 8; iPar++ )
1641 histoFitDaughtersQA[iParticle][iPar]->Fill(res[iPar]);
1642 histoFitDaughtersQA[iParticle][iPar+8]->Fill(pull[iPar]);
1647 daughterIndex[0] = recDaughterId;
1648 if(iD == 1 && daughterIndex[0] > -1 && histoDSToParticleQA)
1650 daughterIndex[1] = recDaughterId;
1651 KFParticle d1 = fTopoReconstructor->GetParticles()[daughterIndex[0]];
1652 KFParticle d2 = fTopoReconstructor->GetParticles()[daughterIndex[1]];
1656 float_v dS[2] = {0.f, 0.f};
1658 for(
int i1=0; i1<4; i1++)
1659 for(
int i2=0; i2<6; i2++)
1663 float_v pD[2][8], cD[2][36], corrPD[2][36], corrCD[2][36];
1665 for(
int iDR=0; iDR<2; iDR++)
1667 for(
int iPD = 0; iPD<8; iPD++)
1670 corrPD[iDR][iPD] = 0;
1672 for(
int iCD=0; iCD<36; iCD++)
1675 corrCD[iDR][iCD] = 0;
1681 for(
int i1=0; i1<4; i1++)
1682 for(
int i2=0; i2<36; i2++)
1685 daughters[0].
Transport(dS[0], dsdr[0], pD[0], cD[0], dsdr[1], F[0], F[1]);
1686 daughters[1].
Transport(dS[1], dsdr[3], pD[1], cD[1], dsdr[2], F[3], F[2]);
1688 daughters[0].
MultQSQt( F[1], daughters[1].CovarianceMatrix(), corrCD[0], 6);
1689 daughters[0].
MultQSQt( F[2], daughters[0].CovarianceMatrix(), corrCD[1], 6);
1690 for(
int iDR=0; iDR<2; iDR++)
1691 for(
int iC=0; iC<6; iC++)
1692 cD[iDR][iC] += corrCD[iDR][iC];
1694 for(
int iDR=0; iDR<2; iDR++)
1696 cD[iDR][1] = cD[iDR][2];
1697 cD[iDR][2] = cD[iDR][5];
1698 for(
int iPar=0; iPar<3; iPar++)
1700 res[iPar] = pD[iDR][iPar][0] - decayVtx[iPar][0];
1702 Double_t error = cD[iDR][iPar][0];
1703 if(error < 0.) { error = 1.e20;}
1704 error = sqrt(error);
1706 pull[iPar] = res[iPar] /
error;
1708 histoDSToParticleQA[iParticle][iPar]->Fill(res[iPar]);
1709 histoDSToParticleQA[iParticle][iPar+3]->Fill(pull[iPar]);
1713 Double_t dXds = pD[0][0][0] - pD[1][0][0];
1714 Double_t dYds = pD[0][1][0] - pD[1][1][0];
1715 Double_t dZds = pD[0][2][0] - pD[1][2][0];
1717 Double_t dRds = sqrt(dXds*dXds + dYds*dYds + dZds*dZds);
1718 histoDSToParticleQA[iParticle][6]->Fill(dRds);
1724 void KFTopoPerformance::FillHistos()
1727 vector<int> multiplicities[6];
1728 for(
int iV=0; iV<6; iV++)
1732 for(
unsigned int iP=0; iP<fTopoReconstructor->GetParticles().size(); iP++)
1734 int iParticle = fParteff.GetParticleIndex(fTopoReconstructor->GetParticles()[iP].GetPDG());
1735 if(iParticle < 0)
continue;
1736 KFParticle TempPart = fTopoReconstructor->GetParticles()[iP];
1738 FillParticleParameters(TempPart,iParticle, iP, 0, hPartParam, hPartParam2D, hPartParam3D,
1739 hFitQA, hFitDaughtersQA, hDSToParticleQA, multiplicities);
1742 if(fStoreMCHistograms)
1746 const std::vector<KFParticle>& SecondaryCandidates = fTopoReconstructor->GetKFParticleFinder()->GetSecondaryCandidates()[iSet];
1747 for(
unsigned int iP=0; iP<SecondaryCandidates.size(); iP++)
1749 KFParticle TempPart = SecondaryCandidates[iP];
1750 int iParticle = fParteff.GetParticleIndex(TempPart.
GetPDG());
1751 if(iParticle < 0)
continue;
1753 const int id = TempPart.
Id();
1754 FillParticleParameters(TempPart, iParticle,
id, 0, hPartParamSecondaryMass, hPartParam2DSecondaryMass, 0);
1756 TempPart = fTopoReconstructor->GetParticles()[
id];
1757 FillParticleParameters(TempPart, iParticle,
id, 0, hPartParamSecondary, hPartParam2DSecondary, 0);
1763 for(
int iPV=0; iPV<fTopoReconstructor->NPrimaryVertices(); iPV++)
1765 const std::vector<KFParticle>& PrimaryCandidates = fTopoReconstructor->GetKFParticleFinder()->GetPrimaryCandidates()[iSet][iPV];
1766 for(
unsigned int iP=0; iP<PrimaryCandidates.size(); iP++)
1769 int iParticle = fParteff.GetParticleIndex(TempPart.
GetPDG());
1770 if(iParticle < 0)
continue;
1772 const int id = TempPart.
Id();
1773 FillParticleParameters(TempPart,iParticle,
id, iPV, hPartParamPrimaryMass, hPartParam2DPrimaryMass, 0, hFitQAMassConstraint);
1775 TempPart = fTopoReconstructor->GetParticles()[
id];
1776 FillParticleParameters(TempPart,iParticle,
id, iPV, hPartParamPrimary, hPartParam2DPrimary, 0, hFitQANoConstraint);
1779 const std::vector<KFParticle>& PrimaryCandidatesTopo = fTopoReconstructor->GetKFParticleFinder()->GetPrimaryTopoCandidates()[iSet][iPV];
1780 for(
unsigned int iP=0; iP<PrimaryCandidatesTopo.size(); iP++)
1782 KFParticle TempPart = PrimaryCandidatesTopo[iP];
1783 int iParticle = fParteff.GetParticleIndex(TempPart.
GetPDG());
1784 if(iParticle < 0)
continue;
1786 FillParticleParameters(TempPart,iParticle, TempPart.
Id(), iPV, hPartParamPrimaryTopo, hPartParam2DPrimaryTopo, 0, hFitQATopoConstraint);
1789 const std::vector<KFParticle>& PrimaryCandidatesTopoMass = fTopoReconstructor->GetKFParticleFinder()->GetPrimaryTopoMassCandidates()[iSet][iPV];
1790 for(
unsigned int iP=0; iP<PrimaryCandidatesTopoMass.size(); iP++)
1792 KFParticle TempPart = PrimaryCandidatesTopoMass[iP];
1793 int iParticle = fParteff.GetParticleIndex(TempPart.
GetPDG());
1794 if(iParticle < 0)
continue;
1796 FillParticleParameters(TempPart,iParticle, TempPart.
Id(), iPV, hPartParamPrimaryTopoMass, hPartParam2DPrimaryTopoMass, 0, hFitQATopoMassConstraint);
1802 for(
unsigned int iP=0; iP<fTopoReconstructor->GetParticles().size(); iP++)
1804 KFParticle TempPart = fTopoReconstructor->GetParticles()[iP];
1805 KFParticle vtx = fTopoReconstructor->GetPrimVertex(0);
1809 int iMCPV = vMCParticles[RtoMCParticleId[iP].GetBestMatch()].GetMotherId();
1815 vtx = fTopoReconstructor->GetPrimVertex(MCtoRPVId[iMCPV].GetBestMatch());
1836 int iMCPart = RtoMCParticleId[iP].GetBestMatch();
1848 int iParticle = fParteff.GetParticleIndex(fTopoReconstructor->GetParticles()[iP].GetPDG());
1850 hTrackParameters[iParticle]->Fill(chi2 );
1856 for(
int iPV = 0; iPV<fTopoReconstructor->NPrimaryVertices(); iPV++)
1858 KFParticle & vtx = fTopoReconstructor->GetPrimVertex(iPV);
1859 vector<int> &tracks = fTopoReconstructor->GetPVTrackIndexArray(iPV);
1861 Double_t probPV = TMath::Prob(vtx.
Chi2(), vtx.
NDF());
1862 vector<Double_t> dzPV;
1865 int iCurrMCPV = RtoMCPVId[iPV].GetBestMatch();
1866 for(
int iPV2 = iPV+1; iPV2 < fTopoReconstructor->NPrimaryVertices(); iPV2++)
1868 if(!RtoMCPVId[iPV2].
IsMatched())
continue;
1869 int iCurrMCPV2 = RtoMCPVId[iPV2].GetBestMatch();
1870 if(iCurrMCPV != iCurrMCPV2)
continue;
1871 KFParticle & vtx2 = fTopoReconstructor->GetPrimVertex(iPV2);
1873 dzPV.push_back(fabs(vtx.
Z() - vtx2.
Z()));
1877 hPVParam[ 0]->Fill(vtx.
X());
1878 hPVParam[ 1]->Fill(vtx.
Y());
1879 hPVParam[ 2]->Fill(vtx.
Z());
1880 hPVParam[ 3]->Fill(sqrt(vtx.
X()*vtx.
X() + vtx.
Y()*vtx.
Y()));
1881 hPVParam[ 4]->Fill(tracks.size());
1882 hPVParam[ 5]->Fill(vtx.
Chi2());
1883 hPVParam[ 6]->Fill(vtx.
NDF());
1884 hPVParam[ 7]->Fill(vtx.
Chi2()/vtx.
NDF());
1885 hPVParam[ 8]->Fill(probPV);
1886 hPVParam[ 9]->Fill(fPVPurity[iPV]);
1887 hPVParam[10]->Fill(fPVTracksRate[0][iPV]);
1888 hPVParam[11]->Fill(fPVTracksRate[1][iPV]);
1889 hPVParam[12]->Fill(fPVTracksRate[2][iPV]);
1890 hPVParam[13]->Fill(fPVTracksRate[3][iPV]);
1891 for(
unsigned int iZ=0; iZ<dzPV.size(); iZ++)
1892 hPVParam[14]->
Fill(dzPV[iZ]);
1894 hPVParam2D[0]->Fill(vtx.
X(),vtx.
Y());
1897 if(!RtoMCPVId[iPV].IsMatchedWithPdg())
1901 hPVParamGhost[ 0]->Fill(vtx.
X());
1902 hPVParamGhost[ 1]->Fill(vtx.
Y());
1903 hPVParamGhost[ 2]->Fill(vtx.
Z());
1904 hPVParamGhost[ 3]->Fill(sqrt(vtx.
X()*vtx.
X() + vtx.
Y()*vtx.
Y()));
1905 hPVParamGhost[ 4]->Fill(tracks.size());
1906 hPVParamGhost[ 5]->Fill(vtx.
Chi2());
1907 hPVParamGhost[ 6]->Fill(vtx.
NDF());
1908 hPVParamGhost[ 7]->Fill(vtx.
Chi2()/vtx.
NDF());
1909 hPVParamGhost[ 8]->Fill(probPV);
1910 hPVParamGhost[ 9]->Fill(fPVPurity[iPV]);
1911 hPVParamGhost[10]->Fill(fPVTracksRate[0][iPV]);
1912 hPVParamGhost[11]->Fill(fPVTracksRate[1][iPV]);
1913 hPVParamGhost[12]->Fill(fPVTracksRate[2][iPV]);
1914 hPVParamGhost[13]->Fill(fPVTracksRate[3][iPV]);
1915 for(
unsigned int iZ=0; iZ<dzPV.size(); iZ++)
1916 hPVParamGhost[14]->
Fill(dzPV[iZ]);
1920 hPVParamBG[ 0]->Fill(vtx.
X());
1921 hPVParamBG[ 1]->Fill(vtx.
Y());
1922 hPVParamBG[ 2]->Fill(vtx.
Z());
1923 hPVParamBG[ 3]->Fill(sqrt(vtx.
X()*vtx.
X() + vtx.
Y()*vtx.
Y()));
1924 hPVParamBG[ 4]->Fill(tracks.size());
1925 hPVParamBG[ 5]->Fill(vtx.
Chi2());
1926 hPVParamBG[ 6]->Fill(vtx.
NDF());
1927 hPVParamBG[ 7]->Fill(vtx.
Chi2()/vtx.
NDF());
1928 hPVParamBG[ 8]->Fill(probPV);
1929 hPVParamBG[ 9]->Fill(fPVPurity[iPV]);
1930 hPVParamBG[10]->Fill(fPVTracksRate[0][iPV]);
1931 hPVParamBG[11]->Fill(fPVTracksRate[1][iPV]);
1932 hPVParamBG[12]->Fill(fPVTracksRate[2][iPV]);
1933 hPVParamBG[13]->Fill(fPVTracksRate[3][iPV]);
1934 for(
unsigned int iZ=0; iZ<dzPV.size(); iZ++)
1935 hPVParamBG[14]->
Fill(dzPV[iZ]);
1940 int iMCPV = RtoMCPVId[iPV].GetBestMatch();
1946 hPVParamSignal[ 0]->Fill(vtx.
X());
1947 hPVParamSignal[ 1]->Fill(vtx.
Y());
1948 hPVParamSignal[ 2]->Fill(vtx.
Z());
1949 hPVParamSignal[ 3]->Fill(sqrt(vtx.
X()*vtx.
X() + vtx.
Y()*vtx.
Y()));
1950 hPVParamSignal[ 4]->Fill(tracks.size());
1951 hPVParamSignal[ 5]->Fill(vtx.
Chi2());
1952 hPVParamSignal[ 6]->Fill(vtx.
NDF());
1953 hPVParamSignal[ 7]->Fill(vtx.
Chi2()/vtx.
NDF());
1954 hPVParamSignal[ 8]->Fill(probPV);
1955 hPVParamSignal[ 9]->Fill(fPVPurity[iPV]);
1956 hPVParamSignal[10]->Fill(fPVTracksRate[0][iPV]);
1957 hPVParamSignal[11]->Fill(fPVTracksRate[1][iPV]);
1958 hPVParamSignal[12]->Fill(fPVTracksRate[2][iPV]);
1959 hPVParamSignal[13]->Fill(fPVTracksRate[3][iPV]);
1960 for(
unsigned int iZ=0; iZ<dzPV.size(); iZ++)
1961 hPVParamSignal[14]->
Fill(dzPV[iZ]);
1965 hPVParamPileup[ 0]->Fill(vtx.
X());
1966 hPVParamPileup[ 1]->Fill(vtx.
Y());
1967 hPVParamPileup[ 2]->Fill(vtx.
Z());
1968 hPVParamPileup[ 3]->Fill(sqrt(vtx.
X()*vtx.
X() + vtx.
Y()*vtx.
Y()));
1969 hPVParamPileup[ 4]->Fill(tracks.size());
1970 hPVParamPileup[ 5]->Fill(vtx.
Chi2());
1971 hPVParamPileup[ 6]->Fill(vtx.
NDF());
1972 hPVParamPileup[ 7]->Fill(vtx.
Chi2()/vtx.
NDF());
1973 hPVParamPileup[ 8]->Fill(probPV);
1974 hPVParamPileup[ 9]->Fill(fPVPurity[iPV]);
1975 hPVParamPileup[10]->Fill(fPVTracksRate[0][iPV]);
1976 hPVParamPileup[11]->Fill(fPVTracksRate[1][iPV]);
1977 hPVParamPileup[12]->Fill(fPVTracksRate[2][iPV]);
1978 hPVParamPileup[13]->Fill(fPVTracksRate[3][iPV]);
1979 for(
unsigned int iZ=0; iZ<dzPV.size(); iZ++)
1980 hPVParamPileup[14]->
Fill(dzPV[iZ]);
1984 float mcPVx[3]={mcPV.
X(), mcPV.
Y(), mcPV.
Z()};
1987 for(
int iErr=0; iErr<3; iErr++)
1988 if(fabs(errPV[iErr]) < 1.
e-8
f) errPV[iErr] = 1.e8;
1990 float dRPVr[3] = {vtx.
X()-mcPVx[0],
1993 float dRPVp[3] = {
static_cast<float>(dRPVr[0]/sqrt(errPV[0])),
1994 static_cast<float>(dRPVr[1]/sqrt(errPV[1])),
1995 static_cast<float>(dRPVr[2]/sqrt(errPV[2]))};
1997 for(
unsigned int iHPV=0; iHPV<3; ++iHPV)
1998 hPVFitQa[iPVType][iHPV]->
Fill(dRPVr[iHPV]);
1999 for(
unsigned int iHPV=3; iHPV<6; ++iHPV)
2000 hPVFitQa[iPVType][iHPV]->
Fill(dRPVp[iHPV-3]);
2002 for(
unsigned int iHPV=0; iHPV<3; ++iHPV)
2003 hPVFitQa2D[iPVType][1][iHPV]->
Fill(fNCorrectPVTracks[iPV],dRPVr[iHPV]);
2004 for(
unsigned int iHPV=3; iHPV<6; ++iHPV)
2005 hPVFitQa2D[iPVType][1][iHPV]->
Fill(fNCorrectPVTracks[iPV],dRPVp[iHPV-3]);
2007 for(
unsigned int iHPV=0; iHPV<3; ++iHPV)
2009 for(
unsigned int iHPV=3; iHPV<6; ++iHPV)
2016 for(
unsigned int iP=0; iP<fTopoReconstructor->GetParticles().size(); iP++)
2018 KFParticle TempPart = fTopoReconstructor->GetParticles()[iP];
2020 if(nDaughters > 1)
continue;
2022 if(!RtoMCParticleId[iP].IsMatchedWithPdg())
continue;
2024 int iMCPart = RtoMCParticleId[iP].GetBestMatchWithPdg();
2028 KFMCTrack &mcTrack = vMCTracks[iMCTrack];
2030 if( mcTrack.
MotherId() > -1 )
continue;
2032 const float mcX = mcTrack.
X();
2033 const float mcY = mcTrack.
Y();
2034 const float mcZ = mcTrack.
Z();
2035 const float mcPx = mcTrack.
Px();
2036 const float mcPy = mcTrack.
Py();
2037 const float mcPz = mcTrack.
Pz();
2039 float decayVtx[3] = {mcX, mcY, mcZ};
2043 Double_t res[6] = {0},
2045 mcParam[6] = { mcX, mcY, mcZ,
2047 for(
int iPar=0; iPar < 6; iPar++ )
2050 if(error < 0.) { error = 1.e20;}
2051 error = TMath::Sqrt(error);
2052 res[iPar] = TempPart.
GetParameter(iPar) - mcParam[iPar];
2053 if(fabs(error) > 1.
e-20) pull[iPar] = res[iPar]/
error;
2055 hFitPVTracksQA[iPar]->Fill(res[iPar]);
2056 hFitPVTracksQA[iPar+6]->Fill(pull[iPar]);
2060 if(fStoreMCHistograms)
2062 for(
int iV=0; iV<6; iV++)
2064 if(hPartParam[iV][iP][17])
2065 hPartParam[iV][iP][17]->Fill(multiplicities[iV][iP]);
2070 if(hPartParam[0][iP][17])
2071 hPartParam[0][iP][17]->Fill(multiplicities[0][iP]);
2074 void KFTopoPerformance::FillMCHistos()
2077 for(
unsigned int iMCTrack=0; iMCTrack<vMCTracks.size(); iMCTrack++)
2079 int iPDG = fParteff.GetParticleIndex(vMCTracks[iMCTrack].
PDG());
2080 if(iPDG < 0)
continue;
2082 if(vMCTracks[iMCTrack].MotherId()>=0)
continue;
2085 float M = fParteff.partMass[iPDG];
2086 float P = vMCTracks[iMCTrack].P();
2087 float Pt = vMCTracks[iMCTrack].Pt();
2088 float E = sqrt(M*M+P*P);
2089 float Rapidity = 0.5*log((E+vMCTracks[iMCTrack].
Pz())/(E-vMCTracks[iMCTrack].
Pz()));
2090 float M_t = sqrt(Pt*Pt+M*M)-M;
2105 X = vMCTracks[iMCTrack].X();
2106 Y = vMCTracks[iMCTrack].Y();
2107 Z = vMCTracks[iMCTrack].Z();
2112 float parameters[17] = {M,
P,
Pt, Rapidity, 0, 0, 0, 0, 0, 0,
X,
Y,
Z,
R, 0, 0, M_t};
2114 for(
int iParam=0; iParam<17; iParam++)
2115 if(hPartParam[6][iPDG][iParam]) hPartParam[6][iPDG][iParam]->Fill(parameters[iParam]);
2117 if(hPartParam2D[6][iPDG][0]) hPartParam2D[6][iPDG][0]->Fill(Rapidity,Pt,1);
2118 if(hPartParam2D[6][iPDG][3]) hPartParam2D[6][iPDG][3]->Fill(Rapidity,M_t,1);
2120 if(IsCollectZRHistogram(iPDG))
2121 if(hPartParam2D[6][iPDG][1]) hPartParam2D[6][iPDG][1]->Fill(Z,R,1);
2128 if(vMCTracks[index1].Par(6) > 0)
2130 positive = vMCTracks[
index1];
2131 negative = vMCTracks[
index2];
2135 negative = vMCTracks[
index1];
2136 positive = vMCTracks[
index2];
2139 float alpha = 0., qt = 0.;
2140 float spx = positive.
Px() + negative.
Px();
2141 float spy = positive.
Py() + negative.
Py();
2142 float spz = positive.
Pz() + negative.
Pz();
2143 float sp = sqrt(spx*spx + spy*spy + spz*spz);
2145 pn = sqrt(negative.
Px()*negative.
Px() + negative.
Py()*negative.
Py() + negative.
Pz()*negative.
Pz());
2146 pln = (negative.
Px()*spx+negative.
Py()*spy+negative.
Pz()*spz)/sp;
2147 plp = (positive.
Px()*spx+positive.
Py()*spy+positive.
Pz()*spz)/sp;
2148 float ptm = (1.-((pln/pn)*(pln/pn)));
2149 qt= (ptm>=0.)? pn*sqrt(ptm) :0;
2150 alpha = (plp-pln)/(plp+pln);
2152 if(hPartParam2D[6][iPDG][2]) hPartParam2D[6][iPDG][2]->Fill(alpha,qt,1);
2157 void KFTopoPerformance::AddV0Histos()
2160 int iV0 = fParteff.nParticles - 1;
2161 int iK0 = fParteff.GetParticleIndex(310);
2163 for(
int iH=0; iH<nFitQA; iH++)
2165 hFitDaughtersQA[iV0][iH]->Add(hFitDaughtersQA[iK0][iH]);
2166 hFitQA[iV0][iH]->Add(hFitQA[iK0][iH]);
2169 for(
int iV=0; iV<4; iV++)
2170 for(
int iH=0; iH<nHistoPartParam; iH++)
2171 hPartParam[iV][iV0][iH]->Add(hPartParam[iV][iK0][iH]);
2174 void KFTopoPerformance::FillHistos(
const KFPHistogram* histograms)
2180 for(
int iHistogram=0; iHistogram<nHistograms; iHistogram++)
2183 for(
int iBin=0; iBin<histogram.
Size(); iBin++)
2189 #endif //DO_TPCCATRACKER_EFF_PERFORMANCE