/*
$Log$
+Revision 1.13 2000/12/21 16:24:06 morsch
+Coding convention clean-up
+
Revision 1.12 2000/11/30 07:12:50 alibrary
Introducing new Rndm and QA classes
// whole volume of the MUON Arm
fZshift=0;
// Set the default file
- fFileName="flukasource.root";
+ fFileName="";
fTreeFluka=0;
fTreeChain = new TChain("h1");
//
// Read all particles
fNpart=-1;
-
-
}
AliGenFLUKAsource::AliGenFLUKAsource(Int_t npart)
// whole volume of the MUON Arm
fZshift=0;
// Set the default file
- fFileName="flukasource.root";
+ fFileName="";
fTreeFluka=0;
fTreeChain = new TChain("h1");
TChain *h2=fTreeChain;
Int_t nentries = (Int_t) h2->GetEntries();
if (fNpart == -1) fNpart=Int_t(nentries*fFrac);
-
+
+
// loop over number of particles
Int_t nb=0;
Int_t ev=gMC->CurrentEvent();
printf("Generate - I'm out \n");
return;
}
+
+ Int_t ifip = Int_t(fIp);
+
if (fSourceId != -1 && fIgas !=fSourceId) {
irwn++;
continue;
}
- if (fIp > 28 || fIp < 0) {
+ if (ifip > 28 || ifip < 0) {
irwn++;
continue;
}
- if ((fIp != fIkine && fIkine != 6 && fIkine != 9 && fIkine != 10) || fAge > fAgeMax){
+ if ((ifip != fIkine && fIkine != kAll && fIkine != kCharged
+ && fIkine != 10) || fAge > fAgeMax){
irwn++;
continue;
- } else if (fIkine == 9) {
- if (fIp == 7 || fIp == 8 || fAge > fAgeMax) {
+ } else if (fIkine == kCharged) {
+ if (ifip == 7 || ifip == 8 || fAge > fAgeMax) {
irwn++;
continue;
}
- } else if (fIkine == 10) {
- if (fIp == 8 || fAge > fAgeMax) {
+ } else if (fIkine == kNoNeutron) {
+ if (ifip == 8 || fAge > fAgeMax) {
irwn++;
continue;
}
irwn++;
//
-// PDG code from FLUKA particle type (fIp)
- part=kIfluge[int(fIp)-1];
+// PDG code from FLUKA particle type (ifip)
+ part=kIfluge[int(ifip)-1];
//
// Calculate momentum from kinetic energy and mass of the particle
gMC->Gfpart(part, name, itrtyp,
{
public:
- AliGenFLUKAsource();
- AliGenFLUKAsource(Int_t npart);
- AliGenFLUKAsource(const AliGenFLUKAsource &FLUKAsource);
- virtual ~AliGenFLUKAsource();
- // Initialise
- virtual void Init() {}
- // Initialise fluka data
- virtual void FlukaInit();
- // choose particle type
- virtual void SetPartFlag(Int_t ikine) {fIkine=ikine;}
- // set time cut
- virtual void SetAgeMax(Float_t agemax) {fAgeMax=agemax;}
- // use additional weight on neutrals
- virtual void SetAddWeight(Float_t addwgt) {fAddWeight=addwgt;}
- // z-shift of vertex
- virtual void SetZshift(Float_t zshift) {fZshift=zshift;}
- // set file name of data file
- virtual void SetFileName(const Text_t *filname) {fFileName=filname;}
- // set source
- virtual void SetSourceId(Int_t id=-1){fSourceId=id;}
- // add a new source file
- virtual void AddFile(const Text_t *filname) ;
- // read only fraction of data
- virtual void SetFraction(Float_t frac=1.){fFrac=frac;}
- // generate event
- virtual void Generate();
- AliGenFLUKAsource & operator=(const AliGenFLUKAsource & rhs);
-protected:
-
- Int_t fIkine; // Flag to choose type of particles to be read in
- // 6 - all particles types
- // 7 - only gammas
- // 8 - only neutrons
- // 9 - only charged particles
- Float_t fAgeMax; // Maximum age of particle
- Float_t fAddWeight; // Add weight for neutrons
- Float_t fZshift; // Shift the Z of impact point by this quantity
- Float_t fFrac; // Fraction of file that corresponds to one event
- Int_t fSourceId; // Source identifier (-1: all sources)
+ enum constants {kAll = 6, kGammas = 7, kNeutrons = 8, kCharged = 9, kNoNeutron = 10};
+
+ AliGenFLUKAsource();
+ AliGenFLUKAsource(Int_t npart);
+ AliGenFLUKAsource(const AliGenFLUKAsource &FLUKAsource);
+ virtual ~AliGenFLUKAsource();
+ // Initialise
+ virtual void Init() {}
+ // Initialise fluka data
+ virtual void FlukaInit();
+ // choose particle type
+ virtual void SetPartFlag(Int_t ikine) {fIkine=ikine;}
+ // set time cut
+ virtual void SetAgeMax(Float_t agemax) {fAgeMax=agemax;}
+ // use additional weight on neutrals
+ virtual void SetAddWeight(Float_t addwgt) {fAddWeight=addwgt;}
+ // z-shift of vertex
+ virtual void SetZshift(Float_t zshift) {fZshift=zshift;}
+ // set file name of data file
+ virtual void SetFileName(const Text_t *filname) {fFileName=filname;}
+ // set source
+ virtual void SetSourceId(Int_t id=-1){fSourceId=id;}
+ // add a new source file
+ virtual void AddFile(const Text_t *filname) ;
+ // read only fraction of data
+ virtual void SetFraction(Float_t frac=1.){fFrac=frac;}
+ // generate event
+ virtual void Generate();
+ AliGenFLUKAsource & operator=(const AliGenFLUKAsource & rhs);
+ protected:
+
+ Int_t fIkine; // Flag to choose type of particles to be read
+ Float_t fAgeMax; // Maximum age of particle
+ Float_t fAddWeight; // Add weight for neutrons
+ Float_t fZshift; // Shift the Z of impact point by this quantity
+ Float_t fFrac; // Fraction of file that corresponds to one event
+ Int_t fSourceId; // Source identifier (-1: all sources)
- const Text_t *fFileName; //!Choose the file
- TChain *fTreeChain; //file chaining
- TTree *fTreeFluka; //pointer to the TTree
+ const Text_t *fFileName; //!Choose the file
+ TChain *fTreeChain; //file chaining
+ TTree *fTreeFluka; //pointer to the TTree
//Declaration of variables read from the file -- TTree type
- Float_t fIp; // Particle type
- Float_t fIpp; // Primary particle type
- Float_t fXi; // x-Impact
- Float_t fYi; // y-Impact
- Float_t fZi; // z-Impact
- Float_t fPx; // Direction cosine x
- Float_t fPy; // Direction cosine y
- Float_t fPz; // Direction cosine z
- Float_t fEkin; // Kinetic energy
- Float_t fZv; // z-Position of particle vertex
- Float_t fRv; // r-Position of particle vertex
- Float_t fItra; // Primary track number
- Float_t fIgas; // Volume identifier
- Float_t fWgt; // Particle weight
- Float_t fEtag; // Pseudorapidity of primary particle
- Float_t fPtg; // Pt of primary particle
- Float_t fAge; // Time of flight
-
-
-
- ClassDef(AliGenFLUKAsource,1) //Boundary source
+ Float_t fIp; // Particle type
+ Float_t fIpp; // Primary particle type
+ Float_t fXi; // x-Impact
+ Float_t fYi; // y-Impact
+ Float_t fZi; // z-Impact
+ Float_t fPx; // Direction cosine x
+ Float_t fPy; // Direction cosine y
+ Float_t fPz; // Direction cosine z
+ Float_t fEkin; // Kinetic energy
+ Float_t fZv; // z-Position of particle vertex
+ Float_t fRv; // r-Position of particle vertex
+ Float_t fItra; // Primary track number
+ Float_t fIgas; // Volume identifier
+ Float_t fWgt; // Particle weight
+ Float_t fEtag; // Pseudorapidity of primary particle
+ Float_t fPtg; // Pt of primary particle
+ Float_t fAge; // Time of flight
+
+
+
+ ClassDef(AliGenFLUKAsource,1) //Boundary source
};
#endif