fmssim
pythiaEvent.h
Go to the documentation of this file.
00001 
00013 #ifndef __CINT__
00014 # include <stdlib.h> // Replace deprecated headers with C++ standard ones.
00015 # include <ostream>
00016 # include <TROOT.h>
00017 # include <TRint.h>
00018 # include <TApplication.h>
00019 # include <TFile.h>
00020 # include <TObject.h>
00021 #endif
00022 
00023 # include <TPythia6.h>
00024 # include <TClonesArray.h>
00025 # include <TTree.h>
00026 # include <math.h> // Replace deprecated headers with C++ standard ones.
00027 #include <vector>
00028 using std::vector; // Get rid of 'using' statment in header.
00029 
00030 #define NDET 16
00031 #define NTYPES 8
00032 
00033 #define NOSTARLIB // What is the purpose of this?
00034 
00035 #ifndef NOSTARLIB
00036 class StPythiaAnalyzer;
00037 class StJetAssociator;
00038 class StProtoJet;
00039 #endif
00040 
00048 class pythiaParticle : public TObject{
00049 public:
00050    static Long64_t count; // Added for debug
00051    pythiaParticle(){++count;};
00052    pythiaParticle(Pyjets_t* pyj, Int_t i);
00053    virtual ~pythiaParticle(){--count;};
00054    void dump() const;
00055    
00056    Int_t mstatus;        // status of particle          ( LUJETS K[1] )
00057    Int_t mpdg_id;        // flavour code                ( LUJETS K[2] )
00058    Int_t mparent;        // parrent's id                ( LUJETS K[3] )
00059    Int_t mfirstChild;    // id of first child           ( LUJETS K[4] )
00060    Int_t mlastChild;     // id of last  child           ( LUJETS K[5] )
00061    Float_t mpx;          // X momenta [GeV/c]           ( LUJETS P[1] )
00062    Float_t mpy;          // Y momenta [GeV/c]           ( LUJETS P[2] )
00063    Float_t mpz;          // Z momenta [GeV/c]           ( LUJETS P[3] )
00064    Float_t menergy;      // energy    [GeV/c]           ( LUJETS P[4] )
00065    Float_t mmass;        // Mass      [Gev/c^2]         ( LUJETS P[5] )
00066    Float_t mvx;          // X vertex  [cm];             ( LUJETS V[1] )
00067    Float_t mvy;          // Y vertex  [cm];             ( LUJETS V[2] )
00068    Float_t mvz;          // Z vertex  [cm];             ( LUJETS V[3] )
00069    Float_t mvt;          // time of procuction [cm/c]   ( LUJETS V[4] )
00070    Float_t mlifetime;    // proper lifetime [cm/c]      ( LUJETS V[5] )
00071    Float_t met;          // trasnverse energy
00072    Float_t mpt;          // trasnverse energy
00073    Float_t meta;         // psudo rapidity
00074    Float_t mphi;         // phi angle
00075    Double_t mCharge;     //charge in units of e
00076    
00077    Int_t c2JetIndex;     //index into c2 jets
00078    Int_t cluJetIndex;    //index into clu jets
00079    
00080    Bool_t cluLp;         //is it the leading particle in the clu Jet
00081    Bool_t cluLcp;        //is it the leading charged particle in the clu Jet
00082    Bool_t cluTpcLcp;     //is it the tpc detected lcp in the clu Jet
00083    Bool_t c2Lp;          //is it the leading particle in c2 Jet
00084    Bool_t c2Lcp;         //is it the leading charged particle in c2 Jet
00085    Bool_t c2TpcLcp;      //is it the tpc detected lcp in the c2 Jet
00086    
00087    // What are all these variables?
00088    // Which detectors the particle passes through?
00089    Bool_t dZdcE;
00090    Bool_t dZdcW;
00091    Bool_t dFpd;
00092    Bool_t dFpdNF;
00093    Bool_t dFpdNN;
00094    Bool_t dFpdS;
00095    Bool_t dFpdT;
00096    Bool_t dFpdB;
00097    Bool_t dFMS;
00098    Bool_t dFMS2;
00099    Bool_t dBbcE1;
00100    Bool_t dBbcE2;
00101    Bool_t dBbcE3;
00102    Bool_t dBbcW1;
00103    Bool_t dBbcW2;
00104    Bool_t dBbcW3;
00105    Bool_t dCtb;
00106    Bool_t dTpc;
00107    
00108    double theta() const { return acos(mpz/p()); };
00109    
00111    
00112    double eta() const {
00113       double arg = tan(theta()/2.);
00114       return (arg>0.) ? -log(arg) : -999;
00115    }
00116    
00117    double getEta() const {
00118       double arg = tan(theta()/2.);
00119       return (arg>0.) ? -log(arg) : -999;
00120    }
00121    double px() const {return mpx;}
00122    double py() const {return mpy;}
00123    double pz() const {return mpz;}
00124    double p() const {return sqrt(mpx*mpx + mpy*mpy + mpz*mpz);}
00125    double pt() const {return sqrt(mpx*mpx+mpy*mpy);}
00126    double getPt() const {return pt();}
00127    
00128    double e() const {return sqrt(fabs(mpx*mpx + mpy*mpy + mpz*mpz + mmass*mmass));}
00129    double eT() const {return met;}
00130    double eZ() const {return met*sinh(eta());}
00131    
00132    double getPhi() const {return mphi;}
00133    double phi() const {return mphi;}
00134    
00135    double mass() const {return mmass;}
00136    
00137    double rapidity() const {
00138       double num = e()+mpz;
00139       double den = e()-mpz;
00140       
00141       if (den==0.) {return -999;}
00142       double arg = num/den;
00143       if (arg<0.) {return -999;}
00144       return 0.5 * log(arg);
00145    };
00146    
00147    double charge() const;
00148    
00149 private:
00150    ClassDef(pythiaParticle,4)
00151 };
00152 
00153 
00161 class pythiaEvent: public TObject{
00162 public:
00163    
00164    pythiaEvent(Int_t n=200, Int_t filterout=0, Int_t debugon=0);
00165    virtual ~pythiaEvent();
00166    void dump();
00167    void clear();
00168    void fill(Int_t i, TPythia6& pythia);
00169    void fillntp(Int_t i, int runnum, float zvert, TPythia6& pythia);
00170    void fillntp_1part(Int_t i, int runnum, float zvert, int pId, float px, float py, float pz, float energy, float mass);
00171    void closentp(float msel, float seed, float cs, float nevt);
00172    void STARDetector(float zvert);
00173    void jetAnalysis();
00174    
00175 #ifndef NOSTARLIB 
00176 
00177    
00178    // Which Mike?
00179 
00180    void setPythiaAnalyzer(StPythiaAnalyzer* a) {mAnalyzer = a;}
00181    void setJetAssociator(StJetAssociator* a) {mAssoc = a;}
00182    
00183    bool diJet() const {return out1 && out2;}
00184    
00185    //Here are some jet-wise utilities:
00186    typedef vector<pythiaParticle*> ParticleVec; 
00187    
00189    ParticleVec cluJetDaughters(int jetIndex); 
00190    
00192    ParticleVec c2JetDaughters(int jetIndex); 
00193 #endif
00194    
00195    // Need to figure out what all of these mean...
00196    
00197    Int_t         debug;
00198    Int_t         filter;             // filter output to GEANT
00199    Int_t         eventNumber;
00200    Int_t         subprocessType;
00201    Int_t         nParticle;
00202    Int_t         nFinalState;
00203    Float_t       shat;     
00204    Float_t       that;     
00205    Float_t       Q2;       
00206    Float_t       costheta; 
00207    Int_t         in1;      
00208    Int_t         in2;      
00209    Int_t         out1;     
00210    Int_t         out2;     
00211    Float_t       x1;       
00212    Float_t       x2;       
00213    
00214    Float_t       eZdcW;
00215    Float_t       eZdcE;
00216    Float_t       eSumFms[2][2];
00217    Float_t       eFms[40];
00218    Float_t       eFpd[2][16][16];
00219    Float_t       eFpdEM[2][16][16];
00220    Float_t       eFpdMax[3];
00221    Float_t       eFpdNN;
00222    Float_t       eFpdNF;
00223    Float_t       eFpdS;
00224    Float_t       eFpdT;
00225    Float_t       eFpdB;
00226    Int_t         nBbcE1;
00227    Int_t         nBbcE2;
00228    Int_t         nBbcE3;
00229    Int_t         nBbcW1;
00230    Int_t         nBbcW2;
00231    Int_t         nBbcW3;
00232    Int_t         nCtb;
00233    Int_t         nTpc;
00234    
00235    Int_t         Lcp;
00236    Float_t       LcpPt;
00237    Float_t       LcpEta;
00238    Float_t       LcpPhi;
00239    Float_t       sumPt;
00240    Float_t       vectorSumPt;
00241    Float_t       weightedEta;
00242    Float_t       weightedPhi;
00243    Int_t         nPJets;
00244    Int_t         nFJets;
00245    Int_t         nSJets;
00246    Int_t         nCJets;
00247    Int_t         nC2Jets;
00248    Int_t         nCluJets;
00249    Float_t       dEt[NTYPES][2];
00250    Float_t       dEta[NTYPES][2];
00251    Float_t       dPhi[NTYPES][2];
00252    
00253    TClonesArray* particles;
00254    TClonesArray* pJets;
00255    TClonesArray* fJets;
00256    TClonesArray* sJets;
00257    TClonesArray* cJets;
00258    TClonesArray* c2Jets;
00259    TClonesArray* cluJets;
00260    
00261 private:
00262 #ifndef NOSTARLIB
00263    void setCluIndex(StProtoJet& pj, int ijet);
00264    void setC2Index(StProtoJet& pj, int ijet);    
00265    StPythiaAnalyzer* mAnalyzer; 
00266    StJetAssociator* mAssoc; 
00267 #endif
00268    
00269    ClassDef(pythiaEvent,5);
00270 };
00271 
00272 
00276 class pythiaRun: public TObject{
00277 public:
00278    pythiaRun();
00279    virtual ~pythiaRun(){};
00280    Int_t nEvent;
00281    Int_t MSEL;
00282    Float_t energy;
00283    Float_t xsection;
00284    Float_t CKIN3;
00285    Float_t CKIN4;
00286    float   getXSection(TPythia6 &);
00287 private:
00288    ClassDef(pythiaRun,1);
00289 };
00290 
00291 //functors
00292 // Only used in the .cxx file, move there.
00293 struct PythiaPartPtLessThan
00294 {
00295    bool operator() (pythiaParticle* lhs, pythiaParticle* rhs) {
00296       return lhs->pt()<rhs->pt();
00297    }
00298 };
00299 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines