22 #include "Riostream.h"
30 #include "TProfile2D.h"
35 #include "AliMultSelection.h"
36 #include "AliVVertex.h"
38 #include "AliAnalysisManager.h"
44 #include "AliAnalysisManager.h"
45 #include "AliInputEventHandler.h"
46 #include "AliVEvent.h"
48 #include "AliESDEvent.h"
49 #include "AliESDHeader.h"
50 #include "AliESDInputHandler.h"
51 #include "AliESDZDC.h"
52 #include "AliMultiplicity.h"
53 #include "AliAnalysisUtils.h"
54 #include "AliAODHandler.h"
55 #include "AliAODTrack.h"
56 #include "AliAODEvent.h"
57 #include "AliAODHeader.h"
58 #include "AliAODVertex.h"
59 #include "AliAODVZERO.h"
60 #include "AliAODZDC.h"
61 #include "AliAODMCHeader.h"
62 #include "AliMCEventHandler.h"
63 #include "AliMCEvent.h"
64 #include "AliHeader.h"
65 #include "AliVParticle.h"
67 #include "AliAODMCParticle.h"
68 #include "AliAnalysisTaskSE.h"
69 #include "AliGenEventHeader.h"
70 #include "AliPhysicsSelectionTask.h"
71 #include "AliPhysicsSelection.h"
72 #include "AliBackgroundSelection.h"
73 #include "AliTriggerAnalysis.h"
74 #include "AliCentrality.h"
89 fUsePhiWeights(usePhiWeights),
92 fApplyCorrectionForNUA(kFALSE),
94 fNormalizationType(1),
99 fHist_Vertex_XY(NULL),
100 fHist_Vx_vs_runnum(NULL),
101 fHist_Vy_vs_runnum(NULL),
102 fHist_Vz_vs_runnum(NULL),
103 fHist_tracks_vs_runnum(NULL),
104 fHist_Vx_ArrayFinder(NULL),
105 fHist_Vy_ArrayFinder(NULL),
106 fHist_Vz_ArrayFinder(NULL),
107 fHist_Vertex_Vz(NULL),
108 fHist_Event_count(NULL),
109 fHist_Cent_count1(NULL),
110 fHist_Cent_count2(NULL),
111 fHist_EventperRun(NULL),
112 fHist_Psi1_zdnA(NULL),
113 fHist_Psi1_zdnC(NULL),
114 fHist_Psi1_zdnA_after1(NULL),
115 fHist_Psi1_zdnC_after1(NULL),
116 fHist_Psi1_zdnA_after2(NULL),
117 fHist_Psi1_zdnC_after2(NULL),
118 fHist_vBincount(NULL),
122 fPileUpMultSelCount(NULL),
124 fMultSelection(NULL),
126 fHist_v2xV1_ZDN_Norm_cosXX(NULL),
127 fHist_v2xV1_ZDN_Refm_cosXX(NULL),
128 fHist_v2xV1_ZDN_Cent_cosXX(NULL),
129 fHist_v2xV1_ZDN_Norm_cosYY(NULL),
130 fHist_v2xV1_ZDN_Refm_cosYY(NULL),
131 fHist_v2xV1_ZDN_Cent_cosYY(NULL),
132 fHist_v2xV1_ZDN_Norm_sinXY(NULL),
133 fHist_v2xV1_ZDN_Refm_sinXY(NULL),
134 fHist_v2xV1_ZDN_Cent_sinXY(NULL),
135 fHist_v2xV1_ZDN_Norm_sinYX(NULL),
136 fHist_v2xV1_ZDN_Refm_sinYX(NULL),
137 fHist_v2xV1_ZDN_Cent_sinYX(NULL),
138 fHist_v2xV1_ZDN_Norm_All(NULL),
139 fHist_v2xV1_ZDN_Refm_All(NULL),
140 fHist_v2xV1_ZDN_Cent_All(NULL),
141 fHist_ZDN_resol_Norm_All(NULL),
142 fHist_ZDN_resol_Cent_All(NULL),
143 fHist_ZDN_resol_Refm_All(NULL),
144 fHist_ZDN_resol_Norm_cos(NULL),
145 fHist_ZDN_resol_Refm_cos(NULL),
146 fHist_ZDN_resol_Cent_cos(NULL),
147 fHist_ZDN_resol_Norm_sin(NULL),
148 fHist_ZDN_resol_Refm_sin(NULL),
149 fHist_ZDN_resol_Cent_sin(NULL),
150 fHist_ZDCn_A_XYvsRun(NULL),
151 fHist_ZDCn_C_XYvsRun(NULL),
152 fAvg_Cent_vs_Vz_Cent_woCut(NULL),
153 fAvg_Cent_vs_Vz_Peri_woCut(NULL),
154 fAvg_Cent_vs_Vx_Cent_woCut(NULL),
155 fAvg_Cent_vs_Vx_Peri_woCut(NULL),
156 fAvg_Cent_vs_Vy_Cent_woCut(NULL),
157 fAvg_Cent_vs_Vy_Peri_woCut(NULL),
158 fAvg_Cent_vs_Vz_Cent_wCuts(NULL),
159 fAvg_Cent_vs_Vz_Peri_wCuts(NULL),
160 fAvg_Cent_vs_Vx_Cent_wCuts(NULL),
161 fAvg_Cent_vs_Vx_Peri_wCuts(NULL),
162 fAvg_Cent_vs_Vy_Cent_wCuts(NULL),
163 fAvg_Cent_vs_Vy_Peri_wCuts(NULL),
164 fTPCV0M_CentDiff_vs_Vz(NULL),
165 fTPCV0M_CentDiff_vs_Vx(NULL),
166 fTPCV0M_CentDiff_vs_Vy(NULL),
168 fCent_fromDATA(NULL),
169 fRejectPileUpTight(kFALSE),
170 fRejectPileUp(kFALSE),
176 for(
int i=0;i<90;i++)
179 for(
int i=0;i<90;i++){
180 for(
int j=0;j<10;j++){
181 fHist_znCx_V0_VxVy[i][j] = NULL;
182 fHist_znCy_V0_VxVy[i][j] = NULL;
183 fHist_znAx_V0_VxVy[i][j] = NULL;
184 fHist_znAy_V0_VxVy[i][j] = NULL;
186 fHist_ZDCA_En_Run[i] = NULL;
187 fHist_ZDCC_En_Run[i] = NULL;
197 for(
int i=0;i<4;i++){
198 for(
int j=0;j<5;j++){
199 fHist_X_vs_Obs_before[i][j] = NULL;
200 fHist_X_vs_Obs_after1[i][j] = NULL;
201 fHist_XX_vs_Obs_before[i][j] = NULL;
202 fHist_XX_vs_Obs_after1[i][j] = NULL;
206 for(
int i=0;i<10;i++){
207 fFB_Efficiency_Cent[i] = NULL;
211 DefineInput(1, AliFlowEventSimple::Class());
212 DefineOutput(1,TList::Class());
213 DefineOutput(2,TList::Class());
216 fAnalysisSet=
"recenter1";
218 fTotalQvector =
new TString(
"QaQb");
220 cout<<
"AliAnalysisTaskVnZDC::Constructor is called..!! fAnalysisSet = "<<fAnalysisSet.Data()<<endl;
229 fMinimalBook(kFALSE),
230 fUsePhiWeights(kFALSE),
233 fApplyCorrectionForNUA(kFALSE),
235 fNormalizationType(1),
240 fHist_Vertex_XY(NULL),
241 fHist_Vx_vs_runnum(NULL),
242 fHist_Vy_vs_runnum(NULL),
243 fHist_Vz_vs_runnum(NULL),
244 fHist_tracks_vs_runnum(NULL),
245 fHist_Vx_ArrayFinder(NULL),
246 fHist_Vy_ArrayFinder(NULL),
247 fHist_Vz_ArrayFinder(NULL),
248 fHist_Vertex_Vz(NULL),
249 fHist_Event_count(NULL),
250 fHist_Cent_count1(NULL),
251 fHist_Cent_count2(NULL),
252 fHist_EventperRun(NULL),
253 fHist_Psi1_zdnA(NULL),
254 fHist_Psi1_zdnC(NULL),
255 fHist_Psi1_zdnA_after1(NULL),
256 fHist_Psi1_zdnC_after1(NULL),
257 fHist_Psi1_zdnA_after2(NULL),
258 fHist_Psi1_zdnC_after2(NULL),
259 fHist_vBincount(NULL),
263 fPileUpMultSelCount(NULL),
265 fMultSelection(NULL),
267 fHist_v2xV1_ZDN_Norm_cosXX(NULL),
268 fHist_v2xV1_ZDN_Refm_cosXX(NULL),
269 fHist_v2xV1_ZDN_Cent_cosXX(NULL),
270 fHist_v2xV1_ZDN_Norm_cosYY(NULL),
271 fHist_v2xV1_ZDN_Refm_cosYY(NULL),
272 fHist_v2xV1_ZDN_Cent_cosYY(NULL),
273 fHist_v2xV1_ZDN_Norm_sinXY(NULL),
274 fHist_v2xV1_ZDN_Refm_sinXY(NULL),
275 fHist_v2xV1_ZDN_Cent_sinXY(NULL),
276 fHist_v2xV1_ZDN_Norm_sinYX(NULL),
277 fHist_v2xV1_ZDN_Refm_sinYX(NULL),
278 fHist_v2xV1_ZDN_Cent_sinYX(NULL),
279 fHist_ZDN_resol_Norm_cos(NULL),
280 fHist_ZDN_resol_Refm_cos(NULL),
281 fHist_ZDN_resol_Cent_cos(NULL),
282 fHist_ZDN_resol_Norm_sin(NULL),
283 fHist_ZDN_resol_Refm_sin(NULL),
284 fHist_ZDN_resol_Cent_sin(NULL),
285 fHist_v2xV1_ZDN_Norm_All(NULL),
286 fHist_v2xV1_ZDN_Refm_All(NULL),
287 fHist_v2xV1_ZDN_Cent_All(NULL),
288 fHist_ZDN_resol_Norm_All(NULL),
289 fHist_ZDN_resol_Cent_All(NULL),
290 fHist_ZDN_resol_Refm_All(NULL),
291 fHist_ZDCn_A_XYvsRun(NULL),
292 fHist_ZDCn_C_XYvsRun(NULL),
293 fAvg_Cent_vs_Vz_Cent_woCut(NULL),
294 fAvg_Cent_vs_Vz_Peri_woCut(NULL),
295 fAvg_Cent_vs_Vx_Cent_woCut(NULL),
296 fAvg_Cent_vs_Vx_Peri_woCut(NULL),
297 fAvg_Cent_vs_Vy_Cent_woCut(NULL),
298 fAvg_Cent_vs_Vy_Peri_woCut(NULL),
299 fAvg_Cent_vs_Vz_Cent_wCuts(NULL),
300 fAvg_Cent_vs_Vz_Peri_wCuts(NULL),
301 fAvg_Cent_vs_Vx_Cent_wCuts(NULL),
302 fAvg_Cent_vs_Vx_Peri_wCuts(NULL),
303 fAvg_Cent_vs_Vy_Cent_wCuts(NULL),
304 fAvg_Cent_vs_Vy_Peri_wCuts(NULL),
305 fTPCV0M_CentDiff_vs_Vz(NULL),
306 fTPCV0M_CentDiff_vs_Vx(NULL),
307 fTPCV0M_CentDiff_vs_Vy(NULL),
309 fCent_fromDATA(NULL),
310 fRejectPileUpTight(kFALSE),
311 fRejectPileUp(kFALSE),
317 for(
int i=0;i<90;i++)
320 for(
int i=0;i<90;i++){
321 for(
int j=0;j<10;j++){
338 for(
int i=0;i<4;i++){
339 for(
int j=0;j<5;j++){
347 for(
int i=0;i<10;i++){
379 for(
int i=0;i<90;i++){
380 for(
int j=0;j<10;j++){
392 for(
int i=0;i<10;i++){
402 printf(
"\n\n ~AliAnalysisTaskVnZDC::Destructor is called..!!\n\n");
412 Int_t runArray_2010[89] = {139510, 139507, 139505, 139503, 139465, 139438, 139437, 139360, 139329, 139328, 139314, 139310, 139309, 139173, 139107, 139105, 139038, 139037, 139036, 139029, 139028, 138872, 138871, 138870, 138837, 138732, 138730, 138666, 138662, 138653, 138652, 138638, 138624, 138621, 138583, 138582, 138579, 138578, 138534, 138469, 138442, 138439, 138438, 138396, 138364, 138275, 138225, 138201, 138197, 138192, 138190, 137848, 137844, 137752, 137751, 137724, 137722, 137718, 137704, 137693, 137692, 137691, 137686, 137685, 137639, 137638, 137608, 137595, 137549, 137546, 137544, 137541, 137539, 137531, 137530, 137443, 137441, 137440, 137439, 137434, 137432, 137431, 137243, 137236, 137235, 137232, 137231, 137162, 137161};
414 Int_t runArray_2011[68] = {167915, 168115, 168460, 169035, 169238, 169859, 170228, 167920, 168310, 168464, 169091, 169411, 169923, 170230, 167985, 168311, 168467, 169094, 169415, 170027, 170268, 167987, 168322, 168511, 169138, 169417, 170081, 170269, 167988, 168325, 168512, 169144, 169835, 170155, 170270, 168069, 168341, 168514, 169145, 169837, 170159, 170306, 168076, 168342, 168777, 169148, 169838, 170163, 170308, 168105, 168361, 168826, 169156, 169846, 170193, 170309, 168107, 168362, 168988, 169160, 169855, 170203, 168108, 168458, 168992, 169167, 169858, 170204};
416 Int_t runArray_2015[90] = {246994, 246991, 246989, 246984, 246982, 246980, 246948, 246945, 246928, 246871, 246870, 246867, 246865, 246864, 246859, 246858, 246851, 246847, 246846, 246845, 246844, 246810, 246809, 246808, 246807, 246805, 246804, 246766, 246765, 246763, 246760, 246759, 246758, 246757, 246751, 246750, 246676, 246675, 246540, 246495, 246493, 246488, 246487, 246434, 246431, 246428, 246424, 246276, 246275, 246272, 246271, 246225, 246222, 246217, 246185, 246182, 246181, 246180, 246178, 246153, 246152, 246151, 246148, 246115, 246113, 246089, 246087, 246053, 246052, 246049, 246048, 246042, 246037, 246036, 246012, 246003, 246001, 245963, 245954, 245952, 245949, 245923, 245833, 245831, 245829, 245705, 245702, 245700, 245692, 245683};
452 fHist_Psi1_zdnA =
new TH1F(
"fHist_Psi1_zdnA",
"", 200, 0,2.*TMath::Pi());
454 fHist_Psi1_zdnC =
new TH1F(
"fHist_Psi1_zdnC",
"", 200, 0,2.*TMath::Pi());
466 fHist_Vertex_Vz =
new TH1F(
"fHist_Vertex_Vz_dist",
"Vertex Z Distribution",200, -15, 15);
468 fHist_Vertex_XY =
new TH2F(
"fHist_Vertex_XY_dist",
"Vertex XY Distributn.",100,-0.2,0.2,100,0.0,0.4);
481 fHist_ZDCn_A_XYvsRun =
new TH3F(
"fHist_ZDCn_A_XYvsRun",
"ZDC XY vs run",80,-2.0,2.0,80,-2.0,2.0,89,0,89);
483 fHist_ZDCn_C_XYvsRun =
new TH3F(
"fHist_ZDCn_C_XYvsRun",
"ZDC XY vs run",80,-2.0,2.0,80,-2.0,2.0,89,0,89);
487 Double_t centRange[12] = {0,5,10,20,30,40,50,60,70,80,90,100};
489 fPileUpCount =
new TH1F(
"fPileUpCount",
"fPileUpCount", 9, 0., 9.);
492 fPileUpCount->GetXaxis()->SetBinLabel(3,
"RefMultiplicityComb08");
493 fPileUpCount->GetXaxis()->SetBinLabel(4,
"IncompleteDAQ");
494 fPileUpCount->GetXaxis()->SetBinLabel(5,
"abs(V0M-CL1)>7.5");
496 fPileUpCount->GetXaxis()->SetBinLabel(7,
"inconsistentVtx");
497 fPileUpCount->GetXaxis()->SetBinLabel(8,
"multESDTPCDif");
498 fPileUpCount->GetXaxis()->SetBinLabel(9,
"extraPileUpMultSel");
547 AliDebug(2,
"\n\n !!** WARNING ***!! \n cuts not defined for DATASET: %s\n ...EXIT...\n\n)");
564 TString sNameQn[4] = {
"Xa",
"Xc",
"Ya",
"Yc"};
565 TString sNameQn2[4] = {
"XaXc",
"YaYc",
"XcYa",
"YcXa"};
566 TString sNameVs[5] = {
"Cent",
"Mult",
"Vx",
"Vy",
"Vz"};
567 Int_t nBinNumVs[5] = {100, 500, 40, 40,400};
568 Double_t lBinLowVs[5] = { 0, 0,-0.1,0.1,-10};
569 Double_t lBinHighVs[5] = {100,2000, 0.1,0.3, 10};
574 for(
int i=0;i<4;i++) {
575 for(
int j=0;j<5;j++) {
577 sprintf(name,
"fHist_%s_vs_%s_before",static_cast<const char*>(sNameQn[i]),static_cast<const char*>(sNameVs[j]));
581 sprintf(name,
"fHist_%s_vs_%s_after1",static_cast<const char*>(sNameQn[i]),static_cast<const char*>(sNameVs[j]));
585 sprintf(name,
"fHist_%s_vs_%s_before",static_cast<const char*>(sNameQn2[i]),static_cast<const char*>(sNameVs[j]));
589 sprintf(name,
"fHist_%s_vs_%s_after1",static_cast<const char*>(sNameQn2[i]),static_cast<const char*>(sNameVs[j]));
595 Double_t centRange[12] = {0,5,10,20,30,40,50,60,70,80,90,100};
685 AliDebug(2,
"\n\n ******** Running without Centrality weight !!******** \n\n");
686 fCent_fromDATA =
new TH1F(
"fCent_fromDATA",
"Centrality distribution",100,0,100);
687 for(
int i=1;i<=100;i++){
698 if(maxCount < Content){
704 fWeight_Cent =
new TH1F(
"fWeight_Cent",
"Weight for centrality",100,0,100);
710 weight = maxCount/Content;
711 if(weight>1e9)
continue;
724 printf(
"\n\n !!** Warning ***!! \n TList FilterBit efficiency not found !!\n\n");
730 for(
int i=0;i<10;i++) {
737 for(
int i=0;i<10;i++){
739 for(
int j=1;j<=100;j++){
748 printf(
"\n\n !!** ERROR ***!! \n \n TList fZDCESEList not found !!\n .......EXIT...... \n\n)");
753 for(
int j=0;j<10;j++){
759 printf(
"\n\n !!** WARNING *** One/more Recenter1 histograms NOT FOUND\n ...........!! \n\n");
767 printf(
"\n\n ******** Running without Recentering 1 !!******** \n\n");
769 for(
int j=0;j<10;j++){
770 fHist_znCx_V0_VxVy[i][j] =
new TProfile2D(Form(
"fHist_znCx_V0_Run%d_Vz%d",
runNums[i],j+1),
"",NbinVt,0,NbinVt,90,0,90,
"");
771 fHist_znCy_V0_VxVy[i][j] =
new TProfile2D(Form(
"fHist_znCy_V0_Run%d_Vz%d",
runNums[i],j+1),
"",NbinVt,0,NbinVt,90,0,90,
"");
772 fHist_znAx_V0_VxVy[i][j] =
new TProfile2D(Form(
"fHist_znAx_V0_Run%d_Vz%d",
runNums[i],j+1),
"",NbinVt,0,NbinVt,90,0,90,
"");
773 fHist_znAy_V0_VxVy[i][j] =
new TProfile2D(Form(
"fHist_znAy_V0_Run%d_Vz%d",
runNums[i],j+1),
"",NbinVt,0,NbinVt,90,0,90,
"");
830 for(
int j=0;j<10;j++){
831 fHist_znCx_V0_VxVy[i][j] =
new TProfile2D(Form(
"fHist_znCx_V0_Run%d_Vz%d",
runNums[i],j+1),
"",NbinVt,0,NbinVt,90,0,90,
"");
832 fHist_znCy_V0_VxVy[i][j] =
new TProfile2D(Form(
"fHist_znCy_V0_Run%d_Vz%d",
runNums[i],j+1),
"",NbinVt,0,NbinVt,90,0,90,
"");
833 fHist_znAx_V0_VxVy[i][j] =
new TProfile2D(Form(
"fHist_znAx_V0_Run%d_Vz%d",
runNums[i],j+1),
"",NbinVt,0,NbinVt,90,0,90,
"");
834 fHist_znAy_V0_VxVy[i][j] =
new TProfile2D(Form(
"fHist_znAy_V0_Run%d_Vz%d",
runNums[i],j+1),
"",NbinVt,0,NbinVt,90,0,90,
"");
841 for(
int j=0;j<10;j++) {
874 printf(
"\n\n::UserCreateOutPutObject(). NbinVt= %d, frunflag= %d, dataset: %s, Analysis= %s\n\n",NbinVt,
frunflag,
fDataSet.Data(),
fAnalysisSet.Data());
897 printf(
"\n ... ::UserExec no aod found..... \n");
905 AliAODVertex *pVertex = aod->GetPrimaryVertex();
907 Vxyz[0] = pVertex->GetX();
908 Vxyz[1] = pVertex->GetY();
909 Vxyz[2] = pVertex->GetZ();
913 if(Vxyz[2] >=
VzCut[1] || Vxyz[2] <=
VzCut[0])
return;
917 if(Vxyz[0] >=
VxCut[1] || Vxyz[0] <=
VxCut[0])
return;
921 if(Vxyz[1] >=
VyCut[1] || Vxyz[1] <=
VyCut[0])
return;
931 Int_t runNumber = aod->GetRunNumber();
932 Int_t runindex = -111;
942 AliDebug(2,
"\n ::UserExec Runnumber is not listed ..... \n");
953 centrV0M = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile(
"V0M");
954 centrCL1 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile(
"CL1");
955 centrCL0 = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile(
"CL0");
956 centrTRK = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP()->GetCentralityPercentile(
"TRK");
960 fMultSelection = (AliMultSelection*) InputEvent()->FindListObject(
"MultSelection");
963 AliDebug(2,Form(
"\n **WARNING** ::UserExec() AliMultSelection object not found. Step# %d\n",stepCount));
983 Int_t isPileup = aod->IsPileupFromSPD(3);
988 if(((AliAODHeader*)aod->GetHeader())->GetRefMultiplicityComb08() < 0) {
992 if(aod->IsIncompleteDAQ()) {
998 const AliAODVertex* vtTrc = aod->GetPrimaryVertex();
999 const AliAODVertex* vtSPD = aod->GetPrimaryVertexSPD();
1001 if(vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
1006 double covTrc[6], covSPD[6];
1007 vtTrc->GetCovarianceMatrix(covTrc);
1008 vtSPD->GetCovarianceMatrix(covSPD);
1010 double dz = vtTrc->GetZ() - vtSPD->GetZ();
1012 double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
1013 double errTrc = TMath::Sqrt(covTrc[5]);
1014 double nsigTot = dz/errTot;
1015 double nsigTrc = dz/errTrc;
1017 if(TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
1054 Int_t isPileup = aod->IsPileupFromSPD(3);
1060 if(((AliAODHeader*)aod->GetHeader())->GetRefMultiplicityComb08() < 0) {
1065 if(aod->IsIncompleteDAQ()) {
1070 if(fabs(centrV0M-centrCL1)>7.5) {
1076 const AliAODVertex* vtTrc = aod->GetPrimaryVertex();
1077 const AliAODVertex* vtSPD = aod->GetPrimaryVertexSPD();
1079 if (vtTrc->GetNContributors() < 2 || vtSPD->GetNContributors()<1) {
1084 double covTrc[6], covSPD[6];
1085 vtTrc->GetCovarianceMatrix(covTrc);
1086 vtSPD->GetCovarianceMatrix(covSPD);
1088 double dz = vtTrc->GetZ() - vtSPD->GetZ();
1090 double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
1091 double errTrc = TMath::Sqrt(covTrc[5]);
1092 double nsigTot = dz/errTot;
1093 double nsigTrc = dz/errTrc;
1095 if(TMath::Abs(dz)>0.2 || TMath::Abs(nsigTot)>10 || TMath::Abs(nsigTrc)>20) {
1101 const Int_t nTracks = aod->GetNumberOfTracks();
1102 Int_t multEsd = ((AliAODHeader*)aod->GetHeader())->GetNumberOfESDTracks();
1105 Int_t multTrkBefC = 0;
1106 Int_t multTrkTOFBefC = 0;
1109 for(
Int_t it = 0; it < nTracks; it++) {
1110 AliAODTrack* aodTrk = (AliAODTrack*)aod->GetTrack(it);
1122 if(aodTrk->TestFilterBit(128))
1128 Double_t multESDTPCDif = multEsdn - multTPCn*3.38;
1136 if(BisPileup==kFALSE) {
1138 if(!
fMultSelection->GetThisEventIsNotPileupMV()) BisPileup=kTRUE;
1139 if(!
fMultSelection->GetThisEventIsNotPileupInMultBins()) BisPileup=kTRUE;
1140 if(!
fMultSelection->GetThisEventHasNoInconsistentVertices()) BisPileup=kTRUE;
1141 if(!
fMultSelection->GetThisEventPassesTrackletVsCluster()) BisPileup=kTRUE;
1142 if(!
fMultSelection->GetThisEventIsNotIncompleteDAQ()) BisPileup=kTRUE;
1143 if(!
fMultSelection->GetThisEventHasGoodVertex2016()) BisPileup=kTRUE;
1155 AliDebug(2,Form(
"\n ::UserExec Pileup event found, skipping.\n Dataset: %s \n",
fDataSet.Data()));
1180 AliAODZDC *aodZDC = aod->GetZDCData();
1181 Float_t fZDCGainAlpha = 0.500;
1189 const Double_t * towZNC = aodZDC->GetZNCTowerEnergy();
1190 const Double_t * towZPC = aodZDC->GetZPCTowerEnergy();
1191 const Double_t * towZNA = aodZDC->GetZNATowerEnergy();
1192 const Double_t * towZPA = aodZDC->GetZPATowerEnergy();
1194 const Double_t * towZNClg = aodZDC->GetZNCTowerEnergyLR();
1195 const Double_t * towZNAlg = aodZDC->GetZNATowerEnergyLR();
1200 for(
Int_t it=0; it<5; it++) {
1201 towZPClg[it] = 8*towZPC[it];
1202 towZPAlg[it] = 8*towZNA[it];
1206 if(towZNC[1]<0 || towZNC[2]<0 || towZNC[3]<0 || towZNC[4]<0)
return;
1210 if(towZNA[1]<0 || towZNA[2]<0 || towZNA[3]<0 || towZNA[4]<0)
return;
1215 for(
Int_t it=0; it<5; it++) {
1226 Float_t zncEnergy=0., znaEnergy=0.;
1228 for(
Int_t i=0; i<5; i++){
1229 zncEnergy += towZNC[i];
1230 znaEnergy += towZNA[i];
1234 Double_t AvTowerGain[8] = {1., 1., 1., 1., 1., 1., 1., 1.};
1267 const Float_t x[4] = {-1.75, 1.75,-1.75, 1.75};
1268 const Float_t y[4] = {-1.75, -1.75, 1.75, 1.75};
1270 Float_t numXZNC=0., numYZNC=0., denZNC=0., wZNC;
1271 Float_t numXZNA=0., numYZNA=0., denZNA=0., wZNA;
1273 for(
Int_t i=0; i<4; i++)
1277 wZNC = TMath::Power(towZNC[i+1], fZDCGainAlpha)*AvTowerGain[i];
1278 numXZNC += x[i]*wZNC;
1279 numYZNC += y[i]*wZNC;
1283 if(towZNA[i+1]>0.) {
1284 wZNA = TMath::Power(towZNA[i+1], fZDCGainAlpha)*AvTowerGain[i+4];
1285 numXZNA += x[i]*wZNA;
1286 numYZNA += y[i]*wZNA;
1292 xyZNC[0] = numXZNC/denZNC;
1293 xyZNC[1] = numYZNC/denZNC;
1301 xyZNA[0] = numXZNA/denZNA;
1302 xyZNA[1] = numYZNA/denZNA;
1312 xyZNA[0] = -1.*xyZNA[0];
1316 if(sqrt(xyZNC[0]*xyZNC[0] + xyZNC[1]*xyZNC[1])>1.5)
return;
1320 if(sqrt(xyZNA[0]*xyZNA[0] + xyZNA[1]*xyZNA[1])>1.5)
return;
1342 if(EvtCent<5.0){ cIndex = 0;}
1343 else if(EvtCent>=5.0 && EvtCent<10){
1347 cIndex = abs(EvtCent/10.0) + 1;
1355 for(
Int_t i=0; i<iTracks; i++)
1358 if (!pTrack)
continue;
1359 dPhi = pTrack->
Phi();
1360 dPt = pTrack-> Pt();
1361 dEta = pTrack->
Eta();
1363 if(fabs(dEta)>0.8)
continue;
1364 if(dPt<0.15 || dPt>10.0)
continue;
1366 if(dPt<0.20)
continue;
1372 Qnx_TPC[0] += TMath::Cos(2.*dPhi)*pTwgt;
1373 Qny_TPC[0] += TMath::Sin(2.*dPhi)*pTwgt;
1382 dUx = Qnx_TPC[0]/npoiMult;
1383 dUy = Qny_TPC[0]/npoiMult;
1413 Int_t nTracks = aod->GetNumberOfTracks();
1426 psi2 = TMath::ATan2(xyZNC[1],xyZNC[0]);
1427 if(psi2<0) psi2 += 2.*TMath::Pi();
1430 psi2 = TMath::ATan2(xyZNA[1],xyZNA[0]);
1431 if(psi2<0) psi2 += 2.*TMath::Pi();
1450 Int_t tVertexBin2 = (indexVy-1)*
vxBin + indexVx;
1451 Int_t tCentBin = abs(EvtCent) + 1;
1467 Double_t FillVsWith[5] = {EvtCent,
static_cast<Double_t>(nRefMult), Vxyz[0], Vxyz[1], Vxyz[2]};
1468 Double_t FillValue1[4] = {xyZNA[0],xyZNC[0],xyZNA[1],xyZNC[1]};
1469 Double_t FillValue11[4] = {xyZNA[0]*xyZNC[0],xyZNA[1]*xyZNC[1],xyZNC[0]*xyZNA[1],xyZNC[1]*xyZNA[0]};
1472 for(
int i=0;i<4;i++){
1473 for(
int j=0;j<5;j++){
1479 meanCx[0] =
fHist_znCx_V0_VxVy[runindex][indexVz-1]->GetBinContent(tVertexBin2,tCentBin);
1480 meanCy[0] =
fHist_znCy_V0_VxVy[runindex][indexVz-1]->GetBinContent(tVertexBin2,tCentBin);
1481 meanAx[0] =
fHist_znAx_V0_VxVy[runindex][indexVz-1]->GetBinContent(tVertexBin2,tCentBin);
1482 meanAy[0] =
fHist_znAy_V0_VxVy[runindex][indexVz-1]->GetBinContent(tVertexBin2,tCentBin);
1488 xyZNC[0] = xyZNC[0] - meanCx[0];
1489 xyZNC[1] = xyZNC[1] - meanCy[0];
1490 xyZNA[0] = xyZNA[0] - meanAx[0];
1491 xyZNA[1] = xyZNA[1] - meanAy[0];
1493 Double_t FillValue2[4] = {xyZNA[0],xyZNC[0],xyZNA[1],xyZNC[1]};
1494 Double_t FillValue21[4] = {xyZNA[0]*xyZNC[0],xyZNA[1]*xyZNC[1],xyZNC[0]*xyZNA[1],xyZNC[1]*xyZNA[0]};
1497 for(
int i=0;i<4;i++){
1498 for(
int j=0;j<5;j++){
1504 psi2 = TMath::ATan2(xyZNC[1],xyZNC[0]);
1505 if(psi2<0) psi2 += 2.*TMath::Pi();
1508 psi2 = TMath::ATan2(xyZNA[1],xyZNA[0]);
1509 if(psi2<0) psi2 += 2.*TMath::Pi();
1537 Double_t fullTerm = dUx*xyZNA[0]*xyZNC[0]-dUx*xyZNA[1]*xyZNC[1]+dUy*xyZNA[0]*xyZNC[1]+dUy*xyZNA[1]*xyZNC[0];
1538 Double_t fullReso = xyZNA[0]*xyZNC[0]+xyZNA[1]*xyZNC[1];
1593 AliDebug(2,
"\n ... AliAnalysisTaskVnZDC::Terminate() is being called ... \n");
1601 AliDebug(2,
"\n\n ::GetWDist => One of vertices is not valid\n\n");
1604 static TMatrixDSym vVb(3);
1606 double dx = v0->GetX()-v1->GetX();
1607 double dy = v0->GetY()-v1->GetY();
1608 double dz = v0->GetZ()-v1->GetZ();
1609 double cov0[6],cov1[6];
1610 v0->GetCovarianceMatrix(cov0);
1611 v1->GetCovarianceMatrix(cov1);
1612 vVb(0,0) = cov0[0]+cov1[0];
1613 vVb(1,1) = cov0[2]+cov1[2];
1614 vVb(2,2) = cov0[5]+cov1[5];
1615 vVb(1,0) = vVb(0,1) = cov0[1]+cov1[1];
1616 vVb(0,2) = vVb(1,2) = vVb(2,0) = vVb(2,1) = 0.;
1618 if (!vVb.IsValid()) {
1619 AliDebug(2,
"Singular Matrix\n");
1621 dist = vVb(0,0)*dx*dx + vVb(1,1)*dy*dy + vVb(2,2)*dz*dz
1622 + 2*vVb(0,1)*dx*dy + 2*vVb(0,2)*dx*dz + 2*vVb(1,2)*dy*dz;
1623 return dist>0 ? TMath::Sqrt(dist) : -1;
1628 const int kMinPlpContrib = 5;
1629 const double kMaxPlpChi2 = 5.0;
1630 const double kMinWDist = 15;
1632 const AliVVertex* vtPrm = 0;
1633 const AliVVertex* vtPlp = 0;
1637 if(!(nPlp=aod->GetNumberOfPileupVerticesTracks()))
1640 vtPrm = aod->GetPrimaryVertex();
1641 if(vtPrm == aod->GetPrimaryVertexSPD())
1646 for(
int ipl=0;ipl<nPlp;ipl++) {
1647 vtPlp = (
const AliVVertex*)aod->GetPileupVertexTracks(ipl);
1648 if(vtPlp->GetNContributors() < kMinPlpContrib)
continue;
1649 if(vtPlp->GetChi2perNDF() > kMaxPlpChi2)
continue;
1654 double wDst =
GetWDist(vtPrm,vtPlp);
1655 if(wDst<kMinWDist)
continue;
TH1F * fHist_Vx_ArrayFinder
ClassImp(AliAnalysisTaskVnZDC) AliAnalysisTaskVnZDC
TProfile * fHist_X_vs_Obs_before[4][5]
AliFlowEventSimple * fEvent
TProfile * fAvg_Cent_vs_Vz_Peri_wCuts
TH1F * fHist_Psi1_zdnC_after2
TProfile * fHist_v2xV1_ZDN_Norm_cosYY
TProfile2D * fHist_znAx_V0_VxVy[90][10]
AliMultSelection * fMultSelection
TProfile * fHist_v2xV1_ZDN_Norm_sinYX
AliFlowTrackSimple * GetTrack(Int_t i)
TH1F * fHist_Psi1_zdnA_after2
TProfile * fHist_v2xV1_ZDN_Cent_sinYX
TProfile * fAvg_Cent_vs_Vy_Cent_wCuts
TH3F * fHist_ZDCn_A_XYvsRun
TProfile * fTPCV0M_CentDiff_vs_Vy
TH1F * fHist_Vy_ArrayFinder
TProfile * fHist_tracks_vs_runnum
TProfile2D * fHist_znCy_V0_VxVy[90][10]
TProfile * fHist_v2xV1_ZDN_Refm_sinYX
TProfile * fHist_XX_vs_Obs_before[4][5]
TProfile * fAvg_Cent_vs_Vz_Cent_wCuts
virtual void Terminate(Option_t *)
TH1F * fHist_Psi1_zdnC_after1
TProfile * fAvg_Cent_vs_Vx_Peri_wCuts
TProfile * fHist_Vx_vs_runnum
TProfile * fHist_ZDN_resol_Refm_All
TProfile * fHist_ZDN_resol_Norm_cos
TProfile * fAvg_Cent_vs_Vx_Cent_wCuts
Bool_t fRejectPileUpTight
TProfile * fHist_v2xV1_ZDN_Cent_All
TProfile * fTPCV0M_CentDiff_vs_Vx
TProfile * fAvg_Cent_vs_Vz_Cent_woCut
TProfile * fAvg_Cent_vs_Vx_Peri_woCut
TProfile * fHist_ZDN_resol_Norm_All
virtual ~AliAnalysisTaskVnZDC()
TProfile * fHist_ZDN_resol_Cent_sin
Bool_t plpMV(const AliAODEvent *aod)
TProfile * fHist_XX_vs_Obs_after1[4][5]
TProfile2D * fHist_ZDCC_En_Run[90]
TProfile * fHist_ZDN_resol_Refm_cos
TProfile * fHist_v2xV1_ZDN_Norm_cosXX
virtual void UserCreateOutputObjects()
TProfile * fHist_Vz_vs_runnum
Double_t GetCentrality() const
TProfile * fHist_v2xV1_ZDN_Norm_sinXY
TProfile * fHist_v2xV1_ZDN_Refm_sinXY
TProfile * fAvg_Cent_vs_Vy_Peri_woCut
TProfile * fHist_v2xV1_ZDN_Refm_All
TProfile * fTPCV0M_CentDiff_vs_Vz
AliAnalysisUtils * fAnalysisUtil
TProfile * fHist_X_vs_Obs_after1[4][5]
TProfile * fHist_ZDN_resol_Norm_sin
TProfile * fAvg_Cent_vs_Vz_Peri_woCut
TProfile * fHist_v2xV1_ZDN_Cent_cosYY
TProfile * fHist_ZDN_resol_Refm_sin
TProfile * fAvg_Cent_vs_Vx_Cent_woCut
TProfile * fHist_ZDN_resol_Cent_cos
TProfile * fAvg_Cent_vs_Vy_Peri_wCuts
TH1F * fHist_Vz_ArrayFinder
double GetWDist(const AliVVertex *v0, const AliVVertex *v1)
TProfile * fHist_v2xV1_ZDN_Refm_cosXX
TH1D * fFB_Efficiency_Cent[10]
TProfile2D * fHist_ZDCA_En_Run[90]
TProfile * fHist_Vy_vs_runnum
TProfile2D * fHist_znAy_V0_VxVy[90][10]
TProfile * fHist_v2xV1_ZDN_Cent_sinXY
TProfile2D * fHist_znCx_V0_VxVy[90][10]
TProfile * fHist_v2xV1_ZDN_Refm_cosYY
TH1F * fPileUpMultSelCount
virtual void UserExec(Option_t *option)
TH3F * fHist_ZDCn_C_XYvsRun
TProfile * fHist_ZDN_resol_Cent_All
TH1F * fHist_Psi1_zdnA_after1
TProfile * fHist_v2xV1_ZDN_Cent_cosXX
TProfile * fAvg_Cent_vs_Vy_Cent_woCut
TProfile * fHist_v2xV1_ZDN_Norm_All
Int_t NumberOfTracks() const