// authors: Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
// Martin Vala (martin.vala@cern.ch)
//
-
+#include "Riostream.h"
+#include "AliRsnCutSet.h"
+#include "AliRsnVATProcessInfo.h"
#include "AliRsnAnalysisSE.h"
ClassImp(AliRsnAnalysisSE)
fRsnAnalysisManager(),
fPIDIndex(0),
fEvent(),
+ fEventCuts(0x0),
fESDCuts(0)
{
//
fRsnAnalysisManager(copy.fRsnAnalysisManager),
fPIDIndex(copy.fPIDIndex),
fEvent(copy.fEvent),
+ fEventCuts(copy.fEventCuts),
fESDCuts(copy.fESDCuts)
{
AliDebug(AliLog::kDebug+2,"<-");
else
return;
if (fEvent.GetMultiplicity()<2) return;
+ if (fEventCuts) {
+ if (!fEventCuts->IsSelected(AliRsnCut::kEvent, &fEvent)) {
+ fTaskInfo.SetNumberOfTracks(0);
+ return;
+ }
+ else {
+ if (fESDEvent) {
+ fTaskInfo.SetNumberOfTracks(fESDEvent->GetNumberOfTracks());
+ }
+ else if (fAODEventOut) {
+ fTaskInfo.SetNumberOfTracks(fAODEventOut->GetNumberOfTracks());
+ }
+ else if (fAODEventIn) {
+ fTaskInfo.SetNumberOfTracks(fAODEventIn->GetNumberOfTracks());
+ }
+ }
+ }
// sort tracks w.r. to PID
fPIDIndex.ResetAll(fEvent.GetMultiplicity());
#include "AliRsnAnalysisManager.h"\r
#include "AliRsnPIDIndex.h"\r
\r
+class AliRsnPIDDefESD;\r
+class AliRsnCutSet;\r
+\r
class AliRsnAnalysisSE : public AliRsnVAnalysisTaskSE\r
{\r
\r
// ESD cuts\r
void SetESDtrackCuts(AliESDtrackCuts *cuts) {fESDCuts = cuts;}\r
\r
+ // Indexer\r
+ AliRsnPIDIndex* GetPIDIndex() {return &fPIDIndex;}\r
+ AliRsnPIDDefESD* GetPIDDef() {return fPIDIndex.GetPIDDef();}\r
+ AliRsnCutSet* GetEventCuts() {return fEventCuts;}\r
+ void SetEventCuts(AliRsnCutSet *cuts) {fEventCuts = cuts;}\r
+\r
private:\r
\r
AliRsnAnalysisSE& operator=(const AliRsnAnalysisSE& /*copy*/) {return *this;}\r
AliRsnAnalysisManager fRsnAnalysisManager; // analysis main engine\r
AliRsnPIDIndex fPIDIndex; // utility --> PID sorter\r
AliRsnEvent fEvent; // utility --> event interface\r
+ AliRsnCutSet *fEventCuts; // event cuts\r
\r
AliESDtrackCuts *fESDCuts; // ESD track cuts\r
Double_t fPrior[AliPID::kSPECIES]; // prior probabilities\r
//_________________________________________________________________________________________________
AliRsnCutBetheBloch::AliRsnCutBetheBloch
(const char *name, Double_t fractionRange, AliPID::EParticleType type, Double_t mip, Bool_t correct) :
- AliRsnCut(name, -fractionRange, fractionRange),
+ AliRsnCut(name, 0.0, fractionRange),
fCorrect(correct),
fMIP(mip),
fType(type)
return out * fMIP;
}
+//_____________________________________________________________________________
+Double_t AliRsnCutBetheBloch::RelDiff(AliRsnDaughter *track)
+{
+//
+// Relative difference between BB value and TPC signal
+//
+
+ if (!track->GetRefESD()) return -99999.9;
+
+ // compute Bethe-Bloch with the given mass hypothesis
+ Double_t bb = BetheBloch(track);
+ return TMath::Abs((track->GetRefESD()->GetTPCsignal() - bb) / bb);
+}
+
//_________________________________________________________________________________________________
Bool_t AliRsnCutBetheBloch::IsSelected(ETarget tgt, AliRsnDaughter *track)
{
return kTRUE;
}
- // compute Bethe-Bloch with the given mass hypothesis
- Double_t bb = BetheBloch(track);
-
// 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 = (esd->GetTPCsignal() - bb) / bb;
+ fCutValueD = RelDiff(track);
// then, this cut is checked inside the range
return OkRange();
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 *track);
+ Double_t RelDiff(AliRsnDaughter *track);
virtual Bool_t IsSelected(ETarget tgt, AliRsnDaughter *daughter);
virtual Bool_t IsSelected(ETarget tgt, AliRsnPairParticle *pair);
case kEta:
fCutValueD = (fUseMC ? pair->GetEtaMC() : pair->GetEta());
return OkRange();
+ case kSameLabel:
+ return pair->IsLabelEqual();
case kTruePair:
fCutValueI = pair->CommonMother();
return OkValue();
AliRsnEvent& operator= (const AliRsnEvent& copy);
virtual ~AliRsnEvent();
- void SetRef(AliVEvent *event, AliMCEvent *mc = 0) {fRef = event; fRefMC = mc;}
- void SetRefMC(AliMCEvent *mc) {fRefMC = mc;}
+ void SetRef(AliVEvent *event, AliMCEvent *mc = 0) {fRef = event; fRefMC = mc;}
+ void SetRefMC(AliMCEvent *mc) {fRefMC = mc;}
+ AliVEvent* GetRef() {return fRef;}
+ AliMCEvent* GetRefMC() {return fRefMC;}
void SetDaughter(AliRsnDaughter &daughter, Int_t index);
AliRsnDaughter GetDaughter(Int_t i);
return 0x0;
}
- static Int_t *nbins = new Int_t[size];
- static Double_t *min = new Double_t[size];
- static Double_t *max = new Double_t[size];
+ Int_t *nbins = new Int_t[size];
+ Double_t *min = new Double_t[size];
+ Double_t *max = new Double_t[size];
// retrieve binnings for main and secondary axes
AliRsnFunctionAxis *fcnAxis = 0;
AliDebug(AliLog::kDebug +2,"->");
Int_t i, nAxes = fAxisList.GetEntries();
- static Double_t *values = new Double_t[nAxes];
+ Double_t *values = new Double_t[nAxes];
AliRsnFunctionAxis *fcnAxis = 0;
for (i = 0; i < nAxes; i++)
AliError("Histogram is not yet initialized");
return kFALSE;
}
+ //TArrayD val(values); val->Print();
fHistogram->Fill(values);
AliDebug(AliLog::kDebug +2,"->");
switch (fType)
{
+ case kTrack1P: return "P1";
+ case kTrack2P: return "P2";
+ case kTrack1Pt: return "PT1";
+ case kTrack2Pt: return "PT2";
case kPairInvMass: return "IM";
case kPairInvMassMC: return "IMMC";
case kPairInvMassRes: return "IMRES";
switch (fType)
{
+ case kTrack1P:
+ case kTrack2P:
+ case kTrack1Pt:
+ case kTrack2Pt:
case kPairInvMass:
case kPairInvMassMC:
case kPairInvMassRes:
switch (fType)
{
+ case kTrack1P:
+ return pair->GetDaughter(0)->P();
+ case kTrack2P:
+ return pair->GetDaughter(1)->P();
+ case kTrack1Pt:
+ return pair->GetDaughter(0)->Pt();
+ case kTrack2Pt:
+ return pair->GetDaughter(1)->Pt();
case kPairInvMass:
return pair->GetInvMass(pairDef->GetMass(0), pairDef->GetMass(1));
case kPairInvMassMC:
enum EAxisType
{
+ kTrack1P,
+ kTrack2P,
+ kTrack1Pt,
+ kTrack2Pt,
kPairInvMass,
kPairInvMassMC,
kPairInvMassRes,
ClassImp(AliRsnPIDDefESD)
//_____________________________________________________________________________
-AliRsnPIDDefESD::AliRsnPIDDefESD() : fUseESDWeights(kTRUE) {
+AliRsnPIDDefESD::AliRsnPIDDefESD() :
+ fUseESDWeights(kTRUE)
+{
//
// Default constructor.
// By default, it is set for using ESD weights,
//_____________________________________________________________________________
AliRsnPIDDefESD::AliRsnPIDDefESD(const AliRsnPIDDefESD& copy) :
- TObject(copy),
- fUseESDWeights(copy.fUseESDWeights) {
+ TObject(copy),
+ fUseESDWeights(copy.fUseESDWeights)
+{
//
// Copy constructor.
// Implemented to manage passing of this object to functions
}
//_____________________________________________________________________________
-void AliRsnPIDDefESD::SetScheme(EScheme scheme, Double_t divValue) {
+void AliRsnPIDDefESD::SetScheme(EScheme scheme, Double_t divValue)
+{
//
// Set one of the predefined schemes
//
}
//_____________________________________________________________________________
-void AliRsnPIDDefESD::ComputeWeights(AliESDtrack *track, Double_t *weights) {
+void AliRsnPIDDefESD::ComputeWeights(AliESDtrack *track, Double_t *weights)
+{
//
// Computes the global PID weights using the given ranges
//
}
//_____________________________________________________________________________
-void AliRsnPIDDefESD::PrintStatus() {
+void AliRsnPIDDefESD::PrintStatus()
+{
//
// Print informations about this object configurations
//
}
//_____________________________________________________________________________
-const char* AliRsnPIDDefESD::DetName(EDetector det) {
+const char* AliRsnPIDDefESD::DetName(EDetector det)
+{
//
// Detector name for messages
//
}
//_____________________________________________________________________________
-const char* AliRsnPIDDefESD::SchemeName() {
+const char* AliRsnPIDDefESD::SchemeName()
+{
//
// Scheme name for messages
//
}
//_____________________________________________________________________________
-void AliRsnPIDDefESD::SetDivValue(EDetector det, Double_t value, Bool_t userHigher) {
+void AliRsnPIDDefESD::SetDivValue(EDetector det, Double_t value, Bool_t userHigher)
+{
//
// Sets div.value properties for detector
//
}
//_____________________________________________________________________________
-Bool_t AliRsnPIDDefESD::CheckDivValue(EDetector det,Double_t value) {
+Bool_t AliRsnPIDDefESD::CheckDivValue(EDetector det,Double_t value)
+{
//
// Sets div.value properties for detector
//
class AliESDtrack;
-class AliRsnPIDDefESD : public TObject {
+class AliRsnPIDDefESD : public TObject
+{
public:
enum EDetector {
- kITS,
+ kITS = 0,
kTPC,
kTRD,
kTOF,
ClassImp(AliRsnPIDIndex)
//_____________________________________________________________________________
-AliRsnPIDIndex::AliRsnPIDIndex(Int_t num)
+AliRsnPIDIndex::AliRsnPIDIndex(Int_t num) : fPIDDef()
{
//
// Default constructor
//_____________________________________________________________________________
AliRsnPIDIndex::AliRsnPIDIndex(const AliRsnPIDIndex & copy)
- : TObject(copy)
+ : TObject(copy),
+ fPIDDef(copy.fPIDDef)
{
//
// Copy constructor.
AliESDtrack *track = daughter.GetRefESD();
if (track) if (!cuts->IsSelected(track)) continue;
}
- daughter.CombineWithPriors(fPrior);
+ daughter.CombineWithPriors(fPrior, &fPIDDef);
// daughter.Print("ALL");
AddIndex(i,AliRsnDaughter::kNoPID,IndexCharge(daughter.Charge()),AliPID::kUnknown);
#include "AliRsnEvent.h"
#include "AliAODTrack.h"
#include "AliRsnDaughter.h"
+#include "AliRsnPIDDefESD.h"
class AliESDtrackCuts;
void DumpPriors();
void GetPriorProbability(Double_t *out);
+ AliRsnPIDDefESD* GetPIDDef() {return &fPIDDef;}
+
private:
Int_t ChargeIndex(Char_t sign) const;
TArrayI fIndex[AliRsnDaughter::kMethods][2][AliPID::kSPECIES + 1]; // index arrays of pos/neg particles of each PID
Int_t fNumOfIndex[AliRsnDaughter::kMethods][2][AliPID::kSPECIES + 1]; //! array size
- Double_t fPrior[AliPID::kSPECIES]; // prior probabilities
+ Double_t fPrior[AliPID::kSPECIES]; // prior probabilities
+ AliRsnPIDDefESD fPIDDef; // customization of weights
ClassDef(AliRsnPIDIndex, 1);
};
if (!CutPass(&fPairParticle)) continue;
AliDebug(AliLog::kDebug+1, "pairParticle cut passed");
-// pairParticle.PrintInfo();
+// fPairParticle.PrintInfo();
// fill all histograms
TObjArrayIter nextFcn(&fFunctions);
}
//_____________________________________________________________________________
-TList * AliRsnPair::GenerateHistograms(TString prefix)
+TList * AliRsnPair::GenerateHistograms(TString prefix,TList *list)
{
//
// Generates needed histograms, giving them a name based on
// All generated histograms are stored into the output TList.
//
AliDebug(AliLog::kDebug+2,"<-");
- TList *list = new TList();
- list->SetName(GetPairHistName(0x0).Data());
-
+ if (!list){
+ TList *list = new TList();
+ list->SetName(GetPairHistName(0x0).Data());
+ }
Char_t hName[255], hTitle[255];
//AliRsnFunction *fcn = 0;
AliRsnFunction *fcn = 0;
void LoopPair(TArrayI *a1, TArrayI *a2, AliRsnEvent *ev1, AliRsnEvent *ev2 = 0);
void SetCutMgr(AliRsnCutMgr* theValue) { fCutMgr = theValue; }
void AddFunction(AliRsnFunction *fcn);
- TList* GenerateHistograms(TString prefix = "");
- void GenerateHistograms(TString prefix, TList *tgt);
+ TList* GenerateHistograms(TString prefix = "", TList *list=0);
Bool_t IsMixed() {return fIsMixed;}
Bool_t IsPairEqual() {if (fPIDMethod == AliRsnDaughter::kNoPID) return (fPairDef->IsLikeSign());
while ((pair = (AliRsnPair*)next())) {
if (!pair) continue;
AliDebug(AliLog::kDebug+1, Form("InitAllPairs of the PairManager(%s) [%d] ...", pair->GetPairName().Data(), i++));
- list->Add(pair->GenerateHistograms(GetName()));
+ pair->GenerateHistograms(GetName(),list);
}
AliDebug(AliLog::kDebug+2, "->");
//
AliDebug(AliLog::kDebug+2, "<-");
+ /*
if (fAODEventOut) {
fTaskInfo.SetNumberOfTracks(fAODEventOut->GetNumberOfTracks());
}
else if (fAODEventIn) {
fTaskInfo.SetNumberOfTracks(fAODEventIn->GetNumberOfTracks());
}
-
+ */
fTaskInfo.FillInfo();
AliDebug(AliLog::kDebug+2,"->");
}
// === CUTS =====================================================================================
+ /*
// cuts for tracks:
// - probability to be a kaon (only for kaons)
- AliRsnCut *cutAssignedKaon = new AliRsnCut("cutAssignedKaon", "", AliRsnCut::kAssignedPID, AliAODTrack::kKaon);
- AliRsnCut *cutProbKaon = new AliRsnCut("cutProbKaon", "", AliRsnCut::kPIDProbForSpecies, (Int_t)AliAODTrack::kKaon);
+ AliRsnCutStd *cutAssignedKaon = new AliRsnCut("cutAssignedKaon", "", AliRsnCut::kAssignedPID, AliAODTrack::kKaon);
+ AliRsnCutStd *cutProbKaon = new AliRsnCut("cutProbKaon", "", AliRsnCut::kPIDProbForSpecies, (Int_t)AliAODTrack::kKaon);
cutProbKaon->SetCutValues(AliRsnCut::kPIDProbForSpecies, 0.15, 1.0);
+ */
AliRsnCutSet *cutSetTrack = new AliRsnCutSet("tracks");
- cutSetTrack->AddCut(cutAssignedKaon);
- cutSetTrack->AddCut(cutProbKaon);
- cutSetTrack->SetCutScheme("(!cutAssignedKaon)|(cutAssignedKaon&cutProbKaon)");
+ //cutSetTrack->AddCut(cutAssignedKaon);
+ //cutSetTrack->AddCut(cutProbKaon);
+ //cutSetTrack->SetCutScheme("(!cutAssignedKaon)|(cutAssignedKaon&cutProbKaon)");
// cuts on pairs:
// - true daughters of the defined resonance (only for true pairs histogram)
- AliRsnCut *cutPairTrue = new AliRsnCut("cutTrue", "", AliRsnCut::kIsTruePair, resonancePDG);
+ AliRsnCutStd *cutPairTrue = new AliRsnCutStd("cutTrue", "", AliRsnCut::kTruePair, resonancePDG);
AliRsnCutSet *cutSetPairTrue = new AliRsnCutSet("truePairs");
cutSetPairTrue->AddCut(cutPairTrue);
cutSetPairTrue->SetCutScheme("cutTrue");
// cuts on events:
// - multiplicity bin
- AliRsnCut *cutEventMult = new AliRsnCut("cutMult", "", AliRsnCut::kMultiplicity, multMin, multMax);
+ AliRsnCutStd *cutEventMult = new AliRsnCutStd("cutMult", "", AliRsnCut::kMultiplicity, multMin, multMax);
AliRsnCutSet *cutSetEvent = new AliRsnCutSet("multiplicity");
cutSetEvent->AddCut(cutEventMult);
cutSetEvent->SetCutScheme("cutMult");