]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/EMCALJetTasks/macros/AddTaskJetRespPtHard.C
From Chris
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / macros / AddTaskJetRespPtHard.C
1 // $Id$
2
3 AliJetResponseMaker* AddTaskJetRespPtHard(  
4   const char *ntracks1           = "Tracks",
5   const char *nclusters1         = "CaloClusters",
6   const char *njets1             = "Jets",
7   const char *nrho1              = "Rho",
8   Double_t    jetradius1         = 0.2,
9   const char *ntracks2           = "MCParticles",
10   const char *nclusters2         = "",
11   const char *njets2             = "MCJets",
12   const char *nrho2              = "",
13   Double_t    jetradius2         = 0.2,
14   Double_t    jetptcut           = 1,
15   Double_t    jetareacut         = 0.557,
16   Double_t    jetBias            = 5,
17   Int_t       biasType           = 0,   //  0 = charged, 1 = neutral, 2 = both
18   UInt_t      matching           = AliJetResponseMaker::kGeometrical,
19   Double_t    maxDistance1       = 0.25,
20   Double_t    maxDistance2       = 0.25,
21   const char *cutType            = "TPC",
22   Int_t       minPtHardBin       = -999,
23   Int_t       maxPtHardBin       = -999,
24   Int_t       ncent              = 0,
25   const char *taskname           = "AliJetResponseMaker",
26   Bool_t      biggerMatrix       = kFALSE
27 )
28 {
29   TCollection *funct = gROOT->GetListOfGlobalFunctions();
30   if (!funct->Contains("AddTaskJetResponseMaker"))
31     gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskJetResponseMaker.C");
32   else
33     Printf("Function AddTaskJetResponseMaker already loaded, will not load again...");
34
35   Double_t centRanges[5] = {0,10,30,50,100};
36  
37   if (ncent == 0) {
38     ncent = 1;
39     centRanges[0] = -999;
40     centRanges[1] = -999;
41   }
42
43   if (ncent > 4)
44     ncent = 4;
45
46   Int_t ntasks = (maxPtHardBin - minPtHardBin + 1) * ncent;
47
48   if (jetBias > 5)
49     ntasks *= 3;
50   else if (jetBias > 0)
51     ntasks *= 2;
52
53   AliJetResponseMaker *jetTask = new AliJetResponseMaker[ntasks];
54
55   Int_t itask = 0;
56
57   for (Int_t i = minPtHardBin; i <= maxPtHardBin; i++) {
58     for (Int_t j = 0; j < ncent; j++) {
59       Printf("Adding AliJetResponseMaker n. %d", itask);
60       AddTaskJetResponseMaker(ntracks1, nclusters1, njets1, nrho1, jetradius1, ntracks2, nclusters2, njets2, nrho2, jetradius2,
61                               jetptcut, jetareacut, 0, biasType,
62                               matching, maxDistance1, maxDistance2, cutType, i, centRanges[j], centRanges[j+1], taskname, biggerMatrix, jetTask + itask);
63       itask++;
64
65       if (jetBias > 5) {
66         Printf("Adding AliJetResponseMaker n. %d", itask);
67         AddTaskJetResponseMaker(ntracks1, nclusters1, njets1, nrho1, jetradius1, ntracks2, nclusters2, njets2, nrho2, jetradius2,
68                                 jetptcut, jetareacut, 5, biasType,
69                                 0, 1, 1, cutType, i, centRanges[j], centRanges[j+1], taskname, biggerMatrix, jetTask + itask);
70         itask++;
71       }
72
73       if (jetBias > 0) {
74         Printf("Adding AliJetResponseMaker n. %d", itask);
75         AddTaskJetResponseMaker(ntracks1, nclusters1, njets1, nrho1, jetradius1, ntracks2, nclusters2, njets2, nrho2, jetradius2,
76                                 jetptcut, jetareacut, jetBias, biasType,
77                                 0, 1, 1, cutType, i, centRanges[j], centRanges[j+1], taskname, biggerMatrix, jetTask + itask);
78         itask++;
79       }
80     }
81   }
82   
83   return jetTask;
84 }