]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITS.cxx
Bug fix (Yuri)
[u/mrichter/AliRoot.git] / ITS / AliITS.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
88cb7938 16/* $Id$ */
2ab0c725 17
4c039060 18
fe4da5cc 19///////////////////////////////////////////////////////////////////////////////
04366a57 20// //
21// An overview of the basic philosophy of the ITS code development //
22// and analysis is show in the figure below. //
23//Begin_Html //
24/*
a92b2b7d 25<img src="picts/ITS/ITS_Analysis_schema.gif">
fe4da5cc 26</pre>
27<br clear=left>
28<font size=+2 color=red>
58005f18 29<p>Roberto Barbera is in charge of the ITS Offline code (1999).
fe4da5cc 30<a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
31</font>
32<pre>
33*/
34//End_Html
58005f18 35//
36// AliITS. Inner Traking System base class.
37// This class contains the base procedures for the Inner Tracking System
38//
39//Begin_Html
40/*
a92b2b7d 41<img src="picts/ITS/AliITS_Class_Diagram.gif">
58005f18 42</pre>
43<br clear=left>
44<font size=+2 color=red>
45<p>This show the class diagram of the different elements that are part of
46the AliITS class.
47</font>
48<pre>
49*/
50//End_Html
51//
52// Version: 0
53// Written by Rene Brun, Federico Carminati, and Roberto Barbera
54//
55// Version: 1
56// Modified and documented by Bjorn S. Nilsen
57// July 11 1999
58//
3bd79107 59// Version: 2
60// Modified and documented by A. Bologna
61// October 18 1999
62//
58005f18 63// AliITS is the general base class for the ITS. Also see AliDetector for
64// futher information.
65//
fe4da5cc 66///////////////////////////////////////////////////////////////////////////////
88cb7938 67
143d1056 68#include <stdlib.h>
caf37aec 69#include <TClonesArray.h>
9c74c52b 70#include <TFile.h>
7d62fb64 71#include <TParticle.h>
d5da1ecf 72#include <TString.h>
88cb7938 73#include <TTree.h>
88cb7938 74#include <TVirtualMC.h>
7d62fb64 75#include "AliDetector.h"
3bd79107 76#include "AliITS.h"
7d62fb64 77#include "AliITSDetTypeSim.h"
f77f13c8 78#include "AliITSDDLRawData.h"
88cb7938 79#include "AliITSLoader.h"
88cb7938 80#include "AliITShit.h"
81#include "AliITSmodule.h"
7d62fb64 82#include "AliITSpListItem.h"
83#include "AliITSsimulation.h"
84#include "AliITSsimulationFastPoints.h"
5d12ce38 85#include "AliMC.h"
7d62fb64 86#include "AliITSDigitizer.h"
87#include "AliITSRecPoint.h"
0b5bf101 88#include "AliITSsegmentationSPD.h"
89#include "AliITSsegmentationSDD.h"
90#include "AliITSsegmentationSSD.h"
91#include "AliITSRawStreamSPD.h"
92#include "AliITSRawStreamSSD.h"
93#include "AliITSRawStreamSDD.h"
94#include "AliITSresponseSDD.h"
95#include "AliRawReader.h"
f77f13c8 96#include "AliRun.h"
7d62fb64 97#include "AliLog.h"
ef7ff1f9 98#include "AliITSInitGeometry.h"
828e06c7 99
3bd79107 100ClassImp(AliITS)
3bd79107 101
2aea926d 102//______________________________________________________________________
ed9289c8 103AliITS::AliITS() : AliDetector(),
104fDetTypeSim(0),
105fEuclidOut(0),
106fOpt("All"),
107fIdN(0),
108fIdSens(0),
109fIdName(0),
110fITSmodules(0)
111{
7d62fb64 112 // Default initializer for ITS
113 // The default constructor of the AliITS class. In addition to
114 // creating the AliITS class it zeros the variables fIshunt (a member
115 // of AliDetector class), fEuclidOut, and fIdN, and zeros the pointers
116 // fIdSens, and fIdName. The AliDetector default constructor
117 // is also called.
118
aa044888 119// SetDetectors(); // default to fOpt="All". This variable not written out.
e939a978 120//PH SetMarkerColor(kRed);
fe4da5cc 121}
2aea926d 122//______________________________________________________________________
ed9289c8 123AliITS::AliITS(const char *name, const char *title):AliDetector(name,title),
124fDetTypeSim(0),
125fEuclidOut(0),
126fOpt("All"),
127fIdN(0),
128fIdSens(0),
129fIdName(0),
130fITSmodules(0)
131{
7d62fb64 132 // The standard Constructor for the ITS class.
133 // It also zeros the variables
134 // fIshunt (a member of AliDetector class), fEuclidOut, and zeros
135 // the pointers fIdSens and fIdName. To help in displaying hits via the
136 // ROOT macro display.C AliITS also sets the marker color to red. The
137 // variables passes with this constructor, const char *name and *title,
138 // are used by the constructor of AliDetector class. See AliDetector
139 // class for a description of these parameters and its constructor
140 // functions.
141
7d62fb64 142 fHits = new TClonesArray("AliITShit",1560);
143 if(gAlice->GetMCApp()) gAlice->GetMCApp()->AddHitList(fHits);
ed9289c8 144 //fNhits=0; //done in AliDetector(name,title)
7d62fb64 145
7d62fb64 146 SetDetectors(); // default to fOpt="All". This variable not written out.
ed9289c8 147
7d62fb64 148 fDetTypeSim = new AliITSDetTypeSim();
149
e939a978 150 //PH SetMarkerColor(kRed);
023ae34b 151 if(!fLoader) MakeLoader(AliConfig::GetDefaultEventFolderName());
152 fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
fe4da5cc 153
3bd79107 154}
2aea926d 155//______________________________________________________________________
58005f18 156AliITS::~AliITS(){
4a5bebc2 157 // Default destructor for ITS.
2aea926d 158 // The default destructor of the AliITS class. In addition to deleting
7d62fb64 159 // the AliITS class it deletes the memory pointed to by
160 // fIdSens, fIdName, fDetTypeSim and it's contents.
4a5bebc2 161 // Inputs:
162 // none.
163 // Outputs:
164 // none.
165 // Return:
166 // none.
023ae34b 167
88cb7938 168 if (fHits) {
169 fHits->Delete();
170 delete fHits;
171 fHits=0;
172 }
88cb7938 173 if(fITSmodules) {
174 this->ClearModules();
175 delete fITSmodules;
279a35d7 176 fITSmodules = 0;
88cb7938 177 }// end if fITSmodules!=0
178
7d62fb64 179 delete[] fIdName; // Array of TStrings
180 delete[] fIdSens;
181
182 if (fDetTypeSim){
183 delete fDetTypeSim;
184 fDetTypeSim = 0;
185 }
3bd79107 186}
2aea926d 187//______________________________________________________________________
aacedc3e 188AliDigitizer* AliITS::CreateDigitizer(AliRunDigitizer* manager)const{
189 // Creates the AliITSDigitizer in a standard way for use via AliModule.
190 // This function can not be included in the .h file because of problems
191 // with the order of inclusion (recursive).
4a5bebc2 192 // Inputs:
aacedc3e 193 // AliRunDigitizer *manager The Manger class for Digitization
194 // Output:
195 // none.
4a5bebc2 196 // Return:
aacedc3e 197 // A new AliITSRunDigitizer (cast as a AliDigitizer).
3bd79107 198
aacedc3e 199 return new AliITSDigitizer(manager);
3bd79107 200}
2aea926d 201//______________________________________________________________________
202void AliITS::Init(){
4a5bebc2 203 // Initializer ITS after it has been built
2aea926d 204 // This routine initializes the AliITS class. It is intended to be
205 // called from the Init function in AliITSv?. Besides displaying a banner
206 // indicating that it has been called it initializes the array fIdSens
207 // and sets the default segmentation, response, digit and raw cluster
208 // classes therefore it should be called after a call to CreateGeometry.
4a5bebc2 209 // Inputs:
210 // none.
211 // Outputs:
212 // none.
213 // Return:
214 // none.
3bd79107 215 Int_t i;
3bd79107 216
2aea926d 217 SetDefaults();
218 // Array of TStrings
0e73d04c 219 if(gMC) for(i=0;i<fIdN;i++) fIdSens[i] = gMC->VolId(fIdName[i]);
7d62fb64 220
221 WriteGeometry();
222}
223
224//______________________________________________________________________
225void AliITS::WriteGeometry(){
226
023ae34b 227 //Writes ITS geometry on gAlice
7d62fb64 228
229 if(!fLoader) MakeLoader(AliConfig::GetDefaultEventFolderName());
230 AliRunLoader* rl = fLoader->GetRunLoader();
231 rl->CdGAFile();
232 AliITSgeom* geom = GetITSgeom();
233 geom->Write();
234
3bd79107 235}
7d62fb64 236
2aea926d 237//______________________________________________________________________
238void AliITS::SetDefaults(){
4a5bebc2 239 // sets the default segmentation, response, digit and raw cluster classes.
240 // Inputs:
241 // none.
242 // Outputs:
243 // none.
244 // Return:
245 // none.
023ae34b 246 AliInfoClass("AliITS::Setting Defaults");
7d62fb64 247
248 if(!fDetTypeSim) {
249 Error("SetDefaults()","fDetTypeSim is 0!");
250 return;
251 }
252
253 fDetTypeSim->SetDefaults();
254
255
3bd79107 256}
2aea926d 257//______________________________________________________________________
258void AliITS::SetDefaultSimulation(){
4a5bebc2 259 // sets the default simulation.
260 // Inputs:
261 // none.
262 // Outputs:
263 // none.
264 // Return:
265 // none.
7d62fb64 266 if(!fDetTypeSim) {
267 Error("SetDefaultSimulation()","fDetTypeSim is 0!");
268 return;
269 }
270
271 fDetTypeSim->SetDefaultSimulation();
04366a57 272
04366a57 273}
274
275
2aea926d 276//______________________________________________________________________
88cb7938 277void AliITS::MakeBranch(Option_t* option){
2aea926d 278 // Creates Tree branches for the ITS.
4a5bebc2 279 // Inputs:
280 // Option_t *option String of Tree types S,D, and/or R.
281 // const char *file String of the file name where these branches
282 // are to be stored. If blank then these branches
283 // are written to the same tree as the Hits were
284 // read from.
285 // Outputs:
286 // none.
287 // Return:
288 // none.
7d62fb64 289 if(!fDetTypeSim) {
290 Error("MakeBranch","fDetTypeSim is 0!");
291 return;
292 }
04366a57 293
7d62fb64 294 Bool_t cH = (strstr(option,"H")!=0);
295 Bool_t cS = (strstr(option,"S")!=0);
296 Bool_t cD = (strstr(option,"D")!=0);
297
298 if(cH && (fHits == 0x0)) fHits = new TClonesArray("AliITShit", 1560);
299 AliDetector::MakeBranch(option);
300
301 if(cS) MakeBranchS(0);
302 if(cD) MakeBranchD(0);
303
304
305}
306//___________________________________________________________________
307void AliITS::MakeBranchS(const char* fl){
308
309 // Creates Tree Branch for the ITS summable digits.
310 // Inputs:
311 // cont char *fl File name where SDigits branch is to be written
312 // to. If blank it write the SDigits to the same
313 // file in which the Hits were found.
314
315
316 if(!fDetTypeSim){
317 Error("MakeBranchS","fDetTypeSim is 0!");
318 }
319 Int_t buffersize = 4000;
320 char branchname[30];
321
322 // only one branch for SDigits.
323 sprintf(branchname,"%s",GetName());
324
325 if(fLoader->TreeS()){
326 if(fDetTypeSim->GetSDigits()==0x0) fDetTypeSim->SetSDigits(new TClonesArray("AliITSpListItem",1000));
327 TClonesArray* sdig = (TClonesArray*)fDetTypeSim->GetSDigits();
328 MakeBranchInTree(fLoader->TreeS(),branchname,&sdig,buffersize,fl);
329 }
330}
331//______________________________________________________________________
332void AliITS::MakeBranchD(const char* file){
333
334 //Make branch for digits
335 if(!fDetTypeSim) {
336 Warning("MakeBranchD","fDetTypeSim is 0!");
337 return;
338 }
023ae34b 339 fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
7d62fb64 340 MakeBranchInTreeD(fLoader->TreeD(),file);
341}
342
343//___________________________________________________________________
344void AliITS:: MakeBranchInTreeD(TTree* treeD, const char* file){
345 // Creates Tree branches for the ITS.
346
347 if(!fDetTypeSim){
348 Error("MakeBranchS","fDetTypeSim is 0!");
349 }
023ae34b 350 fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
7d62fb64 351
352 const Char_t *det[3] = {"SPD","SDD","SSD"};
353 Char_t* digclass;
354 Int_t buffersize = 4000;
355 Char_t branchname[30];
356
357 if(!fDetTypeSim->GetDigits()){
358 fDetTypeSim->SetDigits(new TObjArray(fgkNTYPES));
359 }
360 for(Int_t i=0;i<fgkNTYPES;i++){
361 digclass = fDetTypeSim->GetDigitClassName(i);
362 TString classn = digclass;
363 if(!((fDetTypeSim->GetDigits())->At(i))){
364 (fDetTypeSim->GetDigits())->AddAt(new TClonesArray(classn.Data(),1000),i);
365 }
366 else ResetDigits(i);
367 if(fgkNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
368 else sprintf(branchname,"%sDigits%d",GetName(),i+1);
369 TObjArray* dig = DigitsAddress(i);
370 if(GetDigits() && treeD) AliDetector::MakeBranchInTree(treeD,branchname, &dig,buffersize,file);
371 }
2aea926d 372
fe4da5cc 373}
2aea926d 374//______________________________________________________________________
375void AliITS::SetTreeAddress(){
376 // Set branch address for the Trees.
4a5bebc2 377 // Inputs:
378 // none.
379 // Outputs:
380 // none.
381 // Return:
382 // none.
023ae34b 383
7d62fb64 384 if(!fDetTypeSim) {
385 Error("SetTreeAddress","fDetTypeSim is 0!");
386 return;
387 }
388
023ae34b 389 fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
7d62fb64 390
391 TTree *treeS = fLoader->TreeS();
392 TTree *treeD = fLoader->TreeD();
393 if (fLoader->TreeH() && (fHits == 0x0)) {
394 fHits = new TClonesArray("AliITShit", 1560);
395 }
396 AliDetector::SetTreeAddress();
397
398 fDetTypeSim->SetTreeAddressS(treeS, (Char_t*)GetName());
399 fDetTypeSim->SetTreeAddressD(treeD, (Char_t*)GetName());
fe4da5cc 400}
2aea926d 401//______________________________________________________________________
2aea926d 402void AliITS::AddHit(Int_t track, Int_t *vol, Float_t *hits){
403 // Add an ITS hit
404 // The function to add information to the AliITShit class. See the
405 // AliITShit class for a full description. This function allocates the
406 // necessary new space for the hit information and passes the variable
407 // track, and the pointers *vol and *hits to the AliITShit constructor
408 // function.
4a5bebc2 409 // Inputs:
410 // Int_t track Track number which produced this hit.
411 // Int_t *vol Array of Integer Hit information. See AliITShit.h
412 // Float_t *hits Array of Floating Hit information. see AliITShit.h
413 // Outputs:
414 // none.
415 // Return:
416 // none.
7d62fb64 417 TClonesArray &lhits = *fHits;
418 new(lhits[fNhits++]) AliITShit(fIshunt,track,vol,hits);
3bd79107 419}
9c74c52b 420
2aea926d 421//______________________________________________________________________
422void AliITS::FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
8e8eae84 423 Option_t *option, const char *filename){
7d62fb64 424 // fill the modules with the sorted by module hits; add hits from
425 // background if option=Add.
426
427 static TTree *trH1; //Tree with background hits
428 static Bool_t first=kTRUE;
429 static TFile *file;
430 const char *addBgr = strstr(option,"Add");
431
432 evnt = nmodules; // Dummy use of variables to remove warnings
433 if (addBgr ) {
434 if(first) {
435 file=new TFile(filename);
436 } // end if first
437 first=kFALSE;
438 file->cd();
439 file->ls();
440 // Get Hits Tree header from file
441 if(trH1) delete trH1;
442 trH1=0;
443
444 char treeName[20];
445 sprintf(treeName,"TreeH%d",bgrev);
446 trH1 = (TTree*)gDirectory->Get(treeName);
447 if (!trH1) {
448 Error("FillModules","cannot find Hits Tree for event:%d",bgrev);
449 } // end if !trH1
450 // Set branch addresses
451 } // end if addBgr
452
453 FillModules(fLoader->TreeH(),0); // fill from this file's tree.
3bd79107 454
7d62fb64 455 if (addBgr ) {
456 FillModules(trH1,10000000); // Default mask 10M.
457 TTree *fAli=fLoader->GetRunLoader()->TreeK();
458 TFile *fileAli=0;
459 if (fAli) fileAli =fAli->GetCurrentFile();
460 fileAli->cd();
461 } // end if add
462
463
3bd79107 464}
7d62fb64 465
466
2aea926d 467//______________________________________________________________________
b4012daf 468void AliITS::FillModules(TTree *treeH, Int_t mask) {
469 // fill the modules with the sorted by module hits;
470 // can be called many times to do a merging
471 // Inputs:
472 // TTree *treeH The tree containing the hits to be copied into
473 // the modules.
474 // Int_t mask The track number mask to indecate which file
475 // this hits came from.
476 // Outputs:
477 // none.
478 // Return:
479 // none.
480
88cb7938 481 if (treeH == 0x0)
482 {
483 Error("FillModules","Tree is NULL");
484 }
b4012daf 485 Int_t lay,lad,det,index;
486 AliITShit *itsHit=0;
487 AliITSmodule *mod=0;
488 char branchname[20];
489 sprintf(branchname,"%s",GetName());
490 TBranch *branch = treeH->GetBranch(branchname);
491 if (!branch) {
88cb7938 492 Error("FillModules","%s branch in TreeH not found",branchname);
493 return;
b4012daf 494 } // end if !branch
495 branch->SetAddress(&fHits);
496 Int_t nTracks =(Int_t) treeH->GetEntries();
497 Int_t iPrimTrack,h;
498 for(iPrimTrack=0; iPrimTrack<nTracks; iPrimTrack++){
88cb7938 499 ResetHits();
500 Int_t nBytes = treeH->GetEvent(iPrimTrack);
501 if (nBytes <= 0) continue;
502 Int_t nHits = fHits->GetEntriesFast();
503 for(h=0; h<nHits; h++){
504 itsHit = (AliITShit *)fHits->UncheckedAt(h);
505 itsHit->GetDetectorID(lay,lad,det);
7d62fb64 506 if (GetITSgeom()) {
507 index = GetITSgeom()->GetModuleIndex(lay,lad,det);
88cb7938 508 } else {
509 index=det-1; // This should not be used.
510 } // end if [You must have fITSgeom for this to work!]
511 mod = GetModule(index);
512 itsHit->SetTrack(itsHit->GetTrack()+mask); // Set track mask.
513 mod->AddHit(itsHit,iPrimTrack,h);
514 } // end loop over hits
b4012daf 515 } // end loop over tracks
516}
7d62fb64 517
b4012daf 518//______________________________________________________________________
7d62fb64 519void AliITS::InitModules(Int_t size,Int_t &nmodules){
520 // Initialize the modules array.
4a5bebc2 521 // Inputs:
7d62fb64 522 // Int_t size Size of array of the number of modules to be
523 // created. If size <=0 then the number of modules
524 // is gotten from AliITSgeom class kept in fITSgeom.
4a5bebc2 525 // Outputs:
7d62fb64 526 // Int_t &nmodules The number of modules existing.
4a5bebc2 527 // Return:
528 // none.
2ab0c725 529
7d62fb64 530 if(fITSmodules){
531 fITSmodules->Delete();
532 delete fITSmodules;
533 } // end fir fITSmoudles
88cb7938 534
7d62fb64 535 if(!fDetTypeSim) {
536 Error("InitModules","fDetTypeSim is null!");
537 return;
538 }
828e06c7 539
7d62fb64 540 Int_t nl,indexMAX,index;
541
542 if(size<=0){ // default to using data stored in AliITSgeom
543 if(fDetTypeSim->GetITSgeom()==0) {
544 Error("InitModules","fITSgeom not defined");
545 return;
546 } // end if fITSgeom==0
547 nl = fDetTypeSim->GetITSgeom()->GetNlayers();
548 indexMAX = fDetTypeSim->GetITSgeom()->GetIndexMax();
549 nmodules = indexMAX;
550 fITSmodules = new TObjArray(indexMAX);
551 for(index=0;index<indexMAX;index++){
552 fITSmodules->AddAt( new AliITSmodule(index),index);
553 } // end for index
554 }else{
555 fITSmodules = new TObjArray(size);
556 for(index=0;index<size;index++) {
557 fITSmodules->AddAt( new AliITSmodule(index),index);
558 } // end for index
559
560 nmodules = size;
561 } // end i size<=0
2aea926d 562}
563//______________________________________________________________________
564void AliITS::Hits2SDigits(){
565 // Standard Hits to summable Digits function.
4a5bebc2 566 // Inputs:
567 // none.
568 // Outputs:
569 // none.
7d62fb64 570
2aea926d 571
7d62fb64 572 if(!fDetTypeSim) {
573 Error("Hits2SDigits","fDetTypeSim is null!");
574 return;
575
576 }
577
578 SetDefaults();
579 fLoader->LoadHits("read");
580 fLoader->LoadSDigits("recreate");
581 AliRunLoader* rl = fLoader->GetRunLoader();
023ae34b 582 fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
7d62fb64 583 for (Int_t iEvent = 0; iEvent < rl->GetNumberOfEvents(); iEvent++) {
aacedc3e 584 // Do the Hits to Digits operation. Use Standard input values.
585 // Event number from file, no background hit merging , use size from
586 // AliITSgeom class, option="All", input from this file only.
7d62fb64 587 rl->GetEvent(iEvent);
588 if (!fLoader->TreeS()) fLoader->MakeTree("S");
589 MakeBranch("S");
590 SetTreeAddress();
591 HitsToPreDigits(iEvent,0,-1," ",fOpt," ");
592 } // end for iEvent
e0fc0305 593
7d62fb64 594 fLoader->UnloadHits();
595 fLoader->UnloadSDigits();
596
2aea926d 597}
598//______________________________________________________________________
599void AliITS::Hits2Digits(){
2aea926d 600
7d62fb64 601 //Conversion from hits to digits
602 if(!fDetTypeSim) {
603 Error("Hits2SDigits","fDetTypeSim is 0!");
604 return;
605 }
606
023ae34b 607 fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
7d62fb64 608 SetDefaults();
609
610 fLoader->LoadHits("read");
611 fLoader->LoadDigits("recreate");
612 AliRunLoader* rl = fLoader->GetRunLoader();
613 for (Int_t iEvent = 0; iEvent < rl->GetNumberOfEvents(); iEvent++) {
614 rl->GetEvent(iEvent);
615 if (!fLoader->TreeD()) fLoader->MakeTree("D");
616 MakeBranch("D");
617 SetTreeAddress();
618 HitsToDigits(iEvent,0,-1," ",fOpt," ");
619 }
620
621 fLoader->UnloadHits();
622 fLoader->UnloadDigits();
623
2aea926d 624}
7d62fb64 625
2aea926d 626//______________________________________________________________________
7d62fb64 627void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
628 Option_t *option,Option_t *opt,
629 const char *filename){
4a5bebc2 630 // Keep galice.root for signal and name differently the file for
2aea926d 631 // background when add! otherwise the track info for signal will be lost !
632 // the condition below will disappear when the geom class will be
4a5bebc2 633 // initialized for all versions - for the moment it is only for v5 !
634 // 7 is the SDD beam test version.
635 // Inputs:
636 // Int_t evnt Event to be processed.
637 // Int_t bgrev Background Hit tree number.
638 // Int_t nmodules Not used.
639 // Option_t *option String indicating if merging hits or not. To
640 // merge hits set equal to "Add". Otherwise no
641 // background hits are considered.
642 // Test_t *filename File name containing the background hits..
643 // Outputs:
644 // none.
645 // Return:
646 // none.
2aea926d 647
7d62fb64 648 if(!fDetTypeSim) {
649 Error("HitsToDigits","fDetTypeSim is null!");
650 return;
651 }
023ae34b 652 fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
7d62fb64 653 if(!GetITSgeom()) return; // need transformations to do digitization.
654 AliITSgeom *geom = GetITSgeom();
655
656 const char *all = strstr(opt,"All");
657 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
658 strstr(opt,"SSD")};
659 static Bool_t setDef=kTRUE;
660 if (setDef) SetDefaultSimulation();
661 setDef=kFALSE;
662
663 Int_t nmodules;
664 InitModules(size,nmodules);
665 FillModules(evNumber,bgrev,nmodules,option,filename);
666
667 AliITSsimulation *sim = 0;
668 AliITSmodule *mod = 0;
669 Int_t id;
670 for(Int_t module=0;module<geom->GetIndexMax();module++){
671 id = geom->GetModuleType(module);
672 if (!all && !det[id]) continue;
673 sim = (AliITSsimulation*)fDetTypeSim->GetSimulationModel(id);
674 if (!sim) {
675 Error("HitsToDigits","The simulation class was not "
676 "instanciated for module %d type %s!",module,
677 geom->GetModuleTypeName(module));
678 exit(1);
679 } // end if !sim
680 mod = (AliITSmodule *)fITSmodules->At(module);
681 sim->DigitiseModule(mod,module,evNumber);
682 // fills all branches - wasted disk space
683 fLoader->TreeD()->Fill();
684 ResetDigits();
685 } // end for module
686
687 ClearModules();
688
689 fLoader->TreeD()->GetEntries();
690 fLoader->TreeD()->AutoSave();
691 // reset tree
692 fLoader->TreeD()->Reset();
2aea926d 693}
7d62fb64 694//_____________________________________________________________________
695void AliITS::Hits2PreDigits(){
696 // Turn hits into SDigits
697
698 if(!fDetTypeSim) {
699 Error("Hits2SDigits","fDetTypeSim is 0!");
700 return;
701 }
702
023ae34b 703 fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
7d62fb64 704 SetDefaults();
705
706 HitsToPreDigits(fLoader->GetRunLoader()->GetEventNumber(),
707 0,-1," ",fOpt," ");
708}
709
2aea926d 710//______________________________________________________________________
7d62fb64 711void AliITS::HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
712 Option_t *option,Option_t *opt,
713 const char *filename){
4a5bebc2 714 // Keep galice.root for signal and name differently the file for
2aea926d 715 // background when add! otherwise the track info for signal will be lost !
716 // the condition below will disappear when the geom class will be
4a5bebc2 717 // initialized for all versions - for the moment it is only for v5 !
718 // 7 is the SDD beam test version.
719 // Inputs:
720 // Int_t evnt Event to be processed.
721 // Int_t bgrev Background Hit tree number.
722 // Int_t nmodules Not used.
723 // Option_t *option String indicating if merging hits or not. To
724 // merge hits set equal to "Add". Otherwise no
725 // background hits are considered.
726 // Test_t *filename File name containing the background hits..
727 // Outputs:
728 // none.
729 // Return:
730 // none.
731
7d62fb64 732
733 if(!fDetTypeSim) {
734 Error("HitsToPreDigits","fDetTypeSim is null!");
735 return;
736 }
023ae34b 737 fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
7d62fb64 738
739 if(!GetITSgeom()){
740 Error("HitsToPreDigits","fGeom is null!");
741 return; // need transformations to do digitization.
742 }
743 AliITSgeom *geom = GetITSgeom();
744
745 const char *all = strstr(opt,"All");
746 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
747 strstr(opt,"SSD")};
748 static Bool_t setDef=kTRUE;
749 if (setDef) SetDefaultSimulation();
750 setDef=kFALSE;
751
752 Int_t nmodules;
753 InitModules(size,nmodules);
754 FillModules(evNumber,bgrev,nmodules,option,filename);
755
756
757 AliITSsimulation *sim = 0;
758 AliITSmodule *mod = 0;
759 Int_t id,module;
760 for(module=0;module<geom->GetIndexMax();module++){
761 id = geom->GetModuleType(module);
762 if (!all && !det[id]) continue;
763 sim = (AliITSsimulation*)GetSimulationModel(id);
764 if (!sim) {
765 Error("HitsToPreDigits","The simulation class was not "
766 "instanciated for module %d type %s!",module,
767 geom->GetModuleTypeName(module));
768 exit(1);
769 } // end if !sim
770 mod = (AliITSmodule *)fITSmodules->At(module);
771 sim->SDigitiseModule(mod,module,evNumber);
772 // fills all branches - wasted disk space
773 fLoader->TreeS()->Fill();
774 fDetTypeSim->ResetSDigits();
775 } // end for module
04366a57 776
7d62fb64 777 ClearModules();
778
779
780 fLoader->TreeS()->GetEntries();
781 fLoader->TreeS()->AutoSave();
782 fLoader->WriteSDigits("OVERWRITE");
783 // reset tree
784 fLoader->TreeS()->Reset();
2aea926d 785}
7d62fb64 786
787//_____________________________________________________________________
788void AliITS::HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
789 Option_t *opt0,Option_t *opt1,
790 const char *flnm){
791 // keep galice.root for signal and name differently the file for
792 // background when add! otherwise the track info for signal will be lost !
793 // the condition below will disappear when the geom class will be
794 // initialized for all versions - for the moment it is only for v5 !
795 // Inputs:
796 // Int_t evnt Event to be processed.
797 // Int_t bgrev Background Hit tree number.
798 // Int_t size Size used by InitModules. See InitModules.
799 // Option_t *opt0 Option passed to FillModules. See FillModules.
800 // Option_t *opt1 String indicating if merging hits or not. To
801 // merge hits set equal to "Add". Otherwise no
802 // background hits are considered.
803 // Test_t *flnm File name containing the background hits..
804 // Outputs:
805 // none.
806 // Return:
807 // none.
808
809
00a7cc50 810
7d62fb64 811 if(!GetITSgeom()){
812 Error("HitsToPreDigits","fGeom is null!");
813 return; // need transformations to do digitization.
814 }
815 AliITSgeom *geom = GetITSgeom();
816
817 AliITSLoader *pITSloader = (AliITSLoader*)fLoader;
818
819 const char *all = strstr(opt1,"All");
820 const char *det[3] ={strstr(opt1,"SPD"),strstr(opt1,"SDD"),
821 strstr(opt1,"SSD")};
822 Int_t nmodules;
823 InitModules(size,nmodules);
824 FillModules(evNumber,bgrev,nmodules,opt0,flnm);
825
826 AliITSsimulation *sim = 0;
827 AliITSmodule *mod = 0;
828 Int_t id,module;
829
830 TTree *lTR = pITSloader->TreeR();
00a7cc50 831 if(!lTR) {
832 pITSloader->MakeTree("R");
833 lTR = pITSloader->TreeR();
834 }
835
7d62fb64 836 TClonesArray* ptarray = new TClonesArray("AliITSRecPoint",1000);
00a7cc50 837 TBranch* branch = (TBranch*)lTR->Branch("ITSRecPointsF",&ptarray);
838 branch->SetAddress(&ptarray);
7d62fb64 839 //m.b. : this change is nothing but a nice way to make sure
023ae34b 840 //the CPU goes up !
7d62fb64 841 for(module=0;module<geom->GetIndexMax();module++){
842 id = geom->GetModuleType(module);
843 if (!all && !det[id]) continue;
844 sim = (AliITSsimulation*)GetSimulationModel(id);
845 if (!sim) {
846 Error("HitsToFastPoints","The simulation class was not "
847 "instanciated for module %d type %x!",module,
848 geom->GetModuleTypeName(module));
849 exit(1);
850 } // end if !sim
851 mod = (AliITSmodule *)fITSmodules->At(module);
852 sim->CreateFastRecPoints(mod,module,gRandom,ptarray);
853 lTR->Fill();
854 } // end for module
855
856 ClearModules();
857 fLoader->WriteRecPoints("OVERWRITE");
858 delete ptarray;
859}
860//_____________________________________________________________________
861Int_t AliITS::Hits2Clusters(TTree *hTree, TTree *cTree) {
862 //------------------------------------------------------------
863 // This function creates ITS clusters
864 //------------------------------------------------------------
865 if(!GetITSgeom()){
866 Error("HitsToPreDigits","fGeom is null!");
867 return 1; // need transformations to do digitization.
868 }
869 AliITSgeom *geom=GetITSgeom();
870 Int_t mmax=geom->GetIndexMax();
871
872 InitModules(-1,mmax);
873 FillModules(hTree,0);
874
7d62fb64 875 TClonesArray *points = new TClonesArray("AliITSRecPoint",1000);
00a7cc50 876 TBranch *branch=cTree->GetBranch("ITSRecPoints");
877 if (!branch) cTree->Branch("ITSRecPoints",&points);
878 else branch->SetAddress(&points);
7d62fb64 879
880 AliITSsimulationFastPoints sim;
881 Int_t ncl=0;
882 for (Int_t m=0; m<mmax; m++) {
883 AliITSmodule *mod=GetModule(m);
884 sim.CreateFastRecPoints(mod,m,gRandom,points);
00a7cc50 885 ncl+=points->GetEntriesFast();
7d62fb64 886 cTree->Fill();
7d62fb64 887 points->Clear();
888 }
889
890 Info("Hits2Clusters","Number of found fast clusters : %d",ncl);
891
892 //cTree->Write();
893
7d62fb64 894 delete points;
895 return 0;
896}
7d62fb64 897
7d62fb64 898//_____________________________________________________________________
899void AliITS::CheckLabels(Int_t lab[3]) const {
900 //------------------------------------------------------------
901 // Tries to find mother's labels
902 //------------------------------------------------------------
903
904 if(lab[0]<0 && lab[1]<0 && lab[2]<0) return; // In case of no labels just exit
905
906 Int_t ntracks = gAlice->GetMCApp()->GetNtrack();
907 for (Int_t i=0;i<3;i++){
908 Int_t label = lab[i];
909 if (label>=0 && label<ntracks) {
910 TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
911 if (part->P() < 0.005) {
912 Int_t m=part->GetFirstMother();
913 if (m<0) {
914 continue;
915 }
916 if (part->GetStatusCode()>0) {
917 continue;
918 }
919 lab[i]=m;
920 }
921 }
922 }
923
924}
925
926//______________________________________________________________________
927void AliITS::SDigitsToDigits(Option_t *opt){
928 // Standard Summable digits to Digits function.
929 // Inputs:
930 // none.
931 // Outputs:
932 // none.
933 if(!fDetTypeSim) {
934 Error("SDigitsToSDigits","fDetTypeSim is 0!");
935 return;
936 }
937
023ae34b 938 fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
7d62fb64 939 SetDefaults();
940 fDetTypeSim->SDigitsToDigits(opt,(Char_t*)GetName());
941
942}
943
2aea926d 944//______________________________________________________________________
2aea926d 945void AliITS::ResetDigits(){
4a5bebc2 946 // Reset number of digits and the digits array for the ITS detector.
947 // Inputs:
948 // none.
949 // Outputs:
950 // none.
7d62fb64 951 if(!fDetTypeSim) {
952 Error("ResetDigits","fDetTypeSim is 0!");
953 return;
954 }
955
956 fDetTypeSim->ResetDigits();
3bd79107 957
958
2aea926d 959}
960//______________________________________________________________________
7d62fb64 961void AliITS::ResetDigits(Int_t branch){
4a5bebc2 962 // Reset number of digits and the digits array for this branch.
963 // Inputs:
964 // none.
965 // Outputs:
966 // none.
828e06c7 967
7d62fb64 968 if(!fDetTypeSim) {
969 Error("ResetDigits","fDetTypeSim is 0!");
970 return;
971 }
972
973 fDetTypeSim->ResetDigits(branch);
974
2aea926d 975}
976//______________________________________________________________________
977void AliITS::AddSumDigit(AliITSpListItem &sdig){
4a5bebc2 978 // Adds the a module full of summable digits to the summable digits tree.
979 // Inputs:
980 // AliITSpListItem &sdig SDigit to be added to SDigits tree.
981 // Outputs:
982 // none.
983 // Return:
984 // none.
828e06c7 985
7d62fb64 986 if(!fDetTypeSim) {
987 Error("AddSumDigit","fDetTypeSim is 0!");
988 return;
989 }
990 fDetTypeSim->AddSumDigit(sdig);
991
828e06c7 992}
2aea926d 993//______________________________________________________________________
7d62fb64 994void AliITS::AddRealDigit(Int_t branch, Int_t *digits){
4a5bebc2 995 // Add a real digit - as coming from data.
996 // Inputs:
997 // Int_t id Detector type number.
998 // Int_t *digits Integer array containing the digits info. See
999 // AliITSdigit.h
1000 // Outputs:
1001 // none.
1002 // Return:
1003 // none.
9c74c52b 1004
7d62fb64 1005 if(!fDetTypeSim) {
1006 Error("AddRealDigit","fDetTypeSim is 0!");
1007 return;
1008 }
1009 fDetTypeSim->AddRealDigit(branch,digits);
1010
2aea926d 1011}
1012//______________________________________________________________________
7d62fb64 1013void AliITS::AddSimDigit(Int_t branch, AliITSdigit *d){
4a5bebc2 1014 // Add a simulated digit.
1015 // Inputs:
1016 // Int_t id Detector type number.
1017 // AliITSdigit *d Digit to be added to the Digits Tree. See
1018 // AliITSdigit.h
1019 // Outputs:
1020 // none.
1021 // Return:
1022 // none.
2aea926d 1023
7d62fb64 1024 if(!fDetTypeSim) {
1025 Error("AddSimDigit","fDetTypeSim is 0!");
1026 return;
1027 }
1028 fDetTypeSim->AddSimDigit(branch,d);
1029
2aea926d 1030}
1031//______________________________________________________________________
7d62fb64 1032void AliITS::AddSimDigit(Int_t branch,Float_t phys,Int_t *digits,Int_t *tracks,
88cb7938 1033 Int_t *hits,Float_t *charges){
7f1a504b 1034 // Add a simulated digit to the list.
1035 // Inputs:
1036 // Int_t id Detector type number.
1037 // Float_t phys Physics indicator. See AliITSdigits.h
1038 // Int_t *digits Integer array containing the digits info. See
1039 // AliITSdigit.h
1040 // Int_t *tracks Integer array [AliITSdigitS?D::GetNTracks()]
1041 // containing the track numbers that contributed to
1042 // this digit.
1043 // Int_t *hits Integer array [AliITSdigitS?D::GetNTracks()]
1044 // containing the hit numbers, from AliITSmodule, that
1045 // contributed to this digit.
1046 // Float_t *charge Floating point array of the signals contributed
1047 // to this digit by each track.
1048 // Outputs:
1049 // none.
1050 // Return:
1051 // none.
2aea926d 1052
7d62fb64 1053 if(!fDetTypeSim) {
1054 Error("AddSimDigit","fDetTypeSim is 0!");
1055 return;
1056 }
1057 fDetTypeSim->AddSimDigit(branch,phys,digits,tracks,hits,charges);
1058
2aea926d 1059}
0421c3d1 1060//______________________________________________________________________
aacedc3e 1061void AliITS::Digits2Raw(){
1062 // convert digits of the current event to raw data
0421c3d1 1063
7d62fb64 1064 if(!fDetTypeSim) {
1065 Error("Digits2Raw","fDetTypeSim is 0!");
1066 return;
1067 }
023ae34b 1068 fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
7d62fb64 1069 SetDefaults();
1070 fDetTypeSim->GetLoader()->LoadDigits();
1071 TTree* digits = fDetTypeSim->GetLoader()->TreeD();
0421c3d1 1072 if (!digits) {
aacedc3e 1073 Error("Digits2Raw", "no digits tree");
1074 return;
0421c3d1 1075 }
7d62fb64 1076 fDetTypeSim->SetTreeAddressD(digits,(Char_t*)GetName());
0421c3d1 1077
1078 AliITSDDLRawData rawWriter;
1079 //Verbose level
1080 // 0: Silent
1081 // 1: cout messages
1082 // 2: txt files with digits
1083 //BE CAREFUL, verbose level 2 MUST be used only for debugging and
1084 //it is highly suggested to use this mode only for debugging digits files
1085 //reasonably small, because otherwise the size of the txt files can reach
1086 //quickly several MB wasting time and disk space.
1087 rawWriter.SetVerbose(0);
1088
1089 //SILICON PIXEL DETECTOR
1090 Info("Digits2Raw", "Formatting raw data for SPD");
1091 rawWriter.RawDataSPD(digits->GetBranch("ITSDigitsSPD"));
1092
1093 //SILICON DRIFT DETECTOR
1094 Info("Digits2Raw", "Formatting raw data for SDD");
1095 rawWriter.RawDataSDD(digits->GetBranch("ITSDigitsSDD"));
1096
1097 //SILICON STRIP DETECTOR
1098 Info("Digits2Raw", "Formatting raw data for SSD");
1099 rawWriter.RawDataSSD(digits->GetBranch("ITSDigitsSSD"));
1100
1101 fLoader->UnloadDigits();
2aea926d 1102}
2aea926d 1103//______________________________________________________________________
aacedc3e 1104AliLoader* AliITS::MakeLoader(const char* topfoldername){
1105 //builds ITSgetter (AliLoader type)
1106 //if detector wants to use castomized getter, it must overload this method
1107
64f311fe 1108 AliDebug(1,Form("Creating AliITSLoader. Top folder is %s.",
1109 topfoldername));
aacedc3e 1110 fLoader = new AliITSLoader(GetName(),topfoldername);
1111 return fLoader;
2aea926d 1112}
ef7ff1f9 1113
0b5bf101 1114Bool_t AliITS::Raw2SDigits(AliRawReader* rawReader)
1115{
1116 //
1117 // Converts RAW data to SDigits
1118 //
1119 // Get TreeS
1120 //
1121 Int_t last = -1;
1122 Int_t size = GetITSgeom()->GetIndexMax();
1123 TClonesArray** modA = new TClonesArray*[size];
1124 for (Int_t mod = 0; mod < size; mod++) modA[mod] = new TClonesArray("AliITSpListItem", 10000);
1125
1126 AliLoader* loader = (gAlice->GetRunLoader())->GetLoader("ITSLoader");
1127 if (!loader)
1128 {
1129 Error("Open","Can not get ITS loader from Run Loader");
1130 return kFALSE;
1131 }
1132
1133 TTree* tree = 0;
1134 tree = loader->TreeS();
1135 if (!tree)
1136 {
1137 loader->MakeTree("S");
1138 tree = loader->TreeS();
1139 }
1140 //
1141 // Array for SDigits
1142 //
1143 TClonesArray aSDigits("AliITSpListItem",10000), *itsSDigits=&aSDigits;
1144 Int_t bufsize = 32000;
1145 tree->Branch("ITS", &itsSDigits, bufsize);
1146 Int_t npx = 0;
1147 //
1148 // SPD
1149 //
1150 AliITSsegmentationSPD* segSPD = (AliITSsegmentationSPD*) fDetTypeSim->GetSegmentationModel(0);
1151 npx = segSPD->Npx();
1152 Double_t thr, sigma;
1153
1154 AliITSRawStreamSPD inputSPD(rawReader);
1155 while(1){
1156 Bool_t next = inputSPD.Next();
1157 if (!next) break;
1158
1159 Int_t module = inputSPD.GetModuleID();
1160 Int_t column = inputSPD.GetColumn();
1161 Int_t row = inputSPD.GetRow();
1162 Int_t index = npx * column + row;
1163
1164 if (module >= size) continue;
1165
1166 last = (modA[module])->GetEntries();
1167 TClonesArray& dum = *modA[module];
1168 fDetTypeSim->GetCalibrationModel(module)->Thresholds(thr,sigma);
1169 thr += 1.;
1170 new (dum[last]) AliITSpListItem(-1, -1, module, index, thr);
1171 }
1172 rawReader->Reset();
1173
1174 //
1175 // SDD
1176 //
1177 AliITSsegmentationSDD* segSDD = (AliITSsegmentationSDD*) fDetTypeSim->GetSegmentationModel(1);
1178 npx = segSDD->Npx();
1179 AliITSRawStreamSDD inputSDD(rawReader);
1180 while(1){
1181 Bool_t next = inputSDD.Next();
1182 if (!next) break;
1183
1184 Int_t module = inputSDD.GetModuleID();
1185 Int_t anode = inputSDD.GetAnode();
1186 Int_t time = inputSDD.GetTime();
1187 Int_t signal = inputSDD.GetSignal();
1188 Int_t index = npx * anode + time;
1189
1190 if (module >= size) continue;
1191 // 8bit -> 10 bit
1192 AliITSresponseSDD *resSDD = (AliITSresponseSDD*) fDetTypeSim->GetResponse(1);
1193 Int_t signal10 = resSDD->Convert8to10(signal); // signal is a 8 bit value (if the compression is active)
1194
1195 last = modA[module]->GetEntries();
1196 TClonesArray& dum = *modA[module];
1197 new (dum[last]) AliITSpListItem(-1, -1, module, index, Double_t(signal10));
1198 ((AliITSpListItem*) dum.At(last))->AddSignalAfterElect(module, index, Double_t(signal10));
1199
1200 }
1201 rawReader->Reset();
1202
1203 //
1204 // SSD
1205 //
1206 AliITSsegmentationSSD* segSSD = (AliITSsegmentationSSD*) fDetTypeSim->GetSegmentationModel(2);
1207 npx = segSSD->Npx();
1208 AliITSRawStreamSSD inputSSD(rawReader);
1209 while(1){
1210 Bool_t next = inputSSD.Next();
1211 if (!next) break;
1212
1213 Int_t module = inputSSD.GetModuleID();
1214 Int_t side = inputSSD.GetSideFlag();
1215 Int_t strip = inputSSD.GetStrip();
1216 Int_t signal = inputSSD.GetSignal();
1217 Int_t index = npx * side + strip;
1218
1219 if (module >= size) continue;
1220
1221 last = modA[module]->GetEntries();
1222 TClonesArray& dum = *modA[module];
1223 new (dum[last]) AliITSpListItem(-1, -1, module, index, Double_t(signal));
1224 }
1225 rawReader->Reset();
1226 AliITSpListItem* sdig = 0;
1227
1228 for (Int_t mod = 0; mod < size; mod++)
1229 {
1230 Int_t nsdig = modA[mod]->GetEntries();
1231 for (Int_t ie = 0; ie < nsdig; ie++) {
1232 sdig = (AliITSpListItem*) (modA[mod]->At(ie));
1233 new (aSDigits[ie]) AliITSpListItem(-1, -1, mod, sdig->GetIndex(), sdig->GetSignal());
1234 Float_t sig = sdig->GetSignalAfterElect();
1235 if (sig > 0.) {
1236 sdig = (AliITSpListItem*)aSDigits[ie];
1237 sdig->AddSignalAfterElect(mod, sdig->GetIndex(), Double_t(sig));
1238 }
1239 }
1240
1241 tree->Fill();
1242 aSDigits.Clear();
1243 modA[mod]->Clear();
1244 }
1245 loader->WriteSDigits("OVERWRITE");
1246 delete modA;
1247 return kTRUE;
1248}
1249
1250
ef7ff1f9 1251//______________________________________________________________________
1252void AliITS::UpdateInternalGeometry(){
1253
ed9289c8 1254 //reads new geometry from TGeo
09669aa7 1255 AliDebug(1,"Delete ITSgeom and create a new one reading TGeo");
1256 AliITSInitGeometry initgeom("AliITSvPPRasymmFMD",2);
1257 AliITSgeom* geom = initgeom.CreateAliITSgeom();
ef7ff1f9 1258 SetITSgeom(geom);
1259
1260 if(!fLoader) MakeLoader(AliConfig::GetDefaultEventFolderName());
1261 AliRunLoader* rl = fLoader->GetRunLoader();
1262 rl->CdGAFile();
1263 geom->Write(0,kOverwrite);
1264
1265}
0b5bf101 1266