本文整理汇总了C++中TParticle::GetFirstMother方法的典型用法代码示例。如果您正苦于以下问题:C++ TParticle::GetFirstMother方法的具体用法?C++ TParticle::GetFirstMother怎么用?C++ TParticle::GetFirstMother使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TParticle
的用法示例。
在下文中一共展示了TParticle::GetFirstMother方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCurrentParentTrackNumber
//_____________________________________________________________________________
Int_t amsvmc_MCStack::GetCurrentParentTrackNumber() const
{
/// \return The current track parent ID.
TParticle* current = GetCurrentTrack();
if (current)
return current->GetFirstMother();
else
return -1;
}
示例2: TOFquickanal
//.........这里部分代码省略.........
tofl->LoadHits();
TTree *TH = tofl->TreeH();
tof->SetTreeAddress();
if (!TH) {
cout << "<TOFquickanal> No hit tree found" << endl;
rc = 4;
return rc;
}
// Import the Kine Tree for the event eventNumber in the file
rl->LoadHeader();
rl->LoadKinematics();
//AliStack * stack = rl->Stack();
Int_t ntracks = TH->GetEntries();
cout<<" ntracks = "<<ntracks<<endl;
AliTOFhitT0 *tofHit;
// Start loop on tracks in the hits containers
for (Int_t track=0; track<ntracks;track++) {
tof->ResetHits();
TH->GetEvent(track);
for(tofHit=(AliTOFhitT0*)tof->FirstHit(track); tofHit; tofHit=(AliTOFhitT0*)tof->NextHit()) {
Float_t toflight = tofHit->GetTof();
toflight *= 1.E+09; // conversion from s to ns
Double_t tofmom = tofHit->GetMom();
Int_t ipart = tofHit->Track();
TParticle *particle = gAlice->Particle(ipart);
if (particle->GetFirstMother() < 0) {
htofprim->Fill(toflight);
htofmom->Fill(tofmom);
} else {
htofsec->Fill(toflight);
}
Double_t zcoor = tofHit->Z();
hzcoor->Fill(zcoor);
Double_t incangle = tofHit->GetIncA();
hincangle->Fill(incangle);
Double_t xcoor = particle->Vx();
Double_t ycoor = particle->Vy();
Double_t radius = TMath::Sqrt(xcoor*xcoor+ycoor*ycoor);
if (particle->GetFirstMother() >= 0) hradius->Fill(radius);
Double_t prodmom = particle->P();
if (prodmom!=0.) {
Double_t dummy = (particle->Pz())/prodmom;
Double_t prodthe = TMath::ACos(dummy);
prodthe *= 57.29578; // conversion from rad to deg
if (particle->GetFirstMother() < 0) hprodthe->Fill(prodthe);
} // theta at production vertex
if (particle->GetFirstMother() < 0) {
hprodmom->Fill(prodmom);
Double_t dummypx = particle->Px();
Double_t dummypy = particle->Py();
Double_t prodphi = TMath::ATan2(dummypy,dummypx);
prodphi *= 57.29578; // conversion from rad to deg
hprodphi->Fill(prodphi);