Undoing some unwanted method renames
[u/mrichter/AliRoot.git] / PWGJE / macros / AddTaskPWG4HighPtTrackQA.C
1 void AddTaskPWG4HighPtTrackQA(TString prodType = "LHC10h", Int_t iAODanalysis = 0, Bool_t isPbPb=kTRUE, Bool_t bReduced = kTRUE, Int_t filterBit = 272, Bool_t doEfficiency = kFALSE)
2 {
3   if(iAODanalysis==0) { //run on ESDs
4     if(prodType.EqualTo("LHC10h") || prodType.EqualTo("LHC11a")) {
5       if(bReduced)
6         AddTaskPWG4HighPtTrackQAAllReduced(prodType.Data(),isPbPb,iAODanalysis);
7       else
8         AddTaskPWG4HighPtTrackQAAll(prodType.Data(),isPbPb,iAODanalysis);
9     }
10     else if(prodType.Contains("LHC12") || prodType.Contains("LHC13")) {
11       AddTaskPWG4HighPtTrackQApPb();
12     } else {
13       if(bReduced)
14         AddTaskPWG4HighPtTrackQAAllReduced2011(prodType.Data(),isPbPb,iAODanalysis);
15       else
16         AddTaskPWG4HighPtTrackQAAll2011(prodType.Data(),isPbPb,iAODanalysis);
17     }
18   }
19   else if(iAODanalysis==1) { //run on AODs
20     if(doEfficiency==1){
21       gROOT->LoadMacro(gSystem->ExpandPathName("$ALICE_ROOT/PWGJE/macros/AddTaskHybridTrackEfficiency.C"));
22       AddTaskHybridTrackEfficiencyQA_AOD_train(prodType.Data(),isPbPb,AliVEvent::kMB,kTRUE,kFALSE);
23     }
24     AddTaskPWG4HighPtTrackQAAOD(prodType.Data(),isPbPb,iAODanalysis,filterBit); 
25   }
26 }
27
28 void AddTaskPWG4HighPtTrackQApPb(char *prodType = "LHC13b")
29 {
30   AliPWG4HighPtTrackQA *taskTrackQA05cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,kFALSE,0,10,0,5,AliVEvent::kINT7);
31   AliPWG4HighPtTrackQA *taskTrackQA75cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,kFALSE,0,10,7,5,AliVEvent::kINT7);
32   
33   if(!strcmp(prodType,"LHC13d") || !strcmp(prodType,"LHC13e") || !strcmp(prodType,"LHC13f")) {
34     AliPWG4HighPtTrackQA *taskTrackQA05cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,kFALSE,0,10,0,5,AliVEvent::kEMCEJE);
35     AliPWG4HighPtTrackQA *taskTrackQA75cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,kFALSE,0,10,7,5,AliVEvent::kEMCEJE);
36   }
37 }
38
39 void AddTaskPWG4HighPtTrackQAAll(char *prodType = "LHC10h",Bool_t isPbPb=kTRUE, Int_t iAODanalysis = 0) 
40 {    
41
42   Int_t cent = 10;
43   
44   AliPWG4HighPtTrackQA *taskTrackQA00cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0); //RAA track cuts
45   AliPWG4HighPtTrackQA *taskTrackQA01cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1); //global hybrid unconstrained
46   AliPWG4HighPtTrackQA *taskTrackQA70cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0); //global hybrid constrained category 1
47   AliPWG4HighPtTrackQA *taskTrackQA71cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1); //global hybrid constrained category 2
48   AliPWG4HighPtTrackQA *taskTrackQA72cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2); //global hybrid constrained all
49
50   if(isPbPb) {
51     for(cent=0; cent<4; cent++) {
52       AliPWG4HighPtTrackQA *taskTrackQA00 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0);
53       AliPWG4HighPtTrackQA *taskTrackQA01 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1);
54       AliPWG4HighPtTrackQA *taskTrackQA70 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0);
55       AliPWG4HighPtTrackQA *taskTrackQA71 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1);
56       AliPWG4HighPtTrackQA *taskTrackQA72 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2);
57     }
58   }
59 }
60
61 void AddTaskPWG4HighPtTrackQAAll2011(char *prodType = "LHC11h",Bool_t isPbPb=kTRUE, Int_t iAODanalysis = 0) 
62 {    
63
64   Int_t cent = 10;
65   UInt_t iPhysicsSelectionFlag = AliVEvent::kMB;
66   UInt_t iPhysicsSelectionFlagCentral = AliVEvent::kCentral;
67   UInt_t iPhysicsSelectionFlagSemiCentral = AliVEvent::kSemiCentral;
68
69   
70   AliPWG4HighPtTrackQA *taskTrackQA00cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlag);
71   AliPWG4HighPtTrackQA *taskTrackQA01cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1,iPhysicsSelectionFlag);
72   AliPWG4HighPtTrackQA *taskTrackQA70cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0,iPhysicsSelectionFlag);
73   AliPWG4HighPtTrackQA *taskTrackQA71cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1,iPhysicsSelectionFlag);
74   AliPWG4HighPtTrackQA *taskTrackQA72cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2,iPhysicsSelectionFlag);
75   
76   AliPWG4HighPtTrackQA *taskTrackQA05cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlag);
77   AliPWG4HighPtTrackQA *taskTrackQA74cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,4,iPhysicsSelectionFlag);
78   AliPWG4HighPtTrackQA *taskTrackQA75cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlag);
79
80   if(isPbPb) {
81     for(cent=0; cent<4; cent++) {
82       AliPWG4HighPtTrackQA *taskTrackQA00 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlag);
83       AliPWG4HighPtTrackQA *taskTrackQA01 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1,iPhysicsSelectionFlag);
84       AliPWG4HighPtTrackQA *taskTrackQA70 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0,iPhysicsSelectionFlag);
85       AliPWG4HighPtTrackQA *taskTrackQA71 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1,iPhysicsSelectionFlag);
86       AliPWG4HighPtTrackQA *taskTrackQA72 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2,iPhysicsSelectionFlag);
87       AliPWG4HighPtTrackQA *taskTrackQA05 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlag);
88       AliPWG4HighPtTrackQA *taskTrackQA74 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,4,iPhysicsSelectionFlag);
89       AliPWG4HighPtTrackQA *taskTrackQA75 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlag);
90
91       if(cent==0) {
92         AliPWG4HighPtTrackQA *taskTrackQA00 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagCentral);
93         AliPWG4HighPtTrackQA *taskTrackQA01 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1,iPhysicsSelectionFlagCentral);
94         AliPWG4HighPtTrackQA *taskTrackQA70 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0,iPhysicsSelectionFlagCentral);
95         AliPWG4HighPtTrackQA *taskTrackQA71 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1,iPhysicsSelectionFlagCentral);
96         AliPWG4HighPtTrackQA *taskTrackQA72 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2,iPhysicsSelectionFlagCentral);
97         AliPWG4HighPtTrackQA *taskTrackQA05 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagCentral);
98         AliPWG4HighPtTrackQA *taskTrackQA74 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,4,iPhysicsSelectionFlagCentral);
99         AliPWG4HighPtTrackQA *taskTrackQA75 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagCentral);
100       }
101       else {
102         AliPWG4HighPtTrackQA *taskTrackQA00 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagSemiCentral);
103         AliPWG4HighPtTrackQA *taskTrackQA01 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1,iPhysicsSelectionFlagSemiCentral);
104         AliPWG4HighPtTrackQA *taskTrackQA70 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0,iPhysicsSelectionFlagSemiCentral);
105         AliPWG4HighPtTrackQA *taskTrackQA71 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1,iPhysicsSelectionFlagSemiCentral);
106         AliPWG4HighPtTrackQA *taskTrackQA72 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2,iPhysicsSelectionFlagSemiCentral);
107         AliPWG4HighPtTrackQA *taskTrackQA05 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagSemiCentral);
108         AliPWG4HighPtTrackQA *taskTrackQA74 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,4,iPhysicsSelectionFlagSemiCentral);
109         AliPWG4HighPtTrackQA *taskTrackQA75 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagSemiCentral);
110       }
111     }
112   }
113 }
114
115 void AddTaskPWG4HighPtTrackQAAllReduced(char *prodType = "LHC11h",Bool_t isPbPb=kTRUE, Int_t iAODanalysis = 0) 
116 {    
117
118   int cent = 10;
119   
120   if(isPbPb) {
121     for(cent=0; cent<4; cent++) {
122       AliPWG4HighPtTrackQA *taskTrackQA00 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0);
123       AliPWG4HighPtTrackQA *taskTrackQA01 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1);
124       AliPWG4HighPtTrackQA *taskTrackQA70 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0);
125       AliPWG4HighPtTrackQA *taskTrackQA71 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1);
126       AliPWG4HighPtTrackQA *taskTrackQA72 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2);
127     }
128   }
129 }
130
131 void AddTaskPWG4HighPtTrackQALHC11hLTS(char *prodType = "LHC10h",Bool_t isPbPb=kTRUE, Int_t iAODanalysis = 0) 
132 {    
133
134   Int_t cent = 10;
135   UInt_t iPhysicsSelectionFlag = AliVEvent::kMB|AliVEvent::kCentral|AliVEvent::kSemiCentral;
136   UInt_t iPhysicsSelectionFlagEMCEJE = AliVEvent::kEMCEJE;
137   
138   AliPWG4HighPtTrackQA *taskTrackQA00cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlag);
139   AliPWG4HighPtTrackQA *taskTrackQA01cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1,iPhysicsSelectionFlag);
140   AliPWG4HighPtTrackQA *taskTrackQA70cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0,iPhysicsSelectionFlag);
141   AliPWG4HighPtTrackQA *taskTrackQA71cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1,iPhysicsSelectionFlag);
142   AliPWG4HighPtTrackQA *taskTrackQA72cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2,iPhysicsSelectionFlag);
143   AliPWG4HighPtTrackQA *taskTrackQA05cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlag);
144   AliPWG4HighPtTrackQA *taskTrackQA74cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,4,iPhysicsSelectionFlag);
145   AliPWG4HighPtTrackQA *taskTrackQA75cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlag);
146
147   AliPWG4HighPtTrackQA *taskTrackQAEMCJE00cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagEMCEJE);
148   AliPWG4HighPtTrackQA *taskTrackQAEMCJE01cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1,iPhysicsSelectionFlagEMCEJE);
149   AliPWG4HighPtTrackQA *taskTrackQAEMCJE70cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0,iPhysicsSelectionFlagEMCEJE);
150   AliPWG4HighPtTrackQA *taskTrackQAEMCJE71cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1,iPhysicsSelectionFlagEMCEJE);
151   AliPWG4HighPtTrackQA *taskTrackQAEMCJE72cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2,iPhysicsSelectionFlagEMCEJE);
152   AliPWG4HighPtTrackQA *taskTrackQAEMCJE05cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagEMCEJE);
153   AliPWG4HighPtTrackQA *taskTrackQAEMCJE74cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,4,iPhysicsSelectionFlagEMCEJE);
154   AliPWG4HighPtTrackQA *taskTrackQAEMCJE75cent10 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagEMCEJE);
155
156   if(isPbPb) {
157     for(cent=0; cent<4; cent++) {
158       AliPWG4HighPtTrackQA *taskTrackQA00 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlag);
159       AliPWG4HighPtTrackQA *taskTrackQA01 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1,iPhysicsSelectionFlag);
160       AliPWG4HighPtTrackQA *taskTrackQA70 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0,iPhysicsSelectionFlag);
161       AliPWG4HighPtTrackQA *taskTrackQA71 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1,iPhysicsSelectionFlag);
162       AliPWG4HighPtTrackQA *taskTrackQA72 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2,iPhysicsSelectionFlag);
163       AliPWG4HighPtTrackQA *taskTrackQA05 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlag);
164       AliPWG4HighPtTrackQA *taskTrackQA74 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,4,iPhysicsSelectionFlag);
165       AliPWG4HighPtTrackQA *taskTrackQA75 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlag);
166
167       AliPWG4HighPtTrackQA *taskTrackQAEMCJE00 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagEMCEJE);
168       AliPWG4HighPtTrackQA *taskTrackQAEMCJE01 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1,iPhysicsSelectionFlagEMCEJE);
169       AliPWG4HighPtTrackQA *taskTrackQAEMCJE70 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0,iPhysicsSelectionFlagEMCEJE);
170       AliPWG4HighPtTrackQA *taskTrackQAEMCJE71 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1,iPhysicsSelectionFlagEMCEJE);
171       AliPWG4HighPtTrackQA *taskTrackQAEMCJE72 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2,iPhysicsSelectionFlagEMCEJE);
172       AliPWG4HighPtTrackQA *taskTrackQAEMCJE05 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagEMCEJE);
173       AliPWG4HighPtTrackQA *taskTrackQAEMCJE74 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,4,iPhysicsSelectionFlagEMCEJE);
174       AliPWG4HighPtTrackQA *taskTrackQAEMCJE75 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagEMCEJE);
175     }
176   }
177 }
178
179 void AddTaskPWG4HighPtTrackQAAllReduced2011(char *prodType = "LHC10h",Bool_t isPbPb=kTRUE, Int_t iAODanalysis = 0) 
180 {    
181
182   int cent = 10;
183
184   UInt_t iPhysicsSelectionFlagCentral = AliVEvent::kCentral;
185   UInt_t iPhysicsSelectionFlagSemiCentral = AliVEvent::kSemiCentral;
186
187   AliPWG4HighPtTrackQA *taskTrackQA00C = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagCentral);
188   AliPWG4HighPtTrackQA *taskTrackQA01C = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1,iPhysicsSelectionFlagCentral);
189   AliPWG4HighPtTrackQA *taskTrackQA70C = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0,iPhysicsSelectionFlagCentral);
190   AliPWG4HighPtTrackQA *taskTrackQA71C = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1,iPhysicsSelectionFlagCentral);
191   AliPWG4HighPtTrackQA *taskTrackQA72C = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2,iPhysicsSelectionFlagCentral);
192   AliPWG4HighPtTrackQA *taskTrackQA05C = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagCentral); 
193   AliPWG4HighPtTrackQA *taskTrackQA74C = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,4,iPhysicsSelectionFlagCentral);
194   AliPWG4HighPtTrackQA *taskTrackQA75C = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagCentral);
195
196   AliPWG4HighPtTrackQA *taskTrackQA00SC = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagSemiCentral);
197   AliPWG4HighPtTrackQA *taskTrackQA01SC = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,1,iPhysicsSelectionFlagSemiCentral);
198   AliPWG4HighPtTrackQA *taskTrackQA70SC = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,0,iPhysicsSelectionFlagSemiCentral);
199   AliPWG4HighPtTrackQA *taskTrackQA71SC = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,1,iPhysicsSelectionFlagSemiCentral);
200   AliPWG4HighPtTrackQA *taskTrackQA72SC = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,2,iPhysicsSelectionFlagSemiCentral);
201   AliPWG4HighPtTrackQA *taskTrackQA05SC = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagSemiCentral);
202   AliPWG4HighPtTrackQA *taskTrackQA74SC = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,4,iPhysicsSelectionFlagSemiCentral);
203   AliPWG4HighPtTrackQA *taskTrackQA75SC = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagSemiCentral);
204 }
205
206 void AddTaskPWG4HighPtTrackQAAOD(char *prodType = "LHC11h",Bool_t isPbPb=kTRUE, Int_t iAODanalysis = 1, Int_t filterBit = 768) 
207 {  
208   UInt_t iPhysicsSelectionFlagMB          = AliVEvent::kMB; 
209   UInt_t iPhysicsSelectionFlagCentral     = AliVEvent::kCentral;
210   UInt_t iPhysicsSelectionFlagSemiCentral = AliVEvent::kSemiCentral;
211   UInt_t iPhysicsSelectionFlagINT7        = AliVEvent::kINT7; 
212   UInt_t iPhysicsSelectionFlagEMCEJE      = AliVEvent::kEMCEJE; 
213
214   Int_t cent = 10;
215
216   Int_t filterBit1 = 256; //standard global tracks
217   Int_t filterBit2 = 512; //complementary tracks
218
219   Bool_t bIncludeNoITS = kFALSE;
220
221   TString strRunPeriod = TString(prodType);
222   strRunPeriod.ToLower();
223
224   if (strRunPeriod == "lhc10h" || strRunPeriod == "lhc11h" || 
225       strRunPeriod == "lhc12a" || strRunPeriod == "lhc12b" || strRunPeriod == "lhc12c" || strRunPeriod == "lhc12d" || 
226       strRunPeriod == "lhc12e" || strRunPeriod == "lhc12f" || strRunPeriod == "lhc12g" || strRunPeriod == "lhc12g" || 
227       strRunPeriod == "lhc12h" || strRunPeriod == "lhc12i" ||
228       strRunPeriod == "lhc13b" || strRunPeriod == "lhc13c" || strRunPeriod == "lhc13d" || strRunPeriod == "lhc13e" || 
229       strRunPeriod == "lhc13f" || strRunPeriod == "lhc13g" || 
230       strRunPeriod == "lhc12a15e" || strRunPeriod == "lhc13b4" || strRunPeriod == "lhc13b4_fix" || 
231       strRunPeriod == "lhc13b4_plus" || strRunPeriod == "lhc12a15f" || strRunPeriod.Contains("lhc12a17") || strRunPeriod.Contains("lhc14a1")) {
232     filterBit  = 768;
233     filterBit1 = 256;
234     filterBit2 = 512;
235     bIncludeNoITS = kFALSE;
236     if(strRunPeriod == "lhc10h") bIncludeNoITS = kTRUE;
237   }
238   else if (strRunPeriod == "lhc11a" || strRunPeriod == "lhc10hold" || strRunPeriod == "lhc12a15a" || strRunPeriod.Contains("lhc11a2")) {
239     filterBit  = 272;
240     filterBit1 = 16;
241     filterBit2 = 256;
242     bIncludeNoITS = kTRUE;
243   }
244
245   if(isPbPb) {
246     for(cent=0; cent<4; cent++) {
247       AliPWG4HighPtTrackQA *taskTrackQAMB = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagMB);
248       taskTrackQAMB->SetFilterMask(filterBit);
249       taskTrackQAMB->SetIncludeNoITS(bIncludeNoITS);
250
251       AliPWG4HighPtTrackQA *taskTrackQAMB1 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagMB);
252       taskTrackQAMB1->SetFilterMask(filterBit1);
253       taskTrackQAMB1->SetIncludeNoITS(bIncludeNoITS);
254       
255       AliPWG4HighPtTrackQA *taskTrackQAMB2 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagMB);
256       taskTrackQAMB2->SetFilterMask(filterBit2);
257       taskTrackQAMB2->SetIncludeNoITS(bIncludeNoITS);
258     }
259
260     cent = 10;
261
262     if(strRunPeriod.Contains("lhc11h")) {
263       AliPWG4HighPtTrackQA *taskTrackQAC = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagCentral);
264       taskTrackQAC->SetFilterMask(filterBit);
265       taskTrackQAC->SetIncludeNoITS(bIncludeNoITS);
266
267       AliPWG4HighPtTrackQA *taskTrackQAC1 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagCentral);
268       taskTrackQAC1->SetFilterMask(filterBit1);
269       taskTrackQAC1->SetIncludeNoITS(bIncludeNoITS);
270
271       AliPWG4HighPtTrackQA *taskTrackQAC2 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagCentral);
272       taskTrackQAC2->SetFilterMask(filterBit2);
273       taskTrackQAC2->SetIncludeNoITS(bIncludeNoITS);
274
275       AliPWG4HighPtTrackQA *taskTrackQASC = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagSemiCentral);
276       taskTrackQASC->SetFilterMask(filterBit);
277       taskTrackQASC->SetIncludeNoITS(bIncludeNoITS);
278
279       AliPWG4HighPtTrackQA *taskTrackQASC1 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagSemiCentral);
280       taskTrackQASC1->SetFilterMask(filterBit1);
281       taskTrackQASC1->SetIncludeNoITS(bIncludeNoITS);
282
283       AliPWG4HighPtTrackQA *taskTrackQASC2 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagSemiCentral);
284       taskTrackQASC2->SetFilterMask(filterBit2);
285       taskTrackQASC2->SetIncludeNoITS(bIncludeNoITS);
286     }
287   }
288   else {
289     cent = 10;
290
291     if(strRunPeriod.Contains("lhc13") || strRunPeriod.Contains("lhc12")) {
292       AliPWG4HighPtTrackQA *taskTrackQAMB = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagINT7);
293       taskTrackQAMB->SetFilterMask(filterBit);
294       taskTrackQAMB->SetIncludeNoITS(bIncludeNoITS);
295
296       AliPWG4HighPtTrackQA *taskTrackQAMB1 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagINT7);
297       taskTrackQAMB1->SetFilterMask(filterBit1);
298       taskTrackQAMB1->SetIncludeNoITS(bIncludeNoITS);
299
300       AliPWG4HighPtTrackQA *taskTrackQAMB2 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagINT7);
301       taskTrackQAMB2->SetFilterMask(filterBit2);
302       taskTrackQAMB2->SetIncludeNoITS(bIncludeNoITS);
303
304       if(strRunPeriod.EqualTo("lhc13d") || strRunPeriod.EqualTo("lhc13e") || strRunPeriod.EqualTo("lhc13f") || strRunPeriod.EqualTo("lhc13g") 
305          || strRunPeriod.Contains("lhc12")) {
306         AliPWG4HighPtTrackQA *taskTrackQAEMCEJE = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagEMCEJE);
307         taskTrackQAEMCEJE->SetFilterMask(filterBit);
308         taskTrackQAEMCEJE->SetIncludeNoITS(bIncludeNoITS);
309
310         AliPWG4HighPtTrackQA *taskTrackQAEMCEJE1 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagEMCEJE);
311         taskTrackQAEMCEJE1->SetFilterMask(filterBit1);
312         taskTrackQAEMCEJE1->SetIncludeNoITS(bIncludeNoITS);
313
314         AliPWG4HighPtTrackQA *taskTrackQAEMCEJE2 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagEMCEJE);
315         taskTrackQAEMCEJE2->SetFilterMask(filterBit2);
316         taskTrackQAEMCEJE2->SetIncludeNoITS(bIncludeNoITS);
317       }
318     }
319     else {
320       AliPWG4HighPtTrackQA *taskTrackQAMB = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,0,iPhysicsSelectionFlagMB);
321       taskTrackQAMB->SetFilterMask(filterBit);
322       taskTrackQAMB->SetIncludeNoITS(bIncludeNoITS);
323
324       AliPWG4HighPtTrackQA *taskTrackQAMB1 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,0,5,iPhysicsSelectionFlagMB);
325       taskTrackQAMB1->SetFilterMask(filterBit1);
326       taskTrackQAMB1->SetIncludeNoITS(bIncludeNoITS);
327       
328
329       AliPWG4HighPtTrackQA *taskTrackQAMB2 = ConfigureTaskPWG4HighPtTrackQA(prodType,isPbPb,iAODanalysis,cent,7,5,iPhysicsSelectionFlagMB);
330       taskTrackQAMB2->SetFilterMask(filterBit2);
331       taskTrackQAMB2->SetIncludeNoITS(bIncludeNoITS);
332     }
333   }
334 }
335
336 AliPWG4HighPtTrackQA* ConfigureTaskPWG4HighPtTrackQA(char *prodType = "LHC10e14",Bool_t isPbPb=kTRUE,Int_t iAODanalysis = 0, Int_t centClass = 0, Int_t trackType = 0, Int_t cuts = 0, UInt_t iPhysicsSelectionFlag = AliVEvent::kMB)
337 {
338   /*
339     trackType: 0 = global
340                1 = TPC stand alone
341                2 = TPC stand alone constrained to SPD vertex
342                4 = TPC stand alone constrained to SPD vertex with QA track selection on global tracks
343                5 = Hybrid tracks: constrained TPConly for which no tight ITS is available
344                6 = Hybrid tracks: constrained loose global for which no tight ITS is available
345     cuts:      0 (global) = standard ITSTPC2010 a la RAA analysis
346                1 (global) = ITSrefit, no SPD requirements -> standard for jet analysis
347                2 (global) = ITSrefit + no hits in SPD
348                3 (global) = standard ITS tight cuts with nCrossed rows cut for hybrid tracks
349                0 (TPC)    = standard TPC + NClusters>70
350                1 (TPC)    = standard TPC + NClusters>0 --> to study new TPC QA recommendations
351                0 (hybrid 5) = constrained TPConly for which no tight ITS is available
352                0 (hybrid 6) = constrained loose global for which no tight ITS is available
353    */
354
355   //Load common track cut class
356   gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C");
357
358   // Creates HighPtTrackQA analysis task and adds it to the analysis manager.
359   
360   // A. Get the pointer to the existing analysis manager via the static access method.
361   //==============================================================================
362   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
363   if (!mgr) {
364     Error("AddTaskPWG4HighPtQMC", "No analysis manager to connect to.");
365     return NULL;
366   }  
367
368   // B. Check the analysis type using the event handlers connected to the analysis
369   //    manager. The availability of MC handler can also be checked here.
370   //==============================================================================
371   if (!mgr->GetInputEventHandler()) {
372     ::Error("AddPWG4TaskHighPtTrackQA", "This task requires an input event handler");
373     return NULL;
374   }  
375
376   // C. Create the task, add it to manager.
377   //===========================================================================
378  
379   //CREATE THE  CUTS -----------------------------------------------
380   //Use AliESDtrackCuts
381   AliESDtrackCuts *trackCuts = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts");
382   AliESDtrackCuts *trackCutsReject = 0x0;
383   AliESDtrackCuts *trackCutsTPConly = new AliESDtrackCuts("AliESDtrackCutsTPConly","TPC only Cuts");
384
385   //Standard Cuts
386   //Set track cuts for global tracks
387   if(trackType==0 && cuts==0) {
388     // tight global tracks - RAA analysis
389     trackCuts = CreateTrackCutsPWGJE(1000);
390   }
391   if(trackType==0 && cuts==1) {
392     //Cuts global tracks with ITSrefit requirement and SPDrequirement for jet analysis
393     trackCuts = CreateTrackCutsPWGJE(10001006);
394   }
395   if(trackType==0 && cuts==5) {
396     //Cuts global tracks with ITSrefit requirement and SPDrequirement for jet analysis + NCrossedRowsCut>70 recommended in 2011
397     trackCuts = CreateTrackCutsPWGJE(10001008);
398   }
399   if(trackType==0 && cuts==6) {
400     //Cuts global tracks with ITSrefit requirement and no SPDrequirement for jet analysis + NCrossedRowsCut>70 recommended in 2011
401     trackCuts = CreateTrackCutsPWGJE(10051008);
402   }
403   
404   if(trackType==0 && cuts==2) {
405     //Cuts global tracks with ITSrefit requirement but without SPD
406     trackCuts = CreateTrackCutsPWGJE(10011006);
407   }
408   if(trackType==7 && cuts==0) {
409     // tight global tracks
410     trackCuts = CreateTrackCutsPWGJE(10041006);
411     trackCutsReject = CreateTrackCutsPWGJE(1006);
412     trackCutsReject->SetEtaRange(-0.9,0.9);
413     trackCutsReject->SetPtRange(0.15, 1e10);
414   }
415   if(trackType==7 && cuts==4) {
416     // tight global tracks +  NCrossedRowsCut>120 recommended in 2011
417     trackCuts = CreateTrackCutsPWGJE(10041008);
418     trackCutsReject = CreateTrackCutsPWGJE(1008);
419     trackCutsReject->SetEtaRange(-0.9,0.9);
420     trackCutsReject->SetPtRange(0.15, 1e10);
421   }
422   if(trackType==7 && cuts==1) {
423     // tight global tracks
424     trackCuts = CreateTrackCutsPWGJE(10011006);
425   }
426   if(trackType==7 && cuts==5) {
427     // tight global tracks  + NCrossedRowsCut>70 recommended in 2011
428     trackCuts = CreateTrackCutsPWGJE(10011008);
429   }
430   if(trackType==7 && cuts==2) {
431     // no requirements on SPD and ITSrefit failed
432     trackCuts = CreateTrackCutsPWGJE(10041006);       //no ITSrefit requirement filter 256
433     trackCutsReject = CreateTrackCutsPWGJE(10001006); //ITSrefit requirement filter 16
434     trackCutsReject->SetEtaRange(-0.9,0.9);
435     trackCutsReject->SetPtRange(0.15, 1e10);
436   }
437   if(trackType==7 && cuts==6) {
438     // no requirements on SPD and ITSrefit failed
439     trackCuts = CreateTrackCutsPWGJE(10041008);       //no ITSrefit requirement filter 256
440     trackCutsReject = CreateTrackCutsPWGJE(10001008); //ITSrefit requirement filter 16
441     trackCutsReject->SetEtaRange(-0.9,0.9);
442     trackCutsReject->SetPtRange(0.15, 1e10);
443   }
444
445   if(trackType==1 && cuts==0) {
446     //Set track cuts for TPConly tracks
447     trackCuts = CreateTrackCutsPWGJE(2001);
448   }
449   if(trackType==1 && cuts==1) {
450     //Set track cuts for TPConly tracks
451     trackCuts = CreateTrackCutsPWGJE(10032001);
452   }
453
454   if(trackType==2 && cuts==0) {
455     //Set track cuts for TPConly constrained tracks
456     trackCuts = CreateTrackCutsPWGJE(2001);
457   }
458   if(trackType==2 && cuts==1) {
459     //Set track cuts for TPConly constrained tracks w/o cut on NClusters or NCrossedRows
460     trackCuts = CreateTrackCutsPWGJE(10032001);
461   }
462
463   if(trackType==4 && cuts==0) {
464      //       Set track cuts for TPConly constrained tracks
465     trackCuts = CreateTrackCutsPWGJE(2001);
466   }
467   if(trackType==4 && cuts==1) {
468      //       Set track cuts for TPConly constrained tracks
469     trackCuts = CreateTrackCutsPWGJE(10032001);
470   }
471   if(trackType==5 || trackType==6) {
472     // tight global tracks
473     trackCuts = CreateTrackCutsPWGJE(1003);
474     trackCutsReject = CreateTrackCutsPWGJE(10021003); 
475     trackCutsTPConly = CreateTrackCutsPWGJE(2002);
476
477     trackCutsReject->SetEtaRange(-0.9,0.9);
478     trackCutsReject->SetPtRange(0.15, 1e10);
479     
480     trackCutsTPConly->SetEtaRange(-0.9,0.9);
481     trackCutsTPConly->SetPtRange(0.15, 1e10);
482   }
483
484   trackCuts->SetEtaRange(-0.9,0.9);
485   trackCuts->SetPtRange(0.15, 1e10);
486   
487   TString trigName = "";
488   if (iPhysicsSelectionFlag == AliVEvent::kAnyINT)
489     trigName += "kAnyINT";
490   else if (iPhysicsSelectionFlag == AliVEvent::kAny)
491     trigName += "kAny";
492   else if(iPhysicsSelectionFlag == AliVEvent::kINT7)
493     trigName += "kINT7";
494   else if(iPhysicsSelectionFlag == AliVEvent::kINT8)
495     trigName += "kINT8";
496   else if(iPhysicsSelectionFlag == AliVEvent::kMB)
497     trigName += "kMB";
498   else if(iPhysicsSelectionFlag == AliVEvent::kCentral)
499     trigName += "kCentral";
500   else if(iPhysicsSelectionFlag == AliVEvent::kSemiCentral)
501     trigName += "kSemiCentral";
502   else if(iPhysicsSelectionFlag == AliVEvent::kEMC7)
503     trigName += "kEMC7";
504   else if(iPhysicsSelectionFlag == AliVEvent::kEMCEJE)
505     trigName += "kEMCEJE";
506   else if(iPhysicsSelectionFlag == AliVEvent::kEMCEGA)
507     trigName += "kEMCEGA";
508
509
510   //Create the task
511   AliPWG4HighPtTrackQA *taskPWG4TrackQA = new AliPWG4HighPtTrackQA(Form("AliPWG4HighPtTrackQACent%dTrack%dCuts%d%s",centClass,trackType,cuts,trigName.Data()));
512   taskPWG4TrackQA->SetTrackType(trackType);
513   taskPWG4TrackQA->SetCuts(trackCuts);
514   taskPWG4TrackQA->SetCutsITSLoose(trackCutsReject);
515   taskPWG4TrackQA->SetCutsTPConly(trackCutsTPConly);
516   taskPWG4TrackQA->SetPtMax(100.);
517  
518   if(iAODanalysis)
519     taskPWG4TrackQA->SetDataType(AliPWG4HighPtTrackQA::kAOD);
520   else
521     taskPWG4TrackQA->SetDataType(AliPWG4HighPtTrackQA::kESD);
522
523   if(isPbPb) {
524     taskPWG4TrackQA->SetIsPbPb(kTRUE);
525     taskPWG4TrackQA->SetCentralityClass(centClass);
526   }
527   taskPWG4TrackQA->SelectCollisionCandidates(iPhysicsSelectionFlag);
528
529   // E. Create ONLY the output containers for the data produced by the task.
530   // Get and connect other common input/output containers via the manager as below
531   //==============================================================================
532   TString outputfile = AliAnalysisManager::GetCommonFileName();
533   outputfile += Form(":PWG4_HighPtTrackQACent%dTrackType%dCuts%d%s",centClass,trackType,cuts,trigName.Data());
534
535   AliAnalysisDataContainer *cout_histQAtrack = 0x0;
536   TString contName = Form("qa_histsQAtrackCent%dType%dcuts%d%s",centClass,trackType,cuts,trigName.Data());
537   cout_histQAtrack = mgr->CreateContainer(contName.Data(), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile);
538
539   mgr->AddTask(taskPWG4TrackQA);
540   mgr->ConnectInput(taskPWG4TrackQA,0,mgr->GetCommonInputContainer());
541   mgr->ConnectOutput(taskPWG4TrackQA,1,cout_histQAtrack);
542
543   // Return task pointer at the end
544   return taskPWG4TrackQA;
545 }