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"
34 #include "AliESDEvent.h"
35 #include "AliESDtrack.h"
36 #include "AliESDtrackCuts.h"
38 //______________________________________________________________________________
40 AliTRDqaBasic::AliTRDqaBasic()
41 : AliAnalysisTask("",""),
55 // default constructor
59 //______________________________________________________________________________
61 AliTRDqaBasic:: AliTRDqaBasic(const AliTRDqaBasic & /*trd*/)
62 : AliAnalysisTask("",""),
81 //______________________________________________________________________________
82 AliTRDqaBasic::AliTRDqaBasic(const char *name)
83 : AliAnalysisTask(name,""),
97 // Input slot #0 works with an Ntuple
98 DefineInput(0, TChain::Class());
99 // Output slot #0 writes into a TH1 container
100 DefineOutput(0, TObjArray::Class()) ;
103 //______________________________________________________________________________
104 void AliTRDqaBasic::ConnectInputData(const Option_t *)
106 // Initialisation of branch container and histograms
108 //AliInfo(Form("*** Initialization of %s", GetName())) ;
110 fChain = (TChain*)GetInputData(0);
111 fESD = new AliESDEvent();
112 fESD->ReadFromTree(fChain);
115 //________________________________________________________________________
116 void AliTRDqaBasic::CreateOutputObjects()
120 fStatus = new TH1D("status", ";status bit", 32, -0.5, 31.5);
121 fPtIn = new TH1D("ptIn", ";p_{T}, GeV/c", 100, 0, 15);
122 fPtOut = new TH1D("ptOut", ";p_{T}, GeV/c", 100, 0, 15);
123 fPtVtx = new TH1D("ptVtx", ";p_{T}, GeV/c", 100, 0, 15);
124 fPtVtxSec = new TH1D("ptVtxSec", ";p_{T}, GeV/c", 100, 0, 15);
125 fnTracks = new TH1D("nTracks", "", 200, -0.5, 199.5);
127 fPtPt = new TH2D("ptpt", ";p_{T} from inner plane, GeV/c;p_{T} at vertex, GeV/c",
128 100, 0, 10, 100, 0, 10);
131 fOutputContainer = new TObjArray(50);
133 fOutputContainer->AddAt(fStatus, c++);
134 fOutputContainer->AddAt(fPtIn, c++);
135 fOutputContainer->AddAt(fPtOut, c++);
136 fOutputContainer->AddAt(fPtVtx, c++);
137 fOutputContainer->AddAt(fPtVtxSec, c++);
138 fOutputContainer->AddAt(fnTracks, c++);
139 fOutputContainer->AddAt(fPtPt, c++);
141 printf("n hist = %d\n", c);
144 fTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
145 fTrackCuts->DefineHistograms(0);
147 // default cuts for ITS+TPC
155 TString tag("Global tracking");
157 fTrackCuts->SetMaxCovDiagonalElements(cov1, cov2, cov3, cov4, cov5);
159 fTrackCuts->SetMaxNsigmaToVertex(nSigma);
160 fTrackCuts->SetRequireSigmaToVertex(kTRUE);
162 fTrackCuts->SetRequireTPCRefit(kTRUE);
163 fTrackCuts->SetAcceptKinkDaughters(kFALSE);
165 fTrackCuts->SetMinNClustersTPC(50);
166 fTrackCuts->SetMaxChi2PerClusterTPC(3.5);
168 //______________________________________________________________________________
169 void AliTRDqaBasic::Exec(Option_t *)
172 Long64_t entry = fChain->GetReadEntry() ;
173 if (!(entry%100)) Info("Exec", "Entry = %lld", entry);
175 // Processing of one event
178 //AliError("fESD is not connected to the input!") ;
182 Int_t nTracks = fESD->GetNumberOfTracks();
183 fnTracks->Fill(nTracks);
186 for(Int_t i=0; i<nTracks; i++) {
192 // TRDrefit and TRDPid bit
195 AliESDtrack *track = fESD->GetTrack(i);
196 const AliExternalTrackParam *paramOut = track->GetOuterParam();
197 const AliExternalTrackParam *paramIn = track->GetInnerParam();
200 if (!paramIn) continue;
201 if (!paramOut) continue;
203 UInt_t status = track->GetStatus();
204 if (!(status & AliESDtrack::kTPCrefit)) continue;
206 //if (!fTrackCuts->AcceptTrack(track)) continue;
208 AliTRDqaAT::FillStatus(fStatus, status);
210 fPtIn->Fill(paramIn->Pt());
211 fPtOut->Fill(paramOut->Pt());
212 fPtVtx->Fill(track->Pt());
213 if (track->GetConstrainedParam())
214 fPtVtxSec->Fill(track->GetConstrainedParam()->Pt());
216 fPtPt->Fill(paramIn->Pt(), track->Pt());
219 PostData(0, fOutputContainer);
222 //______________________________________________________________________________
223 void AliTRDqaBasic::Terminate(Option_t *)
226 fOutputContainer = (TObjArray*)GetOutputData(0);
228 TFile *file = new TFile("outBasic.root", "RECREATE");
229 fOutputContainer->Write();
235 //for(Int_t i=0; i<fOutputContainer->GetEntries(); i++) {
236 // TObject *obj = fOu
240 //______________________________________________________________________________