if (!outfile) return -1;
TChain* chain = new TChain("tpcQA");
+ if(!chain) return -1;
+
ifstream in;
in.open(infilelist);
in.close();
//TTree *tree = chain;
TTree *tree = chain->CopyTree("1");
+ if(!tree) return -1;
if (chain) { delete chain; chain=0; }
//TGraph* graph = dynamic_cast<TGraph*>(tree->DrawClone("run:run"));
//TGraph *graph = (TGraph*)gPad->GetPrimitive("Graph");
TFile* out = new TFile(outfile,"RECREATE");
+ if(!out) return -1;
+
out->cd();
const Char_t* condition = "meanTPCncl>0";
SaveGraph(tree,"meanTPCnclF","run",condition);
if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7")) {
his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7"));
+ if(!his3D) return 8;
his3D->GetYaxis()->SetRangeUser(-1,1);
his3D->GetZaxis()->SetRangeUser(0.25,10);
}
} else {
his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
}
-
+ if(!his2D) return 8;
his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
+ if(!his3D) return 16;
his3D->GetYaxis()->SetRangeUser(-1,1);
his3D->GetZaxis()->SetRangeUser(0.25,10);
}
his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
}
+ if(!his2D) return 16;
his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
delete his2D;
if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
+ if(!his3D) return 32;
his3D->GetYaxis()->SetRangeUser(-1,1);
his3D->GetZaxis()->SetRangeUser(0.25,10);
}
his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
}
+ if(!his2D) return 32;
+
his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
delete his2D;
his1D = (TH1*) arrayFit.At(1);
if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7")) {
his3D0 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7"));
+ if(!his3D0) return 1;
his3D0->GetYaxis()->SetRangeUser(-1,1);
his3D0->GetZaxis()->SetRangeUser(0.25,10);
}
if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7")) {
his3D1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7"));
+ if(!his3D1) return 1;
his3D1->GetYaxis()->SetRangeUser(-1,1);
his3D1->GetZaxis()->SetRangeUser(0.25,10);
}
if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7")) {
his3D2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7"));
+ if(!his3D2) return 1;
his3D2->GetYaxis()->SetRangeUser(-1,1);
his3D2->GetZaxis()->SetRangeUser(0.25,10);
his3D2->GetXaxis()->SetRangeUser(0.4,1.1);
} else {
hprof = pTPC->GetTPCTrackHisto()->Projection(0,5)->ProfileX();
}
+ if(!hprof) return 1;
hprof->Fit(fpol1,"QNR","QNR",0.1,0.8);
slopeATPCncl= fpol1->GetParameter(1);
pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0.4,1.1);
his1D = pTPC->GetTPCTrackHisto()->Projection(2,5)->ProfileX();
}
+ if(!his1D) return 1;
his1D->Fit(fpol1,"QNR","QNR",0.1,0.8);
slopeATPCnclF= fpol1->GetParameter(1);
if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7")) {
his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7"));
+ if(!his3D) return 2;
his3D->GetYaxis()->SetRangeUser(-1,1);
his3D->GetZaxis()->SetRangeUser(0.25,10);
- }
+ }
+
if (his3D && !fgForceTHnSparse) {
his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
} else {
his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
}
+ if(!his2D) return 2;
static TF1 *fpol1 = new TF1("fpol1","pol1");
TObjArray arrayFit;
if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7")) {
his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7"));
+ if(!his3D) return 64;
his3D->GetYaxis()->SetRangeUser(-1,1);
his3D->GetZaxis()->SetRangeUser(0.25,10);
- }
+ }
+
if (his3D && !fgForceTHnSparse) {
his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
} else {
his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
}
+ if(!his2D) return 64;
static TF1 *fpol1 = new TF1("fpol1","pol1");
TObjArray arrayFit;
if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7")) {
his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7"));
+ if(!his3D) return 128;
his3D->GetYaxis()->SetRangeUser(-1,1);
his3D->GetZaxis()->SetRangeUser(0.25,10);
}
} else {
his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
}
+ if(!his2D) return 128;
static TF1 *fpol1 = new TF1("fpol1","pol1");
TObjArray arrayFit;
} else {
his1D = pTPCgain->GetDeDxHisto()->Projection(0);
}
+ if(!his1D) return 4;
his1D->Fit(&gausFit,"QN","QN");
meanMIP = gausFit.GetParameter(1);
} else {
his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
}
+ if(!his2D) return 4;
+
TF1 * fpol = new TF1("fpol","pol1");
TObjArray arrayFit;
his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
} else {
his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
}
+ if(!his2D) return 4;
+
TF1 * fpolA = new TF1("fpolA","pol1");
TObjArray arrayFitA;
his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
} else {
his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
}
+ if(!his2D) return 4;
+
for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
//TH1* his1D=0;
Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
} else {
his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
}
+ if(!his2D) return 4;
+
for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
//TH1* his1D=0;
Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
} else {
his1D = pTPC->GetTPCEventHisto()->Projection(6);
}
+ if(!his1D) return 1;
+
vertAll = his1D->GetEntries();
vertOK = his1D->GetBinContent(2);
if (vertAll>=1) {
} else {
his1D = pTPC->GetTPCEventHisto()->Projection(0);
}
+ if(!his1D) return 1;
+
meanVertX = his1D->GetMean();
rmsVertX = his1D->GetRMS();
delete his1D;
} else {
his1D = pTPC->GetTPCEventHisto()->Projection(1);
}
+ if(!his1D) return 1;
+
meanVertY = his1D->GetMean();
rmsVertY = his1D->GetRMS();
delete his1D;
} else {
his1D = pTPC->GetTPCEventHisto()->Projection(2);
} meanVertZ = his1D->GetMean();
+ if(!his1D) return 1;
+
rmsVertZ = his1D->GetRMS();
delete his1D;
} else {
his1D = pTPC->GetTPCEventHisto()->Projection(3);
}
+ if(!his1D) return 1;
+
meanMult = his1D->GetMean();
rmsMult = his1D->GetRMS();
delete his1D;
} else {
his1D = pTPC->GetTPCEventHisto()->Projection(4);
}
+ if(!his1D) return 1;
+
meanMultPos = his1D->GetMean();
rmsMultPos = his1D->GetRMS();
delete his1D;
} else {
his1D = pTPC->GetTPCEventHisto()->Projection(5);
}
+ if(!his1D) return 1;
+
meanMultNeg = his1D->GetMean();
rmsMultNeg = his1D->GetRMS();
delete his1D;
if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
his3D1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
+ if(!his3D1) return 256;
his3D1->GetYaxis()->SetRangeUser(0.1,0.8);
if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
his3D2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
+ if(!his3D2) return 256;
his3D2->GetYaxis()->SetRangeUser(0.1,0.8);
if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8")) {
his2D = dynamic_cast<TH2*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8"));
+ if(!his2D) return 512;
his1D1 = his2D->ProjectionX();
his1D1->Fit(fp1,"R");