50 #include "AliCFManager.h" 51 #include "AliCFContainer.h" 53 #include "AliInputEventHandler.h" 54 #include "AliAnalysisManager.h" 55 #include "AliAODHandler.h" 56 #include "AliAODEvent.h" 62 #include "AliAODMCParticle.h" 63 #include "AliAODMCHeader.h" 64 #include "AliESDtrack.h" 66 #include "THnSparse.h" 67 #include "AliESDtrackCuts.h" 82 #include "AliAnalysisDataSlot.h" 83 #include "AliAnalysisDataContainer.h" 84 #include "AliAnalysisTaskSE.h" 85 #include "AliPIDResponse.h" 96 fHistEventsProcessed(0x0),
105 fCountRecoITSClusters(0),
110 fFillFromGenerated(kFALSE),
111 fOriginDselection(0),
112 fAcceptanceUnf(kTRUE),
116 fUseFlatPtWeight(kFALSE),
118 fUseNchWeight(kFALSE),
119 fUseTrackletsWeight(kFALSE),
120 fUseMultRatioAsWeight(kFALSE),
125 fCentralitySelection(kTRUE),
127 fRejectIfNoQuark(kTRUE),
128 fUseMCVertex(kFALSE),
131 fConfiguration(kCheetah),
134 fHistoMotherPtWeight(0x0),
138 fLctoV0bachelorOption(1),
139 fGenLctoV0bachelorOption(0),
140 fUseSelectionBit(kTRUE),
142 fMultiplicityEstimator(kNtrk10),
144 fZvtxCorrectedNtrkEstimator(kFALSE),
147 fUseAdditionalCuts(kFALSE),
148 fUseCutsForTMVA(kFALSE),
149 fUseCascadeTaskForLctoV0bachelor(kFALSE),
150 fCutOnMomConservation(0.00001),
240 DefineOutput(1,TH1I::Class());
241 DefineOutput(2,AliCFContainer::Class());
242 DefineOutput(3,THnSparseD::Class());
243 DefineOutput(4,AliRDHFCuts::Class());
245 DefineOutput(5,TList::Class());
246 DefineOutput(6,THnSparseF::Class());
247 DefineOutput(7,TH3F::Class());
248 DefineOutput(8,TH1F::Class());
249 DefineOutput(9,TH1F::Class());
250 DefineOutput(10,TH1F::Class());
251 DefineOutput(11,TList::Class());
252 DefineOutput(12,TList::Class());
264 AliAnalysisTaskSE::operator=(c) ;
384 for(
Int_t i=0; i<4; i++) {
396 if (fDebug>1) printf(
"AliCFTaskVertexingHFCutVarFDSub::Init()");
397 if(
fUseWeight &&
fUseZWeight) { AliFatal(
"Can not use at the same time pt and z-vtx weights, please choose");
return; }
398 if(
fUseWeight &&
fUseNchWeight) { AliInfo(
"Beware, using at the same time pt and Nch weights, please check"); }
404 AliFatal(
"No cuts defined - Exiting...");
515 AliFatal(
"The decay channel MUST be defined according to AliCFVertexing::DecayChannel - Exiting...");
519 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
521 copyfCuts->SetName(nameoutput);
524 PostData(4, copyfCuts);
527 AliFatal(
"Failing initializing AliRDHFCuts object - Exiting...");
536 period[0] =
"LHC13b"; period[1] =
"LHC13c";
539 period[0] =
"LHC10b"; period[1] =
"LHC10c"; period[2] =
"LHC10d"; period[3] =
"LHC10e";
543 for(
Int_t i=0; i<nProfiles; i++){
546 hprof->SetName(Form(
"ProfileTrkVsZvtx%s\n",period[i].
Data()));
571 PostData(2,
fCFManager->GetParticleContainer()) ;
574 AliDebug(3,Form(
"*** Processing event %d\n",
fEvents));
577 AliWarning(
"Flag to fill container with generated value ON ---> dca, d0pi, d0K, d0xd0, cosPointingAngle will be set as dummy!");
581 Error(
"UserExec",
"NO EVENT FOUND!");
587 TClonesArray *arrayBranch=0;
589 if(!aodEvent && AODEvent() && IsStandardAOD()) {
592 aodEvent =
dynamic_cast<AliAODEvent*
> (AODEvent());
595 AliAODHandler* aodHandler = (AliAODHandler*)
596 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
597 if(aodHandler->GetExtensions()) {
598 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
603 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject(
"D0toKpi");
607 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Dstar");
611 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject(
"CascadesHF");
617 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
621 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm4Prong");
632 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject(
"D0toKpi");
636 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject(
"Dstar");
640 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject(
"CascadesHF");
646 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject(
"Charm3Prong");
650 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject(
"Charm4Prong");
658 AliAODVertex *aodVtx = (AliAODVertex*)aodEvent->GetPrimaryVertex();
660 AliDebug(3,
"The event was skipped due to missing vertex");
665 AliError(
"Could not find array of HF vertices");
678 TClonesArray* mcArray =
dynamic_cast<TClonesArray*
>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
680 AliError(
"Could not find Monte-Carlo in AOD");
685 Int_t icountReco = 0;
686 Int_t icountVertex = 0;
687 Int_t icountRefit = 0;
688 Int_t icountRecoAcc = 0;
689 Int_t icountRecoITSClusters = 0;
690 Int_t icountRecoPPR = 0;
691 Int_t icountRecoPID = 0;
694 AliAODMCHeader *mcHeader =
dynamic_cast<AliAODMCHeader*
>(aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
696 AliError(
"Could not find MC Header in AOD");
762 AliError(
"No AliCFVertexingHF initialized");
763 delete[] containerInput;
764 delete[] containerInputMC;
768 Double_t zPrimVertex = aodVtx ->GetZ();
769 Double_t zMCVertex = mcHeader->GetVtxZ();
770 Int_t runnumber = aodEvent->GetRunNumber();
776 nTracklets = (
Double_t)nTrackletsEta10;
785 nTracklets = (
Double_t)nTrackletsEta10Corr;
797 AliDebug(2,Form(
"Using Nch weights, Mult=%d Weight=%f\n",nChargedMCPhysicalPrimary,
fWeight));
802 AliDebug(3,Form(
"z coordinate of MC vertex = %f, it was required to be within [-%f, +%f], skipping event", zMCVertex,
fCuts->
GetMaxVtxZ(),
fCuts->
GetMaxVtxZ()));
803 delete[] containerInput;
804 delete[] containerInputMC;
809 if(aodEvent->GetTriggerMask()==0 &&
810 (runnumber>=195344 && runnumber<=195677)){
811 AliDebug(3,
"Event rejected because of null trigger mask");
812 delete[] containerInput;
813 delete[] containerInputMC;
818 AliESDtrackCuts** trackCuts =
new AliESDtrackCuts*[cfVtxHF->
GetNProngs()];
856 delete[] containerInput;
857 delete[] containerInputMC;
873 AliAODVZERO *vzeroAOD = (AliAODVZERO*)aodEvent->GetVZEROData();
874 if(vzeroAOD) vzeroMult = vzeroAOD->GetMTotV0A() + vzeroAOD->GetMTotV0C();
883 for (
Int_t iPart=0; iPart<mcArray->GetEntriesFast(); iPart++) {
884 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(iPart));
886 AliError(
"Failed casting particle from MC array!, Skipping particle");
891 if ((((mcPart->GetPdgCode()%1000)/100==5||(mcPart->GetPdgCode()%1000)/100==-5)) &&
892 (mcPart->Y()<1.)&&(mcPart->Y()>-1.)) {
897 if (TMath::Abs(mcPart->GetPdgCode())==5&&TMath::Abs(mcPart->Y())<1.)
fhBquarkPt->Fill(mcPart->Pt());
898 if (TMath::Abs(mcPart->GetPdgCode())==4&&TMath::Abs(mcPart->Y())<1.)
fhCquarkPt->Fill(mcPart->Pt());
904 if (!
fCFManager->CheckParticleCuts(0, mcPart)) {
905 AliDebug(2,
"Check the MC-level cuts - not desidered particle");
909 AliDebug(3, Form(
"\n\n---> COOL! we found a particle (particle %d)!!! with PDG code = %d \n\n", iPart, mcPart->GetPdgCode()));
915 AliDebug(2,Form(
"Impossible to set the label array for particle %d (decaychannel = %d)", iPart,
fDecayChannel));
921 AliDebug(2,Form(
"Check on the family wrong for particle %d!!! (decaychannel = %d)", iPart,
fDecayChannel));
925 AliDebug(2,Form(
"Check on the family OK for particle %d!!! (decaychannel = %d)", iPart,
fDecayChannel));
929 Bool_t mcContainerFilled = cfVtxHF -> FillMCContainer(containerInputMC);
930 AliDebug(2, Form(
"particle = %d mcContainerFilled = %d", iPart, mcContainerFilled));
931 if (mcContainerFilled) {
934 AliDebug(2,
"Using Histogram as Pt weight function");
938 AliDebug(2,
"Using function");
942 AliDebug(2,
"Using FONLL");
945 AliDebug(2,Form(
"pt = %f, weight = %f",containerInputMC[0],
fWeight));
948 AliDebug(3, Form(
"Not in limited acceptance, containerInputMC[0] = %f, containerInputMC[1] = %f", containerInputMC[0], containerInputMC[1]));
952 AliDebug(3, Form(
"YES!! in limited acceptance, containerInputMC[0] = %f, containerInputMC[1] = %f", containerInputMC[0],containerInputMC[1]));
956 if (TMath::Abs(containerInputMC[1]) < 0.5) {
958 AliDebug(3,
"MC Lim Acc container filled\n");
964 AliDebug(3,
"MC container filled \n");
969 Bool_t mcAccepStep = cfVtxHF-> MCAcceptanceStep();
972 AliDebug(3,
"MC acceptance cut passed\n");
980 AliDebug(3,
"Vertex cut passed and container filled\n");
987 AliDebug(3,
"MC Refit cut passed and container filled\n");
991 AliDebug(3,
"MC Refit cut not passed\n");
996 AliDebug (3,
"MC vertex step not passed\n");
1001 AliDebug (3,
"MC in acceptance step not passed\n");
1006 AliDebug (3,
"MC container not filled\n");
1010 if (cquarks<2) AliDebug(2,Form(
"Event with %d c-quarks", cquarks));
1011 AliDebug(2,Form(
"Found %i MC particles that are %s!!",icountMC,
fPartName.Data()));
1012 AliDebug(2,Form(
"Found %i MC particles that are %s and satisfy Acc cuts!!",icountAcc,
fPartName.Data()));
1013 AliDebug(2,Form(
"Found %i MC particles that are %s and satisfy Vertex cuts!!",icountVertex,
fPartName.Data()));
1014 AliDebug(2,Form(
"Found %i MC particles that are %s and satisfy Refit cuts!!",icountRefit,
fPartName.Data()));
1022 AliDebug(2,Form(
"Found %d vertices for decay channel %d",arrayBranch->GetEntriesFast(),
fDecayChannel));
1024 for(
Int_t iCandid = 0; iCandid<arrayBranch->GetEntriesFast();iCandid++){
1053 AliDebug(2,
"Using Histogram as mother pt weight function");
1056 AliDebug(2,Form(
"mother pt = %f, weight = %f", motherPt,
fWeight));
1058 else AliDebug(2,
"Couldn't find mother pt dependend weights");
1068 if (!signAssociation){
1074 if (isPartOrAntipart == 0){
1075 AliDebug(2, Form(
"The candidate pdg code doesn't match the requirement set in the task (fSign = %d)",
fSign));
1080 AliDebug(3,Form(
"iCandid=%d - signAssociation=%d, isPartOrAntipart=%d",iCandid, signAssociation, isPartOrAntipart));
1083 AliDebug(3, Form(
"CF task: RecoContFilled for candidate %d is %d", iCandid, (
Int_t)recoContFilled));
1084 if (recoContFilled){
1089 AliDebug(2,
"Using Histogram as Pt weight function");
1093 AliDebug(2,
"Using function");
1097 AliDebug(2,
"Using FONLL");
1100 AliDebug(2, Form(
"pt = %f, weight = %f",containerInput[0],
fWeight));
1109 if (recoStep) AliDebug(2, Form(
"particle = %d --> CF task: Reco step for candidate %d is %d", iCandid, iCandid, (
Int_t)recoStep));
1114 Bool_t isBitSelected = kTRUE;
1124 if(!((dynamic_cast<AliAODRecoCascadeHF*>(charmCandidate))->CheckCascadeFlags())) isBitSelected = kFALSE;
1132 if (recoStep && recoContFilled && vtxCheck){
1135 AliDebug(3,
"Reco step passed and container filled\n");
1139 if (recoAcceptanceStep) {
1142 AliDebug(3,
"Reco acceptance cut passed and container filled\n");
1146 Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(
fPDGcode,fill);
1152 if (recoITSnCluster){
1154 icountRecoITSClusters++;
1155 AliDebug(3,
"Reco n ITS cluster cut passed and container filled\n");
1158 Int_t recoAnalysisCuts = -1, recoPidSelection = -1;
1164 if(keepDs) recoAnalysisCuts=3;
1168 if (keepLctoV0bachelor) recoAnalysisCuts=3;
1170 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
1171 AliPIDResponse* pidResponse = inputHandler->GetPIDResponse();
1178 Bool_t tempAn=(recoAnalysisCuts == 3 || recoAnalysisCuts == isPartOrAntipart);
1180 if (
fDecayChannel == 32) tempAn=(recoAnalysisCuts >0 || recoAnalysisCuts == isPartOrAntipart);
1185 AliDebug(3,
"Reco Analysis cuts passed and container filled \n");
1193 if(keepDs) recoPidSelection=3;
1196 if (keepLctoV0bachelor) recoPidSelection=3;
1199 Bool_t tempPid=(recoPidSelection == 3 || recoPidSelection == isPartOrAntipart);
1201 if (
fDecayChannel == 32) tempPid=(recoPidSelection >0 || recoPidSelection == isPartOrAntipart);
1207 if (isPartOrAntipart == 1){
1209 }
else if (isPartOrAntipart == 2){
1212 if ((weigPID < 0) || (weigPID > 1)) weigPID = 0.;
1216 Int_t labDau0=((AliAODTrack*)charmCandidate->GetDaughter(0))->GetLabel();
1217 AliAODMCParticle* firstDau=(AliAODMCParticle*)mcArray->UncheckedAt(TMath::Abs(labDau0));
1219 Int_t pdgCode0=TMath::Abs(firstDau->GetPdgCode());
1222 }
else if(pdgCode0==211){
1225 if ((weigPID < 0) || (weigPID > 1)) weigPID = 0.;
1238 AliDebug(3,
"Reco PID cuts passed and container filled \n");
1241 Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(
fPDGcode,fill);
1246 AliDebug(3,
"Analysis Cuts step not passed \n");
1252 AliDebug(3,
"PID selection not passed \n");
1258 AliDebug(3,
"Number of ITS cluster step not passed\n");
1264 AliDebug(3,
"Reco acceptance step not passed\n");
1270 AliDebug(3,
"Reco step not passed\n");
1287 delete[] containerInput;
1288 delete[] containerInputMC;
1294 delete [] trackCuts;
1307 AliAnalysisTaskSE::Terminate();
1310 AliInfo(Form(
"Found %i MC particles that are %s in MC and satisfy Acc cuts, in %d events",
fCountAcc,
fPartName.Data(),
fEvents));
1311 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));
1312 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));
1320 AliCFContainer *cont=
dynamic_cast<AliCFContainer*
> (GetOutputData(2));
1322 printf(
"CONTAINER NOT FOUND\n");
1329 Int_t nvarToPlot = 0;
1332 for (
Int_t ih = 0; ih<3; ih++){
1338 h[ih] =
new TH1D[nvarToPlot];
1340 for(
Int_t iC=1;iC<nvarToPlot; iC++){
1342 h[0][iC] = *(cont->ShowProjection(iC,0));
1344 h[1][iC] = *(cont->ShowProjection(iC,1));
1346 h[2][iC] = *(cont->ShowProjection(iC,4));
1352 for (
Int_t ih = 0; ih<3; ih++){
1353 h[ih] =
new TH1D[nvarToPlot];
1355 for(
Int_t iC=0;iC<nvarToPlot; iC++){
1357 h[0][iC] = *(cont->ShowProjection(iC,0));
1359 h[1][iC] = *(cont->ShowProjection(iC,1));
1361 h[2][iC] = *(cont->ShowProjection(iC,4));
1369 titles =
new TString[nvarToPlot];
1370 titles[0]=
"pT_Dplus (GeV/c)";
1371 titles[1]=
"rapidity";
1372 titles[2]=
"phi (rad)";
1373 titles[3]=
"cT (#mum)";
1374 titles[4]=
"cosPointingAngle";
1375 titles[5]=
"pT_1 (GeV/c)";
1376 titles[6]=
"pT_2 (GeV/c)";
1377 titles[7]=
"pT_3 (GeV/c)";
1378 titles[8]=
"d0_1 (#mum)";
1379 titles[9]=
"d0_2 (#mum)";
1380 titles[10]=
"d0_3 (#mum)";
1381 titles[11]=
"zVertex (cm)";
1384 titles =
new TString[nvarToPlot];
1385 titles[0]=
"p_{T}(#Lambda_{c}) [GeV/c]";
1386 titles[1]=
"y(#Lambda_{c})";
1387 titles[2]=
"#varphi(#Lambda_{c}) [rad]";
1388 titles[3]=
"onTheFlyStatusV0";
1389 titles[4]=
"z_{vtx} [cm]";
1390 titles[5]=
"centrality";
1392 titles[7]=
"multiplicity";
1394 titles[8]=
"p(bachelor) [GeV/c]";
1395 titles[9]=
"p_{T}(V0) [GeV/c]";
1397 titles[11]=
"#varphi(V0) [rad]";
1398 titles[12]=
"m_{inv}(#pi^{+}#pi^{+}) [GeV/c^{2}]";
1399 titles[13]=
"dcaV0 (nSigma)";
1400 titles[14]=
"cosine pointing angle (V0)";
1401 titles[15]=
"cosine pointing angle (#Lambda_{c})";
1406 titles =
new TString[nvarToPlot];
1407 titles[0]=
"pT_D0 (GeV/c)";
1408 titles[1]=
"rapidity";
1409 titles[2]=
"cosThetaStar";
1410 titles[3]=
"pT_pi (GeV/c)";
1411 titles[4]=
"pT_K (Gev/c)";
1412 titles[5]=
"cT (#mum)";
1413 titles[6]=
"dca (#mum)";
1414 titles[7]=
"d0_pi (#mum)";
1415 titles[8]=
"d0_K (#mum)";
1416 titles[9]=
"d0xd0 (#mum^2)";
1417 titles[10]=
"cosPointingAngle";
1418 titles[11]=
"phi (rad)";
1423 titles =
new TString[nvarToPlot];
1425 titles[0]=
"p_{T}(#Lambda_{c}) [GeV/c]";
1426 titles[1]=
"y(#Lambda_{c})";
1427 titles[2]=
"#varphi(#Lambda_{c}) [rad]";
1428 titles[3]=
"onTheFlyStatusV0";
1429 titles[4]=
"z_{vtx} [cm]";
1430 titles[5]=
"centrality";
1432 titles[7]=
"multiplicity";
1434 titles[0]=
"pT_candidate (GeV/c)";
1435 titles[1]=
"rapidity";
1436 titles[2]=
"cT (#mum)";
1438 titles[4]=
"z_{vtx}";
1439 titles[5]=
"centrality";
1441 titles[7]=
"multiplicity";
1445 Int_t markers[16]={20,24,21,25,27,28,
1449 for(
Int_t iC=0;iC<nvarToPlot; iC++){
1450 for(
Int_t iStep=0;iStep<3;iStep++){
1451 h[iStep][iC].SetTitle(titles[iC].
Data());
1452 h[iStep][iC].GetXaxis()->SetTitle(titles[iC].
Data());
1453 Double_t maxh=h[iStep][iC].GetMaximum();
1454 h[iStep][iC].GetYaxis()->SetRangeUser(0,maxh*1.2);
1455 h[iStep][iC].SetMarkerStyle(markers[iC]);
1456 h[iStep][iC].SetMarkerColor(colors[iStep]);
1460 gStyle->SetCanvasColor(0);
1461 gStyle->SetFrameFillColor(0);
1462 gStyle->SetTitleFillColor(0);
1463 gStyle->SetStatColor(0);
1466 TCanvas * c1 =
new TCanvas(Form(
"c1New_%d",
fDecayChannel),
"Vars 0, 1, 2, 3",1100,1200);
1469 for(
Int_t iVar=0; iVar<4; iVar++){
1471 h[0][iVar].DrawCopy(
"p");
1473 h[1][iVar].DrawCopy(
"p");
1475 h[2][iVar].DrawCopy(
"p");
1478 TCanvas * c2 =
new TCanvas(Form(
"c2New_%d",
fDecayChannel),
"Vars 4, 5, 6, 7",1100,1200);
1481 for(
Int_t iVar=4; iVar<8; iVar++){
1483 h[0][iVar].DrawCopy(
"p");
1485 h[1][iVar].DrawCopy(
"p");
1487 h[2][iVar].DrawCopy(
"p");
1491 TCanvas * c3 =
new TCanvas(Form(
"c3New_%d",
fDecayChannel),
"Vars 8, 9, 10, 11",1100,1200);
1494 for(
Int_t iVar=8; iVar<12; iVar++){
1496 h[0][iVar].DrawCopy(
"p");
1498 h[1][iVar].DrawCopy(
"p");
1500 h[2][iVar].DrawCopy(
"p");
1503 TCanvas * c4 =
new TCanvas(Form(
"c4New_%d",
fDecayChannel),
"Vars 12, 13, 14, 15",1100,1200);
1506 for(
Int_t iVar=12; iVar<16; iVar++){
1508 h[0][iVar].DrawCopy(
"p");
1510 h[1][iVar].DrawCopy(
"p");
1512 h[2][iVar].DrawCopy(
"p");
1530 TFile* file_projection =
new TFile(
"CFtaskHFprojectionNew.root",
"RECREATE");
1535 for(
Int_t iC=0;iC<nvarToPlot; iC++){
1536 for(
Int_t iStep=0;iStep<3;iStep++){
1537 h[iStep][iC].Write(Form(
"Step%d_%s",iStep,titles[iC].
Data()));
1540 file_projection->Close();
1541 for (
Int_t ih = 0; ih<3; ih++)
delete [] h[ih];
1553 Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s\n", GetName());
1557 const char* nameoutput=GetOutputSlot(1)->GetContainer()->GetName();
1571 fhBptCutVar =
new TH1F(
"hBptCutVar",
"B meson #it{p}_{T} spectrum;#it{p}_{T};Counts (a.u.)",201,0.,50.25);
1572 fhBquarkPt =
new TH1F(
"hBquarkPt",
"B quark #it{p}_{T} spectrum;#it{p}_{T};Counts (a.u.)",201,0.,50.25);
1573 fhCquarkPt =
new TH1F(
"hCquarkPt",
"C quark #it{p}_{T} spectrum;#it{p}_{T};Counts (a.u.)",201,0.,50.25);
1576 PostData( 2,
fCFManager->GetParticleContainer()) ;
1594 fFuncWeight=
new TF1(
"funcWeight",
"[0]+[1]*TMath::Exp(-[2]*x)",0.,50.);
1606 fFuncWeight=
new TF1(
"funcWeight",
"[0]+[1]/TMath::Power(x,[2])",0.05,50.);
1618 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.);
1619 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);
1629 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.);
1630 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);
1639 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.);
1640 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);
1650 const Int_t nBins=48;
1652 Double_t weights[nBins] = { 0.958796, 0.94262, 1.00746, 1.00264, 1.0103, 1.00033, 0.970773, 0.925759, 0.873651, 0.827537, 0.793838, 0.770711, 0.753224, 0.740698, 0.729354, 0.720129, 0.71487, 0.711469, 0.706371, 0.704551, 0.705003, 0.702572, 0.704875, 0.706797, 0.70574, 0.710273, 0.714451, 0.716691, 0.720462, 0.719736, 0.722672, 0.724752, 0.731169, 0.734225, 0.741758, 0.749343, 0.741116, 0.747457, 0.746682, 0.754226, 0.763797, 0.765175, 0.762687, 0.772638, 0.767542, 0.779808, 0.782834, 0.781626 };
1666 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.);
1667 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);
1676 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.);
1677 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);
1686 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.);
1687 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);
1696 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.);
1697 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);
1706 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.);
1707 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);
1716 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.);
1717 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);
1740 Double_t func1[4] = {0.322643,2.96275,2.30301,2.5};
1741 Double_t func2[4] = {0.36609,1.94635,1.40463,2.5};
1746 AliDebug(2,Form(
"pt = %f, FONLL = %f, Pythia = %f, ratio = %f",pt,dndpt_func1,dndpt_func2,dndpt_func1/dndpt_func2));
1747 return dndpt_func1/dndpt_func2;
1757 Double_t denom = TMath::Power((pt/par[1]), par[3] );
1758 Double_t dNdpt = par[0]*pt/TMath::Power(1.+denom, par[2]);
1773 if( (histobin>0) && (histobin<=histoNbins) ) {
1790 if( (histobin>0) && (histobin<=histoNbins) ) {
1804 Int_t labDau0=((AliAODTrack*)charmCandidate->GetDaughter(0))->GetLabel();
1805 if (labDau0<0) labDau0*=-1;
1806 AliAODMCParticle* firstDau=(AliAODMCParticle*)mcArray->UncheckedAt(labDau0);
1807 Int_t labMother=firstDau->GetMother();
1808 if (labMother<0) labMother*=-1;
1809 AliAODMCParticle* mother=(AliAODMCParticle*)mcArray->UncheckedAt(labMother);
1810 Int_t pdgMother=mother->GetPdgCode();
1811 while ((pdgMother%1000)/100==4 || (pdgMother%10000)/1000==4) {
1813 labMother=mother->GetMother();
1814 if (labMother<0) labMother*=-1;
1815 mother=(AliAODMCParticle*)mcArray->UncheckedAt(labMother);
1816 pdgMother=mother->GetPdgCode();
1818 if ((pdgMother%1000)/100!=5 && (pdgMother%10000)/1000!=5) {
1819 AliDebug(3,
"Found strange decay, expected the mother to be a beauty hadron!");
1822 motherPt=mother->Pt();
1834 if(runnumber>146824 || runnumber<146803)
return 1.0;
1836 Double_t func1[3] = {1.0, -0.5, 6.5 };
1837 Double_t func2[3] = {1.0, -0.5, 5.5 };
1842 return dzFunc1/dzFunc2;
1853 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]);
1862 if(nch<=0)
return 0.;
1866 Double_t weight = pMC>0 ? pMeas/pMC : 0.;
1879 Double_t nchbins[82]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1880 10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1881 20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1882 30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1883 40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1884 50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1885 60.50,62.50,64.50,66.50,68.50,70.50,72.50,74.50,76.50,78.50,
1886 80.50,82.50,84.50,86.50,88.50,90.50,92.50,94.50,96.50,98.50,
1888 Double_t pch[81]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1889 0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1890 0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1891 0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1892 0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1893 0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1894 0.000296,0.000265,0.000193,0.00016,0.000126,0.0000851, 0.0000676,0.0000537,0.0000426, 0.0000338,
1895 0.0000268,0.0000213,0.0000166,0.0000133,0.0000106,0.00000837,0.00000662, 0.00000524,0.00000414, 0.00000327,
1900 for(
Int_t i=0; i<81; i++){
1910 if(recoAnalysisCuts > 0){
1911 Int_t isKKpi=recoAnalysisCuts&1;
1912 Int_t ispiKK=recoAnalysisCuts&2;
1913 Int_t isPhiKKpi=recoAnalysisCuts&4;
1914 Int_t isPhipiKK=recoAnalysisCuts&8;
1915 Int_t isK0starKKpi=recoAnalysisCuts&16;
1916 Int_t isK0starpiKK=recoAnalysisCuts&32;
1918 if(isKKpi && isPhiKKpi) keep=kTRUE;
1919 if(ispiKK && isPhipiKK) keep=kTRUE;
1922 if(isKKpi && isK0starKKpi) keep=kTRUE;
1923 if(ispiKK && isK0starpiKK) keep=kTRUE;
1933 if(recoAnalysisCuts > 0){
1935 Int_t isK0Sp = recoAnalysisCuts&1;
1936 Int_t isLambdaBarpi = recoAnalysisCuts&2;
1937 Int_t isLambdapi = recoAnalysisCuts&4;
1940 if(isK0Sp) keep=kTRUE;
1943 if(isLambdaBarpi) keep=kTRUE;
1946 if(isLambdapi) keep=kTRUE;
1949 if (isK0Sp || isLambdaBarpi || isLambdapi) keep=kTRUE;
1962 Int_t runNo =
event->GetRunNumber();
1967 if (runNo>195343 && runNo<195484) period = 0;
1968 if (runNo>195528 && runNo<195678) period = 1;
1969 if (period<0 || period>1)
return 0;
1971 if(runNo>114930 && runNo<117223) period = 0;
1972 if(runNo>119158 && runNo<120830) period = 1;
1973 if(runNo>122373 && runNo<126438) period = 2;
1974 if(runNo>127711 && runNo<130841) period = 3;
1975 if(period<0 || period>3)
return 0;
void SetPtWeightsFromFONLL5overLHC13d3()
TH1F * fhCquarkPt
b quark pt spectrum
Int_t fNvar
flag to use directly the ratio of the distributions (fHistoMCNch) instead of computing it ...
void SetCentralityValue(Float_t centValue)
Bool_t fAcceptanceUnf
flag to select D0 origins. 0 Only from charm 1 only from beauty 2 both from charm and beauty ...
virtual AliESDtrackCuts * GetTrackCutsV0daughters() const
void SetFillFromGenerated(Bool_t flag)
Bool_t fRejectIfNoQuark
selection flag for fakes tracks
Int_t fCountRecoAcc
Reco particle found that satisfy cuts.
void SetPtWeightsFromDataPbPb276overLHC12a17a()
virtual AliESDtrackCuts * GetTrackCutsSoftPi() const
Bool_t fFillFromGenerated
decay channel to configure the task
Int_t MCcquarkCounting(AliAODMCParticle *mcPart) const
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
void Terminate(Option_t *)
void SetPtWeightsFromFONLL7overLHC12a12bis()
Class for HF corrections as a function of many variables and steps For D* and other cascades...
Int_t IsEventSelectedInCentrality(AliVEvent *event)
Bool_t HasSelectionBit(Int_t i) const
Class for HF corrections as a function of many variables and step.
Bool_t fIsPPData
flag to use the z-vtx corrected (if not use uncorrected) multiplicity estimator
AliHFsubtractBFDcuts * fObjSpr
cut on momentum conservation
Bool_t FillRecoContainer(Double_t *containerInput)
Double_t fWeight
flag to decide whether to use pt-weights != 1 when filling the container or not
void UnsetOwnPrimaryVtx()
Double_t GetMotherPtFromRecoDecay(AliAODRecoDecayHF *charmCandidate, TClonesArray *mcArray)
Int_t fConfiguration
Ds decay option (generation level)
void SetPtWeightsFromFONLL7overLHC12a12()
void SetPtWeightsFromFONLL7overLHC13e2fix()
void SetPtWeightsFromFONLL5overLHC10f6a()
THnSparseF * GetSparseMC() const
Int_t fCountRecoITSClusters
Reco particle found that satisfy cuts in requested acceptance.
Bool_t fIsPPbData
flag for pp data (not checking centrality)
Double_t dNdptFit(Float_t pt, Double_t *par)
Class for storing and handling D0 meson candidates properties // for estimating the feed-down fractio...
void SetRejectCandidateIfNotFromQuark(Bool_t opt)
Double_t GetNchWeight(Int_t nch)
virtual Bool_t SetLabelArray()
slow configuration, all variables
Double_t GetPtWeightFromHistogram(Float_t pt)
Bool_t fCentralitySelection
flag to decide wheter to keep D0 only (0), D0bar only (1), or both D0 and D0bar (2) ...
Double_t InvMassD0() const
UInt_t fPDGcode
flag to use selection bit
void SetPtWeightsFromFONLL276overLHC12a17a()
Bool_t fUseMCVertex
flag to remove events not geenrated with PYTHIA
void UserExec(Option_t *option)
TH1F * fHistoMCNch
histogram with measured Nch distribution (pp 7 TeV)
Double_t GetMaxVtxZ() const
Double_t GetMotherPtWeightFromHistogram(Float_t motherPt)
void SetFillMC(Bool_t fillMC=kTRUE)
Int_t fDecayChannel
n. of events
void SetPtWeightsFromFONLL276overLHC12a17b()
Int_t fCountMC
list of profile histos for z-vtx correction
TString fDauNames
D meson name.
AliCFTaskVertexingHFCutVarFDSub()
multiplicity estimators
TH1F * fHistoMeasNch
user-defined histogram to calculate the Mother Pt weights
Double_t GetWeight(Float_t pt)
TH1F * fHistoPtWeight
user-defined function to be used to calculate weights
Class for cuts on AOD reconstructed D+->Kpipi.
TF1 * fFuncWeight
configuration (slow / fast) of the CF –> different variables will be allocated (all / reduced number...
TH1F * fhBptCutVar
Generator level histogram D0 pt, Nprongs of the decay, Mother pt.
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
Int_t fCountReco
Reco particle found that satisfy kTPCrefit and kITSrefit.
Bool_t ProcessDs(Int_t returnCodeDs) const
void SetMinCentrality(Float_t minCentrality=0.)
THnSparseF * GetSparseMCgen() const
Bool_t fUseAdditionalCuts
flag for pPb data (used for multiplicity corrections)
Bool_t fUseMultRatioAsWeight
flag to decide whether to use Ncharged weights != 1 when filling the container or not ...
Int_t fGenLctoV0bachelorOption
Lc->V0+bachelor decay option (selection level)
TH1F * fHistoMotherPtWeight
user-defined histogram to calculate the Pt weights
Bool_t fUseTrackletsWeight
flag to decide whether to use Ncharged weights != 1 when filling the container or not ...
Int_t fEvents
Reco PID step.
Double_t DodzFit(Float_t z, Double_t *par)
TH1F * fhBquarkPt
B0 pt spectrum.
AliAODVertex * GetOwnPrimaryVtx() const
Int_t fMultiplicityEstimator
PDG code.
AliESDtrackCuts * GetTrackCuts() const
AliCFManager * fCFManager
Float_t GetCentrality(AliAODEvent *aodEvent)
TList * GetDecayStrings()
Int_t fLctoV0bachelorOption
resonant deacy channel to be used if the CF should be run on resonant channels only ...
Double_t InvMassD0bar() const
void SetFakeSelection(Int_t fakeSel)
Bool_t fUseSelectionBit
Lc->V0+bachelor decay option (generation level)
Bool_t fZvtxCorrectedNtrkEstimator
refrence multiplcity (period b)
Int_t fCountRefit
Reco particle found that satisfy vertex constrained.
Double_t fRefMult
TProfile with mult vas. Z per period.
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)
void SetMaxCentrality(Float_t maxCentrality=100.)
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
void SetRecoPrimVertex(Double_t zPrimVertex)
Double_t GetZWeight(Float_t z, Int_t runnumber)
TList * fQAHists
List with B hadron decays (unique entries)
virtual ~AliCFTaskVertexingHFCutVarFDSub()
void SetMCCandidateParam(Int_t label)
TH1I * fHistEventsProcessed
pointer to the CF manager
Int_t fCountRecoPPR
Reco particle found that satisfy cuts in n. of ITS clusters.
Bool_t CheckMCPartFamily(AliAODMCParticle *, TClonesArray *) const
Bool_t fUseCutsForTMVA
flag to use additional cuts needed for Lc –> K0S + p, TMVA
virtual Bool_t SetRecoCandidateParam(AliAODRecoDecayHF *)
static Double_t GetCorrectedNtracklets(TProfile *estimatorAvg, Double_t uncorrectedNacc, Double_t vtxZ, Double_t refMult)
Int_t CheckReflexion(Char_t isSign)
Bool_t IsEventSelected(AliVEvent *event)
Bool_t fUseMotherPtWeight
flag to decide whether to use pt-weights != 1 when filling the container or not
Bool_t fUseZWeight
flag to decide to use a flat pt shape
void SetUsePID(Bool_t flag=kTRUE)
Char_t fSign
daughter in fin state
virtual void PrintAll() const
void FillSparses(AliAODRecoDecayHF2Prong *dzeroPart, Int_t isSelected, Double_t pt=-1, Double_t massD0=-1, Double_t massD0bar=-1, Double_t weight=1., TClonesArray *mcArray=0x0, AliAODEvent *aodEvent=0x0, AliAODMCHeader *mcHeader=0x0)
AliCFTaskVertexingHFCutVarFDSub & operator=(const AliCFTaskVertexingHFCutVarFDSub &c)
Bool_t fUseNchWeight
flag to decide whether to use z-vtx weights != 1 when filling the container or not ...
void CreateMeasuredNchHisto()
Bool_t RecoAcceptStep(AliESDtrackCuts **trackCuts) const
void FillGenStep(AliAODMCParticle *dzeroMC, Double_t pt=-1, Double_t weight=1., TClonesArray *mcArray=0x0, AliAODMCHeader *mcHeader=0x0)
Int_t fCountAcc
MC particle found.
TList * fListProfiles
response matrix for unfolding
THnSparseF * fTHnAnalysis
object for cut variation study
void SetMotherPtWeightsFromFONLL5overLHC13d3()
static Int_t GetGeneratedPhysicalPrimariesInEtaRange(TClonesArray *arrayMC, Double_t mineta, Double_t maxeta)
Bool_t IsSelected(TObject *obj)
TProfile * fMultEstimatorAvg[4]
Definition of the multiplicity estimator: kNtrk10=0, kNtrk10to16=1, kVZERO=2.
Bool_t MCRefitStep(AliAODEvent *aodEvent, AliESDtrackCuts **trackCuts) const
Int_t fFakeSelection
flag to switch off the centrality selection
Bool_t GetIsUsePID() const
UInt_t fResonantDecay
histogram with Nch distribution from MC production
Float_t fCutOnMomConservation
flag to define which task to use for Lc –> K0S+p
AliRDHFCuts * fCuts
flag for unfolding before or after cuts.
void SetTriggerClass(TString trclass0, TString trclass1="")
Bool_t fUseCascadeTaskForLctoV0bachelor
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 SetPtWeightsFromFONLL276andBAMPSoverLHC12a17b()
TProfile * GetEstimatorHistogram(const AliVEvent *event)
void SetConfiguration(Int_t configuration)
void SetMultiplicity(Double_t multiplicity)
Int_t fGenDsOption
Ds decay option (selection level)
void SetMCPrimaryVertex(Double_t zMCVertex)
Int_t fCountRecoPID
Reco particle found that satisfy cuts in PPR.
void SetPtWeightsFromFONLL276overLHC10f6a()
Int_t fDsOption
flag to use MC vertex (useful when runnign in pp)
void UserCreateOutputObjects()
ANALYSIS FRAMEWORK STUFF to loop on data and fill output objects.
Bool_t ProcessLctoV0Bachelor(Int_t returnCodeDs) const
TList * fListBdecays
c quark pt spectrum
TString fPartName
number of variables for the container
void SetPtWeightsFromFONLL7overLHC10f6a()
Class for HF corrections as a function of many variables and step.
TList * OpenFile(const char *fname)
Int_t fCountVertex
MC particle found that satisfy acceptance cuts.
THnSparseF * fTHnGenerator