// histograms are in the output list and deleted when the output
// list is deleted by the TSelector dtor
- if (fOutput) {
+ if (fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
delete fOutput;
fOutput = 0;
}
// Get the ESD
AliESDEvent * aESD = dynamic_cast<AliESDEvent*>(fInputEvent);
+ if(!aESD) {
+ AliFatal("Cannot get ESD");
+ }
if (strcmp(aESD->ClassName(),"AliESDEvent")) {
AliFatal("Not processing ESDs");
}
// NB never call IsEventSelected more than once per event
// (statistics histogram would be altered)
- Bool_t isSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
+ // FIXME: using only MB events, foresee more events?
+ Bool_t isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB);
// Get the Multiplicity cut
const AliMultiplicity* mult = aESD->GetMultiplicity();
Int_t ntracklet = mult->GetNumberOfTracklets();
const AliESDVertex * vtxESD = aESD->GetPrimaryVertexSPD();
- if(vtxESD) {
- // If there is a vertex from vertexer z with delta phi > 0.02 we
- // don't consider it rec (we keep the event in bin0). If quality
- // is good eneough we check the number of tracklets
- // A similar selection is applied in IsEventInBinZero
- // If the vertex is too far away, we don't consider it reconstructed either.
- if ((vtxESD->IsFromVertexerZ() && vtxESD->GetDispersion() > 0.02) || TMath::Abs(vtxESD->GetZ()) > 15) {
- vtxESD = 0;
- ntracklet = 0; // Don't trust reconstructed tracklets if you don't trust clusters
- }
- }
+ if (IsEventInBinZero()) {
+ ntracklet = 0;
+ vtxESD = 0;
+ }
if (ntracklet > 0 && !vtxESD) {
AliError("No vertex but reconstructed tracklets?");
if (fIsMC) {
// Monte Carlo: we fill 3 histos
+ if (!isSelected || !vtxESD) ntracklet = 0; //If the event does not pass the physics selection or is not rec, it goes in the bin0
fCollisionNormalization->FillVzMCGen(vz, ntracklet, mcEvent);
// If triggered == passing the physics selection
- if (isSelected) fCollisionNormalization->FillVzMCTrg(vz, ntracklet, mcEvent);
- // If reconstructer == good enough vertex
- if (vtxESD) fCollisionNormalization->FillVzMCRec(vz, ntracklet, mcEvent);
+ if (isSelected) {
+ fCollisionNormalization->FillVzMCTrg(vz, ntracklet, mcEvent);
+ // If reconstructer == good enough vertex
+ if (vtxESD) fCollisionNormalization->FillVzMCRec(vz, ntracklet, mcEvent);
+ }
} else {
if (isSelected) {
// Passing the trigger
Bool_t isZeroBin = kTRUE;
const AliESDEvent* esd= dynamic_cast<AliESDEvent*>(fInputEvent);
+ if (!esd){
+ Printf("AliCollisionNormalizationTask::IsEventInBinZero: Can't get ESD");
+ return kFALSE;
+ }
const AliMultiplicity* mult = esd->GetMultiplicity();
if (!mult){
- Printf("AliAnalysisTaskBGvsTime::IsBinZero: Can't get mult object");
+ Printf("AliCollisionNormalizationTask::IsEventInBinZero: Can't get mult object");
return kFALSE;
}
Int_t ntracklet = mult->GetNumberOfTracklets();