20 #include <TClonesArray.h> 31 #include "AliGenCocktailEventHeader.h" 33 #include "AliAODEvent.h" 34 #include "AliAnalysisManager.h" 35 #include "AliCentrality.h" 36 #include "AliEMCALGeometry.h" 37 #include "AliESDEvent.h" 39 #include "AliEventplane.h" 40 #include "AliInputEventHandler.h" 42 #include "AliMCParticle.h" 43 #include "AliVCluster.h" 44 #include "AliVEventHandler.h" 45 #include "AliVParticle.h" 46 #include "AliAODTrack.h" 47 #include "AliVCaloTrigger.h" 48 #include "AliGenPythiaEventHeader.h" 49 #include "AliGenEventHeader.h" 50 #include "AliAODMCHeader.h" 51 #include "AliMCEvent.h" 52 #include "AliEMCALTriggerPatchInfo.h" 54 #include "AliMultSelection.h" 70 fGeneralHistograms(kFALSE),
72 fNeedEmcalGeom(kTRUE),
74 fCentralityEstimation(kNewCentrality),
76 fIsMonteCarlo(kFALSE),
80 fCaloTriggerPatchInfoName(),
84 fTriggerSelectionBitMap(0),
93 fMaxMinimumBiasPtHard(-1),
94 fAcceptedTriggerClasses(),
95 fRejectedTriggerClasses(),
96 fMCRejectFilter(kFALSE),
97 fPtHardAndJetPtFactor(0.),
98 fPtHardAndClusterPtFactor(0.),
99 fPtHardAndTrackPtFactor(0.),
100 fSwitchOffLHC15oFaultyBranches(kFALSE),
101 fEventSelectionAfterRun(kFALSE),
102 fSelectGeneratorName(),
103 fMinimumEventWeight(1e-6),
104 fMaximumEventWeight(1e6),
106 fLocalInitialized(kFALSE),
111 fTriggerPatchInfo(0),
119 fFiredTriggerBitMap(0),
120 fFiredTriggerClasses(),
124 fUseXsecFromHeader(false),
155 fGeneralHistograms(kFALSE),
157 fNeedEmcalGeom(kTRUE),
159 fCentralityEstimation(kNewCentrality),
161 fIsMonteCarlo(kFALSE),
162 fMCEventHeaderName(),
165 fCaloTriggerPatchInfoName(),
167 fParticleCollArray(),
169 fTriggerSelectionBitMap(0),
178 fMaxMinimumBiasPtHard(-1),
179 fAcceptedTriggerClasses(),
180 fRejectedTriggerClasses(),
181 fMCRejectFilter(kFALSE),
182 fPtHardAndJetPtFactor(0.),
183 fPtHardAndClusterPtFactor(0.),
184 fPtHardAndTrackPtFactor(0.),
185 fSwitchOffLHC15oFaultyBranches(kFALSE),
186 fEventSelectionAfterRun(kFALSE),
187 fSelectGeneratorName(),
188 fMinimumEventWeight(1e-6),
189 fMaximumEventWeight(1e6),
191 fLocalInitialized(kFALSE),
196 fTriggerPatchInfo(0),
204 fFiredTriggerBitMap(0),
205 fFiredTriggerClasses(),
209 fUseXsecFromHeader(false),
267 AliWarningStream() <<
"The execution of this task is inhibited. Returning." << std::endl;
272 AliVEventHandler *evhand = mgr->GetInputEventHandler();
274 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
282 AliError(
"Event handler not found!");
286 AliError(
"Analysis manager not found!");
305 h =
new TH1F(
"fHistEventsVsPtHard",
"fHistEventsVsPtHard", 1000, 0, 1000);
306 h->GetXaxis()->SetTitle(
"#it{p}_{T,hard} (GeV/#it{c})");
307 h->GetYaxis()->SetTitle(
"events");
311 h =
new TH1F(
"fHistTrialsVsPtHard",
"fHistTrialsVsPtHard", 1000, 0, 1000);
312 h->GetXaxis()->SetTitle(
"#it{p}_{T,hard} (GeV/#it{c})");
313 h->GetYaxis()->SetTitle(
"trials");
317 h =
new TProfile(
"fHistXsection",
"fHistXsection", 50, 0, 50);
318 h->GetXaxis()->SetTitle(
"#it{p}_{T,hard} bin");
319 h->GetYaxis()->SetTitle(
"total integrated cross section (mb)");
323 h =
new TH1F(
"fHistXsectionDistribution",
"fHistXsectionDistribution", 1000, &weight_bins[0]);
324 h->GetXaxis()->SetTitle(
"total integrated cross section (mb)");
325 h->GetYaxis()->SetTitle(
"events");
329 h =
new TH1F(
"fHistEventWeights",
"fHistEventWeights", 1000, &weight_bins[0]);
330 h->GetXaxis()->SetTitle(
"weight");
331 h->GetYaxis()->SetTitle(
"events");
335 h =
new TH2F(
"fHistEventWeightsVsPtHard",
"fHistEventWeightsVsPtHard", 1000, 0, 1000, 1000, &weight_bins[0]);
336 h->GetXaxis()->SetTitle(
"#it{p}_{T,hard} (GeV/#it{c})");
337 h->GetYaxis()->SetTitle(
"event weight");
341 h =
new TH1F(
"fHistEventsVsPtHardNoSel",
"fHistEventsVsPtHardNoSel", 1000, 0, 1000);
342 h->GetXaxis()->SetTitle(
"#it{p}_{T,hard} (GeV/#it{c})");
343 h->GetYaxis()->SetTitle(
"events");
347 h =
new TH1F(
"fHistTrialsVsPtHardNoSel",
"fHistTrialsVsPtHardNoSel", 1000, 0, 1000);
348 h->GetXaxis()->SetTitle(
"#it{p}_{T,hard} (GeV/#it{c})");
349 h->GetYaxis()->SetTitle(
"trials");
353 h =
new TProfile(
"fHistXsectionNoSel",
"fHistXsectionNoSel", 50, 0, 50);
354 h->GetXaxis()->SetTitle(
"#it{p}_{T,hard} bin");
355 h->GetYaxis()->SetTitle(
"total integrated cross section (mb)");
359 h =
new TH1F(
"fHistXsectionDistributionNoSel",
"fHistXsectionDistributionNoSel", 1000, &weight_bins[0]);
360 h->GetXaxis()->SetTitle(
"total integrated cross section (mb)");
361 h->GetYaxis()->SetTitle(
"events");
365 h =
new TH1F(
"fHistEventWeightsNoSel",
"fHistEventWeightsNoSel", 1000, &weight_bins[0]);
366 h->GetXaxis()->SetTitle(
"weight");
367 h->GetYaxis()->SetTitle(
"events");
371 h =
new TH2F(
"fHistEventWeightsVsPtHardNoSel",
"fHistEventWeightsVsPtHardNoSel", 1000, 0, 1000, 1000, &weight_bins[0]);
372 h->GetXaxis()->SetTitle(
"#it{p}_{T,hard} (GeV/#it{c})");
373 h->GetYaxis()->SetTitle(
"event weight");
377 h =
new TH1F(
"fHistTrialsExternalFile",
"fHistTrialsExternalFile", 50, 0, 50);
378 h->GetXaxis()->SetTitle(
"#it{p}_{T,hard} bin");
379 h->GetYaxis()->SetTitle(
"trials");
383 h =
new TH1F(
"fHistEventsExternalFile",
"fHistEventsExternalFile", 50, 0, 50);
384 h->GetXaxis()->SetTitle(
"#it{p}_{T,hard} bin");
385 h->GetYaxis()->SetTitle(
"total events");
389 h =
new TProfile(
"fHistXsectionExternalFile",
"fHistXsectionExternalFile", 50, 0, 50);
390 h->GetXaxis()->SetTitle(
"#it{p}_{T,hard} bin");
391 h->GetYaxis()->SetTitle(
"total integrated cross section (mb)");
396 h =
new TH1F(
"fHistZVertex",
"Z vertex position", 60, -30, 30);
397 h->GetXaxis()->SetTitle(
"V_{#it{z}}");
398 h->GetYaxis()->SetTitle(
"counts");
402 h =
new TH1F(
"fHistZVertexNoSel",
"Z vertex position (no event selection)", 60, -30, 30);
403 h->GetXaxis()->SetTitle(
"V_{#it{z}}");
404 h->GetYaxis()->SetTitle(
"counts");
409 h =
new TH1F(
"fHistCentrality",
"Event centrality distribution", 100, 0, 100);
410 h->GetXaxis()->SetTitle(
"Centrality (%)");
411 h->GetYaxis()->SetTitle(
"counts");
415 h =
new TH1F(
"fHistCentralityNoSel",
"Event centrality distribution (no event selection)", 100, 0, 100);
416 h->GetXaxis()->SetTitle(
"Centrality (%)");
417 h->GetYaxis()->SetTitle(
"counts");
423 h =
new TH1F(
"fHistEventPlane",
"Event plane", 120, -TMath::Pi(), TMath::Pi());
424 h->GetXaxis()->SetTitle(
"event plane");
425 h->GetYaxis()->SetTitle(
"counts");
429 h =
new TH1F(
"fHistEventPlaneNoSel",
"Event plane (no event selection)", 120, -TMath::Pi(), TMath::Pi());
430 h->GetXaxis()->SetTitle(
"event plane");
431 h->GetYaxis()->SetTitle(
"counts");
436 h =
new TH1F(
"fHistEventRejection",
"Reasons to reject event",30,0,30);
437 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2) 438 h->SetBit(TH1::kCanRebin);
440 h->SetCanExtend(TH1::kAllAxes);
442 std::array<std::string, 10> labels = {
"PhysSel",
"Evt Gen Name",
"Trg class (acc)",
"Trg class (rej)",
"Cent",
"vertex contr.",
"Vz",
"VzSPD",
"SelPtHardBin",
"MCOutlier"};
444 for (
auto label : labels) {
445 h->GetXaxis()->SetBinLabel(i, label.c_str());
448 h->GetYaxis()->SetTitle(
"counts");
452 h =
new TH1F(
"fHistTriggerClasses",
"fHistTriggerClasses",3,0,3);
453 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2) 454 h->SetBit(TH1::kCanRebin);
456 h->SetCanExtend(TH1::kAllAxes);
461 h =
new TH1F(
"fHistTriggerClassesNoSel",
"fHistTriggerClassesNoSel",3,0,3);
462 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2) 463 h->SetBit(TH1::kCanRebin);
465 h->SetCanExtend(TH1::kAllAxes);
470 h =
new TH1F(
"fHistEventCount",
"fHistEventCount",2,0,2);
471 h->GetXaxis()->SetBinLabel(1,
"Accepted");
472 h->GetXaxis()->SetBinLabel(2,
"Rejected");
473 h->GetYaxis()->SetTitle(
"counts");
509 if (hCent) hCent->Fill(
fCent);
512 if (hEventPlane) hEventPlane->Fill(
fEPV0);
530 if (hCent) hCent->Fill(
fCent);
533 if (hEventPlane) hEventPlane->Fill(
fEPV0);
564 AliWarningStream() <<
"The execution of this task is inhibited. Returning." << std::endl;
619 std::unique_ptr<TObjArray> walk(file.Tokenize(
"/"));
621 TString &tok =
static_cast<TObjString *
>(t)->String();
622 if(tok.Contains(
".zip")){
624 Int_t pos = archivetype.Index(
".zip");
625 archivetype.Replace(pos, archivetype.Length() - pos,
"");
628 if(archivetype.Length()){
629 AliDebugStream(1) <<
"Auto-detected archive type " << archivetype << std::endl;
630 Ssiz_t pos1 = file.Index(archivetype,archivetype.Length(),0,TString::kExact);
631 Ssiz_t pos = file.Index(
"#",1,pos1,TString::kExact);
632 Ssiz_t pos2 = file.Index(
".root",5,TString::kExact);
633 file.Replace(pos+1,pos2-pos1,
"");
636 file.ReplaceAll(
gSystem->BaseName(file.Data()),
"");
638 AliDebugStream(1) <<
"File name: " << file << std::endl;
643 if(file.Contains(
"__alice")){
645 Int_t pos = tmp.Index(
"__alice");
646 tmp.Replace(0, pos,
"");
647 tmp.ReplaceAll(
"__",
"/");
650 std::unique_ptr<TObjArray> toks(tmp.Tokenize(
"/"));
651 TString tag =
"_" + archivetype;
653 TString &path =
static_cast<TObjString *
>(t)->String();
654 if(path.Contains(tag)){
655 Int_t posTag = path.Index(tag);
656 path.Replace(posTag, path.Length() - posTag,
"");
658 virtualFileName +=
"/" + path;
661 virtualFileName =
file;
664 AliDebugStream(1) <<
"Physical file name " << file <<
", virtual file name " << virtualFileName << std::endl;
667 TString strPthard(virtualFileName);
690 bool binfound =
false;
691 std::unique_ptr<TObjArray> tokens(strPthard.Tokenize(
"/"));
692 for(
auto t : *tokens) {
693 TString &tok =
static_cast<TObjString *
>(t)->String();
695 Int_t number = tok.Atoi();
696 if(number > 2000 && number < 3000){
699 }
else if(number == fInputHandler->GetEvent()->GetRunNumber()){
713 AliErrorStream() <<
"Could not extract file number from path " << strPthard << std::endl;
715 AliInfoStream() <<
"Auto-detecting pt-hard bin " << pthard << std::endl;
718 AliInfoStream() <<
"File: " << file << std::endl;
721 std::unique_ptr<TFile> fxsec(TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec.root")));
725 fxsec = std::unique_ptr<TFile>(TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec_hists.root")));
727 AliErrorStream() <<
"Failed reading cross section from file " << file << std::endl;
728 useXsecFromHeader =
true;
733 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
734 if (!key)
return kFALSE;
735 TList *list =
dynamic_cast<TList*
>(key->ReadObj());
736 if (!list)
return kFALSE;
737 TProfile *xSecHist =
static_cast<TProfile*
>(list->FindObject(
"h1Xsec"));
739 if(!xSecHist->GetEntries()) {
741 AliErrorStream() <<
"No cross section information available in file " << fxsec->GetName() <<
" - fall back to cross section in PYTHIA header" << std::endl;
742 useXsecFromHeader =
true;
745 xsec = xSecHist->GetBinContent(1);
746 if(!xsec) AliErrorStream() << GetName() <<
": Cross section 0 for file " << file << std::endl;
747 useXsecFromHeader =
false;
749 trials = ((TH1F*)list->FindObject(
"h1Trials"))->GetBinContent(1);
752 TTree *xtree = (
TTree*)fxsec->Get(
"Xsection");
753 if (!xtree)
return kFALSE;
756 xtree->SetBranchAddress(
"xsection",&xsection);
757 xtree->SetBranchAddress(
"ntrials",&ntrials);
782 TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
784 AliError(Form(
"%s - UserNotify: No current tree!",GetName()));
791 Bool_t useXsecFromHeader =
false;
793 TFile *curfile = tree->GetCurrentFile();
795 AliError(Form(
"%s - UserNotify: No current file!",GetName()));
800 if (chain) tree = chain->GetTree();
809 if (!res)
return kTRUE;
812 GetGeneralTH1(
"fHistTrialsExternalFile",
true)->Fill(fPtHardBin, trials);
813 if(!useXsecFromHeader)
GetGeneralTProfile(
"fHistXsectionExternalFile",
true)->Fill(fPtHardBin, xsection);
814 GetGeneralTH1(
"fHistEventsExternalFile",
true)->Fill(fPtHardBin, nevents);
833 AliError(Form(
"%s: Could not retrieve event! Returning!", GetName()));
838 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->
GetRunNumber());
840 AliFatal(Form(
"%s: Can not get EMCal geometry instance. If you do not need the EMCal geometry, disable it by setting task->SetNeedEmcalGeometry(kFALSE).", GetName()));
846 TTree *aodTree = AliAnalysisManager::GetAnalysisManager()->GetTree();
847 aodTree->SetBranchStatus(
"D0toKpi.fPx", 0);
848 aodTree->SetBranchStatus(
"D0toKpi.fPy", 0);
849 aodTree->SetBranchStatus(
"D0toKpi.fPz", 0);
850 aodTree->SetBranchStatus(
"D0toKpi.fd0", 0);
851 aodTree->SetBranchStatus(
"Charm3Prong.fPx", 0);
852 aodTree->SetBranchStatus(
"Charm3Prong.fPy", 0);
853 aodTree->SetBranchStatus(
"Charm3Prong.fPz", 0);
854 aodTree->SetBranchStatus(
"Charm3Prong.fd0", 0);
855 aodTree->SetBranchStatus(
"Dstar.fPx", 0);
856 aodTree->SetBranchStatus(
"Dstar.fPy", 0);
857 aodTree->SetBranchStatus(
"Dstar.fPz", 0);
858 aodTree->SetBranchStatus(
"Dstar.fd0", 0);
870 AliError(Form(
"%s: Could not retrieve cells %s!", GetName(),
fCaloCellsName.Data()));
878 AliError(Form(
"%s: Could not retrieve calo triggers %s!", GetName(),
fCaloTriggersName.Data()));
907 const AliESDRun *run = esd->GetESDRun();
908 TString beamType = run->GetBeamType();
909 if (beamType ==
"p-p")
911 else if (beamType ==
"A-A")
913 else if (beamType ==
"p-A")
918 Int_t runNumber = InputEvent()->GetRunNumber();
920 if ((runNumber >= 136833 && runNumber <= 139517) ||
921 (runNumber >= 167693 && runNumber <= 170593) ||
922 (runNumber >= 244824 && runNumber <= 246994)) {
924 }
else if ((runNumber >= 188356 && runNumber <= 188366) ||
925 (runNumber >= 195164 && runNumber <= 197388) ||
926 (runNumber >= 265015 && runNumber <= 267166)) {
971 Bool_t acceptedTrgClassFound = kFALSE;
974 std::string teststring(acc_trg);
975 bool fullmatch(
false);
976 auto posexact = acc_trg.find(
"EXACT");
977 if(posexact != std::string::npos) {
979 teststring.erase(posexact, 5);
982 bool classmatch = fullmatch ? teststring == fired_trg : fired_trg.find(teststring) != std::string::npos;
984 acceptedTrgClassFound = kTRUE;
988 if (acceptedTrgClassFound)
break;
991 if (!acceptedTrgClassFound) {
999 std::string teststring(rej_trg);
1000 bool fullmatch(
false);
1001 auto posexact = rej_trg.find(
"EXACT");
1002 if(posexact != std::string::npos) {
1004 teststring.erase(posexact, 5);
1007 bool classmatch = fullmatch ? teststring == fired_trg : fired_trg.find(teststring) != std::string::npos;
1016 if (fMinCent < fMaxCent && fMaxCent > 0) {
1017 if (fCent < fMinCent || fCent >
fMaxCent) {
1081 TClonesArray *arr = 0;
1083 if (!sname.IsNull()) {
1084 arr =
dynamic_cast<TClonesArray*
>(InputEvent()->FindListObject(sname));
1086 AliWarning(Form(
"%s: Could not retrieve array with name %s!", GetName(), name));
1096 TString objname(arr->GetClass()->GetName());
1097 TClass cls(objname);
1098 if (!cls.InheritsFrom(clname)) {
1099 AliWarning(Form(
"%s: Objects of type %s in %s are not inherited from %s!",
1100 GetName(), cls.GetName(), name, clname));
1123 std::stringstream firedClasses(InputEvent()->GetFiredTriggerClasses().
Data());
1124 while (firedClasses.good()) {
1125 std::string trgClass;
1126 firedClasses >> trgClass;
1134 fFiredTriggerBitMap =
static_cast<AliVAODHeader*
>(InputEvent()->GetHeader())->GetOfflineTrigger();
1137 const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1143 const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
1160 AliMultSelection *MultSelection =
static_cast<AliMultSelection*
>(InputEvent()->FindListObject(
"MultSelection"));
1161 if (MultSelection) {
1162 fCent = MultSelection->GetMultiplicityPercentile(
fCentEst.Data());
1165 AliWarning(Form(
"%s: Could not retrieve centrality information! Assuming 99", GetName()));
1170 AliCentrality *aliCent = InputEvent()->GetCentrality();
1175 AliWarning(Form(
"%s: Could not retrieve centrality information! Assuming 99", GetName()));
1188 AliEventplane *aliEP = InputEvent()->GetEventplane();
1190 fEPV0 = aliEP->GetEventplane(
"V0" ,InputEvent());
1191 fEPV0A = aliEP->GetEventplane(
"V0A",InputEvent());
1192 fEPV0C = aliEP->GetEventplane(
"V0C",InputEvent());
1194 AliWarning(Form(
"%s: Could not retrieve event plane information!", GetName()));
1199 AliGenEventHeader* header = MCEvent()->GenEventHeader();
1207 else if (header->InheritsFrom(
"AliGenCocktailEventHeader")) {
1208 AliGenCocktailEventHeader* cocktailHeader =
static_cast<AliGenCocktailEventHeader*
>(header);
1209 TList* headers = cocktailHeader->GetHeaders();
1210 for (
auto obj : *headers) {
1212 fMCHeader =
static_cast<AliGenEventHeader*
>(obj);
1246 if (branchName.size() == 0)
return 0;
1250 if (branchName ==
"tracks" || branchName ==
"Tracks") cont =
new AliTrackContainer(branchName.c_str());
1254 if (contName.size() > 0) cont->SetName(contName.c_str());
1271 if (branchName.size() == 0)
return 0;
1275 if (contName.size() > 0) cont->SetName(contName.c_str());
1289 std::map<std::string, AliParticleContainer*>::const_iterator cont_it =
fParticleCollArray.find(name);
1291 else return nullptr;
1301 std::map<std::string, AliClusterContainer*>::const_iterator cont_it =
fClusterCollArray.find(name);
1303 else return nullptr;
1313 if (!(InputEvent()->FindListObject(obj->GetName()))) {
1314 InputEvent()->AddObject(obj);
1318 AliFatal(Form(
"%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1334 AliWarning(Form(
"%s - AliAnalysisTaskEmcalBase::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1341 if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1351 axis->SetBinLabel(1,
"NullObject");
1352 axis->SetBinLabel(2,
"Pt");
1353 axis->SetBinLabel(3,
"Acceptance");
1354 axis->SetBinLabel(4,
"MCLabel");
1355 axis->SetBinLabel(5,
"BitMap");
1356 axis->SetBinLabel(6,
"HF cut");
1357 axis->SetBinLabel(7,
"Bit6");
1358 axis->SetBinLabel(8,
"NotHybridTrack");
1359 axis->SetBinLabel(9,
"MCFlag");
1360 axis->SetBinLabel(10,
"MCGenerator");
1361 axis->SetBinLabel(11,
"ChargeCut");
1362 axis->SetBinLabel(12,
"MinDistanceTPCSectorEdge");
1363 axis->SetBinLabel(13,
"Bit12");
1364 axis->SetBinLabel(14,
"IsEMCal");
1365 axis->SetBinLabel(15,
"Time");
1366 axis->SetBinLabel(16,
"Energy");
1367 axis->SetBinLabel(17,
"ExoticCut");
1368 axis->SetBinLabel(18,
"Bit17");
1369 axis->SetBinLabel(19,
"Area");
1370 axis->SetBinLabel(20,
"AreaEmc");
1371 axis->SetBinLabel(21,
"ZLeadingCh");
1372 axis->SetBinLabel(22,
"ZLeadingEmc");
1373 axis->SetBinLabel(23,
"NEF");
1374 axis->SetBinLabel(24,
"MinLeadPt");
1375 axis->SetBinLabel(25,
"MaxTrackPt");
1376 axis->SetBinLabel(26,
"MaxClusterPt");
1377 axis->SetBinLabel(27,
"Flavour");
1378 axis->SetBinLabel(28,
"TagStatus");
1379 axis->SetBinLabel(29,
"MinNConstituents");
1380 axis->SetBinLabel(30,
"Bit29");
1381 axis->SetBinLabel(31,
"Bit30");
1382 axis->SetBinLabel(32,
"Bit31");
1393 TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1394 TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1395 Double_t z = (vect1 * vect2) / (vect2 * vect2);
1407 TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1408 Double_t z = (vect1 * vect2) / (vect2 * vect2);
1427 Double_t veta = t->GetTrackEtaOnEMCal();
1428 Double_t vphi = t->GetTrackPhiOnEMCal();
1431 v->GetPosition(pos);
1436 phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
1447 if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
1449 else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1451 else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1470 if (aodTrack->TestFilterBit(filterBit1)) {
1473 else if (aodTrack->TestFilterBit(filterBit2)) {
1474 if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
1496 if ((runnumber >= 136833 && runnumber <= 139517) ||
1497 (runnumber >= 167693 && runnumber <= 170593) ||
1498 (runnumber >= 244824 && runnumber <= 246994)) {
1501 else if ((runnumber > 188356 && runnumber <= 188503) ||
1502 (runnumber >= 195164 && runnumber <= 197388) ||
1503 (runnumber >= 265077 && runnumber <= 267166)) {
1524 AliDebug(1,Form(
"Njets: %d, pT Hard %f",nTriggerJets,
fPtHard));
1527 for (
Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1530 jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1532 AliDebug(1,Form(
"jet %d; pycell jet pT %f",ijet, jet.Pt()));
1536 AliInfo(Form(
"Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n",
fPtHard, jet.Pt(),
fPtHardAndJetPtFactor));
1546 if ((
Bool_t)mccluscont) {
1547 for (
auto cluster : mccluscont->all()) {
1548 Float_t ecluster = cluster->E();
1562 if ((
Bool_t)mcpartcont) {
1563 for (
auto mctrack : mcpartcont->
all()) {
1564 Float_t trackpt = mctrack->Pt();
1588 const Double_t tpi = TMath::TwoPi();
1590 if (phia < 0) phia += tpi;
1591 else if (phia > tpi) phia -= tpi;
1592 if (phib < 0) phib += tpi;
1593 else if (phib > tpi) phib -= tpi;
1595 if (dphi < rangeMin) dphi += tpi;
1596 else if (dphi > rangeMax) dphi -= tpi;
1612 double binWidth = (max - min) / n;
1615 for (
int i = 0; i < n; i++) {
1632 std::vector<double> array;
1648 if (min <= 0 || max < min) {
1649 AliErrorClassStream() <<
"Cannot generate a log scale fixed-bin array with limits " << min <<
", " << max << std::endl;
1652 double binWidth = std::pow(max / min, 1.0 / n);
1655 for (
int i = 0; i < n; i++) {
1672 std::vector<double> array;
1682 return search->second;
1685 if (warn) AliErrorStream() <<
"Could not find histogram '" << name <<
"'" << std::endl;
1716 TClass gen_header_class(name);
1717 if (gen_header_class.InheritsFrom(
"AliGenEventHeader")) {
1721 AliWarningStream() <<
"Class name '" << name <<
"' does not inherit from 'AliGenEventHeader'. Not setting it." << std::endl;
Bool_t fSwitchOffLHC15oFaultyBranches
Switch off faulty tree branches in LHC15o AOD trees.
void SetRejectionReasonLabels(TAxis *axis)
AliClusterContainer * AddClusterContainer(std::string branchName, std::string contName="")
Float_t fPtHardAndJetPtFactor
Factor between ptHard and jet pT to reject/accept event.
Double_t fVertexSPD[3]
!event Svertex
void UserCreateOutputObjects()
TString fCaloTriggersName
name of calo triggers collection
AliEMCALGeometry * fGeom
!emcal geometry
EBeamType_t fBeamType
!event beam type
Bool_t fInhibit
!inhibit execution of the task
TList * fOutput
!output list
TClonesArray * GetArrayFromEvent(const char *name, const char *clname=0)
Double_t fPtHard
!event pt hard
Float_t fXsection
!x-section from pythia header
Double_t fEPV0A
!event plane V0A
TString fSelectGeneratorName
Selects only events produced by a generator that has a name containing a string.
Double_t fEPV0
!event plane V0
Bool_t fIsMonteCarlo
if it is a MC production
Int_t fNTrials
!event trials
Container with name, TClonesArray and cuts for particles.
Bool_t fMCRejectFilter
enable the filtering of events by tail rejection
TString fCaloTriggerPatchInfoName
trigger patch info array name
Double_t fMinVz
min vertex for event selection
New centrality estimation (AliMultSelection, see https://twiki.cern.ch/twiki/bin/viewauth/ALICE/AliMu...
void UserExec(Option_t *option)
TString fCentEst
name of the centrality estimator
UInt_t fTriggerSelectionBitMap
trigger selection bit map
const AliMCParticleIterableContainer all() const
std::vector< double > fCentBins
how many centrality bins
Bool_t fEventSelectionAfterRun
If kTRUE, the event selection is performed after Run() but before FillHistograms() ...
static Byte_t GetTrackType(const AliVTrack *t)
virtual ~AliAnalysisTaskEmcalLight()
static std::vector< double > GenerateFixedBinArray(int n, double min, double max, bool last=true)
TString fCaloCellsName
name of calo cell collection
Bool_t IsTrackInEmcalAcceptance(AliVParticle *part, Double_t edges=0.9) const
void SetMCEventHeaderName(const char *name)
std::set< std::string > fRejectedTriggerClasses
list of accepted trigger classes
TH1 * GetGeneralTH1(const char *name, bool warn=false)
virtual Bool_t FillHistograms()
Double_t fMaxMinimumBiasPtHard
maximum pt hard for the minimum bias pt hard bin (MC)
Container for particles within the EMCAL framework.
static void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
void AddObjectToEvent(TObject *obj, Bool_t attempt=kFALSE)
std::map< std::string, TH1 * > fHistograms
!general QA histograms
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal
EBeamType_t fForceBeamType
forced beam type
No centrality estimation.
virtual Bool_t IsEventSelected()
AliVCaloCells * fCaloCells
!cells
std::vector< std::string > fFiredTriggerClasses
!trigger classes fired by the current event
Bool_t fCreateHisto
whether or not create histograms
Bool_t PythiaInfoFromFile(const char *currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard, Bool_t &useXsecFromHeader)
TH2 * GetGeneralTH2(const char *name, bool warn=false)
Double_t fMinPtHard
select minimum pt hard (MC)
TString fMCEventHeaderName
Looks for MC event properties in a particular MC event type (useful for a MC cocktail production) ...
Base task in the EMCAL framework (lighter version of AliAnalysisTaskEmcal)
EBeamType_t GetBeamType()
Float_t fPtHardAndClusterPtFactor
Factor between ptHard and cluster pT to reject/accept event.
Double_t fMaxVzDiff
upper limit for distance between primary and SPD vertex
Double_t fVertex[3]
!event vertex
Double_t fMaximumEventWeight
Minimum event weight for the related bookkeping histogram.
ECentralityEstimation_t fCentralityEstimation
Centrality estimation.
Int_t fPtHardBin
!event pt hard bin
AliClusterContainer * GetClusterContainer(std::string name) const
void AdoptClusterContainer(AliClusterContainer *cont)
Bool_t fIsPythia
if it is a PYTHIA production
Int_t fCentBin
!event centrality bin
Double_t fMaxCent
max centrality for event selection
ULong_t fFiredTriggerBitMap
!bit map of fired triggers
Double_t fMinNVertCont
minumum number of vertex contributors
virtual Bool_t RetrieveEventObjects()
Float_t fEventWeight
!event weight
Int_t fNVertSPDCont
!event SPD vertex number of contributors
std::set< std::string > fAcceptedTriggerClasses
list of accepted trigger classes
static Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rMin=-TMath::Pi()/2, Double_t rMax=3 *TMath::Pi()/2)
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)
Double_t fMinimumEventWeight
Minimum event weight for the related bookkeping histogram.
Bool_t fLocalInitialized
!whether or not the task has been already initialized
AliGenEventHeader * fMCHeader
!event MC header
static EBeamType_t BeamTypeFromRunNumber(Int_t runnumber)
AliParticleContainer * AddParticleContainer(std::string branchName, std::string contName="")
TProfile * GetGeneralTProfile(const char *name, bool warn=false)
std::map< std::string, AliParticleContainer * > fParticleCollArray
particle/track collection array
TFile * file
TList with histograms for a given trigger.
Int_t fNVertCont
!event vertex number of contributors
static std::vector< double > GenerateLogFixedBinArray(int n, double min, double max, bool last=true)
Bool_t fGeneralHistograms
whether or not it should fill some general histograms
Int_t GetRunNumber(TString)
AliGenPythiaEventHeader * fPythiaHeader
!event Pythia header
Float_t fPtHardAndTrackPtFactor
Factor between ptHard and track pT to reject/accept event.
void SetIsPythia(Bool_t i)
AliParticleContainer * GetParticleContainer(std::string name) const
Bool_t fUseXsecFromHeader
!Switch for using cross section from header (if not found in pythia file)
AliAnalysisTaskEmcalLight()
std::map< std::string, AliClusterContainer * > fClusterCollArray
cluster collection array
EBeamType_t
Switch for the beam type.
AliVCaloTrigger * fCaloTriggers
!calo triggers
Container structure for EMCAL clusters.
Container for MC-true particles within the EMCAL framework.
TString fGeneratorName
!name of the MC generator used to produce the current event (only AOD)
void AdoptParticleContainer(AliParticleContainer *cont)
virtual Bool_t FillGeneralHistograms(Bool_t eventSelected)
Double_t fMaxVz
max vertex for event selection
Double_t fCent
!event centrality
Double_t fEPV0C
!event plane V0C
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Double_t fMaxPtHard
select maximum pt hard (MC)
Old centrality estimation (AliCentrality, works only on Run-1 PbPb and pPb)
TList * OpenFile(const char *fname)
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
EDataType_t fDataType
!data type (ESD or AOD)