ClassImp(AliAnalysisTaskSpectraBoth)
//________________________________________________________________________
-AliAnalysisTaskSpectraBoth::AliAnalysisTaskSpectraBoth(const char *name) : AliAnalysisTaskSE(name), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0), fPID(0), fIsMC(0), fNRebin(0),fUseMinSigma(0),fCuts(0),fdotheMCLoopAfterEventCuts(0),
-fmakePIDQAhisto(1),fMotherWDPDGcode(-1)
+AliAnalysisTaskSpectraBoth::AliAnalysisTaskSpectraBoth(const char *name) : AliAnalysisTaskSE(name), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0), fPID(0), fIsMC(0), fNRebin(0),fUseMinSigma(0),fCuts(0),fdotheMCLoopAfterEventCuts(0),fmakePIDQAhisto(1),fMotherWDPDGcode(-1)
{
// Default constructor
fHistMan->GetPtHistogram(kHistPtRec)->Fill(track->Pt(),dca); // PT histo
// get identity and charge
Bool_t rec[3]={false,false,false};
+ Bool_t sel[3]={false,false,false};
Int_t idRec = fPID->GetParticleSpecie(fHistMan,track, fTrackCuts,rec);
for(int irec=kSpPion;irec<kNSpecies;irec++)
{
fTrackCuts->GetHistoDCAzQA()->Fill(idRec,track->Pt(),dcaz);
fTrackCuts->GetHistoNclustersQA()->Fill(idRec,track->Pt(),ncls);
fTrackCuts->GetHistochi2perNDFQA()->Fill(idRec,track->Pt(),chi2perndf);
+ sel[idRec]=true;
}
//can't put a continue because we still have to fill allcharged primaries, done later
if(!fTrackCuts->CheckYCut ((BothParticleSpecies_t)idRec)) continue;
// Get true ID
-
+
if (idRec == idGen) fHistMan->GetHistogram2D(kHistPtRecTrue, idGen, charge)->Fill(track->Pt(),dca);
}//end if(arrayMC)
}
+ if(sel[0]&&sel[1]&&sel[2])//pi+k+p
+ fHistMan->GetPtHistogram("hHistDoubleCounts")->Fill(track->Pt(),0);
+ else if(sel[0]&&sel[1]) //pi+k
+ fHistMan->GetPtHistogram("hHistDoubleCounts")->Fill(track->Pt(),1);
+ else if(sel[0]&&sel[2]) //pi+k
+ fHistMan->GetPtHistogram("hHistDoubleCounts")->Fill(track->Pt(),2);
+ else if(sel[1]&&sel[2]) //p+k
+ fHistMan->GetPtHistogram("hHistDoubleCounts")->Fill(track->Pt(),3);
+
} // end loop on tracks
if (ihist > kNPtRecAllChHist && ihist <= kNHistPID && pidqa) BookPIDHistogram(kHistNameBoth[ihist]); // PID histos
if (ihist > kNHistPID && ihist <= kNHistNSig && pidqa) BookNSigHistogram(kHistNameBoth[ihist]); // NSigmaSep histos
if(ihist==kHistGenMulvsRawMul) BookGenMulvsRawMulHistogram(kHistNameBoth[ihist]);
+ if(ihist==kHistDoubleCounts)BookDoubleCountsHistogram(kHistNameBoth[ihist]);
}
TH1::AddDirectory(oldStatus);
// returns histo based on ids, casting it to TH2*
return (TH2*) GetHistogram1D(histoType,particleType,charge);
+}
+//______________________________________________________________________________________________________
+ TH2F* AliSpectraBothHistoManager::BookDoubleCountsHistogram(const char * name)
+{
+ // Return a pt histogram with predefined binning, set the ID and add it to the output list
+ AliInfo(Form("Booking Double Counts histogram %s", name));
+ const Double_t templBins[] = {0.05,0.1,0.12,0.14,0.16,0.18,0.20,0.25,0.30,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.8,5.0};
+ Int_t nbinsTempl=52;
+
+ TH2F * hist = new TH2F(name,"Histogram of double counts",nbinsTempl,templBins,4,-0.5,3.5);
+ hist->GetXaxis()->SetTitle("P_{T} (GeV / c)");
+ hist->GetYaxis()->SetTitle("type of doubles");
+ hist->GetYaxis()->SetBinLabel(1,"#pi+K+p");
+ hist->GetYaxis()->SetBinLabel(2,"#pi+K");
+ hist->GetYaxis()->SetBinLabel(3,"#pi+p");
+ hist->GetYaxis()->SetBinLabel(4,"K+p");
+
+ hist->SetMarkerStyle(kFullCircle);
+ hist->Sumw2();
+ fOutputList->Add(hist);
+
+ return hist;
+
}
+
TH2F* BookPIDHistogram(const char * name);
TH2F* BookNSigHistogram(const char * name);
TH2F* BookGenMulvsRawMulHistogram(const char * name);
-
+ TH2F* BookDoubleCountsHistogram(const char * name);
+
TH1F* GetPtHistogram1D(const char * name,Double_t minDCA,Double_t maxDCA);
TH1F* GetDCAHistogram1D(const char * name,Double_t minPt,Double_t maxPt);
TH2* GetHistogram(UInt_t id) { return (TH2*) fOutputList->At(id); }
AliSpectraBothHistoManager(const AliSpectraBothHistoManager&);
AliSpectraBothHistoManager& operator=(const AliSpectraBothHistoManager&);
- ClassDef(AliSpectraBothHistoManager, 1);
+ ClassDef(AliSpectraBothHistoManager, 2);
};
#endif
"hHistNSigKaonPtTPCTOF",
"hHistNSigProtonPtTPCTOF",
"hHistGenMulvsRawMul",
+ "hHistDoubleCounts"
};
kNHistNSig=kHistNSigProtonPtTPCTOF,
kHistGenMulvsRawMul,
+
+ kHistDoubleCounts,
kNHist, // Total number of histos
}; // Type of events plotted in Pt Histogram