/*
$Log$
+Revision 1.4 2000/03/20 18:03:24 morsch
+Change muon particle code to PDG code.
+
Revision 1.3 1999/09/29 09:24:08 fca
Introduction of the Copyright and cvs Log
//
//
#include "AliDimuCombinator.h"
-#include "AliRun.h"
#include "AliPDG.h"
-#include "TRandom.h"
+#include <TRandom.h>
+#include <TClonesArray.h>
+#include <TParticle.h>
//
ClassImp(AliDimuCombinator)
+ AliDimuCombinator::AliDimuCombinator(TClonesArray* Partarray)
+{
+// Constructor
+ fPartArray=Partarray;
+ fNParticle=fPartArray->GetEntriesFast();
+
+ fimuon1 =0;
+ fimuon2 =0;
+ fmuon1 =0;
+ fmuon2 =0;
+ fimin1 = 0;
+ fimin2 = 0;
+ fimax1 = fNParticle;
+ fimax2 = fNParticle;
+ fPtMin =0;
+ fEtaMin =-10;
+ fEtaMax =-10;
+ fRate1=1.;
+ fRate2=1.;
+}
+
+AliDimuCombinator::AliDimuCombinator(const AliDimuCombinator & combinator)
+{
+// copy constructor
+}
+
+
//
// Iterators
//
- TParticle* AliDimuCombinator::FirstMuon()
- {
- fimuon1=fimin1;
- fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
- while(Type(fmuon1)!=kMuonPlus && Type(fmuon1)!=kMuonMinus) {
- fimuon1++;
- if (fimuon1 >= fimax1) {fmuon1=0; break;}
- fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
- }
- return fmuon1;
- }
-
- TParticle* AliDimuCombinator::FirstMuonSelected()
- {
- TParticle * muon=FirstMuon();
- while(muon!=0 && !Selected(muon)) {muon=NextMuon();}
- return muon;
- }
-
-
- TParticle* AliDimuCombinator::NextMuon()
- {
- fimuon1++;
- if (fimuon1>=fNParticle) {fmuon1 = 0; return fmuon1;}
-
- fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
- while(Type(fmuon1)!=kMuonPlus && Type(fmuon1)!=kMuonMinus) {
- fimuon1++;
- if (fimuon1>=fimax1) {fmuon1 = 0; break;}
- fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
- }
- return fmuon1;
- }
+TParticle* AliDimuCombinator::FirstMuon()
+{
+// Single muon iterator: initialisation
+ fimuon1=fimin1;
+ fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
+ while(Type(fmuon1)!=kMuonPlus && Type(fmuon1)!=kMuonMinus) {
+ fimuon1++;
+ if (fimuon1 >= fimax1) {fmuon1=0; break;}
+ fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
+ }
+ return fmuon1;
+}
+
+TParticle* AliDimuCombinator::FirstMuonSelected()
+{
+// Single selected muon iterator: initialisation
+ TParticle * muon=FirstMuon();
+ while(muon!=0 && !Selected(muon)) {muon=NextMuon();}
+ return muon;
+}
+
+
+TParticle* AliDimuCombinator::NextMuon()
+{
+// Single muon iterator: increment
+ fimuon1++;
+ if (fimuon1>=fNParticle) {fmuon1 = 0; return fmuon1;}
+
+ fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
+ while(Type(fmuon1)!=kMuonPlus && Type(fmuon1)!=kMuonMinus) {
+ fimuon1++;
+ if (fimuon1>=fimax1) {fmuon1 = 0; break;}
+ fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
+ }
+ return fmuon1;
+}
TParticle* AliDimuCombinator::NextMuonSelected()
- {
- TParticle * muon=NextMuon();
- while(muon !=0 && !Selected(muon)) {muon=NextMuon();}
- return muon;
- }
-
-
- void AliDimuCombinator::FirstPartner()
- {
- if (fimin1==fimin2) {
- fimuon2=fimuon1+1;
- } else {
- fimuon2=fimin2;
- }
- if (fimuon2 >= fimax2) {fmuon2=0; return;}
- fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
- while(Type(fmuon2)!=kMuonPlus && Type(fmuon2)!=kMuonMinus) {
- fimuon2++;
- if (fimuon2 >= fimax2) {fmuon2=0; break;}
- fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
- }
- }
-void AliDimuCombinator::FirstPartnerSelected()
{
- FirstPartner();
- while(fmuon2 !=0 && !Selected(fmuon2)) {NextPartner();}
+// Single selected muon iterator: increment
+ TParticle * muon=NextMuon();
+ while(muon !=0 && !Selected(muon)) {muon=NextMuon();}
+ return muon;
}
- void AliDimuCombinator::NextPartner()
- {
- fimuon2++;
- if (fimuon2>=fimax2) {fmuon2 = 0; return;}
+void AliDimuCombinator::FirstPartner()
+{
+// Helper for dimuon iterator: initialisation
+ if (fimin1==fimin2) {
+ fimuon2=fimuon1+1;
+ } else {
+ fimuon2=fimin2;
+ }
+ if (fimuon2 >= fimax2) {fmuon2=0; return;}
+ fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
+ while(Type(fmuon2)!=kMuonPlus && Type(fmuon2)!=kMuonMinus) {
+ fimuon2++;
+ if (fimuon2 >= fimax2) {fmuon2=0; break;}
+ fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
+ }
+}
-
- fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
+void AliDimuCombinator::FirstPartnerSelected()
+{
+// Helper for selected dimuon iterator: initialisation
+ FirstPartner();
+ while(fmuon2 !=0 && !Selected(fmuon2)) {NextPartner();}
+}
- while(Type(fmuon2)!=kMuonPlus && Type(fmuon2)!=kMuonMinus) {
- fimuon2++;
- if (fimuon2>=fimax2) {fmuon2 = 0; break;}
- fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
- }
- }
+void AliDimuCombinator::NextPartner()
+{
+// Helper for dimuon iterator: increment
+ fimuon2++;
+ if (fimuon2>=fimax2) {fmuon2 = 0; return;}
+
+
+ fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
+
+ while(Type(fmuon2)!=kMuonPlus && Type(fmuon2)!=kMuonMinus) {
+ fimuon2++;
+ if (fimuon2>=fimax2) {fmuon2 = 0; break;}
+ fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
+ }
+}
void AliDimuCombinator::NextPartnerSelected()
{
- NextPartner();
- while(fmuon2 !=0 && !Selected(fmuon2)) {NextPartner();}
+// Helper for selected dimuon iterator: increment
+ NextPartner();
+ while(fmuon2 !=0 && !Selected(fmuon2)) {NextPartner();}
}
- TParticle* AliDimuCombinator::Partner()
- {
- return fmuon2;
- }
+TParticle* AliDimuCombinator::Partner()
+{
+// Returns current partner for muon to form a dimuon
+ return fmuon2;
+}
void AliDimuCombinator::FirstMuonPair(TParticle* & muon1, TParticle* & muon2)
- {
- FirstMuon();
- FirstPartner();
- muon1=fmuon1;
- muon2=fmuon2;
- }
+{
+// Dimuon iterator: initialisation
+ FirstMuon();
+ FirstPartner();
+ muon1=fmuon1;
+ muon2=fmuon2;
+}
+
void AliDimuCombinator::NextMuonPair(TParticle* & muon1, TParticle* & muon2)
- {
- NextPartner();
- if (!Partner()) {
- NextMuon();
- FirstPartner();
- }
- muon1=fmuon1;
- muon2=fmuon2;
- }
-void AliDimuCombinator::FirstMuonPairSelected(TParticle* & muon1, TParticle* & muon2)
- {
- FirstMuonSelected();
- FirstPartnerSelected();
- muon1=fmuon1;
- muon2=fmuon2;
- }
-void AliDimuCombinator::NextMuonPairSelected(TParticle* & muon1, TParticle* & muon2)
- {
- NextPartnerSelected();
- if (!Partner()) {
- NextMuonSelected();
- FirstPartnerSelected();
- }
- muon1=fmuon1;
- muon2=fmuon2;
- }
+{
+// Dimuon iterator: increment
+ NextPartner();
+ if (!Partner()) {
+ NextMuon();
+ FirstPartner();
+ }
+ muon1=fmuon1;
+ muon2=fmuon2;
+}
+void AliDimuCombinator::FirstMuonPairSelected(TParticle* & muon1,
+ TParticle* & muon2)
+{
+// Selected dimuon iterator: initialisation
+ FirstMuonSelected();
+ FirstPartnerSelected();
+ muon1=fmuon1;
+ muon2=fmuon2;
+}
+
+void AliDimuCombinator::NextMuonPairSelected(TParticle* & muon1,
+ TParticle* & muon2)
+{
+// Selected dimuon iterator: increment
+ NextPartnerSelected();
+ if (!Partner()) {
+ NextMuonSelected();
+ FirstPartnerSelected();
+ }
+ muon1=fmuon1;
+ muon2=fmuon2;
+}
+
void AliDimuCombinator::ResetRange()
{
+// Reset index ranges for single muons
fimin1=fimin2=0;
fimax1=fimax2=fNParticle;
}
void AliDimuCombinator::SetFirstRange(Int_t from, Int_t to)
{
+// Reset index range for first muon
fimin1=from;
fimax1=to;
if (fimax1 > fNParticle) fimax1=fNParticle;
void AliDimuCombinator::SetSecondRange(Int_t from, Int_t to)
{
+// Reset index range for second muon
fimin2=from;
fimax2=to;
if (fimax2 > fNParticle) fimax2=fNParticle;
Bool_t AliDimuCombinator::Selected(TParticle* part)
{
-//
+// Selection cut for single muon
//
if (part==0) {return 0;}
} else {
return 0;
}
-
-
}
Bool_t AliDimuCombinator::Selected(TParticle* part1, TParticle* part2)
{
+// Selection cut for dimuons
+//
return Selected(part1)*Selected(part2);
}
//
//
Float_t AliDimuCombinator::Mass(TParticle* part1, TParticle* part2)
{
+// Invariant mass
+//
Float_t px,py,pz,e;
px=part1->Px()+part2->Px();
py=part1->Py()+part2->Py();
Float_t AliDimuCombinator::PT(TParticle* part1, TParticle* part2)
{
+// Transverse momentum of dimuons
+//
Float_t px,py;
px=part1->Px()+part2->Px();
py=part1->Py()+part2->Py();
Float_t AliDimuCombinator::Pz(TParticle* part1, TParticle* part2)
{
+// Pz of dimuon system
+//
return part1->Pz()+part2->Pz();
}
Float_t AliDimuCombinator::Y(TParticle* part1, TParticle* part2)
{
+// Rapidity of dimuon system
+//
Float_t pz,e;
pz=part1->Pz()+part2->Pz();
e =part1->Energy()+part2->Energy();
//
void AliDimuCombinator::SmearGauss(Float_t width, Float_t & value)
{
+// Apply gaussian smearing
+//
value+=gRandom->Gaus(0, width);
}
// Weighting
//
-Float_t AliDimuCombinator::Decay_Prob(TParticle* part)
+Float_t AliDimuCombinator::DecayProbability(TParticle* part)
{
- Float_t d, h, theta, CTau;
+// Calculate decay probability for muons from pion and kaon decays
+//
+ Float_t d, h, theta, cTau;
TParticle* parent = Parent(part);
Int_t ipar=Type(parent);
- if (ipar==8 || ipar==9) {
- CTau=780.4;
- } else if (ipar==11 || ipar==12) {
- CTau=370.9;
+ if (ipar==kPiPlus || ipar==kPiMinus) {
+ cTau=780.4;
+ } else if (ipar==kKPlus || ipar==kKMinus) {
+ cTau=370.9;
} else {
- CTau=0;
+ cTau=0;
}
- Float_t GammaBeta=(parent->P())/(parent->GetMass());
+ Float_t gammaBeta=(parent->P())/(parent->GetMass());
//
// this part is still very ALICE muon-arm specific
//
d=90/TMath::Cos(theta);
}
- if (CTau > 0) {
- return 1-TMath::Exp(-d/CTau/GammaBeta);
+ if (cTau > 0) {
+ return 1-TMath::Exp(-d/cTau/gammaBeta);
} else {
return 1;
}
Float_t AliDimuCombinator::Weight(TParticle* part1, TParticle* part2)
{
+// Dimuon weight
+
Float_t wgt=(part1->GetWeight())*(part2->GetWeight());
if (Correlated(part1, part2)) {
Float_t AliDimuCombinator::Weight(TParticle* part)
{
+// Single muon weight
return (part->GetWeight())*(Parent(part)->GetWeight())*fRate1;
}
+
Bool_t AliDimuCombinator::Correlated(TParticle* part1, TParticle* part2)
{
+// Check if muons are correlated
+//
if (Origin(part1) == Origin(part2)) {
return kTRUE;
} else {
TParticle* AliDimuCombinator::Parent(TParticle* part)
{
+// Return pointer to parent
+//
return (TParticle*) (fPartArray->UncheckedAt(part->GetFirstMother()));
}
Int_t AliDimuCombinator::Origin(TParticle* part)
{
+// Return pointer to primary particle
+//
Int_t iparent= part->GetFirstMother();
if (iparent < 0) return iparent;
Int_t ip;
return iparent;
}
+AliDimuCombinator& AliDimuCombinator::operator=(const AliDimuCombinator& rhs)
+{
+// Assignment operator
+ return *this;
+}
+
+
+
+
+
+
+
+
-#ifndef _AliDimuCombinator_H
-#define _AliDimuCombinator_H
+#ifndef ALIDIMUCOMBINATOR_H
+#define ALIDIMUCOMBINATOR_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
+#include <TParticle.h>
+#include <TObject.h>
-#include "TParticle.h"
-#include <TBrowser.h>
-#include <TList.h>
-#include <TTree.h>
-#include <TROOT.h>
+class TClonesArray;
+class TParticle;
class AliDimuCombinator:
public TObject
{
public:
- AliDimuCombinator(TClonesArray* Partarray){
- fPartArray=Partarray;
- fNParticle=fPartArray->GetEntriesFast();
-
- fimuon1 =0;
- fimuon2 =0;
- fmuon1 =0;
- fmuon2 =0;
- fimin1 = 0;
- fimin2 = 0;
- fimax1 = fNParticle;
- fimax2 = fNParticle;
- fPtMin =0;
- fEtaMin =-10;
- fEtaMax =-10;
- fRate1=1.;
- fRate2=1.;
- }
+ AliDimuCombinator(TClonesArray* Partarray);
+ AliDimuCombinator(const AliDimuCombinator &combinator);
//
// Iterators
// Single muons
void SetSecondRange(Int_t from, Int_t to);
// Cuts
void SetPtMin(Float_t ptmin) {fPtMin=ptmin;}
- void SetEtaCut(Float_t etamin, Float_t etamax){fEtaMin=etamin; fEtaMax=etamax;} Bool_t Selected(TParticle* part);
+ void SetEtaCut(Float_t etamin, Float_t etamax)
+ {fEtaMin=etamin; fEtaMax=etamax;}
+ Bool_t Selected(TParticle* part);
Bool_t Selected(TParticle* part1, TParticle* part2);
// Kinematics
Float_t Mass(TParticle* part1, TParticle* part);
void SetRate(Float_t rate1, Float_t rate2 ){fRate1=rate1; fRate2=rate2;}
Float_t Weight(TParticle* part);
Float_t Weight(TParticle* part1, TParticle* part);
- Float_t Decay_Prob(TParticle* part);
+ Float_t DecayProbability(TParticle* part);
+ AliDimuCombinator & operator=(const AliDimuCombinator & rhs);
private:
void FirstPartner();
Int_t Origin(TParticle* part);
TParticle* Parent(TParticle* part);
TParticle* Partner();
- Int_t Type(TParticle *part){return part->GetPdgCode();}
+ Int_t Type(TParticle *part) {return part->GetPdgCode();}
private:
- TClonesArray *fPartArray;
- Int_t fNParticle;
- Int_t fimuon1;
- Int_t fimuon2;
- Int_t fimin1;
- Int_t fimin2;
- Int_t fimax1;
- Int_t fimax2;
- Float_t fRate1;
- Float_t fRate2;
- TParticle *fmuon1;
- TParticle *fmuon2;
- Float_t fPtMin;
- Float_t fEtaMin;
- Float_t fEtaMax;
- ClassDef(AliDimuCombinator,1) // Dimuon Combinator
+ TClonesArray *fPartArray; // MC Event
+ Int_t fNParticle; // Number of particles
+ Int_t fimuon1; // Index of first muon
+ Int_t fimuon2; // Index of second muon
+ Int_t fimin1; // Lowest index for first muon
+ Int_t fimin2; // Lowest index for second muon
+ Int_t fimax1; // Highest index for first muon
+ Int_t fimax2; // Highest index for second muon
+ Float_t fRate1; // weight factor
+ Float_t fRate2; // weight factor
+ TParticle *fmuon1; // First muon
+ TParticle *fmuon2; // Second muon
+ Float_t fPtMin; // pT-cut
+ Float_t fEtaMin; // Minimum pseudorapidity cut
+ Float_t fEtaMax; // Maximum pseudorapidity cut
+
+ ClassDef(AliDimuCombinator,1) // Tools for dimuon combinatoric studies
};
#endif
+
/*
$Log$
+Revision 1.1 2000/02/23 16:25:14 morsch
+First commit of this file
+
*/
#include "AliGenDoubleScan.h"
-#include <stdlib.h>
#include "AliRun.h"
+
ClassImp(AliGenDoubleScan)
AliGenDoubleScan::AliGenDoubleScan()
AliGenDoubleScan::AliGenDoubleScan(Int_t npart)
:AliGenScan(npart)
{
+// Constructor
}
//____________________________________________________________
AliGenDoubleScan::~AliGenDoubleScan()
-{}
+{
+// Destructor
+}
//____________________________________________________________
void AliGenDoubleScan::Generate()
{
- //
- // Generate one trigger
- //
-
- Float_t polar[3]= {0,0,0};
- //
- Float_t origin[3];
- Float_t p[3];
- Int_t nt;
- Float_t pmom, theta, phi;
- //
- Float_t random[6];
- Float_t dx,dy,dz;
+ //
+ // Generate one trigger
+ //
- //
- if (fNy > 0) {
- dx=(fXmax-fXmin)/fNx;
- } else {
- dx=1e10;
- }
-
- if (fNy > 0) {
- dy=(fYmax-fYmin)/fNy;
- } else {
- dy=1e10;
- }
-
- if (fNz > 0) {
+ Float_t polar[3]= {0,0,0};
+ //
+ Float_t origin[3];
+ Float_t p[3];
+ Int_t nt;
+ Float_t pmom, theta, phi;
+ //
+ Float_t random[6];
+ Float_t dx,dy,dz;
+
+ //
+ if (fNy > 0) {
+ dx=(fXmax-fXmin)/fNx;
+ } else {
+ dx=1e10;
+ }
+
+ if (fNy > 0) {
+ dy=(fYmax-fYmin)/fNy;
+ } else {
+ dy=1e10;
+ }
+
+ if (fNz > 0) {
dz=(fZmax-fZmin)/fNz;
- } else {
- dz=1e10;
- }
- for (Int_t ix=0; ix<fNx; ix++) {
+ } else {
+ dz=1e10;
+ }
+ for (Int_t ix=0; ix<fNx; ix++) {
for (Int_t iy=0; iy<fNy; iy++) {
for (Int_t iz=0; iz<fNz; iz++){
gMC->Rndm(random,6);
-#ifndef AliGenDoubleScan_H
-#define AliGenDoubleScan_H
+#ifndef ALIGENDOUBLESCAN_H
+#define ALIGENDOUBLESCAN_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
-/////////////////////////////////////////////////////////
-// Manager and hits classes for set:MUON version 0 //
-/////////////////////////////////////////////////////////
#include "AliGenScan.h"
-#include "TNamed.h"
-#include "TF1.h"
-#include "TArrayF.h"
-#include "TTree.h"
-
class AliGenDoubleScan : public AliGenScan
{
- private:
- Float_t fDistance;
public:
AliGenDoubleScan();
AliGenDoubleScan(Int_t npart);
virtual ~AliGenDoubleScan();
- // generate event
virtual void Generate();
virtual void SetDistance(Float_t d) {fDistance=d;}
- ClassDef(AliGenDoubleScan,1) // Generation of particles on a grid
+ private:
+ Float_t fDistance; // Distance between particles
+ ClassDef(AliGenDoubleScan,1) // Generation of particles (double hits) on a grid
};
#endif
/*
$Log$
+Revision 1.7 2000/02/16 14:56:27 morsch
+Convert geant particle code into pdg code before putting particle on the stack.
+
Revision 1.6 1999/11/09 07:38:48 fca
Changes for compatibility with version 2.23 of ROOT
AliGenExtFile::AliGenExtFile()
:AliGenerator(-1)
{
- //
+// Constructor
fName="ExtFile";
fTitle="Primaries from ext. File";
fFileName="dtujet93.root";
AliGenExtFile::AliGenExtFile(Int_t npart)
:AliGenerator(npart)
{
- //
+// Constructor
fName="ExtFile";
fTitle="Primaries from ext. File";
fFileName="dtujet93.root";
fNcurrent=0;
}
+AliGenExtFile::AliGenExtFile(const AliGenExtFile & ExtFile)
+{
+// copy constructor
+}
//____________________________________________________________
AliGenExtFile::~AliGenExtFile()
{
+// Destructor
delete fTreeNtuple;
}
// reset the existing file environment and open a new root file if
// the pointer to the Fluka tree is null
- TFile *File=0;
+ TFile *pFile=0;
if (fTreeNtuple==0) {
- if (!File) {
- File = new TFile(fFileName);
- File->cd();
+ if (!pFile) {
+ pFile = new TFile(fFileName);
+ pFile->cd();
cout<<"I have opened "<<fFileName<<" file "<<endl;
}
// get the tree address in the Fluka boundary source file
fTreeNtuple = (TTree*)gDirectory->Get("h888");
} else {
- File = fTreeNtuple->GetCurrentFile();
- File->cd();
+ pFile = fTreeNtuple->GetCurrentFile();
+ pFile->cd();
}
TTree *h2=fTreeNtuple;
//Set branch addresses
//Set branch addresses
- h2->SetBranchAddress("Nihead",&Nihead);
- h2->SetBranchAddress("Ihead",Ihead);
- h2->SetBranchAddress("Nrhead",&Nrhead);
- h2->SetBranchAddress("Rhead",Rhead);
- h2->SetBranchAddress("Idpart",&Idpart);
- h2->SetBranchAddress("Theta",&Theta);
- h2->SetBranchAddress("Phi",&Phi);
- h2->SetBranchAddress("P",&P);
- h2->SetBranchAddress("E",&E);
+ h2->SetBranchAddress("Nihead",&fNihead);
+ h2->SetBranchAddress("Ihead",fIhead);
+ h2->SetBranchAddress("Nrhead",&fNrhead);
+ h2->SetBranchAddress("Rhead",fRhead);
+ h2->SetBranchAddress("Idpart",&fIdpart);
+ h2->SetBranchAddress("Theta",&fTheta);
+ h2->SetBranchAddress("Phi",&fPhi);
+ h2->SetBranchAddress("P",&fP);
+ h2->SetBranchAddress("E",&fE);
}
//____________________________________________________________
void AliGenExtFile::Generate()
{
+// Generate particles
Float_t polar[3]= {0,0,0};
//
Float_t p[3];
Float_t random[6];
Float_t prwn;
- Int_t i, j, nt, Ntracks=0;
+ Int_t i, j, nt, nTracks=0;
//
NtupleInit();
TTree *h2=fTreeNtuple;
Int_t nentries = (Int_t) h2->GetEntries();
// loop over number of particles
Int_t nb = (Int_t)h2->GetEvent(fNcurrent);
- Int_t i5=Ihead[4];
- Int_t i6=Ihead[5];
+ Int_t i5=fIhead[4];
+ Int_t i6=fIhead[5];
for (j=0;j<3;j++) origin[j]=fOrigin[j];
if(fVertexSmear==perEvent) {
printf("\n This should never happen !\n");
} else {
printf("\n Next event contains %d tracks! \n", i6);
- Ntracks=i6;
+ nTracks=i6;
}
- for (i=0; i<Ntracks; i++) {
- Idpart=gMC->PDGFromId(Idpart);
- Double_t amass = TDatabasePDG::Instance()->GetParticle(Idpart)->Mass();
- if(E<=amass) {
+ for (i=0; i<nTracks; i++) {
+ fIdpart=gMC->PDGFromId(fIdpart);
+ Double_t amass = TDatabasePDG::Instance()->GetParticle(fIdpart)->Mass();
+ if(fE<=amass) {
Warning("Generate","Particle %d no %d E = %f mass = %f\n",
- Idpart,i,E,amass);
+ fIdpart,i,fE,amass);
prwn=0;
} else {
- prwn=sqrt((E+amass)*(E-amass));
+ prwn=sqrt((fE+amass)*(fE-amass));
}
- Theta *= TMath::Pi()/180.;
- Phi = (Phi-180)*TMath::Pi()/180.;
- if(Theta<fThetaMin || Theta>fThetaMax ||
- Phi<fPhiMin || Phi>fPhiMax ||
+ fTheta *= TMath::Pi()/180.;
+ fPhi = (fPhi-180)*TMath::Pi()/180.;
+ if(fTheta<fThetaMin || fTheta>fThetaMax ||
+ fPhi<fPhiMin || fPhi>fPhiMax ||
prwn<fPMin || prwn>fPMax)
{
;
} else {
- p[0]=prwn*TMath::Sin(Theta)*TMath::Cos(Phi);
- p[1]=prwn*TMath::Sin(Theta)*TMath::Sin(Phi);
- p[2]=prwn*TMath::Cos(Theta);
+ p[0]=prwn*TMath::Sin(fTheta)*TMath::Cos(fPhi);
+ p[1]=prwn*TMath::Sin(fTheta)*TMath::Sin(fPhi);
+ p[2]=prwn*TMath::Cos(fTheta);
if(fVertexSmear==perTrack) {
gMC->Rndm(random,6);
TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
}
}
- gAlice->SetTrack(fTrackIt,-1,Idpart,p,origin,polar,0,"Primary",nt);
+ gAlice->SetTrack(fTrackIt,-1,fIdpart,p,origin,polar,0,"Primary",nt);
}
fNcurrent++;
nb = (Int_t)h2->GetEvent(fNcurrent);
}
- TFile *File=0;
+ TFile *pFile=0;
// Get AliRun object or create it
if (!gAlice) {
- gAlice = (AliRun*)File->Get("gAlice");
+ gAlice = (AliRun*)pFile->Get("gAlice");
if (gAlice) printf("AliRun object found on file\n");
if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
}
TTree *fAli=gAlice->TreeK();
- if (fAli) File =fAli->GetCurrentFile();
- File->cd();
+ if (fAli) pFile =fAli->GetCurrentFile();
+ pFile->cd();
}
+AliGenExtFile& AliGenExtFile::operator=(const AliGenExtFile& rhs)
+{
+// Assignment operator
+ return *this;
+}
+
-#ifndef AliGenExtFile_H
-#define AliGenExtFile_H
+#ifndef ALIGENEXTFILE_H
+#define ALIGENEXTFILE_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
-/////////////////////////////////////////////////////////
-// Manager and hits classes for set:MUON version 0 //
-/////////////////////////////////////////////////////////
+
+
#include "AliGenerator.h"
-#include "TNamed.h"
-#include "TF1.h"
-#include "TArrayF.h"
#include "TTree.h"
// Read background particles from a FLUKA boundary source file
class AliGenExtFile : public AliGenerator
{
-
+ public:
+ AliGenExtFile();
+ AliGenExtFile(Int_t npart);
+ AliGenExtFile(const AliGenExtFile &cocktail);
+
+ virtual ~AliGenExtFile();
+ // Initialise
+ virtual void Init() {}
+ // Initialise fluka data
+ virtual void NtupleInit();
+ // set file name of data file
+ virtual void SetFileName(const Text_t *filname) {fFileName=filname;}
+ // generate event
+ virtual void Generate();
+ AliGenExtFile & operator=(const AliGenExtFile & rhs);
protected:
- const Text_t *fFileName; //! Choose the file
- Int_t fNcurrent; // points to the next entry
- TTree *fTreeNtuple; // pointer to the TTree
-//Declaration of variables read from the file -- TTree type
- //Declaration of leaves types
- Int_t Nihead;
- Int_t Ihead[12];
- Int_t Nrhead;
- Float_t Rhead[6];
- UInt_t Idpart;
- Float_t Theta;
- Float_t Phi;
- Float_t P;
- Float_t E;
-public:
- AliGenExtFile();
- AliGenExtFile(Int_t npart);
- virtual ~AliGenExtFile();
- // Initialise
- virtual void Init() {}
- // Initialise fluka data
- virtual void NtupleInit();
- // set file name of data file
- virtual void SetFileName(const Text_t *filname) {fFileName=filname;}
- // generate event
- virtual void Generate();
-
- ClassDef(AliGenExtFile,1) //Boundary source
+ const Text_t *fFileName; //! Choose the file
+ Int_t fNcurrent; // points to the next entry
+ TTree *fTreeNtuple; // pointer to the TTree
+ //Declaration of leaves types
+ Int_t fNihead; // Number of entries in integer header
+ Int_t fIhead[12]; // Integer header
+ Int_t fNrhead; // Number of entries in float header
+ Float_t fRhead[6]; // Float header
+ UInt_t fIdpart; // Particle type
+ Float_t fTheta; // Theta
+ Float_t fPhi; // Phi
+ Float_t fP; // Total momentum
+ Float_t fE; // Total energy
+
+ ClassDef(AliGenExtFile,1) //Generate particles from external file
};
#endif
/*
$Log$
+Revision 1.9 2000/03/07 13:52:54 morsch
+static Int_t irwn=0;
+
Revision 1.8 2000/02/14 14:49:38 morsch
Correct particle type for gamma and neutrons
More consistent calculation of momentum from kin. energy and mass
#include <TDirectory.h>
#include <TFile.h>
#include <TTree.h>
+#include <TChain.h>
#include <stdlib.h>
ClassImp(AliGenFLUKAsource)
AliGenFLUKAsource::AliGenFLUKAsource()
:AliGenerator(-1)
{
- //
+ // Constructor
fName="FLUKA";
fTitle="FLUKA Boundary Source";
// Read in all particle types by default
//
// Read all particles
fNpart=-1;
+
}
AliGenFLUKAsource::AliGenFLUKAsource(Int_t npart)
:AliGenerator(npart)
{
- //
+ // Constructor
fName="FLUKA";
fTitle="FLUKA Boundary Source";
// Read in all particle types by default
fTreeFluka=0;
fTreeChain = new TChain("h1");
+ fSourceId=-1;
}
+AliGenFLUKAsource::AliGenFLUKAsource(const AliGenFLUKAsource & FLUKAsource)
+{
+// copy constructor
+}
+
+
//____________________________________________________________
AliGenFLUKAsource::~AliGenFLUKAsource()
{
+// Destructor
if (fTreeFluka) delete fTreeFluka;
if (fTreeChain) delete fTreeChain;
- // if (fFileName) delete fFileName;
}
void AliGenFLUKAsource::AddFile(const Text_t *filename)
{
+// Add a file to the chain
fTreeChain->Add(filename);
}
//____________________________________________________________
void AliGenFLUKAsource::FlukaInit()
{
+// Set branch addresses of data entries
TChain *h2=fTreeChain;
//Set branch addresses
- h2->SetBranchAddress("Ip",&Ip);
- h2->SetBranchAddress("Ipp",&Ipp);
- h2->SetBranchAddress("Xi",&Xi);
- h2->SetBranchAddress("Yi",&Yi);
- h2->SetBranchAddress("Zi",&Zi);
- h2->SetBranchAddress("Px",&Px);
- h2->SetBranchAddress("Py",&Py);
- h2->SetBranchAddress("Pz",&Pz);
- h2->SetBranchAddress("Ekin",&Ekin);
- h2->SetBranchAddress("Zv",&Zv);
- h2->SetBranchAddress("Rv",&Rv);
- h2->SetBranchAddress("Itra",&Itra);
- h2->SetBranchAddress("Igas",&Igas);
- h2->SetBranchAddress("Wgt",&Wgt);
- h2->SetBranchAddress("Etag",&Etag);
- h2->SetBranchAddress("Ptg",&Ptg);
- h2->SetBranchAddress("Age",&Age);
+ h2->SetBranchAddress("Ip",&fIp);
+ h2->SetBranchAddress("Ipp",&fIpp);
+ h2->SetBranchAddress("Xi",&fXi);
+ h2->SetBranchAddress("Yi",&fYi);
+ h2->SetBranchAddress("Zi",&fZi);
+ h2->SetBranchAddress("Px",&fPx);
+ h2->SetBranchAddress("Py",&fPy);
+ h2->SetBranchAddress("Pz",&fPz);
+ h2->SetBranchAddress("Ekin",&fEkin);
+ h2->SetBranchAddress("Zv",&fZv);
+ h2->SetBranchAddress("Rv",&fRv);
+ h2->SetBranchAddress("Itra",&fItra);
+ h2->SetBranchAddress("Igas",&fIgas);
+ h2->SetBranchAddress("Wgt",&fWgt);
+ h2->SetBranchAddress("Etag",&fEtag);
+ h2->SetBranchAddress("Ptg",&fPtg);
+ h2->SetBranchAddress("Age",&fAge);
}
//____________________________________________________________
void AliGenFLUKAsource::Generate()
-{
+{
+// Generate one event
AliMC* gMC = AliMC::GetMC();
- const Int_t ifluge[28]={kProton, kProtonBar, kElectron, kPositron,
+ const Int_t kIfluge[28]={kProton, kProtonBar, kElectron, kPositron,
kNuE, kNuEBar, kGamma, kNeutron, kNeutronBar,
kMuonPlus, kMuonMinus, kK0Long , kPiPlus, kPiMinus,
kKPlus, kKMinus, kLambda0, kLambda0Bar, kK0Short,
nb = (Int_t)h2->GetEvent(entry);
if (irwn > nentries) {
printf("No more entries in the FLUKA boundary source file\n");
- TFile *File=0;
+ TFile *pFile=0;
// Get AliRun object or create it
if (!gAlice) {
- gAlice = (AliRun*)File->Get("gAlice");
+ gAlice = (AliRun*)pFile->Get("gAlice");
if (gAlice) printf("AliRun object found on file\n");
if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
}
TTree *fAli=gAlice->TreeK();
- if (fAli) File =fAli->GetCurrentFile();
- File->cd();
+ if (fAli) pFile =fAli->GetCurrentFile();
+ pFile->cd();
printf("Generate - I'm out \n");
return;
}
- if (Ip > 28 || Ip < 0) {
+
+ if (fSourceId != -1 && fIgas !=fSourceId) {
+ irwn++;
+ continue;
+ }
+
+ if (fIp > 28 || fIp < 0) {
irwn++;
continue;
}
- if ((Ip != fIkine && fIkine != 6 && fIkine != 9 && fIkine != 10) || Age > fAgeMax){
+ if ((fIp != fIkine && fIkine != 6 && fIkine != 9 && fIkine != 10) || fAge > fAgeMax){
irwn++;
continue;
} else if (fIkine == 9) {
- if (Ip == 7 || Ip == 8 || Age > fAgeMax) {
+ if (fIp == 7 || fIp == 8 || fAge > fAgeMax) {
irwn++;
continue;
}
} else if (fIkine == 10) {
- if (Ip == 8 || Age > fAgeMax) {
+ if (fIp == 8 || fAge > fAgeMax) {
irwn++;
continue;
}
irwn++;
//
-// PDG code from FLUKA particle type (Ip)
- part=ifluge[int(Ip)-1];
+// PDG code from FLUKA particle type (fIp)
+ part=kIfluge[int(fIp)-1];
//
// Calculate momentum from kinetic energy and mass of the particle
gMC->Gfpart(part, name, itrtyp,
amass, charge, tlife);
- prwn=Ekin*sqrt(1. + 2.*amass/Ekin);
+ prwn=fEkin*sqrt(1. + 2.*amass/fEkin);
- origin[0]=Yi;
- origin[1]=Xi;
- origin[2]=Zi;
+ origin[0]=fYi;
+ origin[1]=fXi;
+ origin[2]=fZi;
- p[0]=Py*prwn;
- p[1]=Px*prwn;
- p[2]=Pz*prwn;
+ p[0]=fPy*prwn;
+ p[1]=fPx*prwn;
+ p[2]=fPz*prwn;
//handle particle weight correctly
- wgt = (part == 13) ? Wgt*fAddWeight : Wgt;
+ wgt = (part == 13) ? fWgt*fAddWeight : fWgt;
iwgt=Int_t(wgt);
fwgt=wgt-Float_t(iwgt);
gMC->Rndm(random,2);
if (part==1 && iwgt>100) iwgt=100;
Int_t nstack=0;
for (j=0; j<iwgt; j++) {
- gAlice->SetTrack(fTrackIt,-1,part,p,origin,polar,Age,"Primary",nt);
+ gAlice->SetTrack(fTrackIt,-1,part,p,origin,polar,fAge,"Primary",nt);
gMC->Rndm(random,2);
phi=2*random[1]*TMath::Pi();
Float_t pn1=p[0]*TMath::Sin(phi) - p[1]*TMath::Cos(phi);
if (nstack == 0) continue;
}
- TFile *File=0;
+ TFile *pFile=0;
// Get AliRun object or create it
if (!gAlice) {
- gAlice = (AliRun*)File->Get("gAlice");
+ gAlice = (AliRun*)pFile->Get("gAlice");
if (gAlice) printf("AliRun object found on file\n");
if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
}
TTree *fAli=gAlice->TreeK();
- if (fAli) File =fAli->GetCurrentFile();
- File->cd();
+ if (fAli) pFile =fAli->GetCurrentFile();
+ pFile->cd();
}
-
+AliGenFLUKAsource& AliGenFLUKAsource::operator=(const AliGenFLUKAsource& rhs)
+{
+// Assignment operator
+ return *this;
+}
-#ifndef AliGenFLUKAsource_H
-#define AliGenFLUKAsource_H
+#ifndef ALIGENFLUKASOURCE_H
+#define ALIGENFLUKASOURCE_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
-/////////////////////////////////////////////////////////
-// Manager and hits classes for set:MUON version 0 //
-/////////////////////////////////////////////////////////
+
#include "AliGenerator.h"
-#include "TNamed.h"
-#include "TF1.h"
-#include "TArrayF.h"
-#include "TTree.h"
-#include "TChain.h"
+#include <TChain.h>
+
+class TTree;
+
+
// Read background particles from a FLUKA boundary source file
class AliGenFLUKAsource : public AliGenerator
{
-
-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;
-
- const Text_t *fFileName; //!Choose the file
- TChain *fTreeChain;
- TTree *fTreeFluka; //pointer to the TTree
-//Declaration of variables read from the file -- TTree type
- Float_t Ip;
- Float_t Ipp;
- Float_t Xi;
- Float_t Yi;
- Float_t Zi;
- Float_t Px;
- Float_t Py;
- Float_t Pz;
- Float_t Ekin;
- Float_t Zv;
- Float_t Rv;
- Float_t Itra;
- Float_t Igas;
- Float_t Wgt;
- Float_t Etag;
- Float_t Ptg;
- Float_t Age;
-
public:
AliGenFLUKAsource();
AliGenFLUKAsource(Int_t npart);
+ AliGenFLUKAsource(const AliGenFLUKAsource &FLUKAsource);
virtual ~AliGenFLUKAsource();
// Initialise
virtual void Init() {}
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)
+
+
+ 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
};
/*
$Log$
+Revision 1.5 1999/11/03 17:43:20 fca
+New version from G.Martinez & A.Morsch
+
Revision 1.4 1999/09/29 09:24:14 fca
Introduction of the Copyright and cvs Log
*/
#include "AliGenHalo.h"
-#include "AliGenMUONlib.h"
-#include "AliMC.h"
#include "AliRun.h"
#include "AliPDG.h"
-#include <TDirectory.h>
#include <TDatabasePDG.h>
-#include <TFile.h>
-#include <TTree.h>
#include <stdlib.h>
+
ClassImp(AliGenHalo)
AliGenHalo::AliGenHalo()
:AliGenerator(-1)
{
+// Constructor
fName="Halo";
fTitle="Halo from LHC Tunnel";
// Set the default file
AliGenHalo::AliGenHalo(Int_t npart)
:AliGenerator(npart)
{
+// Constructor
fName="Halo";
fTitle="Halo from LHC Tunnel";
// Set the default file
fp=0;
}
+AliGenHalo::AliGenHalo(const AliGenHalo & Halo)
+{
+// copy constructor
+}
+
+
//____________________________________________________________
AliGenHalo::~AliGenHalo()
{
+// Destructor
}
//____________________________________________________________
void AliGenHalo::Init()
-{}
+{
+// Initialisation
+}
//____________________________________________________________
void AliGenHalo::Generate()
{
+// Generate from input file
FILE *fp = fopen(fFileName,"r");
if (fp) {
printf("\n File %s opened for reading ! \n ", fFileName);
}
//
// MARS particle codes
- // const Int_t imars[12]={0,14, 13, 8, 9, 11, 12, 5, 6, 1, 3, 2};
- const Int_t imars[12]={0,kProton,kNeutron,kPiPlus,kPiMinus,kKPlus,kKMinus,
+ const Int_t kmars[12]={0,kProton,kNeutron,kPiPlus,kPiMinus,kKPlus,kKMinus,
kMuonPlus,kMuonMinus,kGamma,kElectron,kPositron};
Float_t polar[3]= {0,0,0};
if (ncols < 0) break;
nread++;
if (fNpart !=-1 && nread > fNpart) break;
- ipart = imars[ipart];
+ ipart = kmars[ipart];
amass = TDatabasePDG::Instance()->GetParticle(ipart)->Mass();
p0=sqrt(ekin*ekin + 2.*amass);
}
+AliGenHalo& AliGenHalo::operator=(const AliGenHalo& rhs)
+{
+// Assignment operator
+ return *this;
+}
+
-#ifndef AliGenHalo_H
-#define AliGenHalo_H
+#ifndef ALIGENHALO_H
+#define ALIGENHALO_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
-/////////////////////////////////////////////////////////
-// Manager and hits classes for set:MUON version 0 //
-/////////////////////////////////////////////////////////
+
#include "AliGenerator.h"
-#include "TNamed.h"
-#include "TF1.h"
-#include "TArrayF.h"
-#include "TTree.h"
// Read background particles from a FLUKA boundary source file
class AliGenHalo : public AliGenerator
{
-
-protected:
- FILE *fp; //! Pointer to file
- const Text_t *fFileName; //!Choose the file
-
public:
AliGenHalo();
AliGenHalo(Int_t npart);
+ AliGenHalo(const AliGenHalo &Halo);
virtual ~AliGenHalo();
virtual void Init();
virtual void SetFileName(const Text_t *filname) {fFileName=filname;}
virtual void Generate();
- ClassDef(AliGenHalo,1)
+ AliGenHalo & operator=(const AliGenHalo & rhs);
+protected:
+ FILE *fp; // Pointer to file
+ const Text_t *fFileName; // Choose the file
+ ClassDef(AliGenHalo,1) // LHC background boundary source (MARS input)
};
#endif
/*
$Log$
+Revision 1.7 2000/05/02 08:12:13 morsch
+Coding rule violations corrected.
+
Revision 1.6 1999/09/29 09:24:14 fca
Introduction of the Copyright and cvs Log
*/
#include "AliGenMUONlib.h"
-#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliGenMUONlib)
//
// Pions
/* $Id$ */
-#include <TROOT.h>
+#include <TObject.h>
#include "GenTypeDefs.h"
class AliGenMUONlib :
static GenFunc GetPt(Param_t param);
static GenFunc GetY(Param_t param);
static GenFuncIp GetIp(Param_t param);
- ClassDef(AliGenMUONlib,1)
+ ClassDef(AliGenMUONlib,1) // Library providing y and pT parameterisations
};
#endif
/*
$Log$
+Revision 1.2 1999/11/04 11:30:48 fca
+Improve comments
+
Revision 1.1 1999/11/03 17:43:20 fca
New version from G.Martinez & A.Morsch
//======================================================================
#include "AliGenPHOSlib.h"
+#include "TMath.h"
#include "AliRun.h"
ClassImp(AliGenPHOSlib)
// POWER LAW FOR PT > 500 MEV
// MT SCALING BELOW (T=160 MEV)
//
- const Double_t p0 = 1.3;
- const Double_t xn = 8.28;
- const Double_t xlim=0.5;
- const Double_t t=0.160;
- const Double_t xmpi=0.139;
- const Double_t b=1.;
- Double_t y, y1, xmpi2, ynorm, a;
+ const Double_t kp0 = 1.3;
+ const Double_t kxn = 8.28;
+ const Double_t kxlim=0.5;
+ const Double_t kt=0.160;
+ const Double_t kxmpi=0.139;
+ const Double_t kb=1.;
+ Double_t y, y1, kxmpi2, ynorm, a;
Double_t x=*px;
//
- y1=TMath::Power(p0/(p0+xlim),xn);
- xmpi2=xmpi*xmpi;
- ynorm=b*(TMath::Exp(-sqrt(xlim*xlim+xmpi2)/t));
+ y1=TMath::Power(kp0/(kp0+kxlim),kxn);
+ kxmpi2=kxmpi*kxmpi;
+ ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
a=ynorm/y1;
- if (x > xlim)
- y=a*TMath::Power(p0/(p0+x),xn);
+ if (x > kxlim)
+ y=a*TMath::Power(kp0/(kp0+x),kxn);
else
- y=b*TMath::Exp(-sqrt(x*x+xmpi2)/t);
+ y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
return y*x;
}
-//
-// y-distribution
-//
Double_t AliGenPHOSlib::YPion( Double_t *py, Double_t *)
{
- const Double_t a = 7000.;
- const Double_t dy = 4.;
+//
+// pion y-distribution
+//
+
+ const Double_t ka = 7000.;
+ const Double_t kdy = 4.;
Double_t y=TMath::Abs(*py);
//
- Double_t ex = y*y/(2*dy*dy);
- return a*TMath::Exp(-ex);
+ Double_t ex = y*y/(2*kdy*kdy);
+ return ka*TMath::Exp(-ex);
}
-// particle composition pi+, pi0, pi-
-//
+
Int_t AliGenPHOSlib::IpPion()
{
+// particle composition pi+, pi0, pi-
+//
+
Float_t random[1];
gMC->Rndm(random,1);
// End Pions
//=============================================================
//
+ Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
+{
// Mt-scaling
// Fonction for the calculation of the Pt distribution for a
// given particle np, from the pion Pt distribution using the
// aliroot version 3.01, and was extended for baryons
// np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
// 7=>BARYONS-BARYONBARS
- Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
-{
+
// SCALING EN MASSE PAR RAPPORT A PTPI
// MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA',6=>PHI
- const Double_t hm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
+ const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
// MASS 7=>BARYON-BARYONBAR
0.938, 0. , 0., 0.};
// VALUE MESON/PI AT 5 GEV
- const Double_t fmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
+ const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
np--;
- Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+hm[np]*hm[np])+2.0)),12.3);
- Double_t fmax2=f5/fmax[np];
+ Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
+ Double_t kfmax2=f5/kfmax[np];
// PIONS
Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
- (sqrt(pt*pt+hm[np]*hm[np])+2.0)),12.3)/ fmax2;
+ (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
return fmtscal*ptpion;
}
// End Scaling
//============================================================================
// K A O N S
-// kaon
-// pt-distribution
-//____________________________________________________________
Double_t AliGenPHOSlib::PtKaon( Double_t *px, Double_t *)
{
+// kaon
+// pt-distribution
+//____________________________________________________________
+
return PtScal(*px,2); // 2==> Kaon in the PtScal function
}
-// y-distribution
-//____________________________________________________________
Double_t AliGenPHOSlib::YKaon( Double_t *py, Double_t *)
{
- const Double_t a = 1000.;
- const Double_t dy = 4.;
+// y-distribution
+//____________________________________________________________
+
+ const Double_t ka = 1000.;
+ const Double_t kdy = 4.;
Double_t y=TMath::Abs(*py);
//
- Double_t ex = y*y/(2*dy*dy);
- return a*TMath::Exp(-ex);
+ Double_t ex = y*y/(2*kdy*kdy);
+ return ka*TMath::Exp(-ex);
}
-// particle composition
-//
Int_t AliGenPHOSlib::IpKaon()
{
+// particle composition
+//
+
Float_t random[1],random2[1];
gMC->Rndm(random,1);
gMC->Rndm(random2,1);
//============================================================================
//============================================================================
// E T A S
-// etas
-// pt-distribution
-//____________________________________________________________
Double_t AliGenPHOSlib::PtEta( Double_t *px, Double_t *)
{
+// etas
+// pt-distribution
+//____________________________________________________________
+
return PtScal(*px,3); // 3==> Eta in the PtScal function
}
-// y-distribution
-//____________________________________________________________
Double_t AliGenPHOSlib::YEta( Double_t *py, Double_t *)
{
- const Double_t a = 1000.;
- const Double_t dy = 4.;
+// y-distribution
+//____________________________________________________________
+
+ const Double_t ka = 1000.;
+ const Double_t kdy = 4.;
Double_t y=TMath::Abs(*py);
//
- Double_t ex = y*y/(2*dy*dy);
- return a*TMath::Exp(-ex);
+ Double_t ex = y*y/(2*kdy*kdy);
+ return ka*TMath::Exp(-ex);
}
-// particle composition
-//
Int_t AliGenPHOSlib::IpEta()
{
+// particle composition
+//
+
return 221; // eta
}
// End Etas
//============================================================================
//============================================================================
// O M E G A S
+ Double_t AliGenPHOSlib::PtOmega( Double_t *px, Double_t *)
+{
// omegas
// pt-distribution
//____________________________________________________________
- Double_t AliGenPHOSlib::PtOmega( Double_t *px, Double_t *)
-{
+
return PtScal(*px,4); // 4==> Omega in the PtScal function
}
-// y-distribution
-//____________________________________________________________
Double_t AliGenPHOSlib::YOmega( Double_t *py, Double_t *)
{
- const Double_t a = 1000.;
- const Double_t dy = 4.;
+// y-distribution
+//____________________________________________________________
+
+ const Double_t ka = 1000.;
+ const Double_t kdy = 4.;
Double_t y=TMath::Abs(*py);
//
- Double_t ex = y*y/(2*dy*dy);
- return a*TMath::Exp(-ex);
+ Double_t ex = y*y/(2*kdy*kdy);
+ return ka*TMath::Exp(-ex);
}
-// particle composition
-//
Int_t AliGenPHOSlib::IpOmega()
{
+// particle composition
+//
+
return 223; // Omega
}
// End Omega
//============================================================================
//============================================================================
// E T A P R I M E
+ Double_t AliGenPHOSlib::PtEtaprime( Double_t *px, Double_t *)
+{
// etaprime
// pt-distribution
//____________________________________________________________
- Double_t AliGenPHOSlib::PtEtaprime( Double_t *px, Double_t *)
-{
+
return PtScal(*px,5); // 5==> Etaprime in the PtScal function
}
-// y-distribution
-//____________________________________________________________
Double_t AliGenPHOSlib::YEtaprime( Double_t *py, Double_t *)
{
- const Double_t a = 1000.;
- const Double_t dy = 4.;
+// y-distribution
+//____________________________________________________________
+
+ const Double_t ka = 1000.;
+ const Double_t kdy = 4.;
Double_t y=TMath::Abs(*py);
//
- Double_t ex = y*y/(2*dy*dy);
- return a*TMath::Exp(-ex);
+ Double_t ex = y*y/(2*kdy*kdy);
+ return ka*TMath::Exp(-ex);
}
-// particle composition
-//
Int_t AliGenPHOSlib::IpEtaprime()
{
+// particle composition
+//
+
return 331; // Etaprime
}
// End EtaPrime
//===================================================================
//============================================================================
// P H I S
+ Double_t AliGenPHOSlib::PtPhi( Double_t *px, Double_t *)
+{
// phi
// pt-distribution
//____________________________________________________________
- Double_t AliGenPHOSlib::PtPhi( Double_t *px, Double_t *)
-{
+
return PtScal(*px,6); // 6==> Phi in the PtScal function
}
-// y-distribution
-//____________________________________________________________
Double_t AliGenPHOSlib::YPhi( Double_t *py, Double_t *)
{
- const Double_t a = 1000.;
- const Double_t dy = 4.;
+// y-distribution
+//____________________________________________________________
+
+ const Double_t ka = 1000.;
+ const Double_t kdy = 4.;
Double_t y=TMath::Abs(*py);
//
- Double_t ex = y*y/(2*dy*dy);
- return a*TMath::Exp(-ex);
+ Double_t ex = y*y/(2*kdy*kdy);
+ return ka*TMath::Exp(-ex);
}
+ Int_t AliGenPHOSlib::IpPhi()
+{
// particle composition
//
- Int_t AliGenPHOSlib::IpPhi()
-{
+
return 333; // Phi
}
// End Phis
//===================================================================
//============================================================================
// B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
+ Double_t AliGenPHOSlib::PtBaryon( Double_t *px, Double_t *)
+{
// baryons
// pt-distribution
//____________________________________________________________
- Double_t AliGenPHOSlib::PtBaryon( Double_t *px, Double_t *)
-{
+
return PtScal(*px,7); // 7==> Baryon in the PtScal function
}
-// y-distribution
-//____________________________________________________________
Double_t AliGenPHOSlib::YBaryon( Double_t *py, Double_t *)
{
- const Double_t a = 1000.;
- const Double_t dy = 4.;
+// y-distribution
+//____________________________________________________________
+
+ const Double_t ka = 1000.;
+ const Double_t kdy = 4.;
Double_t y=TMath::Abs(*py);
//
- Double_t ex = y*y/(2*dy*dy);
- return a*TMath::Exp(-ex);
+ Double_t ex = y*y/(2*kdy*kdy);
+ return ka*TMath::Exp(-ex);
}
-// particle composition
-//
Int_t AliGenPHOSlib::IpBaryon()
{
+// particle composition
+//
+
Float_t random[1],random2[1];
gMC->Rndm(random,1);
gMC->Rndm(random2,1);
typedef Double_t (*GenFunc) (Double_t*, Double_t*);
GenFunc AliGenPHOSlib::GetPt(Param_t param)
{
+// Return pinter to pT parameterisation
GenFunc func;
switch (param)
GenFunc AliGenPHOSlib::GetY(Param_t param)
{
+// Return pointer to Y parameterisation
GenFunc func;
switch (param)
{
typedef Int_t (*GenFuncIp) ();
GenFuncIp AliGenPHOSlib::GetIp(Param_t param)
{
+// Return pointer to particle composition
GenFuncIp func;
switch (param)
{
-#ifndef _AliGenPHOSlib_H
-#define _AliGenPHOSlib_H
-#include <TROOT.h>
+#ifndef ALIGENPHOSLIB_H
+#define ALIGENPHOSLIB_H
+#include <TObject.h>
#include "GenTypeDefs.h"
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
{
public:
// pions
- static Double_t PtPion(Double_t *px, Double_t *);
+ static Double_t PtPion(Double_t *px, Double_t *dummy);
static Double_t PtScal(Double_t pt, Int_t np);
- static Double_t YPion( Double_t *py, Double_t *);
+ static Double_t YPion( Double_t *py, Double_t *dummy);
static Int_t IpPion();
// kaons
- static Double_t PtKaon(Double_t *px, Double_t *);
- static Double_t YKaon( Double_t *py, Double_t *);
+ static Double_t PtKaon(Double_t *px, Double_t *dummy);
+ static Double_t YKaon( Double_t *py, Double_t *dummy);
static Int_t IpKaon();
// etas
- static Double_t PtEta(Double_t *px, Double_t *);
- static Double_t YEta( Double_t *py, Double_t *);
+ static Double_t PtEta(Double_t *px, Double_t *dummy);
+ static Double_t YEta( Double_t *py, Double_t *dummy);
static Int_t IpEta();
// omegas
- static Double_t PtOmega(Double_t *px, Double_t *);
- static Double_t YOmega( Double_t *py, Double_t *);
+ static Double_t PtOmega(Double_t *px, Double_t *dummy);
+ static Double_t YOmega( Double_t *py, Double_t *dummy);
static Int_t IpOmega();
// etaprime
- static Double_t PtEtaprime(Double_t *px, Double_t *);
- static Double_t YEtaprime( Double_t *py, Double_t *);
+ static Double_t PtEtaprime(Double_t *px, Double_t *dummy);
+ static Double_t YEtaprime( Double_t *py, Double_t *dummy);
static Int_t IpEtaprime();
// phis
- static Double_t PtPhi(Double_t *px, Double_t *);
- static Double_t YPhi( Double_t *py, Double_t *);
+ static Double_t PtPhi(Double_t *px, Double_t *dummy);
+ static Double_t YPhi( Double_t *py, Double_t *dummy);
static Int_t IpPhi();
// baryons
- static Double_t PtBaryon(Double_t *px, Double_t *);
- static Double_t YBaryon( Double_t *py, Double_t *);
+ static Double_t PtBaryon(Double_t *px, Double_t *dummy);
+ static Double_t YBaryon( Double_t *py, Double_t *dummy);
static Int_t IpBaryon();
- typedef Double_t (*GenFunc) (Double_t *, Double_t *);
+ typedef Double_t (*GenFunc) (Double_t *, Double_t *dummy);
typedef Int_t (*GenFuncIp)();
static GenFunc GetPt(Param_t param);
static GenFunc GetY(Param_t param);
static GenFuncIp GetIp(Param_t param);
- ClassDef(AliGenPHOSlib,1)
+ ClassDef(AliGenPHOSlib,1) // Library providing y and pT parameterisations
};
#endif
/*
$Log$
+Revision 1.16 2000/05/02 07:51:31 morsch
+- Control precision of pT sampling TF1::SetNpx(..)
+- Correct initialisation of child-cuts in all constructors.
+- Most coding rule violations corrected.
+
Revision 1.15 2000/04/03 15:42:12 morsch
Cuts on primary particles are separated from those on the decay products. Methods
SetChildMomentumRange, SetChildPtRange, SetChildPhiRange, SetChildThetaRange added.
#include "AliGenParam.h"
#include "AliGenMUONlib.h"
-#include "AliGenPHOSlib.h"
#include "AliRun.h"
#include "AliPythia.h"
#include <TParticle.h>
+#include <TF1.h>
ClassImp(AliGenParam)
SetDeltaPt();
}
+
+AliGenParam::AliGenParam(const AliGenParam & Paramd)
+{
+// copy constructor
+}
+
//____________________________________________________________
AliGenParam::~AliGenParam()
{
gAlice->
SetTrack(0,-1,iPart,p,origin0,polar,0,"Primary",nt,wgtp);
iparent=nt;
-
+ gAlice->KeepTrack(nt);
for (i=0; i< ncsel; i++) {
gAlice->SetTrack(fTrackIt,iparent,kfch[i],
&pch[i][0],och,polar,
}
+AliGenParam& AliGenParam::operator=(const AliGenParam& rhs)
+{
+// Assignment operator
+ return *this;
+}
+
/* $Id$ */
#include "AliGenerator.h"
-#include "TF1.h"
#include "TArrayI.h"
-#include "AliPythia.h"
#include "GenTypeDefs.h"
+
+class AliPythia;
+class TParticle;
+class TF1;
+
//-------------------------------------------------------------
class AliGenParam : public AliGenerator
{
AliGenParam(Int_t npart, Param_t param,
Double_t (*PtPara)(Double_t*, Double_t*),
Double_t (*YPara )(Double_t*, Double_t*),
- Int_t (*IpPara)() );
+ Int_t (*IpPara)() );
+ AliGenParam(const AliGenParam &Param);
+
virtual ~AliGenParam();
virtual void Generate();
virtual void Init();
fChildThetaMax = TMath::Pi()*thetamax/180;}
virtual void SetDeltaPt(Float_t delta=0.01) {fDeltaPt=delta;}
-
+ AliGenParam & operator=(const AliGenParam & rhs);
protected:
Double_t (*fPtParaFunc)(Double_t*, Double_t*); //! Pointer to Pt parametrisation function
Double_t (*fYParaFunc )(Double_t*, Double_t*); //! Pointer to Y parametrisation function
/*
$Log$
+Revision 1.16 2000/05/15 15:04:20 morsch
+The full event is written for fNtrack = -1
+Coding rule violations corrected.
+
Revision 1.15 2000/04/26 10:14:24 morsch
Particles array has one entry more than pythia particle list. Upper bound of
particle loop changed to np-1 (R. Guernane, AM)
Introduction of the Copyright and cvs Log
*/
-#include "AliGenerator.h"
#include "AliGenPythia.h"
#include "AliRun.h"
#include "AliPythia.h"
-#include <TDirectory.h>
-#include <TFile.h>
-#include <TTree.h>
-#include <stdlib.h>
-#include <AliPythia.h>
#include <TParticle.h>
-//#include <GParticle.h>
+
ClassImp(AliGenPythia)
AliGenPythia::AliGenPythia()
SetEnergyCMS();
}
+AliGenPythia::AliGenPythia(const AliGenPythia & Pythia)
+{
+// copy constructor
+}
+
AliGenPythia::~AliGenPythia()
{
// Destructor
while(1)
{
fPythia->Pyevnt();
- fPythia->Lulist(1);
+// fPythia->Lulist(1);
fTrials++;
fPythia->ImportParticles(particles,"All");
Int_t np = particles->GetEntriesFast();
//
// phi cut
- Float_t phi=Float_t(TMath::ATan2(Double_t(py),Double_t(px)))+TMath::Pi();
+ Float_t phi=Float_t(TMath::ATan2(Double_t(py),Double_t(px)));
if (phi > fPhiMax || phi < fPhiMin)
{
// printf("\n failed phi cut %f %f %f \n",phi,fPhiMin,fPhiMax);
return pdgcode;
}
-
+AliGenPythia& AliGenPythia::operator=(const AliGenPythia& rhs)
+{
+// Assignment operator
+ return *this;
+}
/* $Id$ */
-/////////////////////////////////////////////////////////
-// Manager and hits classes for set:MUON version 0 //
-/////////////////////////////////////////////////////////
+
#include "AliGenerator.h"
-#include "TNamed.h"
-#include "TF1.h"
-#include "TArrayF.h"
-#include "TTree.h"
-#include "AliPythia.h"
-#include "TArrayI.h"
-#include "TParticle.h"
+#include "GenTypeDefs.h"
+#include <TArrayI.h>
+
+class AliPythia;
+class TParticle;
class AliGenPythia : public AliGenerator
{
public:
AliGenPythia();
AliGenPythia(Int_t npart);
+ AliGenPythia(const AliGenPythia &Pythia);
virtual ~AliGenPythia();
virtual void Generate();
virtual void Init();
virtual Float_t GetXsection() {return fXsection;}
// Check PDG code
virtual Int_t CheckPDGCode(Int_t pdgcode);
-
+ // Assignment Operator
+ AliGenPythia & operator=(const AliGenPythia & rhs);
protected:
Process_t fProcess; // Process type
StrucFunc_t fStrucFunc; // Structure Function
// adjust the weight from kinematic cuts
void AdjustWeights();
- ClassDef(AliGenPythia,1)
+ ClassDef(AliGenPythia,1) // AliGenerator interface to Pythia
};
#endif
/*
$Log$
+Revision 1.4 1999/11/03 17:43:20 fca
+New version from G.Martinez & A.Morsch
+
Revision 1.3 1999/09/29 09:24:14 fca
Introduction of the Copyright and cvs Log
*/
#include "AliGenScan.h"
-#include <stdlib.h>
#include "AliRun.h"
+
ClassImp(AliGenScan)
AliGenScan::AliGenScan()
:AliGenerator(-1)
{
-//
+// Constructor
fXmin=0;
fXmax=0;
fNx=1;
AliGenScan::AliGenScan(Int_t npart)
:AliGenerator(npart)
{
+// Constructor
fXmin=0;
fXmax=0;
fNx=1;
//____________________________________________________________
AliGenScan::~AliGenScan()
-{}
+{
+// Destructor
+}
void AliGenScan::SetRange(Int_t nx, Float_t xmin, Float_t xmax,
Int_t ny, Float_t ymin, Float_t ymax,
Int_t nz, Float_t zmin, Float_t zmax)
{
+// Define the grid
fXmin=xmin;
fXmax=xmax;
fNx=nx;
-#ifndef AliGenScan_H
-#define AliGenScan_H
+#ifndef ALIGENSCAN_H
+#define ALIGENSCAN_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
#include "AliGenerator.h"
-#include "TNamed.h"
-#include "TF1.h"
-#include "TArrayF.h"
-#include "TTree.h"
class AliGenScan : public AliGenerator
{
-
-protected:
- Float_t fXmin;
- Float_t fXmax;
- Int_t fNx;
- Float_t fYmin;
- Float_t fYmax;
- Int_t fNy;
- Float_t fZmin;
- Float_t fZmax;
- Int_t fNz;
- Int_t fIpart; // Particle type
-
public:
- AliGenScan();
- AliGenScan(Int_t npart);
- virtual ~AliGenScan();
- // Set Scanning Range
- virtual void SetRange(Int_t nx, Float_t xmin, Float_t xmax,
- Int_t ny, Float_t ymin, Float_t ymax,
- Int_t nz, Float_t zmin, Float_t zmax);
+ AliGenScan();
+ AliGenScan(Int_t npart);
+ virtual ~AliGenScan();
+ // Set Scanning Range
+ virtual void SetRange(Int_t nx, Float_t xmin, Float_t xmax,
+ Int_t ny, Float_t ymin, Float_t ymax,
+ Int_t nz, Float_t zmin, Float_t zmax);
- // Initialise
- virtual void Init() {}
- // generate event
- virtual void Generate();
- virtual void SetPart(Int_t part) {fIpart=part;}
+ // Initialise
+ virtual void Init() {}
+ // generate event
+ virtual void Generate();
+ virtual void SetPart(Int_t part) {fIpart=part;}
+ protected:
+ Float_t fXmin; // Minimum x on grid
+ Float_t fXmax; // Maximum x on grid
+ Int_t fNx; // Number of divisions in x
+ Float_t fYmin; // Minimum y on grid
+ Float_t fYmax; // Maximum y on grid
+ Int_t fNy; // Number of divisions in y
+ Float_t fZmin; // Minimum z on grid
+ Float_t fZmax; // Maximum z on grid
+ Int_t fNz; // Number of divisions in z
+ Int_t fIpart; // Particle type
+
- ClassDef(AliGenScan,1) //Boundary source
+ ClassDef(AliGenScan,1) //Partcles on a regular grid
};
#endif
/*
$Log$
+Revision 1.6 1999/11/09 07:38:48 fca
+Changes for compatibility with version 2.23 of ROOT
+
Revision 1.5 1999/11/03 17:43:20 fca
New version from G.Martinez & A.Morsch
#include "AliPythia.h"
-#include "AliMC.h"
+#include "AliRun.h"
+
ClassImp(AliPythia)
#ifndef WIN32
AliPythia::AliPythia()
{
+// Constructor
for (Int_t i=0; i<501; i++) {
fGPCode[i][0]=0;
fGPCode[i][1]=0;
void AliPythia::Lu1Ent(Int_t flag, Int_t idpart,
Float_t mom, Float_t theta,Float_t phi)
{
+// Wrap of Pythia lu1ent subroutine
printf("%d %d %f %f %f\n",flag, idpart, mom, theta, phi);
lu1ent(flag, idpart, mom, theta, phi);
void AliPythia::DecayParticle(Int_t idpart,
Float_t mom, Float_t theta,Float_t phi)
{
+// Decay a particle
Lu1Ent(0, idpart, mom, theta, phi);
GetPrimaries();
}
void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
{
+// Initialise the process to generate
fProcess = process;
fEcms = energy;
fStrucFunc = strucfunc;
Int_t AliPythia::CountProducts(Int_t channel, Int_t particle)
{
+// Count number of decay products
Int_t np=0;
for (Int_t i=1; i<=5; i++) {
if (TMath::Abs(GetKFDP(channel,i)) == particle) np++;
void AliPythia::AllowAllDecays()
{
+// Reset decay flags
Int_t i;
for (i=1; i<= 2000; i++) {
SetMDME(i,1,1);
void AliPythia::ForceDecay(Decay_t decay)
{
+// Force a particle decay mode
fDecay=decay;
//
// Make clean
void AliPythia::DefineParticles()
{
+// Define new particles
if (fgInit) return;
fgInit=1;
Int_t AliPythia::GetGeantCode(Int_t kf)
{
+// Get geant code
Int_t kc=Lucomp(TMath::Abs(kf));
return (kf > 0) ? fGPCode[kc][0] : fGPCode[kc][1];
}
Float_t AliPythia::GetBraPart(Int_t kf)
{
+// Get branching ratio
Int_t kc=Lucomp(TMath::Abs(kf));
return fBraPart[kc];
}
-
+Int_t AliPythia::CheckedLuComp(Int_t kf)
+{
+// Check Lund particle code (for debugging)
+ Int_t kc=Lucomp(kf);
+ printf("\n Lucomp kf,kc %d %d",kf,kc);
+ return kc;
+}
-#ifndef _AliPythia_H
-#define _AliPythia_H
+#ifndef ALIPYTHIA_H
+#define ALIPYTHIA_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
class AliPythia:public TPythia
{
- protected:
- Process_t fProcess;
- Decay_t fDecay;
- Float_t fEcms;
- StrucFunc_t fStrucFunc;
- Int_t fGPCode[501][2];
- Float_t fBraPart[501];
-
public:
- static Int_t fgInit;
AliPythia();
virtual ~AliPythia(){;}
// convert to compressed code and print result (for debugging only)
- virtual Int_t CheckedLuComp(Int_t kf)
- {
- Int_t kc=Lucomp(kf);
- printf("\n Lucomp kf,kc %d %d",kf,kc);
- return kc;
- }
+ virtual Int_t CheckedLuComp(Int_t kf);
// entry to the corresponding lujet function
virtual void Lu1Ent(int flag, int idpart,
float mom, float theta,float phi);
//
// Get sum of branching ratios for forced decays
virtual Float_t GetBraPart(Int_t kf);
+ protected:
+ Process_t fProcess; // Process type
+ Decay_t fDecay; // Decay channel
+ Float_t fEcms; // Centre of mass energy
+ StrucFunc_t fStrucFunc; // Structure function
+ Int_t fGPCode[501][2]; // Particle codes
+ Float_t fBraPart[501]; // Branching ratios
+ static Int_t fgInit; // Make sure that only one object of type
+ // AliPythia is ceated
+
ClassDef(AliPythia,1) //ALICE UI to PYTHIA
};