Added another version of cut for pp (small differences in PID)
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Apr 2011 17:10:34 +0000 (17:10 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Apr 2011 17:10:34 +0000 (17:10 +0000)
Added a workaround to solve a problem in primary vertex cut when doing mixing

Added some modification for a more proper computation of efficiency, which involved also AlirsnMother and AliRsnDaughter and the classes based on them.

12 files changed:
PWG2/CMakelibPWG2resonances.pkg
PWG2/PWG2resonancesLinkDef.h
PWG2/RESONANCES/AliRsnCutKaonForPhi2010.cxx
PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx [new file with mode: 0644]
PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h [new file with mode: 0644]
PWG2/RESONANCES/AliRsnCutPrimaryVertex.cxx
PWG2/RESONANCES/AliRsnDaughter.cxx
PWG2/RESONANCES/AliRsnDaughterSelector.cxx
PWG2/RESONANCES/AliRsnDaughterSelector.h
PWG2/RESONANCES/AliRsnLoopEff.cxx
PWG2/RESONANCES/AliRsnMother.cxx
PWG2/RESONANCES/AliRsnMother.h

index eda8af1..17d1a82 100644 (file)
@@ -46,6 +46,7 @@ set ( SRCS RESONANCES/AliRsnDaughter.cxx
            RESONANCES/AliRsnCutPIDNSigma.cxx
            RESONANCES/AliRsnCutMomentumComparison.cxx
            RESONANCES/AliRsnCutKaonForPhi2010.cxx
+           RESONANCES/AliRsnCutKaonForPhi2010PP.cxx
            RESONANCES/AliRsnCutSet.cxx
            RESONANCES/AliRsnExpression.cxx
            RESONANCES/AliRsnVariableExpression.cxx
index c1792fe..02fec9c 100644 (file)
@@ -25,7 +25,7 @@
 #pragma link C++ class AliRsnCutPIDNSigma+;
 #pragma link C++ class AliRsnCutMomentumComparison+;
 #pragma link C++ class AliRsnCutKaonForPhi2010+;
-
+#pragma link C++ class AliRsnCutKaonForPhi2010PP+;
 
 #pragma link C++ class AliRsnCutSet+;
 #pragma link C++ class AliRsnExpression+;
index cfbe1c2..4617f64 100644 (file)
@@ -12,7 +12,7 @@ ClassImp(AliRsnCutKaonForPhi2010)
 
 //__________________________________________________________________________________________________
 AliRsnCutKaonForPhi2010::AliRsnCutKaonForPhi2010(const char *name) :
-   AliRsnCut(name, AliRsnTarget::kDaughter, -3.0, 3.0),
+   AliRsnCut(name, AliRsnTarget::kDaughter, 0.0, 3.0),
    fCutQuality(Form("%sQuality", name))
 {
 //
diff --git a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx
new file mode 100644 (file)
index 0000000..1bc4cf0
--- /dev/null
@@ -0,0 +1,94 @@
+//
+// All cuts for single kaons in phi analysis 2010
+//
+
+#include <Riostream.h>
+
+#include "AliPID.h"
+#include "AliPIDResponse.h"
+#include "AliRsnCutKaonForPhi2010PP.h"
+
+ClassImp(AliRsnCutKaonForPhi2010PP)
+
+//__________________________________________________________________________________________________
+AliRsnCutKaonForPhi2010PP::AliRsnCutKaonForPhi2010PP(const char *name) :
+   AliRsnCut(name, AliRsnTarget::kDaughter, -3.0, 3.0),
+   fNSigmaTPCLow(5.0),
+   fNSigmaTPCHigh(3.0),
+   fLimitTPC(0.350),
+   fNSigmaTOF(3.0),
+   fCutQuality(Form("%sQuality", name))
+{
+//
+// Constructor
+// Initialize the contained cuts and sets defaults
+//
+
+   // track quality
+   //fCutQuality.AddStatusFlag(AliESDtrack::kTPCin   , kTRUE);
+   //fCutQuality.AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE);
+   //fCutQuality.AddStatusFlag(AliESDtrack::kITSrefit, kTRUE);
+   fCutQuality.SetPtRange(0.15, 1E+20);
+   fCutQuality.SetEtaRange(-0.8, 0.8);
+   fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01");
+   fCutQuality.SetDCAZmax(2.0);
+   fCutQuality.SetSPDminNClusters(1);
+   fCutQuality.SetITSminNClusters(0);
+   fCutQuality.SetITSmaxChi2(1E+20);
+   fCutQuality.SetTPCminNClusters(70);
+   fCutQuality.SetTPCmaxChi2(4.0);
+   fCutQuality.SetRejectKinkDaughters();
+   fCutQuality.SetAODTestFilterBit(5);
+}
+
+//__________________________________________________________________________________________________
+Bool_t AliRsnCutKaonForPhi2010PP::IsSelected(TObject *obj)
+{
+//
+// Global check
+//
+
+   // coherence check
+   if (!TargetOK(obj)) return kFALSE;
+   
+   // check track
+   AliVTrack *track = fDaughter->Ref2Vtrack();
+   if (!track) {
+      if (!fDaughter->GetRef()) AliWarning("NULL ref");
+      return kFALSE;
+   }
+   
+   // check flags
+   if ((track->GetStatus() & AliESDtrack::kTPCin   ) == 0) return kFALSE;
+   if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
+   if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
+   
+   // quality
+   if (!fCutQuality.IsSelected(obj)) return kFALSE;
+   
+   // check initialization of PID object
+   AliPIDResponse *pid = fEvent->GetPIDResponse();
+   if (!pid) {
+      AliFatal("NULL PID response");
+      return kFALSE;
+   }
+   
+   // PID TPC :
+   // depends on momentum
+   if (track->GetTPCmomentum() < fLimitTPC) 
+      SetRangeD(0.0, fNSigmaTPCLow);
+   else
+      SetRangeD(0.0, fNSigmaTPCHigh);
+   fCutValueD = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon));
+   if (!OkRangeD()) return kFALSE;
+   
+   // if TOF is not matched, end here
+   // otherwise check TOF
+   if (!MatchTOF(track)) 
+      return kTRUE;
+   else {
+      SetRangeD(0.0, fNSigmaTOF);
+      fCutValueD = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kKaon));
+      return OkRangeD();
+   }
+}
diff --git a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h
new file mode 100644 (file)
index 0000000..41b19b8
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef AliRsnCutKaonForPhi2010PP_H
+#define AliRsnCutKaonForPhi2010PP_H
+
+//
+// All cuts for single kaons in phi analysis 2010
+//
+
+#include "AliVTrack.h"
+#include "AliRsnCut.h"
+#include "AliRsnCutTrackQuality.h"
+
+class AliRsnCutKaonForPhi2010PP : public AliRsnCut {
+
+public:
+
+   AliRsnCutKaonForPhi2010PP(const char *name = "");
+   
+   void           SetTPCNSigmaLow (Double_t v) {fNSigmaTPCLow  = v;}
+   void           SetTPCNSigmaHigh(Double_t v) {fNSigmaTPCHigh = v;}
+   void           SetTPCLimit(Double_t v)      {fLimitTPC      = v;}
+   void           SetTOFNSigma(Double_t v)     {fNSigmaTOF     = v;}
+   
+   virtual Bool_t IsSelected(TObject *obj);
+   
+   AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;}
+
+private:
+
+   Bool_t MatchTOF(AliVTrack *vtrack);
+   
+   Double_t              fNSigmaTPCLow;   // TPC: nsigma cut below limit
+   Double_t              fNSigmaTPCHigh;  // TPC: nsigma cut above limit
+   Double_t              fLimitTPC;       // TPC: momentum limit 
+   Double_t              fNSigmaTOF;      // TOF: nsigma cut (unique)
+
+   AliRsnCutTrackQuality fCutQuality;     // track quality cut
+
+   ClassDef(AliRsnCutKaonForPhi2010PP,1)
+
+};
+
+//__________________________________________________________________________________________________
+inline Bool_t AliRsnCutKaonForPhi2010PP::MatchTOF(AliVTrack *vtrack)
+{
+//
+// Checks if the track has matched the TOF detector
+//
+
+   if (!vtrack) {
+      AliWarning("NULL argument: impossible to check status");
+      return kFALSE;
+   }
+
+   Bool_t isTOFout = ((vtrack->GetStatus() & AliESDtrack::kTOFout) != 0);
+   Bool_t isTIME   = ((vtrack->GetStatus() & AliESDtrack::kTIME) != 0);
+
+   return (isTOFout && isTIME);
+}
+
+#endif
index 48b331e..7a5a816 100644 (file)
@@ -103,14 +103,14 @@ Bool_t AliRsnCutPrimaryVertex::IsSelected(TObject *object)
       if (CheckVertex(aodv)) {
          AliDebugClass(1, "Vertex TRK is OK");
          fCutValueD = aodv->GetZ();
-         fCutValueI = aodv->GetNContributors();
+         fCutValueI = aodv->GetNDaughters(); //aodv->GetNContributors();
       }
       else {
          aodv = aod->GetPrimaryVertexSPD();
          if (CheckVertex(aodv)) {
             AliDebugClass(1, "Vertex TRK is BAD, but vertex SPD is OK");
             fCutValueD = aodv->GetZ();
-            fCutValueI = aodv->GetNContributors();
+            fCutValueI = aodv->GetNDaughters(); //aodv->GetNContributors();
          } else {
             AliDebugClass(1, "Vertex TRK is BAD, and vertex SPD is BAD");
             return kFALSE;
index e17b092..d0d1ee7 100644 (file)
@@ -149,7 +149,7 @@ Int_t AliRsnDaughter::GetMother()
    
 
 //______________________________________________________________________________
-void AliRsnDaughter::Print(Option_t *opt) const
+void AliRsnDaughter::Print(Option_t *) const
 {
 //
 // Override of TObject::Print()
index ce6c626..349bda8 100644 (file)
@@ -2,7 +2,7 @@
 #include <TEntryList.h>
 
 #include "AliLog.h"
-
+#include "AliRsnMiniParticle.h"
 #include "AliRsnCutSet.h"
 #include "AliRsnDaughterDef.h"
 
@@ -288,3 +288,56 @@ void AliRsnDaughterSelector::ScanEvent(AliRsnEvent* ev)
    
    //Print();
 }
+
+//__________________________________________________________________________________________________
+AliRsnMiniEvent AliRsnDaughterSelector::CreateMiniEvent(AliRsnEvent* ev)
+{
+//
+// Loop over event and fill all entry lists
+//
+
+   AliRsnMiniEvent newEv;
+   AliRsnMiniParticle newPart;
+
+   Int_t id, is;
+   Int_t nSel, nTot = ev->GetAbsoluteSum();
+   AliRsnDaughter check;
+   TClonesArray *cutsArray = 0x0, *entryArray = 0x0;
+   
+   for (id = 0; id < nTot; id++) {
+      ev->SetDaughter(check, id);
+      // some checks
+      if (!check.GetRef()) {
+         AliDebugClass(1, Form("[%s]: daughter has NULL ref", GetName()));
+         continue;
+      }
+      if (!check.IsOK()) {
+         AliDebugClass(1, Form("[%s]: daughter is BAD", GetName()));
+         continue;
+      }
+      // copy informations
+      if (check.GetRefMC()) {
+         newPart.PsimX() = check.GetRefMC()->Px();
+         newPart.PsimY() = check.GetRefMC()->Py();
+         newPart.PsimZ() = check.GetRefMC()->Pz();
+      }
+      newPart.PrecX() = check.GetRef()->Px();
+      newPart.PrecY() = check.GetRef()->Py();
+      newPart.PrecZ() = check.GetRef()->Pz();
+      newPart.Charge() = check.GetRef()->Charge();
+      newPart.Mother() = check.GetMother();
+      newPart.MotherPDG() = check.GetMotherPDG();
+      newPart.CutBits() = 0x0;
+      // check with all cuts in that charge
+      nSel = cutsArray->GetEntries();
+      for (is = 0; is < nSel; is++) {
+         AliRsnCutSet *cuts = (AliRsnCutSet*)cutsArray->At(is);
+         if (cuts->IsSelected(&check)) newPart.SetCutBit(is);
+      }
+      // add only if it satisfied a cut bit
+      if (newPart.CutBits() != 0) newEv.AddParticle(newPart);
+   }
+   
+   return newEv;
+   //Print();
+}
index e8cc8ad..45883bd 100644 (file)
@@ -4,6 +4,8 @@
 #include <TNamed.h>
 #include <TClonesArray.h>
 
+#include "AliRsnMiniEvent.h"
+
 class TEntryList;
 
 class AliRsnCutSet;
@@ -25,6 +27,7 @@ public:
    TEntryList*   GetSelected(Int_t i, Char_t charge);
    TEntryList*   GetSelected(Int_t i, Short_t charge);
    void          ScanEvent(AliRsnEvent *ev);
+   AliRsnMiniEvent CreateMiniEvent(AliRsnEvent *ev);
    
    virtual void  Print(Option_t* option = "") const;
 
index 230abd1..d33d5ed 100644 (file)
@@ -38,7 +38,8 @@ AliRsnLoopEff::AliRsnLoopEff(const AliRsnLoopEff& copy) :
    AliRsnLoop(copy),
    fAddSteps(copy.fAddSteps),
    fSteps(copy.fSteps),
-   fOutput(copy.fOutput)
+   fOutput(copy.fOutput),
+   fMaxDistPV(copy.fMaxDistPV)
 {
 //
 // Copy constructor
index 02732b6..3006346 100644 (file)
@@ -43,7 +43,9 @@ AliRsnMother::AliRsnMother(const AliRsnMother &obj) :
    TObject(obj),
    fRefEvent(obj.fRefEvent),
    fSum(obj.fSum),
-   fRef(obj.fRef)
+   fSumMC(obj.fSumMC),
+   fRef(obj.fRef),
+   fRefMC(obj.fRefMC)
 {
 //
 // Copy constructor.
@@ -64,6 +66,8 @@ AliRsnMother& AliRsnMother::operator=(const AliRsnMother &obj)
 
    fSum = obj.fSum;
    fRef = obj.fRef;
+   fSumMC = obj.fSumMC;
+   fRefMC = obj.fRefMC;
    fRefEvent = obj.fRefEvent;
    fDaughter[0] = obj.fDaughter[0];
    fDaughter[1] = obj.fDaughter[1];
index de2ed43..f87084f 100644 (file)
@@ -18,7 +18,7 @@ class AliRsnEvent;
 class AliRsnMother : public TObject {
 public:
 
-   AliRsnMother() : fRefEvent(0), fSum(), fRef() {fDaughter[0] = fDaughter[1] = 0;}
+   AliRsnMother() : fRefEvent(0), fSum(), fSumMC(), fRef(), fRefMC() {fDaughter[0] = fDaughter[1] = 0;}
    AliRsnMother(const AliRsnMother &obj);
    AliRsnMother& operator=(const AliRsnMother &obj);
    virtual ~AliRsnMother();