]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/testJetFinderHits.C
Acceptance and random rejection added.
[u/mrichter/AliRoot.git] / EMCAL / testJetFinderHits.C
1 void testJetFinderHits(Int_t evNumber1=0, Int_t evNumber2=0) 
2 {
3 //*-- Author: Andreas Morsch (CERN)
4 // Dynamically link some shared libs                    
5     if (gClassTable->GetID("AliRun") < 0) {
6         gROOT->LoadMacro("../macros/loadlibs.C");
7         loadlibs();
8     }
9 // Connect the Root Galice file containing Geometry, Kine and Hits
10
11     TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
12
13     
14     if (!file) {
15         printf("\n Creating galice.root \n");
16         file = new TFile("galice.root", "update");
17     } else {
18         printf("\n galice.root found in file list");
19     }
20     
21 // Get AliRun object from file or create it if not on file
22     if (!gAlice) {
23         gAlice = (AliRun*)(file->Get("gAlice"));
24         if (gAlice) printf("AliRun object found on file\n");
25         if (!gAlice) {
26             printf("\n create new gAlice object");
27             gAlice = new AliRun("gAlice","Alice test program");
28         }
29     }
30
31     AliEMCALJetFinder* jetFinder = 
32         new AliEMCALJetFinder("UA1 Jet Finder", "Test");
33     jetFinder->SetConeRadius(0.7);
34     jetFinder->SetEtSeed(3.);
35     jetFinder->SetMinJetEt(10.);
36     jetFinder->SetMinCellEt(1.);
37 //
38 //   Loop over events 
39 //
40 //    TCanvas *c1 = new TCanvas("c1","Canvas 1",400,10,600,700);
41 //    c1->Divide(2,2);
42
43     Int_t nhit=0;
44     for (Int_t nev=0; nev<= evNumber2; nev++) {
45         Int_t nparticles = gAlice->GetEvent(nev);
46         if (nev < evNumber1) continue;
47         if (nparticles <= 0) return;
48 // ECAL information     
49         jetFinder->FillFromHits();
50 // TPC  information
51         jetFinder->FillFromTracks(1, 0);
52 //                                ^ preserves info from hit
53         jetFinder->Find();
54         printf("\n Test Jets: %d\n", jetFinder->Njets());
55         Int_t njet = jetFinder->Njets();
56         for (Int_t nj=0; nj<njet; nj++)
57         {
58             printf("\n Jet Energy %5d %8.2f \n", 
59                    nj, jetFinder->JetEnergy(nj));
60             printf("\n Jet Phi    %5d %8.2f %8.2f \n", 
61                    nj, jetFinder->JetPhiL(nj), jetFinder->JetPhiW(nj));
62             printf("\n Jet Eta    %5d %8.2f %8.2f \n", 
63                    nj, jetFinder->JetEtaL(nj), jetFinder->JetEtaW(nj));
64         }
65 //      c1->cd(2);
66 //      (jetFinder->GetLego())->Draw();
67     } // event loop
68 }
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84