33 #include <TParticle.h>
34 #include <TDatabasePDG.h>
43 #include "AliMCEvent.h"
44 #include "AliCFManager.h"
45 #include "AliCFContainer.h"
47 #include "AliInputEventHandler.h"
48 #include "AliAnalysisManager.h"
49 #include "AliAODHandler.h"
50 #include "AliAODEvent.h"
51 #include "AliAODRecoDecay.h"
57 #include "AliAODMCParticle.h"
58 #include "AliAODMCHeader.h"
59 #include "AliESDtrack.h"
61 #include "THnSparse.h"
63 #include "AliESDtrackCuts.h"
78 #include "AliAnalysisDataSlot.h"
79 #include "AliAnalysisDataContainer.h"
80 #include "AliPIDResponse.h"
86 fHistEventsProcessed(0x0),
95 fCountRecoITSClusters(0),
100 fFillFromGenerated(kFALSE),
101 fOriginDselection(0),
102 fAcceptanceUnf(kTRUE),
106 fUseFlatPtWeight(kFALSE),
108 fUseNchWeight(kFALSE),
109 fUseTrackletsWeight(kFALSE),
110 fUseMultRatioAsWeight(kFALSE),
115 fCentralitySelection(kTRUE),
117 fRejectIfNoQuark(kTRUE),
118 fUseMCVertex(kFALSE),
121 fConfiguration(kCheetah),
127 fLctoV0bachelorOption(1),
128 fGenLctoV0bachelorOption(0),
129 fUseSelectionBit(kTRUE),
131 fMultiplicityEstimator(kNtrk10),
133 fZvtxCorrectedNtrkEstimator(kFALSE),
136 fUseAdditionalCuts(kFALSE),
137 fUseCutsForTMVA(kFALSE),
138 fUseCascadeTaskForLctoV0bachelor(kFALSE),
139 fCutOnMomConservation(0.00001)
148 AliAnalysisTaskSE(name),
150 fHistEventsProcessed(0x0),
159 fCountRecoITSClusters(0),
164 fFillFromGenerated(kFALSE),
165 fOriginDselection(0),
166 fAcceptanceUnf(kTRUE),
170 fUseFlatPtWeight(kFALSE),
172 fUseNchWeight(kFALSE),
173 fUseTrackletsWeight(kFALSE),
174 fUseMultRatioAsWeight(kFALSE),
179 fCentralitySelection(kTRUE),
181 fRejectIfNoQuark(kTRUE),
182 fUseMCVertex(kFALSE),
185 fConfiguration(kCheetah),
191 fLctoV0bachelorOption(1),
192 fGenLctoV0bachelorOption(0),
193 fUseSelectionBit(kTRUE),
195 fMultiplicityEstimator(kNtrk10),
197 fZvtxCorrectedNtrkEstimator(kFALSE),
200 fUseAdditionalCuts(kFALSE),
201 fUseCutsForTMVA(kFALSE),
202 fUseCascadeTaskForLctoV0bachelor(kFALSE),
203 fCutOnMomConservation(0.00001)
212 DefineOutput(1,TH1I::Class());
213 DefineOutput(2,AliCFContainer::Class());
214 DefineOutput(3,THnSparseD::Class());
215 DefineOutput(4,AliRDHFCuts::Class());
217 DefineOutput(5,TList::Class());
229 AliAnalysisTaskSE::operator=(c) ;
244 AliAnalysisTaskSE(c),
245 fCFManager(c.fCFManager),
246 fHistEventsProcessed(c.fHistEventsProcessed),
247 fCorrelation(c.fCorrelation),
248 fListProfiles(c.fListProfiles),
249 fCountMC(c.fCountMC),
250 fCountAcc(c.fCountAcc),
251 fCountVertex(c.fCountVertex),
252 fCountRefit(c.fCountRefit),
253 fCountReco(c.fCountReco),
254 fCountRecoAcc(c.fCountRecoAcc),
255 fCountRecoITSClusters(c.fCountRecoITSClusters),
256 fCountRecoPPR(c.fCountRecoPPR),
257 fCountRecoPID(c.fCountRecoPID),
259 fDecayChannel(c.fDecayChannel),
260 fFillFromGenerated(c.fFillFromGenerated),
261 fOriginDselection(c.fOriginDselection),
262 fAcceptanceUnf(c.fAcceptanceUnf),
264 fUseWeight(c.fUseWeight),
266 fUseFlatPtWeight(c.fUseFlatPtWeight),
267 fUseZWeight(c.fUseZWeight),
268 fUseNchWeight(c.fUseNchWeight),
269 fUseTrackletsWeight(c.fUseTrackletsWeight),
270 fUseMultRatioAsWeight(c.fUseMultRatioAsWeight),
272 fPartName(c.fPartName),
273 fDauNames(c.fDauNames),
275 fCentralitySelection(c.fCentralitySelection),
276 fFakeSelection(c.fFakeSelection),
277 fRejectIfNoQuark(c.fRejectIfNoQuark),
278 fUseMCVertex(c.fUseMCVertex),
279 fDsOption(c.fDsOption),
280 fGenDsOption(c.fGenDsOption),
281 fConfiguration(c.fConfiguration),
282 fFuncWeight(c.fFuncWeight),
283 fHistoPtWeight(c.fHistoPtWeight),
284 fHistoMeasNch(c.fHistoMeasNch),
285 fHistoMCNch(c.fHistoMCNch),
286 fResonantDecay(c.fResonantDecay),
287 fLctoV0bachelorOption(c.fLctoV0bachelorOption),
288 fGenLctoV0bachelorOption(c.fGenLctoV0bachelorOption),
289 fUseSelectionBit(c.fUseSelectionBit),
290 fPDGcode(c.fPDGcode),
291 fMultiplicityEstimator(c.fMultiplicityEstimator),
292 fRefMult(c.fRefMult),
293 fZvtxCorrectedNtrkEstimator(c.fZvtxCorrectedNtrkEstimator),
294 fIsPPData(c.fIsPPData),
295 fIsPPbData(c.fIsPPbData),
296 fUseAdditionalCuts(c.fUseAdditionalCuts),
297 fUseCutsForTMVA(c.fUseCutsForTMVA),
298 fUseCascadeTaskForLctoV0bachelor(c.fUseCascadeTaskForLctoV0bachelor),
299 fCutOnMomConservation(c.fCutOnMomConservation)
332 if (fDebug>1) printf(
"AliCFTaskVertexingHF::Init()");
333 if(
fUseWeight &&
fUseZWeight) { AliFatal(
"Can not use at the same time pt and z-vtx weights, please choose");
return; }
334 if(
fUseWeight &&
fUseNchWeight) { AliInfo(
"Beware, using at the same time pt and Nch weights, please check"); }
340 AliFatal(
"No cuts defined - Exiting...");
451 AliFatal(
"The decay channel MUST be defined according to AliCFVertexing::DecayChannel - Exiting...");
455 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
457 copyfCuts->SetName(nameoutput);
460 PostData(4, copyfCuts);
463 AliFatal(
"Failing initializing AliRDHFCuts object - Exiting...");
472 period[0] =
"LHC13b"; period[1] =
"LHC13c";
475 period[0] =
"LHC10b"; period[1] =
"LHC10c"; period[2] =
"LHC10d"; period[3] =
"LHC10e";
479 for(Int_t i=0; i<nProfiles; i++){
482 hprof->SetName(Form(
"ProfileTrkVsZvtx%s\n",period[i].
Data()));
506 PostData(2,
fCFManager->GetParticleContainer()) ;
509 AliDebug(3,Form(
"*** Processing event %d\n",
fEvents));
512 AliWarning(
"Flag to fill container with generated value ON ---> dca, d0pi, d0K, d0xd0, cosPointingAngle will be set as dummy!");
516 Error(
"UserExec",
"NO EVENT FOUND!");
520 AliAODEvent* aodEvent =
dynamic_cast<AliAODEvent*
>(fInputEvent);
522 TClonesArray *arrayBranch=0;
524 if(!aodEvent && AODEvent() && IsStandardAOD()) {
527 aodEvent =
dynamic_cast<AliAODEvent*
> (AODEvent());
530 AliAODHandler* aodHandler = (AliAODHandler*)
531 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
532 if(aodHandler->GetExtensions()) {
533 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
534 AliAODEvent *aodFromExt = ext->GetAOD();
538 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject(
"D0toKpi");
542 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Dstar");
546 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject(
"CascadesHF");
552 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
556 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm4Prong");
567 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject(
"D0toKpi");
571 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject(
"Dstar");
575 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject(
"CascadesHF");
581 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject(
"Charm3Prong");
585 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject(
"Charm4Prong");
593 AliAODVertex *aodVtx = (AliAODVertex*)aodEvent->GetPrimaryVertex();
595 AliDebug(3,
"The event was skipped due to missing vertex");
600 AliError(
"Could not find array of HF vertices");
613 TClonesArray* mcArray =
dynamic_cast<TClonesArray*
>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
615 AliError(
"Could not find Monte-Carlo in AOD");
620 Int_t icountReco = 0;
621 Int_t icountVertex = 0;
622 Int_t icountRefit = 0;
623 Int_t icountRecoAcc = 0;
624 Int_t icountRecoITSClusters = 0;
625 Int_t icountRecoPPR = 0;
626 Int_t icountRecoPID = 0;
629 AliAODMCHeader *mcHeader =
dynamic_cast<AliAODMCHeader*
>(aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
631 AliError(
"Could not find MC Header in AOD");
637 Double_t* containerInput =
new Double_t[
fNvar];
638 Double_t* containerInputMC =
new Double_t[
fNvar];
697 AliError(
"No AliCFVertexingHF initialized");
698 delete[] containerInput;
699 delete[] containerInputMC;
703 Double_t zPrimVertex = aodVtx ->GetZ();
704 Double_t zMCVertex = mcHeader->GetVtxZ();
705 Int_t runnumber = aodEvent->GetRunNumber();
708 Double_t nTracklets = 0;
711 nTracklets = (Double_t)nTrackletsEta10;
720 nTracklets = (Double_t)nTrackletsEta10Corr;
732 AliDebug(2,Form(
"Using Nch weights, Mult=%d Weight=%f\n",nChargedMCPhysicalPrimary,
fWeight));
737 AliDebug(3,Form(
"z coordinate of MC vertex = %f, it was required to be within [-%f, +%f], skipping event", zMCVertex,
fCuts->
GetMaxVtxZ(),
fCuts->
GetMaxVtxZ()));
738 delete[] containerInput;
739 delete[] containerInputMC;
744 if(aodEvent->GetTriggerMask()==0 &&
745 (runnumber>=195344 && runnumber<=195677)){
746 AliDebug(3,
"Event rejected because of null trigger mask");
747 delete[] containerInput;
748 delete[] containerInputMC;
753 AliESDtrackCuts** trackCuts =
new AliESDtrackCuts*[cfVtxHF->
GetNProngs()];
756 for (Int_t iProng = 0; iProng<cfVtxHF->
GetNProngs()-1; iProng++){
768 for (Int_t iProng = 0; iProng<cfVtxHF->
GetNProngs(); iProng++){
791 delete[] containerInput;
792 delete[] containerInputMC;
802 Float_t centValue = 0.;
807 Double_t vzeroMult=0;
808 AliAODVZERO *vzeroAOD = (AliAODVZERO*)aodEvent->GetVZEROData();
809 if(vzeroAOD) vzeroMult = vzeroAOD->GetMTotV0A() + vzeroAOD->GetMTotV0C();
811 Double_t multiplicity = nTracklets;
818 for (Int_t iPart=0; iPart<mcArray->GetEntriesFast(); iPart++) {
819 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(iPart));
821 AliError(
"Failed casting particle from MC array!, Skipping particle");
829 if (!
fCFManager->CheckParticleCuts(0, mcPart)) {
830 AliDebug(2,
"Check the MC-level cuts - not desidered particle");
834 AliDebug(3, Form(
"\n\n---> COOL! we found a particle (particle %d)!!! with PDG code = %d \n\n", iPart, mcPart->GetPdgCode()));
840 AliDebug(2,Form(
"Impossible to set the label array for particle %d (decaychannel = %d)", iPart,
fDecayChannel));
846 AliDebug(2,Form(
"Check on the family wrong for particle %d!!! (decaychannel = %d)", iPart,
fDecayChannel));
850 AliDebug(2,Form(
"Check on the family OK for particle %d!!! (decaychannel = %d)", iPart,
fDecayChannel));
854 Bool_t mcContainerFilled = cfVtxHF -> FillMCContainer(containerInputMC);
855 AliDebug(2, Form(
"particle = %d mcContainerFilled = %d", iPart, mcContainerFilled));
856 if (mcContainerFilled) {
859 AliDebug(2,
"Using Histogram as Pt weight function");
863 AliDebug(2,
"Using function");
867 AliDebug(2,
"Using FONLL");
870 AliDebug(2,Form(
"pt = %f, weight = %f",containerInputMC[0],
fWeight));
873 AliDebug(3, Form(
"Not in limited acceptance, containerInputMC[0] = %f, containerInputMC[1] = %f", containerInputMC[0], containerInputMC[1]));
877 AliDebug(3, Form(
"YES!! in limited acceptance, containerInputMC[0] = %f, containerInputMC[1] = %f", containerInputMC[0],containerInputMC[1]));
881 if (TMath::Abs(containerInputMC[1]) < 0.5) {
883 AliDebug(3,
"MC Lim Acc container filled\n");
889 AliDebug(3,
"MC container filled \n");
894 Bool_t mcAccepStep = cfVtxHF-> MCAcceptanceStep();
897 AliDebug(3,
"MC acceptance cut passed\n");
904 AliDebug(3,
"Vertex cut passed and container filled\n");
908 Bool_t mcRefitStep = cfVtxHF->
MCRefitStep(aodEvent, &trackCuts[0]);
911 AliDebug(3,
"MC Refit cut passed and container filled\n");
915 AliDebug(3,
"MC Refit cut not passed\n");
920 AliDebug (3,
"MC vertex step not passed\n");
925 AliDebug (3,
"MC in acceptance step not passed\n");
930 AliDebug (3,
"MC container not filled\n");
934 if (cquarks<2) AliDebug(2,Form(
"Event with %d c-quarks", cquarks));
935 AliDebug(2,Form(
"Found %i MC particles that are %s!!",icountMC,
fPartName.Data()));
936 AliDebug(2,Form(
"Found %i MC particles that are %s and satisfy Acc cuts!!",icountAcc,
fPartName.Data()));
937 AliDebug(2,Form(
"Found %i MC particles that are %s and satisfy Vertex cuts!!",icountVertex,
fPartName.Data()));
938 AliDebug(2,Form(
"Found %i MC particles that are %s and satisfy Refit cuts!!",icountRefit,
fPartName.Data()));
946 AliDebug(2,Form(
"Found %d vertices for decay channel %d",arrayBranch->GetEntriesFast(),
fDecayChannel));
948 for(Int_t iCandid = 0; iCandid<arrayBranch->GetEntriesFast();iCandid++){
974 Bool_t unsetvtx=kFALSE;
981 if (!signAssociation){
987 if (isPartOrAntipart == 0){
988 AliDebug(2, Form(
"The candidate pdg code doesn't match the requirement set in the task (fSign = %d)",
fSign));
993 AliDebug(3,Form(
"iCandid=%d - signAssociation=%d, isPartOrAntipart=%d",iCandid, signAssociation, isPartOrAntipart));
996 AliDebug(3, Form(
"CF task: RecoContFilled for candidate %d is %d", iCandid, (Int_t)recoContFilled));
1002 AliDebug(2,
"Using Histogram as Pt weight function");
1006 AliDebug(2,
"Using function");
1010 AliDebug(2,
"Using FONLL");
1013 AliDebug(2, Form(
"pt = %f, weight = %f",containerInput[0],
fWeight));
1021 Bool_t recoStep = cfVtxHF->
RecoStep();
1022 if (recoStep) AliDebug(2, Form(
"particle = %d --> CF task: Reco step for candidate %d is %d", iCandid, iCandid, (Int_t)recoStep));
1027 Bool_t isBitSelected = kTRUE;
1043 if (recoStep && recoContFilled && vtxCheck){
1046 AliDebug(3,
"Reco step passed and container filled\n");
1049 Bool_t recoAcceptanceStep = cfVtxHF->
RecoAcceptStep(&trackCuts[0]);
1050 if (recoAcceptanceStep) {
1053 AliDebug(3,
"Reco acceptance cut passed and container filled\n");
1057 Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(
fPDGcode,fill);
1063 if (recoITSnCluster){
1065 icountRecoITSClusters++;
1066 AliDebug(3,
"Reco n ITS cluster cut passed and container filled\n");
1069 Int_t recoAnalysisCuts = -1, recoPidSelection = -1;
1074 Bool_t keepDs=
ProcessDs(recoAnalysisCuts);
1075 if(keepDs) recoAnalysisCuts=3;
1079 if (keepLctoV0bachelor) recoAnalysisCuts=3;
1080 AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
1081 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
1082 AliPIDResponse* pidResponse = inputHandler->GetPIDResponse();
1089 Bool_t tempAn=(recoAnalysisCuts == 3 || recoAnalysisCuts == isPartOrAntipart);
1091 if (
fDecayChannel == 32) tempAn=(recoAnalysisCuts >0 || recoAnalysisCuts == isPartOrAntipart);
1096 AliDebug(3,
"Reco Analysis cuts passed and container filled \n");
1103 Bool_t keepDs=
ProcessDs(recoPidSelection);
1104 if(keepDs) recoPidSelection=3;
1107 if (keepLctoV0bachelor) recoPidSelection=3;
1110 Bool_t tempPid=(recoPidSelection == 3 || recoPidSelection == isPartOrAntipart);
1112 if (
fDecayChannel == 32) tempPid=(recoPidSelection >0 || recoPidSelection == isPartOrAntipart);
1115 Double_t weigPID = 1.;
1118 if (isPartOrAntipart == 1){
1120 }
else if (isPartOrAntipart == 2){
1123 if ((weigPID < 0) || (weigPID > 1)) weigPID = 0.;
1127 Int_t labDau0=((AliAODTrack*)charmCandidate->GetDaughter(0))->GetLabel();
1128 AliAODMCParticle* firstDau=(AliAODMCParticle*)mcArray->UncheckedAt(TMath::Abs(labDau0));
1130 Int_t pdgCode0=TMath::Abs(firstDau->GetPdgCode());
1133 }
else if(pdgCode0==211){
1136 if ((weigPID < 0) || (weigPID > 1)) weigPID = 0.;
1144 AliDebug(3,
"Reco PID cuts passed and container filled \n");
1147 Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(
fPDGcode,fill);
1152 AliDebug(3,
"Analysis Cuts step not passed \n");
1158 AliDebug(3,
"PID selection not passed \n");
1164 AliDebug(3,
"Number of ITS cluster step not passed\n");
1170 AliDebug(3,
"Reco acceptance step not passed\n");
1176 AliDebug(3,
"Reco step not passed\n");
1193 delete[] containerInput;
1194 delete[] containerInputMC;
1200 delete [] trackCuts;
1213 AliAnalysisTaskSE::Terminate();
1216 AliInfo(Form(
"Found %i MC particles that are %s in MC and satisfy Acc cuts, in %d events",
fCountAcc,
fPartName.Data(),
fEvents));
1217 AliInfo(Form(
"Found %i MC particles that are %s in MC and satisfy Acc cuts, and satisfy Vertex requirement in %d events",
fCountVertex,
fPartName.Data(),
fEvents));
1218 AliInfo(Form(
"Found %i MC particles that are %s in MC and satisfy Acc cuts, and satisfy ITS+TPC refit requirementin %d events",
fCountRefit,
fPartName.Data(),
fEvents));
1226 AliCFContainer *cont=
dynamic_cast<AliCFContainer*
> (GetOutputData(2));
1228 printf(
"CONTAINER NOT FOUND\n");
1234 TH1D** h =
new TH1D*[3];
1235 Int_t nvarToPlot = 0;
1238 for (Int_t ih = 0; ih<3; ih++){
1244 h[ih] =
new TH1D[nvarToPlot];
1246 for(Int_t iC=1;iC<nvarToPlot; iC++){
1248 h[0][iC] = *(cont->ShowProjection(iC,0));
1250 h[1][iC] = *(cont->ShowProjection(iC,1));
1252 h[2][iC] = *(cont->ShowProjection(iC,4));
1258 for (Int_t ih = 0; ih<3; ih++){
1259 h[ih] =
new TH1D[nvarToPlot];
1261 for(Int_t iC=0;iC<nvarToPlot; iC++){
1263 h[0][iC] = *(cont->ShowProjection(iC,0));
1265 h[1][iC] = *(cont->ShowProjection(iC,1));
1267 h[2][iC] = *(cont->ShowProjection(iC,4));
1275 titles =
new TString[nvarToPlot];
1276 titles[0]=
"pT_Dplus (GeV/c)";
1277 titles[1]=
"rapidity";
1278 titles[2]=
"phi (rad)";
1279 titles[3]=
"cT (#mum)";
1280 titles[4]=
"cosPointingAngle";
1281 titles[5]=
"pT_1 (GeV/c)";
1282 titles[6]=
"pT_2 (GeV/c)";
1283 titles[7]=
"pT_3 (GeV/c)";
1284 titles[8]=
"d0_1 (#mum)";
1285 titles[9]=
"d0_2 (#mum)";
1286 titles[10]=
"d0_3 (#mum)";
1287 titles[11]=
"zVertex (cm)";
1290 titles =
new TString[nvarToPlot];
1291 titles[0]=
"p_{T}(#Lambda_{c}) [GeV/c]";
1292 titles[1]=
"y(#Lambda_{c})";
1293 titles[2]=
"#varphi(#Lambda_{c}) [rad]";
1294 titles[3]=
"onTheFlyStatusV0";
1295 titles[4]=
"z_{vtx} [cm]";
1296 titles[5]=
"centrality";
1298 titles[7]=
"multiplicity";
1300 titles[8]=
"p(bachelor) [GeV/c]";
1301 titles[9]=
"p_{T}(V0) [GeV/c]";
1303 titles[11]=
"#varphi(V0) [rad]";
1304 titles[12]=
"m_{inv}(#pi^{+}#pi^{+}) [GeV/c^{2}]";
1305 titles[13]=
"dcaV0 (nSigma)";
1306 titles[14]=
"cosine pointing angle (V0)";
1307 titles[15]=
"cosine pointing angle (#Lambda_{c})";
1312 titles =
new TString[nvarToPlot];
1313 titles[0]=
"pT_D0 (GeV/c)";
1314 titles[1]=
"rapidity";
1315 titles[2]=
"cosThetaStar";
1316 titles[3]=
"pT_pi (GeV/c)";
1317 titles[4]=
"pT_K (Gev/c)";
1318 titles[5]=
"cT (#mum)";
1319 titles[6]=
"dca (#mum)";
1320 titles[7]=
"d0_pi (#mum)";
1321 titles[8]=
"d0_K (#mum)";
1322 titles[9]=
"d0xd0 (#mum^2)";
1323 titles[10]=
"cosPointingAngle";
1324 titles[11]=
"phi (rad)";
1329 titles =
new TString[nvarToPlot];
1331 titles[0]=
"p_{T}(#Lambda_{c}) [GeV/c]";
1332 titles[1]=
"y(#Lambda_{c})";
1333 titles[2]=
"#varphi(#Lambda_{c}) [rad]";
1334 titles[3]=
"onTheFlyStatusV0";
1335 titles[4]=
"z_{vtx} [cm]";
1336 titles[5]=
"centrality";
1338 titles[7]=
"multiplicity";
1340 titles[0]=
"pT_candidate (GeV/c)";
1341 titles[1]=
"rapidity";
1342 titles[2]=
"cT (#mum)";
1344 titles[4]=
"z_{vtx}";
1345 titles[5]=
"centrality";
1347 titles[7]=
"multiplicity";
1351 Int_t markers[16]={20,24,21,25,27,28,
1354 Int_t colors[3]={2,8,4};
1355 for(Int_t iC=0;iC<nvarToPlot; iC++){
1356 for(Int_t iStep=0;iStep<3;iStep++){
1357 h[iStep][iC].SetTitle(titles[iC].
Data());
1358 h[iStep][iC].GetXaxis()->SetTitle(titles[iC].
Data());
1359 Double_t maxh=h[iStep][iC].GetMaximum();
1360 h[iStep][iC].GetYaxis()->SetRangeUser(0,maxh*1.2);
1361 h[iStep][iC].SetMarkerStyle(markers[iC]);
1362 h[iStep][iC].SetMarkerColor(colors[iStep]);
1366 gStyle->SetCanvasColor(0);
1367 gStyle->SetFrameFillColor(0);
1368 gStyle->SetTitleFillColor(0);
1369 gStyle->SetStatColor(0);
1372 TCanvas * c1 =
new TCanvas(Form(
"c1New_%d",
fDecayChannel),
"Vars 0, 1, 2, 3",1100,1200);
1375 for(Int_t iVar=0; iVar<4; iVar++){
1377 h[0][iVar].DrawCopy(
"p");
1379 h[1][iVar].DrawCopy(
"p");
1381 h[2][iVar].DrawCopy(
"p");
1384 TCanvas * c2 =
new TCanvas(Form(
"c2New_%d",
fDecayChannel),
"Vars 4, 5, 6, 7",1100,1200);
1387 for(Int_t iVar=4; iVar<8; iVar++){
1389 h[0][iVar].DrawCopy(
"p");
1391 h[1][iVar].DrawCopy(
"p");
1393 h[2][iVar].DrawCopy(
"p");
1397 TCanvas * c3 =
new TCanvas(Form(
"c3New_%d",
fDecayChannel),
"Vars 8, 9, 10, 11",1100,1200);
1400 for(Int_t iVar=8; iVar<12; iVar++){
1402 h[0][iVar].DrawCopy(
"p");
1404 h[1][iVar].DrawCopy(
"p");
1406 h[2][iVar].DrawCopy(
"p");
1409 TCanvas * c4 =
new TCanvas(Form(
"c4New_%d",
fDecayChannel),
"Vars 12, 13, 14, 15",1100,1200);
1412 for(Int_t iVar=12; iVar<16; iVar++){
1414 h[0][iVar].DrawCopy(
"p");
1416 h[1][iVar].DrawCopy(
"p");
1418 h[2][iVar].DrawCopy(
"p");
1436 TFile* file_projection =
new TFile(
"CFtaskHFprojectionNew.root",
"RECREATE");
1441 for(Int_t iC=0;iC<nvarToPlot; iC++){
1442 for(Int_t iStep=0;iStep<3;iStep++){
1443 h[iStep][iC].Write(Form(
"Step%d_%s",iStep,titles[iC].
Data()));
1446 file_projection->Close();
1447 for (Int_t ih = 0; ih<3; ih++)
delete [] h[ih];
1459 Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s\n", GetName());
1463 const char* nameoutput=GetOutputSlot(1)->GetContainer()->GetName();
1469 PostData(2,
fCFManager->GetParticleContainer()) ;
1481 fFuncWeight=
new TF1(
"funcWeight",
"[0]+[1]*TMath::Exp(-[2]*x)",0.,50.);
1493 fFuncWeight=
new TF1(
"funcWeight",
"[0]+[1]/TMath::Power(x,[2])",0.05,50.);
1505 fFuncWeight=
new TF1(
"funcWeight",
"([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,50.);
1506 fFuncWeight->SetParameters(1.92381e+01, 5.05055e+00, 1.05314e+01, 2.5, 1.88214e-03, 3.44871e+00, -9.74325e-02, 1.97671e+00, -3.21278e-01);
1516 fFuncWeight=
new TF1(
"funcWeight",
"([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,50.);
1517 fFuncWeight->SetParameters(6.10443e+00, 1.53487e+00, 1.99474e+00, 2.5, 5.51172e-03, 5.86590e+00, -5.46963e-01, 9.41201e-02, -1.64323e-01);
1526 fFuncWeight=
new TF1(
"funcWeight",
"([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,30.);
1527 fFuncWeight->SetParameters(2.94999e+00,3.47032e+00,2.81278e+00,2.5,1.93370e-02,3.86865e+00,-1.54113e-01,8.86944e-02,2.56267e-02);
1536 fFuncWeight=
new TF1(
"funcWeight",
"([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,40.);
1537 fFuncWeight->SetParameters(2.41522e+01,4.92146e+00,6.72495e+00,2.5,6.15361e-03,4.78995e+00,-4.29135e-01,3.99421e-01,-1.57220e-02);
1546 fFuncWeight=
new TF1(
"funcWeight",
"([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x+[9])",0.15,50.);
1547 fFuncWeight->SetParameters(1.31497e+01,3.30503e+00,3.45594e+00,2.5,2.28642e-02,1.42372e+00,2.32892e-04,5.21986e-02,-2.14236e-01,3.86200e+00);
1556 fFuncWeight=
new TF1(
"funcWeight",
"([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x+[9])",0.15,50.);
1557 fFuncWeight->SetParameters(6.54519e+00,2.74007e+00,2.48325e+00,2.5,1.61113e-01,-5.32546e-01,-3.75916e-04,2.38189e-01,-2.17561e-01,2.35975e+00);
1566 fFuncWeight=
new TF1(
"funcWeight",
"([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x+[9])",0.15,50.);
1567 fFuncWeight->SetParameters(1.85862e+01,2.48171e+00,3.39356e+00,2.5,1.70426e-02,2.28453e+00,-4.57749e-02,5.84585e-02,-3.19719e-01,4.16789e+00);
1576 fFuncWeight=
new TF1(
"funcWeight",
"([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,40.);
1577 fFuncWeight->SetParameters(2.77730e+01,4.78942e+00,7.45378e+00,2.5,9.86255e-02,2.30120e+00,-4.16435e-01,3.43770e-01,-2.29380e-02);
1586 fFuncWeight=
new TF1(
"funcWeight",
"([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x+[9])",0.15,40.);
1587 fFuncWeight->SetParameters(1.34412e+01,3.20068e+00,5.14481e+00,2.5,7.59405e-04,7.51821e+00,-3.93811e-01,2.16849e-02,-3.37768e-02,2.40308e+00);
1610 Double_t func1[4] = {0.322643,2.96275,2.30301,2.5};
1611 Double_t func2[4] = {0.36609,1.94635,1.40463,2.5};
1613 Double_t dndpt_func1 =
dNdptFit(pt,func1);
1615 Double_t dndpt_func2 =
dNdptFit(pt,func2);
1616 AliDebug(2,Form(
"pt = %f, FONLL = %f, Pythia = %f, ratio = %f",pt,dndpt_func1,dndpt_func2,dndpt_func1/dndpt_func2));
1617 return dndpt_func1/dndpt_func2;
1627 Double_t denom = TMath::Power((pt/par[1]), par[3] );
1628 Double_t dNdpt = par[0]*pt/TMath::Power(1.+denom, par[2]);
1640 Double_t weight = 0.0;
1643 if( (histobin>0) && (histobin<=histoNbins) ) {
1656 if(runnumber>146824 || runnumber<146803)
return 1.0;
1658 Double_t func1[3] = {1.0, -0.5, 6.5 };
1659 Double_t func2[3] = {1.0, -0.5, 5.5 };
1661 Double_t dzFunc1 =
DodzFit(z,func1);
1662 Double_t dzFunc2 =
DodzFit(z,func2);
1664 return dzFunc1/dzFunc2;
1675 Double_t value = par[0]/TMath::Sqrt(2.*TMath::Pi())/par[2]*TMath::Exp(-(z-par[1])*(z-par[1])/2./par[2]/par[2]);
1684 if(nch<=0)
return 0.;
1688 Double_t weight = pMC>0 ? pMeas/pMC : 0.;
1701 Double_t nchbins[82]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1702 10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1703 20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1704 30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1705 40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1706 50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1707 60.50,62.50,64.50,66.50,68.50,70.50,72.50,74.50,76.50,78.50,
1708 80.50,82.50,84.50,86.50,88.50,90.50,92.50,94.50,96.50,98.50,
1710 Double_t pch[81]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1711 0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1712 0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1713 0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1714 0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1715 0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1716 0.000296,0.000265,0.000193,0.00016,0.000126,0.0000851, 0.0000676,0.0000537,0.0000426, 0.0000338,
1717 0.0000268,0.0000213,0.0000166,0.0000133,0.0000106,0.00000837,0.00000662, 0.00000524,0.00000414, 0.00000327,
1722 for(Int_t i=0; i<81; i++){
1732 if(recoAnalysisCuts > 0){
1733 Int_t isKKpi=recoAnalysisCuts&1;
1734 Int_t ispiKK=recoAnalysisCuts&2;
1735 Int_t isPhiKKpi=recoAnalysisCuts&4;
1736 Int_t isPhipiKK=recoAnalysisCuts&8;
1737 Int_t isK0starKKpi=recoAnalysisCuts&16;
1738 Int_t isK0starpiKK=recoAnalysisCuts&32;
1740 if(isKKpi && isPhiKKpi) keep=kTRUE;
1741 if(ispiKK && isPhipiKK) keep=kTRUE;
1744 if(isKKpi && isK0starKKpi) keep=kTRUE;
1745 if(ispiKK && isK0starpiKK) keep=kTRUE;
1758 if (recoAnalysisCuts > 0){
1760 Int_t isK0Sp = recoAnalysisCuts&1;
1761 Int_t isLambdaBarpi = recoAnalysisCuts&2;
1762 Int_t isLambdapi = recoAnalysisCuts&4;
1765 if(isK0Sp) keep=kTRUE;
1768 if(isLambdaBarpi) keep=kTRUE;
1771 if(isLambdapi) keep=kTRUE;
1774 if (isK0Sp || isLambdaBarpi || isLambdapi) keep=kTRUE;
1787 Int_t runNo =
event->GetRunNumber();
1792 if (runNo>195343 && runNo<195484) period = 0;
1793 if (runNo>195528 && runNo<195678) period = 1;
1794 if (period<0 || period>1)
return 0;
1796 if(runNo>114930 && runNo<117223) period = 0;
1797 if(runNo>119158 && runNo<120830) period = 1;
1798 if(runNo>122373 && runNo<126438) period = 2;
1799 if(runNo>127711 && runNo<130841) period = 3;
1800 if(period<0 || period>3)
return 0;
void SetCentralityValue(Float_t centValue)
virtual AliESDtrackCuts * GetTrackCutsV0daughters() const
void SetFillFromGenerated(Bool_t flag)
Double_t GetPtWeightFromHistogram(Float_t pt)
void Terminate(Option_t *)
Bool_t fUseAdditionalCuts
flag for pPb data (used for multiplicity corrections)
Bool_t fUseZWeight
flag to decide to use a flat pt shape
AliCFTaskVertexingHF & operator=(const AliCFTaskVertexingHF &c)
Bool_t fFillFromGenerated
decay channel to configure the task
Double_t GetWeight(Float_t pt)
virtual AliESDtrackCuts * GetTrackCutsSoftPi() const
Int_t fCountAcc
MC particle found.
Int_t fCountRefit
Reco particle found that satisfy vertex constrained.
Int_t MCcquarkCounting(AliAODMCParticle *mcPart) const
void SetPtWeightsFromFONLL7overLHC12a12()
Class for HF corrections as a function of many variables and steps For D* and other cascades...
Int_t IsEventSelectedInCentrality(AliVEvent *event)
Int_t fCountReco
Reco particle found that satisfy kTPCrefit and kITSrefit.
Bool_t HasSelectionBit(Int_t i) const
UInt_t fPDGcode
flag to use selection bit
Class for HF corrections as a function of many variables and step.
Bool_t FillRecoContainer(Double_t *containerInput)
void UnsetOwnPrimaryVtx()
Bool_t fIsPPbData
flag for pp data (not checking centrality)
slow configuration, all variables
TH1F * fHistoPtWeight
user-defined function to be used to calculate weights
Bool_t fUseSelectionBit
Lc->V0+bachelor decay option (generation level)
AliCFTaskVertexingHF()
multiplicity estimators
Int_t fCountRecoITSClusters
Reco particle found that satisfy cuts in requested acceptance.
Int_t fNvar
flag to use directly the ratio of the distributions (fHistoMCNch) instead of computing it ...
void SetPtWeightsFromFONLL5overLHC10f6a()
void SetRejectCandidateIfNotFromQuark(Bool_t opt)
virtual Bool_t SetLabelArray()
Int_t fGenLctoV0bachelorOption
Lc->V0+bachelor decay option (selection level)
Double_t GetZWeight(Float_t z, Int_t runnumber)
void SetPtWeightsFromFONLL7overLHC12a12bis()
void SetPtWeightsFromFONLL276andBAMPSoverLHC12a17b()
Double_t dNdptFit(Float_t pt, Double_t *par)
TString fPartName
number of variables for the container
Double_t GetMaxVtxZ() const
Double_t fRefMult
TProfile with mult vas. Z per period.
void SetPtWeightsFromFONLL276overLHC12a17a()
Bool_t ProcessDs(Int_t returnCodeDs) const
Float_t fCutOnMomConservation
flag to define which task to use for Lc –> K0S+p
void CreateMeasuredNchHisto()
Bool_t fZvtxCorrectedNtrkEstimator
refrence multiplcity (period b)
TList * fListProfiles
response matrix for unfolding
Class for cuts on AOD reconstructed D+->Kpipi.
Bool_t fAcceptanceUnf
flag to select D0 origins. 0 Only from charm 1 only from beauty 2 both from charm and beauty ...
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
Bool_t fUseTrackletsWeight
flag to decide whether to use Ncharged weights != 1 when filling the container or not ...
Int_t fCountVertex
MC particle found that satisfy acceptance cuts.
void SetMinCentrality(Float_t minCentrality=0.)
Double_t DodzFit(Float_t z, Double_t *par)
Bool_t fUseCascadeTaskForLctoV0bachelor
these are the pre-selection cuts for the TMVA
Double_t GetNchWeight(Int_t nch)
UShort_t fOriginDselection
flag to indicate whether data container should be filled with generated values also for reconstructed...
Bool_t fUseFlatPtWeight
weight used to fill the container
AliAODVertex * GetOwnPrimaryVtx() const
Char_t fSign
daughter in fin state
AliESDtrackCuts * GetTrackCuts() const
Float_t GetCentrality(AliAODEvent *aodEvent)
AliRDHFCuts * fCuts
flag for unfolding before or after cuts.
Int_t fFakeSelection
flag to switch off the centrality selection
void SetFakeSelection(Int_t fakeSel)
TF1 * fFuncWeight
configuration (slow / fast) of the CF –> different variables will be allocated (all / reduced number)...
void SetPtWeightsFromDataPbPb276overLHC12a17a()
UInt_t fResonantDecay
histogram with Nch distribution from MC production
Bool_t fCentralitySelection
flag to decide wheter to keep D0 only (0), D0bar only (1), or both D0 and D0bar (2) ...
Int_t fCountRecoAcc
Reco particle found that satisfy cuts.
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Int_t fGenDsOption
Ds decay option (selection level)
void SetMaxCentrality(Float_t maxCentrality=100.)
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
void SetRecoPrimVertex(Double_t zPrimVertex)
Bool_t fIsPPData
flag to use the z-vtx corrected (if not use uncorrected) multiplicity estimator
AliCFManager * fCFManager
virtual ~AliCFTaskVertexingHF()
void SetMCCandidateParam(Int_t label)
Bool_t CheckMCPartFamily(AliAODMCParticle *, TClonesArray *) const
virtual Bool_t SetRecoCandidateParam(AliAODRecoDecayHF *)
static Double_t GetCorrectedNtracklets(TProfile *estimatorAvg, Double_t uncorrectedNacc, Double_t vtxZ, Double_t refMult)
Int_t fConfiguration
Ds decay option (generation level)
Int_t CheckReflexion(Char_t isSign)
Bool_t IsEventSelected(AliVEvent *event)
Int_t fLctoV0bachelorOption
resonant deacy channel to be used if the CF should be run on resonant channels only ...
Bool_t fRejectIfNoQuark
selection flag for fakes tracks
void SetUsePID(Bool_t flag=kTRUE)
void SetPtWeightsFromFONLL276overLHC12a17b()
TH1I * fHistEventsProcessed
pointer to the CF manager
virtual void PrintAll() const
TString fDauNames
D meson name.
Bool_t RecoAcceptStep(AliESDtrackCuts **trackCuts) const
void SetPtWeightsFromFONLL7overLHC13e2fix()
Int_t fCountRecoPID
Reco particle found that satisfy cuts in PPR.
Bool_t fUseMultRatioAsWeight
flag to decide whether to use Ncharged weights != 1 when filling the container or not ...
static Int_t GetGeneratedPhysicalPrimariesInEtaRange(TClonesArray *arrayMC, Double_t mineta, Double_t maxeta)
void SetPtWeightsFromFONLL5overLHC13d3()
Bool_t IsSelected(TObject *obj)
Int_t fEvents
Reco PID step.
Bool_t MCRefitStep(AliAODEvent *aodEvent, AliESDtrackCuts **trackCuts) const
Bool_t fUseCutsForTMVA
flag to use additional cuts needed for Lc –> K0S + p, TMVA
Int_t fDecayChannel
n. of events
Bool_t GetIsUsePID() const
void UserExec(Option_t *option)
Int_t fCountRecoPPR
Reco particle found that satisfy cuts in n. of ITS clusters.
Bool_t fUseMCVertex
flag to remove events not geenrated with PYTHIA
void SetTriggerClass(TString trclass0, TString trclass1="")
Int_t fDsOption
flag to use MC vertex (useful when runnign in pp)
Bool_t fUseNchWeight
flag to decide whether to use z-vtx weights != 1 when filling the container or not ...
Class to compute variables for correction framework // for 3-body decays of D mesons (D+...
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
void SetPtWeightsFromFONLL7overLHC10f6a()
TProfile * GetEstimatorHistogram(const AliVEvent *event)
void SetConfiguration(Int_t configuration)
void SetMultiplicity(Double_t multiplicity)
void SetMCPrimaryVertex(Double_t zMCVertex)
Int_t fMultiplicityEstimator
PDG code.
void UserCreateOutputObjects()
ANALYSIS FRAMEWORK STUFF to loop on data and fill output objects.
TH1F * fHistoMCNch
histogram with measured Nch distribution (pp 7 TeV)
TProfile * fMultEstimatorAvg[4]
Definition of the multiplicity estimator: kNtrk10=0, kNtrk10to16=1, kVZERO=2.
void SetPtWeightsFromFONLL276overLHC10f6a()
Double_t fWeight
flag to decide whether to use pt-weights != 1 when filling the container or not
TH1F * fHistoMeasNch
user-defined histogram to calculate the Pt weights
Bool_t ProcessLctoV0Bachelor(Int_t returnCodeDs) const
Class for HF corrections as a function of many variables and step.