Added AliRsnAction, fix for AliRsnPIDRange, lego_train macros updated
authorfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Mar 2012 17:45:00 +0000 (17:45 +0000)
committerfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Mar 2012 17:45:00 +0000 (17:45 +0000)
14 files changed:
PWGLF/CMakelibPWGLFresonances.pkg
PWGLF/Makefile
PWGLF/PROOF-INF.PWGLFresonances/BUILD.sh
PWGLF/PWGLFresonancesLinkDef.h
PWGLF/RESONANCES/AliRsnAnalysisTask.cxx
PWGLF/RESONANCES/AliRsnCutPIDNSigma.cxx
PWGLF/RESONANCES/AliRsnCutPIDNSigma.h
PWGLF/RESONANCES/AliRsnDaughterSelector.cxx
PWGLF/RESONANCES/AliRsnDaughterSelector.h
PWGLF/RESONANCES/AliRsnInputHandler.cxx
PWGLF/RESONANCES/macros/lego_train/AddAMRsn.C
PWGLF/RESONANCES/macros/lego_train/README
PWGLF/RESONANCES/macros/lego_train/RsnConfig.C
PWGLF/RESONANCES/macros/lego_train/RsnManager.C

index 24ae420..3117877 100644 (file)
@@ -33,6 +33,7 @@ set ( SRCS RESONANCES/AliRsnDaughter.cxx
            RESONANCES/AliRsnPairDef.cxx
            RESONANCES/AliRsnTarget.cxx
            RESONANCES/AliRsnValue.cxx
+           RESONANCES/AliRsnAction.cxx
            RESONANCES/AliRsnCut.cxx
            RESONANCES/AliRsnValueDaughter.cxx
            RESONANCES/AliRsnValuePair.cxx
@@ -45,6 +46,7 @@ set ( SRCS RESONANCES/AliRsnDaughter.cxx
            RESONANCES/AliRsnCutPIDITS.cxx
            RESONANCES/AliRsnCutPIDTPC.cxx
            RESONANCES/AliRsnCutPIDTOF.cxx
+           RESONANCES/AliRsnPIDRange.cxx
            RESONANCES/AliRsnCutPIDNSigma.cxx
            RESONANCES/AliRsnCutMomentumComparison.cxx
            RESONANCES/AliRsnCutKaonForPhi2010.cxx
@@ -89,4 +91,8 @@ set ( DHDR PWGLFresonancesLinkDef.h)
 
 set ( EXPORT )
 
-set ( EINCLUDE  PYTHIA6 PWGLF/RESONANCES CORRFW ANALYSIS/EventMixing STEER/AOD STEER/ESD STEER/STEERBase)
+set ( EINCLUDE  PYTHIA6 PWGLF/RESONANCES CORRFW ANALYSIS/EventMixing STEER/AOD STEER/ESD STEER/STEERBase ${EXTRA_INCLUDE})
+
+set ( PARINCLUDE PWGLF/RESONANCES )
+set ( EXPORT ${HDRS})
+set ( EXPORT ${HDRS})
index d50b74d..9241597 100644 (file)
@@ -1,81 +1,60 @@
-# $Id: Makefile 53653 2011-12-16 10:05:45Z cholm $
+# $Id: Makefile 50266 2011-06-24 09:37:46Z pulvir $
 
-include Makefile.arch
+include $(ROOTSYS)/etc/Makefile.arch
 
-PACKAGE = PWGLFresonances
+PACKAGE = PWGLFresonancesdev
 
 default-target: lib$(PACKAGE).so 
 
-ALICEINC      = -I. -I$(ALICE_ROOT)/TOF -I$(ALICE_ROOT)/ANALYSIS/EventMixing -I$(ALICE_ROOT)/PWGUD/base
+ALICEINC      = -I.
+
+ifeq ($(PACKAGE),PWGLFresonances)
+  ALICEINC      += -IRESONANCES
+endif
+
+ifeq ($(PACKAGE),PWGLFresonancesdev)
+  ALICEINC      += -IRESONANCES_DEV
+endif
 
 ### define include dir for local case and par case
-ifneq ($(ESD_INCLUDE),)
+ifneq ($(STEERBase_INCLUDE),)
+   ALICEINC += -I../$(STEERBase_INCLUDE)
    ALICEINC += -I../$(ESD_INCLUDE)
    ALICEINC += -I../$(AOD_INCLUDE)
-   ALICEINC += -I../$(STEERBase_INCLUDE)
-   ALICEINC += -I../$(OADB_INCLUDE)
    ALICEINC += -I../$(ANALYSIS_INCLUDE)
    ALICEINC += -I../$(ANALYSISalice_INCLUDE)
- else
-    ifneq ($(ALICE_ROOT),)
-       ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PWGLF
-     endif
-endif
-
-ifneq ($(PWGLFresonances_INCLUDE),)
-  ALICEINC += -I../$(PWGLFresonances_INCLUDE)
- else
-    ifneq ($(ALICE_ROOT),)
-       ALICEINC += -I$(ALICE_ROOT)/PWGLF/RESONANCES
-     endif
-endif
-
-ifneq ($(PWGLFSTRANGENESS_INCLUDE),)
-  ALICEINC += -I../$(PWGLFSTRANGENESS_INCLUDE)
- else
-    ifneq ($(ALICE_ROOT),)
-       ALICEINC += -I$(ALICE_ROOT)/PWGLF/STRANGENESS
-     endif
-endif
-
-ifneq ($(PWGLFtotEt_INCLUDE),)
-  ALICEINC += -I../$(PWGLFtotEt_INCLUDE)
- else
-    ifneq ($(ALICE_ROOT),)
-       ALICEINC += -I$(ALICE_ROOT)/PWGLF/totEt
-     endif
+else
+   ifneq ($(ALICE_ROOT),)
+      ALICEINC += -I$(ALICE_ROOT)/include
+   endif
 endif
 
-ifneq ($(PWGLFforward_INCLUDE),)
-  ALICEINC += -I../$(PWGLFforward_INCLUDE)
- else
-    ifneq ($(ALICE_ROOT),)
-       ALICEINC += -I$(ALICE_ROOT)/PWGLF/FORWARD/analysis
-     endif
+ifneq ($(CORRFW_INCLUDE),)
+   ALICEINC += -I../$(CORRFW_INCLUDE)
 endif
 
-ifneq ($(PWGLFforward2_INCLUDE),)
-  ALICEINC += -I../$(PWGLFforward2_INCLUDE)
- else
-    ifneq ($(ALICE_ROOT),)
-       ALICEINC += -I$(ALICE_ROOT)/PWGLF/FORWARD/analysis2
-     endif
+ifneq ($(PWGLFresonances_INCLUDE),)
+   ALICEINC += -I../$(PWGLFresonances_INCLUDE)
+else
+   ifneq ($(ALICE_ROOT),)
+      ALICEINC += -I$(ALICE_ROOT)/PWGLF -I$(ALICE_ROOT)/PWGLF/RESONANCES
+   endif
 endif
 
-ifneq ($(OADB_INCLUDE), )
-  ALICEINC += -I../$(OADB_INCLUDE)
+ifneq ($(PWGLFresonancesdev_INCLUDE),)
+   ALICEINC += -I../$(PWGLFresonancesdev_INCLUDE)
 else
-  ifneq ($(ALICE_ROOT),)
-    ALICEINC += -I$(ALICE_ROOT)/OADB
-  endif
+   ifneq ($(ALICE_ROOT),)
+      ALICEINC += -I$(ALICE_ROOT)/PWGLF -I$(ALICE_ROOT)/PWGLF/RESONANCES_DEV
+   endif
 endif
 
 # only if no par file was loaded before
-#ifeq ($(ALICEINC),-I.)
+ifeq ($(ALICEINC),-I.)
   ifneq ($(ALICE_ROOT),)
     ALICEINC += -I$(ALICE_ROOT)/include
   endif
-#endif
+endif
 
 ifneq ($(EINCLUDE),)
   ALICEINC += $(EINCLUDE:%=-I$(ALICE_ROOT)/%)
@@ -84,23 +63,44 @@ endif
 CXXFLAGS     += $(ALICEINC) -g
 F77FLAGS     += $(ALICEINC) -g -fPIC
 
-DHDR =
-HDRS =
-SRCS =
-FSRCS =
+DHDR = 
+HDRS = 
+SRCS = 
+FSRCS = 
 
-DHDR_PWGLF := $(DHDR)
-HDRS_PWGLF := $(HDRS)
-SRCS_PWGLF := $(SRCS) G__$(PACKAGE).cxx
-FSCRS_PWGLF := $(FSRCS)
-OBJS_PWGLF := $(SRCS_PWGLF:.cxx=.o) $(FSRCS:.F=.o)
+DHDR_PWG2 := $(DHDR)
+HDRS_PWG2 := $(HDRS)
+SRCS_PWG2 := $(SRCS) G__$(PACKAGE).cxx
+FSCRS_PWG2 := $(FSRCS)
+OBJS_PWG2 := $(SRCS_PWG2:.cxx=.o) $(FSRCS:.F=.o)
 
 PARFILE       = $(PACKAGE).par
 
-lib$(PACKAGE).so: $(OBJS_PWGLF)
+lib$(PACKAGE).so: $(OBJS_PWG2)
        @echo "Linking" $@ ...
        @/bin/rm -f $@
-       $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
+ifeq ($(PLATFORM),macosx)
+# We need to make both the .dylib and the .so
+               $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@
+ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
+ifeq ($(MACOSX_MINOR),4)
+               ln -sf $@ $(subst .$(DllSuf),.so,$@)
+else
+               $(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
+                  $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
+endif
+endif
+else
+ifeq ($(PLATFORM),win32)
+               bindexplib $* $^ > $*.def
+               lib -nologo -MACHINE:IX86 $^ -def:$*.def \
+                  $(OutPutOpt)$(EVENTLIB)
+               $(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
+                  $(OutPutOpt)$@
+else
+               $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
+endif
+endif
        @chmod a+x $@
        @echo "done"
 
@@ -113,16 +113,16 @@ lib$(PACKAGE).so: $(OBJS_PWGLF)
 G__$(PACKAGE).h:G__$(PACKAGE).cxx
        @if test -f $@ ; then : ; else rm -f $< ; $(MAKE) $@ ; fi
 
-G__$(PACKAGE).cxx: $(HDRS_PWGLF) $(DHDR_PWGLF)
+G__$(PACKAGE).cxx: $(HDRS_PWG2) $(DHDR_PWG2)
        @echo "Generating dictionary ..."
        rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
 
 clean:
-       @rm -f $(OBJS_PWGLF) *.so G__$(PACKAGE).* $(PARFILE)
+       @rm -f $(OBJS_PWG2) *.so G__$(PACKAGE).* $(PARFILE)
 
 ### CREATE PAR FILE
 
-$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWGLF) $(SRCS_PWGLF) $(DHDR_PWGLF) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
+$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG2) $(SRCS_PWG2) $(DHDR_PWG2) Makefile Makefile.arch PROOF-INF))
        @echo "Creating archive" $@ ...
        @tar cfzh $@ $(PACKAGE)
        @rm -rf $(PACKAGE)
index 3633fa5..a4a544b 100755 (executable)
@@ -1,5 +1,3 @@
 #! /bin/sh
 
-touch libPWGLFresonances.pkg
-
-make libPWGLFresonances.so
+make
index 2925206..355fd64 100644 (file)
@@ -9,6 +9,8 @@
 
 #pragma link C++ class AliRsnTarget+;
 #pragma link C++ class AliRsnValue+;
+#pragma link C++ class AliRsnAction+;
+
 #pragma link C++ class AliRsnCut+;
 
 #pragma link C++ class AliRsnValueDaughter+;
@@ -23,7 +25,7 @@
 #pragma link C++ class AliRsnCutPIDITS+;
 #pragma link C++ class AliRsnCutPIDTPC+;
 #pragma link C++ class AliRsnCutPIDTOF+;
-#pragma link C++ class AliRsnCutPIDNSigma::AliRsnPIDRange+;
+#pragma link C++ class AliRsnPIDRange+;
 #pragma link C++ class AliRsnCutPIDNSigma+;
 #pragma link C++ class AliRsnCutMomentumComparison+;
 #pragma link C++ class AliRsnCutKaonForPhi2010+;
index a08718e..ad70de1 100644 (file)
@@ -132,13 +132,18 @@ void AliRsnAnalysisTask::UserCreateOutputObjects()
    if (fInputEHMain) {
       TObjArrayIter nextIH(fInputEHMain->InputEventHandlers());
       TObject *obj = 0x0;
+      AliRsnInputHandler *rsnIH;
+      AliRsnDaughterSelector *s;
+      TClonesArray *c;
+      AliRsnCutSet *cuts;
       while ( (obj = nextIH()) ) {
          if (obj->IsA() == AliRsnInputHandler::Class()) {
-            AliRsnInputHandler *rsnIH = (AliRsnInputHandler *) obj;
-            AliRsnDaughterSelector *s = rsnIH->GetSelector();
-            TClonesArray *c = s->GetCutSetC();
+            rsnIH = (AliRsnInputHandler *) obj;
+            s = rsnIH->GetSelector();
+            s->InitActions(fOutput);
+            c = s->GetCutSetC();
             for (Int_t is = 0; is < c->GetEntries(); is++) {
-               AliRsnCutSet *cuts = (AliRsnCutSet *)c->At(is);
+               cuts = (AliRsnCutSet *)c->At(is);
                cuts->Init(fOutput);
             }
          }
index 9eb63e2..3213317 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "AliRsnCutPIDNSigma.h"
 
-ClassImp(AliRsnCutPIDNSigma::AliRsnPIDRange)
 ClassImp(AliRsnCutPIDNSigma)
 
 //_________________________________________________________________________________________________
@@ -34,7 +33,7 @@ AliRsnCutPIDNSigma::AliRsnCutPIDNSigma() :
    fTrackNSigma(0.0),
    fTrackMom(0.0),
    fMyPID(0x0),
-   fRanges("AliRsnCutPIDNSigma::AliRsnPIDRange", 0)
+   fRanges("AliRsnPIDRange", 0)
 {
 //
 // Main constructor.
@@ -51,7 +50,7 @@ AliRsnCutPIDNSigma::AliRsnCutPIDNSigma
    fTrackNSigma(0.0),
    fTrackMom(0.0),
    fMyPID(0x0),
-   fRanges("AliRsnCutPIDNSigma::AliRsnPIDRange", 0)
+   fRanges("AliRsnPIDRange", 0)
 {
 //
 // Main constructor.
index 682de29..94cfd40 100644 (file)
@@ -18,6 +18,7 @@
 #include "AliESDtrack.h"
 
 #include "AliRsnCut.h"
+#include "AliRsnPIDRange.h"
 
 class AliVTrack;
 class AliPIDResponse;
@@ -31,32 +32,6 @@ public:
       kTOF,
       kDetectors
    };
-
-   //
-   // This allows to define several intervals
-   //
-   class AliRsnPIDRange : public TObject {
-   public:
-
-      AliRsnPIDRange(Double_t nsigma, Double_t pmin, Double_t pmax)
-         : fPMin(pmin), fPMax(pmax), fNSigmaCut(nsigma) { }
-
-      Double_t &PMin()      {return fPMin;}
-      Double_t &PMax()      {return fPMax;}
-      Double_t &NSigmaCut() {return fNSigmaCut;}
-
-      Bool_t IsInRange(Double_t mom)  {return (mom >= fPMin && mom <= fPMax);}
-      Bool_t CutPass(Double_t nsigma) {return (nsigma <= fNSigmaCut);}
-
-   private:
-
-      Double_t fPMin;      // lower bound of momentum range
-      Double_t fPMax;      // upper bound of momentum range
-      Double_t fNSigmaCut; // cut in number of sigmas
-
-      ClassDef(AliRsnCutPIDNSigma::AliRsnPIDRange,1)
-   };
-
    AliRsnCutPIDNSigma();
    AliRsnCutPIDNSigma(const char *name, AliPID::EParticleType species, EDetector det);
    AliRsnCutPIDNSigma(const AliRsnCutPIDNSigma &copy);
index b8e9d52..3fe7015 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "AliRsnCutSet.h"
 #include "AliRsnDaughterDef.h"
+#include "AliRsnAction.h"
 
 #include "AliRsnDaughterSelector.h"
 
@@ -18,7 +19,8 @@ AliRsnDaughterSelector::AliRsnDaughterSelector(const char *name, const char *tit
    fEntryListsN("TEntryList", 0),
    fEntryListsP("TEntryList", 0),
    fEntryListsM("TEntryList", 0),
-   fUseLabelCheck(kTRUE)
+   fUseLabelCheck(kTRUE),
+   fActions()
 {
 //
 // Default constructor.
@@ -36,7 +38,8 @@ AliRsnDaughterSelector::AliRsnDaughterSelector(const AliRsnDaughterSelector &cop
    fEntryListsN(copy.fEntryListsN),
    fEntryListsP(copy.fEntryListsP),
    fEntryListsM(copy.fEntryListsM),
-   fUseLabelCheck(copy.fUseLabelCheck)
+   fUseLabelCheck(copy.fUseLabelCheck),
+   fActions(copy.fActions)
 {
 //
 // Copy constructor.
@@ -64,6 +67,7 @@ AliRsnDaughterSelector &AliRsnDaughterSelector::operator=(const AliRsnDaughterSe
    fEntryListsP = copy.fEntryListsP;
    fEntryListsM = copy.fEntryListsM;
    fUseLabelCheck = copy.fUseLabelCheck;
+   fActions = copy.fActions;
 
    AliDebug(AliLog::kDebug + 10, "->");
 
@@ -85,6 +89,8 @@ AliRsnDaughterSelector::~AliRsnDaughterSelector()
    fEntryListsP.Delete();
    fEntryListsM.Delete();
 
+   fActions.Delete();
+
    AliDebug(AliLog::kDebug + 10, "->");
 }
 
@@ -153,6 +159,56 @@ void AliRsnDaughterSelector::Init()
 }
 
 //__________________________________________________________________________________________________
+void AliRsnDaughterSelector::AddAction(AliRsnAction *action)
+{
+//
+// Adding action
+//
+   if (!action) return;
+
+   fActions.Add(action);
+}
+
+
+//__________________________________________________________________________________________________
+void AliRsnDaughterSelector::InitActions(TList *list)
+{
+//
+// Initialize output for post actiosn
+//
+   if (!list) return;
+   TObjArray objects;
+   objects.Add(this);
+
+   TIter next(&fActions);
+   AliRsnAction *action;
+   while ((action = (AliRsnAction *)next())) {
+      action->InitAction(list,&objects);
+   }
+
+}
+
+//__________________________________________________________________________________________________
+void AliRsnDaughterSelector::ExecActions(AliRsnEvent *ev)
+{
+//
+// Exec Actions
+//
+
+   if (!ev) return;
+   
+   TObjArray objects;
+   objects.Add(ev);
+
+   TIter next(&fActions);
+   AliRsnAction *action;
+   while ((action = (AliRsnAction *)next())) {
+      action->ExecAction(&objects);
+   }
+}
+
+
+//__________________________________________________________________________________________________
 void AliRsnDaughterSelector::Reset()
 {
    TEntryList *el;
@@ -253,6 +309,7 @@ void AliRsnDaughterSelector::ScanEvent(AliRsnEvent *ev)
 //
 
    Int_t id, is;
+   Int_t label;
    Int_t nSel, nTot = ev->GetAbsoluteSum();
    AliRsnDaughter check;
    TClonesArray *cutsArray = 0x0, *entryArray = 0x0;
@@ -282,7 +339,11 @@ void AliRsnDaughterSelector::ScanEvent(AliRsnEvent *ev)
          entryArray = &fEntryListsN;
       }
 
-      if (fUseLabelCheck && labelList.Contains(check.GetLabel())) continue;
+      // gets label for later use
+      label = check.GetLabel();
+
+      // check if label was not in labelList
+      if (fUseLabelCheck && labelList.Contains(label)) continue;
 
       // check with all cuts in that charge
       nSel = cutsArray->GetEntries();
@@ -291,11 +352,9 @@ void AliRsnDaughterSelector::ScanEvent(AliRsnEvent *ev)
          if (cuts->IsSelected(&check)) {
             el = (TEntryList *)entryArray->At(is);
             el->Enter(id);
-            if (fUseLabelCheck) labelList.Enter(check.GetLabel());
+            if (fUseLabelCheck && label >= 0) labelList.Enter(label);
          }
       }
    }
-
-   //Print();
 }
 
index 353fc40..44d778c 100644 (file)
@@ -3,11 +3,14 @@
 
 #include <TNamed.h>
 #include <TClonesArray.h>
+#include <TObjArray.h>
 
 class TEntryList;
+class TList;
 
 class AliRsnCutSet;
 class AliRsnEvent;
+class AliRsnAction;
 
 class AliRsnDaughterSelector : public TNamed {
 
@@ -19,18 +22,23 @@ public:
    virtual ~AliRsnDaughterSelector();
 
    void          Init();
+   void          InitActions(TList *list);
    void          Reset();
    Int_t         Add(AliRsnCutSet *cuts, Bool_t charged);
    Int_t         GetID(const char *cutSetName, Bool_t charged);
    TEntryList   *GetSelected(Int_t i, Char_t charge);
    TEntryList   *GetSelected(Int_t i, Short_t charge);
    void          ScanEvent(AliRsnEvent *ev);
+   void          ExecActions(AliRsnEvent *ev);
 
    virtual void  Print(Option_t *option = "") const;
 
    TClonesArray *GetCutSetC() {return &fCutSetsC;}
    TClonesArray *GetCutSetN() {return &fCutSetsN;}
    
+   void          AddAction(AliRsnAction *action);
+   TObjArray    *GetActions() { return &fActions; }
+   
    void SetLabelCheck(Bool_t useLabelCheck = kTRUE) { fUseLabelCheck = useLabelCheck;}
 
 private:
@@ -43,8 +51,10 @@ private:
    TClonesArray fEntryListsM;     // entry lists for charged (one per sign)
    
    Bool_t       fUseLabelCheck;   // flag is reapiting of label should be checked
+   
+   TObjArray    fActions;
 
-   ClassDef(AliRsnDaughterSelector, 2)
+   ClassDef(AliRsnDaughterSelector, 3)
 };
 
 #endif
index bc92dee..69f552e 100644 (file)
@@ -150,6 +150,7 @@ Bool_t AliRsnInputHandler::BeginEvent(Long64_t entry)
             // reject event if needed
             if (fRsnEventCuts) if (!fRsnEventCuts->IsSelected(fRsnEvent)) return kTRUE;
             fRsnSelector.ScanEvent(fRsnEvent);
+            fRsnSelector.ExecActions(fRsnEvent);
          }
       }
    }
index 42bc18a..adb4668 100644 (file)
@@ -11,8 +11,10 @@ Bool_t AddAMRsn(TString analysisSource = "proof", TString analysisMode = "test",
 
    Int_t eventMixinPar = AliAnalysisManager::GetGlobalInt("rsnUseEventMixingPar",valid);
    Int_t rsnPar = AliAnalysisManager::GetGlobalInt("rsnUseRSNPar",valid);
+   Int_t rsnParDev = AliAnalysisManager::GetGlobalInt("rsnUseRSNParDev",valid);
    if (eventMixinPar) rsnPar = 1;
-
+   if (rsnPar&&rsnParDev>=0) rsnParDev=1;
+   
    Int_t pidResponse = AliAnalysisManager::GetGlobalInt("rsnUsePIDResponse",valid);
    Int_t useRsnIH = AliAnalysisManager::GetGlobalInt("rsnUseRsnInputHandler",valid);
    Int_t physSel = AliAnalysisManager::GetGlobalInt("rsnUsePhysSel",valid);
@@ -41,7 +43,13 @@ Bool_t AddAMRsn(TString analysisSource = "proof", TString analysisMode = "test",
       if (rsnPar) { AliAnalysisAlien::SetupPar(rsnLibName.Data()); myAdditionalLibs += Form(" %s.par",rsnLibName.Data()); }
       else { gSystem->Load(Form("lib%s.so",rsnLibName.Data())); myAdditionalLibs += Form(" lib%s.so",rsnLibName.Data()); }
    }
+   
 
+   
+   if (rsnParDev>=0) {
+     if (rsnParDev) { AliAnalysisAlien::SetupPar("PWGLFresonancesdev"); myAdditionalLibs += " PWGLFresonancesdev.par"; }
+     else { gSystem->Load("libPWGLFresonancesdev.so"); myAdditionalLibs += " libPWGLFresonancesdev.so"; }
+   }
    analysisPlugin->SetAdditionalLibs(myAdditionalLibs.Data());
 
    AliMultiInputEventHandler *multiInputHandler = mgr->GetInputEventHandler();
@@ -72,8 +80,7 @@ Bool_t AddAMRsn(TString analysisSource = "proof", TString analysisMode = "test",
          if (aodIH) aodIH->SetEventSelection(multiIH->GetEventSelection());
       }
    }
-
-
+   
    // load and run AddTask macro
    if (!RsnLoadMacro("AddRsnAnalysisTask.C")) return kFALSE;
    if (!RsnLoadMacro("RsnConfig.C")) return kFALSE;
index be01043..ce5a175 100755 (executable)
@@ -5,3 +5,70 @@ root 'RunALICE.C("proof","test","aod","",1e10,0,"my_local_data.txt","AddAMRsn")'
 root 'RunALICE.C("local","full","aod","",1e10,0,"my_local_data.txt","AddAMRsn")'
 
 root 'RunALICE.C("proof","full","aod","",1e10,0,"datasets-proof/LHC11a_p3_SSD_AOD072.txt","AddAMRsn")'
+
+
+
+##### Init working direcotry to be able use lego_train stuff #####
+
+# get source from RSN git (readonly version) [please install git]
+
+mkdir -p $HOME/ALICE/
+cd $HOME/ALICE/
+git clone git://github.com/mvala/AliRsn.git
+
+# to get latest source
+cd $HOME/ALICE/AliRsn
+git pull
+
+# Let's create working direcotry (any directory you want)
+mkdir -p /tmp/my_wk_dir
+cd /tmp/my_wk_dir
+$HOME/ALICE/AliRsn/scripts/alirsn-create-wk-dir.sh
+# now you should have .C files needed to run analysis
+
+# modify RsnManager.C to set your RSN you want to study
+# for example line
+
+listRsn->Add(new TNamed("Phi","Phi2010"));
+
+# will use 
+# AddRsnPairsPhi.C
+# AddRsnDaughterCutsPhi2010.C
+# more info in 'RsnManager.C'
+# NOTE: ORDER of loading macros 
+# 1. Looks for macro in local direcotry
+# 2. Looks in direcotry defined in RsnManager.C as variable 'legoTrainPath'
+#    Default is '$ALICE_ROOT/PWGLF/RESONANCES/macros/lego_train'
+
+# if you want to use latest macros, which are not even in aliroot, but they are in RSN git, you can do
+# in 'RsnManager.C' change legoTrainPath
+# for example (my RSN git copy is located /home/mvala/ALICE/AliRsn)
+legoTrainPath = "/home/mvala/ALICE/AliRsn/PWGLF/RESONANCES/macros/lego_train";
+
+# and you can do for example , where 'my_local_data.txt' has
+# list of files localy saved
+
+root 'RunALICE.C("proof","test","aod","",1e10,0,"my_local_data.txt","AddAMRsn")'
+
+##### END Init working direcotry to be able use lego_train stuff #####
+
+
+###### EXTRA STUFF ###############################
+
+# <1> #
+# Create latest PWGLFresonances.par from RSN git
+cd $HOME/ALICE/AliRsn
+mkdir build
+cd build
+../scripts/alirsn-make.sh PWGLFresonances.par
+# and now PWGLFresonances.par is saved in build direcotry
+
+# to use PWGLFresonances.par in lego_train macros
+# just set 
+
+Int_t useRsnPar = 1;
+
+# and run as usual, for example
+root 'RunALICE.C("proof","test","aod","",1e10,0,"my_local_data.txt","AddAMRsn")'
+
+###### END EXTRA STUFF ###############################
index cc63ed5..d164d10 100644 (file)
@@ -75,6 +75,21 @@ Bool_t RsnConfig(AliAnalysisTaskSE *task,Bool_t isMC,Bool_t isMixing,AliRsnInput
             AddRsnPairsKStar(task,isMC,isMixing,AliPID::kKaon,cutIndex,AliPID::kPion,cutIndex+1,commonEventCuts,commonPairCuts,Form("%s_%s",rsnNameOptFull.Data(),rsnCutNameOptFull.Data()));
             cutIndex+=numOfCuts;
          }
+      } else if (!rsnName.CompareTo("rho")) {
+         numOfCuts = gROOT->ProcessLine(Form("AddRsnDaughterCuts%s(AliPID::kPion,AliPID::kPion,\"%s\",%d,(AliRsnInputHandler*)%p,(AliAnalysisTaskSE*)%p)",rsnCutName.Data(), rsnCutOpt.Data(),isRsnMini,rsnIH,task));
+         if (numOfCuts) {
+            if (rsnNameOpt.Contains("mon")) AddParticleMonitor(task,isMC,cutIndex,commonEventCuts,commonPairCuts,Form("%s_%s_pi",rsnNameOptFull.Data(),rsnCutNameOptFull.Data()));
+            AddRsnPairsRho(task,isMC,isMixing,AliPID::kPion,cutIndex,AliPID::kPion,cutIndex,commonEventCuts,commonPairCuts,Form("%s_%s",rsnNameOptFull.Data(),rsnCutNameOptFull.Data()));
+            cutIndex+=numOfCuts;
+         }
+      } else if (!rsnName.CompareTo("lambda")) {
+         numOfCuts = gROOT->ProcessLine(Form("AddRsnDaughterCuts%s(AliPID::kProton,AliPID::kKaon,\"%s\",%d,(AliRsnInputHandler*)%p,(AliAnalysisTaskSE*)%p)",rsnCutName.Data(), rsnCutOpt.Data(),isRsnMini,rsnIH,task));
+         if (numOfCuts) {
+            if (rsnNameOpt.Contains("mon")) AddParticleMonitor(task,isMC,cutIndex,commonEventCuts,commonPairCuts,Form("%s_%s_p",rsnNameOptFull.Data(),rsnCutNameOptFull.Data()));
+            if (rsnNameOpt.Contains("mon")) AddParticleMonitor(task,isMC,cutIndex+1,commonEventCuts,commonPairCuts,Form("%s_%s_K",rsnNameOptFull.Data(),rsnCutNameOptFull.Data()));
+            AddRsnPairsLambda(task,isMC,isMixing,AliPID::kProton,cutIndex,AliPID::kKaon,cutIndex+1,commonEventCuts,commonPairCuts,Form("%s_%s",rsnNameOptFull.Data(),rsnCutNameOptFull.Data()));
+            cutIndex+=numOfCuts;
+         }
       } else {
          Printf("Error : Particle %s is not supported !!!!",rsnName.Data());
          return kFALSE;
index 670f595..0656995 100644 (file)
@@ -1,6 +1,6 @@
 TList *RsnManager() {
 
-   Int_t isPP           = 1; // in GRID case it will be overwriten
+   Int_t isPP           = 1; // in GRID case it will be overwriten (look bellow)
    Int_t useRsnMini     = 1;
 
    Int_t useMixing      = 0;
@@ -12,10 +12,11 @@ TList *RsnManager() {
 
    Int_t useEventMixPar = 0;
    Int_t useRsnPar      = 0;
+   Int_t useRsnParDev   = -1;
 
-   TString rootver = "v5-30-06-1";
+   TString rootver = "v5-32-01";
    TString alirootver = "";
-   //   alirootver = "v5-02-17-AN";
+//      alirootver = "v5-03-07-AN";
 
    TString legoTrainPath = "$ALICE_ROOT/PWGLF/RESONANCES/macros/lego_train";
 //    legoTrainPath = "$HOME/git/AliRsn/PWGLF/RESONANCES/macros/lego_train";
@@ -32,55 +33,43 @@ TList *RsnManager() {
    //    listRsn->Add(new TNamed("<Name>:mon","<CutName>:<opt>"));
 
    TString commonCutOption="";
-//    commonCutOption="mon_eta";
+   commonCutOption="mon_eta";
 
+   // PHI
    listRsn->Add(new TNamed("Phi","Phi2010"));
+//    listRsn->Add(new TNamed("Phi","Phi2010:tpconly_TPCsigma1"));
+//    listRsn->Add(new TNamed("Phi","Phi2010:tpconly_TPCsigma2"));
+//    listRsn->Add(new TNamed("Phi","Phi2010:tpconly_TPCsigma3"));
 //    listRsn->Add(new TNamed("Phi","Phi2010:pdg"));
-//
-//    listRsn->Add(new TNamed("Phi","Phi2010:trackPtMax18"));
-//    listRsn->Add(new TNamed("Phi","Phi2010:trackPtMax18_pdg"));
-//
-//    listRsn->Add(new TNamed("Phi","Phi2010:usePP"));
 //    listRsn->Add(new TNamed("Phi","Phi2010:usePP_pdg"));
-//
-//    listRsn->Add(new TNamed("Phi","Phi2010:usePP_trackPtMax18"));
-//    listRsn->Add(new TNamed("Phi","Phi2010:usePP_trackPtMax18_pdg"));
-//
-// //   listRsn->Add(new TNamed("Phi","Phi2010:tpconly_TPCsigma1"));
-// //   listRsn->Add(new TNamed("Phi","Phi2010:tpconly_TPCsigma2"));
-//    listRsn->Add(new TNamed("Phi","Phi2010:tpconly_TPCsigma3"));
+
+//    listRsn->Add(new TNamed("Phi","Phi2010:tpconly_TPCsigma1_pdg"));
+//    listRsn->Add(new TNamed("Phi","Phi2010:tpconly_TPCsigma2_pdg"));
 //    listRsn->Add(new TNamed("Phi","Phi2010:tpconly_TPCsigma3_pdg"));
-// //   listRsn->Add(new TNamed("Phi","Phi2010:tofonly_TOFsigma1"));
-// //   listRsn->Add(new TNamed("Phi","Phi2010:tofonly_TOCsigma2"));
-//    listRsn->Add(new TNamed("Phi","Phi2010:tofonly_TOCsigma3"));
-//    listRsn->Add(new TNamed("Phi","Phi2010:tofonly_TOCsigma3_pdg"));
-//    listRsn->Add(new TNamed("Phi","Phi2010:tofonly_TOCsigma3_trackPtMax18"));
-//    listRsn->Add(new TNamed("Phi","Phi2010:tofonly_TOCsigma3_trackPtMax18_pdg"));
-//
-//
-// //   listRsn->Add(new TNamed("Phi","BPID"));
-//    listRsn->Add(new TNamed("Phi","Phi2010:qualityonly"));
-// //   listRsn->Add(new TNamed("Phi","Phi2010:tpcptMax05"));
-// //   listRsn->Add(new TNamed("Phi","Phi2010:tpcptMax06"));
-// //   listRsn->Add(new TNamed("Phi","Phi2010:tpcptMax07"));
-// //   listRsn->Add(new TNamed("Phi","Phi2010:tpcptMax08"));
-// //   listRsn->Add(new TNamed("Phi","Phi2010:TPCsigma1_tpcptMax06"));
-// //   listRsn->Add(new TNamed("Phi","Phi2010:TPCsigma1_tpcptMax08"));
+
+//    listRsn->Add(new TNamed("Phi","BPID"));
 //
-//    //
-//    //    // in case you have MC
-//    //   listRsn->Add(new TNamed("Phi","PDG"));
-//    listRsn->Add(new TNamed("Phi","PDG:NoTOFSIGMA"));
-//    //
-//    //    listRsn->Add(new TNamed("KStar","KStar2010:mon"));
-//    //    listRsn->Add(new TNamed("KStar","BPID:mon"));
+
+   // RHO
+//    listRsn->Add(new TNamed("Rho","Rho"));
+//    listRsn->Add(new TNamed("Rho","Rho:tpconly_TPCsigma1"));
+
+
+   // KStar
 //
-//    //    listRsn->Add(new TNamed("KStar","KStar:mon"));
-//    //    listRsn->Add(new TNamed("KStar","KStar:TPCTOFpidDefaultKstarPP2010_mon"));
-//    //    listRsn->Add(new TNamed("KStar","KStar:FastTPCpid1point5sigma_mon"));
-//    //    listRsn->Add(new TNamed("KStar","KStar:FastTPCpid2sigma_mon"));
+//    listRsn->Add(new TNamed("KStar","KStar2010:mon"));
+//    listRsn->Add(new TNamed("KStar","BPID:mon"));
+//    listRsn->Add(new TNamed("KStar","KStar:mon"));
+//    listRsn->Add(new TNamed("KStar","KStar:TPCTOFpidDefaultKstarPP2010_mon"));
+//    listRsn->Add(new TNamed("KStar","KStar:FastTPCpid1point5sigma_mon"));
+//    listRsn->Add(new TNamed("KStar","KStar:FastTPCpid2sigma_mon"));
 
 
+   // Lambda
+//    listRsn->Add(new TNamed("Lambda","Lambda"));
+//    listRsn->Add(new TNamed("Lambda","Lambda:TPCPsigma2_TPCKsigma1"));
+
+   
    //============= ONLY for GRID ====================
    TString dsConfig;
 
@@ -124,7 +113,7 @@ TList *RsnManager() {
    // use parfiles instead of libs
    AliAnalysisManager::SetGlobalInt("rsnUseEventMixingPar",useEventMixPar);
    AliAnalysisManager::SetGlobalInt("rsnUseRSNPar",useRsnPar);
-
+   AliAnalysisManager::SetGlobalInt("rsnUseRSNParDev",useRsnParDev);
    // common options
    AliAnalysisManager::SetGlobalInt("rsnUsePhysSel",0);
    AliAnalysisManager::SetGlobalInt("rsnUsePIDResponse",1);
@@ -162,9 +151,7 @@ TList *RsnManager() {
    AliAnalysisManager::SetGlobalStr("rsnLegoTrainROOTversion",rootver.Data());
    AliAnalysisManager::SetGlobalStr("rsnLegoTrainAliROOTversion",alirootver.Data());
 
-
    AliAnalysisManager::SetGlobalStr("rsnLegoTrainCommonCutOption",commonCutOption.Data());
 
-
    return listRsn;
 }