]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/testJetFinder.C
Clusterizer introduced
[u/mrichter/AliRoot.git] / EMCAL / testJetFinder.C
CommitLineData
d8659a86 1void testJetFinder(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// Create and configure jet finder
32 AliEMCALJetFinder* jetFinder =
33 new AliEMCALJetFinder("UA1 Jet Finder", "Test");
34 jetFinder->SetDebug(1);
35 jetFinder->SetConeRadius(0.5);
36 jetFinder->SetEtSeed(4.);
37 jetFinder->SetMinJetEt(10.);
38 jetFinder->SetMinCellEt(1.);
39 jetFinder->SetPtCut(2.);
40// jetFinder->SetMomentumSmearing(1);
41// jetFinder->SetEfficiencySim(1);
42 jetFinder->SetHadronCorrection(0);
43// jetFinder->SetHadronCorrector(AliEMCALHadronCorrectionv0::Instance());
44 jetFinder->SetSamplingFraction(12.9);
45
46//
47// Loop over events
48//
49
50 Int_t nhit=0;
51 for (Int_t nev = evNumber1; nev<= evNumber2; nev++) {
52 Int_t nparticles = gAlice->GetEvent(nev);
53 if (nev < evNumber1) continue;
54 if (nparticles <= 0) return;
55// ECAL information
56 jetFinder->FillFromHits();
57// jetFinder->FillFromDigits();
58// TPC information
59 jetFinder->FillFromTracks(1, 0);
60// ^ preserves info from hit
61
62// TPC information from Hits associated to the EMCAL
63// jetFinder->FillFromHitFlaggedTracks(1);
64//
65 jetFinder->Find();
66
67//
68// Look at results
69 printf("\n Test Jets: %d\n", jetFinder->Njets());
70 Int_t njet = jetFinder->Njets();
71 for (Int_t nj=0; nj<njet; nj++)
72 {
73 printf("\n Jet Energy %5d %8.2f \n",
74 nj, jetFinder->JetEnergy(nj));
75 printf("\n Jet Phi %5d %8.2f %8.2f \n",
76 nj, jetFinder->JetPhiL(nj), jetFinder->JetPhiW(nj));
77 printf("\n Jet Eta %5d %8.2f %8.2f \n",
78 nj, jetFinder->JetEtaL(nj), jetFinder->JetEtaW(nj));
79 }
80// TCanvas *c1 = new TCanvas("c1","Canvas 1",400,10,600,700);
81// (jetFinder->GetLego())->Draw();
82 } // event loop
83}
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99