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: AliTRDqaBasic.cxx 23387 2008-01-17 17:25:16Z cblume $ */
19 // This class is a part of a package of high level QA monitoring for TRD.
22 // radomski@physi.uni-heidelberg.de
26 #include "AliTRDqaBasic.h"
27 #include "AliTRDqaAT.h"
36 #include "AliESDEvent.h"
37 #include "AliESDtrack.h"
38 #include "AliESDtrackCuts.h"
40 //______________________________________________________________________________
42 AliTRDqaBasic::AliTRDqaBasic()
43 : AliAnalysisTask("",""),
57 // default dummy constructor
61 //______________________________________________________________________________
63 AliTRDqaBasic:: AliTRDqaBasic(AliTRDqaBasic& /*trd*/)
64 : AliAnalysisTask("",""),
78 // Dummy copy constructor
85 //______________________________________________________________________________
86 AliTRDqaBasic::AliTRDqaBasic(const char *name)
87 : AliAnalysisTask(name,""),
101 // Input slot #0 works with an Ntuple
102 DefineInput(0, TChain::Class());
103 // Output slot #0 writes into a TH1 container
104 DefineOutput(0, TObjArray::Class()) ;
107 //______________________________________________________________________________
108 void AliTRDqaBasic::ConnectInputData(const Option_t *)
110 // Initialisation of branch container and histograms
112 //AliInfo(Form("*** Initialization of %s", GetName())) ;
114 fChain = (TChain*)GetInputData(0);
115 fESD = new AliESDEvent();
116 fESD->ReadFromTree(fChain);
119 //________________________________________________________________________
120 void AliTRDqaBasic::CreateOutputObjects()
124 fStatus = new TH1D("status", ";status bit", 32, -0.5, 31.5);
125 fPtIn = new TH1D("ptIn", ";p_{T}, GeV/c", 100, 0, 15);
126 fPtOut = new TH1D("ptOut", ";p_{T}, GeV/c", 100, 0, 15);
127 fPtVtx = new TH1D("ptVtx", ";p_{T}, GeV/c", 100, 0, 15);
128 fPtVtxSec = new TH1D("ptVtxSec", ";p_{T}, GeV/c", 100, 0, 15);
129 fnTracks = new TH1D("nTracks", "", 200, -0.5, 199.5);
131 fPtPt = new TH2D("ptpt", ";p_{T} from inner plane, GeV/c;p_{T} at vertex, GeV/c",
132 100, 0, 10, 100, 0, 10);
135 fOutputContainer = new TObjArray(50);
137 fOutputContainer->AddAt(fStatus, c++);
138 fOutputContainer->AddAt(fPtIn, c++);
139 fOutputContainer->AddAt(fPtOut, c++);
140 fOutputContainer->AddAt(fPtVtx, c++);
141 fOutputContainer->AddAt(fPtVtxSec, c++);
142 fOutputContainer->AddAt(fnTracks, c++);
143 fOutputContainer->AddAt(fPtPt, c++);
145 printf("n hist = %d\n", c);
148 fTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
149 fTrackCuts->DefineHistograms(0);
151 // default cuts for ITS+TPC
159 TString tag("Global tracking");
161 fTrackCuts->SetMaxCovDiagonalElements(cov1, cov2, cov3, cov4, cov5);
163 fTrackCuts->SetMinNsigmaToVertex(nSigma);
164 fTrackCuts->SetRequireSigmaToVertex(kTRUE);
166 fTrackCuts->SetRequireTPCRefit(kTRUE);
167 fTrackCuts->SetAcceptKingDaughters(kFALSE);
169 fTrackCuts->SetMinNClustersTPC(50);
170 fTrackCuts->SetMaxChi2PerClusterTPC(3.5);
172 //______________________________________________________________________________
173 void AliTRDqaBasic::Exec(Option_t *)
176 Long64_t entry = fChain->GetReadEntry() ;
177 if (!(entry%100)) Info("Exec", "Entry = %ld", entry);
179 // Processing of one event
182 //AliError("fESD is not connected to the input!") ;
186 Int_t nTracks = fESD->GetNumberOfTracks();
187 fnTracks->Fill(nTracks);
190 for(Int_t i=0; i<nTracks; i++) {
196 // TRDrefit and TRDPid bit
199 AliESDtrack *track = fESD->GetTrack(i);
200 const AliExternalTrackParam *paramOut = track->GetOuterParam();
201 const AliExternalTrackParam *paramIn = track->GetInnerParam();
204 if (!paramIn) continue;
205 if (!paramOut) continue;
207 UInt_t status = track->GetStatus();
208 if (!(status & AliESDtrack::kTPCrefit)) continue;
210 //if (!fTrackCuts->AcceptTrack(track)) continue;
212 AliTRDqaAT::FillStatus(fStatus, status);
214 fPtIn->Fill(paramIn->Pt());
215 fPtOut->Fill(paramOut->Pt());
216 fPtVtx->Fill(track->Pt());
217 if (track->GetConstrainedParam())
218 fPtVtxSec->Fill(track->GetConstrainedParam()->Pt());
220 fPtPt->Fill(paramIn->Pt(), track->Pt());
223 PostData(0, fOutputContainer);
226 //______________________________________________________________________________
227 void AliTRDqaBasic::Terminate(Option_t *)
230 fOutputContainer = (TObjArray*)GetOutputData(0);
232 TFile *file = new TFile("outBasic.root", "RECREATE");
233 fOutputContainer->Write();
239 //for(Int_t i=0; i<fOutputContainer->GetEntries(); i++) {
240 // TObject *obj = fOu
244 //______________________________________________________________________________