#include "AliESDtrackCuts.h"
#include "AliPWG0Helper.h"
-#include "dNdEta/AliMultiplicityCorrection.h"
+#include "multiplicity/AliMultiplicityCorrection.h"
#include "AliCorrection.h"
#include "AliCorrectionMatrix3D.h"
fOption(opt),
fAnalysisMode(AliPWG0Helper::kSPD),
fReadMC(kFALSE),
+ fUseMCVertex(kFALSE),
fMultiplicity(0),
fEsdTrackCuts(0),
fSystSkipParticles(kFALSE),
Printf("ERROR: Could not read tree from input slot 0");
} else {
// Disable all branches and enable only the needed ones
- //tree->SetBranchStatus("*", 0);
+ tree->SetBranchStatus("*", 0);
- tree->SetBranchStatus("fTriggerMask", 1);
- tree->SetBranchStatus("fSPDVertex*", 1);
+ tree->SetBranchStatus("AliESDHeader*", 1);
+ tree->SetBranchStatus("*Vertex*", 1);
- if (fAnalysisMode == AliPWG0Helper::kSPD)
- tree->SetBranchStatus("fSPDMult*", 1);
+ if (fAnalysisMode == AliPWG0Helper::kSPD) {
+ tree->SetBranchStatus("AliMultiplicity*", 1);
+ }
if (fAnalysisMode == AliPWG0Helper::kTPC || fAnalysisMode == AliPWG0Helper::kTPCITS) {
- AliESDtrackCuts::EnableNeededBranches(tree);
- tree->SetBranchStatus("fTracks.fLabel", 1);
+ //AliESDtrackCuts::EnableNeededBranches(tree);
+ tree->SetBranchStatus("Tracks*", 1);
}
AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
} else
fESD = esdH->GetEvent();
}
+
+ // disable info messages of AliMCEvent (per event)
+ AliLog::SetClassDebugLevel("AliMCEvent", AliLog::kWarning - AliLog::kDebug + 1);
}
void AliMultiplicityTask::CreateOutputObjects()
// only FASTOR
//Bool_t eventTriggered = fESD->GetTriggerMask() & 32;
- Bool_t eventVertex = AliPWG0Helper::IsVertexReconstructed(fESD->GetVertex());
+ const AliESDVertex* vtxESD = AliPWG0Helper::GetVertex(fESD, fAnalysisMode);
+ Bool_t eventVertex = (vtxESD != 0);
- // get the ESD vertex
- const AliESDVertex* vtxESD = fESD->GetVertex();
Double_t vtx[3];
- vtxESD->GetXYZ(vtx);
+ if (vtxESD)
+ vtxESD->GetXYZ(vtx);
// post the data already here
PostData(0, fOutput);
}
// get multiplicity from ESD tracks
- TObjArray* list = fEsdTrackCuts->GetAcceptedTracks(fESD);
+ TObjArray* list = fEsdTrackCuts->GetAcceptedTracks(fESD, (fAnalysisMode == AliPWG0Helper::kTPC));
Int_t nGoodTracks = list->GetEntries();
labelArr = new Int_t[nGoodTracks];
return;
}
+ if (fUseMCVertex)
+ {
+ Printf("WARNING: Replacing vertex by MC vertex. This is for systematical checks only.");
+ // get the MC vertex
+ AliGenEventHeader* genHeader = header->GenEventHeader();
+ TArrayF vtxMC(3);
+ genHeader->PrimaryVertex(vtxMC);
+
+ vtx[2] = vtxMC[2];
+ }
+
Bool_t processEvent = kTRUE;
if (fSelectProcessType > 0)
{
delete[] foundTracks;
delete[] foundPrimaries;
- if ((Int_t) nMCTracks20 == 0 && nESDTracks20 > 3)
- printf("WARNING: Event has %d generated and %d reconstructed...\n", nMCTracks20, nESDTracks20);
+ if ((Int_t) nMCTracks15 > 15 && nESDTracks15 <= 3)
+ {
+ TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
+ printf("WARNING: Event %lld %s (vtx-z = %f) has %d generated and %d reconstructed...\n", tree->GetReadEntry(), tree->GetCurrentFile()->GetName(), vtxMC[2], nMCTracks15, nESDTracks15);
+ }
// fill response matrix using vtxMC (best guess)
fMultiplicity->FillCorrection(vtxMC[2], nMCTracks05, nMCTracks09, nMCTracks15, nMCTracks20, nMCTracksAll, nESDTracks05, nESDTracks09, nESDTracks15, nESDTracks20);
return;
}
- TFile* file = TFile::Open("multiplicityMC.root", "RECREATE");
+ TFile* file = TFile::Open("multiplicity.root", "RECREATE");
fMultiplicity->SaveHistograms();
for (Int_t i = 0; i < 4; ++i)
file->Close();
- Printf("Writting result to multiplicityMC.root");
+ Printf("Writting result to multiplicity.root");
}