]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Corrections, bug fixes and a class name change
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Sep 2008 15:52:18 +0000 (15:52 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Sep 2008 15:52:18 +0000 (15:52 +0000)
45 files changed:
PWG2/RESONANCES/AliRsnAnalysisSE.cxx
PWG2/RESONANCES/AliRsnAnalysisSE.h
PWG2/RESONANCES/AliRsnAnalysisTask2ndStep.cxx
PWG2/RESONANCES/AliRsnAnalysisTask2ndStep.h
PWG2/RESONANCES/AliRsnAnalysisTaskBase.cxx [moved from PWG2/RESONANCES/AliRsnBaseAT.cxx with 88% similarity]
PWG2/RESONANCES/AliRsnAnalysisTaskBase.h [moved from PWG2/RESONANCES/AliRsnBaseAT.h with 82% similarity]
PWG2/RESONANCES/AliRsnAnalysisTaskSEBase.cxx
PWG2/RESONANCES/AliRsnAnalysisTaskSEBase.h
PWG2/RESONANCES/AliRsnComparisonAT.cxx
PWG2/RESONANCES/AliRsnComparisonAT.h
PWG2/RESONANCES/AliRsnComparisonObj.h
PWG2/RESONANCES/AliRsnCut.cxx
PWG2/RESONANCES/AliRsnCut.h
PWG2/RESONANCES/AliRsnCutMgr.h
PWG2/RESONANCES/AliRsnCutSet.cxx
PWG2/RESONANCES/AliRsnCutSet.h
PWG2/RESONANCES/AliRsnDaughter.cxx
PWG2/RESONANCES/AliRsnDaughter.h
PWG2/RESONANCES/AliRsnEvent.cxx
PWG2/RESONANCES/AliRsnEvent.h
PWG2/RESONANCES/AliRsnEventBuffer.cxx
PWG2/RESONANCES/AliRsnEventBuffer.h
PWG2/RESONANCES/AliRsnFunction.cxx
PWG2/RESONANCES/AliRsnFunction.h
PWG2/RESONANCES/AliRsnHistoDef.cxx
PWG2/RESONANCES/AliRsnHistoDef.h
PWG2/RESONANCES/AliRsnMCInfo.cxx
PWG2/RESONANCES/AliRsnMCInfo.h
PWG2/RESONANCES/AliRsnPID.cxx
PWG2/RESONANCES/AliRsnPID.h
PWG2/RESONANCES/AliRsnPIDIndex.cxx
PWG2/RESONANCES/AliRsnPIDIndex.h
PWG2/RESONANCES/AliRsnPair.cxx
PWG2/RESONANCES/AliRsnPair.h
PWG2/RESONANCES/AliRsnPairDef.cxx
PWG2/RESONANCES/AliRsnPairMgr.cxx
PWG2/RESONANCES/AliRsnPairMgr.h
PWG2/RESONANCES/AliRsnPairParticle.cxx
PWG2/RESONANCES/AliRsnPairParticle.h
PWG2/RESONANCES/AliRsnReader.cxx
PWG2/RESONANCES/AliRsnReader.h
PWG2/RESONANCES/AliRsnReaderTask.cxx
PWG2/RESONANCES/AliRsnReaderTask.h
PWG2/RESONANCES/AliRsnReaderTaskSE.cxx
PWG2/RESONANCES/AliRsnReaderTaskSE.h

index 776fee0375698fa3b12cb5cacbb66a8bbad823a9..1299f66b4b8717f438a0e0ec7eceb5609317f133 100644 (file)
@@ -71,7 +71,7 @@ void AliRsnAnalysisSE::UserCreateOutputObjects()
 
   AliDebug(AliLog::kDebug, "<-");
 //   fPID.DumpPriors();
-  OpenFile ( 0 );
+  OpenFile(0);
   fOutList = new TList();
   fOutList->SetOwner();
   AliRsnPair *def=0;
@@ -89,15 +89,15 @@ void AliRsnAnalysisSE::UserCreateOutputObjects()
       if (def)
       {
         def->Init();
-        //listTmp->Add(def->GenerateHistograms(mgr->GetName()));
-        def->GenerateHistograms(mgr->GetName(), listTmp);
+        listTmp->Add(def->GenerateHistograms(mgr->GetName()));
+        //def->GenerateHistograms(mgr->GetName(), listTmp);
         //def->Print();
       }
     }
     fOutList->Add(listTmp);
   }
 
-  fRsnEventBuffer = new AliRsnEventBuffer(100);
+  fRsnEventBuffer = new AliRsnEventBuffer(1000);
 //   fRsnEventBuffer = new AliRsnEventBuffer ( 10000 ,kFALSE );
   AliDebug(AliLog::kDebug, "->");
 
@@ -111,7 +111,7 @@ void AliRsnAnalysisSE::UserExec(Option_t *)
 //=========================================================
 
   if (fEntry++%1000==0)
-    AliInfo(Form("Event %d",-1));
+    AliInfo(Form("Event %d",fEntry-1));
 
   AliRsnEvent *curEvent = GetRsnEventFromInputType();
   if (!curEvent) return;
index d143c6ec754e826972fa9bfcc8d062f9d6c4ba29..48feb4e4d87a05b94f8716ba6eca192ae93db089 100644 (file)
@@ -22,7 +22,7 @@ class AliRsnAnalysisSE : public AliRsnAnalysisTaskSEBase
   public:
     AliRsnAnalysisSE(const char *name = "AliRsnAnalysisSE");
     AliRsnAnalysisSE(const AliRsnAnalysisSE& copy): AliRsnAnalysisTaskSEBase(copy),
-       fPairMgrs(0),fOutList(0x0),fRsnEventBuffer(0x0),fNumOfEventsInBuffer(100) {}
+        fPairMgrs(0),fOutList(0x0),fRsnEventBuffer(0x0),fNumOfEventsInBuffer(100) {}
     AliRsnAnalysisSE& operator= (const AliRsnAnalysisSE&) {return *this;}
     ~AliRsnAnalysisSE();
 
index 6d23584fa426742195c8348ead20c062797af0db..dd0ac0748a73dfb4954db109d56f2e86b7d30a8c 100644 (file)
@@ -29,18 +29,18 @@ ClassImp(AliRsnAnalysisTask2ndStep)
 
 //_____________________________________________________________________________
 AliRsnAnalysisTask2ndStep::AliRsnAnalysisTask2ndStep(const char *name) :
-  AliAnalysisTaskSE(name),
-  fOutList(0x0),
-  fPairMgrs(0x0),
-  fEventBuffer(0x0),
-  fRsnHandlerAOD(0x0),
-  fAnalysisMgr(0x0)
+    AliAnalysisTaskSE(name),
+    fOutList(0x0),
+    fPairMgrs(0x0),
+    fEventBuffer(0x0),
+    fRsnHandlerAOD(0x0),
+    fAnalysisMgr(0x0)
 {
 //
 // Default constructor
 //
 
-    DefineOutput(1, TList::Class());
+  DefineOutput(1, TList::Class());
 }
 
 //_____________________________________________________________________________
@@ -50,16 +50,17 @@ void AliRsnAnalysisTask2ndStep::CreateHandlers(AliAnalysisManager* am)
 // Sets the handlers.
 //
 
-    fAnalysisMgr = am;
-    if (!fAnalysisMgr) {
-        AliWarning("Passed a NULL AnalysisManager!");
-        return;
-    }
-    
-    // this task is made only for building histograms from
-    // a set of RSN events saved as non-standard branches in AOD tree
-    fRsnHandlerAOD = new AliAODInputHandler();
-    if (fRsnHandlerAOD) fAnalysisMgr->SetInputEventHandler(fRsnHandlerAOD);
+  fAnalysisMgr = am;
+  if (!fAnalysisMgr)
+  {
+    AliWarning("Passed a NULL AnalysisManager!");
+    return;
+  }
+
+  // this task is made only for building histograms from
+  // a set of RSN events saved as non-standard branches in AOD tree
+  fRsnHandlerAOD = new AliAODInputHandler();
+  if (fRsnHandlerAOD) fAnalysisMgr->SetInputEventHandler(fRsnHandlerAOD);
 }
 
 //_____________________________________________________________________________
@@ -68,40 +69,44 @@ void AliRsnAnalysisTask2ndStep::UserCreateOutputObjects()
 //
 // Creates output objects, as a TList of all histograms
 //
-    AliInfo("--->");
-    
-    //OpenFile (1);
-    if (fOutList) {
-        fOutList->Clear();
-        delete fOutList;
-    }
-    fOutList = new TList();
-    fOutList->SetOwner();
-    AliRsnPairMgr *pairMgr = 0x0;
-    AliRsnPair *pair = 0x0;
-    
-    if (!fPairMgrs) {
-        AliError("No pair managers defined!");
-        return;
+  AliInfo("--->");
+
+  //OpenFile (1);
+  if (fOutList)
+  {
+    fOutList->Clear();
+    delete fOutList;
+  }
+  fOutList = new TList();
+  fOutList->SetOwner();
+  AliRsnPairMgr *pairMgr = 0x0;
+  AliRsnPair *pair = 0x0;
+
+  if (!fPairMgrs)
+  {
+    AliError("No pair managers defined!");
+    return;
+  }
+
+  TObjArrayIter next(fPairMgrs);
+  while ((pairMgr = (AliRsnPairMgr*)next()))
+  {
+    TList *listTmp = new TList();
+    listTmp->SetName(pairMgr->GetName());
+    TObjArrayIter nextPair(pairMgr->GetPairs());
+    while ((pair = (AliRsnPair*)nextPair()))
+    {
+      pair->Init();
+      //pair->Print();
+      pair->GenerateHistograms(pairMgr->GetName(), listTmp);
+      //listTmp->Add(pair->GenerateHistograms(pairMgr->GetName()));
+      //fOutList->Add(listTmp);
     }
-    
-    TObjArrayIter next(fPairMgrs);
-    while ( (pairMgr = (AliRsnPairMgr*)next()) ) {
-        TList *listTmp = new TList();
-        listTmp->SetName(pairMgr->GetName());
-        TObjArrayIter nextPair(pairMgr->GetPairs());
-        while ( (pair = (AliRsnPair*)nextPair()) ) {
-            pair->Init();
-            //pair->Print();
-            pair->GenerateHistograms(pairMgr->GetName(), listTmp);
-            //listTmp->Add(pair->GenerateHistograms(pairMgr->GetName()));
-            //fOutList->Add(listTmp);
-        }
-        fOutList->Add(listTmp);
-    }
-    fEventBuffer = new AliRsnEventBuffer(1000);
-    
-    AliInfo("<---");
+    fOutList->Add(listTmp);
+  }
+  fEventBuffer = new AliRsnEventBuffer(1000);
+
+  AliInfo("<---");
 }
 
 //_____________________________________________________________________________
@@ -110,20 +115,20 @@ void AliRsnAnalysisTask2ndStep::UserExec(Option_t *)
 //
 // Executes the task
 //
-    
-    if (fEntry++ % 1000 == 0) AliInfo(Form("Event %d",-1));
-    
-    // retrieve AOD
-    AliAODEvent *aod = dynamic_cast<AliAODEvent*>(fInputEvent);
-    
-    // find RSN event
-    AliRsnEvent *rsn = (AliRsnEvent*)(aod->GetList()->FindObject("rsnEvents"));
-    
-    // execute analysis
-    ProcessEventAnalysis(rsn);
-    PostEventProcess();
-    
-    PostData(1, fOutList);
+
+  if (fEntry++ % 1000 == 0) AliInfo(Form("Event %d",-1));
+
+  // retrieve AOD
+  AliAODEvent *aod = dynamic_cast<AliAODEvent*>(fInputEvent);
+
+  // find RSN event
+  AliRsnEvent *rsn = (AliRsnEvent*)(aod->GetList()->FindObject("rsnEvents"));
+
+  // execute analysis
+  ProcessEventAnalysis(rsn);
+  PostEventProcess();
+
+  PostData(1, fOutList);
 }
 
 //_____________________________________________________________________________
@@ -133,9 +138,9 @@ void AliRsnAnalysisTask2ndStep::Terminate(Option_t *)
 // A simple check on the output list
 //
 
-    fOutList = dynamic_cast<TList*>(GetOutputData(1));
-    if (!fOutList) { AliError("--- Output list not available ---"); return; }
-    fOutList->Print();
+  fOutList = dynamic_cast<TList*>(GetOutputData(1));
+  if (!fOutList) { AliError("--- Output list not available ---"); return; }
+  fOutList->Print();
 }
 
 //_____________________________________________________________________________
@@ -145,19 +150,21 @@ void AliRsnAnalysisTask2ndStep::ProcessEventAnalysis(AliRsnEvent *curEvent)
 // Process of one event
 //
 
-    // Adds event to Event Buffer
-    fEventBuffer->AddEvent(curEvent);
-    
-    // loop over all Pair managers
-    AliRsnPair *pair = 0;
-    AliRsnPairMgr *mgr = 0;
-    TObjArrayIter nextMgr(fPairMgrs);
-    while ( (mgr = (AliRsnPairMgr*)nextMgr()) ) {
-        TObjArrayIter nextPair(mgr->GetPairs());
-        while ( (pair = (AliRsnPair*)nextPair()) ) {
-            pair->ProcessPair(fEventBuffer);
-        }
+  // Adds event to Event Buffer
+  fEventBuffer->AddEvent(curEvent);
+
+  // loop over all Pair managers
+  AliRsnPair *pair = 0;
+  AliRsnPairMgr *mgr = 0;
+  TObjArrayIter nextMgr(fPairMgrs);
+  while ((mgr = (AliRsnPairMgr*)nextMgr()))
+  {
+    TObjArrayIter nextPair(mgr->GetPairs());
+    while ((pair = (AliRsnPair*)nextPair()))
+    {
+      pair->ProcessPair(fEventBuffer);
     }
+  }
 }
 
 //_____________________________________________________________________________
@@ -172,6 +179,6 @@ void AliRsnAnalysisTask2ndStep::PostEventProcess()
 //_____________________________________________________________________________
 void AliRsnAnalysisTask2ndStep::AddPairMgr(AliRsnPairMgr *pairmgr)
 {
-    if (!fPairMgrs) fPairMgrs = new TObjArray;
-    fPairMgrs->Add(pairmgr);
+  if (!fPairMgrs) fPairMgrs = new TObjArray;
+  fPairMgrs->Add(pairmgr);
 }
index f21720be65c3406f5a45315fe99f89f7cc4483c4..f1e134289ceb7c86211484ebceafa5bebc8ce906 100644 (file)
@@ -41,12 +41,12 @@ class AliRsnAnalysisTask2ndStep : public AliAnalysisTaskSE
     void PostEventProcess();
 
   private:
-  
+
     AliRsnAnalysisTask2ndStep(const AliRsnAnalysisTask2ndStep& copy) :
         AliAnalysisTaskSE(copy),fOutList(0x0),fPairMgrs(0x0),fEventBuffer(0x0),
         fRsnHandlerAOD(0x0),fAnalysisMgr(0x0) {}
     AliRsnAnalysisTask2ndStep& operator= (const AliRsnAnalysisTask2ndStep&) {return *this;}
-  
+
     TList                       *fOutList;         // list of output histograms
     TObjArray                   *fPairMgrs;        // array if pair managers used
     AliRsnEventBuffer           *fEventBuffer;     // event buffer
similarity index 88%
rename from PWG2/RESONANCES/AliRsnBaseAT.cxx
rename to PWG2/RESONANCES/AliRsnAnalysisTaskBase.cxx
index 10f13e6ff9f80a3bc4673c4216e493b9763a7c7f..b4252ff4a069e3e36de39af3476e421ac1f8b698 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Class AliRsnBaseAT
+// Class AliRsnAnalysisTaskBase
 //
 // TODO
 //
 #include "AliRsnEvent.h"
 #include "AliMCEvent.h"
 
-#include "AliRsnBaseAT.h"
+#include "AliRsnAnalysisTaskBase.h"
 
 
-ClassImp(AliRsnBaseAT)
+ClassImp(AliRsnAnalysisTaskBase)
 
 //________________________________________________________________________
-AliRsnBaseAT::AliRsnBaseAT(const char *name)
+AliRsnAnalysisTaskBase::AliRsnAnalysisTaskBase(const char *name)
     : AliAnalysisTask(name, ""),
     fNumOfEvents(100),
     fUseAutoHandler(100),
@@ -45,7 +45,7 @@ AliRsnBaseAT::AliRsnBaseAT(const char *name)
 }
 
 //________________________________________________________________________
-void AliRsnBaseAT::InitIOVars()
+void AliRsnAnalysisTaskBase::InitIOVars()
 {
 //=========================================================
 // Initial values for constructor
@@ -73,7 +73,7 @@ void AliRsnBaseAT::InitIOVars()
 }
 
 //________________________________________________________________________
-void AliRsnBaseAT::LocalInit()
+void AliRsnAnalysisTaskBase::LocalInit()
 {
 //=========================================================
 // LocalInit()
@@ -81,7 +81,7 @@ void AliRsnBaseAT::LocalInit()
 }
 
 //________________________________________________________________________
-Bool_t AliRsnBaseAT::Notify()
+Bool_t AliRsnAnalysisTaskBase::Notify()
 {
 //=========================================================
 // Notify()
@@ -91,7 +91,7 @@ Bool_t AliRsnBaseAT::Notify()
 }
 
 //________________________________________________________________________
-void AliRsnBaseAT::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.
@@ -167,19 +167,19 @@ void AliRsnBaseAT::SetInputType(EInputType type,AliAnalysisManager* am,Bool_t au
 }
 
 //________________________________________________________________________
-void AliRsnBaseAT::ConnectInputData(Option_t *)
+void AliRsnAnalysisTaskBase::ConnectInputData(Option_t *)
 {
 //=========================================================
 // ConectInputData() for AliAnalysisTask
-// just define myTask->SetInputType ( AliRsnBaseAT::kRSN ); for Rsn input
-// just define myTask->SetInputType ( AliRsnBaseAT::kESDMC ); for ESD and MC input
-// just define myTask->SetInputType ( AliRsnBaseAT::kAOD ); for Rsn input
+// just define myTask->SetInputType ( AliRsnAnalysisTaskBase::kRSN ); for Rsn input
+// just define myTask->SetInputType ( AliRsnAnalysisTaskBase::kESDMC ); for ESD and MC input
+// just define myTask->SetInputType ( AliRsnAnalysisTaskBase::kAOD ); for Rsn input
 //=========================================================
 
   ConnectInputDataByInputType(fInputType[0],0);
 }
 
-void AliRsnBaseAT::ConnectInputDataByInputType(EInputType type ,Short_t inputIndex)
+void AliRsnAnalysisTaskBase::ConnectInputDataByInputType(EInputType type ,Short_t inputIndex)
 {
 //=========================================================
 // Connect input data by input type
@@ -219,7 +219,7 @@ void AliRsnBaseAT::ConnectInputDataByInputType(EInputType type ,Short_t inputInd
   AliDebug(AliLog::kDebug, "->");
 }
 //________________________________________________________________________
-void AliRsnBaseAT::ConnectRSN(Short_t inputIndex)
+void AliRsnAnalysisTaskBase::ConnectRSN(Short_t inputIndex)
 {
 //=========================================================
 // Connect input data by RSN input type
@@ -239,7 +239,7 @@ void AliRsnBaseAT::ConnectRSN(Short_t inputIndex)
   AliDebug(AliLog::kDebug, "->");
 }
 
-void AliRsnBaseAT::ConnectESD(Short_t inputIndex)
+void AliRsnAnalysisTaskBase::ConnectESD(Short_t inputIndex)
 {
 //=========================================================
 // Connect input data by ESD input type
@@ -265,7 +265,7 @@ void AliRsnBaseAT::ConnectESD(Short_t inputIndex)
 
 }
 //________________________________________________________________________
-void AliRsnBaseAT::ConnectESDMC(Short_t inputIndex)
+void AliRsnAnalysisTaskBase::ConnectESDMC(Short_t inputIndex)
 {
 //=========================================================
 // Connect input data by ESDMC input type
@@ -292,7 +292,7 @@ void AliRsnBaseAT::ConnectESDMC(Short_t inputIndex)
 
 }
 //________________________________________________________________________
-void AliRsnBaseAT::ConnectAOD(Short_t inputIndex)
+void AliRsnAnalysisTaskBase::ConnectAOD(Short_t inputIndex)
 {
 //=========================================================
 // Connect input data by AOD input type
@@ -316,7 +316,7 @@ void AliRsnBaseAT::ConnectAOD(Short_t inputIndex)
 }
 
 //________________________________________________________________________
-AliRsnEvent * AliRsnBaseAT::GetRsnEventFromInputType(const Short_t & index)
+AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnEventFromInputType(const Short_t & index)
 {
 //=========================================================
 // Gets Evetn from input type
@@ -360,7 +360,7 @@ AliRsnEvent * AliRsnBaseAT::GetRsnEventFromInputType(const Short_t & index)
 
 
 //________________________________________________________________________
-AliRsnEvent * AliRsnBaseAT::GetRsnFromAOD(const Short_t & index)
+AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromAOD(const Short_t & index)
 {
 //=========================================================
 // Gets RSN event from AOD
@@ -388,7 +388,7 @@ AliRsnEvent * AliRsnBaseAT::GetRsnFromAOD(const Short_t & index)
 
 }
 //________________________________________________________________________
-AliRsnEvent * AliRsnBaseAT::GetRsnFromESD(const Short_t & index)
+AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromESD(const Short_t & index)
 {
 //=========================================================
 // Gets RSN event from ESD
@@ -415,7 +415,7 @@ AliRsnEvent * AliRsnBaseAT::GetRsnFromESD(const Short_t & index)
   return fRSN[index];
 }
 //________________________________________________________________________
-AliRsnEvent * AliRsnBaseAT::GetRsnFromESDMC(const Short_t & index)
+AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromESDMC(const Short_t & index)
 {
 //=========================================================
 // Gets RSN event from ESD and MC
@@ -452,7 +452,7 @@ AliRsnEvent * AliRsnBaseAT::GetRsnFromESDMC(const Short_t & index)
   return fRSN[index];
 }
 //________________________________________________________________________
-AliRsnEvent * AliRsnBaseAT::GetRsnFromRSN(const Short_t & index)
+AliRsnEvent * AliRsnAnalysisTaskBase::GetRsnFromRSN(const Short_t & index)
 {
 //=========================================================
 // Gets RSN event from RSN
@@ -469,7 +469,7 @@ AliRsnEvent * AliRsnBaseAT::GetRsnFromRSN(const Short_t & index)
 }
 
 //________________________________________________________________________
-void AliRsnBaseAT::UseAutoHandler(const Bool_t & theValue)
+void AliRsnAnalysisTaskBase::UseAutoHandler(const Bool_t & theValue)
 {
 //=========================================================
 // Sets should create handlers
similarity index 82%
rename from PWG2/RESONANCES/AliRsnBaseAT.h
rename to PWG2/RESONANCES/AliRsnAnalysisTaskBase.h
index afac444094c9686ca63a87834745af26a21e20e2..35b3d91ad03b9d8b62afcb9221f723c29f0ab0c4 100644 (file)
@@ -1,13 +1,13 @@
 //\r
-// Class AliRsnBaseAT\r
+// Class AliRsnAnalysisTaskBase\r
 //\r
 // TODO\r
 //\r
 // authors: Martin Vala (martin.vala@cern.ch)\r
 //          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)\r
 //\r
-#ifndef ALIRSNBASEAT_H\r
-#define ALIRSNBASEAT_H\r
+#ifndef ALIRSNANALYSISTASKBASE_H\r
+#define ALIRSNANALYSISTASKBASE_H\r
 \r
 #include <TChain.h>\r
 \r
@@ -25,15 +25,15 @@ class AliMCEvent;
 #include "AliAODInputHandler.h"\r
 \r
 \r
-class AliRsnBaseAT : public AliAnalysisTask\r
+class AliRsnAnalysisTaskBase : public AliAnalysisTask\r
 {\r
   public:\r
-    AliRsnBaseAT(const char *name = "AliRsnBaseAT");\r
-    AliRsnBaseAT(const AliRsnBaseAT& copy):AliAnalysisTask(copy),\r
-       fNumOfEvents(0),fUseAutoHandler(kTRUE),\r
-       fRsnInput(1),fReader(),fPID(),fAnalysisMgr(0x0) {}\r
-    AliRsnBaseAT& operator= (const AliRsnBaseAT&) {return *this;}\r
-    virtual ~AliRsnBaseAT() {/* Does nothing*/}\r
+    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
+    AliRsnAnalysisTaskBase& operator= (const AliRsnAnalysisTaskBase&) {return *this;}\r
+    virtual ~AliRsnAnalysisTaskBase() {/* Does nothing*/}\r
 \r
     enum EInputType\r
     {\r
@@ -69,7 +69,7 @@ class AliRsnBaseAT : public AliAnalysisTask
 \r
     AliRsnReader *GetReader() { return &fReader; }\r
     AliRsnPID *GetPID() { return &fPID;}\r
-    \r
+\r
   protected:\r
 \r
     Long64_t      fNumOfEvents;       // number of events\r
@@ -109,7 +109,7 @@ class AliRsnBaseAT : public AliAnalysisTask
     virtual AliRsnEvent*  GetRsnFromRSN(const Short_t &index=0);\r
 \r
 \r
-    ClassDef(AliRsnBaseAT, 1)\r
+    ClassDef(AliRsnAnalysisTaskBase, 1)\r
 };\r
 \r
 #endif\r
index 0cf9c748314ebf243a2a46b04d0cfd05929bb2be..98ac77eec685a95fd07566b2180a9e584d10d2b9 100644 (file)
@@ -27,17 +27,17 @@ ClassImp(AliRsnAnalysisTaskSEBase)
 
 //_____________________________________________________________________________
 AliRsnAnalysisTaskSEBase::AliRsnAnalysisTaskSEBase(const char *name) :
-  AliAnalysisTaskSE(name),
-  fUseAutoHandler(kTRUE),
-  fReader(),
-  fPID(),
-  fAnalysisMgr(0x0) // pointer to current AnalysisMgr
+    AliAnalysisTaskSE(name),
+    fUseAutoHandler(kTRUE),
+    fReader(),
+    fPID(),
+    fAnalysisMgr(0x0) // pointer to current AnalysisMgr
 {
 //
 // Default constructor
 //
-    InitIOVars();
-    DefineInput(0, TChain::Class());
+  InitIOVars();
+  DefineInput(0, TChain::Class());
 }
 
 //_____________________________________________________________________________
@@ -46,23 +46,24 @@ void AliRsnAnalysisTaskSEBase::InitIOVars()
 //
 // Initial values for constructor
 //
-    
-    fUseAutoHandler = kFALSE;
-    
-    Int_t i;
-    for (i = 0; i < 2; i++) {
-        fChain[i] = 0;
-        fRSN[i] = 0;
-        fRsnESD[i] = 0;
-        fRsnMC[i] = 0;
-        fRsnAOD[i] = 0;
-        fRsnESDEH[i] = 0;
-        fRsnMCEH[i] = 0;
-        fRsnAODEH[i] = 0;
-        fInputType[i] = kRSN;
-    }
-    
-    fAnalysisMgr = 0;
+
+  fUseAutoHandler = kFALSE;
+
+  Int_t i;
+  for (i = 0; i < 2; i++)
+  {
+    fChain[i] = 0;
+    fRSN[i] = 0;
+    fRsnESD[i] = 0;
+    fRsnMC[i] = 0;
+    fRsnAOD[i] = 0;
+    fRsnESDEH[i] = 0;
+    fRsnMCEH[i] = 0;
+    fRsnAODEH[i] = 0;
+    fInputType[i] = kRSN;
+  }
+
+  fAnalysisMgr = 0;
 }
 
 //_____________________________________________________________________________
@@ -71,7 +72,7 @@ void AliRsnAnalysisTaskSEBase::LocalInit()
 //
 // LocalInit()
 //
-    AliAnalysisTaskSE::LocalInit();
+  AliAnalysisTaskSE::LocalInit();
 }
 
 //_____________________________________________________________________________
@@ -81,7 +82,7 @@ Bool_t AliRsnAnalysisTaskSEBase::Notify()
 // Notify()
 //
 
-    return AliAnalysisTaskSE::Notify();
+  return AliAnalysisTaskSE::Notify();
 }
 
 //_____________________________________________________________________________
@@ -95,47 +96,45 @@ void AliRsnAnalysisTaskSEBase::SetInputType
 // 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));
-        return;
-    }
-    
-    switch (fInputType[inputIndex]) {
-        case kAOD:
-            fRsnAODEH[0] = new AliAODInputHandler();
-            if (fRsnAODEH[0]) fAnalysisMgr->SetInputEventHandler(fRsnAODEH[0]);
-            break;
-        case kESD:
-            fRsnESDEH[0] = new AliESDInputHandler();
-            if (fRsnESDEH[0]) fAnalysisMgr->SetInputEventHandler(fRsnESDEH[0]);
-            break;
-        case kESDMC:
-            fRsnESDEH[0] = new AliESDInputHandler();
-            fRsnMCEH[0] = new AliMCEventHandler();
-            if ((fRsnESDEH[0]) && (fRsnMCEH[0])) {
-                fAnalysisMgr->SetInputEventHandler(fRsnESDEH[0]);
-                fAnalysisMgr->SetMCtruthEventHandler(fRsnMCEH[0]);
-            }
-            break;
-        case kMC:
-            fRsnMCEH[0] = new AliMCEventHandler();
-            if (fRsnMCEH[0]) {
-                fAnalysisMgr->SetMCtruthEventHandler(fRsnMCEH[0]);
-            }
-            break;
-        case kRSN:
-            AliError("Not Implemented Yet ...");
-            break;
-        default:
-            AliError("Type not supported ...");
-            break;
-    }
+  fInputType[inputIndex] = type;
+  fAnalysisMgr = am;
+
+  UseAutoHandler(autohandler);
+  if (!fUseAutoHandler) return;
+
+  if (!fAnalysisMgr)
+  {
+    AliWarning(Form("fAnalysisMgr is %p and fUseAutoHandler is %d", fAnalysisMgr, fUseAutoHandler));
+    return;
+  }
+
+  switch (fInputType[inputIndex])
+  {
+    case kAOD:
+      fRsnAODEH[0] = new AliAODInputHandler();
+      if (fRsnAODEH[0]) fAnalysisMgr->SetInputEventHandler(fRsnAODEH[0]);
+      break;
+    case kESD:
+      fRsnESDEH[0] = new AliESDInputHandler();
+      if (fRsnESDEH[0]) fAnalysisMgr->SetInputEventHandler(fRsnESDEH[0]);
+      break;
+    case kESDMC:
+    case kMC:
+      fRsnESDEH[0] = new AliESDInputHandler();
+      fRsnMCEH[0] = new AliMCEventHandler();
+      if ((fRsnESDEH[0]) && (fRsnMCEH[0]))
+      {
+        fAnalysisMgr->SetInputEventHandler(fRsnESDEH[0]);
+        fAnalysisMgr->SetMCtruthEventHandler(fRsnMCEH[0]);
+      }
+      break;
+    case kRSN:
+//       AliError("Not Implemented Yet ...");
+      break;
+    default:
+      AliError("Type not supported ...");
+      break;
+  }
 }
 
 //_____________________________________________________________________________
@@ -148,10 +147,10 @@ void AliRsnAnalysisTaskSEBase::ConnectInputData(Option_t *)
 // just define myTask->SetInputType ( AliRsnAnalysisTaskSEBase::kAOD ); for Rsn input
 //
 
-    if (fInputType[0] != kRSN) AliAnalysisTaskSE::ConnectInputData();
-    
-    // connects input handlers according to the type of analysis being done
-    ConnectInputDataByInputType(fInputType[0], 0);
+  if (fInputType[0] != kRSN) AliAnalysisTaskSE::ConnectInputData();
+
+  // connects input handlers according to the type of analysis being done
+  ConnectInputDataByInputType(fInputType[0], 0);
 }
 
 //_____________________________________________________________________________
@@ -161,31 +160,29 @@ void AliRsnAnalysisTaskSEBase::ConnectInputDataByInputType
 //
 // Connect input data dependint on the input type used.
 //
-    AliDebug(AliLog::kDebug, "<-");
-
-    switch (type)
-    {
-        case kAOD:
-            ConnectAOD(inputIndex);
-            break;
-        case kESD:
-            ConnectESD(inputIndex);
-            break;
-        case kESDMC:
-            ConnectESDMC(inputIndex);
-            break;
-        case kMC:
-            ConnectESDMC(inputIndex);
-            break;
-        case kRSN:
-            ConnectRSN(inputIndex);
-            break;
-        default:
-            AliError("Type not supported ...");
-            break;
-    }
-    
-    AliDebug(AliLog::kDebug, "->");
+  AliDebug(AliLog::kDebug, "<-");
+
+  switch (type)
+  {
+    case kAOD:
+      ConnectAOD(inputIndex);
+      break;
+    case kESD:
+      ConnectESD(inputIndex);
+      break;
+    case kESDMC:
+    case kMC:
+      ConnectESDMC(inputIndex);
+      break;
+    case kRSN:
+      ConnectRSN(inputIndex);
+      break;
+    default:
+      AliError("Type not supported ...");
+      break;
+  }
+
+  AliDebug(AliLog::kDebug, "->");
 }
 //_____________________________________________________________________________
 void AliRsnAnalysisTaskSEBase::ConnectRSN(Short_t inputIndex)
@@ -194,20 +191,20 @@ void AliRsnAnalysisTaskSEBase::ConnectRSN(Short_t inputIndex)
 // Connect input data by RSN input type
 //
 
-    AliDebug(AliLog::kDebug, "<-");
-    
-    char ** address = (char **) GetBranchAddress(inputIndex, "rsnEvents");
-    if (address)
-    {
-        fRSN[inputIndex] = (AliRsnEvent*)(*address);
-    }
-    else
-    {
-        fRSN[inputIndex] = 0;
-        SetBranchAddress(inputIndex, "rsnEvents", &fRSN[inputIndex]);
-    }
-    
-    AliDebug(AliLog::kDebug, "->");
+  AliDebug(AliLog::kDebug, "<-");
+
+  char ** address = (char **) GetBranchAddress(inputIndex, "rsnEvents");
+  if (address)
+  {
+    fRSN[inputIndex] = (AliRsnEvent*)(*address);
+  }
+  else
+  {
+    fRSN[inputIndex] = 0;
+    SetBranchAddress(inputIndex, "rsnEvents", &fRSN[inputIndex]);
+  }
+
+  AliDebug(AliLog::kDebug, "->");
 }
 
 //_____________________________________________________________________________
@@ -217,9 +214,9 @@ void AliRsnAnalysisTaskSEBase::ConnectESD(Short_t inputIndex)
 // Connect input data by ESD input type
 //
 
-    AliDebug(AliLog::kDebug, "<-");
-    fRsnESD[inputIndex] = (AliESDEvent*)fInputEvent;
-    AliDebug(AliLog::kDebug, "->");
+  AliDebug(AliLog::kDebug, "<-");
+  fRsnESD[inputIndex] = (AliESDEvent*)fInputEvent;
+  AliDebug(AliLog::kDebug, "->");
 
 }
 
@@ -230,10 +227,10 @@ void AliRsnAnalysisTaskSEBase::ConnectESDMC(Short_t inputIndex)
 // Connect input data by ESDMC input type
 //
 
-    AliDebug(AliLog::kDebug, "<-");
-    fRsnESD[inputIndex] = (AliESDEvent*)fInputEvent;
-    //fRSNMC[inputIndex] = fMCEvent;
-    AliDebug(AliLog::kDebug, "->");
+  AliDebug(AliLog::kDebug, "<-");
+  fRsnESD[inputIndex] = (AliESDEvent*)fInputEvent;
+  //fRSNMC[inputIndex] = fMCEvent;
+  AliDebug(AliLog::kDebug, "->");
 }
 
 //_____________________________________________________________________________
@@ -243,18 +240,18 @@ void AliRsnAnalysisTaskSEBase::ConnectAOD(Short_t inputIndex)
 // Connect input data by AOD input type
 //
 
-    AliDebug(AliLog::kDebug, "<-");
+  AliDebug(AliLog::kDebug, "<-");
+
+  TTree* tree = dynamic_cast<TTree*>(GetInputData(inputIndex));
+  if (!tree) { AliError("Could not read chain from input slot 0");}
+  else
+  {
+    AliAODInputHandler *aodH = dynamic_cast<AliAODInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+    if (!aodH) { AliError("Could not get AODInputHandler"); }
+    else fRsnAOD[inputIndex] = aodH->GetEvent();
+  }
 
-    TTree* tree = dynamic_cast<TTree*>(GetInputData(inputIndex));
-    if (!tree) { AliError("Could not read chain from input slot 0");}
-    else
-    {
-        AliAODInputHandler *aodH = dynamic_cast<AliAODInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
-        if (!aodH) { AliError("Could not get AODInputHandler"); }
-        else fRsnAOD[inputIndex] = aodH->GetEvent();
-    }
-    
-    AliDebug(AliLog::kDebug, "->");
+  AliDebug(AliLog::kDebug, "->");
 }
 
 //_____________________________________________________________________________
@@ -264,19 +261,19 @@ AliRsnEvent * AliRsnAnalysisTaskSEBase::GetRsnEventFromInputType(const Short_t &
 // Gets Event from input type
 //
 
-    switch (fInputType[index])
-    {
-        case kAOD:   return GetRsnFromAOD(index);
-        case kESD:   return GetRsnFromESD(index);
-        case kESDMC: return GetRsnFromESDMC(index);
-        case kMC:    return GetRsnFromMC(index);
-        case kRSN:   return GetRsnFromRSN(index);
-        default:
-            AliError("Type not supported ...");
-            return (AliRsnEvent*) 0x0;
-    }
-    
-    return (AliRsnEvent*) 0x0;
+  switch (fInputType[index])
+  {
+    case kAOD:   return GetRsnFromAOD(index);
+    case kESD:   return GetRsnFromESD(index);
+    case kESDMC: return GetRsnFromESDMC(index);
+    case kMC:    return GetRsnFromMC(index);
+    case kRSN:   return GetRsnFromRSN(index);
+    default:
+      AliError("Type not supported ...");
+      return (AliRsnEvent*) 0x0;
+  }
+
+  return (AliRsnEvent*) 0x0;
 }
 
 //_____________________________________________________________________________
@@ -286,25 +283,25 @@ AliRsnEvent * AliRsnAnalysisTaskSEBase::GetRsnFromAOD(const Short_t & index)
 // Gets RSN event from AOD
 //
 
-    if (!fRsnAOD[index]) 
-    {
-        AliError("fRsnAOD not available."); 
-        return (AliRsnEvent *) 0x0; 
-    }
-    
-    if (!fRSN[0])
-    {
-        fRSN[0] = new AliRsnEvent();
-        fRSN[0]->SetName("rsnEvents");
-        fRSN[0]->Init();
-    }
-    
-    // clear pevious event
-    fRSN[0]->Clear();
-    if (!fReader.FillFromAOD(fRSN[0], fRsnAOD[index])) return (AliRsnEvent*) 0x0;
-    if (!fPID.Process(fRSN[0])) AliWarning("Failed PID");
-    
-    return (AliRsnEvent*) fRSN[0];
+  if (!fRsnAOD[index])
+  {
+    AliError("fRsnAOD not available.");
+    return (AliRsnEvent *) 0x0;
+  }
+
+  if (!fRSN[0])
+  {
+    fRSN[0] = new AliRsnEvent();
+    fRSN[0]->SetName("rsnEvents");
+    fRSN[0]->Init();
+  }
+
+  // clear pevious event
+  fRSN[0]->Clear();
+  if (!fReader.FillFromAOD(fRSN[0], fRsnAOD[index])) return (AliRsnEvent*) 0x0;
+  if (!fPID.Process(fRSN[0])) AliWarning("Failed PID");
+
+  return (AliRsnEvent*) fRSN[0];
 }
 
 //_____________________________________________________________________________
@@ -314,31 +311,31 @@ AliRsnEvent * AliRsnAnalysisTaskSEBase::GetRsnFromESD(const Short_t & index)
 // Gets RSN event from ESD
 //
 
-    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();
-    
-    if (!fReader.FillFromESD(fRSN[index], fRsnESD[index])) return (AliRsnEvent*) 0x0;
-
-    if (!fPID.Process(fRSN[index])) 
-    {
-        AliWarning("Failed PID");
-        return (AliRsnEvent*) 0x0;
-    }
-    
-    return fRSN[index];
+  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();
+
+  if (!fReader.FillFromESD(fRSN[index], fRsnESD[index])) return (AliRsnEvent*) 0x0;
+
+  if (!fPID.Process(fRSN[index]))
+  {
+    AliWarning("Failed PID");
+    return (AliRsnEvent*) 0x0;
+  }
+
+  return fRSN[index];
 }
 
 //_____________________________________________________________________________
@@ -348,20 +345,29 @@ AliRsnEvent * AliRsnAnalysisTaskSEBase::GetRsnFromMC(const Short_t & index)
 // Gets RSN event from ESD
 //
 
-    if (!fRSN[index])
-    {
-        fRSN[index] = new AliRsnEvent();
-        fRSN[index]->SetName("rsnEvents");
-        fRSN[index]->Init();
-    }
-    
-    // clear pevious event
-    fRSN[index]->Clear();
-    fRsnMC[index] = MCEvent();
-    
-    if (!fReader.FillFromMC(fRSN[index], fRsnMC[index])) return (AliRsnEvent*) 0x0;
-    fRSN[index]->FillPIDArrays();
-    return fRSN[index];
+  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();
+  fRsnMC[index] = MCEvent();
+
+  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]);
+  fRSN[index]->FillPIDArrays(3000);
+  return fRSN[index];
 }
 
 //_____________________________________________________________________________
@@ -371,32 +377,32 @@ AliRsnEvent * AliRsnAnalysisTaskSEBase::GetRsnFromESDMC(const Short_t & index)
 // Gets RSN event from ESD and MC
 //
 
-    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();
-    fRsnMC[index] = 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");
-        return (AliRsnEvent*) 0x0;
-    }
-    
-    return fRSN[index];
+  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();
+  fRsnMC[index] = 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");
+    return (AliRsnEvent*) 0x0;
+  }
+
+  return fRSN[index];
 }
 
 //_____________________________________________________________________________
@@ -406,6 +412,6 @@ AliRsnEvent * AliRsnAnalysisTaskSEBase::GetRsnFromRSN(const Short_t & index)
 // Gets RSN event from RSN
 // not fully implemented yet
 //
-    AliRsnEvent *event = fRSN[index];
-    return event;
+  AliRsnEvent *event = fRSN[index];
+  return event;
 }
index 63893567a0bb128d21d057b40780350b4c571b1f..6de11401eefe4ba171b291848352fcfa92f06f21 100644 (file)
@@ -35,12 +35,12 @@ class AliRsnAnalysisTaskSEBase : public AliAnalysisTaskSE
 \r
     enum EInputType\r
     {\r
-        kAOD = 0,\r
-        kESD,\r
-        kESDMC,\r
-        kMC,\r
-        kRSN,\r
-        kLastIndex\r
+      kAOD = 0,\r
+      kESD,\r
+      kESDMC,\r
+      kMC,\r
+      kRSN,\r
+      kLastIndex\r
     };\r
 \r
     virtual void   InitIOVars();\r
index 99e5c702a7a3829b38d58d66d84f36b8317efbc1..4770f1816dfdd2e3cd3f4c55f1da512e96ad5935 100644 (file)
@@ -26,7 +26,7 @@ ClassImp(AliRsnComparisonAT)
 
 //________________________________________________________________________
 AliRsnComparisonAT::AliRsnComparisonAT(const char*name)
-    : AliRsnBaseAT(name),fOutList(0x0),fMyInputNum(1),fMyPIDInputNum(0)
+    : AliRsnAnalysisTaskBase(name),fOutList(0x0),fMyInputNum(1),fMyPIDInputNum(0)
 {
 //=========================================================
 // Default constructor
@@ -44,7 +44,7 @@ void AliRsnComparisonAT::InitIOVars()
 // Sets default values for input and output
 //=========================================================
   AliDebug(AliLog::kDebug, "<-");
-  AliRsnBaseAT::InitIOVars();
+  AliRsnAnalysisTaskBase::InitIOVars();
   fOutList = 0;
   AliDebug(AliLog::kDebug, "->");
 }
index 101c582b11b6e716f8ef8f4a36b374930cfd2dd0..d22b89e35115736cce5d3d157b5bdb7a5d0a2c4d 100644 (file)
 
 #include "AliRsnDaughter.h"
 #include "AliRsnEvent.h"
-#include "AliRsnBaseAT.h"
+#include "AliRsnAnalysisTaskBase.h"
 #include "AliRsnCut.h"
 #include "AliRsnCutSet.h"
 
-class AliRsnComparisonAT : public AliRsnBaseAT
+class AliRsnComparisonAT : public AliRsnAnalysisTaskBase
 {
   public:
 
@@ -50,9 +50,9 @@ class AliRsnComparisonAT : public AliRsnBaseAT
 
 
   private:
-  
+
     AliRsnComparisonAT(const AliRsnComparisonAT&)
-        : AliRsnBaseAT(""),fOutList(0x0),fMyInputNum(1),fMyPIDInputNum(0) {}
+        : AliRsnAnalysisTaskBase(""),fOutList(0x0),fMyInputNum(1),fMyPIDInputNum(0) {}
     AliRsnComparisonAT& operator=(const AliRsnComparisonAT&) {return *this;}
 
     TList       *fOutList;                      // output list
index b10b9fcf1c8447e873af582c7d29bafc301b0d61..dc86882b92ca562618da57cd721aa232566a6905 100644 (file)
@@ -47,7 +47,7 @@ class AliRsnComparisonObj : public TNamed
       kY,
       kLastParameterType
     };
-    
+
     enum EHistoType
     {
       kIndent=0,
@@ -79,7 +79,7 @@ class AliRsnComparisonObj : public TNamed
     void FillPIDHistograms(AliRsnDaughter *daughter);
     void FillPIDHistograms(AliESDtrack *track,AliMCEvent *mc=0);
     void FillPIDHistograms(AliMCParticle *mctrack);
-    
+
     void FillHistograms(AliMCParticle *mctrack);
 
     void SetCurrentESDPID(const EPIDType& type,const Double_t&divValue = 0.0);
@@ -88,10 +88,10 @@ class AliRsnComparisonObj : public TNamed
     void SetESDstatus(const ULong_t status);
     void SetESDTrackQualityCuts(const Int_t& its=-1,const Int_t& tpc=-1,const Int_t& trd=-1);
   private:
-  
-    AliRsnComparisonObj(const AliRsnComparisonObj& copy) 
-    : TNamed(copy),fCurrentComparisonType(kParticleInfo),fCurrentESDPID(kEsd),
-    fESDstatus(0),fITSClusters(0),fTPCClusters(0),fTRDClusters(0),fPIDDivValue(0.) {}
+
+    AliRsnComparisonObj(const AliRsnComparisonObj& copy)
+        : TNamed(copy),fCurrentComparisonType(kParticleInfo),fCurrentESDPID(kEsd),
+        fESDstatus(0),fITSClusters(0),fTPCClusters(0),fTRDClusters(0),fPIDDivValue(0.) {}
     const AliRsnComparisonObj& operator=(const AliRsnComparisonObj&) {return *this;}
 
     EComparisonType   fCurrentComparisonType;
@@ -101,12 +101,12 @@ class AliRsnComparisonObj : public TNamed
     Int_t             fITSClusters;
     Int_t             fTPCClusters;
     Int_t             fTRDClusters;
-    
+
     Double_t          fPIDDivValue;
 
     TH1D              *fHistosPartInfo[kLastParameterType][2][AliRsnPID::kSpeciesAll];
     TH1D              *fHistosPID[kLastFormat][kLastHistoType][AliRsnPID::kSpecies+1];
-    
+
     TString     GetFormatName(EFormat type);
     TString     GetHistoTypeName(EHistoType type);
 
index 277d45946cf48e1c6b587b063ea90bf030da64c4..e7d18216dbbf2496314e3c0ed89bed7be28b2f25 100644 (file)
@@ -317,11 +317,11 @@ Bool_t AliRsnCut::IsSelected(ETarget type, AliRsnDaughter *daughter)
     case kEtaMC:
       if (mcinfo) return IsBetween(mcinfo->Eta());
       else return kTRUE;
+    case kNSigma:
+      return IsBetween(daughter->NSigmaToVertex());
       /*
-      case kEsdNSigma:
-          return IsBetween (daughter->GetNSigma());
       case kEsdNSigmaCalculate:
-          return IsBetween (daughter->GetESDInfo()->GetNSigmaCalculate());
+      return IsBetween (daughter->GetESDInfo()->GetNSigmaCalculate());
       */
     default:
       AliWarning("Requested a cut which cannot be applied to a single track");
@@ -393,6 +393,33 @@ Bool_t AliRsnCut::IsSelected(ETarget type, AliRsnEvent * event)
   return kTRUE;
 }
 
+//________________________________________________________________________________________________________________
+Bool_t AliRsnCut::IsSelected(ETarget type, AliRsnEvent * ev1, AliRsnEvent * ev2)
+{
+  AliDebug(AliLog::kDebug, "<-");
+
+  Double_t valueD;
+  Int_t    valueI;
+
+  switch (fType)
+  {
+    case kMultiplicityDifference:
+      valueI = TMath::Abs(ev1->GetMultiplicity() - ev2->GetMultiplicity());
+      return IsBetween((Int_t)valueI);
+    case kVzDifference:
+      valueD = TMath::Abs(ev1->GetVz() - ev2->GetVz());
+      return IsBetween((Double_t)valueD);
+    case kPhiMeanDifference:
+      valueD = TMath::Abs(ev1->GetPhiMean() - ev2->GetPhiMean());
+      return IsBetween((Double_t)valueD);
+    default:
+      AliWarning("Requested a cut which cannot be applied to an event");
+      return kTRUE;
+  }
+
+  return kTRUE;
+}
+
 //________________________________________________________________________________________________________________
 void AliRsnCut::PrintAllValues()
 {
index a753dbee644508a7064efc882a7b3ede81db27bc..46a6e1be080b5902cd6d2c381e5a2a81d281b642 100644 (file)
@@ -49,6 +49,9 @@ class AliRsnCut : public TNamed
     kPIDType,
     kPIDProb,
     kMultiplicity,
+    kMultiplicityDifference,
+    kPhiMeanDifference,
+    kVzDifference,
     kLastCutType
   };
   
@@ -64,7 +67,7 @@ class AliRsnCut : public TNamed
     kParticle = 0,
     kPair,
     kEvent,
-    kMixEventFinderCut,
+    kMixEvent,
     kLastCutTarget
   };
 
@@ -85,6 +88,7 @@ class AliRsnCut : public TNamed
   Bool_t    IsSelected(ETarget tgt,  AliRsnDaughter *daughter);
   Bool_t    IsSelected(ETarget tgt,  AliRsnPairParticle *pair);
   Bool_t    IsSelected(ETarget tgt,  AliRsnEvent *event);
+  Bool_t    IsSelected(ETarget tgt,  AliRsnEvent *ev1, AliRsnEvent *ev2);
 
   void      PrintAllValues();
 
index 7c15ebbb08676d8e5e0291bb08aa257aa2728090..f96c2be9a10ab7030b076188f363f54b6fd67798 100644 (file)
@@ -39,7 +39,7 @@ class AliRsnCutMgr : public TNamed
 
     AliRsnCutSet *fCutSets[AliRsnCut::kLastCutTarget];  // cut definitions for all targets
 
-    ClassDef(AliRsnCutMgr, 1);  // dictionary
+    ClassDef(AliRsnCutMgr, 1)  // dictionary
 };
 
 #endif
index 836a231acc80d1cfeece7f803c539c20ff38e751..4bf61b2aeae81654329a791a7551d8189b816c61 100644 (file)
@@ -1,3 +1,12 @@
+//
+// Class AliRsnCutSet
+//
+// This is the front-end for cut management and checking.
+// It must be prepared by adding all required single cuts,
+// and then with a logical expression which combines all cuts
+// with the "AND", "OR" and "NOT" operators.
+//
+
 #include "AliLog.h"
 
 #include "AliRsnCut.h"
@@ -183,6 +192,28 @@ Bool_t AliRsnCutSet::IsSelected(AliRsnCut::ETarget type, AliRsnEvent * event)
   return boolReturn;
 }
 
+//_____________________________________________________________________________
+Bool_t AliRsnCutSet::IsSelected(AliRsnCut::ETarget type, AliRsnEvent * ev1, AliRsnEvent *ev2)
+{
+//
+// Checks an object according to the cut expression defined here.
+//
+
+  Int_t i;
+  if (!fNumOfCuts) return kTRUE;
+
+  Bool_t boolReturn = kTRUE;
+  AliRsnCut *cut;
+  for (i = 0; i < fNumOfCuts; i++)
+  {
+    cut = (AliRsnCut*) fCuts.At(i);
+    fBoolValues[i] = cut->IsSelected(type,ev1,ev2);
+  }
+
+  if (fIsScheme) boolReturn = Passed();
+  return boolReturn;
+}
+
 //_____________________________________________________________________________
 void AliRsnCutSet::SetCutScheme(const TString & theValue)
 {
index 315ecc5e68e9055df9d2c08d1b343a5fd4da1856..d1528e833b40dbdf698a39c3c9f3fd42ed159d53 100644 (file)
@@ -1,11 +1,12 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               *
- **************************************************************************/
-
 //
-// class AliRsnCutSet
-// Combination of simple cuts
+// Class AliRsnCutSet
+//
+// This is the front-end for cut management and checking.
+// It must be prepared by adding all required single cuts,
+// and then with a logical expression which combines all cuts
+// with the "AND", "OR" and "NOT" operators.
+//
+// author: M. Vala (martin.vala@cern.ch)
 //
 
 #ifndef ALIRSNCUTSET_H
@@ -43,6 +44,7 @@ class AliRsnCutSet : public TNamed
     Bool_t    IsSelected(AliRsnCut::ETarget type, AliRsnDaughter *daughter);
     Bool_t    IsSelected(AliRsnCut::ETarget type, AliRsnPairParticle *pair);
     Bool_t    IsSelected(AliRsnCut::ETarget type, AliRsnEvent *event);
+    Bool_t    IsSelected(AliRsnCut::ETarget type, AliRsnEvent *ev1, AliRsnEvent *ev2);
 
     void SetBoolValue(Bool_t theValue,Int_t index) { fBoolValues[index] = theValue; }
     Bool_t GetBoolValue(Int_t index) const { return fBoolValues[index]; }
@@ -69,7 +71,7 @@ class AliRsnCutSet : public TNamed
 
     AliRsnExpression  *fExpression;       // pointer to AliRsnExpression
 
-    ClassDef(AliRsnCutSet,1);    // ROOT dictionary
+    ClassDef(AliRsnCutSet,1)    // ROOT dictionary
 };
 
 #endif
index bbe48e5835ea0fe3600c4db04d589fa59e583e10..11fde071b473556366c224a79b6c52a58eddf926 100644 (file)
@@ -1,14 +1,12 @@
 //
 // Class AliRsnDaughter
 //
+// Light-weight AOD object which contains all required track details
+// which are used for resonance analysis.
+// Provides converters from all kinds of input track type: ESD, AOD and MC.
 //
-// Light-weight 'track' object into an internal format used
-// for further steps of resonance analysis.
-// Provides converters from all kinds of input track type
-// (ESD, AOD and MC).
-// Contains also a facility to compute invariant mass of a pair.
-//
-// author: A. Pulvirenti --- email: alberto.pulvirenti@ct.infn.it
+// authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//          M. Vala (martin.vala@cern.ch)
 //
 
 #include <Riostream.h>
@@ -35,7 +33,12 @@ AliRsnDaughter::AliRsnDaughter() :
     fLabel(-1),
     fCharge(0),
     fFlags(0),
+    fKink(0),
     fMass(0.0),
+    fChi2(0.0),
+    fNSigmaToVertex(-1.0),
+    fITSnum(0),
+    fTPCnum(0),
     fRealisticPID(AliRsnPID::kUnknown),
     fMCInfo(0x0)
 {
@@ -64,7 +67,12 @@ AliRsnDaughter::AliRsnDaughter(const AliRsnDaughter &copy) :
     fLabel(copy.fLabel),
     fCharge(copy.fCharge),
     fFlags(copy.fFlags),
+    fKink(copy.fKink),
     fMass(copy.fMass),
+    fChi2(copy.fChi2),
+    fNSigmaToVertex(copy.fNSigmaToVertex),
+    fITSnum(copy.fITSnum),
+    fTPCnum(copy.fTPCnum),
     fRealisticPID(copy.fRealisticPID),
     fMCInfo(0x0)
 {
@@ -96,7 +104,12 @@ AliRsnDaughter::AliRsnDaughter(AliESDtrack *track, Bool_t useTPC) :
     fLabel(-1),
     fCharge(0),
     fFlags(0),
+    fKink(0),
     fMass(0.0),
+    fChi2(0.0),
+    fNSigmaToVertex(-1.0),
+    fITSnum(0),
+    fTPCnum(0),
     fRealisticPID(AliRsnPID::kUnknown),
     fMCInfo(0x0)
 {
@@ -116,7 +129,12 @@ AliRsnDaughter::AliRsnDaughter(AliAODTrack *track) :
     fLabel(-1),
     fCharge(0),
     fFlags(0),
+    fKink(0),
     fMass(0.0),
+    fChi2(0.0),
+    fNSigmaToVertex(-1.0),
+    fITSnum(0),
+    fTPCnum(0),
     fRealisticPID(AliRsnPID::kUnknown),
     fMCInfo(0x0)
 {
@@ -136,7 +154,12 @@ AliRsnDaughter::AliRsnDaughter(AliMCParticle *track) :
     fLabel(-1),
     fCharge(0),
     fFlags(0),
+    fKink(0),
     fMass(0.0),
+    fChi2(0.0),
+    fNSigmaToVertex(-1.0),
+    fITSnum(0),
+    fTPCnum(0),
     fRealisticPID(AliRsnPID::kUnknown),
     fMCInfo(0x0)
 {
@@ -162,6 +185,11 @@ AliRsnDaughter& AliRsnDaughter::operator=(const AliRsnDaughter &copy)
   fLabel  = copy.fLabel;
   fCharge = copy.fCharge;
   fFlags  = copy.fFlags;
+  fKink   = copy.fKink;
+  fChi2   = copy.fChi2;
+  fNSigmaToVertex = copy.fNSigmaToVertex;
+  fITSnum = copy.fITSnum;
+  fTPCnum = copy.fTPCnum;
 
   Int_t i;
   for (i = 0; i < AliRsnPID::kSpecies; i++)
@@ -205,6 +233,20 @@ AliRsnDaughter::~AliRsnDaughter()
   }
 }
 
+//_____________________________________________________________________________
+void AliRsnDaughter::RotateP(Double_t angle)
+{
+//
+// Rotate the momentum along Z axis by an angle
+//
+
+  Double_t s = TMath::Sin(angle);
+  Double_t c = TMath::Cos(angle);
+  Double_t xx = fP[0];
+  fP[0] = c*xx - s*fP[1];
+  fP[1] = s*xx + c*fP[1];
+}
+
 //_____________________________________________________________________________
 void AliRsnDaughter::SetPIDWeight(Int_t i, Double_t value)
 {
@@ -307,22 +349,37 @@ Bool_t AliRsnDaughter::Adopt(AliESDtrack* esdTrack,EPIDType pidType ,Double_t di
     return kFALSE;
   }
 
-  // copy momentum and vertex
+  // copy momentum, vertex, chi2 and number of clusters
   if (!useTPCInnerParam)
   {
     esdTrack->GetPxPyPz(fP);
     esdTrack->GetXYZ(fV);
+    fChi2 = esdTrack->GetConstrainedChi2();
+    fITSnum = esdTrack->GetITSclusters(0x0);
+    fTPCnum = esdTrack->GetTPCclusters(0x0);
   }
   else
   {
     if (!esdTrack->GetTPCInnerParam()) return kFALSE;
     esdTrack->GetTPCInnerParam()->GetPxPyPz(fP);
     esdTrack->GetTPCInnerParam()->GetXYZ(fV);
+    fChi2 = esdTrack->GetTPCchi2();
+    fITSnum = 0;
+    fTPCnum = esdTrack->GetTPCclusters(0x0);
   }
 
+  // define the kink index:
+  //  0 = no kink
+  //  1 = kink daughter
+  // -1 = kink mother
+  Int_t i, ik[3];
+  for (i = 0; i < 3; i++) ik[i] = esdTrack->GetKinkIndex(i);
+  if (ik[0] < 0 || ik[1] < 0 || ik[2] < 0) fKink = -1;
+  else if (ik[0] > 0 || ik[1] > 0 || ik[2] > 0) fKink = 1;
+  else fKink = 0;
+
   Double_t p = esdTrack->P();
   // copy PID weights
-  Int_t    i;
   Double_t pid[5];
   if (!useTPCInnerParam)
   {
@@ -341,6 +398,10 @@ Bool_t AliRsnDaughter::Adopt(AliESDtrack* esdTrack,EPIDType pidType ,Double_t di
   // copy charge sign
   fCharge = (Short_t)esdTrack->Charge();
 
+  // calculate N sigma to vertex
+  SetNSigmaToVertex(fESDTrackCuts.GetSigmaToVertex(esdTrack));
+
+
   return kTRUE;
 }
 
@@ -371,6 +432,9 @@ Bool_t AliRsnDaughter::Adopt(AliAODTrack* aodTrack)
   fV[1] = aodTrack->Yv();
   fV[2] = aodTrack->Zv();
 
+  // chi2
+  fChi2 = aodTrack->Chi2perNDF();
+
   // copy PID weights
   Int_t i;
   for (i = 0; i < 5; i++) fPIDWeight[i] = aodTrack->PID()[i];
@@ -424,16 +488,18 @@ Bool_t AliRsnDaughter::Adopt(AliMCParticle *mcParticle)
   // recognize charge sign from PDG code sign
   Int_t pdg = particle->GetPdgCode();
   Int_t absPDG = TMath::Abs(pdg);
-  if (absPDG <= 15)
+  if (absPDG == 11 || absPDG == 13)
   {
     if (pdg > 0) fCharge = -1; else fCharge = 1;
   }
-  else if (absPDG < 3000)
+  else if (absPDG == 211 || absPDG == 321 || absPDG == 2212)
   {
     if (pdg > 0) fCharge = 1; else fCharge = -1;
   }
   else
   {
+    // when trying to "adopt" a neutral track (photon, neutron, etc.)
+    // for the moment a "failed" message is returned
     fCharge = 0;
     return kFALSE;
   }
@@ -593,13 +659,20 @@ Int_t AliRsnDaughter::Compare(const TObject* obj) const
 }
 
 //_____________________________________________________________________________
-void AliRsnDaughter::GetESDPID(AliESDtrack * track, Double_t * pid,EPIDType pidType, Double_t divValue, Double_t val)
+void AliRsnDaughter::GetESDPID
+(AliESDtrack * track, Double_t * pid, EPIDType pidType, Double_t divValue, Double_t val)
 {
 //
-// return PID from EPIDType type
+// A simple method to define PID weights by combining the ones
+// from single detectors by multiplication.
+// In the case when 'kITS_TPC_TOF_SP' option is chosen, a separation value
+// defines if the TOF signal must be included or not.
+// This value is usually the transverse momentum, but here it is left undefined.
 //
 
+  Int_t i;
   Double_t ctmp[AliRsnPID::kSpecies];
+
   switch (pidType)
   {
     case kEsd :
@@ -617,31 +690,31 @@ void AliRsnDaughter::GetESDPID(AliESDtrack * track, Double_t * pid,EPIDType pidT
     case kITS_TPC :
       track->GetITSpid(pid);
       track->GetTPCpid(ctmp);
-      for (Int_t i=0;i<5;i++) pid[i]*=ctmp[i];
+      for (i = 0; i < 5; i++) pid[i] *= ctmp[i];
       break;
     case kITS_TOF :
       track->GetITSpid(pid);
       track->GetTOFpid(ctmp);
-      for (Int_t i=0;i<AliRsnPID::kSpecies;i++) pid[i]*=ctmp[i];
+      for (i = 0; i < AliRsnPID::kSpecies; i++) pid[i] *= ctmp[i];
       break;
     case kTPC_TOF :
       track->GetTPCpid(pid);
       track->GetTOFpid(ctmp);
-      for (Int_t i=0;i<AliRsnPID::kSpecies;i++) pid[i]*=ctmp[i];
+      for (i = 0; i < AliRsnPID::kSpecies; i++) pid[i] *= ctmp[i];
       break;
     case kITS_TPC_TOF :
       track->GetITSpid(pid);
       track->GetTPCpid(ctmp);
-      for (Int_t i=0;i<AliRsnPID::kSpecies;i++) pid[i]*=ctmp[i];
+      for (i = 0; i < AliRsnPID::kSpecies; i++) pid[i] *= ctmp[i];
       track->GetTOFpid(ctmp);
-      for (Int_t i=0;i<AliRsnPID::kSpecies;i++) pid[i]*=ctmp[i];
+      for (i = 0; i < AliRsnPID::kSpecies; i++) pid[i] *= ctmp[i];
       break;
     case kITS_TPC_TOF_SP :
-      if (val<divValue)
+      if (val < divValue)
       {
         track->GetITSpid(pid);
         track->GetTPCpid(ctmp);
-        for (Int_t i=0;i<AliRsnPID::kSpecies;i++) pid[i]*=ctmp[i];
+        for (i = 0; i < AliRsnPID::kSpecies; i++) pid[i] *= ctmp[i];
       }
       else
       {
@@ -649,9 +722,10 @@ void AliRsnDaughter::GetESDPID(AliESDtrack * track, Double_t * pid,EPIDType pidT
       }
       break;
     default:
-//       AliWarning("Unrecognized value of EPIDType argument");
-      for (Int_t i=0;i<AliRsnPID::kSpecies;i++) pid[i]=1.0;
+      AliLog::Message(AliLog::kError,
+                      "Unrecognized value of EPIDType argument",
+                      "", "AliRsnDaughter", "GetESDPID", __FILE__, __LINE__);
+      for (i = 0; i < AliRsnPID::kSpecies; i++) pid[i] = 1.0;
       break;
   }
 }
-
index 25ac4dfb82aae3a9220896cda401c1bf9b59bc02..2e4767994751895bcec9446ac9c82e2a2ecf51f4 100644 (file)
@@ -5,7 +5,8 @@
 // which are used for resonance analysis.
 // Provides converters from all kinds of input track type: ESD, AOD and MC.
 //
-// author: A. Pulvirenti --- email: alberto.pulvirenti@ct.infn.it
+// authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//          M. Vala (martin.vala@cern.ch)
 //
 
 #ifndef ALIRSNDAUGHTER_H
@@ -15,6 +16,7 @@
 
 #include "AliVParticle.h"
 #include "AliRsnPID.h"
+#include "AliESDtrackCuts.h"
 
 class TParticle;
 
@@ -51,7 +53,6 @@ class AliRsnDaughter : public AliVParticle
       kLastPIDType
     };
 
-
     AliRsnDaughter();
     AliRsnDaughter(const AliRsnDaughter &copy);
     AliRsnDaughter(AliESDtrack *track, Bool_t useTPCInnerParam = kFALSE);
@@ -72,11 +73,14 @@ class AliRsnDaughter : public AliVParticle
     virtual Double_t Pt() const {return TMath::Sqrt(Px()*Px() + Py()*Py());}
     virtual Double_t OneOverPt() const {return 1.0 / Pt();}
     virtual Bool_t   PxPyPz(Double_t p[3]) const {p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE;}
+    virtual Double_t Chi2() const {return fChi2;}
     void             SetPx(Double_t value) {fP[0] = value;}
     void             SetPy(Double_t value) {fP[1] = value;}
     void             SetPz(Double_t value) {fP[2] = value;}
     void             SetP(Double_t px, Double_t py, Double_t pz) {SetPx(px); SetPy(py); SetPz(pz);}
     void             SetM(Double_t m) {fMass = m;}
+    void             SetChi2(Double_t chi2) {fChi2 = chi2;}
+    void             RotateP(Double_t angle);
 
     // DCA vertex
     virtual Double_t Xv() const {return fV[0];}
@@ -98,7 +102,11 @@ class AliRsnDaughter : public AliVParticle
 
     // Charge
     virtual Short_t Charge() const {return fCharge;}
+    virtual Char_t  Kink() const {return fKink;}
+    virtual Bool_t  IsKinkMother() const {return (fKink < 0);}
+    virtual Bool_t  IsKinkDaughter() const {return (fKink > 0);}
     void            SetCharge(Short_t value) {fCharge = value;}
+    void            SetKink(Char_t kink) {fKink = kink;}
 
     // PID
     virtual const Double_t* PID() const {return fPIDWeight;}
@@ -110,10 +118,11 @@ class AliRsnDaughter : public AliVParticle
     AliRsnPID::EType        PIDType(Double_t &prob) const;
 
     // check that contains a given ESD flag
+    UInt_t  GetFlags() {return fFlags;}
     Bool_t  CheckFlag(ULong_t flag) {return ((fFlags & flag) == flag);}
 
     // information getters from objects
-    Bool_t  Adopt(AliESDtrack *track, EPIDType pidType = kEsd,Double_t divValue = 0.0,Bool_t useTPCInnerParam = kFALSE);
+    Bool_t  Adopt(AliESDtrack *track, EPIDType pidType = kEsd, Double_t divValue = 0.0, Bool_t useTPCInnerParam = kFALSE);
     Bool_t  Adopt(AliAODTrack *track);
     Bool_t  Adopt(AliMCParticle *track);
 
@@ -123,6 +132,17 @@ class AliRsnDaughter : public AliVParticle
     Int_t   GetLabel() const {return -1;}
     void    SetIndex(Int_t value) {fIndex = value;}
     void    SetLabel(Int_t value) {fLabel = value;}
+    
+    // N sigma to vertex
+    Float_t NSigmaToVertex() const { return fNSigmaToVertex; }
+    void    SetNSigmaToVertex(const Float_t& theValue) { fNSigmaToVertex = theValue; }
+
+
+    // ITS/TPC clusters
+    Int_t   NumberOfITSClusters() const {return fITSnum;}
+    Int_t   NumberOfTPCClusters() const {return fTPCnum;}
+    void    SetNumberOfITSClusters(Int_t n) {fITSnum = n;}
+    void    SetNumberOfTPCClusters(Int_t n) {fTPCnum = n;}
 
     // Utilities
     void    Print(Option_t *option = "ALL") const;
@@ -137,29 +157,40 @@ class AliRsnDaughter : public AliVParticle
     virtual Bool_t IsSortable() const {return kTRUE;}
     virtual Int_t  Compare(const TObject* obj) const;
 
+
   private:
 
+    static void GetESDPID
+    (AliESDtrack *track, Double_t *pid, EPIDType pidType = kEsd,
+     Double_t divValue = -1.0, Double_t val = -1.0);
+
     Int_t              fIndex;    // index of source object (ESD/AOD/MC) in its collection
     Int_t              fLabel;    // label assigned to the track (act. by GEANT3)
 
     Short_t            fCharge;   // charge sign
     ULong_t            fFlags;    // status flags
+    Char_t             fKink;     // kink index
 
     Double_t           fP[3];     // vector momentum (x, y, z)
     Double_t           fV[3];     // DCA vertex (x, y, z)
     Double_t           fMass;     // mass (assigned externally)
+    Double_t           fChi2;     // chi square of track
+    Float_t            fNSigmaToVertex; // N sigma to vertex
+
+    Int_t              fITSnum;   // number of ITS clusters
+    Int_t              fTPCnum;   // number of TPC clusters
 
     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
 
     AliRsnMCInfo      *fMCInfo;     // reference to particle object (if any)
+    
+    AliESDtrackCuts    fESDTrackCuts; //! tmp object of AliESDtrackCuts for fNSigmaToVertex
 
     static EPIDMethod  fgPIDMethod; // flag to define how the PID is computed for this object
 
-    static void        GetESDPID(AliESDtrack *track,Double_t *pid,EPIDType pidType = kEsd,Double_t divValue=-1.0,Double_t val=-1.0);
-
-    ClassDef(AliRsnDaughter, 4);
+    ClassDef(AliRsnDaughter, 4)
 };
 
 #endif
index ec1c8a91c9bf6f067f2f50f5e4d01f1e79d298f0..ee024eaf0f67dead3410ae9331f973c26e452232 100644 (file)
@@ -312,7 +312,7 @@ TArrayI * AliRsnEvent::GetTracksArray
 }
 
 //_____________________________________________________________________________
-void AliRsnEvent::FillPIDArrays()
+void AliRsnEvent::FillPIDArrays(Int_t arraySizeInit)
 {
 //
 // Initializes and fills the AliRsnPIDIndex objects containing
@@ -323,9 +323,9 @@ void AliRsnEvent::FillPIDArrays()
   if (fNoPID) delete fNoPID;
   if (fPerfectPID) delete fPerfectPID;
   if (fRealisticPID) delete fRealisticPID;
-  fNoPID = new AliRsnPIDIndex(2000);
-  fPerfectPID = new AliRsnPIDIndex(2000);
-  fRealisticPID = new AliRsnPIDIndex(2000);
+  fNoPID = new AliRsnPIDIndex(arraySizeInit);
+  fPerfectPID = new AliRsnPIDIndex(arraySizeInit);
+  fRealisticPID = new AliRsnPIDIndex(arraySizeInit);
 
   // set the default type to Realistic
   AliRsnDaughter::SetPIDMethod(AliRsnDaughter::kRealistic);
@@ -389,6 +389,32 @@ void AliRsnEvent::Print(Option_t *option) const
   }
 }
 
+//_____________________________________________________________________________
+void AliRsnEvent::MakeComputations()
+{
+//
+// Computes all required overall variables:
+// - multiplicity
+// - mean phi of tracks
+//
+
+  if (!fTracks) {
+    fMult = 0; 
+    fPhiMean = 0.0;
+  }
+  else {
+    fMult = fTracks->GetEntries();
+    fPhiMean = 0.0;
+    
+    AliRsnDaughter *d = 0;
+    TObjArrayIter next(fTracks);
+    while ( (d = (AliRsnDaughter*)next()) ) {
+      fPhiMean += d->Phi();
+    }
+    fPhiMean /= (Double_t)fMult;
+  }
+}
+
 //_____________________________________________________________________________
 void AliRsnEvent::CorrectByPrimaryVertex()
 {
@@ -404,6 +430,7 @@ void AliRsnEvent::CorrectByPrimaryVertex()
     }
 }
 
+/*
 //_____________________________________________________________________________
 Int_t AliRsnEvent::GetMultiplicity() const
 {
@@ -414,6 +441,7 @@ Int_t AliRsnEvent::GetMultiplicity() const
   if (!fTracks) return 0;
   return fTracks->GetEntries();
 }
+*/
 
 //_____________________________________________________________________________
 Int_t AliRsnEvent::GetNCharged(Char_t sign)
index 651681e41c675baf22a4ed9c65ab29b08ae25bae..3ee2278a32640faecfd7114ac28fa6a5308e400c 100644 (file)
@@ -48,15 +48,17 @@ class AliRsnEvent : public TNamed
     TClonesArray*   GetTracks() {return fTracks;}
     TArrayI*        GetCharged(Char_t sign);
     TArrayI*        GetTracksArray(AliRsnDaughter::EPIDMethod method, Char_t sign, AliRsnPID::EType type);
-    void            FillPIDArrays();
+    void            FillPIDArrays(Int_t arraySizeDefault = 1000);
     void            SortTracks() {fTracks->Sort();}
     void            Print(Option_t *option = "") const;
+    void            MakeComputations();
 
     // Primary vertex
     Double_t GetPrimaryVertexX() const {return fPVx;}
     Double_t GetPrimaryVertexY() const {return fPVy;}
     Double_t GetPrimaryVertexZ() const {return fPVz;}
     void     GetPrimaryVertex(Double_t &x, Double_t &y, Double_t &z) const {x=fPVx;y=fPVy;z=fPVz;}
+    Double_t GetVz() const {return GetPrimaryVertexZ();}
     void     SetPrimaryVertexX(Double_t value) {fPVx = value;}
     void     SetPrimaryVertexY(Double_t value) {fPVy = value;}
     void     SetPrimaryVertexZ(Double_t value) {fPVz = value;}
@@ -64,8 +66,11 @@ class AliRsnEvent : public TNamed
     void     CorrectByPrimaryVertex();
 
     // Multiplicity
-    Int_t GetMultiplicity() const;
+    Int_t GetMultiplicity() const {return fMult;}
     Int_t GetNCharged(Char_t sign);
+    
+    // Mean phi
+    Double_t GetPhiMean() const {return fPhiMean;}
 
   private:
 
@@ -75,6 +80,8 @@ class AliRsnEvent : public TNamed
     Double_t        fPVx;                 // position of
     Double_t        fPVy;                 // primary
     Double_t        fPVz;                 // vertex
+    Double_t        fPhiMean;             // mean "phi" coord of all tracks
+    Int_t           fMult;                // track multiplicity
 
     TClonesArray   *fTracks;              // collection of particles
 
index 9d18c0277c40454e6aaa44b5cedacc6d361484f4..9ff3ad93e122a349076cc9abf6b599845f3ca859 100644 (file)
@@ -24,6 +24,9 @@
 //
 
 #include "AliLog.h"
+
+#include "AliRsnCut.h"
+#include "AliRsnCutSet.h"
 #include "AliRsnEventBuffer.h"
 
 ClassImp(AliRsnEventBuffer)
@@ -91,10 +94,32 @@ void AliRsnEventBuffer::AddEvent(AliRsnEvent * event)
 
   if (fEventsBufferIndex >= fEventsBufferSize - 1) ResetIndex();
   fEventsBufferIndex++;
-  if (fEventsBuffer[fEventsBufferIndex])
+  if (fEventsBuffer[fEventsBufferIndex]) {
+    //AliInfo("Replacing event");
     *fEventsBuffer[fEventsBufferIndex] = *event;
-  else
+  }
+  else {
+    //AliInfo("New event");
     fEventsBuffer[fEventsBufferIndex] = new AliRsnEvent(*event);
+  }
+    
+  // correct for primary vertex
+  fEventsBuffer[fEventsBufferIndex]->CorrectByPrimaryVertex();
+}
+
+//_____________________________________________________________________________
+Int_t AliRsnEventBuffer::IndexOf(AliRsnEvent * event)
+{
+//
+// Return position of the event
+//
+
+  Int_t i;
+  for (i = 0; i < fEventsBufferSize; i++) {
+    if (event == fEventsBuffer[i]) return i;
+  }
+  
+  return -1;
 }
 
 //_____________________________________________________________________________
@@ -116,6 +141,36 @@ AliRsnEvent * AliRsnEventBuffer::GetNextEvent()
   else return GetEvent(fEventsBufferIndex + 1);
 }
 
+//_____________________________________________________________________________
+AliRsnEvent * AliRsnEventBuffer::GetNextGoodEvent
+(Int_t &start, AliRsnCutSet *cuts)
+{
+//
+// Scans the buffer starting from 'start' in order to
+// find another event which satisfies the cuts defined in 'cuts'.
+// If it finds such an event, returns it and upgrades the 'start' value
+// to its position, otherwise returns NULL.
+//
+
+  Int_t i = start;
+  AliRsnEvent *ref = GetCurrentEvent();
+  AliRsnEvent *ev = 0x0;
+  for(;;i++) {
+    ev = GetEvent(i);
+    if (!ev) break;
+    if (!cuts) {
+      start = i;
+      return ev;
+    }
+    else if (cuts->IsSelected(AliRsnCut::kMixEvent, ref, ev)) {
+      start = i;
+      return ev;
+    }
+  }
+  
+  return 0x0;
+}
+
 //_____________________________________________________________________________
 AliRsnEvent * AliRsnEventBuffer::GetEvent(Int_t index)
 {
index e7493bba5c80cdf3ea29811148a2c7d5d49ed058..52c15f621c90ae1e95f4341f7ddfe8e49c784480 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "AliRsnEvent.h"
 
+class AliRsnCutSet;
+
 class AliRsnEventBuffer : public TObject
 {
   public:
@@ -29,9 +31,11 @@ class AliRsnEventBuffer : public TObject
     void ResetIndex();
 
     void AddEvent(AliRsnEvent *event);
+    Int_t IndexOf(AliRsnEvent *event);
     AliRsnEvent *GetEvent(Int_t index) ;
     AliRsnEvent *GetCurrentEvent();
     AliRsnEvent *GetNextEvent();
+    AliRsnEvent *GetNextGoodEvent(Int_t &start, AliRsnCutSet *cuts = 0);
 
     void SetEventsBufferSize(const Int_t& theValue) { fEventsBufferSize = theValue; }
     Int_t GetEventsBufferSize() const { return fEventsBufferSize; }
index 36926b8e618044c08e3aefa0e06ba6f19078cfe2..ac10aeddfc5158e637f5e7b46843669a151cca1c 100644 (file)
@@ -11,8 +11,8 @@
 // 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 
+// 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.
 //
 //
@@ -22,7 +22,6 @@
 #include <Riostream.h>
 
 #include <TH1.h>
-#include <TH2.h>
 #include <TList.h>
 #include <TString.h>
 
@@ -40,13 +39,14 @@ ClassImp(AliRsnFunction)
 
 //________________________________________________________________________________________
 AliRsnFunction::AliRsnFunction() :
-  fFcnType(kFcnTypes),
-  fUseBins(kFALSE),
-  fSkipOutsideInterval(kFALSE),
-  fBins(0),
-  fBinningCut(),
-  fBinningCutType(AliRsnCut::kLastCutType),
-  fHistoDef(0x0)
+    fFcnType(kFcnTypes),
+    fRotAngle(0.0),
+    fUseBins(kFALSE),
+    fSkipOutsideInterval(kFALSE),
+    fBins(0),
+    fBinningCut(),
+    fBinningCutType(AliRsnCut::kLastCutType),
+    fHistoDef(0x0)
 {
   //
   // Constructor.
@@ -54,9 +54,10 @@ AliRsnFunction::AliRsnFunction() :
   // 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++) {
+  for (i = 0; i < 100; i++)
+  {
     fHisto[i] = 0x0;
   }
 }
@@ -64,13 +65,14 @@ AliRsnFunction::AliRsnFunction() :
 //________________________________________________________________________________________
 AliRsnFunction::AliRsnFunction
 (EFcnType type, AliRsnHistoDef *hd, Bool_t skipOut) :
-  fFcnType(type),
-  fUseBins(kFALSE),
-  fSkipOutsideInterval(skipOut),
-  fBins(0),
-  fBinningCut(),
-  fBinningCutType(AliRsnCut::kLastCutType),
-  fHistoDef(hd)
+    fFcnType(type),
+    fRotAngle(0.0),
+    fUseBins(kFALSE),
+    fSkipOutsideInterval(skipOut),
+    fBins(0),
+    fBinningCut(),
+    fBinningCutType(AliRsnCut::kLastCutType),
+    fHistoDef(hd)
 {
   //
   // Constructor.
@@ -78,23 +80,25 @@ AliRsnFunction::AliRsnFunction
   // 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++) {
+  for (i = 0; i < 100; i++)
+  {
     fHisto[i] = 0x0;
   }
 }
 
 //________________________________________________________________________________________
 AliRsnFunction::AliRsnFunction(const AliRsnFunction &copy) :
-  TObject(copy),
-  fFcnType(copy.fFcnType),
-  fUseBins(copy.fUseBins),
-  fSkipOutsideInterval(copy.fSkipOutsideInterval),
-  fBins(0),
-  fBinningCut(),
-  fBinningCutType(AliRsnCut::kLastCutType),
-  fHistoDef(copy.fHistoDef)
+    TObject(copy),
+    fFcnType(copy.fFcnType),
+    fRotAngle(copy.fRotAngle),
+    fUseBins(copy.fUseBins),
+    fSkipOutsideInterval(copy.fSkipOutsideInterval),
+    fBins(0),
+    fBinningCut(),
+    fBinningCutType(AliRsnCut::kLastCutType),
+    fHistoDef(copy.fHistoDef)
 {
   //
   // Copy constructor.
@@ -102,11 +106,13 @@ AliRsnFunction::AliRsnFunction(const AliRsnFunction &copy) :
   //
 
   Int_t i, n = 100;
-  for (i = 0; i < n; i++) {
+  for (i = 0; i < n; i++)
+  {
     fHisto[i] = 0x0;
   }
-    
-  if (fUseBins) {
+
+  if (fUseBins)
+  {
     n = copy.fBins.GetSize();
     Double_t *array = new Double_t[n];
     for (i = 0; i < n; i++) array[i] = copy.fBins[i];
@@ -135,7 +141,8 @@ void AliRsnFunction::Clear(Option_t* /*option*/)
   //
 
   Int_t i;
-  for (i = 0; i < 100; i++) {
+  for (i = 0; i < 100; i++)
+  {
     delete fHisto[i];
     fHisto[i] = 0x0;
   }
@@ -153,33 +160,35 @@ TList* AliRsnFunction::Init(const char *histoName, const char *histoTitle)
   //
 
   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
   TList *histos = new TList;
   histos->SetName(Form("%s", GetFcnName().Data()));
-    
-  // a general histogram is always added, 
+
+  // a general histogram is always added,
   // which overrides the binning and collects everything
   fHisto[0] = new TH1D(histoName, histoTitle, nbins, min, max);
   histos->AddLast(fHisto[0]);
-    
-  // if requested a binning w.r. to some cut variable, histograms are added 
+
+  // 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];
-  if (fUseBins) {
-    for (ibin = 0, i = 1; ibin < fBins.GetSize() - 1; ibin++, i++) {
+  if (fUseBins)
+  {
+    for (ibin = 0, i = 1; ibin < fBins.GetSize() - 1; ibin++, i++)
+    {
       sprintf(hName, "%s[%.2f-%.2f]", histoName, fBins[ibin], fBins[ibin+1]);
       sprintf(hTitle, "%s [%.2f-%.2f]", histoTitle, fBins[ibin], fBins[ibin+1]);
       fHisto[i] = new TH1D(hName, hTitle, nbins, min, max);
       histos->AddLast(fHisto[i]);
     }
   }
-    
+
   // returns the full list at the end
   return histos;
 }
@@ -196,28 +205,31 @@ void AliRsnFunction::Init(const char *histoName, const char *histoTitle, TList *
   //
 
   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) {
+  if (!histos)
+  {
     AliError("NULL target list!");
     return;
   }
-    
-  // a general histogram is always added, 
+
+  // a general histogram is always added,
   // which overrides the binning and collects everything
   fHisto[0] = new TH1D(histoName, histoTitle, nbins, min, max);
   histos->AddLast(fHisto[0]);
-    
-  // if requested a binning w.r. to some cut variable, histograms are added 
+
+  // 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];
-  if (fUseBins) {
-    for (ibin = 0, i = 1; ibin < fBins.GetSize() - 1; ibin++, i++) {
+  if (fUseBins)
+  {
+    for (ibin = 0, i = 1; ibin < fBins.GetSize() - 1; ibin++, i++)
+    {
       sprintf(hName, "%s[%.2f-%.2f]", histoName, fBins[ibin], fBins[ibin+1]);
       sprintf(hTitle, "%s [%.2f-%.2f]", histoTitle, fBins[ibin], fBins[ibin+1]);
       fHisto[i] = new TH1D(hName, hTitle, nbins, min, max);
@@ -233,13 +245,14 @@ void AliRsnFunction::SetBinningCut
   //
   // 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++) {
+  for (i = 0; i < nBins; i++)
+  {
     fBins[i] = min + (Double_t)i * step;
   }
 }
@@ -257,7 +270,8 @@ void AliRsnFunction::SetBinningCut
   Int_t i;
   fBinningCutType = type;
   fBins.Set(nbins);
-  for (i = 0; i < nbins; i++) {
+  for (i = 0; i < nbins; i++)
+  {
     fBins[i] = bins[i];
   }
 }
@@ -271,22 +285,26 @@ TString AliRsnFunction::GetFcnName()
 
   TString text("Undef");
 
-  switch (fFcnType) {
-  case kInvMass:
-    text = "IM";
-    break;
-  case kInvMassMC:
-    text = "IM_MC";
-    break;
-  case kResolution:
-    text = "RES";
-    break;
-  case kPtSpectrum:
-    text = "PT";
-  default:
-    AliError("Type not defined");
+  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";
+    default:
+      AliError("Type not defined");
   }
-  
+
   return text;
 }
 
@@ -296,25 +314,26 @@ TString AliRsnFunction::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";
-  default:
-    AliError("Type not defined");
+  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";
+    default:
+      AliError("Type not defined");
   }
-  
+
   return text;
 }
 
@@ -328,29 +347,32 @@ Bool_t AliRsnFunction::Fill(AliRsnPairParticle *pair, AliRsnPairDef *ref, Double
 
   Double_t value = FcnValue(pair, ref);
   if (fSkipOutsideInterval)
-    {
-      if (value < fHistoDef->GetMin()) return kFALSE;
-      if (value > fHistoDef->GetMax()) return kFALSE;
-    }
-    
+  {
+    if (value < fHistoDef->GetMin()) return kFALSE;
+    if (value > fHistoDef->GetMax()) return kFALSE;
+  }
+
   // fill global histogram
   if (weight == 0.0) fHisto[0]->Fill(value);
   else fHisto[0]->Fill(value, weight);
-    
+
   // if bins are allocated, find right one and fill it
-  if (fUseBins) {
+  if (fUseBins)
+  {
     Int_t i, ibin;
-    for (ibin = 0, i = 1; ibin < fBins.GetSize() - 1; ibin++, i++) {
+    for (ibin = 0, i = 1; ibin < fBins.GetSize() - 1; ibin++, i++)
+    {
       if (!fHisto[i]) continue;
       fBinningCut.SetCutValues(fBinningCutType, fBins[ibin], fBins[ibin+1]);
-      if (fBinningCut.IsSelected(AliRsnCut::kPair, pair)) {
+      if (fBinningCut.IsSelected(AliRsnCut::kPair, pair))
+      {
         if (weight == 0.0) fHisto[i]->Fill(value);
         else fHisto[i]->Fill(value, weight);
         break;
       }
     }
   }
-    
+
   return kTRUE;
 }
 
@@ -362,19 +384,29 @@ Double_t AliRsnFunction::FcnValue(AliRsnPairParticle *pair, AliRsnPairDef *ref)
   // It computes the value which must be used to fill the histogram.
   //
 
-  switch (fFcnType) {
-  case kInvMass:
-    return pair->GetInvMass(ref->GetMass(0), ref->GetMass(1));
-  case kInvMassMC:
-    return pair->GetInvMassMC(ref->GetMass(0), ref->GetMass(1));
-  case kResolution:
-    return FcnResolution(pair, ref);
-  case kPtSpectrum:
-    return pair->GetPt();
-  default:
-    AliError("Type not defined");
+  switch (fFcnType)
+  {
+    case kInvMass:
+      return pair->GetInvMass(ref->GetMass(0), ref->GetMass(1));
+    case kInvMassMC:
+      return pair->GetInvMassMC(ref->GetMass(0), ref->GetMass(1));
+    case kInvMassRotated:
+      //AliInfo(Form("*** ROTATION ANGLE = %f ***", fRotAngle));
+      //AliInfo(Form("UNROTATED INV MASS = %f", pair->GetInvMass(ref->GetMass(0), ref->GetMass(1))));
+      //pair->GetDaughter(1)->Print("P");
+      pair->GetDaughter(1)->RotateP(fRotAngle * TMath::DegToRad());
+      pair->ResetPair();
+      //AliInfo(Form("  ROTATED INV MASS = %f", pair->GetInvMass(ref->GetMass(0), ref->GetMass(1))));
+      //pair->GetDaughter(1)->Print("P");
+      return pair->GetInvMass(ref->GetMass(0), ref->GetMass(1));
+    case kResolution:
+      return FcnResolution(pair, ref);
+    case kPtSpectrum:
+      return pair->GetPt();
+    default:
+      AliError("Type not defined");
   }
-  
+
   return 0.0;
 }
 
@@ -387,6 +419,6 @@ inline Double_t AliRsnFunction::FcnResolution(AliRsnPairParticle *pair, AliRsnPa
 
   Double_t recInvMass = pair->GetInvMass(ref->GetMass(0), ref->GetMass(1));
   Double_t simInvMass = pair->GetInvMassMC(ref->GetMass(0), ref->GetMass(1));
-    
+
   return (simInvMass - recInvMass) / simInvMass;
 }
index 0db1b145597906399e923da8b63c9e25c4f0cdf3..e73e8dd8c5c4fb7087492e136275cdcf1f4c5758 100644 (file)
@@ -11,8 +11,8 @@
 // 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 
+// 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.
 //
 //
@@ -36,12 +36,13 @@ class AliRsnEvent;
 class AliRsnFunction : public TObject
 {
 
-public:
+  public:
 
     enum EFcnType
     {
       kInvMass,
       kInvMassMC,
+      kInvMassRotated,
       kResolution,
       kPtSpectrum,
       kFcnTypes
@@ -58,10 +59,11 @@ public:
     AliRsnHistoDef*  GetHistoDef() {return fHistoDef;}
     TString          GetFcnName();
     TString          GetFcnTitle();
-    
+
     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  SetBinningCut(AliRsnCut::EType type, Int_t nbins, Double_t *bins);
     void  SetHistoDef(AliRsnHistoDef *def) {fHistoDef = def;}
+    void  SetRotationAngle(Double_t rotAngle) {fRotAngle = rotAngle;}
 
     // working routines
     TList* Init(const char *histoName, const char *histoTitle);
@@ -69,24 +71,26 @@ public:
     Bool_t Fill(AliRsnPairParticle *pair, AliRsnPairDef *ref, Double_t weight = 0.0);
     Double_t FcnValue(AliRsnPairParticle *pair, AliRsnPairDef *ref);
 
-private:
-    
+  private:
+
     const AliRsnFunction& operator=(const AliRsnFunction &copy);
-    
+
     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
     Bool_t           fSkipOutsideInterval; // skip pairs which fall outside histogram interval
-    
+
     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
 
     AliRsnHistoDef  *fHistoDef;      // definitions for histogram
     TH1D            *fHisto[100];    // binned histograms
-    
+
     // ROOT dictionary
     ClassDef(AliRsnFunction, 1)
 };
index ab6cf1517056aa4ba9066bdcb6a5685436c827e0..dc3a1a2b58ab834acb6fc811d6c6d4e5716900cb 100644 (file)
@@ -18,9 +18,9 @@ ClassImp(AliRsnHistoDef)
 
 //_____________________________________________________________________________
 AliRsnHistoDef::AliRsnHistoDef() :
-  fNBins(0),
-  fMin(0.0),
-  fMax(0.0)
+    fNBins(0),
+    fMin(0.0),
+    fMax(0.0)
 {
 //
 // Default constructor
@@ -30,14 +30,14 @@ AliRsnHistoDef::AliRsnHistoDef() :
 //_____________________________________________________________________________
 AliRsnHistoDef::AliRsnHistoDef
 (Int_t nbins, Double_t min, Double_t max) :
-  fNBins(0),
-  fMin(0.0),
-  fMax(0.0)
+    fNBins(0),
+    fMin(0.0),
+    fMax(0.0)
 {
 //
 // 1D histo definition.
 //
-    SetBins(nbins, min, max);
+  SetBins(nbins, min, max);
 }
 
 //_____________________________________________________________________________
@@ -46,14 +46,16 @@ void AliRsnHistoDef::SetBins(Int_t n, Double_t min, Double_t max)
 //
 // Binning for histogram.
 //
-    fNBins = n;
-    
-    if (min < max) {
-        fMin = min;
-        fMax = max;
-    }
-    else {
-        fMin = max;
-        fMax = min;
-    }
+  fNBins = n;
+
+  if (min < max)
+  {
+    fMin = min;
+    fMax = max;
+  }
+  else
+  {
+    fMin = max;
+    fMax = min;
+  }
 }
index 4e841979eedff24bf2fa75d4f3dc56baa15f2c51..a47d53cf412231e0ec846d869cfd46f13b98a70e 100644 (file)
@@ -4,7 +4,7 @@
 // Histogram definition.
 // Contains required informations to create a histogram
 // with fixed bin size: number of bins, minimum and maximum.
-// Variable bin sizes are not considered because they are 
+// Variable bin sizes are not considered because they are
 // not used as typical output of analysis in this package.
 //
 
index de84229bb017d22713aa9c18cd9e2f44d194f01a..d47556d3ddd95e10cf5f5fa9a9fdf2c631e4186b 100644 (file)
@@ -1,3 +1,11 @@
+//
+// Class AliRsnMCInfo
+//
+// Contains informations from the MonteCarlo particle is associated to a track.
+// It is used when looking at "perfect" PID and at "true" pairs, but the user
+// does not need to access its methods.
+//
+
 #include "AliLog.h"
 
 #include "AliRsnMCInfo.h"
 ClassImp(AliRsnMCInfo)
 
 //_____________________________________________________________________________
-AliRsnMCInfo::AliRsnMCInfo() : TObject(),
-    fEnergy(0),
-    fPDG(0),
-    fMother(-1),
-    fMotherPDG(0)
+AliRsnMCInfo::AliRsnMCInfo() :
+    TObject(), fEnergy(0), fPDG(0), fMother(-1), fMotherPDG(0)
 {
 //
 // Default constructor.
-// Initializes all data-members with meaningless values.
+// Initializes all data-members to meaningless values.
 //
-  for (Int_t i = 0; i < 3; i++) fP[i] = 0.0;
+
+  Int_t i;
+  for (i = 0; i < 3; i++) fP[i] = 0.0;
 }
 
 //_____________________________________________________________________________
-AliRsnMCInfo::AliRsnMCInfo(const AliRsnMCInfo & copy) : TObject(copy),
+AliRsnMCInfo::AliRsnMCInfo(const AliRsnMCInfo & copy) :
+    TObject(copy),
     fEnergy(copy.fEnergy),
     fPDG(copy.fPDG),
     fMother(copy.fMother),
@@ -27,27 +35,27 @@ AliRsnMCInfo::AliRsnMCInfo(const AliRsnMCInfo & copy) : TObject(copy),
 {
 //
 // Copy constructor.
-// Initializes all data-members with meaningless values.
 //
 
-  for (Int_t i = 0; i < 3; i++) fP[i] = copy.fP[i];
-
+  Int_t i;
+  for (i = 0; i < 3; i++) fP[i] = copy.fP[i];
 }
 
 //_____________________________________________________________________________
 AliRsnMCInfo::~AliRsnMCInfo()
 {
+//
+// Destructor.
+// Does nothing because there are no pointers to clean.
+//
 }
 
 //_____________________________________________________________________________
 void AliRsnMCInfo::Adopt(TParticle * particle)
 {
 //
-// Copies data from a TParticle into "this":
-//  - PDG code
-//  - GEANT label of mother (if any, otherwise -1)
-// If the argument is NULL, nothing is done, and an alert
-// is given by the method.
+// Uses a TParticle to initialize its data members.
+// If the argument is NULL, nothing is done and an error message is returned.
 //
 
   if (!particle)
index b70eca5176aa3fa256e0c3b94eb2bb20c6b98c77..f0f9cfb3c78d754e3128270557f28454b594042b 100644 (file)
@@ -1,13 +1,24 @@
-#ifndef AliRsnMCInfo_h
-#define AliRsnMCInfo_h
+//
+// Class AliRsnMCInfo
+//
+// Contains informations from the MonteCarlo particle is associated to a track.
+// It is used when looking at "perfect" PID and at "true" pairs, but the user
+// does not need to access its methods.
+//
+// authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//          M. Vala (martin.vala@cern.ch)
+//
+
+#ifndef ALIRSNMCINFO_H
+#define ALIRSNMCINFO_H
 
-#include <AliVParticle.h>
 #include <TParticle.h>
 #include <TMath.h>
 
 class AliRsnMCInfo : public TObject
 {
   public:
+
     AliRsnMCInfo();
     AliRsnMCInfo(const AliRsnMCInfo &copy);
 
@@ -15,35 +26,35 @@ class AliRsnMCInfo : public TObject
     void Adopt(TParticle *part);
 
     // 4-momentum
-    virtual Double_t E()  const {return fEnergy;}
-    virtual Double_t E(Double_t mass) {return TMath::Sqrt(mass*mass + P2());}
-    virtual Double_t M()  const {return TMath::Sqrt(fEnergy*fEnergy - P2());}
-    virtual Double_t P2() const {return Px()*Px() + Py()*Py() + Pz()*Pz();}
-    virtual Double_t P()  const {return TMath::Sqrt(P2());}
-    virtual Double_t Px() const {return fP[0];}
-    virtual Double_t Py() const {return fP[1];}
-    virtual Double_t Pz() const {return fP[2];}
-    virtual Double_t Pt() const {return TMath::Sqrt(Px() *Px() + Py() *Py());}
-    virtual Double_t OneOverPt() const {return 1.0 / Pt();}
-    virtual Bool_t   PxPyPz(Double_t p[3]) const {p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE;}
-
-    virtual Double_t Phi() const {return TMath::ATan2(Py(), Px());}
-    virtual Double_t Theta() const {return TMath::ATan2(Pt(), Pz());}
-    virtual Double_t Eta() const {return -TMath::Log(TMath::Tan(0.5*Theta()));}
-    virtual Double_t Y() const {return TMath::Log((E() + Pz()) / (E() - Pz()));}
-
-    void             SetPx(Double_t value) {fP[0] = value;}
-    void             SetPy(Double_t value) {fP[1] = value;}
-    void             SetPz(Double_t value) {fP[2] = value;}
-    void             SetP(Double_t px, Double_t py, Double_t pz) {SetPx(px); SetPy(py); SetPz(pz);}
-    void             SetE(Double_t e) {fEnergy = e;}
-
-    Int_t     PDG() const {return fPDG;}
-    Int_t     Mother() const {return fMother;}
-    Short_t   MotherPDG() const {return fMotherPDG;}
-    void      SetPDG(Int_t pdg) {fPDG = pdg;}
-    void      SetMother(Int_t mlabel) {fMother = mlabel;}
-    void      SetMotherPDG(Int_t pdg) {fMotherPDG = (Short_t) pdg;}
+    Double_t E()  const {return fEnergy;}
+    Double_t E(Double_t mass) {return TMath::Sqrt(mass*mass + P2());}
+    Double_t M()  const {return TMath::Sqrt(fEnergy*fEnergy - P2());}
+    Double_t P2() const {return Px()*Px() + Py()*Py() + Pz()*Pz();}
+    Double_t P()  const {return TMath::Sqrt(P2());}
+    Double_t Px() const {return fP[0];}
+    Double_t Py() const {return fP[1];}
+    Double_t Pz() const {return fP[2];}
+    Double_t Pt() const {return TMath::Sqrt(Px() *Px() + Py() *Py());}
+    Double_t OneOverPt() const {return 1.0 / Pt();}
+    Bool_t   PxPyPz(Double_t p[3]) const {p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE;}
+
+    Double_t Phi() const {return TMath::ATan2(Py(), Px());}
+    Double_t Theta() const {return TMath::ATan2(Pt(), Pz());}
+    Double_t Eta() const {return -TMath::Log(TMath::Tan(0.5*Theta()));}
+    Double_t Y() const {return 0.5 * TMath::Log((E() + Pz()) / (E() - Pz()));}
+
+    void     SetPx(Double_t value) {fP[0] = value;}
+    void     SetPy(Double_t value) {fP[1] = value;}
+    void     SetPz(Double_t value) {fP[2] = value;}
+    void     SetP(Double_t px, Double_t py, Double_t pz) {SetPx(px); SetPy(py); SetPz(pz);}
+    void     SetE(Double_t e) {fEnergy = e;}
+
+    Int_t    PDG() const {return fPDG;}
+    Int_t    Mother() const {return fMother;}
+    Short_t  MotherPDG() const {return fMotherPDG;}
+    void     SetPDG(Int_t pdg) {fPDG = pdg;}
+    void     SetMother(Int_t mlabel) {fMother = mlabel;}
+    void     SetMotherPDG(Int_t pdg) {fMotherPDG = (Short_t) pdg;}
 
   private:
 
index 2e53130cb80a0b1e4385fe1d4db5caddba31a5af..b0c68c02ba0593bd5b0951870bb503e21631e941 100644 (file)
@@ -1,28 +1,14 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-//-------------------------------------------------------------------------
-//                      Class AliRsnPID
-//                     -------------------
-//           Simple collection of reconstructed tracks
-//           selected from an ESD event
-//           to be used for analysis.
-//           .........................................
 //
-// author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
-//-------------------------------------------------------------------------
+// Class AliRsnPID
+//
+// Processes the tracks to compute PID probabilities,
+// by combining the prior probabilities with the PID weights
+// stored in each AliRsnDaughter
+//
+// authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//          M. Vala (martin.vala@cern.ch)
+//
+
 
 #include <TMath.h>
 #include <TDirectory.h>
@@ -34,9 +20,9 @@
 
 #include "AliRsnPID.h"
 
-ClassImp ( AliRsnPID )
+ClassImp(AliRsnPID)
 
-    const Double_t AliRsnPID::fgkParticleMass[AliRsnPID::kSpeciesAll + 1] =
+const Double_t AliRsnPID::fgkParticleMass[AliRsnPID::kSpeciesAll + 1] =
 {
   0.00051099892,   // electron
   0.105658369,     // muon
@@ -98,9 +84,9 @@ const Int_t AliRsnPID::fgkParticlePDG[AliRsnPID::kSpeciesAll + 1] =
 
 //_____________________________________________________________________________
 AliRsnPID::AliRsnPID() :
-    TNamed ( "RsnPID", "" ),
-    fMaxPt ( 100.0 ),
-    fMinProb ( 0.0 )
+    TNamed("RsnPID", ""),
+    fMaxPt(100.0),
+    fMinProb(0.0)
 {
 //
 // Constructor.
@@ -108,13 +94,13 @@ AliRsnPID::AliRsnPID() :
 //
 
   Int_t i;
-  for ( i = 0; i < kSpecies; i++ ) fPrior[i] = 0.0;
+  for (i = 0; i < kSpecies; i++) fPrior[i] = 0.0;
 
 //     gDirectory->Append(this, kTRUE);
 }
 
 //_____________________________________________________________________________
-AliRsnPID::EType AliRsnPID::InternalType ( Int_t pdg )
+AliRsnPID::EType AliRsnPID::InternalType(Int_t pdg)
 //
 // Return the internal enum value corresponding to the PDG
 // code passed as argument, if possible.
@@ -122,9 +108,9 @@ AliRsnPID::EType AliRsnPID::InternalType ( Int_t pdg )
 //
 {
   EType value;
-  Int_t absPDG = TMath::Abs ( pdg );
+  Int_t absPDG = TMath::Abs(pdg);
 
-  switch ( absPDG )
+  switch (absPDG)
   {
     case 11:
       value = kElectron;
@@ -155,14 +141,14 @@ AliRsnPID::EType AliRsnPID::InternalType ( Int_t pdg )
 
 
 //_____________________________________________________________________________
-Int_t AliRsnPID::PDGCode ( EType type )
+Int_t AliRsnPID::PDGCode(EType type)
 {
 //
 // Returns the PDG code of the particle type
 // specified as argument (w.r. to the internal enum)
 //
 
-  if ( type >= kElectron && type <= kUnknown )
+  if (type >= kElectron && type <= kUnknown)
   {
     return fgkParticlePDG[type];
   }
@@ -173,14 +159,14 @@ Int_t AliRsnPID::PDGCode ( EType type )
 }
 
 //_____________________________________________________________________________
-const char* AliRsnPID::ParticleName ( EType type, Bool_t shortName )
+const char* AliRsnPID::ParticleName(EType type, Bool_t shortName)
 {
 //
 // Returns the name of the particle type
 // specified as argument (w.r. to the internal enum)
 //
 
-  if ( type >= kElectron && type <= kSpeciesAll )
+  if (type >= 0 && type <= kSpeciesAll)
   {
     return shortName ? fgkParticleNameShort[type] : fgkParticleNameLong[type];
   }
@@ -191,14 +177,14 @@ const char* AliRsnPID::ParticleName ( EType type, Bool_t shortName )
 }
 
 //_____________________________________________________________________________
-const char* AliRsnPID::ParticleNameLatex ( EType type )
+const char* AliRsnPID::ParticleNameLatex(EType type)
 {
 //
 // Returns the name of the particle type
 // specified as argument (w.r. to the internal enum)
 //
 
-  if ( type >= kElectron && type <= kSpeciesAll )
+  if (type >= kElectron && type <= kSpeciesAll)
   {
     return fgkParticleNameLatex[type];
   }
@@ -209,7 +195,7 @@ const char* AliRsnPID::ParticleNameLatex ( EType type )
 }
 
 //_____________________________________________________________________________
-Double_t AliRsnPID::ParticleMass ( EType type )
+Double_t AliRsnPID::ParticleMass(EType type)
 {
 //
 // Returns the mass corresponding to the particle type
@@ -220,12 +206,12 @@ Double_t AliRsnPID::ParticleMass ( EType type )
   Int_t pdg = PDGCode(type);
   return db->GetParticle(pdg)->Mass();
   */
-  if ( type >= kElectron && type < kSpeciesAll ) return fgkParticleMass[type];
+  if (type >= kElectron && type < kSpeciesAll) return fgkParticleMass[type];
   return 0.0;
 }
 
 //_____________________________________________________________________________
-Bool_t AliRsnPID::ComputeProbs ( AliRsnDaughter *daughter )
+Bool_t AliRsnPID::ComputeProbs(AliRsnDaughter *daughter)
 {
 //
 // Uses the Bayesian combination of prior probabilities
@@ -245,28 +231,28 @@ Bool_t AliRsnPID::ComputeProbs ( AliRsnDaughter *daughter )
 
   // reset all PID probabilities to 0.0
   Int_t i;
-  for ( i = 0; i < kSpecies; i++ ) daughter->SetPIDProb ( i, 1.0 / ( Double_t ) kSpecies );
+  for (i = 0; i < kSpecies; i++) daughter->SetPIDProb(i, 1.0 / (Double_t) kSpecies);
 
   // multiply weights and priors
   Double_t sum = 0.0, prob[kSpecies];
-  for ( i = 0; i < kSpecies; i++ )
+  for (i = 0; i < kSpecies; i++)
   {
-    prob[i] = fPrior[i] * daughter->PID() [i];
+    prob[i] = fPrior[i] * daughter->PID()[i];
     sum += prob[i];
   }
-  if ( sum <= ( Double_t ) 0. )
+  if (sum <= (Double_t) 0.)
   {
-    AliError ( Form ( "Sum of weights = %f <= 0", sum ) );
+    AliError(Form("Sum of weights = %f <= 0", sum));
     return kFALSE;
   }
 
   // normalize
-  for ( i = 0; i < kSpecies; i++ )
+  for (i = 0; i < kSpecies; i++)
   {
     prob[i] /= sum;
-    daughter->SetPIDProb ( i, prob[i] );
+    daughter->SetPIDProb(i, prob[i]);
   }
-  
+
   daughter->AssignRealisticPID();
   Double_t assprob;
   AliRsnDaughter::SetPIDMethod(AliRsnDaughter::kRealistic);
@@ -277,7 +263,7 @@ Bool_t AliRsnPID::ComputeProbs ( AliRsnDaughter *daughter )
 }
 
 //_____________________________________________________________________________
-Bool_t AliRsnPID::IdentifiedAs ( AliRsnDaughter *d, EType type, Short_t charge )
+Bool_t AliRsnPID::IdentifiedAs(AliRsnDaughter *d, EType type, Short_t charge)
 {
 //
 // Tells if a particle has can be identified to be of a given tipe and charge.
@@ -288,24 +274,24 @@ Bool_t AliRsnPID::IdentifiedAs ( AliRsnDaughter *d, EType type, Short_t charge )
 // is kFALSE even when the type and charge are matched.
 //
 
-  EType dType = TrackType ( d );
-  if ( dType != type ) return kFALSE;
-  if ( charge == 0 )
+  EType dType = TrackType(d);
+  if (dType != type) return kFALSE;
+  if (charge == 0)
   {
     return kTRUE;
   }
-  else if ( charge > 0 )
+  else if (charge > 0)
   {
-    return ( d->Charge() > 0 );
+    return (d->Charge() > 0);
   }
   else
   {
-    return ( d->Charge() < 0 );
+    return (d->Charge() < 0);
   }
 }
 
 //_____________________________________________________________________________
-AliRsnPID::EType AliRsnPID::TrackType ( AliRsnDaughter *d )
+AliRsnPID::EType AliRsnPID::TrackType(AliRsnDaughter *d)
 {
 //
 // Returns the track type according to the object settings
@@ -313,16 +299,16 @@ AliRsnPID::EType AliRsnPID::TrackType ( AliRsnDaughter *d )
 //
 
   Double_t prob;
-  EType type = d->PIDType ( prob );
+  EType type = d->PIDType(prob);
 
-  if ( d->Pt() > fMaxPt ) return kUnknown;
-  if ( prob < fMinProb ) return kUnknown;
+  if (d->Pt() > fMaxPt) return kUnknown;
+  if (prob < fMinProb) return kUnknown;
 
   return type;
 }
 
 //_____________________________________________________________________________
-Bool_t AliRsnPID::Process ( AliRsnEvent *event )
+Bool_t AliRsnPID::Process(AliRsnEvent *event)
 {
 //
 // Performs identification for all tracks in a given event.
@@ -330,15 +316,15 @@ Bool_t AliRsnPID::Process ( AliRsnEvent *event )
 //
 
   Bool_t check = kTRUE;
-  if ( !event ) return check;
-  if ( !event->GetTracks() ) return check;
-  if ( event->GetTracks()->IsEmpty() ) return check;
+  if (!event) return check;
+  if (!event->GetTracks()) return check;
+  if (event->GetTracks()->IsEmpty()) return check;
 
   AliRsnDaughter *daughter = 0;
-  TObjArrayIter iter ( event->GetTracks() );
-  while ( ( daughter = ( AliRsnDaughter* ) iter.Next() ) )
+  TObjArrayIter iter(event->GetTracks());
+  while ((daughter = (AliRsnDaughter*) iter.Next()))
   {
-    check = check && ComputeProbs ( daughter );
+    check = check && ComputeProbs(daughter);
   }
   event->FillPIDArrays();
 
@@ -347,14 +333,14 @@ Bool_t AliRsnPID::Process ( AliRsnEvent *event )
 
 
 //_____________________________________________________________________________
-void AliRsnPID::SetPriorProbability ( EType type, Double_t p )
+void AliRsnPID::SetPriorProbability(EType type, Double_t p)
 {
 //
 // Sets the prior probability for Realistic PID, for a
 // given particle species.
 //
 
-  if ( type >= kElectron && type < kSpecies )
+  if (type >= kElectron && type < kSpecies)
   {
     fPrior[type] = p;
   }
@@ -370,9 +356,9 @@ void AliRsnPID::DumpPriors()
   Int_t i;
   Char_t msg[200];
 
-  for ( i = 0; i < kSpecies; i++ )
+  for (i = 0; i < kSpecies; i++)
   {
-    sprintf ( msg, "Prior probability for '%s' = %3.5f", fgkParticleNameLong[i], fPrior[i] );
-    AliInfo ( msg );
+    sprintf(msg, "Prior probability for '%s' = %3.5f", fgkParticleNameLong[i], fPrior[i]);
+    AliInfo(msg);
   }
 }
index 41e64fd25afe00e839bae0da42315ba794c3110f..f5035b2fb3558df35ba498716c001fefdee491be 100644 (file)
@@ -1,16 +1,13 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               *
- **************************************************************************/
-
-/* $Id: AliRsnPID.h,v 1.5 2007/02/21 14:33:25 pulvir Exp $ */
-
-//-------------------------------------------------------------------------
-//                      Class AliRsnPID
-//  Simple collection of reconstructed tracks, selected from an ESD event
 //
-// author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
-//-------------------------------------------------------------------------
+// Class AliRsnPID
+//
+// Processes the tracks to compute PID probabilities,
+// by combining the prior probabilities with the PID weights
+// stored in each AliRsnDaughter
+//
+// authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//          M. Vala (martin.vala@cern.ch)
+//
 
 #ifndef ALIRSNPID_H
 #define ALIRSNPID_H
index 741443a55119ed0c5b81670c76efe3e11425de05..49c9228f209ef1328e170f9ef039c3904370095a 100644 (file)
@@ -1,20 +1,5 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-//
-// *** Class AliRsnPIDIndex ***
+//
+// Class AliRsnPIDIndex
 //
 // It sorts the indexes of all tracks in an AliRsnEvent
 // for a fast retrieval of them according to charge and PID.
index 1c4dfba51b41d22f8b8b975920ced2a2c63bb05c..a91821cf0876425018a77b7d2ff723373b0fa719 100644 (file)
@@ -1,10 +1,5 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               *
- **************************************************************************/
-
 //
-// *** Class AliRsnPIDIndex ***
+// Class AliRsnPIDIndex
 //
 // It sorts the indexes of all tracks in an AliRsnEvent
 // for a fast retrieval of them according to charge and PID.
@@ -22,7 +17,7 @@ class AliRsnPIDIndex : public TObject
 {
   public:
 
-    AliRsnPIDIndex(Int_t num = 2000);
+    AliRsnPIDIndex(Int_t num = 1000);
     AliRsnPIDIndex(const AliRsnPIDIndex &copy);
     AliRsnPIDIndex& operator= (const AliRsnPIDIndex& copy);
 
index 0f40b8e18ad9aa310e88bbb32f3a6570ddbd9b71..1627fd1bb69493008ef10076f7e94526f8142839 100644 (file)
@@ -25,17 +25,18 @@ ClassImp(AliRsnPair)
 
 //_____________________________________________________________________________
 AliRsnPair::AliRsnPair
-(EPairType type, AliRsnPairDef *def, Int_t mixNum) :
-    TObject(),
-    fIsMixed(kFALSE),
-    fUseMC(kFALSE),
-    fIsLikeSign(kFALSE),
-    fMixNum(mixNum),
-    fPairDef(def),
-    fPairType(type),
-    fTypePID(AliRsnDaughter::kRealistic),
-    fCutMgr(0),
-    fFunctions("AliRsnFunction", 0)
+(EPairType type, AliRsnPairDef *def, Int_t mixNum, Double_t mixVzCut, Int_t mixMultCut) :
+  TObject(),
+  fIsMixed(kFALSE),
+  fUseMC(kFALSE),
+  fIsLikeSign(kFALSE),
+  fMixNum(mixNum),
+  fMixingCut(0x0),
+  fPairDef(def),
+  fPairType(type),
+  fTypePID(AliRsnDaughter::kRealistic),
+  fCutMgr(0),
+  fFunctions("AliRsnFunction", 0)
 {
 //
 // Default constructor
@@ -123,16 +124,16 @@ void AliRsnPair::Print()
   AliInfo(Form("Number of functions %d", fFunctions.GetEntries()));
   switch(fTypePID) {
     case AliRsnDaughter::kNoPID:
-        AliInfo("PID method: none");
-        break;
+      AliInfo("PID method: none");
+      break;
     case AliRsnDaughter::kRealistic:
-        AliInfo("PID method: realistic");
-        break;
+      AliInfo("PID method: realistic");
+      break;
     case AliRsnDaughter::kPerfect:
-        AliInfo("PID method: perfect");
-        break;
+      AliInfo("PID method: perfect");
+      break;
     default:
-        AliInfo("PID method: undefined");
+      AliInfo("PID method: undefined");
     }
 }
 
@@ -145,22 +146,24 @@ void AliRsnPair::ProcessPair(AliRsnEventBuffer *buf)
 
   AliRsnEvent *e1 = buf->GetCurrentEvent();
   if (!e1) return;
-  if (e1->GetMultiplicity() < 1) return;
+//   if (e1->GetMultiplicity() < 1) return;
   TArrayI* array1 = e1->GetTracksArray(fTypePID, fPairDef->GetCharge(0), fPairDef->GetType(0));
-
+  
   Int_t i = 0;
   Int_t numMixed = 0;
-  Int_t lastOkEvent = 1;
+  Int_t lastOkEvent = 0;
   TArrayI* array2 = 0;
   for (i = 0; i < fMixNum; i++)
   {
     // find other event by event cut
-    AliRsnEvent *e2 = FindEventByEventCut(buf, lastOkEvent);
+    AliRsnEvent *e2 = 0;
+    e2 = FindEventByEventCut(buf, lastOkEvent);
     if (!e2) return;
-    if (e2->GetMultiplicity() < 1) return;
+//     if (e2->GetMultiplicity() < 1) continue;
     array2 = e2->GetTracksArray(fTypePID, fPairDef->GetCharge(1), fPairDef->GetType(1));
     LoopPair(e1, array1, e2, array2);
     numMixed++;
+    lastOkEvent++;
   }
 //  if (fIsMixed) AliInfo (Form ("NumMixed = %d",numMixed));
 }
@@ -178,7 +181,8 @@ AliRsnEvent * AliRsnPair::FindEventByEventCut(AliRsnEventBuffer *buf, Int_t& num
 
   if (fIsMixed)
   {
-    returnEvent = buf->GetEvent(buf->GetEventsBufferIndex() - num);
+    //returnEvent = buf->GetEvent(buf->GetEventsBufferIndex() - num);
+    returnEvent = buf->GetNextGoodEvent(num);
   }
   else
   {
@@ -197,8 +201,8 @@ void AliRsnPair::LoopPair
 // using the arrays of indexes and the events containing them.
 //
 
-  if (!a1) {AliError("No TArrayI 1 from currentEvent->GetTracksArray(...)"); return;}
-  if (!a2) {AliError("No TArrayI 2 from currentEvent->GetTracksArray(...)"); return;}
+  if (!a1) {AliDebug(4, "No TArrayI 1 from currentEvent->GetTracksArray(...)"); return;}
+  if (!a2) {AliDebug(4, "No TArrayI 2 from currentEvent->GetTracksArray(...)"); return;}
 
   AliRsnDaughter::SetPIDMethod(fTypePID);
   AliRsnDaughter *daughter1 = 0;
@@ -288,7 +292,7 @@ void AliRsnPair::GenerateHistograms(TString prefix, TList *tgt)
 }
 
 //_____________________________________________________________________________
-TString AliRsnPair::GetPairTypeName(EPairType type)
+TString AliRsnPair::GetPairTypeName(EPairType type) 
 {
 //
 // Returns type name, made with particle names ant chosen PID
@@ -311,7 +315,7 @@ TString AliRsnPair::GetPairTypeName(EPairType type)
 }
 
 //_____________________________________________________________________________
-TString AliRsnPair::GetPairName()
+TString AliRsnPair::GetPairName() 
 {
 //
 // Retruns pair name
@@ -371,11 +375,8 @@ void AliRsnPair::AddFunction(AliRsnFunction *fcn)
 //
 // Adds a new computing function
 //
-//     if (!fFunctions) fFunctions = new TList;
-  //fFunctions.Add((AliRsnFunction *)fcn->Clone());
   Int_t size = fFunctions.GetEntries();
   new(fFunctions[size]) AliRsnFunction(*fcn);
-  //fFunctions.AddLast(fcopy);
 }
 
 //________________________________________________________________________________________
index 8323a2cccd8a2c9621f86718644e02a72965b646..d1ac9bbf681483c4795721e5e5d5ee470b824fef 100644 (file)
@@ -29,28 +29,22 @@ class AliRsnPair : public TObject
 
     enum EPairType
     {
-        kNoPID = 0,    kNoPIDMix,
-        kRealisticPID, kRealisticPIDMix,
-        kPerfectPID,   kPerfectPIDMix,
-        kTruePairs,
-        kPairTypes
+      kNoPID = 0,    kNoPIDMix,
+      kRealisticPID, kRealisticPIDMix,
+      kPerfectPID,   kPerfectPIDMix,
+      kTruePairs,
+      kPairTypes
     };
 
-    enum EOutputType
-    {
-      kInvMass = 0,
-      kInvMassResolution,
-      kOutputTypes
-    };
-
-
-    AliRsnPair (EPairType type = kRealisticPID, AliRsnPairDef *def = 0, Int_t mixNum = 1);
+    AliRsnPair(EPairType type = kRealisticPID, AliRsnPairDef *def = 0, 
+               Int_t mixNum = 1, Double_t mixVzCut = 1.0, Int_t mixMultCut = 10);
     ~AliRsnPair();
 
     void    Init();
     void    Print();
     void    ProcessPair(AliRsnEventBuffer *buf);
     void    SetCutMgr(AliRsnCutMgr* theValue) { fCutMgr = theValue; }
+    void    SetMixingCut(AliRsnCutSet* theValue) { fMixingCut = theValue; }
     void    AddFunction(AliRsnFunction *fcn);
     TList*  GenerateHistograms(TString prefix = "");
     void    GenerateHistograms(TString prefix, TList *tgt);
@@ -61,11 +55,11 @@ class AliRsnPair : public TObject
     TString GetPairHistTitle(AliRsnFunction *fcn, TString text="");
 
   private:
-  
+
     AliRsnPair (const AliRsnPair &copy) : TObject(copy),
-         fIsMixed(kFALSE),fUseMC(kFALSE),fIsLikeSign(kFALSE),fMixNum(1),
-         fPairDef(0x0),fPairType(kPairTypes),fTypePID(AliRsnDaughter::kRealistic),
-         fCutMgr(0x0),fFunctions("AliRsnFunction",0) {}
+      fIsMixed(kFALSE),fUseMC(kFALSE),fIsLikeSign(kFALSE),fMixNum(1),fMixingCut(0x0),
+      fPairDef(0x0),fPairType(kPairTypes),fTypePID(AliRsnDaughter::kRealistic),
+      fCutMgr(0x0),fFunctions("AliRsnFunction",0) {}
     AliRsnPair& operator=(const AliRsnPair&) {return *this;}
 
     void           SetUp(EPairType type);  // sets up all flags
@@ -73,13 +67,6 @@ class AliRsnPair : public TObject
     AliRsnEvent*   FindEventByEventCut(AliRsnEventBuffer *buf,Int_t & num);
     void           LoopPair(AliRsnEvent *ev1,TArrayI *a1,AliRsnEvent *ev2,TArrayI *a2);
 
-    void           FillHistogram(EOutputType type,AliRsnPairParticle*pairPart);
-    void           FillEffMass(EOutputType type,AliRsnPairParticle*pairPart);
-    void           FillResolution(EOutputType type,AliRsnPairParticle*pairPart);
-
-    TString        GetOutputTypeName(EOutputType type);
-    TString        GetOutputTypeTitle(EOutputType type);
-    
     Bool_t         CutPass(AliRsnDaughter *d);
     Bool_t         CutPass(AliRsnPairParticle *p);
     Bool_t         CutPass(AliRsnEvent *e);
@@ -89,6 +76,7 @@ class AliRsnPair : public TObject
     Bool_t         fUseMC;                   // using MC inv. mass ?
     Bool_t         fIsLikeSign;              // is a like-sign pair ?
     Int_t          fMixNum;                  // number of mixed events
+    AliRsnCutSet  *fMixingCut;               // cut for event mixing
     
     // work management
     AliRsnPairDef              *fPairDef;                // pair definition (particles, charges)
index 59e38989e2e03de522a481b706e20791aaa10387..a330c288350f7c242aa04e172fcad89220cbce34 100644 (file)
@@ -27,12 +27,13 @@ AliRsnPairDef::AliRsnPairDef() : fMotherPDG(0)
 // must be defined before starting event processing.
 //
 
-    Int_t i;
-    for (i = 0; i < 2; i++) {
-        fCharge[i] = '0';
-        fMass[i] = 0.0;
-        fType[i] = AliRsnPID::kUnknown;
-    }
+  Int_t i;
+  for (i = 0; i < 2; i++)
+  {
+    fCharge[i] = '0';
+    fMass[i] = 0.0;
+    fType[i] = AliRsnPID::kUnknown;
+  }
 }
 
 //_____________________________________________________________________________
@@ -45,7 +46,7 @@ AliRsnPairDef::AliRsnPairDef
 // This constructor allows to define all the working parameters.
 //
 
-    SetPair(sign1, type1, sign2, type2);
+  SetPair(sign1, type1, sign2, type2);
 }
 
 //_____________________________________________________________________________
@@ -58,7 +59,7 @@ AliRsnPairDef::AliRsnPairDef
 // This constructor allows to define all the working parameters.
 //
 
-    SetPair(sign1, type1, sign2, type2);
+  SetPair(sign1, type1, sign2, type2);
 }
 
 
@@ -71,7 +72,7 @@ AliRsnPairDef::AliRsnPairDef(const AliRsnPairDef &copy) :
 // Copy constructor with standard behavior
 //
 
-    SetPair(copy.fCharge[0], copy.fType[0], copy.fCharge[1], copy.fType[1]);
+  SetPair(copy.fCharge[0], copy.fType[0], copy.fCharge[1], copy.fType[1]);
 }
 
 //_____________________________________________________________________________
@@ -81,10 +82,10 @@ const AliRsnPairDef& AliRsnPairDef::operator=(const AliRsnPairDef &copy)
 // Assignment operator with standard behavior.
 //
 
-    fMotherPDG = copy.fMotherPDG;
-    SetPair(copy.fCharge[0], copy.fType[0], copy.fCharge[1], copy.fType[1]);
+  fMotherPDG = copy.fMotherPDG;
+  SetPair(copy.fCharge[0], copy.fType[0], copy.fCharge[1], copy.fType[1]);
 
-    return (*this);
+  return (*this);
 }
 
 //_____________________________________________________________________________
@@ -94,23 +95,26 @@ Bool_t AliRsnPairDef::SetPairElement(Int_t i, Char_t charge, AliRsnPID::EType ty
 // Set one element of the pair
 // and returns warnings if the type is not valid.
 //
-    if (i < 0 || i > 1) {
-        AliError("Index out of range");
-        return kFALSE;
-    }
-    if (charge != '+' && charge != '-') {
-        AliError(Form("Character '%c' not recognized as charge sign"));
-        return kFALSE;
-    }
-    if (type < AliRsnPID::kElectron && type > AliRsnPID::kUnknown) {
-        AliError("Type index out of enumeration range");
-        return kFALSE;
-    }
-    fCharge[i] = charge;
-    fType[i] = type;
-    fMass[i] = AliRsnPID::ParticleMass(type);
-    
-    return kTRUE;
+  if (i < 0 || i > 1)
+  {
+    AliError("Index out of range");
+    return kFALSE;
+  }
+  if (charge != '+' && charge != '-')
+  {
+    AliError(Form("Character '%c' not recognized as charge sign"));
+    return kFALSE;
+  }
+  if (type < AliRsnPID::kElectron && type > AliRsnPID::kUnknown)
+  {
+    AliError("Type index out of enumeration range");
+    return kFALSE;
+  }
+  fCharge[i] = charge;
+  fType[i] = type;
+  fMass[i] = AliRsnPID::ParticleMass(type);
+
+  return kTRUE;
 }
 
 //_____________________________________________________________________________
@@ -121,10 +125,10 @@ Bool_t AliRsnPairDef::SetPair
 // Set both elements of the pair,
 // returning logical AND of check for each one.
 //
-    Bool_t part1 = SetPairElement(0, charge1, type1);
-    Bool_t part2 = SetPairElement(1, charge2, type2);
-    
-    return (part1 && part2);
+  Bool_t part1 = SetPairElement(0, charge1, type1);
+  Bool_t part2 = SetPairElement(1, charge2, type2);
+
+  return (part1 && part2);
 }
 
 //_____________________________________________________________________________
@@ -137,10 +141,10 @@ Double_t AliRsnPairDef::ComputeWeight(AliRsnDaughter *d0, AliRsnDaughter *d1)
 // according to the order of appearance in argument list.
 //
 
-    Double_t prob0 = d0->PIDProb()[fType[0]];
-    Double_t prob1 = d1->PIDProb()[fType[1]];
+  Double_t prob0 = d0->PIDProb()[fType[0]];
+  Double_t prob1 = d1->PIDProb()[fType[1]];
 
-    return prob0*prob1;
+  return prob0*prob1;
 }
 
 //_____________________________________________________________________________
@@ -150,12 +154,12 @@ TString AliRsnPairDef::GetPairName()
 // Returns a compact string with the name of the pair,
 // to be used for naming objects related to it.
 //
-    
-    TString sName;
-    sName += AliRsnPID::ParticleName(fType[0]);
-    sName += fCharge[0];
-    sName += AliRsnPID::ParticleName(fType[1]);
-    sName += fCharge[1];
-    
-    return sName;
+
+  TString sName;
+  sName += AliRsnPID::ParticleName(fType[0]);
+  sName += fCharge[0];
+  sName += AliRsnPID::ParticleName(fType[1]);
+  sName += fCharge[1];
+
+  return sName;
 }
index db78cfc4692b6ee0659c307a19b22bfb819a95b5..8e984d41f2ed9f7a67963e9a2061679ce3db1f0d 100644 (file)
@@ -1,71 +1,59 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
 //
-// *** Class AliRsnPairMgr ***
+// Class AliRsnPairMgr
 //
-// TODO
+// A collection of pairs for an analysis.
+// The function of this collection is just for purposes of well-sorting
+// the analyzed pairs into upper-level groups, in the case of a wide
+// analysis containing many resonances at once, or different settings for the same one.
 //
-// authors: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
-//          M. Vala (email: martin.vala@cern.ch)
+// Each PairMgr will result in a separate list of histograms, which
+// can be seen as a folder in the output file, whose name is given by this object.
+//
+// author: M. Vala (email: martin.vala@cern.ch)
 //
 
 #include "AliLog.h"
 
 #include "AliRsnPairMgr.h"
 
-ClassImp ( AliRsnPairMgr )
+ClassImp(AliRsnPairMgr)
 
 //_____________________________________________________________________________
-AliRsnPairMgr::AliRsnPairMgr ( const char*name )
-    : TNamed ( name,name),fPairs(0)
+AliRsnPairMgr::AliRsnPairMgr(const char*name) :
+    TNamed(name,name),
+    fPairs(0)
 {
-//=========================================================
+//
 // Default constructor
-//=========================================================
-
+//
 }
 
 //_____________________________________________________________________________
 AliRsnPairMgr::~AliRsnPairMgr()
 {
-//=========================================================
+//
 // Destructor
-//=========================================================
-
+//
 }
 
 //_____________________________________________________________________________
-void AliRsnPairMgr::AddPair ( AliRsnPair * pair )
+void AliRsnPairMgr::AddPair(AliRsnPair *pair)
 {
-//=========================================================
+//
 // Adds pair
-//=========================================================
+//
 
-  fPairs.Add ( ( AliRsnPair * ) pair );
+  fPairs.Add((AliRsnPair*)pair);
 }
 
 //_____________________________________________________________________________
 void AliRsnPairMgr::PrintPairs()
 {
-//=========================================================
+//
 // Prints all pairs
-//=========================================================
-  AliRsnPair * pair=0;
-  for ( Int_t i=0;i<fPairs.GetEntriesFast() ;i++ )
-  {
-    pair = ( AliRsnPair * ) fPairs.At ( i );
-    pair->Print();
-  }
+//
+
+  AliRsnPair *pair = 0;
+  TObjArrayIter next(&fPairs);
+  while ((pair = (AliRsnPair*)next())) pair->Print();
 }
index 2b02a49fbd42413171592d28da32d70129dff00a..ae07e4d72a8b6477df015066e5752a79d2f8f342 100644 (file)
@@ -1,33 +1,38 @@
 //
-// *** Class AliRsnPairMgr ***
+// Class AliRsnPairMgr
 //
-// TODO
+// A collection of pairs for an analysis.
+// The function of this collection is just for purposes of well-sorting
+// the analyzed pairs into upper-level groups, in the case of a wide
+// analysis containing many resonances at once, or different settings for the same one.
 //
-// authors: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
-//          M. Vala (email: martin.vala@cern.ch)
+// Each PairMgr will result in a separate list of histograms, which
+// can be seen as a folder in the output file, whose name is given by this object.
+//
+// author: M. Vala (email: martin.vala@cern.ch)
 //
 
-#ifndef ALIRSNMVPAIRMGR_H
-#define ALIRSNMVPAIRMGR_H
+#ifndef ALIRSNPAIRMGR_H
+#define ALIRSNPAIRMGR_H
 
 #include "AliRsnPair.h"
 
 class AliRsnPairMgr : public TNamed
 {
   public:
-    AliRsnPairMgr(const char*name="default");
 
+    AliRsnPairMgr(const char*name = "default");
     ~AliRsnPairMgr();
 
-    void          AddPair ( AliRsnPair *pair );
-    TObjArray     *GetPairs() { return &fPairs; }
-    void          PrintPairs();
+    void       AddPair(AliRsnPair *pair);
+    TObjArray *GetPairs() { return &fPairs; }
+    void       PrintPairs();
 
   private:
 
-    TObjArray       fPairs;                 // array of pairs
-    
-    ClassDef ( AliRsnPairMgr, 1 )
+    TObjArray  fPairs;  // array of pairs
+
+    ClassDef(AliRsnPairMgr, 1)
 };
 
 #endif
index 8dc04936d9a61955c23e9fcd1605019d52862f52..8b593451df3d8301df7ce87490c2d32b197337a1 100644 (file)
@@ -1,27 +1,13 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
 //
 // Class AliRsnPairParticle
 //
 // Implementation of a pair of tracks, for several purposes
 // - computing the total 4-momentum & inv. mass for output histos filling
 // - evaluating cut checks on the pair of particles
+// - evaluating any kind of kinematic value over their sum
 //
-// author: Martin Vala (martin.vala@cern.ch)
-// revised by: Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
+// authors: Martin Vala (martin.vala@cern.ch)
+//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
 //
 
 #include "AliLog.h"
@@ -134,7 +120,7 @@ Double_t AliRsnPairParticle::GetInvMass(Double_t mass0, Double_t mass1)
 // Mass in argument #1 is assigned to first track in the pair (fDaughter[0]),
 // mass in argument #2 is assigned to second track in the pair (fDaughter[1])
 // Then, the invariant mass of the pair is computed by using their total momentum
-// and the sum of their energies as they result from assigned masses.
+// and the sum of their energies computed after assigned masses.
 //
 
   if (!fDaughter[0] || !fDaughter[1])
@@ -160,7 +146,7 @@ Double_t AliRsnPairParticle::GetInvMassMC(Double_t mass0, Double_t mass1)
 // Mass in argument #1 is assigned to first track in the pair (fDaughter[0]),
 // mass in argument #2 is assigned to second track in the pair (fDaughter[1])
 // Then, the invariant mass of the pair is computed by using their total momentum
-// and the sum of their energies as they result from assigned masses.
+// and the sum of their energies.
 //
 
   if (!fDaughter[0] || !fDaughter[1])
@@ -180,7 +166,7 @@ Double_t AliRsnPairParticle::GetInvMassMC(Double_t mass0, Double_t mass1)
   etot += fDaughter[1]->GetMCInfo()->E(mass1);
 
   // compute & return invariant mass
-  return  TMath::Sqrt(etot * etot - GetP2());
+  return  TMath::Sqrt(etot * etot - GetP2MC());
 }
 
 //_____________________________________________________________________________
@@ -190,11 +176,12 @@ Double_t AliRsnPairParticle::GetEtot(Double_t mass0, Double_t mass1) const
 // Compute total pair energy from the sum of single track energies
 // with a necessary mass hypothesis (rec. values).
 //
-    Double_t etot = 0.0;
-    etot += fDaughter[0]->E(mass0);
-    etot += fDaughter[1]->E(mass1);
-    
-    return etot;
+
+  Double_t etot = 0.0;
+  etot += fDaughter[0]->E(mass0);
+  etot += fDaughter[1]->E(mass1);
+
+  return etot;
 }
 
 //_____________________________________________________________________________
@@ -204,11 +191,11 @@ Double_t AliRsnPairParticle::GetEtotMC(Double_t mass0, Double_t mass1) const
 // Compute total pair energy from the sum of single track energies
 // with a necessary mass hypothesis (MC values).
 //
-    Double_t etot = 0.0;
-    etot += fDaughter[0]->GetMCInfo()->E(mass0);
-    etot += fDaughter[1]->GetMCInfo()->E(mass1);
-    
-    return etot;
+  Double_t etot = 0.0;
+  etot += fDaughter[0]->GetMCInfo()->E(mass0);
+  etot += fDaughter[1]->GetMCInfo()->E(mass1);
+
+  return etot;
 }
 
 //_____________________________________________________________________________
@@ -298,6 +285,38 @@ void AliRsnPairParticle::SetPair(AliRsnDaughter *daughter1, AliRsnDaughter *daug
   for (i = 0; i < 3; i++) fPTot[i] = fPTrack[0][i] + fPTrack[1][i];
 }
 
+//_____________________________________________________________________________
+void AliRsnPairParticle::ResetPair()
+{
+//
+// Computes the total momentum for REC data and MC if available
+//
+
+  Int_t i;
+
+  // copy MC info (if available)
+  if (fDaughter[0]->GetMCInfo() && fDaughter[1]->GetMCInfo())
+  {
+    for (i = 0; i < 2; i++)
+    {
+      fPTrackMC[i][0] = fDaughter[i]->GetMCInfo()->Px();
+      fPTrackMC[i][1] = fDaughter[i]->GetMCInfo()->Py();
+      fPTrackMC[i][2] = fDaughter[i]->GetMCInfo()->Pz();
+      fMotherPDG[i] = fDaughter[i]->GetMCInfo()->MotherPDG();
+    }
+    for (i = 0; i < 3; i++) fPTotMC[i] = fPTrackMC[0][i] + fPTrackMC[1][i];
+  }
+
+  // copy reconstructed info (always available)
+  for (i = 0; i < 2; i++)
+  {
+    fPTrack[i][0] = fDaughter[i]->Px();
+    fPTrack[i][1] = fDaughter[i]->Py();
+    fPTrack[i][2] = fDaughter[i]->Pz();
+  }
+  for (i = 0; i < 3; i++) fPTot[i] = fPTrack[0][i] + fPTrack[1][i];
+}
+
 //_____________________________________________________________________________
 void AliRsnPairParticle::PrintInfo(const Option_t *option)
 {
index 07753220e9ac8bdecd91b38f0420fe70a1d0df08..f82dae8a3b9c9abd55e04d0bed4108531b1ce619 100644 (file)
@@ -1,17 +1,13 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               *
- **************************************************************************/
-
 //
 // Class AliRsnPairParticle
 //
 // Implementation of a pair of tracks, for several purposes
 // - computing the total 4-momentum & inv. mass for output histos filling
 // - evaluating cut checks on the pair of particles
+// - evaluating any kind of kinematic value over their sum
 //
-// author: Martin Vala (martin.vala@cern.ch)
-// revised by: Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
+// authors: Martin Vala (martin.vala@cern.ch)
+//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
 //
 
 #ifndef ALIRSNPAIRPARTICLE_H
@@ -43,7 +39,8 @@ class AliRsnPairParticle : public TObject
     Double_t          GetPz() const {return fPTot[2];}
     Double_t          GetPt() const {return TMath::Sqrt(GetPt2());}
     Double_t          GetPhi() const {return TMath::Pi() + TMath::ATan2(-fPTot[1], -fPTot[0]);}
-    Double_t          GetTheta() const {if(fPTot[2]==0.0){return TMath::PiOver2();}else{return TMath::ACos(fPTot[2]/GetP());}}
+    Double_t          GetTheta() const {if (fPTot[2]==0.0){return TMath::PiOver2();}
+      else{return TMath::ACos(fPTot[2]/GetP());}}
     Double_t          GetEta() const {return -TMath::Log(TMath::ATan(0.5*GetTheta()));}
     Double_t          GetY(Double_t m1, Double_t m2) const {return 0.5*TMath::Log((GetEtot(m1,m2)+fPTot[2])/(GetEtot(m1,m2)-fPTot[2]));}
 
@@ -56,7 +53,8 @@ class AliRsnPairParticle : public TObject
     Double_t          GetPzMC() const {return fPTotMC[2];}
     Double_t          GetPtMC() const {return TMath::Sqrt(GetPt2MC());}
     Double_t          GetPhiMC() const {return TMath::Pi() + TMath::ATan2(-fPTotMC[1], -fPTotMC[0]);}
-    Double_t          GetThetaMC() const {if(fPTotMC[2]==0.0){return TMath::PiOver2();}else{return TMath::ACos(fPTotMC[2]/GetPMC());}}
+    Double_t          GetThetaMC() const {if (fPTotMC[2]==0.0){return TMath::PiOver2();}
+      else{return TMath::ACos(fPTotMC[2]/GetPMC());}}
     Double_t          GetEtaMC() const {return -TMath::Log(TMath::ATan(0.5*GetThetaMC()));}
     Double_t          GetYMC(Double_t m1, Double_t m2) const {return 0.5*TMath::Log((GetEtotMC(m1,m2)+fPTotMC[2])/(GetEtotMC(m1,m2)-fPTotMC[2]));}
 
@@ -69,6 +67,7 @@ class AliRsnPairParticle : public TObject
     Bool_t            IsTruePair(Int_t refPDG = 0);
 
     void              SetPair(AliRsnDaughter *daughter1, AliRsnDaughter *daughter2);
+    void              ResetPair();
     void              PrintInfo(const Option_t *option = "");
 
   private:
index c4c128f4eb991aaecdc3f58fc38e69d4266b1b36..e3893858151e289c511e15a5683354500a8f5675 100644 (file)
@@ -55,7 +55,10 @@ AliRsnReader::AliRsnReader(AliRsnPIDWeightsMgr *mgr) :
     fPIDDivValue(0.0),
     fITSClusters(0),
     fTPCClusters(0),
-    fTRDClusters(0)
+    fTRDClusters(0),
+    fTrackRefs(0),
+    fTrackRefsITS(0),
+    fTrackRefsTPC(0)
 {
 //
 // Constructor.
@@ -164,9 +167,18 @@ Bool_t AliRsnReader::FillFromESD
     }
     else
     {
-        vertex[0] = esd->GetPrimaryVertexTPC()->GetXv();
-        vertex[1] = esd->GetPrimaryVertexTPC()->GetYv();
-        vertex[2] = esd->GetPrimaryVertexTPC()->GetZv();
+        // when taking vertex from ESD event there are two options:
+        // if a vertex with tracks was successfully reconstructed, 
+        // it is used for computing DCA;
+        // otherwise, the one computed with SPD is used.
+        // This is known from the "Status" parameter of the vertex itself.
+        const AliESDVertex *v = esd->GetPrimaryVertex();
+        if (!v->GetStatus()) v = esd->GetPrimaryVertexSPD();
+        
+        // get primary vertex
+        vertex[0] = (Double_t)v->GetXv();
+        vertex[1] = (Double_t)v->GetYv();
+        vertex[2] = (Double_t)v->GetZv();
     }
     rsn->SetPrimaryVertex(vertex[0], vertex[1], vertex[2]);
 
@@ -242,12 +254,14 @@ Bool_t AliRsnReader::FillFromESD
         // set index and label and add this object to the output container
         temp.SetIndex(index);
         temp.SetLabel(label);
+        temp.ShiftZero(vertex[0], vertex[1], vertex[2]);
         AliRsnDaughter *ptr = rsn->AddTrack(temp);
         // if problems occurred while storing, that pointer is NULL
         if (!ptr) AliWarning(Form("Failed storing track#%d", index));
     }
 
     // compute total multiplicity
+    rsn->MakeComputations();
     if (rsn->GetMultiplicity() <= 0)
     {
         AliDebug(1, "Zero Multiplicity in this event");
@@ -330,6 +344,7 @@ Bool_t AliRsnReader::FillFromAOD(AliRsnEvent *rsn, AliAODEvent *aod, AliMCEvent
     }
 
     // compute total multiplicity
+    rsn->MakeComputations();
     if (rsn->GetMultiplicity() <= 0)
     {
         AliDebug(1, "Zero multiplicity in this event");
@@ -372,15 +387,34 @@ Bool_t AliRsnReader::FillFromMC(AliRsnEvent *rsn, AliMCEvent *mc)
     rsn->SetPrimaryVertex(vertex[0], vertex[1], vertex[2]);
 
     // store tracks from MC
-    Int_t    index, labmum;
+    Int_t    i, index, labmum, nHitsITS, nHitsTPC, nRef;
     Bool_t check;
     AliRsnDaughter temp;
     for (index = 0; index < ntracks; index++)
     {
         // get and check MC track
         AliMCParticle *mcTrack = mc->GetTrack(index);
-        // if particle has no track references, it is rejected
-        if (mcTrack->GetNumberOfTrackReferences() <= 0) continue;
+        // check particle track references
+        nRef = mcTrack->GetNumberOfTrackReferences();
+        if (fTrackRefs > 0 && nRef < fTrackRefs) continue;
+        else if (fTrackRefsITS > 0 || fTrackRefsTPC > 0)
+        {
+          nHitsITS = nHitsTPC = 0;
+          for (i = 0; i < nRef; i++) {
+            AliTrackReference *trackRef = mcTrack->GetTrackReference(i);
+            if(trackRef)
+            {
+              Int_t detectorId = trackRef->DetectorId();
+              switch(detectorId) {
+                case AliTrackReference::kITS  : nHitsITS++  ; break ;
+                case AliTrackReference::kTPC  : nHitsTPC++  ; break ;
+                default : break ;
+              }
+            }
+          }
+          if (fTrackRefsITS > 0 && nHitsITS < fTrackRefsITS) continue;
+          if (fTrackRefsTPC > 0 && nHitsTPC < fTrackRefsTPC) continue;
+        }
         // try to insert in the RsnDaughter its data
         check = temp.Adopt(mcTrack);
         if (!check) continue;
@@ -399,6 +433,7 @@ Bool_t AliRsnReader::FillFromMC(AliRsnEvent *rsn, AliMCEvent *mc)
     }
 
     // compute total multiplicity
+    rsn->MakeComputations();
     if (rsn->GetMultiplicity() <= 0)
     {
         AliDebug(1, "Zero multiplicity in this event");
index 070eecd5686c6c40b7c3b95ec6c04b212e2a8f23..62133738cd88a37c837bf2ba98384b6e27ce2274 100644 (file)
@@ -52,6 +52,11 @@ class AliRsnReader : public TNamed
     // sets PID TYPE
     void SetPIDtype(const AliRsnDaughter::EPIDType& theValue = AliRsnDaughter::kEsd, Double_t divValue = 0.0);
     AliRsnDaughter::EPIDType GetPIDtype() const { return fCurrentPIDtype; }
+    
+    // set limits in track references
+    void SetTrackRefs(Int_t value) {fTrackRefs = value;}
+    void SetTrackRefsITS(Int_t value) {fTrackRefsITS = value;}
+    void SetTrackRefsTPC(Int_t value) {fTrackRefsTPC = value;}
 
     // sets Sectors cut
     void SetITSTPCTRDSectors(const Int_t& its = -1, const Int_t& tpc = -1, const Int_t& trd = -1);
@@ -73,6 +78,10 @@ class AliRsnReader : public TNamed
     Int_t                     fITSClusters;    //
     Int_t                     fTPCClusters;    //
     Int_t                     fTRDClusters;    //
+    Int_t                     fTrackRefs;      // minimum required track references for MC reading
+    Int_t                     fTrackRefsITS;   // minimum required track references for MC reading (ITS)
+    Int_t                     fTrackRefsTPC;   // minimum required track references for MC reading (TPC)
+    
 
   private:
 
index 208baf4a4469288de37b061b03e5c13639145853..eba1c7736ee98c440715c15fb5832b1060c1ef3c 100644 (file)
@@ -28,7 +28,7 @@ ClassImp(AliRsnReaderTask)
 
 //_____________________________________________________________________________
 AliRsnReaderTask::AliRsnReaderTask() :
-    AliRsnBaseAT(),
+    AliRsnAnalysisTaskBase(),
     fRsnTree(0x0)
 {
 //=========================================================
@@ -38,7 +38,7 @@ AliRsnReaderTask::AliRsnReaderTask() :
 
 //_____________________________________________________________________________
 AliRsnReaderTask::AliRsnReaderTask(const char *name) :
-    AliRsnBaseAT(name),
+    AliRsnAnalysisTaskBase(name),
     fRsnTree(0x0)
 {
 //=========================================================
@@ -50,7 +50,7 @@ AliRsnReaderTask::AliRsnReaderTask(const char *name) :
 
 //_____________________________________________________________________________
 AliRsnReaderTask::AliRsnReaderTask(const AliRsnReaderTask& obj) :
-    AliRsnBaseAT(obj),
+    AliRsnAnalysisTaskBase(obj),
     fRsnTree(0x0)
 {
 //=========================================================
@@ -76,7 +76,7 @@ void AliRsnReaderTask::InitIOVars()
 // Init values for input and output data
 //=========================================================
   AliDebug(AliLog::kDebug, "<-");
-  AliRsnBaseAT::InitIOVars();
+  AliRsnAnalysisTaskBase::InitIOVars();
   AliDebug(AliLog::kDebug, "->");
 }
 
index 68f787e9c3180154d93eb0c188251614f88ac368..5a837b750cb3620e3e234883f85f8ebe62c5506e 100644 (file)
@@ -9,12 +9,12 @@
 #ifndef ALIRSNREADERTASK_H
 #define ALIRSNREADERTASK_H
 
-#include "AliRsnBaseAT.h"
+#include "AliRsnAnalysisTaskBase.h"
 
 class AliRsnPID;
 class AliRsnReader;
 
-class AliRsnReaderTask : public AliRsnBaseAT
+class AliRsnReaderTask : public AliRsnAnalysisTaskBase
 {
   public:
 
index 7e2b1ba8f9682292f6f4b6ae153bb6268f41a434..7f976ca9d10568f2b3a5776f8e5573ee859ad53e 100644 (file)
@@ -93,31 +93,31 @@ void AliRsnReaderTaskSE::UserExec(Option_t */*option*/)
   // step 1: conversion
   Bool_t ok = kFALSE;
   switch (fInputType[0])
-    {
-        case kAOD: 
-            AliDebug(5, "Reading AOD event...");
-            ok = fReader.FillFromAOD(fRsnEvent, (AliAODEvent*)fInputEvent, fMCEvent);
-            AliDebug(5, "...done");
-            break;
-        case kESD: 
-            AliDebug(5, "Reading ESD event...");
-            ok = fReader.FillFromESD(fRsnEvent, (AliESDEvent*)fInputEvent, fMCEvent);
-            AliDebug(5, "...done");
-            break;
-        case kESDMC:
-            AliDebug(5, "Reading ESD event with MC...");
-            ok = fReader.FillFromESD(fRsnEvent, (AliESDEvent*)fInputEvent, fMCEvent);
-            AliDebug(5, "...done");
-            break;
-        case kMC: 
-            AliDebug(5, "Reading MC only event...");
-            ok = fReader.FillFromMC(fRsnEvent, fMCEvent);
-            AliDebug(5, "...done");
-            break;
-        default:
-            AliError("Type not supported ...");
-            return;
-    }
+  {
+    case kAOD:
+      AliDebug(5, "Reading AOD event...");
+      ok = fReader.FillFromAOD(fRsnEvent, (AliAODEvent*)fInputEvent, fMCEvent);
+      AliDebug(5, "...done");
+      break;
+    case kESD:
+      AliDebug(5, "Reading ESD event...");
+      ok = fReader.FillFromESD(fRsnEvent, (AliESDEvent*)fInputEvent, fMCEvent);
+      AliDebug(5, "...done");
+      break;
+    case kESDMC:
+      AliDebug(5, "Reading ESD event with MC...");
+      ok = fReader.FillFromESD(fRsnEvent, (AliESDEvent*)fInputEvent, fMCEvent);
+      AliDebug(5, "...done");
+      break;
+    case kMC:
+      AliDebug(5, "Reading MC only event...");
+      ok = fReader.FillFromMC(fRsnEvent, fMCEvent);
+      AliDebug(5, "...done");
+      break;
+    default:
+      AliError("Type not supported ...");
+      return;
+  }
   if (!ok) AliWarning("Failed reading");
 
   // step 2: PID probability computation
index 9cb0e0dc4696ab178233eb4fe01eb8207fdbf7e9..0fa9613bc547cc725d7b0c1abee64799abc018fe 100644 (file)
@@ -21,7 +21,7 @@ class AliRsnReader;
 
 class AliRsnReaderTaskSE : public AliRsnAnalysisTaskSEBase
 {
-public:
+  public:
 
     AliRsnReaderTaskSE();
     AliRsnReaderTaskSE(const char *name);
@@ -40,12 +40,12 @@ public:
 //     AliRsnPID*    GetPID() {return fPID;}
     AliRsnEvent*  GetCurrentEvent() {return fRsnEvent;}
 
-private:
+  private:
 
     AliRsnReaderTaskSE(const AliRsnReaderTaskSE &copy) :
-      AliRsnAnalysisTaskSEBase(copy),fRsnEvent(0x0) { /*nothing*/ }
+        AliRsnAnalysisTaskSEBase(copy),fRsnEvent(0x0) { /*nothing*/ }
     AliRsnReaderTaskSE& operator=(const AliRsnReaderTaskSE&)
-      { /*nothing*/ return (*this); }
+    { /*nothing*/ return (*this); }
 
     AliRsnEvent  *fRsnEvent;   // output events in the AliRsnEvent format