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 **************************************************************************/
19 ///////////////////////////////////////////////////////////////////////////////
21 // An overview of the basic philosophy of the ITS code development
22 // and analysis is show in the figure below.
25 <img src="picts/ITS/ITS_Analysis_schema.gif">
28 <font size=+2 color=red>
29 <p>Roberto Barbera is in charge of the ITS Offline code (1999).
30 <a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
36 // AliITS. Inner Traking System base class.
37 // This class contains the base procedures for the Inner Tracking System
41 <img src="picts/ITS/AliITS_Class_Diagram.gif">
44 <font size=+2 color=red>
45 <p>This show the class diagram of the different elements that are part of
53 // Written by Rene Brun, Federico Carminati, and Roberto Barbera
56 // Modified and documented by Bjorn S. Nilsen
60 // Modified and documented by A. Bologna
63 // AliITS is the general base class for the ITS. Also see AliDetector for
64 // futher information.
66 ///////////////////////////////////////////////////////////////////////////////
68 #include <Riostream.h>
72 #include <TClonesArray.h>
75 #include <TObjectTable.h>
81 #include <TVirtualMC.h>
83 #include "AliConfig.h"
84 #include "AliHeader.h"
86 #include "AliITSClusterFinderSDD.h"
87 #include "AliITSClusterFinderSPD.h"
88 #include "AliITSClusterFinderSSD.h"
89 #include "AliITSDetType.h"
90 #include "AliITSLoader.h"
91 #include "AliITSRawCluster.h"
92 #include "AliITSRecPoint.h"
93 #include "AliITSdigit.h"
94 #include "AliITSgeom.h"
95 #include "AliITShit.h"
96 #include "AliITSmodule.h"
97 #include "AliITSpList.h"
98 #include "AliITSresponseSDD.h"
99 #include "AliITSresponseSPD.h"
100 #include "AliITSresponseSSD.h"
101 #include "AliITSsegmentationSDD.h"
102 #include "AliITSsegmentationSPD.h"
103 #include "AliITSsegmentationSSD.h"
104 #include "AliITSsimulationSDD.h"
105 #include "AliITSsimulationSPD.h"
106 #include "AliITSsimulationSSD.h"
110 //______________________________________________________________________
111 AliITS::AliITS() : AliDetector() {
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 // fITSpoints, fIdSens, and fIdName. The AliDetector default constructor
125 fIshunt = 0; // not zeroed in AliDetector.
132 // SetDetectors(); // default to fOpt="All". This variable not written out.
138 fNDetTypes = kNTYPES;
153 SetMarkerColor(kRed);
155 //______________________________________________________________________
156 AliITS::AliITS(const char *name, const char *title):AliDetector(name,title){
157 // The standard Constructor for the ITS class. In addition to
158 // creating the AliITS class, it allocates memory for the TClonesArrays
159 // fHits, fSDigits, fDigits, fITSpoints, and the TObjArray of fCtype
160 // (clusters). It also zeros the variables
161 // fIshunt (a member of AliDetector class), fEuclidOut, and fIdN, and zeros
162 // the pointers fIdSens and fIdName. To help in displaying hits via the
163 // ROOT macro display.C AliITS also sets the marker color to red. The
164 // variables passes with this constructor, const char *name and *title,
165 // are used by the constructor of AliDetector class. See AliDetector
166 // class for a description of these parameters and its constructor
169 // const char *name Detector name. Should always be "ITS"
170 // const char *title Detector title.
176 fIshunt = 0; // not zeroed in AliDetector
177 fHits = new TClonesArray("AliITShit", 1560);//not done in AliDetector
178 gAlice->AddHitList(fHits); // Not done in AliDetector.
183 SetDetectors(); // default to fOpt="All". This variable not written out.
189 fNDetTypes = kNTYPES;
190 fDetTypes = new TObjArray(fNDetTypes);
192 fSDigits = new TClonesArray("AliITSpListItem",1000);
195 fNdtype = new Int_t[fNDetTypes];
196 fDtype = new TObjArray(fNDetTypes);
198 fCtype = new TObjArray(fNDetTypes);
199 fNctype = new Int_t[fNDetTypes];
201 fRecPoints = new TClonesArray("AliITSRecPoint",1000);
205 for(i=0;i<fNDetTypes;i++) {
206 fDetTypes->AddAt(new AliITSDetType(),i);
211 SetMarkerColor(kRed);
214 //______________________________________________________________________
216 // Default destructor for ITS.
217 // The default destructor of the AliITS class. In addition to deleting
218 // the AliITS class it deletes the memory pointed to by the fHits, fDigits,
219 // fSDigits, fCtype, fITSmodules, fITSgeom, fRecPoints, fIdSens, fIdName,
220 // fITSpoints, fDetType and it's contents.
244 fRecPoints->Delete();
248 delete[] fIdName; // Array of TStrings
251 this->ClearModules();
254 }// end if fITSmodules!=0
272 } // end if fDetTypes
275 if (fITSgeom) delete fITSgeom;
277 //______________________________________________________________________
278 AliITS::AliITS(const AliITS &source) : AliDetector(source){
279 // Copy constructor. This is a function which is not allowed to be
280 // done to the ITS. It exits with an error.
282 // AliITS &source An AliITS class.
288 if(this==&source) return;
289 Error("Copy constructor",
290 "You are not allowed to make a copy of the AliITS");
293 //______________________________________________________________________
294 AliITS& AliITS::operator=(AliITS &source){
295 // Assignment operator. This is a function which is not allowed to be
296 // done to the ITS. It exits with an error.
298 // AliITS &source An AliITS class.
304 if(this==&source) return *this;
305 Error("operator=","You are not allowed to make a copy of the AliITS");
307 return *this; //fake return
309 //______________________________________________________________________
310 Int_t AliITS::DistancetoPrimitive(Int_t,Int_t) const{
311 // Distance from mouse to ITS on the screen. Dummy routine
312 // A dummy routine used by the ROOT macro display.C to allow for the
313 // use of the mouse (pointing device) in the macro. In general this should
314 // never be called. If it is it returns the number 9999 for any value of
317 // Int_t Dummy screen coordinate.
318 // Int_t Dummy screen coordinate.
322 // Int_t Dummy = 9999 distance to ITS.
326 //______________________________________________________________________
328 // Initializer ITS after it has been built
329 // This routine initializes the AliITS class. It is intended to be
330 // called from the Init function in AliITSv?. Besides displaying a banner
331 // indicating that it has been called it initializes the array fIdSens
332 // and sets the default segmentation, response, digit and raw cluster
333 // classes therefore it should be called after a call to CreateGeometry.
344 for(i=0;i<fIdN;i++) fIdSens[i] = gMC->VolId(fIdName[i]);
346 //______________________________________________________________________
347 void AliITS::SetDefaults(){
348 // sets the default segmentation, response, digit and raw cluster classes.
356 if(fDebug) printf("%s: SetDefaults\n",ClassName());
358 AliITSDetType *iDetType;
362 if (!iDetType->GetSegmentationModel()) {
363 AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(fITSgeom);
364 SetSegmentationModel(0,seg0);
366 if (!iDetType->GetResponseModel()) {
367 SetResponseModel(0,new AliITSresponseSPD());
369 // set digit and raw cluster classes to be used
371 const char *kData0=(iDetType->GetResponseModel())->DataType();
372 if (strstr(kData0,"real")) {
373 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSPD");
374 } else iDetType->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD");
378 if (!iDetType->GetResponseModel()) {
379 SetResponseModel(1,new AliITSresponseSDD("simulated"));
381 AliITSresponse *resp1=iDetType->GetResponseModel();
382 if (!iDetType->GetSegmentationModel()) {
383 AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(fITSgeom,resp1);
384 SetSegmentationModel(1,seg1);
386 const char *kData1=(iDetType->GetResponseModel())->DataType();
387 const char *kopt=iDetType->GetResponseModel()->ZeroSuppOption();
388 if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D")) || strstr(kData1,"real") ){
389 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD");
390 } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
394 if (!iDetType->GetSegmentationModel()) {
395 AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(fITSgeom);
396 SetSegmentationModel(2,seg2);
398 if (!iDetType->GetResponseModel()) {
399 SetResponseModel(2,new AliITSresponseSSD("simulated"));
401 const char *kData2=(iDetType->GetResponseModel())->DataType();
402 if (strstr(kData2,"real")) {
403 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSSD");
404 } else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
407 Warning("SetDefaults",
408 "Only the three basic detector types are initialized!");
411 //______________________________________________________________________
412 void AliITS::SetDefaultSimulation(){
413 // sets the default simulation.
421 AliITSDetType *iDetType;
422 AliITSsimulation *sim;
424 sim = iDetType->GetSimulationModel();
426 AliITSsegmentation *seg0=
427 (AliITSsegmentation*)iDetType->GetSegmentationModel();
428 AliITSresponse *res0 = (AliITSresponse*)iDetType->GetResponseModel();
429 AliITSsimulationSPD *sim0=new AliITSsimulationSPD(seg0,res0);
430 SetSimulationModel(0,sim0);
431 }else{ // simulation exists, make sure it is set up properly.
432 ((AliITSsimulationSPD*)sim)->Init(
433 (AliITSsegmentationSPD*) iDetType->GetSegmentationModel(),
434 (AliITSresponseSPD*) iDetType->GetResponseModel());
435 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
436 // (AliITSresponse*)iDetType->GetResponseModel());
437 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
438 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
441 sim = iDetType->GetSimulationModel();
443 AliITSsegmentation *seg1=
444 (AliITSsegmentation*)iDetType->GetSegmentationModel();
445 AliITSresponse *res1 = (AliITSresponse*)iDetType->GetResponseModel();
446 AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1);
447 SetSimulationModel(1,sim1);
448 }else{ // simulation exists, make sure it is set up properly.
449 ((AliITSsimulationSDD*)sim)->Init(
450 (AliITSsegmentationSDD*) iDetType->GetSegmentationModel(),
451 (AliITSresponseSDD*) iDetType->GetResponseModel());
452 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
453 // (AliITSresponse*)iDetType->GetResponseModel());
454 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
455 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
458 sim = iDetType->GetSimulationModel();
460 AliITSsegmentation *seg2=
461 (AliITSsegmentation*)iDetType->GetSegmentationModel();
462 AliITSresponse *res2 = (AliITSresponse*)iDetType->GetResponseModel();
463 AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2);
464 SetSimulationModel(2,sim2);
465 }else{ // simulation exists, make sure it is set up properly.
466 ((AliITSsimulationSSD*)sim)->Init(
467 (AliITSsegmentationSSD*) iDetType->GetSegmentationModel(),
468 (AliITSresponseSSD*) iDetType->GetResponseModel());
469 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
470 // (AliITSresponse*)iDetType->GetResponseModel());
471 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
472 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
475 //______________________________________________________________________
476 void AliITS::SetDefaultClusterFinders(){
477 // Sets the default cluster finders. Used in finding RecPoints.
486 AliITSDetType *iDetType;
490 if (!iDetType->GetReconstructionModel()) {
491 AliITSsegmentation *seg0 =
492 (AliITSsegmentation*)iDetType->GetSegmentationModel();
493 TClonesArray *dig0=DigitsAddress(0);
494 TClonesArray *recp0=ClustersAddress(0);
495 AliITSClusterFinderSPD *rec0 = new AliITSClusterFinderSPD(seg0,dig0,
497 SetReconstructionModel(0,rec0);
502 if (!iDetType->GetReconstructionModel()) {
503 AliITSsegmentation *seg1 =
504 (AliITSsegmentation*)iDetType->GetSegmentationModel();
505 AliITSresponse *res1 = (AliITSresponse*)iDetType->GetResponseModel();
506 TClonesArray *dig1=DigitsAddress(1);
507 TClonesArray *recp1=ClustersAddress(1);
508 AliITSClusterFinderSDD *rec1 =
509 new AliITSClusterFinderSDD(seg1,res1,dig1,recp1);
510 SetReconstructionModel(1,rec1);
515 if (!iDetType->GetReconstructionModel()) {
516 AliITSsegmentation *seg2=
517 (AliITSsegmentation*)iDetType->GetSegmentationModel();
518 TClonesArray *dig2=DigitsAddress(2);
519 AliITSClusterFinderSSD *rec2= new AliITSClusterFinderSSD(seg2,dig2);
520 SetReconstructionModel(2,rec2);
523 //______________________________________________________________________
524 void AliITS::MakeBranch(Option_t* option){
525 // Creates Tree branches for the ITS.
527 // Option_t *option String of Tree types S,D, and/or R.
528 // const char *file String of the file name where these branches
529 // are to be stored. If blank then these branches
530 // are written to the same tree as the Hits were
536 Bool_t cH = (strstr(option,"H")!=0);
537 Bool_t cS = (strstr(option,"S")!=0);
538 Bool_t cD = (strstr(option,"D")!=0);
539 Bool_t cR = (strstr(option,"R")!=0);
540 Bool_t cRF = (strstr(option,"RF")!=0);
543 if(cH && (fHits == 0x0)) fHits = new TClonesArray("AliITShit", 1560);
545 AliDetector::MakeBranch(option);
547 if(cS) MakeBranchS(0);
548 if(cD) MakeBranchD(0);
549 if(cR) MakeBranchR(0);
550 if(cRF) MakeBranchRF(0);
552 //______________________________________________________________________
553 void AliITS::SetTreeAddress(){
554 // Set branch address for the Trees.
561 TTree *treeS = fLoader->TreeS();
562 TTree *treeD = fLoader->TreeD();
563 TTree *treeR = fLoader->TreeR();
564 if (fLoader->TreeH() && (fHits == 0x0)) fHits = new TClonesArray("AliITShit", 1560);
566 AliDetector::SetTreeAddress();
568 SetTreeAddressS(treeS);
569 SetTreeAddressD(treeD);
570 SetTreeAddressR(treeR);
572 //______________________________________________________________________
573 AliITSDetType* AliITS::DetType(Int_t id){
574 // Return pointer to id detector type.
576 // Int_t id detector id number.
580 // returned, a pointer to a AliITSDetType.
582 return ((AliITSDetType*) fDetTypes->At(id));
584 //______________________________________________________________________
585 void AliITS::SetResponseModel(Int_t id, AliITSresponse *response){
586 // Set the response model for the id detector type.
588 // Int_t id detector id number.
589 // AliITSresponse* a pointer containing an instance of AliITSresponse
590 // to be stored/owned b y AliITSDetType.
596 ((AliITSDetType*) fDetTypes->At(id))->ResponseModel(response);
598 //______________________________________________________________________
599 void AliITS::SetSegmentationModel(Int_t id, AliITSsegmentation *seg){
600 // Set the segmentation model for the id detector type.
602 // Int_t id detector id number.
603 // AliITSsegmentation* a pointer containing an instance of
604 // AliITSsegmentation to be stored/owned b y
611 ((AliITSDetType*) fDetTypes->At(id))->SegmentationModel(seg);
613 //______________________________________________________________________
614 void AliITS::SetSimulationModel(Int_t id, AliITSsimulation *sim){
615 // Set the simulation model for the id detector type.
617 // Int_t id detector id number.
618 // AliITSresponse* a pointer containing an instance of AliITSresponse
619 // to be stored/owned b y AliITSDetType.
625 ((AliITSDetType*) fDetTypes->At(id))->SimulationModel(sim);
628 //______________________________________________________________________
629 void AliITS::SetReconstructionModel(Int_t id, AliITSClusterFinder *reconst){
630 // Set the cluster finder model for the id detector type.
632 // Int_t id detector id number.
633 // AliITSClusterFinder* a pointer containing an instance of
634 // AliITSClusterFinder to be stored/owned b y
641 ((AliITSDetType*) fDetTypes->At(id))->ReconstructionModel(reconst);
643 //______________________________________________________________________
644 void AliITS::SetClasses(Int_t id, const char *digit, const char *cluster){
645 // Set the digit and cluster classes name to be used for the id detector
648 // Int_t id detector id number.
649 // const char *digit Digit class name for detector id.
650 // const char *cluster Cluster class name for detector id.
656 ((AliITSDetType*) fDetTypes->At(id))->ClassNames(digit,cluster);
658 //______________________________________________________________________
659 void AliITS::AddHit(Int_t track, Int_t *vol, Float_t *hits){
661 // The function to add information to the AliITShit class. See the
662 // AliITShit class for a full description. This function allocates the
663 // necessary new space for the hit information and passes the variable
664 // track, and the pointers *vol and *hits to the AliITShit constructor
667 // Int_t track Track number which produced this hit.
668 // Int_t *vol Array of Integer Hit information. See AliITShit.h
669 // Float_t *hits Array of Floating Hit information. see AliITShit.h
675 TClonesArray &lhits = *fHits;
676 new(lhits[fNhits++]) AliITShit(fIshunt,track,vol,hits);
678 //______________________________________________________________________
679 void AliITS::InitModules(Int_t size,Int_t &nmodules){
680 // Initialize the modules array.
682 // Int_t size Size of array of the number of modules to be
683 // created. If size <=0 then the number of modules
684 // is gotten from AliITSgeom class kept in fITSgeom.
686 // Int_t &nmodules The number of modules existing.
691 fITSmodules->Delete();
693 } // end fir fITSmoudles
695 Int_t nl,indexMAX,index;
697 if(size<=0){ // default to using data stored in AliITSgeom
699 Error("InitModules","fITSgeom not defined");
701 } // end if fITSgeom==0
702 nl = fITSgeom->GetNlayers();
703 indexMAX = fITSgeom->GetModuleIndex(nl,fITSgeom->GetNladders(nl),
704 fITSgeom->GetNdetectors(nl))+1;
706 fITSmodules = new TObjArray(indexMAX);
707 for(index=0;index<indexMAX;index++){
708 fITSmodules->AddAt( new AliITSmodule(index),index);
711 fITSmodules = new TObjArray(size);
712 for(index=0;index<size;index++) {
713 fITSmodules->AddAt( new AliITSmodule(index),index);
719 //______________________________________________________________________
720 void AliITS::FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
721 Option_t *option,Text_t *filename){
722 // fill the modules with the sorted by module hits; add hits from
723 // background if option=Add.
725 // Int_t evnt Event to be processed.
726 // Int_t bgrev Background Hit tree number.
727 // Int_t nmodules Not used.
728 // Option_t *option String indicating if merging hits or not. To
729 // merge hits set equal to "Add". Otherwise no
730 // background hits are considered.
731 // Test_t *filename File name containing the background hits..
736 static TTree *trH1; //Tree with background hits
737 static Bool_t first=kTRUE;
739 const char *addBgr = strstr(option,"Add");
741 evnt = nmodules; // Dummy use of variables to remove warnings
744 file=new TFile(filename);
749 // Get Hits Tree header from file
750 if(trH1) delete trH1;
754 sprintf(treeName,"TreeH%d",bgrev);
755 trH1 = (TTree*)gDirectory->Get(treeName);
757 Error("FillModules","cannot find Hits Tree for event:%d",bgrev);
759 // Set branch addresses
762 FillModules(fLoader->TreeH(),0); // fill from this file's tree.
765 FillModules(trH1,10000000); // Default mask 10M.
766 TTree *fAli=fLoader->GetRunLoader()->TreeK();
768 if (fAli) fileAli =fAli->GetCurrentFile();
772 //______________________________________________________________________
773 void AliITS::FillModules(TTree *treeH, Int_t mask) {
774 // fill the modules with the sorted by module hits;
775 // can be called many times to do a merging
777 // TTree *treeH The tree containing the hits to be copied into
779 // Int_t mask The track number mask to indecate which file
780 // this hits came from.
788 Error("FillModules","Tree is NULL");
790 Int_t lay,lad,det,index;
794 sprintf(branchname,"%s",GetName());
795 TBranch *branch = treeH->GetBranch(branchname);
797 Error("FillModules","%s branch in TreeH not found",branchname);
800 branch->SetAddress(&fHits);
801 Int_t nTracks =(Int_t) treeH->GetEntries();
803 for(iPrimTrack=0; iPrimTrack<nTracks; iPrimTrack++){
805 Int_t nBytes = treeH->GetEvent(iPrimTrack);
806 if (nBytes <= 0) continue;
807 Int_t nHits = fHits->GetEntriesFast();
808 for(h=0; h<nHits; h++){
809 itsHit = (AliITShit *)fHits->UncheckedAt(h);
810 itsHit->GetDetectorID(lay,lad,det);
812 index = fITSgeom->GetModuleIndex(lay,lad,det);
814 index=det-1; // This should not be used.
815 } // end if [You must have fITSgeom for this to work!]
816 mod = GetModule(index);
817 itsHit->SetTrack(itsHit->GetTrack()+mask); // Set track mask.
818 mod->AddHit(itsHit,iPrimTrack,h);
819 } // end loop over hits
820 } // end loop over tracks
822 //______________________________________________________________________
823 void AliITS::ClearModules(){
824 // Clear the modules TObjArray.
830 if(fITSmodules) fITSmodules->Delete();
832 //______________________________________________________________________
833 void AliITS::MakeBranchS(const char *fl){
834 // Creates Tree Branch for the ITS summable digits.
836 // cont char *fl File name where SDigits branch is to be written
837 // to. If blank it write the SDigits to the same
838 // file in which the Hits were found.
843 Int_t buffersize = 4000;
846 // only one branch for SDigits.
847 sprintf(branchname,"%s",GetName());
850 if(fLoader->TreeS()){
851 if (fSDigits == 0x0) fSDigits = new TClonesArray("AliITSpListItem",1000);
852 MakeBranchInTree(fLoader->TreeS(),branchname,&fSDigits,buffersize,fl);
855 //______________________________________________________________________
856 void AliITS::SetTreeAddressS(TTree *treeS){
857 // Set branch address for the ITS summable digits Trees.
859 // TTree *treeS Tree containing the SDigits.
867 if (fSDigits == 0x0) fSDigits = new TClonesArray("AliITSpListItem",1000);
869 sprintf(branchname,"%s",GetName());
870 branch = treeS->GetBranch(branchname);
871 if (branch) branch->SetAddress(&fSDigits);
873 //______________________________________________________________________
874 void AliITS::MakeBranchInTreeD(TTree *treeD,const char *file){
875 // Creates Tree branches for the ITS.
877 // TTree *treeD Pointer to the Digits Tree.
878 // cont char *file File name where Digits branch is to be written
879 // to. If blank it write the SDigits to the same
880 // file in which the Hits were found.
885 Int_t buffersize = 4000;
888 sprintf(branchname,"%s",GetName());
889 // one branch for digits per type of detector
890 const char *det[3] = {"SPD","SDD","SSD"};
894 for (i=0; i<kNTYPES ;i++) {
895 DetType(i)->GetClassNames(digclass,clclass);
897 if (fDtype == 0x0) fDtype = new TObjArray(fNDetTypes);
898 if(!(fDtype->At(i))) fDtype->AddAt(new TClonesArray(digclass,1000),i);
901 for (i=0; i<kNTYPES ;i++) {
902 if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
903 else sprintf(branchname,"%sDigits%d",GetName(),i+1);
904 if (fDtype && treeD) {
905 MakeBranchInTree(treeD, branchname, &((*fDtype)[i]),buffersize,file);
909 //______________________________________________________________________
910 void AliITS::SetTreeAddressD(TTree *treeD){
911 // Set branch address for the Trees.
913 // TTree *treeD Tree containing the Digits.
919 const char *det[3] = {"SPD","SDD","SSD"};
926 for (i=0; i<kNTYPES; i++) {
927 DetType(i)->GetClassNames(digclass,clclass);
929 if (fDtype == 0x0) fDtype = new TObjArray(fNDetTypes);
930 if(!(fDtype->At(i))) fDtype->AddAt(new TClonesArray(digclass,1000),i);
932 if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
933 else sprintf(branchname,"%sDigits%d",GetName(),i+1);
935 branch = treeD->GetBranch(branchname);
936 if (branch) branch->SetAddress(&((*fDtype)[i]));
940 //______________________________________________________________________
941 void AliITS::Hits2SDigits(){
942 // Standard Hits to summable Digits function.
948 // return; // Using Hits in place of the larger sDigits.
949 AliRunLoader* rl = fLoader->GetRunLoader();
950 AliHeader *header=rl->GetHeader(); // Get event number from this file.
954 header=rl->GetHeader();
955 if (header == 0x0) return;
957 // Do the Hits to Digits operation. Use Standard input values.
958 // Event number from file, no background hit merging , use size from
959 // AliITSgeom class, option="All", input from this file only.
960 HitsToSDigits(header->GetEvent(),0,-1," ",fOpt," ");
963 //______________________________________________________________________
964 void AliITS::Hits2PreDigits(){
965 // Standard Hits to summable Digits function.
971 AliHeader *header=fLoader->GetRunLoader()->GetHeader(); // Get event number from this file.
972 // Do the Hits to Digits operation. Use Standard input values.
973 // Event number from file, no background hit merging , use size from
974 // AliITSgeom class, option="All", input from this file only.
975 HitsToPreDigits(header->GetEvent(),0,-1," ",fOpt," ");
977 //______________________________________________________________________
978 void AliITS::SDigitsToDigits(Option_t *opt){
979 // Standard Summable digits to Digits function.
984 char name[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
986 if(!GetITSgeom()) return; // need transformations to do digitization.
987 AliITSgeom *geom = GetITSgeom();
989 const char *all = strstr(opt,"All");
990 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
992 if( !det[0] && !det[1] && !det[2] ) all = "All";
994 static Bool_t setDef=kTRUE;
995 if (setDef) SetDefaultSimulation();
998 AliITSsimulation *sim = 0;
999 AliITSDetType *iDetType = 0;
1000 TTree *trees = fLoader->TreeS();
1001 if( !(trees && this->GetSDigits()) ){
1002 Error("SDigits2Digits","Error: No trees or SDigits. Returning.");
1005 sprintf( name, "%s", this->GetName() );
1006 TBranch *brchSDigits = trees->GetBranch( name );
1009 for(module=0;module<geom->GetIndexMax();module++){
1010 id = geom->GetModuleType(module);
1011 if (!all && !det[id]) continue;
1012 iDetType = DetType(id);
1013 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1015 Error("SDigit2Digits",
1016 "The simulation class was not instanciated!");
1019 sim->InitSimulationModule(module,gAlice->GetEvNumber());
1021 // add summable digits to module
1022 this->GetSDigits()->Clear();
1023 brchSDigits->GetEvent(module);
1024 sim->AddSDigitsToModule(GetSDigits(),0);
1026 // Digitise current module sum(SDigits)->Digits
1027 sim->FinishSDigitiseModule();
1029 // fills all branches - wasted disk space
1030 fLoader->TreeD()->Fill();
1031 this->ResetDigits();
1034 fLoader->TreeD()->GetEntries();
1036 fLoader->TreeD()->AutoSave();
1038 fLoader->TreeD()->Reset();
1041 //______________________________________________________________________
1042 void AliITS::Hits2Digits(){
1043 // Standard Hits to Digits function.
1049 AliHeader *header=fLoader->GetRunLoader()->GetHeader(); // Get event number from this file.
1050 // Do the Hits to Digits operation. Use Standard input values.
1051 // Event number from file, no background hit merging , use size from
1052 // AliITSgeom class, option="All", input from this file only.
1053 HitsToDigits(header->GetEvent(),0,-1," ",fOpt," ");
1055 //______________________________________________________________________
1056 void AliITS::HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size,
1057 Option_t *option, Option_t *opt,Text_t *filename){
1058 // keep galice.root for signal and name differently the file for
1059 // background when add! otherwise the track info for signal will be lost !
1060 // the condition below will disappear when the geom class will be
1061 // initialized for all versions - for the moment it is only for v5 !
1062 // 7 is the SDD beam test version. Dummy routine. Hits are ITS's Summable
1065 // Int_t evnt Event to be processed.
1066 // Int_t bgrev Background Hit tree number.
1067 // Int_t nmodules Not used.
1068 // Option_t *option String indicating if merging hits or not. To
1069 // merge hits set equal to "Add". Otherwise no
1070 // background hits are considered.
1071 // Test_t *filename File name containing the background hits..
1076 // return; // using Hits instead of the larger sdigits.
1078 HitsToPreDigits(evNumber,bgrev,size,option,opt,filename);
1080 //______________________________________________________________________
1081 void AliITS::HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
1082 Option_t *option, Option_t *opt,Text_t *filename){
1083 // Keep galice.root for signal and name differently the file for
1084 // background when add! otherwise the track info for signal will be lost !
1085 // the condition below will disappear when the geom class will be
1086 // initialized for all versions - for the moment it is only for v5 !
1087 // 7 is the SDD beam test version.
1089 // Int_t evnt Event to be processed.
1090 // Int_t bgrev Background Hit tree number.
1091 // Int_t nmodules Not used.
1092 // Option_t *option String indicating if merging hits or not. To
1093 // merge hits set equal to "Add". Otherwise no
1094 // background hits are considered.
1095 // Test_t *filename File name containing the background hits..
1101 if(!GetITSgeom()) return; // need transformations to do digitization.
1102 AliITSgeom *geom = GetITSgeom();
1104 const char *all = strstr(opt,"All");
1105 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1107 static Bool_t setDef=kTRUE;
1108 if (setDef) SetDefaultSimulation();
1112 InitModules(size,nmodules);
1113 FillModules(evNumber,bgrev,nmodules,option,filename);
1115 AliITSsimulation *sim = 0;
1116 AliITSDetType *iDetType = 0;
1117 AliITSmodule *mod = 0;
1119 for(module=0;module<geom->GetIndexMax();module++){
1120 id = geom->GetModuleType(module);
1121 if (!all && !det[id]) continue;
1122 iDetType = DetType(id);
1123 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1125 Error("HitsToSDigits",
1126 "The simulation class was not instanciated!");
1129 mod = (AliITSmodule *)fITSmodules->At(module);
1130 sim->SDigitiseModule(mod,module,evNumber);
1131 // fills all branches - wasted disk space
1132 fLoader->TreeS()->Fill();
1138 fLoader->TreeS()->GetEntries();
1139 fLoader->TreeS()->AutoSave();
1140 fLoader->WriteSDigits("OVERWRITE");
1142 fLoader->TreeS()->Reset();
1144 //______________________________________________________________________
1145 void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
1146 Option_t *option, Option_t *opt,Text_t *filename){
1147 // Keep galice.root for signal and name differently the file for
1148 // background when add! otherwise the track info for signal will be lost !
1149 // the condition below will disappear when the geom class will be
1150 // initialized for all versions - for the moment it is only for v5 !
1151 // 7 is the SDD beam test version.
1153 // Int_t evnt Event to be processed.
1154 // Int_t bgrev Background Hit tree number.
1155 // Int_t nmodules Not used.
1156 // Option_t *option String indicating if merging hits or not. To
1157 // merge hits set equal to "Add". Otherwise no
1158 // background hits are considered.
1159 // Test_t *filename File name containing the background hits..
1165 if(!GetITSgeom()) return; // need transformations to do digitization.
1166 AliITSgeom *geom = GetITSgeom();
1168 const char *all = strstr(opt,"All");
1169 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1171 static Bool_t setDef=kTRUE;
1172 if (setDef) SetDefaultSimulation();
1176 InitModules(size,nmodules);
1177 FillModules(evNumber,bgrev,nmodules,option,filename);
1179 AliITSsimulation *sim = 0;
1180 AliITSDetType *iDetType = 0;
1181 AliITSmodule *mod = 0;
1183 for(module=0;module<geom->GetIndexMax();module++){
1184 id = geom->GetModuleType(module);
1185 if (!all && !det[id]) continue;
1186 iDetType = DetType(id);
1187 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1189 Error("HitsToDigits",
1190 "The simulation class was not instanciated!");
1193 mod = (AliITSmodule *)fITSmodules->At(module);
1194 sim->DigitiseModule(mod,module,evNumber);
1195 // fills all branches - wasted disk space
1196 fLoader->TreeD()->Fill();
1202 fLoader->TreeD()->GetEntries();
1203 fLoader->TreeD()->AutoSave();
1205 fLoader->TreeD()->Reset();
1207 //______________________________________________________________________
1208 void AliITS::ResetSDigits(){
1209 // Reset the Summable Digits array.
1215 if (fSDigits) fSDigits->Clear();
1218 //______________________________________________________________________
1219 void AliITS::ResetDigits(){
1220 // Reset number of digits and the digits array for the ITS detector.
1226 if (!fDtype) return;
1229 for (i=0;i<kNTYPES;i++ ) {
1230 if (fDtype->At(i)) ((TClonesArray*)fDtype->At(i))->Clear();
1231 if (fNdtype) fNdtype[i]=0;
1234 //______________________________________________________________________
1235 void AliITS::ResetDigits(Int_t i){
1236 // Reset number of digits and the digits array for this branch.
1242 if (fDtype->At(i)) ((TClonesArray*)fDtype->At(i))->Clear();
1243 if (fNdtype) fNdtype[i]=0;
1245 //______________________________________________________________________
1246 void AliITS::AddSumDigit(AliITSpListItem &sdig){
1247 // Adds the a module full of summable digits to the summable digits tree.
1249 // AliITSpListItem &sdig SDigit to be added to SDigits tree.
1255 TClonesArray &lsdig = *fSDigits;
1256 new(lsdig[fNSDigits++]) AliITSpListItem(sdig);
1258 //______________________________________________________________________
1259 void AliITS::AddRealDigit(Int_t id, Int_t *digits){
1260 // Add a real digit - as coming from data.
1262 // Int_t id Detector type number.
1263 // Int_t *digits Integer array containing the digits info. See
1270 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1271 new(ldigits[fNdtype[id]++]) AliITSdigit(digits);
1273 //______________________________________________________________________
1274 void AliITS::AddSimDigit(Int_t id, AliITSdigit *d){
1275 // Add a simulated digit.
1277 // Int_t id Detector type number.
1278 // AliITSdigit *d Digit to be added to the Digits Tree. See
1285 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1289 new(ldigits[fNdtype[id]++]) AliITSdigitSPD(*((AliITSdigitSPD*)d));
1292 new(ldigits[fNdtype[id]++]) AliITSdigitSDD(*((AliITSdigitSDD*)d));
1295 new(ldigits[fNdtype[id]++]) AliITSdigitSSD(*((AliITSdigitSSD*)d));
1299 //______________________________________________________________________
1300 void AliITS::AddSimDigit(Int_t id,Float_t phys,Int_t *digits,Int_t *tracks,
1301 Int_t *hits,Float_t *charges){
1302 // Add a simulated digit to the list.
1304 // Int_t id Detector type number.
1305 // Float_t phys Physics indicator. See AliITSdigits.h
1306 // Int_t *digits Integer array containing the digits info. See
1308 // Int_t *tracks Integer array [AliITSdigitS?D::GetNTracks()]
1309 // containing the track numbers that contributed to
1311 // Int_t *hits Integer array [AliITSdigitS?D::GetNTracks()]
1312 // containing the hit numbers, from AliITSmodule, that
1313 // contributed to this digit.
1314 // Float_t *charge Floating point array of the signals contributed
1315 // to this digit by each track.
1321 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1324 new(ldigits[fNdtype[id]++]) AliITSdigitSPD(digits,tracks,hits);
1327 new(ldigits[fNdtype[id]++]) AliITSdigitSDD(phys,digits,tracks,
1331 new(ldigits[fNdtype[id]++]) AliITSdigitSSD(digits,tracks,hits);
1335 //______________________________________________________________________
1336 void AliITS::MakeTreeC(Option_t *option){
1337 // Create a separate tree to store the clusters.
1339 // Option_t *option string which must contain "C" otherwise
1340 // no Cluster Tree is created.
1346 AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
1348 if (pITSLoader == 0x0) {
1349 Error("MakeTreeC","fLoader == 0x0 option=%s",option);
1352 if (pITSLoader->TreeC() == 0x0) pITSLoader->MakeTree("C");
1356 void AliITS::MakeBranchC()
1358 //Makes barnches in treeC
1359 AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
1360 if (pITSLoader == 0x0)
1362 Error("MakeTreeC","fLoader == 0x0");
1365 TTree * lTC = pITSLoader->TreeC();
1368 Error("MakeTreeC","Can not get TreeC from Loader");
1372 Int_t buffersize = 4000;
1373 char branchname[30];
1374 const char *det[3] = {"SPD","SDD","SSD"};
1378 // one branch for Clusters per type of detector
1380 for (i=0; i<kNTYPES ;i++)
1382 AliITSDetType *iDetType=DetType(i);
1383 iDetType->GetClassNames(digclass,clclass);
1385 if (fCtype == 0x0) fCtype = new TObjArray(fNDetTypes);
1386 if(!ClustersAddress(i))
1388 fCtype->AddAt(new TClonesArray(clclass,1000),i);
1390 if (kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
1391 else sprintf(branchname,"%sClusters%d",GetName(),i+1);
1394 if (lTC->GetBranch(branchname))
1396 Warning("MakeBranchC","Branch %s alread exists in TreeC",branchname);
1400 Info("MakeBranchC","Creating branch %s in TreeC",branchname);
1401 lTC->Branch(branchname,&((*fCtype)[i]), buffersize);
1403 } // end if fCtype && lTC
1407 //______________________________________________________________________
1408 void AliITS::GetTreeC(Int_t event){
1409 // Get the clusters tree for this event and set the branch address.
1411 // Int_t event Event number for the cluster tree.
1416 char branchname[30];
1417 const char *det[3] = {"SPD","SDD","SSD"};
1419 AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
1420 TTree * lTC = pITSLoader->TreeC();
1424 pITSLoader->CleanRawClusters();
1434 for (i=0; i<kNTYPES; i++) {
1435 AliITSDetType *iDetType=DetType(i);
1436 iDetType->GetClassNames(digclass,clclass);
1438 if (fCtype == 0x0) fCtype = new TObjArray(fNDetTypes);
1439 if(!fCtype->At(i)) fCtype->AddAt(new TClonesArray(clclass,1000),i);
1440 if(kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
1441 else sprintf(branchname,"%sClusters%d",GetName(),i+1);
1443 branch = lTC->GetBranch(branchname);
1444 if (branch) branch->SetAddress(&((*fCtype)[i]));
1448 Error("GetTreeC","cannot find Clusters Tree for event:%d",event);
1451 //______________________________________________________________________
1452 void AliITS::AddCluster(Int_t id, AliITSRawCluster *c){
1453 // Add a cluster to the list.
1455 // Int_t id Detector type number.
1456 // AliITSRawCluster *c Cluster class to be added to the tree of
1463 TClonesArray &lc = *((TClonesArray*)fCtype->At(id));
1467 new(lc[fNctype[id]++]) AliITSRawClusterSPD(*((AliITSRawClusterSPD*)c));
1470 new(lc[fNctype[id]++]) AliITSRawClusterSDD(*((AliITSRawClusterSDD*)c));
1473 new(lc[fNctype[id]++]) AliITSRawClusterSSD(*((AliITSRawClusterSSD*)c));
1477 //______________________________________________________________________
1478 void AliITS::ResetClusters(){
1479 // Reset number of clusters and the clusters array for ITS.
1486 for (i=0;i<kNTYPES;i++ ) ResetClusters(i);
1488 //______________________________________________________________________
1489 void AliITS::ResetClusters(Int_t i){
1490 // Reset number of clusters and the clusters array for this branch.
1492 // Int_t i Detector type number.
1498 if (fCtype->At(i)) ((TClonesArray*)fCtype->At(i))->Clear();
1499 if (fNctype) fNctype[i]=0;
1501 //______________________________________________________________________
1502 void AliITS::MakeBranchR(const char *file, Option_t *opt){
1503 // Creates Tree branches for the ITS Reconstructed points.
1505 // cont char *file File name where RecPoints branch is to be written
1506 // to. If blank it write the SDigits to the same
1507 // file in which the Hits were found.
1512 Int_t buffsz = 4000;
1513 char branchname[30];
1515 // only one branch for rec points for all detector types
1516 Bool_t oFast= (strstr(opt,"Fast")!=0);
1518 sprintf(branchname,"%sRecPointsF",GetName());
1520 sprintf(branchname,"%sRecPoints",GetName());
1524 if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
1525 if (fLoader->TreeR()) {
1526 if (fRecPoints == 0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
1527 MakeBranchInTree(fLoader->TreeR(),branchname,&fRecPoints,buffsz,file);
1530 //______________________________________________________________________
1531 void AliITS::SetTreeAddressR(TTree *treeR){
1532 // Set branch address for the Reconstructed points Trees.
1534 // TTree *treeR Tree containing the RecPoints.
1539 char branchname[30];
1542 if (fRecPoints == 0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
1544 sprintf(branchname,"%sRecPoints",GetName());
1545 branch = treeR->GetBranch(branchname);
1547 branch->SetAddress(&fRecPoints);
1550 sprintf(branchname,"%sRecPointsF",GetName());
1551 branch = treeR->GetBranch(branchname);
1553 branch->SetAddress(&fRecPoints);
1557 //______________________________________________________________________
1558 void AliITS::AddRecPoint(const AliITSRecPoint &r){
1559 // Add a reconstructed space point to the list
1561 // const AliITSRecPoint &r RecPoint class to be added to the tree
1562 // of reconstructed points TreeR.
1568 TClonesArray &lrecp = *fRecPoints;
1569 new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
1571 //______________________________________________________________________
1572 void AliITS::HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
1573 Option_t *opt0,Option_t *opt1,Text_t *flnm){
1574 // keep galice.root for signal and name differently the file for
1575 // background when add! otherwise the track info for signal will be lost !
1576 // the condition below will disappear when the geom class will be
1577 // initialized for all versions - for the moment it is only for v5 !
1579 // Int_t evnt Event to be processed.
1580 // Int_t bgrev Background Hit tree number.
1581 // Int_t size Size used by InitModules. See InitModules.
1582 // Option_t *opt0 Option passed to FillModules. See FillModules.
1583 // Option_t *opt1 String indicating if merging hits or not. To
1584 // merge hits set equal to "Add". Otherwise no
1585 // background hits are considered.
1586 // Test_t *flnm File name containing the background hits..
1592 if(!GetITSgeom()) return;
1593 AliITSLoader *pITSloader = (AliITSLoader*)fLoader;
1594 AliITSgeom *geom = GetITSgeom();
1596 const char *all = strstr(opt1,"All");
1597 const char *det[3] ={strstr(opt1,"SPD"),strstr(opt1,"SDD"),
1598 strstr(opt1,"SSD")};
1600 InitModules(size,nmodules);
1601 FillModules(evNumber,bgrev,nmodules,opt0,flnm);
1603 AliITSsimulation *sim = 0;
1604 AliITSDetType *iDetType = 0;
1605 AliITSmodule *mod = 0;
1608 //m.b. : this change is nothing but a nice way to make sure
1611 cout<<"HitsToFastRecPoints: N mod = "<<geom->GetIndexMax()<<endl;
1613 for(module=0;module<geom->GetIndexMax();module++)
1615 id = geom->GetModuleType(module);
1616 if (!all && !det[id]) continue;
1617 iDetType = DetType(id);
1618 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1621 Error("HitsToFastPoints","The simulation class was not instanciated!");
1624 mod = (AliITSmodule *)fITSmodules->At(module);
1625 sim->CreateFastRecPoints(mod,module,gRandom);
1626 cout<<module<<"\r";fflush(0);
1627 //gAlice->TreeR()->Fill();
1628 TTree *lTR = pITSloader->TreeR();
1629 TBranch *br=lTR->GetBranch("ITSRecPointsF");
1636 fLoader->WriteRecPoints("OVERWRITE");
1638 //______________________________________________________________________
1639 void AliITS::Digits2Reco(){
1640 // Find clusters and reconstruct space points.
1646 AliHeader *header=fLoader->GetRunLoader()->GetHeader();
1647 // to Digits to RecPoints for event in file, all digits in file, and
1648 // all ITS detectors.
1649 DigitsToRecPoints(header->GetEvent(),0,fOpt);
1651 //______________________________________________________________________
1652 void AliITS::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt){
1653 // cluster finding and reconstruction of space points
1654 // the condition below will disappear when the geom class will be
1655 // initialized for all versions - for the moment it is only for v5 !
1656 // 7 is the SDD beam test version
1658 // Int_t evNumber Event number to be processed.
1659 // Int_t lastentry Offset for module when not all of the modules
1661 // Option_t *opt String indicating which ITS sub-detectors should
1662 // be processed. If ="All" then all of the ITS
1663 // sub detectors are processed.
1669 if(!GetITSgeom()) return;
1670 AliITSgeom *geom = GetITSgeom();
1672 const char *all = strstr(opt,"All");
1673 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1675 static Bool_t setRec=kTRUE;
1676 if (setRec) SetDefaultClusterFinders();
1679 AliITSLoader *pITSloader = (AliITSLoader*)fLoader;
1680 TTree *treeC=pITSloader->TreeC();
1681 AliITSClusterFinder *rec = 0;
1682 AliITSDetType *iDetType = 0;
1683 Int_t id,module,first=0;
1684 for(module=0;module<geom->GetIndexMax();module++){
1685 id = geom->GetModuleType(module);
1686 if (!all && !det[id]) continue;
1687 if(det[id]) first = geom->GetStartDet(id);
1688 iDetType = DetType(id);
1689 rec = (AliITSClusterFinder*)iDetType->GetReconstructionModel();
1690 TClonesArray *itsDigits = this->DigitsAddress(id);
1692 Error("DigitsToRecPoints",
1693 "The reconstruction class was not instanciated! event=%d",
1697 this->ResetDigits();
1698 TTree *lTD = pITSloader->TreeD();
1700 lTD->GetEvent(lastentry+module);
1702 lTD->GetEvent(lastentry+(module-first));
1704 Int_t ndigits = itsDigits->GetEntriesFast();
1705 if (ndigits) rec->FindRawClusters(module);
1706 pITSloader->TreeR()->Fill();
1713 pITSloader->WriteRecPoints("OVERWRITE");
1714 pITSloader->WriteRawClusters("OVERWRITE");
1716 //______________________________________________________________________
1717 void AliITS::ResetRecPoints(){
1718 // Reset number of rec points and the rec points array.
1724 if (fRecPoints) fRecPoints->Clear();
1727 //______________________________________________________________________
1728 AliLoader* AliITS::MakeLoader(const char* topfoldername)
1730 //builds ITSgetter (AliLoader type)
1731 //if detector wants to use castomized getter, it must overload this method
1733 Info("MakeLoader","Creating AliITSLoader. Top folder is %s.",topfoldername);
1734 fLoader = new AliITSLoader(GetName(),topfoldername);