12 #if !defined(__CINT__) || defined(__MAKECINT__) 16 #include "AliAnalysisManager.h" 55 const Bool_t bFillAOD = kFALSE,
56 const Int_t bMC = kFALSE,
57 const Bool_t exotic = kTRUE,
58 const TString name =
"V1Unfold",
61 const Int_t minEcell = 50,
62 const Int_t minEseed = 100,
63 const Int_t maxDeltaT = 250,
64 const Int_t timeWindow = 1000,
65 const Int_t minEUnf = 15,
66 const Int_t minFrac = 1,
67 const Bool_t bRecalE = kTRUE,
69 const Bool_t bRecalT = kTRUE,
70 const Bool_t bNonLine = kFALSE,
71 const Int_t minCen = -1,
72 const Int_t maxCen = -1,
73 const Float_t clusterEnergyCutEvent = -1,
74 const Int_t nRowDiff = 1,
75 const Int_t nColDiff = 1,
76 const Bool_t skipOrReject = kFALSE,
77 const Int_t tCardMimic = 0,
78 const Bool_t cellUpd = kTRUE
86 ::Error(
"AddTaskEMCALClusterize",
"No analysis manager to connect to.");
92 if (!mgr->GetInputEventHandler())
94 ::Error(
"AddTaskEMCALClusterize",
"This clusterize requires an input event handler");
98 printf(
"AddTaskEMCALClusterize() - Passed Settings :\n");
99 printf(
"\t mc %d, exo %d, name %s, trigger %s, tm %d\n",
100 bMC,exotic,name.Data(),trigger.Data(),tm);
101 printf(
"\t Ecell %d, Eseed %d, dT %d, wT %d, minUnf %d, minFrac %d \n",
102 minEcell, minEseed,maxDeltaT,timeWindow,minEUnf,minFrac);
103 printf(
"\t recalE %d, bad %d, recalT %d, nonlin %d, minCen %d, maxCen %d, rowDiff %d, colDiff %d, t-card %d, cell update %d \n",
104 bRecalE,bBad,bRecalT,bNonLine,minCen,maxCen,nRowDiff,nColDiff,tCardMimic,cellUpd);
108 if(name.Contains(
"NxN")) arrayName = Form(
"%dx%d_Ecell%d_Eseed%d_DT%d_WT%d",2*nRowDiff+1,2*nColDiff+1,minEcell,minEseed,maxDeltaT,timeWindow);
109 else arrayName = Form(
"%s_Ecell%d_Eseed%d_DT%d_WT%d", name.Data(),minEcell,minEseed,maxDeltaT,timeWindow);
111 if(minCen != -1 && maxCen != -1)
112 arrayName+=Form(
"_Cen%d_%d",minCen,maxCen);
114 printf(
"AddTaskEMCALClusterize() - Created Branch Name: %s \n",arrayName.Data());
122 clusterize->SetAODBranchName(arrayName);
127 clusterize->SetCentralityBin(minCen, maxCen);
130 clusterize->SwitchOffFillAODCaloCells();
131 clusterize->SwitchOffFillAODHeader();
132 clusterize->FillAODFile(bFillAOD);
135 if ( cellUpd ) clusterize->SwitchOnUpdateCell();
141 AliEMCALRecParam * params = clusterize->GetRecParam();
152 if(maxDeltaT > 1) params->SetTimeCut(maxDeltaT*1.e-9);
153 else { params->SetTimeCut(250*1.e-9); printf(
"AddTaskEMCALClusterize() - default maxDeltaT = 250 ns\n"); }
157 params->SetTimeMin(-1*timeWindow*1.e-9);
158 params->SetTimeMax(timeWindow*1.e-9);
166 params->SetTimeMin(-250*1.e-9);
167 params->SetTimeMax( 250*1.e-9);
168 printf(
"AddTaskEMCALClusterize() - default time window for calibrated time -250 ns < T < 250 ns\n");
173 params->SetTimeMin(425*1.e-9);
174 params->SetTimeMax(825*1.e-9);
175 printf(
"AddTaskEMCALClusterize() - default time window 425 ns < T < 825 ns\n");
180 params->SetTimeMin(-100000000);
181 params->SetTimeMax( 100000000);
182 printf(
"AddTaskEMCALClusterize() - open time cut\n");
189 params->SetClusteringThreshold(minEseed/1.e3);
190 params->SetMinECut (minEcell/1.e3);
195 if(name.Contains(
"V2")) params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv2);
196 if(name.Contains(
"V1")) params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv1);
197 if(name.Contains(
"NxN"))
199 params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerNxN);
200 printf(
"AddTaskEMCALClusterize() - Set NxN cluster size to %dx%d (row diff %d, col diff %d)\n",
201 2*nRowDiff+1,2*nColDiff+1,nRowDiff,nColDiff);
202 params->SetNxM(nRowDiff, nColDiff);
210 if(name.Contains(
"JustUnfold"))
211 clusterize->JustUnfold(kTRUE);
213 clusterize->JustUnfold(kFALSE);
216 if (name.Contains(
"Unfold"))
218 clusterize->SwitchOnCellEnergySelection();
219 clusterize->SetCellCuts(minEUnf/1000.,minFrac/10000.);
220 clusterize->SetRejectBelowThreshold(skipOrReject);
221 printf(
"AliAnalysisTaskEMCALClusterize() - Unfolding Cuts: min E %f, frac %f\n",
222 minEUnf/1000.,minFrac/10000.);
225 if(!name.Contains(
"Just"))
226 params->SetUnfold(kTRUE);
228 params->SetUnfold(kFALSE);
242 clusterize->ConfigureEMCALRecoUtils(bMC,exotic,bNonLine,bRecalE,bBad,bRecalT);
249 clusterize->SwitchOnTrackMatching();
250 if ( tm == 2 ) clusterize->GetRecoUtils()->SwitchOnAODHybridTracksMatch();
251 else if ( tm == 1 ) clusterize->GetRecoUtils()->SwitchOnAODTPCOnlyTracksMatch();
252 else clusterize->GetRecoUtils()->SetAODTrackFilterMask(tm);
254 else clusterize->SwitchOffTrackMatching();
262 clusterize->SwitchOnLoadOwnGeometryMatrices();
268 if(clusterEnergyCutEvent > 0)
270 clusterize->SwitchOnSelectEMCALEvent();
271 clusterize->SetEMCALEnergyCut(clusterEnergyCutEvent);
272 clusterize->SetEMCALNcellsCut(3);
274 else clusterize->SwitchOffSelectEMCALEvent();
283 clusterize->SwitchOnUseClusterMCLabelForCell(0) ;
284 clusterize->SwitchOnRemapMCLabelForAODs() ;
299 clusterize->SwitchOffTCardCorrelation();
301 if(bMC && tCardMimic > 0)
303 if ( tCardMimic == 1 ) clusterize->SwitchOnTCardCorrelation(kFALSE);
304 else clusterize->SwitchOnTCardCorrelation(kTRUE);
314 clusterize->SetInducedEnergyLossFraction (mu1, mu1, mu1, 0.);
315 clusterize->SetInducedEnergyLossFractionP1(mu2, mu2, mu2, 0.);
320 for(
Int_t ism = 0; ism < 20; ism++)
321 clusterize->SetInducedEnergyLossMinimumFractionPerSM(mu1Min,ism);
326 for(
Int_t ism = 0; ism < 20; ism++)
327 clusterize->SetInducedEnergyLossMaximumFractionPerSM(mu1Max,ism);
329 clusterize->SetInducedTCardMinimumCellEnergy(0) ;
330 clusterize->SeInducedTCardMaximum(100) ;
333 clusterize->SwitchOffRandomizeTCardInducedEnergy() ;
334 clusterize->SetInducedEnergyLossFractionWidth(0., 0., 0., 0.);
337 clusterize->SetInducedEnergyLossProbabilityPerSM(0.30, 0);
338 clusterize->SetInducedEnergyLossProbabilityPerSM(0.60, 1);
339 clusterize->SetInducedEnergyLossProbabilityPerSM(0.50, 2);
340 clusterize->SetInducedEnergyLossProbabilityPerSM(1.00, 3);
341 clusterize->SetInducedEnergyLossProbabilityPerSM(0.35, 4);
342 clusterize->SetInducedEnergyLossProbabilityPerSM(0.25, 5);
343 clusterize->SetInducedEnergyLossProbabilityPerSM(0.35, 6);
344 clusterize->SetInducedEnergyLossProbabilityPerSM(1.00, 7);
345 clusterize->SetInducedEnergyLossProbabilityPerSM(0.25, 8);
346 clusterize->SetInducedEnergyLossProbabilityPerSM(0.25, 9);
348 for(
Int_t ism = 10; ism < 20; ism++)
349 clusterize->SetInducedEnergyLossProbabilityPerSM(0., ism);
358 printf(
"AddTaskEMCALClusterize() - trigger EMC7\n");
359 clusterize->SelectCollisionCandidates(AliVEvent::kEMC7);
361 else if (trigger==
"INT7")
363 printf(
"AddTaskEMCALClusterize() - trigger INT7\n");
364 clusterize->SelectCollisionCandidates(AliVEvent::kINT7);
366 else if(trigger==
"EMC1")
368 printf(
"AddTaskEMCALClusterize() - trigger EMC1\n");
369 clusterize->SelectCollisionCandidates(AliVEvent::kEMC1);
371 else if(trigger==
"MB")
373 printf(
"AddTaskEMCALClusterize() - trigger MB\n");
374 clusterize->SelectCollisionCandidates(AliVEvent::kMB);
376 else if(trigger==
"PHOS")
378 printf(
"AddTaskEMCALClusterize() - trigger PHOS\n");
379 clusterize->SelectCollisionCandidates(AliVEvent::kPHI7);
381 else if(trigger==
"PHOSPb")
383 printf(
"AddTaskEMCALClusterize() - trigger PHOSPb\n");
384 clusterize->SelectCollisionCandidates(AliVEvent::kPHOSPb);
386 else if(trigger==
"AnyINT")
388 printf(
"AddTaskEMCALClusterize() - trigger AnyINT\n");
389 clusterize->SelectCollisionCandidates(AliVEvent::kAnyINT);
391 else if(trigger==
"INT")
393 printf(
"AddTaskEMCALClusterize() - trigger AnyINT\n");
394 clusterize->SelectCollisionCandidates(AliVEvent::kAny);
396 else if(trigger==
"EMCEGA")
398 printf(
"AddTaskEMCALClusterize() - EMC Gamma\n");
399 clusterize->SelectCollisionCandidates(AliVEvent::kEMCEGA);
401 else if(trigger==
"EMCEJE")
403 printf(
"AddTaskEMCALClusterize() - trigger EMC Jet\n");
404 clusterize->SelectCollisionCandidates(AliVEvent::kEMCEJE);
406 else if(trigger==
"Central")
408 printf(
"AddTaskEMCALClusterize() - trigger Central\n");
409 clusterize->SelectCollisionCandidates(AliVEvent::kCentral);
411 else if(trigger==
"SemiCentral")
413 printf(
"AddTaskEMCALClusterize() - trigger SemiCentral\n");
414 clusterize->SelectCollisionCandidates(AliVEvent::kSemiCentral);
423 mgr->AddTask(clusterize);
426 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
427 mgr->ConnectInput (clusterize, 0, cinput1 );
431 printf(
"AddTaskEMCALClusterize() - Fill output AOD\n");
432 AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer() ;
433 mgr->ConnectOutput (clusterize, 0, coutput1 );
AliAnalysisTaskEMCALClusterize * AddTaskEMCALClusterize(TString &arrayName, const Bool_t bFillAOD=kFALSE, const Int_t bMC=kFALSE, const Bool_t exotic=kTRUE, const TString name="V1Unfold", const TString trigger="", const Int_t tm=1, const Int_t minEcell=50, const Int_t minEseed=100, const Int_t maxDeltaT=250, const Int_t timeWindow=1000, const Int_t minEUnf=15, const Int_t minFrac=1, const Bool_t bRecalE=kTRUE, const Bool_t bBad=kTRUE, const Bool_t bRecalT=kTRUE, const Bool_t bNonLine=kFALSE, const Int_t minCen=-1, const Int_t maxCen=-1, const Float_t clusterEnergyCutEvent=-1, const Int_t nRowDiff=1, const Int_t nColDiff=1, const Bool_t skipOrReject=kFALSE, const Int_t tCardMimic=0, const Bool_t cellUpd=kTRUE)
Reclusterize EMCal clusters, put them in a new branch for other following analysis.