1 void MUONcombi (Int_t evNumber=0)
3 const Float_t runWeight = 4.e8;
5 // Dynamically link some shared libs
6 if (gClassTable->GetID("AliRun") < 0) {
7 gROOT->LoadMacro("loadlibs.C");
16 // Connect the Root Galice file containing Geometry, Kine and Hits
17 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
18 if (!file) file = new TFile("galice.root");
20 // Get AliRun object from file or create it if not on file
22 gAlice = (AliRun*)file->Get("gAlice");
23 if (gAlice) printf("AliRun object found on file\n");
24 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
26 TClonesArray *PartArray = gAlice->Particles();
30 // Import the Kine and Hits Trees for the event evNumber in the file
31 Int_t nparticles = gAlice->GetEvent(evNumber);
32 if (nparticles <= 0) return;
35 TH1F *dmass = new TH1F("dmass","Dimuon-Mass Distribution"
38 TH1F *dmassc = new TH1F("dmassc","Dimuon-Mass Distribution"
40 TH1F *dmassd = new TH1F("dmassd","Dimuon-Mass Distribution"
43 TH1F *pt = new TH1F("pt","pT-single"
53 AliGenCocktailEntry *Entry, *e1, *e2;
54 AliGenCocktail* Cocktail = (AliGenCocktail*) gAlice->Generator();
56 for (Entry=Cocktail->FirstGenerator();
58 Entry=Cocktail->NextGenerator()
63 // Initialize Combinator
65 AliDimuCombinator* Combinator = new AliDimuCombinator();
66 Combinator->SetEtaCut(2.5, 4.);
67 Combinator->SetPtMin(1.0);
74 Combinator->ResetRange();
78 for(Muon=Combinator->FirstMuon();
80 Muon=Combinator->NextMuon()) {
82 Int_t chfirst = Muon->GetFirstDaughter();
83 Int_t chlast = Muon->GetLastDaughter();
84 Int_t parent = Muon->GetFirstMother();
85 Float_t ptm = Muon->Pt();
86 Float_t eta = Muon->Eta();
88 // printf("\n Particle %d Parent %d first child %d last child %d",
89 // i,parent, chfirst, chlast);
90 // printf("\n Particle pt, eta: %f , %f ", ptm, eta);
100 Combinator->ResetRange();
103 // Dimuon Loop controlled by Generator Loop
108 for (Cocktail->FirstGeneratorPair(e1,e2);
110 Cocktail->NextGeneratorPair(e1,e2)
113 sprintf(name, "%s-%s", e1->GetName(), e2->GetName());
114 hCont[icont] = new TH1F(name,"Dimuon-Mass Distribution",100,0.,5.);
115 printf("\n ----------------------------------------------------");
118 printf("\n ----------------------------------------------------");
119 Combinator->SetFirstRange (e1->GetFirst(), e1->GetLast());
120 Combinator->SetSecondRange(e2->GetFirst(), e2->GetLast());
121 Combinator->SetRate(e1->Rate(), e2->Rate());
122 for (Combinator->FirstMuonPairSelected(Muon1,Muon2);
124 Combinator->NextMuonPairSelected(Muon1,Muon2))
128 Float_t mass = Combinator->Mass(Muon1, Muon2);
129 Float_t wgt = runWeight*Combinator->Weight(Muon1, Muon2)*
130 Combinator->DecayProbability(Muon1)*
131 Combinator->DecayProbability(Muon2);
134 Float_t smeared_mass = mass;
135 Combinator->SmearGauss(0.02*mass, smeared_mass);
137 if (TMath::Min(pt1,pt2) > -0.5*TMath::Max(pt1,pt2)+2.) {
138 if (Combinator->Correlated(Muon1, Muon2)) {
139 dmassc->Fill(smeared_mass, wgt);
142 // account for the fact that we sum like-sign and unlike-sign
145 dmass->Fill(smeared_mass, wgt);
146 hCont[icont]->Fill(smeared_mass, wgt);
151 printf("\n Signal %e \n \n", sig);
154 //Create a canvas, set the view range, show histograms
156 TCanvas *c1 = new TCanvas("c1","Dimuon Plots",400,10,600,700);
157 TPad* pad11 = new TPad("pad11"," ",0.01,0.51,0.49,0.99);
158 TPad* pad12 = new TPad("pad12"," ",0.51,0.51,0.99,0.99);
159 TPad* pad13 = new TPad("pad13"," ",0.01,0.01,0.49,0.49);
160 TPad* pad14 = new TPad("pad14"," ",0.51,0.01,0.99,0.49);
161 pad11->SetFillColor(11);
162 pad12->SetFillColor(11);
163 pad13->SetFillColor(11);
164 pad14->SetFillColor(11);
171 pt->SetFillColor(42);
172 pt->SetXTitle("pT (GeV)");
177 dmass->SetFillColor(42);
178 dmass->SetXTitle("m (GeV)");
183 dmassc->SetFillColor(42);
184 dmassc->SetXTitle("m (GeV)");
189 dmassd->SetFillColor(42);
190 dmassd->SetXTitle("m (GeV)");