ROOT logo
#ifndef ALIMUONINFOSTOREMC_H
#define ALIMUONINFOSTOREMC_H

/* Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/* $Id$ */ 

//***********************************************************
// Class AliMuonInfoStoreRD
// class used to extract and store info of MC particle
// Author: X-M. Zhang, zhang@clermont.in2p3.fr
//                     zhangxm@iopp.ccnu.edu.cn
//***********************************************************

#include <TString.h>
#include <TParticle.h>
#include <TLorentzVector.h>
#include <TClonesArray.h>

#include "AliMCEventHandler.h"
#include "AliStack.h"
#include "AliAODMCParticle.h"
#include "AliESDEvent.h"
#include "AliESDMuonTrack.h"
#include "AliAODTrack.h"
#include "AliMuonInfoStoreRD.h"
#include "AliMCEvent.h"

class AliMuonInfoStoreMC : public AliMuonInfoStoreRD {
 public:

  AliMuonInfoStoreMC();
  AliMuonInfoStoreMC(AliAODTrack     *trkAOD, AliMCEvent *mcEvent, UInt_t selMask, Bool_t full=kFALSE);
  AliMuonInfoStoreMC(AliESDMuonTrack *trkESD, AliMCEvent *mcEvent, UInt_t selMask, Bool_t full=kFALSE);
  AliMuonInfoStoreMC(const AliMuonInfoStoreMC &src);
  AliMuonInfoStoreMC& operator=(const AliMuonInfoStoreMC &src);
  virtual ~AliMuonInfoStoreMC();

  Int_t  ParentFlavour(Int_t i=0)    const;
  Bool_t IsMotherAResonance(Int_t i) const;

  TLorentzVector LorentzP()         const { return fLorentzP; }
  Int_t    Source()                 const { return fSource; }
  Int_t    TrackIndex()             const { return fTrackIndex; }
  Int_t    TrackPDGCode()           const { return fTrackPDGCode; }
  Int_t    ParentsN()               const { return fNParents; }
  Int_t    ParentIndex(Int_t i=0)   const { return (i<fNParents ? fParentIndex[i] : -1); }
  Int_t    ParentPDGCode(Int_t i=0) const { return (i<fNParents ? fParentPDGCode[i] : 0); }
  Int_t    QuarkIndex(Int_t i=0)    const { return (i<4 ? fQuarkIndex[i] : -1); }
  Int_t    QuarkPDGCode(Int_t i=0)  const { return (i<4 ? fQuarkPDGCode[i] : 0); }
  Bool_t   IsOscillation()          const { return fOscillation; }
  Double_t Weight()                 const { return fWeight; }

  static const char* StdBranchName() { return fgkStdBranchName.Data(); }
  static Int_t SourcesN()            { return fgkSourcesN;             }

 private:

  void SetMCInfoAOD(AliMCEvent *mcEvent, Int_t label);
  void SetMCInfoESD(AliMCEvent *mcEvent, Int_t label);
  void FillHistoryQuarksAOD(AliMCEvent *mcEvent, Int_t lineM);
  void FillHistoryQuarksESD(AliMCEvent *mcEvent, Int_t lineM);
  Int_t SelectHFMuon();

  Bool_t IsDiquark(Int_t pdg);
  void ResetQuarkInfo();

  static const TString fgkStdBranchName;  // Standard branch name
  static const Int_t   fgkSourcesN;       // num. of muon sources

  Bool_t fIsFull;            // whether to use full mode (Pb-Pb)
  TLorentzVector fLorentzP;  // lorentz momentum of particle
  Int_t fTrackIndex;         // index of the MC particle
  Int_t fTrackPDGCode;       // PDG code of the MC particle
  Int_t fSource;  // = 0, mu<-b 
                  // = 1, mu<-c 
                  // = 2, primary mu
                  // = 3, secondary mu
                  // = 4, not mu
                  // = 5, unidentified track

  Int_t fParentIndex[5];    // index of parents
  Int_t fParentPDGCode[5];  // PDG code of parents
  Int_t fNParents;          // num. of parents
  Bool_t fOscillation;      // flag of oscillation

  Int_t fQuarkIndex[4];    // index of quarks
  Int_t fQuarkPDGCode[4];  // PDG code of quarks

  Double_t fWeight;  // for PbPb collisoions

  ClassDef(AliMuonInfoStoreMC, 5);
};

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