1 /**************************************************************************
2 * Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 /////////////////////////////////////////////////////////////
20 // class used to extract and store info of MC particles
22 // Author: X-M. Zhang, zhang@clermont.in2p3.fr
23 // zhangxm@iopp.ccnu.edu.cn
24 /////////////////////////////////////////////////////////////
26 #include "AliMuonInfoStoreMC.h"
27 #include "AliDimuInfoStoreRD.h"
28 #include "AliDimuInfoStoreMC.h"
30 ClassImp(AliDimuInfoStoreMC)
32 const TString AliDimuInfoStoreMC::fgkStdBranchName("DimuMC");
33 const Int_t AliDimuInfoStoreMC::fgkSourcesN = 6;
35 //-----------------------------------------------------------------------------
36 AliDimuInfoStoreMC::AliDimuInfoStoreMC() :
43 // default constructor
47 //-----------------------------------------------------------------------------
48 AliDimuInfoStoreMC::AliDimuInfoStoreMC(AliMuonInfoStoreMC* const trk0, AliMuonInfoStoreMC* const trk1, Bool_t full) :
55 // default constructor
59 fLorentzP = trk0->LorentzP() + trk1->LorentzP();
60 AliDimuInfoStoreRD::FillDimuInfo();
61 if (fIsFull) this->FindDimuonSourceFull();
62 else this->FindDimuonSourceFast();
65 //-----------------------------------------------------------------------------
66 AliDimuInfoStoreMC::AliDimuInfoStoreMC(const AliDimuInfoStoreMC &src) :
67 AliDimuInfoStoreRD(src),
69 fLorentzP(src.fLorentzP),
77 //-----------------------------------------------------------------------------
78 AliDimuInfoStoreMC& AliDimuInfoStoreMC::operator=(const AliDimuInfoStoreMC &src)
81 // assignment constructor
83 if(&src==this) return *this;
85 fIsFull = src.fIsFull;
86 fLorentzP = src.fLorentzP;
87 fSource = src.fSource;
93 //-----------------------------------------------------------------------------
94 AliDimuInfoStoreMC::~AliDimuInfoStoreMC()
101 //-----------------------------------------------------------------------------
102 void AliDimuInfoStoreMC::FindDimuonSourceFast()
104 // find corr relation of two particles (fast for p-p)
106 AliMuonInfoStoreMC *trk0 = (AliMuonInfoStoreMC*)fMuonRef[0].GetObject();
107 Int_t src0 = trk0->Source();
108 if (src0<0 || src0==4 || src0==3) {
112 AliMuonInfoStoreMC *trk1 = (AliMuonInfoStoreMC*)fMuonRef[1].GetObject();
113 Int_t src1 = trk1->Source();
114 if (src1<0 || src1==4 || src1==3) {
118 // Drell-Yan is expected very small at LHC, we ingore it
119 Int_t np0 = trk0->ParentsN() - 1;
123 Int_t np1 = trk1->ParentsN() - 1;
128 if (trk0->IsMotherAResonance(np0) &&
129 trk1->IsMotherAResonance(np1) &&
130 trk0->ParentIndex(np0)==trk1->ParentIndex(np1)) {
134 if (src0==0 && src1==0) {
135 if ((trk0->ParentIndex(0))==(trk1->ParentIndex(0)))
142 if (src0==1 && src1==1) {
143 if ((trk0->ParentIndex(0))==(trk1->ParentIndex(0)))