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");
32 // Get AliRun object from file or create it if not on file
34 gAlice = (AliRun*)(file->Get("gAlice"));
35 if (gAlice) printf("AliRun object found on file\n");
37 printf("\n Create new gAlice object");
38 gAlice = new AliRun("gAlice","Alice test program");
43 // Create some histograms
46 AliMUONChamber* iChamber;
52 for (Int_t nev=0; nev<= evNumber2; nev++) {
53 Int_t nparticles = gAlice->GetEvent(nev);
54 //cout << "nparticles " << nparticles <<endl;
55 if (nev < evNumber1) continue;
56 if (nparticles <= 0) return;
58 AliMUON *MUON = (AliMUON*) gAlice->GetModule("MUON");
61 TTree *TH = gAlice->TreeH();
62 Int_t ntracks = TH->GetEntries();
67 Float_t pups[4]={0,0,0,0};
68 for (Int_t track=0; track<ntracks;track++) {
71 Int_t nbytes += TH->GetEvent(track);
75 for(AliMUONHit* mHit=(AliMUONHit*)MUON->FirstHit(-1);
77 mHit=(AliMUONHit*)MUON->NextHit())
79 Int_t nch = mHit->Chamber(); // chamber number
80 Float_t x = mHit->X(); // x-pos of hit
81 Float_t y = mHit->Y(); // y-pos
82 Float_t z = mHit->Z(); // y-pos
83 Float_t p = mHit->Momentum();
84 Float_t px = mHit->Px();
85 Float_t py = mHit->Py();
86 Float_t pz = mHit->Pz();
88 if (nch != 1) continue;
90 Int_t ipart = mHit->Particle();
92 Int_t ftrack = mHit->Track();
93 Part = gAlice->Particle(ftrack);
94 Int_t ipart = Part->GetPdgCode();
96 Float_t px0 = Part->Px();
97 Float_t py0 = Part->Py();
98 Float_t pz0 = Part->Pz();
99 Float_t p0 = Part->P();
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;
119 Float_t pzB = p * zb/TMath::Sqrt(zb*zb+yb*yb+xb*xb);
120 Float_t pxB = pzB * xb/zb;
121 Float_t pyB = pzB * yb/zb;
123 = TMath::ATan2(TMath::Sqrt(pxB*pxB+pyB*pyB), pzB) *
132 Float_t corr=(p+CorrectP(p, theta))/p;
142 TMath::Sqrt(pups[0]*pups[0]
143 -pups[1]*pups[1]-pups[2]*pups[2]-pups[3]*pups[3]);
144 mass1->Fill(mass, 1.);
145 mass2->Fill(mass, 1.);
146 mass3->Fill(mass, 1.);
148 //Create a canvas, set the view range, show histograms
149 TCanvas *c1 = new TCanvas("c1","Mass Spectra",400,10,600,700);
151 mass2->SetFillColor(42);
152 mass2->SetXTitle("Mass (GeV)");
158 Float_t CorrectP(Float_t p, Float_t theta)
165 c = 2.916+0.0156*p-0.00000866*p*p;
172 c = 2.464+0.00877*p-0.0000106*p*p;