]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
1) Suppressed unnecessary output. 2) Added option to request multiple filter bits
authorlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Nov 2013 14:34:51 +0000 (14:34 +0000)
committerlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Nov 2013 14:34:51 +0000 (14:34 +0000)
PWGCF/Correlations/DPhi/DiHadronPID/AliAODTrackCutsDiHadronPID.cxx
PWGCF/Correlations/DPhi/DiHadronPID/AliAODTrackCutsDiHadronPID.h
PWGCF/Correlations/DPhi/DiHadronPID/AliAnalysisTaskDiHadronPID.cxx
PWGCF/Correlations/DPhi/DiHadronPID/AliAnalysisTaskDiHadronPID.h
PWGCF/Correlations/DPhi/DiHadronPID/AliTrackDiHadronPID.cxx

index 88a6dc11cb49c5ea3af80fa574c0206a5ce81567..8df5e4211ff57f7152b2339572571cafd44a91a1 100644 (file)
@@ -72,6 +72,8 @@ AliAODTrackCutsDiHadronPID::AliAODTrackCutsDiHadronPID():
        fTestTOFmismatch(kFALSE),
        fTestPtDeptDCAcut(kFALSE),
        fDataTrackQAHistos(0x0),
+       fHistAcceptedFilterBits(0x0),
+       fRelevantBitsArray(0x0),
        fTOFMatchingStat(0x0),
        fPrimRecMCTrackQAHistos(0x0),
        fPrimGenMCTrackQAHistos(0x0),
@@ -175,6 +177,8 @@ AliAODTrackCutsDiHadronPID::AliAODTrackCutsDiHadronPID(const char* name):
        fTestTOFmismatch(kFALSE),
        fTestPtDeptDCAcut(kFALSE),
        fDataTrackQAHistos(0x0),
+       fHistAcceptedFilterBits(0x0),
+       fRelevantBitsArray(0x0),        
        fTOFMatchingStat(0x0),  
        fPrimRecMCTrackQAHistos(0x0),
        fPrimGenMCTrackQAHistos(0x0),
@@ -870,6 +874,88 @@ Bool_t AliAODTrackCutsDiHadronPID::RequestQAHistos(const Int_t histoclass, const
        }
 }
 
+// -----------------------------------------------------------------------
+void AliAODTrackCutsDiHadronPID::SetPtRange(Double_t minpt, Double_t maxpt) {
+       
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}  
+
+       fMinPt = minpt;
+       fMaxPt = maxpt;
+       fTestPt = kTRUE;
+}
+
+// -----------------------------------------------------------------------
+void AliAODTrackCutsDiHadronPID::SetFilterMask(UInt_t filtermask) {
+       
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}  
+
+       fFilterMask = filtermask;
+       fTestFilterMask = kTRUE;
+}
+
+// -----------------------------------------------------------------------
+void AliAODTrackCutsDiHadronPID::SetMaxEta(Double_t maxeta) {
+       
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}  
+
+       fMaxEta = maxeta;
+       fTestMaxEta = kTRUE;
+}
+
+// -----------------------------------------------------------------------
+void AliAODTrackCutsDiHadronPID::SetMaxRapidity(Double_t maxrapidity) {
+       
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}  
+
+       fMaxRapidity = maxrapidity;
+       fTestMaxRapidity = kTRUE;
+}
+
+// -----------------------------------------------------------------------
+void AliAODTrackCutsDiHadronPID::SetDemandNoMismatch() {
+       
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}  
+
+       fTestTOFmismatch = kTRUE;
+}
+
+// -----------------------------------------------------------------------
+void AliAODTrackCutsDiHadronPID::SetDemandFlags(ULong_t demandedflags) {
+       
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}  
+
+       fDemandedFlags = demandedflags;
+       fTestFlags = kTRUE;
+}
+
+// -----------------------------------------------------------------------
+void AliAODTrackCutsDiHadronPID::SetMinimumNumberOfTPCClusters(Int_t minimumnumberoftpcclusters) {
+       
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}  
+
+       fMinimumNumberOfTPCClusters = minimumnumberoftpcclusters;
+       fTestNumberOfTPCClusters = kTRUE;
+}
+
+// -----------------------------------------------------------------------
+void AliAODTrackCutsDiHadronPID::SetDemandSPDCluster() {
+       
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}  
+
+       fTestSPDAny = kTRUE;
+}
+
+// -----------------------------------------------------------------------
+void AliAODTrackCutsDiHadronPID::SetPtDeptDCACut(TFormula* DCAxyCutFormula, Double_t DCAzCut, UInt_t MinSPDHits) {
+       
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}  
+
+       fPtDeptDCAxyCutFormula = DCAxyCutFormula;
+       fDCAzCut = DCAzCut;
+       fMinSPDHitsForPtDeptDCAcut = MinSPDHits;
+       fTestPtDeptDCAcut = kTRUE;
+}
+
 // -----------------------------------------------------------------------
 void AliAODTrackCutsDiHadronPID::StartNewEvent() {
 
@@ -930,7 +1016,6 @@ void AliAODTrackCutsDiHadronPID::CreateHistos() {
                (fTOFMatchingStat->GetXaxis())->SetBinLabel(2,"Mismatch");
                (fTOFMatchingStat->GetXaxis())->SetBinLabel(3,"No TOF hit");
 
-
                if (!fPrimGenMCTrackQAHistos) {
                        cout<<"AliAODTrackCutsDiHadronPID - Creating Prim. Gen. MC Track QA TList..."<<endl;    
                        fPrimGenMCTrackQAHistos = new TList();
@@ -972,6 +1057,12 @@ void AliAODTrackCutsDiHadronPID::CreateHistos() {
                        fDataTrackQAHistos = new TList();
                        fDataTrackQAHistos->SetName("DataTrackQAHistos");
                        fDataTrackQAHistos->SetOwner(kTRUE);
+
+                       // Add general histograms.
+                       fHistAcceptedFilterBits = InitializeAcceptedFilterBits("fHistAcceptedFilterBits");
+                       fDataTrackQAHistos->Add(fHistAcceptedFilterBits);
+
+                       // Add histograms per class.
                        for (Int_t iHistoClass = 0; iHistoClass < 12; iHistoClass++) {
                                fHistDataDCAxyOneSigma[iHistoClass] = InitializeDCASpectrum("fHistDataDCAxyOneSigma",iHistoClass);
                                fDataTrackQAHistos->Add(fHistDataDCAxyOneSigma[iHistoClass]);
@@ -1011,6 +1102,14 @@ Bool_t AliAODTrackCutsDiHadronPID::IsSelectedData(AliTrackDiHadronPID* track, Do
        if (!CheckPtDeptDCACut(track->GetZAtDCA(),track->GetXYAtDCA(),track->Pt(),NSPDhits)) return kFALSE;
        if (fTestSPDAny) {if (NSPDhits < 1) return kFALSE;}
 
+       // Fill the filterbit histogram.
+       for (Int_t iBin = (fRelevantBitsArray->GetSize() - 1); iBin >= 0; --iBin) {
+               if ( (track->GetFilterMap()&(1<<fRelevantBitsArray->At(iBin))) == (1<<fRelevantBitsArray->At(iBin))) {
+                       fHistAcceptedFilterBits->Fill(iBin);
+                       break;
+               }
+       }
+
        // Track has passed the cuts, fill QA histograms.
        for (Int_t iHistoClass = 0; iHistoClass < 3; iHistoClass++) {
 
@@ -1185,6 +1284,87 @@ Int_t AliAODTrackCutsDiHadronPID::GetBinInPtClass(const Int_t ptbin) const {
        return ptbinout;
 
 }
+       
+// -----------------------------------------------------------------------
+Bool_t AliAODTrackCutsDiHadronPID::CheckPt(Double_t pt) const {
+
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}
+
+       if (!fTestPt) return kTRUE;
+       if ((pt > fMinPt) && (pt < fMaxPt)) return kTRUE;
+       return kFALSE;
+       }
+
+// -----------------------------------------------------------------------
+Bool_t AliAODTrackCutsDiHadronPID::CheckMaxEta(Double_t eta) const {
+
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}
+
+       if (!fTestMaxEta) return kTRUE;                         // Accepted if there is no check on this parameter.
+       if (TMath::Abs(eta) < fMaxEta) return kTRUE;
+       return kFALSE;
+       }
+
+// -----------------------------------------------------------------------
+Bool_t AliAODTrackCutsDiHadronPID::CheckRapidity(Double_t rap) const {
+
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}
+
+       if (!fTestMaxRapidity) return kTRUE;
+       if (TMath::Abs(rap) < fMaxRapidity) return kTRUE;
+       return kFALSE;
+       }
+
+// -----------------------------------------------------------------------
+Bool_t AliAODTrackCutsDiHadronPID::CheckFilterMask(UInt_t filtermap) const {
+
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}
+
+       if (!fTestFilterMask) return kTRUE;
+       if (fFilterMask & filtermap) return kTRUE;
+       return kFALSE;
+       }
+
+// -----------------------------------------------------------------------
+Bool_t AliAODTrackCutsDiHadronPID::CheckFlags(ULong_t flags) const {
+
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}
+
+       if (!fTestFlags) return kTRUE;
+       if ((flags & fDemandedFlags) == fDemandedFlags) return kTRUE;
+       return kFALSE;
+       }
+
+// -----------------------------------------------------------------------
+Bool_t AliAODTrackCutsDiHadronPID::CheckNclsTPC(Int_t ncls) const {
+
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}
+
+       if (!fTestNumberOfTPCClusters) return kTRUE;
+       if (ncls > fMinimumNumberOfTPCClusters) return kTRUE;
+       return kFALSE;
+       }
+
+// -----------------------------------------------------------------------
+Bool_t AliAODTrackCutsDiHadronPID::CheckTOFmismatch(Bool_t ismismatch) const {
+
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}
+
+       if (!fTestTOFmismatch) return kTRUE; // if we're not cutting on mismatch, then it's accepted.
+       if (!ismismatch) return kTRUE;          // so if the track is not a mismatch, then it is accepted.
+       return kFALSE;                                          // if it is a mismatch, then it's not accepted.
+       }
+
+// -----------------------------------------------------------------------
+Bool_t AliAODTrackCutsDiHadronPID::CheckPtDeptDCACut(Double_t dcaz, Double_t dcaxy, Double_t pt, UInt_t SPDhits) const {
+
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}
+
+       if (!fTestPtDeptDCAcut) return kTRUE;
+       if (SPDhits < fMinSPDHitsForPtDeptDCAcut) return kTRUE; // If there are not enough SPD hits to do the cut.
+       if ((dcaz < fDCAzCut) && (dcaxy < fPtDeptDCAxyCutFormula->Eval(pt))) return kTRUE;
+       return kFALSE;
+}
 
 // -----------------------------------------------------------------------
 Bool_t AliAODTrackCutsDiHadronPID::FillDataHistos(Int_t histoclass, AliTrackDiHadronPID* track) {
@@ -1495,6 +1675,96 @@ Bool_t AliAODTrackCutsDiHadronPID::InitializeRecMCHistos(Int_t histoclass) {
 
 }
 
+// -----------------------------------------------------------------------
+TH1F* AliAODTrackCutsDiHadronPID::InitializeAcceptedFilterBits(const char* name) {
+
+       // This histogram keeps track of the filtermask of all accepted tracks, projected
+       // onto the requested filtermask. For example, we requested mask 2 or 4, then this 
+       // histogram will have three bins, 2, 4 and 6. Suppose now a track is found which has
+       // mask 12, then since (12 & 2) = 0, (12 & 4) = 4, (12 & 6) = 4, the track will end up
+       // in bin 4.
+
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}
+       if (!fTestFilterMask || fFilterMask == 0) {cout << Form("%s -> ERROR: No filtermask requested.",__func__) << endl; return 0x0;}
+
+       // Determine the labels of the X axis.
+       SetXaxisAcceptedFilterBits();
+       
+       // Create histogram.
+       TH1F* hout = new TH1F(name,"Filtermask of accepted track;Mask;N",fRelevantBitsArray->GetSize(),-0.5,fRelevantBitsArray->GetSize()-0.5);
+       hout->SetDirectory(0);
+
+       // Set bin labels.
+       TAxis* axistmp = hout->GetXaxis();
+       for (Int_t iBin = 1; iBin <= axistmp->GetNbins(); ++iBin) {
+               axistmp->SetBinLabel(iBin, Form("%i",fRelevantBitsArray->At(iBin-1)));
+       }
+       return hout;
+       
+}
+
+// -----------------------------------------------------------------------
+void AliAODTrackCutsDiHadronPID::SetXaxisAcceptedFilterBits() {
+
+       // Creates the axis for the AcceptedFilterBits histogram.
+       // See exercise: "FindAllCombinations.C"
+       if (fDebug > 1) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}
+
+       // Step 1: Find the largest bit, in the requested filtermask,
+       Int_t largestBit = 0;
+       Int_t baseArraySizeTmp = 0;
+       Int_t fullArraySizeTmp = 0;
+
+       while (fFilterMask > (1<<(largestBit)) ) {
+               if ((fFilterMask&(1<<largestBit))==(1<<largestBit)) {
+                       fullArraySizeTmp += TMath::Power(2, baseArraySizeTmp);
+                       baseArraySizeTmp++;
+               }
+               largestBit++;
+       }
+       largestBit--;
+
+       // Step 2: Create and fill base array.
+       const Int_t baseArraySize = baseArraySizeTmp;
+       Int_t baseArray[baseArraySize];
+
+       Int_t iBaseArray = 0;
+       for (Int_t iBit = 0; iBit <= largestBit; ++iBit) {
+
+               if ((fFilterMask&(1<<iBit))==(1<<iBit)) {               
+                       baseArray[iBaseArray] = (1<<iBit);
+                       iBaseArray++;
+               }
+
+       }
+
+       // Step 3: Create and fill full array.
+       const Int_t fullArraySize = fullArraySizeTmp;
+       Int_t fullArray[fullArraySize];
+       fullArray[0] = baseArray[0];
+       Int_t iFullArray = 1;
+
+       for (Int_t ii = 1; ii < baseArraySize; ++ii) {
+               Int_t range = (iFullArray + TMath::Power(2,ii));
+               for (Int_t jj = iFullArray; jj < range; ++jj) {
+                       
+                       fullArray[jj] = baseArray[ii];
+
+                       // Add beginning part of the array:
+                       if (jj!=iFullArray) {
+                               fullArray[jj] += fullArray[jj - iFullArray - 1];
+                       }
+
+               }
+               iFullArray += TMath::Power(2,ii);
+
+       }
+
+       // Step 4: Convert to TArrayI object.
+       fRelevantBitsArray = new TArrayI(fullArraySize, fullArray);
+
+}
+
 // -----------------------------------------------------------------------
 TH1F* AliAODTrackCutsDiHadronPID::InitializePtSpectrum(const char* name, Int_t histoclass) {
 
@@ -1505,8 +1775,6 @@ TH1F* AliAODTrackCutsDiHadronPID::InitializePtSpectrum(const char* name, Int_t h
 
        hout->SetDirectory(0);
 
-       //if (fDebug > 2) {cout << "Created: " << hout->GetName() << " of type: " << hout->ClassName() << " at: " << hout << endl;}
-
        return hout;
 
 }
@@ -1522,8 +1790,6 @@ TH2F* AliAODTrackCutsDiHadronPID::InitializeRecPtGenPt(const char* name, Int_t h
 
        hout->SetDirectory(0);
 
-       //if (fDebug > 2) {cout << "Created: " << hout->GetName() << " of type: " << hout->ClassName() << " at: " << hout << endl;}
-
        return hout;
 
 }
@@ -1541,8 +1807,6 @@ TH3F* AliAODTrackCutsDiHadronPID::InitializePhiEtaPt(const char* name, Int_t his
 
        hout->SetDirectory(0);
 
-       //if (fDebug > 2) {cout << "Created: " << hout->GetName() << " of type: " << hout->ClassName() << " at: " << hout << endl;}
-
        return hout;
 
 }
@@ -1559,8 +1823,6 @@ TH2F* AliAODTrackCutsDiHadronPID::InitializeDCASpectrum(const char* name, Int_t
 
        hout->SetDirectory(0);
 
-       //if (fDebug > 2) {cout << "Created: " << hout->GetName() << " of type: " << hout->ClassName() << " at: " << hout << endl;}
-
        return hout;
 
 }
@@ -1576,8 +1838,6 @@ TH1F* AliAODTrackCutsDiHadronPID::InitializeNTracksHisto(const char* name, Int_t
 
        hout->SetDirectory(0);
 
-       //if (fDebug > 2) {cout << "Created: " << hout->GetName() << " of type: " << hout->ClassName() << " at: " << hout << endl;}
-
        return hout;
 
 }
@@ -1592,8 +1852,6 @@ TH1F* AliAODTrackCutsDiHadronPID::InitializeDCAxyHisto(const char* name, Int_t h
 
        hout->SetDirectory(0);
 
-       //if (fDebug > 2) {cout << "Created: " << hout->GetName() << " of type: " << hout->ClassName() << " at: " << hout << endl;}
-
        return hout;
 
 }
@@ -1608,8 +1866,6 @@ TH1F* AliAODTrackCutsDiHadronPID::InitializeDCAzHisto(const char* name, Int_t hi
 
        hout->SetDirectory(0);
 
-       //if (fDebug > 2) {cout << "Created: " << hout->GetName() << " of type: " << hout->ClassName() << " at: " << hout << endl;}
-
        return hout;
 
 }
@@ -1635,8 +1891,6 @@ TH3F* AliAODTrackCutsDiHadronPID::InitializePIDHisto(const char* name, Int_t his
 
        hout->SetDirectory(0);
 
-       //if (fDebug > 2) {cout << "Created: " << hout->GetName() << " of type: " << hout->ClassName() << " at: " << hout << endl;}
-
        return hout;
 
 }
@@ -1653,8 +1907,6 @@ TH2F* AliAODTrackCutsDiHadronPID::InitializeTOFMismatchHisto(const char* name, I
 
        hout->SetDirectory(0);
 
-       //if (fDebug > 2) {cout << "Created: " << hout->GetName() << " of type: " << hout->ClassName() << " at: " << hout << endl;}
-
        return hout;
 
 }
@@ -1671,11 +1923,6 @@ TH2F* AliAODTrackCutsDiHadronPID::InitializeTOFHisto(const char* name, Int_t his
 
        hout->SetDirectory(0);
 
-       //if (fDebug > 2) {cout << "Created: " << hout->GetName() << " of type: " << hout->ClassName() << " at: " << hout << endl;}
-
        return hout;
 
 }
-
-
-
index 7c1b23e551d77a36ee54a0f01f5d610835619691..df6da19b78305aacde6a5062ebe620b09c1e040d 100644 (file)
@@ -113,43 +113,15 @@ public:
        Bool_t RequestQAHistos(const Int_t histoclass, const Bool_t Enable3DSpectra = kFALSE, const Bool_t EnablePIDHistos = kFALSE);
        
        // Setters (Cuts)
-       void SetPtRange(Double_t minpt, Double_t maxpt) {
-               fMinPt = minpt;
-               fMaxPt = maxpt;
-               fTestPt = kTRUE;
-       }
-       void SetFilterMask(UInt_t filtermask) {
-               fFilterMask = filtermask;
-               fTestFilterMask = kTRUE;
-       }
-       void SetMaxEta(Double_t maxeta) {
-               fMaxEta = maxeta;
-               fTestMaxEta = kTRUE;
-       }
-       void SetMaxRapidity(Double_t maxrapidity) {
-               fMaxRapidity = maxrapidity;
-               fTestMaxRapidity = kTRUE;
-       }
-       void SetDemandNoMismatch() {
-               fTestTOFmismatch = kTRUE;
-       }
-       void SetDemandFlags(ULong_t demandedflags) {
-               fDemandedFlags = demandedflags;
-               fTestFlags = kTRUE;
-       }
-       void SetMinimumNumberOfTPCClusters(Int_t minimumnumberoftpcclusters) {
-               fMinimumNumberOfTPCClusters = minimumnumberoftpcclusters;
-               fTestNumberOfTPCClusters = kTRUE;
-       }
-       void SetDemandSPDCluster() {
-               fTestSPDAny = kTRUE;
-       }
-       void SetPtDeptDCACut(TFormula* DCAxyCutFormula, Double_t DCAzCut, UInt_t MinSPDHits = 1) {
-               fPtDeptDCAxyCutFormula = DCAxyCutFormula;
-               fDCAzCut = DCAzCut;
-               fMinSPDHitsForPtDeptDCAcut = MinSPDHits;
-               fTestPtDeptDCAcut = kTRUE;
-       }
+       void SetPtRange(Double_t minpt, Double_t maxpt);
+       void SetFilterMask(UInt_t filtermask);
+       void SetMaxEta(Double_t maxeta);
+       void SetMaxRapidity(Double_t maxrapidity);
+       void SetDemandNoMismatch();
+       void SetDemandFlags(ULong_t demandedflags);
+       void SetMinimumNumberOfTPCClusters(Int_t minimumnumberoftpcclusters);
+       void SetDemandSPDCluster();
+       void SetPtDeptDCACut(TFormula* DCAxyCutFormula, Double_t DCAzCut, UInt_t MinSPDHits = 1);
 
 // Setters (Settings)
        void SetIsMC(Bool_t ismc = kTRUE) {fIsMC = ismc;}
@@ -190,48 +162,14 @@ public:
 private:
 
 // Checks, return kTRUE if track passes the cut.
-       Bool_t CheckPt(Double_t pt) const {
-               // TODO: TO IMPLEMENTATION.             
-               if (!fTestPt) return kTRUE;
-               if ((pt > fMinPt) && (pt < fMaxPt)) return kTRUE;
-               return kFALSE;
-       }
-       Bool_t CheckMaxEta(Double_t eta) const {
-               if (!fTestMaxEta) return kTRUE;                         // Accepted if there is no check on this parameter.
-               if (TMath::Abs(eta) < fMaxEta) return kTRUE;
-               return kFALSE;
-       }
-       Bool_t CheckRapidity(Double_t rap) const {
-               if (!fTestMaxRapidity) return kTRUE;
-               if (TMath::Abs(rap) < fMaxRapidity) return kTRUE;
-               return kFALSE;
-       }
-       Bool_t CheckFilterMask(UInt_t filtermap) const {
-               if (!fTestFilterMask) return kTRUE;
-               if ((fFilterMask & filtermap) == fFilterMask) return kTRUE;
-               return kFALSE;
-       }
-       Bool_t CheckFlags(ULong_t flags) const {
-               if (!fTestFlags) return kTRUE;
-               if ((flags & fDemandedFlags) == fDemandedFlags) return kTRUE;
-               return kFALSE;
-       }
-       Bool_t CheckNclsTPC(Int_t ncls) const {
-               if (!fTestNumberOfTPCClusters) return kTRUE;
-               if (ncls > fMinimumNumberOfTPCClusters) return kTRUE;
-               return kFALSE;
-       }
-       Bool_t CheckTOFmismatch(Bool_t ismismatch) const {
-               if (!fTestTOFmismatch) return kTRUE; // if we're not cutting on mismatch, then it's accepted.
-               if (!ismismatch) return kTRUE;          // so if the track is not a mismatch, then it is accepted.
-               return kFALSE;                                          // if it is a mismatch, then it's not accepted.
-       }
-       Bool_t CheckPtDeptDCACut(Double_t dcaz, Double_t dcaxy, Double_t pt, UInt_t SPDhits) const {
-               if (!fTestPtDeptDCAcut) return kTRUE;
-               if (SPDhits < fMinSPDHitsForPtDeptDCAcut) return kTRUE; // If there are not enough SPD hits to do the cut.
-               if ((dcaz < fDCAzCut) && (dcaxy < fPtDeptDCAxyCutFormula->Eval(pt))) return kTRUE;
-               return kFALSE;
-       }
+       Bool_t CheckPt(Double_t pt) const;
+       Bool_t CheckMaxEta(Double_t eta) const;
+       Bool_t CheckRapidity(Double_t rap) const;
+       Bool_t CheckFilterMask(UInt_t filtermap) const;
+       Bool_t CheckFlags(ULong_t flags) const;
+       Bool_t CheckNclsTPC(Int_t ncls) const;
+       Bool_t CheckTOFmismatch(Bool_t ismismatch) const;
+       Bool_t CheckPtDeptDCACut(Double_t dcaz, Double_t dcaxy, Double_t pt, UInt_t SPDhits) const;
 
 // Filling QA histograms.
        Bool_t FillDataHistos(Int_t histoclass, AliTrackDiHadronPID* track);
@@ -246,6 +184,8 @@ private:
 
        void InitializeDefaultHistoNamesAndAxes();
 
+       TH1F* InitializeAcceptedFilterBits(const char* name);
+       void SetXaxisAcceptedFilterBits();
        TH1F* InitializePtSpectrum(const char* name, Int_t histoclass);
        TH2F* InitializeRecPtGenPt(const char* name, Int_t histoclass);
        TH3F* InitializePhiEtaPt(const char* name, Int_t histoclass);
@@ -255,7 +195,6 @@ private:
        TH3F* InitializeAcceptanceHisto(const char* /*name*/, Int_t /*histoclass*/); // TO BE IMPLEMENTED.
        TH2F* InitializeDCASpectrum(const char* name, Int_t histoclass);
 
-
        TH3F* InitializePIDHisto(const char* name, Int_t histoclass, Int_t expspecies, Int_t ptclass);
        TH2F* InitializeTOFMismatchHisto(const char* name, Int_t histoclass, Int_t expspecies, Int_t ptclass);
        TH2F* InitializeTOFHisto(const char* name, Int_t histoclass, Int_t expspecies, Int_t ptclass);
@@ -299,6 +238,8 @@ private:
 
 // QA histograms for Data.
        TList*                                  fDataTrackQAHistos;                             // 
+       TH1F*                                   fHistAcceptedFilterBits;                //! Histogram with the number of accepted tracks as function of filtermask.
+       TArrayI*                                fRelevantBitsArray;                             //! See method: InitializeAcceptedFilterBits().
        TH1F*                                   fHistDataPt[3];                                 //! Pt distribution of tracks passing this cut.
        TH3F*                                   fHistDataPhiEtaPt[3];                   //! Pt, Eta, Phi distribution.
        TH1F*                                   fHistDataNTracks[3];                    //! Number of tracks passing the cut per event (filling by EventIsDone()).
@@ -312,7 +253,7 @@ private:
        TH3F*                                   fHistTPCTOFMismatch[3][3][5];   //! TPC/TOF mismatch histograms (Same as TOF, but now the TPC hit of the track is included.)
 
 // QA histograms for all reconstructed MC tracks.
-       TH1F*                                   fTOFMatchingStat;                                       //
+       TH1F*                                   fTOFMatchingStat;                               //
 
 // QA histograms for Primary Reconstructed MC tracks.
        TList*                                  fPrimRecMCTrackQAHistos;                //
@@ -367,7 +308,7 @@ private:
 
        Int_t                                   fDebug;                                                 // Debug flag.
 
-       ClassDef(AliAODTrackCutsDiHadronPID,7);
+       ClassDef(AliAODTrackCutsDiHadronPID,8);
 
 };
 
index cd9a109b221fc8f5f970ebce9a187b6f1ca0e12c..b44222c5cc1e086a5848bba7a7c56a689a0a2632 100644 (file)
@@ -829,6 +829,20 @@ void AliAnalysisTaskDiHadronPID::SelectCollisionCandidates(UInt_t offlineTrigger
 
 }
 
+// -----------------------------------------------------------------------
+void AliAnalysisTaskDiHadronPID::SetDebugLevel(Int_t level) {
+
+       // Also propagates this setting to the track and event cuts.
+       if (fDebug > 0) {cout << Form("File: %s, Line: %i, Function: %s",__FILE__,__LINE__,__func__) << endl;}
+
+       fDebug = level;
+
+       if (fEventCuts) {fEventCuts->SetDebugLevel(level);}
+       if (fTrackCutsTrigger) {fTrackCutsTrigger->SetDebugLevel(level);}
+       if (fTrackCutsAssociated) {fTrackCutsAssociated->SetDebugLevel(level);}
+
+} 
+
 // -----------------------------------------------------------------------
 Bool_t AliAnalysisTaskDiHadronPID::LoadExtMismatchHistos() {
 
index ca901fac2317e353129a11d7df41a0cb5983e90b..67e370bd7d0294d076100240149d77ddf21492ee 100644 (file)
@@ -54,7 +54,9 @@ public:
        void SetTOFIntervalFactorTOFTPC(Double_t factor = 1.) {fTOFIntervalFactorTOFTPC = factor;}
        void SetExtendPtAxis(Bool_t extendptaxis) {fExtendPtAxis = extendptaxis;}
 
+       // Overrides methods from AliAnalyisTaskSE.
        void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB);
+       void SetDebugLevel(Int_t level);
 
        // Getters.
        Int_t GetNDEtaBins() const {return fNDEtaBins;}
index afec10e79b46c06576d8ed0c72f24059bb25a53b..3494b1e6eee7fd3362844dc5c67ce778a89f8719 100644 (file)
@@ -371,11 +371,11 @@ Bool_t AliTrackDiHadronPID::CopyTOFInfo() {
        //Int_t TOFlabeltmp[3] = {0};
        fAODGlobalTrack->GetTOFLabel(fTOFLabel);
        //for (Int_t iN = 0; iN < 3; ++iN) {fTOFLabel[iN] = TOFlabeltmp[iN];}
-
+       /*
        if (fTOFLabel[1] == fLabel || fTOFLabel[2] == fLabel) {
                cout<<"fLabel = " << fLabel << " fTOFLabel =  {" << fTOFLabel[0] << "," << fTOFLabel[1] << "," << fTOFLabel[2] <<"}"<<endl; 
        }
-
+       */
        // The following will only work in an AOD production with the fTOFlabels set.
        // If it wasn't set, then every track will be labeled as no match.
        if (fTOFLabel[0] == -1) {fTOFMatchingStatus = 2;}                       // TPC Track was not matched to any TOF hit.