本文整理汇总了C++中TParticle::SetWeight方法的典型用法代码示例。如果您正苦于以下问题:C++ TParticle::SetWeight方法的具体用法?C++ TParticle::SetWeight怎么用?C++ TParticle::SetWeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TParticle
的用法示例。
在下文中一共展示了TParticle::SetWeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PushTrack
//_____________________________________________________________________________
void amsvmc_MCStack::PushTrack(Int_t toBeDone, Int_t parent, Int_t pdg,
Double_t px, Double_t py, Double_t pz, Double_t e,
Double_t vx, Double_t vy, Double_t vz, Double_t tof,
Double_t polx, Double_t poly, Double_t polz,
TMCProcess mech, Int_t& ntr, Double_t weight,
Int_t is)
{
// cout<<"DEBUG in amsvmc_MCStack::PushTrack, about to call"<<endl;
/// Create a new particle and push into stack;
/// adds it to the particles array (fParticles) and if not done to the
/// stack (fStack).
/// Use TParticle::fMother[1] to store Track ID.
/// \param toBeDone 1 if particles should go to tracking, 0 otherwise
/// \param parent number of the parent track, -1 if track is primary
/// \param pdg PDG encoding
/// \param px particle momentum - x component [GeV/c]
/// \param py particle momentum - y component [GeV/c]
/// \param pz particle momentum - z component [GeV/c]
/// \param e total energy [GeV]
/// \param vx position - x component [cm]
/// \param vy position - y component [cm]
/// \param vz position - z component [cm]
/// \param tof time of flight [s]
/// \param polx polarization - x component
/// \param poly polarization - y component
/// \param polz polarization - z component
/// \param mech creator process VMC code
/// \param ntr track number (is filled by the stack
/// \param weight particle weight
/// \param is generation status code
const Int_t kFirstDaughter=-1;
const Int_t kLastDaughter=-1;
TClonesArray& particlesRef = *fParticles;
Int_t trackId = GetNtrack();
TParticle* particle
= new(particlesRef[trackId])
TParticle(pdg, is, parent, trackId, kFirstDaughter, kLastDaughter,
px, py, pz, e, vx, vy, vz, tof);
particle->SetPolarisation(polx, poly, polz);
particle->SetWeight(weight);
particle->SetUniqueID(mech);
if (parent<0) fNPrimary++;
if (toBeDone && pdg!=50000050)
{
// cout<<"DEBUG: a track is pushed into fStack, "<<pdg<<", stack number increased to"<<GetNtrack()<<endl;
// printf("momemtum: px= %f, py= %f,pz= %f; position:x=%f, y=%f,z=%f; Total momemtum: %f \n",px,py,pz,vx,vy,vz,particle->P());
fStack.push(particle);
}
if (toBeDone && pdg==50000050 )
{
float p=particle->P();
//pow(px*px+py*py+pz*pz,0.5);
bool vmc_richpmtcut=RICHDB::detcer(p);
// cout<<"vmc_richpmtcut"<<vmc_richpmtcut<<endl;
if(vmc_richpmtcut){
// cout<<"DEBUG: a Cerenkov photon is produced, "<<pdg<<", P ="<<p<<endl;
// cout<<"DEBUG: a Cerenkov photon is pushed into fStack, "<<pdg<<", stack number increased to"<<GetNtrack()<<endl;
// printf("momemtum: px= %f, py= %f,pz= %f; position:x=%f, y=%f,z=%f; tof: %f \n",px*10000,py*10000,pz*10000,vx,vy,vz,tof);
fStack.push(particle);
}
}
ntr = GetNtrack() - 1;
// cout<<"DEBUG: in PushTracks:"<<endl;
// cout<<"parent = "<<parent<<endl;
// cout<<"trackID:"<<trackId<<endl;
// cout<<"ntr="<<ntr<<endl;
// cout<<"Particle is : "<< pdg<<endl;
}