]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
AliRsnEvent:
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Mar 2011 23:26:00 +0000 (23:26 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Mar 2011 23:26:00 +0000 (23:26 +0000)
- 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

PWG2/RESONANCES/AliRsnAnalysisManager.cxx
PWG2/RESONANCES/AliRsnCutPIDITS.cxx
PWG2/RESONANCES/AliRsnEvent.cxx
PWG2/RESONANCES/AliRsnEvent.h
PWG2/RESONANCES/AliRsnPair.cxx
PWG2/RESONANCES/AliRsnPair.h

index fb99cb9dd07ef9885a723b6c8641c9cbec00be63..92d5c6e6844a03ec79d2841845263f607997b800 100644 (file)
@@ -271,7 +271,7 @@ void AliRsnAnalysisManager::ProcessAll(AliRsnEvent *ev0, AliRsnEvent *ev1, Bool_
          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();
@@ -293,7 +293,7 @@ void AliRsnAnalysisManager::ProcessAll(AliRsnEvent *ev0, AliRsnEvent *ev1, Bool_
             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;
@@ -307,9 +307,9 @@ void AliRsnAnalysisManager::ProcessAll(AliRsnEvent *ev0, AliRsnEvent *ev1, Bool_
             // 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();
             }
          }
index 5d12c34bfaf142852012f9982945baa6102f4a85..1acd861fb07bbbf282863b2bf786e754c53a5024 100644 (file)
@@ -191,7 +191,7 @@ void AliRsnCutPIDITS::Initialize()
    AliESDInputHandler *handler = dynamic_cast<AliESDInputHandler*>(mgr->GetInputEventHandler());
    if (handler) {
       AliESDpid *pid = handler->GetESDpid();
-      fESDpid = (*pid);
+      if (pid) fESDpid = (*pid);
    }
 
    fInitialized = kTRUE;
index e8abf3363893aa5543cb9a02f93b0d63a44fd99e..0d0a5e7f10fe5aa0371225cd10b99775f2cc83f1 100644 (file)
@@ -374,13 +374,13 @@ Int_t AliRsnEvent::GetMultiplicityFromESDCuts()
 }
 
 //_____________________________________________________________________________
-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) {
@@ -391,7 +391,7 @@ Int_t AliRsnEvent::GetMultiplicityFromSPD()
    }
    else {
       AliWarning("Cannot compute SPD multiplicity without a well initialized ESD event");
-      return -1;
+      return -1.0;
    }
 }
 
index 6eada401fbcf460e4cc44d4e32736d27c7f28836..8961b4327573d7f7b65883d534698430c0a38947 100644 (file)
@@ -52,7 +52,7 @@ public:
    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);
index 2a4fa325011961ab4c80c5216af9f3629005e6fd..2bb44e176711f3d0e1a0490478f72170df42fcd2 100644 (file)
@@ -87,7 +87,7 @@ void AliRsnPair::Print(Option_t* /*option*/) const
 
 //_____________________________________________________________________________
 Bool_t AliRsnPair::Fill
-(AliRsnDaughter *daughter1, AliRsnDaughter *daughter2)
+(AliRsnDaughter *daughter1, AliRsnDaughter *daughter2, Bool_t refFirst)
 {
 //
 // Checks that first argument matches definitions for first daughter
@@ -96,6 +96,8 @@ Bool_t AliRsnPair::Fill
 // 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
@@ -151,6 +153,9 @@ Bool_t AliRsnPair::Fill
 
    // if pair is accepted, increment counter
    ++fCount;
+   
+   // assign reference event
+   if (refFirst) fMother.SetRefEvent(daughter1->GetOwnerEvent()); else fMother.SetRefEvent(daughter2->GetOwnerEvent());
 
    return kTRUE;
 }
index 1dda9fca485b68eb00eb3e4a2456ec551fe5ad25..926d7465fffa8d43e4818a027f0ffba40c714498 100644 (file)
@@ -49,7 +49,7 @@ public:
    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);