- multiplicity from SPD is a float, not an integer (correct warning in compilation)
AliRsnPair:
- assignment of mother reference event was missing, and caused segfaults
AliRsnCutPIDITS:
- don't assume that the AliESDpid object in the input handler is always initialized
AliRsnAnalysisManager:
- assign the reference event for the mother passed to each pair, and take care of
maintaining the right one in case they are swapped
if (!ev0->SetDaughterAbs(daughter0, i0)) continue;
}
// when the assigment is unsuccessful, this i known in internal status flag
- if (!daughter0.IsOK()) continue;
+ if (!daughter0.IsOK() || !daughter0.GetRef()) continue;
// process all single-track monitors
nextMonitor.Reset();
if (!ev1->SetDaughterAbs(daughter1, i1)) continue;
}
// when the assigment is unsuccessful, this i known in internal status flag
- if (!daughter1.IsOK()) continue;
+ if (!daughter1.IsOK() || !daughter1.GetRef()) continue;
// loop over all pairs and make computations
i = 0;
// the Fill() method returns kTRUE if the two daughters
// do match the pair definition of each AliRsnPait object,
// and the pair is processed only in this case
- if (pair->Fill(&daughter0, &daughter1)) {
+ if (pair->Fill(&daughter0, &daughter1, kTRUE)) {
pair->Compute();
- } else if (pair->Fill(&daughter1, &daughter0)) {
+ } else if (pair->Fill(&daughter1, &daughter0, kFALSE)) {
pair->Compute();
}
}
AliESDInputHandler *handler = dynamic_cast<AliESDInputHandler*>(mgr->GetInputEventHandler());
if (handler) {
AliESDpid *pid = handler->GetESDpid();
- fESDpid = (*pid);
+ if (pid) fESDpid = (*pid);
}
fInitialized = kTRUE;
}
//_____________________________________________________________________________
-Int_t AliRsnEvent::GetMultiplicityFromSPD()
+Float_t AliRsnEvent::GetMultiplicityFromSPD()
{
//
// Returns event multiplicity computed from SPD.
//
- if (!fRef) return -1;
+ if (!fRef) return -1.0;
AliESDEvent *esd = GetRefESD();
if (esd) {
}
else {
AliWarning("Cannot compute SPD multiplicity without a well initialized ESD event");
- return -1;
+ return -1.0;
}
}
Int_t GetMultiplicityFromTracks() {if (fRef) return fRef->GetNumberOfTracks(); return -1;}
Int_t GetMultiplicityFromMC() {if (fRefMC) return fRefMC->GetNumberOfTracks(); return -1;}
Int_t GetMultiplicityFromESDCuts();
- Int_t GetMultiplicityFromSPD();
+ Float_t GetMultiplicityFromSPD();
// setters for a daughter
Bool_t SetDaughterAbs(AliRsnDaughter &daughter, Int_t absoluteIndex);
//_____________________________________________________________________________
Bool_t AliRsnPair::Fill
-(AliRsnDaughter *daughter1, AliRsnDaughter *daughter2)
+(AliRsnDaughter *daughter1, AliRsnDaughter *daughter2, Bool_t refFirst)
{
//
// Checks that first argument matches definitions for first daughter
// If the matching is successful, the AliRsnMother data member is
// initialized using the mass hypotheses defined here and the momenta
// in the passed daughters.
+// The third argument is necessary to choose which one of the possible two
+// events owning the two daughter will be used as reference.
//
// check matching and exit if one of them fails
// if pair is accepted, increment counter
++fCount;
+
+ // assign reference event
+ if (refFirst) fMother.SetRefEvent(daughter1->GetOwnerEvent()); else fMother.SetRefEvent(daughter2->GetOwnerEvent());
return kTRUE;
}
void ResetCount() {fCount = 0;}
// methods
- Bool_t Fill(AliRsnDaughter *d0, AliRsnDaughter *d1);
+ Bool_t Fill(AliRsnDaughter *d0, AliRsnDaughter *d1, Bool_t refFirst = kTRUE);
virtual void Print(Option_t *option = "") const;
virtual void Compute();
virtual void Init(const char *prefix, TList *list);