1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.62 2001/10/21 19:23:21 nilsen
19 Added function to allow to limit which detectors to digitize and reconstruct.
20 The default is All. This change makes no changes to any root file.
22 Revision 1.61 2001/10/11 15:26:07 mariana
23 Correct HitsToFastRecPoints
25 Revision 1.60 2001/10/04 22:38:10 nilsen
26 Changes made to support PreDigits (SDigits) plus other helpful changes.
28 Revision 1.59 2001/08/30 09:56:18 hristov
29 The operator[] is replaced by At() or AddAt() in case of TObjArray.
31 Revision 1.58 2001/07/26 15:05:29 hristov
32 Use global gRandom generator (M.Ivanov)
34 Revision 1.57 2001/07/24 14:26:11 mariana
35 Introduce the function Digits2Reco() and write the defaults for simulation and reconstruction
37 Revision 1.56 2001/07/05 12:49:49 mariana
38 Temporary patches required by root.v3.01.05
40 Revision 1.55 2001/06/14 14:59:00 barbera
41 Tracking V1 decoupled from AliITS
43 Revision 1.54 2001/05/31 20:37:56 barbera
44 Bari/Salerno model set as defaault SPD simulation
46 Revision 1.53 2001/05/31 18:52:24 barbera
47 Bari model becomes the default
49 Revision 1.53 2001/05/30 07:52:24 hristov
50 TPC and CONTAINERS included in the search path
52 Revision 1.52 2001/05/30 06:04:58 hristov
53 Changes made to be consitant with changes in TPC tracking classes (B.Nilsen)
55 Revision 1.51 2001/05/16 14:57:15 alibrary
56 New files for folders and Stack
58 Revision 1.50 2001/05/11 09:15:21 barbera
59 Corrected to make fast point creation working with PPR geometry
61 Revision 1.49 2001/05/11 07:37:49 hristov
62 Legacy lines commented
64 Revision 1.48 2001/05/10 18:14:25 barbera
67 Revision 1.47 2001/05/10 17:55:59 barbera
68 Modified to create rec points also for PPR geometries
70 Revision 1.46 2001/05/10 00:05:28 nilsen
71 Allowed for HitsToDigits function to work with versions 5, 7, 8, and 9. This
72 should probably be cleaned up to only check to make sure that fITSgeom has
73 been properly defined.
75 Revision 1.45 2001/05/01 22:35:48 nilsen
76 Remove/commented a number of cout<< statements. and made change needed by
79 Revision 1.44 2001/04/26 22:44:01 nilsen
80 Removed dependence on layer 5/6 in AliITS::HitsToDigits. This will be
81 done properly in AliITSv???.cxx via SetDefaults.
83 Revision 1.43 2001/04/26 13:22:52 barbera
84 TMatrix and TVector elimininated to speed up the code
86 Revision 1.42 2001/04/25 21:55:12 barbera
87 Updated version to be compatible with actual verion of STEER and TPC
89 Revision 1.41 2001/04/21 15:16:51 barbera
90 Updated with the new SSD reconstruction code
92 Revision 1.40 2001/03/17 15:07:06 mariana
93 Update SDD response parameters
95 Revision 1.39 2001/03/12 17:45:32 hristov
96 Changes needed on Sun with CC 5.0
98 Revision 1.38 2001/03/07 14:04:51 barbera
99 Some vector dimensions increased to cope with full events
101 Revision 1.37 2001/03/07 12:36:35 barbera
102 A change added in the tracking part to manage delta rays
104 Revision 1.36 2001/03/02 19:44:11 barbera
105 modified to taking into account new version tracking v1
107 Revision 1.35 2001/02/28 18:16:46 mariana
108 Make the code compatible with the new AliRun
110 Revision 1.34 2001/02/11 15:51:39 mariana
111 Set protection in MakeBranch
113 Revision 1.33 2001/02/10 22:26:39 mariana
114 Move the initialization of the containers for raw clusters in MakeTreeC()
116 Revision 1.32 2001/02/08 23:55:31 nilsen
117 Removed fMajor/MinorVersion variables in favor of variables in derived classes.
118 Set arrays char *det[3] = {"SPD","SDD","SSD"} as const.
120 Revision 1.31 2001/02/02 23:57:28 nilsen
121 Added include file that are no londer included in AliITSgeom.h
123 Revision 1.30 2001/01/30 09:23:13 hristov
124 Streamers removed (R.Brun)
126 Revision 1.29 2001/01/26 20:01:09 hristov
127 Major upgrade of AliRoot code
129 Revision 1.28 2000/12/18 14:02:00 barbera
130 new version of the ITS tracking to take into account the new TPC track parametrization
132 Revision 1.27 2000/12/08 13:49:27 barbera
133 Hidden declaration in a for loop removed to be compliant with HP-UX compiler
135 Revision 1.26 2000/11/27 13:12:13 barbera
136 New version containing the files for tracking
138 Revision 1.25 2000/11/12 22:38:05 barbera
139 Added header file for the SPD Bari model
141 Revision 1.24 2000/10/09 22:18:12 barbera
142 Bug fixes from MAriana to le AliITStest.C run correctly
144 Revision 1.23 2000/10/05 20:47:42 nilsen
145 fixed dependencies of include files. Tryed but failed to get a root automaticly
146 generates streamer function to work. Modified SetDefaults.
148 Revision 1.9.2.15 2000/10/04 16:56:40 nilsen
149 Needed to include stdlib.h
152 Revision 1.22 2000/10/04 19:45:52 barbera
153 Corrected by F. Carminati for v3.04
155 Revision 1.21 2000/10/02 21:28:08 fca
156 Removal of useless dependecies via forward declarations
158 Revision 1.20 2000/10/02 16:31:39 barbera
159 General code clean-up
161 Revision 1.9.2.14 2000/10/02 15:43:51 barbera
162 General code clean-up (e.g., printf -> cout)
164 Revision 1.19 2000/09/22 12:13:25 nilsen
165 Patches and updates for fixes to this and other routines.
167 Revision 1.18 2000/07/12 05:32:20 fca
168 Correcting several syntax problem with static members
170 Revision 1.17 2000/07/10 16:07:18 fca
171 Release version of ITS code
173 Revision 1.9.2.3 2000/02/02 13:42:09 barbera
174 fixed AliITS.cxx for new AliRun structure. Added ITS hits list to list of hits which will have their track numbers updated
176 Revision 1.9.2.2 2000/01/23 03:03:13 nilsen
177 //fixed FillModule. Removed fi(fabs(xl)<dx....
179 Revision 1.9.2.1 2000/01/12 19:03:32 nilsen
180 This is the version of the files after the merging done in December 1999.
181 See the ReadMe110100.txt file for details
183 Revision 1.9 1999/11/14 14:33:25 fca
184 Correct problems with distructors and pointers, thanks to I.Hrivnacova
186 Revision 1.8 1999/09/29 09:24:19 fca
187 Introduction of the Copyright and cvs Log
191 ///////////////////////////////////////////////////////////////////////////////
193 // An overview of the basic philosophy of the ITS code development
194 // and analysis is show in the figure below.
197 <img src="picts/ITS/ITS_Analysis_schema.gif">
200 <font size=+2 color=red>
201 <p>Roberto Barbera is in charge of the ITS Offline code (1999).
202 <a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
208 // AliITS. Inner Traking System base class.
209 // This class contains the base procedures for the Inner Tracking System
213 <img src="picts/ITS/AliITS_Class_Diagram.gif">
216 <font size=+2 color=red>
217 <p>This show the class diagram of the different elements that are part of
225 // Written by Rene Brun, Federico Carminati, and Roberto Barbera
228 // Modified and documented by Bjorn S. Nilsen
232 // Modified and documented by A. Bologna
235 // AliITS is the general base class for the ITS. Also see AliDetector for
236 // futher information.
238 ///////////////////////////////////////////////////////////////////////////////
239 #include <iostream.h>
247 #include <TClonesArray.h>
249 #include <TObjectTable.h>
256 #include "AliHeader.h"
259 #include "AliITSDetType.h"
260 #include "AliITSresponseSPD.h"
261 #include "AliITSresponseSDD.h"
262 #include "AliITSresponseSSD.h"
263 #include "AliITSsegmentationSPD.h"
264 #include "AliITSsegmentationSDD.h"
265 #include "AliITSsegmentationSSD.h"
266 #include "AliITSsimulationSPD.h"
267 #include "AliITSsimulationSDD.h"
268 #include "AliITSsimulationSSD.h"
269 #include "AliITSClusterFinderSPD.h"
270 #include "AliITSClusterFinderSDD.h"
271 #include "AliITSClusterFinderSSD.h"
272 #include "AliITShit.h"
273 #include "AliITSgeom.h"
274 #include "AliITSpList.h"
275 #include "AliITSdigit.h"
276 #include "AliITSmodule.h"
277 #include "AliITSRecPoint.h"
278 #include "AliITSRawCluster.h"
282 //______________________________________________________________________
283 AliITS::AliITS() : AliDetector() {
284 // Default initializer for ITS
285 // The default constructor of the AliITS class. In addition to
286 // creating the AliITS class it zeros the variables fIshunt (a member
287 // of AliDetector class), fEuclidOut, and fIdN, and zeros the pointers
288 // fITSpoints, fIdSens, and fIdName. The AliDetector default constructor
297 fIshunt = 0; // not zeroed in AliDetector.
303 SetDetectors(); // default to "All". This variable not written out.
309 fNDetTypes = kNTYPES;
325 SetMarkerColor(kRed);
327 //______________________________________________________________________
328 AliITS::AliITS(const char *name, const char *title):AliDetector(name,title){
329 // The standard Constructor for the ITS class. In addition to
330 // creating the AliITS class, it allocates memory for the TClonesArrays
331 // fHits, fSDigits, fDigits, fITSpoints, and the TObjArray of fCtype
332 // (clusters). It also zeros the variables
333 // fIshunt (a member of AliDetector class), fEuclidOut, and fIdN, and zeros
334 // the pointers fIdSens and fIdName. To help in displaying hits via the
335 // ROOT macro display.C AliITS also sets the marker color to red. The
336 // variables passes with this constructor, const char *name and *title,
337 // are used by the constructor of AliDetector class. See AliDetector
338 // class for a description of these parameters and its constructor
341 // const char *name Detector name. Should always be "ITS"
342 // const char *title Detector title.
348 fIshunt = 0; // not zeroed in AliDetector
349 fHits = new TClonesArray("AliITShit", 1560);//not done in AliDetector
350 gAlice->AddHitList(fHits); // Not done in AliDetector.
355 SetDetectors(); // default to "All". This variable not written out.
361 fNDetTypes = kNTYPES;
362 fDetTypes = new TObjArray(fNDetTypes);
364 fSDigits = new TClonesArray("AliITSpListItem",1000);
367 fNdtype = new Int_t[fNDetTypes];
368 fDtype = new TObjArray(fNDetTypes);
370 fCtype = new TObjArray(fNDetTypes);
371 fNctype = new Int_t[fNDetTypes];
374 fRecPoints = new TClonesArray("AliITSRecPoint",1000);
378 for(i=0;i<fNDetTypes;i++) {
379 fDetTypes->AddAt(new AliITSDetType(),i);
384 SetMarkerColor(kRed);
386 //______________________________________________________________________
388 // Default destructor for ITS.
389 // The default destructor of the AliITS class. In addition to deleting
390 // the AliITS class it deletes the memory pointed to by the fHits, fDigits,
391 // fSDigits, fCtype, fITSmodules, fITSgeom, fRecPoints, fIdSens, fIdName,
392 // fITSpoints, fDetType and it's contents.
404 if(fIdName!=0) delete[] fIdName; // Array of TStrings
405 if(fIdSens!=0) delete[] fIdSens;
407 this->ClearModules();
409 }// end if fITSmodules!=0
425 } // end if fDetTypes
427 if (fTreeC) delete fTreeC;
429 if (fITSgeom) delete fITSgeom;
431 //______________________________________________________________________
432 AliITS::AliITS(AliITS &source){
433 // Copy constructor. This is a function which is not allowed to be
434 // done to the ITS. It exits with an error.
436 // AliITS &source An AliITS class.
442 if(this==&source) return;
443 Error("Copy constructor",
444 "You are not allowed to make a copy of the AliITS");
447 //______________________________________________________________________
448 AliITS& AliITS::operator=(AliITS &source){
449 // Assignment operator. This is a function which is not allowed to be
450 // done to the ITS. It exits with an error.
452 // AliITS &source An AliITS class.
458 if(this==&source) return *this;
459 Error("operator=","You are not allowed to make a copy of the AliITS");
461 return *this; //fake return
463 //______________________________________________________________________
464 Int_t AliITS::DistancetoPrimitive(Int_t,Int_t){
465 // Distance from mouse to ITS on the screen. Dummy routine
466 // A dummy routine used by the ROOT macro display.C to allow for the
467 // use of the mouse (pointing device) in the macro. In general this should
468 // never be called. If it is it returns the number 9999 for any value of
471 // Int_t Dummy screen coordinate.
472 // Int_t Dummy screen coordinate.
476 // Int_t Dummy = 9999 distance to ITS.
480 //______________________________________________________________________
482 // Initializer ITS after it has been built
483 // This routine initializes the AliITS class. It is intended to be
484 // called from the Init function in AliITSv?. Besides displaying a banner
485 // indicating that it has been called it initializes the array fIdSens
486 // and sets the default segmentation, response, digit and raw cluster
487 // classes therefore it should be called after a call to CreateGeometry.
498 for(i=0;i<fIdN;i++) fIdSens[i] = gMC->VolId(fIdName[i]);
500 //______________________________________________________________________
501 void AliITS::SetDefaults(){
502 // sets the default segmentation, response, digit and raw cluster classes.
510 if(fDebug) printf("%s: SetDefaults\n",ClassName());
512 AliITSDetType *iDetType;
516 if (!iDetType->GetSegmentationModel()) {
517 AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(fITSgeom);
518 SetSegmentationModel(0,seg0);
520 if (!iDetType->GetResponseModel()) {
521 SetResponseModel(0,new AliITSresponseSPD());
523 // set digit and raw cluster classes to be used
525 const char *kData0=(iDetType->GetResponseModel())->DataType();
526 if (strstr(kData0,"real")) {
527 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSPD");
528 } else iDetType->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD");
532 if (!iDetType->GetResponseModel()) {
533 SetResponseModel(1,new AliITSresponseSDD());
535 AliITSresponse *resp1=iDetType->GetResponseModel();
536 if (!iDetType->GetSegmentationModel()) {
537 AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(fITSgeom,resp1);
538 SetSegmentationModel(1,seg1);
540 const char *kData1=(iDetType->GetResponseModel())->DataType();
541 const char *kopt=iDetType->GetResponseModel()->ZeroSuppOption();
542 if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D")) || strstr(kData1,"real") ){
543 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD");
544 } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
548 if (!iDetType->GetSegmentationModel()) {
549 AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(fITSgeom);
550 SetSegmentationModel(2,seg2);
552 if (!iDetType->GetResponseModel()) {
553 SetResponseModel(2,new AliITSresponseSSD());
555 const char *kData2=(iDetType->GetResponseModel())->DataType();
556 if (strstr(kData2,"real")) {
557 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSSD");
558 } else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
561 Warning("SetDefaults",
562 "Only the three basic detector types are initialized!");
565 //______________________________________________________________________
566 void AliITS::SetDefaultSimulation(){
567 // sets the default simulation.
575 AliITSDetType *iDetType;
577 if (!iDetType->GetSimulationModel()) {
578 AliITSsegmentation *seg0=
579 (AliITSsegmentation*)iDetType->GetSegmentationModel();
580 AliITSresponse *res0 = (AliITSresponse*)iDetType->GetResponseModel();
581 AliITSsimulationSPD *sim0=new AliITSsimulationSPD(seg0,res0);
582 SetSimulationModel(0,sim0);
585 if (!iDetType->GetSimulationModel()) {
586 AliITSsegmentation *seg1=
587 (AliITSsegmentation*)iDetType->GetSegmentationModel();
588 AliITSresponse *res1 = (AliITSresponse*)iDetType->GetResponseModel();
589 AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1);
590 SetSimulationModel(1,sim1);
593 if (!iDetType->GetSimulationModel()) {
594 AliITSsegmentation *seg2=
595 (AliITSsegmentation*)iDetType->GetSegmentationModel();
596 AliITSresponse *res2 = (AliITSresponse*)iDetType->GetResponseModel();
597 AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2);
598 SetSimulationModel(2,sim2);
601 //______________________________________________________________________
602 void AliITS::SetDefaultClusterFinders(){
603 // Sets the default cluster finders. Used in finding RecPoints.
612 AliITSDetType *iDetType;
616 if (!iDetType->GetReconstructionModel()) {
617 AliITSsegmentation *seg0 =
618 (AliITSsegmentation*)iDetType->GetSegmentationModel();
619 TClonesArray *dig0=DigitsAddress(0);
620 TClonesArray *recp0=ClustersAddress(0);
621 AliITSClusterFinderSPD *rec0 = new AliITSClusterFinderSPD(seg0,dig0,
623 SetReconstructionModel(0,rec0);
628 if (!iDetType->GetReconstructionModel()) {
629 AliITSsegmentation *seg1 =
630 (AliITSsegmentation*)iDetType->GetSegmentationModel();
631 AliITSresponse *res1 = (AliITSresponse*)iDetType->GetResponseModel();
632 TClonesArray *dig1=DigitsAddress(1);
633 TClonesArray *recp1=ClustersAddress(1);
634 AliITSClusterFinderSDD *rec1 =
635 new AliITSClusterFinderSDD(seg1,res1,dig1,recp1);
636 SetReconstructionModel(1,rec1);
641 if (!iDetType->GetReconstructionModel()) {
642 AliITSsegmentation *seg2=
643 (AliITSsegmentation*)iDetType->GetSegmentationModel();
644 TClonesArray *dig2=DigitsAddress(2);
645 AliITSClusterFinderSSD *rec2= new AliITSClusterFinderSSD(seg2,dig2);
646 SetReconstructionModel(2,rec2);
649 //______________________________________________________________________
650 void AliITS::MakeBranch(Option_t* option, const char *file){
651 // Creates Tree branches for the ITS.
653 // Option_t *option String of Tree types S,D, and/or R.
654 // const char *file String of the file name where these branches
655 // are to be stored. If blank then these branches
656 // are written to the same tree as the Hits were
662 const char *cS = strstr(option,"S");
663 const char *cD = strstr(option,"D");
664 const char *cR = strstr(option,"R");
666 AliDetector::MakeBranch(option,file);
668 if(cS) MakeBranchS(file);
669 if(cD) MakeBranchD(file);
670 if(cR) MakeBranchR(file);
672 //______________________________________________________________________
673 void AliITS::SetTreeAddress(){
674 // Set branch address for the Trees.
681 TTree *treeS = gAlice->TreeS();
682 TTree *treeD = gAlice->TreeD();
683 TTree *treeR = gAlice->TreeR();
685 AliDetector::SetTreeAddress();
687 SetTreeAddressS(treeS);
688 SetTreeAddressD(treeD);
689 SetTreeAddressR(treeR);
691 //______________________________________________________________________
692 AliITSDetType* AliITS::DetType(Int_t id){
693 // Return pointer to id detector type.
695 // Int_t id detector id number.
699 // returned, a pointer to a AliITSDetType.
701 return ((AliITSDetType*) fDetTypes->At(id));
703 //______________________________________________________________________
704 void AliITS::SetResponseModel(Int_t id, AliITSresponse *response){
705 // Set the response model for the id detector type.
707 // Int_t id detector id number.
708 // AliITSresponse* a pointer containing an instance of AliITSresponse
709 // to be stored/owned b y AliITSDetType.
715 ((AliITSDetType*) fDetTypes->At(id))->ResponseModel(response);
717 //______________________________________________________________________
718 void AliITS::SetSegmentationModel(Int_t id, AliITSsegmentation *seg){
719 // Set the segmentation model for the id detector type.
721 // Int_t id detector id number.
722 // AliITSsegmentation* a pointer containing an instance of
723 // AliITSsegmentation to be stored/owned b y
730 ((AliITSDetType*) fDetTypes->At(id))->SegmentationModel(seg);
732 //______________________________________________________________________
733 void AliITS::SetSimulationModel(Int_t id, AliITSsimulation *sim){
734 // Set the simulation model for the id detector type.
736 // Int_t id detector id number.
737 // AliITSresponse* a pointer containing an instance of AliITSresponse
738 // to be stored/owned b y AliITSDetType.
744 ((AliITSDetType*) fDetTypes->At(id))->SimulationModel(sim);
747 //______________________________________________________________________
748 void AliITS::SetReconstructionModel(Int_t id, AliITSClusterFinder *reconst){
749 // Set the cluster finder model for the id detector type.
751 // Int_t id detector id number.
752 // AliITSClusterFinder* a pointer containing an instance of
753 // AliITSClusterFinder to be stored/owned b y
760 ((AliITSDetType*) fDetTypes->At(id))->ReconstructionModel(reconst);
762 //______________________________________________________________________
763 void AliITS::SetClasses(Int_t id, const char *digit, const char *cluster){
764 // Set the digit and cluster classes name to be used for the id detector
767 // Int_t id detector id number.
768 // const char *digit Digit class name for detector id.
769 // const char *cluster Cluster class name for detector id.
775 ((AliITSDetType*) fDetTypes->At(id))->ClassNames(digit,cluster);
777 //______________________________________________________________________
778 void AliITS::AddHit(Int_t track, Int_t *vol, Float_t *hits){
780 // The function to add information to the AliITShit class. See the
781 // AliITShit class for a full description. This function allocates the
782 // necessary new space for the hit information and passes the variable
783 // track, and the pointers *vol and *hits to the AliITShit constructor
786 // Int_t track Track number which produced this hit.
787 // Int_t *vol Array of Integer Hit information. See AliITShit.h
788 // Float_t *hits Array of Floating Hit information. see AliITShit.h
794 TClonesArray &lhits = *fHits;
795 new(lhits[fNhits++]) AliITShit(fIshunt,track,vol,hits);
797 //______________________________________________________________________
798 void AliITS::InitModules(Int_t size,Int_t &nmodules){
799 // Initialize the modules array.
801 // Int_t size Size of array of the number of modules to be
802 // created. If size <=0 then the number of modules
803 // is gotten from AliITSgeom class kept in fITSgeom.
805 // Int_t &nmodules The number of modules existing.
810 fITSmodules->Delete();
812 } // end fir fITSmoudles
814 Int_t nl,indexMAX,index;
816 if(size<=0){ // default to using data stored in AliITSgeom
818 Error("InitModules","fITSgeom not defined");
820 } // end if fITSgeom==0
821 nl = fITSgeom->GetNlayers();
822 indexMAX = fITSgeom->GetModuleIndex(nl,fITSgeom->GetNladders(nl),
823 fITSgeom->GetNdetectors(nl))+1;
825 fITSmodules = new TObjArray(indexMAX);
826 for(index=0;index<indexMAX;index++){
827 fITSmodules->AddAt( new AliITSmodule(index),index);
830 fITSmodules = new TObjArray(size);
831 for(index=0;index<size;index++) {
832 fITSmodules->AddAt( new AliITSmodule(index),index);
838 //______________________________________________________________________
839 void AliITS::FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
840 Option_t *option,Text_t *filename){
841 // fill the modules with the sorted by module hits; add hits from
842 // background if option=Add.
844 // Int_t evnt Event to be processed.
845 // Int_t bgrev Background Hit tree number.
846 // Int_t nmodules Not used.
847 // Option_t *option String indicating if merging hits or not. To
848 // merge hits set equal to "Add". Otherwise no
849 // background hits are considered.
850 // Test_t *filename File name containing the background hits..
855 static TTree *trH1; //Tree with background hits
856 static TClonesArray *fHits2; //List of hits for one track only
857 static Bool_t first=kTRUE;
859 const char *addBgr = strstr(option,"Add");
863 file=new TFile(filename);
864 fHits2 = new TClonesArray("AliITShit",1000 );
869 // Get Hits Tree header from file
870 if(fHits2) fHits2->Clear();
871 if(trH1) delete trH1;
875 sprintf(treeName,"TreeH%d",bgrev);
876 trH1 = (TTree*)gDirectory->Get(treeName);
878 Error("FillModules","cannot find Hits Tree for event:%d",bgrev);
880 // Set branch addresses
883 sprintf(branchname,"%s",GetName());
884 if (trH1 && fHits2) {
885 branch = trH1->GetBranch(branchname);
886 if (branch) branch->SetAddress(&fHits2);
887 } // end if trH1 && fHits
890 TClonesArray *itsHits = this->Hits();
891 Int_t lay,lad,det,index;
894 TTree *iTH = gAlice->TreeH();
895 Int_t ntracks =(Int_t) iTH->GetEntries();
897 for(t=0; t<ntracks; t++){
900 Int_t nhits = itsHits->GetEntriesFast();
901 if (!nhits) continue;
902 for(h=0; h<nhits; h++){
903 itsHit = (AliITShit *)itsHits->UncheckedAt(h);
904 itsHit->GetDetectorID(lay,lad,det);
905 // temporarily index=det-1 !!!
906 if(fITSgeom) index = fITSgeom->GetModuleIndex(lay,lad,det);
909 mod = this->GetModule(index);
910 mod->AddHit(itsHit,t,h);
911 } // end loop over hits
912 } // end loop over tracks
914 // open the file with background
918 ntracks =(Int_t)trH1->GetEntries();
920 for (track=0; track<ntracks; track++) {
921 if (fHits2) fHits2->Clear();
922 trH1->GetEvent(track);
924 for(i=0;i<fHits2->GetEntriesFast();++i) {
925 itsHit=(AliITShit*) (*fHits2)[i];
926 itsHit->GetDetectorID(lay,lad,det);
927 // temporarily index=det-1 !!!
928 if(fITSgeom) index = fITSgeom->GetModuleIndex(lay,lad,det);
931 mod = this->GetModule(index);
932 mod->AddHit(itsHit,track,i);
933 } // end loop over hits
934 } // end loop over tracks
935 TTree *fAli=gAlice->TreeK();
937 if (fAli) fileAli =fAli->GetCurrentFile();
941 //______________________________________________________________________
942 void AliITS::ClearModules(){
943 // Clear the modules TObjArray.
949 if(fITSmodules) fITSmodules->Delete();
951 //______________________________________________________________________
952 void AliITS::MakeBranchS(const char *fl){
953 // Creates Tree Branch for the ITS summable digits.
955 // cont char *fl File name where SDigits branch is to be written
956 // to. If blank it write the SDigits to the same
957 // file in which the Hits were found.
962 Int_t buffersize = 4000;
965 // only one branch for SDigits.
966 sprintf(branchname,"%s",GetName());
967 if(fSDigits && gAlice->TreeS()){
968 MakeBranchInTree(gAlice->TreeS(),branchname,&fSDigits,buffersize,fl);
971 //______________________________________________________________________
972 void AliITS::SetTreeAddressS(TTree *treeS){
973 // Set branch address for the ITS summable digits Trees.
975 // TTree *treeS Tree containing the SDigits.
984 sprintf(branchname,"%s",GetName());
985 branch = treeS->GetBranch(branchname);
986 if (branch) branch->SetAddress(&fSDigits);
988 //______________________________________________________________________
989 void AliITS::MakeBranchD(const char *file){
990 // Creates Tree branches for the ITS.
992 // cont char *file File name where Digits branch is to be written
993 // to. If blank it write the SDigits to the same
994 // file in which the Hits were found.
999 Int_t buffersize = 4000;
1000 char branchname[30];
1002 sprintf(branchname,"%s",GetName());
1003 // one branch for digits per type of detector
1004 const char *det[3] = {"SPD","SDD","SSD"};
1008 for (i=0; i<kNTYPES ;i++) {
1009 DetType(i)->GetClassNames(digclass,clclass);
1011 if(!(fDtype->At(i))) fDtype->AddAt(new TClonesArray(digclass,1000),i);
1012 else ResetDigits(i);
1014 for (i=0; i<kNTYPES ;i++) {
1015 if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
1016 else sprintf(branchname,"%sDigits%d",GetName(),i+1);
1017 if (fDtype && gAlice->TreeD()) {
1018 MakeBranchInTree(gAlice->TreeD(),
1019 branchname, &((*fDtype)[i]),buffersize,file);
1023 //______________________________________________________________________
1024 void AliITS::SetTreeAddressD(TTree *treeD){
1025 // Set branch address for the Trees.
1027 // TTree *treeD Tree containing the Digits.
1032 char branchname[30];
1033 const char *det[3] = {"SPD","SDD","SSD"};
1040 for (i=0; i<kNTYPES; i++) {
1041 DetType(i)->GetClassNames(digclass,clclass);
1043 if(!(fDtype->At(i))) fDtype->AddAt(new TClonesArray(digclass,1000),i);
1044 else ResetDigits(i);
1045 if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
1046 else sprintf(branchname,"%sDigits%d",GetName(),i+1);
1048 branch = treeD->GetBranch(branchname);
1049 if (branch) branch->SetAddress(&((*fDtype)[i]));
1053 //______________________________________________________________________
1054 void AliITS::Hits2SDigits(){
1055 // Standard Hits to summable Digits function.
1061 return; // Using Hits in place of the larger sDigits.
1062 AliHeader *header=gAlice->GetHeader(); // Get event number from this file.
1063 // Do the Hits to Digits operation. Use Standard input values.
1064 // Event number from file, no background hit merging , use size from
1065 // AliITSgeom class, option="All", input from this file only.
1066 HitsToSDigits(header->GetEvent(),0,-1," ",fOpt," ");
1068 //______________________________________________________________________
1069 void AliITS::Hits2PreDigits(){
1070 // Standard Hits to summable Digits function.
1076 AliHeader *header=gAlice->GetHeader(); // Get event number from this file.
1077 // Do the Hits to Digits operation. Use Standard input values.
1078 // Event number from file, no background hit merging , use size from
1079 // AliITSgeom class, option="All", input from this file only.
1080 HitsToPreDigits(header->GetEvent(),0,-1," ",fOpt," ");
1082 //______________________________________________________________________
1083 void AliITS::SDigits2Digits(){
1084 // Standard Summable digits to Digits function.
1092 //______________________________________________________________________
1093 void AliITS::Hits2Digits(){
1094 // Standard Hits to Digits function.
1100 AliHeader *header=gAlice->GetHeader(); // Get event number from this file.
1101 // Do the Hits to Digits operation. Use Standard input values.
1102 // Event number from file, no background hit merging , use size from
1103 // AliITSgeom class, option="All", input from this file only.
1104 HitsToDigits(header->GetEvent(),0,-1," ",fOpt," ");
1106 //______________________________________________________________________
1107 void AliITS::HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size,
1108 Option_t *option, Option_t *opt,Text_t *filename){
1109 // keep galice.root for signal and name differently the file for
1110 // background when add! otherwise the track info for signal will be lost !
1111 // the condition below will disappear when the geom class will be
1112 // initialized for all versions - for the moment it is only for v5 !
1113 // 7 is the SDD beam test version. Dummy routine. Hits are ITS's Summable
1116 // Int_t evnt Event to be processed.
1117 // Int_t bgrev Background Hit tree number.
1118 // Int_t nmodules Not used.
1119 // Option_t *option String indicating if merging hits or not. To
1120 // merge hits set equal to "Add". Otherwise no
1121 // background hits are considered.
1122 // Test_t *filename File name containing the background hits..
1127 return; // using Hits instead of the larger sdigits.
1129 //______________________________________________________________________
1130 void AliITS::HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
1131 Option_t *option, Option_t *opt,Text_t *filename){
1132 // Keep galice.root for signal and name differently the file for
1133 // background when add! otherwise the track info for signal will be lost !
1134 // the condition below will disappear when the geom class will be
1135 // initialized for all versions - for the moment it is only for v5 !
1136 // 7 is the SDD beam test version.
1138 // Int_t evnt Event to be processed.
1139 // Int_t bgrev Background Hit tree number.
1140 // Int_t nmodules Not used.
1141 // Option_t *option String indicating if merging hits or not. To
1142 // merge hits set equal to "Add". Otherwise no
1143 // background hits are considered.
1144 // Test_t *filename File name containing the background hits..
1150 if(!GetITSgeom()) return; // need transformations to do digitization.
1151 AliITSgeom *geom = GetITSgeom();
1153 const char *all = strstr(opt,"All");
1154 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1156 static Bool_t setDef=kTRUE;
1157 if (setDef) SetDefaultSimulation();
1161 InitModules(size,nmodules);
1162 FillModules(evNumber,bgrev,nmodules,option,filename);
1164 AliITSsimulation *sim = 0;
1165 AliITSDetType *iDetType = 0;
1166 AliITSmodule *mod = 0;
1168 for(module=0;module<geom->GetIndexMax();module++){
1169 id = geom->GetModuleType(module);
1170 if (!all && !det[id]) continue;
1171 iDetType = DetType(id);
1172 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1174 Error("HitsToSDigits",
1175 "The simulation class was not instanciated!");
1178 mod = (AliITSmodule *)fITSmodules->At(module);
1179 sim->SDigitiseModule(mod,module,evNumber);
1180 // fills all branches - wasted disk space
1181 gAlice->TreeS()->Fill();
1187 gAlice->TreeS()->GetEntries();
1190 sprintf(hname,"TreeS%d",evNumber);
1191 gAlice->TreeS()->Write(hname,TObject::kOverwrite);
1193 gAlice->TreeS()->Reset();
1195 //______________________________________________________________________
1196 void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
1197 Option_t *option, Option_t *opt,Text_t *filename){
1198 // Keep galice.root for signal and name differently the file for
1199 // background when add! otherwise the track info for signal will be lost !
1200 // the condition below will disappear when the geom class will be
1201 // initialized for all versions - for the moment it is only for v5 !
1202 // 7 is the SDD beam test version.
1204 // Int_t evnt Event to be processed.
1205 // Int_t bgrev Background Hit tree number.
1206 // Int_t nmodules Not used.
1207 // Option_t *option String indicating if merging hits or not. To
1208 // merge hits set equal to "Add". Otherwise no
1209 // background hits are considered.
1210 // Test_t *filename File name containing the background hits..
1216 if(!GetITSgeom()) return; // need transformations to do digitization.
1217 AliITSgeom *geom = GetITSgeom();
1219 const char *all = strstr(opt,"All");
1220 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1222 static Bool_t setDef=kTRUE;
1223 if (setDef) SetDefaultSimulation();
1227 InitModules(size,nmodules);
1228 FillModules(evNumber,bgrev,nmodules,option,filename);
1230 AliITSsimulation *sim = 0;
1231 AliITSDetType *iDetType = 0;
1232 AliITSmodule *mod = 0;
1234 for(module=0;module<geom->GetIndexMax();module++){
1235 id = geom->GetModuleType(module);
1236 if (!all && !det[id]) continue;
1237 iDetType = DetType(id);
1238 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1240 Error("HitsToDigits",
1241 "The simulation class was not instanciated!");
1244 mod = (AliITSmodule *)fITSmodules->At(module);
1245 sim->DigitiseModule(mod,module,evNumber);
1246 // fills all branches - wasted disk space
1247 gAlice->TreeD()->Fill();
1253 gAlice->TreeD()->GetEntries();
1256 sprintf(hname,"TreeD%d",evNumber);
1257 gAlice->TreeD()->Write(hname,TObject::kOverwrite);
1259 gAlice->TreeD()->Reset();
1261 //______________________________________________________________________
1262 void AliITS::ResetSDigits(){
1263 // Reset the Summable Digits array.
1269 if (fSDigits) fSDigits->Clear();
1272 //______________________________________________________________________
1273 void AliITS::ResetDigits(){
1274 // Reset number of digits and the digits array for the ITS detector.
1280 if (!fDtype) return;
1283 for (i=0;i<kNTYPES;i++ ) {
1284 if (fDtype->At(i)) ((TClonesArray*)fDtype->At(i))->Clear();
1285 if (fNdtype) fNdtype[i]=0;
1288 //______________________________________________________________________
1289 void AliITS::ResetDigits(Int_t i){
1290 // Reset number of digits and the digits array for this branch.
1296 if (fDtype->At(i)) ((TClonesArray*)fDtype->At(i))->Clear();
1297 if (fNdtype) fNdtype[i]=0;
1299 //______________________________________________________________________
1300 void AliITS::AddSumDigit(AliITSpListItem &sdig){
1301 // Adds the a module full of summable digits to the summable digits tree.
1303 // AliITSpListItem &sdig SDigit to be added to SDigits tree.
1309 TClonesArray &lsdig = *fSDigits;
1310 new(lsdig[fNSDigits++]) AliITSpListItem(sdig);
1312 //______________________________________________________________________
1313 void AliITS::AddRealDigit(Int_t id, Int_t *digits){
1314 // Add a real digit - as coming from data.
1316 // Int_t id Detector type number.
1317 // Int_t *digits Integer array containing the digits info. See
1324 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1325 new(ldigits[fNdtype[id]++]) AliITSdigit(digits);
1327 //______________________________________________________________________
1328 void AliITS::AddSimDigit(Int_t id, AliITSdigit *d){
1329 // Add a simulated digit.
1331 // Int_t id Detector type number.
1332 // AliITSdigit *d Digit to be added to the Digits Tree. See
1339 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1343 new(ldigits[fNdtype[id]++]) AliITSdigitSPD(*((AliITSdigitSPD*)d));
1346 new(ldigits[fNdtype[id]++]) AliITSdigitSDD(*((AliITSdigitSDD*)d));
1349 new(ldigits[fNdtype[id]++]) AliITSdigitSSD(*((AliITSdigitSSD*)d));
1353 //______________________________________________________________________
1354 void AliITS::AddSimDigit(Int_t id,Float_t phys,Int_t *digits,Int_t *tracks,
1355 Int_t *hits,Float_t *charges){
1356 // Add a simulated digit to the list.
1358 // Int_t id Detector type number.
1359 // Float_t phys Physics indicator. See AliITSdigits.h
1360 // Int_t *digits Integer array containing the digits info. See
1362 // Int_t *tracks Integer array [3] containing the track numbers that
1363 // contributed to this digit.
1364 // Int_t *hits Integer array [3] containing the hit numbers that
1365 // contributed to this digit.
1366 // Float_t *charge Floating point array of the signals contributed
1367 // to this digit by each track.
1373 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1376 new(ldigits[fNdtype[id]++]) AliITSdigitSPD(digits,tracks,hits);
1379 new(ldigits[fNdtype[id]++]) AliITSdigitSDD(phys,digits,tracks,
1383 new(ldigits[fNdtype[id]++]) AliITSdigitSSD(digits,tracks,hits);
1387 //______________________________________________________________________
1388 void AliITS::MakeTreeC(Option_t *option){
1389 // Create a separate tree to store the clusters.
1391 // Option_t *option string which must contain "C" otherwise
1392 // no Cluster Tree is created.
1398 const char *optC = strstr(option,"C");
1399 if (optC && !fTreeC) fTreeC = new TTree("TC","Clusters in ITS");
1402 Int_t buffersize = 4000;
1403 char branchname[30];
1404 const char *det[3] = {"SPD","SDD","SSD"};
1408 // one branch for Clusters per type of detector
1410 for (i=0; i<kNTYPES ;i++) {
1411 AliITSDetType *iDetType=DetType(i);
1412 iDetType->GetClassNames(digclass,clclass);
1414 fCtype->AddAt(new TClonesArray(clclass,1000),i);
1415 if (kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
1416 else sprintf(branchname,"%sClusters%d",GetName(),i+1);
1417 if (fCtype && fTreeC) {
1418 TreeC()->Branch(branchname,&((*fCtype)[i]), buffersize);
1419 } // end if fCtype && fTreeC
1422 //______________________________________________________________________
1423 void AliITS::GetTreeC(Int_t event){
1424 // Get the clusters tree for this event and set the branch address.
1426 // Int_t event Event number for the cluster tree.
1432 char branchname[30];
1433 const char *det[3] = {"SPD","SDD","SSD"};
1440 sprintf(treeName,"TreeC%d",event);
1441 fTreeC = (TTree*)gDirectory->Get(treeName);
1449 for (i=0; i<kNTYPES; i++) {
1450 AliITSDetType *iDetType=DetType(i);
1451 iDetType->GetClassNames(digclass,clclass);
1453 if(!fCtype->At(i)) fCtype->AddAt(new TClonesArray(clclass,1000),i);
1454 if(kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
1455 else sprintf(branchname,"%sClusters%d",GetName(),i+1);
1457 branch = fTreeC->GetBranch(branchname);
1458 if (branch) branch->SetAddress(&((*fCtype)[i]));
1462 Error("GetTreeC","cannot find Clusters Tree for event:%d",event);
1465 //______________________________________________________________________
1466 void AliITS::AddCluster(Int_t id, AliITSRawCluster *c){
1467 // Add a cluster to the list.
1469 // Int_t id Detector type number.
1470 // AliITSRawCluster *c Cluster class to be added to the tree of
1477 TClonesArray &lc = *((TClonesArray*)fCtype->At(id));
1481 new(lc[fNctype[id]++]) AliITSRawClusterSPD(*((AliITSRawClusterSPD*)c));
1484 new(lc[fNctype[id]++]) AliITSRawClusterSDD(*((AliITSRawClusterSDD*)c));
1487 new(lc[fNctype[id]++]) AliITSRawClusterSSD(*((AliITSRawClusterSSD*)c));
1491 //______________________________________________________________________
1492 void AliITS::ResetClusters(){
1493 // Reset number of clusters and the clusters array for ITS.
1500 for (i=0;i<kNTYPES;i++ ) ResetClusters(i);
1502 //______________________________________________________________________
1503 void AliITS::ResetClusters(Int_t i){
1504 // Reset number of clusters and the clusters array for this branch.
1506 // Int_t i Detector type number.
1512 if (fCtype->At(i)) ((TClonesArray*)fCtype->At(i))->Clear();
1513 if (fNctype) fNctype[i]=0;
1515 //______________________________________________________________________
1516 void AliITS::MakeBranchR(const char *file){
1517 // Creates Tree branches for the ITS Reconstructed points.
1519 // cont char *file File name where RecPoints branch is to be written
1520 // to. If blank it write the SDigits to the same
1521 // file in which the Hits were found.
1526 Int_t buffsz = 4000;
1527 char branchname[30];
1529 // only one branch for rec points for all detector types
1530 sprintf(branchname,"%sRecPoints",GetName());
1531 if (fRecPoints && gAlice->TreeR()) {
1532 MakeBranchInTree(gAlice->TreeR(),branchname,&fRecPoints,buffsz,file);
1535 //______________________________________________________________________
1536 void AliITS::SetTreeAddressR(TTree *treeR){
1537 // Set branch address for the Reconstructed points Trees.
1539 // TTree *treeR Tree containing the RecPoints.
1544 char branchname[30];
1548 sprintf(branchname,"%sRecPoints",GetName());
1549 branch = treeR->GetBranch(branchname);
1550 if (branch) branch->SetAddress(&fRecPoints);
1552 //______________________________________________________________________
1553 void AliITS::AddRecPoint(const AliITSRecPoint &r){
1554 // Add a reconstructed space point to the list
1556 // const AliITSRecPoint &r RecPoint class to be added to the tree
1557 // of reconstructed points TreeR.
1563 TClonesArray &lrecp = *fRecPoints;
1564 new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
1566 //______________________________________________________________________
1567 void AliITS::HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
1568 Option_t *opt0,Option_t *opt1,Text_t *flnm){
1569 // keep galice.root for signal and name differently the file for
1570 // background when add! otherwise the track info for signal will be lost !
1571 // the condition below will disappear when the geom class will be
1572 // initialized for all versions - for the moment it is only for v5 !
1574 // Int_t evnt Event to be processed.
1575 // Int_t bgrev Background Hit tree number.
1576 // Int_t size Size used by InitModules. See InitModules.
1577 // Option_t *opt0 Option passed to FillModules. See FillModules.
1578 // Option_t *opt1 String indicating if merging hits or not. To
1579 // merge hits set equal to "Add". Otherwise no
1580 // background hits are considered.
1581 // Test_t *flnm File name containing the background hits..
1587 if(!GetITSgeom()) return;
1588 AliITSgeom *geom = GetITSgeom();
1590 const char *all = strstr(opt1,"All");
1591 const char *det[3] ={strstr(opt1,"SPD"),strstr(opt1,"SDD"),
1592 strstr(opt1,"SSD")};
1594 InitModules(size,nmodules);
1595 FillModules(evNumber,bgrev,nmodules,opt0,flnm);
1597 AliITSsimulation *sim = 0;
1598 AliITSDetType *iDetType = 0;
1599 AliITSmodule *mod = 0;
1602 //m.b. : this change is nothing but a nice way to make sure
1604 for(module=0;module<geom->GetIndexMax();module++){
1605 id = geom->GetModuleType(module);
1606 if (!all && !det[id]) continue;
1607 iDetType = DetType(id);
1608 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1610 Error("HitsToFastPoints",
1611 "The simulation class was not instanciated!");
1614 mod = (AliITSmodule *)fITSmodules->At(module);
1615 sim->CreateFastRecPoints(mod,module,gRandom);
1616 gAlice->TreeR()->Fill();
1623 sprintf(hname,"TreeR%d",evNumber);
1624 gAlice->TreeR()->Write(hname,TObject::kOverwrite);
1626 gAlice->TreeR()->Reset();
1628 //______________________________________________________________________
1629 void AliITS::Digits2Reco(){
1630 // Find clusters and reconstruct space points.
1636 AliHeader *header=gAlice->GetHeader();
1637 // to Digits to RecPoints for event in file, all digits in file, and
1638 // all ITS detectors.
1639 DigitsToRecPoints(header->GetEvent(),0,fOpt);
1641 //______________________________________________________________________
1642 void AliITS::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt){
1643 // cluster finding and reconstruction of space points
1644 // the condition below will disappear when the geom class will be
1645 // initialized for all versions - for the moment it is only for v5 !
1646 // 7 is the SDD beam test version
1648 // Int_t evNumber Event number to be processed.
1649 // Int_t lastentry Offset for module when not all of the modules
1651 // Option_t *opt String indicating which ITS sub-detectors should
1652 // be processed. If ="All" then all of the ITS
1653 // sub detectors are processed.
1659 if(!GetITSgeom()) return;
1660 AliITSgeom *geom = GetITSgeom();
1662 const char *all = strstr(opt,"All");
1663 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1665 static Bool_t setRec=kTRUE;
1666 if (setRec) SetDefaultClusterFinders();
1669 TTree *treeC=TreeC();
1671 AliITSClusterFinder *rec = 0;
1672 AliITSDetType *iDetType = 0;
1673 Int_t id,module,first=0;
1674 for(module=0;module<geom->GetIndexMax();module++){
1675 id = geom->GetModuleType(module);
1676 if (!all && !det[id]) continue;
1677 if(det[id]) first = geom->GetStartDet(id);
1678 iDetType = DetType(id);
1679 rec = (AliITSClusterFinder*)iDetType->GetReconstructionModel();
1680 TClonesArray *itsDigits = this->DigitsAddress(id);
1682 Error("DigitsToRecPoints",
1683 "The reconstruction class was not instanciated!");
1686 this->ResetDigits();
1687 if (all) gAlice->TreeD()->GetEvent(lastentry+module);
1688 else gAlice->TreeD()->GetEvent(lastentry+(module-first));
1689 Int_t ndigits = itsDigits->GetEntriesFast();
1690 if (ndigits) rec->FindRawClusters(module);
1691 gAlice->TreeR()->Fill();
1697 gAlice->TreeR()->GetEntries();
1698 treeC->GetEntries();
1701 sprintf(hname,"TreeR%d",evNumber);
1702 gAlice->TreeR()->Write(hname,TObject::kOverwrite);
1704 gAlice->TreeR()->Reset();
1706 sprintf(hname,"TreeC%d",evNumber);
1707 treeC->Write(hname,TObject::kOverwrite);
1710 //______________________________________________________________________
1711 void AliITS::ResetRecPoints(){
1712 // Reset number of rec points and the rec points array.
1718 if (fRecPoints) fRecPoints->Clear();