- TH1D *hist = new TH1D("fitHist", "", 200, -0.5, 199.5);
-
- if (task == AliQAv1::kRECPOINTS) {
-
- //list->Print();
-
- // Rec points full chambers
- for (Int_t i=0; i<540; i++) {
-
- //TH1D *h = ((TH2D*)list->At(1))->ProjectionY(Form("qaTRD_recPoints_amp_%d",i), i+1, i+1);
- hist->Reset();
- for(Int_t b=1; b<hist->GetXaxis()->GetNbins()-1; b++) {
- Double_t xvalue = hist->GetBinCenter(b);
- Int_t bin = ((TH2D*)list->At(1))->FindBin(i,xvalue);
- Double_t value = ((TH2D*)list->At(1))->GetBinContent(bin);
- hist->SetBinContent(b, value);
- }
-
- //printf("Sum = %d %f\n", i, hist->GetSum());
- if (hist->GetSum() < 100) continue; // chamber not present
-
- hist->Fit("landau", "q0", "goff", 10, 180);
- TF1 *fit = hist->GetFunction("landau");
- ((TH1D*)list->At(12))->Fill(fit->GetParameter(1));
- ((TH1D*)list->At(13))->Fill(fit->GetParameter(2));
- }
-
- // time-bin by time-bin
- for (Int_t i=0; i<540; i++) {
-
- //TH1D *test = ((TH3D*)list->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, 0, 35);
- //if (test->GetSum() < 100) continue;
-
- //AliDebug(AliQAv1::GetQADebugLevel(), Form("fitting det = %d", i));
-
- for(Int_t j=0; j<35; j++) {
-
- //TH1D *h = ((TH3D*)list->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, j+1, j+1);
- hist->Reset();
- for(Int_t b=1; b<hist->GetXaxis()->GetNbins()-1; b++) {
- Double_t xvalue = hist->GetBinCenter(b);
- Int_t bin = ((TH3D*)list->At(10))->FindBin(i,j,xvalue);
- Double_t value = ((TH3D*)list->At(10))->GetBinContent(bin);
- //printf("v = %f\n", value);
- hist->SetBinContent(b, value);
+ TH1F *hist = new TH1F("fitHist", "", 200, -0.5, 199.5);
+ //
+ // RS Add a loop over species
+ for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+ if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) continue ;
+ SetEventSpecie(specie);
+ //
+ for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS: loop over eventual clones per trigger class
+ //
+ if (task == AliQAv1::kRECPOINTS) {
+
+ //list->Print();
+ TObjArray& arrRP = *GetRecPointsDataOfTrigClass(itc); // RS Histos matching to trigger class
+ // Rec points full chambers
+ TH2* h2tmp = (TH2*) arrRP[1];
+ if (h2tmp) {
+ for (Int_t i=0; i<540; i++) {
+ hist->Reset();
+ 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);
+ }
+ //printf("Sum = %d %f\n", i, hist->GetSum());
+ if (hist->GetSum() < 100) continue; // chamber not present
+ //
+ hist->Fit("landau", "q0", "goff", 10, 180);
+ TF1 *fit = hist->GetFunction("landau");
+ if (arrRP[12]) ((TH1*)arrRP[12])->Fill(fit->GetParameter(1));
+ if (arrRP[13]) ((TH1*)arrRP[13])->Fill(fit->GetParameter(2));
+ }