1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /* $Id: AliTRDqaAT.cxx $ */
19 // This class is a part of a package of high level QA monitoring for TRD.
20 // In this class provides a commonly used tools as static functions.
23 // radomski@physi.uni-heidelberg.de
27 #include "AliTRDqaAT.h"
32 #include "AliESDtrack.h"
33 #include "AliExternalTrackParam.h"
35 //______________________________________________________________________________
37 AliTRDqaAT::AliTRDqaAT() {
44 //______________________________________________________________________________
45 Int_t AliTRDqaAT::GetSector(const Double_t alpha)
47 // Gets the sector number
49 Double_t size = TMath::DegToRad() * 20.;
50 Int_t sector = (Int_t)((alpha + TMath::Pi())/size);
54 //______________________________________________________________________________
56 Int_t AliTRDqaAT::GetStack(const AliExternalTrackParam *paramOut)
59 // calculates the stack the track is in
62 const Double_t l = -0.9;
63 const Double_t w = (2*l)/5;
65 Double_t tan = paramOut->GetZ() / paramOut->GetX();
66 Double_t pos = (tan - l) / w;
70 //______________________________________________________________________________
72 void AliTRDqaAT::BuildRatio(TH1D *ratio, TH1D *histN, TH1D*histD) {
74 // Calculate the ratio of two histograms
75 // error are calculated assuming the histos have the same counts
80 Int_t nbins = histN->GetXaxis()->GetNbins();
81 for(Int_t i=1; i<nbins+2; i++) {
83 Double_t valueN = histN->GetBinContent(i);
84 Double_t valueD = histD->GetBinContent(i);
87 ratio->SetBinContent(i, 0);
88 ratio->SetBinError(i, 0);
92 Double_t eps = (valueN < valueD-valueN)? valueN : valueD-valueN;
94 ratio->SetBinContent(i, valueN/valueD);
95 ratio->SetBinError(i, TMath::Sqrt(eps)/valueD);
99 ratio->SetMinimum(-0.1);
100 ratio->SetMaximum(1.1);
101 ratio->SetMarkerStyle(20);
103 //__________________________________________________________________________
105 void AliTRDqaAT::FillStatus(TH1D *fStatusHist, UInt_t status) {
108 //UInt_t status = track->GetStatus();
109 for(Int_t bit=0; bit<32; bit++)
110 if (u<<bit & status) fStatusHist->Fill(bit);
113 //__________________________________________________________________________
115 void AliTRDqaAT::PrintPID(const AliESDtrack *track) {
117 Int_t id = AliPID::kElectron;
118 Double_t pidESD[5], pidITS[5], pidTPC[5], pidTRD[5];
120 track->GetESDpid(pidESD);
121 track->GetITSpid(pidITS);
122 track->GetTPCpid(pidTPC);
123 track->GetTRDpid(pidTRD);
124 //track->GetTOFpid(pidTOF);
126 Double_t comb = pidITS[id] * pidTPC[id] * pidTRD[id];
128 Double_t normTot = 0;
129 Double_t norm[5] = {0,0,0,0,0};
130 for(Int_t i=0; i<5; i++) {
131 norm[i] = pidITS[i] * pidTPC[i] * pidTRD[i];
136 for(Int_t i=0; i<AliPID::kSPECIES; i++) trdTot += pidTRD[i];
141 printf("%.3f | %.3f %.3f | %.3f %.3f %.3f | ",
142 pidESD[id], comb, normTot, pidITS[id], pidTPC[id], pidTRD[id]);
144 for(Int_t i=0; i<5; i++) printf("%.2f:%.2f:%.2f | ", pidITS[i], pidTPC[i], pidTRD[i]);
145 printf("| %.3f |\n", trdTot);
148 //__________________________________________________________________________