Skip to content

Commit

Permalink
Add missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
sawenzel committed Jul 1, 2024
1 parent 2a54e2e commit e59364e
Show file tree
Hide file tree
Showing 4 changed files with 1,494 additions and 0 deletions.
52 changes: 52 additions & 0 deletions GeneratorParam/TMCParticle.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// @(#)root/pythia6:$Id$
// Author: Piotr Golonka 17/09/97

/** \class TMCParticle
\ingroup pythia6
This class serves as a data storage for description of one particle.
It is especially convenient to store information taken from LUJETS common,
which is done by interface class TPythia.
Author: Piotr Golonka 17/09/97
*/

#include "TMCParticle.h"
#include "TPrimary.h"

#ifndef WIN32
# define pyname pyname_
extern "C" void pyname(const Int_t &kf, const char *name, const Int_t len);
#else
# define pyname PYNAME
extern "C" void pyname(const Int_t &kf, const char *name, const Int_t len);
#endif

ClassImp(TMCParticle);

////////////////////////////////////////////////////////////////////////////////

void TMCParticle::ls(Option_t *) const
{
printf("(%2i,%4i) <-%3i, =>[%3i,%3i]",fKS,fKF,fParent,
fFirstChild,fLastChild);
printf(": p=(%7.3f,%7.3f,%9.3f) ;",fPx,fPy,fPz);

printf(" E=%8.3f ; m=%7.3f ; V=(%g,%g,%g); t=%g, tau=%g\n",
fEnergy,fMass,fVx,fVy,fVz,fTime,fLifetime);
}

////////////////////////////////////////////////////////////////////////////////
/// Return name of this particle via Pythia

const char *TMCParticle::GetName() const
{
static char name[20];
pyname(fKF,name,16); name[15] = 0;
for (Int_t i=14;i>0;i--) {
if (name[i] != ' ') break;
name[i] = 0;
}
return name;
}
117 changes: 117 additions & 0 deletions GeneratorParam/TMCParticle.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
// @(#)root/pythia6:$Id$
// Author: Piotr Golonka 17/09/97

/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

#ifndef ROOT_TMCParticle
#define ROOT_TMCParticle

#include "TObject.h"
#include "TAttLine.h"
#include "TPrimary.h"


class TMCParticle : public TObject, public TAttLine {

private:

Int_t fKS; // status of particle ( LUJETS K[1] )
Int_t fKF; // KF flavour code ( LUJETS K[2] )
Int_t fParent; // parrent's id ( LUJETS K[3] )
Int_t fFirstChild; // id of first child ( LUJETS K[4] )
Int_t fLastChild; // id of last child ( LUJETS K[5] )

Float_t fPx; // X momenta [GeV/c] ( LUJETS P[1] )
Float_t fPy; // Y momenta [GeV/c] ( LUJETS P[2] )
Float_t fPz; // Z momenta [GeV/c] ( LUJETS P[3] )
Float_t fEnergy; // Energy [GeV] ( LUJETS P[4] )
Float_t fMass; // Mass [Gev/c^2] ( LUJETS P[5] )

Float_t fVx; // X vertex [mm] ( LUJETS V[1] )
Float_t fVy; // Y vertex [mm] ( LUJETS V[2] )
Float_t fVz; // Z vertex [mm] ( LUJETS V[3] )
Float_t fTime; // time of procuction [mm/c]( LUJETS V[4] )
Float_t fLifetime; // proper lifetime [mm/c] ( LUJETS V[5] )


public:
TMCParticle() : fKS(0), fKF(0), fParent(0), fFirstChild(0),
fLastChild(0), fPx(0), fPy(0), fPz(0), fEnergy(0), fMass(0),
fVx(0), fVy(0), fVz(0), fTime(0), fLifetime(0) {}

TMCParticle(Int_t kS, Int_t kF, Int_t parent,
Int_t firstchild, Int_t lastchild,
Float_t px, Float_t py, Float_t pz,
Float_t energy, Float_t mass,
Float_t vx, Float_t vy, Float_t vz,
Float_t time, Float_t lifetime) :

fKS(kS),
fKF(kF),
fParent(parent),
fFirstChild(firstchild),
fLastChild(lastchild),
fPx(px),
fPy(py),
fPz(pz),
fEnergy(energy),
fMass(mass),
fVx(vx),
fVy(vy),
fVz(vz),
fTime(time),
fLifetime(lifetime) { }


~TMCParticle() override { }

Int_t GetKS() const {return fKS;}
Int_t GetKF() const {return fKF;}
Int_t GetParent() const {return fParent;}
Int_t GetFirstChild() const {return fFirstChild;}
Int_t GetLastChild() const {return fLastChild;}

Float_t GetPx() const {return fPx;}
Float_t GetPy() const {return fPy;}
Float_t GetPz() const {return fPz;}
Float_t GetEnergy() const {return fEnergy;}
Float_t GetMass() const {return fMass;}

Float_t GetVx() const {return fVx;}
Float_t GetVy() const {return fVy;}
Float_t GetVz() const {return fVz;}
Float_t GetTime() const {return fTime;}
Float_t GetLifetime() const {return fLifetime;}
const char *GetName() const override;

virtual void SetKS(Int_t kS) {fKS=kS;}
virtual void SetKF(Int_t kF) {fKF=kF;}
virtual void SetParent(Int_t parent) {fParent=parent;}
virtual void SetFirstChild(Int_t first) {fFirstChild=first;}
virtual void SetLastChild(Int_t last) {fLastChild=last;}

virtual void SetPx(Float_t px) {fPx=px;}
virtual void SetPy(Float_t py) {fPy=py;}
virtual void SetPz(Float_t pz) {fPz=pz;}
virtual void SetEnergy(Float_t energy) {fEnergy=energy;}
virtual void SetMass(Float_t mass) {fMass=mass;}

virtual void SetVx(Float_t vx) {fVx=vx;}
virtual void SetVy(Float_t vy) {fVy=vy;}
virtual void SetVz(Float_t vz) {fVz=vz;}
virtual void SetTime(Float_t time) {fTime=time;}
virtual void SetLifetime(Float_t lifetime) {fLifetime=lifetime;}


void ls(Option_t* option) const override;

ClassDefOverride(TMCParticle,1) // LUJETS particles data record.
};

#endif
Loading

0 comments on commit e59364e

Please sign in to comment.