- }
- }
- if (hist)
- delete hist;
- }
- //////////////////////////
- // const Int_t knbits = 6;
- // const char *suf[knbits] = {"TPCi", "TPCo", "TPCz", "TRDo", "TRDr", "TRDz"};
- //const char *sufRatio[4] = {"TRDrTRDo", "TRDoTPCo", "TRDrTPCo", "TRDzTPCo"};
-
- if (task == AliQAv1::kESDS) {
-
- const Int_t knRatio = 4;
- const Int_t kN[knRatio] = {4,3,4,5};
- const Int_t kD[knRatio] = {3,1,1,3};
-
- // create ratios
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
- if (! IsValidEventSpecie(specie, list))
- continue ;
- for(Int_t type = 0 ; type < 2 ; type++) {
- for(Int_t i = 0 ; i < knRatio ; i++) {
- TH1D *ratio = (TH1D*)list[specie]->At(19 + 2*i + type);
- TH1D *histN = (TH1D*)list[specie]->At(3 + 2*kN[i] + type);
- TH1D *histD = (TH1D*)list[specie]->At(3 + 2*kD[i] + type);
- BuildRatio(ratio, histN, histD);
- //ratio->Reset();
- //ratio->Add(histN);
- //ratio->Divide(histD);
- }
- }
- // ratio for the fraction of electrons per stack
- TH1D *histN = (TH1D*)list[specie]->At(33);
- TH1D *histD = (TH1D*)list[specie]->At(32);
- TH1D *ratio = (TH1D*)list[specie]->At(34);
- BuildRatio(ratio, histN, histD);
- }
- }
+ //
+ // 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"};
+
+ if (task == AliQAv1::kESDS) {
+ //
+ const Int_t knRatio = 4;
+ const Int_t kN[knRatio] = {4,3,4,5};
+ const Int_t kD[knRatio] = {3,1,1,3};
+ //
+ TObjArray& arrES = *GetESDsDataOfTrigClass(itc); // RS Histos matching to trigger class
+ // create ratios
+ for(Int_t type = 0 ; type < 2 ; type++) {
+ for(Int_t i = 0 ; i < knRatio ; i++) {
+ TH1 *ratio = (TH1*)arrES[19 + 2*i + type];
+ TH1 *histN = (TH1*)arrES[3 + 2*kN[i] + type];
+ TH1 *histD = (TH1*)arrES[3 + 2*kD[i] + type];
+ if ( ! (ratio && histN && histD) ) continue;
+ BuildRatio(ratio, histN, histD);
+ //ratio->Reset();
+ //ratio->Add(histN);
+ //ratio->Divide(histD);
+ }
+ }
+ // ratio for the fraction of electrons per stack
+ TH1 *histN = (TH1*)arrES[33];
+ TH1 *histD = (TH1*)arrES[32];
+ TH1 *ratio = (TH1*)arrES[34];
+ BuildRatio(ratio, histN, histD);
+ } // ESDs
+ } // RS: loop over eventual clones per trigger class
+ } // loop over species