Line data Source code
1 : #ifndef ALIGENEPOSREADER_H
2 : #define ALIGENEPOSREADER_H
3 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 : /* $Id$ */
7 :
8 : // Realisation of the AliGenReader interface to be used with AliGenExFile.
9 : // NextEvent() loops over events
10 : // and NextParticle() loops over particles.
11 : // This implementation reads EPOS v3.111 output format (from ROOT trees)
12 : // Author: Igor Lakomov <Igor.Lakomov@cern.ch>
13 :
14 : #include <iostream>
15 : #include <fstream>
16 : #include <stdio.h>
17 : #include <vector>
18 : #include <map>
19 :
20 : #include <TFile.h>
21 : #include <TTree.h>
22 : #include <TBranch.h>
23 : #include <TParticle.h>
24 : #include <TString.h>
25 : #include <TDatabasePDG.h>
26 :
27 : #include "AliGenReader.h"
28 : #include "AliGenEventHeader.h"
29 : //#include "AliRun.h"
30 : #include "AliStack.h"
31 : #include "AliLog.h"
32 :
33 : class AliGenEposReader : public AliGenReader
34 : {
35 : public:
36 : AliGenEposReader();
37 :
38 : AliGenEposReader(const AliGenEposReader &reader);
39 : virtual ~AliGenEposReader();
40 0 : AliGenEventHeader* GetGenEventHeader() const {return fGenEventHeader;};
41 : virtual void Init();
42 : virtual Int_t NextEvent();
43 : virtual TParticle* NextParticle();
44 : virtual void RewindEvent();
45 : virtual void ChangeFile(const Text_t *fNewFileName);
46 : AliGenEposReader & operator=(const AliGenEposReader &rhs);
47 :
48 : protected:
49 : Int_t fNcurrent;
50 : Int_t fNparticle;
51 : Int_t fCurrentEvent;
52 : Int_t fCurrentParticle;
53 : TTree *fTreeNtuple;
54 : TTree *fTreeHeader;
55 : TFile *fFile;
56 : AliGenEventHeader* fGenEventHeader; // AliGenEventHeader
57 : std::multimap<Int_t,Int_t> fMothersMap;
58 :
59 : // Parameters in EPOS Tree:
60 : //--------------teposevent---------------
61 : Int_t np; //number of particles
62 : Float_t bim; //impact parameter
63 : std::vector<Float_t> zus; //different meaning depending on ptl type:
64 : // partons: presently unused
65 : // hadrons: decay information :
66 : // -999 : hadron is decay product from decay
67 : // in cascade part (mother unknown)
68 : // -1 : hadron is decay product, mother not stored
69 : // >0 : hadron is decay product, mother index = zus
70 : // so, zus is the number n of the particle, not the id
71 : // to get the id you need id(n)
72 : // -2 : no mother
73 : // phi 331, K+ 130
74 : std::vector<Float_t> px; //px
75 : std::vector<Float_t> py; //py particle four momentum
76 : std::vector<Float_t> pz; //pz
77 : std::vector<Float_t> e; //energy pf particle
78 : std::vector<Float_t> x; //x component of formation point
79 : std::vector<Float_t> y; //y component of formation point
80 : std::vector<Float_t> z; //z component of formation point
81 : std::vector<Float_t> t; //formation time
82 : std::vector<Int_t> id; //particle id
83 : std::vector<Int_t> ist; //particle status (hadron last generation(0) or not(1))
84 : std::vector<Int_t> ity; //type of particle origin (20-29 from soft strings, 30-39 from hard strings, 40-59 from remnants, 60 from fluid)
85 : std::vector<Int_t> ior; //index of father (resonance decay products)
86 : std::vector<Int_t> jor; //index of mother (mothers are needed for exemple for strings: the partons between ior and jor constitute the string)
87 :
88 : // --------------teposhead---------------
89 : Int_t fIversn; //EPOS version number
90 : Int_t fLaproj; //atomic number projectile
91 : Int_t fMaproj; //mass number projectile
92 : Int_t fLatarg; //atomic number target
93 : Int_t fMatarg; //mass number target
94 : Float_t fEngy; //energy in the CMS in GeV
95 : Int_t fNfull; //number of full events
96 : Int_t fNfreeze; //number of freeze outs per full event
97 :
98 : private:
99 : Int_t EposToPdg(Int_t code);
100 : void Copy(TObject&) const;
101 6 : ClassDef(AliGenEposReader,3)
102 : };
103 : #endif
|