ROOT logo
#ifndef ALIGENINFOMAKER_H
#define ALIGENINFOMAKER_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */



//////////////////////////////////////////////////////////////////////////////
//                          Class AliGenInfoMaker                           //
//   collect together MC info for comparison purposes - effieciency studies and so on//                                                                 //
//   marian.ivanov@cern.ch                                                  //
//////////////////////////////////////////////////////////////////////////////




#include <TParticle.h>
#include "AliAnalysisTask.h"
#include "AliTrackReference.h"

class TFile;
class AliRunLoader;
class AliStack;
class AliTPCParam;
class AliMCEventHandler;
class AliMCInfo;

////////////////////////////////////////////////////////////////////////
// 
// Start of implementation of the class AliGenInfoMaker
//
////////////////////////////////////////////////////////////////////////

class AliGenInfoMaker : public TObject {

public:
  AliGenInfoMaker();
  virtual ~AliGenInfoMaker();
  // 
  //
  AliGenInfoMaker(const char * fnGalice, const char* fnRes,
		   Int_t nEvents=1, Int_t firstEvent=0);
  //event by event function - used in the analysis task
  Int_t ProcessEvent(AliMCEventHandler* mcinfo);

  Int_t ProcessEvent();   // process event
  Int_t TreeKLoop();      // process kinamatics
  Int_t TreeTRLoop();     // process track refereces
  Int_t TreeDLoop();      // process digits tree
  Int_t BuildKinkInfo();  // build information about MC kinks
  Int_t BuildV0Info();    // build information about MC kinks
  //
  //
  Int_t Exec();  
  void CreateTreeGenTracks();
  void CloseOutputFile();
  void SetFirstEventNr(Int_t i) {fFirstEventNr = i;}
  void SetNEvents(Int_t i) {fNEvents = i;}
  void SetDebug(Int_t level) {fDebug = level;}
  Int_t SetIO(Int_t eventNr);
  Int_t CloseIOEvent();
  Int_t CloseIO();
  Int_t SetIO();

protected:
  AliGenInfoMaker(const AliGenInfoMaker& /*info*/);
  AliGenInfoMaker& operator=(const AliGenInfoMaker& /*info*/) { return *this;}

  AliMCInfo * MakeInfo(UInt_t i);
  AliMCInfo * GetInfo(UInt_t i) const {return (i<fNParticles)? fGenInfo[i]:0;}
  Float_t TR2LocalX(AliTrackReference *trackRef,
		    AliTPCParam *paramTPC) const;
  AliTPCParam * GetTPCParam();
  //
  TObjArray *fGenTracksArray;  //clones array with filtered particles
  TObjArray *fGenKinkArray;    //clones array with filtered Kinks
  TObjArray *fGenV0Array;      //clones array with filtered V0s
  //
  Int_t  fDebug;                   //! debug flag  
  Int_t  fEventNr;                 //! current event number
  Int_t  fLabel;                   //! track label
  Int_t  fNEvents;                 //! number of events to process
  Int_t  fFirstEventNr;            //! first event to process
  UInt_t fNParticles;              //! number of particles in TreeK
  TTree *fTreeGenTracks;          //! output tree with generated tracks
  TTree *fTreeKinks;             //!  output tree with Kinks
  TTree *fTreeV0;                //!  output tree with V0
  char   fFnRes[1000];             //! output file name with stored tracks
  TFile *fFileGenTracks;          //! output file with stored fTreeGenTracks
  //
  AliRunLoader * fLoader;         //! pointer to the run loader
  TTree * fTreeD;                 //! current tree with digits
  TTree * fTreeTR;                //! current tree with TR
  AliStack *fStack;               //! current stack
  // 
  AliMCInfo **   fGenInfo;    //! array with pointers to gen info
  Int_t   fNInfos;                  //! number of tracks with infos
  //
  AliTPCParam* fParamTPC;         //! AliTPCParam
  Float_t  fVPrim[3];             //! primary vertex position                                  // the fVDist[3] contains size of the 3-vector
  // cuts
  //
  Double_t fTPCPtCut; // do not store particles with generated pT less than this
  Double_t fITSPtCut; // do not store particles with generated pT less than this
  Double_t fTRDPtCut; // do not store particles with generated pT less than this
  Double_t fTOFPtCut; // do not store particles with generated pT less than this
 
  ClassDef(AliGenInfoMaker,0)    // class which creates and fills tree with TPCGenTrack objects
};






#endif
 AliGenInfoMaker.h:1
 AliGenInfoMaker.h:2
 AliGenInfoMaker.h:3
 AliGenInfoMaker.h:4
 AliGenInfoMaker.h:5
 AliGenInfoMaker.h:6
 AliGenInfoMaker.h:7
 AliGenInfoMaker.h:8
 AliGenInfoMaker.h:9
 AliGenInfoMaker.h:10
 AliGenInfoMaker.h:11
 AliGenInfoMaker.h:12
 AliGenInfoMaker.h:13
 AliGenInfoMaker.h:14
 AliGenInfoMaker.h:15
 AliGenInfoMaker.h:16
 AliGenInfoMaker.h:17
 AliGenInfoMaker.h:18
 AliGenInfoMaker.h:19
 AliGenInfoMaker.h:20
 AliGenInfoMaker.h:21
 AliGenInfoMaker.h:22
 AliGenInfoMaker.h:23
 AliGenInfoMaker.h:24
 AliGenInfoMaker.h:25
 AliGenInfoMaker.h:26
 AliGenInfoMaker.h:27
 AliGenInfoMaker.h:28
 AliGenInfoMaker.h:29
 AliGenInfoMaker.h:30
 AliGenInfoMaker.h:31
 AliGenInfoMaker.h:32
 AliGenInfoMaker.h:33
 AliGenInfoMaker.h:34
 AliGenInfoMaker.h:35
 AliGenInfoMaker.h:36
 AliGenInfoMaker.h:37
 AliGenInfoMaker.h:38
 AliGenInfoMaker.h:39
 AliGenInfoMaker.h:40
 AliGenInfoMaker.h:41
 AliGenInfoMaker.h:42
 AliGenInfoMaker.h:43
 AliGenInfoMaker.h:44
 AliGenInfoMaker.h:45
 AliGenInfoMaker.h:46
 AliGenInfoMaker.h:47
 AliGenInfoMaker.h:48
 AliGenInfoMaker.h:49
 AliGenInfoMaker.h:50
 AliGenInfoMaker.h:51
 AliGenInfoMaker.h:52
 AliGenInfoMaker.h:53
 AliGenInfoMaker.h:54
 AliGenInfoMaker.h:55
 AliGenInfoMaker.h:56
 AliGenInfoMaker.h:57
 AliGenInfoMaker.h:58
 AliGenInfoMaker.h:59
 AliGenInfoMaker.h:60
 AliGenInfoMaker.h:61
 AliGenInfoMaker.h:62
 AliGenInfoMaker.h:63
 AliGenInfoMaker.h:64
 AliGenInfoMaker.h:65
 AliGenInfoMaker.h:66
 AliGenInfoMaker.h:67
 AliGenInfoMaker.h:68
 AliGenInfoMaker.h:69
 AliGenInfoMaker.h:70
 AliGenInfoMaker.h:71
 AliGenInfoMaker.h:72
 AliGenInfoMaker.h:73
 AliGenInfoMaker.h:74
 AliGenInfoMaker.h:75
 AliGenInfoMaker.h:76
 AliGenInfoMaker.h:77
 AliGenInfoMaker.h:78
 AliGenInfoMaker.h:79
 AliGenInfoMaker.h:80
 AliGenInfoMaker.h:81
 AliGenInfoMaker.h:82
 AliGenInfoMaker.h:83
 AliGenInfoMaker.h:84
 AliGenInfoMaker.h:85
 AliGenInfoMaker.h:86
 AliGenInfoMaker.h:87
 AliGenInfoMaker.h:88
 AliGenInfoMaker.h:89
 AliGenInfoMaker.h:90
 AliGenInfoMaker.h:91
 AliGenInfoMaker.h:92
 AliGenInfoMaker.h:93
 AliGenInfoMaker.h:94
 AliGenInfoMaker.h:95
 AliGenInfoMaker.h:96
 AliGenInfoMaker.h:97
 AliGenInfoMaker.h:98
 AliGenInfoMaker.h:99
 AliGenInfoMaker.h:100
 AliGenInfoMaker.h:101
 AliGenInfoMaker.h:102
 AliGenInfoMaker.h:103
 AliGenInfoMaker.h:104
 AliGenInfoMaker.h:105
 AliGenInfoMaker.h:106
 AliGenInfoMaker.h:107
 AliGenInfoMaker.h:108
 AliGenInfoMaker.h:109
 AliGenInfoMaker.h:110
 AliGenInfoMaker.h:111
 AliGenInfoMaker.h:112
 AliGenInfoMaker.h:113
 AliGenInfoMaker.h:114
 AliGenInfoMaker.h:115
 AliGenInfoMaker.h:116