ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/


///////////////////////////////////////////////////////////////////////////
/*

Origin: marian.ivanov@cern.ch

Generate complex MC information - used for Comparison later on
How to use it?


---Usage outside of the analysis framework

gSystem->Load("libANALYSIS.so")
gSystem->Load("libPWGPP.so")
AliGenInfoMaker *t = new AliGenInfoMaker("galice.root","genTracks.root",0,0)
t->Exec();

*/

#if !defined(__CINT__) || defined(__MAKECINT__)
#include <stdio.h>
#include <string.h>
//ROOT includes
#include "TROOT.h"
#include "Rtypes.h"
#include "TFile.h"
#include "TTree.h"
#include "TStopwatch.h"
#include "TParticle.h"
#include "TDatabasePDG.h"

//ALIROOT includes
#include "AliMCEvent.h"
#include "AliMCEventHandler.h"

#include "AliRun.h"
#include "AliStack.h"
#include "AliSimDigits.h"
#include "AliTPCParam.h"
#include "AliTPC.h"
#include "AliTPCLoader.h"
#include "AliTrackReference.h"
#include "AliTPCParamSR.h"
#include "AliTrackPointArray.h"

#endif
#include "AliMCInfo.h" 
#include "AliGenV0Info.h" 
#include "AliGenKinkInfo.h" 
#include "AliGenInfoMaker.h" 
//
// 

using std::cout;
using std::cerr;
using std::endl;

ClassImp(AliGenInfoMaker)






  
////////////////////////////////////////////////////////////////////////
AliGenInfoMaker::AliGenInfoMaker(): 
  fGenTracksArray(0),          //clones array with filtered particles
  fGenKinkArray(0),            //clones array with filtered Kinks
  fGenV0Array(0),              //clones array with filtered V0s
  fDebug(0),                   //! debug flag  
  fEventNr(0),                 //! current event number
  fLabel(0),                   //! track label
  fNEvents(0),                 //! number of events to process
  fFirstEventNr(0),            //! first event to process
  fNParticles(0),              //! number of particles in TreeK
  fTreeGenTracks(0),           //! output tree with generated tracks
  fTreeKinks(0),               //!  output tree with Kinks
  fTreeV0(0),                  //!  output tree with V0
  fFileGenTracks(0),           //! output file with stored fTreeGenTracks
  fLoader(0),                  //! pointer to the run loader
  fTreeD(0),                   //! current tree with digits
  fTreeTR(0),                  //! current tree with TR
  fStack(0),                   //! current stack
  fGenInfo(0),                 //! array with pointers to gen info
  fNInfos(0),                  //! number of tracks with infos
  fParamTPC(0),                //! AliTPCParam
  fTPCPtCut(0.1),              //  TPC pt cut            
  fITSPtCut(0.1),              //  ITS pt cut
  fTRDPtCut(0.1),              //  TRD pt cut
  fTOFPtCut(0.1)               //  TOF pt cut
{    
  snprintf(fFnRes,1000,"%s","genTracks.root");
  for(Int_t i=0; i<3; i++) { fVPrim[i] = 0; };  
}




////////////////////////////////////////////////////////////////////////
AliGenInfoMaker::AliGenInfoMaker(const char * fnGalice, const char* fnRes,
				 Int_t nEvents, Int_t firstEvent):
  fGenTracksArray(0),          //clones array with filtered particles
  fGenKinkArray(0),            //clones array with filtered Kinks
  fGenV0Array(0),              //clones array with filtered V0s
  fDebug(0),                   //! debug flag  
  fEventNr(0),                 //! current event number
  fLabel(0),                   //! track label
  fNEvents(0),                 //! number of events to process
  fFirstEventNr(0),            //! first event to process
  fNParticles(0),              //! number of particles in TreeK
  fTreeGenTracks(0),           //! output tree with generated tracks
  fTreeKinks(0),               //!  output tree with Kinks
  fTreeV0(0),                  //!  output tree with V0
  fFileGenTracks(0),           //! output file with stored fTreeGenTracks
  fLoader(0),                  //! pointer to the run loader
  fTreeD(0),                   //! current tree with digits
  fTreeTR(0),                  //! current tree with TR
  fStack(0),                   //! current stack
  fGenInfo(0),                 //! array with pointers to gen info
  fNInfos(0),                  //! number of tracks with infos
  fParamTPC(0),                //! AliTPCParam 
  fTPCPtCut(0.1),  
  fITSPtCut(0.1),  
  fTRDPtCut(0.1), 
  fTOFPtCut(0.1)
{
  //
  // 
  //
  for(Int_t i=0; i<3; i++) { fVPrim[i] = 0; };  
  fFirstEventNr = firstEvent;
  fEventNr = firstEvent;
  fNEvents = nEvents;
  snprintf(fFnRes,1000,"%s",fnRes);
  //
  //
  //
  fLoader = AliRunLoader::Open(fnGalice);
  if (gAlice){
    delete AliRunLoader::Instance();
    delete gAlice;
    gAlice = 0x0;
  }
  if (fLoader->LoadgAlice()){
    cerr<<"Error occured while l"<<endl;
  }
  Int_t nall = fLoader->GetNumberOfEvents();
  if (nEvents==0) {
    nEvents =nall;
    fNEvents=nall;
    fFirstEventNr=0;
  }    
  
  if (nall<=0){
    cerr<<"no events available"<<endl;
    fEventNr = 0;
    return;
  }
  if (firstEvent+nEvents>nall) {
    fEventNr = nall-firstEvent;
    cerr<<"restricted number of events availaible"<<endl;
  }
}




////////////////////////////////////////////////////////////////////////
AliGenInfoMaker::~AliGenInfoMaker()
{
  //
  // Destructor
  //
  
  if (fLoader){
    fLoader->UnloadgAlice();
    gAlice = 0;
    delete fLoader;
  }
}


AliMCInfo * AliGenInfoMaker::MakeInfo(UInt_t i)
{
  // 
  // Make info structure for given particle index
  //
  if (i<fNParticles) {
    if (fGenInfo[i]) return  fGenInfo[i];
    fGenInfo[i] = new AliMCInfo;  
    fNInfos++;
    return fGenInfo[i];
  }
  else 
    return 0;  
}


Int_t  AliGenInfoMaker::ProcessEvent(AliMCEventHandler* mcinfo){
  //
  // Process MC info from the task
  //
  if (!fParamTPC) {
    SetIO();
    fParamTPC = GetTPCParam();
  }
  fStack  = mcinfo->MCEvent()->Stack();
  fTreeTR = mcinfo->TreeTR();
  fTreeD  = 0;
  // array with preprocessedprocessed information
  fGenTracksArray = new TObjArray;
  fGenKinkArray   = new TObjArray;
  fGenV0Array     = new TObjArray;
  //
  ProcessEvent();
  fEventNr++;
  return 0;
}



Int_t AliGenInfoMaker::ProcessEvent(){
  //
  // Process Event 
  //
  fNParticles = fStack->GetNtrack();
  //
  fGenInfo = new AliMCInfo*[fNParticles];
  for (UInt_t i = 0; i<fNParticles; i++) {
    fGenInfo[i]=0; 
  }
  //
  cout<<"Start to process event "<<fEventNr<<endl;
  cout<<"\tfNParticles = "<<fNParticles<<endl;
  if (fDebug>2) cout<<"\n\n\n\tStart loop over TreeTR"<<endl;
  if (TreeTRLoop()>0) return 1;
  //
  if (fDebug>2) cout<<"\n\n\n\tStart loop over TreeD"<<endl;
  if (TreeDLoop()>0) return 1;
  //
  if (fDebug>2) cout<<"\n\n\n\tStart loop over TreeK"<<endl;
  if (TreeKLoop()>0) return 1;
  if (fDebug>2) cout<<"\tEnd loop over TreeK"<<endl;
  //
  //  if (BuildKinkInfo()>0) return 1;
  if (BuildV0Info()>0) return 1;
  if (fDebug>2) cout<<"\tEnd loop over TreeK"<<endl;
  //
  for (UInt_t i = 0; i<fNParticles; i++) {
    if (fGenInfo[i]) delete fGenInfo[i]; 
  }
  delete []fGenInfo;
  return 0;
}







Int_t  AliGenInfoMaker::SetIO()
{
  //
  // Set IO for given event 
  //
  CreateTreeGenTracks();
  if (!fTreeGenTracks) return 1;
 
  fParamTPC = GetTPCParam();
  //
  return 0;
}

////////////////////////////////////////////////////////////////////////
Int_t AliGenInfoMaker::SetIO(Int_t eventNr)
{
  //
  // 
  // SET INPUT
  fLoader->SetEventNumber(eventNr);
  //
  fLoader->LoadHeader();
  fLoader->LoadKinematics();  
  fStack = fLoader->Stack();
  //
  fLoader->LoadTrackRefs();
  fLoader->LoadHits();
  fTreeTR = fLoader->TreeTR();
  //
  AliTPCLoader * tpcl = (AliTPCLoader*)fLoader->GetLoader("TPCLoader");
  tpcl->LoadDigits();
  fTreeD = tpcl->TreeD();  
  return 0;
}

Int_t AliGenInfoMaker::CloseIOEvent()
{
  //
  // Close IO for current event
  //
  fLoader->UnloadHeader();
  fLoader->UnloadKinematics();
  fLoader->UnloadTrackRefs();
  AliTPCLoader * tpcl = (AliTPCLoader*)fLoader->GetLoader("TPCLoader");
  tpcl->UnloadDigits();
  return 0;
}

Int_t AliGenInfoMaker::CloseIO()
{
  fLoader->UnloadgAlice();
  return 0;
}



////////////////////////////////////////////////////////////////////////
Int_t AliGenInfoMaker::Exec()  
{
  //
  // Make a comparision MC tree
  // Connect MC information -TPArticle - AliTrackRefernces ...
  //
  TStopwatch timer;
  timer.Start();
  Int_t status =SetIO();
  if (status>0) return status;
  //
  for (fEventNr = fFirstEventNr; fEventNr < fFirstEventNr+fNEvents;
       fEventNr++) {
    SetIO(fEventNr);
    ProcessEvent();
    CloseIOEvent();
  }
  //
  CloseIO();
  CloseOutputFile();
  cerr<<"Exec finished"<<endl;
  timer.Stop();
  timer.Print();
  return 0;
}






////////////////////////////////////////////////////////////////////////
void AliGenInfoMaker::CreateTreeGenTracks() 
{
  //
  //
  //
  fFileGenTracks = TFile::Open(fFnRes,"RECREATE");
  if (!fFileGenTracks) {
    cerr<<"Error in CreateTreeGenTracks: cannot open file "<<fFnRes<<endl;
    return;
  }
  fTreeGenTracks = new TTree("genTracksTree","genTracksTree");  
  AliMCInfo * info = new AliMCInfo;
  fTreeGenTracks->Branch("MC","AliMCInfo",&info);
  delete info; 
  //
  AliGenKinkInfo *kinkinfo = new AliGenKinkInfo;
  fTreeKinks = new TTree("genKinksTree","genKinksTree");  
  fTreeKinks->Branch("MC","AliGenKinkInfo",&kinkinfo);
  delete kinkinfo;
  //
  AliGenV0Info *v0info = new AliGenV0Info;
  fTreeV0 = new TTree("genV0Tree","genV0Tree");  
  fTreeV0->Branch("MC","AliGenV0Info",&v0info);
  delete v0info;
  //
  //
  //
  fTreeGenTracks->AutoSave();
  fTreeKinks->AutoSave();
  fTreeV0->AutoSave();
}



////////////////////////////////////////////////////////////////////////
void AliGenInfoMaker::CloseOutputFile() 
{
  //
  // Close Output files
  //
  if (!fFileGenTracks) {
    cerr<<"File "<<fFnRes<<" not found as an open file."<<endl;
    return;
  }
  fFileGenTracks->cd();
  fTreeGenTracks->Write();  
  delete fTreeGenTracks;
  fTreeKinks->Write();
  delete fTreeKinks;
  fTreeV0->Write();
  delete fTreeV0;

  fFileGenTracks->Close();
  delete fFileGenTracks;
  return;
}

////////////////////////////////////////////////////////////////////////
Int_t AliGenInfoMaker::TreeKLoop()
{
//
// open the file with treeK
// loop over all entries there and save information about some tracks
//

  AliStack * stack = fStack;
  if (!stack) {cerr<<"Stack was not found!\n"; return 1;}
  
  if (fDebug > 0) {
    cout<<"There are "<<fNParticles<<" primary and secondary particles in event "
	<<fEventNr<<endl;
  }  
  Int_t  ipdg = 0;
  //TParticlePDG *ppdg = 0;
  // not all generators give primary vertex position. Take the vertex
  // of the particle 0 as primary vertex.
  TDatabasePDG  pdg; //get pdg table  

  TParticle *particle = stack->ParticleFromTreeK(0);
  fVPrim[0] = particle->Vx();
  fVPrim[1] = particle->Vy();
  fVPrim[2] = particle->Vz();
  Int_t accepted =0;
  for (UInt_t iParticle = 0; iParticle < fNParticles; iParticle++) {
    // load only particles with TR
    AliMCInfo * info = GetInfo(iParticle);
    if (!info) continue;
    //////////////////////////////////////////////////////////////////////
    info->fLabel = iParticle;
    //
    info->fParticle = *(stack->Particle(iParticle));
    info->fVDist[0] = info->fParticle.Vx()-fVPrim[0];
    info->fVDist[1] = info->fParticle.Vy()-fVPrim[1];
    info->fVDist[2] = info->fParticle.Vz()-fVPrim[2]; 
    info->fVDist[3] = TMath::Sqrt(info->fVDist[0]*info->fVDist[0]+
				  info->fVDist[1]*info->fVDist[1]+info->fVDist[2]*info->fVDist[2]);
    //
    //
    ipdg = info->fParticle.GetPdgCode();
    info->fPdg = ipdg;
    //ppdg = pdg.GetParticle(ipdg);   	   
    info->fEventNr = fEventNr;
    info->Update();
    if (fGenTracksArray){
      fGenTracksArray->AddLast(info->Clone());
    }
    accepted++;
  }
  //
  // write the results to the tree - if specified
  //
  TBranch * br = fTreeGenTracks->GetBranch("MC");
  for (UInt_t iParticle = 0; iParticle < fNParticles; iParticle++) {
    // load only particles with TR
    AliMCInfo * info = GetInfo(iParticle);
    if (!info) continue;
    //////////////////////////////////////////////////////////////////////    
    br->SetAddress(&info);    
    fTreeGenTracks->Fill();    
  }
  fTreeGenTracks->AutoSave();
  //
  //
  if (fDebug > 2) cerr<<"end of TreeKLoop"<<endl;
  return 0;
}


////////////////////////////////////////////////////////////////////////////////////
Int_t  AliGenInfoMaker::BuildKinkInfo()
{
  //
  // Build tree with Kink Information
  //
  AliStack * stack = fStack;
  if (!stack) {cerr<<"Stack was not found!\n"; return 1;}
  
  if (fDebug > 0) {
    cout<<"There are "<<fNParticles<<" primary and secondary particles in event "
	<<fEventNr<<endl;
  }  
  //  Int_t  ipdg = 0;
  //TParticlePDG *ppdg = 0;
  // not all generators give primary vertex position. Take the vertex
  // of the particle 0 as primary vertex.
  TDatabasePDG  pdg; //get pdg table  
  //thank you very much root for this
  TBranch * br = fTreeKinks->GetBranch("MC");
  //
  AliGenKinkInfo * kinkinfo = new AliGenKinkInfo;
  //
  for (UInt_t iParticle = 0; iParticle < fNParticles; iParticle++) {
    // load only particles with TR
    AliMCInfo * info = GetInfo(iParticle);
    if (!info) continue;
    if (info->fCharge==0) continue;  
    if (info->fTRdecay.R()>500)  continue;  //R cut - decay outside barrel
    TParticle & particle = info->fParticle;
    Int_t first = particle.GetDaughter(0);
    if (first ==0) continue;

    Int_t last = particle.GetDaughter(1);
    if (last ==0) last=first;
    AliMCInfo * info2 =  0;
    AliMCInfo * dinfo =  0;
    
    for (Int_t id2=first;id2<=last;id2++){
      info2 = GetInfo(id2);
      if (!info2) continue;
      TParticle &p2 = info2->fParticle;
      Double_t r = TMath::Sqrt(p2.Vx()*p2.Vx()+p2.Vy()*p2.Vy());
      if ( TMath::Abs(info->fTRdecay.R()-r)>0.01) continue;
      if (!(p2.GetPDG())) continue;
      dinfo =info2;
     
      kinkinfo->SetInfoMother(*info);
      kinkinfo->SetInfoDaughter(*dinfo);
      if (kinkinfo->GetMinus().GetParticle().GetPDG()==0 ||  kinkinfo->GetPlus().GetParticle().GetPDG()==0) continue;
      kinkinfo->Update();
      br->SetAddress(&kinkinfo);    
      fTreeKinks->Fill();
    }
  }
  fTreeKinks->AutoSave();
  if (fDebug > 2) cerr<<"end of Kink Loop"<<endl;
  return 0;
}


////////////////////////////////////////////////////////////////////////////////////
Int_t  AliGenInfoMaker::BuildV0Info()
{
  //
  // Build tree with V0 Information
  //
  AliStack * stack = fStack;
  if (!stack) {cerr<<"Stack was not found!\n"; return 1;}
  
  if (fDebug > 0) {
    cout<<"There are "<<fNParticles<<" primary and secondary particles in event "
	<<fEventNr<<endl;
  }  
  //
  TDatabasePDG  pdg; //get pdg table  
  //thank you very much root for this
  TBranch * br = fTreeV0->GetBranch("MC");
  //
  AliGenV0Info * v0info = new AliGenV0Info;
  //
  //
  for (UInt_t iParticle = 0; iParticle < fNParticles; iParticle++) {    
    TParticle * mParticle = fStack->Particle(iParticle);
    if (!mParticle) continue;
    if (mParticle->GetPDG()==0) continue;
    if (mParticle->GetPDG()->Charge()!=0) continue;  //only neutral particle
    //
    Int_t first = mParticle->GetDaughter(0);
    Int_t last  = mParticle->GetDaughter(1);
    if (first-last==0) continue;
    //
    AliMCInfo * info0 = GetInfo(first);
    AliMCInfo * info1 = GetInfo(first+1);
    if (info0 && info1){
      if (info0->GetPdg()==0) continue;
      if (info1->GetPdg()==0) continue;
      v0info->SetInfoP(*info0);
      v0info->SetInfoM(*info1);
      v0info->SetMother(*mParticle);
      v0info->Update(fVPrim);
      if (fGenV0Array) fGenV0Array->AddLast(v0info);
      br->SetAddress(&v0info);    
      fTreeV0->Fill();
    }
  }
  fTreeV0->AutoSave();
  if (fDebug > 2) cerr<<"end of V0 Loop"<<endl;
  return 0;
}





////////////////////////////////////////////////////////////////////////
Int_t AliGenInfoMaker::TreeDLoop()
{
  //
  // open the file with treeD
  // loop over all entries there and save information about some tracks
  //
  if (!fTreeD) return 0;
  Int_t nInnerSector = fParamTPC->GetNInnerSector();
  Int_t rowShift = 0;
  Int_t zero=fParamTPC->GetZeroSup()+6;  
  //
  //
  AliSimDigits digitsAddress, *digits=&digitsAddress;
  fTreeD->GetBranch("Segment")->SetAddress(&digits);
  
  Int_t sectorsByRows=(Int_t)fTreeD->GetEntries();
  if (fDebug > 1) cout<<"\tsectorsByRows = "<<sectorsByRows<<endl;
  for (Int_t i=0; i<sectorsByRows; i++) {
    if (!fTreeD->GetEvent(i)) continue;
    Int_t sec,row;
    fParamTPC->AdjustSectorRow(digits->GetID(),sec,row);
    if (fDebug > 1) cout<<sec<<' '<<row<<"                          \r";
    // here I expect that upper sectors follow lower sectors
    if (sec > nInnerSector) rowShift = fParamTPC->GetNRowLow();
    //
    digits->ExpandTrackBuffer();
    digits->First();        
    do {
      Int_t iRow=digits->CurrentRow();
      Int_t iColumn=digits->CurrentColumn();
      Short_t digitValue = digits->CurrentDigit();
      if (digitValue >= zero) {
	Int_t label;
	for (Int_t j = 0; j<3; j++) {
	  //	  label = digits->GetTrackID(iRow,iColumn,j);
	  label = digits->GetTrackIDFast(iRow,iColumn,j)-2; 	  
	  if (label >= (Int_t)fNParticles) { //don't label from bakground event
	    continue;
	  }
	  if (label >= 0 && label <= (Int_t)fNParticles) {
	    if (fDebug > 6 ) {
	      cout<<"Inner loop: sector, iRow, iColumn, label, value, row "
		  <<sec<<" "
		  <<iRow<<" "<<iColumn<<" "<<label<<" "<<digitValue
		  <<" "<<row<<endl;
	    }	
	    AliMCInfo * info = GetInfo(label);
	    if (info){
	      info->fTPCRow.SetRow(row+rowShift);
	    }
	  }
	}
      }
    } while (digits->Next());
  }
  
  if (fDebug > 2) cerr<<"end of TreeDLoop"<<endl;  
  return 0;
}




////////////////////////////////////////////////////////////////////////
Int_t AliGenInfoMaker::TreeTRLoop()
{
  //
  // loop over TrackReferences and store the first one for each track
  //  
  TTree * treeTR = fTreeTR;
  Int_t nPrimaries = (Int_t) treeTR->GetEntries();
  if (fDebug > 1) cout<<"There are "<<nPrimaries<<" entries in TreeTR"<<endl;
  //
  //
  //
  TClonesArray* runArrayTR = new TClonesArray("AliTrackReference");
  //
  if (treeTR->GetBranch("TrackReferences")) treeTR->GetBranch("TrackReferences")->SetAddress(&runArrayTR);
  //
  //
  //
  for (Int_t ipart = 0; ipart<fStack->GetNtrack(); ipart++) {
    TParticle * part = fStack->Particle(ipart);
    if (!part) continue;
    if (part->GetPDG()==0) continue;
    if (part->GetPDG()->Charge()==0) continue;
    
    if (part->Pt()<fITSPtCut) continue;
    if (part->R()>250.) continue;
    if (TMath::Abs(part->Vz())>250.) continue;
    if (TMath::Abs(part->Pz()/part->Pt())>2.5) continue;     
    //AliMCInfo * info = ;
    MakeInfo(ipart); 
  }
  //
  //

  for (Int_t iPrimPart = 0; iPrimPart<nPrimaries; iPrimPart++) {
    treeTR->GetEntry(iPrimPart);
    //
    // gettrack references
    //
    for (Int_t iTrackRef = 0; iTrackRef < runArrayTR->GetEntriesFast(); iTrackRef++) {
      AliTrackReference *trackRef = (AliTrackReference*)runArrayTR->At(iTrackRef);      
      //
      Int_t label = trackRef->GetTrack();
      AliMCInfo * cinfo = GetInfo(label);
      if (cinfo) cinfo->CalcTPCrows(runArrayTR);
      //
      // TPC
      //
      if (trackRef->DetectorId()== AliTrackReference::kTPC){
	//
	Int_t label1 = trackRef->GetTrack();      
	AliMCInfo * info = GetInfo(label1);
	if (!info && trackRef->Pt()<fTPCPtCut) continue;
	if (!info) {
	  info = MakeInfo(label1);
	}
	if (!info) continue;
	info->fPrimPart =  iPrimPart;
	TClonesArray & arr = *(info->fTPCReferences);
	new (arr[arr.GetEntriesFast()]) AliTrackReference(*trackRef);     
      }
      //
      // ITS
      //
      if (trackRef->DetectorId()== AliTrackReference::kITS){
	//
	Int_t label1 = trackRef->GetTrack();      
	AliMCInfo * info = GetInfo(label1);
	if (!info && trackRef->Pt()<fITSPtCut) continue;
	if (!info) info = MakeInfo(label1);
	if (!info) continue;
	info->fPrimPart =  iPrimPart;
	TClonesArray & arr = *(info->fITSReferences);
	new (arr[arr.GetEntriesFast()]) AliTrackReference(*trackRef);     
      }
      //
      // TRD
      //
      if (trackRef->DetectorId()== AliTrackReference::kTRD){
	//
	Int_t label1 = trackRef->GetTrack();      
	AliMCInfo * info = GetInfo(label1);
	if (!info&&trackRef->P()<fTRDPtCut) continue;
	if (!info) info = MakeInfo(label1);
	if (!info) continue;
	info->fPrimPart =  iPrimPart;
	TClonesArray & arr = *(info->fTRDReferences);
	new (arr[arr.GetEntriesFast()]) AliTrackReference(*trackRef);     
      }
      //
      // TOF
      //
      if (trackRef->DetectorId()== AliTrackReference::kTOF){
	//
	Int_t label1 = trackRef->GetTrack();      
	AliMCInfo * info = GetInfo(label1);
	if (!info&&trackRef->P()<fTOFPtCut) continue;
	if (!info) info = MakeInfo(label1);
	if (!info) continue;
	info->fPrimPart =  iPrimPart;
	TClonesArray & arr = *(info->fTOFReferences);
	new (arr[arr.GetEntriesFast()]) AliTrackReference(*trackRef);     
      }
      //
      // decay case
      //
      if (trackRef->DetectorId()== AliTrackReference::kDisappeared){
	//
	AliMCInfo * info = GetInfo(label);
	if (!info) continue;
	info->fTRdecay = *trackRef;      	
      }
    }
  }
  //
  //
  return 0;
}

////////////////////////////////////////////////////////////////////////
Float_t AliGenInfoMaker::TR2LocalX(AliTrackReference *trackRef,
				    AliTPCParam *paramTPC) const {

  //
  // Transformation from Gloabal to local tacking system
  //
  Float_t x[3] = { trackRef->X(),trackRef->Y(),trackRef->Z()};
  Int_t index[4];
  paramTPC->Transform0to1(x,index);
  paramTPC->Transform1to2(x,index);
  return x[0];
}
////////////////////////////////////////////////////////////////////////



AliTPCParam * AliGenInfoMaker::GetTPCParam(){
  //
  // create default TPC parameters
  //
  AliTPCParamSR * par = new AliTPCParamSR;
  par->Update();
  return par;
}


 AliGenInfoMaker.cxx:1
 AliGenInfoMaker.cxx:2
 AliGenInfoMaker.cxx:3
 AliGenInfoMaker.cxx:4
 AliGenInfoMaker.cxx:5
 AliGenInfoMaker.cxx:6
 AliGenInfoMaker.cxx:7
 AliGenInfoMaker.cxx:8
 AliGenInfoMaker.cxx:9
 AliGenInfoMaker.cxx:10
 AliGenInfoMaker.cxx:11
 AliGenInfoMaker.cxx:12
 AliGenInfoMaker.cxx:13
 AliGenInfoMaker.cxx:14
 AliGenInfoMaker.cxx:15
 AliGenInfoMaker.cxx:16
 AliGenInfoMaker.cxx:17
 AliGenInfoMaker.cxx:18
 AliGenInfoMaker.cxx:19
 AliGenInfoMaker.cxx:20
 AliGenInfoMaker.cxx:21
 AliGenInfoMaker.cxx:22
 AliGenInfoMaker.cxx:23
 AliGenInfoMaker.cxx:24
 AliGenInfoMaker.cxx:25
 AliGenInfoMaker.cxx:26
 AliGenInfoMaker.cxx:27
 AliGenInfoMaker.cxx:28
 AliGenInfoMaker.cxx:29
 AliGenInfoMaker.cxx:30
 AliGenInfoMaker.cxx:31
 AliGenInfoMaker.cxx:32
 AliGenInfoMaker.cxx:33
 AliGenInfoMaker.cxx:34
 AliGenInfoMaker.cxx:35
 AliGenInfoMaker.cxx:36
 AliGenInfoMaker.cxx:37
 AliGenInfoMaker.cxx:38
 AliGenInfoMaker.cxx:39
 AliGenInfoMaker.cxx:40
 AliGenInfoMaker.cxx:41
 AliGenInfoMaker.cxx:42
 AliGenInfoMaker.cxx:43
 AliGenInfoMaker.cxx:44
 AliGenInfoMaker.cxx:45
 AliGenInfoMaker.cxx:46
 AliGenInfoMaker.cxx:47
 AliGenInfoMaker.cxx:48
 AliGenInfoMaker.cxx:49
 AliGenInfoMaker.cxx:50
 AliGenInfoMaker.cxx:51
 AliGenInfoMaker.cxx:52
 AliGenInfoMaker.cxx:53
 AliGenInfoMaker.cxx:54
 AliGenInfoMaker.cxx:55
 AliGenInfoMaker.cxx:56
 AliGenInfoMaker.cxx:57
 AliGenInfoMaker.cxx:58
 AliGenInfoMaker.cxx:59
 AliGenInfoMaker.cxx:60
 AliGenInfoMaker.cxx:61
 AliGenInfoMaker.cxx:62
 AliGenInfoMaker.cxx:63
 AliGenInfoMaker.cxx:64
 AliGenInfoMaker.cxx:65
 AliGenInfoMaker.cxx:66
 AliGenInfoMaker.cxx:67
 AliGenInfoMaker.cxx:68
 AliGenInfoMaker.cxx:69
 AliGenInfoMaker.cxx:70
 AliGenInfoMaker.cxx:71
 AliGenInfoMaker.cxx:72
 AliGenInfoMaker.cxx:73
 AliGenInfoMaker.cxx:74
 AliGenInfoMaker.cxx:75
 AliGenInfoMaker.cxx:76
 AliGenInfoMaker.cxx:77
 AliGenInfoMaker.cxx:78
 AliGenInfoMaker.cxx:79
 AliGenInfoMaker.cxx:80
 AliGenInfoMaker.cxx:81
 AliGenInfoMaker.cxx:82
 AliGenInfoMaker.cxx:83
 AliGenInfoMaker.cxx:84
 AliGenInfoMaker.cxx:85
 AliGenInfoMaker.cxx:86
 AliGenInfoMaker.cxx:87
 AliGenInfoMaker.cxx:88
 AliGenInfoMaker.cxx:89
 AliGenInfoMaker.cxx:90
 AliGenInfoMaker.cxx:91
 AliGenInfoMaker.cxx:92
 AliGenInfoMaker.cxx:93
 AliGenInfoMaker.cxx:94
 AliGenInfoMaker.cxx:95
 AliGenInfoMaker.cxx:96
 AliGenInfoMaker.cxx:97
 AliGenInfoMaker.cxx:98
 AliGenInfoMaker.cxx:99
 AliGenInfoMaker.cxx:100
 AliGenInfoMaker.cxx:101
 AliGenInfoMaker.cxx:102
 AliGenInfoMaker.cxx:103
 AliGenInfoMaker.cxx:104
 AliGenInfoMaker.cxx:105
 AliGenInfoMaker.cxx:106
 AliGenInfoMaker.cxx:107
 AliGenInfoMaker.cxx:108
 AliGenInfoMaker.cxx:109
 AliGenInfoMaker.cxx:110
 AliGenInfoMaker.cxx:111
 AliGenInfoMaker.cxx:112
 AliGenInfoMaker.cxx:113
 AliGenInfoMaker.cxx:114
 AliGenInfoMaker.cxx:115
 AliGenInfoMaker.cxx:116
 AliGenInfoMaker.cxx:117
 AliGenInfoMaker.cxx:118
 AliGenInfoMaker.cxx:119
 AliGenInfoMaker.cxx:120
 AliGenInfoMaker.cxx:121
 AliGenInfoMaker.cxx:122
 AliGenInfoMaker.cxx:123
 AliGenInfoMaker.cxx:124
 AliGenInfoMaker.cxx:125
 AliGenInfoMaker.cxx:126
 AliGenInfoMaker.cxx:127
 AliGenInfoMaker.cxx:128
 AliGenInfoMaker.cxx:129
 AliGenInfoMaker.cxx:130
 AliGenInfoMaker.cxx:131
 AliGenInfoMaker.cxx:132
 AliGenInfoMaker.cxx:133
 AliGenInfoMaker.cxx:134
 AliGenInfoMaker.cxx:135
 AliGenInfoMaker.cxx:136
 AliGenInfoMaker.cxx:137
 AliGenInfoMaker.cxx:138
 AliGenInfoMaker.cxx:139
 AliGenInfoMaker.cxx:140
 AliGenInfoMaker.cxx:141
 AliGenInfoMaker.cxx:142
 AliGenInfoMaker.cxx:143
 AliGenInfoMaker.cxx:144
 AliGenInfoMaker.cxx:145
 AliGenInfoMaker.cxx:146
 AliGenInfoMaker.cxx:147
 AliGenInfoMaker.cxx:148
 AliGenInfoMaker.cxx:149
 AliGenInfoMaker.cxx:150
 AliGenInfoMaker.cxx:151
 AliGenInfoMaker.cxx:152
 AliGenInfoMaker.cxx:153
 AliGenInfoMaker.cxx:154
 AliGenInfoMaker.cxx:155
 AliGenInfoMaker.cxx:156
 AliGenInfoMaker.cxx:157
 AliGenInfoMaker.cxx:158
 AliGenInfoMaker.cxx:159
 AliGenInfoMaker.cxx:160
 AliGenInfoMaker.cxx:161
 AliGenInfoMaker.cxx:162
 AliGenInfoMaker.cxx:163
 AliGenInfoMaker.cxx:164
 AliGenInfoMaker.cxx:165
 AliGenInfoMaker.cxx:166
 AliGenInfoMaker.cxx:167
 AliGenInfoMaker.cxx:168
 AliGenInfoMaker.cxx:169
 AliGenInfoMaker.cxx:170
 AliGenInfoMaker.cxx:171
 AliGenInfoMaker.cxx:172
 AliGenInfoMaker.cxx:173
 AliGenInfoMaker.cxx:174
 AliGenInfoMaker.cxx:175
 AliGenInfoMaker.cxx:176
 AliGenInfoMaker.cxx:177
 AliGenInfoMaker.cxx:178
 AliGenInfoMaker.cxx:179
 AliGenInfoMaker.cxx:180
 AliGenInfoMaker.cxx:181
 AliGenInfoMaker.cxx:182
 AliGenInfoMaker.cxx:183
 AliGenInfoMaker.cxx:184
 AliGenInfoMaker.cxx:185
 AliGenInfoMaker.cxx:186
 AliGenInfoMaker.cxx:187
 AliGenInfoMaker.cxx:188
 AliGenInfoMaker.cxx:189
 AliGenInfoMaker.cxx:190
 AliGenInfoMaker.cxx:191
 AliGenInfoMaker.cxx:192
 AliGenInfoMaker.cxx:193
 AliGenInfoMaker.cxx:194
 AliGenInfoMaker.cxx:195
 AliGenInfoMaker.cxx:196
 AliGenInfoMaker.cxx:197
 AliGenInfoMaker.cxx:198
 AliGenInfoMaker.cxx:199
 AliGenInfoMaker.cxx:200
 AliGenInfoMaker.cxx:201
 AliGenInfoMaker.cxx:202
 AliGenInfoMaker.cxx:203
 AliGenInfoMaker.cxx:204
 AliGenInfoMaker.cxx:205
 AliGenInfoMaker.cxx:206
 AliGenInfoMaker.cxx:207
 AliGenInfoMaker.cxx:208
 AliGenInfoMaker.cxx:209
 AliGenInfoMaker.cxx:210
 AliGenInfoMaker.cxx:211
 AliGenInfoMaker.cxx:212
 AliGenInfoMaker.cxx:213
 AliGenInfoMaker.cxx:214
 AliGenInfoMaker.cxx:215
 AliGenInfoMaker.cxx:216
 AliGenInfoMaker.cxx:217
 AliGenInfoMaker.cxx:218
 AliGenInfoMaker.cxx:219
 AliGenInfoMaker.cxx:220
 AliGenInfoMaker.cxx:221
 AliGenInfoMaker.cxx:222
 AliGenInfoMaker.cxx:223
 AliGenInfoMaker.cxx:224
 AliGenInfoMaker.cxx:225
 AliGenInfoMaker.cxx:226
 AliGenInfoMaker.cxx:227
 AliGenInfoMaker.cxx:228
 AliGenInfoMaker.cxx:229
 AliGenInfoMaker.cxx:230
 AliGenInfoMaker.cxx:231
 AliGenInfoMaker.cxx:232
 AliGenInfoMaker.cxx:233
 AliGenInfoMaker.cxx:234
 AliGenInfoMaker.cxx:235
 AliGenInfoMaker.cxx:236
 AliGenInfoMaker.cxx:237
 AliGenInfoMaker.cxx:238
 AliGenInfoMaker.cxx:239
 AliGenInfoMaker.cxx:240
 AliGenInfoMaker.cxx:241
 AliGenInfoMaker.cxx:242
 AliGenInfoMaker.cxx:243
 AliGenInfoMaker.cxx:244
 AliGenInfoMaker.cxx:245
 AliGenInfoMaker.cxx:246
 AliGenInfoMaker.cxx:247
 AliGenInfoMaker.cxx:248
 AliGenInfoMaker.cxx:249
 AliGenInfoMaker.cxx:250
 AliGenInfoMaker.cxx:251
 AliGenInfoMaker.cxx:252
 AliGenInfoMaker.cxx:253
 AliGenInfoMaker.cxx:254
 AliGenInfoMaker.cxx:255
 AliGenInfoMaker.cxx:256
 AliGenInfoMaker.cxx:257
 AliGenInfoMaker.cxx:258
 AliGenInfoMaker.cxx:259
 AliGenInfoMaker.cxx:260
 AliGenInfoMaker.cxx:261
 AliGenInfoMaker.cxx:262
 AliGenInfoMaker.cxx:263
 AliGenInfoMaker.cxx:264
 AliGenInfoMaker.cxx:265
 AliGenInfoMaker.cxx:266
 AliGenInfoMaker.cxx:267
 AliGenInfoMaker.cxx:268
 AliGenInfoMaker.cxx:269
 AliGenInfoMaker.cxx:270
 AliGenInfoMaker.cxx:271
 AliGenInfoMaker.cxx:272
 AliGenInfoMaker.cxx:273
 AliGenInfoMaker.cxx:274
 AliGenInfoMaker.cxx:275
 AliGenInfoMaker.cxx:276
 AliGenInfoMaker.cxx:277
 AliGenInfoMaker.cxx:278
 AliGenInfoMaker.cxx:279
 AliGenInfoMaker.cxx:280
 AliGenInfoMaker.cxx:281
 AliGenInfoMaker.cxx:282
 AliGenInfoMaker.cxx:283
 AliGenInfoMaker.cxx:284
 AliGenInfoMaker.cxx:285
 AliGenInfoMaker.cxx:286
 AliGenInfoMaker.cxx:287
 AliGenInfoMaker.cxx:288
 AliGenInfoMaker.cxx:289
 AliGenInfoMaker.cxx:290
 AliGenInfoMaker.cxx:291
 AliGenInfoMaker.cxx:292
 AliGenInfoMaker.cxx:293
 AliGenInfoMaker.cxx:294
 AliGenInfoMaker.cxx:295
 AliGenInfoMaker.cxx:296
 AliGenInfoMaker.cxx:297
 AliGenInfoMaker.cxx:298
 AliGenInfoMaker.cxx:299
 AliGenInfoMaker.cxx:300
 AliGenInfoMaker.cxx:301
 AliGenInfoMaker.cxx:302
 AliGenInfoMaker.cxx:303
 AliGenInfoMaker.cxx:304
 AliGenInfoMaker.cxx:305
 AliGenInfoMaker.cxx:306
 AliGenInfoMaker.cxx:307
 AliGenInfoMaker.cxx:308
 AliGenInfoMaker.cxx:309
 AliGenInfoMaker.cxx:310
 AliGenInfoMaker.cxx:311
 AliGenInfoMaker.cxx:312
 AliGenInfoMaker.cxx:313
 AliGenInfoMaker.cxx:314
 AliGenInfoMaker.cxx:315
 AliGenInfoMaker.cxx:316
 AliGenInfoMaker.cxx:317
 AliGenInfoMaker.cxx:318
 AliGenInfoMaker.cxx:319
 AliGenInfoMaker.cxx:320
 AliGenInfoMaker.cxx:321
 AliGenInfoMaker.cxx:322
 AliGenInfoMaker.cxx:323
 AliGenInfoMaker.cxx:324
 AliGenInfoMaker.cxx:325
 AliGenInfoMaker.cxx:326
 AliGenInfoMaker.cxx:327
 AliGenInfoMaker.cxx:328
 AliGenInfoMaker.cxx:329
 AliGenInfoMaker.cxx:330
 AliGenInfoMaker.cxx:331
 AliGenInfoMaker.cxx:332
 AliGenInfoMaker.cxx:333
 AliGenInfoMaker.cxx:334
 AliGenInfoMaker.cxx:335
 AliGenInfoMaker.cxx:336
 AliGenInfoMaker.cxx:337
 AliGenInfoMaker.cxx:338
 AliGenInfoMaker.cxx:339
 AliGenInfoMaker.cxx:340
 AliGenInfoMaker.cxx:341
 AliGenInfoMaker.cxx:342
 AliGenInfoMaker.cxx:343
 AliGenInfoMaker.cxx:344
 AliGenInfoMaker.cxx:345
 AliGenInfoMaker.cxx:346
 AliGenInfoMaker.cxx:347
 AliGenInfoMaker.cxx:348
 AliGenInfoMaker.cxx:349
 AliGenInfoMaker.cxx:350
 AliGenInfoMaker.cxx:351
 AliGenInfoMaker.cxx:352
 AliGenInfoMaker.cxx:353
 AliGenInfoMaker.cxx:354
 AliGenInfoMaker.cxx:355
 AliGenInfoMaker.cxx:356
 AliGenInfoMaker.cxx:357
 AliGenInfoMaker.cxx:358
 AliGenInfoMaker.cxx:359
 AliGenInfoMaker.cxx:360
 AliGenInfoMaker.cxx:361
 AliGenInfoMaker.cxx:362
 AliGenInfoMaker.cxx:363
 AliGenInfoMaker.cxx:364
 AliGenInfoMaker.cxx:365
 AliGenInfoMaker.cxx:366
 AliGenInfoMaker.cxx:367
 AliGenInfoMaker.cxx:368
 AliGenInfoMaker.cxx:369
 AliGenInfoMaker.cxx:370
 AliGenInfoMaker.cxx:371
 AliGenInfoMaker.cxx:372
 AliGenInfoMaker.cxx:373
 AliGenInfoMaker.cxx:374
 AliGenInfoMaker.cxx:375
 AliGenInfoMaker.cxx:376
 AliGenInfoMaker.cxx:377
 AliGenInfoMaker.cxx:378
 AliGenInfoMaker.cxx:379
 AliGenInfoMaker.cxx:380
 AliGenInfoMaker.cxx:381
 AliGenInfoMaker.cxx:382
 AliGenInfoMaker.cxx:383
 AliGenInfoMaker.cxx:384
 AliGenInfoMaker.cxx:385
 AliGenInfoMaker.cxx:386
 AliGenInfoMaker.cxx:387
 AliGenInfoMaker.cxx:388
 AliGenInfoMaker.cxx:389
 AliGenInfoMaker.cxx:390
 AliGenInfoMaker.cxx:391
 AliGenInfoMaker.cxx:392
 AliGenInfoMaker.cxx:393
 AliGenInfoMaker.cxx:394
 AliGenInfoMaker.cxx:395
 AliGenInfoMaker.cxx:396
 AliGenInfoMaker.cxx:397
 AliGenInfoMaker.cxx:398
 AliGenInfoMaker.cxx:399
 AliGenInfoMaker.cxx:400
 AliGenInfoMaker.cxx:401
 AliGenInfoMaker.cxx:402
 AliGenInfoMaker.cxx:403
 AliGenInfoMaker.cxx:404
 AliGenInfoMaker.cxx:405
 AliGenInfoMaker.cxx:406
 AliGenInfoMaker.cxx:407
 AliGenInfoMaker.cxx:408
 AliGenInfoMaker.cxx:409
 AliGenInfoMaker.cxx:410
 AliGenInfoMaker.cxx:411
 AliGenInfoMaker.cxx:412
 AliGenInfoMaker.cxx:413
 AliGenInfoMaker.cxx:414
 AliGenInfoMaker.cxx:415
 AliGenInfoMaker.cxx:416
 AliGenInfoMaker.cxx:417
 AliGenInfoMaker.cxx:418
 AliGenInfoMaker.cxx:419
 AliGenInfoMaker.cxx:420
 AliGenInfoMaker.cxx:421
 AliGenInfoMaker.cxx:422
 AliGenInfoMaker.cxx:423
 AliGenInfoMaker.cxx:424
 AliGenInfoMaker.cxx:425
 AliGenInfoMaker.cxx:426
 AliGenInfoMaker.cxx:427
 AliGenInfoMaker.cxx:428
 AliGenInfoMaker.cxx:429
 AliGenInfoMaker.cxx:430
 AliGenInfoMaker.cxx:431
 AliGenInfoMaker.cxx:432
 AliGenInfoMaker.cxx:433
 AliGenInfoMaker.cxx:434
 AliGenInfoMaker.cxx:435
 AliGenInfoMaker.cxx:436
 AliGenInfoMaker.cxx:437
 AliGenInfoMaker.cxx:438
 AliGenInfoMaker.cxx:439
 AliGenInfoMaker.cxx:440
 AliGenInfoMaker.cxx:441
 AliGenInfoMaker.cxx:442
 AliGenInfoMaker.cxx:443
 AliGenInfoMaker.cxx:444
 AliGenInfoMaker.cxx:445
 AliGenInfoMaker.cxx:446
 AliGenInfoMaker.cxx:447
 AliGenInfoMaker.cxx:448
 AliGenInfoMaker.cxx:449
 AliGenInfoMaker.cxx:450
 AliGenInfoMaker.cxx:451
 AliGenInfoMaker.cxx:452
 AliGenInfoMaker.cxx:453
 AliGenInfoMaker.cxx:454
 AliGenInfoMaker.cxx:455
 AliGenInfoMaker.cxx:456
 AliGenInfoMaker.cxx:457
 AliGenInfoMaker.cxx:458
 AliGenInfoMaker.cxx:459
 AliGenInfoMaker.cxx:460
 AliGenInfoMaker.cxx:461
 AliGenInfoMaker.cxx:462
 AliGenInfoMaker.cxx:463
 AliGenInfoMaker.cxx:464
 AliGenInfoMaker.cxx:465
 AliGenInfoMaker.cxx:466
 AliGenInfoMaker.cxx:467
 AliGenInfoMaker.cxx:468
 AliGenInfoMaker.cxx:469
 AliGenInfoMaker.cxx:470
 AliGenInfoMaker.cxx:471
 AliGenInfoMaker.cxx:472
 AliGenInfoMaker.cxx:473
 AliGenInfoMaker.cxx:474
 AliGenInfoMaker.cxx:475
 AliGenInfoMaker.cxx:476
 AliGenInfoMaker.cxx:477
 AliGenInfoMaker.cxx:478
 AliGenInfoMaker.cxx:479
 AliGenInfoMaker.cxx:480
 AliGenInfoMaker.cxx:481
 AliGenInfoMaker.cxx:482
 AliGenInfoMaker.cxx:483
 AliGenInfoMaker.cxx:484
 AliGenInfoMaker.cxx:485
 AliGenInfoMaker.cxx:486
 AliGenInfoMaker.cxx:487
 AliGenInfoMaker.cxx:488
 AliGenInfoMaker.cxx:489
 AliGenInfoMaker.cxx:490
 AliGenInfoMaker.cxx:491
 AliGenInfoMaker.cxx:492
 AliGenInfoMaker.cxx:493
 AliGenInfoMaker.cxx:494
 AliGenInfoMaker.cxx:495
 AliGenInfoMaker.cxx:496
 AliGenInfoMaker.cxx:497
 AliGenInfoMaker.cxx:498
 AliGenInfoMaker.cxx:499
 AliGenInfoMaker.cxx:500
 AliGenInfoMaker.cxx:501
 AliGenInfoMaker.cxx:502
 AliGenInfoMaker.cxx:503
 AliGenInfoMaker.cxx:504
 AliGenInfoMaker.cxx:505
 AliGenInfoMaker.cxx:506
 AliGenInfoMaker.cxx:507
 AliGenInfoMaker.cxx:508
 AliGenInfoMaker.cxx:509
 AliGenInfoMaker.cxx:510
 AliGenInfoMaker.cxx:511
 AliGenInfoMaker.cxx:512
 AliGenInfoMaker.cxx:513
 AliGenInfoMaker.cxx:514
 AliGenInfoMaker.cxx:515
 AliGenInfoMaker.cxx:516
 AliGenInfoMaker.cxx:517
 AliGenInfoMaker.cxx:518
 AliGenInfoMaker.cxx:519
 AliGenInfoMaker.cxx:520
 AliGenInfoMaker.cxx:521
 AliGenInfoMaker.cxx:522
 AliGenInfoMaker.cxx:523
 AliGenInfoMaker.cxx:524
 AliGenInfoMaker.cxx:525
 AliGenInfoMaker.cxx:526
 AliGenInfoMaker.cxx:527
 AliGenInfoMaker.cxx:528
 AliGenInfoMaker.cxx:529
 AliGenInfoMaker.cxx:530
 AliGenInfoMaker.cxx:531
 AliGenInfoMaker.cxx:532
 AliGenInfoMaker.cxx:533
 AliGenInfoMaker.cxx:534
 AliGenInfoMaker.cxx:535
 AliGenInfoMaker.cxx:536
 AliGenInfoMaker.cxx:537
 AliGenInfoMaker.cxx:538
 AliGenInfoMaker.cxx:539
 AliGenInfoMaker.cxx:540
 AliGenInfoMaker.cxx:541
 AliGenInfoMaker.cxx:542
 AliGenInfoMaker.cxx:543
 AliGenInfoMaker.cxx:544
 AliGenInfoMaker.cxx:545
 AliGenInfoMaker.cxx:546
 AliGenInfoMaker.cxx:547
 AliGenInfoMaker.cxx:548
 AliGenInfoMaker.cxx:549
 AliGenInfoMaker.cxx:550
 AliGenInfoMaker.cxx:551
 AliGenInfoMaker.cxx:552
 AliGenInfoMaker.cxx:553
 AliGenInfoMaker.cxx:554
 AliGenInfoMaker.cxx:555
 AliGenInfoMaker.cxx:556
 AliGenInfoMaker.cxx:557
 AliGenInfoMaker.cxx:558
 AliGenInfoMaker.cxx:559
 AliGenInfoMaker.cxx:560
 AliGenInfoMaker.cxx:561
 AliGenInfoMaker.cxx:562
 AliGenInfoMaker.cxx:563
 AliGenInfoMaker.cxx:564
 AliGenInfoMaker.cxx:565
 AliGenInfoMaker.cxx:566
 AliGenInfoMaker.cxx:567
 AliGenInfoMaker.cxx:568
 AliGenInfoMaker.cxx:569
 AliGenInfoMaker.cxx:570
 AliGenInfoMaker.cxx:571
 AliGenInfoMaker.cxx:572
 AliGenInfoMaker.cxx:573
 AliGenInfoMaker.cxx:574
 AliGenInfoMaker.cxx:575
 AliGenInfoMaker.cxx:576
 AliGenInfoMaker.cxx:577
 AliGenInfoMaker.cxx:578
 AliGenInfoMaker.cxx:579
 AliGenInfoMaker.cxx:580
 AliGenInfoMaker.cxx:581
 AliGenInfoMaker.cxx:582
 AliGenInfoMaker.cxx:583
 AliGenInfoMaker.cxx:584
 AliGenInfoMaker.cxx:585
 AliGenInfoMaker.cxx:586
 AliGenInfoMaker.cxx:587
 AliGenInfoMaker.cxx:588
 AliGenInfoMaker.cxx:589
 AliGenInfoMaker.cxx:590
 AliGenInfoMaker.cxx:591
 AliGenInfoMaker.cxx:592
 AliGenInfoMaker.cxx:593
 AliGenInfoMaker.cxx:594
 AliGenInfoMaker.cxx:595
 AliGenInfoMaker.cxx:596
 AliGenInfoMaker.cxx:597
 AliGenInfoMaker.cxx:598
 AliGenInfoMaker.cxx:599
 AliGenInfoMaker.cxx:600
 AliGenInfoMaker.cxx:601
 AliGenInfoMaker.cxx:602
 AliGenInfoMaker.cxx:603
 AliGenInfoMaker.cxx:604
 AliGenInfoMaker.cxx:605
 AliGenInfoMaker.cxx:606
 AliGenInfoMaker.cxx:607
 AliGenInfoMaker.cxx:608
 AliGenInfoMaker.cxx:609
 AliGenInfoMaker.cxx:610
 AliGenInfoMaker.cxx:611
 AliGenInfoMaker.cxx:612
 AliGenInfoMaker.cxx:613
 AliGenInfoMaker.cxx:614
 AliGenInfoMaker.cxx:615
 AliGenInfoMaker.cxx:616
 AliGenInfoMaker.cxx:617
 AliGenInfoMaker.cxx:618
 AliGenInfoMaker.cxx:619
 AliGenInfoMaker.cxx:620
 AliGenInfoMaker.cxx:621
 AliGenInfoMaker.cxx:622
 AliGenInfoMaker.cxx:623
 AliGenInfoMaker.cxx:624
 AliGenInfoMaker.cxx:625
 AliGenInfoMaker.cxx:626
 AliGenInfoMaker.cxx:627
 AliGenInfoMaker.cxx:628
 AliGenInfoMaker.cxx:629
 AliGenInfoMaker.cxx:630
 AliGenInfoMaker.cxx:631
 AliGenInfoMaker.cxx:632
 AliGenInfoMaker.cxx:633
 AliGenInfoMaker.cxx:634
 AliGenInfoMaker.cxx:635
 AliGenInfoMaker.cxx:636
 AliGenInfoMaker.cxx:637
 AliGenInfoMaker.cxx:638
 AliGenInfoMaker.cxx:639
 AliGenInfoMaker.cxx:640
 AliGenInfoMaker.cxx:641
 AliGenInfoMaker.cxx:642
 AliGenInfoMaker.cxx:643
 AliGenInfoMaker.cxx:644
 AliGenInfoMaker.cxx:645
 AliGenInfoMaker.cxx:646
 AliGenInfoMaker.cxx:647
 AliGenInfoMaker.cxx:648
 AliGenInfoMaker.cxx:649
 AliGenInfoMaker.cxx:650
 AliGenInfoMaker.cxx:651
 AliGenInfoMaker.cxx:652
 AliGenInfoMaker.cxx:653
 AliGenInfoMaker.cxx:654
 AliGenInfoMaker.cxx:655
 AliGenInfoMaker.cxx:656
 AliGenInfoMaker.cxx:657
 AliGenInfoMaker.cxx:658
 AliGenInfoMaker.cxx:659
 AliGenInfoMaker.cxx:660
 AliGenInfoMaker.cxx:661
 AliGenInfoMaker.cxx:662
 AliGenInfoMaker.cxx:663
 AliGenInfoMaker.cxx:664
 AliGenInfoMaker.cxx:665
 AliGenInfoMaker.cxx:666
 AliGenInfoMaker.cxx:667
 AliGenInfoMaker.cxx:668
 AliGenInfoMaker.cxx:669
 AliGenInfoMaker.cxx:670
 AliGenInfoMaker.cxx:671
 AliGenInfoMaker.cxx:672
 AliGenInfoMaker.cxx:673
 AliGenInfoMaker.cxx:674
 AliGenInfoMaker.cxx:675
 AliGenInfoMaker.cxx:676
 AliGenInfoMaker.cxx:677
 AliGenInfoMaker.cxx:678
 AliGenInfoMaker.cxx:679
 AliGenInfoMaker.cxx:680
 AliGenInfoMaker.cxx:681
 AliGenInfoMaker.cxx:682
 AliGenInfoMaker.cxx:683
 AliGenInfoMaker.cxx:684
 AliGenInfoMaker.cxx:685
 AliGenInfoMaker.cxx:686
 AliGenInfoMaker.cxx:687
 AliGenInfoMaker.cxx:688
 AliGenInfoMaker.cxx:689
 AliGenInfoMaker.cxx:690
 AliGenInfoMaker.cxx:691
 AliGenInfoMaker.cxx:692
 AliGenInfoMaker.cxx:693
 AliGenInfoMaker.cxx:694
 AliGenInfoMaker.cxx:695
 AliGenInfoMaker.cxx:696
 AliGenInfoMaker.cxx:697
 AliGenInfoMaker.cxx:698
 AliGenInfoMaker.cxx:699
 AliGenInfoMaker.cxx:700
 AliGenInfoMaker.cxx:701
 AliGenInfoMaker.cxx:702
 AliGenInfoMaker.cxx:703
 AliGenInfoMaker.cxx:704
 AliGenInfoMaker.cxx:705
 AliGenInfoMaker.cxx:706
 AliGenInfoMaker.cxx:707
 AliGenInfoMaker.cxx:708
 AliGenInfoMaker.cxx:709
 AliGenInfoMaker.cxx:710
 AliGenInfoMaker.cxx:711
 AliGenInfoMaker.cxx:712
 AliGenInfoMaker.cxx:713
 AliGenInfoMaker.cxx:714
 AliGenInfoMaker.cxx:715
 AliGenInfoMaker.cxx:716
 AliGenInfoMaker.cxx:717
 AliGenInfoMaker.cxx:718
 AliGenInfoMaker.cxx:719
 AliGenInfoMaker.cxx:720
 AliGenInfoMaker.cxx:721
 AliGenInfoMaker.cxx:722
 AliGenInfoMaker.cxx:723
 AliGenInfoMaker.cxx:724
 AliGenInfoMaker.cxx:725
 AliGenInfoMaker.cxx:726
 AliGenInfoMaker.cxx:727
 AliGenInfoMaker.cxx:728
 AliGenInfoMaker.cxx:729
 AliGenInfoMaker.cxx:730
 AliGenInfoMaker.cxx:731
 AliGenInfoMaker.cxx:732
 AliGenInfoMaker.cxx:733
 AliGenInfoMaker.cxx:734
 AliGenInfoMaker.cxx:735
 AliGenInfoMaker.cxx:736
 AliGenInfoMaker.cxx:737
 AliGenInfoMaker.cxx:738
 AliGenInfoMaker.cxx:739
 AliGenInfoMaker.cxx:740
 AliGenInfoMaker.cxx:741
 AliGenInfoMaker.cxx:742
 AliGenInfoMaker.cxx:743
 AliGenInfoMaker.cxx:744
 AliGenInfoMaker.cxx:745
 AliGenInfoMaker.cxx:746
 AliGenInfoMaker.cxx:747
 AliGenInfoMaker.cxx:748
 AliGenInfoMaker.cxx:749
 AliGenInfoMaker.cxx:750
 AliGenInfoMaker.cxx:751
 AliGenInfoMaker.cxx:752
 AliGenInfoMaker.cxx:753
 AliGenInfoMaker.cxx:754
 AliGenInfoMaker.cxx:755
 AliGenInfoMaker.cxx:756
 AliGenInfoMaker.cxx:757
 AliGenInfoMaker.cxx:758
 AliGenInfoMaker.cxx:759
 AliGenInfoMaker.cxx:760
 AliGenInfoMaker.cxx:761
 AliGenInfoMaker.cxx:762
 AliGenInfoMaker.cxx:763
 AliGenInfoMaker.cxx:764
 AliGenInfoMaker.cxx:765
 AliGenInfoMaker.cxx:766
 AliGenInfoMaker.cxx:767
 AliGenInfoMaker.cxx:768
 AliGenInfoMaker.cxx:769
 AliGenInfoMaker.cxx:770
 AliGenInfoMaker.cxx:771
 AliGenInfoMaker.cxx:772
 AliGenInfoMaker.cxx:773
 AliGenInfoMaker.cxx:774
 AliGenInfoMaker.cxx:775
 AliGenInfoMaker.cxx:776
 AliGenInfoMaker.cxx:777
 AliGenInfoMaker.cxx:778
 AliGenInfoMaker.cxx:779
 AliGenInfoMaker.cxx:780
 AliGenInfoMaker.cxx:781
 AliGenInfoMaker.cxx:782
 AliGenInfoMaker.cxx:783
 AliGenInfoMaker.cxx:784
 AliGenInfoMaker.cxx:785
 AliGenInfoMaker.cxx:786
 AliGenInfoMaker.cxx:787
 AliGenInfoMaker.cxx:788
 AliGenInfoMaker.cxx:789
 AliGenInfoMaker.cxx:790
 AliGenInfoMaker.cxx:791
 AliGenInfoMaker.cxx:792
 AliGenInfoMaker.cxx:793
 AliGenInfoMaker.cxx:794
 AliGenInfoMaker.cxx:795
 AliGenInfoMaker.cxx:796
 AliGenInfoMaker.cxx:797
 AliGenInfoMaker.cxx:798
 AliGenInfoMaker.cxx:799
 AliGenInfoMaker.cxx:800
 AliGenInfoMaker.cxx:801
 AliGenInfoMaker.cxx:802
 AliGenInfoMaker.cxx:803
 AliGenInfoMaker.cxx:804
 AliGenInfoMaker.cxx:805
 AliGenInfoMaker.cxx:806
 AliGenInfoMaker.cxx:807
 AliGenInfoMaker.cxx:808
 AliGenInfoMaker.cxx:809
 AliGenInfoMaker.cxx:810
 AliGenInfoMaker.cxx:811
 AliGenInfoMaker.cxx:812
 AliGenInfoMaker.cxx:813
 AliGenInfoMaker.cxx:814
 AliGenInfoMaker.cxx:815
 AliGenInfoMaker.cxx:816
 AliGenInfoMaker.cxx:817
 AliGenInfoMaker.cxx:818
 AliGenInfoMaker.cxx:819