//
// For stand alone usage please refer to the following example:
// {
-// gSystem->Load("libANALYSIS.so");
-// gSystem->Load("libTRDqaRec.so");
+// gSystem->Load("libANALYSIS");
+// gSystem->Load("libTRDqaRec");
// AliTRDresolution *res = new AliTRDresolution();
// //res->SetMCdata();
// //res->SetVerbose();
// //
////////////////////////////////////////////////////////////////////////////
+#include <TFile.h>
#include <TSystem.h>
#include <TStyle.h>
#include <TROOT.h>
#include "AliPID.h"
#include "AliLog.h"
#include "AliESDtrack.h"
+#include "AliESDHeader.h"
#include "AliMathBase.h"
#include "AliTrackPointArray.h"
#include "info/AliTRDeventInfo.h"
ClassImp(AliTRDresolution)
-ClassImp(AliTRDresolution::AliTRDresolutionProjection)
+ClassImp(AliTRDresolution::AliTRDrecoProjection)
Int_t const AliTRDresolution::fgkNbins[kNdim] = {
Int_t(kNbunchCross)/*bc*/,
- 180/*phi*/,
- 50/*eta*/,
+ 144/*phi*/,
+ 45/*eta*/,
50/*dy*/,
40/*dphi*/,
50/*dz*/,
- 3/*chg*species*/,
- kNpt/*pt*/
+ 5/*chg*species*/,
+ 3/*pt*/
}; //! no of bins/projection
Double_t const AliTRDresolution::fgkMin[kNdim] = {
- -1.5,
- -TMath::Pi(),
- -1.,
- -1.5,
- -10.,
- -2.5,
- -1.5,
- -0.5
+ -1.5, /*bc*/
+ -TMath::Pi(),/*phi*/
+ -0.9, /*eta*/
+ -1.5, /*dy*/
+ -5., /*dphi*/
+ -2.5, /*dz*/
+ -2.5, /*chg*species*/
+ -0.5 /*pt*/
}; //! low limits for projections
Double_t const AliTRDresolution::fgkMax[kNdim] = {
- 1.5,
- TMath::Pi(),
- 1.,
- 1.5,
- 10.,
- 2.5,
- 1.5,
- kNpt-0.5
+ 1.5, /*bc*/
+ TMath::Pi(),/*phi*/
+ 0.9, /*eta*/
+ 1.5, /*dy*/
+ 5., /*dphi*/
+ 2.5, /*dz*/
+ 2.5, /*chg*species*/
+ 2.5 /*pt*/
}; //! high limits for projections
Char_t const *AliTRDresolution::fgkTitle[kNdim] = {
"bunch cross",
"#Delta#phi [deg]",
"#Deltaz [cm]",
"chg*spec*rc",
- "bin_p_{t}"
+ "p_{t} [bin]"
}; //! title of projection
Char_t const * AliTRDresolution::fgPerformanceName[kNclasses] = {
// ,"Tracklet2TRDout"
// ,"TRDout2MC"
};
-Float_t AliTRDresolution::fgPtBin[25];
//________________________________________________________
AliTRDresolution::AliTRDresolution()
:AliTRDrecoTask()
,fSteer(0)
- ,fIdxFrame(0)
,fPtThreshold(.3)
- ,fDyRange(0.75)
,fBCbinTOF(0)
,fBCbinFill(0)
+ ,fLYselect(-1)
,fBsign(kFALSE)
,fProj(NULL)
,fDBPDG(NULL)
// Default constructor
//
SetNameTitle("TRDresolution", "TRD spatial and momentum resolution");
- MakePtSegmentation();
SetProcesses(kTRUE, kTRUE, kTRUE, kTRUE);
}
AliTRDresolution::AliTRDresolution(char* name, Bool_t xchange)
:AliTRDrecoTask(name, "TRD spatial and momentum resolution")
,fSteer(0)
- ,fIdxFrame(0)
,fPtThreshold(.3)
- ,fDyRange(0.75)
,fBCbinTOF(0)
,fBCbinFill(0)
+ ,fLYselect(-1)
,fBsign(kFALSE)
,fProj(NULL)
,fDBPDG(NULL)
//
InitFunctorList();
- MakePtSegmentation();
SetProcesses(kTRUE, kTRUE, kTRUE, kTRUE);
if(xchange){
SetUseExchangeContainers();
// Destructor
//
if (AliAnalysisManager::GetAnalysisManager() && AliAnalysisManager::GetAnalysisManager()->IsProofMode()) return;
- if(fProj){fProj->Delete(); delete fProj;}
+ if(fProj){
+ fProj->Delete();
+ delete fProj;
+ }
if(fCl){fCl->Delete(); delete fCl;}
if(fMCcl){fMCcl->Delete(); delete fMCcl;}
}
cs(TMath::Cos(alpha)),
sn(TMath::Sin(alpha));
for(Int_t icl(0); icl<ncl; icl++){
- if(!(cl = (AliTRDcluster*)(*fkClusters)[icl])) continue;
+ if(!(cl = (AliTRDcluster*)(*fkClusters)[icl])){
+ AliDebug(2, Form("Missing clusters @ %d", icl));
+ continue;
+ }
+ if(cl->IsMasked()) printf("Mask %03d[%02d_%d_%d] %d[%d]", det, AliTRDgeometry::GetSector(det), stk, ly, cl->GetPadMaskedPosition(), cl->GetPadMaskedStatus());
val[kBC] = ly;
val[kPhi] = TMath::ATan2(cl->GetX()*sn + cl->GetY()*cs, cl->GetX()*cs - cl->GetY()*sn);
val[kEta] = (5-stk)*16-cl->GetPadRow()-1-(stk<3?4:0);
val[kYrez]= fEvent->GetMultiplicity();
val[4] = TMath::Abs(cl->GetQ());
- val[5] = cl->IsFivePad()?1:cl->GetNPads();
+ val[5] = fTriggerList?fTriggerSlot:(cl->IsFivePad()?1:cl->GetNPads());
H->Fill(val);
}
return NULL;
if((cc = fTracklet->GetClusters(tb-2))) {val[kZrez] += TMath::Abs(cc->GetQ()); ic++;}
if(ic) val[kZrez] /= (ic*q);
val[kSpeciesChgRC]= fTracklet->IsRowCross()?0.:(TMath::Max(q*corr, Float_t(3.)));
- val[kNdim] = fEvent->GetMultiplicity();
- val[kNdim+1] = c->IsFivePad()?1:c->GetNPads();
+ val[kNdim] = fEvent?fEvent->GetMultiplicity():0.;
+ val[kNdim+1] = fTriggerList?fTriggerSlot:(c->IsFivePad()?1:c->GetNPads());
H->Fill(val);
/* // tilt rotation of covariance for clusters
Double_t sy2(c->GetSigmaY2()), sz2(c->GetSigmaZ2());
return H->Projection(kYrez);
}
-
//________________________________________________________
TH1* AliTRDresolution::PlotTracklet(const AliTRDtrackV1 *track)
{
return NULL;
}
+ // down scale PID resolution
+ Int_t spc(fSpecies); if(spc==3) spc=2; if(spc==-3) spc=-2; if(spc>3) spc=3; if(spc<-3) spc=-3;
const Int_t ndim(kNdim+8);
Double_t val[ndim],
alpha(0.), cs(-2.), sn(0.);
- Float_t sz[AliTRDseedV1::kNtb], pos[AliTRDseedV1::kNtb];
- Int_t ntbGap[AliTRDseedV1::kNtb];
+// Float_t sz[AliTRDseedV1::kNtb], pos[AliTRDseedV1::kNtb]; Int_t ntbGap[AliTRDseedV1::kNtb];
AliTRDseedV1 *fTracklet(NULL);
for(Int_t il(0); il<AliTRDgeometry::kNlayer; il++){
if(!(fTracklet = fkTrack->GetTracklet(il))) continue;
Float_t tgl = fTracklet->GetZ()/fTracklet->GetX()/TMath::Sqrt(1.+fTracklet->GetY()*fTracklet->GetY()/fTracklet->GetX()/fTracklet->GetX());//fTracklet->GetTgl();
val[kEta] = -TMath::Log(TMath::Tan(0.5 * (0.5*TMath::Pi() - TMath::ATan(tgl))));
- val[kSpeciesChgRC]= fTracklet->IsRowCross()?0:fkTrack->Charge();// fSpecies;
- val[kPt] = fPt<0.8?0:(fPt<1.5?1:2);//GetPtBin(fTracklet->GetMomentum());
+ val[kSpeciesChgRC]= fTracklet->IsRowCross()?0:spc;// fSpecies;
+ val[kPt] = GetPtBin(fPt); //fPt<0.8?0:(fPt<1.5?1:2);//GetPtBin(fTracklet->GetMomentum());
Double_t dyt(fTracklet->GetYfit(0) - fTracklet->GetYref(0)),
dzt(fTracklet->GetZfit(0) - fTracklet->GetZref(0)),
dydx(fTracklet->GetYfit(1)),
dydx+= tilt*fTracklet->GetZref(1);
val[kPrez] = TMath::ATan((dydx - fTracklet->GetYref(1))/(1.+ fTracklet->GetYref(1)*dydx)) * TMath::RadToDeg();
val[kNdim] = fEvent?fEvent->GetMultiplicity():0;
- val[kNdim+1] = 1.e2*fTracklet->GetTBoccupancy()/AliTRDseedV1::kNtb;
- Int_t n = fTracklet->GetChargeGaps(sz, pos, ntbGap);
+ val[kNdim+1] = fTriggerList?fTriggerSlot:(1.e2*fTracklet->GetTBoccupancy()/AliTRDseedV1::kNtb);
+/* Int_t n = fTracklet->GetChargeGaps(sz, pos, ntbGap);
val[kNdim+2] = 0.; for(Int_t igap(0); igap<n; igap++) val[kNdim+2] += sz[igap];
for(Int_t ifill(0); ifill<3; ifill++){ val[kNdim+3+ifill]=0.;val[kNdim+4+ifill]=0.;}
for(Int_t igap(0), ifill(0); igap<n&&ifill<2; igap++){
val[kNdim+3+ifill] = sz[igap];
val[kNdim+4+ifill] = pos[igap];
ifill++;
- }
+ }*/
H->Fill(val);
// // compute covariance matrix
//
// Additionally the momentum resolution/pulls are calculated for usage in the
// PID calculation.
- //printf("AliTRDresolution::PlotTrackIn() :: track[%p]\n", (void*)track);
-
+
if(track) fkTrack = track;
if(!fkTrack){
AliDebug(4, "No Track defined.");
if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h;
return H->Projection(kYrez);
}
-// printf("USE y[%+f] dydx[%+f]\n", fTracklet->GetYfit(0), fTracklet->GetYfit(1));
- Int_t bc(fkESD?fkESD->GetTOFbc()/2:0);
+ // down scale PID resolution
+ Int_t spc(fSpecies); if(spc==3) spc=2; if(spc==-3) spc=-2; if(spc>3) spc=3; if(spc<-3) spc=-3;
+ // read V0 PID if available
+ Int_t v0pid(-2);
+ if(fkESD->IsElectron()) v0pid = -1;
+ else if(fkESD->IsPion()) v0pid = 0;
+ else if(fkESD->IsProton()) v0pid = 1;
+ if(DebugLevel()>=1/* && v0pid>-2*/){
+ Float_t tpc(fkESD->GetTPCdedx());
+ Float_t tof(fkESD->GetTOFbeta());
+ Int_t ev(fEvent->GetEventHeader()->GetEventNumberInFile());
+ AliTRDtrackV1 t(*fkTrack); t.SetOwner();
+ (*DebugStream()) << "trackIn"
+ <<"ev=" << ev
+ <<"pid=" << v0pid
+ <<"tpc=" << tpc
+ <<"tof=" << tof
+ <<"track.=" << &t
+ <<"trackIn.=" << tin
+ << "\n";
+ }
+
+ //Int_t bc(fkESD?fkESD->GetTOFbc()/2:0);
const Double_t *parR(tin->GetParameter());
Double_t dyt(fTracklet->GetYfit(0)-parR[0]), dzt(fTracklet->GetZfit(0)-parR[1]),
phit(fTracklet->GetYfit(1)),
phit += tilt*parR[3];
Double_t dphi = TMath::ATan(phit) - TMath::ASin(parR[2]);
- Double_t val[kNdim+3];
- val[kBC] = bc==0?0:(bc<0?-1.:1.);
+ Double_t val[kNdim+2];
+ val[kBC] = fTriggerSlot?fTriggerSlot:v0pid;//bc==0?0:(bc<0?-1.:1.);
Double_t alpha = (0.5+AliTRDgeometry::GetSector(fTracklet->GetDetector()))*AliTRDgeometry::GetAlpha(),
cs = TMath::Cos(alpha),
sn = TMath::Sin(alpha);
- val[kPhi] = TMath::ATan2(fTracklet->GetX()*sn + fTracklet->GetY()*cs, fTracklet->GetX()*cs - fTracklet->GetY()*sn);
- Float_t tgl = fTracklet->GetZ()/fTracklet->GetX()/TMath::Sqrt(1.+fTracklet->GetY()*fTracklet->GetY()/fTracklet->GetX()/fTracklet->GetX());
- val[kEta] = -TMath::Log(TMath::Tan(0.5 * (0.5*TMath::Pi() - TMath::ATan(tgl))));
+ val[kPhi] = TMath::ATan2(fTracklet->GetX()*sn + fTracklet->GetY()*cs, fTracklet->GetX()*cs - fTracklet->GetY()*sn);
+ Float_t tgl = fTracklet->GetZ()/fTracklet->GetX()/TMath::Sqrt(1.+fTracklet->GetY()*fTracklet->GetY()/fTracklet->GetX()/fTracklet->GetX());
+ val[kEta] = -TMath::Log(TMath::Tan(0.5 * (0.5*TMath::Pi() - TMath::ATan(tgl))));
val[kYrez] = dy;
val[kZrez] = fTracklet->IsRowCross()?dz:(fTracklet->GetdQdl()*5.e-4 - 2.5);
val[kPrez] = dphi*TMath::RadToDeg();
- val[kSpeciesChgRC]= fTracklet->IsRowCross()?0:fSpecies; //printf("val[%d] = %4.2f\n", kSpeciesChgRC, val[kSpeciesChgRC]);
- val[kPt] = fPt<0.8?0:(fPt<1.5?1:2);//GetPtBin(fPt);
+ val[kSpeciesChgRC]= fTracklet->IsRowCross()?0:spc;
+ Float_t pz(0.); if(fTracklet->GetMomentum()-fPt>1.e-5) pz = TMath::Sqrt((fTracklet->GetMomentum()-fPt)*(fTracklet->GetMomentum()+fPt));
+ val[kPt] = fTracklet->IsRowCross()?GetPtBin(pz):GetPtBin(fPt);
val[kNdim] = GetPtBin(fTracklet->GetMomentum());
val[kNdim+1] = dx;
- val[kNdim+2] = fEvent?fEvent->GetBunchFill():0;
+ //val[kNdim+2] = fEvent?fEvent->GetBunchFill():0;
H->Fill(val);
- if(DebugLevel()>=3){
- (*DebugStream()) << "trackIn"
- <<"tracklet.=" << fTracklet
- <<"trackIn.=" << tin
- << "\n";
- }
if(!track) return NULL;
// special care for EVE usage
- if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h;
- return H->Projection(kYrez);
+ if((h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h;
+ return H->Projection(kYrez);
}
/*
AliDebug(4, "No Track defined.");
return NULL;
}
- Int_t bc(TMath::Abs(fkESD->GetTOFbc()));
+// Int_t bc(TMath::Abs(fkESD->GetTOFbc()));
THnSparse *H(NULL);
if(!fContainer){
if(!fDBPDG) fDBPDG=TDatabasePDG::Instance();
TParticlePDG *ppdg(fDBPDG->GetParticle(pdg));
if(ppdg) sign = ppdg->Charge() > 0. ? 1 : -1;
+ if(sIdx==3) sIdx=2; if(sIdx>3) sIdx=3; // downscale PID
TH1 *h(NULL);
AliTRDgeometry *geo(AliTRDinfoGen::Geometry());
AliTRDseedV1 *fTracklet(NULL); TObjArray *clInfoArr(NULL);
UChar_t s;
- Double_t x, y, z, pt, dydx, dzdx, dzdl;
- Float_t pt0, x0, y0, z0, dx, dy, dz, dydx0, dzdx0;
+ Double_t x, y, z, pt, dydx, dzdx/*, dzdl*/;
+ Float_t pt0, p0, x0, y0, z0, dx, dy, dz, dydx0, dzdx0;
Double_t covR[7]/*, cov[3]*/;
/* if(DebugLevel()>=3){
}
}*/
AliTRDcluster *c(NULL);
- Double_t val[kNdim+1];
+ Double_t val[kNdim+2];
for(Int_t ily=0; ily<AliTRDgeometry::kNlayer; ily++){
if(!(fTracklet = fkTrack->GetTracklet(ily)))/* ||
!fTracklet->IsOK())*/ continue;
x= x0 = fTracklet->GetX();
Bool_t rc(fTracklet->IsRowCross()); Float_t eta, phi;
- if(!fkMC->GetDirections(x0, y0, z0, dydx0, dzdx0, pt0, eta, phi, s)) continue;
+ if(!fkMC->GetDirections(x0, y0, z0, dydx0, dzdx0, pt0, p0, eta, phi, s)) continue;
// MC track position at reference radial position
dx = x0 - x;
val[kPhi] = phi;
val[kEta] = eta;
val[kSpeciesChgRC]= rc?0.:sign*sIdx;
- val[kPt] = pt0<0.8?0:(pt0<1.5?1:2);//GetPtBin(pt0);
+ val[kPt] = GetPtBin(pt0);
+ val[kNdim]= GetPtBin(p0);
Double_t tilt(fTracklet->GetTilt());
// ,t2(tilt*tilt)
// ,corr(1./(1. + t2))
// check radial position
if(TMath::Abs(tin->GetX()-x)>1.e-3) AliDebug(1, Form("TrackIn radial mismatch. dx[cm]=%+4.1f", tin->GetX()-x));
else{
- val[kBC] = (bc>=kNbunchCross)?(kNbunchCross-1):bc;
+ Int_t exactPID = -2;
+ switch(TMath::Abs(pdg)){
+ case 11: exactPID = -1;break;
+ case 211: exactPID = 0;break;
+ case 2212: exactPID = 1;break;
+ }
+ val[kBC] = exactPID;
val[kYrez] = tin->GetY()-ymc;
- val[kZrez] = tin->GetZ()-zmc;
+ val[kZrez] = rc?(tin->GetZ()-zmc):(fTracklet->GetdQdl()*5e-4 - 2.5);
val[kPrez] = (TMath::ASin(tin->GetSnp())-TMath::ATan(dydx0))*TMath::RadToDeg();
+ val[kNdim+1] = 0.;//dx;
if((H = (THnSparseI*)fContainer->At(kMCtrackIn))) H->Fill(val);
+ val[kBC] = ily; // reset for subsequent components
+
+ if(DebugLevel()>=1 && exactPID>-2){
+ Float_t tpc(fkESD->GetTPCdedx());
+ Float_t tof(fkESD->GetTOFbeta());
+ AliTRDtrackV1 t(*fkTrack); t.SetOwner();
+ (*DebugStream()) << "MCtrackIn"
+ <<"pid=" << exactPID
+ <<"tpc=" << tpc
+ <<"tof=" << tof
+ <<"track.=" << &t
+ <<"trackIn.=" << tin
+ << "\n";
+ }
}
}
//if(bc>1) break; // do nothing for the rest of TRD objects if satellite bunch
// track residuals
dydx = fTracklet->GetYref(1);
dzdx = fTracklet->GetZref(1);
- dzdl = fTracklet->GetTgl();
+ //dzdl = fTracklet->GetTgl();
y = fTracklet->GetYref(0);
dy = y - ymc;
z = fTracklet->GetZref(0);
dz = z - zmc;
val[kYrez] = dy - dz*tilt;
val[kPrez] = TMath::ATan((dydx - dydx0)/(1.+ dydx*dydx0))*TMath::RadToDeg();
- val[kZrez] = dz + dy*tilt;
+ val[kZrez] = rc?(dz + dy*tilt):(fTracklet->GetdQdl()*3.e-4 - 1.5);
+ val[kNdim] = fEvent?fEvent->GetMultiplicity():0;
+ val[kNdim+1] = 1.e2*fTracklet->GetTBoccupancy()/AliTRDseedV1::kNtb;
// val[kNdim] = pt/pt0-1.;
if((H = (THnSparse*)fContainer->At(kMCtracklet))) H->Fill(val);
val[kPt] = TMath::ATan(dydx0)*TMath::RadToDeg();
//Float_t corr = 1./TMath::Sqrt(1.+dydx0*dydx0+dzdx0*dzdx0);
Int_t row0(-1);
- Float_t padCorr(tilt*fTracklet->GetPadLength());
+ Float_t padCorr(tilt*fTracklet->GetPadLength()),
+ corr(1./TMath::Sqrt(1.+dydx0*dydx0+dzdx0*dzdx0));
fTracklet->ResetClusterIter(kTRUE);
while((c = fTracklet->NextCluster())){
if(row0<0) row0 = c->GetPadRow();
if((cc = fTracklet->GetClusters(tb-1))) {val[kZrez] += TMath::Abs(cc->GetQ()); ic++;}
if((cc = fTracklet->GetClusters(tb-2))) {val[kZrez] += TMath::Abs(cc->GetQ()); ic++;}
if(ic) val[kZrez] /= (ic*q);
+ val[kSpeciesChgRC]= rc?0.:(TMath::Max(q*corr, Float_t(3.)));
+ val[kNdim+1] = c->IsFivePad()?1:c->GetNPads();
if(H) H->Fill(val);
}
}
if(clInfoArr) delete clInfoArr;
- return h;
-}
-
-
-//__________________________________________________________________________
-Int_t AliTRDresolution::GetPtBin(Float_t pt)
-{
-// Find pt bin according to local pt segmentation
- Int_t ipt(-1);
- while(ipt<24){
- if(pt<fgPtBin[ipt+1]) break;
- ipt++;
- }
- return ipt;
-}
-
-//________________________________________________________
-Float_t AliTRDresolution::GetMeanStat(TH1 *h, Float_t cut, Option_t *opt)
-{
-// return mean number of entries/bin of histogram "h"
-// if option "opt" is given the following values are accepted:
-// "<" : consider only entries less than "cut"
-// ">" : consider only entries greater than "cut"
-
- //Int_t dim(h->GetDimension());
- Int_t nbx(h->GetNbinsX()), nby(h->GetNbinsY()), nbz(h->GetNbinsZ());
- Double_t sum(0.); Int_t n(0);
- for(Int_t ix(1); ix<=nbx; ix++)
- for(Int_t iy(1); iy<=nby; iy++)
- for(Int_t iz(1); iz<=nbz; iz++){
- if(strcmp(opt, "")==0){sum += h->GetBinContent(ix, iy, iz); n++;}
- else{
- if(strcmp(opt, "<")==0) {
- if(h->GetBinContent(ix, iy, iz)<cut) {sum += h->GetBinContent(ix, iy, iz); n++;}
- } else if(strcmp(opt, ">")==0){
- if(h->GetBinContent(ix, iy, iz)>cut) {sum += h->GetBinContent(ix, iy, iz); n++;}
- } else {sum += h->GetBinContent(ix, iy, iz); n++;}
- }
- }
- return n>0?sum/n:0.;
+ if(!track) return NULL;
+ // special care for EVE usage
+ if(H && (h = (TH1*)gDirectory->Get(Form("%s_proj_%d", H->GetName(), kYrez)))) delete h;
+ return H?H->Projection(kYrez):NULL;
}
//________________________________________________________
return kFALSE;
}
-
-//________________________________________________________
-void AliTRDresolution::MakePtSegmentation(Float_t pt0, Float_t dpt)
-{
-// Build pt segments
- for(Int_t j(0); j<=24; j++){
- pt0+=(TMath::Exp(j*j*dpt)-1.);
- fgPtBin[j]=pt0;
- }
-}
-
//________________________________________________________
void AliTRDresolution::MakeSummary()
{
}
TVirtualPad *p(NULL); TCanvas *cOut(NULL);
TObjArray *arr(NULL); TH2 *h2(NULL);
+ TH2 *h2e[100] = {NULL}; Int_t ih2e(0); // save sigma histos for later deletion
// cluster resolution
// define palette
const Char_t *typName[] = {"", "MC"};
const Int_t nx(2048), ny(1536);
- if((arr = (TObjArray*)fProj->At(kDetector))){
+ if((arr = (TObjArray*)fProj->FindObject("hDet2Cluster"))){
cOut = new TCanvas(Form("%s_DetOccupancy", GetName()), "Detector performance", 2*nx, 2*ny);
cOut->Divide(AliTRDgeometry::kNlayer,AliTRDeventInfo::kCentralityClasses, 1.e-5, 1.e-5);
+ Int_t n=0;
for(Int_t icen(0); icen<AliTRDeventInfo::kCentralityClasses; icen++){
for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
p=cOut->cd(icen*AliTRDgeometry::kNlayer+ily+1); p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712);
if(!(h2 = (TH2*)arr->FindObject(Form("HDet%d%dEn", ily, icen)))) continue;
- SetNormZ(h2, 1, 11, 1, -1, 10.);
- SetRangeZ(h2, 0., 150, -25.);
+ if(SetNormZ(h2, 1, -1, 1, -1, 10.) < 1.e3) continue; // cut all bins with < 10 entries
+ SetRangeZ(h2, -90., 90, -200.);
+ //h2->GetXaxis()->SetNdivisions(1010);
h2->GetZaxis()->SetTitle("Rel. Det. Occup. [%]");
h2->GetZaxis()->CenterTitle();
- h2->Draw("colz");
- MakeDetectorPlot(ily, "pad");
+ h2->SetContour(9); h2->Draw("colz"); n++;
+ MakeDetectorPlot(ily, "p");
}
}
- cOut->SaveAs(Form("%s.gif", cOut->GetName()));
+ if(n>=AliTRDgeometry::kNlayer) cOut->SaveAs(Form("%s.gif", cOut->GetName()));
+
cOut = new TCanvas(Form("%s_DetCharge", GetName()), "Detector performance", nx, ny);
cOut->Divide(3,2, 1.e-5, 1.e-5);
for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
p=cOut->cd(ily+1); p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712);
- if(!(h2 = (TH2*)arr->FindObject(Form("HDet%d_2D", ily)))) continue;
- SetNormZ(h2, 1, 11, 1, -1, 10.);
- SetRangeZ(h2, 0., 45., -15.);
+ if(!(h2 = (TH2*)arr->FindObject(Form("HDet%d_2D", UseLYselectTrklt()?fLYselect:ily)))) continue;
+ SetNormZ(h2, 1, -1, 1, -1, 10.); // cut all <q> < 10
+ SetRangeZ(h2, -30., 30., -200.);
+ //h2->GetXaxis()->SetNdivisions(1010);
h2->GetZaxis()->SetTitle("Rel. Mean(q) [%]");
h2->GetZaxis()->CenterTitle();
h2->Draw("colz");
- MakeDetectorPlot(ily, "pad");
+ MakeDetectorPlot(ily, "p");
}
cOut->SaveAs(Form("%s.gif", cOut->GetName()));
}
for(Int_t ityp(0); ityp<(HasMCdata()?2:1); ityp++){
- if((arr = (TObjArray*)fProj->At(ityp?kMCcluster:kCluster))){
+ if((arr = (TObjArray*)fProj->FindObject(ityp?"hCluster2MC":"hCluster2Track"))){
for(Int_t iview(0); iview<nClViews; iview++){
cOut = new TCanvas(Form("%s_%s%s_%d", GetName(), typName[ityp], vClName[iview], vClOpt[iview]), "Cluster Resolution", nx, ny);
cOut->Divide(3,2, 1.e-5, 1.e-5);
Int_t nplot(0);
for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
p=cOut->cd(ily+1); p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712);
- if(!(h2 = (TH2*)arr->FindObject(Form("H%s%s%d_2D", typName[ityp], vClName[iview], ily)))) continue;
+ if(!(h2 = (TH2*)arr->FindObject(Form("H%s%s%d_2D", typName[ityp], vClName[iview], UseLYselectTrklt()?fLYselect:ily)))) continue;
nplot++;
if(vClOpt[iview]==0) h2->Draw("colz");
- else if(vClOpt[iview]==1) DrawSigma(h2, "#sigma(#Deltay) [#mum]", vClMin[iview], vClMax[iview], 1.e4);
+ else if(vClOpt[iview]==1) h2e[ih2e++] = DrawSigma(h2, "#sigma(#Deltay) [#mum]", vClMin[iview], vClMax[iview], 1.e4);
if(iview<5) MakeDetectorPlot(ily);
}
if(nplot==AliTRDgeometry::kNlayer) cOut->SaveAs(Form("%s.gif", cOut->GetName()));
}
}
// tracklet systematic
- if((arr = (TObjArray*)fProj->At(ityp?kMCtracklet:kTracklet))){
+ if((arr = (TObjArray*)fProj->FindObject(ityp?"hTracklet2MC":"hTracklet2Track"))){
for(Int_t iview(0); iview<nTrkltViews; iview++){
cOut = new TCanvas(Form("%s_%s%s_%d", GetName(), typName[ityp], vTrkltName[iview], vTrkltOpt[iview]), "Tracklet Resolution", nx, ny);
cOut->Divide(3,2, 1.e-5, 1.e-5);
if(!(h2 = (TH2*)arr->FindObject(Form("H%s%s%d_2D", typName[ityp], vTrkltName[iview], iplot)))) continue;
nplot++;
if(vTrkltOpt[iview]==0) h2->Draw("colz");
- else if (vTrkltOpt[iview]==1) DrawSigma(h2, "#sigma(#Deltay) [cm]", .15, .4);
- else if (vTrkltOpt[iview]==2) DrawSigma(h2, "#sigma(occupancy) [%]", 10.5, 15.);
+ else if (vTrkltOpt[iview]==1) h2e[ih2e++] = DrawSigma(h2, "#sigma(#Deltay) [cm]", .15, .4);
+ else if (vTrkltOpt[iview]==2) h2e[ih2e++] = DrawSigma(h2, "#sigma(occupancy) [%]", 10.5, 15.);
MakeDetectorPlot(iplot);
}
if(nplot==6){
}
}
// trackIn systematic
- if((arr = (TObjArray*)fProj->At(ityp?kMCtrackIn:kTrackIn))){
- for(Int_t iview(0); iview<nTrkInViews; iview++){
- cOut = new TCanvas(Form("%s_%s%s_%d", GetName(), typName[ityp], vTrkInName[iview][0], vTrkInOpt[iview]), "Track IN Resolution", nx, ny);
- cOut->Divide(3,2, 1.e-5, 1.e-5);
- Int_t nplot(0);
- for(Int_t iplot(0); iplot<6; iplot++){
- p=cOut->cd(iplot+1); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712);
- if(!(h2 = (TH2*)arr->FindObject(Form("H%s%s_2D", typName[ityp], vTrkInName[iview][iplot])))){
- AliInfo(Form("Missing H%s%s_2D", typName[ityp], vTrkInName[iview][iplot]));
+ for(Int_t iv0(0); iv0<2; iv0++){
+ const Char_t *prefix = ityp?"MC":(iv0?"V0":"");
+ if(ityp && !iv0) arr = (TObjArray*)fProj->FindObject("hTRDin2MC");
+ else if(!ityp && !iv0) arr = (TObjArray*)fProj->FindObject("hTracklet2TRDin");
+ else if(!ityp && iv0) arr = (TObjArray*)fProj->FindObject("hTracklet2TRDinV0");
+ else continue;
+ if(arr){
+ for(Int_t iview(0); iview<nTrkInViews; iview++){
+ cOut = new TCanvas(Form("%s_%s%s_%d", GetName(), prefix, vTrkInName[iview][0], vTrkInOpt[iview]), "Track IN Resolution", nx, ny);
+ cOut->Divide(3,2, 1.e-5, 1.e-5);
+ Int_t nplot(0);
+ for(Int_t iplot(0); iplot<6; iplot++){
+ p=cOut->cd(iplot+1); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712);
+ if(!(h2 = (TH2*)arr->FindObject(Form("H%s%s_2D", prefix, vTrkInName[iview][iplot])))){
+ AliInfo(Form("Missing H%s%s_2D", prefix, vTrkInName[iview][iplot]));
+ continue;
+ }
+ nplot++;
+ if(vTrkInOpt[iview]==0) h2->Draw("colz");
+ else h2e[ih2e++] = DrawSigma(h2, ttt[iplot], min[iplot], max[iplot]);
+ MakeDetectorPlot(0);
+ }
+ if(nplot==6) cOut->SaveAs(Form("%s.gif", cOut->GetName()));
+ else delete cOut;
+ }
+ // species
+ const Float_t zmin[] = {1., 61., 15.},
+ zmax[] = {10., 79., 33.};
+ cOut = new TCanvas(Form("%s_%sTrkInSpc", GetName(), prefix), "Track IN PID", Int_t(1.5*ny), Int_t(1.5*ny));
+ cOut->Divide(3,3, 1.e-5, 1.e-5);
+ Int_t nplot(0); const Char_t *chName[] = {"p", "n", ""};
+ for(Int_t ich(0), ipad(1); ich<3; ich++){
+ TH2 *h2s(NULL);
+ if(!(h2s = (TH2*)arr->FindObject(Form("H%sTrkInY%sEn", prefix, chName[ich])))) {
+ AliInfo(Form("Missing H%sTrkIn%sEn", prefix, chName[ich]));
continue;
}
- nplot++;
- if(vTrkInOpt[iview]==0) h2->Draw("colz");
- else DrawSigma(h2, ttt[iplot], min[iplot], max[iplot]);
- MakeDetectorPlot(0);
+ Int_t irebin(0), dxBin(1), dyBin(1);
+ const Int_t nrebin(5); Int_t rebinX[nrebin] = {1, 2, 1, 2, 1}, rebinY[nrebin] = {2, 1, 2, 1, 2};
+ if(h2s->GetNbinsY()==180){ // old binning
+ rebinX[0] = 1; rebinY[0] = 2;
+ rebinX[1] = 2; rebinY[1] = 1;
+ rebinX[2] = 2; rebinY[2] = 1;
+ rebinX[3] = 1; rebinY[3] = 5;
+ rebinX[4] = 1; rebinY[4] = 1; // dummy
+ }
+ while(irebin<nrebin && (AliTRDrecoTask::GetMeanStat(h2s, .5, 1)<200)){
+ h2s->Rebin2D(rebinX[irebin], rebinY[irebin]);
+ dxBin*=rebinX[irebin];dyBin*=rebinY[irebin];irebin++;
+ }
+ AliDebug(2, Form("Rebin level[%d] @ chg[%d]. Binning[%2dx%2d]", irebin, ich, h2s->GetNbinsX(), h2s->GetNbinsY()));
+ for(Int_t ispec(0); ispec<kNspc; ispec++){
+ p=cOut->cd(ipad++); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712);
+ if(!(h2 = (TH2*)arr->FindObject(Form("H%sTrkInY%s%dEn", prefix, chName[ich], ispec)))) {
+ AliInfo(Form("Missing H%sTrkIn%s%dEn", prefix, chName[ich], ispec));
+ continue;
+ }
+ nplot++;
+ h2->Rebin2D(dxBin,dyBin);
+ h2->Divide(h2, h2s, 1.e2);
+ h2->SetContour(9);
+ h2->GetZaxis()->SetRangeUser(zmin[ispec], zmax[ispec]);
+ h2->GetZaxis()->SetTitle("Rel. Abundancy [%]");h2->GetZaxis()->CenterTitle();
+ TString tit(h2->GetTitle()); TObjArray *atit = tit.Tokenize("::");
+ h2->SetTitle(Form("%s :: Relative Abundancy", ((*atit)[0])->GetName()));
+ atit->Delete(); delete atit;
+ h2->Draw("colz");
+ MakeDetectorPlot(0);
+ }
}
- if(nplot==6) cOut->SaveAs(Form("%s.gif", cOut->GetName()));
+ if(nplot==9) cOut->SaveAs(Form("%s.gif", cOut->GetName()));
else delete cOut;
- }
- // species
- const Float_t zmin[] = {1., 20., 25., 10., 5.},
- zmax[] = {10., 38., 43., 28., 14.};
- cOut = new TCanvas(Form("%s_%sTrkInSpc", GetName(), typName[ityp]), "Track IN PID", Int_t(1.5*nx), Int_t(1.5*ny));
- cOut->Divide(5,3, 1.e-5, 1.e-5);
- Int_t nplot(0); const Char_t *chName[] = {"p", "n", ""};
- for(Int_t ich(0), ipad(1); ich<3; ich++){
- TH2 *h2s(NULL);
- if(!(h2s = (TH2*)arr->FindObject(Form("H%sTrkInY%sEn", typName[ityp], chName[ich])))) {
- AliInfo(Form("Missing H%sTrkIn%sEn", typName[ityp], chName[ich]));
- continue;
+ // pt resolution plot
+ cOut = new TCanvas(Form("%s_%sTrkInPt", GetName(), prefix), "TrackIn Pt", Int_t(1.5*ny), Int_t(1.5*ny));
+ cOut->Divide(3,2, 1.e-5, 1.e-5);
+ for(Int_t ich(0), ipad(1); ich<2; ich++){
+ for(Int_t ispc(0); ispc<kNspc; ispc++){
+ p=cOut->cd(ipad++); p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712);
+ if(!(h2 = (TH2*)arr->FindObject(Form("H%sTrkInPt%s%d_2D", prefix, chName[ich], ispc)))) continue;
+ h2->GetZaxis()->SetRangeUser(0.5, 1.2); h2->SetContour(7); h2->Draw("colz");
+ MakeDetectorPlot(0);
+ }
}
- for(Int_t ispec(0); ispec<AliPID::kSPECIES; ispec++){
- p=cOut->cd(ipad++); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712);
- if(!(h2 = (TH2*)arr->FindObject(Form("H%sTrkInY%s%dEn", typName[ityp], chName[ich], ispec)))) {
- AliInfo(Form("Missing H%sTrkIn%s%dEn", typName[ityp], chName[ich], ispec));
- continue;
+ cOut->SaveAs(Form("%s.gif", cOut->GetName()));
+ // MPV(Q) & <Q plots>
+ const char *chQ[] = {"Q", "QS"};
+ for(Int_t iq(0); iq<2; iq++){
+ cOut = new TCanvas(Form("%s_%sTrkIn%s", GetName(), prefix, chQ[iq]), "Track IN PID", Int_t(1.5*ny), Int_t(1.5*ny));
+ cOut->Divide(3,3, 1.e-5, 1.e-5);
+ nplot=0;
+ for(Int_t ich(0), ipad(1); ich<3; ich++){
+ for(Int_t ispec(0); ispec<kNspc; ispec++){
+ p=cOut->cd(ipad++); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712);
+ if(!(h2 = (TH2*)arr->FindObject(Form("H%sTrkIn%s%s%d_2D", prefix, chQ[iq], chName[ich], ispec)))) {
+ AliInfo(Form("Missing H%sTrkIn%s%s%d_2D", prefix, chQ[iq], chName[ich], ispec));
+ continue;
+ }
+ nplot++;
+ h2->Draw("colz");
+ MakeDetectorPlot(0);
+ }
}
- nplot++;
- h2->Divide(h2, h2s, 1.e2);
- h2->SetContour(9);
- h2->GetZaxis()->SetRangeUser(zmin[ispec], zmax[ispec]);
- h2->GetZaxis()->SetTitle("Rel. Abundancy [%]");h2->GetZaxis()->CenterTitle();
- TString tit(h2->GetTitle()); h2->SetTitle(Form("%s :: Relative Abundancy", ((*(tit.Tokenize("::")))[0])->GetName()));
- h2->Draw("colz");
- MakeDetectorPlot(0);
+ if(nplot==9) cOut->SaveAs(Form("%s.gif", cOut->GetName()));
+ else delete cOut;
}
}
- if(nplot==15) cOut->SaveAs(Form("%s.gif", cOut->GetName()));
- else delete cOut;
}
}
// track MC systematic
- if((arr = (TObjArray*)fProj->At(kMCtrack))) {
+ if((arr = (TObjArray*)fProj->FindObject("hTRD2MC"))) {
for(Int_t iview(0); iview<nTrkViews; iview++){
cOut = new TCanvas(Form("%s_MC%s", GetName(), vTrkName[iview]), "Track Resolution", nx, ny);
cOut->Divide(3,2, 1.e-5, 1.e-5);
else delete cOut;
}
}
-
-
gStyle->SetPalette(1);
+
+ // clean histos
+ for(Int_t ih(ih2e); ih--;) delete h2e[ih];
}
//________________________________________________________
-void AliTRDresolution::DrawSigma(TH2 *h2, const Char_t *title, Float_t m, Float_t M, Float_t scale)
+TH2* AliTRDresolution::DrawSigma(TH2 *h2, const Char_t *title, Float_t m, Float_t M, Float_t scale)
{
// Draw error bars scaled with "scale" instead of content values
//use range [m,M] if limits are specified
- if(!h2) return;
+ if(!h2) return NULL;
TAxis *ax(h2->GetXaxis()), *ay(h2->GetYaxis());
TH2F *h2e = new TH2F(Form("%s_E", h2->GetName()),
Form("%s;%s;%s;%s", h2->GetTitle(), ax->GetTitle(), ay->GetTitle(), title),
}
}
h2e->Draw("colz");
+ return h2e;
}
//________________________________________________________
}
THnSparse *H(NULL);
if(!(H = (THnSparse*)fContainer->FindObject("hDet2Cluster"))){
- AliInfo(Form("Missing/Wrong data @ hDet2Cluster."));
+ AliInfo("Missing/Wrong data @ hDet2Cluster.");
return kTRUE;
}
Int_t ndim(H->GetNdimensions());
// build list of projections
const Int_t nsel(8*AliTRDgeometry::kNlayer*AliTRDeventInfo::kCentralityClasses);
// define rebinning strategy
- const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 2, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
+ const Int_t nEtaPhi(5); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 1, 2, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 2, 1, 2};
+ if(aa[1]->GetNbins()==180){ // old binning
+ rebinEtaPhiX[0] = 1; rebinEtaPhiY[0] = 2;
+ rebinEtaPhiX[1] = 2; rebinEtaPhiY[1] = 1;
+ rebinEtaPhiX[2] = 2; rebinEtaPhiY[2] = 1;
+ rebinEtaPhiX[3] = 1; rebinEtaPhiY[3] = 5;
+ rebinEtaPhiX[4] = 1; rebinEtaPhiY[4] = 1; // dummy
+ }
//const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"0-10%", "10-20%", "20-50%", "50-80%", "80-100%"};
const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"2800-inf", "2100-2799", "1400-2099", "700-1399", "0-699"};
- AliTRDresolutionProjection hp[kDetNproj]; TObjArray php(kDetNproj);
- Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t));
+ AliTRDrecoProjection hp[kDetNproj]; TObjArray php(kDetNproj);
+ Int_t ih(0), isel(-1), np[nsel]={0};
for(Int_t ipad(0); ipad<nPad; ipad++){
for(Int_t icen(0); icen<AliTRDeventInfo::kCentralityClasses; icen++){
for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
npad = 0; // no. of pads selection
if(an) npad = TMath::Min(coord[5]-1, Int_t(kNpads));
isel = npad*AliTRDeventInfo::kCentralityClasses*AliTRDgeometry::kNlayer+cen*AliTRDgeometry::kNlayer+ly;
- ((AliTRDresolutionProjection*)php.At(isel))->Increment(coord, v);
- //Int_t ioff=isel;for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDresolutionProjection*)php.At(ioff+jh))->Increment(coord, v);
+ ((AliTRDrecoProjection*)php.At(isel))->Increment(coord, v);
+ //Int_t ioff=isel;for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v);
}
TObjArray *arr(NULL);
fProj->AddAt(arr = new TObjArray(kDetNproj), kDetector);
+ arr->SetName("hDet2Cluster"); arr->SetOwner();
TH2 *h2(NULL); Int_t jh(0);
for(; ih--; ){
- if(!hp[ih].fH) continue;
- if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours, 0, kFALSE))) continue;
- arr->AddAt(h2, jh++);
- if(!(h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].fH->GetName())))) continue;
- arr->AddAt(h2, jh++);
+ if(!hp[ih].H()) continue;
+ if((h2 = hp[ih].Projection2D(kNstat, kNcontours, 0, kFALSE))) arr->AddAt(h2, jh++);
+ if((h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].H()->GetName())))) arr->AddAt(h2, jh++);
}
- AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
+ AliTRDrecoProjection *pr0(NULL), *pr1(NULL);
for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
for(Int_t icen(0); icen<AliTRDeventInfo::kCentralityClasses; icen++){
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, 0)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, 0)))){
for(Int_t ipad(1); ipad<nPad; ipad++){
- if((pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, ipad)))){
+ if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, ipad)))){
(*pr0)+=(*pr1);
}
}
- pr0->fH->SetNameTitle(Form("HDet%d%d", ily, icen), Form("Detectors :: Ly[%d] Cen[%s]", ily, cenName[icen]));
+ pr0->H()->SetNameTitle(Form("HDet%d%d", ily, icen), Form("Detectors :: Ly[%d] Cen[%s]", ily, cenName[icen]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 0, kFALSE))) arr->AddAt(h2, jh++);
- if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->fH->GetName())))) arr->AddAt(h2, jh++);
- if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))) (*pr1)+=(*pr0);
+ if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++);
+ if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))) (*pr1)+=(*pr0);
}
}
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))){
- pr0->fH->SetNameTitle(Form("HDet%d", ily), Form("Detectors :: Ly[%d]", ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))){
+ pr0->H()->SetNameTitle(Form("HDet%d", UseLYselectTrklt()?fLYselect:ily), Form("Detectors :: Ly[%d]", UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
}
}
THnSparse *H(NULL);
if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){
AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)]));
- return kFALSE;
+ return kTRUE;
}
Int_t ndim(H->GetNdimensions()); Bool_t debug(ndim>Int_t(kNdimCl));
- Int_t coord[kNdim]; memset(coord, 0, sizeof(Int_t) * kNdim); Double_t v = 0.;
+ Int_t coord[10]; memset(coord, 0, sizeof(Int_t) * 10); Double_t v = 0.;
TAxis *aa[kNdim], *as(NULL), *apt(NULL), *acen(NULL), *anp(NULL); memset(aa, 0, sizeof(TAxis*) * kNdim);
for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id);
if(ndim > Int_t(kPt)) apt = H->GetAxis(kPt);
// build list of projections
const Int_t nsel(AliTRDgeometry::kNlayer*kNcharge*(kNpads+1)*AliTRDeventInfo::kCentralityClasses);
// define rebinning strategy
- const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
- AliTRDresolutionProjection hp[kClNproj]; TObjArray php(kClNproj);
+ const Int_t nEtaPhi(5); Int_t rebinEtaPhiX[nEtaPhi] = {1, 3, 1, 3, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 2, 1, 2};
+ if(aa[1]->GetNbins()==180){ // old binning
+ rebinEtaPhiX[0] = 1; rebinEtaPhiY[0] = 2;
+ rebinEtaPhiX[1] = 2; rebinEtaPhiY[1] = 1;
+ rebinEtaPhiX[2] = 5; rebinEtaPhiY[2] = 1;
+ rebinEtaPhiX[3] = 1; rebinEtaPhiY[3] = 5;
+ rebinEtaPhiX[4] = 1; rebinEtaPhiY[4] = 1; // dummy
+ }
+ AliTRDrecoProjection hp[kClNproj]; TObjArray php(kClNproj);
const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'};
const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"2800-inf", "2100-2799", "1400-2099", "700-1399", "0-699"};
Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t));
}
}
}
- AliInfo(Form("Build %3d 3D projections.", ih));
+ AliInfo(Form("Build %3d 3D %s projections.", ih, mc?"MC":""));
- AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
+ AliTRDrecoProjection *pr0(NULL), *pr1(NULL);
Int_t ly(0), ch(0), rcBin(as?as->FindBin(0.):-1), chBin(apt?apt->FindBin(0.):-1), ioff(0), cen(0), npad(0);
for (Long64_t ib(0); ib < H->GetNbins(); ib++) {
v = H->GetBinContent(ib, coord); if(v<1.) continue;
+npad;
ioff=isel*4;
} else {
+ if(mc && ly<0) ly=0; // fix for bug in PlotMC
isel = ly; ioff = isel;
}
if(ioff>=ih){
AliError(Form("Wrong selection %d [%3d]", ioff, ih));
return kFALSE;
}
- if(!(pr0=(AliTRDresolutionProjection*)php.At(ioff))) {
+ if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) {
AliError(Form("Missing projection %d", ioff));
return kFALSE;
}
- if(strcmp(pr0->fH->GetName(), Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ch], ly, cen, npad))!=0){
- AliError(Form("Projection mismatch :: request[H%sClY%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ly, cen, npad, pr0->fH->GetName()));
+ if(strcmp(pr0->H()->GetName(), Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ch], ly, cen, npad))!=0){
+ AliError(Form("Projection mismatch :: request[H%sClY%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ly, cen, npad, pr0->H()->GetName()));
return kFALSE;
}
- for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDresolutionProjection*)php.At(ioff+jh))->Increment(coord, v);
+ for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v);
+ }
+ if(HasDump3DFor(kCluster)){
+ TDirectory *cwd = gDirectory;
+ TFile::Open(Form("DumpRes_%s.root", H->GetName()), "RECREATE");
+ for(Int_t ip(0); ip<php.GetEntriesFast(); ip++){
+ if(!(pr0 = (AliTRDrecoProjection*)php.At(ip))) continue;
+ if(!pr0->H()) continue;
+ TH3 *h3=(TH3*)pr0->H()->Clone();
+ h3->Write();
+ }
+ gFile->Close();
+ cwd->cd();
}
+
TObjArray *arr(NULL);
fProj->AddAt(arr = new TObjArray(kClNproj), cidx);
+ arr->SetName(projName[Int_t(mc)]); arr->SetOwner();
TH2 *h2(NULL); Int_t jh(0);
for(; ih--; ){
- if(!hp[ih].fH) continue;
- if(strchr(hp[ih].fH->GetName(), 'Q')){
- if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours, 0, kFALSE))) continue;
- arr->AddAt(h2, jh++);
- if(!(h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].fH->GetName())))) continue;
- arr->AddAt(h2, jh++);
+ if(!hp[ih].H()) continue;
+ if(strchr(hp[ih].H()->GetName(), 'Q')){
+ if((h2 = hp[ih].Projection2D(kNstat, kNcontours, 0, kFALSE))) arr->AddAt(h2, jh++);
+ if((h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].H()->GetName())))) arr->AddAt(h2, jh++);
} else {
if((h2 = hp[ih].Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
}
+ Double_t m(0.), s(0.), se(0.), trend(0.);
for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
for(Int_t ich(0); ich<nCh; ich++){
for(Int_t icen(0); icen<nCen; icen++){
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
for(Int_t ipad(1); ipad<nNpad; ipad++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sClY%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+ pr0->H()->SetNameTitle(Form("H%sClY%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
+ if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
}
/*!Q*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
for(Int_t ipad(1); ipad<nNpad; ipad++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sClQ%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: Q Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+ pr0->H()->SetNameTitle(Form("H%sClQ%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: Q Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 2, kFALSE))) arr->AddAt(h2, jh++);
- if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->fH->GetName())))) arr->AddAt(h2, jh++);
- pr0->fH->SetName(Form("H%sClQS%c%d%d", mc?"MC":"", chName[ich], ily, icen));
+ if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++);
+ pr0->H()->SetName(Form("H%sClQS%c%d%d", mc?"MC":"", chName[ich], ily, icen));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
- if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
+ if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
}
/*!YXTC*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
for(Int_t ipad(1); ipad<nNpad; ipad++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sClYXTC%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay(x,TC) Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+ pr0->H()->SetNameTitle(Form("H%sClYXTC%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay(x,TC) Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
+ if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
}
/*!YXPh*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
for(Int_t ipad(1); ipad<nNpad; ipad++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, ipad)))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sClYXPh%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay(x,#Phi) Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+ pr0->H()->SetNameTitle(Form("H%sClYXPh%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay(x,#Phi) Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
+ if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
}
} // end centrality integration
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
- pr0->fH->SetNameTitle(Form("H%sClY%c%d", mc?"MC":"", chName[ich], ily),
- Form("Clusters[%c]:: #Deltay Ly[%d]", chSgn[ich], ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sClY%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily),
+ Form("Clusters[%c]:: #Deltay Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
+ if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
}
/*!Q*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
- pr0->fH->SetNameTitle(Form("H%sClQ%c%d", mc?"MC":"", chName[ich], ily),
- Form("Clusters[%c]:: Q Ly[%d]", chSgn[ich], ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sClQ%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily),
+ Form("Clusters[%c]:: Q Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++);
- pr0->fH->SetName(Form("H%sClQS%c%d", mc?"MC":"", chName[ich], ily));
+ pr0->H()->SetName(Form("H%sClQS%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
+ if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
}
/*!YXTC*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
- pr0->fH->SetNameTitle(Form("H%sClYXTC%c%d", mc?"MC":"", chName[ich], ily),
- Form("Clusters[%c]:: #Deltay(x,TC) Ly[%d]", chSgn[ich], ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sClYXTC%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily),
+ Form("Clusters[%c]:: #Deltay(x,TC) Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
+ if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
}
/*!YXPh*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
- pr0->fH->SetNameTitle(Form("H%sClYXPh%c%d", mc?"MC":"", chName[ich], ily),
- Form("Clusters[%c]:: #Deltay(x,#Phi) Ly[%d]", chSgn[ich], ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sClYXPh%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily),
+ Form("Clusters[%c]:: #Deltay(x,#Phi) Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
+ if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
}
} // end charge integration
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){
- pr0->fH->SetNameTitle(Form("H%sClY%d", mc?"MC":"", ily), Form("Clusters :: #Deltay Ly[%d]", ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sClY%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Clusters :: #Deltay Ly[%d]", UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
+ if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.) PutTrendValue(Form("%sClS%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), s, se);
}
/*!YXPh*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){
- pr0->fH->SetNameTitle(Form("H%sClYXPh%d", mc?"MC":"", ily), Form("Clusters :: #Deltay Ly[%d]", ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sClYXPh%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Clusters :: #Deltay Ly[%d]", UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
}
- AliInfo(Form("Done %3d 2D projections.", jh));
+ AliInfo(Form("Done %3d 2D %s projections.", jh, mc?"MC":""));
return kTRUE;
}
const Int_t kNstat(30);
const Int_t kNstatQ(30);
Int_t cidx=mc?kMCtracklet:kTracklet;
- if(fProj && fProj->At(cidx)) return kTRUE;
+ if(!fProj){
+ AliError("Missing results container.");
+ return kFALSE;
+ }
if(!fContainer){
AliError("Missing data container.");
return kFALSE;
THnSparse *H(NULL);
if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){
AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)]));
- return kFALSE;
+ return kTRUE;
}
const Int_t mdim(kNdim+8);
- Int_t ndim(H->GetNdimensions()); Bool_t debug(ndim>Int_t(kNdimTrklt));
+ Int_t ndim(H->GetNdimensions()); //Bool_t debug(ndim>Int_t(kNdimTrklt));
Int_t coord[mdim]; memset(coord, 0, sizeof(Int_t) * mdim); Double_t v = 0.;
TAxis *aa[mdim], *as(NULL), *ap(NULL), *ac(NULL); memset(aa, 0, sizeof(TAxis*) * mdim);
for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id);
if(ndim > Int_t(kSpeciesChgRC)) as = H->GetAxis(kSpeciesChgRC); // init species/charge selection
if(ndim > Int_t(kPt)) ap = H->GetAxis(kPt); // init pt selection
- if(ndim > Int_t(kNdim)) ac = H->GetAxis(kNdim); // init centrality selection
+// if(ndim > Int_t(kNdim)) ac = H->GetAxis(kNdim); // init centrality selection
// calculate size depending on debug level
- const Int_t nCen(debug?Int_t(AliTRDeventInfo::kCentralityClasses):1);
- const Int_t nPt(debug?Int_t(kNpt):1);
- const Int_t nSpc(1);//ndim>kNdimTrklt?fgkNbins[kSpeciesChgRC]:1);
- const Int_t nCh(debug?Int_t(kNcharge):1);
+ const Int_t nCen(ac?Int_t(AliTRDeventInfo::kCentralityClasses):1);
+ const Int_t nPt(ap?Int_t(fNpt+2):1);
+ const Int_t nSpc(as?Int_t(kNspc):1);
+ const Int_t nCh(as?Int_t(kNcharge):1);
+ const Int_t nLy(UseLYselectTrklt()?1:AliTRDgeometry::kNlayer);
// build list of projections
- const Int_t nsel(AliTRDeventInfo::kCentralityClasses*AliTRDgeometry::kNlayer*kNpt*(AliPID::kSPECIES*kNcharge + 1));
+ const Int_t nsel(AliTRDeventInfo::kCentralityClasses*AliTRDgeometry::kNlayer*(fgNPt+2)*(AliPID::kSPECIES*kNcharge + 1));
// define rebinning strategy
- const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
- AliTRDresolutionProjection hp[kTrkltNproj]; TObjArray php(kTrkltNproj);
+ const Int_t nEtaPhi(5); Int_t rebinEtaPhiX[nEtaPhi] = {1, 3, 1, 3, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 2, 1, 2};
+ if(aa[1]->GetNbins()==180){ // old binning
+ rebinEtaPhiX[0] = 1; rebinEtaPhiY[0] = 2;
+ rebinEtaPhiX[1] = 2; rebinEtaPhiY[1] = 1;
+ rebinEtaPhiX[2] = 5; rebinEtaPhiY[2] = 1;
+ rebinEtaPhiX[3] = 1; rebinEtaPhiY[3] = 5;
+ rebinEtaPhiX[4] = 1; rebinEtaPhiY[4] = 1; // dummy
+ }
+ AliTRDrecoProjection hp[kTrkltNproj]; TObjArray php(kTrkltNproj);
Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t));
const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'};
- const Char_t ptName[kNpt] = {'l', 'i', 'h'};
- const Char_t *ptCut[kNpt] = {"p_{t}[GeV/c]<0.8", "0.8<=p_{t}[GeV/c]<1.5", "p_{t}[GeV/c]>=1.5"};
+ const Char_t ptShortName[5] = {'L', 'l', 'i', 'h', 'H'};
+ Char_t ptName[fgNPt+2] = {0};
+ Char_t *ptCut[fgNPt+2] = {NULL};
+
// const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"0-10%", "10-20%", "20-50%", "50-80%", "80-100%"};
const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"2800-inf", "2100-2799", "1400-2099", "700-1399", "0-699"};
for(Int_t icen(0); icen<nCen; icen++){
- for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
+ for(Int_t ily(0); ily<nLy; ily++){
for(Int_t ipt(0); ipt<nPt; ipt++){
+ if(!ptName[ipt]){
+ ptName[ipt]= nPt>5?(64+ipt):ptShortName[ipt];
+ ptCut[ipt] = StrDup(Form("#it{%4.2f<=p_{t}^{%s}[GeV/c]<%4.2f}",ipt?fgPt[ipt-1]:0., mc?"MC":"", ipt>fgNPt?99.99:fgPt[ipt]));
+ }
for(Int_t isp(0); isp<nSpc; isp++){
for(Int_t ich(0); ich<nCh; ich++){
isel++; // new selection
- hp[ih].Build(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen),
- Form("Tracklets[%s%c]:: #Deltay{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
+ AliDebug(3, Form("Building sel[%3d|%4d]", isel, ih));
+ hp[ih].Build(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen),
+ Form("Tracklets[%s%c]:: #Deltay{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]),
kEta, kPhi, kYrez, aa);
//hp[ih].SetShowRange(-0.1,0.1);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
- hp[ih].Build(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen),
- Form("Tracklets[%s%c]:: #Delta#phi{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
+ hp[ih].Build(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen),
+ Form("Tracklets[%s%c]:: #Delta#phi{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]),
kEta, kPhi, kPrez, aa);
//hp[ih].SetShowRange(-0.5,0.5);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
- hp[ih].Build(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen),
- Form("Tracklets[%s%c]:: dQdl{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
+ hp[ih].Build(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen),
+ Form("Tracklets[%s%c]:: dQdl{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]),
kEta, kPhi, kZrez, aa);
hp[ih].SetShowRange(1.,2.3);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
- hp[ih].Build(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen),
- Form("Tracklets[%s%c]:: OccupancyTB{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
- kEta, kPhi, kNdim+1, aa);
- hp[ih].SetShowRange(30., 70.);
- hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
- php.AddLast(&hp[ih++]); np[isel]++;
+// hp[ih].Build(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen),
+// Form("Tracklets[%s%c]:: OccupancyTB{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
+// kEta, kPhi, kNdim+1, aa);
+// hp[ih].SetShowRange(30., 70.);
+// hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
+// php.AddLast(&hp[ih++]); np[isel]++;
}
}
if(ndim==kNdimTrklt) continue;
isel++; // new selection
- hp[ih].Build(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[ipt], ily, icen),
- Form("Tracklets[RC]:: #Deltaz{%s} Ly[%d] Cen[%s]", ptCut[ipt], ily, cenName[icen]),
+ AliDebug(3, Form("Building selRC[%3d|%4d]", isel, ih));
+ hp[ih].Build(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen),
+ Form("Tracklets[RC]:: #Deltaz{%s} Ly[%d] Cen[%s]", ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]),
kEta, kPhi, kZrez, aa);
// hp[ih].SetShowRange(-0.1,0.1);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
}
}
}
- AliInfo(Form("Build %3d 3D projections.", ih));
+ AliInfo(Form("Build %3d 3D %s projections%s", ih, mc?"MC":"", UseLYselectTrklt()?Form(" for Ly[%d].", fLYselect):"."));
- AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
- Int_t ly(0), ch(0), sp(2), rcBin(as?as->FindBin(0.):-1), pt(0), cen(0), ioff(0), jspc(nSpc*nCh+1), kspc(nSpc*nCh*4+1);
+ AliTRDrecoProjection *pr0(NULL), *pr1(NULL);
+ Int_t ly(0), ch(0), sp(2), rcBin(as?as->FindBin(0.):-1), pt(0), cen(0), ioff(0), jspc(nSpc*nCh+1), kspc(nSpc*nCh*3/*4*/+1);
for (Long64_t ib(0); ib < H->GetNbins(); ib++) {
v = H->GetBinContent(ib, coord);
if(v<1.) continue;
ly = coord[kBC]-1; // layer selection
+ if(UseLYselectTrklt()&& (ly!=fLYselect)) continue;
// charge selection
ch = 0; sp=0;// [e-] track [dafault]
if(rcBin>0){ // debug mode in which species/charge are also saved
}
// pt selection
pt = 0; // low pt
- if(ap) pt = TMath::Min(coord[kPt]-1, Int_t(kNpt)-1);
+ if(ap) pt = coord[kPt];//TMath::Min(coord[kPt], Int_t(kNpt)+1);
// centrality selection
cen = 0; // default
if(ac) cen = coord[kNdim]-1;
// global selection
if(ndim==kNdimTrklt){
- ioff = ly*4;
+ if(mc && ly<0) ly=0; // fix for bug in PlotMC
+ ioff = ly*3/*4*/;
isel = ly;
} else {
- isel = cen*AliTRDgeometry::kNlayer*nPt*jspc+ly*nPt*jspc+pt*jspc; isel+=sp<0?(nSpc*nCh):ch;
- ioff = cen*AliTRDgeometry::kNlayer*nPt*kspc+ly*nPt*kspc+pt*kspc; ioff+=sp<0?((nSpc*nCh)*4):(ch*4);
+ isel = cen*nLy*nPt*jspc+(!UseLYselectTrklt())*ly*nPt*jspc+pt*jspc; isel+=sp<0?(nSpc*nCh):(sp*nCh+ch);
+ ioff = cen*nLy*nPt*kspc+(!UseLYselectTrklt())*ly*nPt*kspc+pt*kspc; ioff+=sp<0?((nSpc*nCh)*3/*4*/):(sp*nCh*3+ch*3/*4*/);
}
if(ioff>=ih){
AliError(Form("Wrong selection %d [%3d]", ioff, ih));
return kFALSE;
}
- if(!(pr0=(AliTRDresolutionProjection*)php.At(ioff))) {
+ if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) {
AliError(Form("Missing projection %d", ioff));
return kFALSE;
}
if(sp>=0){
- if(strcmp(pr0->fH->GetName(), Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ch], ptName[pt], sp, ly, cen))!=0){
- AliError(Form("Projection mismatch :: request[H%sTrkltY%c%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ptName[pt], sp, ly, cen, pr0->fH->GetName()));
+ if(strcmp(pr0->H()->GetName(), Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ch], ptName[pt], sp, UseLYselectTrklt()?fLYselect:ly, cen))!=0){
+ AliError(Form("Projection mismatch :: request[H%sTrkltY%c%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ptName[pt], sp, UseLYselectTrklt()?fLYselect:ly, cen, pr0->H()->GetName()));
return kFALSE;
}
} else {
- if(strcmp(pr0->fH->GetName(), Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[pt], ly, cen))!=0){
- AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c%d%d] found[%s]", mc?"MC":"", ptName[pt], ly, cen, pr0->fH->GetName()));
+ if(strcmp(pr0->H()->GetName(), Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[pt], UseLYselectTrklt()?fLYselect:ly, cen))!=0){
+ AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c%d%d] found[%s]", mc?"MC":"", ptName[pt], UseLYselectTrklt()?fLYselect:ly, cen, pr0->H()->GetName()));
return kFALSE;
}
}
- for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDresolutionProjection*)php.At(ioff+jh))->Increment(coord, v);
+ for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v);
+ }
+ if(HasDump3DFor(kTracklet)){
+ TDirectory *cwd = gDirectory;
+ TFile::Open(Form("DumpRes_%s.root", H->GetName()), "RECREATE");
+ for(Int_t ip(0); ip<php.GetEntriesFast(); ip++){
+ if(!(pr0 = (AliTRDrecoProjection*)php.At(ip))) continue;
+ if(!pr0->H()) continue;
+ TH3 *h3=(TH3*)pr0->H()->Clone();
+ h3->Write();
+ }
+ gFile->Close();
+ cwd->cd();
}
- TObjArray *arr(NULL);
- fProj->AddAt(arr = new TObjArray(kTrkltNproj), cidx);
TH2 *h2(NULL); Int_t jh(0);
+ TObjArray *arr(NULL);
+ if(!(arr = (TObjArray*)fProj->At(cidx))){
+ fProj->AddAt(arr = new TObjArray(kTrkltNproj), cidx);
+ arr->SetName(projName[Int_t(mc)]); arr->SetOwner();
+ } else jh = arr->GetEntriesFast();
+
for(; ih--; ){
- if(!hp[ih].fH) continue;
+ if(!hp[ih].H()) continue;
Int_t mid(0), nstat(kNstat);
- if(strchr(hp[ih].fH->GetName(), 'Q')){ mid=2; nstat=kNstatQ;}
+ if(strchr(hp[ih].H()->GetName(), 'Q')){ mid=2; nstat=kNstatQ;}
if(!(h2 = hp[ih].Projection2D(nstat, kNcontours, mid))) continue;
arr->AddAt(h2, jh++);
}
// build combined performance plots
- for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
+ Double_t m(0.), s(0.), se(0.), trend(0.);
+ for(Int_t ily(0); ily<nLy; ily++){
for(Int_t ich(0); ich<nCh; ich++){
- for(Int_t icen(0); icen<nCen; icen++){
- for(Int_t ipt(0); ipt<nPt; ipt++){
+ for(Int_t ipt(0); ipt<nPt; ipt++){
+ for(Int_t icen(0); icen<nCen; icen++){
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, icen)))){
for(Int_t isp(1); isp<nSpc; isp++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen)))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sTrkltY%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
- Form("Tracklets[%c]:: #Deltay{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen]));
+ pr0->H()->SetNameTitle(Form("H%sTrkltY%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen),
+ Form("Tracklets[%c]:: #Deltay{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
+ if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, icen)))){
for(Int_t isp(1); isp<nSpc; isp++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen)))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sTrkltPh%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
- Form("Tracklets[%c]:: #Delta#phi{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen]));
+ pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen),
+ Form("Tracklets[%c]:: #Delta#phi{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
+ if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
}
/*!dQ/dl*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, icen)))){
for(Int_t isp(1); isp<nSpc; isp++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen)))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sTrkltQ%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
- Form("Tracklets[%c]:: dQdl{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen]));
+ pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen),
+ Form("Tracklets[%c]:: dQdl{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]));
if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++);
- pr0->fH->SetNameTitle(Form("H%sTrkltQS%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
- Form("Tracklets[%c]:: dQdl{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen]));
+ pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen),
+ Form("Tracklets[%c]:: dQdl{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]));
pr0->SetShowRange(2.4, 5.1);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
- if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
+ if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
}
/*!TB occupancy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
- for(Int_t isp(1); isp<nSpc; isp++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
- (*pr0)+=(*pr1);
- }
- pr0->fH->SetNameTitle(Form("H%sTrkltTB%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
- Form("Tracklets[%c]:: OccupancyTB{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen]));
- if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
- if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
- }
- } // end pt integration
+// if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, icen)))){
+// for(Int_t isp(1); isp<nSpc; isp++){
+// if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily, icen)))) continue;
+// (*pr0)+=(*pr1);
+// }
+// pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen),
+// Form("Tracklets[%c]:: OccupancyTB{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily, cenName[icen]));
+// if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
+// if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
+// }
+ } // end centrality integration
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltY%c%d%d", mc?"MC":"", chName[ich], ily, icen),
- Form("Tracklets[%c]:: #Deltay Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkltY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracklets[%c]:: #Deltay Ly[%d] %s", chSgn[ich], UseLYselectTrklt()?fLYselect:ily, ptCut[ipt]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+ if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkltY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), trend, m);
+ PutTrendValue(Form("%sTrkltYS%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), s, se);
+ }
+ if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltPh%c%d%d", mc?"MC":"", chName[ich], ily, icen),
- Form("Tracklets[%c]:: #Delta#phi Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracklets[%c]:: #Delta#phi Ly[%d] %s", chSgn[ich], UseLYselectTrklt()?fLYselect:ily, ptCut[ipt]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+ if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkltPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), trend, m);
+ PutTrendValue(Form("%sTrkltPhS%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), s, se);
+ }
+ if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
}
/*!dQ/dl*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltQ%c%d%d", mc?"MC":"", chName[ich], ily, icen),
- Form("Tracklets[%c]:: dQdl Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracklets[%c]:: dQdl Ly[%d] %s", chSgn[ich], UseLYselectTrklt()?fLYselect:ily, ptCut[ipt]));
pr0->SetShowRange(1.,2.3);
if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++);
- pr0->fH->SetNameTitle(Form("H%sTrkltQS%c%d%d", mc?"MC":"", chName[ich], ily, icen),
- Form("Tracklets[%c]:: dQdl Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+ pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracklets[%c]:: dQdl Ly[%d] %s", chSgn[ich], UseLYselectTrklt()?fLYselect:ily, ptCut[ipt]));
pr0->SetShowRange(2.4,5.1);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
- if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+ if((trend=pr0->GetTrendValue(2,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkltQ%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), trend, m);
+ PutTrendValue(Form("%sTrkltQS%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily), s, se);
+ }
+ if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
}
/*!TB occupancy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltTB%c%d%d", mc?"MC":"", chName[ich], ily, icen),
- Form("Tracklets[%c]:: OccupancyTB Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
- if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
- if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
- }
- } // end centrality integration
+// if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+// pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily),
+// Form("Tracklets[%c]:: OccupancyTB Ly[%d] %s", chSgn[ich], UseLYselectTrklt()?fLYselect:ily, ptCut[ipt]));
+// if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
+// if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
+// }
+ } // end pt integration
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltY%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: #Deltay Ly[%d]", chSgn[ich], ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkltY%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[%c] :: #Deltay Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+ if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkltY%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), trend, m);
+ PutTrendValue(Form("%sTrkltYS%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), s, se);
+ }
+ if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltPh%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: #Delta#phi Ly[%d]", chSgn[ich], ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[%c] :: #Delta#phi Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
pr0->SetShowRange(-.9,.9);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+ if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkltPh%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), trend, m);
+ PutTrendValue(Form("%sTrkltPhS%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), s, se);
+ }
+ if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
}
/*!dQ/dl*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltQ%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
pr0->SetShowRange(1.,2.3);
if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++);
- pr0->fH->SetNameTitle(Form("H%sTrkltQS%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], ily));
+ pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
pr0->SetShowRange(2.4,5.1);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+ if((trend=pr0->GetTrendValue(2,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkltQ%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), trend, m);
+ PutTrendValue(Form("%sTrkltQS%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), s, se);
+ }
+ if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
}
/*!TB occupancy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltTB%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: OccupancyTB Ly[%d]", chSgn[ich], ily));
- if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
- }
+// if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+// pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%d", mc?"MC":"", chName[ich], UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[%c] :: OccupancyTB Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
+// if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
+// if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
+// }
} // end charge integration
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltY%d", mc?"MC":"", ily), Form("Tracklets :: #Deltay Ly[%d]", ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkltY%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Tracklets :: #Deltay Ly[%d]", UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
+ if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkltY%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), trend, m);
+ PutTrendValue(Form("%sTrkltYS%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), s, se);
+ }
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltPh%d", mc?"MC":"", ily), Form("Tracklets :: #Delta#phi Ly[%d]", ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkltPh%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Tracklets :: #Delta#phi Ly[%d]", UseLYselectTrklt()?fLYselect:ily));
pr0->SetShowRange(-.45,.45);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
/*!dQdl*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltQ%d", mc?"MC":"", ily), Form("Tracklets :: dQdl Ly[%d]", ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkltQ%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Tracklets :: dQdl Ly[%d]", UseLYselectTrklt()?fLYselect:ily));
pr0->SetShowRange(1.,2.3);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++);
- pr0->fH->SetName(Form("H%sTrkltQS%d", mc?"MC":"", ily));
+ pr0->H()->SetName(Form("H%sTrkltQS%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily));
pr0->SetShowRange(2.4,5.1);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
}
/*!TB occupancy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltTB%d", mc?"MC":"", ily), Form("Tracklets :: OccupancyTB Ly[%d]", ily));
- if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
- }
+// if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily, 0)))){
+// pr0->H()->SetNameTitle(Form("H%sTrkltTB%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Tracklets :: OccupancyTB Ly[%d]", UseLYselectTrklt()?fLYselect:ily));
+// if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
+// }
/*! Row Cross processing*/
for(Int_t icen(0); icen<nCen; icen++){
/*!RC dz*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, icen)))){
- for(Int_t ipt(0); ipt<kNpt; ipt++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[ipt], ily, icen)))) continue;
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], UseLYselectTrklt()?fLYselect:ily, icen)))){
+ for(Int_t ipt(0); ipt<nPt; ipt++){
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[ipt], UseLYselectTrklt()?fLYselect:ily, icen)))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sTrkltRCZ%d%d", mc?"MC":"", ily, icen), Form("Tracklets[RC]:: #Deltaz Ly[%d] Cen[%s]", ily, cenName[icen]));
+ pr0->H()->SetNameTitle(Form("H%sTrkltRCZ%d%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily, icen), Form("Tracklets[RC]:: #Deltaz Ly[%d] Cen[%s]", UseLYselectTrklt()?fLYselect:ily, cenName[icen]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, 0)))) (*pr1)+=(*pr0);
+ if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], UseLYselectTrklt()?fLYselect:ily, 0)))) (*pr1)+=(*pr0);
}
} // end centrality integration for row cross
/*!RC dz*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkltRCZ%d", mc?"MC":"", ily), Form("Tracklets[RC] :: #Deltaz Ly[%d]", ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], UseLYselectTrklt()?fLYselect:ily, 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkltRCZ%d", mc?"MC":"", UseLYselectTrklt()?fLYselect:ily), Form("Tracklets[RC] :: #Deltaz Ly[%d]", UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
} // end layer loop
- AliInfo(Form("Done %3d 2D projections.", jh));
+ AliInfo(Form("Done %3d 2D %s projections.", jh, mc?"MC":""));
+
+// clean local memory allocation
+ for(Int_t i(fgNPt+2);i--;) if(ptCut[i]) delete [] ptCut[i];
return kTRUE;
}
//________________________________________________________
-Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
+Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc, Bool_t v0)
{
// Analyse track in
const Int_t kNcontours(9);
const Int_t kNstat(30);
- Int_t cidx=mc?kMCtrackIn:kTrackIn;
- if(fProj && fProj->At(cidx)) return kTRUE;
+ Int_t cidx=mc?kMCtrackIn:(v0?(kV0TrackIn-1):kTrackIn);
+ if(fProj && fProj->At(cidx)){
+ AliInfo(Form("Nothing to do for container %s.", ((TObjArray*)fProj->At(cidx))->GetName() ));
+ return kTRUE;
+ }
if(!fContainer){
AliError("Missing data container.");
return kFALSE;
}
- const Char_t *projName[] = {"hTracklet2TRDin", "hTRDin2MC"};
+ const Char_t *projName[] = {"hTracklet2TRDin", "hTRDin2MC", "hTracklet2TRDinV0"};
THnSparse *H(NULL);
if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){
AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)]));
- return kFALSE;
+ return kTRUE;
}
+ const Char_t *prefix = mc?"MC":(v0?"V0":"");
const Int_t mdim(kNdim+3);
Int_t coord[mdim]; memset(coord, 0, sizeof(Int_t) * mdim); Double_t v = 0.;
Int_t ndim(H->GetNdimensions());
- TAxis *aa[mdim], *as(NULL), *ap(NULL), *ax(NULL), *abf(NULL); memset(aa, 0, sizeof(TAxis*) * (mdim));
+ TAxis *aa[mdim], *as(NULL), *ap(NULL), *apt(NULL), *ax(NULL), *abf(NULL); memset(aa, 0, sizeof(TAxis*) * (mdim));
for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id);
if(ndim > Int_t(kSpeciesChgRC)) as = H->GetAxis(kSpeciesChgRC);
- if(ndim > Int_t(kPt)) ap = H->GetAxis(kPt);
+ if(ndim > Int_t(kPt)) apt = H->GetAxis(kPt);
+ if(ndim > Int_t(kNdim)) ap = H->GetAxis(kNdim);
if(ndim > Int_t(kNdim)+1) ax = H->GetAxis(kNdim+1);
if(ndim > Int_t(kNdim)+2) abf = H->GetAxis(kNdim+2);
//AliInfo(Form("Using : Species[%c] Pt[%c] BunchFill[%c]", as?'y':'n', ap?'y':'n', abf?'y':'n'));
- const Int_t nPt(ndim>Int_t(kNdimTrkIn)?Int_t(kNpt):1);
+ const Int_t nPt(apt?(apt->GetNbins()+2):1);
// build list of projections
- const Int_t nsel(kNpt*(AliPID::kSPECIES*kNcharge + 1));
+ const Int_t nsel((fgNPt+2)*(kNspc*kNcharge + 1) + kNspc*kNcharge);
+ const Int_t nprj((fgNPt+2)*(kNspc*kNcharge + 1)*4 + kNspc*kNcharge);
const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'};
- const Char_t ptName[kNpt] = {'l', 'i', 'h'};
- const Char_t *ptCut[kNpt] = {"p_{t}[GeV/c]<0.8", "0.8<=p_{t}[GeV/c]<1.5", "p_{t}[GeV/c]>=1.5"};
+ const Char_t *spcName[2][kNspc] = {{"e", "#mu#pi", "Kp"},
+ {"e", "#pi", "p"}};
+ const Char_t ptShortName[5] = {'L', 'l', 'i', 'h', 'H'};
+ Char_t ptName[fgNPt+2] = {0};
+ Char_t *ptCut[fgNPt+2] = {NULL};
+ Char_t *pCut[fgNPt+2] = {NULL};
// define rebinning strategy
- const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
- AliTRDresolutionProjection hp[kMCTrkInNproj]; TObjArray php(kMCTrkInNproj+2);
+ const Int_t nEtaPhi(5); Int_t rebinEtaPhiX[nEtaPhi] = {1, 3, 1, 3, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 2, 1, 2};
+ if(aa[1]->GetNbins()==180){ // old binning
+ rebinEtaPhiX[0] = 1; rebinEtaPhiY[0] = 2;
+ rebinEtaPhiX[1] = 2; rebinEtaPhiY[1] = 1;
+ rebinEtaPhiX[2] = 5; rebinEtaPhiY[2] = 1;
+ rebinEtaPhiX[3] = 1; rebinEtaPhiY[3] = 5;
+ rebinEtaPhiX[4] = 1; rebinEtaPhiY[4] = 1; // dummy
+ }
+ AliTRDrecoProjection hp[nprj]; TObjArray php(nprj+2);
Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t));
// define list of projections
for(Int_t ipt(0); ipt<nPt; ipt++){
- for(Int_t isp(0); isp<AliPID::kSPECIES; isp++){
+ ptName[ipt]= nPt>5?(64+ipt):ptShortName[ipt];
+ ptCut[ipt] = StrDup(Form("#it{%4.2f<=p_{t}^{%s}[GeV/c]<%4.2f}",ipt?fgPt[ipt-1]:0., mc?"MC":"", ipt>fgNPt?99.99:fgPt[ipt]));
+ pCut[ipt] = StrDup(Form("#it{%4.2f<=p^{%s}[GeV/c]<%4.2f}",ipt?fgPt[ipt-1]:0., mc?"MC":"", ipt>fgNPt?99.99:fgPt[ipt]));
+ for(Int_t isp(0); isp<kNspc; isp++){
for(Int_t ich(0); ich<kNcharge; ich++){
isel++; // new selection
- hp[ih].Build(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp),
- Form("TrackIn[%s%c]:: #Deltay{%s}", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt]),
+ AliDebug(3, Form("Building sel[%3d|%4d] spc[%s%c] pt[%s]", isel, ih, spcName[v0][isp], chSgn[ich], ptCut[ipt]));
+ hp[ih].Build(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[ipt], isp),
+ Form("TrackIn[%s%c]:: #Deltay{%s}", spcName[v0][isp], chSgn[ich], ptCut[ipt]),
kEta, kPhi, kYrez, aa);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
- hp[ih].Build(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp),
- Form("TrackIn[%s%c]:: #Delta#phi{%s}", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt]),
+ hp[ih].Build(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[ipt], isp),
+ Form("TrackIn[%s%c]:: #Delta#phi{%s}", spcName[v0][isp], chSgn[ich], ptCut[ipt]),
kEta, kPhi, kPrez, aa);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
- hp[ih].Build(Form("H%sTrkInQ%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp),
- Form("TrackIn[%s%c]:: dQdl {%s}", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt]),
+ hp[ih].Build(Form("H%sTrkInQ%c%c%d", prefix, chName[ich], ptName[ipt], isp),
+ Form("TrackIn[%s%c]:: dQdl {%s}", spcName[v0][isp], chSgn[ich], pCut[ipt]),
kEta, kPhi, kZrez, aa);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
if(!ax) continue;
- hp[ih].Build(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp),
- Form("TrackIn[%s%c]:: #Deltax{%s}", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt]),
+ hp[ih].Build(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[ipt], isp),
+ Form("TrackIn[%s%c]:: #Deltax{%s}", spcName[v0][isp], chSgn[ich], ptCut[ipt]),
kEta, kPhi, kNdim+1, aa);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
}
}
- isel++; // RC tracks
- hp[ih].Build(Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[ipt]),
+ isel++; // RC projections
+ AliDebug(3, Form("Building RCsel[%3d] pt[%s]", isel, ptCut[ipt]));
+ hp[ih].Build(Form("H%sTrkInRCZ%c", prefix, ptName[ipt]),
Form("TrackIn[RC]:: #Deltaz{%s}", ptCut[ipt]),
kEta, kPhi, kZrez, aa);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
- hp[ih].Build(Form("H%sTrkInRCY%c", mc?"MC":"", ptName[ipt]),
+ hp[ih].Build(Form("H%sTrkInRCY%c", prefix, ptName[ipt]),
Form("TrackIn[RC]:: #Deltay{%s}", ptCut[ipt]),
kEta, kPhi, kYrez, aa);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
- hp[ih].Build(Form("H%sTrkInRCPh%c", mc?"MC":"", ptName[ipt]),
+ hp[ih].Build(Form("H%sTrkInRCPh%c", prefix, ptName[ipt]),
Form("TrackIn[RC]:: #Delta#phi{%s}", ptCut[ipt]),
kEta, kPhi, kPrez, aa);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
if(!ax) continue;
- hp[ih].Build(Form("H%sTrkInRCX%c", mc?"MC":"", ptName[ipt]),
+ hp[ih].Build(Form("H%sTrkInRCX%c", prefix, ptName[ipt]),
Form("TrackIn[RC]:: #Deltax{%s}", ptCut[ipt]),
kEta, kPhi, kNdim+1, aa);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
}
- AliInfo(Form("Build %3d 3D projections.", ih));
+ // pt projections
+ for(Int_t isp(0); isp<kNspc; isp++){
+ for(Int_t ich(0); ich<kNcharge; ich++){
+ isel++; // new selection
+ AliDebug(3, Form("Building PTsel[%3d] spc[%s%c]", isel, spcName[v0][isp], chSgn[ich]));
+ hp[ih].Build(Form("H%sTrkInPt%c%d", prefix, chName[ich], isp),
+ Form("TrackIn[%s%c]:: P_{t}[GeV/c]", spcName[v0][isp], chSgn[ich]),
+ kEta, kPhi, kPt, aa);
+ hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
+ php.AddLast(&hp[ih++]); //np[isel]++;
+ }
+ }
+ AliInfo(Form("Build %3d 3D %s projections.", ih, prefix));
// fill projections
- Int_t ch(0), pt(0), sp(1), rcBin(as?as->FindBin(0.):-1), ioff(0);
- AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
+ Int_t ch(0), pt(0), p(0), sp(1), rcBin(as?as->FindBin(0.):-1), ioff(0), joff(0), jsel(0), ksel(0);
+ AliTRDrecoProjection *pr0(NULL), *pr1(NULL);
for (Long64_t ib(0); ib < H->GetNbins(); ib++) {
v = H->GetBinContent(ib, coord);
if(v<1.) continue;
if(fBCbinTOF>0 && coord[kBC]!=fBCbinTOF) continue; // TOF bunch cross cut
if(fBCbinFill>0 && abf && coord[kNdim+2]!=fBCbinTOF) continue; // Fill bunch cut
+ if(coord[kBC]==3) continue;
// charge selection
- ch = 0; sp=1;// [-] track
- if(rcBin>0){ // debug mode in which species are also saved
- sp = Int_t(TMath::Abs(as->GetBinCenter(coord[kSpeciesChgRC])))-1;
- if(sp>=AliPID::kSPECIES){
- AliDebug(2, Form("Wrong SpeciesIndex[%d]. Rescale", sp));
- sp = AliPID::kSPECIES-1;
+ ch = 0; sp=1;// [pi-] track
+ if(rcBin>0){
+ if(v0){ // V0 PID for dQdl
+ if(!coord[kBC]) continue;
+ sp = coord[kBC]-1;
+ } else {// TPC PID for statistics
+ sp = Int_t(TMath::Abs(as->GetBinCenter(coord[kSpeciesChgRC])))-1;
+ }
+
+ // take care of old data format (2*AliPID::kSPECIES+1)
+ if(as->GetNbins() == kNcharge*AliPID::kSPECIES+1){
+ if(sp>2) sp=2;
+ else if(sp==2) sp=1;
}
if(coord[kSpeciesChgRC] > rcBin) ch = 1; // [+] track
else if(coord[kSpeciesChgRC] == rcBin) ch = 2; // [RC] track
}
// pt selection
- pt = 0; // low pt
- if(ap) pt = TMath::Min(coord[kPt]-1, Int_t(kNpt)-1);
+ pt = 0; p = 0; // low pt
+ if(apt) pt = coord[kPt];//TMath::Min(coord[kPt], Int_t(kNpt)+1);
+ if(ap ) p = coord[kNdim];//TMath::Min(coord[kNdim], Int_t(kNpt)+1);
// global selection
- isel = pt*(AliPID::kSPECIES*kNcharge+1); isel+=sp<0?(AliPID::kSPECIES*kNcharge):(sp*kNcharge+ch);
- ioff = isel*(ax?4:3);
+ isel = pt*(kNspc*kNcharge+1); isel+=(ch==2?(kNspc*kNcharge):(sp*kNcharge+ch)); ioff = isel*(ax?4:3);
+ jsel = p *(kNspc*kNcharge+1); jsel+=(ch==2?(kNspc*kNcharge):(sp*kNcharge+ch)); joff = jsel*(ax?4:3);
+ ksel = ch==2?0:nPt*(kNspc*kNcharge+1); ksel *= (ax?4:3); ksel+=sp*kNcharge+ch;
if(ioff>=ih){
AliError(Form("Wrong selection %d [%3d]", ioff, ih));
return kFALSE;
}
- if(!(pr0=(AliTRDresolutionProjection*)php.At(ioff))) {
- AliError(Form("Missing projection %d", ioff));
+ if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) {
+ AliError(Form("Missing projection @ %d", ioff));
return kFALSE;
}
- if(sp>=0){
- if(strcmp(pr0->fH->GetName(), Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ch], ptName[pt], sp))!=0){
- AliError(Form("Projection mismatch :: request[H%sTrkInY%c%c%d] found[%s]", mc?"MC":"", chName[ch], ptName[pt], sp, pr0->fH->GetName()));
+ if(ch<2){
+ if(strcmp(pr0->H()->GetName(), Form("H%sTrkInY%c%c%d", prefix, chName[ch], ptName[pt], sp))!=0){
+ AliError(Form("Projection mismatch :: request[H%sTrkInY%c%c%d] found[%s]", prefix, chName[ch], ptName[pt], sp, pr0->H()->GetName()));
return kFALSE;
}
} else {
- if(strcmp(pr0->fH->GetName(), Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[pt]))!=0){
- AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c] found[%s]", mc?"MC":"", ptName[pt], pr0->fH->GetName()));
+ if(strcmp(pr0->H()->GetName(), Form("H%sTrkInRCZ%c", prefix, ptName[pt]))!=0){
+ AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c] found[%s]", prefix, ptName[pt], pr0->H()->GetName()));
return kFALSE;
}
}
- for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDresolutionProjection*)php.At(ioff+jh))->Increment(coord, v);
+ AliDebug(2, Form("Found %s for selection sp[%d] ch[%d] pt[%d]", pr0->H()->GetName(), sp, ch, pt));
+ for(Int_t jh(0); jh<np[isel]; jh++){
+ if(ch<2 && jh==2) ((AliTRDrecoProjection*)php.At(joff+jh))->Increment(coord, v); // special care for dQdl=f(p)
+ else ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v); // all = f(p_t)
+ }
+ if(ksel){
+ if(!(pr0 = (AliTRDrecoProjection*)php.At(ksel))){
+ AliError(Form("Missing P_t projection @ %d", ksel));
+ return kFALSE;
+ }
+ AliDebug(2, Form("Found %s for selection[%d] sp[%d] ch[%d]", pr0->H()->GetName(), ksel, sp, ch));
+ pr0->Increment(coord, v); // p_t spectra
+ }
+ }
+ if(HasDump3DFor(kTrackIn)){
+ TDirectory *cwd = gDirectory;
+ TFile::Open(Form("Dump%s_%s.root", GetName(), H->GetName()), "UPDATE");
+ for(Int_t ip(0); ip<php.GetEntriesFast(); ip++){
+ if(!(pr0 = (AliTRDrecoProjection*)php.At(ip))) continue;
+ if(!pr0->H()) continue;
+ TH3 *h3=(TH3*)pr0->H()->Clone();
+ h3->Write();
+ }
+ gFile->Close();
+ cwd->cd();
}
+
TObjArray *arr(NULL);
fProj->AddAt(arr = new TObjArray(mc?kMCTrkInNproj:kTrkInNproj), cidx);
+ arr->SetName(mc?projName[1]:(v0?projName[2]:projName[0])); arr->SetOwner();
TH2 *h2(NULL); Int_t jh(0);
for(; ih--; ){
- if(!hp[ih].fH) continue;
- if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours))) continue;
- arr->AddAt(h2, jh++);
+ if(!hp[ih].H()) continue;
+ if(strstr(hp[ih].H()->GetName(), "TrkInPt")){
+ for(Int_t ipt(0); ipt<nPt; ipt++) arr->AddAt(hp[ih].Projection2Dbin(ipt), jh++);
+ } else {
+ if((h2 = hp[ih].Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
+ }
}
// build combined performance plots
// combine up the tree of projections
- AliTRDresolutionProjection xlow[2], specY[kNcharge*AliPID::kSPECIES], specPh[kNcharge*AliPID::kSPECIES], specQ[kNcharge*AliPID::kSPECIES];
+ Double_t m(0.), s(0.), se(0.), trend(0.);
+ AliTRDrecoProjection xlow[2], specY[kNcharge*kNspc], specPh[kNcharge*kNspc], specQ[kNcharge*kNspc];
for(Int_t ich(0); ich<kNcharge; ich++){
// PID dependency - summation over pt
- for(Int_t isp(0); isp<AliPID::kSPECIES; isp++){
+ for(Int_t isp(0); isp<kNspc; isp++){
/*!dy*/
- Int_t idx(ich*AliPID::kSPECIES+isp);
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){
+ Int_t idx(ich*kNspc+isp);
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[0], isp)))){
specY[idx] = (*pr0);
- specY[idx].SetNameTitle(Form("H%sTrkInY%c%d", mc?"MC":"", chName[ich], isp), "Sum over pt");
- specY[idx].fH->SetNameTitle(Form("H%sTrkInY%c%d", mc?"MC":"", chName[ich], isp),
- Form("TrackIn[%s%c]:: #Deltay", AliPID::ParticleLatexName(isp), chSgn[ich]));
+ specY[idx].SetNameTitle(Form("H%sTrkInY%c%d", prefix, chName[ich], isp), "Sum over pt");
+ specY[idx].H()->SetNameTitle(Form("H%sTrkInY%c%d", prefix, chName[ich], isp),
+ Form("TrackIn[%s%c]:: #Deltay", spcName[v0][isp], chSgn[ich]));
+ if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkInY%c%c%d", prefix, chName[ich], ptName[0], isp), trend, m);
+ PutTrendValue(Form("%sTrkInYS%c%c%d", prefix, chName[ich], ptName[0], isp), s, se);
+ }
for(Int_t ipt(1); ipt<nPt; ipt++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue;
+ if((trend=pr1->GetTrendValue(1,&m,&s, &se))>-100.){
+ PutTrendValue(Form("%sTrkInY%c%c%d", prefix, chName[ich], ptName[ipt], isp), trend, m);
+ PutTrendValue(Form("%sTrkInYS%c%c%d", prefix, chName[ich], ptName[ipt], isp), s, se);
+ }
specY[idx]+=(*pr1);
}
php.AddLast(&specY[idx]);
if((h2 = specY[idx].Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++);
- if((h2 = (TH2*)gDirectory->Get(Form("%sEn", specY[idx].fH->GetName())))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specY[idx];
+ if((trend=specY[idx].GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkInY%c%d", prefix, chName[ich], isp), trend, m);
+ PutTrendValue(Form("%sTrkInYS%c%d", prefix, chName[ich], isp), s,se);
+ }
+ if((h2 = (TH2*)gDirectory->Get(Form("%sEn", specY[idx].H()->GetName())))) arr->AddAt(h2, jh++);
+ if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%d", prefix, chName[0], isp)))) (*pr1)+=specY[idx];
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[0], isp)))){
specPh[idx] = (*pr0);
- specPh[idx].SetNameTitle(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[ich], isp), "Sum over pt");
- specPh[idx].fH->SetNameTitle(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[ich], isp),
- Form("TrackIn[%s%c]:: #Delta#phi", AliPID::ParticleLatexName(isp), chSgn[ich]));
+ specPh[idx].SetNameTitle(Form("H%sTrkInPh%c%d", prefix, chName[ich], isp), "Sum over pt");
+ specPh[idx].H()->SetNameTitle(Form("H%sTrkInPh%c%d", prefix, chName[ich], isp),
+ Form("TrackIn[%s%c]:: #Delta#phi", spcName[v0][isp], chSgn[ich]));
specPh[idx].SetShowRange(-1.5, 1.5);
+ if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkInPh%c%c%d", prefix, chName[ich], ptName[0], isp), trend, m);
+ PutTrendValue(Form("%sTrkInPhS%c%c%d", prefix, chName[ich], ptName[0], isp), s, se);
+ }
for(Int_t ipt(1); ipt<nPt; ipt++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue;
+ if((trend=pr1->GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkInPh%c%c%d", prefix, chName[ich], ptName[ipt], isp), trend, m);
+ PutTrendValue(Form("%sTrkInPhS%c%c%d", prefix, chName[ich], ptName[ipt], isp), s, se);
+ }
specPh[idx]+=(*pr1);
}
php.AddLast(&specPh[idx]);
if((h2 = specPh[idx].Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specPh[idx];
+ if((trend=specPh[idx].GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkInPh%c%d", prefix, chName[ich], isp), trend, m);
+ PutTrendValue(Form("%sTrkInPhS%c%d", prefix, chName[ich], isp), s,se);
+ }
+ if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%d", prefix, chName[0], isp)))) (*pr1)+=specPh[idx];
}
/*!dQdl*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", prefix, chName[ich], ptName[0], isp)))){
specQ[idx] = (*pr0);
- specQ[idx].SetNameTitle(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[ich], isp), "Sum over pt");
- specQ[idx].fH->SetNameTitle(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[ich], isp),
- Form("TrackIn[%s%c]:: dQdl", AliPID::ParticleLatexName(isp), chSgn[ich]));
+ specQ[idx].SetNameTitle(Form("H%sTrkInQ%c%d", prefix, chName[ich], isp), "Sum over p");
+ specQ[idx].H()->SetNameTitle(Form("H%sTrkInQ%c%d", prefix, chName[ich], isp),
+ Form("TrackIn[%s%c]:: dQdl", spcName[v0][isp], chSgn[ich]));
specQ[idx].SetShowRange(-2.2, -1.75);
- specQ[idx].fH->GetZaxis()->SetTitle("dQdl [a.u.]");
+ specQ[idx].H()->GetZaxis()->SetTitle("dQdl [a.u.]");
+ if((trend = pr0->GetTrendValue(2, &m))>-100.) PutTrendValue(Form("%sTrkInQ%c%c%d", prefix, chName[ich], ptName[0], isp), trend, m);
+ if((trend = pr0->GetTrendValue(0, &m))>-100.) PutTrendValue(Form("%sTrkInQS%c%c%d", prefix, chName[ich], ptName[0], isp), trend, m);
for(Int_t ipt(1); ipt<nPt; ipt++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue;
+ if((trend=pr1->GetTrendValue(2, &m))>-100.) PutTrendValue(Form("%sTrkInQ%c%c%d", prefix, chName[ich], ptName[ipt], isp), trend, m);
+ if((trend=pr1->GetTrendValue(0, &m))>-100.) PutTrendValue(Form("%sTrkInQS%c%c%d", prefix, chName[ich], ptName[ipt], isp), trend, m);
specQ[idx]+=(*pr1);
}
php.AddLast(&specQ[idx]);
if((h2 = specQ[idx].Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++);
- specQ[idx].fH->SetName(Form("H%sTrkInQS%c%d", mc?"MC":"", chName[ich], isp));
- specQ[idx].SetShowRange(-1.75, -1.25);
+ specQ[idx].H()->SetName(Form("H%sTrkInQS%c%d", prefix, chName[ich], isp));
+ specQ[idx].SetShowRange(-1.85, -1.4);
if((h2 = specQ[idx].Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specQ[idx];
+ if((trend=specQ[idx].GetTrendValue(2, &m))>-100.) PutTrendValue(Form("%sTrkInQ%c%d", prefix, chName[ich], isp), trend, m);
+ if((trend=specQ[idx].GetTrendValue(0, &m))>-100.) PutTrendValue(Form("%sTrkInQS%c%d", prefix, chName[ich], isp), trend, m);
+ if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%d", prefix, chName[0], isp)))) (*pr1)+=specQ[idx];
}
} // end PID loop for pt integration
// pt dependency - summation over PID
for(Int_t ipt(0); ipt<nPt; ipt++){
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){
- for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[ipt], 0)))){
+ for(Int_t isp(1); isp<kNspc; isp++){
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sTrkInY%c%c", mc?"MC":"", chName[ich], ptName[ipt]),
+ pr0->H()->SetNameTitle(Form("H%sTrkInY%c%c", prefix, chName[ich], ptName[ipt]),
Form("TrackIn[%c]:: #Deltay{%s}", chSgn[ich], ptCut[ipt]));
pr0->SetShowRange(-0.3, 0.3);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
+ if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkInY%c%c", prefix, chName[ich], ptName[ipt]), trend, m);
+ PutTrendValue(Form("%sTrkInYS%c%c", prefix, chName[ich], ptName[ipt]), s, se);
+ }
+ if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){
- for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[ipt], 0)))){
+ for(Int_t isp(1); isp<kNspc; isp++){
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sTrkInPh%c%c", mc?"MC":"", chName[ich], ptName[ipt]),
+ pr0->H()->SetNameTitle(Form("H%sTrkInPh%c%c", prefix, chName[ich], ptName[ipt]),
Form("TrackIn[%c]:: #Delta#phi{%s}", chSgn[ich], ptCut[ipt]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
+ if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkInPh%c%c", prefix, chName[ich], ptName[ipt]), trend, m);
+ PutTrendValue(Form("%sTrkInPhS%c%c", prefix, chName[ich], ptName[ipt]), s, se);
+ }
+ if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
}
/*!dx*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){
- for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[ipt], 0)))){
+ for(Int_t isp(1); isp<kNspc; isp++){
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[ipt], isp)))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sTrkInX%c%c", mc?"MC":"", chName[ich], ptName[ipt]),
+ pr0->H()->SetNameTitle(Form("H%sTrkInX%c%c", prefix, chName[ich], ptName[ipt]),
Form("TrackIn[%c]:: #Deltax{%s}", chSgn[ich], ptCut[ipt]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
+ PutTrendValue(Form("%sTrkInX%c%c", prefix, chName[ich], ptName[ipt]), pr0->GetTrendValue(1));
if(!ipt){
xlow[ich] = (*pr0);
- xlow[ich].SetNameTitle(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 5),
+ xlow[ich].SetNameTitle(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[0], 5),
Form("TrackIn[%c]:: #Deltax{%s}", chSgn[ich], ptCut[0]));
php.AddLast(&xlow[ich]);
}
- if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
+ if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
}
} // end pt loop for PID integration
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkInY%c", mc?"MC":"", chName[ich]),
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[0], 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkInY%c", prefix, chName[ich]),
Form("TrackIn[%c]:: #Deltay", chSgn[ich]));
pr0->SetShowRange(-0.3, 0.3);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++);
- if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->fH->GetName())))) arr->AddAt(h2, jh++);
- if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
+ if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++);
+ if((trend=pr0->GetTrendValue(1, &m, &s, &se))>-100.){
+ PutTrendValue(Form("%sTrkInY%c", prefix, chName[ich]), trend, m);
+ PutTrendValue(Form("%sTrkInYS%c", prefix, chName[ich]), s, se);
+ }
+ if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
}
/*!dy high pt*/
- if(ich && (pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[2], 0)))){
- if((pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[2], 0)))){
+ if(ich && (pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[0], ptName[3], 0)))){
+ if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[ich], ptName[3], 0)))){
(*pr0)+=(*pr1);
- pr0->fH->SetNameTitle(Form("H%sTrkInY%c", mc?"MC":"", ptName[2]), Form("TrackIn :: #Deltay{%s}", ptCut[2]));
+ pr0->H()->SetNameTitle(Form("H%sTrkInY%c", prefix, ptName[3]), Form("TrackIn :: #Deltay{%s}", ptCut[3]));
pr0->SetShowRange(-0.3, 0.3);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkInPh%c", mc?"MC":"", chName[ich]),
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[ich], ptName[0], 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkInPh%c", prefix, chName[ich]),
Form("TrackIn[%c]:: #Delta#phi", chSgn[ich]));
pr0->SetShowRange(-1., 1.);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ich==1 && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
+ if((trend=pr0->GetTrendValue(1, &m, &s, &se))>-100.){
+ PutTrendValue(Form("%sTrkInPh%c", prefix, chName[ich]), trend, m);
+ PutTrendValue(Form("%sTrkInPhS%c", prefix, chName[ich]), s, se);
+ }
+ if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
}
/*!dx*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkInX%c", mc?"MC":"", chName[ich]),
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[0], 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkInX%c", prefix, chName[ich]),
Form("TrackIn[%c]:: #Deltax", chSgn[ich]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ich==1 && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
+ PutTrendValue(Form("%sTrkInX%c", prefix, chName[ich]), pr0->GetTrendValue(1));
+ if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
}
/*!dx low pt*/
- if(ich && (pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[0], 5)))){
- if((pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 5)))){
+ if(ich && (pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[0], ptName[1], 5)))){
+ if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[ich], ptName[1], 5)))){
(*pr0)+=(*pr1);
- pr0->fH->SetNameTitle(Form("H%sTrkInX%c", mc?"MC":"", ptName[0]), Form("TrackIn :: #Deltax{%s}", ptCut[0]));
+ pr0->H()->SetNameTitle(Form("H%sTrkInX%c", prefix, ptName[1]), Form("TrackIn :: #Deltax{%s}", ptCut[1]));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
}
} // end charge loop
- for(Int_t isp(0); isp<AliPID::kSPECIES; isp++){
+ for(Int_t isp(0); isp<kNspc; isp++){
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%d", mc?"MC":"", chName[0], isp)))){
- pr0->fH->SetNameTitle(Form("H%sTrkInY%d", mc?"MC":"", isp), Form("TrackIn[%s] :: #Deltay", AliPID::ParticleLatexName(isp)));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%d", prefix, chName[0], isp)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkInY%d", prefix, isp), Form("TrackIn[%s] :: #Deltay", spcName[v0][isp]));
pr0->SetShowRange(-0.3, 0.3);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++);
- if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->fH->GetName())))) arr->AddAt(h2, jh++);
+ PutTrendValue(Form("%sTrkInY%d", prefix, isp), pr0->GetTrendValue(1));
+ if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++);
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[0], isp)))){
- pr0->fH->SetNameTitle(Form("H%sTrkInPh%d", mc?"MC":"", isp), Form("TrackIn[%s] :: #Delta#phi", AliPID::ParticleLatexName(isp)));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%d", prefix, chName[0], isp)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkInPh%d", prefix, isp), Form("TrackIn[%s] :: #Delta#phi", spcName[v0][isp]));
pr0->SetShowRange(-1., 1.);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
+ PutTrendValue(Form("%sTrkInPh%d", prefix, isp), pr0->GetTrendValue(1));
}
/*!dQdl*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[0], isp)))){
- pr0->fH->SetNameTitle(Form("H%sTrkInQ%d", mc?"MC":"", isp), Form("TrackIn[%s] :: dQdl", AliPID::ParticleLatexName(isp)));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%d", prefix, chName[0], isp)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkInQ%d", prefix, isp), Form("TrackIn[%s] :: dQdl", spcName[v0][isp]));
pr0->SetShowRange(-2.2, -1.75);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++);
- pr0->fH->SetName(Form("H%sTrkInQS%d", mc?"MC":"", isp));
- pr0->SetShowRange(-1.7, -1.25);
+ pr0->H()->SetName(Form("H%sTrkInQS%d", prefix, isp));
+ pr0->SetShowRange(-1.85, -1.4);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
+ if((trend=pr0->GetTrendValue(2, &m))>-100.) PutTrendValue(Form("%sTrkInQ%d", prefix, isp), trend, m);
+ if((trend=pr0->GetTrendValue(0, &m))>-100.) PutTrendValue(Form("%sTrkInQS%d", prefix, isp), trend, m);
}
} // end PID processing
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkInY", mc?"MC":""), "TrackIn :: #Deltay");
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", prefix, chName[0], ptName[0], 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkInY", prefix), "TrackIn :: #Deltay");
pr0->SetShowRange(-0.3, 0.3);
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++);
- if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->fH->GetName())))) arr->AddAt(h2, jh++);
+ if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++);
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkInPh", mc?"MC":""), "TrackIn :: #Delta#phi");
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", prefix, chName[0], ptName[0], 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkInPh", prefix), "TrackIn :: #Delta#phi");
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
/*!dx*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){
- pr0->fH->SetNameTitle(Form("H%sTrkInX", mc?"MC":""), "TrackIn :: #Deltax");
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", prefix, chName[0], ptName[0], 0)))){
+ pr0->H()->SetNameTitle(Form("H%sTrkInX", prefix), "TrackIn :: #Deltax");
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
// Row Cross processing
/*!RC dz*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[0])))){
- for(Int_t ipt(0); ipt<kNpt; ipt++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[ipt])))) continue;
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCZ%c", prefix, ptName[0])))){
+ for(Int_t ipt(0); ipt<nPt; ipt++){
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCZ%c", prefix, ptName[ipt])))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sTrkInRCZ", mc?"MC":""), "TrackIn[RC]:: #Deltaz");
+ pr0->H()->SetNameTitle(Form("H%sTrkInRCZ", prefix), "TrackIn[RC]:: #Deltaz");
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
+ if((trend=pr0->GetTrendValue(1,&m,&s,&se))>-100.){
+ PutTrendValue(Form("%sTrkInRCZ", prefix), trend, m);
+ PutTrendValue(Form("%sTrkInRCZS", prefix), s, se);
+ }
}
/*!RC dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCY%c", mc?"MC":"", ptName[0])))){
- for(Int_t ipt(0); ipt<kNpt; ipt++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCY%c", mc?"MC":"", ptName[ipt])))) continue;
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCY%c", prefix, ptName[0])))){
+ for(Int_t ipt(0); ipt<nPt; ipt++){
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCY%c", prefix, ptName[ipt])))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sTrkInRCY", mc?"MC":""), "TrackIn[RC]:: #Deltay");
+ pr0->H()->SetNameTitle(Form("H%sTrkInRCY", prefix), "TrackIn[RC]:: #Deltay");
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
/*!RC dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCPh%c", mc?"MC":"", ptName[0])))){
- for(Int_t ipt(0); ipt<kNpt; ipt++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCPh%c", mc?"MC":"", ptName[ipt])))) continue;
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCPh%c", prefix, ptName[0])))){
+ for(Int_t ipt(0); ipt<nPt; ipt++){
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCPh%c", prefix, ptName[ipt])))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sTrkInRCPh", mc?"MC":""), "TrackIn[RC]:: #Delta#phi");
+ pr0->H()->SetNameTitle(Form("H%sTrkInRCPh", prefix), "TrackIn[RC]:: #Delta#phi");
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
/*!RC dx*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCX%c", mc?"MC":"", ptName[0])))){
- for(Int_t ipt(0); ipt<kNpt; ipt++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCX%c", mc?"MC":"", ptName[ipt])))) continue;
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCX%c", prefix, ptName[0])))){
+ for(Int_t ipt(0); ipt<nPt; ipt++){
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCX%c", prefix, ptName[ipt])))) continue;
(*pr0)+=(*pr1);
}
- pr0->fH->SetNameTitle(Form("H%sTrkInRCX", mc?"MC":""), "TrackIn[RC]:: #Deltax");
+ pr0->H()->SetNameTitle(Form("H%sTrkInRCX", prefix), "TrackIn[RC]:: #Deltax");
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
- AliInfo(Form("Done %3d 2D projections.", jh));
+
+ // P_t processing
+ for(Int_t isp(0); isp<kNspc; isp++){
+ for(Int_t ich(0); ich<kNcharge; ich++){
+ TH2 *h2pt[26]={NULL}, *h2s(NULL);
+ for(Int_t ipt(0); ipt<nPt; ipt++){
+ if(!(h2pt[ipt] = (TH2*)arr->FindObject(Form("H%sTrkInPt%c%d%d_2D", prefix, chName[ich], isp, ipt)))){
+ AliWarning(Form("Missing \"H%sTrkInPt%c%d%d_2D\"", prefix, chName[ich], isp, ipt));
+ continue;
+ }
+ if(!h2s) h2s = (TH2F*)h2pt[ipt]->Clone("h2s");
+ else h2s->Add(h2pt[ipt]);
+ }
+ if(!h2s) continue;
+ Int_t irebin(0), dxBin(1), dyBin(1);
+ while(irebin<nEtaPhi && (AliTRDrecoTask::GetMeanStat(h2s, .5, 1)<200)){
+ h2s->Rebin2D(rebinEtaPhiX[irebin], rebinEtaPhiY[irebin]);
+ dxBin*=rebinEtaPhiX[irebin];dyBin*=rebinEtaPhiY[irebin];irebin++;
+ }
+ AliDebug(2, Form("Rebin level[%d] @ chg[%d] spc[%d]. Binning[%2dx%2d]", irebin, ich, isp, h2s->GetNbinsX(), h2s->GetNbinsY()));
+ Int_t nx(h2s->GetNbinsX()), ny(h2s->GetNbinsY());
+ for(Int_t ipt(0); ipt<nPt; ipt++) h2pt[ipt]->Rebin2D(dxBin, dyBin);
+ delete h2s;
+
+ h2 = new TH2F(Form("H%sTrkInPt%c%d_2D", prefix, chName[ich], isp),
+ Form("TrackIn[%s%c]:: <P_{t}>[GeV/c];%s;%s", spcName[v0][isp], chSgn[ich], aa[2]->GetTitle(), aa[1]->GetTitle()),
+ nx, aa[2]->GetXmin(), aa[2]->GetXmax(),
+ ny, aa[1]->GetXmin(), aa[1]->GetXmax());
+ arr->AddAt(h2, jh++);
+ for(Int_t ix(1); ix<=nx; ix++){ // eta
+ for(Int_t iy(1); iy<=ny; iy++){ // phi
+ Float_t w[26]={0.}, sw(0.);
+ for(Int_t ipt(0); ipt<nPt; ipt++){
+ if(!h2pt[ipt]) continue;
+ w[ipt] = h2pt[ipt]->GetBinContent(ix, iy);
+ sw += w[ipt];
+ }
+ if(sw<=0.) h2->SetBinContent(ix, iy, 0.);
+ else{
+ Float_t ptm(0.);
+ for(Int_t ipt(0); ipt<nPt; ipt++){
+ w[ipt]/=sw;
+ ptm += w[ipt]*fgPt[ipt?ipt-1:0];
+ }
+ h2->SetBinContent(ix, iy, ptm);
+ }
+ }
+ }
+ PutTrendValue(Form("%sTrkInPt%c%d", prefix, chName[ich], isp), GetMeanStat(h2, 0.01, 1));
+ }
+ }
+ AliInfo(Form("Done %3d 2D %s projections.", jh, prefix));
+
+// clean local memory allocation
+ for(Int_t i(fgNPt+2);i--;){
+ if(ptCut[i]) delete [] ptCut[i];
+ if(pCut[i]) delete [] pCut[i];
+ }
return kTRUE;
}
THnSparse *H(NULL);
if(!(H = (THnSparse*)fContainer->FindObject("hTRD2MC"))){
AliError("Missing/Wrong data @ hTRD2MC.");
- return kFALSE;
+ return kTRUE;
}
Int_t ndim(H->GetNdimensions());
Int_t coord[kNdim+1]; memset(coord, 0, sizeof(Int_t) * (kNdim+1)); Double_t v = 0.;
for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id);
if(ndim > kSpeciesChgRC) as = H->GetAxis(kSpeciesChgRC);
if(ndim > kPt) ap = H->GetAxis(kPt);
+ const Int_t nPt(ap?(ap->GetNbins()+2):1);
// build list of projections
- const Int_t nsel(AliTRDgeometry::kNlayer*kNpt*AliPID::kSPECIES*7);//, npsel(3);
+ const Int_t nsel(AliTRDgeometry::kNlayer*fgNPt*AliPID::kSPECIES*7);//, npsel(3);
const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'};
- const Char_t ptName[kNpt] = {'l', 'i', 'h'};
- const Char_t *ptCut[kNpt] = {"p_{t}[GeV/c]<0.8", "0.8<=p_{t}[GeV/c]<1.5", "p_{t}[GeV/c]>=1.5"};
+ const Char_t ptShortName[5] = {'L', 'l', 'i', 'h', 'H'};
+ Char_t ptName[fgNPt+2] = {0};
+ Char_t *ptCut[fgNPt+2] = {NULL};
// define rebinning strategy
- const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
- AliTRDresolutionProjection hp[kTrkNproj]; TObjArray php(kTrkNproj);
+ const Int_t nEtaPhi(5); Int_t rebinEtaPhiX[nEtaPhi] = {1, 3, 1, 3, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 2, 1, 2};
+ if(aa[1]->GetNbins()==180){ // old binning
+ rebinEtaPhiX[0] = 1; rebinEtaPhiY[0] = 2;
+ rebinEtaPhiX[1] = 2; rebinEtaPhiY[1] = 1;
+ rebinEtaPhiX[2] = 5; rebinEtaPhiY[2] = 1;
+ rebinEtaPhiX[3] = 1; rebinEtaPhiY[3] = 5;
+ rebinEtaPhiX[4] = 1; rebinEtaPhiY[4] = 1; // dummy
+ }
+ AliTRDrecoProjection hp[kTrkNproj]; TObjArray php(kTrkNproj);
Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t));
for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
- for(Int_t ipt(0); ipt<kNpt; ipt++){
+ for(Int_t ipt(0); ipt<nPt; ipt++){
+ if(!ptName[ipt]){
+ ptName[ipt]= nPt>5?(64+ipt):ptShortName[ipt];
+ ptCut[ipt] = StrDup(Form("#it{%4.2f<=p_{t}^{MC}[GeV/c]<%4.2f}",ipt?fgPt[ipt-1]:0., ipt>fgNPt?99.99:fgPt[ipt]));
+ }
for(Int_t isp(0); isp<AliPID::kSPECIES; isp++){
for(Int_t ich(0); ich<kNcharge; ich++){
isel++; // new selection
- hp[ih].Build(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], isp, ily),
- Form("Tracks[%s%c]:: #Deltay{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily),
+ hp[ih].Build(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracks[%s%c]:: #Deltay{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily),
kEta, kPhi, kYrez, aa);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
- hp[ih].Build(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], isp, ily),
- Form("Tracks[%s%c]:: #Delta#phi{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily),
+ hp[ih].Build(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracks[%s%c]:: #Delta#phi{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily),
kEta, kPhi, kPrez, aa);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
- hp[ih].Build(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], isp, ily),
- Form("Tracks[%s%c]:: #Deltap_{t}/p_{t}{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily),
+ hp[ih].Build(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracks[%s%c]:: #Deltap_{t}/p_{t}{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily),
kEta, kPhi, kNdim, aa);
hp[ih].SetShowRange(0.,10.);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
}
}
isel++; // new selection
- hp[ih].Build(Form("HMCTrkZ%c%d", ptName[ipt], ily),
- Form("Tracks[RC]:: #Deltaz{%s} Ly[%d]", ptCut[ipt], ily),
+ hp[ih].Build(Form("HMCTrkZ%c%d", ptName[ipt], UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracks[RC]:: #Deltaz{%s} Ly[%d]", ptCut[ipt], UseLYselectTrklt()?fLYselect:ily),
kEta, kPhi, kZrez, aa);
hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
php.AddLast(&hp[ih++]); np[isel]++;
}
}
+ AliInfo(Form("Build %3d 3D projections.", ih));
Int_t ly(0), ch(0), pt(0), sp(2), rcBin(as?as->FindBin(0.):-1);
for (Long64_t ib(0); ib < H->GetNbins(); ib++) {
v = H->GetBinContent(ib, coord);
if(v<1.) continue;
ly = coord[kBC]-1; // layer selection
+ if(ly<0) ly=0; // fix for bug in PlotMC
// charge selection
ch=0; sp=2;// [pi-] track [dafault]
if(rcBin>0){ // debug mode in which species are also saved
pt = 0; // low pt [default]
if(ap) pt = coord[kPt]-1;
// global selection
- Int_t ioff = ly*kNpt*31+pt*31; ioff+=3*(sp<0?10:(sp*kNcharge+ch));
- isel = ly*kNpt*11+pt*11; isel+=sp<0?10:(sp*kNcharge+ch);
+ Int_t ioff = ly*nPt*31+pt*31; ioff+=3*(sp<0?10:(sp*kNcharge+ch));
+ isel = ly*nPt*11+pt*11; isel+=sp<0?10:(sp*kNcharge+ch);
AliDebug(4, Form("SELECTION[%d] :: ch[%c] pt[%c] sp[%d] ly[%d]\n", np[isel], ch==2?'Z':chName[ch], ptName[pt], sp, ly));
- for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDresolutionProjection*)php.At(ioff+jh))->Increment(coord, v);
+ for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v);
}
TObjArray *arr(NULL);
fProj->AddAt(arr = new TObjArray(kTrkNproj), cidx);
+ arr->SetName("hTRD2MC"); arr->SetOwner();
TH2 *h2(NULL); Int_t jh(0);
for(; ih--; ){
- if(!hp[ih].fH) continue;
+ if(!hp[ih].H()) continue;
if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours))) continue;
arr->AddAt(h2, jh++);
}
// combine up the tree of projections
- AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
+ AliTRDrecoProjection *pr0(NULL), *pr1(NULL);
//Int_t iproj(0), jproj(0);
for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
for(Int_t ich(0); ich<kNcharge; ich++){
- for(Int_t ipt(0); ipt<kNpt; ipt++){
+ for(Int_t ipt(0); ipt<nPt; ipt++){
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily)))){
for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily)))) continue;
(*pr0)+=(*pr1);
}
- AliDebug(2, Form("Rename %s to HMCTrkY%c%c%d", pr0->fH->GetName(), chName[ich], ptName[ipt], ily));
- pr0->fH->SetNameTitle(Form("HMCTrkY%c%c%d", chName[ich], ptName[ipt], ily),
- Form("Tracks[%c]:: #Deltay{%s} Ly[%d]", chSgn[ich], ptCut[ipt], ily));
+ AliDebug(2, Form("Rename %s to HMCTrkY%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily));
+ pr0->H()->SetNameTitle(Form("HMCTrkY%c%c%d", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracks[%c]:: #Deltay{%s} Ly[%d]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+ if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0);
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily)))){
for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily)))) continue;
(*pr0)+=(*pr1);
}
- AliDebug(2, Form("Rename %s to HMCTrkPh%c%c%d", pr0->fH->GetName(), chName[ich], ptName[ipt], ily));
- pr0->fH->SetNameTitle(Form("HMCTrkPh%c%c%d", chName[ich], ptName[ipt], ily),
- Form("Tracks[%c]:: #Delta#phi{%s} Ly[%d]", chSgn[ich], ptCut[ipt], ily));
+ AliDebug(2, Form("Rename %s to HMCTrkPh%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily));
+ pr0->H()->SetNameTitle(Form("HMCTrkPh%c%c%d", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracks[%c]:: #Delta#phi{%s} Ly[%d]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+ if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0);
}
/*!dpt/pt*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], 0, UseLYselectTrklt()?fLYselect:ily)))){
for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
- if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue;
+ if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], isp, UseLYselectTrklt()?fLYselect:ily)))) continue;
(*pr0)+=(*pr1);
}
- AliDebug(2, Form("Rename %s to HMCTrkDPt%c%c%d", pr0->fH->GetName(), chName[ich], ptName[ipt], ily));
- pr0->fH->SetNameTitle(Form("HMCTrkDPt%c%c%d", chName[ich], ptName[ipt], ily),
- Form("Tracks[%c]:: #Deltap_{t}/p_{t}{%s} Ly[%d]", chSgn[ich], ptCut[ipt], ily));
+ AliDebug(2, Form("Rename %s to HMCTrkDPt%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily));
+ pr0->H()->SetNameTitle(Form("HMCTrkDPt%c%c%d", chName[ich], ptName[ipt], UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracks[%c]:: #Deltap_{t}/p_{t}{%s} Ly[%d]", chSgn[ich], ptCut[ipt], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+ if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0);
}
}
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, ily)))){
- pr0->fH->SetNameTitle(Form("HMCTrkY%c%d", chName[ich], ily),
- Form("Tracks[%c]:: #Deltay Ly[%d]", chSgn[ich], ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){
+ pr0->H()->SetNameTitle(Form("HMCTrkY%c%d", chName[ich], UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracks[%c]:: #Deltay Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ich==1 && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+ if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0);
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, ily)))){
- pr0->fH->SetNameTitle(Form("HMCTrkPh%c%d", chName[ich], ily),
- Form("Tracks[%c]:: #Delta#phi Ly[%d]", chSgn[ich], ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){
+ pr0->H()->SetNameTitle(Form("HMCTrkPh%c%d", chName[ich], UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracks[%c]:: #Delta#phi Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ich==1 && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+ if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0);
}
/*!dpt/pt*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, ily)))){
- pr0->fH->SetNameTitle(Form("HMCTrkDPt%c%d", chName[ich], ily),
- Form("Tracks[%c]:: #Deltap_{t}/p_{t} Ly[%d]", chSgn[ich], ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){
+ pr0->H()->SetNameTitle(Form("HMCTrkDPt%c%d", chName[ich], UseLYselectTrklt()?fLYselect:ily),
+ Form("Tracks[%c]:: #Deltap_{t}/p_{t} Ly[%d]", chSgn[ich], UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
- if(ich==1 && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+ if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))) (*pr1)+=(*pr0);
}
}
/*!dy*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, ily)))){
- pr0->fH->SetNameTitle(Form("HMCTrkY%d", ily), Form("Tracks :: #Deltay Ly[%d]", ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){
+ pr0->H()->SetNameTitle(Form("HMCTrkY%d", UseLYselectTrklt()?fLYselect:ily), Form("Tracks :: #Deltay Ly[%d]", UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
/*!dphi*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, ily)))){
- pr0->fH->SetNameTitle(Form("HMCTrkPh%d", ily), Form("Tracks :: #Delta#phi Ly[%d]", ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){
+ pr0->H()->SetNameTitle(Form("HMCTrkPh%d", UseLYselectTrklt()?fLYselect:ily), Form("Tracks :: #Delta#phi Ly[%d]", UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
/*!dpt/pt*/
- if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, ily)))){
- pr0->fH->SetNameTitle(Form("HMCTrkDPt%d", ily), Form("Tracks :: #Deltap_{t}/p_{t} Ly[%d]", ily));
+ if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, UseLYselectTrklt()?fLYselect:ily)))){
+ pr0->H()->SetNameTitle(Form("HMCTrkDPt%d", UseLYselectTrklt()?fLYselect:ily), Form("Tracks :: #Deltap_{t}/p_{t} Ly[%d]", UseLYselectTrklt()?fLYselect:ily));
if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
}
}
}
if(!fProj){
AliInfo("Building array of projections ...");
- fProj = new TObjArray(kNclasses); fProj->SetOwner(kTRUE);
+ fProj = new TObjArray(kNclasses+1); fProj->SetOwner(kTRUE);
}
+ // set pt/p segmentation. guess from data
+ THnSparse *H(NULL);
+ if(!(H = (THnSparse*)fContainer->FindObject("hTracklet2TRDin"))){
+ AliWarning("Missing/Wrong data @ hTracklet2TRDin needed for infering pt/p segmentation.");
+ return kFALSE;
+ }
+ // protect for backward compatibility
+ fNpt=H->GetAxis(kPt)?(H->GetAxis(kPt)->GetNbins()+1):1;
+ if(!MakeMomSegmentation()) return kFALSE;
//PROCESS EXPERIMENTAL DISTRIBUTIONS
// Clusters detector
- if(HasProcessDetector() && !MakeProjectionDetector()) return kFALSE;
+ if(HasProcess(kDetector)) MakeProjectionDetector();
// Clusters residuals
- if(HasProcessCluster() && !MakeProjectionCluster()) return kFALSE;
+ if(HasProcess(kCluster)) MakeProjectionCluster();
fNRefFigures = 3;
// Tracklet residual/pulls
- if(HasProcessTrklt() && !MakeProjectionTracklet()) return kFALSE;
+ if(HasProcess(kTracklet)) MakeProjectionTracklet();
fNRefFigures = 7;
// TRDin residual/pulls
- if(HasProcessTrkIn() && !MakeProjectionTrackIn()) return kFALSE;
+ if(HasProcess(kTrackIn)){
+ MakeProjectionTrackIn();
+ MakeProjectionTrackIn(kFALSE, kTRUE);
+ }
fNRefFigures = 11;
if(!HasMCdata()) return kTRUE;
//PROCESS MC RESIDUAL DISTRIBUTIONS
// CLUSTER Y RESOLUTION/PULLS
- if(!MakeProjectionCluster(kTRUE)) return kFALSE;
+ if(HasProcess(kCluster)) MakeProjectionCluster(kTRUE);
fNRefFigures = 17;
// TRACKLET RESOLUTION/PULLS
- if(!MakeProjectionTracklet(kTRUE)) return kFALSE;
+ if(HasProcess(kTracklet)) if(!MakeProjectionTracklet(kTRUE)) return kFALSE;
fNRefFigures = 21;
// TRACK RESOLUTION/PULLS
- if(!MakeProjectionTrack()) return kFALSE;
- fNRefFigures+=16;
+// if(HasProcess(kTracklet)) if(!MakeProjectionTrack()) return kFALSE;
+// fNRefFigures+=16;
// TRACK TRDin RESOLUTION/PULLS
- if(!MakeProjectionTrackIn(kTRUE)) return kFALSE;
+ if(HasProcess(kTrackIn)) if(!MakeProjectionTrackIn(kTRUE)) return kFALSE;
fNRefFigures+=8;
return kTRUE;
f->SetParameter(5, 2.e-1);
}
-//________________________________________________________
-TObjArray* AliTRDresolution::BuildMonitorContainerCluster(const char* name, Bool_t expand, Float_t range)
-{
-// Build performance histograms for AliTRDcluster.vs TRD track or MC
-// - y reziduals/pulls
-
- TObjArray *arr = new TObjArray(2);
- arr->SetName(name); arr->SetOwner();
- TH1 *h(NULL); char hname[100], htitle[300];
-
- // tracklet resolution/pull in y direction
- snprintf(hname, 100, "%s_%s_Y", GetNameId(), name);
- snprintf(htitle, 300, "Y res for \"%s\" @ %s;tg(#phi);#Delta y [cm];%s", GetNameId(), name, "Detector");
- Float_t rr = range<0.?fDyRange:range;
- if(!(h = (TH3S*)gROOT->FindObject(hname))){
- Int_t nybins=50;
- if(expand) nybins*=2;
- h = new TH3S(hname, htitle,
- 48, -.48, .48, // phi
- 60, -rr, rr, // dy
- nybins, -0.5, nybins-0.5);// segment
- } else h->Reset();
- arr->AddAt(h, 0);
- snprintf(hname, 100, "%s_%s_YZpull", GetNameId(), name);
- snprintf(htitle, 300, "YZ pull for \"%s\" @ %s;%s;#Delta y / #sigma_{y};#Delta z / #sigma_{z}", GetNameId(), name, "Detector");
- if(!(h = (TH3S*)gROOT->FindObject(hname))){
- h = new TH3S(hname, htitle, 540, -0.5, 540-0.5, 100, -4.5, 4.5, 100, -4.5, 4.5);
- } else h->Reset();
- arr->AddAt(h, 1);
-
- return arr;
-}
-
-//________________________________________________________
-TObjArray* AliTRDresolution::BuildMonitorContainerTracklet(const char* name, Bool_t expand)
-{
-// Build performance histograms for AliExternalTrackParam.vs TRD tracklet
-// - y reziduals/pulls
-// - z reziduals/pulls
-// - phi reziduals
- TObjArray *arr = BuildMonitorContainerCluster(name, expand, 0.05);
- arr->Expand(5);
- TH1 *h(NULL); char hname[100], htitle[300];
-
- // tracklet resolution/pull in z direction
- snprintf(hname, 100, "%s_%s_Z", GetNameId(), name);
- snprintf(htitle, 300, "Z res for \"%s\" @ %s;tg(#theta);#Delta z [cm]", GetNameId(), name);
- if(!(h = (TH2S*)gROOT->FindObject(hname))){
- h = new TH2S(hname, htitle, 50, -1., 1., 100, -.05, .05);
- } else h->Reset();
- arr->AddAt(h, 2);
- snprintf(hname, 100, "%s_%s_Zpull", GetNameId(), name);
- snprintf(htitle, 300, "Z pull for \"%s\" @ %s;tg(#theta);#Delta z / #sigma_{z};row cross", GetNameId(), name);
- if(!(h = (TH3S*)gROOT->FindObject(hname))){
- h = new TH3S(hname, htitle, 50, -1., 1., 100, -5.5, 5.5, 2, -0.5, 1.5);
- h->GetZaxis()->SetBinLabel(1, "no RC");
- h->GetZaxis()->SetBinLabel(2, "RC");
- } else h->Reset();
- arr->AddAt(h, 3);
-
- // tracklet to track phi resolution
- snprintf(hname, 100, "%s_%s_PHI", GetNameId(), name);
- snprintf(htitle, 300, "#Phi res for \"%s\" @ %s;tg(#phi);#Delta #phi [rad];%s", GetNameId(), name, "Detector");
- Int_t nsgms=540;
- if(!(h = (TH3S*)gROOT->FindObject(hname))){
- h = new TH3S(hname, htitle, 48, -.48, .48, 100, -.5, .5, nsgms, -0.5, nsgms-0.5);
- } else h->Reset();
- arr->AddAt(h, 4);
-
- return arr;
-}
-
-//________________________________________________________
-TObjArray* AliTRDresolution::BuildMonitorContainerTrack(const char* name)
-{
-// Build performance histograms for AliExternalTrackParam.vs MC
-// - y resolution/pulls
-// - z resolution/pulls
-// - phi resolution, snp pulls
-// - theta resolution, tgl pulls
-// - pt resolution, 1/pt pulls, p resolution
-
- TObjArray *arr = BuildMonitorContainerTracklet(name);
- arr->Expand(11);
- TH1 *h(NULL); char hname[100], htitle[300];
- //TAxis *ax(NULL);
-
- // snp pulls
- snprintf(hname, 100, "%s_%s_SNPpull", GetNameId(), name);
- snprintf(htitle, 300, "SNP pull for \"%s\" @ %s;tg(#phi);#Delta snp / #sigma_{snp};entries", GetNameId(), name);
- if(!(h = (TH2I*)gROOT->FindObject(hname))){
- h = new TH2I(hname, htitle, 60, -.3, .3, 100, -4.5, 4.5);
- } else h->Reset();
- arr->AddAt(h, 5);
-
- // theta resolution
- snprintf(hname, 100, "%s_%s_THT", GetNameId(), name);
- snprintf(htitle, 300, "#Theta res for \"%s\" @ %s;tg(#theta);#Delta #theta [rad];entries", GetNameId(), name);
- if(!(h = (TH2I*)gROOT->FindObject(hname))){
- h = new TH2I(hname, htitle, 100, -1., 1., 100, -5e-3, 5e-3);
- } else h->Reset();
- arr->AddAt(h, 6);
- // tgl pulls
- snprintf(hname, 100, "%s_%s_TGLpull", GetNameId(), name);
- snprintf(htitle, 300, "TGL pull for \"%s\" @ %s;tg(#theta);#Delta tgl / #sigma_{tgl};entries", GetNameId(), name);
- if(!(h = (TH2I*)gROOT->FindObject(hname))){
- h = new TH2I(hname, htitle, 100, -1., 1., 100, -4.5, 4.5);
- } else h->Reset();
- arr->AddAt(h, 7);
-
- const Int_t kNdpt(150);
- const Int_t kNspc = 2*AliPID::kSPECIES+1;
- Float_t lPt=0.1, lDPt=-.1, lSpc=-5.5;
- Float_t binsPt[kNpt+1], binsSpc[kNspc+1], binsDPt[kNdpt+1];
- for(Int_t i=0;i<kNpt+1; i++,lPt=TMath::Exp(i*.15)-1.) binsPt[i]=lPt;
- for(Int_t i=0; i<kNspc+1; i++,lSpc+=1.) binsSpc[i]=lSpc;
- for(Int_t i=0; i<kNdpt+1; i++,lDPt+=2.e-3) binsDPt[i]=lDPt;
-
- // Pt resolution
- snprintf(hname, 100, "%s_%s_Pt", GetNameId(), name);
- snprintf(htitle, 300, "#splitline{P_{t} res for}{\"%s\" @ %s};p_{t} [GeV/c];#Delta p_{t}/p_{t}^{MC};SPECIES", GetNameId(), name);
- if(!(h = (TH3S*)gROOT->FindObject(hname))){
- h = new TH3S(hname, htitle,
- kNpt, binsPt, kNdpt, binsDPt, kNspc, binsSpc);
- //ax = h->GetZaxis();
- //for(Int_t ib(1); ib<=ax->GetNbins(); ib++) ax->SetBinLabel(ib, fgParticle[ib-1]);
- } else h->Reset();
- arr->AddAt(h, 8);
- // 1/Pt pulls
- snprintf(hname, 100, "%s_%s_1Pt", GetNameId(), name);
- snprintf(htitle, 300, "#splitline{1/P_{t} pull for}{\"%s\" @ %s};1/p_{t}^{MC} [c/GeV];#Delta(1/p_{t})/#sigma(1/p_{t});SPECIES", GetNameId(), name);
- if(!(h = (TH3S*)gROOT->FindObject(hname))){
- h = new TH3S(hname, htitle,
- kNpt, 0., 2., 100, -4., 4., kNspc, -5.5, 5.5);
- //ax = h->GetZaxis();
- //for(Int_t ib(1); ib<=ax->GetNbins(); ib++) ax->SetBinLabel(ib, fgParticle[ib-1]);
- } else h->Reset();
- arr->AddAt(h, 9);
- // P resolution
- snprintf(hname, 100, "%s_%s_P", GetNameId(), name);
- snprintf(htitle, 300, "P res for \"%s\" @ %s;p [GeV/c];#Delta p/p^{MC};SPECIES", GetNameId(), name);
- if(!(h = (TH3S*)gROOT->FindObject(hname))){
- h = new TH3S(hname, htitle,
- kNpt, binsPt, kNdpt, binsDPt, kNspc, binsSpc);
- //ax = h->GetZaxis();
- //for(Int_t ib(1); ib<=ax->GetNbins(); ib++) ax->SetBinLabel(ib, fgParticle[ib-1]);
- } else h->Reset();
- arr->AddAt(h, 10);
-
- return arr;
-}
-
-
//________________________________________________________
TObjArray* AliTRDresolution::Histos()
{
fContainer = new TObjArray(kNclasses); fContainer->SetOwner(kTRUE);
THnSparse *H(NULL);
const Int_t nhn(100); Char_t hn[nhn]; TString st;
+ Int_t triggerBins(fTriggerList?(TMath::Power(2.,fTriggerList->GetEntriesFast())-1):0);
//++++++++++++++++++++++
// cluster to detector
snprintf(hn, nhn, "h%s", fgPerformanceName[kDetector]);
if(!(H = (THnSparseI*)gROOT->FindObject(hn))){
const Int_t mdim(6);
- const Char_t *cldTitle[mdim] = {"layer", fgkTitle[kPhi], "pad row", "centrality", "q [a.u.]", "no. of pads"/*, "tb [10 Hz]"*/};
- const Int_t cldNbins[mdim] = {AliTRDgeometry::kNlayer, fgkNbins[kPhi], 76, AliTRDeventInfo::kCentralityClasses, 50, kNpads};
+ const Char_t *cldTitle[mdim] = {"layer", fgkTitle[kPhi], "pad row", "centrality", "q [a.u.]", triggerBins?"trigger":"no. of pads"/*, "tb [10 Hz]"*/};
+ const Int_t cldNbins[mdim] = {AliTRDgeometry::kNlayer, fgkNbins[kPhi], 76, AliTRDeventInfo::kCentralityClasses, 50, triggerBins?triggerBins:kNpads};
const Double_t cldMin[mdim] = {-0.5, fgkMin[kPhi], -0.5, -0.5, 0., 0.5},
- cldMax[mdim] = {AliTRDgeometry::kNlayer-0.5, fgkMax[kPhi], 75.5, AliTRDeventInfo::kCentralityClasses - 0.5, 1200., kNpads+.5};
+ cldMax[mdim] = {AliTRDgeometry::kNlayer-0.5, fgkMax[kPhi], 75.5, AliTRDeventInfo::kCentralityClasses - 0.5, 1200., triggerBins?(triggerBins+.5):(kNpads+.5)};
st = "cluster proprieties;";
// define minimum info to be saved in non debug mode
Int_t ndim=DebugLevel()>=1?mdim:Int_t(kNdimDet);
snprintf(hn, nhn, "h%s", fgPerformanceName[kCluster]);
if(!(H = (THnSparseI*)gROOT->FindObject(hn))){
const Int_t mdim(10);
- const Char_t *clTitle[mdim] = {"layer", fgkTitle[kPhi], fgkTitle[kEta], fgkTitle[kYrez], "#Deltax [cm]", "Q</Q", "Q/angle", "#Phi [deg]", "centrality", "no. of pads"};
- const Int_t clNbins[mdim] = {AliTRDgeometry::kNlayer, fgkNbins[kPhi], fgkNbins[kEta], fgkNbins[kYrez], 45, 30, 30, 15, AliTRDeventInfo::kCentralityClasses, kNpads};
+ const Char_t *clTitle[mdim] = {"layer", fgkTitle[kPhi], fgkTitle[kEta], fgkTitle[kYrez], "#Deltax [cm]", "Q</Q", "Q/angle", "#Phi [deg]", "centrality", triggerBins?"trigger":"no. of pads"};
+ const Int_t clNbins[mdim] = {AliTRDgeometry::kNlayer, fgkNbins[kPhi], fgkNbins[kEta], fgkNbins[kYrez], 45, 30, 30, 15, AliTRDeventInfo::kCentralityClasses, triggerBins?triggerBins:kNpads};
const Double_t clMin[mdim] = {-0.5, fgkMin[kPhi], fgkMin[kEta], fgkMin[kYrez]/10., -.5, 0.1, -2., -45, -0.5, 0.5},
- clMax[mdim] = {AliTRDgeometry::kNlayer-0.5, fgkMax[kPhi], fgkMax[kEta], fgkMax[kYrez]/10., 4., 2.1, 118., 45, AliTRDeventInfo::kCentralityClasses - 0.5, kNpads+.5};
+ clMax[mdim] = {AliTRDgeometry::kNlayer-0.5, fgkMax[kPhi], fgkMax[kEta], fgkMax[kYrez]/10., 4., 2.1, 118., 45, AliTRDeventInfo::kCentralityClasses - 0.5, triggerBins?(triggerBins+.5):(kNpads+.5)};
st = "cluster spatial&charge resolution;";
// define minimum info to be saved in non debug mode
Int_t ndim=DebugLevel()>=1?mdim:Int_t(kNdimCl);
trMin[kPrez] = -4.5; trMax[kPrez] = 4.5;
trMin[kZrez] = -1.5; trMax[kZrez] = 1.5;
trTitle[kBC]=StrDup("layer"); trNbins[kBC] = AliTRDgeometry::kNlayer; trMin[kBC] = -0.5; trMax[kBC] = AliTRDgeometry::kNlayer-0.5;
+ trNbins[kPt]=fNpt-1; trMax[kPt] = trNbins[kPt]-.5;
Int_t jdim(kNdim);
trTitle[jdim]=StrDup("centrality"); trNbins[jdim] = AliTRDeventInfo::kCentralityClasses; trMin[jdim] = -.5; trMax[jdim] = AliTRDeventInfo::kCentralityClasses - 0.5;
- jdim++; trTitle[jdim]=StrDup("occupancy [%]"); trNbins[jdim] = 12; trMin[jdim] = 25.; trMax[jdim] = 85.;
-// jdim++; trTitle[jdim]=StrDup("gap [cm]"); trNbins[jdim] = 80; trMin[jdim] = 0.1; trMax[jdim] = 2.1;
-// jdim++; trTitle[jdim]=StrDup("size_{0} [cm]"); trNbins[jdim] = 16; trMin[jdim] = 0.15; trMax[jdim] = 1.75;
-// jdim++; trTitle[jdim]=StrDup("pos_{0} [cm]"); trNbins[jdim] = 10; trMin[jdim] = 0.; trMax[jdim] = 3.5;
-// jdim++; trTitle[jdim]=StrDup("size_{1} [cm]"); trNbins[jdim] = 16; trMin[jdim] = 0.15; trMax[jdim] = 1.75;
-// jdim++; trTitle[jdim]=StrDup("pos_{1} [cm]"); trNbins[jdim] = 10; trMin[jdim] = 0.; trMax[jdim] = 3.5;
+ jdim++;
+ if(triggerBins){
+ trTitle[jdim]=StrDup("trigger"); trNbins[jdim] = triggerBins;
+ trMin[jdim] = 0.5; trMax[jdim] = triggerBins+.5;
+ } else {
+ trTitle[jdim]=StrDup("occupancy [%]"); trNbins[jdim] = 12;
+ trMin[jdim] = 25.; trMax[jdim] = 85.;
+ }
st = "tracklet spatial&charge resolution;";
// define minimum info to be saved in non debug mode
snprintf(hn, nhn, "h%s", fgPerformanceName[kTrackIn]);
if(!(H = (THnSparseI*)gROOT->FindObject(hn))){
// set specific fields
- const Int_t mdim(kNdim+3);
+ const Int_t mdim(kNdim+2);
Char_t *trinTitle[mdim]; memcpy(trinTitle, fgkTitle, kNdim*sizeof(Char_t*));
Int_t trinNbins[mdim]; memcpy(trinNbins, fgkNbins, kNdim*sizeof(Int_t));
Double_t trinMin[mdim]; memcpy(trinMin, fgkMin, kNdim*sizeof(Double_t));
Double_t trinMax[mdim]; memcpy(trinMax, fgkMax, kNdim*sizeof(Double_t));
- trinNbins[kSpeciesChgRC] = Int_t(kNcharge)*AliPID::kSPECIES+1; trinMin[kSpeciesChgRC] = -AliPID::kSPECIES-0.5; trinMax[kSpeciesChgRC] = AliPID::kSPECIES+0.5;
- trinTitle[kNdim]=StrDup("p [GeV/c]"); trinNbins[kNdim] = 24; trinMin[kNdim] = -0.5; trinMax[kNdim] = 23.5;
+ if(triggerBins){
+ trinTitle[kBC]=StrDup("trigger"); trinNbins[kBC] = triggerBins;
+ trinMin[kBC] = 0.5; trinMax[kBC] = triggerBins+.5;
+ }
+// trinNbins[kSpeciesChgRC] = Int_t(kNcharge)*(kNspc-1)+1; trinMin[kSpeciesChgRC] = -kNspc+0.5; trinMax[kSpeciesChgRC] = kNspc-0.5;
+ trinNbins[kPt]=fNpt-1; trinMax[kPt] = trinNbins[kPt]-.5;
+ trinTitle[kNdim]=StrDup("p [bin]"); trinNbins[kNdim] = fNpt-1; trinMin[kNdim] = -0.5; trinMax[kNdim] = trinNbins[kNdim]-.5;
trinTitle[kNdim+1]=StrDup("dx [cm]"); trinNbins[kNdim+1]=48; trinMin[kNdim+1]=-2.4; trinMax[kNdim+1]=2.4;
- trinTitle[kNdim+2]=StrDup("Fill Bunch"); trinNbins[kNdim+2]=3500; trinMin[kNdim+2]=-0.5; trinMax[kNdim+2]=3499.5;
+ //trinTitle[kNdim+2]=StrDup("Fill Bunch"); trinNbins[kNdim+2]=3500; trinMin[kNdim+2]=-0.5; trinMax[kNdim+2]=3499.5;
st = "r-#phi/z/angular residuals @ TRD entry;";
// define minimum info to be saved in non debug mode
- Int_t ndim=DebugLevel()>=1?mdim:kNdim;//kNdimTrkIn;
+ Int_t ndim=(DebugLevel()>=1?mdim:(kNdim+1));//kNdimTrkIn;
for(Int_t idim(0); idim<ndim; idim++){st+=trinTitle[idim]; st+=";";}
H = new THnSparseI(hn, st.Data(), ndim, trinNbins, trinMin, trinMax);
} else H->Reset();
// cluster to TrackRef residuals/pulls
snprintf(hn, nhn, "h%s", fgPerformanceName[kMCcluster]);
if(!(H = (THnSparseI*)gROOT->FindObject(hn))){
- const Char_t *clTitle[kNdim] = {"layer", fgkTitle[kPhi], fgkTitle[kEta], fgkTitle[kYrez], "#Deltax [cm]", "Q</Q", fgkTitle[kSpeciesChgRC], "#Phi [deg]"};
- const Int_t clNbins[kNdim] = {AliTRDgeometry::kNlayer, fgkNbins[kPhi], fgkNbins[kEta], fgkNbins[kYrez], 20, 10, Int_t(kNcharge)*AliPID::kSPECIES+1, 15};
- const Double_t clMin[kNdim] = {-0.5, fgkMin[kPhi], fgkMin[kEta], fgkMin[kYrez]/10., 0., 0.1, -AliPID::kSPECIES-0.5, -45},
- clMax[kNdim] = {AliTRDgeometry::kNlayer-0.5, fgkMax[kPhi], fgkMax[kEta], fgkMax[kYrez]/10., 4., 2.1, AliPID::kSPECIES+0.5, 45};
- st = "MC cluster spatial resolution;";
- // define minimum info to be saved in non debug mode
- Int_t ndim=DebugLevel()>=1?kNdim:4;
- for(Int_t idim(0); idim<ndim; idim++){ st += clTitle[idim]; st+=";";}
- H = new THnSparseI(hn, st.Data(), ndim, clNbins, clMin, clMax);
+ H = (THnSparseI*)((THnSparseI*)fContainer->At(kCluster))->Clone(hn);
+ H->SetTitle("MC cluster spatial resolution");
} else H->Reset();
fContainer->AddAt(H, kMCcluster);
//++++++++++++++++++++++
// tracklet to TrackRef
snprintf(hn, nhn, "h%s", fgPerformanceName[kMCtracklet]);
if(!(H = (THnSparseI*)gROOT->FindObject(hn))){
- Char_t *trTitle[kNdim]; memcpy(trTitle, fgkTitle, kNdim*sizeof(Char_t*));
- Int_t trNbins[kNdim]; memcpy(trNbins, fgkNbins, kNdim*sizeof(Int_t));
- Double_t trMin[kNdim]; memcpy(trMin, fgkMin, kNdim*sizeof(Double_t));
- Double_t trMax[kNdim]; memcpy(trMax, fgkMax, kNdim*sizeof(Double_t));
- // set specific fields
- trTitle[kBC]=StrDup("layer"); trNbins[kBC] = AliTRDgeometry::kNlayer; trMin[kBC] = -0.5; trMax[kBC] = AliTRDgeometry::kNlayer-0.5;
- trMin[kYrez] = -0.54; trMax[kYrez] = -trMin[kYrez];
- trMin[kPrez] = -4.5; trMax[kPrez] = -trMin[kPrez];
- trMin[kZrez] = -1.5; trMax[kZrez] = -trMin[kZrez];
- trNbins[kSpeciesChgRC] = Int_t(kNcharge)*AliPID::kSPECIES+1;trMin[kSpeciesChgRC] = -AliPID::kSPECIES-0.5; trMax[kSpeciesChgRC] = AliPID::kSPECIES+0.5;
-
- st = "MC tracklet spatial resolution;";
- // define minimum info to be saved in non debug mode
- Int_t ndim=DebugLevel()>=1?kNdim:4;
- for(Int_t idim(0); idim<ndim; idim++){ st += trTitle[idim]; st+=";";}
- H = new THnSparseI(hn, st.Data(), ndim, trNbins, trMin, trMax);
+ H = (THnSparseI*)((THnSparseI*)fContainer->At(kTracklet))->Clone(hn);
+ H->SetTitle("MC tracklet spatial resolution");
} else H->Reset();
fContainer->AddAt(H, kMCtracklet);
//++++++++++++++++++++++
// TRDin to TrackRef
snprintf(hn, nhn, "h%s", fgPerformanceName[kMCtrackIn]);
if(!(H = (THnSparseI*)gROOT->FindObject(hn))){
- st = "MC r-#phi/z/angular residuals @ TRD entry;";
- // set specific fields
- Int_t trNbins[kNdim]; memcpy(trNbins, fgkNbins, kNdim*sizeof(Int_t));
- Double_t trMin[kNdim]; memcpy(trMin, fgkMin, kNdim*sizeof(Double_t));
- Double_t trMax[kNdim]; memcpy(trMax, fgkMax, kNdim*sizeof(Double_t));
- trMin[kYrez] = -0.54; trMax[kYrez] = -trMin[kYrez];
- trMin[kPrez] = -2.4; trMax[kPrez] = -trMin[kPrez];
- trMin[kZrez] = -0.9; trMax[kZrez] = -trMin[kZrez];
- trNbins[kSpeciesChgRC] = Int_t(kNcharge)*AliPID::kSPECIES+1;trMin[kSpeciesChgRC] = -AliPID::kSPECIES-0.5; trMax[kSpeciesChgRC] = AliPID::kSPECIES+0.5;
- // define minimum info to be saved in non debug mode
- Int_t ndim=DebugLevel()>=1?kNdim:7;
- for(Int_t idim(0); idim<ndim; idim++){ st += fgkTitle[idim]; st+=";";}
- H = new THnSparseI(hn, st.Data(), ndim, trNbins, trMin, trMax);
+ H = (THnSparseI*)((THnSparseI*)fContainer->At(kTrackIn))->Clone(hn);
+ H->SetTitle("MC r-#phi/z/angular residuals @ TRD entry");
} else H->Reset();
fContainer->AddAt(H, kMCtrackIn);
//++++++++++++++++++++++
trMin[kYrez] = -0.9; trMax[kYrez] = -trMin[kYrez];
trMin[kPrez] = -1.5; trMax[kPrez] = -trMin[kPrez];
trMin[kZrez] = -0.9; trMax[kZrez] = -trMin[kZrez];
- trNbins[kSpeciesChgRC] = Int_t(kNcharge)*AliPID::kSPECIES+1;trMin[kSpeciesChgRC] = -AliPID::kSPECIES-0.5; trMax[kSpeciesChgRC] = AliPID::kSPECIES+0.5;
+ trNbins[kPt] =fNpt-1;trMax[kPt] = trNbins[kPt]-.5;
+ //trNbins[kSpeciesChgRC] = Int_t(kNcharge)*AliPID::kSPECIES+1;trMin[kSpeciesChgRC] = -AliPID::kSPECIES-0.5; trMax[kSpeciesChgRC] = AliPID::kSPECIES+0.5;
trTitle[kNdim]=StrDup("#Deltap_{t}/p_{t} [%]"); trNbins[kNdim] = 25; trMin[kNdim] = -4.5; trMax[kNdim] = 20.5;
st = "MC track spatial&p_{t} resolution;";
z = points[ip].GetZ();
tilt = points[ip].GetCharge();
y -= tilt*(-dzdx*dx + z - z0);
- Float_t xyz[3] = {x, y, z}; points[ip].SetXYZ(xyz);
+ Float_t xyz[3] = {(Float_t)x, (Float_t)y, (Float_t)z}; points[ip].SetXYZ(xyz);
yfitter.AddPoint(&dx, y, 1.);
}
if(yfitter.Eval() != 0) return kFALSE;
const Float_t kS(0.6), kM(0.2);
TH1S h("h1", "", 100, -5.*kS, 5.*kS);
- Float_t dy, dz, s, m;
+ Float_t dy/*, dz*/, s, m;
for(Int_t ip(0); ip<np; ip++){
if(points[ip].GetClusterType()) continue;
Float_t x0(points[ip].GetX())
,y0(param[1] + param[3] * (x0 - param[0]))
- ,z0(param[2] + param[4] * (x0 - param[0]));
+ /*,z0(param[2] + param[4] * (x0 - param[0]))*/;
dy=points[ip].GetY() - y0; h.Fill(dy);
- dz=points[ip].GetZ() - z0;
+ //dz=points[ip].GetZ() - z0;
}
TF1 fg("fg", "gaus", -5.*kS, 5.*kS);
fg.SetParameter(1, 0.);
// return kTRUE;
// }
-//________________________________________________________
-AliTRDresolution::AliTRDresolutionProjection::AliTRDresolutionProjection()
- :TNamed()
- ,fH(NULL)
- ,fNrebin(0)
- ,fRebinX(NULL)
- ,fRebinY(NULL)
-{
- // constructor
- memset(fAx, 0, 3*sizeof(Int_t));
- memset(fRange, 0, 4*sizeof(Float_t));
-}
-
-//________________________________________________________
-AliTRDresolution::AliTRDresolutionProjection::~AliTRDresolutionProjection()
-{
- // destructor
- if(fH) delete fH;
-}
-
-//________________________________________________________
-void AliTRDresolution::AliTRDresolutionProjection::Build(const Char_t *n, const Char_t *t, Int_t ix, Int_t iy, Int_t iz, TAxis *aa[])
-{
-// check and build (if neccessary) projection determined by axis "ix", "iy" and "iz"
- if(!aa[ix] || !aa[iy] || !aa[iz]) return;
- TAxis *ax(aa[ix]), *ay(aa[iy]), *az(aa[iz]);
- // check ax definiton to protect against older versions of the data
- if(ax->GetNbins()<=0 || (ax->GetXmax()-ax->GetXmin())<=0.){
- AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, ax->GetTitle(), ax->GetNbins(), ax->GetXmin(), ax->GetXmax()));
- return;
- }
- if(ay->GetNbins()<=0 || (ay->GetXmax()-ay->GetXmin())<=0.){
- AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, ay->GetTitle(), ay->GetNbins(), ay->GetXmin(), ay->GetXmax()));
- return;
- }
- if(az->GetNbins()<=0 || (az->GetXmax()-az->GetXmin())<=0.){
- AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, az->GetTitle(), az->GetNbins(), az->GetXmin(), az->GetXmax()));
- return;
- }
- SetNameTitle(n,t);
- fH = new TH3I(n, Form("%s;%s;%s;%s", t, ax->GetTitle(), ay->GetTitle(), az->GetTitle()),
- ax->GetNbins(), ax->GetXmin(), ax->GetXmax(),
- ay->GetNbins(), ay->GetXmin(), ay->GetXmax(),
- az->GetNbins(), az->GetXmin(), az->GetXmax());
- fAx[0] = ix; fAx[1] = iy; fAx[2] = iz;
- fRange[0] = az->GetXmin()/3.; fRange[1] = az->GetXmax()/3.;
- AliDebug(2, Form("H3(%s, %s) :: %s[%3d %4.2f %4.2f]%s[%3d %4.2f %4.2f]%s[%3d %4.2f %4.2f]", n, t,
- ax->GetTitle(), ax->GetNbins(), ax->GetXmin(), ax->GetXmax(),
- ay->GetTitle(), ay->GetNbins(), ay->GetXmin(), ay->GetXmax(),
- az->GetTitle(), az->GetNbins(), az->GetXmin(), az->GetXmax()));
-}
-
-//________________________________________________________
-AliTRDresolution::AliTRDresolutionProjection& AliTRDresolution::AliTRDresolutionProjection::operator=(const AliTRDresolutionProjection& rhs)
-{
-// copy projections
- if(this == &rhs) return *this;
-
- TNamed::operator=(rhs);
- if(fNrebin){fNrebin=0; delete [] fRebinX; delete [] fRebinY;}
- if(rhs.fNrebin) SetRebinStrategy(rhs.fNrebin, rhs.fRebinX, rhs.fRebinY);
- memcpy(fAx, rhs.fAx, 3*sizeof(Int_t));
- memcpy(fRange, rhs.fRange, 4*sizeof(Float_t));
- if(fH) delete fH;
- if(rhs.fH) fH=(TH3I*)rhs.fH->Clone(Form("%s_CLONE", rhs.fH->GetName()));
- return *this;
-}
-
-//________________________________________________________
-AliTRDresolution::AliTRDresolutionProjection& AliTRDresolution::AliTRDresolutionProjection::operator+=(const AliTRDresolutionProjection& other)
-{
-// increment projections
- if(!fH || !other.fH) return *this;
- AliDebug(2, Form("%s+=%s [%s+=%s]", GetName(), other.GetName(), fH->GetName(), (other.fH)->GetName()));
- fH->Add(other.fH);
- return *this;
-}
-
-//________________________________________________________
-void AliTRDresolution::AliTRDresolutionProjection::Increment(Int_t bin[], Double_t v)
-{
-// increment bin with value "v" pointed by general coord in "bin"
- if(!fH) return;
- AliDebug(4, Form(" %s[%2d]", fH->GetName(), Int_t(v)));
- fH->AddBinContent(fH->GetBin(bin[fAx[0]],bin[fAx[1]],bin[fAx[2]]), Int_t(v));
-}
-
-//________________________________________________________
-TH2* AliTRDresolution::AliTRDresolutionProjection::Projection2D(const Int_t nstat, const Int_t ncol, const Int_t mid, Bool_t del)
-{
-// build the 2D projection and adjust binning
-
- const Char_t *title[] = {"Mean", "#mu", "MPV"};
- if(!fH) return NULL;
- TAxis *ax(fH->GetXaxis()), *ay(fH->GetYaxis()), *az(fH->GetZaxis());
- TH2D *h2s(NULL), *hyx(NULL);
- if(!(h2s = (TH2D*)fH->Project3D("yx"))) return NULL;
- // save a copy of the original distribution
- if(!del) hyx = (TH2D*)h2s->Clone(Form("%sEn", fH->GetName()));
- Int_t irebin(0), dxBin(1), dyBin(1);
- while(irebin<fNrebin && (AliTRDresolution::GetMeanStat(h2s, .5, ">")<nstat)){
- h2s->Rebin2D(fRebinX[irebin], fRebinY[irebin]);
- dxBin*=fRebinX[irebin];dyBin*=fRebinY[irebin];
- irebin++;
- }
- Int_t nx(h2s->GetNbinsX()), ny(h2s->GetNbinsY());
- delete h2s;
-
- // start projection
- TH1 *h(NULL); Int_t n(0);
- Float_t dz=(fRange[1]-fRange[1])/ncol;
- TString titlez(az->GetTitle()); TObjArray *tokenTitle(titlez.Tokenize(" "));
- Int_t nt(tokenTitle->GetEntriesFast());
- TH2 *h2 = new TH2F(Form("%s_2D", fH->GetName()),
- Form("%s;%s;%s;%s(%s) %s", fH->GetTitle(), ax->GetTitle(), ay->GetTitle(), title[mid], nt>0?(*tokenTitle)[0]->GetName():"", nt>1?(*tokenTitle)[1]->GetName():""),
- nx, ax->GetXmin(), ax->GetXmax(), ny, ay->GetXmin(), ay->GetXmax());
- h2->SetContour(ncol);
- h2->GetZaxis()->CenterTitle();
- h2->GetZaxis()->SetTitleOffset(1.4);
- h2->GetZaxis()->SetRangeUser(fRange[0], fRange[1]);
- AliDebug(2, Form("%s[%s] nx[%d] ny[%d]", h2->GetName(), h2->GetTitle(), nx, ny));
- for(Int_t iy(0); iy<ny; iy++){
- for(Int_t ix(0); ix<nx; ix++){
- h = fH->ProjectionZ(Form("%s_z", h2->GetName()), ix*dxBin+1, (ix+1)*dxBin+1, iy*dyBin+1, (iy+1)*dyBin+1);
- Int_t ne((Int_t)h->Integral());
- if(ne<nstat/2){
- h2->SetBinContent(ix+1, iy+1, -999);
- h2->SetBinError(ix+1, iy+1, 1.);
- n++;
- }else{
- Float_t v(h->GetMean()), ve(h->GetRMS());
- if(mid==1){
- TF1 fg("fg", "gaus", az->GetXmin(), az->GetXmax());
- fg.SetParameter(0, Float_t(ne)); fg.SetParameter(1, v); fg.SetParameter(2, ve);
- h->Fit(&fg, "WQ");
- v = fg.GetParameter(1); ve = fg.GetParameter(2);
- } else if (mid==2) {
- TF1 fl("fl", "landau", az->GetXmin(), az->GetXmax());
- fl.SetParameter(0, Float_t(ne)); fl.SetParameter(1, v); fl.SetParameter(2, ve);
- h->Fit(&fl, "WQ");
- v = fl.GetMaximumX(); ve = fl.GetParameter(2);
-/* TF1 fgle("gle", "[0]*TMath::Landau(x, [1], [2], 1)*TMath::Exp(-[3]*x/[1])", az->GetXmin(), az->GetXmax());
- fgle.SetParameter(0, fl.GetParameter(0));
- fgle.SetParameter(1, fl.GetParameter(1));
- fgle.SetParameter(2, fl.GetParameter(2));
- fgle.SetParameter(3, 1.);fgle.SetParLimits(3, 0., 5.);
- h->Fit(&fgle, "WQ");
- v = fgle.GetMaximumX(); ve = fgle.GetParameter(2);*/
- }
- if(v<fRange[0]) h2->SetBinContent(ix+1, iy+1, fRange[0]+0.1*dz);
- else h2->SetBinContent(ix+1, iy+1, v);
- h2->SetBinError(ix+1, iy+1, ve);
- }
- }
- }
- if(h) delete h;
- if(n==nx*ny){delete h2; h2=NULL;} // clean empty projections
- return h2;
-}
-
-//________________________________________________________
-void AliTRDresolution::SetNormZ(TH2 *h2, Int_t bxmin, Int_t bxmax, Int_t bymin, Int_t bymax, Float_t thr)
-{
-// Normalize histo content to the mean value in the range specified by bin ranges
-// [bxmin, bxmax] on the x axis and [bymin, bymax] on the y axis.
-// Optionally a threshold "thr" can be specified to disregard entries with no meaning
-
- Float_t s = 0., c=0.; Int_t is(0);
- for(Int_t ix(bxmin); ix<=(bxmax>0?bxmax:(h2->GetXaxis()->GetNbins())); ix++){
- for(Int_t iy(bymin); iy<=(bymax>0?bymax:(h2->GetYaxis()->GetNbins())); iy++){
- if((c = h2->GetBinContent(ix, iy))<thr) continue;
- s += c; is++;
- }
- }
- s/= is?is:1;
- for(Int_t ix(1); ix<=h2->GetXaxis()->GetNbins(); ix++){
- for(Int_t iy(1); iy<=h2->GetYaxis()->GetNbins(); iy++){
- if((c = h2->GetBinContent(ix, iy))<thr) h2->SetBinContent(ix, iy, thr-100);
- else h2->SetBinContent(ix, iy, 100.*(c/s-1.));
- }
- }
-}
-
//________________________________________________________
void AliTRDresolution::SetProcesses(Bool_t det, Bool_t cl, Bool_t trklt, Bool_t trkin)
{
if(trkin) SETBIT(fSteer, kTrackIn); else CLRBIT(fSteer, kTrackIn);
}
-//________________________________________________________
-void AliTRDresolution::SetRangeZ(TH2 *h2, Float_t min, Float_t max, Float_t thr)
-{
-// Set range on Z axis such to avoid outliers
-
- Float_t c(0.), dz(1.e-3*(max-min));
- for(Int_t ix(1); ix<=h2->GetXaxis()->GetNbins(); ix++){
- for(Int_t iy(1); iy<=h2->GetYaxis()->GetNbins(); iy++){
- if((c = h2->GetBinContent(ix, iy))<thr) continue;
- if(c<=min) h2->SetBinContent(ix, iy, min+dz);
- }
- }
- h2->GetZaxis()->SetRangeUser(min, max);
-}
//________________________________________________________
-void AliTRDresolution::AliTRDresolutionProjection::SetRebinStrategy(Int_t n, Int_t rebx[], Int_t reby[])
+void AliTRDresolution::SetDump3D(Bool_t det, Bool_t cl, Bool_t trklt, Bool_t trkin)
{
-// define rebinning strategy for this projection
- fNrebin = n;
- fRebinX = new Int_t[n]; memcpy(fRebinX, rebx, n*sizeof(Int_t));
- fRebinY = new Int_t[n]; memcpy(fRebinY, reby, n*sizeof(Int_t));
+// steer processes
+ if(det) SETBIT(fSteer, 4+kDetector); else CLRBIT(fSteer, 4+kDetector);
+ if(cl) SETBIT(fSteer, 4+kCluster); else CLRBIT(fSteer, 4+kCluster);
+ if(trklt) SETBIT(fSteer, 4+kTracklet); else CLRBIT(fSteer, 4+kTracklet);
+ if(trkin) SETBIT(fSteer, 4+kTrackIn); else CLRBIT(fSteer, 4+kTrackIn);
}
-