fContainer->Add(fCHSum);
}
-
+ // Post output data
+ PostData(1, fContainer);
}
//________________________________________________________________________
fNbTRDTrackOffline->Fill(nbTrdTracksOffline);
}
-
- //printf("Nbof tracks %d\n",nbTrdTracks);
-
- // Post output data
- PostData(1, fContainer);
-
- //printf("post container\n");
-
-}
+}
+
//________________________________________________________________________
void AliTRDcalibration::Terminate(Option_t *)
{
//
// Create Output Objects
//
- if(!HasFunctorList()) InitFunctorList();
- fContainer = Histos();
+ AliTRDrecoTask::UserCreateOutputObjects();
if(!fTriggerNames) fTriggerNames = new TMap();
}
histo = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTrigger));
histo->GetXaxis()->SetBinLabel(histo->FindBin(triggermask), triggername);
}
- PostData(1, fContainer);
}
// Create Output Containers (TObjectArray containing 1D histograms)\r
//\r
Histos();\r
+ PostData(1, fHistos);\r
}\r
\r
//____________________________________________________________________\r
h->Fill(nTracksAcc);\r
h = (TH1I*)fHistos->At(kNTracksTPC);\r
h->Fill(nTracksTPC);\r
- \r
- PostData(1, fHistos);\r
}\r
\r
//____________________________________________________________________\r
// Create histograms
// Called once
- if(!HasFunctorList()) InitFunctorList();
- fContainer = Histos();
-
+ AliTRDrecoTask::UserCreateOutputObjects();
fPID = new TObjArray();
fPID->SetOwner(kTRUE);
+ PostData(2, fPID);
}
//________________________________________________________
fPID->Delete();
AliTRDrecoTask::UserExec(opt);
-
- PostData(2, fPID);
}
void AliTRDclusterResolution::UserCreateOutputObjects()
{
fContainer = Histos();
+ PostData(1, fContainer);
}
//_______________________________________________________
// fill histo for systematic (mean)
((TH3S*)arr2->At(it-1))->Fill(10.*cli->GetAnisochronity(), dydx-cli->GetTilt()*dzdx, dy);
}
- PostData(1, fContainer);
}
}
fContainer->Add(h = new TProfile("h", "", nbins, xbins));
h->SetMarkerStyle(7);
+ PostData(1, fContainer);
}
//____________________________________________________________________
for(Int_t itk = 0; itk < nTRD - 1; itk++)
if(labelsacc[indices[itk]] ==labelsacc[indices[itk + 1]]) printf("Double counted MC track: %d\n", labelsacc[indices[itk]]);
}
- PostData(1, fContainer);
}
#include "AliTRDcluster.h"
#include "AliTRDseedV1.h"
#include "AliTRDtrackV1.h"
+#include "AliTRDpidUtil.h"
#include "Cal/AliTRDCalPID.h"
#include "info/AliTRDtrackInfo.h"
#include "AliTRDinfoGen.h"
//
fContainer = Histos();
+ PostData(1, fContainer);
}
//_____________________________________________________________________________
(nall ? 1.E2*Float_t(naccept)/Float_t(nall) : 0.),
ncontam,
(nall ? 1.E2*Float_t(ncontam)/Float_t(nall) : 0.)));
-
- PostData(1, fContainer);
}
ax->SetBinLabel(11, "Kink");
ax->SetBinLabel(12, "KinkMC");
fContainer->AddAt(h, 0);
+ PostData(kMonitor, fContainer);
}
//____________________________________________________________________
PostData(kTracksKink, fTracksKink);
PostData(kEventInfo, fEventInfo);
PostData(kV0List, fV0List);
- PostData(kMonitor, fContainer);
}
//____________________________________________________________________
#include "AliLog.h"
#include "AliESDtrack.h"
#include "AliTrackReference.h"
+#include "AliAnalysisManager.h"
#include "AliTRDReconstructor.h"
#include "AliTRDtrackV1.h"
h2->GetYaxis()->SetTitle("P bins");
h2->GetYaxis()->SetNdivisions(511);
fContainer->AddAt(h2, 0);
+ PostData(1, fContainer);
OpenFile(2);
fData = new TTree("RefPID", "Reference data for PID");
fData->Branch("data", &fPIDdataArray);
+ PostData(2, fData);
}
//________________________________________________________________________
{
// Main loop
// Called for each event
-
- if(!(fTracks = dynamic_cast<TObjArray*>(GetInputData(1)))) return;
- if(!(fV0s = dynamic_cast<TObjArray*>(GetInputData(2)))) return;
- if(!(fInfo = dynamic_cast<TObjArray*>(GetInputData(3)))) return;
+ Int_t ev((Int_t)AliAnalysisManager::GetAnalysisManager()->GetCurrentEntry());
+ if(!(fTracks = dynamic_cast<TObjArray*>(GetInputData(1)))){
+ AliDebug(3, Form("Missing tracks container in ev %d", ev));
+ return;
+ }
+ if(!(fV0s = dynamic_cast<TObjArray*>(GetInputData(2)))){
+ AliDebug(3, Form("Missing v0 container in ev %d", ev));
+ return;
+ }
+ if(!(fInfo = dynamic_cast<TObjArray*>(GetInputData(3)))){
+ AliDebug(3, Form("Missing pid info container in ev %d", ev));
+ return;
+ }
AliDebug(1, Form("Entries: Tracks[%d] V0[%d] PID[%d]", fTracks->GetEntriesFast(), fV0s->GetEntriesFast(), fInfo->GetEntriesFast()));
AliTRDtrackInfo *track = NULL;
Fill();
}
-
- PostData(1, fContainer);
- PostData(2, fData);
}
// Called once
fContainer = Histos();
+ PostData(1, fContainer);
//OpenFile(2, "RECREATE");
fPDF = new TObjArray(AliTRDCalPIDLQ::GetNrefs());
fPDF->SetOwner();fPDF->SetName("PDF_LQ");
+ PostData(3, fPDF);
}
((TH1*)((TObjArray*)fContainer->At(ip))->At(s))->Fill(dedx[0]+dedx[1]);
}
}
-
- PostData(1, fContainer);
- PostData(3, fPDF);
}
return fNRefFigures;
}
+//_______________________________________________________
+void AliTRDrecoTask::UserCreateOutputObjects()
+{
+ if(!HasFunctorList()) InitFunctorList();
+ fContainer = Histos();
+ PostData(1, fContainer);
+}
+
//_______________________________________________________
void AliTRDrecoTask::UserExec(Option_t *)
{
plot->Execute(this);
}
}
- PostData(1, fContainer);
}
//_______________________________________________________
virtual ~AliTRDrecoTask();
- virtual void UserCreateOutputObjects() = 0;
+ virtual void UserCreateOutputObjects();
virtual void UserExec(Option_t *opt);
virtual void SetDebugLevel(Int_t level);
#include "AliPID.h"
#include "AliLog.h"
#include "AliESDtrack.h"
+#include "AliMathBase.h"
#include "AliTRDresolution.h"
#include "AliTRDgeometry.h"
}
if(!fGeo) fGeo = new AliTRDgeometry();
- if(!HasFunctorList()) InitFunctorList();
- fContainer = Histos();
+ AliTRDrecoTask::UserCreateOutputObjects();
+ PostData(kClToTrk, fCl);
+ PostData(kClToMC, fMCcl);
+/* PostData(kTrkltToTrk, fTrklt);
+ PostData(kTrkltToMC, fMCtrklt);*/
InitExchangeContainers();
}
/* fTrklt->Delete();
fMCtrklt->Delete();*/
AliTRDrecoTask::UserExec(opt);
- PostData(kClToTrk, fCl);
- PostData(kClToMC, fMCcl);
-/* PostData(kTrkltToTrk, fTrklt);
- PostData(kTrkltToMC, fMCtrklt);*/
}
//________________________________________________________
return;
}
Float_t xy[4] = {0., 0., 0., 0.};
- Int_t iSumPlot(0);
- TCanvas *cOut = new TCanvas(Form("TRDsummary%s_%d", GetName(), iSumPlot), "Cluster & Tracklet Resolution", 1024, 768);
- TF1 fg("fg", "gaus", -500., 500.);
-
- if(!HasMCdata()) return;
- cOut->Divide(3,2);
-
+ Float_t range[2];
TH2 *h2 = new TH2I("h2SF", "", 20, -.2, .2, fgkNresYsegm[fSegmentLevel], -0.5, fgkNresYsegm[fSegmentLevel]-0.5);
h2->GetXaxis()->CenterTitle();
h2->GetYaxis()->CenterTitle();
- h2->GetZaxis()->CenterTitle();
- TH1 *h1 = new TH1F("h1SF0", "", 120, -200., 1000.);
- TGraphErrors *g(NULL);
- TAxis *ax(h2->GetXaxis());
- Double_t x, y;
- TObjArray *a(NULL);
-
- cOut->cd(1);
- h2->SetTitle(Form("Cluster R-Phi Resolution;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
- a=(TObjArray*) ((TObjArray*)fGraphS->At(kMCcluster))->At(0);
- for(Int_t iseg(0); iseg<fgkNresYsegm[fSegmentLevel]; iseg++){
- g=(TGraphErrors*)a->At(iseg);
- for(Int_t in(0); in<g->GetN(); in++){
- g->GetPoint(in, x, y);
- h2->SetBinContent(ax->FindBin(x), iseg+1, y);
- h1->Fill(y);
- }
- }
- Int_t jBinMin(1), jBinMax(h1->GetNbinsX());
- for(Int_t ibin(h1->GetMaximumBin()); ibin--;){
- if(h1->GetBinContent(ibin)==0){
- jBinMin=ibin; break;
- }
- }
- for(Int_t ibin(h1->GetMaximumBin()); ibin++;){
- if(h1->GetBinContent(ibin)==0){
- jBinMax=ibin; break;
- }
- }
- h2->GetZaxis()->SetRangeUser(h1->GetBinCenter(jBinMin), h1->GetBinCenter(jBinMax));
- h2->Draw("col2z");
+ h2->GetZaxis()->CenterTitle();h2->GetZaxis()->SetTitleOffset(1.4);
+
+ Int_t ih2(0), iSumPlot(0);
+ TCanvas *cOut = new TCanvas(Form("TRDsummary%s_%d", GetName(), iSumPlot++), "Cluster & Tracklet Resolution", 1024, 768);
+ cOut->Divide(3,2, 2.e-3, 2.e-3, kYellow-7);
+ TVirtualPad *p(NULL);
+
+ p=cOut->cd(1);
+ p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+ h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+ h2->SetTitle(Form("Cluster-Track R-Phi Residuals;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
+ MakeSummaryPlot((TObjArray*) ((TObjArray*)fGraphS->At(kCluster))->At(0), h2);
+ GetRange(h2, 1, range);
+ h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+ h2->Draw("colz");
+ h2->SetContour(7);
+
+ p=cOut->cd(2);
+ p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+ h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+ h2->SetTitle(Form("Cluster-Track R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
+ MakeSummaryPlot((TObjArray*) ((TObjArray*)fGraphM->At(kCluster))->At(0), h2);
+ GetRange(h2, 0, range);
+ h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+ h2->Draw("colz");
+ h2->SetContour(7);
+
+ p=cOut->cd(3);
+ p->SetRightMargin(0.06);p->SetTopMargin(0.06);
+ xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
+ GetGraphArray(xy, kCluster, 1, 1);
+
+ p=cOut->cd(4);
+ p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+ h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+ h2->SetTitle(Form("Tracklet-Track R-Phi Residuals;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
+ MakeSummaryPlot((TObjArray*) ((TObjArray*)fGraphS->At(kTrack))->At(0), h2);
+ GetRange(h2, 1, range);
+ h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+ h2->Draw("colz");
+ h2->SetContour(7);
+
+ p=cOut->cd(5);
+ p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+ h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+ h2->SetTitle(Form("Tracklet-Track R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
+ MakeSummaryPlot((TObjArray*) ((TObjArray*)fGraphM->At(kTrack))->At(0), h2);
+ GetRange(h2, 0, range);
+ h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+ h2->Draw("colz");
+ h2->SetContour(7);
+
+ p=cOut->cd(6);
+ p->SetRightMargin(0.06);p->SetTopMargin(0.06);
+ xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
+ GetGraphArray(xy, kTrack, 1, 1);
- cOut->cd(2);
- h2=(TH2I*)h2->Clone("h2SF"); h2->Reset(); h2->SetTitle(Form("Cluster R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
- h1=(TH1F*)h1->Clone("h1SF1"); h1->Reset();
- //h2->GetZaxis()->SetRangeUser(-100., 100.);
- a=(TObjArray*) ((TObjArray*)fGraphM->At(kMCcluster))->At(0);
- for(Int_t iseg(0); iseg<fgkNresYsegm[fSegmentLevel]; iseg++){
- g=(TGraphErrors*)a->At(iseg);
- for(Int_t in(0); in<g->GetN(); in++){
- g->GetPoint(in, x, y);
- h2->SetBinContent(ax->FindBin(x), iseg+1, y);
- h1->Fill(y);
- }
- }
- h1->Fit(&fg, "QN");
- Double_t m(fg.GetParameter(1)), s(fg.GetParameter(2));
- h2->GetZaxis()->SetRangeUser(m-2.5*s, m+2.5*s);
- h2->Draw("col2z");
+ cOut->SaveAs(Form("%s.gif", cOut->GetName()));
- cOut->cd(3);
+ if(!HasMCdata()){
+ delete cOut;
+ return;
+ }
+ cOut->Clear(); cOut->SetName(Form("TRDsummary%s_%d", GetName(), iSumPlot++));
+ cOut->Divide(3, 2, 2.e-3, 2.e-3, kBlue-10);
+
+ p=cOut->cd(1);
+ p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+ h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+ h2->SetTitle(Form("Cluster-MC R-Phi Resolution;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
+ MakeSummaryPlot((TObjArray*) ((TObjArray*)fGraphS->At(kMCcluster))->At(0), h2);
+ GetRange(h2, 1, range);
+ h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+ h2->Draw("colz");
+ h2->SetContour(7);
+
+ p=cOut->cd(2);
+ p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+ h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+ h2->SetContour(7);
+ h2->SetTitle(Form("Cluster-MC R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
+ MakeSummaryPlot((TObjArray*) ((TObjArray*)fGraphM->At(kMCcluster))->At(0), h2);
+ GetRange(h2, 0, range);
+ h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+ h2->Draw("colz");
+ h2->SetContour(7);
+
+ p=cOut->cd(3);
+ p->SetRightMargin(0.06);p->SetTopMargin(0.06);
xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
GetGraphArray(xy, kMCcluster, 1, 1);
- cOut->cd(4);
- h2=(TH2I*)h2->Clone("h2SF"); h2->Reset();
- h2->SetTitle(Form("Tracklet R-Phi Resolution;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
- //h2->GetZaxis()->SetRangeUser(100., 500.);
- h1=(TH1F*)h1->Clone("h1SF2"); h1->Reset();
- a=(TObjArray*) ((TObjArray*)fGraphS->At(kMCtracklet))->At(0);
- for(Int_t iseg(0); iseg<fgkNresYsegm[fSegmentLevel]; iseg++){
- g=(TGraphErrors*)a->At(iseg);
- for(Int_t in(0); in<g->GetN(); in++){
- g->GetPoint(in, x, y);
- h2->SetBinContent(ax->FindBin(x), iseg+1, y);
- h1->Fill(y);
- }
+ p=cOut->cd(4);
+ p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+ h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+ h2->SetContour(7);
+ h2->SetTitle(Form("Tracklet-MC R-Phi Resolution;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
+ MakeSummaryPlot((TObjArray*) ((TObjArray*)fGraphS->At(kMCtracklet))->At(0), h2);
+ GetRange(h2, 1, range);
+ h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+ h2->Draw("colz");
+ h2->SetContour(7);
+
+ p=cOut->cd(5);
+ p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+ h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+ h2->SetContour(7);
+ h2->SetTitle(Form("Tracklet-MC R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
+ MakeSummaryPlot((TObjArray*) ((TObjArray*)fGraphM->At(kMCtracklet))->At(0), h2);
+ GetRange(h2, 0, range);
+ h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+ h2->Draw("colz");
+ h2->SetContour(7);
+
+ p=cOut->cd(6);
+ p->SetRightMargin(0.06);p->SetTopMargin(0.06);
+ xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
+ GetGraphArray(xy, kMCtracklet, 1, 1);
+
+ cOut->SaveAs(Form("%s.gif", cOut->GetName()));
+ delete cOut;
+}
+
+//________________________________________________________
+void AliTRDresolution::GetRange(TH2 *h2, Char_t mod, Float_t *range)
+{
+// Returns the range of the bulk of data in histogram h2. Removes outliers.
+// The "range" vector should be initialized with 2 elements
+// Option "mod" can be any of
+// - 0 : gaussian like distribution
+// - 1 : tailed distribution
+
+ Int_t nx(h2->GetNbinsX())
+ , ny(h2->GetNbinsY())
+ , n(nx*ny);
+ Double_t *data=new Double_t[n];
+ for(Int_t ix(1), in(0); ix<=nx; ix++){
+ for(Int_t iy(1); iy<=ny; iy++)
+ data[in++] = h2->GetBinContent(ix, iy);
+ }
+ Double_t mean, sigm;
+ AliMathBase::EvaluateUni(n, data, mean, sigm, Int_t(n*.8));
+
+ range[0]=mean-3.*sigm; range[1]=mean+3.*sigm;
+ if(mod==1) range[0]=TMath::Max(Float_t(1.e-3), range[0]);
+ AliDebug(2, Form("h[%s] range0[%f %f]", h2->GetName(), range[0], range[1]));
+ TH1S h1("h1SF0", "", 100, range[0], range[1]);
+ h1.FillN(n,data,0);
+ delete [] data;
+
+ switch(mod){
+ case 0:// gaussian distribution
+ {
+ TF1 fg("fg", "gaus", mean-3.*sigm, mean+3.*sigm);
+ h1.Fit(&fg, "QN");
+ mean=fg.GetParameter(1); sigm=fg.GetParameter(2);
+ range[0] = mean-2.5*sigm;range[1] = mean+2.5*sigm;
+ AliDebug(2, Form(" rangeG[%f %f]", range[0], range[1]));
+ break;
}
- jBinMin=1; jBinMax=h1->GetNbinsX();
- for(Int_t ibin(h1->GetMaximumBin()); ibin--;){
- if(h1->GetBinContent(ibin)==0){
- jBinMin=ibin; break;
+ case 1:// tailed distribution
+ {
+ Int_t bmax(h1.GetMaximumBin());
+ Int_t jBinMin(1), jBinMax(100);
+ for(Int_t ibin(bmax); ibin--;){
+ if(h1.GetBinContent(ibin)==0){
+ jBinMin=ibin; break;
+ }
}
- }
- for(Int_t ibin(h1->GetMaximumBin()); ibin++;){
- if(h1->GetBinContent(ibin)==0){
- jBinMax=ibin; break;
+ for(Int_t ibin(bmax); ibin++;){
+ if(h1.GetBinContent(ibin)==0){
+ jBinMax=ibin; break;
+ }
}
+ range[0]=h1.GetBinCenter(jBinMin); range[1]=h1.GetBinCenter(jBinMax);
+ AliDebug(2, Form(" rangeT[%f %f]", range[0], range[1]));
+ break;
}
- h2->GetZaxis()->SetRangeUser(h1->GetBinCenter(jBinMin), h1->GetBinCenter(jBinMax));
- h2->Draw("col2z");
+ }
+
+ return;
+}
- cOut->cd(5);
- h2=(TH2I*)h2->Clone("h2SF"); h2->Reset(); h2->SetTitle(Form("Tracklet R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
- h1=(TH1F*)h1->Clone("h1SF3"); h1->Reset();
- a=(TObjArray*) ((TObjArray*)fGraphM->At(kMCtracklet))->At(0);
+//________________________________________________________
+void AliTRDresolution::MakeSummaryPlot(TObjArray *a, TH2 *h2)
+{
+ h2->Reset();
+ Double_t x,y;
+ TGraphErrors *g(NULL); TAxis *ax(h2->GetXaxis());
for(Int_t iseg(0); iseg<fgkNresYsegm[fSegmentLevel]; iseg++){
g=(TGraphErrors*)a->At(iseg);
for(Int_t in(0); in<g->GetN(); in++){
g->GetPoint(in, x, y);
h2->SetBinContent(ax->FindBin(x), iseg+1, y);
- h1->Fill(y);
}
}
- h1->Fit(&fg, "QN");
- m=fg.GetParameter(1); s=fg.GetParameter(2);
- h2->GetZaxis()->SetRangeUser(m-2.5*s, m+2.5*s);
- h2->Draw("col2z");
-
- cOut->cd(6);
- xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
- GetGraphArray(xy, kMCtracklet, 1, 1);
-
- cOut->SaveAs(Form("%s.gif", cOut->GetName()));
}
+
//________________________________________________________
Char_t const *fgParticle[11]={
" p bar", " K -", " #pi -", " #mu -", " e -",
Int_t abin(ibin*kINTEGRAL+1),bbin(abin+kINTEGRAL-1),mbin(abin+Int_t(kINTEGRAL/2));
Double_t x = h2->GetXaxis()->GetBinCenter(mbin);
TH1D *h = h2->ProjectionY(pn, abin, bbin);
- if((n=(Int_t)h->GetEntries())<100){
+ if((n=(Int_t)h->GetEntries())<150){
AliDebug(4, Form(" x[%f] range[%d %d] stat[%d] low statistics !", x, abin, bbin, n));
continue;
}
TObjArray* BuildMonitorContainerTracklet(const char* name, Bool_t expand=kFALSE);
TObjArray* BuildMonitorContainerTrack(const char* name);
void GetLandauMpvFwhm(TF1 * const f, Float_t &mpv, Float_t &xm, Float_t &xM);
+ void GetRange(TH2 *h2, Char_t mod, Float_t *range);
+ void MakeSummaryPlot(TObjArray *a, TH2 *h2);
Bool_t Process(TH2* const h2, TF1 *f, Float_t k, TGraphErrors **g);
Bool_t Process2D(ETRDresolutionPlot ip, Int_t idx=-1, TF1 *f=NULL, Float_t scale=1., Int_t gidx=-1);
Bool_t Process2Darray(ETRDresolutionPlot ip, Int_t idx=-1, TF1 *f=NULL, Float_t scale=1.);
}
//________________________________________________________________________
-void AliTRDv0Monitor::UserCreateOutputObjects()
+TObjArray* AliTRDv0Monitor::Histos()
{
// Create histograms
// Called once
+ if(fContainer) return fContainer;
-fContainer = new TObjArray(kNPlots);
-fContainer->SetName("V0Monitoring");
-
-
-const char *samplename[AliPID::kSPECIES] = {"electrons","muons","pions","kaons","protons"};
-const char *decayname[AliTRDv0Info::kNDecays] = {"gamma","K0s","Lambda","AntiLambda"};
-const char *detectorname[kNDets] = {"ITS","TPC","TOF"};
-
-fhQualityReductions = new TH1I(Form("fhQualityReductions"),Form("Number of tracks cut out by different quality cut steps"),11,-9,2);
-fContainer->Add(fhQualityReductions);
-
-for(Int_t ipart = 0;ipart < AliPID::kSPECIES; ipart++){
- fhCutReductions[ipart] = new TH1I(Form("fhCutReductions_%s",samplename[ipart]),Form("Number of tracks cut out by different cut steps for %s",samplename[ipart]),19,-17,2);
- fContainer->Add(fhCutReductions[ipart]);
- for(Int_t idetector = 0; idetector < kNDets; idetector++){
- fhDetPID[idetector][ipart] = new TH2F(Form("fhDetector_%s_%s",detectorname[idetector],samplename[ipart]),Form("%s Likelihood for %s vs. momentum",detectorname[idetector], samplename[ipart]),100,0.,10.,100, 0., 1.);
-
- fContainer->Add(fhDetPID[idetector][ipart]);
- }
- fhComPID[ipart] = new TH2F(Form("fhComPID_%s",samplename[ipart]),Form("Combined TPC/TOF PID: Likelihood for %s",samplename[ipart]),100,0.,10.,100,0.,1.);
-
+ fContainer = new TObjArray(kNPlots);
+ fContainer->SetName("V0Monitoring");
+
+ const char *samplename[AliPID::kSPECIES] = {"electrons","muons","pions","kaons","protons"};
+ const char *decayname[AliTRDv0Info::kNDecays] = {"gamma","K0s","Lambda","AntiLambda"};
+ const char *detectorname[kNDets] = {"ITS","TPC","TOF"};
+
+ fhQualityReductions = new TH1I(Form("fhQualityReductions"),Form("Number of tracks cut out by different quality cut steps"),11,-9,2);
+ fContainer->Add(fhQualityReductions);
+
+ for(Int_t ipart = 0;ipart < AliPID::kSPECIES; ipart++){
+ fhCutReductions[ipart] = new TH1I(Form("fhCutReductions_%s",samplename[ipart]),Form("Number of tracks cut out by different cut steps for %s",samplename[ipart]),19,-17,2);
+ fContainer->Add(fhCutReductions[ipart]);
+ for(Int_t idetector = 0; idetector < kNDets; idetector++){
+ fhDetPID[idetector][ipart] = new TH2F(Form("fhDetector_%s_%s",detectorname[idetector],samplename[ipart]),Form("%s Likelihood for %s vs. momentum",detectorname[idetector], samplename[ipart]),100,0.,10.,100, 0., 1.);
+
+ fContainer->Add(fhDetPID[idetector][ipart]);
+ }
+ fhComPID[ipart] = new TH2F(Form("fhComPID_%s",samplename[ipart]),Form("Combined TPC/TOF PID: Likelihood for %s",samplename[ipart]),100,0.,10.,100,0.,1.);
+
fContainer->Add(fhComPID[ipart]);
for(Int_t cutstep = 0; cutstep < kNCutSteps; cutstep++){
fContainer->Add(fhTPCdEdx[ipart][cutstep]);
}
-}
-
-for(Int_t iDecay = 0; iDecay < AliTRDv0Info::kNDecays; iDecay++){
- for(Int_t cutstep =0; cutstep < kNCutSteps; cutstep++){
- fhV0Chi2ndf[iDecay][cutstep] = new TH2F(Form("fhV0Chi2ndf_%s_[%d]",decayname[iDecay],cutstep),Form("Chi2/NDF vs. momentum"),100,0.,10.,500, 0., 500.);
-
- fContainer->Add(fhV0Chi2ndf[iDecay][cutstep]);
-
- fhPsiPair[iDecay][cutstep] = new TH2F(Form("fhV0PsiPair_%s_[%d]",decayname[iDecay],cutstep),Form("Psi_pair vs. momentum"),100,0.,10.,200, 0., 1.6);
-
- fContainer->Add(fhPsiPair[iDecay][cutstep]);
-
- fhPointAngle[iDecay][cutstep] = new TH2F(Form("fhPointAngle_%s_[%d]",decayname[iDecay],cutstep),Form("Pointing Angle vs. momentum"),100,0.,10.,500, 0., 1.6);
- fContainer->Add(fhPointAngle[iDecay][cutstep]);
-
- fhDCA[iDecay][cutstep] = new TH2F(Form("fhDCA_%s_[%d]",decayname[iDecay],cutstep),Form("V0 Daughter DCA vs. momentum"),100,0.,10.,500, 0., 1.);
-
- fContainer->Add(fhDCA[iDecay][cutstep]);
-
- fhOpenAngle[iDecay][cutstep] = new TH2F(Form("fhOpenAngle_%s_[%d]",decayname[iDecay],cutstep),Form("Opening Angle vs. momentum"),100,0.,10.,500, 0., 1.6);
-
- fContainer->Add(fhOpenAngle[iDecay][cutstep]);
-
- fhRadius[iDecay][cutstep] = new TH2F(Form("fhRadius_%s_[%d]",decayname[iDecay],cutstep),Form("V0 Generation Radius vs. momentum"),100,0.,10.,500, 0., 150.);
-
- fContainer->Add(fhRadius[iDecay][cutstep]);
}
-
- fhInvMass[iDecay] = new TH2F(Form("fhInvMass_%s",decayname[iDecay]),Form("Invariant Mass vs. momentum"),100,0.,10.,500, 0., 2.);
-
- fContainer->Add(fhInvMass[iDecay]);
-
-}
+
+ for(Int_t iDecay = 0; iDecay < AliTRDv0Info::kNDecays; iDecay++){
+ for(Int_t cutstep =0; cutstep < kNCutSteps; cutstep++){
+ fhV0Chi2ndf[iDecay][cutstep] = new TH2F(Form("fhV0Chi2ndf_%s_[%d]",decayname[iDecay],cutstep),Form("Chi2/NDF vs. momentum"),100,0.,10.,500, 0., 500.);
+
+ fContainer->Add(fhV0Chi2ndf[iDecay][cutstep]);
+
+ fhPsiPair[iDecay][cutstep] = new TH2F(Form("fhV0PsiPair_%s_[%d]",decayname[iDecay],cutstep),Form("Psi_pair vs. momentum"),100,0.,10.,200, 0., 1.6);
+
+ fContainer->Add(fhPsiPair[iDecay][cutstep]);
+
+ fhPointAngle[iDecay][cutstep] = new TH2F(Form("fhPointAngle_%s_[%d]",decayname[iDecay],cutstep),Form("Pointing Angle vs. momentum"),100,0.,10.,500, 0., 1.6);
+ fContainer->Add(fhPointAngle[iDecay][cutstep]);
+
+ fhDCA[iDecay][cutstep] = new TH2F(Form("fhDCA_%s_[%d]",decayname[iDecay],cutstep),Form("V0 Daughter DCA vs. momentum"),100,0.,10.,500, 0., 1.);
+
+ fContainer->Add(fhDCA[iDecay][cutstep]);
+
+ fhOpenAngle[iDecay][cutstep] = new TH2F(Form("fhOpenAngle_%s_[%d]",decayname[iDecay],cutstep),Form("Opening Angle vs. momentum"),100,0.,10.,500, 0., 1.6);
+
+ fContainer->Add(fhOpenAngle[iDecay][cutstep]);
+
+ fhRadius[iDecay][cutstep] = new TH2F(Form("fhRadius_%s_[%d]",decayname[iDecay],cutstep),Form("V0 Generation Radius vs. momentum"),100,0.,10.,500, 0., 150.);
+
+ fContainer->Add(fhRadius[iDecay][cutstep]);
+ }
+
+ fhInvMass[iDecay] = new TH2F(Form("fhInvMass_%s",decayname[iDecay]),Form("Invariant Mass vs. momentum"),100,0.,10.,500, 0., 2.);
+
+ fContainer->Add(fhInvMass[iDecay]);
+ }
/*TH1F *hV0mcPID[AliPID::kSPECIES][AliPID::kSPECIES];
Int_t nPBins = 200;
fhV0mcPID[iSample][iSpecies] = new TH1F(Form("fhV0mcPID_%s_is_%s",name[iSample],name[iSpecies]),Form("%s contained in %s sample",name[iSpecies],name[iSample]), nPBins, 0.2, 13.);
}
}*/
+
+ return fContainer;
}
+
+
//________________________________________________________________________
void AliTRDv0Monitor::UserExec(Option_t *)
{
fhQualityReductions->Fill(v0->fQuality);//fills integer codes for tracks cut out by track/V0 quality cuts
- if(!(v0->fQuality == 1))continue;
+ if(!(v0->fQuality == 1)) continue;
for(Int_t part = 0; part < AliPID::kSPECIES; part++){
- fhCutReductions[part]->Fill(v0->GetPID(part,track));//fill in numbers of tracks eliminated by different PID cuts
+ fhCutReductions[part]->Fill(v0->GetPID(part,track));//fill in numbers of tracks eliminated by different PID cuts
}
for(Int_t idecay(0), part(-1); idecay < AliTRDv0Info::kNDecays; idecay++){//loop over decay types considered for reference data
-
- if(idecay == AliTRDv0Info::kLambda){ //protons and pions from Lambda
- part = AliPID::kProton;
- } else if(idecay == AliTRDv0Info::kAntiLambda) { //antiprotons and pions from Anti-Lambda
- part = AliPID::kProton;
- } else if(idecay == AliTRDv0Info::kK0s) {//pions from K0s
- part = AliPID::kPion;
- } else if(idecay == AliTRDv0Info::kGamma) {//electrons from conversions
- part = AliPID::kElectron;
- }
-
- //fill histograms with track/V0 quality cuts only
- fhPsiPair[idecay][0]->Fill(v0->fV0Momentum,v0->fPsiPair);//Angle between daughter momentum plane and plane perpendicular to magnetic field
- fhInvMass[idecay]->Fill(v0->fV0Momentum,v0->fInvMass[idecay]);//Invariant mass
- fhPointAngle[idecay][0]->Fill(v0->fV0Momentum,v0->fPointingAngle);// = TMath::ACos(esdv0->GetV0CosineOfPointingAngle()); // Cosine of pointing angle
- fhOpenAngle[idecay][0]->Fill(v0->fV0Momentum,v0->fOpenAngle);// opening angle between daughters
- fhDCA[idecay][0]->Fill(v0->fV0Momentum,v0->fDCA);// Distance of closest approach of daughter tracks
- fhV0Chi2ndf[idecay][0]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);//Kalman Filter Chi2/NDF
- fhRadius[idecay][0]->Fill(v0->fV0Momentum,v0->fRadius);//distance of decay/conversion from primary vertex in x-y plane
-
- if(v0->HasTrack(track) == -1){
- fhTPCdEdx[part][0]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);//TPC dE/dx for negative track
- } else if(v0->HasTrack(track) == 1){
- fhTPCdEdx[part][0]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);//TPC dE/dx for positive track
- }
-
- //fill histograms after invariant mass cuts
- if((v0->fInvMass[idecay] < v0->fUpInvMass[idecay][0])&&(v0->fInvMass[idecay]> v0->fDownInvMass[idecay])){
- fhV0Chi2ndf[idecay][1]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);
- fhPsiPair[idecay][1]->Fill(v0->fV0Momentum,v0->fPsiPair);
- fhPointAngle[idecay][1]->Fill(v0->fV0Momentum,v0->fPointingAngle);
- fhOpenAngle[idecay][1]->Fill(v0->fV0Momentum,v0->fOpenAngle);
- fhDCA[idecay][1]->Fill(v0->fV0Momentum,v0->fDCA);
- fhRadius[idecay][1]->Fill(v0->fV0Momentum,v0->fRadius);
- if(v0->HasTrack(track) == -1)
- fhTPCdEdx[part][1]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);
- else if(v0->HasTrack(track) == 1)
- fhTPCdEdx[part][1]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);
-
- }
-
- //fill histograms after all reference selection cuts
- if(v0->GetPID(part,track)==1){
- fhV0Chi2ndf[idecay][2]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);
- fhPsiPair[idecay][2]->Fill(v0->fV0Momentum,v0->fPsiPair);
- fhPointAngle[idecay][2]->Fill(v0->fV0Momentum,v0->fPointingAngle);
- fhOpenAngle[idecay][2]->Fill(v0->fV0Momentum,v0->fOpenAngle);
- fhDCA[idecay][2]->Fill(v0->fV0Momentum,v0->fDCA);
- fhRadius[idecay][2]->Fill(v0->fV0Momentum,v0->fRadius);
- if(v0->HasTrack(track) == -1)
- fhTPCdEdx[part][2]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);
- else if(v0->HasTrack(track) == 1)
- fhTPCdEdx[part][2]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);
-
- }
+ if(idecay == AliTRDv0Info::kLambda){ //protons and pions from Lambda
+ part = AliPID::kProton;
+ } else if(idecay == AliTRDv0Info::kAntiLambda) { //antiprotons and pions from Anti-Lambda
+ part = AliPID::kProton;
+ } else if(idecay == AliTRDv0Info::kK0s) {//pions from K0s
+ part = AliPID::kPion;
+ } else if(idecay == AliTRDv0Info::kGamma) {//electrons from conversions
+ part = AliPID::kElectron;
+ }
+
+ //fill histograms with track/V0 quality cuts only
+ fhPsiPair[idecay][0]->Fill(v0->fV0Momentum,v0->fPsiPair);//Angle between daughter momentum plane and plane perpendicular to magnetic field
+ fhInvMass[idecay]->Fill(v0->fV0Momentum,v0->fInvMass[idecay]);//Invariant mass
+ fhPointAngle[idecay][0]->Fill(v0->fV0Momentum,v0->fPointingAngle);// = TMath::ACos(esdv0->GetV0CosineOfPointingAngle()); // Cosine of pointing angle
+ fhOpenAngle[idecay][0]->Fill(v0->fV0Momentum,v0->fOpenAngle);// opening angle between daughters
+ fhDCA[idecay][0]->Fill(v0->fV0Momentum,v0->fDCA);// Distance of closest approach of daughter tracks
+ fhV0Chi2ndf[idecay][0]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);//Kalman Filter Chi2/NDF
+ fhRadius[idecay][0]->Fill(v0->fV0Momentum,v0->fRadius);//distance of decay/conversion from primary vertex in x-y plane
+
+ if(v0->HasTrack(track) == -1){
+ fhTPCdEdx[part][0]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);//TPC dE/dx for negative track
+ } else if(v0->HasTrack(track) == 1){
+ fhTPCdEdx[part][0]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);//TPC dE/dx for positive track
+ }
+
+ //fill histograms after invariant mass cuts
+ if((v0->fInvMass[idecay] < v0->fUpInvMass[idecay][0])&&(v0->fInvMass[idecay]> v0->fDownInvMass[idecay])){
+ fhV0Chi2ndf[idecay][1]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);
+ fhPsiPair[idecay][1]->Fill(v0->fV0Momentum,v0->fPsiPair);
+ fhPointAngle[idecay][1]->Fill(v0->fV0Momentum,v0->fPointingAngle);
+ fhOpenAngle[idecay][1]->Fill(v0->fV0Momentum,v0->fOpenAngle);
+ fhDCA[idecay][1]->Fill(v0->fV0Momentum,v0->fDCA);
+ fhRadius[idecay][1]->Fill(v0->fV0Momentum,v0->fRadius);
+ if(v0->HasTrack(track) == -1)
+ fhTPCdEdx[part][1]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);
+ else if(v0->HasTrack(track) == 1)
+ fhTPCdEdx[part][1]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);
+
+ }
+
+ //fill histograms after all reference selection cuts
+ if(v0->GetPID(part,track)==1){
+ fhV0Chi2ndf[idecay][2]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);
+ fhPsiPair[idecay][2]->Fill(v0->fV0Momentum,v0->fPsiPair);
+ fhPointAngle[idecay][2]->Fill(v0->fV0Momentum,v0->fPointingAngle);
+ fhOpenAngle[idecay][2]->Fill(v0->fV0Momentum,v0->fOpenAngle);
+ fhDCA[idecay][2]->Fill(v0->fV0Momentum,v0->fDCA);
+ fhRadius[idecay][2]->Fill(v0->fV0Momentum,v0->fRadius);
+ if(v0->HasTrack(track) == -1)
+ fhTPCdEdx[part][2]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);
+ else if(v0->HasTrack(track) == 1)
+ fhTPCdEdx[part][2]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);
+ }
}
}
}
- PostData(1, fContainer);
}
AliTRDv0Monitor(const char *name, const char *title);
virtual ~AliTRDv0Monitor(){};
- Bool_t GetRefFigure(Int_t ifig);
- void UserCreateOutputObjects();
- void UserExec(Option_t *option);
- void MakeSummary();
+ Bool_t GetRefFigure(Int_t ifig);
+ TObjArray* Histos();
+ void UserExec(Option_t *option);
+ void MakeSummary();
private:
AliTRDv0Monitor(const AliTRDv0Monitor&); // not implemented