#include <TTree.h>
- ClassImp(AliGenExtFile)
+ClassImp(AliGenExtFile)
AliGenExtFile::AliGenExtFile()
:AliGenMC()
fReader = 0;
}
-AliGenExtFile::AliGenExtFile(const AliGenExtFile & ExtFile)
+AliGenExtFile::AliGenExtFile(const AliGenExtFile & ExtFile):
+ AliGenMC(ExtFile)
{
-// copy constructor
+// Copy constructor
+ ExtFile.Copy(*this);
}
//____________________________________________________________
AliGenExtFile::~AliGenExtFile()
Float_t origin[3] = {0,0,0};
Float_t p[3];
Float_t random[6];
- Int_t i, j, nt;
+ Int_t i = 0, j, nt;
//
for (j=0;j<3;j++) origin[j]=fOrigin[j];
if(fVertexSmear == kPerTrack) {
//
// The selction criterium for the external file generator is as follows:
//
- // 1) All tracs are subjects to the cuts defined by AliGenerator, i.e.
+ // 1) All tracks are subjects to the cuts defined by AliGenerator, i.e.
// fThetaMin, fThetaMax, fPhiMin, fPhiMax, fPMin, fPMax, fPtMin, fPtMax,
// fYMin, fYMax.
// If the particle does not satisfy these cuts, it is not put on the
// 2) If fCutOnChild and some specific child is selected (e.g. if
// fForceDecay==kSemiElectronic) the event is rejected if NOT EVEN ONE
// child falls into the child-cuts.
+ TParticle* iparticle = 0x0;
+
if(fCutOnChild) {
// Count the selected children
Int_t nSelected = 0;
-
- for (i = 0; i < nTracks; i++) {
- TParticle* iparticle = fReader->NextParticle();
+ while ( (iparticle=fReader->NextParticle()) ) {
+ ;
Int_t kf = CheckPDGCode(iparticle->GetPdgCode());
kf = TMath::Abs(kf);
if (ChildSelected(kf) && KinematicSelection(iparticle, 1)) {
p[1] = iparticle->Py();
p[2] = iparticle->Pz();
Int_t idpart = iparticle->GetPdgCode();
- if(fVertexSmear==kPerTrack) {
- Rndm(random,6);
- for (j = 0; j < 3; j++) {
- origin[j]=fOrigin[j]
- +fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
- TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
- }
+ if(fVertexSmear==kPerTrack)
+ {
+ Rndm(random,6);
+ for (j = 0; j < 3; j++) {
+ origin[j]=fOrigin[j]+
+ fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
+ TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
+ }
}
Int_t decayed = iparticle->GetFirstDaughter();
Int_t doTracking = fTrackIt && (decayed < 0) &&
(TMath::Abs(idpart) > 10) && selected;
// printf("*** pdg, first daughter, trk = %d, %d, %d\n",
// idpart,decayed, doTracking);
- //PH SetTrack(doTracking,-1,idpart,p,origin,polar,0,kPPrimary,nt);
+ //PH PushTrack(doTracking,-1,idpart,p,origin,polar,0,kPPrimary,nt);
Int_t parent = iparticle->GetFirstMother();
- SetTrack(doTracking,parent,idpart,p,origin,polar,0,kPPrimary,nt);
+ PushTrack(doTracking,parent,idpart,p,origin,polar,0,kPPrimary,nt);
KeepTrack(nt);
} // track loop
AliGenExtFile& AliGenExtFile::operator=(const AliGenExtFile& rhs)
{
// Assignment operator
+ rhs.Copy(*this);
return *this;
}
+
+void AliGenExtFile::Copy(TObject&) const
+{
+ //
+ // Copy
+ //
+ Fatal("Copy","Not implemented!\n");
+}