+ // stuff for vertex reconstruction correction systematics
+ Bool_t vertexRecoStudy = kFALSE;
+ Bool_t triggerBiasStudy = kFALSE;
+ if (fdNdEtaCorrectionVertexReco[0]) vertexRecoStudy = kTRUE;
+ if (fdNdEtaCorrectionTriggerBias[0]) triggerBiasStudy = kTRUE;
+
+ if (vertexRecoStudy || triggerBiasStudy) {
+ AliHeader* header = GetHeader();
+ if (!header) {
+ AliDebug(AliLog::kError, "Header not available");
+ return kFALSE;
+ }
+
+ // getting process information
+ Int_t processtype = AliPWG0depHelper::GetPythiaEventProcessType(header);
+
+ AliDebug(AliLog::kInfo, Form("Pythia process type %d.",processtype));
+
+ // can only read pythia headers, either directly or from cocktalil header
+ AliGenEventHeader* genHeader = (AliGenEventHeader*)(header->GenEventHeader());
+
+ if (!genHeader) {
+ AliDebug(AliLog::kError, "Gen header not available");
+ return kFALSE;
+ }
+
+ // get the MC vertex
+ TArrayF vtxMC(3);
+ genHeader->PrimaryVertex(vtxMC);
+
+ Int_t nGoodTracks = list->GetEntries();
+
+ Bool_t eventTriggered = AliPWG0Helper::IsEventTriggered(fESD);
+ Bool_t vertexReconstructed = AliPWG0Helper::IsVertexReconstructed(fESD);
+
+ // non diffractive
+ if (processtype!=92 && processtype!=93 && processtype!=94) {
+ if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[0]->FillEventAll(vtxMC[2], nGoodTracks);
+
+ if (eventTriggered) {
+ if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[0]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+ if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[0]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+
+ if (vertexReconstructed)
+ if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[0]->FillEventWithTriggerWithReconstructedVertex(vtxMC[2], nGoodTracks);
+ }
+ }
+
+ // single diffractive
+ if (processtype==92 || processtype==93) {
+ if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[1]->FillEventAll(vtxMC[2], nGoodTracks);
+
+ if (eventTriggered) {
+ if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[1]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+ if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[1]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+
+ if (vertexReconstructed)
+ if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[1]->FillEventWithTriggerWithReconstructedVertex(vtxMC[2], nGoodTracks);
+ }
+ }
+
+ // double diffractive
+ if (processtype==94) {
+ if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[2]->FillEventAll(vtxMC[2], nGoodTracks);
+
+ if (eventTriggered) {
+ if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[2]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+ if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[2]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+
+ if (vertexReconstructed)
+ if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[2]->FillEventWithTriggerWithReconstructedVertex(vtxMC[2], nGoodTracks);
+ }
+ }
+ }
+