Added two missing includes to allow macro compilation (thanks to Laurent for remarkin...
[u/mrichter/AliRoot.git] / ITS / AliITSDetTypeRec.cxx
CommitLineData
3b9df642 1/***************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
b17dae48 5 * Conributors are mentioned in the code where appropriate. *
3b9df642 6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
140e5249 17 $Id$
3b9df642 18*/
19
7d62fb64 20////////////////////////////////////////////////////////////////////////
21// This class defines the "Standard" reconstruction for the ITS //
22// detector. //
23// //
24////////////////////////////////////////////////////////////////////////
25#include "TObjArray.h"
26#include "TTree.h"
27
8ba39da9 28#include "AliCDBManager.h"
8ba39da9 29#include "AliCDBEntry.h"
7d62fb64 30#include "AliITSClusterFinder.h"
7d62fb64 31#include "AliITSClusterFinderV2SPD.h"
32#include "AliITSClusterFinderV2SDD.h"
33#include "AliITSClusterFinderV2SSD.h"
3b9df642 34#include "AliITSDetTypeRec.h"
ef665f5e 35#include "AliITSDDLModuleMapSDD.h"
7d62fb64 36#include "AliITSRecPoint.h"
fcf95fc7 37#include "AliITSCalibrationSDD.h"
54af1add 38#include "AliITSMapSDD.h"
fb4dfab9 39#include "AliITSCalibrationSSD.h"
88128115 40#include "AliITSNoiseSSDv2.h"
41#include "AliITSGainSSDv2.h"
42#include "AliITSBadChannelsSSDv2.h"
fb4dfab9 43#include "AliITSNoiseSSD.h"
44#include "AliITSGainSSD.h"
45#include "AliITSBadChannelsSSD.h"
dc5c67dc 46#include "AliITSresponseSDD.h"
7d62fb64 47#include "AliITSsegmentationSPD.h"
48#include "AliITSsegmentationSDD.h"
49#include "AliITSsegmentationSSD.h"
00a7cc50 50#include "AliLog.h"
ad7f2bfa 51#include "AliITSRawStreamSPD.h"
52#include "AliITSTriggerConditions.h"
53#include "AliITSFOSignalsSPD.h"
54#include "AliRunLoader.h"
55#include "AliDataLoader.h"
56#include "AliITSLoader.h"
7d62fb64 57
ef665f5e 58class AliITSDriftSpeedArraySDD;
54af1add 59class AliITSCorrMapSDD;
ef665f5e 60class AliITSRecoParam;
3b9df642 61
7d62fb64 62const Int_t AliITSDetTypeRec::fgkNdettypes = 3;
8ba39da9 63const Int_t AliITSDetTypeRec::fgkDefaultNModulesSPD = 240;
64const Int_t AliITSDetTypeRec::fgkDefaultNModulesSDD = 260;
65const Int_t AliITSDetTypeRec::fgkDefaultNModulesSSD = 1698;
66
3b9df642 67ClassImp(AliITSDetTypeRec)
68
7d62fb64 69//________________________________________________________________
e56160b8 70AliITSDetTypeRec::AliITSDetTypeRec(): TObject(),
71fNMod(0),
6cae184e 72fITSgeom(0),
e56160b8 73fReconstruction(0),
74fSegmentation(0),
75fCalibration(0),
ced4d9bc 76fSSDCalibration(0),
23197852 77fSPDDead(0),
ad7f2bfa 78fTriggerConditions(0),
e56160b8 79fDigits(0),
ad7f2bfa 80fFOSignals(0),
979b5a5f 81fDDLMapSDD(0),
253e68a0 82fRespSDD(0),
75065a60 83fAveGainSDD(0),
e56160b8 84fRecPoints(0),
85fNRecPoints(0),
62b93da7 86fFirstcall(kTRUE),
ff44c37c 87fLoadOnlySPDCalib(0),
88fFastOrFiredMap(1200){
8e50d897 89 // Standard Constructor
90 // Inputs:
91 // none.
92 // Outputs:
93 // none.
94 // Return:
95 //
7d62fb64 96
7d62fb64 97 fReconstruction = new TObjArray(fgkNdettypes);
7d62fb64 98 fDigits = new TObjArray(fgkNdettypes);
8e50d897 99 for(Int_t i=0; i<3; i++){
ef665f5e 100 fkDigClassName[i]=0;
8e50d897 101 }
ced4d9bc 102 fSSDCalibration=new AliITSCalibrationSSD();
8e50d897 103 fNMod = new Int_t [fgkNdettypes];
104 fNMod[0] = fgkDefaultNModulesSPD;
105 fNMod[1] = fgkDefaultNModulesSDD;
106 fNMod[2] = fgkDefaultNModulesSSD;
00a7cc50 107 fRecPoints = new TClonesArray("AliITSRecPoint",3000);
7d62fb64 108 fNRecPoints = 0;
7d62fb64 109
7d62fb64 110
7d62fb64 111}
7537d03c 112
7d62fb64 113//______________________________________________________________________
7537d03c 114AliITSDetTypeRec::AliITSDetTypeRec(const AliITSDetTypeRec & rec):TObject(rec),
115fNMod(rec.fNMod),
6cae184e 116fITSgeom(rec.fITSgeom),
7537d03c 117fReconstruction(rec.fReconstruction),
118fSegmentation(rec.fSegmentation),
119fCalibration(rec.fCalibration),
ced4d9bc 120fSSDCalibration(rec.fSSDCalibration),
23197852 121fSPDDead(rec.fSPDDead),
ad7f2bfa 122fTriggerConditions(rec.fTriggerConditions),
7537d03c 123fDigits(rec.fDigits),
ad7f2bfa 124fFOSignals(rec.fFOSignals),
979b5a5f 125fDDLMapSDD(rec.fDDLMapSDD),
253e68a0 126fRespSDD(rec.fRespSDD),
75065a60 127fAveGainSDD(rec.fAveGainSDD),
7537d03c 128fRecPoints(rec.fRecPoints),
129fNRecPoints(rec.fNRecPoints),
62b93da7 130fFirstcall(rec.fFirstcall),
ff44c37c 131fLoadOnlySPDCalib(rec.fLoadOnlySPDCalib),
132fFastOrFiredMap(rec.fFastOrFiredMap){
7d62fb64 133
e56160b8 134 // Copy constructor.
7537d03c 135
7d62fb64 136}
137//______________________________________________________________________
e56160b8 138AliITSDetTypeRec& AliITSDetTypeRec::operator=(const AliITSDetTypeRec& source){
7537d03c 139 // Assignment operator.
140 this->~AliITSDetTypeRec();
141 new(this) AliITSDetTypeRec(source);
142 return *this;
7d62fb64 143
e56160b8 144}
7537d03c 145
7d62fb64 146//_____________________________________________________________________
3b9df642 147AliITSDetTypeRec::~AliITSDetTypeRec(){
7d62fb64 148 //Destructor
6cae184e 149
fcf95fc7 150 if(fReconstruction){
151 fReconstruction->Delete();
152 delete fReconstruction;
153 fReconstruction = 0;
154 }
155 if(fSegmentation){
156 fSegmentation->Delete();
157 delete fSegmentation;
158 fSegmentation = 0;
159 }
6cae184e 160 if(fCalibration){
7032f6a2 161 if(!(AliCDBManager::Instance()->GetCacheFlag())) {
7032f6a2 162 fCalibration->Delete();
163 delete fCalibration;
164 fCalibration = 0;
253e68a0 165 if(fRespSDD) delete fRespSDD;
166 if(fDDLMapSDD) delete fDDLMapSDD;
167 }
fcf95fc7 168 }
ced4d9bc 169 if(fSSDCalibration) delete fSSDCalibration;
170 if(fSPDDead){
23197852 171 if(!(AliCDBManager::Instance()->GetCacheFlag())) {
172 fSPDDead->Delete();
173 delete fSPDDead;
174 fSPDDead = 0;
175 }
ad7f2bfa 176 }
177 if(fTriggerConditions){
178 if(!(AliCDBManager::Instance()->GetCacheFlag())) {
179 fTriggerConditions->Delete();
180 delete fTriggerConditions;
181 fTriggerConditions = 0;
182 }
183 }
7d62fb64 184 if(fDigits){
185 fDigits->Delete();
186 delete fDigits;
187 fDigits=0;
188 }
189 if(fRecPoints){
190 fRecPoints->Delete();
191 delete fRecPoints;
192 fRecPoints=0;
193 }
8e50d897 194 delete [] fNMod;
7d62fb64 195
6cae184e 196 if (fITSgeom) delete fITSgeom;
197
7d62fb64 198}
8e50d897 199
7d62fb64 200//___________________________________________________________________
201void AliITSDetTypeRec::SetReconstructionModel(Int_t dettype,AliITSClusterFinder *clf){
202
203 //Set reconstruction model for detector type
204
205 if(fReconstruction==0) fReconstruction = new TObjArray(fgkNdettypes);
206 if(fReconstruction->At(dettype)!=0) delete fReconstruction->At(dettype);
207 fReconstruction->AddAt(clf,dettype);
208}
209//______________________________________________________________________
04c81913 210AliITSClusterFinder* AliITSDetTypeRec::GetReconstructionModel(Int_t dettype) const{
7d62fb64 211
212 //Get reconstruction model for detector type
213 if(fReconstruction==0) {
214 Warning("GetReconstructionModel","fReconstruction is 0!");
215 return 0;
216 }
217 return (AliITSClusterFinder*)fReconstruction->At(dettype);
218}
219
220//______________________________________________________________________
221void AliITSDetTypeRec::SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg){
222
223 //Set segmentation model for detector type
224
225 if(fSegmentation==0) fSegmentation = new TObjArray(fgkNdettypes);
226 if(fSegmentation->At(dettype)!=0) delete fSegmentation->At(dettype);
227 fSegmentation->AddAt(seg,dettype);
228
229}
230//______________________________________________________________________
04c81913 231AliITSsegmentation* AliITSDetTypeRec::GetSegmentationModel(Int_t dettype) const {
7d62fb64 232
233 //Get segmentation model for detector type
234
235 if(fSegmentation==0) {
236 Warning("GetSegmentationModel","fSegmentation is 0!");
237 return 0;
238 }
239 return (AliITSsegmentation*)fSegmentation->At(dettype);
240
241}
242//_______________________________________________________________________
fcf95fc7 243void AliITSDetTypeRec::SetCalibrationModel(Int_t iMod, AliITSCalibration *cal){
8ba39da9 244
245 //Set calibration (response) for the module iMod of type dettype
246 if (fCalibration==0) {
8e50d897 247 fCalibration = new TObjArray(GetITSgeom()->GetIndexMax());
8ba39da9 248 fCalibration->SetOwner(kTRUE);
249 fCalibration->Clear();
250 }
251
252 if (fCalibration->At(iMod) != 0)
fcf95fc7 253 delete (AliITSCalibration*) fCalibration->At(iMod);
8ba39da9 254 fCalibration->AddAt(cal,iMod);
7d62fb64 255
7d62fb64 256}
257//_______________________________________________________________________
23197852 258void AliITSDetTypeRec::SetSPDDeadModel(Int_t iMod, AliITSCalibration *cal){
259
260 //Set dead pixel info for the SPD module iMod
261 if (fSPDDead==0) {
262 fSPDDead = new TObjArray(fgkDefaultNModulesSPD);
263 fSPDDead->SetOwner(kTRUE);
264 fSPDDead->Clear();
265 }
266
267 if (fSPDDead->At(iMod) != 0)
268 delete (AliITSCalibration*) fSPDDead->At(iMod);
269 fSPDDead->AddAt(cal,iMod);
270}
271//_______________________________________________________________________
04c81913 272AliITSCalibration* AliITSDetTypeRec::GetCalibrationModel(Int_t iMod) const {
7d62fb64 273
8ba39da9 274 //Get calibration model for module type
7d62fb64 275
276 if(fCalibration==0) {
8ba39da9 277 Warning("GetalibrationModel","fCalibration is 0!");
7d62fb64 278 return 0;
279 }
8ba39da9 280
ced4d9bc 281 if(iMod<fgkDefaultNModulesSPD+fgkDefaultNModulesSDD){
282 return (AliITSCalibration*)fCalibration->At(iMod);
283 }else{
284 Int_t i=iMod-(fgkDefaultNModulesSPD+fgkDefaultNModulesSDD);
285 fSSDCalibration->SetModule(i);
286 return (AliITSCalibration*)fSSDCalibration;
287 }
288
7d62fb64 289}
23197852 290//_______________________________________________________________________
04c81913 291AliITSCalibration* AliITSDetTypeRec::GetSPDDeadModel(Int_t iMod) const {
23197852 292
293 //Get SPD dead for module iMod
294
295 if(fSPDDead==0) {
296 AliWarning("fSPDDead is 0!");
297 return 0;
298 }
23197852 299 return (AliITSCalibration*)fSPDDead->At(iMod);
300}
ad7f2bfa 301//_______________________________________________________________________
302AliITSTriggerConditions* AliITSDetTypeRec::GetTriggerConditions() const {
303 //Get Pixel Trigger Conditions
304 if (fTriggerConditions==0) {
305 AliWarning("fTriggerConditions is 0!");
306 }
307 return fTriggerConditions;
308}
7d62fb64 309//______________________________________________________________________
dc5c67dc 310void AliITSDetTypeRec::SetTreeAddressD(TTree* const treeD){
7d62fb64 311 // Set branch address for the tree of digits.
312
ad7f2bfa 313 const char *det[4] = {"SPD","SDD","SSD","ITS"};
314 TBranch *branch;
315 const Char_t* digclass;
316 Int_t i;
317 char branchname[30];
318
319 if(!treeD) return;
320 if (fDigits == 0x0) fDigits = new TObjArray(fgkNdettypes);
321 for (i=0; i<fgkNdettypes; i++) {
322 digclass = GetDigitClassName(i);
323 if(!(fDigits->At(i))) {
324 fDigits->AddAt(new TClonesArray(digclass,1000),i);
325 }
326 else{
327 ResetDigits(i);
7d62fb64 328 }
ad7f2bfa 329 if (fgkNdettypes==3) sprintf(branchname,"%sDigits%s",det[3],det[i]);
330 else sprintf(branchname,"%sDigits%d",det[3],i+1);
331 if (fDigits) {
332 branch = treeD->GetBranch(branchname);
333 if (branch) branch->SetAddress(&((*fDigits)[i]));
334 }
335 }
336
7d62fb64 337}
338
339//_______________________________________________________________________
dc5c67dc 340TBranch* AliITSDetTypeRec::MakeBranchInTree(TTree* const tree,
341 const char* name, const char *classname,
342 void* address,Int_t size,Int_t splitlevel)
7d62fb64 343{
344//
345// Makes branch in given tree and diverts them to a separate file
346//
347//
348//
349
350 if (tree == 0x0) {
351 Error("MakeBranchInTree","Making Branch %s Tree is NULL",name);
352 return 0x0;
353 }
354 TBranch *branch = tree->GetBranch(name);
355 if (branch) {
356 return branch;
357 }
358 if (classname){
359 branch = tree->Branch(name,classname,address,size,splitlevel);
360 }
361 else {
362 branch = tree->Bronch(name, "TClonesArray", address, size, splitlevel);
363 }
364
365 return branch;
366}
367
368//____________________________________________________________________
369void AliITSDetTypeRec::SetDefaults(){
370
371 //Set defaults for segmentation and response
372
8e50d897 373 if(!GetITSgeom()){
374 Warning("SetDefaults","null pointer to AliITSgeomGeom !");
7d62fb64 375 return;
376 }
377
378 AliITSsegmentation* seg;
8ba39da9 379 if(!GetCalibration()) {AliFatal("Exit");exit(0);}
7d62fb64 380
381 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
382 if(dettype==0){
d24bc9d6 383 seg = new AliITSsegmentationSPD();
7d62fb64 384 SetSegmentationModel(dettype,seg);
3a7c3e6d 385 SetDigitClassName(dettype,"AliITSdigitSPD");
7d62fb64 386 }
62b93da7 387 if(fLoadOnlySPDCalib==kFALSE){
388 if(dettype==1){
389 seg = new AliITSsegmentationSDD();
390 AliITSCalibrationSDD* cal=(AliITSCalibrationSDD*)GetCalibrationModel(fgkDefaultNModulesSPD+1);
391 if(cal->IsAMAt20MHz()){
392 seg->SetPadSize(seg->Dpz(0),20.);
393 seg->SetNPads(seg->Npz()/2,128);
394 }
395 SetSegmentationModel(dettype,seg);
396 SetDigitClassName(dettype,"AliITSdigitSDD");
b27af87f 397 }
7d62fb64 398 }
399 if(dettype==2){
d24bc9d6 400 AliITSsegmentationSSD* seg2 = new AliITSsegmentationSSD();
7d62fb64 401 SetSegmentationModel(dettype,seg2);
7d62fb64 402 SetDigitClassName(dettype,"AliITSdigitSSD");
7d62fb64 403 }
7d62fb64 404 }
7d62fb64 405}
8ba39da9 406//______________________________________________________________________
407Bool_t AliITSDetTypeRec::GetCalibration() {
408 // Get Default calibration if a storage is not defined.
409
b17dae48 410 if(!fFirstcall){
411 AliITSCalibration* cal = GetCalibrationModel(0);
412 if(cal)return kTRUE;
62b93da7 413 }else {
b17dae48 414 fFirstcall = kFALSE;
415 }
06232459 416
6cae184e 417 // SetRunNumber((Int_t)AliCDBManager::Instance()->GetRun());
418 // Int_t run=GetRunNumber();
b17dae48 419
6cae184e 420 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
b17dae48 421 if (fCalibration==0) {
422 fCalibration = new TObjArray(GetITSgeom()->GetIndexMax());
6cae184e 423 fCalibration->SetOwner(!cacheStatus);
b17dae48 424 fCalibration->Clear();
425 }
75065a60 426
427 Bool_t retCode=GetCalibrationSPD(cacheStatus);
428 if(retCode==kFALSE) return kFALSE;
429
430 if(fLoadOnlySPDCalib==kFALSE){
431 retCode=GetCalibrationSDD(cacheStatus);
432 if(retCode==kFALSE) return kFALSE;
433 retCode=GetCalibrationSSD(cacheStatus);
434 if(retCode==kFALSE) return kFALSE;
435 }
436
437 AliInfo(Form("%i SPD, %i SDD and %i SSD in calibration database",
438 fNMod[0], fNMod[1], fNMod[2]));
439 return kTRUE;
440}
441//______________________________________________________________________
442Bool_t AliITSDetTypeRec::GetCalibrationSPD(Bool_t cacheStatus) {
443 // Get SPD calibration objects from OCDB
8d37cc87 444 // dead pixel are not used for local reconstruction
75065a60 445
ad7f2bfa 446
447 AliCDBEntry *noisySPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDNoisy");
23197852 448 AliCDBEntry *deadSPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDDead");
ad7f2bfa 449 AliCDBEntry *pitCond = AliCDBManager::Instance()->Get("ITS/Calib/PITConditions");
450 if(!noisySPD || !deadSPD || !pitCond ){
62b93da7 451 AliFatal("SPD Calibration object retrieval failed! ");
452 return kFALSE;
ad7f2bfa 453 }
75065a60 454
ad7f2bfa 455 TObjArray *calNoisySPD = (TObjArray*) noisySPD->GetObject();
456 if (!cacheStatus) noisySPD->SetObject(NULL);
457 noisySPD->SetOwner(kTRUE);
fb4dfab9 458
ad7f2bfa 459 TObjArray *calDeadSPD = (TObjArray*) deadSPD->GetObject();
460 if (!cacheStatus) deadSPD->SetObject(NULL);
62b93da7 461 deadSPD->SetOwner(kTRUE);
462
ad7f2bfa 463 AliITSTriggerConditions *calPitCond = (AliITSTriggerConditions*) pitCond->GetObject();
464 if (!cacheStatus) pitCond->SetObject(NULL);
465 pitCond->SetOwner(kTRUE);
b457135f 466
62b93da7 467 if(!cacheStatus){
ad7f2bfa 468 delete noisySPD;
62b93da7 469 delete deadSPD;
ad7f2bfa 470 delete pitCond;
62b93da7 471 }
ad7f2bfa 472 if ((!calNoisySPD) || (!calDeadSPD) || (!calPitCond)){
62b93da7 473 AliWarning("Can not get SPD calibration from calibration database !");
474 return kFALSE;
475 }
476
ad7f2bfa 477 fNMod[0] = calNoisySPD->GetEntries();
62b93da7 478
479 AliITSCalibration* cal;
480 for (Int_t i=0; i<fNMod[0]; i++) {
ad7f2bfa 481 cal = (AliITSCalibration*) calNoisySPD->At(i);
62b93da7 482 SetCalibrationModel(i, cal);
ad7f2bfa 483 cal = (AliITSCalibration*) calDeadSPD->At(i);
62b93da7 484 SetSPDDeadModel(i, cal);
485 }
ad7f2bfa 486 fTriggerConditions = calPitCond;
62b93da7 487
62b93da7 488 return kTRUE;
489}
75065a60 490
62b93da7 491//______________________________________________________________________
75065a60 492Bool_t AliITSDetTypeRec::GetCalibrationSDD(Bool_t cacheStatus) {
493 // Get SDD calibration objects from OCDB
494
62b93da7 495 AliCDBEntry *entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
6cae184e 496 AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD");
18da6e54 497 AliCDBEntry *drSpSDD = AliCDBManager::Instance()->Get("ITS/Calib/DriftSpeedSDD");
979b5a5f 498 AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD");
62b93da7 499 // AliCDBEntry *mapASDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsAnodeSDD");
028a3709 500 AliCDBEntry *mapTSDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsTimeSDD");
06232459 501
e5b2f7f2 502 if(!entrySDD || !entry2SDD || !drSpSDD || !ddlMapSDD || !mapTSDD ){
75065a60 503 AliFatal("SDD Calibration object retrieval failed! ");
e8c4cf33 504 return kFALSE;
566f73ca 505 }
506
23197852 507
fcf95fc7 508
b17dae48 509 TObjArray *calSDD = (TObjArray *)entrySDD->GetObject();
6cae184e 510 if(!cacheStatus)entrySDD->SetObject(NULL);
8ba39da9 511 entrySDD->SetOwner(kTRUE);
fcf95fc7 512
513 AliITSresponseSDD *pSDD = (AliITSresponseSDD*)entry2SDD->GetObject();
6cae184e 514 if(!cacheStatus)entry2SDD->SetObject(NULL);
fcf95fc7 515 entry2SDD->SetOwner(kTRUE);
516
18da6e54 517 TObjArray *drSp = (TObjArray *)drSpSDD->GetObject();
518 if(!cacheStatus)drSpSDD->SetObject(NULL);
519 drSpSDD->SetOwner(kTRUE);
520
979b5a5f 521 AliITSDDLModuleMapSDD *ddlsdd=(AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject();
522 if(!cacheStatus)ddlMapSDD->SetObject(NULL);
523 ddlMapSDD->SetOwner(kTRUE);
524
2ebd5518 525// TObjArray *mapAn = (TObjArray *)mapASDD->GetObject();
526// if(!cacheStatus)mapASDD->SetObject(NULL);
527// mapASDD->SetOwner(kTRUE);
028a3709 528
529 TObjArray *mapT = (TObjArray *)mapTSDD->GetObject();
530 if(!cacheStatus)mapTSDD->SetObject(NULL);
531 mapTSDD->SetOwner(kTRUE);
532
75065a60 533
534 // DB entries are deleted. In this way metadeta objects are deleted as well
535 if(!cacheStatus){
536 delete entrySDD;
537 delete entry2SDD;
538 //delete mapASDD;
75065a60 539 delete mapTSDD;
540 delete drSpSDD;
541 delete ddlMapSDD;
542 }
543
e5b2f7f2 544 if ((!pSDD)||(!calSDD) || (!drSp) || (!ddlsdd) || (!mapT) ){
75065a60 545 AliWarning("Can not get SDD calibration from calibration database !");
546 return kFALSE;
547 }
548
549 fNMod[1] = calSDD->GetEntries();
550
551 fDDLMapSDD=ddlsdd;
552 fRespSDD=pSDD;
75065a60 553 AliITSCalibration* cal;
554 Float_t avegain=0.;
555 Float_t nGdAnodes=0;
54af1add 556 Bool_t oldMapFormat=kFALSE;
557 TObject* objmap=(TObject*)mapT->At(0);
558 TString cname(objmap->ClassName());
559 if(cname.CompareTo("AliITSMapSDD")==0){
560 oldMapFormat=kTRUE;
561 AliInfo("SDD Maps converted to new format");
562 }
75065a60 563 for(Int_t iddl=0; iddl<AliITSDDLModuleMapSDD::GetNDDLs(); iddl++){
564 for(Int_t icar=0; icar<AliITSDDLModuleMapSDD::GetNModPerDDL();icar++){
565 Int_t iMod=fDDLMapSDD->GetModuleNumber(iddl,icar);
566 if(iMod==-1) continue;
567 Int_t i=iMod - fgkDefaultNModulesSPD;
568 cal = (AliITSCalibration*) calSDD->At(i);
569 Int_t i0=2*i;
570 Int_t i1=1+2*i;
571 for(Int_t iAnode=0;iAnode< ((AliITSCalibrationSDD*)cal)->NOfAnodes(); iAnode++){
572 if(((AliITSCalibrationSDD*)cal)->IsBadChannel(iAnode)) continue;
573 avegain+= ((AliITSCalibrationSDD*)cal)->GetChannelGain(iAnode);
574 nGdAnodes++;
575 }
576 AliITSDriftSpeedArraySDD* arr0 = (AliITSDriftSpeedArraySDD*) drSp->At(i0);
75065a60 577 AliITSDriftSpeedArraySDD* arr1 = (AliITSDriftSpeedArraySDD*) drSp->At(i1);
54af1add 578
579 AliITSCorrMapSDD* mt0 = 0;
580 AliITSCorrMapSDD* mt1 = 0;
581 if(oldMapFormat){
582 AliITSMapSDD* oldmap0=(AliITSMapSDD*)mapT->At(i0);
583 AliITSMapSDD* oldmap1=(AliITSMapSDD*)mapT->At(i1);
584 mt0=oldmap0->ConvertToNewFormat();
585 mt1=oldmap1->ConvertToNewFormat();
586 }else{
587 mt0=(AliITSCorrMapSDD*)mapT->At(i0);
588 mt1=(AliITSCorrMapSDD*)mapT->At(i1);
589 }
75065a60 590 cal->SetDriftSpeed(0,arr0);
591 cal->SetDriftSpeed(1,arr1);
75065a60 592 cal->SetMapT(0,mt0);
593 cal->SetMapT(1,mt1);
594 SetCalibrationModel(iMod, cal);
595 }
596 }
597 if(nGdAnodes) fAveGainSDD=avegain/nGdAnodes;
598 return kTRUE;
599}
600
601
602//______________________________________________________________________
603Bool_t AliITSDetTypeRec::GetCalibrationSSD(Bool_t cacheStatus) {
604 // Get SSD calibration objects from OCDB
605 // AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD");
606
607 AliCDBEntry *entryNoiseSSD = AliCDBManager::Instance()->Get("ITS/Calib/NoiseSSD");
608 AliCDBEntry *entryGainSSD = AliCDBManager::Instance()->Get("ITS/Calib/GainSSD");
609 AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD");
610
611 if(!entryNoiseSSD || !entryGainSSD || !entryBadChannelsSSD){
612 AliFatal("SSD Calibration object retrieval failed! ");
613 return kFALSE;
614 }
615
9b4aee57 616 TObject *emptyssd = 0; TString ssdobjectname;
88128115 617 AliITSNoiseSSDv2 *noiseSSD = new AliITSNoiseSSDv2();
618 emptyssd = (TObject *)entryNoiseSSD->GetObject();
619 ssdobjectname = emptyssd->GetName();
620 if(ssdobjectname=="TObjArray") {
621 TObjArray *noiseSSDOld = (TObjArray *)entryNoiseSSD->GetObject();
622 ReadOldSSDNoise(noiseSSDOld, noiseSSD);
623 }
624 else if(ssdobjectname=="AliITSNoiseSSDv2")
625 noiseSSD = (AliITSNoiseSSDv2 *)entryNoiseSSD->GetObject();
fb4dfab9 626 if(!cacheStatus)entryNoiseSSD->SetObject(NULL);
627 entryNoiseSSD->SetOwner(kTRUE);
628
88128115 629 AliITSGainSSDv2 *gainSSD = new AliITSGainSSDv2();
630 emptyssd = (TObject *)entryGainSSD->GetObject();
631 ssdobjectname = emptyssd->GetName();
632 if(ssdobjectname=="Gain") {
633 TObjArray *gainSSDOld = (TObjArray *)entryGainSSD->GetObject();
634 ReadOldSSDGain(gainSSDOld, gainSSD);
635 }
636 else if(ssdobjectname=="AliITSGainSSDv2")
637 gainSSD = (AliITSGainSSDv2 *)entryGainSSD->GetObject();
fb4dfab9 638 if(!cacheStatus)entryGainSSD->SetObject(NULL);
639 entryGainSSD->SetOwner(kTRUE);
640
88128115 641 AliITSBadChannelsSSDv2 *badChannelsSSD = new AliITSBadChannelsSSDv2();
642 emptyssd = (TObject *)entryBadChannelsSSD->GetObject();
643 ssdobjectname = emptyssd->GetName();
644 if(ssdobjectname=="TObjArray") {
645 TObjArray *badChannelsSSDOld = (TObjArray *)entryBadChannelsSSD->GetObject();
646 ReadOldSSDBadChannels(badChannelsSSDOld, badChannelsSSD);
647 }
648 else if(ssdobjectname=="AliITSBadChannelsSSDv2")
649 badChannelsSSD = (AliITSBadChannelsSSDv2*)entryBadChannelsSSD->GetObject();
fb4dfab9 650 if(!cacheStatus)entryBadChannelsSSD->SetObject(NULL);
651 entryBadChannelsSSD->SetOwner(kTRUE);
fcf95fc7 652
b17dae48 653 // DB entries are deleted. In this way metadeta objects are deleted as well
6cae184e 654 if(!cacheStatus){
fb4dfab9 655 delete entryNoiseSSD;
656 delete entryGainSSD;
657 delete entryBadChannelsSSD;
b17dae48 658 }
06232459 659
75065a60 660 if ((!noiseSSD)|| (!gainSSD)|| (!badChannelsSSD)) {
661 AliWarning("Can not get SSD calibration from calibration database !");
8ba39da9 662 return kFALSE;
663 }
fcf95fc7 664
ced4d9bc 665 fSSDCalibration->SetNoise(noiseSSD);
ced4d9bc 666 fSSDCalibration->SetGain(gainSSD);
88128115 667 fSSDCalibration->SetBadChannels(badChannelsSSD);
ced4d9bc 668 //fSSDCalibration->FillBadChipMap();
669
8ba39da9 670 return kTRUE;
671}
672
7d62fb64 673//________________________________________________________________
3a7c3e6d 674void AliITSDetTypeRec::SetDefaultClusterFindersV2(Bool_t rawdata){
7d62fb64 675
676 //Set defaults for cluster finder V2
677
8e50d897 678 if(!GetITSgeom()){
679 Warning("SetDefaults","Null pointer to AliITSgeom !");
7d62fb64 680 return;
681 }
682
7d62fb64 683 AliITSClusterFinder *clf;
684
3a7c3e6d 685 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
7d62fb64 686 //SPD
687 if(dettype==0){
688 if(!GetReconstructionModel(dettype)){
8ba39da9 689 clf = new AliITSClusterFinderV2SPD(this);
7d62fb64 690 clf->InitGeometry();
3a7c3e6d 691 if(!rawdata) clf->SetDigits(DigitsAddress(0));
7d62fb64 692 SetReconstructionModel(dettype,clf);
693
694 }
695 }
696 //SDD
697 if(dettype==1){
698 if(!GetReconstructionModel(dettype)){
8ba39da9 699 clf = new AliITSClusterFinderV2SDD(this);
700 clf->InitGeometry();
3a7c3e6d 701 if(!rawdata) clf->SetDigits(DigitsAddress(1));
7d62fb64 702 SetReconstructionModel(dettype,clf);
703 }
704
705 }
706
707 //SSD
708 if(dettype==2){
709 if(!GetReconstructionModel(dettype)){
8ba39da9 710 clf = new AliITSClusterFinderV2SSD(this);
7d62fb64 711 clf->InitGeometry();
3a7c3e6d 712 if(!rawdata) clf->SetDigits(DigitsAddress(2));
7d62fb64 713 SetReconstructionModel(dettype,clf);
714 }
715 }
716
717 }
718
719}
720//______________________________________________________________________
6cae184e 721void AliITSDetTypeRec::MakeBranch(TTree* tree, Option_t* option){
7d62fb64 722
723 //Creates branches for clusters and recpoints
724 Bool_t cR = (strstr(option,"R")!=0);
725 Bool_t cRF = (strstr(option,"RF")!=0);
7d62fb64 726
727 if(cRF)cR = kFALSE;
728
6cae184e 729 if(cR) MakeBranchR(tree);
730 if(cRF) MakeBranchRF(tree);
7d62fb64 731
732}
733
734//___________________________________________________________________
7d62fb64 735void AliITSDetTypeRec::ResetDigits(){
736 // Reset number of digits and the digits array for the ITS detector.
737
738 if(!fDigits) return;
739 for(Int_t i=0;i<fgkNdettypes;i++){
740 ResetDigits(i);
741 }
742}
743//___________________________________________________________________
744void AliITSDetTypeRec::ResetDigits(Int_t branch){
745 // Reset number of digits and the digits array for this branch.
746
747 if(fDigits->At(branch)) ((TClonesArray*)fDigits->At(branch))->Clear();
7d62fb64 748
7d62fb64 749}
750//__________________________________________________________________
6cae184e 751void AliITSDetTypeRec::MakeBranchR(TTree *treeR, Option_t *opt){
7d62fb64 752
753 //Creates tree branches for recpoints
754 // Inputs:
755 // cont char *file File name where RecPoints branch is to be written
756 // to. If blank it write the SDigits to the same
757 // file in which the Hits were found.
758
7d62fb64 759 Int_t buffsz = 4000;
760 char branchname[30];
761
762 // only one branch for rec points for all detector types
763 Bool_t oFast= (strstr(opt,"Fast")!=0);
7d62fb64 764
765 Char_t detname[10] = "ITS";
766
767
768 if(oFast){
769 sprintf(branchname,"%sRecPointsF",detname);
7d62fb64 770 } else {
771 sprintf(branchname,"%sRecPoints",detname);
772 }
773
00a7cc50 774 if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
6cae184e 775 if (treeR)
776 MakeBranchInTree(treeR,branchname,0,&fRecPoints,buffsz,99);
7d62fb64 777}
778//______________________________________________________________________
dc5c67dc 779void AliITSDetTypeRec::SetTreeAddressR(TTree* const treeR){
7d62fb64 780 // Set branch address for the Reconstructed points Trees.
3b9df642 781 // Inputs:
7d62fb64 782 // TTree *treeR Tree containing the RecPoints.
3b9df642 783 // Outputs:
7d62fb64 784 // none.
3b9df642 785 // Return:
7d62fb64 786
ad7f2bfa 787 char branchname[30];
788 Char_t namedet[10]="ITS";
7d62fb64 789
ad7f2bfa 790 if(!treeR) return;
791 if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
792 TBranch *branch;
793 sprintf(branchname,"%sRecPoints",namedet);
794 branch = treeR->GetBranch(branchname);
795 if (branch) {
00a7cc50 796 branch->SetAddress(&fRecPoints);
ad7f2bfa 797 }
798 else {
00a7cc50 799 sprintf(branchname,"%sRecPointsF",namedet);
7d62fb64 800 branch = treeR->GetBranch(branchname);
801 if (branch) {
00a7cc50 802 branch->SetAddress(&fRecPoints);
7d62fb64 803 }
ad7f2bfa 804 }
3b9df642 805}
7d62fb64 806//____________________________________________________________________
807void AliITSDetTypeRec::AddRecPoint(const AliITSRecPoint &r){
808 // Add a reconstructed space point to the list
809 // Inputs:
810 // const AliITSRecPoint &r RecPoint class to be added to the tree
811 // of reconstructed points TreeR.
812 // Outputs:
813 // none.
814 // Return:
815 // none.
816
817 TClonesArray &lrecp = *fRecPoints;
818 new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
819}
7d62fb64 820
821//______________________________________________________________________
5d2c2f86 822void AliITSDetTypeRec::DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastentry,Option_t *opt, Int_t optCluFind){
7d62fb64 823 // cluster finding and reconstruction of space points
824 // the condition below will disappear when the geom class will be
825 // initialized for all versions - for the moment it is only for v5 !
826 // 7 is the SDD beam test version
827 // Inputs:
6cae184e 828 // TTree *treeD Digits tree
829 // TTree *treeR Clusters tree
7d62fb64 830 // Int_t lastentry Offset for module when not all of the modules
831 // are processed.
832 // Option_t *opt String indicating which ITS sub-detectors should
833 // be processed. If ="All" then all of the ITS
834 // sub detectors are processed.
835
7d62fb64 836 const char *all = strstr(opt,"All");
837 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
838 strstr(opt,"SSD")};
5d2c2f86 839 if(optCluFind==0){
00a7cc50 840 SetDefaultClusterFindersV2();
841 AliInfo("V2 cluster finder has been selected \n");
5d2c2f86 842 }else{
843 SetDefaultClusterFindersV2();
06a7cbee 844 AliInfo("Cluster Finder Option not implemented, V2 cluster finder will be used \n");
00a7cc50 845 }
7d62fb64 846
ad7f2bfa 847
848 // Reset Fast-OR fired map
849 ResetFastOrFiredMap();
850
851 if (all || det[0]) { // SPD present
852 // Get the FO signals for this event
853 AliRunLoader* runLoader = AliRunLoader::Instance();
854 AliITSLoader* itsLoader = (AliITSLoader*) runLoader->GetLoader("ITSLoader");
855 if (!itsLoader) {
856 AliError("ITS loader is NULL.");
857 }
a0d76912 858 else {
859 fFOSignals = (AliITSFOSignalsSPD*)itsLoader->TreeD()->GetUserInfo()->FindObject("AliITSFOSignalsSPD");
860 if(!fFOSignals) AliError("FO signals not retrieved");
861 }
862
ad7f2bfa 863 }
864
865
7d62fb64 866 AliITSClusterFinder *rec = 0;
867 Int_t id,module,first=0;
8e50d897 868 for(module=0;module<GetITSgeom()->GetIndexMax();module++){
869 id = GetITSgeom()->GetModuleType(module);
7d62fb64 870 if (!all && !det[id]) continue;
8e50d897 871 if(det[id]) first = GetITSgeom()->GetStartDet(id);
7d62fb64 872 rec = (AliITSClusterFinder*)GetReconstructionModel(id);
873 TClonesArray *itsDigits = DigitsAddress(id);
6cae184e 874 if (!rec)
875 AliFatal("The reconstruction class was not instanciated!");
5e5bc8f1 876 ResetDigits(); // MvL: Not sure we neeed this when rereading anyways
7d62fb64 877 if (all) {
6cae184e 878 treeD->GetEvent(lastentry+module);
ad7f2bfa 879 }
880 else {
881 treeD->GetEvent(lastentry+(module-first));
882 }
883 Int_t ndigits = itsDigits->GetEntriesFast();
884 if (ndigits>0 || id==0) { // for SPD we always want to call FindRawClusters (to process FO signals)
885 rec->SetDetTypeRec(this);
886 rec->SetDigits(DigitsAddress(id));
887 // rec->SetClusters(ClustersAddress(id));
888 rec->FindRawClusters(module);
889 } // end if
890 treeR->Fill();
891 ResetRecPoints();
892 }
893
894 // Remove PIT in-active chips from Fast-OR fired map
895 if (all || det[0]) { // SPD present
896 RemoveFastOrFiredInActive();
897 }
7d62fb64 898}
899//______________________________________________________________________
8484b32d 900void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR,Option_t *opt){
7d62fb64 901 // cluster finding and reconstruction of space points
902 // the condition below will disappear when the geom class will be
903 // initialized for all versions - for the moment it is only for v5 !
904 // 7 is the SDD beam test version
905 // Inputs:
6cae184e 906 // AliRawReader *rawReader Pointer to the raw-data reader
907 // TTree *treeR Clusters tree
7d62fb64 908 // Outputs:
909 // none.
910 // Return:
911 // none.
8484b32d 912 const char *all = strstr(opt,"All");
913 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
914 strstr(opt,"SSD")};
ad7f2bfa 915
7d62fb64 916 Int_t id=0;
917
00a7cc50 918 TClonesArray *array=new TClonesArray("AliITSRecPoint",1000);
6cae184e 919 TBranch *branch = treeR->Branch("ITSRecPoints",&array);
7d62fb64 920 delete array;
921
8e50d897 922 TClonesArray** clusters = new TClonesArray*[GetITSgeom()->GetIndexMax()];
923 for (Int_t iModule = 0; iModule < GetITSgeom()->GetIndexMax(); iModule++) {
7d62fb64 924 clusters[iModule] = NULL;
925 }
d97fc3e0 926
927 DigitsToRecPoints(rawReader,clusters,opt);
928
7d62fb64 929 Int_t nClusters =0;
c157c94e 930 TClonesArray *emptyArray=new TClonesArray("AliITSRecPoint");
8e50d897 931 for(Int_t iModule=0;iModule<GetITSgeom()->GetIndexMax();iModule++){
8484b32d 932 id = GetITSgeom()->GetModuleType(iModule);
933 if (!all && !det[id]) continue;
7d62fb64 934 array = clusters[iModule];
935 if(!array){
c157c94e 936 AliDebug(1,Form("data for module %d missing!",iModule));
937 array = emptyArray;
7d62fb64 938 }
6cae184e 939 branch->SetAddress(&array);
940 treeR->Fill();
7d62fb64 941 nClusters+=array->GetEntriesFast();
5ef4644f 942
943 if (array != emptyArray) {
944 array->Delete();
945 delete array;
946 }
7d62fb64 947 }
c157c94e 948 delete emptyArray;
949
7d62fb64 950 delete[] clusters;
00a7cc50 951 Info("DigitsToRecPoints", "total number of found recpoints in ITS: %d\n",
7d62fb64 952 nClusters);
953
d97fc3e0 954}
955//______________________________________________________________________
956void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader,TClonesArray** clusters,Option_t *opt){
957 // cluster finding and reconstruction of space points
958 // the condition below will disappear when the geom class will be
959 // initialized for all versions - for the moment it is only for v5 !
960 // 7 is the SDD beam test version
961 // Inputs:
962 // AliRawReader *rawReader Pointer to the raw-data reader
963 // TClonesArray **clusters Clusters Array
964 // Outputs:
965 // none.
966 // Return:
967 // none.
968 const char *all = strstr(opt,"All");
969 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
970 strstr(opt,"SSD")};
971
972 // Reset Fast-OR fired map
973 ResetFastOrFiredMap();
974
975 AliITSClusterFinder *rec = 0;
976 Int_t id=0;
977
978 for(id=0;id<3;id++){
979 if (!all && !det[id]) continue;
980 rec = (AliITSClusterFinder*)GetReconstructionModel(id);
981 if (!rec)
982 AliFatal("The reconstruction class was not instantiated");
983 rec->SetDetTypeRec(this);
984 rec->RawdataToClusters(rawReader,clusters);
985 }
986
ad7f2bfa 987 // Remove PIT in-active chips from Fast-OR fired map
988 if (all || det[0]) { // SPD present
989 RemoveFastOrFiredInActive();
990 }
7d62fb64 991}
88128115 992//______________________________________________________________________
ef665f5e 993void AliITSDetTypeRec::ReadOldSSDNoise(const TObjArray *array,
88128115 994 AliITSNoiseSSDv2 *noiseSSD) {
995 //Reads the old SSD calibration object and converts it to the new format
996 const Int_t fgkSSDSTRIPSPERMODULE = 1536;
997 const Int_t fgkSSDPSIDESTRIPSPERMODULE = 768;
998
3dd31ed2 999 Int_t gNMod = array->GetEntries();
88128115 1000 cout<<"Converting old calibration object for noise..."<<endl;
1001
1002 //NOISE
1003 Double_t noise = 0.0;
3dd31ed2 1004 for (Int_t iModule = 0; iModule < gNMod; iModule++) {
88128115 1005 AliITSNoiseSSD *noiseModule = (AliITSNoiseSSD*) (array->At(iModule));
1006 for(Int_t iStrip = 0; iStrip < fgkSSDSTRIPSPERMODULE; iStrip++) {
1007 noise = (iStrip < fgkSSDPSIDESTRIPSPERMODULE) ? noiseModule->GetNoiseP(iStrip) : noiseModule->GetNoiseN(1535 - iStrip);
1008 if(iStrip < fgkSSDPSIDESTRIPSPERMODULE)
1009 noiseSSD->AddNoiseP(iModule,iStrip,noise);
1010 if(iStrip >= fgkSSDPSIDESTRIPSPERMODULE)
1011 noiseSSD->AddNoiseN(iModule,1535 - iStrip,noise);
1012 }//loop over strips
1013 }//loop over modules
1014}
1015
1016//______________________________________________________________________
ef665f5e 1017void AliITSDetTypeRec::ReadOldSSDBadChannels(const TObjArray *array,
88128115 1018 AliITSBadChannelsSSDv2 *badChannelsSSD) {
1019 //Reads the old SSD calibration object and converts it to the new format
3dd31ed2 1020 Int_t gNMod = array->GetEntries();
88128115 1021 cout<<"Converting old calibration object for bad channels..."<<endl;
3dd31ed2 1022 for (Int_t iModule = 0; iModule < gNMod; iModule++) {
88128115 1023 //for (Int_t iModule = 0; iModule < 1; iModule++) {
1024 AliITSBadChannelsSSD *bad = (AliITSBadChannelsSSD*) (array->At(iModule));
1025 TArrayI arrayPSide = bad->GetBadPChannelsList();
1026 for(Int_t iPCounter = 0; iPCounter < arrayPSide.GetSize(); iPCounter++)
1027 badChannelsSSD->AddBadChannelP(iModule,
1028 iPCounter,
1029 (Char_t)arrayPSide.At(iPCounter));
1030
1031 TArrayI arrayNSide = bad->GetBadNChannelsList();
1032 for(Int_t iNCounter = 0; iNCounter < arrayNSide.GetSize(); iNCounter++)
1033 badChannelsSSD->AddBadChannelN(iModule,
1034 iNCounter,
1035 (Char_t)arrayNSide.At(iNCounter));
1036
1037 }//loop over modules
1038}
1039
1040//______________________________________________________________________
ef665f5e 1041void AliITSDetTypeRec::ReadOldSSDGain(const TObjArray *array,
88128115 1042 AliITSGainSSDv2 *gainSSD) {
1043 //Reads the old SSD calibration object and converts it to the new format
1044
3dd31ed2 1045 Int_t gNMod = array->GetEntries();
88128115 1046 cout<<"Converting old calibration object for gain..."<<endl;
1047
1048 //GAIN
3dd31ed2 1049 for (Int_t iModule = 0; iModule < gNMod; iModule++) {
88128115 1050 AliITSGainSSD *gainModule = (AliITSGainSSD*) (array->At(iModule));
1051 TArrayF arrayPSide = gainModule->GetGainP();
1052 for(Int_t iPCounter = 0; iPCounter < arrayPSide.GetSize(); iPCounter++)
1053 gainSSD->AddGainP(iModule,
1054 iPCounter,
1055 arrayPSide.At(iPCounter));
1056 TArrayF arrayNSide = gainModule->GetGainN();
1057 for(Int_t iNCounter = 0; iNCounter < arrayNSide.GetSize(); iNCounter++)
1058 gainSSD->AddGainN(iModule,
1059 iNCounter,
1060 arrayNSide.At(iNCounter));
1061 }//loop over modules
1062}
ad7f2bfa 1063//______________________________________________________________________
1064void AliITSDetTypeRec::RemoveFastOrFiredInActive() {
1065 // Removes the chips that were in-active in the pixel trigger (from fast-or fired map)
1066 if (fTriggerConditions==NULL) {
1067 AliError("Pixel trigger conditions are missing.");
1068 return;
1069 }
1070 Int_t eq = -1;
1071 Int_t hs = -1;
1072 Int_t chip = -1;
1073 while (fTriggerConditions->GetNextInActiveChip(eq,hs,chip)) {
1074 UInt_t chipKey = AliITSRawStreamSPD::GetOfflineChipKeyFromOnline(eq,hs,chip);
1075 fFastOrFiredMap.SetBitNumber(chipKey,kFALSE);
1076 }
1077}
1078//______________________________________________________________________
1079void AliITSDetTypeRec::SetFastOrFiredMapOnline(UInt_t eq, UInt_t hs, UInt_t chip) {
1080 // Set fast-or fired map for this chip
1081 Int_t chipKey = AliITSRawStreamSPD::GetOfflineChipKeyFromOnline(eq,hs,chip);
1082 return SetFastOrFiredMap(chipKey);
1083}
88128115 1084
8ba39da9 1085