+ //
+ if (task == AliQAv1::kRECPOINTS) {
+ //
+ TH1F * hist = new TH1F("fitHist", "", 200, -0.5, 199.5);
+ TObjArray& arrRP = *GetRecPointsDataOfTrigClass(itc); // RS Histos matching to trigger class
+ // fill detector map;
+ TH1* h0 = (TH1*) arrRP[0];
+ TH1* detMap = (TH1*) arrRP[87];
+ if (h0 && detMap) {
+ for(Int_t i = 0 ; i < 540 ; i++) {
+ Double_t v = h0->GetBinContent(i+1);
+ Int_t sm = i/30;
+ Int_t det = i%30;
+ Int_t bin = detMap->FindBin(sm, det);
+ detMap->SetBinContent(bin, v);
+ }
+ }
+ //
+ // Rec points full chambers
+ TH2* h2tmp = (TH2*) arrRP[1];
+ TH1* h12 = (TH1*) arrRP[12];
+ TH1* h13 = (TH1*) arrRP[13];
+ if (h2tmp && h12 && h13) {
+ for (Int_t i = 0 ; i < 540 ; i++) {
+ //AliDebug(AliQAv1::GetQADebugLevel(), Form("I = %d", i));
+ hist->Reset();
+ // project TH2F into TH1F
+ for(Int_t b = 1 ; b < hist->GetXaxis()->GetNbins()-1 ; b++) {
+ Double_t xvalue = hist->GetBinCenter(b);
+ Int_t bin = h2tmp->FindBin(i,xvalue);
+ Double_t value = h2tmp->GetBinContent(bin);
+ hist->SetBinContent(b, value);
+ }
+ //AliDebug(AliQAv1::GetQADebugLevel(), Form("Sum = %d %f\n", i, hist->GetSum()));
+ if (hist->GetSum() < 100) continue; // not enougth data in a chamber
+ //
+ hist->Fit("landau", "q0", "goff", 10, 180);
+ TF1 *fit = hist->GetFunction("landau");
+ h12->Fill(fit->GetParameter(1));
+ h13->Fill(fit->GetParameter(2));
+ }
+ }
+ //
+ // time-bin by time-bin sm by sm
+ TH3* h3tmp = (TH3*) arrRP[10];
+ if (h3tmp) {
+ for(Int_t i=0; i<18; i++) { // loop over super-modules
+ for(Int_t j=0; j<kTimeBin; j++) { // loop over time bins
+ hist->Reset();
+ for(Int_t b = 1 ; b < hist->GetXaxis()->GetNbins()-1 ; b++) {
+ Double_t xvalue = hist->GetBinCenter(b);
+ Double_t svalue = 0.0;
+ for(Int_t det = i*30 ; det < (i+1)*30 ; det++) { // loop over detectors
+ Int_t bin = h3tmp->FindBin(det,j,xvalue);
+ Double_t value = h3tmp->GetBinContent(bin);
+ svalue += value;
+ }
+ //AliDebug(AliQAv1::GetQADebugLevel(), Form("v = %f\n", value));
+ hist->SetBinContent(b, svalue);
+ }
+ //
+ if (hist->GetSum() < 100) continue;
+ //
+ hist->Fit("landau", "q0", "goff", 10, 180);
+ TF1 *fit = hist->GetFunction("landau");
+ //
+ TH1 *hi = (TH1*)arrRP[14+18+i];
+ if (!hi) continue;
+ hi->SetMarkerStyle(20);
+ Int_t bin = hi->FindBin(j);
+ // printf("%d %d %d\n", det, j, bin);
+ //
+ Double_t value = TMath::Abs(fit->GetParameter(1));
+ Double_t error = TMath::Abs(fit->GetParError(1));
+ //
+ if (value/error < 3) continue; // insuficient statistics
+ //
+ hi->SetBinContent(bin, value);
+ hi->SetBinError(bin, error);
+ } // j
+ } // i
+ //
+ // for numerical convergence
+ TF1 *form = new TF1("formLandau", "landau", 0, 200);
+ //
+ // time-bin by time-bin chamber by chamber
+ for (Int_t i=0; i<540; i++) {
+ for(Int_t j=0; j<kTimeBin; j++) {
+ //
+ hist->Reset();
+ for(Int_t b = 1 ; b < hist->GetXaxis()->GetNbins()-1 ; b++) {
+ Double_t xvalue = hist->GetBinCenter(b);
+ Int_t bin = h3tmp->FindBin(i,j,xvalue);
+ Double_t value = h3tmp->GetBinContent(bin);
+ //AliDebug(AliQAv1::GetQADebugLevel(), Form("v = %f\n", value));
+ hist->SetBinContent(b, value);
+ }
+ //
+ if (hist->GetSum() < 100) continue;
+
+ form->SetParameters(1000, 60, 20);
+ hist->Fit(form, "q0", "goff", 20, 180);
+
+ Int_t sm = i/30;
+ Int_t det = i%30;
+ TH1 *hi = (TH1*)arrRP[14+sm];
+ if (!hi) continue;
+ Int_t bin = hi->FindBin(det,j);
+ // printf("%d %d %d\n", det, j, bin);
+ //
+ Double_t value = TMath::Abs(form->GetParameter(1));
+ Double_t error = TMath::Abs(form->GetParError(1));
+ //
+ if (value/error < 3) continue;
+ //
+ hi->SetBinContent(bin, value);
+ hi->SetBinError(bin, error);
+ } // j
+ } // i
+ } // h3tmp
+ if (hist) delete hist;
+ } // RECPOINTS
+ //
+ //////////////////////////
+ // const Int_t knbits = 6;
+ // const char *suf[knbits] = {"TPCi", "TPCo", "TPCz", "TRDo", "TRDr", "TRDz"};
+ //const char *sufRatio[4] = {"TRDrTRDo", "TRDoTPCo", "TRDrTPCo", "TRDzTPCo"};