Splitted the PID cuts into three classes for ITS, TPC and TOF, and added the possibil...
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Jan 2011 11:08:11 +0000 (11:08 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Jan 2011 11:08:11 +0000 (11:08 +0000)
Moved all the code in RESONANCES directory which is not related to RSN package into the 'extra' directory
Removed some obsolete cut classes which are no longer used nor supported.

22 files changed:
PWG2/CMakelibPWG2resonances.pkg
PWG2/PWG2resonancesLinkDef.h
PWG2/RESONANCES/AliRsnCutBetheBloch.cxx [deleted file]
PWG2/RESONANCES/AliRsnCutBetheBloch.h [deleted file]
PWG2/RESONANCES/AliRsnCutDaughterType.cxx [deleted file]
PWG2/RESONANCES/AliRsnCutDaughterType.h [deleted file]
PWG2/RESONANCES/AliRsnCutESDCutMultiplicity.cxx [deleted file]
PWG2/RESONANCES/AliRsnCutESDCutMultiplicity.h [deleted file]
PWG2/RESONANCES/AliRsnCutPIDITS.cxx [new file with mode: 0644]
PWG2/RESONANCES/AliRsnCutPIDITS.h [new file with mode: 0644]
PWG2/RESONANCES/AliRsnCutPIDTOF.cxx
PWG2/RESONANCES/AliRsnCutPIDTOF.h
PWG2/RESONANCES/AliRsnCutPIDTPC.cxx [new file with mode: 0644]
PWG2/RESONANCES/AliRsnCutPIDTPC.h [new file with mode: 0644]
PWG2/RESONANCES/extra/AliRsnAnalysisPhi7TeV.cxx [moved from PWG2/RESONANCES/AliRsnAnalysisPhi7TeV.cxx with 100% similarity]
PWG2/RESONANCES/extra/AliRsnAnalysisPhi7TeV.h [moved from PWG2/RESONANCES/AliRsnAnalysisPhi7TeV.h with 100% similarity]
PWG2/RESONANCES/extra/AliRsnAnalysisPhi7TeVNoPID.cxx [moved from PWG2/RESONANCES/AliRsnAnalysisPhi7TeVNoPID.cxx with 100% similarity]
PWG2/RESONANCES/extra/AliRsnAnalysisPhi7TeVNoPID.h [moved from PWG2/RESONANCES/AliRsnAnalysisPhi7TeVNoPID.h with 100% similarity]
PWG2/RESONANCES/extra/AliRsnAnalysisPhi900GeV.cxx [moved from PWG2/RESONANCES/AliRsnAnalysisPhi900GeV.cxx with 100% similarity]
PWG2/RESONANCES/extra/AliRsnAnalysisPhi900GeV.h [moved from PWG2/RESONANCES/AliRsnAnalysisPhi900GeV.h with 100% similarity]
PWG2/RESONANCES/extra/AliRsnTOFT0maker.cxx [new file with mode: 0644]
PWG2/RESONANCES/extra/AliRsnTOFT0maker.h [new file with mode: 0644]

index 64b843b..ab1dea1 100644 (file)
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS  RESONANCES/AliRsnDaughter.cxx RESONANCES/AliRsnMother.cxx RESONANCES/AliRsnPairDef.cxx RESONANCES/AliRsnEvent.cxx RESONANCES/AliRsnTarget.cxx RESONANCES/AliRsnValue.cxx RESONANCES/AliRsnCut.cxx RESONANCES/AliRsnCutValue.cxx RESONANCES/AliRsnCutPID.cxx RESONANCES/AliRsnCutBetheBloch.cxx RESONANCES/AliRsnCutPrimaryVertex.cxx RESONANCES/AliRsnCutESDPrimary.cxx RESONANCES/AliRsnCutDaughterType.cxx RESONANCES/AliRsnCutESD2010.cxx RESONANCES/AliRsnCutAOD2010.cxx RESONANCES/AliRsnCutTrackQuality.cxx RESONANCES/AliRsnCutPIDTOF.cxx RESONANCES/AliRsnCutSet.cxx RESONANCES/AliRsnExpression.cxx RESONANCES/AliRsnVariableExpression.cxx RESONANCES/AliRsnCutManager.cxx RESONANCES/AliRsnFunction.cxx RESONANCES/AliRsnPair.cxx RESONANCES/AliRsnPairFunctions.cxx RESONANCES/AliRsnPairNtuple.cxx RESONANCES/AliRsnAnalysisManager.cxx RESONANCES/AliRsnVATProcessInfo.cxx RESONANCES/AliRsnVAnalysisTaskSE.cxx RESONANCES/AliRsnVAnalysisTaskME.cxx RESONANCES/AliRsnAnalysisSE.cxx RESONANCES/AliRsnAnalysisME.cxx RESONANCES/AliRsnAnalysisEffSE.cxx RESONANCES/AliRsnTOFT0maker.cxx RESONANCES/AliRsnAnalysisPhi900GeV.cxx RESONANCES/AliRsnAnalysisPhi7TeV.cxx RESONANCES/AliRsnAnalysisPhi7TeVNoPID.cxx RESONANCES/AliRsnMonitorTrack.cxx RESONANCES/AliRsnAnalysisMonitorTask.cxx RESONANCES/AliRsnAnalysisMonitorTask.cxx RESONANCES/AliRsnAnalysisPhiKK.cxx RESONANCES/AliRsnAnalysisKStarKpi.cxx RESONANCES/AliRsnVAnalysisTask.cxx RESONANCES/AliRsnAnalysisTask.cxx  RESONANCES/extra/AliAnalysisTaskSigma1385.cxx )
+set ( SRCS RESONANCES/AliRsnDaughter.cxx
+           RESONANCES/AliRsnMother.cxx 
+           RESONANCES/AliRsnPairDef.cxx 
+           RESONANCES/AliRsnEvent.cxx 
+           RESONANCES/AliRsnTarget.cxx 
+           RESONANCES/AliRsnValue.cxx 
+           RESONANCES/AliRsnCut.cxx 
+           RESONANCES/AliRsnCutValue.cxx 
+           RESONANCES/AliRsnCutPrimaryVertex.cxx 
+           RESONANCES/AliRsnCutESD2010.cxx 
+           RESONANCES/AliRsnCutAOD2010.cxx 
+           RESONANCES/AliRsnCutTrackQuality.cxx 
+           RESONANCES/AliRsnCutPID.cxx 
+           RESONANCES/AliRsnCutPIDITS.cxx 
+           RESONANCES/AliRsnCutPIDTPC.cxx 
+           RESONANCES/AliRsnCutPIDTOF.cxx 
+           RESONANCES/AliRsnCutSet.cxx 
+           RESONANCES/AliRsnExpression.cxx 
+           RESONANCES/AliRsnVariableExpression.cxx 
+           RESONANCES/AliRsnCutManager.cxx 
+           RESONANCES/AliRsnFunction.cxx 
+           RESONANCES/AliRsnPair.cxx 
+           RESONANCES/AliRsnPairFunctions.cxx 
+           RESONANCES/AliRsnPairNtuple.cxx 
+           RESONANCES/AliRsnAnalysisManager.cxx 
+           RESONANCES/AliRsnVATProcessInfo.cxx 
+           RESONANCES/AliRsnVAnalysisTaskSE.cxx 
+           RESONANCES/AliRsnVAnalysisTaskME.cxx 
+           RESONANCES/AliRsnAnalysisSE.cxx 
+           RESONANCES/AliRsnAnalysisME.cxx 
+           RESONANCES/AliRsnAnalysisEffSE.cxx 
+           RESONANCES/AliRsnAnalysisPhiKK.cxx 
+           RESONANCES/AliRsnAnalysisKStarKpi.cxx 
+           RESONANCES/AliRsnVAnalysisTask.cxx 
+           RESONANCES/AliRsnAnalysisTask.cxx 
+           RESONANCES/AliRsnMonitorTrack.cxx 
+           RESONANCES/AliRsnAnalysisMonitorTask.cxx 
+           RESONANCES/extra/AliRsnTOFT0maker.cxx 
+           RESONANCES/extra/AliRsnAnalysisPhi900GeV.cxx 
+           RESONANCES/extra/AliRsnAnalysisPhi7TeV.cxx 
+           RESONANCES/extra/AliRsnAnalysisPhi7TeVNoPID.cxx 
+           RESONANCES/extra/AliAnalysisTaskSigma1385.cxx )
 
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
 
index 4ff7235..d26d629 100644 (file)
 #pragma link C++ class AliRsnCut+;
 
 #pragma link C++ class AliRsnCutValue+;
-#pragma link C++ class AliRsnCutPID+;
-#pragma link C++ class AliRsnCutBetheBloch+;
 #pragma link C++ class AliRsnCutPrimaryVertex+;
-#pragma link C++ class AliRsnCutESDPrimary+;
-#pragma link C++ class AliRsnCutDaughterType+;
 #pragma link C++ class AliRsnCutESD2010+;
 #pragma link C++ class AliRsnCutAOD2010+;
 #pragma link C++ class AliRsnCutTrackQuality+;
+#pragma link C++ class AliRsnCutPID+;
+#pragma link C++ class AliRsnCutPIDITS+;
+#pragma link C++ class AliRsnCutPIDTPC+;
 #pragma link C++ class AliRsnCutPIDTOF+;
 
 #pragma link C++ class AliRsnCutSet+;
 #pragma link C++ class AliRsnAnalysisSE+;
 #pragma link C++ class AliRsnAnalysisME+;
 #pragma link C++ class AliRsnAnalysisEffSE+;
-
-#pragma link C++ class AliRsnTOFT0maker+;
-#pragma link C++ class AliRsnAnalysisPhi900GeV+;
-#pragma link C++ class AliRsnAnalysisPhi7TeV+;
-#pragma link C++ class AliRsnAnalysisPhi7TeVNoPID+;
-
-#pragma link C++ class AliRsnMonitorTrack+;
-#pragma link C++ class AliRsnAnalysisMonitorTask+;
-
 #pragma link C++ class AliRsnAnalysisPhiKK+;
 #pragma link C++ class AliRsnAnalysisKStarKpi+;
 
 #pragma link C++ class AliRsnVAnalysisTask+;
 #pragma link C++ class AliRsnAnalysisTask+;
 
+#pragma link C++ class AliRsnMonitorTrack+;
+#pragma link C++ class AliRsnAnalysisMonitorTask+;
+
+#pragma link C++ class AliRsnTOFT0maker+;
+#pragma link C++ class AliRsnAnalysisPhi900GeV+;
+#pragma link C++ class AliRsnAnalysisPhi7TeV+;
+#pragma link C++ class AliRsnAnalysisPhi7TeVNoPID+;
 #pragma link C++ class AliAnalysisTaskSigma1385+;
 
 #endif
diff --git a/PWG2/RESONANCES/AliRsnCutBetheBloch.cxx b/PWG2/RESONANCES/AliRsnCutBetheBloch.cxx
deleted file mode 100644 (file)
index 329426f..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// Class AliRsnCutBetheBloch
-//
-// General implementation of a single cut strategy, which can be:
-// - a value contained in a given interval  [--> IsBetween()   ]
-// - a value equal to a given reference     [--> MatchesValue()]
-//
-// In all cases, the reference value(s) is (are) given as data members
-// and each kind of cut requires a given value type (Int, UInt, Double),
-// but the cut check procedure is then automatized and chosen thanks to
-// an enumeration of the implemented cut types.
-// At the end, the user (or any other point which uses this object) has
-// to use the method IsSelected() to check if this cut has been passed.
-//
-// authors: Martin Vala (martin.vala@cern.ch)
-//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
-//
-#include "TMath.h"
-
-#include "AliExternalTrackParam.h"
-
-#include "AliRsnDaughter.h"
-#include "AliRsnCutBetheBloch.h"
-
-ClassImp(AliRsnCutBetheBloch)
-
-//_________________________________________________________________________________________________
-AliRsnCutBetheBloch::AliRsnCutBetheBloch() :
-  AliRsnCut("dummyBBCut", AliRsnTarget::kDaughter),
-  fCorrect(kTRUE),
-  fMIP(50.0),
-  fType(AliPID::kUnknown)
-{
-//
-// Default constructor.
-//
-
-  fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
-}
-
-//_________________________________________________________________________________________________
-AliRsnCutBetheBloch::AliRsnCutBetheBloch
-(const char *name, Double_t fractionRange, AliPID::EParticleType type, Double_t mip, Bool_t correct) :
-  AliRsnCut(name, AliRsnCut::kDaughter, 0.0, fractionRange),
-  fCorrect(correct),
-  fMIP(mip),
-  fType(type)
-{
-//
-// Main constructor.
-// the cut range is the relative fraction of the value:
-// BB*(1-fraction) < TPC < BB*(1+fraction)
-// which means:
-// -fraction < (TPC - BB)/BB < fraction
-//
-
-  fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
-}
-
-//_____________________________________________________________________________
-Double_t AliRsnCutBetheBloch::BetheBloch(AliRsnDaughter * const trackRef)
-{
-//
-// Computes the theoretical dE/dx according to
-// a given mass hypothesis, from which betaGamma is computed
-//
-// This is the empirical ALEPH parameterization of the Bethe-Bloch formula.
-// It is normalized to 1 at the minimum.
-//
-// The default values for the kp* parameters are for ALICE TPC.
-// The value is computed in MIP units, multiplied by 50 to have it in energy.
-//
-
-  AliPID pid;
-  Double_t mass = pid.ParticleMass(fType);
-
-  // get the track momentum at the inner wall of TPC: if absent cut is not passed
-  AliExternalTrackParam track(*trackRef->GetRefESDtrack()->GetInnerParam());
-
-  Double_t betaGamma = track.P() / mass;
-  Double_t beta = betaGamma / TMath::Sqrt(1.0 + betaGamma * betaGamma);
-  Double_t aa = TMath::Power(beta, fConst[3]);
-  Double_t bb = TMath::Power(1.0 / betaGamma, fConst[4]);
-
-  bb = TMath::Log(fConst[2] + bb);
-
-  Double_t out = (fConst[1] - aa - bb) * fConst[0] / aa;
-
-  if (fCorrect) {
-    Double_t kMeanCorr = 0.1;
-    Double_t meanCorr = (1 + (out - 1) * kMeanCorr);
-    out *= meanCorr;
-  }
-
-  return out * fMIP;
-}
-
-//_____________________________________________________________________________
-Double_t AliRsnCutBetheBloch::RelDiff(AliRsnDaughter *track)
-{
-//
-// Relative difference between BB value and TPC signal
-//
-
-  if (!track->GetRefESDtrack()) return -99999.9;
-
-  // compute Bethe-Bloch with the given mass hypothesis
-  Double_t bb = BetheBloch(track);
-  return TMath::Abs((track->GetRefESDtrack()->GetTPCsignal() - bb) / bb);
-}
-
-//_________________________________________________________________________________________________
-Bool_t AliRsnCutBetheBloch::IsSelected(TObject *object)
-{
-//
-// Cut checker.
-//
-
-  // dynamic cast the object into AliRsnDaughter
-  if (!TargetOK(object)) return kFALSE;
-
-  // retrieve the TPC signal
-  AliRsnDaughter *track = fDaughter;
-  
-  // if track is meaningful, retrieve its ESD format
-  AliESDtrack    *esd   = track->GetRefESDtrack();
-  if (!esd) {
-    AliError("ESD information unavailable");
-    return kTRUE;
-  }
-  if (!track->GetRefESDtrack()->GetInnerParam()) {
-    AliDebug(AliLog::kDebug+2, "Rejecting a track with no info at the TPC inner wall");
-    return kFALSE;
-  }
-
-  // the cut range is the relative fraction of the value:
-  // BB*(1-fraction) < TPC < BB*(1+fraction)
-  // which means:
-  // -fraction < (TPC - BB)/BB < fraction
-  // so we must compute the cut value accordingly
-  fCutValueD = RelDiff(track);
-
-  // then, this cut is checked inside the range
-  return OkRangeD();
-}
diff --git a/PWG2/RESONANCES/AliRsnCutBetheBloch.h b/PWG2/RESONANCES/AliRsnCutBetheBloch.h
deleted file mode 100644 (file)
index 1421d6d..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// Class AliRsnCutRange
-//
-// General implementation of cuts which check a value inside a range.
-// This range can be defined by two integers or two doubles.
-// A user-friendly enumeration allows to define what is checked.
-//
-// authors: Martin Vala (martin.vala@cern.ch)
-//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
-//
-
-#ifndef ALIRSNCUTBETHEBLOCH_H
-#define ALIRSNCUTBETHEBLOCH_H
-
-#include "AliPID.h"
-#include "AliRsnCut.h"
-
-class AliRsnCutBetheBloch : public AliRsnCut
-{
-  public:
-
-    AliRsnCutBetheBloch();
-    AliRsnCutBetheBloch(const char *name, Double_t fractionRange, AliPID::EParticleType type, Double_t mip = 50.0, Bool_t correct = kTRUE);
-    virtual ~AliRsnCutBetheBloch() {;};
-
-    void           SetType(AliPID::EParticleType type) {fType = type;}
-    void           SetMIP(Double_t mip) {fMIP = mip;}
-    void           SetCalibConstant(Int_t i, Double_t value) {if (i>=0&&i<5) fConst[i] = value;}
-    Double_t       BetheBloch(AliRsnDaughter*const track);
-    Double_t       RelDiff(AliRsnDaughter *track);
-
-    virtual Bool_t IsSelected(TObject *object);
-
-  protected:
-
-    Bool_t                fCorrect;   // apply or not the saturation corrections
-    Double_t              fMIP;       // MIP normalization
-    Double_t              fConst[5];  // calibration constants
-    AliPID::EParticleType fType;      // reference particle type
-
-    ClassDef(AliRsnCutBetheBloch, 1)
-};
-
-#endif
diff --git a/PWG2/RESONANCES/AliRsnCutDaughterType.cxx b/PWG2/RESONANCES/AliRsnCutDaughterType.cxx
deleted file mode 100644 (file)
index 0c03e74..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// Class AliRsnCutDaughterType
-//
-// General implementation of a single cut strategy, which can be:
-// - a value contained in a given interval  [--> IsBetween()   ]
-// - a value equal to a given reference     [--> MatchesValue()]
-//
-// In all cases, the reference value(s) is (are) given as data members
-// and each kind of cut requires a given value type (Int, UInt, Double),
-// but the cut check procedure is then automatized and chosen thanks to
-// an enumeration of the implemented cut types.
-// At the end, the user (or any other point which uses this object) has
-// to use the method IsSelected() to check if this cut has been passed.
-//
-// authors: Martin Vala (martin.vala@cern.ch)
-//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
-//
-
-#include "AliRsnDaughter.h"
-#include "AliRsnCutDaughterType.h"
-
-ClassImp(AliRsnCutDaughterType)
-
-//_________________________________________________________________________________________________
-AliRsnCutDaughterType::AliRsnCutDaughterType() :
-  AliRsnCut(),
-  fRefType(kTypes)
-{
-//
-// Default constructor.
-//
-
-  SetTargetType(AliRsnTarget::kDaughter);
-}
-
-//_________________________________________________________________________________________________
-AliRsnCutDaughterType::AliRsnCutDaughterType
-(const char *name, EType type) :
-  AliRsnCut(name, AliRsnCut::kDaughter, 0.0, 0.0),
-  fRefType(type)
-{
-//
-// Main constructor.
-//
-}
-
-//_________________________________________________________________________________________________
-Bool_t AliRsnCutDaughterType::IsSelected(TObject *object)
-{
-//
-// Cut checker.
-//
-
-  // coherence check
-  if (!TargetOK(object)) return kFALSE;
-  
-  // check the daughter according to the selected type
-  // in some cases this means to retrieve the track status
-  AliRsnDaughter *daughter = fDaughter;
-  AliVTrack   *track  = dynamic_cast<AliVTrack*>(daughter->GetRef());
-  AliESDtrack *esdT   = dynamic_cast<AliESDtrack*>(daughter->GetRef());
-  ULong_t      status = 0x0;
-  if (track) status = (ULong_t)track->GetStatus();
-  
-  switch (fRefType)
-  {
-    case kTrackTPC:
-      return ((status & AliESDtrack::kTPCin)  != 0);
-    case kTrackITSSA:
-      if (esdT && track)
-      {
-        UChar_t itsCluMap = track->GetITSClusterMap();
-        Int_t   k, nITS   = 0;
-        for(k = 2; k < 6; k++) if(itsCluMap & (1 << k)) ++nITS;
-        if (nITS < 3) return kFALSE;
-      }
-      return ((status & AliESDtrack::kTPCin)  == 0 && (status & AliESDtrack::kITSrefit) != 0 && (status & AliESDtrack::kITSpureSA) == 0 && (status & AliESDtrack::kITSpid) != 0);
-    case kV0:
-      return daughter->IsV0();
-    default:
-      AliError("No good reference type is chosen. Cut skipped");
-      return kTRUE;
-  }
-}
diff --git a/PWG2/RESONANCES/AliRsnCutDaughterType.h b/PWG2/RESONANCES/AliRsnCutDaughterType.h
deleted file mode 100644 (file)
index 69ece70..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// Class AliRsnCutRange
-//
-// General implementation of cuts which check a value inside a range.
-// This range can be defined by two integers or two doubles.
-// A user-friendly enumeration allows to define what is checked.
-//
-// authors: Martin Vala (martin.vala@cern.ch)
-//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
-//
-
-#ifndef ALIRSNCUTDAUGHTERTYPE_H
-#define ALIRSNCUTDAUGHTERTYPE_H
-
-#include "AliRsnCut.h"
-
-class AliRsnCutDaughterType : public AliRsnCut
-{
-  public:
-  
-    enum EType
-    {
-      kTrackTPC,
-      kTrackITSSA,
-      kV0,
-      kTypes
-    };
-
-    AliRsnCutDaughterType();
-    AliRsnCutDaughterType(const char *name, EType type);
-    virtual ~AliRsnCutDaughterType() {;};
-
-    virtual Bool_t IsSelected(TObject *object);
-
-  protected:
-  
-    EType fRefType;   // type to which the track format is compared
-
-    ClassDef(AliRsnCutDaughterType, 1)
-};
-
-#endif
diff --git a/PWG2/RESONANCES/AliRsnCutESDCutMultiplicity.cxx b/PWG2/RESONANCES/AliRsnCutESDCutMultiplicity.cxx
deleted file mode 100644 (file)
index 54e8aa1..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Class AliRsnCutESDCutMultiplicity
-//
-// Cuts on event multiplicity computed from number o tracks passing
-// the ESDtrackCuts defined as data member.
-//
-// authors: Martin Vala (martin.vala@cern.ch)
-//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
-//
-
-#include "AliRsnEvent.h"
-#include "AliRsnCutESDCutMultiplicity.h"
-
-ClassImp(AliRsnCutESDCutMultiplicity)
-
-//_________________________________________________________________________________________________
-AliRsnCutESDCutMultiplicity::AliRsnCutESDCutMultiplicity() :
-  AliRsnCut(AliRsnCut::kEvent),
-  fCuts()
-{
-//
-// Default constructor.
-//
-}
-
-//_________________________________________________________________________________________________
-AliRsnCutESDCutMultiplicity::AliRsnCutESDCutMultiplicity
-(const char *name, Int_t min, Int_t max) :
-  AliRsnCut(name, AliRsnCut::kEvent, min, max),
-  fCuts()
-{
-//
-// Main constructor.
-//
-}
-
-//_________________________________________________________________________________________________
-Bool_t AliRsnCutESDCutMultiplicity::IsSelected(TObject *obj1, TObject* /*obj2*/)
-{
-//
-// Cut checker.
-//
-
-  // coherence check
-  AliRsnEvent *event = dynamic_cast<AliRsnEvent*>(obj1);
-  if (!event) return kFALSE;
-  AliESDEvent *esd   = event->GetRefESD();
-  if (!esd) return kFALSE;
-  
-  // count the tracks passing the cut
-  fCutValueI = fCuts.CountAcceptedTracks(esd);
-  return OkRangeI();
-}
diff --git a/PWG2/RESONANCES/AliRsnCutESDCutMultiplicity.h b/PWG2/RESONANCES/AliRsnCutESDCutMultiplicity.h
deleted file mode 100644 (file)
index f18b89d..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Class AliRsnCutRange
-//
-// General implementation of cuts which check a value inside a range.
-// This range can be defined by two integers or two doubles.
-// A user-friendly enumeration allows to define what is checked.
-//
-// authors: Martin Vala (martin.vala@cern.ch)
-//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
-//
-
-#ifndef ALIRSNCUTESDCUTMULTIPLICITY_H
-#define ALIRSNCUTESDCUTMULTIPLICITY_H
-
-#include "AliESDtrackCuts.h"
-#include "AliRsnCut.h"
-
-class AliRsnCutESDCutMultiplicity : public AliRsnCut
-{
-  public:
-
-    AliRsnCutESDCutMultiplicity();
-    AliRsnCutESDCutMultiplicity(const char *name, Int_t min, Int_t max);
-    virtual ~AliRsnCutESDCutMultiplicity() {;};
-
-    const AliESDtrackCuts* GetCuts() const {return &fCuts;}
-    virtual Bool_t IsSelected(TObject *object);
-
-  protected:
-
-    AliESDtrackCuts fCuts;  // set of ESD track cuts
-
-    ClassDef(AliRsnCutESDCutMultiplicity, 1)
-};
-
-#endif
diff --git a/PWG2/RESONANCES/AliRsnCutPIDITS.cxx b/PWG2/RESONANCES/AliRsnCutPIDITS.cxx
new file mode 100644 (file)
index 0000000..1490423
--- /dev/null
@@ -0,0 +1,207 @@
+//
+// Class AliRsnCutPIDITS
+//
+// General implementation of a single cut strategy, which can be:
+// - a value contained in a given interval  [--> IsBetween()   ]
+// - a value equal to a given reference     [--> MatchesValue()]
+//
+// In all cases, the reference value(s) is (are) given as data members
+// and each kind of cut requires a given value type (Int, UInt, Double),
+// but the cut check procedure is then automatized and chosen thanks to
+// an enumeration of the implemented cut types.
+// At the end, the user (or any other point which uses this object) has
+// to use the method IsSelected() to check if this cut has been passed.
+//
+// authors: Martin Vala (martin.vala@cern.ch)
+//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//
+
+#include <Riostream.h>
+
+#include "AliESDpid.h"
+#include "AliTOFT0maker.h"
+#include "AliTOFcalib.h"
+#include "AliCDBManager.h"
+#include "AliITSPIDResponse.h"
+
+#include "AliRsnEvent.h"
+#include "AliRsnDaughter.h"
+#include "AliRsnCutPIDITS.h"
+
+ClassImp(AliRsnCutPIDITS)
+
+//_________________________________________________________________________________________________
+AliRsnCutPIDITS::AliRsnCutPIDITS
+(const char *name, AliPID::EParticleType type, Bool_t isMC, Double_t momLimit, Double_t cut1, Double_t cut2) :
+  AliRsnCut(name, AliRsnCut::kDaughter, 0.0, 0.0),
+  fPIDtype(type),
+  fIsMC(isMC),
+  fMomentumLimit(momLimit),
+  fLargeCut(TMath::Max(cut1, cut2)),
+  fSmallCut(TMath::Min(cut1, cut2)),
+  fESDpid(),
+  fAODpid()
+{
+//
+// Main constructor.
+//
+
+  SetMC(isMC);
+}
+
+//_________________________________________________________________________________________________
+AliRsnCutPIDITS::AliRsnCutPIDITS
+(const AliRsnCutPIDITS& copy) :
+  AliRsnCut(copy),
+  fPIDtype(copy.fPIDtype),
+  fIsMC(copy.fIsMC),
+  fMomentumLimit(copy.fMomentumLimit),
+  fLargeCut(copy.fLargeCut),
+  fSmallCut(copy.fSmallCut),
+  fESDpid(copy.fESDpid),
+  fAODpid(copy.fAODpid)
+{
+//
+// Copy constructor.
+//
+
+  SetMC(copy.fIsMC);
+}
+
+//_________________________________________________________________________________________________
+AliRsnCutPIDITS& AliRsnCutPIDITS::operator=(const AliRsnCutPIDITS& copy)
+{
+//
+// Assignment operator
+//
+
+  AliRsnCut::operator=(copy);
+
+  fPIDtype = copy.fPIDtype;
+  fMomentumLimit = copy.fMomentumLimit;
+  fLargeCut = copy.fLargeCut;
+  fSmallCut = copy.fSmallCut;
+  fESDpid = copy.fESDpid;
+  fAODpid = copy.fAODpid;
+  
+  SetMC(copy.fIsMC);
+  
+  return (*this);
+}
+
+//_________________________________________________________________________________________________
+void AliRsnCutPIDITS::SetMC(Bool_t yn)
+{
+//
+// Properly set the PID response
+//
+
+  fIsMC = yn;
+  AliITSPIDResponse itsresponse(fIsMC);
+  fESDpid.GetITSResponse() = itsresponse;
+  fAODpid.GetITSResponse() = itsresponse;
+}
+
+//_________________________________________________________________________________________________
+Bool_t AliRsnCutPIDITS::IsSelected(TObject *object)
+{
+//
+// Cut checker.
+//
+
+  // coherence check
+  if (!TargetOK(object)) return kFALSE;
+  
+  // reject not ITS tracks
+  // status is checked in the same way for all tracks
+  AliVTrack *vtrack = dynamic_cast<AliVTrack*>(fDaughter->GetRef());
+  if (!vtrack)
+  {
+    AliDebug(AliLog::kDebug + 2, Form("This object is not either an ESD nor AOD track, it is an %s", fDaughter->GetRef()->ClassName()));
+    return kFALSE;
+  }
+  
+  // check status, to know it track is an ITS+TPC or ITS standalone
+  // and reject it if it is of none of the allowed types
+  Bool_t isSA = kFALSE;
+  if (IsITSTPC(vtrack)) isSA = kFALSE;
+  else if (IsITSSA(vtrack)) isSA = kTRUE;
+  else
+  {
+    AliWarning("Track is neither ITS+TPC nor ITS standalone");
+    return kFALSE;
+  }
+  
+  // common evaluation variables
+  Double_t mom = vtrack->P();
+  Int_t    k, nITSpidLayers;
+
+  // retrieve real object type
+  AliESDtrack *esdTrack = fDaughter->GetRefESDtrack();
+  AliAODTrack *aodTrack = fDaughter->GetRefAODtrack();
+  if (esdTrack) 
+  {
+    AliDebug(AliLog::kDebug + 2, "Checking an ESD track");
+    
+    // count PID layers and reject if they are too few
+    nITSpidLayers = 0;
+    UChar_t itsCluMap = esdTrack->GetITSClusterMap();
+    for(k = 2; k < 6; k++) if(itsCluMap & (1 << k)) ++nITSpidLayers;
+    if (nITSpidLayers < 3)
+    {
+      AliDebug(AliLog::kDebug+2, "Rejecting track with too few ITS pid layers");
+      return kFALSE;
+    }
+  
+    // create the PID response object and compute nsigma
+    AliITSPIDResponse &itsrsp = fESDpid.GetITSResponse();
+    fCutValueD = itsrsp.GetNumberOfSigmas(mom, esdTrack->GetITSsignal(), fPIDtype, nITSpidLayers, isSA);
+  }
+  else if (aodTrack)
+  {
+    AliDebug(AliLog::kDebug + 2, "Checking an AOD track");
+    
+    // count PID layers and reject if they are too few
+    nITSpidLayers = 0;
+    for(k = 2; k < 6; k++) if (TESTBIT(aodTrack->GetITSClusterMap(), k)) ++nITSpidLayers;
+    if (nITSpidLayers < 3)
+    {
+      AliDebug(AliLog::kDebug+2, "Rejecting track with too few ITS pid layers");
+      return kFALSE;
+    }
+    
+    // compute nsigma
+    fCutValueD = fAODpid.NumberOfSigmasITS(aodTrack, fPIDtype);
+  }
+  else
+  {
+    AliDebug(AliLog::kDebug + 2, Form("This object is not either an ESD nor AOD track, it is an %s", fDaughter->GetRef()->ClassName()));
+    return kFALSE;
+  }
+  
+  // determine cut range from the momentum
+  if (mom < fMomentumLimit)
+  {
+    fMinD = -fLargeCut;
+    fMaxD =  fLargeCut;
+  }
+  else
+  {
+    fMinD = -fSmallCut;
+    fMaxD =  fSmallCut;
+  }
+  
+  // check the cut using the standard AliRsnCut facilities
+  return OkRangeD();
+}
+
+//_________________________________________________________________________________________________
+void AliRsnCutPIDITS::Print(const Option_t *) const
+{
+//
+// Print information on this cut
+//
+
+  AliInfo(Form("Cut name, type                  : %s %s", GetName(), ClassName()));
+  AliInfo(Form("ITS PID cut: limit, large, small: %.3ff %.3ff %.3ff", fMomentumLimit, fLargeCut, fSmallCut));
+}
diff --git a/PWG2/RESONANCES/AliRsnCutPIDITS.h b/PWG2/RESONANCES/AliRsnCutPIDITS.h
new file mode 100644 (file)
index 0000000..f13db71
--- /dev/null
@@ -0,0 +1,103 @@
+//
+// *** Class AliRsnCutPIDITS ***
+//
+// This class implements all cuts which have to be used for the 2010 runs
+// for phi and generic resonance analysis.
+// It contains an AliESDtrackCuts object for track quality selection
+// and some criteria for particle identification with ITS, ITS and TOF.
+//
+// authors: Martin Vala (martin.vala@cern.ch)
+//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//
+
+#ifndef ALIRSNCUTPIDITS_H
+#define ALIRSNCUTPIDITS_H
+
+#include "AliPID.h"
+#include "AliVTrack.h"
+#include "AliESDpid.h"
+#include "AliAODpidUtil.h"
+#include "AliRsnCut.h"
+
+class AliRsnCutPIDITS : public AliRsnCut
+{
+  public:
+
+    AliRsnCutPIDITS(const char *name = "cutPIDITS", AliPID::EParticleType type = AliPID::kKaon, Bool_t fIsMC = kFALSE, Double_t momLimit = 0.0, Double_t cut1 = 3.0, Double_t cut2 = 3.0);
+    AliRsnCutPIDITS(const AliRsnCutPIDITS& copy);
+    AliRsnCutPIDITS& operator=(const AliRsnCutPIDITS& copy);
+    virtual ~AliRsnCutPIDITS() { }
+
+    AliESDpid*       GetESDpid()                         {return &fESDpid;}    
+    void             SetPIDType(AliPID::EParticleType t) {fPIDtype = t;}
+        
+    void             SetMC(Bool_t yn = kTRUE);
+    void             SetMomentumLimit(Double_t v)        {fMomentumLimit = v;}
+    void             SetLargeCut(Double_t v)             {fLargeCut = v;}
+    void             SetSmallCut(Double_t v)             {fSmallCut = v;}
+    
+    virtual Bool_t   IsSelected(TObject *object);
+    virtual void     Print(const Option_t *option = "") const;
+
+  protected:
+  
+    Bool_t  IsITSTPC (AliVTrack *d);  // check that the track is TPC+ITS
+    Bool_t  IsITSSA  (AliVTrack *d);  // check that the track is ITS standalone
+  
+    AliPID::EParticleType   fPIDtype;          //  PID reference type used for checks
+    
+    Bool_t                  fIsMC;             //  to know what settings must be used
+    Double_t                fMomentumLimit;    //  below this value, large cut is used; above, small one is used (value in GeV/c)
+    Double_t                fLargeCut;         //  range for ITS de/dx large cut
+    Double_t                fSmallCut;         //  range for ITS de/dx small cut
+    
+    AliESDpid               fESDpid;           //  ESD PID object
+    AliAODpidUtil           fAODpid;           //  AOD PID object
+
+    ClassDef(AliRsnCutPIDITS, 1)
+};
+
+inline Bool_t AliRsnCutPIDITS::IsITSTPC(AliVTrack *vtrack)
+{
+//
+// Checks if the track has the status flags required for a global track
+//
+
+  if (!vtrack)
+  {
+    AliWarning("NULL argument: impossible to check status");
+    return kFALSE;
+  }
+  
+  Bool_t isTPCin     = ((vtrack->GetStatus() & AliESDtrack::kTPCin) != 0);
+  Bool_t isITSrefit  = ((vtrack->GetStatus() & AliESDtrack::kITSrefit) != 0);
+  Bool_t isITSpid    = ((vtrack->GetStatus() & AliESDtrack::kITSpid) != 0);
+  
+  return ( isTPCin && isITSrefit && isITSpid );
+  
+  return kTRUE;
+}
+
+inline Bool_t AliRsnCutPIDITS::IsITSSA(AliVTrack *vtrack)
+{
+//
+// Checks if the track has the status flags required for an ITS standalone track
+//
+
+  if (!vtrack)
+  {
+    AliWarning("NULL argument: impossible to check status");
+    return kFALSE;
+  }
+  
+  Bool_t isTPCin     = ((vtrack->GetStatus() & AliESDtrack::kTPCin) != 0);
+  Bool_t isITSrefit  = ((vtrack->GetStatus() & AliESDtrack::kITSrefit) != 0);
+  Bool_t isITSpureSA = ((vtrack->GetStatus() & AliESDtrack::kITSpureSA) != 0);
+  Bool_t isITSpid    = ((vtrack->GetStatus() & AliESDtrack::kITSpid) != 0);
+  
+  return ( (!isTPCin) && isITSrefit && (!isITSpureSA) && isITSpid );
+  
+  return kTRUE;
+}
+
+#endif
index dcfa886..5b48eb4 100644 (file)
@@ -45,9 +45,10 @@ AliESDEvent*   AliRsnCutPIDTOF::fgLastEvent       = 0x0;
 
 
 //_________________________________________________________________________________________________
-AliRsnCutPIDTOF::AliRsnCutPIDTOF(const char *name, Bool_t isMC, Double_t min, Double_t max) :
+AliRsnCutPIDTOF::AliRsnCutPIDTOF(const char *name, Bool_t isMC, Double_t min, Double_t max, Bool_t forceMatching) :
   AliRsnCut(name, AliRsnCut::kDaughter, min, max),
   fIsMC(isMC),
+  fForceMatching(forceMatching),
   fPIDtype(AliPID::kPion),
   fESDpid(),
   fAODpid()
@@ -61,6 +62,7 @@ AliRsnCutPIDTOF::AliRsnCutPIDTOF(const char *name, Bool_t isMC, Double_t min, Do
 AliRsnCutPIDTOF::AliRsnCutPIDTOF(const AliRsnCutPIDTOF& copy) :
   AliRsnCut(copy),
   fIsMC(copy.fIsMC),
+  fForceMatching(copy.fForceMatching),
   fPIDtype(copy.fPIDtype),
   fESDpid(copy.fESDpid),
   fAODpid(copy.fAODpid)
@@ -78,6 +80,7 @@ AliRsnCutPIDTOF& AliRsnCutPIDTOF::operator=(const AliRsnCutPIDTOF& copy)
 //
 
   fIsMC = copy.fIsMC;
+  fForceMatching = copy.fForceMatching;
   fPIDtype = copy.fPIDtype;
   fESDpid = copy.fESDpid;
   fAODpid = copy.fAODpid;
@@ -95,19 +98,27 @@ Bool_t AliRsnCutPIDTOF::IsSelected(TObject *object)
   // coherence check
   if (!TargetOK(object)) return kFALSE;
   
-  // reject not TOF-matched tracks
-  // status is checked in the same way for all tracks
+  // reject always non-track objects
   AliVTrack *vtrack = dynamic_cast<AliVTrack*>(fDaughter->GetRef());
   if (!vtrack)
   {
     AliDebug(AliLog::kDebug + 2, Form("This object is not either an ESD nor AOD track, it is an %s", fDaughter->GetRef()->ClassName()));
     return kFALSE;
   }
+  
+  // for non TOF-matched tracks, the TOF PID check cannot be done:
+  // -- if 'fForceMatching' is kTRUE
+  //    all non matched tracks are rejected as if they didn't pass the cut
+  // -- if 'fForceMatching' is kFALSE
+  //    all non matched tracks are ignored, as if they did pass the cut
   ULong_t status = (ULong_t)vtrack->GetStatus();
   if ((status & AliESDtrack::kTOFout) == 0 || (status & AliESDtrack::kTIME) == 0)
   {
     AliDebug(AliLog::kDebug + 2, "Track is not matched with TOF");
-    return kFALSE;
+    if (fForceMatching)
+      return kFALSE;
+    else
+      return kTRUE;
   }
   
   // retrieve real object type
index ef4bfed..10b1b35 100644 (file)
@@ -27,7 +27,7 @@ class AliRsnCutPIDTOF : public AliRsnCut
 {
   public:
 
-    AliRsnCutPIDTOF(const char *name = "cutPIDTOF", Bool_t isMC = kFALSE, Double_t min = -10.0, Double_t max = 10.0);
+    AliRsnCutPIDTOF(const char *name = "cutPIDTOF", Bool_t isMC = kFALSE, Double_t min = -10.0, Double_t max = 10.0, Bool_t forceMatching = kFALSE);
     AliRsnCutPIDTOF(const AliRsnCutPIDTOF& copy);
     AliRsnCutPIDTOF& operator=(const AliRsnCutPIDTOF& copy);
     virtual ~AliRsnCutPIDTOF() { }
@@ -41,7 +41,8 @@ class AliRsnCutPIDTOF : public AliRsnCut
     Bool_t  CheckESD(AliESDtrack *track);
     Bool_t  CheckAOD(AliAODTrack *track);
   
-    Bool_t                 fIsMC;             //  switch for MC analysis    
+    Bool_t                 fIsMC;             //  switch for MC analysis   
+    Bool_t                 fForceMatching;    //  decide if non TOF matched tracks pass the cut or not 
     AliPID::EParticleType  fPIDtype;          //  particle type for which PID is checked   
     AliESDpid              fESDpid;           //  PID utility for ESD
     AliAODpidUtil          fAODpid;           //  PID utility for AOD
diff --git a/PWG2/RESONANCES/AliRsnCutPIDTPC.cxx b/PWG2/RESONANCES/AliRsnCutPIDTPC.cxx
new file mode 100644 (file)
index 0000000..191e893
--- /dev/null
@@ -0,0 +1,175 @@
+//
+// Class AliRsnCutPIDTPC
+//
+// General implementation of a single cut strategy, which can be:
+// - a value contained in a given interval  [--> IsBetween()   ]
+// - a value equal to a given reference     [--> MatchesValue()]
+//
+// In all cases, the reference value(s) is (are) given as data members
+// and each kind of cut requires a given value type (Int, UInt, Double),
+// but the cut check procedure is then automatized and chosen thanks to
+// an enumeration of the implemented cut types.
+// At the end, the user (or any other point which uses this object) has
+// to use the method IsSelected() to check if this cut has been passed.
+//
+// authors: Martin Vala (martin.vala@cern.ch)
+//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//
+
+#include <Riostream.h>
+
+#include "AliESDpid.h"
+#include "AliTOFT0maker.h"
+#include "AliTOFcalib.h"
+#include "AliCDBManager.h"
+#include "AliITSPIDResponse.h"
+
+#include "AliRsnEvent.h"
+#include "AliRsnDaughter.h"
+#include "AliRsnCutPIDTPC.h"
+
+ClassImp(AliRsnCutPIDTPC)
+
+//_________________________________________________________________________________________________
+AliRsnCutPIDTPC::AliRsnCutPIDTPC
+(const char *name, AliPID::EParticleType type, Double_t momLimit, Double_t cut1, Double_t cut2) :
+  AliRsnCut(name, AliRsnCut::kDaughter, 0.0, 0.0),
+  fPIDtype(type),
+  fMomentumLimit(momLimit),
+  fLargeCut(TMath::Max(cut1, cut2)),
+  fSmallCut(TMath::Min(cut1, cut2)),
+  fESDpid(),
+  fAODpid()
+{
+//
+// Main constructor.
+//
+}
+
+//_________________________________________________________________________________________________
+AliRsnCutPIDTPC::AliRsnCutPIDTPC
+(const AliRsnCutPIDTPC& copy) :
+  AliRsnCut(copy),
+  fPIDtype(copy.fPIDtype),
+  fMomentumLimit(copy.fMomentumLimit),
+  fLargeCut(copy.fLargeCut),
+  fSmallCut(copy.fSmallCut),
+  fESDpid(copy.fESDpid),
+  fAODpid(copy.fAODpid)
+{
+//
+// Copy constructor.
+//
+}
+
+//_________________________________________________________________________________________________
+AliRsnCutPIDTPC& AliRsnCutPIDTPC::operator=(const AliRsnCutPIDTPC& copy)
+{
+//
+// Assignment operator
+//
+
+  AliRsnCut::operator=(copy);
+
+  fPIDtype = copy.fPIDtype;
+  fMomentumLimit = copy.fMomentumLimit;
+  fLargeCut = copy.fLargeCut;
+  fSmallCut = copy.fSmallCut;
+  fESDpid = copy.fESDpid;
+  fAODpid = copy.fAODpid;
+  
+  return (*this);
+}
+
+//_________________________________________________________________________________________________
+void AliRsnCutPIDTPC::SetBBParam(Double_t p0, Double_t p1, Double_t p2, Double_t p3, Double_t p4)
+{
+//
+// Properly set the Bethe-Bloch parameters in all places where it is needed.
+//
+
+  fESDpid.GetTPCResponse().SetBetheBlochParameters(p0, p1, p2, p3, p4);
+  fAODpid.GetTPCResponse().SetBetheBlochParameters(p0, p1, p2, p3, p4);
+}
+
+//_________________________________________________________________________________________________
+Bool_t AliRsnCutPIDTPC::IsSelected(TObject *object)
+{
+//
+// Cut checker.
+//
+
+  // coherence check
+  if (!TargetOK(object)) return kFALSE;
+  
+  // reject not TPC tracks
+  // status is checked in the same way for all tracks
+  AliVTrack *vtrack = dynamic_cast<AliVTrack*>(fDaughter->GetRef());
+  if (!vtrack)
+  {
+    AliDebug(AliLog::kDebug + 2, Form("This object is not either an ESD nor AOD track, it is an %s", fDaughter->GetRef()->ClassName()));
+    return kFALSE;
+  }
+  ULong_t status = (ULong_t)vtrack->GetStatus();
+  if ((status & AliESDtrack::kTPCin) == 0)
+  {
+    AliDebug(AliLog::kDebug + 2, "Track is not found in TPC");
+    return kFALSE;
+  }
+  
+  // common evaluation variables
+  Double_t mom;
+
+  // retrieve real object type
+  AliESDtrack *esdTrack = fDaughter->GetRefESDtrack();
+  AliAODTrack *aodTrack = fDaughter->GetRefAODtrack();
+  if (esdTrack) 
+  {
+    AliDebug(AliLog::kDebug + 2, "Checking an ESD track");
+    
+    mom = esdTrack->GetInnerParam()->P();
+    
+    AliTPCPIDResponse &tpcrsp = fESDpid.GetTPCResponse();
+    fCutValueD = tpcrsp.GetNumberOfSigmas(mom, esdTrack->GetTPCsignal(), esdTrack->GetTPCsignalN(), fPIDtype);
+  }
+  else if (aodTrack)
+  {
+    AliDebug(AliLog::kDebug + 2, "Checking an AOD track");
+    
+    AliAODPid *pidObj = aodTrack->GetDetPid();
+    mom = pidObj->GetTPCmomentum();
+  
+    fCutValueD = fAODpid.NumberOfSigmasTPC(aodTrack, fPIDtype);
+  }
+  else
+  {
+    AliDebug(AliLog::kDebug + 2, Form("This object is not either an ESD nor AOD track, it is an %s", fDaughter->GetRef()->ClassName()));
+    return kFALSE;
+  }
+  
+  // determine cut range from the momentum
+  if (mom < fMomentumLimit)
+  {
+    fMinD = -fLargeCut;
+    fMaxD =  fLargeCut;
+  }
+  else
+  {
+    fMinD = -fSmallCut;
+    fMaxD =  fSmallCut;
+  }
+  
+  // check the cut using the standard AliRsnCut facilities
+  return OkRangeD();
+}
+
+//_________________________________________________________________________________________________
+void AliRsnCutPIDTPC::Print(const Option_t *) const
+{
+//
+// Print information on this cut
+//
+
+  AliInfo(Form("Cut name, type                  : %s %s", GetName(), ClassName()));
+  AliInfo(Form("TPC PID cut: limit, large, small: %.3ff %.3ff %.3ff", fMomentumLimit, fLargeCut, fSmallCut));
+}
diff --git a/PWG2/RESONANCES/AliRsnCutPIDTPC.h b/PWG2/RESONANCES/AliRsnCutPIDTPC.h
new file mode 100644 (file)
index 0000000..9cae361
--- /dev/null
@@ -0,0 +1,58 @@
+//
+// *** Class AliRsnCutPIDTPC ***
+//
+// This class implements all cuts which have to be used for the 2010 runs
+// for phi and generic resonance analysis.
+// It contains an AliESDtrackCuts object for track quality selection
+// and some criteria for particle identification with ITS, TPC and TOF.
+//
+// authors: Martin Vala (martin.vala@cern.ch)
+//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//
+
+#ifndef ALIRSNCUTPIDTPC_H
+#define ALIRSNCUTPIDTPC_H
+
+#include "AliPID.h"
+#include "AliESDtrack.h"
+#include "AliESDtrackCuts.h"
+#include "AliESDpid.h"
+#include "AliAODpidUtil.h"
+#include "AliRsnCut.h"
+
+class AliRsnCutPIDTPC : public AliRsnCut
+{
+  public:
+
+    AliRsnCutPIDTPC(const char *name = "cutPIDTPC", AliPID::EParticleType type = AliPID::kKaon, Double_t momLimit = 0.350, Double_t cut1 = 5.0, Double_t cut2 = 3.0);
+    AliRsnCutPIDTPC(const AliRsnCutPIDTPC& copy);
+    AliRsnCutPIDTPC& operator=(const AliRsnCutPIDTPC& copy);
+    virtual ~AliRsnCutPIDTPC() { }
+
+    AliESDpid*       GetESDpid()                         {return &fESDpid;}    
+    void             SetPIDType(AliPID::EParticleType t) {fPIDtype = t;}
+        
+    void             SetMomentumLimit(Double_t v)        {fMomentumLimit = v;}
+    void             SetLargeCut(Double_t v)             {fLargeCut = v;}
+    void             SetSmallCut(Double_t v)             {fSmallCut = v;}
+    void             SetBBParam(Double_t *p)             {SetBBParam(p[0], p[1], p[2], p[3], p[4]);}
+    void             SetBBParam(Double_t p0, Double_t p1, Double_t p2, Double_t p3, Double_t p4);
+    
+    virtual Bool_t   IsSelected(TObject *object);
+    virtual void     Print(const Option_t *option = "") const;
+
+  protected:
+  
+    AliPID::EParticleType   fPIDtype;          //  PID reference type used for checks
+    
+    Double_t                fMomentumLimit;    //  below this value, large cut is used; above, small one is used (value in GeV/c)
+    Double_t                fLargeCut;         //  range for TPC de/dx large cut
+    Double_t                fSmallCut;         //  range for TPC de/dx small cut
+    
+    AliESDpid               fESDpid;           //  ESD PID object
+    AliAODpidUtil           fAODpid;           //  AOD PID object
+
+    ClassDef(AliRsnCutPIDTPC, 1)
+};
+
+#endif
diff --git a/PWG2/RESONANCES/extra/AliRsnTOFT0maker.cxx b/PWG2/RESONANCES/extra/AliRsnTOFT0maker.cxx
new file mode 100644 (file)
index 0000000..3588aa8
--- /dev/null
@@ -0,0 +1,309 @@
+/**************************************************************************
+ * 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.                  *
+ **************************************************************************/
+/* $Id: AliRsnTOFT0maker.cxx,v 1.8 2010/01/19 16:32:20 noferini Exp $ */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//  This class contains the basic functions for the time zero              //
+//  evaluation with TOF detector informations.                             //
+// Use case in an analysis task:                                           //
+//                                                                         //
+// Create the object in the task constructor (fTOFmakerANA is a private var)  //
+// fTOFmakerANA = new AliRsnTOFT0maker();                                        //
+// fTOFmakerANA->SetTimeResolution(115.0e-12); // if you want set the TOF res //
+// 115 ps is the TOF default resolution value                              //
+//                                                                         //
+// Use the RemakePID method in the task::Exec                              //
+// Double_t* calcolot0;                                                    //
+// calcolot0=fTOFmakerANA->RemakePID(fESD);                                   //
+// //calcolot0[0] = calculated event time                                  // 
+// //calcolot0[1] = event time time resolution                             //
+// //calcolot0[2] = average event time for the current fill                //
+//                                                                         //
+// Let consider that:                                                      //
+// - the PIF is automatically recalculated with the event time subtrction  //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include <Riostream.h>
+#include <stdlib.h>
+
+#include "AliTOFT0v1.h"
+#include "AliTOFcalibHisto.h"
+#include "AliPID.h"
+#include "AliESDpid.h"
+#include "TFile.h"
+#include "AliRsnTOFT0maker.h"
+
+ClassImp(AliRsnTOFT0maker)
+           
+//____________________________________________________________________________ 
+  AliRsnTOFT0maker::AliRsnTOFT0maker():
+    fSettings(kNone),
+    fCalib(new AliTOFcalibHisto()),
+    fESDswitch(0),
+    fTimeResolution(115),
+    fT0sigma(1000),
+    fHmapChannel(0),
+    fKmask(0),
+    fNoTOFT0(0)
+{
+  fCalculated[0] = 0;
+  fCalculated[1] = 0;
+  fCalculated[2] = 0;
+  fCalculated[3] = 0;
+
+  fCalib->LoadCalibPar();
+
+  if(AliPID::ParticleMass(0) == 0) new AliPID();
+}
+//____________________________________________________________________________ 
+AliRsnTOFT0maker::AliRsnTOFT0maker(const AliRsnTOFT0maker & t) :
+  TObject(),
+  fSettings(t.fSettings),
+  fCalib(t.fCalib),
+  fESDswitch(t.fESDswitch),
+  fTimeResolution(t.fTimeResolution),
+  fT0sigma(t.fT0sigma),
+  fHmapChannel(t.fHmapChannel),
+  fKmask(t.fKmask),
+  fNoTOFT0(t.fNoTOFT0)
+{
+}
+
+//____________________________________________________________________________ 
+AliRsnTOFT0maker& AliRsnTOFT0maker::operator=(const AliRsnTOFT0maker &t)
+{
+ //
+  // assign. operator
+  //
+
+  fSettings = t.fSettings;
+  if (this == &t)
+    return *this;
+  fCalib = t.fCalib;
+  fESDswitch = t.fESDswitch;
+  fTimeResolution = t.fTimeResolution;
+  fT0sigma = t.fT0sigma;
+
+  return *this;
+}
+//____________________________________________________________________________ 
+AliRsnTOFT0maker::~AliRsnTOFT0maker()
+{
+  // dtor
+  if(fCalib) delete fCalib;
+}
+//____________________________________________________________________________ 
+Double_t* AliRsnTOFT0maker::RemakePID(AliESDEvent *esd,Double_t t0time,Double_t t0sigma){
+  //
+  // Remake TOF PID probabilities
+  //
+
+  Double_t *t0tof;
+
+  if(fKmask) ApplyMask(esd);
+
+  AliTOFT0v1* t0makerANA=new AliTOFT0v1(esd);
+//   t0makerANA->SetCalib(fCalib);
+  t0makerANA->SetTimeResolution(fTimeResolution*1e-12);
+
+  if(! fESDswitch){
+    TakeTimeRawCorrection(esd);
+  }
+
+  t0tof=t0makerANA->DefineT0("all");
+
+  Float_t lT0Current=0.;
+  fT0sigma=1000;
+
+  Int_t nrun = 0;//esd->GetRunNumber();
+  Double_t t0fill = 175;//GetT0Fill(nrun);
+  if (fSettings == kPass2 || fSettings == kPass4)      // cambiato!!!!!!!!
+  {
+   nrun = esd->GetRunNumber();
+   t0fill = GetT0Fill(nrun);
+  }
+  else if (fSettings == kLHC09d10) // e' il MC del pass2?
+  {
+   t0fill = GetT0Fill(nrun);
+  } 
+
+  fCalculated[0]=-1000*t0tof[0];
+  fCalculated[1]=1000*t0tof[1];
+  fCalculated[2] = t0fill;
+  fCalculated[3] = t0tof[2];
+
+  if(fCalculated[1] < 150 && TMath::Abs(fCalculated[0] - t0fill) < 500){
+    fT0sigma=fCalculated[1];
+    lT0Current=fCalculated[0];
+  }
+
+  if(t0sigma < 1000){
+    if(fT0sigma < 1000){
+      Double_t w1 = 1./t0sigma/t0sigma;
+      Double_t w2 = 1./fCalculated[1]/fCalculated[1];
+
+      Double_t wtot = w1+w2;
+
+      lT0Current = (w1*t0time + w2*fCalculated[0]) / wtot;
+      fT0sigma = TMath::Sqrt(1./wtot);
+    }
+    else{
+      lT0Current=t0time;
+      fT0sigma=t0sigma;
+    }
+  }
+
+  if(fT0sigma >= 1000 || fNoTOFT0){
+    lT0Current = t0fill;
+    fT0sigma = 135;
+
+    fCalculated[0] = t0fill;
+    fCalculated[1] = 150;
+  }
+
+  RemakeTOFpid(esd,lT0Current);
+  
+  return fCalculated;
+}
+//____________________________________________________________________________ 
+void AliRsnTOFT0maker::TakeTimeRawCorrection(AliESDEvent * const esd){
+  //
+  // Take raw corrections for time measurements
+  //
+  
+  Int_t ntracks = esd->GetNumberOfTracks();
+  
+  while (ntracks--) {
+    AliESDtrack *t=esd->GetTrack(ntracks);
+    
+    if ((t->GetStatus()&AliESDtrack::kTOFout)==0) continue;
+    
+    Double_t time=t->GetTOFsignalRaw();
+    Double_t tot = t->GetTOFsignalToT();
+    Int_t chan = t->GetTOFCalChannel();
+    Double_t corr = fCalib->GetFullCorrection(chan,tot) - fCalib->GetCorrection(AliTOFcalibHisto::kTimeSlewingCorr,chan,0);
+    time -= corr*1000;
+
+    //Int_t crate = Int_t(fCalib->GetCalibMap(AliTOFcalibHisto::kDDL,chan));
+    
+//     if(crate == 63 || crate == 62){
+//       time += 9200;
+      
+//    }
+
+//     if(crate == 63 || crate == 62|| crate == 61){
+//  printf("%i) %f\n",crate,time);
+//     getchar();
+//   }
+    t->SetTOFsignal(time);
+  }
+}
+//____________________________________________________________________________ 
+void AliRsnTOFT0maker::RemakeTOFpid(AliESDEvent *esd,Float_t timezero){
+  //
+  // Recalculate TOF PID probabilities
+  //
+  AliESDpid pidESD;
+  pidESD.GetTOFResponse().SetTimeResolution(TMath::Sqrt(fT0sigma*fT0sigma + fTimeResolution*fTimeResolution));
+  pidESD.MakePID(esd,kFALSE,timezero);
+  
+}
+//____________________________________________________________________________ 
+Double_t AliRsnTOFT0maker::GetT0Fill(Int_t nrun) const {
+  //
+  // Return T0 of filling
+  //
+  
+  Double_t t0;
+  if(nrun==104065) t0= 1771614;
+  else if(nrun==104068) t0= 1771603;
+  else if(nrun==104070) t0= 1771594;
+  else if(nrun==104073) t0= 1771610;
+  else if(nrun==104080) t0= 1771305;
+  else if(nrun==104083) t0= 1771613;
+  else if(nrun==104157) t0= 1771665;
+  else if(nrun==104159) t0= 1771679;
+  else if(nrun==104160) t0= 1771633;
+  else if(nrun==104316) t0= 1764344;
+  else if(nrun==104320) t0= 1764342;
+  else if(nrun==104321) t0= 1764371;
+  else if(nrun==104439) t0= 1771750;
+  else if(nrun==104792) t0= 1771755;
+  else if(nrun==104793) t0= 1771762;
+  else if(nrun==104799) t0= 1771828;
+  else if(nrun==104800) t0= 1771788;
+  else if(nrun==104801) t0= 1771796;
+  else if(nrun==104802) t0= 1771775;
+  else if(nrun==104803) t0= 1771795;
+  else if(nrun==104824) t0= 1771751;
+  else if(nrun==104825) t0= 1771763;
+  else if(nrun==104845) t0= 1771792;
+  else if(nrun==104852) t0= 1771817;
+  else if(nrun==104864) t0= 1771825;
+  else if(nrun==104865) t0= 1771827;
+  else if(nrun==104867) t0= 1771841;
+  else if(nrun==104876) t0= 1771856;
+  else if(nrun==104878) t0= 1771847;
+  else if(nrun==104879) t0= 1771830;
+  else if(nrun==104892) t0= 1771837;
+  else t0= 487;
+
+  if(fESDswitch) t0 -= 487;
+  else { if (fSettings == kPass4) t0 -=37*1024*24.4; }
+
+  return t0;
+}
+
+//____________________________________________________________________________ 
+void  AliRsnTOFT0maker::LoadChannelMap(char *filename){
+  // Load the histo with the channel off map
+  TFile *f= new TFile(filename);
+  if(!f){
+    printf("Cannot open the channel map file (%s)\n",filename);
+    return;
+  }
+  
+  fHmapChannel = (TH1F *) f->Get("hChEnabled");
+  
+  if(!fHmapChannel){
+    printf("Cannot laod the channel map histo (from %s)\n",filename);
+    return;
+  }
+    
+}
+//____________________________________________________________________________ 
+void AliRsnTOFT0maker::ApplyMask(AliESDEvent *esd){
+  // Switch off the disable channel
+  if(!fHmapChannel){
+    printf("Channel Map is not available\n");
+    return;
+  }
+  
+  Int_t ntracks = esd->GetNumberOfTracks();
+  
+  while (ntracks--) {
+    AliESDtrack *t=esd->GetTrack(ntracks);
+    
+    if ((t->GetStatus()&AliESDtrack::kTOFout)==0) continue;
+    
+    Int_t chan = t->GetTOFCalChannel();
+    if(fHmapChannel->GetBinContent(chan) < 0.01){
+      t->ResetStatus(AliESDtrack::kTOFout);
+    }
+  }
+}
diff --git a/PWG2/RESONANCES/extra/AliRsnTOFT0maker.h b/PWG2/RESONANCES/extra/AliRsnTOFT0maker.h
new file mode 100644 (file)
index 0000000..8403a01
--- /dev/null
@@ -0,0 +1,92 @@
+#ifndef ALITOFT0MAKERANA_H
+#define ALITOFT0MAKERANA_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: AliRsnTOFT0maker.h,v 1.8 2010/01/19 16:32:20 noferini Exp $ */
+
+///////////////////////////////////////////////
+//                                          //
+//  Manager class for time zero evaluation   //
+//  with TOF informations                    //
+//                                          //
+///////////////////////////////////////////////
+
+
+#include "TObject.h"
+#include "TString.h"
+#include "AliESDEvent.h"
+#include "AliStack.h"
+#include "TH1F.h"
+
+class AliTOFcalibHisto;
+class AliTOFT0v1;
+
+class AliRsnTOFT0maker : public TObject {
+public:
+
+  enum ESettings
+  {
+    kNone,
+    kPass2,
+    kPass4,
+    kLHC09d10
+  };
+
+  ESettings fSettings;
+  TString Settings()
+  {
+    TString out;
+    switch (fSettings)
+    {
+      case kPass2:    out = "pass 2"; break;
+      case kPass4:    out = "pass 4"; break;
+      case kLHC09d10: out = "LHC09d10"; break;
+      default:        out = "none specific"; break;
+    }
+    return out;
+  }
+      
+    
+  AliRsnTOFT0maker() ;
+  virtual ~AliRsnTOFT0maker() ; // dtor
+  AliRsnTOFT0maker(const AliRsnTOFT0maker & t);
+  AliRsnTOFT0maker & operator=(const AliRsnTOFT0maker & t);
+  void SetESDdata(Bool_t val=kTRUE){fESDswitch=val;};
+
+  // return (fCalculated[0]=event time -- fCalculated[1]=sigma event time in ps -- fCalculated[2]=mean event time for each fill -- fCalculated[3]=number of tracks at the TOF level) if you can subtruct the event time; return NULL if there is no event time
+  Double_t *RemakePID(AliESDEvent *esd,Double_t t0time=0.,Double_t t0sigma=1000.); // t0time and t0sigma in ps
+
+  void      SetTimeResolution(Double_t timeresolution){fTimeResolution=timeresolution;};// TOF timeresolution in [s] e.g. for 120 ps -> 1.2e-10
+  Double_t  GetTimeResolution() const {return fTimeResolution;}
+  
+  void LoadChannelMap(char *filename="$ALICE_ROOT/TOF/enableMap.104892.root"); //load the enable channel map
+  void ApplyMask(AliESDEvent *esd);
+  
+  void SetNoTOFT0(Bool_t status=kTRUE){fNoTOFT0=status;}; // disable the TOF T0 info
+  void SetMaskOffChannel(Bool_t status=kTRUE){fKmask=status;}; // swith for the map off channel
+  
+ private:
+  void TakeTimeRawCorrection(AliESDEvent * const esd);
+  void RemakeTOFpid(AliESDEvent *esd,Float_t timezero);
+  Double_t GetT0Fill(Int_t nrun) const ;
+  
+  AliTOFcalibHisto *fCalib; // TOF calibration object pointer
+  
+  Bool_t fESDswitch; // if you want take the ESD time instead of the raw + time slewing correction
+  
+  Double_t fCalculated[4]; // contains the parameters with the event time
+  Double_t fTimeResolution;  // global time resolution used to calculate T0
+  
+  Float_t fT0sigma; // T0 resolution
+  
+  TH1F *fHmapChannel; // histo with the channel map
+  Bool_t fKmask;
+  Bool_t fNoTOFT0;
+  
+  ClassDef(AliRsnTOFT0maker,1);  // Calculate the time zero using TOF detector */
+  
+};
+
+#endif // ALITOFT0MAKERANA_H