Coverity
authorsma <sma@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Dec 2011 11:56:40 +0000 (11:56 +0000)
committersma <sma@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Dec 2011 11:56:40 +0000 (11:56 +0000)
12 files changed:
PWG3/hfe/AliHFEOADBThresholdsTRD.cxx
PWG3/hfe/AliHFEbayesPIDqa.cxx
PWG3/hfe/AliHFEbayesPIDqa.h
PWG3/hfe/AliHFEcontainer.cxx
PWG3/hfe/AliHFEcontainer.h
PWG3/hfe/AliHFEdetPIDqa.cxx
PWG3/hfe/AliHFEextraCuts.cxx
PWG3/hfe/AliHFEextraCuts.h
PWG3/hfe/AliHFEpidBayes.cxx
PWG3/hfe/AliHFEpostAnalysis.cxx
PWG3/hfe/AliHFEtrdPIDqaV1.cxx
PWG3/hfe/AliHFEvarManager.cxx

index c621f77..25adff4 100755 (executable)
@@ -140,11 +140,13 @@ AliHFEOADBThresholdsTRD::AliHFEthresholdParamsTRD &AliHFEOADBThresholdsTRD::AliH
   //
   // Assignment operator
   //
-  TObject::operator=(ref);
+  if(this != &ref){
+    TObject::operator=(ref);
 
-  fNTracklets = ref.fNTracklets;
-  fEfficiency = ref.fEfficiency;
-  memcpy(fParams, ref.fParams, sizeof(Double_t) * 4);
+    fNTracklets = ref.fNTracklets;
+    fEfficiency = ref.fEfficiency;
+    memcpy(fParams, ref.fParams, sizeof(Double_t) * 4);
+  }
   return *this;
 }
         
index 0efeb62..040299f 100644 (file)
 
 ClassImp(AliHFEbayesPIDqa)
 
-//----------------------------------------------------------------
-// Definition of common binning
-const Int_t kNdim = 5;
-const Int_t kPIDbins = AliPID::kSPECIES + 1;
-const Int_t kProbbins = 100;
-const Int_t kSteps = 2;
-const Int_t kCentralityBins = 11;
-const Double_t kMinPID = -1;
-const Double_t kMinP = 0.;
-const Double_t kMaxPID = (Double_t)AliPID::kSPECIES;
-const Double_t kMaxP = 20.;
-
-const Int_t AliHFEbayesPIDqa::fgkNBinsProb[kNdim] = {
-    kPIDbins,                     // species
-    1000,                       // p-bins
-    kProbbins,                    // probability
-    kSteps,                       // step
-    kCentralityBins               // centrality
-};
-const Double_t AliHFEbayesPIDqa::fgkMinBinsProb[kNdim] = {
-    -1.,                          // species
-    0.,                           // p-bins
-    0.,                           // probability
-    0.,                           // step
-    0.                            // centrality
-};
-const Double_t AliHFEbayesPIDqa::fgkMaxBinsProb[kNdim] = {
-    (Double_t)AliPID::kSPECIES,   // species
-    20.,                          // p-bins
-    1.,                           // probability
-    2.,                           // step
-    11.                           // centrality
-};
-//----------------------------------------------------------------
-
 //_________________________________________________________
 AliHFEbayesPIDqa::AliHFEbayesPIDqa():
     AliHFEdetPIDqa()
@@ -116,9 +81,10 @@ AliHFEbayesPIDqa &AliHFEbayesPIDqa::operator=(const AliHFEbayesPIDqa &o){
   //
   // Make assignment
   //
-  AliHFEdetPIDqa::operator=(o);
-  fHistos = o.fHistos;
-  
+  if(this != &o){
+    AliHFEdetPIDqa::operator=(o);
+    fHistos = o.fHistos;
+  }
   return *this;
 }
 
@@ -130,8 +96,44 @@ AliHFEbayesPIDqa::~AliHFEbayesPIDqa(){
   //
   if(fHistos) delete fHistos;
 }
+//_________________________________________________________
+void AliHFEbayesPIDqa::Copy(TObject &o) const {
+  //
+  // Make copy
+  //
+  AliHFEbayesPIDqa &target = dynamic_cast<AliHFEbayesPIDqa &>(o);
+  if(target.fHistos){
+    delete target.fHistos;
+    target.fHistos = NULL;
+  }
+  if(fHistos) target.fHistos = new AliHFEcollection(*fHistos);
+
+}
 
 //_________________________________________________________
+Long64_t AliHFEbayesPIDqa::Merge(TCollection *coll){
+  //
+  // Merge with other objects
+  //
+  if(!coll) return 0;
+  if(coll->IsEmpty()) return 1;
+
+  TIter it(coll);
+  AliHFEbayesPIDqa *refQA = NULL;
+  TObject *o = NULL;
+  Long64_t count = 0;
+  TList listHistos;
+  while((o = it())){
+    refQA = dynamic_cast<AliHFEbayesPIDqa *>(o);
+    if(!refQA) continue;
+
+    listHistos.Add(refQA->fHistos);
+    count++; 
+  }
+  fHistos->Merge(&listHistos);
+  return count + 1;
+}
+//_________________________________________________________
 void AliHFEbayesPIDqa::Initialize(){
   //
   // Define Histograms
@@ -139,46 +141,36 @@ void AliHFEbayesPIDqa::Initialize(){
 
   fHistos = new AliHFEcollection("BAYESqahistos", "Collection of Bayes QA histograms");
 
-  CreateProbabilityHistograms();
   CreateDetectorSignalHistograms();
 
 //  fBAYESpid = new AliHFEpidBayes("QAbayesPID");
 
 }
 
-//__________________________________________________________________
-void AliHFEbayesPIDqa::CreateProbabilityHistograms(){
+
+void AliHFEbayesPIDqa::CreateDetectorSignalHistograms(){
   //
   // Create Histogram for Probability Studies
-  //
+    //
 
-  fHistos->CreateTHnSparse("combprob", "Comb prob; species; p [GeV/c]; Comb prob; Selection Step; Centrality", kNdim, fgkNBinsProb, fgkMinBinsProb, fgkMaxBinsProb);
+    Int_t kPbins = 1000;  //fQAmanager->HasHighResolutionHistos() ? 1000 : 100;
+    Int_t kSigmaBins = 300; //fQAmanager->HasHighResolutionHistos() ? 600 : 150;
+    Int_t trdLikelihoodBins = 100; // fQAmanager->HasHighResolutionHistos() ? 200 : 100;
+    const Int_t kPIDbins = AliPID::kSPECIES + 1;
+    const Int_t kProbbins = 100;
+    const Int_t kSteps = 2;
+    const Int_t kCentralityBins = 11;
+    const Double_t kMinPID = -1;
+    const Double_t kMinP = 0.;
+    const Double_t kMaxPID = (Double_t)AliPID::kSPECIES;
+    const Double_t kMaxP = 10.;
 
+    Int_t nBinsContr[8] =  {kPIDbins, kPbins, kProbbins, kSigmaBins, kSigmaBins, trdLikelihoodBins, kSteps, kCentralityBins};
+    Double_t minContr[8] = {kMinPID, kMinP, 0,  -10., -7., 0., 0., 0.};
+    Double_t maxContr[8] = {kMaxPID, kMaxP, 1,    5.,   8., 1., 2., 11.};
+    fHistos->CreateTHnSparse("control", "Control; species; p [GeV/c]; Comb prob; TPC sigma; TOF sigma; TRD electron Likelihood; selection step; centrality", 8, nBinsContr, minContr,maxContr);
 
-}
 
-void AliHFEbayesPIDqa::CreateDetectorSignalHistograms(){
-  //
-  // Create Histogram for Probability Studies
-  //
-    Int_t kPbins = fQAmanager->HasHighResolutionHistos() ? 1000 : 100;
-    Int_t kSigmaBins = fQAmanager->HasHighResolutionHistos() ? 1400 : 240;
-    Int_t nBinsSigma[kNdim] = {kPIDbins, kPbins, kSigmaBins, kSteps, kCentralityBins};
-    Double_t minSigma[kNdim] = {kMinPID, kMinP, -12., 0., 0.};
-    Double_t maxSigma[kNdim] = {kMaxPID, kMaxP, 12., 2., 11.};
-    fHistos->CreateTHnSparse("tpcsigma", "TPC sigma; species; p [GeV/c]; TPC sigma; Selection Step; Centrality", kNdim, nBinsSigma, minSigma,maxSigma);
-    fHistos->CreateTHnSparse("tofsigma", "TOF sigma; species; p [GeV/c]; TOF sigma; Selection Step; Centrality", kNdim, nBinsSigma, minSigma,maxSigma);
-
-    Int_t trdLikelihoodBins = fQAmanager->HasHighResolutionHistos() ? 200 : 100;
-    Int_t nBinsTRDlike[5] = {kPIDbins, kPbins, trdLikelihoodBins, kSteps, kCentralityBins};
-    Double_t minTRDlike[5] = {kMinPID, kMinP, 0., 0., 0.};
-    Double_t maxTRDlike[5] = {kMaxPID, kMaxP, 1., 2., 11.};
-    fHistos->CreateTHnSparse("trdlikeli", "TRD Likelihood Distribution; species; p [GeV/c]; TRD electron Likelihood; selection step", 5, nBinsTRDlike, minTRDlike, maxTRDlike);
-
-    Int_t nBinsContr[6] = {kPIDbins, kPbins, kProbbins, kSigmaBins, kSigmaBins, trdLikelihoodBins};
-    Double_t minContr[6] = {kMinPID, kMinP, 0,  -12., -12., 0.};
-    Double_t maxContr[6] = {kMaxPID, kMaxP, 1,   12.,  12., 1.};
-    fHistos->CreateTHnSparse("control", "Control; species; p [GeV/c]; Comb prob; TPC sigma; TOF sigma; TRD electron Likelihood", 6, nBinsContr, minContr,maxContr);
 
     Int_t nBinsTOFmass[5] = {kPIDbins, kPbins, 150, kSteps, kCentralityBins};
     Double_t minTOFmass[5] = {kMinPID, kMinP, 0., 0., 0.};
@@ -201,45 +193,50 @@ void AliHFEbayesPIDqa::ProcessTrack(const AliHFEpidObject *track, AliHFEdetPIDqa
   Double_t probComb[AliPID::kSPECIES]={0.};
   AliHFEpidBayes *bayespid = dynamic_cast<AliHFEpidBayes *>(fQAmanager->GetDetectorPID(AliHFEpid::kBAYESpid));
   const AliPIDResponse *pidResponseBayes = bayespid ? bayespid->GetPIDResponse() : NULL;
+  if(!pidResponseBayes){
+    AliError("No PID Response available");
+    return;
+  }
   bayespid->CalcCombProb(track,pidResponseBayes, probComb);
 
-  Double_t contentSignal[5];
+  Double_t contentSignal[8];
   contentSignal[0] = species;
   contentSignal[1] = track->GetRecTrack()->P();
   contentSignal[2] = probComb[AliPID::kElectron];
 //  contentSignal[2] = contentSignal[2] = pidResponse ? pidResponse->NumberOfSigmasTPC(track->GetRecTrack(), AliPID::kElectron) : 0.;
-  contentSignal[3] = step;
-  contentSignal[4] = centrality;
-  fHistos->Fill("combprob", contentSignal);
-
-  Double_t contentContr[6];
-  contentContr[0]=contentSignal[0];
-  contentContr[1]=contentSignal[1];
-  contentContr[2]=contentSignal[2];
 
   AliHFEpidTOF *tofpid = dynamic_cast<AliHFEpidTOF *>(fQAmanager->GetDetectorPID(AliHFEpid::kTOFpid));
   const AliPIDResponse *pidResponseTOF = tofpid ? tofpid->GetPIDResponse() : NULL;
-  contentSignal[2] = pidResponseTOF ? pidResponseTOF->NumberOfSigmasTOF(track->GetRecTrack(), AliPID::kElectron): -10.;
-  fHistos->Fill("tofsigma", contentSignal);
-  contentContr[3]=contentSignal[2];
+  if(!pidResponseTOF){
+    AliError("No PID response available");
+    return;
+  }
+  contentSignal[4] = pidResponseTOF ? pidResponseTOF->NumberOfSigmasTOF(track->GetRecTrack(), AliPID::kElectron): -10.;
 
   AliHFEpidTPC *tpcpid = dynamic_cast<AliHFEpidTPC *>(fQAmanager->GetDetectorPID(AliHFEpid::kTPCpid));
   const AliPIDResponse *pidResponse = tpcpid ? tpcpid->GetPIDResponse() : NULL;
-  contentSignal[2] = pidResponse ? pidResponse->NumberOfSigmasTPC(track->GetRecTrack(), AliPID::kElectron) : -10.;
-  fHistos->Fill("tpcsigma", contentSignal);
-  contentContr[4]=contentSignal[2];
-
+  if(!pidResponse){
+    AliError("No PID response available");
+    return;
+  }
+  contentSignal[3] = pidResponse ? pidResponse->NumberOfSigmasTPC(track->GetRecTrack(), AliPID::kElectron) : -10.;
 
   AliHFEpidTRD *trdpid = dynamic_cast<AliHFEpidTRD *>(fQAmanager->GetDetectorPID(AliHFEpid::kTRDpid));
-  contentSignal[2] = trdpid ? trdpid->GetElectronLikelihood(static_cast<const AliVTrack*>(track->GetRecTrack()), anatype) : -10;
-  fHistos->Fill("trdlikeli", contentSignal);
+  contentSignal[5] = trdpid ? trdpid->GetElectronLikelihood(static_cast<const AliVTrack*>(track->GetRecTrack()), anatype) : -10;
+
+  contentSignal[6] = step;
+  contentSignal[7] = centrality;
+  fHistos->Fill("control", contentSignal);
 
-  contentContr[5]=contentSignal[2];
-  fHistos->Fill("control", contentContr);
+  Double_t contentFill[5];
+  contentFill[0]=contentSignal[0];
+  contentFill[1]=contentSignal[1];
+  contentFill[3]=contentSignal[6];
+  contentFill[4]=contentSignal[7];
 
   Double_t masscalcfromtof=CalcTOFMass(track);
-  contentSignal[2]=masscalcfromtof;
-  fHistos->Fill("tofmass", contentSignal);
+  contentFill[2]=masscalcfromtof;
+  fHistos->Fill("tofmass", contentFill);
 }
 
 Double_t AliHFEbayesPIDqa::CalcTOFMass(const AliHFEpidObject *track){
index bd32149..a9563a7 100644 (file)
@@ -42,6 +42,8 @@ class AliHFEbayesPIDqa : public AliHFEdetPIDqa{
     AliHFEbayesPIDqa(const AliHFEbayesPIDqa &c);
     AliHFEbayesPIDqa &operator=(const AliHFEbayesPIDqa &o);
     ~AliHFEbayesPIDqa();
+    void Copy(TObject &o) const;
+    virtual Long64_t Merge(TCollection *col);
   
     virtual void Initialize();
     virtual void ProcessTrack(const AliHFEpidObject *track, AliHFEdetPIDqa::EStep_t step);
@@ -50,13 +52,9 @@ class AliHFEbayesPIDqa : public AliHFEdetPIDqa{
     AliHFEcollection *GetHistograms() const { return fHistos; }
 
   protected:
-      void CreateProbabilityHistograms();
       void CreateDetectorSignalHistograms();
       Double_t CalcTOFMass(const AliHFEpidObject *track);
 private:
-    static const Int_t       fgkNBinsProb[5];         // number of bins
-    static const Double_t    fgkMinBinsProb[5];       // bin minimum
-    static const Double_t    fgkMaxBinsProb[5];       // bin maximum
 //    AliHFEpidBayes *fBAYESpid;        // HFE PID for TRD
     AliHFEcollection *fHistos;        // Container for Histograms
 
index 1244997..5469953 100644 (file)
@@ -32,6 +32,7 @@
 #include <TString.h>
 
 #include "AliCFContainer.h"
+#include "AliCFGridSparse.h"
 #include "AliHFEcontainer.h"
 #include "AliHFEtools.h"
 
@@ -132,6 +133,7 @@ AliHFEcontainer &AliHFEcontainer::operator=(const AliHFEcontainer &ref){
   // Assignment operator
   // Cleanup old object, create a new one with new containers inside
   //
+  if(this == &ref) return *this;
   this->~AliHFEcontainer(); // cleanup old object before creating the new onwe
   TNamed::operator=(ref);
   fContainers = new THashList();
@@ -446,6 +448,18 @@ Int_t AliHFEcontainer::GetNumberOfCFContainers() const{
 }
 
 //__________________________________________________________________
+void AliHFEcontainer::Sumw2(const char *contname) const {
+  // 
+  // Set sums of weights for all steps of a given container
+  //
+  AliCFContainer *cont = GetCFContainer(contname);
+  if(cont){
+    for(Int_t istep = 0; istep < cont->GetNStep(); istep++)
+      cont->GetGrid(istep)->SumW2();
+  }
+}
+
+//__________________________________________________________________
 void AliHFEcontainer::Print(const Option_t *)const{
   //
   // Print Container Status
index 109f1e8..b20614c 100644 (file)
@@ -72,6 +72,7 @@ class AliHFEcontainer : public TNamed{
     void MakeLinearBinning(UInt_t var, UInt_t nBins, Double_t begin, Double_t end);
     void MakeLogarithmicBinning(UInt_t var, UInt_t nBins, Double_t begin, Double_t end);
     void MakeUserDefinedBinning(UInt_t var, UInt_t nBins, const Double_t *binning);
+    void Sumw2(const char *contname) const;
 
     virtual void Print(const Option_t * opt = NULL) const;
 
index e0a6326..12c0685 100644 (file)
@@ -68,6 +68,7 @@ AliHFEdetPIDqa &AliHFEdetPIDqa::operator=(const AliHFEdetPIDqa &o){
   //
   // Make assignment
   //
+  if(this == &o) return *this;
   TNamed::operator=(o);
 
   fQAmanager = o.fQAmanager;
index 575a99c..83eefa8 100644 (file)
@@ -58,6 +58,7 @@ AliHFEextraCuts::AliHFEextraCuts(const Char_t *name, const Char_t *title):
   fMinNClustersTPC(0),
   fClusterRatioTPC(0.),
   fMinTrackletsTRD(0),
+  fTRDtrackletsExact(0),
   fPixelITS(0),
   fTPCclusterDef(0),
   fTPCclusterRatioDef(0),
@@ -82,6 +83,7 @@ AliHFEextraCuts::AliHFEextraCuts(const AliHFEextraCuts &c):
   fMinNClustersTPC(c.fMinNClustersTPC),
   fClusterRatioTPC(c.fClusterRatioTPC),
   fMinTrackletsTRD(c.fMinTrackletsTRD),
+  fTRDtrackletsExact(c.fTRDtrackletsExact),
   fPixelITS(c.fPixelITS),
   fTPCclusterDef(c.fTPCclusterDef),
   fTPCclusterRatioDef(c.fTPCclusterRatioDef),
@@ -116,6 +118,7 @@ AliHFEextraCuts &AliHFEextraCuts::operator=(const AliHFEextraCuts &c){
     fClusterRatioTPC = c.fClusterRatioTPC;
     fMinNClustersTPC = c.fMinNClustersTPC;
     fMinTrackletsTRD = c.fMinTrackletsTRD;
+    fTRDtrackletsExact = c.fTRDtrackletsExact;
     fPixelITS = c.fPixelITS;
     fTPCclusterDef = c.fTPCclusterDef;
     fTPCclusterRatioDef = c.fTPCclusterRatioDef;
@@ -243,8 +246,13 @@ Bool_t AliHFEextraCuts::CheckRecCuts(AliVTrack *track){
   }
   if(TESTBIT(fRequirements, kMinTrackletsTRD)){
     // cut on minimum number of TRD tracklets
-    AliDebug(1, Form("Min TRD cut: [%d|%d]\n", fMinTrackletsTRD, trdTracklets));
-    if(trdTracklets >= fMinTrackletsTRD) SETBIT(survivedCut, kMinTrackletsTRD);
+    AliDebug(1, Form("Min TRD cut: [%d|%d], Require exact number [%s]\n", fMinTrackletsTRD, trdTracklets, fTRDtrackletsExact ? "Yes" : "No"));
+    if(fTRDtrackletsExact){
+      if(trdTracklets == fMinTrackletsTRD) SETBIT(survivedCut, kMinTrackletsTRD);
+    }else{
+      if(trdTracklets >= fMinTrackletsTRD) SETBIT(survivedCut, kMinTrackletsTRD);
+      //printf("Min number of tracklets %d\n",fMinTrackletsTRD);
+    }
   }
   if(TESTBIT(fRequirements, kMinNClustersTPC)){
     // cut on minimum number of TRD tracklets
@@ -386,11 +394,13 @@ void AliHFEextraCuts::FillQAhistosRec(AliVTrack *track, UInt_t when){
   }
   // Fill histogram with the status bits
   TH1 *hStatusBits = dynamic_cast<TH1 *>(fQAlist->At(6 + when * fgkNQAhistos));
-  hStatusBits->Fill(0);  // Fill first bin with all tracks
-  if(track->GetStatus() && AliESDtrack::kTOFpid) hStatusBits->Fill(1);
-  if(!(track->GetStatus() && AliESDtrack::kTOFmismatch)) hStatusBits->Fill(2);
-  if(track->GetStatus() && AliESDtrack::kEMCALmatch) hStatusBits->Fill(3);
-  if(GetTPCCountSharedMapBitsAboveThreshold(track)==0) hStatusBits->Fill(4);
+  if(hStatusBits) {
+    hStatusBits->Fill(0);  // Fill first bin with all tracks
+    if(track->GetStatus() && AliESDtrack::kTOFpid) hStatusBits->Fill(1);
+    if(!(track->GetStatus() && AliESDtrack::kTOFmismatch)) hStatusBits->Fill(2);
+    if(track->GetStatus() && AliESDtrack::kEMCALmatch) hStatusBits->Fill(3);
+    if(GetTPCCountSharedMapBitsAboveThreshold(track)==0) hStatusBits->Fill(4);
+  }
   if((htmp = dynamic_cast<TH1F *>(fQAlist->At(7 + when * fgkNQAhistos)))) htmp->Fill(GetTPCnclusdEdx(track));
 }
 
@@ -685,6 +695,10 @@ void AliHFEextraCuts::GetHFEImpactParameters(AliVTrack *track, Double_t &dcaxy,
   Float_t covF[3]={-999.,-999.,-999.};
   
   AliESDEvent *esdevent = dynamic_cast<AliESDEvent *>(fEvent);
+  if(!esdevent) {
+    AliDebug(1, "No esd event available\n");
+    return;
+  }
   const AliVVertex *vtxESDSkip = esdevent->GetPrimaryVertex();
   if( vtxESDSkip->GetNContributors() < 30){ // if vertex contributor is smaller than 30, recalculate the primary vertex
    // recalculate primary vertex for peri. and pp
index c24bace..6c06f10 100644 (file)
@@ -67,7 +67,7 @@ class AliHFEextraCuts : public AliCFCutBase{
     inline void SetMinImpactParamZ(Double_t impactParam);
     inline void SetMaxImpactParamZ(Double_t impactParam);
     inline void SetMinHFEImpactParamR(Float_t ipcutParam[4], Bool_t issigmacut);
-    inline void SetMinTrackletsTRD(Int_t minTracklets);
+    inline void SetMinTrackletsTRD(Int_t minTracklets, Bool_t exact = kFALSE);
     inline void SetMinNClustersTPC(Int_t minclusters, ETPCclusterDef_t def);
     void SetTOFPID(Bool_t tofPid) { tofPid ? SETBIT(fRequirements, kTOFPID) : CLRBIT(fRequirements, kTOFPID); }
     void SetTOFMISMATCH(Bool_t tofMismatch) { tofMismatch ? SETBIT(fRequirements, kTOFmismatch) : CLRBIT(fRequirements, kTOFmismatch); }
@@ -140,6 +140,7 @@ class AliHFEextraCuts : public AliCFCutBase{
     UInt_t fMinNClustersTPC;          // Minimum TPC clusters cut
     Float_t fClusterRatioTPC;                // Ratio of findable vs. found clusters in TPC
     UChar_t fMinTrackletsTRD;                // Min. Number of Tracklets inside TRD
+    Bool_t  fTRDtrackletsExact;       // Require exact number of tracklets
     UChar_t fPixelITS;                // Cut on ITS Pixels
     UChar_t fTPCclusterDef;           // TPC cluster definition Bitmap
     UChar_t fTPCclusterRatioDef;      // TPC cluster ratio definition Bitmap
@@ -200,9 +201,10 @@ void AliHFEextraCuts::SetMinHFEImpactParamR(Float_t ipcutParam[4], Bool_t isSigm
 }
 
 //__________________________________________________________
-void AliHFEextraCuts::SetMinTrackletsTRD(Int_t minTracklets){
+void AliHFEextraCuts::SetMinTrackletsTRD(Int_t minTracklets, Bool_t exact){
   SETBIT(fRequirements, kMinTrackletsTRD);
   fMinTrackletsTRD = minTracklets;
+  fTRDtrackletsExact = exact;
 }
 
 //__________________________________________________________
index a71bdcc..fcb40c8 100644 (file)
@@ -168,16 +168,16 @@ Int_t AliHFEpidBayes::IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanage
     if((fDetMask==fDetMaskDefault)||(fDetMask==fDetMaskDefaultandTRD))
     {
        Double_t probTPC[AliPID::kSPECIES]={0.};
-       usedTPC = fkPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTPC,(AliVTrack*)track->GetRecTrack(),AliPID::kSPECIES,probTPC);
+       usedTPC = fkPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTPC,(AliVTrack*)track->GetRecTrack(),AliPID::kSPECIES,probTPC) == AliPIDResponse::kDetPidOk;
        Double_t probTOF[AliPID::kSPECIES]={0.};
-       usedTOF = fkPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTOF,(AliVTrack*)track->GetRecTrack(),AliPID::kSPECIES,probTOF);
+       usedTOF = fkPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTOF,(AliVTrack*)track->GetRecTrack(),AliPID::kSPECIES,probTOF) == AliPIDResponse::kDetPidOk;
        if((usedTOF==1)&&(usedTPC==1)) used=1;
         else used=0;
 
        if(fDetMask==fDetMaskDefaultandTRD)
        {
            Double_t probTRD[AliPID::kSPECIES]={0.};
-           usedTRD = fkPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTRD,(AliVTrack*)track->GetRecTrack(),AliPID::kSPECIES,probTRD);
+           usedTRD = fkPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTRD,(AliVTrack*)track->GetRecTrack(),AliPID::kSPECIES,probTRD) == AliPIDResponse::kDetPidOk;
            if((usedTOF==1)&&(usedTPC==1)&&(usedTRD==1)) used=1;
            else used=0;
        } 
index 8fe30f5..a2d2835 100644 (file)
@@ -71,6 +71,7 @@ AliHFEpostAnalysis& AliHFEpostAnalysis::operator=(const AliHFEpostAnalysis &ref)
   //
   // Assignment Operator
   //
+  if(this == &ref) return *this;
   TObject::operator=(ref);
   fResults = ref.fResults;
   fAnalysisObjects = ref.fAnalysisObjects;
index 618be03..f541afe 100644 (file)
@@ -83,6 +83,7 @@ AliHFEtrdPIDqaV1 &AliHFEtrdPIDqaV1::operator=(const AliHFEtrdPIDqaV1 &o){
   //
   // Make assignment
   //
+  if(this == &o) return *this;
   AliHFEdetPIDqa::operator=(o);
   fHistos = o.fHistos;
   
index 36271d8..a4a4d68 100644 (file)
@@ -523,6 +523,10 @@ AliHFEvarManager::AliHFEvariable& AliHFEvarManager::AliHFEvariable::operator=(co
     fNBins = ref.fNBins;
     fMax = ref.fMax;
     fMin = ref.fMin;
+    if(ref.fBinning){
+      fBinning = new Double_t[ref.fNBins + 1];
+      memcpy(fBinning, ref.fBinning, sizeof(Double_t) * (ref.fNBins + 1));
+    } else fBinning = NULL;
     fIsLogarithmic = ref.fIsLogarithmic;
   }
   return *this;