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");
14 // Connect the Root Galice file containing Geometry, Kine and Hits
15 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
16 if (!file) file = new TFile("galice.root");
18 // Get AliRun object from file or create it if not on file
20 gAlice = (AliRun*)file->Get("gAlice");
21 if (gAlice) printf("AliRun object found on file\n");
22 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
25 // Import the Kine and Hits Trees for the event evNumber in the file
26 Int_t nparticles = gAlice->GetEvent(evNumber);
27 if (nparticles <= 0) return;
30 TH1F *dmass = new TH1F("dmass","Dimuon-Mass Distribution"
33 TH1F *dmassc = new TH1F("dmassc","Dimuon-Mass Distribution"
35 TH1F *dmassd = new TH1F("dmassd","Dimuon-Mass Distribution"
38 TH1F *pt = new TH1F("pt","pT-single"
48 AliGenCocktailEntry *Entry, *e1, *e2;
49 AliGenCocktail* Cocktail = (AliGenCocktail*) gAlice->Generator();
51 for (Entry=Cocktail->FirstGenerator();
53 Entry=Cocktail->NextGenerator()
58 // Initialize Combinator
60 AliDimuCombinator* Combinator = new AliDimuCombinator();
61 Combinator->SetEtaCut(2.5, 4.);
62 Combinator->SetPtMin(1.0);
69 Combinator->ResetRange();
73 for(Muon=Combinator->FirstMuon();
75 Muon=Combinator->NextMuon()) {
77 Int_t chfirst = Muon->GetFirstDaughter();
78 Int_t chlast = Muon->GetLastDaughter();
79 Int_t parent = Muon->GetFirstMother();
80 Float_t ptm = Muon->Pt();
81 Float_t eta = Muon->Eta();
83 // printf("\n Particle %d Parent %d first child %d last child %d",
84 // i,parent, chfirst, chlast);
85 // printf("\n Particle pt, eta: %f , %f ", ptm, eta);
95 Combinator->ResetRange();
98 // Dimuon Loop controlled by Generator Loop
103 for (Cocktail->FirstGeneratorPair(e1,e2);
105 Cocktail->NextGeneratorPair(e1,e2)
108 sprintf(name, "%s-%s", e1->GetName(), e2->GetName());
109 hCont[icont] = new TH1F(name,"Dimuon-Mass Distribution",100,0.,5.);
110 printf("\n ----------------------------------------------------");
113 printf("\n ----------------------------------------------------");
114 Combinator->SetFirstRange (e1->GetFirst(), e1->GetLast());
115 Combinator->SetSecondRange(e2->GetFirst(), e2->GetLast());
116 Combinator->SetRate(e1->Rate(), e2->Rate());
117 for (Combinator->FirstMuonPairSelected(Muon1,Muon2);
119 Combinator->NextMuonPairSelected(Muon1,Muon2))
123 Float_t mass = Combinator->Mass(Muon1, Muon2);
124 Float_t wgt = runWeight*Combinator->Weight(Muon1, Muon2)*
125 Combinator->DecayProbability(Muon1)*
126 Combinator->DecayProbability(Muon2);
129 Float_t smeared_mass = mass;
130 Combinator->SmearGauss(0.02*mass, smeared_mass);
132 if (TMath::Min(pt1,pt2) > -0.5*TMath::Max(pt1,pt2)+2.) {
133 if (Combinator->Correlated(Muon1, Muon2)) {
134 dmassc->Fill(smeared_mass, wgt);
137 // account for the fact that we sum like-sign and unlike-sign
140 dmass->Fill(smeared_mass, wgt);
141 hCont[icont]->Fill(smeared_mass, wgt);
146 printf("\n Signal %e \n \n", sig);
149 //Create a canvas, set the view range, show histograms
151 TCanvas *c1 = new TCanvas("c1","Dimuon Plots",400,10,600,700);
152 TPad* pad11 = new TPad("pad11"," ",0.01,0.51,0.49,0.99);
153 TPad* pad12 = new TPad("pad12"," ",0.51,0.51,0.99,0.99);
154 TPad* pad13 = new TPad("pad13"," ",0.01,0.01,0.49,0.49);
155 TPad* pad14 = new TPad("pad14"," ",0.51,0.01,0.99,0.49);
156 pad11->SetFillColor(11);
157 pad12->SetFillColor(11);
158 pad13->SetFillColor(11);
159 pad14->SetFillColor(11);
166 pt->SetFillColor(42);
167 pt->SetXTitle("pT (GeV)");
172 dmass->SetFillColor(42);
173 dmass->SetXTitle("m (GeV)");
178 dmassc->SetFillColor(42);
179 dmassc->SetXTitle("m (GeV)");
184 dmassd->SetFillColor(42);
185 dmassd->SetXTitle("m (GeV)");