Added cut set for kstar analysis (fbellini)
authorfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Aug 2012 11:05:50 +0000 (11:05 +0000)
committerfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Aug 2012 11:05:50 +0000 (11:05 +0000)
PWGLF/RESONANCES/AliRsnCutPIDNSigma.cxx
PWGLF/RESONANCES/AliRsnCutPIDNSigma.h
PWGLF/RESONANCES/AliRsnCutSetDaughterParticle.cxx [new file with mode: 0644]
PWGLF/RESONANCES/AliRsnCutSetDaughterParticle.h [new file with mode: 0644]
PWGLF/RESONANCES/AliRsnCutTOFMatch.cxx [new file with mode: 0644]
PWGLF/RESONANCES/AliRsnCutTOFMatch.h [new file with mode: 0644]

index 0bc4a3c..6ebb745 100644 (file)
@@ -216,3 +216,80 @@ void AliRsnCutPIDNSigma::Print(const Option_t *) const
    AliInfo(Form("--> match criteria: %s", match));
    AliInfo(Form("--> momentum range: %s", mom));
 }
+
+//_________________________________________________________________________________________________
+Bool_t AliRsnCutPIDNSigma::MatchITS(const AliVTrack *vtrack) const
+{
+//
+// Checks if the track has the status flags required for an ITS standalone track
+//
+
+   if ((vtrack->GetStatus() & AliESDtrack::kITSin)  == 0) return kFALSE;
+   if ((vtrack->GetStatus() & AliESDtrack::kITSpid) == 0) return kFALSE;
+
+   return kTRUE;
+}
+//_________________________________________________________________________________________________
+Bool_t AliRsnCutPIDNSigma::MatchTPC(const AliVTrack *vtrack) const
+{
+//
+// Checks if the track has the status flags required for a TPC track
+//
+
+   if ((vtrack->GetStatus() & AliESDtrack::kTPCin) == 0) return kFALSE;
+
+   return kTRUE;
+}
+
+//_________________________________________________________________________________________________
+Bool_t AliRsnCutPIDNSigma::MatchTOF(const AliVTrack *vtrack) const
+{
+//
+// Checks if the track has the status flags required for an ITS standalone track
+//
+
+   if ((vtrack->GetStatus() & AliESDtrack::kTOFout) == 0) return kFALSE;
+   if ((vtrack->GetStatus() & AliESDtrack::kTIME)   == 0) return kFALSE;
+
+   return kTRUE;
+}
+
+//_________________________________________________________________________________________________
+Bool_t AliRsnCutPIDNSigma::MatchDetector(const AliVTrack *vtrack) const
+{
+//
+// Checks if the track has matched the required detector.
+// If no valid detector is specified, kFALSE is always returned.
+//
+
+   switch (fDetector) {
+      case kITS: return MatchITS(vtrack);
+      case kTPC: return MatchTPC(vtrack);
+      case kTOF: return MatchTOF(vtrack);
+      default  : return kFALSE;
+   }
+}
+
+//_________________________________________________________________________________________________
+void AliRsnCutPIDNSigma::AddPIDRange(Double_t nsigma, Double_t pmin, Double_t pmax)
+{
+//
+// Add a new slot for checking PID
+//
+
+   Int_t n = fRanges.GetEntries();
+
+   new (fRanges[n]) AliRsnPIDRange(nsigma, pmin, pmax);
+}
+
+//_________________________________________________________________________________________________
+void AliRsnCutPIDNSigma::SinglePIDRange(Double_t nsigma)
+{
+//
+// Clear all slots and sets a unique one
+//
+
+   fRanges.Delete();
+
+   new (fRanges[0]) AliRsnPIDRange(nsigma, 0.0, 1E20);
+}
index 94cfd40..70b7528 100644 (file)
@@ -69,76 +69,4 @@ private:
    ClassDef(AliRsnCutPIDNSigma, 1)
 };
 
-inline Bool_t AliRsnCutPIDNSigma::MatchITS(const AliVTrack *vtrack) const
-{
-//
-// Checks if the track has the status flags required for an ITS standalone track
-//
-
-   if ((vtrack->GetStatus() & AliESDtrack::kITSin)  == 0) return kFALSE;
-   if ((vtrack->GetStatus() & AliESDtrack::kITSpid) == 0) return kFALSE;
-
-   return kTRUE;
-}
-
-inline Bool_t AliRsnCutPIDNSigma::MatchTPC(const AliVTrack *vtrack) const
-{
-//
-// Checks if the track has the status flags required for a TPC track
-//
-
-   if ((vtrack->GetStatus() & AliESDtrack::kTPCin) == 0) return kFALSE;
-
-   return kTRUE;
-}
-
-inline Bool_t AliRsnCutPIDNSigma::MatchTOF(const AliVTrack *vtrack) const
-{
-//
-// Checks if the track has the status flags required for an ITS standalone track
-//
-
-   if ((vtrack->GetStatus() & AliESDtrack::kTOFout) == 0) return kFALSE;
-   if ((vtrack->GetStatus() & AliESDtrack::kTIME)   == 0) return kFALSE;
-
-   return kTRUE;
-}
-
-inline Bool_t AliRsnCutPIDNSigma::MatchDetector(const AliVTrack *vtrack) const
-{
-//
-// Checks if the track has matched the required detector.
-// If no valid detector is specified, kFALSE is always returned.
-//
-
-   switch (fDetector) {
-      case kITS: return MatchITS(vtrack);
-      case kTPC: return MatchTPC(vtrack);
-      case kTOF: return MatchTOF(vtrack);
-      default  : return kFALSE;
-   }
-}
-
-inline void AliRsnCutPIDNSigma::AddPIDRange(Double_t nsigma, Double_t pmin, Double_t pmax)
-{
-//
-// Add a new slot for checking PID
-//
-
-   Int_t n = fRanges.GetEntries();
-
-   new (fRanges[n]) AliRsnPIDRange(nsigma, pmin, pmax);
-}
-
-inline void AliRsnCutPIDNSigma::SinglePIDRange(Double_t nsigma)
-{
-//
-// Clear all slots and sets a unique one
-//
-
-   fRanges.Delete();
-
-   new (fRanges[0]) AliRsnPIDRange(nsigma, 0.0, 1E20);
-}
-
 #endif
diff --git a/PWGLF/RESONANCES/AliRsnCutSetDaughterParticle.cxx b/PWGLF/RESONANCES/AliRsnCutSetDaughterParticle.cxx
new file mode 100644 (file)
index 0000000..9eb4f29
--- /dev/null
@@ -0,0 +1,227 @@
+//
+// Author: Francesca Bellini (fbellini@cern.ch)
+//
+//
+
+#include <Riostream.h>
+
+#include "AliPID.h"
+#include "AliPIDResponse.h"
+#include "AliRsnCutSetDaughterParticle.h"
+
+class AliRsnCutPIDNSigma;
+class AliRsnPIDRange;
+
+ClassImp(AliRsnCutSetDaughterParticle)
+
+//__________________________________________________________________________________________________
+AliRsnCutSetDaughterParticle::AliRsnCutSetDaughterParticle() :
+  AliRsnCutSet("AliRsnCutSetDaughterParticle", AliRsnTarget::kDaughter),
+  fPID(AliPID::kPion),
+  fAppliedCutSetID(AliRsnCutSetDaughterParticle::kNDaughterCuts),
+  fNsigmaTPC(1E20),
+  fNsigmaTOF(1E20)
+{
+   //
+   // Default constructor
+}
+
+//__________________________________________________________________________________________________
+AliRsnCutSetDaughterParticle::AliRsnCutSetDaughterParticle(const char *name, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutSetID, AliPID::EParticleType pid, Float_t nSigmaFast = -1.0) :
+  AliRsnCutSet(name, AliRsnTarget::kDaughter),
+  fPID(pid),
+  fAppliedCutSetID(cutSetID),
+  fNsigmaTPC(1E20),
+  fNsigmaTOF(1E20)
+{
+   //
+   // Constructor
+   //
+  if ( (nSigmaFast<=0) && 
+       ((cutSetID == AliRsnCutSetDaughterParticle::kFastTPCpidNsigma) || (cutSetID == AliRsnCutSetDaughterParticle::kFastTOFpidNsigma)) ) {
+    AliError("Requested fast n-sigma PID with invalid value for n. Setting n = 1E20");
+  } else {
+    if (cutSetID == AliRsnCutSetDaughterParticle::kFastTPCpidNsigma){
+      fNsigmaTPC = nSigmaFast;
+    }
+    if ( (cutSetID == AliRsnCutSetDaughterParticle::kFastTOFpidNsigma) ||
+       (cutSetID == AliRsnCutSetDaughterParticle::kTOFpidKstarPbPb2010) ) { 
+      fNsigmaTOF = nSigmaFast;
+    }
+  }
+  
+  Init();
+}
+
+//__________________________________________________________________________________________________
+AliRsnCutSetDaughterParticle::AliRsnCutSetDaughterParticle(const AliRsnCutSetDaughterParticle &copy) :
+   AliRsnCutSet(copy),
+   fPID(copy.fPID),
+   fAppliedCutSetID(copy.fAppliedCutSetID),
+   fNsigmaTPC(copy.fNsigmaTPC),
+   fNsigmaTOF(copy.fNsigmaTOF)
+{
+   //
+   // copy constructor
+}
+
+//__________________________________________________________________________________________________
+AliRsnCutSetDaughterParticle &AliRsnCutSetDaughterParticle::operator=(const AliRsnCutSetDaughterParticle &copy)
+ {
+   //
+   // operator =
+  //
+  AliRsnCutSet::operator=(copy);
+  if (this == &copy)
+    return *this;
+  fPID=copy.fPID;
+  fAppliedCutSetID=copy.fAppliedCutSetID;
+  fNsigmaTPC=copy.fNsigmaTPC;
+  fNsigmaTOF=copy.fNsigmaTOF;
+  return (*this);
+}
+
+//----------------------------------------------------------------------------
+void AliRsnCutSetDaughterParticle::Init() 
+{ 
+  //
+  // init cut sets by setting variable params
+  //  
+      AliRsnCutTrackQuality * iCutQualityStd2010 = new AliRsnCutTrackQuality("CutQualityStd2010");
+      iCutQualityStd2010->SetDefaults2010();
+      /*
+       requires ITS refit ,TPC refit, TPC in
+       iCutQualityStd2010->SetPtRange(0.15, 1E+20);
+       iCutQualityStd2010->SetEtaRange(-0.8, 0.8);
+       iCutQualityStd2010->SetDCARPtFormula("0.0182+0.0350/pt^1.01");
+       iCutQualityStd2010->SetDCAZmax(2.0);
+       iCutQualityStd2010->SetSPDminNClusters(1);
+       iCutQualityStd2010->SetITSminNClusters(0);
+       iCutQualityStd2010->SetITSmaxChi2(36);
+       iCutQualityStd2010->SetTPCminNClusters(70);
+       iCutQualityStd2010->SetTPCmaxChi2(4.0);
+       iCutQualityStd2010->SetRejectKinkDaughters();
+       iCutQualityStd2010->SetAODTestFilterBit(5); 
+      */       
+
+      AliRsnCutTOFMatch  *iCutTOFMatch     = new AliRsnCutTOFMatch("CutTOFMatch");
+      AliRsnCutPIDNSigma *iCutTPCNSigma    = new AliRsnCutPIDNSigma("CutTPCNSigma", fPID, AliRsnCutPIDNSigma::kTPC);//, AliRsnCutPIDNSigma::kTPCinnerP );
+      AliRsnCutPIDNSigma *iCutTPCTOFNSigma = new AliRsnCutPIDNSigma("CutTPCTOFNSigma", fPID, AliRsnCutPIDNSigma::kTPC);//, AliRsnCutPIDNSigma::kTPCinnerP );
+      AliRsnCutPIDNSigma *iCutTOFNSigma    = new AliRsnCutPIDNSigma("CutTOFNSigma", fPID, AliRsnCutPIDNSigma::kTOF);//, AliRsnCutPIDNSigma::kP );
+
+      switch (fAppliedCutSetID) 
+       {
+       case AliRsnCutSetDaughterParticle::kNoCuts :
+         AliInfo("No cuts applied to daughter particle");
+         break;
+         
+       case AliRsnCutSetDaughterParticle::kQualityStd2010 :    
+         AddCut(iCutQualityStd2010);
+         SetCutScheme(iCutQualityStd2010->GetName());
+         break;
+
+       case AliRsnCutSetDaughterParticle::kQualityStd2011:      
+         //these are also golden cuts for PbPb 2010 
+         //AliESDtrackCuts::GetStandardITSTPCTrackCuts2011()
+         // select golden cut for ESD -> to be implemented 
+         //select golden cut for AOD
+         iCutQualityStd2010->SetAODTestFilterBit(10);    //1024
+         AddCut(iCutQualityStd2010);
+         SetCutScheme(iCutQualityStd2010->GetName());
+         break;
+         
+       case AliRsnCutSetDaughterParticle::kTOFMatch :
+         AddCut(iCutQualityStd2010);
+         AddCut(iCutTOFMatch);
+         SetCutScheme( Form("%s&(%s)",iCutQualityStd2010->GetName(), iCutTOFMatch->GetName()) );
+         break;
+         
+       case    AliRsnCutSetDaughterParticle::kFastTPCpidNsigma :
+         if (fNsigmaTPC <= 0.0) {
+           AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTPCNSigma->GetName()));
+           SetNsigmaForFastTPCpid(10.0);
+         }
+         iCutTPCNSigma->SinglePIDRange(fNsigmaTPC);
+         AddCut(iCutQualityStd2010);
+         AddCut(iCutTPCNSigma);
+         SetCutScheme( Form("%s&%s",iCutQualityStd2010->GetName(), iCutTPCNSigma->GetName()) );
+         break;
+      
+       case    AliRsnCutSetDaughterParticle::kFastTOFpidNsigma :
+         if (fNsigmaTOF <= 0.0) {
+           AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTOFNSigma->GetName()));
+           SetNsigmaForFastTOFpid(10.0);
+         }
+         iCutTOFNSigma->SinglePIDRange(fNsigmaTOF);
+         //iCutTOFNSigma->AddPIDRange(3.0, 0.35, 1E20);
+         AddCut(iCutQualityStd2010);
+         AddCut(iCutTOFNSigma);
+         SetCutScheme( Form("%s&%s",iCutQualityStd2010->GetName(), iCutTOFNSigma->GetName()) );
+         break;
+         
+       case    AliRsnCutSetDaughterParticle::kTPCTOFpidKstarPP2010 :     
+         /* Set TPC  PID (if no TOF)*/
+         // all   below   350         MeV: 5sigma
+         // all   between 350 and 500 MeV: 3sigma
+         // pios above   500         MeV: 2sigma
+         // kaons between 500 and 700 MeV: 2sigma
+         // kaons above   700         MeV: rejected
+         iCutTPCNSigma->AddPIDRange(5.0, 0.0, 0.35); 
+         iCutTPCNSigma->AddPIDRange(3.0, 0.35, 0.5); 
+         if (fPID==AliPID::kPion)
+           iCutTPCNSigma->AddPIDRange(2.0, 0.5, 1E20);
+         if (fPID==AliPID::kKaon)
+           iCutTPCNSigma->AddPIDRange(2.0, 0.5, 0.7);
+
+         AddCut(iCutQualityStd2010);
+         AddCut(iCutTOFMatch);
+         AddCut(iCutTPCNSigma);
+         
+         /* set TPC+TOF PID*/
+         iCutTPCTOFNSigma->SinglePIDRange(5.0);
+         iCutTOFNSigma->AddPIDRange(3.0, 0.0, 1.5);
+         iCutTOFNSigma->AddPIDRange(2.0, 1.5, 1E20);
+
+         AddCut(iCutTPCTOFNSigma);
+         AddCut(iCutTOFNSigma);
+      
+         // scheme:
+         // quality & [ (TOF & TPCTOF) || (!TOFmatch & TPConly) ]      
+         SetCutScheme( Form("%s&((%s&%s)|((!%s)&%s))",iCutQualityStd2010->GetName(), iCutTPCTOFNSigma->GetName(), iCutTOFNSigma->GetName(), iCutTOFMatch->GetName(), iCutTPCNSigma->GetName()) ) ;
+         break;
+         
+       case AliRsnCutSetDaughterParticle::kTOFpidKstarPbPb2010:
+         if (fNsigmaTOF <= 0.0) {
+           AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTOFNSigma->GetName()));
+           SetNsigmaForFastTOFpid(10.0);
+         }
+         iCutTOFNSigma->SinglePIDRange(fNsigmaTOF);
+         //iCutTOFNSigma->AddPIDRange(3.0, 0.35, 1E20);
+         iCutTPCTOFNSigma->SinglePIDRange(5.0); //5-sigma veto on tpc signal
+         /* requires ITS refit ,TPC refit, TPC in*/
+         iCutQualityStd2010->SetPtRange(0.15, 1E+20);
+         iCutQualityStd2010->SetEtaRange(-0.8, 0.8);
+         iCutQualityStd2010->SetDCARPtFormula("0.0182+0.0350/pt^1.01");
+         iCutQualityStd2010->SetDCAZmax(2.0);
+         iCutQualityStd2010->SetSPDminNClusters(1);
+         iCutQualityStd2010->SetITSminNClusters(0);
+         iCutQualityStd2010->SetITSmaxChi2(36);
+         iCutQualityStd2010->SetTPCminNClusters(70);
+         iCutQualityStd2010->SetTPCmaxChi2(4.0);
+         iCutQualityStd2010->SetRejectKinkDaughters();
+         //iCutQualityStd2010->SetAODTestFilterBit(10); //AOD086
+         iCutQualityStd2010->SetAODTestFilterBit(5); //AOD049 no golden cuts  
+         AddCut(iCutQualityStd2010);
+         AddCut(iCutTOFNSigma);
+         AddCut(iCutTPCTOFNSigma);
+         SetCutScheme( Form("%s&%s&%s",iCutQualityStd2010->GetName(), iCutTOFNSigma->GetName(), iCutTPCTOFNSigma->GetName()) );
+         break;
+
+       default :  
+         break;
+       }
+      
+}
+
+
+
diff --git a/PWGLF/RESONANCES/AliRsnCutSetDaughterParticle.h b/PWGLF/RESONANCES/AliRsnCutSetDaughterParticle.h
new file mode 100644 (file)
index 0000000..3d77635
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef ALIRSNCUTSETDAUGHTERPARTICLE_H
+#define ALIRSNCUTSETDAUGHTERPARTICLE_H
+
+//
+// Cuts collection for selecting good daughter candidates for rsn analysis
+//Requires:
+// 1) choice of existing cuts among the enum list
+// 2) PID ipothesis for the daughter particle
+//
+// Author: Francesca Bellini (fbellini@cern.ch)
+//
+
+#include "AliVTrack.h"
+#include "AliRsnCut.h"
+#include "AliRsnCutSet.h"
+#include "AliRsnCutTrackQuality.h"
+#include "AliRsnCutPIDNSigma.h"
+#include "AliRsnCutTOFMatch.h"
+
+class AliRsnCutSetDaughterParticle : public AliRsnCutSet {
+
+public:
+
+   enum ERsnDaughterCutSet {
+     kNoCuts,
+     kQualityStd2010,
+     kQualityStd2011,
+     kTOFMatch,
+     kFastTPCpidNsigma,
+     kFastTOFpidNsigma,
+     kTPCTOFpidKstarPP2010,
+     kTOFpidKstarPbPb2010,
+     kNDaughterCuts
+  };
+     
+   AliRsnCutSetDaughterParticle();
+   AliRsnCutSetDaughterParticle(const char *name, 
+                               AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutSetID,
+                               AliPID::EParticleType pid,
+                               Float_t nsigmaFast);
+   AliRsnCutSetDaughterParticle(const AliRsnCutSetDaughterParticle &copy);
+   AliRsnCutSetDaughterParticle &operator=(const AliRsnCutSetDaughterParticle &copy);
+   virtual ~AliRsnCutSetDaughterParticle() { }
+   
+   void           Init();
+   void           SetNsigmaForFastTPCpid(Float_t nsigma){fNsigmaTPC=nsigma; return;};
+   void           SetNsigmaForFastTOFpid(Float_t nsigma){fNsigmaTOF=nsigma; return;};
+   //getters
+   const char *  GetAppliedDaughterCutSetName() { return GetName();}
+   const Int_t   GetAppliedDaughterCutSetId() { return fAppliedCutSetID;}
+
+private:
+
+   AliPID::EParticleType fPID;              // PID for track
+   AliRsnCutSetDaughterParticle::ERsnDaughterCutSet    fAppliedCutSetID;     // ID of applied cut
+   Float_t               fNsigmaTPC;         // number of TPC sigmas for fast pid cut only
+   Float_t               fNsigmaTOF;         // number of TOF sigmas for fast pid cut only 
+   ClassDef(AliRsnCutSetDaughterParticle, 1) // cut definitions for K*
+
+};
+
+#endif
diff --git a/PWGLF/RESONANCES/AliRsnCutTOFMatch.cxx b/PWGLF/RESONANCES/AliRsnCutTOFMatch.cxx
new file mode 100644 (file)
index 0000000..303d619
--- /dev/null
@@ -0,0 +1,49 @@
+#include "AliRsnCutTOFMatch.h"
+
+ClassImp(AliRsnCutTOFMatch)
+
+AliRsnCutTOFMatch::AliRsnCutTOFMatch() :
+AliRsnCut("cut", AliRsnTarget::kDaughter)
+{
+  //Default constructor
+}
+
+//_________________________________________________________________________________________________
+AliRsnCutTOFMatch::AliRsnCutTOFMatch(const char *name) :
+  AliRsnCut(name, AliRsnTarget::kDaughter)
+{
+  //main constructor
+}
+
+//_________________________________________________________________________________________________
+Bool_t AliRsnCutTOFMatch::IsSelected(TObject *object)
+{
+//
+// Checks if the track has the status flags required for the TPC-TOF matching
+//
+  Bool_t accept = kFALSE;
+  if (!TargetOK(object)) return accept;
+  
+  AliVTrack *vtrack = fDaughter->Ref2Vtrack();
+  if (!vtrack) {
+    AliError("Referenced daughter is not a track");
+    return accept;
+  }
+  if (MatchTOF(vtrack)) accept = kTRUE;
+  return accept;
+}
+
+//-----------------------------------------------------
+inline Bool_t AliRsnCutTOFMatch::MatchTOF(const AliVTrack *vtrack) const
+{
+//
+// Checks if the track has matched the TOF detector
+//
+   if (!vtrack) {
+      AliWarning("NULL argument: impossible to check status");
+      return kFALSE;
+   }
+   if ((vtrack->GetStatus() & AliESDtrack::kTOFout) == 0) return kFALSE;
+   if ((vtrack->GetStatus() & AliESDtrack::kTIME  ) == 0) return kFALSE;
+   return kTRUE;
+}
diff --git a/PWGLF/RESONANCES/AliRsnCutTOFMatch.h b/PWGLF/RESONANCES/AliRsnCutTOFMatch.h
new file mode 100644 (file)
index 0000000..f129fee
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef ALIRSNCUTTOFMATCH_H
+#define ALIRSNCUTTOFMATCH_H
+
+//
+// Class for TOF-matching cut.
+// Author: Francesca Bellini (fbellini@cern.ch)
+
+#include <TMath.h>
+#include <TClonesArray.h>
+
+#include "AliESDtrack.h"
+#include "AliRsnCut.h"
+
+class AliVTrack;
+
+class AliRsnCutTOFMatch : public AliRsnCut {
+ public:
+  
+  AliRsnCutTOFMatch();
+  AliRsnCutTOFMatch(const char *name);
+  virtual ~AliRsnCutTOFMatch() { }
+  
+  Bool_t   MatchTOF(const AliVTrack *vtrack) const;
+  Bool_t   IsSelected(TObject *object);
+
+  ClassDef(AliRsnCutTOFMatch, 1)
+
+};
+
+#endif