From f87cfe57f327b7430c8bbffeb2a81ad3db4115c8 Mon Sep 17 00:00:00 2001 From: morsch Date: Fri, 9 Jun 2000 20:37:51 +0000 Subject: [PATCH] All coding rule violations except RS3 corrected --- EVGEN/AliDimuCombinator.cxx | 333 +++++++++++++++++++++++------------- EVGEN/AliDimuCombinator.h | 76 ++++---- EVGEN/AliGenDoubleScan.cxx | 72 ++++---- EVGEN/AliGenDoubleScan.h | 19 +- EVGEN/AliGenExtFile.cxx | 93 +++++----- EVGEN/AliGenExtFile.h | 71 ++++---- EVGEN/AliGenFLUKAsource.cxx | 117 ++++++++----- EVGEN/AliGenFLUKAsource.h | 95 +++++----- EVGEN/AliGenHalo.cxx | 34 +++- EVGEN/AliGenHalo.h | 24 +-- EVGEN/AliGenMUONlib.cxx | 5 +- EVGEN/AliGenMUONlib.h | 4 +- EVGEN/AliGenPHOSlib.cxx | 211 +++++++++++++---------- EVGEN/AliGenPHOSlib.h | 38 ++-- EVGEN/AliGenParam.cxx | 21 ++- EVGEN/AliGenParam.h | 13 +- EVGEN/AliGenPythia.cxx | 27 +-- EVGEN/AliGenPythia.h | 22 ++- EVGEN/AliGenScan.cxx | 13 +- EVGEN/AliGenScan.h | 59 +++---- EVGEN/AliPythia.cxx | 24 ++- EVGEN/AliPythia.h | 30 ++-- 22 files changed, 801 insertions(+), 600 deletions(-) diff --git a/EVGEN/AliDimuCombinator.cxx b/EVGEN/AliDimuCombinator.cxx index 69e13388d30..b1116c0e1a1 100644 --- a/EVGEN/AliDimuCombinator.cxx +++ b/EVGEN/AliDimuCombinator.cxx @@ -15,6 +15,9 @@ /* $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 @@ -25,148 +28,196 @@ Introduction of the Copyright and cvs Log // // #include "AliDimuCombinator.h" -#include "AliRun.h" #include "AliPDG.h" -#include "TRandom.h" +#include +#include +#include // 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; @@ -174,6 +225,7 @@ void AliDimuCombinator::SetFirstRange(Int_t from, Int_t to) void AliDimuCombinator::SetSecondRange(Int_t from, Int_t to) { +// Reset index range for second muon fimin2=from; fimax2=to; if (fimax2 > fNParticle) fimax2=fNParticle; @@ -184,7 +236,7 @@ void AliDimuCombinator::SetSecondRange(Int_t from, Int_t to) Bool_t AliDimuCombinator::Selected(TParticle* part) { -// +// Selection cut for single muon // if (part==0) {return 0;} @@ -193,12 +245,12 @@ Bool_t AliDimuCombinator::Selected(TParticle* part) } else { return 0; } - - } Bool_t AliDimuCombinator::Selected(TParticle* part1, TParticle* part2) { +// Selection cut for dimuons +// return Selected(part1)*Selected(part2); } // @@ -206,6 +258,8 @@ Bool_t AliDimuCombinator::Selected(TParticle* part1, TParticle* 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(); @@ -221,6 +275,8 @@ Float_t AliDimuCombinator::Mass(TParticle* part1, TParticle* part2) 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(); @@ -229,11 +285,15 @@ Float_t AliDimuCombinator::PT(TParticle* part1, TParticle* part2) 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(); @@ -243,26 +303,30 @@ Float_t AliDimuCombinator::Y(TParticle* part1, TParticle* part2) // 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 // @@ -275,8 +339,8 @@ Float_t AliDimuCombinator::Decay_Prob(TParticle* part) 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; } @@ -284,6 +348,8 @@ Float_t AliDimuCombinator::Decay_Prob(TParticle* part) Float_t AliDimuCombinator::Weight(TParticle* part1, TParticle* part2) { +// Dimuon weight + Float_t wgt=(part1->GetWeight())*(part2->GetWeight()); if (Correlated(part1, part2)) { @@ -296,10 +362,14 @@ Float_t AliDimuCombinator::Weight(TParticle* part1, TParticle* 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 { @@ -309,11 +379,15 @@ Bool_t AliDimuCombinator::Correlated(TParticle* part1, TParticle* part2) 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; @@ -328,3 +402,16 @@ Int_t AliDimuCombinator::Origin(TParticle* part) return iparent; } +AliDimuCombinator& AliDimuCombinator::operator=(const AliDimuCombinator& rhs) +{ +// Assignment operator + return *this; +} + + + + + + + + diff --git a/EVGEN/AliDimuCombinator.h b/EVGEN/AliDimuCombinator.h index 0ce339047af..ae6a593d6d4 100644 --- a/EVGEN/AliDimuCombinator.h +++ b/EVGEN/AliDimuCombinator.h @@ -1,39 +1,22 @@ -#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 +#include -#include "TParticle.h" -#include -#include -#include -#include +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 @@ -55,7 +38,9 @@ public: 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); @@ -70,7 +55,8 @@ public: 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(); @@ -80,27 +66,29 @@ public: 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 + diff --git a/EVGEN/AliGenDoubleScan.cxx b/EVGEN/AliGenDoubleScan.cxx index ebb69286e79..c554d72263b 100644 --- a/EVGEN/AliGenDoubleScan.cxx +++ b/EVGEN/AliGenDoubleScan.cxx @@ -15,11 +15,14 @@ /* $Log$ +Revision 1.1 2000/02/23 16:25:14 morsch +First commit of this file + */ #include "AliGenDoubleScan.h" -#include #include "AliRun.h" + ClassImp(AliGenDoubleScan) AliGenDoubleScan::AliGenDoubleScan() @@ -30,48 +33,51 @@ $Log$ 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; ixRndm(random,6); diff --git a/EVGEN/AliGenDoubleScan.h b/EVGEN/AliGenDoubleScan.h index db487aa9093..0a1044c5452 100644 --- a/EVGEN/AliGenDoubleScan.h +++ b/EVGEN/AliGenDoubleScan.h @@ -1,32 +1,23 @@ -#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 diff --git a/EVGEN/AliGenExtFile.cxx b/EVGEN/AliGenExtFile.cxx index cc5ef08e68f..5691c683a6b 100644 --- a/EVGEN/AliGenExtFile.cxx +++ b/EVGEN/AliGenExtFile.cxx @@ -15,6 +15,9 @@ /* $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 @@ -37,7 +40,7 @@ Introduction of the Copyright and cvs Log AliGenExtFile::AliGenExtFile() :AliGenerator(-1) { - // +// Constructor fName="ExtFile"; fTitle="Primaries from ext. File"; fFileName="dtujet93.root"; @@ -51,7 +54,7 @@ Introduction of the Copyright and cvs Log AliGenExtFile::AliGenExtFile(Int_t npart) :AliGenerator(npart) { - // +// Constructor fName="ExtFile"; fTitle="Primaries from ext. File"; fFileName="dtujet93.root"; @@ -59,9 +62,14 @@ AliGenExtFile::AliGenExtFile(Int_t npart) fNcurrent=0; } +AliGenExtFile::AliGenExtFile(const AliGenExtFile & ExtFile) +{ +// copy constructor +} //____________________________________________________________ AliGenExtFile::~AliGenExtFile() { +// Destructor delete fTreeNtuple; } @@ -72,38 +80,39 @@ void AliGenExtFile::NtupleInit() // 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 "<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}; // @@ -111,15 +120,15 @@ void AliGenExtFile::Generate() 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) { @@ -140,30 +149,30 @@ void AliGenExtFile::Generate() printf("\n This should never happen !\n"); } else { printf("\n Next event contains %d tracks! \n", i6); - Ntracks=i6; + nTracks=i6; } - for (i=0; iPDGFromId(Idpart); - Double_t amass = TDatabasePDG::Instance()->GetParticle(Idpart)->Mass(); - if(E<=amass) { + for (i=0; iPDGFromId(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(ThetafThetaMax || - PhifPhiMax || + fTheta *= TMath::Pi()/180.; + fPhi = (fPhi-180)*TMath::Pi()/180.; + if(fThetafThetaMax || + fPhifPhiMax || prwnfPMax) { ; } 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); @@ -173,25 +182,31 @@ void AliGenExtFile::Generate() 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; +} + diff --git a/EVGEN/AliGenExtFile.h b/EVGEN/AliGenExtFile.h index dc1579a96e5..0114de5f1d2 100644 --- a/EVGEN/AliGenExtFile.h +++ b/EVGEN/AliGenExtFile.h @@ -1,53 +1,50 @@ -#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 diff --git a/EVGEN/AliGenFLUKAsource.cxx b/EVGEN/AliGenFLUKAsource.cxx index 7ecd575a0fb..f02e4aedb1a 100644 --- a/EVGEN/AliGenFLUKAsource.cxx +++ b/EVGEN/AliGenFLUKAsource.cxx @@ -15,6 +15,9 @@ /* $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 @@ -35,12 +38,13 @@ Introduction of the Copyright and cvs Log #include #include #include +#include #include ClassImp(AliGenFLUKAsource) AliGenFLUKAsource::AliGenFLUKAsource() :AliGenerator(-1) { - // + // Constructor fName="FLUKA"; fTitle="FLUKA Boundary Source"; // Read in all particle types by default @@ -63,13 +67,14 @@ Introduction of the Copyright and cvs Log // // 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 @@ -89,18 +94,26 @@ AliGenFLUKAsource::AliGenFLUKAsource(Int_t npart) 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); } @@ -109,33 +122,35 @@ void AliGenFLUKAsource::AddFile(const Text_t *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, @@ -170,34 +185,40 @@ void AliGenFLUKAsource::Generate() 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; } @@ -206,25 +227,25 @@ void AliGenFLUKAsource::Generate() 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); @@ -232,7 +253,7 @@ void AliGenFLUKAsource::Generate() if (part==1 && iwgt>100) iwgt=100; Int_t nstack=0; for (j=0; jSetTrack(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); @@ -248,20 +269,24 @@ void AliGenFLUKAsource::Generate() 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; +} diff --git a/EVGEN/AliGenFLUKAsource.h b/EVGEN/AliGenFLUKAsource.h index f391330e798..600621fa38d 100644 --- a/EVGEN/AliGenFLUKAsource.h +++ b/EVGEN/AliGenFLUKAsource.h @@ -1,61 +1,25 @@ -#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 + +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() {} @@ -71,11 +35,52 @@ public: 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 }; diff --git a/EVGEN/AliGenHalo.cxx b/EVGEN/AliGenHalo.cxx index d1530450a76..44eba2023aa 100644 --- a/EVGEN/AliGenHalo.cxx +++ b/EVGEN/AliGenHalo.cxx @@ -15,26 +15,26 @@ /* $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 #include -#include -#include #include + ClassImp(AliGenHalo) AliGenHalo::AliGenHalo() :AliGenerator(-1) { +// Constructor fName="Halo"; fTitle="Halo from LHC Tunnel"; // Set the default file @@ -48,6 +48,7 @@ Introduction of the Copyright and cvs Log AliGenHalo::AliGenHalo(Int_t npart) :AliGenerator(npart) { +// Constructor fName="Halo"; fTitle="Halo from LHC Tunnel"; // Set the default file @@ -58,18 +59,28 @@ AliGenHalo::AliGenHalo(Int_t npart) 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); @@ -78,8 +89,7 @@ void AliGenHalo::Generate() } // // 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}; @@ -101,7 +111,7 @@ void AliGenHalo::Generate() 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); @@ -125,6 +135,12 @@ void AliGenHalo::Generate() } +AliGenHalo& AliGenHalo::operator=(const AliGenHalo& rhs) +{ +// Assignment operator + return *this; +} + diff --git a/EVGEN/AliGenHalo.h b/EVGEN/AliGenHalo.h index 7267f7d85d6..05632c9b811 100644 --- a/EVGEN/AliGenHalo.h +++ b/EVGEN/AliGenHalo.h @@ -1,36 +1,30 @@ -#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 diff --git a/EVGEN/AliGenMUONlib.cxx b/EVGEN/AliGenMUONlib.cxx index 97c850d6ea2..f904996f915 100644 --- a/EVGEN/AliGenMUONlib.cxx +++ b/EVGEN/AliGenMUONlib.cxx @@ -15,13 +15,16 @@ /* $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 diff --git a/EVGEN/AliGenMUONlib.h b/EVGEN/AliGenMUONlib.h index 23d3acea0fb..858766b90a9 100644 --- a/EVGEN/AliGenMUONlib.h +++ b/EVGEN/AliGenMUONlib.h @@ -5,7 +5,7 @@ /* $Id$ */ -#include +#include #include "GenTypeDefs.h" class AliGenMUONlib : @@ -49,7 +49,7 @@ public TObject 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 diff --git a/EVGEN/AliGenPHOSlib.cxx b/EVGEN/AliGenPHOSlib.cxx index 9cda7d26ad5..b4cc49949c3 100644 --- a/EVGEN/AliGenPHOSlib.cxx +++ b/EVGEN/AliGenPHOSlib.cxx @@ -15,6 +15,9 @@ /* $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 @@ -43,6 +46,7 @@ New version from G.Martinez & A.Morsch //====================================================================== #include "AliGenPHOSlib.h" +#include "TMath.h" #include "AliRun.h" ClassImp(AliGenPHOSlib) @@ -62,42 +66,45 @@ 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); @@ -120,6 +127,8 @@ ClassImp(AliGenPHOSlib) // 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 @@ -127,53 +136,55 @@ ClassImp(AliGenPHOSlib) // 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); @@ -198,160 +209,175 @@ ClassImp(AliGenPHOSlib) //============================================================================ //============================================================================ // 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); @@ -379,6 +405,7 @@ ClassImp(AliGenPHOSlib) typedef Double_t (*GenFunc) (Double_t*, Double_t*); GenFunc AliGenPHOSlib::GetPt(Param_t param) { +// Return pinter to pT parameterisation GenFunc func; switch (param) @@ -410,6 +437,7 @@ typedef Double_t (*GenFunc) (Double_t*, Double_t*); GenFunc AliGenPHOSlib::GetY(Param_t param) { +// Return pointer to Y parameterisation GenFunc func; switch (param) { @@ -443,6 +471,7 @@ typedef Double_t (*GenFunc) (Double_t*, Double_t*); typedef Int_t (*GenFuncIp) (); GenFuncIp AliGenPHOSlib::GetIp(Param_t param) { +// Return pointer to particle composition GenFuncIp func; switch (param) { diff --git a/EVGEN/AliGenPHOSlib.h b/EVGEN/AliGenPHOSlib.h index 0f42895f6c5..52069c4b3d6 100644 --- a/EVGEN/AliGenPHOSlib.h +++ b/EVGEN/AliGenPHOSlib.h @@ -1,6 +1,6 @@ -#ifndef _AliGenPHOSlib_H -#define _AliGenPHOSlib_H -#include +#ifndef ALIGENPHOSLIB_H +#define ALIGENPHOSLIB_H +#include #include "GenTypeDefs.h" /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ @@ -12,41 +12,41 @@ public TObject { 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 diff --git a/EVGEN/AliGenParam.cxx b/EVGEN/AliGenParam.cxx index 60c07cd2068..f71e48456c2 100644 --- a/EVGEN/AliGenParam.cxx +++ b/EVGEN/AliGenParam.cxx @@ -15,6 +15,11 @@ /* $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. @@ -35,10 +40,10 @@ Introduction of the Copyright and cvs Log #include "AliGenParam.h" #include "AliGenMUONlib.h" -#include "AliGenPHOSlib.h" #include "AliRun.h" #include "AliPythia.h" #include +#include ClassImp(AliGenParam) @@ -122,6 +127,12 @@ AliGenParam::AliGenParam(Int_t npart, Param_t param, SetDeltaPt(); } + +AliGenParam::AliGenParam(const AliGenParam & Paramd) +{ +// copy constructor +} + //____________________________________________________________ AliGenParam::~AliGenParam() { @@ -361,7 +372,7 @@ void AliGenParam::Generate() 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, @@ -420,5 +431,11 @@ Bool_t AliGenParam::KinematicSelection(TParticle *particle) } +AliGenParam& AliGenParam::operator=(const AliGenParam& rhs) +{ +// Assignment operator + return *this; +} + diff --git a/EVGEN/AliGenParam.h b/EVGEN/AliGenParam.h index 5c7da75eaca..3604f201226 100644 --- a/EVGEN/AliGenParam.h +++ b/EVGEN/AliGenParam.h @@ -6,10 +6,13 @@ /* $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 { @@ -19,7 +22,9 @@ 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(); @@ -41,7 +46,7 @@ class AliGenParam : public AliGenerator 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 diff --git a/EVGEN/AliGenPythia.cxx b/EVGEN/AliGenPythia.cxx index 6989370fc64..5d4b7749bf5 100644 --- a/EVGEN/AliGenPythia.cxx +++ b/EVGEN/AliGenPythia.cxx @@ -15,6 +15,10 @@ /* $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) @@ -33,17 +37,11 @@ Revision 1.11 1999/09/29 09:24:14 fca Introduction of the Copyright and cvs Log */ -#include "AliGenerator.h" #include "AliGenPythia.h" #include "AliRun.h" #include "AliPythia.h" -#include -#include -#include -#include -#include #include -//#include + ClassImp(AliGenPythia) AliGenPythia::AliGenPythia() @@ -70,6 +68,11 @@ AliGenPythia::AliGenPythia(Int_t npart) SetEnergyCMS(); } +AliGenPythia::AliGenPythia(const AliGenPythia & Pythia) +{ +// copy constructor +} + AliGenPythia::~AliGenPythia() { // Destructor @@ -190,7 +193,7 @@ void AliGenPythia::Generate() while(1) { fPythia->Pyevnt(); - fPythia->Lulist(1); +// fPythia->Lulist(1); fTrials++; fPythia->ImportParticles(particles,"All"); Int_t np = particles->GetEntriesFast(); @@ -377,7 +380,7 @@ Bool_t AliGenPythia::KinematicSelection(TParticle *particle) // // 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); @@ -430,7 +433,11 @@ Int_t AliGenPythia::CheckPDGCode(Int_t pdgcode) return pdgcode; } - +AliGenPythia& AliGenPythia::operator=(const AliGenPythia& rhs) +{ +// Assignment operator + return *this; +} diff --git a/EVGEN/AliGenPythia.h b/EVGEN/AliGenPythia.h index ff5df9ff254..9d950608b7d 100644 --- a/EVGEN/AliGenPythia.h +++ b/EVGEN/AliGenPythia.h @@ -5,23 +5,20 @@ /* $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 + +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(); @@ -40,7 +37,8 @@ class AliGenPythia : public AliGenerator 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 @@ -65,7 +63,7 @@ class AliGenPythia : public AliGenerator // adjust the weight from kinematic cuts void AdjustWeights(); - ClassDef(AliGenPythia,1) + ClassDef(AliGenPythia,1) // AliGenerator interface to Pythia }; #endif diff --git a/EVGEN/AliGenScan.cxx b/EVGEN/AliGenScan.cxx index 2b3274ce332..c3272cfe1ef 100644 --- a/EVGEN/AliGenScan.cxx +++ b/EVGEN/AliGenScan.cxx @@ -15,20 +15,23 @@ /* $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 #include "AliRun.h" + ClassImp(AliGenScan) AliGenScan::AliGenScan() :AliGenerator(-1) { -// +// Constructor fXmin=0; fXmax=0; fNx=1; @@ -46,6 +49,7 @@ Introduction of the Copyright and cvs Log AliGenScan::AliGenScan(Int_t npart) :AliGenerator(npart) { +// Constructor fXmin=0; fXmax=0; fNx=1; @@ -59,12 +63,15 @@ AliGenScan::AliGenScan(Int_t npart) //____________________________________________________________ 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; diff --git a/EVGEN/AliGenScan.h b/EVGEN/AliGenScan.h index 282a62bd26a..f24bba61d3a 100644 --- a/EVGEN/AliGenScan.h +++ b/EVGEN/AliGenScan.h @@ -1,47 +1,42 @@ -#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 diff --git a/EVGEN/AliPythia.cxx b/EVGEN/AliPythia.cxx index d3b541dd69b..f0d7f6ccc89 100644 --- a/EVGEN/AliPythia.cxx +++ b/EVGEN/AliPythia.cxx @@ -15,6 +15,9 @@ /* $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 @@ -25,7 +28,8 @@ Introduction of the Copyright and cvs Log #include "AliPythia.h" -#include "AliMC.h" +#include "AliRun.h" + ClassImp(AliPythia) #ifndef WIN32 @@ -47,6 +51,7 @@ Int_t AliPythia::fgInit=0; AliPythia::AliPythia() { +// Constructor for (Int_t i=0; i<501; i++) { fGPCode[i][0]=0; fGPCode[i][1]=0; @@ -56,6 +61,7 @@ AliPythia::AliPythia() 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); @@ -63,12 +69,14 @@ void AliPythia::Lu1Ent(Int_t flag, Int_t idpart, 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; @@ -168,6 +176,7 @@ void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfun 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++; @@ -177,6 +186,7 @@ Int_t AliPythia::CountProducts(Int_t channel, Int_t particle) void AliPythia::AllowAllDecays() { +// Reset decay flags Int_t i; for (i=1; i<= 2000; i++) { SetMDME(i,1,1); @@ -211,6 +221,7 @@ void AliPythia::ForceParticleDecay(Int_t particle, Int_t product, Int_t mult) void AliPythia::ForceDecay(Decay_t decay) { +// Force a particle decay mode fDecay=decay; // // Make clean @@ -304,6 +315,7 @@ void AliPythia::ForceDecay(Decay_t decay) void AliPythia::DefineParticles() { +// Define new particles if (fgInit) return; fgInit=1; @@ -552,17 +564,25 @@ void AliPythia::ForceDecay(Decay_t decay) 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; +} diff --git a/EVGEN/AliPythia.h b/EVGEN/AliPythia.h index 9f5864d962c..e0c148bb607 100644 --- a/EVGEN/AliPythia.h +++ b/EVGEN/AliPythia.h @@ -1,5 +1,5 @@ -#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 */ @@ -10,25 +10,11 @@ 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); @@ -64,6 +50,16 @@ class AliPythia:public TPythia // // 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 }; -- 2.39.3