Removing AliESDCaloTrack now obsolete
[u/mrichter/AliRoot.git] / MONITOR / AliMonitorITS.cxx
CommitLineData
04fa961a 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// This class creates and fills the monitor histograms for the ITS //
21// //
22///////////////////////////////////////////////////////////////////////////////
23
5fe305fe 24#include <TFolder.h>
25#include <TTree.h>
26#include <TVector3.h>
04fa961a 27
5fe305fe 28#include "AliESD.h"
04fa961a 29#include "AliITSRawStreamSDD.h"
30#include "AliITSRawStreamSSD.h"
31#include "AliITSclusterV2.h"
5fe305fe 32#include "AliITSgeom.h"
33#include "AliMonitorHisto.h"
34#include "AliMonitorITS.h"
c6ba6205 35#include "AliRawReader.h"
5fe305fe 36#include "AliRunLoader.h"
04fa961a 37
38ClassImp(AliMonitorITS)
39
40
41//_____________________________________________________________________________
42AliMonitorITS::AliMonitorITS(AliITSgeom* geom)
43{
44// create a ITS monitor object with the given geometry
45
46 fGeom = geom;
47}
48
49
c4bd737c 50//_____________________________________________________________________________
51AliMonitorITS::AliMonitorITS(const AliMonitorITS& monitor) :
52 AliMonitor(monitor)
53{
54 Fatal("AliMonitorITS", "copy constructor not implemented");
55}
56
57//_____________________________________________________________________________
58AliMonitorITS& AliMonitorITS::operator = (const AliMonitorITS& /*monitor*/)
59{
60 Fatal("operator =", "assignment operator not implemented");
61 return *this;
62}
63
04fa961a 64//_____________________________________________________________________________
65void AliMonitorITS::CreateHistos(TFolder* folder)
66{
67// create the ITS monitor histograms
68
69 fFolder = folder->AddFolder("ITS", "ITS");
70
71 fSDDDigitsCharge = CreateHisto1("SDDDigitsCharge",
72 "charge distribution of SDD digits",
73 128, 0, 256, "charge", "#Delta N/N",
74 AliMonitorHisto::kNormEvents);
75
76 fSSDDigitsCharge = CreateHisto1("SSDDigitsCharge",
77 "charge distribution of SSD digits",
78 100, 0, 200, "charge", "#Delta N/N",
79 AliMonitorHisto::kNormEvents);
80
81 fSDDClustersCharge = CreateHisto1("SDDClustersCharge",
82 "charge distribution of SDD clusters",
83 100, 0, 200, "charge", "#Delta N/N",
84 AliMonitorHisto::kNormEvents);
85
86 fSSDClustersCharge = CreateHisto1("SSDClustersCharge",
87 "charge distribution of SSD clusters",
88 100, 0, 400, "charge", "#Delta N/N",
89 AliMonitorHisto::kNormEvents);
90
91 Int_t nModulesSPD = fGeom->GetLastSPD() - fGeom->GetStartSPD() + 1;
92 fSPDNClustersVsModule = CreateHisto1("SPDNClustersVsModule",
93 "mean number of clusters per SPD module",
94 nModulesSPD, -0.5, nModulesSPD-0.5,
95 "module", "<N_{clusters}>",
96 AliMonitorHisto::kNormEvents);
97
98 Int_t nModulesSDD = fGeom->GetLastSDD() - fGeom->GetStartSDD() + 1;
99 fSDDNClustersVsModule = CreateHisto1("SDDNClustersVsModule",
100 "mean number of clusters per SDD module",
101 nModulesSDD, -0.5, nModulesSDD-0.5,
102 "module", "<N_{clusters}>",
103 AliMonitorHisto::kNormEvents);
104
105 Int_t nModulesSSD = fGeom->GetLastSSD() - fGeom->GetStartSSD() + 1;
106 fSSDNClustersVsModule = CreateHisto1("SSDNClustersVsModule",
107 "mean number of clusters per SSD module",
108 nModulesSSD, -0.5, nModulesSSD-0.5,
109 "module", "<N_{clusters}>",
110 AliMonitorHisto::kNormEvents);
111
112 Int_t nLayer = fGeom->GetNlayers();
113 fNClustersVsLayer = CreateHisto1("NClustersVsLayer",
114 "mean number of clusters per layer",
115 nLayer, 0.5, nLayer+0.5,
116 "layer", "<N_{clusters}>",
117 AliMonitorHisto::kNormEvents);
118
119 fNTracks = CreateHisto1("NTracks", "number of tracks per event",
120 300, 0, 30000, "N_{tracks}", "#Delta N/N",
121 AliMonitorHisto::kNormEvents);
122
123 fNTracksITSTPC = CreateHisto2("NTracksTPCITS",
124 "correlation of number of ITS and TPC tracks per event",
125 30, 0, 30000, 30, 0, 30000,
126 "N_{tracks}(ITS)", "N_{tracks}(TPC)",
127 "#Delta N/N", AliMonitorHisto::kNormEvents);
128
129 fTrackPt = CreateHisto1("TrackPt", "pt distribution of tracks",
130 90, 0, 3, "p_{t} [GeV/c]", "#Delta N/N",
131 AliMonitorHisto::kNormEntries);
132
133 fTrackEta = CreateHisto1("TrackEta", "eta distribution of tracks",
134 100, -2, 2, "#eta", "#Delta N/N",
135 AliMonitorHisto::kNormEntries);
136
137 fTrackPhi = CreateHisto1("TrackPhi", "phi distribution of tracks",
b6a3610d 138 120, -180, 180, "#phi [#circ]", "#Delta N/N",
04fa961a 139 AliMonitorHisto::kNormEntries);
140
141 fTrackDEdxVsP = CreateHisto2("TrackDEdxVsP", "dE/dx of tracks",
142 100, 0, 3, 100, 0, 150,
143 "p [GeV/c]", "dE/dx", "#Delta N/N",
144 AliMonitorHisto::kNormEntries);
145}
146
147
148//_____________________________________________________________________________
149void AliMonitorITS::FillHistos(AliRunLoader* runLoader,
b6a3610d 150 AliRawReader* rawReader, AliESD* esd)
04fa961a 151{
152// fill the ITS monitor histogrms
153
154 rawReader->Reset();
155 AliITSRawStreamSDD inputSDD(rawReader);
156 while (inputSDD.Next()) {
157 fSDDDigitsCharge->Fill(inputSDD.GetSignal());
158 }
159
160 rawReader->Reset();
161 AliITSRawStreamSSD inputSSD(rawReader);
162 while (inputSSD.Next()) {
163 fSSDDigitsCharge->Fill(inputSSD.GetSignal());
164 }
165
166 AliLoader* itsLoader = runLoader->GetLoader("ITSLoader");
167 if (!itsLoader) return;
168
169
170 itsLoader->LoadRecPoints();
171 TTree* clustersTree = itsLoader->TreeR();
172 if (!clustersTree) return;
173 TClonesArray* clusters = new TClonesArray("AliITSclusterV2");
174 clustersTree->SetBranchAddress("Clusters", &clusters);
175
176 for (Int_t iModule = 0; iModule < clustersTree->GetEntries(); iModule++) {
177 clustersTree->GetEntry(iModule);
178 Int_t iLayer, iLadder, iDetector;
179 fGeom->GetModuleId(iModule, iLayer, iLadder, iDetector);
180
181 for (Int_t j = 0; j < clusters->GetEntriesFast(); j++) {
182 AliITSclusterV2* cluster = (AliITSclusterV2*) clusters->At(j);
183 switch (iLayer) {
184 case 1: case 2: {
185 fSPDNClustersVsModule->Fill(iModule - fGeom->GetStartSPD());
186 break;
187 }
188 case 3: case 4: {
189 fSDDClustersCharge->Fill(cluster->GetQ());
190 fSDDNClustersVsModule->Fill(iModule - fGeom->GetStartSDD());
191 break;
192 }
193 case 5: case 6: {
194 fSSDClustersCharge->Fill(cluster->GetQ());
195 fSSDNClustersVsModule->Fill(iModule - fGeom->GetStartSSD());
196 break;
197 }
198 }
199 fNClustersVsLayer->Fill(iLayer);
200 }
201 }
202
203 delete clusters;
204 itsLoader->UnloadRecPoints();
205
206
b6a3610d 207 Int_t nTracks = 0;
208 Int_t nTPCTracks = 0;
209 for (Int_t i = 0; i < esd->GetNumberOfTracks(); i++) {
210 AliESDtrack* track = esd->GetTrack(i);
211 if (!track) continue;
212 if ((track->GetStatus() | AliESDtrack::kTPCin) != 0) nTPCTracks++;
213 if ((track->GetStatus() | AliESDtrack::kITSin) == 0) continue;
214 nTracks++;
215
216 Double_t pxyz[3];
217 track->GetPxPyPz(pxyz);
218 TVector3 pTrack(pxyz);
219 fTrackPt->Fill(pTrack.Pt());
220 fTrackEta->Fill(pTrack.Eta());
221 fTrackPhi->Fill(pTrack.Phi() * TMath::RadToDeg());
222 fTrackDEdxVsP->Fill(pTrack.Mag(), track->GetITSsignal());
04fa961a 223 }
b6a3610d 224 fNTracks->Fill(nTracks);
225 fNTracksITSTPC->Fill(nTracks, nTPCTracks);
04fa961a 226}