]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added new class for azimuthal angle cut in Rsn package
authorfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Apr 2013 12:28:42 +0000 (12:28 +0000)
committerfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Apr 2013 12:28:42 +0000 (12:28 +0000)
PWGLF/CMakelibPWGLFresonances.pkg
PWGLF/PWGLFresonancesLinkDef.h
PWGLF/RESONANCES/AliRsnCutPhi.cxx [new file with mode: 0644]
PWGLF/RESONANCES/AliRsnCutPhi.h [new file with mode: 0644]

index b106087e20aaf9ee0369a800788735814fb6b5e6..5164289a207a718ebe67d627b387b12feae45ac8 100644 (file)
@@ -50,6 +50,7 @@ set ( SRCS RESONANCES/AliRsnDaughter.cxx
            RESONANCES/AliRsnCutPIDNSigma.cxx
            RESONANCES/AliRsnCutMomentumComparison.cxx
           RESONANCES/AliRsnCutTOFMatch.cxx
+          RESONANCES/AliRsnCutPhi.cxx
            RESONANCES/AliRsnCutKaonForPhi2010.cxx
            RESONANCES/AliRsnCutKaonForPhi2010PP.cxx
            RESONANCES/AliRsnCutPion2010PP.cxx
index 396698acda2a4b614d81be9d4478f1d36dd548d0..2c69f0ccf8d09ff6cf75a58150b6447621b45bd5 100644 (file)
@@ -29,6 +29,7 @@
 #pragma link C++ class AliRsnCutPIDNSigma+;
 #pragma link C++ class AliRsnCutMomentumComparison+;
 #pragma link C++ class AliRsnCutTOFMatch+;
+#pragma link C++ class AliRsnCutPhi+;
 #pragma link C++ class AliRsnCutKaonForPhi2010+;
 #pragma link C++ class AliRsnCutKaonForPhi2010PP+;
 #pragma link C++ class AliRsnCutPion2010PP+;
diff --git a/PWGLF/RESONANCES/AliRsnCutPhi.cxx b/PWGLF/RESONANCES/AliRsnCutPhi.cxx
new file mode 100644 (file)
index 0000000..c32e9bc
--- /dev/null
@@ -0,0 +1,143 @@
+#include "AliRsnCutPhi.h"
+
+ClassImp(AliRsnCutPhi)
+
+AliRsnCutPhi::AliRsnCutPhi() :
+  AliRsnCut("cut", AliRsnTarget::kDaughter),
+  fOption("")
+{
+   //Default constructor
+  SetPhiRange(0.0, 360.0);
+}
+
+//_________________________________________________________________________________________________
+AliRsnCutPhi::AliRsnCutPhi(const char *name, TString opt) :
+  AliRsnCut(name, AliRsnTarget::kDaughter),
+  fOption(opt.Data())
+{
+   //main constructor
+  SetPhiRange(0.0, 360.0);
+}
+
+//_________________________________________________________________________________________________
+AliRsnCutPhi::AliRsnCutPhi(const AliRsnCutPhi &copy) :
+  AliRsnCut(copy),
+  fOption(copy.fOption)
+{
+  //copy constructor
+  SetPhiRange(copy.fPhiRange[0], copy.fPhiRange[1]);
+}
+//_________________________________________________________________________________________________
+AliRsnCutPhi &AliRsnCutPhi::operator=(const AliRsnCutPhi &copy)
+{
+  //
+  // operator =
+  //
+  AliRsnCut::operator=(copy);
+  if (this == &copy)
+    return *this;
+  
+  fOption=copy.fOption;
+  SetPhiRange(copy.fPhiRange[0], copy.fPhiRange[1]);
+  return (*this); 
+}
+//_________________________________________________________________________________________________
+Bool_t AliRsnCutPhi::IsSelected(TObject *object)
+{
+  //
+  // Checks if the track passes the phi cut
+  //
+  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 (fOption.Contains("InTRD")) return IsInsideTRD(vtrack);
+  if (fOption.Contains("OutTRD")) return IsOutsideTRD(vtrack);
+  
+  Double_t value = 90.0; 
+  if (fOption.Contains("OuterTPC")) value = GetTrackPhi(vtrack, 278.0);
+  if (fOption.Contains("InnerTOF")) value = GetTrackPhi(vtrack, 378.0);
+  
+  if ( (value>=fPhiRange[0]) && (value<=fPhiRange[1]) ) 
+    accept = kTRUE;
+  else 
+    accept = kFALSE;
+  
+  return accept;
+}
+
+//_________________________________________________________________________________________________
+Bool_t AliRsnCutPhi::IsInsideTRD(AliVTrack *vtrack)
+{
+  //
+  // Checks if track falls inside the TRD sectors
+  // implemented for 2010 configuration only 
+  // edge effects removed by tightening the phi cut by 5 deg 
+  //
+  Bool_t accept = kFALSE;
+  if (!vtrack) {
+    AliError("Referenced daughter is not a track");
+    return accept;
+  }
+  Double_t value = GetTrackPhi(vtrack, 278.0);
+  if ( ((value>=0.0) && (value<=35.0)) ||
+       ((value>=135.0) && (value<=215.0)) ||
+       ((value>=345.0) && (value<=360.0)) ) 
+    accept = kTRUE;
+  else 
+    accept = kFALSE;
+  return accept;
+}
+//_________________________________________________________________________________________________
+Bool_t AliRsnCutPhi::IsOutsideTRD(AliVTrack *vtrack)
+{
+  //
+  // Checks if track falls inside the TRD sectors 
+  // implemented for 2010 configuration only 
+  // edge effects removed by tightening the phi cut by 5 deg 
+  //
+  Bool_t accept = kFALSE;
+  if (!vtrack) {
+    AliError("Referenced daughter is not a track");
+    return accept;
+  }
+  Double_t value = GetTrackPhi(vtrack, 278.0);
+  if ( ((value>=45.0) && (value<=125.0)) ||
+       ((value>=225.0) && (value<=335.0)) ) 
+    accept = kTRUE;
+  else 
+    accept = kFALSE;
+  return accept;
+}
+
+//----------------------------------------------------------------------------
+Double_t AliRsnCutPhi::GetTrackPhi(AliVTrack * vtrack, Double_t radius = 0.0)
+{
+  //
+  // Extract phi from vtrack object at radius r 
+  // If r==0 (default), provides phi at vertex 
+  //
+  Double_t pos[3]={0.,0.,0.};
+  Double_t phiOut = -999.0;
+  
+  if (!vtrack) {
+    AliError("Invalid VTrack object");
+    return phiOut;
+  }
+  if (radius==0.0){
+    phiOut=vtrack->Phi()*TMath::RadToDeg();
+  } else {
+    AliExternalTrackParam etp; 
+    etp.CopyFromVTrack(vtrack);
+    if(etp.GetXYZAt(radius, 5., pos)){
+      phiOut=TMath::ATan2(pos[1],pos[0])*TMath::RadToDeg();
+      if (phiOut<0) phiOut+= (2*TMath::Pi()*TMath::RadToDeg());
+    }
+  }
+  return phiOut;       
+}
diff --git a/PWGLF/RESONANCES/AliRsnCutPhi.h b/PWGLF/RESONANCES/AliRsnCutPhi.h
new file mode 100644 (file)
index 0000000..bd2ea2c
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef ALIRSNCUTPHI_H
+#define ALIRSNCUTPHI_H
+
+/***************************************************************************
+ Class for single track/daughter phi cut.
+ Author: Francesca Bellini (fbellini@cern.ch)
+
+Options:
+- "OuterTPC" apply cut to phi estimated at the TPC outer radius 
+- "InTRD" select phi (at outer TPC radius) region corresponding to the TRD modules
+   (2010 config) where a 5° region is excluded to avoid border effects 
+- "OutTRD" select phi (at outer TPC radius) region without TRD modules 
+   (2010 config) where a 5° region is excluded to avoid border effects 
+****************************************************************************/
+#include <TMath.h>
+#include <TClonesArray.h>
+
+#include "AliESDtrack.h"
+#include "AliRsnCut.h"
+//#include "AliRsnValueDaughter.h";
+#include "AliVTrack.h"
+
+class AliRsnCutPhi : public AliRsnCut {
+ public:
+  
+  AliRsnCutPhi();
+  AliRsnCutPhi(const char *name, TString opt);
+  AliRsnCutPhi(const AliRsnCutPhi &copy);
+  AliRsnCutPhi &operator=(const AliRsnCutPhi &copy);
+  virtual ~AliRsnCutPhi() { }
+  
+  Bool_t   IsSelected(TObject *object);
+  void     SetPhiRange(Double_t a, Double_t b) {fPhiRange[0]=a; fPhiRange[1]=b; return;};
+  
+ protected:
+  Bool_t   IsInsideTRD(AliVTrack *vtrack);
+  Bool_t   IsOutsideTRD(AliVTrack *vtrack);
+  Double_t   GetTrackPhi(AliVTrack * vtrack, Double_t radius);
+
+ private:
+  TString  fOption;
+  Double_t fPhiRange[2];
+  //AliRsnValueDaughter *fPhi;
+  //  Double_t fPhi;
+  ClassDef(AliRsnCutPhi, 1)
+    
+};
+
+#endif