2 void read_jets_kine(const char* fn = "jets.root")
8 TH1F* eH = new TH1F("eH" , "Jet Energy", 40., 0., 200.);
9 TH1F* e1H = new TH1F("e1H" , "Jet Energy", 40., 0., 200.);
10 TH1F* e2H = new TH1F("e2H" , "Jet Energy", 40., 0., 200.);
11 TH1F* e3H = new TH1F("e3H" , "Jet Energy", 40., 0., 200.);
12 TH1F* dr1H = new TH1F("dr1H", "delta R", 160., 0., 2.);
13 TH1F* dr2H = new TH1F("dr2H", "delta R", 160., 0., 2.);
14 TH1F* dr3H = new TH1F("dr4H", "delta R", 160., 0., 2.);
15 TH1F* etaH = new TH1F("etaH", "eta", 160., -2., 2.);
19 gSystem->Load("$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET)/libJETAN");
22 TFile *jFile = new TFile(fn);
24 // get jet header and display parameters
25 AliUA1JetHeader* jHeader =
26 (AliUA1JetHeader*) (jFile->Get("AliUA1JetHeader"));
27 jHeader->PrintParameters();
29 // get reader header and events to be looped over
30 AliJetKineReaderHeader *jReaderH =
31 (AliJetKineReaderHeader*)(jFile->Get("AliJetKineReaderHeader"));
32 Int_t first = jReaderH->GetFirstEvent();
33 Int_t last = jReaderH->GetLastEvent();
34 cout << "First event = " << first << " Last event = " << last << endl;
41 for (Int_t i=first; i< last; i++) {
42 cout << " Analyzing event " << i << endl;
43 // get next tree with AliJet
45 sprintf(nameT, "TreeJ%d",i);
46 TTree *jetT =(TTree *)(jFile->Get(nameT));
47 jetT->SetBranchAddress("FoundJet", &jets);
48 jetT->SetBranchAddress("GenJet", &gjets);
49 jetT->SetBranchAddress("LeadingPart", &leading);
53 // Find the jet with E_T closest to 100.
55 Int_t njets = jets->GetNJets();
61 for (Int_t j = 0; j < njets; j++) {
62 if (TMath::Abs(jets->GetPt(j) - 100.) < demin
63 && TMath::Abs(jets->GetEta(j)) < 0.5) {
64 emax = jets->GetPt(j);
66 demin = TMath::Abs(jets->GetPt(j) - 100.);
71 printf("Strange %d %f %f %f\n", i, emax, jets->GetEta(imax), jets->GetPhi(imax));
72 Int_t ngen = gjets->GetNJets();
73 for (Int_t j = 0; j < ngen; j++) {
74 Float_t etag = gjets->GetEta(j);
75 Float_t phig = gjets->GetPhi(j);
76 Float_t eg = gjets->GetPt(j);
77 printf("Generated %d %f %f %f\n", j, eg, etag, phig);
83 e2H->Fill(gjets->GetPt(0));
85 eH->Fill(jets->GetPt(imax));
86 dr1H->Fill(jets->GetEta(imax) - gjets->GetEta(0));
88 // Find the generated jet closest to the reconstructed
93 Float_t etaj = jets->GetEta(imax);
94 Float_t phij = jets->GetPhi(imax);
96 Int_t ngen = gjets->GetNJets();
100 for (Int_t j = 0; j < ngen; j++) {
101 Float_t etag = gjets->GetEta(j);
102 Float_t phig = gjets->GetPhi(j);
103 Float_t deta = etag - etaj;
104 Float_t dphi = TMath::Abs(phig - phij);
105 if (dphi > TMath::Pi()) dphi = 2. * TMath::Pi() - dphi;
106 Float_t r = TMath::Sqrt(deta * deta + dphi * dphi);
113 e1H->Fill(gjets->GetPt(igen));
116 printf("rmin %f %f %f %f %f %f\n", rmin, gjets->GetEta(igen), gjets->GetPhi(igen),
119 Int_t ngen = gjets->GetNJets();
120 for (Int_t j = 0; j < ngen; j++) {
121 Float_t etag = gjets->GetEta(j);
122 Float_t phig = gjets->GetPhi(j);
123 Float_t eg = gjets->GetPt(j);
124 printf(" Gen %d %f %f %f\n", j, eg, etag, phig);
135 Float_t etal = leading->GetLeading()->Eta();
136 Float_t phil = leading->GetLeading()->Phi();
137 Float_t el = leading->GetLeading()->E();
142 Int_t ngen = gjets->GetNJets();
143 for (Int_t j = 0; j < ngen; j++) {
144 Float_t etag = gjets->GetEta(j);
145 Float_t phig = gjets->GetPhi(j);
146 Float_t deta = etag-etal;
147 Float_t dphi = TMath::Abs(phig - phil);
148 if (dphi > TMath::Pi()) dphi = 2. * TMath::Pi() - dphi;
149 Float_t r = TMath::Sqrt(deta * deta + dphi * dphi);
159 // cout << " Generated Jets:" << endl;
160 // gjets->PrintJets();
161 // cout << " Leading particle: " << endl;
162 // leading->PrintLeading();
166 TCanvas* c1 = new TCanvas("c1");
167 eH->SetXTitle("E (GeV)");
170 e1H->SetLineColor(2);
171 e2H->SetLineColor(4);
172 e3H->SetLineColor(5);
177 TCanvas* c2 = new TCanvas("c2");
179 dr2H->SetXTitle("#DeltaR(rec, gen)");
180 dr2H->SetLineColor(2);
183 TCanvas* c3 = new TCanvas("c3");
184 dr3H->SetXTitle("#DeltaR(rec, gen)");
188 TCanvas* c4 = new TCanvas("c4");
191 TCanvas* c5 = new TCanvas("c5");