1 TH1F *mass1 = new TH1F("mass1","Invariant Mass",120,0,12);
2 TH1F *mass2 = new TH1F("mass2","Invariant Mass",100,9.0,10.5);
3 TH1F *mass3 = new TH1F("mass3","Invariant Mass",100,2.5,3.5);
4 void MUONstraggling (Int_t evNumber1=0,Int_t evNumber2=0)
6 /////////////////////////////////////////////////////////////////////////
7 // This macro is a small example of a ROOT macro
8 // illustrating how to read the output of GALICE
9 // and do some analysis.
11 /////////////////////////////////////////////////////////////////////////
13 // Dynamically link some shared libs
14 static Float_t xmuon, ymuon;
16 if (gClassTable->GetID("AliRun") < 0) {
17 gROOT->LoadMacro("loadlibs.C");
21 // Connect the Root Galice file containing Geometry, Kine and Hits
23 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
27 printf("\n Creating galice.root \n");
28 file = new TFile("galice.root");
30 printf("\n galice.root found in file list");
34 // Get AliRun object from file or create it if not on file
36 gAlice = (AliRun*)(file->Get("gAlice"));
37 if (gAlice) printf("AliRun object found on file\n");
39 printf("\n Create new gAlice object");
40 gAlice = new AliRun("gAlice","Alice test program");
45 // Create some histograms
48 AliMUONChamber* iChamber;
54 for (Int_t nev=0; nev<= evNumber2; nev++) {
55 Int_t nparticles = gAlice->GetEvent(nev);
56 //cout << "nparticles " << nparticles <<endl;
57 if (nev < evNumber1) continue;
58 if (nparticles <= 0) return;
60 AliMUON *MUON = (AliMUON*) gAlice->GetModule("MUON");
63 TTree *TH = gAlice->TreeH();
64 Int_t ntracks = TH->GetEntries();
69 Float_t pups[4]={0,0,0,0};
70 for (Int_t track=0; track<ntracks;track++) {
73 Int_t nbytes += TH->GetEvent(track);
77 for(AliMUONHit* mHit=(AliMUONHit*)MUON->FirstHit(-1);
79 mHit=(AliMUONHit*)MUON->NextHit())
81 Int_t nch = mHit->Chamber(); // chamber number
82 Float_t x = mHit->X(); // x-pos of hit
83 Float_t y = mHit->Y(); // y-pos
84 Float_t z = mHit->Z(); // y-pos
85 Float_t p=mHit->Momentum();
86 Float_t px=mHit->Px();
87 Float_t py=mHit->Py();
88 Float_t pz=mHit->Pz();
90 if (nch != 1) continue;
92 Int_t ipart = mHit->Particle();
94 Int_t ftrack = mHit->Track();
95 Part = gAlice->Particle(ftrack);
96 Int_t ipart = Part->GetPdgCode();
98 Float_t px0=Part->Px();
99 Float_t py0=Part->Py();
100 Float_t pz0=Part->Pz();
101 Float_t e0=Part->Energy();
103 if (ipart == kMuonPlus || ipart == kMuonMinus) {
105 // Branson Correction
108 Float_t r=TMath::Sqrt(x*x+y*y);
117 Float_t xb=x-(zch-zb)*px/pz;
118 Float_t yb=y-(zch-zb)*py/pz;
121 pz=zb*p/TMath::Sqrt(zb*zb+xb*xb+yb*yb);
129 Float_t corr=(p+CorrectP(p,mHit->fTheta))/p;
138 Float_t mass=TMath::Sqrt(pups[0]*pups[0]-pups[1]*pups[1]-pups[2]*pups[2]-pups[3]*pups[3]);
139 mass1->Fill(mass, 1.);
140 mass2->Fill(mass, 1.);
141 mass3->Fill(mass, 1.);
143 //Create a canvas, set the view range, show histograms
144 TCanvas *c1 = new TCanvas("c1","Vertices from electrons and positrons",400,10,600,700);
148 mass1->SetFillColor(42);
149 mass1->SetXTitle("Mass (GeV)");
153 mass2->SetFillColor(42);
154 mass2->SetXTitle("Mass (GeV)");
158 mass3->SetFillColor(42);
159 mass3->SetXTitle("Mass (GeV)");
166 Float_t CorrectP(Float_t p, Float_t theta)
171 return 2.737+0.0494*p-0.001123*p*p;
173 return 3.0643+0.01346*p;
178 return 2.1380+0.0351*p-0.000853*p*p;
180 return 2.407+0.00702*p;