]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Removed warnings from RESONANCES code
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 17 Oct 2008 16:50:47 +0000 (16:50 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 17 Oct 2008 16:50:47 +0000 (16:50 +0000)
22 files changed:
PWG2/RESONANCES/AliRsnAnalysisSE.cxx
PWG2/RESONANCES/AliRsnAnalysisTaskBase.cxx
PWG2/RESONANCES/AliRsnAnalysisTaskSEBase.cxx
PWG2/RESONANCES/AliRsnCut.cxx
PWG2/RESONANCES/AliRsnCut.h
PWG2/RESONANCES/AliRsnDaughter.cxx
PWG2/RESONANCES/AliRsnDaughter.h
PWG2/RESONANCES/AliRsnEvent.cxx
PWG2/RESONANCES/AliRsnEvent.h
PWG2/RESONANCES/AliRsnEventFunction.cxx [new file with mode: 0644]
PWG2/RESONANCES/AliRsnEventFunction.h [new file with mode: 0644]
PWG2/RESONANCES/AliRsnEventTaskSE.cxx [new file with mode: 0644]
PWG2/RESONANCES/AliRsnEventTaskSE.h [new file with mode: 0644]
PWG2/RESONANCES/AliRsnFunction.cxx
PWG2/RESONANCES/AliRsnFunction.h
PWG2/RESONANCES/AliRsnPID.cxx
PWG2/RESONANCES/AliRsnPID.h
PWG2/RESONANCES/AliRsnPair.cxx
PWG2/RESONANCES/AliRsnPair.h
PWG2/RESONANCES/AliRsnPairParticle.cxx
PWG2/RESONANCES/AliRsnReader.h
PWG2/RESONANCES/AliRsnReaderTaskSE.cxx

index 1299f66b4b8717f438a0e0ec7eceb5609317f133..b3f64cb9b473e5b687a3a261fdef0d443d34372a 100644 (file)
@@ -97,7 +97,7 @@ void AliRsnAnalysisSE::UserCreateOutputObjects()
     fOutList->Add(listTmp);
   }
 
-  fRsnEventBuffer = new AliRsnEventBuffer(1000);
+  fRsnEventBuffer = new AliRsnEventBuffer(fNumOfEventsInBuffer);
 //   fRsnEventBuffer = new AliRsnEventBuffer ( 10000 ,kFALSE );
   AliDebug(AliLog::kDebug, "->");
 
index 72d41de9184994998519bb391550679dbb6472ff..b4252ff4a069e3e36de39af3476e421ac1f8b698 100644 (file)
@@ -438,10 +438,8 @@ AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromESDMC(const Short_t & index)
 
   if (!fMC[index]) return (AliRsnEvent *) 0x0;
 
-  Bool_t success = fReader.FillFromESD(fRSN[index], fESD[index], fMC[index]);
-  if (!success)
+  if (!fReader.Fill(fRSN[index], (AliVEvent*) fESD[index],fMC[index]))
   {
-    AliInfo("Failed filling");
     return (AliRsnEvent*) 0x0;
   };
 
index 2744d9e64f26d5fb9d09208a7d505d55caab26ce..98ac77eec685a95fd07566b2180a9e584d10d2b9 100644 (file)
@@ -365,7 +365,8 @@ AliRsnEvent * AliRsnAnalysisTaskSEBase::GetRsnFromMC(const Short_t & index)
   if (!fRsnMC[index]) return (AliRsnEvent *) 0x0;
   if (!fReader.FillFromMC(fRSN[index], fRsnMC[index])) return (AliRsnEvent*) 0x0;
   //if (!fReader.FillFromESD(fRSN[index], fRsnESD[index], fRsnMC[index])) return (AliRsnEvent*) 0x0;
-  fPID.Process(fRSN[index], 3000);
+  fPID.Process(fRSN[index]);
+  fRSN[index]->FillPIDArrays(3000);
   return fRSN[index];
 }
 
index fd3f126e68cf14042e3f0b9832574d24ed1debd1..91f6d94f13019988002924e2bd8ad1d02cfe483e 100644 (file)
@@ -397,8 +397,15 @@ Bool_t AliRsnCut::IsSelected(ETarget type, AliRsnEvent * event)
 Bool_t AliRsnCut::IsSelected(ETarget type, AliRsnEvent * ev1, AliRsnEvent * ev2)
 {
   AliDebug(AliLog::kDebug, "<-");
+  
+  // check type
+  if (type != kMixEvent)
+  {
+    AliWarning(Form("Mismatch: type = %d (expected %d)", type, kMixEvent));
+    return kTRUE;
+  }
 
-  Double_t valueD;
+  Double_t valueD, mult1, mult2;
   Int_t    valueI;
 
   switch (fType)
@@ -406,6 +413,12 @@ Bool_t AliRsnCut::IsSelected(ETarget type, AliRsnEvent * ev1, AliRsnEvent * ev2)
     case kMultiplicityDifference:
       valueI = TMath::Abs(ev1->GetMultiplicity() - ev2->GetMultiplicity());
       return IsBetween((Int_t)valueI);
+    case kMultiplicityRatio:
+      mult1 = (Double_t)ev1->GetMultiplicity();
+      mult2 = (Double_t)ev2->GetMultiplicity();
+      if (mult1 == 0.0  && mult2 == 0.0) return kTRUE;
+      valueD = 100.0 * TMath::Abs(mult1 - mult2) / TMath::Max(mult1, mult2); // in %
+      return IsBetween((Double_t)valueD);
     case kVzDifference:
       valueD = TMath::Abs(ev1->GetVz() - ev2->GetVz());
       return IsBetween((Double_t)valueD);
index 46a6e1be080b5902cd6d2c381e5a2a81d281b642..3879e7364caea636bdd6c05c0e6426412a2ff371 100644 (file)
@@ -50,6 +50,7 @@ class AliRsnCut : public TNamed
     kPIDProb,
     kMultiplicity,
     kMultiplicityDifference,
+    kMultiplicityRatio,
     kPhiMeanDifference,
     kVzDifference,
     kLastCutType
index 49b5287f17ab0fb72981d063153eac9930743412..ccfd2048b6d67835f28d6cb9042a1b40e734e6a6 100644 (file)
@@ -247,6 +247,28 @@ void AliRsnDaughter::RotateP(Double_t angle)
   fP[1] = s*xx + c*fP[1];
 }
 
+//_____________________________________________________________________________
+Double_t AliRsnDaughter::AngleTo(AliRsnDaughter *d)
+{
+//
+// Compute angle in DEGREES between the vector momentum of (this)
+// and the one of argument.
+//
+
+  Double_t arg, dot, ptot2 = P2() * d->P2();
+  
+  if(ptot2 <= 0) {
+    return 0.0;
+  }
+  else {
+    dot = Px()*d->Px() + Py()*d->Py() + Pz()*d->Pz();
+    arg = dot / TMath::Sqrt(ptot2);
+    if (arg >  1.0) arg =  1.0;
+    if (arg < -1.0) arg = -1.0;
+    return TMath::ACos(arg) * TMath::RadToDeg();
+  }
+}
+
 //_____________________________________________________________________________
 void AliRsnDaughter::SetPIDWeight(Int_t i, Double_t value)
 {
@@ -399,8 +421,8 @@ Bool_t AliRsnDaughter::Adopt(AliESDtrack* esdTrack,EPIDType pidType ,Double_t di
   fCharge = (Short_t)esdTrack->Charge();
 
   // calculate N sigma to vertex
-  SetNSigmaToVertex(fESDTrackCuts.GetSigmaToVertex(esdTrack));
-
+  AliESDtrackCuts trkCut;
+  SetNSigmaToVertex(trkCut.GetSigmaToVertex(esdTrack));
 
   return kTRUE;
 }
index 8a97a7f8054f40fed644170103a70420adea8a9b..010b89887913d45483ac9390298c101b65ecd79d 100644 (file)
@@ -81,6 +81,7 @@ class AliRsnDaughter : public AliVParticle
     void             SetM(Double_t m) {fMass = m;}
     void             SetChi2(Double_t chi2) {fChi2 = chi2;}
     void             RotateP(Double_t angle);
+    Double_t         AngleTo(AliRsnDaughter *d);
 
     // DCA vertex
     virtual Double_t Xv() const {return fV[0];}
@@ -184,10 +185,7 @@ class AliRsnDaughter : public AliVParticle
     Double_t           fPIDProb[AliRsnPID::kSpecies];   // PID probabilities (Bayesian comp.)
     Double_t           fPIDWeight[AliRsnPID::kSpecies]; // PID weights
 
-    AliRsnMCInfo      *fMCInfo;     // reference to particle object (if any)
-    
-    AliESDtrackCuts    fESDTrackCuts; //! tmp object of AliESDtrackCuts for fNSigmaToVertex
-
+    AliRsnMCInfo      *fMCInfo;      // reference to particle object (if any)
     static EPIDMethod  fgPIDMethod; // flag to define how the PID is computed for this object
 
     ClassDef(AliRsnDaughter, 4)
index 396ff1906826e6c9a0bb7072da58e36182951b51..0183e8d553b8eafdb4cadf65df9d1bdf5678c44b 100644 (file)
@@ -27,6 +27,7 @@
 //
 
 #include <Riostream.h>
+#include <TH1.h>
 
 #include "AliLog.h"
 
@@ -42,10 +43,16 @@ AliRsnEvent::AliRsnEvent() :
     fPVx(0.0),
     fPVy(0.0),
     fPVz(0.0),
+    fPhiMean(0.0),
+    fMult(0),
     fTracks(0x0),
     fNoPID(0x0),
     fPerfectPID(0x0),
-    fRealisticPID(0x0)
+    fRealisticPID(0x0),
+    fSelPIDType(AliRsnPID::kUnknown),
+    fSelCharge('0'),
+    fSelPIDMethod(AliRsnDaughter::kRealistic),
+    fSelCuts(0x0)
 {
 //
 // Default constructor
@@ -59,10 +66,16 @@ AliRsnEvent::AliRsnEvent(const AliRsnEvent &event) :
     fPVx(event.fPVx),
     fPVy(event.fPVy),
     fPVz(event.fPVz),
+    fPhiMean(event.fPhiMean),
+    fMult(event.fMult),
     fTracks(0x0),
     fNoPID(0x0),
     fPerfectPID(0x0),
-    fRealisticPID(0x0)
+    fRealisticPID(0x0),
+    fSelPIDType(AliRsnPID::kUnknown),
+    fSelCharge('0'),
+    fSelPIDMethod(AliRsnDaughter::kRealistic),
+    fSelCuts(0x0)
 {
 //
 // Copy constructor.
@@ -97,6 +110,10 @@ AliRsnEvent& AliRsnEvent::operator= (const AliRsnEvent &event)
   fPVx = event.fPVx;
   fPVy = event.fPVy;
   fPVz = event.fPVz;
+  
+  // other data
+  fPhiMean = event.fPhiMean;
+  fMult = event.fMult;
 
   // add tracks from array of argument
   Int_t errors = Fill(event.fTracks);
@@ -192,74 +209,6 @@ AliRsnDaughter* AliRsnEvent::GetTrack(Int_t index)
   return (AliRsnDaughter*) fTracks->UncheckedAt(index);
 }
 
-//_____________________________________________________________________________
-AliRsnDaughter* AliRsnEvent::GetLeadingParticle
-(Double_t ptMin, AliRsnPID::EType type, Bool_t realistic)
-{
-//
-// Returns the particle in this event with largest transverse momentum,
-// provided that this momentum is larger than the first argument
-// and that the PID type correspond to the second argument.
-// If one specifies "AliRsnPID::kUnknown" as second arguments, the PID check is not done.
-//
-
-  Double_t prob;
-  AliRsnPID::EType trackType;
-  AliRsnDaughter *track, *leading = 0x0;
-  TObjArrayIter iter(fTracks);
-  while ((track = (AliRsnDaughter*) iter.Next()))
-  {
-    if (track->Pt() < ptMin) continue;
-    if (realistic)
-    {
-      AliRsnDaughter::SetPIDMethod(AliRsnDaughter::kRealistic);
-    }
-    else
-    {
-      AliRsnDaughter::SetPIDMethod(AliRsnDaughter::kPerfect);
-    }
-    trackType = track->PIDType(prob);
-    if (type != AliRsnPID::kUnknown && trackType != type) continue;
-    ptMin = track->Pt();
-    leading = track;
-  }
-
-  return leading;
-}
-
-//_____________________________________________________________________________
-Int_t AliRsnEvent::GetLastFastTrack
-(Double_t ptMin, AliRsnPID::EType type, Bool_t realistic)
-{
-//
-// Loops on the list of tracks (eventually skipping the ones which do not match
-// the given PID type with the specified PID method) and returns the index of the last
-// one whose transverse momentum is still larger than a specified value.
-// When no tracks are found this way, the value "-1" is returned.
-//
-
-  if (realistic)
-  {
-    AliRsnDaughter::SetPIDMethod(AliRsnDaughter::kRealistic);
-  }
-  else
-  {
-    AliRsnDaughter::SetPIDMethod(AliRsnDaughter::kPerfect);
-  }
-
-  Double_t prob;
-  Int_t i, nTracks = fTracks->GetEntries(), lastIndex = -1;
-  for (i = 0; i < nTracks; i++)
-  {
-    AliRsnDaughter *d = (AliRsnDaughter*) fTracks->At(i);
-    AliRsnPID::EType trackType = d->PIDType(prob);
-    if (type != AliRsnPID::kUnknown && trackType != type) continue;
-    if (d->Pt() >= ptMin) lastIndex = i;
-  }
-
-  return lastIndex;
-}
-
 //_____________________________________________________________________________
 TArrayI* AliRsnEvent::GetCharged(Char_t sign)
 {
@@ -511,3 +460,150 @@ Int_t AliRsnEvent::ChargeIndex(Char_t sign) const
     return -1;
   }
 }
+//_____________________________________________________________________________
+inline void AliRsnEvent::SetSelection
+(AliRsnPID::EType pid, Char_t charge, AliRsnDaughter::EPIDMethod meth, AliRsnCutSet *cuts)
+{
+//
+// Set all selection parameters at once
+//
+
+  SetSelectionPIDType(pid);
+  SetSelectionCharge(charge);
+  SetSelectionPIDMethod(meth);
+  SetSelectionTrackCuts(cuts);
+}
+
+//_____________________________________________________________________________
+AliRsnDaughter* AliRsnEvent::GetLeadingParticle(Double_t ptMin)
+{
+//
+// Searches the collection of all particles with given PID type and charge,
+// and returns the one with largest momentum, provided that it is greater than 1st argument.
+// If one specifies AliRsnPID::kUnknown as type or AliRsnDaughter::kNoPID as method,
+// the check is done over all particles irrespectively of their PID.
+// If the sign argument is '+' or '-', the check is done over the particles of that charge,
+// otherwise it is done irrespectively of the charge.
+//
+
+  Int_t i;
+  TArrayI *array = 0x0;
+  AliRsnDaughter *track1 = 0x0, *track2 = 0x0, *leading = 0x0;
+
+  if (fSelCharge == '+' || fSelCharge == '-') {
+    // if the charge '+' or '-' does simply the search
+    array = GetTracksArray(fSelPIDMethod, fSelCharge, fSelPIDType);
+    for (i = 0; i < array->GetSize(); i++) {
+      track1 = (AliRsnDaughter *) fTracks->At(array->At(i));
+      if (!track1) continue;
+      if (track1->Pt() < ptMin) continue;
+      if (!CutPass(track1)) continue;
+      ptMin = track1->Pt();
+      leading = track1;
+    }
+  }
+  else {
+    track1 = GetLeadingParticle(ptMin);
+    track2 = GetLeadingParticle(ptMin);
+    if (track1 && track2) {
+      if (track1->Pt() > track2->Pt()) leading = track1;
+      else leading = track2;
+    }
+    else if (track1) leading = track1;
+    else if (track2) leading = track2;
+    else leading = 0x0;
+  }
+
+  return leading;
+}
+
+//_____________________________________________________________________________
+Double_t AliRsnEvent::GetAverageMomentum(Int_t &count)
+{
+//
+// Loops on the list of tracks and computes average total momentum.
+//
+
+  Int_t i;
+  Double_t pmean = 0.0;
+  TArrayI *array = 0x0;
+  AliRsnDaughter *d = 0x0;
+
+  if (fSelCharge == '+' || fSelCharge == '-') {
+    // if the charge '+' or '-' does simply the search
+    count = 0;
+    array = GetTracksArray(fSelPIDMethod, fSelCharge, fSelPIDType);
+    for (i = 0; i < array->GetSize(); i++) {
+      d = (AliRsnDaughter *) fTracks->At(array->At(i));
+      if (!d) continue;
+      if (!CutPass(d)) continue;
+      pmean += d->P();
+      count++;
+    }
+    if (count > 0) pmean /= (Double_t)count;
+    else pmean = 0.0;
+  }
+  else {
+    Int_t countP, countM;
+    Double_t pmeanP = GetAverageMomentum(countP);
+    Double_t pmeanM = GetAverageMomentum(countM);
+    if (countP && countM) {
+      pmean = (pmeanP * (Double_t)countP + pmeanM * (Double_t)countM) / (countP + countM);
+      count = countP + countM;
+    }
+    else if (countP) {
+      pmean = pmeanP;
+      count = countP;
+    }
+    else if (countM) {
+      pmean = pmeanM;
+      count = countM;
+    }
+    else {
+      count = 0;
+      pmean = 0.0;
+    }
+  }
+  
+  return pmean;
+}
+
+//_____________________________________________________________________________
+Bool_t AliRsnEvent::GetAngleDistrWRLeading
+(Double_t &angleMean, Double_t &angleRMS, Double_t ptMin)
+{
+//
+// Takes the leading particle and computes the mean and RMS
+// of the distribution of directions of all other tracks
+// with respect to the direction of leading particle.
+//
+
+  AliRsnDaughter *leading = GetLeadingParticle(ptMin);
+  if (!leading) return kFALSE;
+  
+  Int_t count = 0;
+  Double_t angle, angle2Mean;
+  AliRsnDaughter *trk = 0x0;
+  TObjArrayIter next(fTracks);
+  
+  angleMean = angle2Mean = 0.0;
+  
+  while ( (trk = (AliRsnDaughter*)next()) )
+  {
+    if (trk == leading) continue;
+    
+    angle = leading->AngleTo(trk);
+    
+    angleMean += angle;
+    angle2Mean += angle * angle;
+    count++;
+  }
+  
+  if (!count) return kFALSE;
+  
+  angleMean /= (Double_t)count;
+  angle2Mean /= (Double_t)count;
+  angleRMS = TMath::Sqrt(angle2Mean - angleMean*angleMean);
+  
+  return kTRUE;
+}
index 3ee2278a32640faecfd7114ac28fa6a5308e400c..5af14a78a533578ff94ef9d62eeb07ddbdd9e739 100644 (file)
@@ -28,6 +28,9 @@
 #include "AliRsnPID.h"
 #include "AliRsnPIDIndex.h"
 #include "AliRsnDaughter.h"
+#include "AliRsnCutSet.h"
+
+class TH1D;
 
 class AliRsnEvent : public TNamed
 {
@@ -43,8 +46,6 @@ class AliRsnEvent : public TNamed
     void            Clear(Option_t *option = "");
     AliRsnDaughter* AddTrack(AliRsnDaughter track);
     AliRsnDaughter* GetTrack(Int_t index);
-    AliRsnDaughter* GetLeadingParticle(Double_t ptMin = 0.0, AliRsnPID::EType type = AliRsnPID::kUnknown, Bool_t realistic = kTRUE);
-    Int_t           GetLastFastTrack(Double_t ptMin, AliRsnPID::EType type = AliRsnPID::kUnknown, Bool_t realistic = kTRUE);
     TClonesArray*   GetTracks() {return fTracks;}
     TArrayI*        GetCharged(Char_t sign);
     TArrayI*        GetTracksArray(AliRsnDaughter::EPIDMethod method, Char_t sign, AliRsnPID::EType type);
@@ -71,6 +72,20 @@ class AliRsnEvent : public TNamed
     
     // Mean phi
     Double_t GetPhiMean() const {return fPhiMean;}
+    
+    // functions for event selection and computation (require on-fly setting of sel parameters)
+    void SetSelectionPIDType(AliRsnPID::EType type) {fSelPIDType = type;}
+    void SetSelectionCharge(Char_t charge) {fSelCharge = charge;}
+    void SetSelectionPIDMethod(AliRsnDaughter::EPIDMethod method) {fSelPIDMethod = method;}
+    void SetSelectionTrackCuts(AliRsnCutSet *cuts) {fSelCuts = cuts;}
+    void SetSelection(AliRsnPID::EType pid, Char_t charge, AliRsnDaughter::EPIDMethod meth, AliRsnCutSet *cuts = 0x0);
+    
+    Bool_t          CutPass(AliRsnDaughter *d) 
+      {if (!fSelCuts) return kTRUE; else return fSelCuts->IsSelected(AliRsnCut::kParticle, d);}
+      
+    AliRsnDaughter* GetLeadingParticle(Double_t ptMin = 0.0);
+    Double_t        GetAverageMomentum(Int_t &count);
+    Bool_t          GetAngleDistrWRLeading(Double_t &angleMean, Double_t &angleRMS, Double_t ptMin = 0.0);
 
   private:
 
@@ -88,6 +103,11 @@ class AliRsnEvent : public TNamed
     AliRsnPIDIndex *fNoPID;               // array index only for charged tracks
     AliRsnPIDIndex *fPerfectPID;          // array index for perfect PID
     AliRsnPIDIndex *fRealisticPID;        // array index for realistic PID (largest prob)
+    
+    AliRsnPID::EType           fSelPIDType;    //! (for selection/cut functions) particle type
+    Char_t                     fSelCharge;     //! (for selection/cut functions) particle charge ('0' = both)
+    AliRsnDaughter::EPIDMethod fSelPIDMethod;  //! (for selection/cut functions) PID method used
+    AliRsnCutSet              *fSelCuts;       //! (for selection/cut functions) track cuts used
 
     ClassDef(AliRsnEvent, 2);
 };
diff --git a/PWG2/RESONANCES/AliRsnEventFunction.cxx b/PWG2/RESONANCES/AliRsnEventFunction.cxx
new file mode 100644 (file)
index 0000000..6e84c10
--- /dev/null
@@ -0,0 +1,402 @@
+//
+// Class AliRsnEventFunction
+//
+// This class defines a base classe to implement a function
+// which uses the internal RSN package event format (AliRsnEvent).
+// It contains some default flags which turn out to be useful:
+//  - a flag to select only the "true" pairs (tracks from same resonance)
+//  - a flag to know if the computation is done over two events (mixing)
+//
+// Any kind of analysis object should be implemented as inheriting from this
+// because the AliRsnAnalyzer which executes the analysis will accept a collection
+// of such objects, in order to have a unique format of processing method
+//
+// The user who implements a kind of computation type should inherit from
+// this class and override the virtual functions defined in it, which
+// initialize the final output histogram and define how to process data.
+//
+//
+// author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
+//
+
+#include <Riostream.h>
+
+#include <TH1.h>
+#include <TList.h>
+#include <TString.h>
+
+#include "AliLog.h"
+
+#include "AliRsnMCInfo.h"
+#include "AliRsnDaughter.h"
+#include "AliRsnEvent.h"
+#include "AliRsnPairDef.h"
+#include "AliRsnCut.h"
+#include "AliRsnCutSet.h"
+
+#include "AliRsnEventFunction.h"
+
+ClassImp(AliRsnEventFunction)
+
+//________________________________________________________________________________________
+AliRsnEventFunction::AliRsnEventFunction() :
+  fType(kTypes),
+  fPIDMethod(AliRsnDaughter::kNoPID),
+  fPIDType(AliRsnPID::kUnknown),
+  fCharge('0'),
+  fLeadPtMin(0.0),
+  fAccept(kFALSE),
+  fUseBins(kFALSE),
+  fBins(0),
+  fBinningCut(),
+  fBinningCutType(AliRsnCut::kLastCutType),
+  fEventCuts(0x0),
+  fTrackCuts(0x0),
+  fHistoDef(0x0)
+{
+  //
+  // Constructor.
+  // The histogram data member cannot be passed externally,
+  // its initialization MUST be defined inside the Init() method,
+  // which must be overridden in any derivate implementation.
+  //
+
+  Int_t i;
+  for (i = 0; i < 100; i++)
+  {
+    fHisto[i] = 0x0;
+  }
+}
+
+//________________________________________________________________________________________
+AliRsnEventFunction::AliRsnEventFunction
+(EType type, AliRsnHistoDef *hd, AliRsnDaughter::EPIDMethod pidMethod, 
+ AliRsnPID::EType pidType, Char_t sign) :
+  fType(type),
+  fPIDMethod(pidMethod),
+  fPIDType(pidType),
+  fCharge(sign),
+  fLeadPtMin(0.0),
+  fAccept(kFALSE),
+  fUseBins(kFALSE),
+  fBins(0),
+  fBinningCut(),
+  fBinningCutType(AliRsnCut::kLastCutType),
+  fEventCuts(0x0),
+  fTrackCuts(0x0),
+  fHistoDef(hd)
+{
+  //
+  // Constructor.
+  // The histogram data member cannot be passed externally,
+  // its initialization MUST be defined inside the Init() method,
+  // which must be overridden in any derivate implementation.
+  //
+
+  Int_t i;
+  for (i = 0; i < 100; i++)
+  {
+    fHisto[i] = 0x0;
+  }
+}
+
+//________________________________________________________________________________________
+AliRsnEventFunction::AliRsnEventFunction(const AliRsnEventFunction &copy) :
+  TObject(copy),
+  fType(copy.fType),
+  fPIDMethod(copy.fPIDMethod),
+  fPIDType(copy.fPIDType),
+  fCharge(copy.fCharge),
+  fLeadPtMin(copy.fLeadPtMin),
+  fAccept(kFALSE),
+  fUseBins(copy.fUseBins),
+  fBins(0),
+  fBinningCut(),
+  fBinningCutType(AliRsnCut::kLastCutType),
+  fEventCuts(copy.fEventCuts),
+  fTrackCuts(copy.fTrackCuts),
+  fHistoDef(copy.fHistoDef)
+{
+  //
+  // Constructor.
+  // The histogram data member cannot be passed externally,
+  // its initialization MUST be defined inside the Init() method,
+  // which must be overridden in any derivate implementation.
+  //
+
+  Int_t i, n = 100;
+  for (i = 0; i < n; i++)
+  {
+    fHisto[i] = 0x0;
+  }
+
+  if (fUseBins)
+  {
+    n = copy.fBins.GetSize();
+    Double_t *array = new Double_t[n];
+    for (i = 0; i < n; i++) array[i] = copy.fBins[i];
+    SetBinningCut(copy.fBinningCutType, copy.fBins.GetSize(), array);
+    delete [] array;
+  }
+}
+
+//________________________________________________________________________________________
+void AliRsnEventFunction::Clear(Option_t* /*option*/)
+{
+  //
+  // Clear arrays and histogram.
+  // For the sake of security, all pointers are also set explicitly to NULL.
+  //
+
+  Int_t i;
+  for (i = 0; i < 100; i++)
+  {
+    delete fHisto[i];
+    fHisto[i] = 0x0;
+  }
+}
+
+//________________________________________________________________________________________
+void AliRsnEventFunction::Init(TList *histos)
+{
+  //
+  // Initialization function.
+  // By default, it initializes the owned histogram using the method
+  // from AliRsnHistoDef class, giving the same name and title of this.
+  // A user can override this behaviour, if necessary.
+  // Before creating, the HistoDef is checked for proper initialization.
+  //
+
+  Clear();
+
+  Int_t i, ibin, nbins = fHistoDef->GetNBins();
+  Double_t min = fHistoDef->GetMin(), max = fHistoDef->GetMax();
+
+  // list is created and named after the general
+  // settings used for the contained histograms
+  if (!histos)
+  {
+    AliError("NULL target list!");
+    return;
+  }
+
+  // a general histogram is always added,
+  // which overrides the binning and collects everything
+  fHisto[0] = new TH1D(GetFcnName(), "", nbins, min, max);
+  histos->AddLast(fHisto[0]);
+
+  // if requested a binning w.r. to some cut variable, histograms are added
+  // for that in this part of the method (one per each bin)
+  Char_t hName[255];
+  if (fUseBins)
+  {
+    for (ibin = 0, i = 1; ibin < fBins.GetSize() - 1; ibin++, i++)
+    {
+      sprintf(hName, "%s[%.2f-%.2f]", GetFcnName().Data(), fBins[ibin], fBins[ibin+1]);
+      fHisto[i] = new TH1D(hName, "", nbins, min, max);
+      histos->AddLast(fHisto[i]);
+    }
+  }
+}
+
+//________________________________________________________________________________________
+void AliRsnEventFunction::SetBinningCut
+(AliRsnCut::EType type, Double_t min, Double_t max, Double_t step)
+{
+  //
+  // Set fixed bins
+  //
+
+  fUseBins = kTRUE;
+
+  Int_t i, nBins = (Int_t)((max - min) / step) + 1;
+  fBinningCutType = type;
+  fBins.Set(nBins);
+  for (i = 0; i < nBins; i++)
+  {
+    fBins[i] = min + (Double_t)i * step;
+  }
+}
+
+//________________________________________________________________________________________
+void AliRsnEventFunction::SetBinningCut
+(AliRsnCut::EType type, Int_t nbins, Double_t *bins)
+{
+  //
+  // Set variable bins
+  //
+
+  fUseBins = kTRUE;
+
+  Int_t i;
+  fBinningCutType = type;
+  fBins.Set(nbins);
+  for (i = 0; i < nbins; i++)
+  {
+    fBins[i] = bins[i];
+  }
+}
+
+//________________________________________________________________________________________
+TString AliRsnEventFunction::GetFcnName()
+{
+  //
+  // Return a string which names the function type
+  //
+
+  TString text("Undef");
+
+  switch (fType)
+  {
+    case kMultiplicity:
+      text = "MULT";
+      break;
+    case kLeadingMomentum:
+      text = "PLEAD";
+      break;
+    case kLeadingTheta:
+      text = "LEADTHETA";
+      break;
+    case kAverageMomentum:
+      text = "PAVG";
+      break;
+    case kAngleLeadingMean:
+      text = "ANGLEADMEAN";
+      break;
+    case kAngleLeadingRMS:
+      text = "ANGLEADRMS";
+      break;
+    default:
+      AliError("Type not defined");
+  }
+  
+  switch (fPIDMethod)
+  {
+    case AliRsnDaughter::kNoPID:
+      text += "_NOPID_";
+      break;
+    case AliRsnDaughter::kPerfect:
+      text += "_PERFECT_";
+      break;
+    case AliRsnDaughter::kRealistic:
+      text += "_REALISTIC_";
+      break;
+    default:
+      AliError("PID method not defined");
+  }
+  
+  text += AliRsnPID::ParticleName(fPIDType);
+  text += fCharge;
+  
+  if (fEventCuts) {
+    text += '_';
+    text += fEventCuts->GetName();
+  }
+  if (fTrackCuts) {
+    text += '_';
+    text += fTrackCuts->GetName();
+  }
+
+  return text;
+}
+
+//________________________________________________________________________________________
+Bool_t AliRsnEventFunction::Fill(AliRsnEvent *event)
+{
+  //
+  // Fillse the histogram with data contained in a defined pair.
+  // This method must be overidden by an appropriate definition in each inheriting class.
+  //
+  
+  if (fEventCuts) if (!fEventCuts->IsSelected(AliRsnCut::kEvent, event)) return kFALSE;
+  
+  // first of all, set all selection definitions, using the ones in this object
+  event->SetSelectionPIDType(fPIDType);
+  event->SetSelectionCharge(fCharge);
+  event->SetSelectionPIDMethod(fPIDMethod);
+  event->SetSelectionTrackCuts(fTrackCuts);
+
+  Double_t value = FcnValue(event);
+  if (!fAccept) return kFALSE;
+
+  // fill global histogram
+  fHisto[0]->Fill(value);
+
+  // if bins are allocated, find right one and fill it
+  if (fUseBins)
+  {
+    Int_t i, ibin;
+    for (ibin = 0, i = 1; ibin < fBins.GetSize() - 1; ibin++, i++)
+    {
+      if (!fHisto[i]) continue;
+      fBinningCut.SetCutValues(fBinningCutType, (Double_t)fBins[ibin], (Double_t)fBins[ibin+1]);
+      fBinningCut.SetCutValues(fBinningCutType, (Int_t)fBins[ibin], (Int_t)fBins[ibin+1]);
+      if (fBinningCut.IsSelected(AliRsnCut::kEvent, event))
+      {
+        fHisto[i]->Fill(value);
+        break;
+      }
+    }
+  }
+
+  return kTRUE;
+}
+
+//________________________________________________________________________________________
+Double_t AliRsnEventFunction::FcnValue(AliRsnEvent *event)
+{
+  //
+  // This method must be overridden in all inheritin functions.
+  // It computes the value which must be used to fill the histogram.
+  //
+
+  Int_t count;
+  Double_t output, mean = 0.0, rms = 0.0;
+  AliRsnDaughter *trk = 0x0;
+
+  switch (fType)
+  {
+    case kMultiplicity:
+      fAccept = kTRUE;
+      output = (Double_t)event->GetMultiplicity();
+      break;
+    case kLeadingMomentum:
+      trk = event->GetLeadingParticle(fLeadPtMin);
+      if (trk) {
+        fAccept = kTRUE;
+        output = trk->P();
+      }
+      else {
+        fAccept = kFALSE;
+        output = 0.0;
+      }
+      break;
+    case kLeadingTheta:
+      trk = event->GetLeadingParticle(fLeadPtMin);
+      if (trk) {
+        fAccept = kTRUE;
+        output = trk->Theta();
+      }
+      else {
+        fAccept = kFALSE;
+        output = 0.0;
+      }
+      break;
+    case kAverageMomentum:
+      output = event->GetAverageMomentum(count);
+      fAccept = (count > 0);
+      break;
+    case kAngleLeadingMean:
+    case kAngleLeadingRMS:
+      fAccept = event->GetAngleDistrWRLeading(mean, rms, fLeadPtMin);
+      if (fType == kAngleLeadingMean) output = mean; else output = rms;
+      break;
+    default:
+      AliError(Form("Type '%d' not supported for EVENT functions", fType));
+      fAccept = kFALSE;
+      output = 0.0;
+  }
+  
+  return output;
+}
+
diff --git a/PWG2/RESONANCES/AliRsnEventFunction.h b/PWG2/RESONANCES/AliRsnEventFunction.h
new file mode 100644 (file)
index 0000000..559e772
--- /dev/null
@@ -0,0 +1,107 @@
+//
+// Class AliRsn Fcn
+//
+// This class defines a base classe to implement a typical computation
+// which uses the internal RSN package event format (AliRsnEvent).
+// It contains some default flags which turn out to be useful:
+//  - a flag to select only the "true" pairs (tracks from same resonance)
+//  - a flag to know if the computation is done over two events (mixing)
+//
+// Any kind of analysis object should be implemented as inheriting from this
+// because the AliRsnAnalyzer which executes the analysis will accept a collection
+// of such objects, in order to have a unique format of processing method
+//
+// The user who implements a kind of computation type should inherit from
+// this class and override the virtual functions defined in it, which
+// initialize the final output histogram and define how to process data.
+//
+//
+// author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
+//
+
+#ifndef ALIRsnEventFunction_H
+#define ALIRsnEventFunction_H
+
+#include <TArrayD.h>
+#include <TString.h>
+
+#include "AliRsnCut.h"
+#include "AliRsnCutSet.h"
+#include "AliRsnHistoDef.h"
+#include "AliRsnPairParticle.h"
+
+class TH1D;
+class TH2D;
+class AliRsnEvent;
+
+class AliRsnEventFunction : public TObject
+{
+
+  public:
+
+    enum EType
+    {
+      kMultiplicity,
+      kLeadingMomentum,
+      kLeadingTheta,
+      kAverageMomentum,
+      kAngleLeadingMean,
+      kAngleLeadingRMS,
+      
+      kTypes
+    };
+    
+    AliRsnEventFunction();
+    AliRsnEventFunction(EType type, AliRsnHistoDef *hd,
+                        AliRsnDaughter::EPIDMethod pidMethod = AliRsnDaughter::kNoPID,
+                        AliRsnPID::EType pidType = AliRsnPID::kUnknown,
+                        Char_t sign = '0');
+    AliRsnEventFunction(const AliRsnEventFunction &copy);
+    virtual ~AliRsnEventFunction() {Clear();}
+    virtual void Clear(Option_t *option = "");
+
+    Bool_t           UseBins() {return fUseBins;}
+    AliRsnHistoDef*  GetHistoDef() {return fHistoDef;}
+    TString          GetFcnName();
+
+    void  SetBinningCut(AliRsnCut::EType type, Double_t min, Double_t max, Double_t step);
+    void  SetBinningCut(AliRsnCut::EType type, Int_t nbins, Double_t *bins);
+    void  SetHistoDef(AliRsnHistoDef *def) {fHistoDef = def;}
+    void  SetEventCuts(AliRsnCutSet *cuts) {fEventCuts = cuts;}
+    void  SetTrackCuts(AliRsnCutSet *cuts) {fTrackCuts = cuts;}
+    void  SetLeadingPtMin(Double_t value) {fLeadPtMin = value;}
+
+    // working routines
+    void     Init(TList *tgt);
+    Bool_t   Fill(AliRsnEvent *event);
+    Double_t FcnValue(AliRsnEvent *event);
+
+  private:
+
+    const AliRsnEventFunction& operator=(const AliRsnEventFunction& /*copy*/) { return *this; }
+
+    EType                      fType;      // function type
+    
+    AliRsnDaughter::EPIDMethod fPIDMethod; // PID method to be used
+    AliRsnPID::EType           fPIDType;   // PID species to be used
+    Char_t                     fCharge;    // charge sign
+    Double_t                   fLeadPtMin; // smallest acceptable momentum of leading particle
+    
+    Bool_t                     fAccept;    // internal flag to check a computed value
+    Bool_t                     fUseBins;   // flag to choose if binning is used
+
+    TArrayD                    fBins;            // low edge of each bin (upper is the low edge of next bin)
+    AliRsnCut                  fBinningCut;      // binning cut
+    AliRsnCut::EType           fBinningCutType;  // binning cut type
+    
+    AliRsnCutSet              *fEventCuts;       // selection cuts for events
+    AliRsnCutSet              *fTrackCuts;       // selection cuts for tracks in each event
+
+    AliRsnHistoDef            *fHistoDef;        // definitions for histogram
+    TH1D                      *fHisto[100];      // binned histograms
+
+    // ROOT dictionary
+    ClassDef(AliRsnEventFunction, 1)
+};
+
+#endif
diff --git a/PWG2/RESONANCES/AliRsnEventTaskSE.cxx b/PWG2/RESONANCES/AliRsnEventTaskSE.cxx
new file mode 100644 (file)
index 0000000..332595d
--- /dev/null
@@ -0,0 +1,121 @@
+//
+// Class AliRsnEventTaskSE
+//
+// TODO
+//
+// authors: Martin Vala (martin.vala@cern.ch)
+//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//
+
+#include <TList.h>
+
+#include "AliLog.h"
+
+#include "AliAnalysisManager.h"
+
+#include "AliRsnEvent.h"
+#include "AliRsnEventFunction.h"
+#include "AliRsnEventTaskSE.h"
+
+ClassImp(AliRsnEventTaskSE)
+
+//________________________________________________________________________
+AliRsnEventTaskSE::AliRsnEventTaskSE(const char * name) :
+  AliRsnAnalysisTaskSEBase(name),
+  fEventFunctions("AliRsnEventFunction", 0),
+  fOutList(0x0)
+{
+//
+// Default constructor
+//
+
+  InitIOVars();
+  DefineOutput(1, TList::Class());
+}
+
+//________________________________________________________________________
+AliRsnEventTaskSE::~AliRsnEventTaskSE()
+{
+//
+// Destructor
+//
+}
+
+//________________________________________________________________________
+void AliRsnEventTaskSE::InitIOVars()
+{
+//
+// Init input output values
+//
+
+  AliRsnAnalysisTaskSEBase::InitIOVars();
+  fOutList = 0;
+}
+
+//________________________________________________________________________
+void AliRsnEventTaskSE::UserCreateOutputObjects()
+{
+//
+// UserCreateOutputObjects() of AliAnalysisTaskSE
+//
+
+  OpenFile(0);
+  fOutList = new TList();
+  fOutList->SetOwner();
+  fOutList->SetName("EventFunctions");
+  
+  AliRsnEventFunction *fcn = 0;
+  TObjArrayIter next(&fEventFunctions);
+  
+  while ( (fcn = (AliRsnEventFunction*)next()) )
+  {
+    fcn->Init(fOutList);
+  }
+  
+  AliInfo("List");
+  fOutList->Print();
+  AliInfo("End List");
+}
+
+//________________________________________________________________________
+void AliRsnEventTaskSE::UserExec(Option_t *)
+{
+//
+// UserExec() of AliAnalysisTaskSE
+//
+
+  if (fEntry++ % 1000 == 0) AliInfo(Form("Event %d", fEntry-1));
+
+  AliRsnEvent *curEvent = GetRsnEventFromInputType();return;
+  if (!curEvent) return;
+
+  AliRsnEventFunction *fcn = 0;
+  TObjArrayIter next(&fEventFunctions);
+  
+  while ( (fcn = (AliRsnEventFunction*)next()) )
+  {
+    fcn->Fill(curEvent);
+  }
+  
+  PostData(1, fOutList);
+}
+
+//________________________________________________________________________
+void AliRsnEventTaskSE::Terminate(Option_t *)
+{
+//
+// Terminate() of AliAnalysisTask
+//
+
+  fOutList = dynamic_cast<TList*>(GetOutputData(1));
+  if (!fOutList) { AliError("*** Output list not available ***"); return; }
+  fOutList->Print();
+}
+
+//________________________________________________________________________
+void AliRsnEventTaskSE::AddEventFunction(AliRsnEventFunction *fcn)
+{
+  Int_t size = fEventFunctions.GetEntries();
+  new (fEventFunctions[size]) AliRsnEventFunction(*fcn);
+  AliInfo(Form("Function name: %s", fcn->GetFcnName().Data()));
+}
diff --git a/PWG2/RESONANCES/AliRsnEventTaskSE.h b/PWG2/RESONANCES/AliRsnEventTaskSE.h
new file mode 100644 (file)
index 0000000..e738dab
--- /dev/null
@@ -0,0 +1,47 @@
+//
+// Class AliRsnEventTaskSE
+//
+// TODO
+//
+// authors: Martin Vala (martin.vala@cern.ch)
+//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//
+#ifndef ALIRSNEVENTTASK_H
+#define ALIRSNEVENTTASK_H
+
+#include <TClonesArray.h>
+#include "AliRsnAnalysisTaskSEBase.h"
+
+class TList;
+class AliRsnEvent;
+class AliRsnEventFunction;
+
+
+class AliRsnEventTaskSE : public AliRsnAnalysisTaskSEBase
+{
+  public:
+    AliRsnEventTaskSE(const char *name = "AliRsnEventTaskSE");
+    AliRsnEventTaskSE(const AliRsnEventTaskSE& copy): AliRsnAnalysisTaskSEBase(copy),
+        fEventFunctions("AliRsnEventFunction", 0),fOutList(0x0) {}
+    AliRsnEventTaskSE& operator= (const AliRsnEventTaskSE&) {return *this;}
+    ~AliRsnEventTaskSE();
+
+    virtual void InitIOVars();
+    virtual void UserCreateOutputObjects();
+    virtual void UserExec(Option_t *option);
+    virtual void Terminate(Option_t *);
+
+    void AddEventFunction(AliRsnEventFunction *fcn);
+
+  private:
+
+    TClonesArray  fEventFunctions;
+    TList        *fOutList;              // List of output
+
+    void          ProcessEventAnalysis(AliRsnEvent *curEvent);
+    void          PostEventProcess(const Short_t &index=0);
+
+    ClassDef(AliRsnEventTaskSE, 1)
+};
+
+#endif
index 6ffbdfc71f8ceed3e4893a0a9a81cf23b493a744..601ce4eda7f5fed84ce2bcf2180c3f1c15ae0f50 100644 (file)
@@ -305,8 +305,6 @@ TString AliRsnFunction::GetFcnName()
     case kEtaSpectrum:
       text = "ETA";
       break;
-    case kAngleSpectrum:
-      text = "ANGLE";
     default:
       AliError("Type not defined");
   }
@@ -340,9 +338,6 @@ TString AliRsnFunction::GetFcnTitle()
     case kEtaSpectrum:
       text = "#eta distribution";
       break;
-    case kAngleSpectrum:
-      text = "angle distribution";
-      break;
     default:
       AliError("Type not defined");
   }
@@ -418,8 +413,6 @@ Double_t AliRsnFunction::FcnValue(AliRsnPairParticle *pair, AliRsnPairDef *ref)
       return pair->GetPt();
     case kEtaSpectrum:
       return pair->GetEta();
-    case kAngleSpectrum:
-      return pair->GetAngle();
     default:
       AliError("Type not defined");
   }
index 68d8c139b5d9105e8e74dccda4f303774ef025e7..ea5fe33b2f7a8e3bfbae87b7f0065b42989ca256 100644 (file)
@@ -46,7 +46,6 @@ class AliRsnFunction : public TObject
       kResolution,
       kPtSpectrum,
       kEtaSpectrum,
-      kAngleSpectrum,
       kFcnTypes
     };
 
index a75b5d3035be16d03ea6ec997dc3f27db35900ea..b0c68c02ba0593bd5b0951870bb503e21631e941 100644 (file)
@@ -308,7 +308,7 @@ AliRsnPID::EType AliRsnPID::TrackType(AliRsnDaughter *d)
 }
 
 //_____________________________________________________________________________
-Bool_t AliRsnPID::Process(AliRsnEvent *event, Int_t pidArraySizeDefault)
+Bool_t AliRsnPID::Process(AliRsnEvent *event)
 {
 //
 // Performs identification for all tracks in a given event.
@@ -326,7 +326,7 @@ Bool_t AliRsnPID::Process(AliRsnEvent *event, Int_t pidArraySizeDefault)
   {
     check = check && ComputeProbs(daughter);
   }
-  event->FillPIDArrays(pidArraySizeDefault);
+  event->FillPIDArrays();
 
   return check;
 }
index ab247f1a95f1a0ea47b9992f8711df71c2248f20..f5035b2fb3558df35ba498716c001fefdee491be 100644 (file)
@@ -49,7 +49,7 @@ class AliRsnPID : public TNamed
     static Double_t     ParticleMass(EType pid);
 
     // identification routines
-    Bool_t Process(AliRsnEvent *e, Int_t pidArraySizeDefault = 1000);
+    Bool_t Process(AliRsnEvent *e);
     Bool_t ComputeProbs(AliRsnDaughter *d);
     Bool_t IdentifiedAs(AliRsnDaughter *d, EType type, Short_t charge = 0);
     EType  TrackType(AliRsnDaughter *d);
index f4ac3e00aeaeb812a095ca71b74af82ab0e32bff..88629ef63f7e542781ba9e9e6612a30b7fc3e276 100644 (file)
@@ -25,7 +25,7 @@ ClassImp(AliRsnPair)
 
 //_____________________________________________________________________________
 AliRsnPair::AliRsnPair
-(EPairType type, AliRsnPairDef *def, Int_t mixNum, Double_t mixVzCut, Int_t mixMultCut) :
+(EPairType type, AliRsnPairDef *def, Int_t mixNum) :
   TObject(),
   fIsMixed(kFALSE),
   fUseMC(kFALSE),
@@ -112,7 +112,7 @@ void AliRsnPair::Init()
 }
 
 //_____________________________________________________________________________
-void AliRsnPair::Print(
+void AliRsnPair::Print(Option_t* /*option*/) const
 {
 //
 // Prints info about pair
@@ -161,12 +161,12 @@ void AliRsnPair::ProcessPair(AliRsnEventBuffer *buf)
     AliRsnEvent *e2 = 0;
     e2 = FindEventByEventCut(buf, lastOkEvent);
     if (!e2) return;
-    //if (fIsMixed) {
-      //AliInfo(Form("ev1 = #%d -- ev2 = #%d -- nMixed = %d/%d", buf->IndexOf(e1), buf->IndexOf(e2), i, fMixNum));
+    if (fIsMixed) {
+      AliInfo(Form("ev1 = #%d -- ev2 = #%d -- nMixed = %d/%d", buf->IndexOf(e1), buf->IndexOf(e2), i, fMixNum));
       //AliInfo(Form("Diff Mult = %d", TMath::Abs(e1->GetMultiplicity() - e2->GetMultiplicity())));
       //AliInfo(Form("Diff Vz   = %f", TMath::Abs(e1->GetVz() - e2->GetVz())));
       //AliInfo(Form("Diff Phi  = %f", TMath::Abs(e1->GetPhiMean() - e2->GetPhiMean())));
-    //}
+    }
 //     if (e2->GetMultiplicity() < 1) continue;
     array2 = e2->GetTracksArray(fTypePID, fPairDef->GetCharge(1), fPairDef->GetType(1));
     LoopPair(e1, array1, e2, array2);
@@ -300,7 +300,7 @@ void AliRsnPair::GenerateHistograms(TString prefix, TList *tgt)
 }
 
 //_____________________________________________________________________________
-TString AliRsnPair::GetPairTypeName(EPairType type) 
+TString AliRsnPair::GetPairTypeName(EPairType type) const
 {
 //
 // Returns type name, made with particle names ant chosen PID
@@ -323,7 +323,7 @@ TString AliRsnPair::GetPairTypeName(EPairType type)
 }
 
 //_____________________________________________________________________________
-TString AliRsnPair::GetPairName() 
+TString AliRsnPair::GetPairName() const
 {
 //
 // Retruns pair name
@@ -336,7 +336,7 @@ TString AliRsnPair::GetPairName()
 }
 
 //_____________________________________________________________________________
-TString AliRsnPair::GetPairHistName(AliRsnFunction *fcn, TString text)
+TString AliRsnPair::GetPairHistName(AliRsnFunction *fcn, TString text) const
 {
 //
 // Returns eff. mass histogram name
@@ -357,7 +357,7 @@ TString AliRsnPair::GetPairHistName(AliRsnFunction *fcn, TString text)
 }
 
 //_____________________________________________________________________________
-TString AliRsnPair::GetPairHistTitle(AliRsnFunction *fcn, TString text)
+TString AliRsnPair::GetPairHistTitle(AliRsnFunction *fcn, TString text) const
 {
 //
 // Returns eff. mass histogram title
index d1ac9bbf681483c4795721e5e5d5ee470b824fef..fed1e2b5a1251ad7a61746a0b5964b0fbdae8788 100644 (file)
@@ -36,12 +36,11 @@ class AliRsnPair : public TObject
       kPairTypes
     };
 
-    AliRsnPair(EPairType type = kRealisticPID, AliRsnPairDef *def = 0, 
-               Int_t mixNum = 1, Double_t mixVzCut = 1.0, Int_t mixMultCut = 10);
+    AliRsnPair(EPairType type = kRealisticPID, AliRsnPairDef *def = 0, Int_t mixNum = 1);
     ~AliRsnPair();
 
     void    Init();
-    void    Print();
+    void    Print(Option_t *option = "") const;
     void    ProcessPair(AliRsnEventBuffer *buf);
     void    SetCutMgr(AliRsnCutMgr* theValue) { fCutMgr = theValue; }
     void    SetMixingCut(AliRsnCutSet* theValue) { fMixingCut = theValue; }
@@ -49,10 +48,10 @@ class AliRsnPair : public TObject
     TList*  GenerateHistograms(TString prefix = "");
     void    GenerateHistograms(TString prefix, TList *tgt);
 
-    TString GetPairTypeName(EPairType type);
-    TString GetPairName();
-    TString GetPairHistName(AliRsnFunction *fcn, TString text = "");
-    TString GetPairHistTitle(AliRsnFunction *fcn, TString text="");
+    TString GetPairTypeName(EPairType type) const;
+    TString GetPairName() const;
+    TString GetPairHistName(AliRsnFunction *fcn, TString text = "") const;
+    TString GetPairHistTitle(AliRsnFunction *fcn, TString text = "") const;
 
   private:
 
index 8dc0c477761eebc5d622937f6ad6048cbfbcc6b8..8b593451df3d8301df7ce87490c2d32b197337a1 100644 (file)
@@ -208,14 +208,12 @@ Double_t AliRsnPairParticle::GetAngle() const
 
   Double_t dotProd = 0.0;
   dotProd += fDaughter[0]->Px() * fDaughter[1]->Px();
-  dotProd += fDaughter[0]->Py() * fDaughter[1]->Py();
+  dotProd += fDaughter[0]->Py() * fDaughter[1]->Pz();
   dotProd += fDaughter[0]->Pz() * fDaughter[1]->Pz();
 
   Double_t cosAngle = dotProd / (fDaughter[0]->P() * fDaughter[1]->P());
-  Double_t angle = TMath::ACos(cosAngle) * TMath::RadToDeg();
-  if (angle < 0) angle += 360.0;
 
-  return angle;
+  return TMath::ACos(cosAngle) * TMath::RadToDeg();
 }
 
 //_____________________________________________________________________________
index 62133738cd88a37c837bf2ba98384b6e27ce2274..812c7024d5b21c12fcdca7fe8b4710669debf5c4 100644 (file)
@@ -66,7 +66,8 @@ class AliRsnReader : public TNamed
     // dummy copy methods
     AliRsnReader(const AliRsnReader &copy) : TNamed(copy),
         fCheckSplit(0),fRejectFakes(0),fWeightsMgr(0x0),fCurrentPIDtype(AliRsnDaughter::kEsd),
-        fPIDDivValue(0.),fITSClusters(0),fTPCClusters(0),fTRDClusters(0) { /*nothing*/ }
+        fPIDDivValue(0.),fITSClusters(0),fTPCClusters(0),fTRDClusters(0),
+        fTrackRefs(0),fTrackRefsITS(0),fTrackRefsTPC(0) { /*nothing*/ }
     AliRsnReader& operator=(const AliRsnReader&) {return (*this);}
 
     Bool_t                    fCheckSplit;     // flag to check and remove split tracks
index 80da9775b87df1210413905a462be6e3779a7806..7f976ca9d10568f2b3a5776f8e5573ee859ad53e 100644 (file)
@@ -91,7 +91,6 @@ void AliRsnReaderTaskSE::UserExec(Option_t */*option*/)
 
 
   // step 1: conversion
-  Int_t arraySize = 1000;
   Bool_t ok = kFALSE;
   switch (fInputType[0])
   {
@@ -113,7 +112,6 @@ void AliRsnReaderTaskSE::UserExec(Option_t */*option*/)
     case kMC:
       AliDebug(5, "Reading MC only event...");
       ok = fReader.FillFromMC(fRsnEvent, fMCEvent);
-      arraySize = 3000;
       AliDebug(5, "...done");
       break;
     default:
@@ -123,7 +121,7 @@ void AliRsnReaderTaskSE::UserExec(Option_t */*option*/)
   if (!ok) AliWarning("Failed reading");
 
   // step 2: PID probability computation
-  if (!fPID.Process(fRsnEvent, arraySize)) AliWarning("Failed PID");
+  if (!fPID.Process(fRsnEvent)) AliWarning("Failed PID");
 
   AliInfo(Form("Collected %d tracks", fRsnEvent->GetMultiplicity()));
 }