]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
few modifications on package, waiting for AOD compliance corrections
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Mar 2009 11:40:22 +0000 (11:40 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Mar 2009 11:40:22 +0000 (11:40 +0000)
21 files changed:
PWG2/PWG2resonancesLinkDef.h
PWG2/RESONANCES/AliRsnAnalysisSE.cxx
PWG2/RESONANCES/AliRsnAnalysisTaskBase.cxx
PWG2/RESONANCES/AliRsnAnalysisTaskBase.h
PWG2/RESONANCES/AliRsnCut.cxx
PWG2/RESONANCES/AliRsnCut.h
PWG2/RESONANCES/AliRsnDaughter.cxx
PWG2/RESONANCES/AliRsnDaughter.h
PWG2/RESONANCES/AliRsnEvent.h
PWG2/RESONANCES/AliRsnFunction.h
PWG2/RESONANCES/AliRsnFunctionDef.cxx [new file with mode: 0644]
PWG2/RESONANCES/AliRsnFunctionDef.h [new file with mode: 0644]
PWG2/RESONANCES/AliRsnFunctionNew.cxx [new file with mode: 0644]
PWG2/RESONANCES/AliRsnFunctionNew.h [new file with mode: 0644]
PWG2/RESONANCES/AliRsnPID.cxx
PWG2/RESONANCES/AliRsnPIDDefESD.cxx
PWG2/RESONANCES/AliRsnPIDDefESD.h
PWG2/RESONANCES/AliRsnPair.cxx
PWG2/RESONANCES/AliRsnPair.h
PWG2/RESONANCES/AliRsnReader.cxx
PWG2/libPWG2resonances.pkg

index 5d15e13c8834870a407f1f55ea2630f41ed243aa..bafbda4539dc17f40bf1a5a08452405db8849a4e 100644 (file)
@@ -24,7 +24,9 @@
 #pragma link C++ class AliRsnPairDef+;
 #pragma link C++ class AliRsnHistoDef+;
 
+#pragma link C++ class AliRsnFunctionDef+;
 #pragma link C++ class AliRsnFunction+;
+#pragma link C++ class AliRsnFunctionNew+;
 
 #pragma link C++ class AliRsnPair+;
 #pragma link C++ class AliRsnPairMgr+;
index c17660717acffd4a076cedf41d633975642a77ec..69202e9e219ca577fa3b05ba4d045483b46d982c 100644 (file)
@@ -85,18 +85,19 @@ void AliRsnAnalysisSE::UserCreateOutputObjects()
   {
     mgr = (AliRsnPairMgr *) fPairMgrs.At(iMgr);
     if (!mgr) continue;
-    listTmp = new TList();
-    listTmp->SetName(mgr->GetName());
+    //listTmp = new TList();
+    //listTmp->SetName(mgr->GetName());
     for (Int_t i=0;i< mgr->GetPairs()->GetEntriesFast();i++)
     {
       def = (AliRsnPair *) mgr->GetPairs()->At(i);
       if (def)
       {
-        listTmp->Add(def->GenerateHistograms(mgr->GetName()));
+        //listTmp->Add(def->GenerateHistograms(mgr->GetName()));
+        def->GenerateHistograms(mgr->GetName(), fOutList);
         if (def->IsMixed()) fDoesMixing = kTRUE;
       }
     }
-    fOutList->Add(listTmp);
+    //fOutList->Add(listTmp);
   }
 
   TH1I *hUsed = new TH1I("hRsnUsed", "skipped and used events in this analysis", 2, 0, 2);
index 6b8354771ce19b4b1a321806bd279e1fc7f818fe..13121745fae85674ee13fa118ae834af9b005710 100644 (file)
@@ -30,7 +30,6 @@ AliRsnAnalysisTaskBase::AliRsnAnalysisTaskBase(const char *name)
     : AliAnalysisTask(name, ""),
     fNumOfEvents(100),
     fUseAutoHandler(100),
-    fRsnInput(),
     fReader(),
     fPID(),
     fAnalysisMgr(0x0)
@@ -58,12 +57,12 @@ void AliRsnAnalysisTaskBase::InitIOVars()
   {
     fChain[i] = 0;
     fRSN[i] = 0;
-    fESD[i] = 0;
-    fMC[i] = 0;
-    fAOD[i] = 0;
-    fESDEH[i] = 0;
-    fMCEH[i] = 0;
-    fAODEH[i] = 0;
+    fRsnESD[i] = 0;
+    fRsnMC[i] = 0;
+    fRsnAOD[i] = 0;
+    fRsnESDEH[i] = 0;
+    fRsnMCEH[i] = 0;
+    fRsnAODEH[i] = 0;
     fInputType[i] = kRSN;
   }
 
@@ -90,82 +89,61 @@ Bool_t AliRsnAnalysisTaskBase::Notify()
   return AliAnalysisTask::Notify();
 }
 
-//________________________________________________________________________
-void AliRsnAnalysisTaskBase::SetInputType(EInputType type,AliAnalysisManager* am,Bool_t autohandler, Short_t inputIndex)
+//_____________________________________________________________________________
+void AliRsnAnalysisTaskBase::SetInputType(EInputType type, AliAnalysisManager* am, Bool_t autohandler, Short_t inputIndex)
 {
-//=========================================================
+//
 // Sets input type.
-// When autohandler is kTRUE handlers are created and sets
-// to AliAnalysisManager (fAnalysisMgr) if exists
-//=========================================================
-
-  AliDebug(AliLog::kDebug, "<-");
+// When autohandler is kTRUE handlers are created and connected
+// to the passed AliAnalysisManager if it exists.
+// The internal AliAnalysisManager object is redirected to the passed one.
+//
 
   fInputType[inputIndex] = type;
   fAnalysisMgr = am;
 
   UseAutoHandler(autohandler);
-
   if (!fUseAutoHandler) return;
 
   if (!fAnalysisMgr)
   {
-    AliWarning(Form("fAnalysisMgr is %p and fUseAutoHandler is %d",fAnalysisMgr,fUseAutoHandler));
+    AliWarning(Form("fAnalysisMgr is %p and fUseAutoHandler is %d", fAnalysisMgr, fUseAutoHandler));
     return;
   }
 
   switch (fInputType[inputIndex])
   {
     case kAOD:
-    {
-      if (fAnalysisMgr)
-      {
-        fAODEH[0] = new AliAODInputHandler();
-        if (fAODEH[0])
-          fAnalysisMgr->SetInputEventHandler(fAODEH[0]);
-      }
+      fRsnAODEH[0] = new AliAODInputHandler();
+      if (fRsnAODEH[0]) fAnalysisMgr->SetInputEventHandler(fRsnAODEH[0]);
       break;
-    }
     case kESD:
-    {
-      if (fAnalysisMgr)
-      {
-        fESDEH[0] = new AliESDInputHandler();
-        if (fESDEH[0])
-          fAnalysisMgr->SetInputEventHandler(fESDEH[0]);
-      }
-
+    case kESDTPC:
+      fRsnESDEH[0] = new AliESDInputHandler();
+      if (fRsnESDEH[0]) fAnalysisMgr->SetInputEventHandler(fRsnESDEH[0]);
       break;
-    }
     case kESDMC:
-    {
-      if (fAnalysisMgr)
+    case kESDMCTPC:
+    case kMC:
+      fRsnESDEH[0] = new AliESDInputHandler();
+      fRsnMCEH[0] = new AliMCEventHandler();
+      if ((fRsnESDEH[0]) && (fRsnMCEH[0]))
       {
-        fESDEH[0] = new AliESDInputHandler();
-        fMCEH[0] = new AliMCEventHandler();
-        if ((fESDEH[0]) && (fMCEH[0]))
-        {
-          fAnalysisMgr->SetInputEventHandler(fESDEH[0]);
-          fAnalysisMgr->SetMCtruthEventHandler(fMCEH[0]);
-        }
+        fAnalysisMgr->SetInputEventHandler(fRsnESDEH[0]);
+        fAnalysisMgr->SetMCtruthEventHandler(fRsnMCEH[0]);
       }
       break;
-    }
-    case kMC:
-      AliError("Not Implemented Yet ...");
-      break;
     case kRSN:
-    {
-      AliError("Not Implemented Yet ...");
       break;
-    }
     default:
       AliError("Type not supported ...");
       break;
   }
-  AliDebug(AliLog::kDebug, "->");
-}
 
+  // check if the TPC only is used
+  if (fInputType[inputIndex] == kESDTPC || fInputType[inputIndex] == kESDMCTPC) fReader.SetTPCOnly();
+  
+}
 //________________________________________________________________________
 void AliRsnAnalysisTaskBase::ConnectInputData(Option_t *)
 {
@@ -190,42 +168,36 @@ void AliRsnAnalysisTaskBase::ConnectInputDataByInputType(EInputType type ,Short_
   switch (type)
   {
     case kAOD:
-    {
       ConnectAOD(inputIndex);
       break;
-    }
     case kESD:
-    {
+    case kESDTPC:
       ConnectESD(inputIndex);
       break;
-    }
     case kESDMC:
-    {
-      ConnectESDMC(inputIndex);
-      break;
-    }
+    case kESDMCTPC:
     case kMC:
-      AliError("Not Implemented Yet ...");
+      ConnectESDMC(inputIndex);
       break;
     case kRSN:
-    {
       ConnectRSN(inputIndex);
       break;
-    }
     default:
       AliError("Type not supported ...");
       break;
   }
+
   AliDebug(AliLog::kDebug, "->");
 }
-//________________________________________________________________________
+//_____________________________________________________________________________
 void AliRsnAnalysisTaskBase::ConnectRSN(Short_t inputIndex)
 {
-//=========================================================
+//
 // Connect input data by RSN input type
-//=========================================================
+//
 
   AliDebug(AliLog::kDebug, "<-");
+
   char ** address = (char **) GetBranchAddress(inputIndex, "rsnEvents");
   if (address)
   {
@@ -236,17 +208,17 @@ void AliRsnAnalysisTaskBase::ConnectRSN(Short_t inputIndex)
     fRSN[inputIndex] = 0;
     SetBranchAddress(inputIndex, "rsnEvents", &fRSN[inputIndex]);
   }
+
   AliDebug(AliLog::kDebug, "->");
 }
 
+//_____________________________________________________________________________
 void AliRsnAnalysisTaskBase::ConnectESD(Short_t inputIndex)
 {
-//=========================================================
+//
 // Connect input data by ESD input type
-//=========================================================
-
+//
   AliDebug(AliLog::kDebug, "<-");
-
   TTree* tree = dynamic_cast<TTree*>(GetInputData(inputIndex));
   if (!tree) { AliError("Could not read chain from input slot 0"); }
   else
@@ -259,21 +231,19 @@ void AliRsnAnalysisTaskBase::ConnectESD(Short_t inputIndex)
 
     if (!esdH) { AliError("Could not get ESDInputHandler"); }
     else
-      fESD[inputIndex] = esdH->GetEvent();
+      fRsnESD[inputIndex] = esdH->GetEvent();
   }
   AliDebug(AliLog::kDebug, "->");
-
 }
-//________________________________________________________________________
+
+//_____________________________________________________________________________
 void AliRsnAnalysisTaskBase::ConnectESDMC(Short_t inputIndex)
 {
-//=========================================================
+//
 // Connect input data by ESDMC input type
-//=========================================================
+//
 
   AliDebug(AliLog::kDebug, "<-");
-
-
   TTree* tree = dynamic_cast<TTree*>(GetInputData(inputIndex));
   if (!tree) { AliError("Could not read chain from input slot 0"); }
   else
@@ -286,17 +256,17 @@ void AliRsnAnalysisTaskBase::ConnectESDMC(Short_t inputIndex)
 
     if (!esdH) { AliError("Could not get ESDInputHandler"); }
     else
-      fESD[inputIndex] = esdH->GetEvent();
+      fRsnESD[inputIndex] = esdH->GetEvent();
   }
   AliDebug(AliLog::kDebug, "->");
-
 }
-//________________________________________________________________________
+
+//_____________________________________________________________________________
 void AliRsnAnalysisTaskBase::ConnectAOD(Short_t inputIndex)
 {
-//=========================================================
+//
 // Connect input data by AOD input type
-//=========================================================
+//
 
   AliDebug(AliLog::kDebug, "<-");
 
@@ -305,68 +275,49 @@ void AliRsnAnalysisTaskBase::ConnectAOD(Short_t inputIndex)
   else
   {
     AliAODInputHandler *aodH = dynamic_cast<AliAODInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
-
     if (!aodH) { AliError("Could not get AODInputHandler"); }
-    else
-    {
-      fAOD[inputIndex] = aodH->GetEvent();
-    }
+    else fRsnAOD[inputIndex] = aodH->GetEvent();
   }
+
   AliDebug(AliLog::kDebug, "->");
 }
 
-//________________________________________________________________________
+//_____________________________________________________________________________
 AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnEventFromInputType(const Short_t & index)
 {
-//=========================================================
-// Gets Evetn from input type
-//=========================================================
+//
+// Gets Event from input type
+//
 
   switch (fInputType[index])
   {
-    case kAOD:
-    {
-      return GetRsnFromAOD(index);
-      break;
-    }
-    case kESD:
-    {
-      AliWarning("Not Implemented Yet ...");
-      return GetRsnFromESD(index);
-      break;
-    }
-    case kESDMC:
-    {
-      return GetRsnFromESDMC(index);
-      break;
-    }
-    case kMC:
-      AliWarning("Not Implemented Yet ...");
-      return (AliRsnEvent*) 0x0;
-      break;
-    case kRSN:
-    {
-      return GetRsnFromRSN(index);
-      break;
-    }
+    case kAOD:      return GetRsnFromAOD(index);
+    case kESD:      return GetRsnFromESD(index);
+    case kESDMC:    return GetRsnFromESDMC(index);
+    case kESDTPC:   return GetRsnFromESD(index);
+    case kESDMCTPC: return GetRsnFromESDMC(index);
+    case kMC:       return GetRsnFromMC(index);
+    case kRSN:      return GetRsnFromRSN(index);
     default:
       AliError("Type not supported ...");
       return (AliRsnEvent*) 0x0;
-      break;
   }
+
   return (AliRsnEvent*) 0x0;
 }
 
-
-
-//________________________________________________________________________
+//_____________________________________________________________________________
 AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromAOD(const Short_t & index)
 {
-//=========================================================
+//
 // Gets RSN event from AOD
-//=========================================================
+//
 
-  if (!fAOD[index]) { AliError("fAOD not available."); return (AliRsnEvent *) 0x0; }
+  if (!fRsnAOD[index])
+  {
+    AliError("fRsnAOD not available.");
+    return (AliRsnEvent *) 0x0;
+  }
 
   if (!fRSN[0])
   {
@@ -374,27 +325,27 @@ AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromAOD(const Short_t & index)
     fRSN[0]->SetName("rsnEvents");
     fRSN[0]->Init();
   }
+
   // clear pevious event
   fRSN[0]->Clear();
-
-  if (!fReader.Fill(fRSN[0], (AliVEvent*)  fAOD[index]))
-  {
-    return (AliRsnEvent*) 0x0;
-  };
-
+  if (!fReader.FillFromAOD(fRSN[0], fRsnAOD[index])) return (AliRsnEvent*) 0x0;
   if (!fPID.Process(fRSN[0])) AliWarning("Failed PID");
 
   return (AliRsnEvent*) fRSN[0];
-
 }
-//________________________________________________________________________
+
+//_____________________________________________________________________________
 AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromESD(const Short_t & index)
 {
-//=========================================================
+//
 // Gets RSN event from ESD
-//=========================================================
+//
 
-  if (!fESD[index]) { AliError("fESD not available."); return (AliRsnEvent *) 0x0; }
+  if (!fRsnESD[index])
+  {
+    AliError("fRsnESD not available.");
+    return (AliRsnEvent *) 0x0;
+  }
 
   if (!fRSN[index])
   {
@@ -402,47 +353,84 @@ AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromESD(const Short_t & index)
     fRSN[index]->SetName("rsnEvents");
     fRSN[index]->Init();
   }
+
   // clear pevious event
   fRSN[index]->Clear();
 
-  if (!fReader.Fill(fRSN[index], (AliVEvent*) fESD[index]))
+  if (!fReader.FillFromESD(fRSN[index], fRsnESD[index], 0x0)) return (AliRsnEvent*) 0x0;
+
+  if (!fPID.Process(fRSN[index]))
   {
+    AliWarning("Failed PID");
     return (AliRsnEvent*) 0x0;
-  };
-
-  if (!fPID.Process(fRSN[index])) AliWarning("Failed PID");
+  }
 
   return fRSN[index];
 }
-//________________________________________________________________________
-AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromESDMC(const Short_t & index)
+
+//_____________________________________________________________________________
+AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromMC(const Short_t & index)
 {
-//=========================================================
-// Gets RSN event from ESD and MC
-//=========================================================
+//
+// Gets RSN event from ESD
+//
 
-  if (!fESD[index]) { AliError("fESD not available."); return (AliRsnEvent *) 0x0; }
   AliMCEventHandler* mcHandler = dynamic_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
   if (!mcHandler) { AliError("Could not retrieve MC event handler"); return (AliRsnEvent *) 0x0; }
 
+  if (!fRsnESD[index])
+  {
+    AliError("fRsnESD not available.");
+    return (AliRsnEvent *) 0x0;
+  }
+
   if (!fRSN[index])
   {
     fRSN[index] = new AliRsnEvent();
     fRSN[index]->SetName("rsnEvents");
     fRSN[index]->Init();
   }
+
   // clear pevious event
   fRSN[index]->Clear();
 
-  fMC[index] = mcHandler->MCEvent();
+  fRsnMC[index] =  mcHandler->MCEvent();
 
-  if (!fMC[index]) return (AliRsnEvent *) 0x0;
+  if (!fRsnMC[index]) return (AliRsnEvent *) 0x0;
+  if (!fReader.FillFromMC(fRSN[index], fRsnMC[index])) return (AliRsnEvent*) 0x0;
+  fPID.Process(fRSN[index]);
+  return fRSN[index];
+}
+
+//_____________________________________________________________________________
+AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromESDMC(const Short_t & index)
+{
+//
+// Gets RSN event from ESD and MC
+//
 
-  if (!fReader.Fill(fRSN[index], (AliVEvent*) fESD[index],fMC[index]))
+  AliMCEventHandler* mcHandler = dynamic_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
+  if (!mcHandler) { AliError("Could not retrieve MC event handler"); return (AliRsnEvent *) 0x0; }
+
+  if (!fRsnESD[index])
   {
-    return (AliRsnEvent*) 0x0;
-  };
+    AliError("fRsnESD not available.");
+    return (AliRsnEvent *) 0x0;
+  }
 
+  if (!fRSN[index])
+  {
+    fRSN[index] = new AliRsnEvent();
+    fRSN[index]->SetName("rsnEvents");
+    fRSN[index]->Init();
+  }
+
+  // clear pevious event
+  fRSN[index]->Clear();
+  fRsnMC[index] =  mcHandler->MCEvent();
+
+  if (!fRsnMC[index]) return (AliRsnEvent *) 0x0;
+  if (!fReader.FillFromESD(fRSN[index], fRsnESD[index], fRsnMC[index])) return (AliRsnEvent*) 0x0;
   if (!fPID.Process(fRSN[index]))
   {
     AliWarning("Failed PID");
@@ -451,28 +439,14 @@ AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromESDMC(const Short_t & index)
 
   return fRSN[index];
 }
-//________________________________________________________________________
+
+//_____________________________________________________________________________
 AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromRSN(const Short_t & index)
 {
-//=========================================================
+//
 // Gets RSN event from RSN
 // not fully implemented yet
-//=========================================================
-
+//
   AliRsnEvent *event = fRSN[index];
-//   if ( fRsnEventBuffer->GetDeleteBufferWhenReset() == kTRUE )
-//   {
-//     event = ( AliRsnEvent * ) fRSN[index]->Clone();
-//   }
-//   AliInfo ( Form ( "%p %p",event,fRSN[index] ) );
   return event;
 }
-
-//________________________________________________________________________
-void AliRsnAnalysisTaskBase::UseAutoHandler(const Bool_t & theValue)
-{
-//=========================================================
-// Sets should create handlers
-//=========================================================
-  fUseAutoHandler = theValue;
-}
index 35b3d91ad03b9d8b62afcb9221f723c29f0ab0c4..f82a53c3171b590e7022caa26e3b2cd5154edf1e 100644 (file)
@@ -31,7 +31,7 @@ class AliRsnAnalysisTaskBase : public AliAnalysisTask
     AliRsnAnalysisTaskBase(const char *name = "AliRsnAnalysisTaskBase");\r
     AliRsnAnalysisTaskBase(const AliRsnAnalysisTaskBase& copy):AliAnalysisTask(copy),\r
         fNumOfEvents(0),fUseAutoHandler(kTRUE),\r
-        fRsnInput(1),fReader(),fPID(),fAnalysisMgr(0x0) {}\r
+        fReader(),fPID(),fAnalysisMgr(0x0) {}\r
     AliRsnAnalysisTaskBase& operator= (const AliRsnAnalysisTaskBase&) {return *this;}\r
     virtual ~AliRsnAnalysisTaskBase() {/* Does nothing*/}\r
 \r
@@ -40,6 +40,8 @@ class AliRsnAnalysisTaskBase : public AliAnalysisTask
       kAOD = 0,\r
       kESD,\r
       kESDMC,\r
+      kESDTPC,\r
+      kESDMCTPC,\r
       kMC,\r
       kRSN,\r
       kLastIndex\r
@@ -63,9 +65,9 @@ class AliRsnAnalysisTaskBase : public AliAnalysisTask
     void SetAnalysisMgr(AliAnalysisManager* theValue) { fAnalysisMgr = theValue; }\r
     AliAnalysisManager* GetAnalysisMgr() const { return fAnalysisMgr; }\r
 \r
-    AliESDInputHandler* GetESDHandler(const Int_t& theValue=0) const { return fESDEH[theValue]; }\r
-    AliMCEventHandler* GetMCHandler(const Int_t& theValue=0) const { return fMCEH[theValue]; }\r
-    AliAODInputHandler* GetAODHandler(const Int_t& theValue=0) const { return fAODEH[theValue]; }\r
+    AliESDInputHandler* GetESDHandler(const Int_t& theValue=0) const { return fRsnESDEH[theValue]; }\r
+    AliMCEventHandler* GetMCHandler(const Int_t& theValue=0) const { return fRsnMCEH[theValue]; }\r
+    AliAODInputHandler* GetAODHandler(const Int_t& theValue=0) const { return fRsnAODEH[theValue]; }\r
 \r
     AliRsnReader *GetReader() { return &fReader; }\r
     AliRsnPID *GetPID() { return &fPID;}\r
@@ -74,27 +76,25 @@ class AliRsnAnalysisTaskBase : public AliAnalysisTask
 \r
     Long64_t      fNumOfEvents;       // number of events\r
 \r
-    TChain        *fChain[2];         // input chain\r
+    TChain       *fChain[2];          // input chain\r
     EInputType    fInputType[2];      // input type\r
     Bool_t        fUseAutoHandler;    // flag if should create handler\r
 \r
-    AliRsnEvent   *fRSN[2];           // RsnMV event\r
-    AliESDEvent   *fESD[2];           // ESD event\r
-    AliMCEvent    *fMC[2];            // ESD event\r
-    AliAODEvent   *fAOD[2];           // AOD event\r
+    AliRsnEvent   *fRSN[2];           // RSN (internal format) event\r
+    AliESDEvent   *fRsnESD[2];        // ESD event\r
+    AliMCEvent    *fRsnMC[2];         // ESD event\r
+    AliAODEvent   *fRsnAOD[2];        // AOD event\r
 \r
-    AliESDInputHandler   *fESDEH[2];  // ESD event handler\r
-    AliMCEventHandler    *fMCEH[2];   // ESD event handler\r
-    AliAODInputHandler   *fAODEH[2];  // AOD event handler\r
+    AliESDInputHandler   *fRsnESDEH[2];  // ESD event handler\r
+    AliMCEventHandler    *fRsnMCEH[2];   // ESD event handler\r
+    AliAODInputHandler   *fRsnAODEH[2];  // AOD event handler\r
 \r
-\r
-    TObjArray     fRsnInput;          // array of rsn input (reader,pid,...)\r
-    AliRsnReader  fReader;            // Reader\r
-    AliRsnPID     fPID;               // PID\r
+    AliRsnReader  fReader;               // Reader\r
+    AliRsnPID     fPID;                  // PID\r
 \r
     AliAnalysisManager *fAnalysisMgr; // pointer to current AnalysisMgr\r
 \r
-    virtual void  UseAutoHandler(const Bool_t& theValue);\r
+    virtual void  UseAutoHandler(const Bool_t& theValue) {fUseAutoHandler = theValue;}\r
 \r
     virtual void  ConnectInputDataByInputType(EInputType type ,Short_t inputIndex=0);\r
     virtual void  ConnectRSN(Short_t inputIndex);\r
@@ -107,6 +107,7 @@ class AliRsnAnalysisTaskBase : public AliAnalysisTask
     virtual AliRsnEvent*  GetRsnFromESD(const Short_t &index=0);\r
     virtual AliRsnEvent*  GetRsnFromESDMC(const Short_t &index=0);\r
     virtual AliRsnEvent*  GetRsnFromRSN(const Short_t &index=0);\r
+    virtual AliRsnEvent*  GetRsnFromMC(const Short_t &index=0);\r
 \r
 \r
     ClassDef(AliRsnAnalysisTaskBase, 1)\r
index 4bf86851aa46a6c43f2bb9cc237f7ccae2030421..c3e101edce55860aafd4d0f3e3880729aef03a70 100644 (file)
@@ -323,6 +323,9 @@ Bool_t AliRsnCut::IsSelected(ETarget type, AliRsnDaughter *daughter)
       cut = IsBetween(daughter->PIDProb()[(AliRsnPID::EType)fIMin]);
       //cout << (AliRsnPID::EType)fIMin << ' ' << daughter->PIDProb()[(AliRsnPID::EType)fIMin] << ' ' << (cut?"OK":"NO") << endl;
       return cut;
+    case kAssignedPID:
+      pidType = daughter->AssignedPID();
+      return MatchesValue((Int_t)pidType);
     case kTruePID:
       pdg = TMath::Abs(mcinfo->PDG());
       cut = MatchesValue(pdg);
@@ -405,6 +408,8 @@ Bool_t AliRsnCut::IsSelected(ETarget type, AliRsnEvent * event)
 
   switch (fType)
   {
+    case kTrueMultiplicity:
+      return IsBetween((Int_t) event->GetTrueMultiplicity());
     case kMultiplicity:
       return IsBetween((Int_t) event->GetMultiplicity());
     case kVz:
@@ -435,7 +440,7 @@ Bool_t AliRsnCut::IsSelected(ETarget type, AliRsnEvent * ev1, AliRsnEvent * ev2)
   switch (fType)
   {
     case kMultiplicityDifference:
-      valueI = TMath::Abs(ev1->GetMultiplicity() - ev2->GetMultiplicity());
+      valueI = TMath::Abs(ev1->GetTrueMultiplicity() - ev2->GetTrueMultiplicity());
       return IsBetween((Int_t)valueI);
     case kMultiplicityRatio:
       mult1 = (Double_t)ev1->GetMultiplicity();
index c8ca46949804457dc59081b977b018c353ae6ae2..add5b0e29580e85e6a8959fd9d48b635bae53649 100644 (file)
@@ -54,8 +54,10 @@ class AliRsnCut : public TNamed
     kPIDType,
     kPIDProb,
     kPIDProbForSpecies,
+    kAssignedPID,
     kTruePID,
     kVz,
+    kTrueMultiplicity,
     kMultiplicity,
     kMultiplicityDifference,
     kMultiplicityRatio,
index 36112a0686d9460cb64387422a8df3547274d900..0b425a376222d481b144ddce8b1f26d3b4794d90 100644 (file)
@@ -200,7 +200,7 @@ Double_t AliRsnDaughter::AngleTo(AliRsnDaughter *d, Bool_t outInDegrees)
 }
 
 //_____________________________________________________________________________
-void  AliRsnDaughter::AssignRealisticPID()
+void  AliRsnDaughter::RealisticPID()
 {
 //
 // Assign realistic PID from largest probability
index 073b1060b000422e3956721687f034bd66f77a1c..932efbeacd802438085a7759a00a0eacff2e0c7a 100644 (file)
@@ -45,6 +45,7 @@ class AliRsnDaughter : public AliVParticle
     // 4-momentum
     virtual Double_t E()  const {return TMath::Sqrt(fMass*fMass + P2());}
     virtual Double_t E(Double_t mass) {SetM(mass); return E();}
+    virtual Double_t E(AliRsnPID::EType pid) {AssignPID(pid); return E();}
     virtual Double_t M()  const {return fMass;}
     virtual Double_t P2() const {return Px()*Px() + Py()*Py() + Pz()*Pz();}
     virtual Double_t P()  const {return TMath::Sqrt(P2());}
@@ -104,8 +105,10 @@ class AliRsnDaughter : public AliVParticle
     void                    SetPIDProb(Int_t i, Double_t value) {if (i>=0&&i<AliRsnPID::kSpecies)fPIDProb[i]=value;}
     void                    SetPIDWeight(Int_t i, Double_t value) {if (i>=0&&i<AliRsnPID::kSpecies)fPIDWeight[i]=value;}
     static void             SetPIDMethod(EPIDMethod method) {fgPIDMethod = method;}
-    void                    AssignRealisticPID();
+    void                    RealisticPID();
+    void                    AssignPID(AliRsnPID::EType pid) {fAssignedPID = pid; fMass = AliRsnPID::ParticleMass(pid);}
     AliRsnPID::EType        PIDType(Double_t &prob) const;
+    AliRsnPID::EType        AssignedPID() {return fAssignedPID;}
 
     // check that contains a given ESD flag
     void    SetFlags(ULong_t flags) {fFlags = flags;}
@@ -159,6 +162,7 @@ class AliRsnDaughter : public AliVParticle
     Int_t              fITSnum;   // number of ITS clusters
     Int_t              fTPCnum;   // number of TPC clusters
 
+    AliRsnPID::EType   fAssignedPID;                    // PID assigned to define mass
     AliRsnPID::EType   fRealisticPID;                   // PID from Bayesian probs (largest one)
     Double_t           fPIDProb[AliRsnPID::kSpecies];   // PID probabilities (Bayesian comp.)
     Double_t           fPIDWeight[AliRsnPID::kSpecies]; // PID weights
index d5a5b34e5a18c48c04bc17757b4cbeceb123e531..fe9993a81d3310e0a1cfb0acca00a6776c193fb7 100644 (file)
@@ -74,6 +74,8 @@ class AliRsnEvent : public TNamed
     void     SetPrimaryVertexMC(Double_t x, Double_t y, Double_t z) {fPVxMC=x;fPVyMC=y;fPVzMC=z;}
 
     // Multiplicity
+    void  SetTrueMultiplicity(Int_t value) {fTrueMult = value;}
+    Int_t GetTrueMultiplicity() {return fTrueMult;}
     Int_t GetMultiplicity() const {return fMult;}
     Int_t GetNCharged(Char_t sign);
 
@@ -109,6 +111,7 @@ class AliRsnEvent : public TNamed
     Double_t        fPVzMC;               // vertex in MC
 
     TClonesArray   *fTracks;              // collection of particles
+    Int_t           fTrueMult;            // true multiplicity taken from source event
 
     AliRsnPIDIndex *fNoPID;               // array index only for charged tracks
     AliRsnPIDIndex *fPerfectPID;          // array index for perfect PID
index 34b150a525f1364c4f1af57af04631905754453c..9f012426a839f6d0a00c223db2982db6ec644322 100644 (file)
@@ -83,7 +83,7 @@ class AliRsnFunction : public TObject
     Double_t    FcnResolution(AliRsnPairParticle *pair, AliRsnPairDef *pd);
 
     EFcnType         fFcnType;                      // function type
-    
+
     Double_t         fRotAngle;                     // rotation angle (for "rotated" invMass)
 
     Bool_t           fUseBins;                      // flag to choose if binning is used
diff --git a/PWG2/RESONANCES/AliRsnFunctionDef.cxx b/PWG2/RESONANCES/AliRsnFunctionDef.cxx
new file mode 100644 (file)
index 0000000..3c56087
--- /dev/null
@@ -0,0 +1,395 @@
+//
+// Class AliRsnFunctionDef
+//
+// 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 "AliRsnPairParticle.h"
+#include "AliRsnPairDef.h"
+//#include "AliRsnCut.h"
+//#include "AliRsnMCInfo.h"
+//#include "AliRsnDaughter.h"
+//#include "AliRsnEvent.h"
+
+
+#include "AliRsnFunctionDef.h"
+
+ClassImp(AliRsnFunctionDef)
+
+//________________________________________________________________________________________
+AliRsnFunctionDef::AliRsnFunctionDef() :
+  fFcnType(kFcnTypes),
+  fNBinsX(0),
+  fXmin(0.0),
+  fXmax(0.0),
+  fYUsed(0),
+  fRotAngle(0.0)
+{
+  //
+  // 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 j;
+  for (j = 0 ; j < kBinMax; j++)
+  {
+    fNBinsY[j] = 0;
+    fYbins[j].Set(0);
+  }
+}
+
+//________________________________________________________________________________________
+AliRsnFunctionDef::AliRsnFunctionDef
+(EFcnType type, Int_t nbins, Double_t min, Double_t max) :
+  fFcnType(type),
+  fNBinsX(nbins),
+  fXmin(min),
+  fXmax(max),
+  fYUsed(0),
+  fRotAngle(0.0)
+{
+  //
+  // 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 j;
+  for (j = 0 ; j < kBinMax; j++)
+  {
+    fNBinsY[j] = 0;
+    fYbins[j].Set(0);
+  }
+}
+
+//________________________________________________________________________________________
+AliRsnFunctionDef::AliRsnFunctionDef(const AliRsnFunctionDef &copy) :
+  TObject(copy),
+  fFcnType(copy.fFcnType),
+  fNBinsX(copy.fNBinsX),
+  fXmin(copy.fXmin),
+  fXmax(copy.fXmax),
+  fYUsed(copy.fYUsed),
+  fRotAngle(copy.fRotAngle)
+{
+  //
+  // Copy constructor.
+  // Calls the functions to define binning.
+  //
+
+  Int_t i, j, nbins;
+
+  for (i = 0; i < fYUsed; i++)
+  {
+    nbins = copy.fNBinsY[i];
+    if (!nbins) continue;
+    fYbins[i].Set(nbins);
+    for (j = 0; j < nbins; j++) fYbins[i][j] = copy.fYbins[i][j];
+  }
+}
+//________________________________________________________________________________________
+const AliRsnFunctionDef& AliRsnFunctionDef::operator=(const AliRsnFunctionDef& copy)
+{
+  //
+  // Assignment operator.
+  // Behaves like copy constructor.
+  // Also in this case, the histogram is not copied, and,
+  // if it was present, it is destroyed and will need to be recreated.
+  //
+
+  fFcnType = copy.fFcnType;
+  fNBinsX = copy.fNBinsX;
+  fXmin = copy.fXmin;
+  fXmax = copy.fXmax;
+  fYUsed = copy.fYUsed;
+  fRotAngle = copy.fRotAngle;
+
+  Int_t i, j, nbins;
+
+  for (i = 0; i < fYUsed; i++)
+  {
+    nbins = copy.fNBinsY[i];
+    if (!nbins) continue;
+    fYbins[i].Set(nbins);
+    for (j = 0; j < nbins; j++) fYbins[i][j] = copy.fYbins[i][j];
+  }
+
+  return (*this);
+}
+
+//________________________________________________________________________________________
+void AliRsnFunctionDef::SetBinningY
+(Int_t i, EFcnBinType type, Double_t xmin, Double_t xmax, Double_t step)
+{
+//
+// Define a secondary binning with fixed bins of given step
+//
+
+  if (i >= fYUsed) return;
+
+  Int_t ib;
+
+  fBinType[i] = type;
+  fNBinsY[i] = (Int_t)((xmax - xmin) / step) + 2;
+  fYbins[i].Set(fNBinsY[i]);
+
+  for (ib = 0; ib < fNBinsY[i]; ib++)
+  {
+    fYbins[i][ib] = xmin + (Double_t)ib * step;
+  }
+}
+
+//________________________________________________________________________________________
+void AliRsnFunctionDef::SetBinningY
+(Int_t i, EFcnBinType type, Int_t nbins, Double_t *bins)
+{
+//
+// Define a secondary binning with variable bins
+//
+
+  if (i >= fYUsed) return;
+
+  fBinType[i] = type;
+
+  Int_t ib;
+
+  fYbins[i].Set(nbins);
+  fNBinsY[i] = nbins;
+  for (ib = 0; ib < nbins; ib++)
+  {
+    fYbins[i][ib] = bins[ib];
+  }
+}
+
+//________________________________________________________________________________________
+Bool_t AliRsnFunctionDef::AddBinningY(EFcnBinType type, Double_t xmin, Double_t xmax, Double_t step)
+{
+//
+// Add a new secondary binning with fixed bins of given step
+//
+
+  if (fYUsed >= kBinMax)
+  {
+    AliError(Form("Cannot create a new binning: maximum allowed of %d is reached", kBinMax));
+    return kFALSE;
+  }
+
+  fYUsed++;
+  SetBinningY(fYUsed - 1, type, xmin, xmax, step);
+
+  return kTRUE;
+}
+
+//________________________________________________________________________________________
+Bool_t AliRsnFunctionDef::AddBinningY(EFcnBinType type, Int_t nbins, Double_t *bins)
+{
+//
+// Define a secondary binning with variable bins
+//
+
+  if (fYUsed >= kBinMax)
+  {
+    AliError(Form("Cannot create a new binning: maximum allowed of %d is reached", kBinMax));
+    return kFALSE;
+  }
+
+  fYUsed++;
+  SetBinningY(fYUsed - 1, type, nbins, bins);
+
+  return kTRUE;
+}
+
+//________________________________________________________________________________________
+TString AliRsnFunctionDef::GetFcnName()
+{
+  //
+  // Return a string which names the function type
+  //
+
+  TString text("Undef");
+
+  switch (fFcnType)
+  {
+    case kInvMass:
+      text = "IM";
+      break;
+    case kInvMassMC:
+      text = "IM_MC";
+      break;
+    case kInvMassRotated:
+      text = Form("IMR%.2f", fRotAngle);
+      break;
+    case kResolution:
+      text = "RES";
+      break;
+    case kPtSpectrum:
+      text = "PT";
+      break;
+    case kEtaSpectrum:
+      text = "ETA";
+      break;
+    default:
+      AliError("Type not defined");
+  }
+
+  return text;
+}
+
+//________________________________________________________________________________________
+TString AliRsnFunctionDef::GetFcnTitle()
+{
+  //
+  // Return a string which names the function type
+  //
+
+  TString text("Undef");
+
+  switch (fFcnType)
+  {
+    case kInvMass:
+      text = "Invariant mass";
+      break;
+    case kInvMassMC:
+      text = "Invariant mass (MC)";
+      break;
+    case kResolution:
+      text = "Resolution";
+      break;
+    case kPtSpectrum:
+      text = "p_{#perp} distribution";
+      break;
+    case kEtaSpectrum:
+      text = "#eta distribution";
+      break;
+    default:
+      AliError("Type not defined");
+  }
+
+  return text;
+}
+
+//________________________________________________________________________________________
+TString AliRsnFunctionDef::GetBinningName(Int_t i)
+{
+  //
+  // Return a string which names the function type
+  //
+
+  TString text("Undef");
+
+  if (i >= kBinMax) return text;
+
+  switch (fBinType[i])
+  {
+    case kPt:
+      text = "PT";
+      break;
+    case kEta:
+      text = "ETA";
+      break;
+    default:
+      AliError("Type not defined");
+  }
+
+  return text;
+}
+
+//________________________________________________________________________________________
+Double_t AliRsnFunctionDef::EvalX(AliRsnPairParticle *pair, AliRsnPairDef *ref)
+{
+//
+// Evaluate X value according to selected type
+//
+
+  Double_t recInvMass = pair->GetInvMass(ref->GetMass(0), ref->GetMass(1));
+  Double_t simInvMass = pair->GetInvMassMC(ref->GetMass(0), ref->GetMass(1));
+
+  switch (fFcnType)
+  {
+    case kInvMass:
+      return recInvMass;
+    case kInvMassMC:
+      return simInvMass;
+    case kInvMassRotated:
+      pair->GetDaughter(1)->RotateP(fRotAngle * TMath::DegToRad());
+      pair->ResetPair();
+      return pair->GetInvMass(ref->GetMass(0), ref->GetMass(1));
+    case kResolution:
+      return (simInvMass - recInvMass) / simInvMass;
+    case kPtSpectrum:
+      return pair->GetPt();
+    case kEtaSpectrum:
+      return pair->GetEta();
+    default:
+      AliError("Type not defined");
+      return 1000.0;
+  }
+}
+
+//________________________________________________________________________________________
+Double_t AliRsnFunctionDef::EvalY(Int_t i, AliRsnPairParticle *pair)
+{
+//
+// Evaluate Y value according to selected type
+//
+
+  if (i >= fYUsed) return 1000.0;
+
+  switch (fBinType[i])
+  {
+    case kPt:
+      return pair->GetPt();
+    case kEta:
+      return pair->GetEta();
+    default:
+      AliError("Binning type not defined");
+      return 1000.0;
+  }
+}
+
+//________________________________________________________________________________________
+void AliRsnFunctionDef::Print(Option_t* /*opt*/)
+{
+//
+// Print details on this function
+//
+
+  Int_t i, j;
+
+  cout << "DEFINITION X TYPE: " << GetFcnName().Data() << endl;
+  cout << "DEFINITION Y TYPES = " << fYUsed << endl;
+
+  for (i = 0; i < fYUsed; i++) {
+    cout << "Y TYPE #" << i << ": " << GetBinningName(i) << " [bins = ";
+    for (j = 0; j < fYbins[i].GetSize(); j++) {
+      cout << fYbins[i][j] << ' ';
+    }
+    cout << endl;
+  }
+}
diff --git a/PWG2/RESONANCES/AliRsnFunctionDef.h b/PWG2/RESONANCES/AliRsnFunctionDef.h
new file mode 100644 (file)
index 0000000..b925651
--- /dev/null
@@ -0,0 +1,112 @@
+//
+// Class AliRsnFunctionDef
+//
+// 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 ALIRSNFUNCTIONDEF_H
+#define ALIRSNFUNCTIONDEF_H
+
+#include <TArrayD.h>
+#include <TString.h>
+
+class AliRsnFunctionDef : public TObject
+{
+  public:
+
+    enum EFcnType
+    {
+      kInvMass,
+      kInvMassMC,
+      kInvMassRotated,
+      kResolution,
+      kPtSpectrum,
+      kEtaSpectrum,
+      kFcnTypes
+    };
+
+    enum EFcnBinType
+    {
+      kPt,            // binning in Pt of the pair
+      kEta,           // binning in Eta of the pair
+      kBinningTypes
+    };
+
+    enum EConstValue
+    {
+      kBinMax = 5
+    };
+
+    AliRsnFunctionDef();
+    AliRsnFunctionDef(EFcnType type, Int_t nbins, Double_t min, Double_t max);
+    AliRsnFunctionDef(const AliRsnFunctionDef &copy);
+    const AliRsnFunctionDef& operator=(const AliRsnFunctionDef &copy);
+    virtual ~AliRsnFunctionDef() { }
+
+    // names
+    TString  GetFcnName();
+    TString  GetFcnTitle();
+    TString  GetBinningName(Int_t i);
+
+    // main histogram definition
+    EFcnType GetType() {return fFcnType;}
+    Int_t    GetNBinsX() {return fNBinsX;}
+    Double_t GetXmin() {return fXmin;}
+    Double_t GetXmax() {return fXmax;}
+    void     SetBinningX(Int_t nbins, Double_t xmin, Double_t xmax) {fNBinsX=nbins;fXmin=xmin;fXmax=xmax;}
+
+    // secondary binning definition
+    Int_t    GetMaxYBinUsed() {return fYUsed;}
+    Int_t    GetNBinsY(Int_t i) {if (i<=fYUsed) return fNBinsY[i]; else return 0;}
+    TArrayD* GetYbins(Int_t i) {if (i<=fYUsed) return &fYbins[i]; else return 0x0;}
+    EFcnBinType GetYtype(Int_t i) {if (i<=fYUsed) return fBinType[i]; else return (EFcnBinType)0;}
+    void     SetBinningY(Int_t i, EFcnBinType type, Double_t xmin, Double_t xmax, Double_t step);
+    void     SetBinningY(Int_t i, EFcnBinType type, Int_t nbins, Double_t *bins);
+    Bool_t   AddBinningY(EFcnBinType type, Double_t min, Double_t max, Double_t step);
+    Bool_t   AddBinningY(EFcnBinType type, Int_t nbins, Double_t *bins);
+
+    // rotation angle
+    void     SetRotationAngle(Double_t rotAngle) {fRotAngle = rotAngle;}
+
+    // computations
+    Double_t EvalX(AliRsnPairParticle *pair, AliRsnPairDef *ref);
+    Double_t EvalY(Int_t i, AliRsnPairParticle *pair);
+
+    // other
+    void     Print(Option_t *opt = "");
+
+  private:
+
+    EFcnType     fFcnType;              // function type
+
+    Int_t        fNBinsX;               // primary histogram bins
+    Double_t     fXmin;                 // primary histogram low edge
+    Double_t     fXmax;                 // primary histogram up edge
+
+    Int_t        fYUsed;                // index of last secondary binning used
+    EFcnBinType  fBinType[kBinMax]; // binning type
+    Int_t        fNBinsY[kBinMax];      // secondary bins number
+    TArrayD      fYbins[kBinMax];       // secondary histogram bins
+
+    Double_t         fRotAngle;             // rotation angle (for "rotated" invMass)
+
+    ClassDef(AliRsnFunctionDef,1)
+};
+
+#endif
+
diff --git a/PWG2/RESONANCES/AliRsnFunctionNew.cxx b/PWG2/RESONANCES/AliRsnFunctionNew.cxx
new file mode 100644 (file)
index 0000000..48d3187
--- /dev/null
@@ -0,0 +1,239 @@
+//
+// Class AliRsnFunctionNew
+//
+// 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 <TH2.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 "AliRsnFunctionNew.h"
+
+ClassImp(AliRsnFunctionNew)
+
+//________________________________________________________________________________________
+AliRsnFunctionNew::AliRsnFunctionNew() :
+  fFcnDef(0x0),
+  fHistoTot(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 < AliRsnFunctionDef::kBinMax; i++) fHistoBin[i] = 0x0;
+}
+
+//________________________________________________________________________________________
+AliRsnFunctionNew::AliRsnFunctionNew(AliRsnFunctionDef *fd) :
+  fFcnDef(fd),
+  fHistoTot(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 < AliRsnFunctionDef::kBinMax; i++) fHistoBin[i] = 0x0;
+}
+
+//________________________________________________________________________________________
+AliRsnFunctionNew::AliRsnFunctionNew(const AliRsnFunctionNew &copy) :
+  TObject(copy),
+  fFcnDef(copy.fFcnDef),
+  fHistoTot(0x0)
+{
+  //
+  // Copy constructor.
+  // Calls the function to define binning.
+  //
+
+  Int_t i;
+  for (i = 0 ; i < AliRsnFunctionDef::kBinMax; i++) fHistoBin[i] = 0x0;
+}
+//________________________________________________________________________________________
+const AliRsnFunctionNew& AliRsnFunctionNew::operator=(const AliRsnFunctionNew& /*copy*/)
+{
+  //
+  // Assignment operator.
+  // Behaves like copy constructor.
+  // Also in this case, the histogram is not copied, and,
+  // if it was present, it is destroyed and will need to be recreated.
+  //
+
+  return (*this);
+}
+//________________________________________________________________________________________
+void AliRsnFunctionNew::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 < AliRsnFunctionDef::kBinMax; i++)
+  {
+    delete fHistoBin[i];
+    fHistoBin[i] = 0x0;
+  }
+
+  delete fHistoTot;
+  fHistoTot = 0x0;
+}
+
+//________________________________________________________________________________________
+TList* AliRsnFunctionNew::Init(const char *histoName, const char *histoTitle)
+{
+  //
+  // 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 nbins = fFcnDef->GetNBinsX();
+  Double_t min = fFcnDef->GetXmin(), max = fFcnDef->GetXmax();
+
+  // list is created and named after the general
+  // settings used for the contained histograms
+  TList *histos = new TList;
+  histos->SetName(Form("%s", fFcnDef->GetFcnName().Data()));
+
+  // a general histogram is always added,
+  // which overrides the binning and collects everything
+  fHistoTot = new TH1D(histoName, histoTitle, nbins, min, max);
+  fHistoTot->Sumw2();
+  histos->AddLast(fHistoTot);
+
+  // 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];
+  Char_t hTitle[255];
+  Int_t j, binMax = fFcnDef->GetMaxYBinUsed();
+  if (binMax > 0)
+  {
+    for (j = 0 ; j < binMax; j++)
+    {
+      Int_t     nY    = fFcnDef->GetNBinsY(j);
+      TArrayD  *binsY = fFcnDef->GetYbins(j);
+      Double_t *arrY  = binsY->GetArray();
+      sprintf(hName, "%s_%02d_%s", histoName, j, fFcnDef->GetBinningName(j).Data());
+      sprintf(hTitle, "%s [%s]", histoTitle, fFcnDef->GetBinningName(j).Data());
+      fHistoBin[j] = new TH2D(hName, hTitle, nbins, min, max, nY - 1, arrY);
+      fHistoBin[j]->Sumw2();
+      histos->AddLast(fHistoBin[j]);
+    }
+  }
+
+  // returns the full list at the end
+  return histos;
+}
+
+//________________________________________________________________________________________
+void AliRsnFunctionNew::Init(const char *histoName, const char *histoTitle, 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 nbins = fFcnDef->GetNBinsX();
+  Double_t min = fFcnDef->GetXmin(), max = fFcnDef->GetXmax();
+
+  // list is not created but its existence is checked
+  if (!histos) return;
+
+  // a general histogram is always added,
+  // which overrides the binning and collects everything
+  fHistoTot = new TH1D(histoName, histoTitle, nbins, min, max);
+  fHistoTot->Sumw2();
+  histos->AddLast(fHistoTot);
+
+  // 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];
+  Char_t hTitle[255];
+  Int_t j, binMax = fFcnDef->GetMaxYBinUsed();
+  if (binMax > 0)
+  {
+    for (j = 0 ; j < binMax; j++)
+    {
+      Int_t    nY    = fFcnDef->GetNBinsY(j);
+      TArrayD *binsY = fFcnDef->GetYbins(j);
+      sprintf(hName, "%s_%02d_%s", histoName, j, fFcnDef->GetBinningName(j).Data());
+      sprintf(hTitle, "%s [%s]", histoTitle, fFcnDef->GetBinningName(j).Data());
+      fHistoBin[j] = new TH2D(hName, hTitle, nbins, min, max, nY, binsY->GetArray());
+      fHistoBin[j]->Sumw2();
+      histos->AddLast(fHistoBin[j]);
+    }
+  }
+}
+
+//________________________________________________________________________________________
+Bool_t AliRsnFunctionNew::Fill(AliRsnPairParticle *pair, AliRsnPairDef *ref)
+{
+  //
+  // Fillse the histogram with data contained in a defined pair.
+  // This method must be overidden by an appropriate definition in each inheriting class.
+  //
+
+  Double_t valueY, valueX = fFcnDef->EvalX(pair, ref);
+
+  // fill global histogram
+  fHistoTot->Fill(valueX);
+
+  // if bins are allocated, fill them
+  Int_t j, binMax = fFcnDef->GetMaxYBinUsed();
+  if (binMax > 0)
+  {
+    for (j = 0 ; j < binMax; j++)
+    {
+      valueY = fFcnDef->EvalY(j, pair);
+      if (fHistoBin[j]) fHistoBin[j]->Fill(valueX, valueY);
+    }
+  }
+
+  return kTRUE;
+}
diff --git a/PWG2/RESONANCES/AliRsnFunctionNew.h b/PWG2/RESONANCES/AliRsnFunctionNew.h
new file mode 100644 (file)
index 0000000..46ac4d5
--- /dev/null
@@ -0,0 +1,69 @@
+//
+// 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 ALIRsnFunctionNew_H
+#define ALIRsnFunctionNew_H
+
+#include <TArrayD.h>
+#include <TString.h>
+
+//#include "AliRsnCut.h"
+#include "AliRsnFunctionDef.h"
+#include "AliRsnPairParticle.h"
+
+class TH1D;
+class TH2D;
+class AliRsnEvent;
+
+class AliRsnFunctionNew : public TObject
+{
+
+  public:
+
+    AliRsnFunctionNew();
+    AliRsnFunctionNew(AliRsnFunctionDef *fd);
+    AliRsnFunctionNew(const AliRsnFunctionNew &copy);
+    virtual ~AliRsnFunctionNew() {Clear();}
+    virtual void Clear(Option_t *option = "");
+
+    void               SetFunctionDef(AliRsnFunctionDef *def) {fFcnDef = def;}
+    AliRsnFunctionDef* GetFunctionDef() {return fFcnDef;}
+    TString            GetFcnName();
+    TString            GetFcnTitle();
+
+    // working routines
+    TList*   Init(const char *histoName, const char *histoTitle);
+    void     Init(const char *histoName, const char *histoTitle, TList *tgt);
+    Bool_t   Fill(AliRsnPairParticle *pair, AliRsnPairDef *ref);
+
+  private:
+
+    const AliRsnFunctionNew& operator=(const AliRsnFunctionNew &copy);
+
+    AliRsnFunctionDef  *fFcnDef;                               // definitions
+    TH1D               *fHistoTot;                             // integrated histogram
+    TH2D               *fHistoBin[AliRsnFunctionDef::kBinMax]; // binned histograms
+
+    // ROOT dictionary
+    ClassDef(AliRsnFunctionNew, 1)
+};
+
+#endif
index 0323ee5bb8a2d8905b07be4ad6b9d662d29ea144..4976fef61bced8b233c500c545a4187760f6b588 100644 (file)
@@ -252,7 +252,7 @@ Bool_t AliRsnPID::ComputeProbs(AliRsnDaughter *daughter)
     daughter->SetPIDProb(i, prob[i]);
   }
 
-  daughter->AssignRealisticPID();
+  daughter->RealisticPID();
   Double_t assprob;
   AliRsnDaughter::SetPIDMethod(AliRsnDaughter::kRealistic);
   AliRsnPID::EType type = daughter->PIDType(assprob);
index e5d02ae1bf654cec4a35ded9eb6fdde4ab0443a0..c9ee2e399957179f163159afe0fe22931136d123 100644 (file)
@@ -38,8 +38,7 @@
 ClassImp(AliRsnPIDDefESD)
 
 //_____________________________________________________________________________
-AliRsnPIDDefESD::AliRsnPIDDefESD() : fUseESDWeights(kTRUE)
-{
+AliRsnPIDDefESD::AliRsnPIDDefESD() : fUseESDWeights(kTRUE) {
 //
 // Default constructor.
 // By default, it is set for using ESD weights,
@@ -50,14 +49,14 @@ AliRsnPIDDefESD::AliRsnPIDDefESD() : fUseESDWeights(kTRUE)
   for (i = 0; i < kDetectors; i++) {
     fUseDet[i] = kTRUE;
     fDivValue[i] = 0.0;
+    fUseHigher[i] = kTRUE;
   }
 }
 
 //_____________________________________________________________________________
 AliRsnPIDDefESD::AliRsnPIDDefESD(const AliRsnPIDDefESD& copy) :
-  TObject(copy),
-  fUseESDWeights(copy.fUseESDWeights)
-{
+    TObject(copy),
+    fUseESDWeights(copy.fUseESDWeights) {
 //
 // Copy constructor.
 // Implemented to manage passing of this object to functions
@@ -67,12 +66,12 @@ AliRsnPIDDefESD::AliRsnPIDDefESD(const AliRsnPIDDefESD& copy) :
   for (i = 0; i < kDetectors; i++) {
     fUseDet[i] = copy.fUseDet[i];
     fDivValue[i] = copy.fDivValue[i];
+    fUseHigher[i] = copy.fUseHigher[i];
   }
 }
 
 //_____________________________________________________________________________
-void AliRsnPIDDefESD::SetScheme(EScheme scheme, Double_t divValue)
-{
+void AliRsnPIDDefESD::SetScheme(EScheme scheme, Double_t divValue) {
 //
 // Set one of the predefined schemes
 //
@@ -143,6 +142,16 @@ void AliRsnPIDDefESD::SetScheme(EScheme scheme, Double_t divValue)
       SetDivValue(kTPC, 0.0);
       SetDivValue(kTOF, divValue);
       break;
+    case kSchemeITSandTPCorTOFwithSP:
+      fUseESDWeights = kFALSE;
+      ExcludeAll();
+      IncludeDet(kITS);
+      IncludeDet(kTPC);
+      IncludeDet(kTOF);
+      SetDivValue(kITS, divValue, kFALSE);
+      SetDivValue(kTPC, divValue, kFALSE);
+      SetDivValue(kTOF, divValue, kTRUE);
+      break;
     default:
       AliWarning("PID scheme unrecognized. Set to ESD");
       fUseESDWeights = kTRUE;
@@ -150,8 +159,7 @@ void AliRsnPIDDefESD::SetScheme(EScheme scheme, Double_t divValue)
 }
 
 //_____________________________________________________________________________
-void AliRsnPIDDefESD::ComputeWeights(AliESDtrack *track, Double_t *weights)
-{
+void AliRsnPIDDefESD::ComputeWeights(AliESDtrack *track, Double_t *weights) {
 //
 // Computes the global PID weights using the given ranges
 //
@@ -171,7 +179,8 @@ void AliRsnPIDDefESD::ComputeWeights(AliESDtrack *track, Double_t *weights)
 
   Int_t i, j;
   for (i = 0; i < kDetectors; i++) {
-    if (!fUseDet[i] || pt < fDivValue[i]) {
+//     if (!fUseDet[i] || pt < fDivValue[i])
+    if (!fUseDet[i] || !CheckDivValue((EDetector)i,pt)) {
       for (j = 0; j < AliRsnPID::kSpecies; j++) {
         w[i][j] = 1.0;
       }
@@ -184,8 +193,7 @@ void AliRsnPIDDefESD::ComputeWeights(AliESDtrack *track, Double_t *weights)
 }
 
 //_____________________________________________________________________________
-void AliRsnPIDDefESD::PrintStatus()
-{
+void AliRsnPIDDefESD::PrintStatus() {
 //
 // Print informations about this object configurations
 //
@@ -194,22 +202,20 @@ void AliRsnPIDDefESD::PrintStatus()
 
   if (fUseESDWeights) {
     AliInfo("Using ESD weights");
-  }
-  else {
+  } else {
     AliInfo("NOT using ESD weights");
   }
 
   Int_t i;
   for (i = 0; i < kDetectors; i++) {
-    AliInfo(Form("Detector name: %s -- accepted: %s -- divValue = %3.1f", DetName((EDetector)i), (fUseDet[i]?"YES":"NO"), fDivValue[i]));
+    AliInfo(Form("Detector name: %s -- accepted: %s -- divValue = %3.1f useHigher = %s", DetName((EDetector)i), (fUseDet[i]?"YES":"NO"), fDivValue[i],(fUseHigher[i]?"YES":"NO")));
   }
 
   AliInfo("===== PIDDef status messages -- END");
 }
 
 //_____________________________________________________________________________
-const char* AliRsnPIDDefESD::DetName(EDetector det)
-{
+const char* AliRsnPIDDefESD::DetName(EDetector det) {
 //
 // Detector name for messages
 //
@@ -223,3 +229,32 @@ const char* AliRsnPIDDefESD::DetName(EDetector det)
     default: return "undef";
   }
 }
+
+//_____________________________________________________________________________
+void AliRsnPIDDefESD::SetDivValue(EDetector det, Double_t value, Bool_t userHigher) {
+//
+// Sets div.value properties for detector
+//
+  if (CheckBounds(det)) {
+    fDivValue[det] = value;
+    fUseHigher[det] = userHigher;
+  }
+}
+
+//_____________________________________________________________________________
+Bool_t AliRsnPIDDefESD::CheckDivValue(EDetector det,Double_t value) {
+//
+// Sets div.value properties for detector
+//
+  if (CheckBounds(det)) {
+    if (fUseHigher[det]) {
+      if (value > fDivValue[det]) return kTRUE;
+      else return kFALSE;
+    } else {
+      if (value < fDivValue[det]) return kTRUE;
+      else return kFALSE;
+    }
+  }
+
+  return kTRUE;
+}
index 93b8e4e4a3294c9f079f7ffa8986ed31c3f0b7f2..5fb792e794a15da78a9b206817dfe6aeb8cdcf27 100644 (file)
 
 class AliESDtrack;
 
-class AliRsnPIDDefESD : public TObject
-{
+class AliRsnPIDDefESD : public TObject {
   public:
 
-    enum EDetector
-    {
+    enum EDetector {
       kITS,
       kTPC,
       kTRD,
@@ -31,8 +29,7 @@ class AliRsnPIDDefESD : public TObject
       kDetectors
     };
 
-    enum EScheme
-    {
+    enum EScheme {
       kSchemeESD = 0,
       kSchemeITS,
       kSchemeTPC,
@@ -42,6 +39,7 @@ class AliRsnPIDDefESD : public TObject
       kSchemeTPCandTOF,
       kSchemeITSandTPCandTOF,
       kSchemeITSandTPCandTOFwithSP,
+      kSchemeITSandTPCorTOFwithSP,
       kSchemeLastPIDType
     };
 
@@ -56,7 +54,7 @@ class AliRsnPIDDefESD : public TObject
     void        ExcludeDet(EDetector det) {if (CheckBounds(det)) fUseDet[det] = kFALSE;}
     void        IncludeAll() { Int_t det; for (det = 0; det < kDetectors; det++) fUseDet[det] = kTRUE; }
     void        ExcludeAll() { Int_t det; for (det = 0; det < kDetectors; det++) fUseDet[det] = kFALSE; }
-    void        SetDivValue(EDetector det, Double_t value) {if (CheckBounds(det)) fDivValue[det] = value;}
+    void        SetDivValue(EDetector det, Double_t value,Bool_t userHigher=kTRUE);
     void        ComputeWeights(AliESDtrack *track, Double_t *weights);
     void        PrintStatus();
     const char* DetName(EDetector);
@@ -64,10 +62,12 @@ class AliRsnPIDDefESD : public TObject
   private:
 
     Bool_t   CheckBounds(EDetector det) { return (det >= kITS && det < kDetectors); }
+    Bool_t   CheckDivValue(EDetector det,Double_t value);
 
     Bool_t   fUseESDWeights;          // with this flag, ESD weights are used
     Bool_t   fUseDet[kDetectors];     // flag to switch off info from a detector
-    Double_t fDivValue[kDetectors];   // division value for detector weight acceptance (accepted above this value)
+    Double_t fDivValue[kDetectors];   // division value for detector weight acceptance
+    Double_t fUseHigher[kDetectors];  // accepted higher or lower then div value
 
     ClassDef(AliRsnPIDDefESD,1);
 };
index e461228f86777d771579f4007a1a1fc6bf52fc59..d072c071e15b3ed4b2897c9aac0fd79438fbcc8d 100644 (file)
@@ -155,6 +155,7 @@ void AliRsnPair::LoopPair
   AliRsnDaughter *daughter1 = 0;
   AliRsnDaughter *daughter2 = 0;
   AliRsnFunction *fcn = 0;
+  //AliRsnFunctionNew *fnew = 0;
 
   Bool_t isLikeSign = fPairDef->IsLikeSign();
   Int_t j, startj = 0;
@@ -164,6 +165,8 @@ void AliRsnPair::LoopPair
         // get track #1
         daughter1 = (AliRsnDaughter *) ev1->GetTrack(a1->At(i));
         if (!daughter1) continue;
+        // assign PID and mass of particle of type #1
+        daughter1->AssignPID(fPairDef->GetType(0));
         // cuts on track #1
         if (!CutPass(daughter1)) continue;
         // get track #2
@@ -177,6 +180,8 @@ void AliRsnPair::LoopPair
         {
             daughter2 = (AliRsnDaughter *) ev2->GetTrack(a2->At(j));
             if (!daughter2) continue;
+            // assign PID and mass of particle of type #2
+            daughter2->AssignPID(fPairDef->GetType(0));
             // cuts on track #2
             if (!CutPass(daughter2)) continue;
             // make pair
@@ -189,6 +194,11 @@ void AliRsnPair::LoopPair
             while ( (fcn = (AliRsnFunction*)nextFcn()) ) {
                 fcn->Fill(&pairParticle, fPairDef);
             }
+            /*
+            while ( (fnew = (AliRsnFunction*)nextFcn()) ) {
+              fnew->Fill(&pairParticle, fPairDef);
+            }
+            */
         }
     }
 }
@@ -339,6 +349,19 @@ void AliRsnPair::AddFunction(AliRsnFunction *fcn)
   new (fFunctions[size]) AliRsnFunction(*fcn);
 }
 
+/*
+//_____________________________________________________________________________
+void AliRsnPair::AddFunction(AliRsnFunctionDef *fcn)
+{
+//
+// Adds a new computing function
+//
+
+  Int_t size = fFunctions.GetEntries();
+  new (fFunctions[size]) AliRsnFunctionNew(fcn);
+}
+*/
+
 //________________________________________________________________________________________
 Bool_t AliRsnPair::CutPass(AliRsnDaughter *d)
 {
index deee19c1d941422be2bf9f11043df9f2ebe0874e..bd15007e795d2088049e73b9ae38eb58f0a64961 100644 (file)
@@ -21,6 +21,8 @@
 #include "AliRsnEvent.h"
 #include "AliRsnCutMgr.h"
 #include "AliRsnHistoDef.h"
+#include "AliRsnFunctionDef.h"
+#include "AliRsnFunctionNew.h"
 
 class AliRsnFunction;
 
@@ -43,6 +45,7 @@ class AliRsnPair : public TObject
     void    ProcessPair(AliRsnEvent *ev1, AliRsnEvent *ev2 = 0);
     void    SetCutMgr(AliRsnCutMgr* theValue) { fCutMgr = theValue; }
     void    AddFunction(AliRsnFunction *fcn);
+    //void    AddFunction(AliRsnFunctionDef *fcn);
     TList*  GenerateHistograms(TString prefix = "");
     void    GenerateHistograms(TString prefix, TList *tgt);
 
@@ -54,6 +57,8 @@ class AliRsnPair : public TObject
     TString GetPairName() const;
     TString GetPairHistName(AliRsnFunction *fcn, TString text = "") const;
     TString GetPairHistTitle(AliRsnFunction *fcn, TString text = "") const;
+    //TString GetPairHistName(AliRsnFunctionNew *fcn, TString text = "") const;
+    //TString GetPairHistTitle(AliRsnFunctionNew *fcn, TString text = "") const;
 
   private:
 
index c23ad10e85ef87aa263808c3f117d77d56090e09..e6c509c4292e447c48d717b43fcfe7f204668702 100644 (file)
@@ -28,6 +28,7 @@
 #include "AliESDtrack.h"
 #include "AliESDVertex.h"
 #include "AliESDtrackCuts.h"
+#include "AliMultiplicity.h"
 
 #include "AliAODEvent.h"
 #include "AliAODTrack.h"
@@ -328,6 +329,11 @@ Bool_t AliRsnReader::FillFromESD(AliRsnEvent *rsn, AliESDEvent *esd, AliMCEvent
   Int_t ntracks = esd->GetNumberOfTracks();
   if (!ntracks) return kFALSE;
 
+  // set SPD multiplicity
+  const AliMultiplicity* SPDMult = esd->GetMultiplicity();
+  Int_t nTracklets = SPDMult->GetNumberOfTracklets();
+  rsn->SetTrueMultiplicity(nTracklets);
+
   // if required with the flag, scans the event
   // and searches all split tracks (= 2 tracks with the same label);
   // for each pair of split tracks, only the better (best chi2) is kept
@@ -482,6 +488,7 @@ Bool_t AliRsnReader::FillFromAOD(AliRsnEvent *rsn, AliAODEvent *aod, AliMCEvent
   // get number of tracks
   Int_t ntracks = aod->GetNTracks();
   if (!ntracks) return kFALSE;
+  rsn->SetTrueMultiplicity(ntracks);
 
   // get primary vertex
   Double_t vertex[3];
@@ -591,6 +598,7 @@ Bool_t AliRsnReader::FillFromMC(AliRsnEvent *rsn, AliMCEvent *mc)
   vz = (Double_t)fvertex[2];
   rsn->SetPrimaryVertex(vx, vy, vz);
   rsn->SetPrimaryVertexMC(vx, vy, vz);
+  rsn->SetTrueMultiplicity(stack->GetNprimary());
 
   // store tracks from MC
   Int_t  i, index, labmum, nRef, nRefITS, nRefTPC, detectorID;
index ee5104ae3afd355853836479d9ba20f729f83ce0..aeb80119ed86e5c1e2260e1a8fcc76d9443eb1a5 100644 (file)
@@ -17,7 +17,9 @@ SRCS= RESONANCES/AliRsnMCInfo.cxx \
       RESONANCES/AliRsnReaderTaskSE.cxx \
       RESONANCES/AliRsnPairDef.cxx \
       RESONANCES/AliRsnHistoDef.cxx \
+      RESONANCES/AliRsnFunctionDef.cxx \
       RESONANCES/AliRsnFunction.cxx \
+      RESONANCES/AliRsnFunctionNew.cxx \
       RESONANCES/AliRsnPair.cxx \
       RESONANCES/AliRsnPairMgr.cxx \
       RESONANCES/AliRsnAnalysisTaskSEBase.cxx \