Correct formula for phi, in case of current local X <0, in GetLocalXat and GetPhiZat
[u/mrichter/AliRoot.git] / ITS / AliITSQASSDDataMakerRec.cxx
CommitLineData
0730893d 1/**************************************************************************
2 * Copyright(c) 2007-2009, 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/* $Id$ */
16// *************************************************************
17// Checks the quality assurance
18// by comparing with reference data
19// contained in a DB
20// -------------------------------------------------------------
21// W. Ferrarese + P. Cerello Feb 2008
22// INFN Torino
23
24// --- ROOT system ---
25#include <TH2D.h>
26#include <TTree.h>
27#include <TMath.h>
28#include <TString.h>
29#include <TSystem.h>
30
31// --- Standard library ---
32
33// --- AliRoot header files ---
34#include "AliITSQASSDDataMakerRec.h"
35#include "AliQADataMakerRec.h"
36#include "AliLog.h"
4e25ac79 37#include "AliQAv1.h"
0730893d 38#include "AliQAChecker.h"
39#include "AliRawReader.h"
40#include "AliRawReaderRoot.h"
41#include "AliITSRawStreamSSD.h"
42#include "AliITSgeomTGeo.h"
43#include "AliRawEventHeaderBase.h"
44#include "AliITSRecPoint.h"
45#include "AliITSBadChannelsSSDv2.h"
46
47#include "AliCDBManager.h"
48#include "AliCDBEntry.h"
49
50ClassImp(AliITSQASSDDataMakerRec)
51
52AliITSQASSDDataMakerRec::AliITSQASSDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Int_t ldc) :
53TObject(),
54fAliITSQADataMakerRec(aliITSQADataMakerRec),
55fSSDEvent(0),
56fSSDEventPerCycle(0),
57fkOnline(kMode),
58fLDC(ldc),
59fSSDRawsOffset(0), fSSDRawsDAOffset(0),
60fSSDRawsCommonLevelOffset(0),
7a0e5776 61fSSDhRawsTask(0),
62fSSDhRecPointsTask(0),
430bb675 63fGenRawsOffset(0),
64fGenRecPointsOffset(0),
0730893d 65fCDBManager(0) {
66 // Default constructor
67 //initilize the raw signal vs strip number histograms
68 if(fkOnline) {
69 fCDBManager = AliCDBManager::Instance();
162637e4 70 //fCDBManager->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
0730893d 71 fCDBManager->SetDefaultStorage(gSystem->Getenv("AMORE_CDB_URI"));
72 Int_t runNumber = atoi(gSystem->Getenv("DATE_RUN_NUMBER"));
73 if(!runNumber)
5379c4a3 74 AliWarning("DATE_RUN_NUMBER not defined!!!\n");
0730893d 75
76 fCDBManager->SetRun(runNumber);
77 AliCDBEntry *geomGRP = fCDBManager->Get("GRP/Geometry/Data");
5379c4a3 78 if(!geomGRP) AliWarning("GRP geometry not found!!!\n");
0730893d 79
80 Int_t gLayer = 0,gLadder = 0, gModule = 0;
81 Int_t gHistCounter = 0;
82 TString gTitle;
83
84 for(Int_t iModule = 500; iModule < fgkSSDMODULES + 500; iModule++) {
85 AliITSgeomTGeo::GetModuleId(iModule,gLayer,gLadder,gModule);
86 gTitle = "SSD_RawSignal_Layer"; gTitle += gLayer;
87 gTitle += "_Ladder"; gTitle += gLadder;
88 gTitle += "_Module"; gTitle += gModule;
89 fHistSSDRawSignalModule[gHistCounter] = new TH1D(gTitle.Data(),gTitle.Data(),
90 2*fgkNumberOfPSideStrips,0,2*fgkNumberOfPSideStrips);
91 gHistCounter += 1;
92
93 for(Int_t iStrip = 0; iStrip < 2*fgkNumberOfPSideStrips; iStrip++)
94 fOccupancyMatrix[iModule-500][iStrip] = 0;
95 }//module loop
96 }//online flag
97 else {
98 for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++)
99 fHistSSDRawSignalModule[iModule]=NULL;
100 fCDBManager = NULL;
101 }
102}
103
104//____________________________________________________________________________
105AliITSQASSDDataMakerRec::AliITSQASSDDataMakerRec(const AliITSQASSDDataMakerRec& qadm) :
106TObject(),
107fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
108fSSDEvent(qadm.fSSDEvent),
109fSSDEventPerCycle(qadm.fSSDEventPerCycle),
110fkOnline(qadm.fkOnline),
111fLDC(qadm.fLDC),
112fSSDRawsOffset(qadm.fSSDRawsOffset), fSSDRawsDAOffset(qadm.fSSDRawsDAOffset),
113fSSDRawsCommonLevelOffset(qadm.fSSDRawsCommonLevelOffset),
7a0e5776 114fSSDhRawsTask(qadm.fSSDhRawsTask),
115fSSDhRecPointsTask(qadm.fSSDhRecPointsTask),
430bb675 116fGenRawsOffset(qadm.fGenRawsOffset),
117fGenRecPointsOffset(qadm.fGenRecPointsOffset),
0730893d 118fCDBManager(qadm.fCDBManager) {
119 //copy ctor
120 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ;
121 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
122}
123
124//__________________________________________________________________
125AliITSQASSDDataMakerRec& AliITSQASSDDataMakerRec::operator = (const AliITSQASSDDataMakerRec& qac )
126{
127 // Equal operator.
128 this->~AliITSQASSDDataMakerRec();
129 new(this) AliITSQASSDDataMakerRec(qac);
130 return *this;
131}
132
133//__________________________________________________________________
134AliITSQASSDDataMakerRec::~AliITSQASSDDataMakerRec() {
135 // destructor
136 for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++)
137 if(fHistSSDRawSignalModule[iModule]) delete fHistSSDRawSignalModule[iModule];
138 if(fCDBManager) delete fCDBManager;
139}
140
141//____________________________________________________________________________
142void AliITSQASSDDataMakerRec::StartOfDetectorCycle()
143{
144 if ( fAliITSQADataMakerRec->GetRawsData(0) == NULL ) // Raws not defined
145 return ;
146
147 //Detector specific actions at start of cycle
5379c4a3 148 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SSD Cycle\n");
0730893d 149
150 //Data size per DDL
430bb675 151 ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+4)))->Reset();
0730893d 152 //Data size per LDC
430bb675 153 ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+22)))->Reset();
0730893d 154
155 //online part
156 if(fkOnline) {
157 for(Int_t iModule = 500; iModule < fgkSSDMODULES + 500; iModule++) {
158 for(Int_t iStrip = 0; iStrip < 2*fgkNumberOfPSideStrips; iStrip++)
159 fOccupancyMatrix[iModule-500][iStrip] = 0;
160 }//module loop
161
162 Int_t gHistPositionOccupancyPerLadder = 0;
163 Int_t gLayer = 0, gLadder = 0, gModule = 0;
164 for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {
165 AliITSgeomTGeo::GetModuleId(iModule+500,gLayer,gLadder,gModule);
166
167 gHistPositionOccupancyPerLadder = (gLayer == 5) ? 2*(gLadder - 1) : 2*(gLadder - 1 + fgkSSDLADDERSLAYER5);
168
169 //P-SIDE OCCUPANCY
430bb675 170 fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder)->Reset();
0730893d 171 //N-SIDE OCCUPANCY
430bb675 172 fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder+1)->Reset();
0730893d 173
430bb675 174 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6))->Reset();
175 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->Reset();
0730893d 176 }//module loop
177 }//online flag
178}
179
180//____________________________________________________________________________
4e25ac79 181void AliITSQASSDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/)
0730893d 182{
183 // launch the QA checking
184 if ( fAliITSQADataMakerRec->GetRawsData(0) == NULL ) // Raws not defined
185 return ;
0730893d 186 // launch the QA checking
5379c4a3 187 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n");
188 AliDebug(AliQAv1::GetQADebugLevel(), Form("Offset: %d\n",fGenRawsOffset));
0730893d 189 //Data size per DDL
190 for(Int_t i = 0; i < fgkNumOfDDLs; i++) {
430bb675 191 Double_t gSizePerDDL = TMath::Power(10,(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->GetMean())/1e+06;
192 //cout<<"DDL: "<<i+2<<" - Size: "<<gSizePerDDL<<" - Mean: "<<
193 //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->GetMean()<<endl;
194 ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+4)))->SetBinContent(i+2,gSizePerDDL);
0730893d 195 }
196
197 //Data size per LDC
198 for(Int_t i = 0; i < fgkNumOfLDCs; i++) {
430bb675 199 Double_t gSizePerLDC = TMath::Power(10,(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+23+i))->GetMean())/1e+06;
200 ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+22)))->SetBinContent(i+6,gSizePerLDC);
0730893d 201 }
202
203 //online part
204 if(fkOnline) {
205 //Output of the DA
206 MonitorOCDBObjects();
207
208 Int_t gHistPositionOccupancyPerModule = 0;
209 Int_t gLayer = 0, gLadder = 0, gModule = 0;
210 //occupancy per module
211 for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {
212 AliITSgeomTGeo::GetModuleId(iModule+500,gLayer,gLadder,gModule);
213
214 gHistPositionOccupancyPerModule = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);
215 for(Int_t iBins = 1; iBins < fHistSSDRawSignalModule[iModule]->GetXaxis()->GetNbins(); iBins++)
430bb675 216 fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule)->SetBinContent(iBins,fOccupancyMatrix[iModule][iBins-1]);
0730893d 217
218 if(fSSDEventPerCycle != 0)
430bb675 219 ((TH1F *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule)))->Scale(100./fSSDEventPerCycle);
0730893d 220 }//module loop
221
222 //occupancy per ladder
223 Int_t gHistPositionOccupancyPerLadder = 0;
224 Int_t lLadderLocationY = 0;
225 Double_t occupancy = 0.0, occupancyThreshold = 0.0, occupancyAverage = 0.0;
226 for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {
227 AliITSgeomTGeo::GetModuleId(iModule+500,gLayer,gLadder,gModule);
228
229 gHistPositionOccupancyPerModule = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);
230 gHistPositionOccupancyPerLadder = (gLayer == 5) ? 2*(gLadder - 1) : 2*(gLadder - 1 + fgkSSDLADDERSLAYER5);
231
232 //P-SIDE OCCUPANCY
430bb675 233 occupancy = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),0,0,0);
234 occupancyThreshold = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),0,1,3);
235 occupancyAverage = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),0,2,0);
0730893d 236
430bb675 237 fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder)->Fill(gModule,occupancy);
0730893d 238 lLadderLocationY = 3*gLadder; // sideP=1 sideN=0
239 if(gLayer == 5) {
240 //occupancy per module - no threshold
430bb675 241 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6))->SetBinContent(gModule,lLadderLocationY,occupancy);
0730893d 242 //occupancy per module - threshold @ 3%
430bb675 243 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+2))->SetBinContent(gModule,lLadderLocationY,occupancyThreshold);
0730893d 244 //average occupancy per module
430bb675 245 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+4))->SetBinContent(gModule,lLadderLocationY,occupancyAverage);
0730893d 246 }
247 else if(gLayer == 6) {
248 //occupancy per module - no threshold
430bb675 249 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->SetBinContent(gModule,lLadderLocationY,occupancy);
0730893d 250 //occupancy per module - threshold @ 3%
430bb675 251 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+3))->SetBinContent(gModule,lLadderLocationY,occupancyThreshold);
0730893d 252 //average occupancy per module
430bb675 253 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+5))->SetBinContent(gModule,lLadderLocationY,occupancyAverage);
0730893d 254 }
255
256 //N-SIDE OCCUPANCY
430bb675 257 occupancy = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),1,0,0);
258 occupancyThreshold = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),1,1,3);
259 occupancyAverage = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),1,2,0);
0730893d 260
430bb675 261 fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder+1)->Fill(gModule,occupancy);
0730893d 262 if(gLayer == 5) {
263 //occupancy per module - no threshold
430bb675 264 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6))->SetBinContent(gModule,lLadderLocationY-1,occupancy);
0730893d 265 //occupancy per module - threshold @ 3%
430bb675 266 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+2))->SetBinContent(gModule,lLadderLocationY-1,occupancyThreshold);
0730893d 267 //average occupancy per module
430bb675 268 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+4))->SetBinContent(gModule,lLadderLocationY-1,occupancyAverage);
0730893d 269 }
270 else if(gLayer == 6) {
271 //occupancy per module - no threshold
430bb675 272 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->SetBinContent(gModule,lLadderLocationY-1,occupancy);
0730893d 273 //occupancy per module - threshold @ 3%
430bb675 274 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+3))->SetBinContent(gModule,lLadderLocationY-1,occupancyThreshold);
0730893d 275 //average occupancy per module
430bb675 276 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+5))->SetBinContent(gModule,lLadderLocationY-1,occupancyAverage);
0730893d 277 }
278 }//module loop
279 }//online flag for SSD
280
281 fSSDEventPerCycle = 0;
282
4e25ac79 283 // AliQAChecker::Instance()->Run( AliQAv1::kITS , task, list);
0730893d 284}
285
286//____________________________________________________________________________
287void AliITSQASSDDataMakerRec::InitRaws() {
288 // Initialization for RAW data - SSD -
7d297381 289 const Bool_t expert = kTRUE ;
290 const Bool_t saveCorr = kTRUE ;
291 const Bool_t image = kTRUE ;
292
57acd2d2 293 fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries();
0730893d 294
295 if(fkOnline) {
5379c4a3 296 AliDebug(AliQAv1::GetQADebugLevel(), "Book Online Histograms for SSD\n");
0730893d 297 }
298 else {
5379c4a3 299 AliDebug(AliQAv1::GetQADebugLevel(), "Book Offline Histograms for SSD\n ");
0730893d 300 }
5379c4a3 301 AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD): %d\n",fGenRawsOffset));
0730893d 302 TString gTitle = 0;
303 //book online-offline QA histos
430bb675 304 TH1D *fHistSSDEventType = new TH1D("SSD/DataSize/fHistSSDEventType",
0730893d 305 ";Event type;Events",
306 31,-1,30);
307 fAliITSQADataMakerRec->Add2RawsList(fHistSSDEventType,
7d297381 308 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 309 fSSDRawsOffset += 1;
430bb675 310 TH1D *fHistSSDDataSize = new TH1D("SSD/DataSize/fHistSSDDataSize",
0730893d 311 ";log(SSD data size) [Bytes];Events",
312 100,3,8);
313 fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSize,
7d297381 314 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 315 fSSDRawsOffset += 1;
430bb675 316 TH1D *fHistSSDDataSizePercentage = new TH1D("SSD/DataSize/fHistSSDDataSizePercentage",
0730893d 317 ";SSD data size [%];Events",
318 100,0,100);
319 fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePercentage,
7d297381 320 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 321 fSSDRawsOffset += 1;
430bb675 322 TH1D *fHistSSDDDLId = new TH1D("SSD/DDL/fHistSSDDDLId",
0730893d 323 ";DDL id;Events",20,510.5,530.5);
324 fAliITSQADataMakerRec->Add2RawsList(fHistSSDDDLId,
7d297381 325 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 326 fSSDRawsOffset += 1;
430bb675 327 TH1D *fHistSSDDataSizePerDDL = new TH1D("SSD/DataSize/fHistSSDDataSizePerDDL",
0730893d 328 ";DDL id;<SSD data size> [MB]",
329 20,510.5,530.5);
330 fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerDDL,
7d297381 331 fGenRawsOffset+fSSDRawsOffset, !expert, image, !saveCorr);
0730893d 332 fSSDRawsOffset += 1;
430bb675 333 TH1D *fHistSSDDataSizeDDL[fgkNumOfDDLs];
0730893d 334 for(Int_t i = 1; i < fgkNumOfDDLs+1; i++) {
c672a510 335 gTitle = "SSD/DDL/fHistSSDDataSizeDDL"; gTitle += i+511;
430bb675 336 fHistSSDDataSizeDDL[i-1] = new TH1D(gTitle.Data(),
0730893d 337 ";log(SSD data size) [Bytes];Events",
338 100,1,8);
339 fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizeDDL[i-1],
7d297381 340 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 341 fSSDRawsOffset += 1;
342 }
343
430bb675 344 TH1D *fHistSSDLDCId = new TH1D("SSD/LDC/fHistSSDLDCId",";LDC id;Events",10,0.5,10.5);
0730893d 345 fAliITSQADataMakerRec->Add2RawsList(fHistSSDLDCId,
7d297381 346 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 347 fSSDRawsOffset += 1;
430bb675 348 TH1D *fHistSSDDataSizePerLDC = new TH1D("SSD/DataSize/fHistSSDDataSizePerLDC",
0730893d 349 ";LDC id;<SSD data size> [MB]",
350 20,0.5,20.5);
351 fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerLDC,
7d297381 352 fGenRawsOffset+fSSDRawsOffset, !expert, image, !saveCorr);
0730893d 353 fSSDRawsOffset += 1;
430bb675 354 TH1D *fHistSSDDataSizeLDC[fgkNumOfLDCs];
0730893d 355 for(Int_t i = 1; i < fgkNumOfLDCs+1; i++) {
c672a510 356 gTitle = "SSD/LDC/fHistSSDDataSizeLDC";
0730893d 357 if(i == 1) gTitle += "082";
358 if(i == 2) gTitle += "086";
359 if(i == 3) gTitle += "085";
430bb675 360 fHistSSDDataSizeLDC[i-1] = new TH1D(gTitle.Data(),
0730893d 361 ";log(SSD data size) [Bytes];Events",
362 100,1,8);
363 fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizeLDC[i-1],
7d297381 364 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 365 fSSDRawsOffset += 1;
366 }
367 fSSDRawsCommonLevelOffset = fSSDRawsOffset;
368
369 if(fkOnline) {
370 Int_t gLayer = 0, gLadder = 0, gModule = 0;
371 //occupancy per SSD module
372 TH1D *fHistSSDOccupancyModule[fgkSSDMODULES];
373 for(Int_t i = 500; i < fgkSSDMODULES + 500; i++) {
374 AliITSgeomTGeo::GetModuleId(i,gLayer,gLadder,gModule);
c672a510 375 gTitle = "SSD/Occupancy/Layer"; gTitle += gLayer;
376 gTitle += "/Ladder";
377 if(gLayer == 5) {
378 gTitle += 499+gLadder;
379 gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += gLayer;
380 gTitle += "_Ladder";
0730893d 381 gTitle += 499+gLadder;
c672a510 382 }
383 if(gLayer == 6) {
0730893d 384 gTitle += 599+gLadder;
c672a510 385 gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += gLayer;
386 gTitle += "_Ladder";
387 gTitle += 599+gLadder;
388 }
0730893d 389 gTitle += "_Module"; gTitle += gModule;
390 fHistSSDOccupancyModule[i-500] = new TH1D(gTitle.Data(),gTitle.Data(),
391 2*fgkNumberOfPSideStrips,0,2*fgkNumberOfPSideStrips);
392 fHistSSDOccupancyModule[i-500]->GetXaxis()->SetTitleColor(1);
393 fHistSSDOccupancyModule[i-500]->GetXaxis()->SetTitle("N_{strip}");
394 fHistSSDOccupancyModule[i-500]->GetYaxis()->SetTitle("Occupancy [%]");
c672a510 395 fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyModule[i-500],
7d297381 396 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 397 fSSDRawsOffset += 1;
398 }
399
400 //Occupancy per SSD ladder
401 Int_t occupancyCounter = 0;
402 TH1D *fHistSSDOccupancyLadder[2*(fgkSSDLADDERSLAYER5 + fgkSSDLADDERSLAYER6)];
403 for(Int_t iLayer = 5; iLayer < 7; iLayer++) {
404 for(Int_t iLadder = 1; iLadder < AliITSgeomTGeo::GetNLadders(iLayer) + 1; iLadder++) {
405 //P-side occupancy plots
c672a510 406 gTitle = "SSD/Occupancy/Layer"; gTitle += iLayer;
407 gTitle += "/Ladder";
408 if(iLayer == 5) {
409 gTitle += 499+iLadder;
410 gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += iLayer;
411 gTitle += "_Ladder";
0730893d 412 gTitle += 499+iLadder;
c672a510 413 }
414 if(iLayer == 6) {
0730893d 415 gTitle += 599+iLadder;
c672a510 416 gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += iLayer;
417 gTitle += "_Ladder";
418 gTitle += 599+iLadder;
419 }
0730893d 420 gTitle += "_PSide";
421 fHistSSDOccupancyLadder[occupancyCounter] = new TH1D(gTitle.Data(),
422 gTitle.Data(),
423 AliITSgeomTGeo::GetNDetectors(iLayer),
424 0.5,AliITSgeomTGeo::GetNDetectors(iLayer)+0.5);
425 fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitleColor(1);
426 fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitle("Module number");
427 fHistSSDOccupancyLadder[occupancyCounter]->GetYaxis()->SetTitle("Occupancy [%]");
428 fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLadder[occupancyCounter],
7d297381 429 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 430 occupancyCounter += 1; fSSDRawsOffset += 1;
431 //N-side occupancy plots
c672a510 432 gTitle = "SSD/Occupancy/Layer"; gTitle += iLayer;
433 gTitle += "/Ladder";
434 if(iLayer == 5) {
0730893d 435 gTitle += 499+iLadder;
c672a510 436 gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += iLayer;
437 gTitle += "_Ladder";
438 gTitle += 499+iLadder;
439 }
440 if(iLayer == 6) {
441 gTitle += 599+iLadder;
442 gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += iLayer;
443 gTitle += "_Ladder";
0730893d 444 gTitle += 599+iLadder;
c672a510 445 }
0730893d 446 gTitle += "_NSide";
447 fHistSSDOccupancyLadder[occupancyCounter] = new TH1D(gTitle.Data(),
448 gTitle.Data(),
449 AliITSgeomTGeo::GetNDetectors(iLayer),
450 0.5,AliITSgeomTGeo::GetNDetectors(iLayer)+0.5);
451 fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitleColor(1);
452 fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitle("Module number");
453 fHistSSDOccupancyLadder[occupancyCounter]->GetYaxis()->SetTitle("Occupancy [%]");
454 fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLadder[occupancyCounter],
7d297381 455 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 456 occupancyCounter += 1; fSSDRawsOffset += 1;
457 }//ladder loop
458 }//layer loop
459
460 //top level occupancy plots
461 //occupancy per module - no threshold
c672a510 462 TH2D *fHistSSDOccupancyLayer5 = new TH2D("SSD/Occupancy/Layer5/fHistSSDOccupancyLayer5",
0730893d 463 ";N_{modules};N_{Ladders}",
464 fgkSSDMODULESPERLADDERLAYER5,
465 0,fgkSSDMODULESPERLADDERLAYER5,
466 3*fgkSSDLADDERSLAYER5,
430bb675 467 5000,500+fgkSSDLADDERSLAYER5);
0730893d 468 fHistSSDOccupancyLayer5->SetTitle("Occupancy per module (Layer 5) - No threshold");
430bb675 469 fHistSSDOccupancyLayer5->GetZaxis()->SetRangeUser(0.0,100.0);
0730893d 470 Char_t fLabel[3];
471 for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){
472 sprintf(fLabel,"%d",iBin);
473 fHistSSDOccupancyLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);
474 }
c672a510 475 fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLayer5,
7d297381 476 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 477 fSSDRawsOffset += 1;
c672a510 478 TH2D *fHistSSDOccupancyLayer6 = new TH2D("SSD/Occupancy/Layer6/fHistSSDOccupancyLayer6",
0730893d 479 ";N_{modules};N_{Ladders}",
480 fgkSSDMODULESPERLADDERLAYER6,
481 0,fgkSSDMODULESPERLADDERLAYER6,
482 3*fgkSSDLADDERSLAYER6,
430bb675 483 600,600+fgkSSDLADDERSLAYER6);
0730893d 484 fHistSSDOccupancyLayer6->SetTitle("Occupancy per module (Layer 6) - No threshold");
430bb675 485 fHistSSDOccupancyLayer6->GetZaxis()->SetRangeUser(0.0,100.0);
0730893d 486 for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){
487 sprintf(fLabel,"%d",iBin);
488 fHistSSDOccupancyLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);
489 }
c672a510 490 fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLayer6,
7d297381 491 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 492 fSSDRawsOffset += 1;
493
494 //occupancy per module - threshold @ 3%
c672a510 495 TH2D *fHistSSDOccupancyThresholdLayer5 = new TH2D("SSD/Occupancy/Layer5/fHistSSDOccupancyThresholdLayer5",
0730893d 496 ";N_{modules};N_{Ladders}",
497 fgkSSDMODULESPERLADDERLAYER5,
498 0,fgkSSDMODULESPERLADDERLAYER5,
499 3*fgkSSDLADDERSLAYER5,
430bb675 500 500,500+fgkSSDLADDERSLAYER5);
0730893d 501 fHistSSDOccupancyThresholdLayer5->SetTitle("Occupancy per module (Layer 5) - Threshold 3%");
430bb675 502 fHistSSDOccupancyThresholdLayer5->GetZaxis()->SetRangeUser(3.0,10.0);
c672a510 503 for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){
0730893d 504 sprintf(fLabel,"%d",iBin);
505 fHistSSDOccupancyThresholdLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);
c672a510 506 }
507 fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyThresholdLayer5,
7d297381 508 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 509 fSSDRawsOffset += 1;
c672a510 510 TH2D *fHistSSDOccupancyThresholdLayer6 = new TH2D("SSD/Occupancy/Layer6/fHistSSDOccupancyThresholdLayer6",
0730893d 511 ";N_{modules};N_{Ladders}",
512 fgkSSDMODULESPERLADDERLAYER6,
513 0,fgkSSDMODULESPERLADDERLAYER6,
514 3*fgkSSDLADDERSLAYER6,
430bb675 515 600,600+fgkSSDLADDERSLAYER6);
0730893d 516 fHistSSDOccupancyThresholdLayer6->SetTitle("Occupancy per module (Layer 6) - Threshold 3%");
430bb675 517 fHistSSDOccupancyThresholdLayer6->GetZaxis()->SetRangeUser(3.0,10.0);
0730893d 518 for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){
519 sprintf(fLabel,"%d",iBin);
520 fHistSSDOccupancyThresholdLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);
521 }
c672a510 522 fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyThresholdLayer6,
7d297381 523 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 524 fSSDRawsOffset += 1;
525
526 //Average occupancy per module
c672a510 527 TH2D *fHistSSDAverageOccupancyLayer5 = new TH2D("SSD/Occupancy/Layer5/fHistSSDAverageOccupancyLayer5",
0730893d 528 ";N_{modules};N_{Ladders}",
529 fgkSSDMODULESPERLADDERLAYER5,
530 0,fgkSSDMODULESPERLADDERLAYER5,
531 3*fgkSSDLADDERSLAYER5,
430bb675 532 500,500+fgkSSDLADDERSLAYER5);
0730893d 533 fHistSSDAverageOccupancyLayer5->SetTitle("Average occupancy per module (Layer 5)");
430bb675 534 fHistSSDAverageOccupancyLayer5->GetZaxis()->SetRangeUser(0.0,5.0);
0730893d 535 for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){
536 sprintf(fLabel,"%d",iBin);
537 fHistSSDAverageOccupancyLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);
538 }
c672a510 539 fAliITSQADataMakerRec->Add2RawsList(fHistSSDAverageOccupancyLayer5,
430bb675 540 fGenRawsOffset+fSSDRawsOffset);
0730893d 541 fSSDRawsOffset += 1;
c672a510 542 TH2D *fHistSSDAverageOccupancyLayer6 = new TH2D("SSD/Occupancy/Layer6/fHistSSDAverageOccupancyLayer6",
0730893d 543 ";N_{modules};N_{Ladders}",
544 fgkSSDMODULESPERLADDERLAYER6,
545 0,fgkSSDMODULESPERLADDERLAYER6,
546 3*fgkSSDLADDERSLAYER6,
430bb675 547 600,600+fgkSSDLADDERSLAYER6);
0730893d 548 fHistSSDAverageOccupancyLayer6->SetTitle("Average occupancy per module (Layer 6)");
430bb675 549 fHistSSDAverageOccupancyLayer6->GetZaxis()->SetRangeUser(0.0,5.0);
0730893d 550 for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){
551 sprintf(fLabel,"%d",iBin);
552 fHistSSDAverageOccupancyLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);
553 }
c672a510 554 fAliITSQADataMakerRec->Add2RawsList(fHistSSDAverageOccupancyLayer6,
7d297381 555 fGenRawsOffset+fSSDRawsOffset, !expert, image, !saveCorr);
0730893d 556 fSSDRawsOffset += 1;
557
558 //Output of the DA
c672a510 559 TH2D *fHistPSideBadChannelMapLayer5 = new TH2D("SSD/BadChannels/fHistPSideBadChannelMapLayer5",
0730893d 560 "Layer 5;N_{module};N_{ladder}",
561 22,1,23,
562 34,500,534);
563 fHistPSideBadChannelMapLayer5->GetXaxis()->SetTitleColor(1);
564 fHistPSideBadChannelMapLayer5->SetStats(kFALSE);
565 fHistPSideBadChannelMapLayer5->GetYaxis()->SetTitleOffset(1.8);
566 fHistPSideBadChannelMapLayer5->GetXaxis()->SetNdivisions(22);
567 fHistPSideBadChannelMapLayer5->GetYaxis()->SetNdivisions(34);
568 fHistPSideBadChannelMapLayer5->GetXaxis()->SetLabelSize(0.03);
569 fHistPSideBadChannelMapLayer5->GetYaxis()->SetLabelSize(0.03);
570 fHistPSideBadChannelMapLayer5->GetZaxis()->SetTitleOffset(1.6);
571 fHistPSideBadChannelMapLayer5->GetZaxis()->SetTitle("Bad channels (p-side)[%]");
c672a510 572 fAliITSQADataMakerRec->Add2RawsList(fHistPSideBadChannelMapLayer5,
7d297381 573 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 574 fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
575
c672a510 576 TH2D *fHistNSideBadChannelMapLayer5 = new TH2D("SSD/BadChannels/fHistNSideBadChannelMapLayer5",
0730893d 577 "Layer 5;N_{module};N_{ladder}",
578 22,1,23,
579 34,500,534);
580 fHistNSideBadChannelMapLayer5->GetXaxis()->SetTitleColor(1);
581 fHistNSideBadChannelMapLayer5->SetStats(kFALSE);
582 fHistNSideBadChannelMapLayer5->GetYaxis()->SetTitleOffset(1.8);
583 fHistNSideBadChannelMapLayer5->GetXaxis()->SetNdivisions(22);
584 fHistNSideBadChannelMapLayer5->GetYaxis()->SetNdivisions(34);
585 fHistNSideBadChannelMapLayer5->GetXaxis()->SetLabelSize(0.03);
586 fHistNSideBadChannelMapLayer5->GetYaxis()->SetLabelSize(0.03);
587 fHistNSideBadChannelMapLayer5->GetZaxis()->SetTitleOffset(1.6);
588 fHistNSideBadChannelMapLayer5->GetZaxis()->SetTitle("Bad channels (n-side)[%]");
c672a510 589 fAliITSQADataMakerRec->Add2RawsList(fHistNSideBadChannelMapLayer5,
7d297381 590 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 591 fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
592
c672a510 593 TH2D *fHistPSideBadChannelMapLayer6 = new TH2D("SSD/BadChannels/fHistPSideBadChannelMapLayer6",
0730893d 594 "Layer 6;N_{module};N_{ladder}",
595 25,1,26,
596 38,600,638);
597 fHistPSideBadChannelMapLayer6->GetXaxis()->SetTitleColor(1);
598 fHistPSideBadChannelMapLayer6->SetStats(kFALSE);
599 fHistPSideBadChannelMapLayer6->GetYaxis()->SetTitleOffset(1.8);
600 fHistPSideBadChannelMapLayer6->GetXaxis()->SetNdivisions(25);
601 fHistPSideBadChannelMapLayer6->GetYaxis()->SetNdivisions(38);
602 fHistPSideBadChannelMapLayer6->GetXaxis()->SetLabelSize(0.03);
603 fHistPSideBadChannelMapLayer6->GetYaxis()->SetLabelSize(0.03);
604 fHistPSideBadChannelMapLayer6->GetZaxis()->SetTitleOffset(1.6);
605 fHistPSideBadChannelMapLayer6->GetZaxis()->SetTitle("Bad channels (p-side)[%]");
c672a510 606 fAliITSQADataMakerRec->Add2RawsList(fHistPSideBadChannelMapLayer6,
7d297381 607 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 608 fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
609
c672a510 610 TH2D *fHistNSideBadChannelMapLayer6 = new TH2D("SSD/BadChannels/fHistNSideBadChannelMapLayer6",
0730893d 611 "Layer 6;N_{module};N_{ladder}",
612 25,1,26,
613 38,600,638);
614 fHistNSideBadChannelMapLayer6->GetXaxis()->SetTitleColor(1);
615 fHistNSideBadChannelMapLayer6->SetStats(kFALSE);
616 fHistNSideBadChannelMapLayer6->GetYaxis()->SetTitleOffset(1.8);
617 fHistNSideBadChannelMapLayer6->GetXaxis()->SetNdivisions(25);
618 fHistNSideBadChannelMapLayer6->GetYaxis()->SetNdivisions(38);
619 fHistNSideBadChannelMapLayer6->GetXaxis()->SetLabelSize(0.03);
620 fHistNSideBadChannelMapLayer6->GetYaxis()->SetLabelSize(0.03);
621 fHistNSideBadChannelMapLayer6->GetZaxis()->SetTitleOffset(1.6);
622 fHistNSideBadChannelMapLayer6->GetZaxis()->SetTitle("Bad channels (n-side)[%]");
c672a510 623 fAliITSQADataMakerRec->Add2RawsList(fHistNSideBadChannelMapLayer6,
7d297381 624 fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
0730893d 625 fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
626 }//online flag
7a0e5776 627
628 fSSDhRawsTask = fSSDRawsOffset;
5379c4a3 629 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Raws histograms booked\n",fSSDhRawsTask));
630 AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset+fSSDhRawsTask));
631 AliDebug(AliQAv1::GetQADebugLevel(),Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset+fSSDRawsOffset));
7a0e5776 632
633 /*
0730893d 634 fSSDhTask = fSSDRawsOffset;
5379c4a3 635 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Raws histograms booked\n",fSSDhTask));
636 AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset+fSSDhTask));
637 AliDebug(AliQAv1::GetQADebugLevel(),Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset+fSSDRawsOffset));
7a0e5776 638 */
0730893d 639}
640
641//____________________________________________________________________________
642void AliITSQASSDDataMakerRec::MakeRaws(AliRawReader* rawReader) {
643 // Fill QA for RAW - SSD -
644 Int_t gStripNumber;
645 Int_t gHistPosition;
646 Int_t gLayer = 0,gLadder = 0, gModule = 0;
647
648 Double_t gSizePerDDL[fgkNumOfDDLs] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
649 Double_t gSizePerLDC[fgkNumOfLDCs] = {0.,0.,0.};
650 Double_t sumSSDDataSize = 0.0;
651 Double_t eventSize = -1.0;
652
653 if(fkOnline) {
654 //reset the signal vs strip number histograms
655 for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++)
656 fHistSSDRawSignalModule[iModule]->Reset();
657 }//online flag
658
659 rawReader->Select("ITSSSD",-1,-1);
660 rawReader->Reset(); //rawReader->NextEvent();
430bb675 661 (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset))->Fill(rawReader->GetType());
0730893d 662 if(rawReader->GetType() == 7) {
663 fSSDEvent += 1;
664 fSSDEventPerCycle += 1;
665 }
666
667 AliITSRawStreamSSD gSSDStream(rawReader);
668 AliRawReaderRoot *rootReader = (AliRawReaderRoot *)rawReader;
669 if(rootReader) {
670 const AliRawEventHeaderBase *header = rootReader->GetEventHeader();
671 if(header)
672 eventSize = header->GetEventSize();
673 }
674 while (gSSDStream.Next()) {
675 if(gSSDStream.GetModuleID() < 0) continue;
676 /*cout<<"DDL: "<<rawReader->GetDDLID()<<
677 " - LDC: "<<rawReader->GetLDCId()<<
678 " - Size: "<<rawReader->GetDataSize()<<
679 " - Equipment size: "<<rawReader->GetEquipmentSize()<<endl;*/
680 gSizePerDDL[rawReader->GetDDLID()] = rawReader->GetDataSize();
681 gSizePerLDC[rawReader->GetLDCId()-6] = rawReader->GetDataSize();
682 AliITSgeomTGeo::GetModuleId(gSSDStream.GetModuleID(),gLayer,gLadder,gModule);
683 if(gSSDStream.GetStrip() < 0) continue;
684 gStripNumber = (gSSDStream.GetSideFlag() == 0) ? gSSDStream.GetStrip() : -gSSDStream.GetStrip() + 2*fgkNumberOfPSideStrips;
685 gHistPosition = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);
5379c4a3 686 //AliDebug(AliQAv1::GetQADebugLevel(), Form("ModulePosition: %d - Layer: %d - Ladder: %d - Module: %d\n",gHistPosition,gLayer,gLadder,gModule));
0730893d 687 if(fkOnline)
688 fHistSSDRawSignalModule[gHistPosition]->Fill(gStripNumber,gSSDStream.GetSignal());
430bb675 689 //fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+gHistPosition+fSSDRawsCommonLevelOffset)->Fill(gStripNumber,gSSDStream.GetSignal());
0730893d 690 }//streamer loop
691
692 //event size calculation and filling info
693 for(Int_t i = 0; i < fgkNumOfDDLs; i++) {
694 sumSSDDataSize += gSizePerDDL[i];
695 if(gSizePerDDL[i] > 0) {
430bb675 696 (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+3))->Fill(i+512);
697 (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->Fill(TMath::Log10(gSizePerDDL[i]));
0730893d 698 }
430bb675 699 //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+4))->Fill(i+512,gSizePerDDL[i]/1e+06);
0730893d 700 }
701 for(Int_t i = 0; i < fgkNumOfLDCs; i++) {
702 if(gSizePerLDC[i] > 0) {
430bb675 703 (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+21))->Fill(i+6);
0730893d 704 //LDC 082
705 if(i == 0)
706 gSizePerLDC[i] = gSizePerDDL[8] + gSizePerDDL[9] + gSizePerDDL[10] +
707 gSizePerDDL[11] + gSizePerDDL[12] + gSizePerDDL[13];
708 //LDC 086
709 if(i == 1)
710 gSizePerLDC[i] = gSizePerDDL[3] + gSizePerDDL[4] + gSizePerDDL[5] +
711 gSizePerDDL[6] + gSizePerDDL[7];
712 //LDC 085
713 if(i == 2)
714 gSizePerLDC[i] = gSizePerDDL[0] + gSizePerDDL[1] + gSizePerDDL[2] +
715 gSizePerDDL[14] + gSizePerDDL[15];
430bb675 716 (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+23+i))->Fill(TMath::Log10(gSizePerLDC[i]));
0730893d 717 //cout<<"Event: "<<fSSDEventPerCycle<<" - LDC: "<<i+6<<
718 //" - Data size: "<<gSizePerLDC[i]<<endl;
719 }
430bb675 720 //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+22))->Fill(i+6,gSizePerLDC[i]/1e+06);
0730893d 721 }
722 if(sumSSDDataSize)
430bb675 723 (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+1))->Fill(TMath::Log10(sumSSDDataSize));
0730893d 724 if(eventSize)
430bb675 725 (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+2))->Fill(100.*sumSSDDataSize/eventSize);
0730893d 726
727 //Occupancy calculation
728 if(fkOnline) {
729 for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) {
730 GetOccupancyStrip(fHistSSDRawSignalModule[iModule],fOccupancyMatrix[iModule]);
731 //if(iModule == 156) {
732 //cout<<"========================================"<<endl;
733 //AliITSgeomTGeo::GetModuleId(656,gLayer,gLadder,gModule);
734 /*for(Int_t iBin = 1; iBin < fHistSSDRawSignalModule[iModule]->GetXaxis()->GetNbins(); iBin++) {
735 if((iBin >= 750)&&(iBin <= 780))
736 cout<<"Event: "<<fSSDEventPerCycle<<" - Ladder: "<<gLadder+499<<
737 " - Module: "<<gModule<<" - Strip: "<<iBin<<
738 " - Signal: "<<fHistSSDRawSignalModule[iModule]->GetBinContent(iBin)<<endl;
739 }*///strip loop --> to be removed
740 //}//module cut --> to be removed
741 }//module loop
742 }//online flag for SSD
743}
744
745//____________________________________________________________________________ //
746void AliITSQASSDDataMakerRec::GetOccupancyStrip(TH1 *lHisto, Int_t *occupancyMatrix) {
747 //Increments the entries in the occupancy matrix based
748 //on whether the signal for each strip is larger than the cutoff
749 //Currently the cutoff is at 0 which means that if ZS
750 //works, whatever comes from the FEROM is considered as "signal"
751 //Double_t cutoff = 0.0;
752 TString histname = lHisto->GetName();
753 //cout<<histname.Data()<<endl;
754 //if(histname.Contains("Layer5_Ladder8_Module3")) {
755 for(Int_t iBin = 1; iBin < lHisto->GetXaxis()->GetNbins(); iBin++) {
756 Double_t y = lHisto->GetBinContent(iBin);
757 if(y) {
758 occupancyMatrix[iBin-1] += 1;
759 }
760 //if((iBin >= 750)&&(iBin <= 780))
761 //cout<<"Strip: "<<iBin<<
762 //" - Signal: "<<y<<
763 //" - Occupancy: "<<occupancyMatrix[iBin-1]<<endl;
764
765 }
766 //}
767}
768
769//____________________________________________________________________________
770Double_t AliITSQASSDDataMakerRec::GetOccupancyModule(TH1 *lHisto,
771 Int_t stripside,
772 Int_t mode,
773 Double_t threshold) {
774 //Mode 0: calculates the occupancy of a module
775 // without a threshold in the strip occupancy
776 //Mode 1: calculates the occupancy of a module
777 // with the set threshold in the strip occupancy
778 //Mode 2: calculates the average occupancy of a module
779
780 // bo: TDC >0 or # of sigmas wrt noise ?
781 //stripside == 0 --> P-side
782 //stripside == 1 --> N-side
783 Int_t lNumFiredBins = 0;
784 Double_t sumOccupancy = 0.0;
785 TString histname = lHisto->GetName();
786 for(Int_t iBin = 1 + stripside*fgkNumberOfPSideStrips; iBin < fgkNumberOfPSideStrips*(1 + stripside); iBin++){
787 /*if(histname.Contains("Layer5_Ladder507_Module3")) {
788 cout<<lHisto->GetName()<<
789 " - Strip: "<<iBin<<
790 " - Bin content: "<<lHisto->GetBinContent(iBin)<<endl;
791 }*/
792 if (lHisto->GetBinContent(iBin) > threshold) {
793 lNumFiredBins++;
794 sumOccupancy = lHisto->GetBinContent(iBin);
795 }
796 }
797
798 Double_t lOccupancy = 0.0;
799 if((mode == 0)||(mode == 1))
800 lOccupancy = (100.*lNumFiredBins)/fgkNumberOfPSideStrips; // percentage
801 else if(mode == 2)
802 lOccupancy = 100.*sumOccupancy/fgkNumberOfPSideStrips;
803
804 /*if(histname.Contains("Layer5_Ladder507_Module3"))
805 cout<<"Fired strips: "<<lNumFiredBins<<
806 " - Occupancy: "<<lOccupancy<<endl;*/
5379c4a3 807 //AliDebug(AliQAv1::GetQADebugLevel(), Form("Fired strips: %d - Total strips: %d - Occupancy :%lf\n",lNumFiredBins,lHisto->GetNbinsX(),lOccupancy));
0730893d 808
809 return lOccupancy;
810}
811
812//____________________________________________________________________________
813void AliITSQASSDDataMakerRec::MonitorOCDBObjects() {
814 //Monitor in AMORE the output of the DA
815 //Currently only the bad channel list is monitored
816 //Todo: Noise - Pedestal
430bb675 817 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset))->Reset();
818 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+1))->Reset();
819 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+2))->Reset();
820 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+3))->Reset();
c672a510 821
0730893d 822 AliCDBEntry *entryBadChannelsSSD = fCDBManager->Get("ITS/Calib/BadChannelsSSD");
823 if(!entryBadChannelsSSD)
824 AliError("OCDB entry for the bad channel list is not valid!");
825 AliITSBadChannelsSSDv2 *badchannelsSSD = (AliITSBadChannelsSSDv2 *)entryBadChannelsSSD->GetObject();
826 if(!badchannelsSSD)
827 AliError("Bad channel list object is not a valid AliITSBadChannelsSSD object!");
828
829 //_____________________________________________________________________________//
830 Int_t nBadPSideChannels = 0, nBadNSideChannels = 0;
831 Int_t layer = 0, ladder = 0, module = 0;
832 Int_t nPSideChannelsLayer5 = 0, nNSideChannelsLayer5 = 0;
833 Int_t nPSideChannelsLayer6 = 0, nNSideChannelsLayer6 = 0;
834 //_____________________________________________________________________________//
835
836 for(Int_t i = 0; i < fgkSSDMODULES; i++) {
837 AliITSgeomTGeo::GetModuleId(i+500,layer,ladder,module);
838 nBadPSideChannels = 0, nBadNSideChannels = 0;
839 nPSideChannelsLayer5 = 0, nNSideChannelsLayer5 = 0;
840 nPSideChannelsLayer6 = 0, nNSideChannelsLayer6 = 0;
841
842 Int_t badChannel = 0;
843 for(Int_t j = 0; j < fgkNumberOfPSideStrips; j++) {
844 badChannel = (Int_t)(badchannelsSSD->GetBadChannelP(i,j));
845 if(badChannel != 0) {
846 if(layer == 5)
847 nPSideChannelsLayer5 += 1;
848 if(layer == 6)
849 nPSideChannelsLayer6 += 1;
850 nBadPSideChannels += 1;
851 }//badchannel flag != 0
852 badChannel = (Int_t)(badchannelsSSD->GetBadChannelN(i,j));
853 if(badChannel != 0) {
854 if(layer == 5)
855 nNSideChannelsLayer5 += 1;
856 if(layer == 6)
857 nNSideChannelsLayer6 += 1;
858 nBadNSideChannels += 1;
859 }//badchannel flag != 0
860 }//loop over strips
861 if(layer == 5) {
862 if(nPSideChannelsLayer5 > 0)
430bb675 863 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset))->Fill(module,499+ladder,
0730893d 864 100.*nPSideChannelsLayer5/fgkNumberOfPSideStrips);
430bb675 865 else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset))->Fill(module,499+ladder,0.0001);
0730893d 866 if(nNSideChannelsLayer5 > 0)
430bb675 867 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+1))->Fill(module,499+ladder,
0730893d 868 100.*nNSideChannelsLayer5/fgkNumberOfPSideStrips);
430bb675 869 else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+1))->Fill(module,499+ladder,0.0001);
0730893d 870 }//layer 5
871 if(layer == 6) {
872 if(nPSideChannelsLayer6 > 0)
430bb675 873 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+2))->Fill(module,599+ladder,
0730893d 874 100.*nPSideChannelsLayer6/fgkNumberOfPSideStrips);
430bb675 875 else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+2))->Fill(module,599+ladder,0.0001);
0730893d 876 if(nNSideChannelsLayer6 > 0)
430bb675 877 ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+3))->Fill(module,599+ladder,
0730893d 878 100.*nNSideChannelsLayer6/fgkNumberOfPSideStrips);
430bb675 879 else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+3))->Fill(module,599+ladder,0.0001);
0730893d 880 }//layer 6
881 }//module loop
882}
883
884//____________________________________________________________________________
885void AliITSQASSDDataMakerRec::InitRecPoints()
886{
887 // Initialization for RECPOINTS - SSD -
7d297381 888 const Bool_t expert = kTRUE ;
889 const Bool_t image = kTRUE ;
890
57acd2d2 891 fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
5379c4a3 892 //AliDebug(AliQAv1::GetQADebugLevel(), Form("**-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints offset %d \t %d \n",fGenOffset,fGenRecPointsOffset));
0730893d 893 Int_t nModuleOffset = 500;
894 Int_t nITSTotalModules = AliITSgeomTGeo::GetNModules();
895
c672a510 896 TH1F *fHistSSDModuleIdLayer5 = new TH1F("SSD/Statistics/fHistSSDModuleIdLayer5",
0730893d 897 "Module Id - Layer 5;Module Id;Entries",
898 fgkSSDMODULESLAYER5,
899 nModuleOffset - 0.5,
900 nITSTotalModules-fgkSSDMODULESLAYER6+0.5);
c672a510 901 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDModuleIdLayer5,
7d297381 902 fGenRecPointsOffset + 0, expert, !image);
7a0e5776 903 fSSDhRecPointsTask += 1;
c672a510 904 TH1F *fHistSSDModuleIdLayer6 = new TH1F("SSD/Statistics/fHistSSDModuleIdLayer6",
0730893d 905 "Module Id - Layer 6;Module Id;Entries",
906 fgkSSDMODULESLAYER6,
907 nModuleOffset+fgkSSDMODULESLAYER5 - 0.5,
908 nITSTotalModules + 0.5);
c672a510 909 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDModuleIdLayer6,
7d297381 910 fGenRecPointsOffset + 1, expert, !image);
7a0e5776 911 fSSDhRecPointsTask += 1;
c672a510 912 TH1F *fHistSSDClusterPerEventLayer5 = new TH1F("SSD/Statistics/fHistSSDClusterPerEventLayer5",
0730893d 913 "N_{clusters} - Layer 5;N_{clusters};Entries;",
914 100,0.1,5000);
c672a510 915 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterPerEventLayer5,
7d297381 916 fGenRecPointsOffset + 2, expert, !image);
7a0e5776 917 fSSDhRecPointsTask += 1;
c672a510 918 TH1F *fHistSSDClusterPerEventLayer6 = new TH1F("SSD/Statistics/fHistSSDClusterPerEventLayer6",
0730893d 919 "N_{clusters} - Layer 6;N_{clusters};Entries;",
920 100,0.1,5000);
c672a510 921 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterPerEventLayer6,
7d297381 922 fGenRecPointsOffset + 3, expert, !image);
7a0e5776 923 fSSDhRecPointsTask += 1;
c672a510 924 TH1F *fHistSSDLocalXLayer5 = new TH1F("SSD/Coordinates/fHistSSDLocalXLayer5",
0730893d 925 "Local x coord.- Layer 5;x [cm];Entries;",
926 100,-4.,4.);
c672a510 927 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalXLayer5,
7d297381 928 fGenRecPointsOffset + 4, expert, !image);
7a0e5776 929 fSSDhRecPointsTask += 1;
c672a510 930 TH1F *fHistSSDLocalXLayer6 = new TH1F("SSD/Coordinates/fHistSSDLocalXLayer6",
0730893d 931 "Local x coord.- Layer 6;x [cm];Entries;",
932 100,-4.,4.);
c672a510 933 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalXLayer6,
7d297381 934 fGenRecPointsOffset + 5, expert, !image);
7a0e5776 935 fSSDhRecPointsTask += 1;
c672a510 936 TH1F *fHistSSDLocalZLayer5 = new TH1F("SSD/Coordinates/fHistSSDLocalZLayer5",
0730893d 937 "Local z coord.- Layer 5;z [cm];Entries;",
938 100,-4.,4.);
c672a510 939 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalZLayer5,
7d297381 940 fGenRecPointsOffset + 6, expert, !image);
7a0e5776 941 fSSDhRecPointsTask += 1;
c672a510 942 TH1F *fHistSSDLocalZLayer6 = new TH1F("SSD/Coordinates/fHistSSDLocalZLayer6",
0730893d 943 "Local z coord.- Layer 6;z [cm];Entries;",
944 100,-4.,4.);
c672a510 945 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalZLayer6,
7d297381 946 fGenRecPointsOffset + 7, expert, !image);
7a0e5776 947 fSSDhRecPointsTask += 1;
c672a510 948 TH1F *fHistSSDGlobalXLayer5 = new TH1F("SSD/Coordinates/fHistSSDGlobalXLayer5",
0730893d 949 "Global x - Layer 5;x [cm];Entries;",
950 100,-40.,40.);
c672a510 951 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalXLayer5,
7d297381 952 fGenRecPointsOffset + 8, expert, !image);
7a0e5776 953 fSSDhRecPointsTask += 1;
c672a510 954 TH1F *fHistSSDGlobalXLayer6 = new TH1F("SSD/Coordinates/fHistSSDGlobalXLayer6",
0730893d 955 "Global x - Layer 6;x [cm];Entries;",
956 100,-45.,45.);
c672a510 957 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalXLayer6,
7d297381 958 fGenRecPointsOffset + 9, expert, !image);
7a0e5776 959 fSSDhRecPointsTask += 1;
c672a510 960 TH1F *fHistSSDGlobalYLayer5 = new TH1F("SSD/Coordinates/fHistSSDGlobalYLayer5",
0730893d 961 "Global y - Layer 5;y [cm];Entries;",
962 100,-40.,40);
c672a510 963 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalYLayer5,
7d297381 964 fGenRecPointsOffset + 10, expert, !image);
7a0e5776 965 fSSDhRecPointsTask += 1;
c672a510 966 TH1F *fHistSSDGlobalYLayer6 = new TH1F("SSD/Coordinates/fHistSSDGlobalYLayer6",
0730893d 967 "Global y - Layer 6;y [cm];Entries;",
968 100,-45.,45.);
c672a510 969 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalYLayer6,
7d297381 970 fGenRecPointsOffset + 11, expert, !image);
7a0e5776 971 fSSDhRecPointsTask += 1;
c672a510 972 TH1F *fHistSSDGlobalZLayer5 = new TH1F("SSD/Coordinates/fHistSSDGlobalZLayer5",
0730893d 973 "Global z - Layer 5;z [cm];Entries;",
974 100,-45.,45);
c672a510 975 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalZLayer5,
7d297381 976 fGenRecPointsOffset + 12, expert, !image);
7a0e5776 977 fSSDhRecPointsTask += 1;
c672a510 978 TH1F *fHistSSDGlobalZLayer6 = new TH1F("SSD/Coordinates/fHistSSDGlobalZLayer6",
0730893d 979 "Global z - Layer 6;z [cm];Entries;",
980 100,-55.,55.);
c672a510 981 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalZLayer6,
7d297381 982 fGenRecPointsOffset + 13, expert, !image);
7a0e5776 983 fSSDhRecPointsTask += 1;
c672a510 984 TH1F *fHistSSDPhiLayer5 = new TH1F("SSD/Coordinates/fHistSSDPhiLayer5",
0730893d 985 "#phi - Layer 5;#phi [rad];Entries;",
986 100,-TMath::Pi(),TMath::Pi());
c672a510 987 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDPhiLayer5,
7d297381 988 fGenRecPointsOffset + 14, expert, !image);
7a0e5776 989 fSSDhRecPointsTask += 1;
c672a510 990 TH1F *fHistSSDPhiLayer6 = new TH1F("SSD/Coordinates/fHistSSDPhiLayer6",
0730893d 991 "#phi - Layer 6;#phi [rad];Entries;",
992 100,-TMath::Pi(),TMath::Pi());
c672a510 993 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDPhiLayer6,
7d297381 994 fGenRecPointsOffset + 15, expert, !image);
7a0e5776 995 fSSDhRecPointsTask += 1;
c672a510 996 TH1F *fHistSSDThetaLayer5 = new TH1F("SSD/Coordinates/fHistSSDThetaLayer5",
0730893d 997 "#theta - Layer 5;#theta [rad];Entries;",
998 100,-TMath::Pi(),TMath::Pi());
c672a510 999 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDThetaLayer5,
7d297381 1000 fGenRecPointsOffset + 16, expert, !image);
7a0e5776 1001 fSSDhRecPointsTask += 1;
c672a510 1002 TH1F *fHistSSDThetaLayer6 = new TH1F("SSD/Coordinates/fHistSSDThetaLayer6",
0730893d 1003 "#theta - Layer 6;#theta [rad];Entries;",
1004 100,-TMath::Pi(),TMath::Pi());
c672a510 1005 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDThetaLayer6,
7d297381 1006 fGenRecPointsOffset + 17, expert, !image);
7a0e5776 1007 fSSDhRecPointsTask += 1;
c672a510 1008 TH1F *fHistSSDRadiusLayer5 = new TH1F("SSD/Coordinates/fHistSSDRadiusLayer5",
0730893d 1009 "r - Layer 5;r [cm];Entries;",
1010 100,35.,50.);
c672a510 1011 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDRadiusLayer5,
7d297381 1012 fGenRecPointsOffset + 18, expert, !image);
7a0e5776 1013 fSSDhRecPointsTask += 1;
c672a510 1014 TH1F *fHistSSDRadiusLayer6 = new TH1F("SSD/Coordinates/fHistSSDRadiusLayer6",
0730893d 1015 "r - Layer 6;r [cm];Entries;",
1016 100,35.,50.);
c672a510 1017 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDRadiusLayer6,
7d297381 1018 fGenRecPointsOffset + 19, expert, !image);
7a0e5776 1019 fSSDhRecPointsTask += 1;
c672a510 1020 TH1F *fHistSSDClusterTypeLayer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDClusterTypeLayer5",
0730893d 1021 "CL type - Layer 5;Cluster type;Entries;",
1022 150,0,150);
c672a510 1023 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterTypeLayer5,
7d297381 1024 fGenRecPointsOffset + 20, expert, !image);
7a0e5776 1025 fSSDhRecPointsTask += 1;
c672a510 1026 TH1F *fHistSSDClusterTypeLayer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDClusterTypeLayer6",
0730893d 1027 "CL type - Layer 6;Cluster type;Entries;",
1028 150,0,150);
c672a510 1029 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterTypeLayer6,
7d297381 1030 fGenRecPointsOffset + 21, expert, !image);
7a0e5776 1031 fSSDhRecPointsTask += 1;
c672a510 1032 TH1F *fHistSSDChargeRatioLayer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDChargeRatioLayer5",
0730893d 1033 "Charge ratio - Layer 5;q_{ratio};Entries;",
1034 100,-2.0,2.0);
c672a510 1035 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatioLayer5,
7d297381 1036 fGenRecPointsOffset + 22, expert, !image);
7a0e5776 1037 fSSDhRecPointsTask += 1;
c672a510 1038 TH1F *fHistSSDChargeRatioLayer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDChargeRatioLayer6",
0730893d 1039 "Charge ratio - Layer 6;q_{ratio};Entries;",
1040 100,-2.0,2.0);
c672a510 1041 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatioLayer6,
7d297381 1042 fGenRecPointsOffset + 23, expert, !image);
7a0e5776 1043 fSSDhRecPointsTask += 1;
c672a510 1044 TH1F *fHistSSDChargekeVLayer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDChargekeVLayer5",
0730893d 1045 "Charge - Layer 5;q [keV];Entries;",
1046 100,0.,300.);
c672a510 1047 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargekeVLayer5,
7d297381 1048 fGenRecPointsOffset + 24, !expert, image);
7a0e5776 1049 fSSDhRecPointsTask += 1;
c672a510 1050 TH1F *fHistSSDChargekeVLayer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDChargekeVLayer6",
0730893d 1051 "Charge - Layer 6;q [keV];Entries;",
1052 100,0.,300.);
c672a510 1053 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargekeVLayer6,
7d297381 1054 fGenRecPointsOffset + 25, !expert, image);
7a0e5776 1055 fSSDhRecPointsTask += 1;
c672a510 1056 TH1F *fHistSSDChargePSideLayer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDChargePSideLayer5",
0730893d 1057 "Charge P- Layer 5;q_{P} [keV];Entries;",
1058 100,0.,300.);
c672a510 1059 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePSideLayer5,
7d297381 1060 fGenRecPointsOffset + 26, expert, !image);
7a0e5776 1061 fSSDhRecPointsTask += 1;
c672a510 1062 TH1F *fHistSSDChargePSideLayer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDChargePSideLayer6",
0730893d 1063 "Charge P- Layer 6;q_{P} [keV];Entries;",
1064 100,0.,300.);
c672a510 1065 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePSideLayer6,
7d297381 1066 fGenRecPointsOffset + 27, expert, !image);
7a0e5776 1067 fSSDhRecPointsTask += 1;
c672a510 1068 TH1F *fHistSSDChargeNSideLayer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDChargeNSideLayer5",
0730893d 1069 "Charge N- Layer 5;q_{N} [keV];Entries;",
1070 100,0.,300.);
c672a510 1071 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeNSideLayer5,
7d297381 1072 fGenRecPointsOffset + 28, expert, !image);
7a0e5776 1073 fSSDhRecPointsTask += 1;
c672a510 1074 TH1F *fHistSSDChargeNSideLayer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDChargeNSideLayer6",
0730893d 1075 "Charge N- Layer 6;q_{N} [keV];Entries;",
1076 100,0.,300.);
c672a510 1077 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeNSideLayer6,
7d297381 1078 fGenRecPointsOffset + 29, expert, !image);
7a0e5776 1079 fSSDhRecPointsTask += 1;
c672a510 1080 TH1F *fHistSSDChargeRatio2Layer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDChargeRatio2Layer5",
0730893d 1081 "Charge Ratio qN/qP - Layer 5;q_{N}/q_{P};Entries;",
1082 100,0,2);
c672a510 1083 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatio2Layer5,
7d297381 1084 fGenRecPointsOffset + 30, expert, !image);
7a0e5776 1085 fSSDhRecPointsTask += 1;
c672a510 1086 TH1F *fHistSSDChargeRatio2Layer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDChargeRatio2Layer6",
0730893d 1087 "Charge Ratio qN/qP - Layer 6;q_{N}/q_{P};Entries;",
1088 100,0,2);
c672a510 1089 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatio2Layer6,
7d297381 1090 fGenRecPointsOffset + 31, expert, !image);
7a0e5776 1091 fSSDhRecPointsTask += 1;
c672a510 1092 TH2F *fHistSSDChargePNSideLayer5 = new TH2F("SSD/ClusterCharge/Layer5/fHistSSDChargePNSideLayer5",
0730893d 1093 "Charge correlation - Layer 5;q_{P} [keV];q_{N} [keV]",
1094 100,0.,300.,
1095 100,0.,300.);
c672a510 1096 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePNSideLayer5,
7d297381 1097 fGenRecPointsOffset + 32, expert, !image);
7a0e5776 1098 fSSDhRecPointsTask += 1;
c672a510 1099 TH2F *fHistSSDChargePNSideLayer6 = new TH2F("SSD/ClusterCharge/Layer6/fHistSSDChargePNSideLayer6",
0730893d 1100 "Charge correlation - Layer 6;q_{P} [keV];q_{N} [keV]",
1101 100,0.,300.,
1102 100,0.,300.);
c672a510 1103 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePNSideLayer6,
7d297381 1104 fGenRecPointsOffset + 33, expert, !image);
7a0e5776 1105 fSSDhRecPointsTask += 1;
c672a510 1106 TH2F *fHistSSDChargeMapLayer5 = new TH2F("SSD/ClusterCharge/Layer5/fHistSSDChargeMapLayer5",
0730893d 1107 "Charge map;N_{modules};N_{Ladders}",
1108 fgkSSDMODULESPERLADDERLAYER5,
1109 -0.5,fgkSSDMODULESPERLADDERLAYER5+0.5,
1110 3*fgkSSDLADDERSLAYER5,
1111 -0.5,fgkSSDLADDERSLAYER5+0.5);
c672a510 1112 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeMapLayer5,
7d297381 1113 fGenRecPointsOffset + 34, expert, !image);
7a0e5776 1114 fSSDhRecPointsTask += 1;
c672a510 1115 TH2F *fHistSSDChargeMapLayer6 = new TH2F("SSD/ClusterCharge/Layer6/fHistSSDChargeMapLayer6",
0730893d 1116 "Charge map;N_{modules};N_{Ladders}",
1117 fgkSSDMODULESPERLADDERLAYER6,
1118 -0.5,fgkSSDMODULESPERLADDERLAYER6+0.5,
1119 3*fgkSSDLADDERSLAYER6,
1120 -0.5,fgkSSDLADDERSLAYER6+0.5);
c672a510 1121 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeMapLayer6,
7d297381 1122 fGenRecPointsOffset + 35, expert, !image);
7a0e5776 1123 fSSDhRecPointsTask += 1;
c672a510 1124 TH2F *fHistSSDClusterMapLayer5 = new TH2F("SSD/Statistics/Layer5/fHistSSDClusterMapLayer5",
1125 "Layer 5;N_{module};N_{ladder}",
1126 22,1,23,
1127 34,500,534);
1128 fHistSSDClusterMapLayer5->GetXaxis()->SetTitleColor(1);
1129 fHistSSDClusterMapLayer5->SetStats(kFALSE);
1130 fHistSSDClusterMapLayer5->GetYaxis()->SetTitleOffset(1.8);
1131 fHistSSDClusterMapLayer5->GetXaxis()->SetNdivisions(22);
1132 fHistSSDClusterMapLayer5->GetYaxis()->SetNdivisions(34);
1133 fHistSSDClusterMapLayer5->GetXaxis()->SetLabelSize(0.03);
1134 fHistSSDClusterMapLayer5->GetYaxis()->SetLabelSize(0.03);
1135 fHistSSDClusterMapLayer5->GetZaxis()->SetTitleOffset(1.4);
1136 fHistSSDClusterMapLayer5->GetZaxis()->SetTitle("N_{clusters}");
1137 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterMapLayer5,
7d297381 1138 fGenRecPointsOffset + 36, !expert, image);
7a0e5776 1139 fSSDhRecPointsTask += 1;
c672a510 1140 TH2F *fHistSSDClusterMapLayer6 = new TH2F("SSD/Statistics/Layer6/fHistSSDClusterMapLayer6",
1141 "Layer 6;N_{module};N_{ladder}",
1142 25,1,26,
1143 38,600,638);
1144 fHistSSDClusterMapLayer6->GetXaxis()->SetTitleColor(1);
1145 fHistSSDClusterMapLayer6->SetStats(kFALSE);
1146 fHistSSDClusterMapLayer6->GetYaxis()->SetTitleOffset(1.8);
1147 fHistSSDClusterMapLayer6->GetXaxis()->SetNdivisions(25);
1148 fHistSSDClusterMapLayer6->GetYaxis()->SetNdivisions(38);
1149 fHistSSDClusterMapLayer6->GetXaxis()->SetLabelSize(0.03);
1150 fHistSSDClusterMapLayer6->GetYaxis()->SetLabelSize(0.03);
1151 fHistSSDClusterMapLayer6->GetZaxis()->SetTitleOffset(1.4);
1152 fHistSSDClusterMapLayer6->GetZaxis()->SetTitle("N_{clusters}");
1153 fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterMapLayer6,
7d297381 1154 fGenRecPointsOffset + 37, !expert, image);
7a0e5776 1155 fSSDhRecPointsTask += 1;
1156 //printf ("%d SSD Recs histograms booked\n",fSSDhRecPointsTask);
5379c4a3 1157 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Recs histograms booked\n",fSSDhRecPointsTask));
0730893d 1158}
1159
1160//____________________________________________________________________________
1161void AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)
1162{
1163 // Fill QA for recpoints - SSD -
7a0e5776 1164 //printf("*-*-*-*-*-*-*---*-*-*-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints called \n");
0730893d 1165 Int_t gLayer = 0, gLadder = 0, gModule = 0;
1166 Int_t lLadderLocationY = 0;
1167 TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints");
1168 if (!branchRecP) {
1169 AliError("can't get the branch with the ITS clusters !");
1170 return;
1171 }
1172 static TClonesArray statRecpoints("AliITSRecPoint");
1173 TClonesArray *recpoints = &statRecpoints;
1174 branchRecP->SetAddress(&recpoints);
1175 Int_t nClustersLayer5 = 0, nClustersLayer6 = 0;
1176 Int_t npoints = 0;
1177 Float_t cluglo[3]={0.,0.,0.};
7a0e5776 1178 //printf("*-*-*-*-*-*-*---*-*-*-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints STEP1 \n");
0730893d 1179 for(Int_t module = 0; module < clustersTree->GetEntries(); module++){
1180 branchRecP->GetEvent(module);
1181 npoints += recpoints->GetEntries();
1182 AliITSgeomTGeo::GetModuleId(module,gLayer,gLadder,gModule);
7a0e5776 1183 //printf("SSDDataMAkerRec:::::::::::::::::::::::gLayer ========== %d \n\n",gLayer);
0730893d 1184 lLadderLocationY = 3*gLadder;
7a0e5776 1185 ////printf("*-*-*-*-*-*-*---*-*-*-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints inside loop \n");
0730893d 1186 for(Int_t j = 0;j < recpoints->GetEntries(); j++){
7a0e5776 1187 ////printf("*-*-*-*-*-*-*---*-*-*-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints inside loop 2\n");
0730893d 1188 AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);
1189 Int_t layer = recp->GetLayer();
7a0e5776 1190 //printf("SSDDataMAkerRec:::::::::::::::::::::::layer ========== %d \n\n",layer);
0730893d 1191 recp->GetGlobalXYZ(cluglo);
1192 Float_t radius = TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]);
1193 Float_t phi = TMath::ATan2(cluglo[1],cluglo[0]);
1194 Float_t theta = TMath::ATan2(radius,cluglo[2]);
1195 Double_t chargeRatio = recp->GetChargeRatio();
1196 Double_t clusterCharge = recp->GetQ();
1197 Double_t chargePSide = clusterCharge*(1. + chargeRatio);
1198 Double_t chargeNSide = clusterCharge*(1. - chargeRatio);
1199 if(layer == 4) {
7a0e5776 1200 //printf("-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints Filling 4 called \n");
430bb675 1201 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 0)->Fill(module);
1202 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 4)->Fill(recp->GetDetLocalX());
1203 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 6)->Fill(recp->GetDetLocalZ());
1204 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 8)->Fill(cluglo[0]);
1205 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 10)->Fill(cluglo[1]);
1206 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 12)->Fill(cluglo[2]);
1207 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 14)->Fill(phi);
1208 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 16)->Fill(theta);
1209 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 18)->Fill(radius);
1210 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 20)->Fill(recp->GetType());
1211 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 22)->Fill(recp->GetChargeRatio());
1212 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 24)->Fill(recp->GetQ());
1213 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 26)->Fill(chargePSide);
1214 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 28)->Fill(chargeNSide);
1215 if(chargePSide != 0.) fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 30)->Fill(chargeNSide/chargePSide);
1216 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 32)->Fill(chargePSide,chargeNSide);
1217 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 34)->SetBinContent(gModule,lLadderLocationY,recp->GetQ());
1218 ((TH2F *)fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 36))->Fill(gModule,499+gLadder,1);
0730893d 1219 nClustersLayer5 += 1;
1220 }//layer 5 histograms
1221 if(layer == 5) {
7a0e5776 1222 //printf("-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints Filling 5 called \n");
430bb675 1223 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 1)->Fill(module);
1224 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 5)->Fill(recp->GetDetLocalX());
1225 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 7)->Fill(recp->GetDetLocalZ());
1226 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 9)->Fill(cluglo[0]);
1227 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 11)->Fill(cluglo[1]);
1228 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 13)->Fill(cluglo[2]);
1229 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 15)->Fill(phi);
1230 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 17)->Fill(theta);
1231 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 19)->Fill(radius);
1232 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 21)->Fill(recp->GetType());
1233 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 23)->Fill(recp->GetChargeRatio());
1234 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 25)->Fill(recp->GetQ());
1235 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 27)->Fill(chargePSide);
1236 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 29)->Fill(chargeNSide);
1237 if(chargePSide != 0.) fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 31)->Fill(chargeNSide/chargePSide);
1238 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 33)->Fill(chargePSide,chargeNSide);
1239 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 35)->SetBinContent(gModule,lLadderLocationY,recp->GetQ());
1240 ((TH2F *)fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 37))->Fill(gModule,599+gLadder,1);
0730893d 1241 nClustersLayer6 += 1;
1242 }//layer 6 histograms
1243 }//rec. points loop
1244 }//module loop
7a0e5776 1245
1246 //printf("-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints Filling called \n");
430bb675 1247 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 2)->Fill(nClustersLayer5);
1248 fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 3)->Fill(nClustersLayer6);
0730893d 1249
1250 statRecpoints.Clear();
1251}
1252
7a0e5776 1253//____________________________________________________________________________
4e25ac79 1254Int_t AliITSQASSDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task) {
7a0e5776 1255 // Returns offset number according to the specified task
1256 Int_t offset=0;
4e25ac79 1257 if( task == AliQAv1::kRAWS ) {
7a0e5776 1258 offset=fGenRawsOffset;
1259 }
4e25ac79 1260 else if( task == AliQAv1::kRECPOINTS ) {
7a0e5776 1261 offset=fGenRecPointsOffset;
1262 }
1263 else {
5379c4a3 1264 AliWarning("No task has been selected. Offset set to zero.\n");
7a0e5776 1265 }
1266
1267 return offset;
1268}
1269
1270//____________________________________________________________________________
4e25ac79 1271Int_t AliITSQASSDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task) {
7a0e5776 1272 // Returns the number of histograms associated to the specified task
1273 Int_t histotot=0;
1274
4e25ac79 1275 if( task == AliQAv1::kRAWS ) {
7a0e5776 1276 histotot=fSSDhRawsTask;
1277 }
4e25ac79 1278 else if( task == AliQAv1::kRECPOINTS ){
7a0e5776 1279 histotot=fSSDhRecPointsTask;
1280 }
1281 else {
5379c4a3 1282 AliWarning("No task has been selected. TaskHisto set to zero.\n");
7a0e5776 1283 }
1284
1285 return histotot;
1286}