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