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"
111 //______________________________________________________________________
112 AliITS::AliITS() : AliDetector() {
113 // Default initializer for ITS
114 // The default constructor of the AliITS class. In addition to
115 // creating the AliITS class it zeros the variables fIshunt (a member
116 // of AliDetector class), fEuclidOut, and fIdN, and zeros the pointers
117 // fITSpoints, fIdSens, and fIdName. The AliDetector default constructor
126 fIshunt = 0; // not zeroed in AliDetector.
133 // SetDetectors(); // default to fOpt="All". This variable not written out.
139 fNDetTypes = kNTYPES;
154 SetMarkerColor(kRed);
156 //______________________________________________________________________
157 AliITS::AliITS(const char *name, const char *title):AliDetector(name,title){
158 // The standard Constructor for the ITS class. In addition to
159 // creating the AliITS class, it allocates memory for the TClonesArrays
160 // fHits, fSDigits, fDigits, fITSpoints, and the TObjArray of fCtype
161 // (clusters). It also zeros the variables
162 // fIshunt (a member of AliDetector class), fEuclidOut, and fIdN, and zeros
163 // the pointers fIdSens and fIdName. To help in displaying hits via the
164 // ROOT macro display.C AliITS also sets the marker color to red. The
165 // variables passes with this constructor, const char *name and *title,
166 // are used by the constructor of AliDetector class. See AliDetector
167 // class for a description of these parameters and its constructor
170 // const char *name Detector name. Should always be "ITS"
171 // const char *title Detector title.
177 fIshunt = 0; // not zeroed in AliDetector
178 fHits = new TClonesArray("AliITShit", 1560);//not done in AliDetector
179 gAlice->GetMCApp()->AddHitList(fHits); // Not done in AliDetector.
184 SetDetectors(); // default to fOpt="All". This variable not written out.
190 fNDetTypes = kNTYPES;
191 fDetTypes = new TObjArray(fNDetTypes);
193 fSDigits = new TClonesArray("AliITSpListItem",1000);
196 fNdtype = new Int_t[fNDetTypes];
197 fDtype = new TObjArray(fNDetTypes);
199 fCtype = new TObjArray(fNDetTypes);
200 fNctype = new Int_t[fNDetTypes];
202 fRecPoints = new TClonesArray("AliITSRecPoint",1000);
206 for(i=0;i<fNDetTypes;i++) {
207 fDetTypes->AddAt(new AliITSDetType(),i);
212 SetMarkerColor(kRed);
215 //______________________________________________________________________
217 // Default destructor for ITS.
218 // The default destructor of the AliITS class. In addition to deleting
219 // the AliITS class it deletes the memory pointed to by the fHits, fDigits,
220 // fSDigits, fCtype, fITSmodules, fITSgeom, fRecPoints, fIdSens, fIdName,
221 // fITSpoints, fDetType and it's contents.
245 fRecPoints->Delete();
249 delete[] fIdName; // Array of TStrings
252 this->ClearModules();
255 }// end if fITSmodules!=0
273 } // end if fDetTypes
276 if (fITSgeom) delete fITSgeom;
278 //______________________________________________________________________
279 AliITS::AliITS(const AliITS &source) : AliDetector(source){
280 // Copy constructor. This is a function which is not allowed to be
281 // done to the ITS. It exits with an error.
283 // AliITS &source An AliITS class.
289 if(this==&source) return;
290 Error("Copy constructor",
291 "You are not allowed to make a copy of the AliITS");
294 //______________________________________________________________________
295 AliITS& AliITS::operator=(AliITS &source){
296 // Assignment operator. This is a function which is not allowed to be
297 // done to the ITS. It exits with an error.
299 // AliITS &source An AliITS class.
305 if(this==&source) return *this;
306 Error("operator=","You are not allowed to make a copy of the AliITS");
308 return *this; //fake return
310 //______________________________________________________________________
311 Int_t AliITS::DistancetoPrimitive(Int_t,Int_t) const{
312 // Distance from mouse to ITS on the screen. Dummy routine
313 // A dummy routine used by the ROOT macro display.C to allow for the
314 // use of the mouse (pointing device) in the macro. In general this should
315 // never be called. If it is it returns the number 9999 for any value of
318 // Int_t Dummy screen coordinate.
319 // Int_t Dummy screen coordinate.
323 // Int_t Dummy = 9999 distance to ITS.
327 //______________________________________________________________________
329 // Initializer ITS after it has been built
330 // This routine initializes the AliITS class. It is intended to be
331 // called from the Init function in AliITSv?. Besides displaying a banner
332 // indicating that it has been called it initializes the array fIdSens
333 // and sets the default segmentation, response, digit and raw cluster
334 // classes therefore it should be called after a call to CreateGeometry.
345 for(i=0;i<fIdN;i++) fIdSens[i] = gMC->VolId(fIdName[i]);
347 //______________________________________________________________________
348 void AliITS::SetDefaults(){
349 // sets the default segmentation, response, digit and raw cluster classes.
357 if(fDebug) printf("%s: SetDefaults\n",ClassName());
359 AliITSDetType *iDetType;
363 if (!iDetType->GetSegmentationModel()) {
364 AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(fITSgeom);
365 SetSegmentationModel(0,seg0);
367 if (!iDetType->GetResponseModel()) {
368 SetResponseModel(0,new AliITSresponseSPD());
370 // set digit and raw cluster classes to be used
372 const char *kData0=(iDetType->GetResponseModel())->DataType();
373 if (strstr(kData0,"real")) {
374 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSPD");
375 } else iDetType->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD");
379 if (!iDetType->GetResponseModel()) {
380 SetResponseModel(1,new AliITSresponseSDD("simulated"));
382 AliITSresponse *resp1=iDetType->GetResponseModel();
383 if (!iDetType->GetSegmentationModel()) {
384 AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(fITSgeom,resp1);
385 SetSegmentationModel(1,seg1);
387 const char *kData1=(iDetType->GetResponseModel())->DataType();
388 const char *kopt=iDetType->GetResponseModel()->ZeroSuppOption();
389 if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D")) || strstr(kData1,"real") ){
390 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD");
391 } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
395 if (!iDetType->GetSegmentationModel()) {
396 AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(fITSgeom);
397 SetSegmentationModel(2,seg2);
399 if (!iDetType->GetResponseModel()) {
400 SetResponseModel(2,new AliITSresponseSSD("simulated"));
402 const char *kData2=(iDetType->GetResponseModel())->DataType();
403 if (strstr(kData2,"real")) {
404 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSSD");
405 } else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
408 Warning("SetDefaults",
409 "Only the three basic detector types are initialized!");
412 //______________________________________________________________________
413 void AliITS::SetDefaultSimulation(){
414 // sets the default simulation.
422 AliITSDetType *iDetType;
423 AliITSsimulation *sim;
425 sim = iDetType->GetSimulationModel();
427 AliITSsegmentation *seg0=
428 (AliITSsegmentation*)iDetType->GetSegmentationModel();
429 AliITSresponse *res0 = (AliITSresponse*)iDetType->GetResponseModel();
430 AliITSsimulationSPD *sim0=new AliITSsimulationSPD(seg0,res0);
431 SetSimulationModel(0,sim0);
432 }else{ // simulation exists, make sure it is set up properly.
433 ((AliITSsimulationSPD*)sim)->Init(
434 (AliITSsegmentationSPD*) iDetType->GetSegmentationModel(),
435 (AliITSresponseSPD*) iDetType->GetResponseModel());
436 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
437 // (AliITSresponse*)iDetType->GetResponseModel());
438 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
439 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
442 sim = iDetType->GetSimulationModel();
444 AliITSsegmentation *seg1=
445 (AliITSsegmentation*)iDetType->GetSegmentationModel();
446 AliITSresponse *res1 = (AliITSresponse*)iDetType->GetResponseModel();
447 AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1);
448 SetSimulationModel(1,sim1);
449 }else{ // simulation exists, make sure it is set up properly.
450 ((AliITSsimulationSDD*)sim)->Init(
451 (AliITSsegmentationSDD*) iDetType->GetSegmentationModel(),
452 (AliITSresponseSDD*) iDetType->GetResponseModel());
453 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
454 // (AliITSresponse*)iDetType->GetResponseModel());
455 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
456 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
459 sim = iDetType->GetSimulationModel();
461 AliITSsegmentation *seg2=
462 (AliITSsegmentation*)iDetType->GetSegmentationModel();
463 AliITSresponse *res2 = (AliITSresponse*)iDetType->GetResponseModel();
464 AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2);
465 SetSimulationModel(2,sim2);
466 }else{ // simulation exists, make sure it is set up properly.
467 ((AliITSsimulationSSD*)sim)->Init(
468 (AliITSsegmentationSSD*) iDetType->GetSegmentationModel(),
469 (AliITSresponseSSD*) iDetType->GetResponseModel());
470 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
471 // (AliITSresponse*)iDetType->GetResponseModel());
472 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
473 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
476 //______________________________________________________________________
477 void AliITS::SetDefaultClusterFinders(){
478 // Sets the default cluster finders. Used in finding RecPoints.
487 AliITSDetType *iDetType;
491 if (!iDetType->GetReconstructionModel()) {
492 AliITSsegmentation *seg0 =
493 (AliITSsegmentation*)iDetType->GetSegmentationModel();
494 TClonesArray *dig0=DigitsAddress(0);
495 TClonesArray *recp0=ClustersAddress(0);
496 AliITSClusterFinderSPD *rec0 = new AliITSClusterFinderSPD(seg0,dig0,
498 SetReconstructionModel(0,rec0);
503 if (!iDetType->GetReconstructionModel()) {
504 AliITSsegmentation *seg1 =
505 (AliITSsegmentation*)iDetType->GetSegmentationModel();
506 AliITSresponse *res1 = (AliITSresponse*)iDetType->GetResponseModel();
507 TClonesArray *dig1=DigitsAddress(1);
508 TClonesArray *recp1=ClustersAddress(1);
509 AliITSClusterFinderSDD *rec1 =
510 new AliITSClusterFinderSDD(seg1,res1,dig1,recp1);
511 SetReconstructionModel(1,rec1);
516 if (!iDetType->GetReconstructionModel()) {
517 AliITSsegmentation *seg2=
518 (AliITSsegmentation*)iDetType->GetSegmentationModel();
519 TClonesArray *dig2=DigitsAddress(2);
520 AliITSClusterFinderSSD *rec2= new AliITSClusterFinderSSD(seg2,dig2);
521 SetReconstructionModel(2,rec2);
524 //______________________________________________________________________
525 void AliITS::MakeBranch(Option_t* option){
526 // Creates Tree branches for the ITS.
528 // Option_t *option String of Tree types S,D, and/or R.
529 // const char *file String of the file name where these branches
530 // are to be stored. If blank then these branches
531 // are written to the same tree as the Hits were
537 Bool_t cH = (strstr(option,"H")!=0);
538 Bool_t cS = (strstr(option,"S")!=0);
539 Bool_t cD = (strstr(option,"D")!=0);
540 Bool_t cR = (strstr(option,"R")!=0);
541 Bool_t cRF = (strstr(option,"RF")!=0);
544 if(cH && (fHits == 0x0)) fHits = new TClonesArray("AliITShit", 1560);
546 AliDetector::MakeBranch(option);
548 if(cS) MakeBranchS(0);
549 if(cD) MakeBranchD(0);
550 if(cR) MakeBranchR(0);
551 if(cRF) MakeBranchRF(0);
553 //______________________________________________________________________
554 void AliITS::SetTreeAddress(){
555 // Set branch address for the Trees.
562 TTree *treeS = fLoader->TreeS();
563 TTree *treeD = fLoader->TreeD();
564 TTree *treeR = fLoader->TreeR();
565 if (fLoader->TreeH() && (fHits == 0x0)) fHits = new TClonesArray("AliITShit", 1560);
567 AliDetector::SetTreeAddress();
569 SetTreeAddressS(treeS);
570 SetTreeAddressD(treeD);
571 SetTreeAddressR(treeR);
573 //______________________________________________________________________
574 AliITSDetType* AliITS::DetType(Int_t id){
575 // Return pointer to id detector type.
577 // Int_t id detector id number.
581 // returned, a pointer to a AliITSDetType.
583 return ((AliITSDetType*) fDetTypes->At(id));
585 //______________________________________________________________________
586 void AliITS::SetResponseModel(Int_t id, AliITSresponse *response){
587 // Set the response model for the id detector type.
589 // Int_t id detector id number.
590 // AliITSresponse* a pointer containing an instance of AliITSresponse
591 // to be stored/owned b y AliITSDetType.
597 ((AliITSDetType*) fDetTypes->At(id))->ResponseModel(response);
599 //______________________________________________________________________
600 void AliITS::SetSegmentationModel(Int_t id, AliITSsegmentation *seg){
601 // Set the segmentation model for the id detector type.
603 // Int_t id detector id number.
604 // AliITSsegmentation* a pointer containing an instance of
605 // AliITSsegmentation to be stored/owned b y
612 ((AliITSDetType*) fDetTypes->At(id))->SegmentationModel(seg);
614 //______________________________________________________________________
615 void AliITS::SetSimulationModel(Int_t id, AliITSsimulation *sim){
616 // Set the simulation model for the id detector type.
618 // Int_t id detector id number.
619 // AliITSresponse* a pointer containing an instance of AliITSresponse
620 // to be stored/owned b y AliITSDetType.
626 ((AliITSDetType*) fDetTypes->At(id))->SimulationModel(sim);
629 //______________________________________________________________________
630 void AliITS::SetReconstructionModel(Int_t id, AliITSClusterFinder *reconst){
631 // Set the cluster finder model for the id detector type.
633 // Int_t id detector id number.
634 // AliITSClusterFinder* a pointer containing an instance of
635 // AliITSClusterFinder to be stored/owned b y
642 ((AliITSDetType*) fDetTypes->At(id))->ReconstructionModel(reconst);
644 //______________________________________________________________________
645 void AliITS::SetClasses(Int_t id, const char *digit, const char *cluster){
646 // Set the digit and cluster classes name to be used for the id detector
649 // Int_t id detector id number.
650 // const char *digit Digit class name for detector id.
651 // const char *cluster Cluster class name for detector id.
657 ((AliITSDetType*) fDetTypes->At(id))->ClassNames(digit,cluster);
659 //______________________________________________________________________
660 void AliITS::AddHit(Int_t track, Int_t *vol, Float_t *hits){
662 // The function to add information to the AliITShit class. See the
663 // AliITShit class for a full description. This function allocates the
664 // necessary new space for the hit information and passes the variable
665 // track, and the pointers *vol and *hits to the AliITShit constructor
668 // Int_t track Track number which produced this hit.
669 // Int_t *vol Array of Integer Hit information. See AliITShit.h
670 // Float_t *hits Array of Floating Hit information. see AliITShit.h
676 TClonesArray &lhits = *fHits;
677 new(lhits[fNhits++]) AliITShit(fIshunt,track,vol,hits);
679 //______________________________________________________________________
680 void AliITS::InitModules(Int_t size,Int_t &nmodules){
681 // Initialize the modules array.
683 // Int_t size Size of array of the number of modules to be
684 // created. If size <=0 then the number of modules
685 // is gotten from AliITSgeom class kept in fITSgeom.
687 // Int_t &nmodules The number of modules existing.
692 fITSmodules->Delete();
694 } // end fir fITSmoudles
696 Int_t nl,indexMAX,index;
698 if(size<=0){ // default to using data stored in AliITSgeom
700 Error("InitModules","fITSgeom not defined");
702 } // end if fITSgeom==0
703 nl = fITSgeom->GetNlayers();
704 indexMAX = fITSgeom->GetModuleIndex(nl,fITSgeom->GetNladders(nl),
705 fITSgeom->GetNdetectors(nl))+1;
707 fITSmodules = new TObjArray(indexMAX);
708 for(index=0;index<indexMAX;index++){
709 fITSmodules->AddAt( new AliITSmodule(index),index);
712 fITSmodules = new TObjArray(size);
713 for(index=0;index<size;index++) {
714 fITSmodules->AddAt( new AliITSmodule(index),index);
720 //______________________________________________________________________
721 void AliITS::FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
722 Option_t *option,Text_t *filename){
723 // fill the modules with the sorted by module hits; add hits from
724 // background if option=Add.
726 // Int_t evnt Event to be processed.
727 // Int_t bgrev Background Hit tree number.
728 // Int_t nmodules Not used.
729 // Option_t *option String indicating if merging hits or not. To
730 // merge hits set equal to "Add". Otherwise no
731 // background hits are considered.
732 // Test_t *filename File name containing the background hits..
737 static TTree *trH1; //Tree with background hits
738 static Bool_t first=kTRUE;
740 const char *addBgr = strstr(option,"Add");
742 evnt = nmodules; // Dummy use of variables to remove warnings
745 file=new TFile(filename);
750 // Get Hits Tree header from file
751 if(trH1) delete trH1;
755 sprintf(treeName,"TreeH%d",bgrev);
756 trH1 = (TTree*)gDirectory->Get(treeName);
758 Error("FillModules","cannot find Hits Tree for event:%d",bgrev);
760 // Set branch addresses
763 FillModules(fLoader->TreeH(),0); // fill from this file's tree.
766 FillModules(trH1,10000000); // Default mask 10M.
767 TTree *fAli=fLoader->GetRunLoader()->TreeK();
769 if (fAli) fileAli =fAli->GetCurrentFile();
773 //______________________________________________________________________
774 void AliITS::FillModules(TTree *treeH, Int_t mask) {
775 // fill the modules with the sorted by module hits;
776 // can be called many times to do a merging
778 // TTree *treeH The tree containing the hits to be copied into
780 // Int_t mask The track number mask to indecate which file
781 // this hits came from.
789 Error("FillModules","Tree is NULL");
791 Int_t lay,lad,det,index;
795 sprintf(branchname,"%s",GetName());
796 TBranch *branch = treeH->GetBranch(branchname);
798 Error("FillModules","%s branch in TreeH not found",branchname);
801 branch->SetAddress(&fHits);
802 Int_t nTracks =(Int_t) treeH->GetEntries();
804 for(iPrimTrack=0; iPrimTrack<nTracks; iPrimTrack++){
806 Int_t nBytes = treeH->GetEvent(iPrimTrack);
807 if (nBytes <= 0) continue;
808 Int_t nHits = fHits->GetEntriesFast();
809 for(h=0; h<nHits; h++){
810 itsHit = (AliITShit *)fHits->UncheckedAt(h);
811 itsHit->GetDetectorID(lay,lad,det);
813 index = fITSgeom->GetModuleIndex(lay,lad,det);
815 index=det-1; // This should not be used.
816 } // end if [You must have fITSgeom for this to work!]
817 mod = GetModule(index);
818 itsHit->SetTrack(itsHit->GetTrack()+mask); // Set track mask.
819 mod->AddHit(itsHit,iPrimTrack,h);
820 } // end loop over hits
821 } // end loop over tracks
823 //______________________________________________________________________
824 void AliITS::ClearModules(){
825 // Clear the modules TObjArray.
831 if(fITSmodules) fITSmodules->Delete();
833 //______________________________________________________________________
834 void AliITS::MakeBranchS(const char *fl){
835 // Creates Tree Branch for the ITS summable digits.
837 // cont char *fl File name where SDigits branch is to be written
838 // to. If blank it write the SDigits to the same
839 // file in which the Hits were found.
844 Int_t buffersize = 4000;
847 // only one branch for SDigits.
848 sprintf(branchname,"%s",GetName());
851 if(fLoader->TreeS()){
852 if (fSDigits == 0x0) fSDigits = new TClonesArray("AliITSpListItem",1000);
853 MakeBranchInTree(fLoader->TreeS(),branchname,&fSDigits,buffersize,fl);
856 //______________________________________________________________________
857 void AliITS::SetTreeAddressS(TTree *treeS){
858 // Set branch address for the ITS summable digits Trees.
860 // TTree *treeS Tree containing the SDigits.
868 if (fSDigits == 0x0) fSDigits = new TClonesArray("AliITSpListItem",1000);
870 sprintf(branchname,"%s",GetName());
871 branch = treeS->GetBranch(branchname);
872 if (branch) branch->SetAddress(&fSDigits);
874 //______________________________________________________________________
875 void AliITS::MakeBranchInTreeD(TTree *treeD,const char *file){
876 // Creates Tree branches for the ITS.
878 // TTree *treeD Pointer to the Digits Tree.
879 // cont char *file File name where Digits branch is to be written
880 // to. If blank it write the SDigits to the same
881 // file in which the Hits were found.
886 Int_t buffersize = 4000;
889 sprintf(branchname,"%s",GetName());
890 // one branch for digits per type of detector
891 const char *det[3] = {"SPD","SDD","SSD"};
895 for (i=0; i<kNTYPES ;i++) {
896 DetType(i)->GetClassNames(digclass,clclass);
898 if (fDtype == 0x0) fDtype = new TObjArray(fNDetTypes);
899 if(!(fDtype->At(i))) fDtype->AddAt(new TClonesArray(digclass,1000),i);
902 for (i=0; i<kNTYPES ;i++) {
903 if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
904 else sprintf(branchname,"%sDigits%d",GetName(),i+1);
905 if (fDtype && treeD) {
906 MakeBranchInTree(treeD, branchname, &((*fDtype)[i]),buffersize,file);
910 //______________________________________________________________________
911 void AliITS::SetTreeAddressD(TTree *treeD){
912 // Set branch address for the Trees.
914 // TTree *treeD Tree containing the Digits.
920 const char *det[3] = {"SPD","SDD","SSD"};
927 for (i=0; i<kNTYPES; i++) {
928 DetType(i)->GetClassNames(digclass,clclass);
930 if (fDtype == 0x0) fDtype = new TObjArray(fNDetTypes);
931 if(!(fDtype->At(i))) fDtype->AddAt(new TClonesArray(digclass,1000),i);
933 if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
934 else sprintf(branchname,"%sDigits%d",GetName(),i+1);
936 branch = treeD->GetBranch(branchname);
937 if (branch) branch->SetAddress(&((*fDtype)[i]));
941 //______________________________________________________________________
942 void AliITS::Hits2SDigits(){
943 // Standard Hits to summable Digits function.
949 // return; // Using Hits in place of the larger sDigits.
950 AliRunLoader* rl = fLoader->GetRunLoader();
951 AliHeader *header=rl->GetHeader(); // Get event number from this file.
955 header=rl->GetHeader();
956 if (header == 0x0) return;
958 // Do the Hits to Digits operation. Use Standard input values.
959 // Event number from file, no background hit merging , use size from
960 // AliITSgeom class, option="All", input from this file only.
961 HitsToSDigits(header->GetEvent(),0,-1," ",fOpt," ");
964 //______________________________________________________________________
965 void AliITS::Hits2PreDigits(){
966 // Standard Hits to summable Digits function.
972 AliHeader *header=fLoader->GetRunLoader()->GetHeader(); // Get event number from this file.
973 // Do the Hits to Digits operation. Use Standard input values.
974 // Event number from file, no background hit merging , use size from
975 // AliITSgeom class, option="All", input from this file only.
976 HitsToPreDigits(header->GetEvent(),0,-1," ",fOpt," ");
978 //______________________________________________________________________
979 void AliITS::SDigitsToDigits(Option_t *opt){
980 // Standard Summable digits to Digits function.
985 char name[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
987 if(!GetITSgeom()) return; // need transformations to do digitization.
988 AliITSgeom *geom = GetITSgeom();
990 const char *all = strstr(opt,"All");
991 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
993 if( !det[0] && !det[1] && !det[2] ) all = "All";
995 static Bool_t setDef=kTRUE;
996 if (setDef) SetDefaultSimulation();
999 AliITSsimulation *sim = 0;
1000 AliITSDetType *iDetType = 0;
1001 TTree *trees = fLoader->TreeS();
1002 if( !(trees && this->GetSDigits()) ){
1003 Error("SDigits2Digits","Error: No trees or SDigits. Returning.");
1006 sprintf( name, "%s", this->GetName() );
1007 TBranch *brchSDigits = trees->GetBranch( name );
1010 for(module=0;module<geom->GetIndexMax();module++){
1011 id = geom->GetModuleType(module);
1012 if (!all && !det[id]) continue;
1013 iDetType = DetType(id);
1014 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1016 Error("SDigit2Digits",
1017 "The simulation class was not instanciated!");
1020 sim->InitSimulationModule(module,gAlice->GetEvNumber());
1022 // add summable digits to module
1023 this->GetSDigits()->Clear();
1024 brchSDigits->GetEvent(module);
1025 sim->AddSDigitsToModule(GetSDigits(),0);
1027 // Digitise current module sum(SDigits)->Digits
1028 sim->FinishSDigitiseModule();
1030 // fills all branches - wasted disk space
1031 fLoader->TreeD()->Fill();
1032 this->ResetDigits();
1035 fLoader->TreeD()->GetEntries();
1037 fLoader->TreeD()->AutoSave();
1039 fLoader->TreeD()->Reset();
1042 //______________________________________________________________________
1043 void AliITS::Hits2Digits(){
1044 // Standard Hits to Digits function.
1050 AliHeader *header=fLoader->GetRunLoader()->GetHeader(); // Get event number from this file.
1051 // Do the Hits to Digits operation. Use Standard input values.
1052 // Event number from file, no background hit merging , use size from
1053 // AliITSgeom class, option="All", input from this file only.
1054 HitsToDigits(header->GetEvent(),0,-1," ",fOpt," ");
1056 //______________________________________________________________________
1057 void AliITS::HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size,
1058 Option_t *option, Option_t *opt,Text_t *filename){
1059 // keep galice.root for signal and name differently the file for
1060 // background when add! otherwise the track info for signal will be lost !
1061 // the condition below will disappear when the geom class will be
1062 // initialized for all versions - for the moment it is only for v5 !
1063 // 7 is the SDD beam test version. Dummy routine. Hits are ITS's Summable
1066 // Int_t evnt Event to be processed.
1067 // Int_t bgrev Background Hit tree number.
1068 // Int_t nmodules Not used.
1069 // Option_t *option String indicating if merging hits or not. To
1070 // merge hits set equal to "Add". Otherwise no
1071 // background hits are considered.
1072 // Test_t *filename File name containing the background hits..
1077 // return; // using Hits instead of the larger sdigits.
1079 HitsToPreDigits(evNumber,bgrev,size,option,opt,filename);
1081 //______________________________________________________________________
1082 void AliITS::HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
1083 Option_t *option, Option_t *opt,Text_t *filename){
1084 // Keep galice.root for signal and name differently the file for
1085 // background when add! otherwise the track info for signal will be lost !
1086 // the condition below will disappear when the geom class will be
1087 // initialized for all versions - for the moment it is only for v5 !
1088 // 7 is the SDD beam test version.
1090 // Int_t evnt Event to be processed.
1091 // Int_t bgrev Background Hit tree number.
1092 // Int_t nmodules Not used.
1093 // Option_t *option String indicating if merging hits or not. To
1094 // merge hits set equal to "Add". Otherwise no
1095 // background hits are considered.
1096 // Test_t *filename File name containing the background hits..
1102 if(!GetITSgeom()) return; // need transformations to do digitization.
1103 AliITSgeom *geom = GetITSgeom();
1105 const char *all = strstr(opt,"All");
1106 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1108 static Bool_t setDef=kTRUE;
1109 if (setDef) SetDefaultSimulation();
1113 InitModules(size,nmodules);
1114 FillModules(evNumber,bgrev,nmodules,option,filename);
1116 AliITSsimulation *sim = 0;
1117 AliITSDetType *iDetType = 0;
1118 AliITSmodule *mod = 0;
1120 for(module=0;module<geom->GetIndexMax();module++){
1121 id = geom->GetModuleType(module);
1122 if (!all && !det[id]) continue;
1123 iDetType = DetType(id);
1124 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1126 Error("HitsToSDigits",
1127 "The simulation class was not instanciated!");
1130 mod = (AliITSmodule *)fITSmodules->At(module);
1131 sim->SDigitiseModule(mod,module,evNumber);
1132 // fills all branches - wasted disk space
1133 fLoader->TreeS()->Fill();
1139 fLoader->TreeS()->GetEntries();
1140 fLoader->TreeS()->AutoSave();
1141 fLoader->WriteSDigits("OVERWRITE");
1143 fLoader->TreeS()->Reset();
1145 //______________________________________________________________________
1146 void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
1147 Option_t *option, Option_t *opt,Text_t *filename){
1148 // Keep galice.root for signal and name differently the file for
1149 // background when add! otherwise the track info for signal will be lost !
1150 // the condition below will disappear when the geom class will be
1151 // initialized for all versions - for the moment it is only for v5 !
1152 // 7 is the SDD beam test version.
1154 // Int_t evnt Event to be processed.
1155 // Int_t bgrev Background Hit tree number.
1156 // Int_t nmodules Not used.
1157 // Option_t *option String indicating if merging hits or not. To
1158 // merge hits set equal to "Add". Otherwise no
1159 // background hits are considered.
1160 // Test_t *filename File name containing the background hits..
1166 if(!GetITSgeom()) return; // need transformations to do digitization.
1167 AliITSgeom *geom = GetITSgeom();
1169 const char *all = strstr(opt,"All");
1170 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1172 static Bool_t setDef=kTRUE;
1173 if (setDef) SetDefaultSimulation();
1177 InitModules(size,nmodules);
1178 FillModules(evNumber,bgrev,nmodules,option,filename);
1180 AliITSsimulation *sim = 0;
1181 AliITSDetType *iDetType = 0;
1182 AliITSmodule *mod = 0;
1184 for(module=0;module<geom->GetIndexMax();module++){
1185 id = geom->GetModuleType(module);
1186 if (!all && !det[id]) continue;
1187 iDetType = DetType(id);
1188 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1190 Error("HitsToDigits",
1191 "The simulation class was not instanciated!");
1194 mod = (AliITSmodule *)fITSmodules->At(module);
1195 sim->DigitiseModule(mod,module,evNumber);
1196 // fills all branches - wasted disk space
1197 fLoader->TreeD()->Fill();
1203 fLoader->TreeD()->GetEntries();
1204 fLoader->TreeD()->AutoSave();
1206 fLoader->TreeD()->Reset();
1208 //______________________________________________________________________
1209 void AliITS::ResetSDigits(){
1210 // Reset the Summable Digits array.
1216 if (fSDigits) fSDigits->Clear();
1219 //______________________________________________________________________
1220 void AliITS::ResetDigits(){
1221 // Reset number of digits and the digits array for the ITS detector.
1227 if (!fDtype) return;
1230 for (i=0;i<kNTYPES;i++ ) {
1231 if (fDtype->At(i)) ((TClonesArray*)fDtype->At(i))->Clear();
1232 if (fNdtype) fNdtype[i]=0;
1235 //______________________________________________________________________
1236 void AliITS::ResetDigits(Int_t i){
1237 // Reset number of digits and the digits array for this branch.
1243 if (fDtype->At(i)) ((TClonesArray*)fDtype->At(i))->Clear();
1244 if (fNdtype) fNdtype[i]=0;
1246 //______________________________________________________________________
1247 void AliITS::AddSumDigit(AliITSpListItem &sdig){
1248 // Adds the a module full of summable digits to the summable digits tree.
1250 // AliITSpListItem &sdig SDigit to be added to SDigits tree.
1256 TClonesArray &lsdig = *fSDigits;
1257 new(lsdig[fNSDigits++]) AliITSpListItem(sdig);
1259 //______________________________________________________________________
1260 void AliITS::AddRealDigit(Int_t id, Int_t *digits){
1261 // Add a real digit - as coming from data.
1263 // Int_t id Detector type number.
1264 // Int_t *digits Integer array containing the digits info. See
1271 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1272 new(ldigits[fNdtype[id]++]) AliITSdigit(digits);
1274 //______________________________________________________________________
1275 void AliITS::AddSimDigit(Int_t id, AliITSdigit *d){
1276 // Add a simulated digit.
1278 // Int_t id Detector type number.
1279 // AliITSdigit *d Digit to be added to the Digits Tree. See
1286 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1290 new(ldigits[fNdtype[id]++]) AliITSdigitSPD(*((AliITSdigitSPD*)d));
1293 new(ldigits[fNdtype[id]++]) AliITSdigitSDD(*((AliITSdigitSDD*)d));
1296 new(ldigits[fNdtype[id]++]) AliITSdigitSSD(*((AliITSdigitSSD*)d));
1300 //______________________________________________________________________
1301 void AliITS::AddSimDigit(Int_t id,Float_t phys,Int_t *digits,Int_t *tracks,
1302 Int_t *hits,Float_t *charges){
1303 // Add a simulated digit to the list.
1305 // Int_t id Detector type number.
1306 // Float_t phys Physics indicator. See AliITSdigits.h
1307 // Int_t *digits Integer array containing the digits info. See
1309 // Int_t *tracks Integer array [AliITSdigitS?D::GetNTracks()]
1310 // containing the track numbers that contributed to
1312 // Int_t *hits Integer array [AliITSdigitS?D::GetNTracks()]
1313 // containing the hit numbers, from AliITSmodule, that
1314 // contributed to this digit.
1315 // Float_t *charge Floating point array of the signals contributed
1316 // to this digit by each track.
1322 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1325 new(ldigits[fNdtype[id]++]) AliITSdigitSPD(digits,tracks,hits);
1328 new(ldigits[fNdtype[id]++]) AliITSdigitSDD(phys,digits,tracks,
1332 new(ldigits[fNdtype[id]++]) AliITSdigitSSD(digits,tracks,hits);
1336 //______________________________________________________________________
1337 void AliITS::MakeTreeC(Option_t *option){
1338 // Create a separate tree to store the clusters.
1340 // Option_t *option string which must contain "C" otherwise
1341 // no Cluster Tree is created.
1347 AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
1349 if (pITSLoader == 0x0) {
1350 Error("MakeTreeC","fLoader == 0x0 option=%s",option);
1353 if (pITSLoader->TreeC() == 0x0) pITSLoader->MakeTree("C");
1357 void AliITS::MakeBranchC()
1359 //Makes barnches in treeC
1360 AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
1361 if (pITSLoader == 0x0)
1363 Error("MakeTreeC","fLoader == 0x0");
1366 TTree * lTC = pITSLoader->TreeC();
1369 Error("MakeTreeC","Can not get TreeC from Loader");
1373 Int_t buffersize = 4000;
1374 char branchname[30];
1375 const char *det[3] = {"SPD","SDD","SSD"};
1379 // one branch for Clusters per type of detector
1381 for (i=0; i<kNTYPES ;i++)
1383 AliITSDetType *iDetType=DetType(i);
1384 iDetType->GetClassNames(digclass,clclass);
1386 if (fCtype == 0x0) fCtype = new TObjArray(fNDetTypes);
1387 if(!ClustersAddress(i))
1389 fCtype->AddAt(new TClonesArray(clclass,1000),i);
1391 if (kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
1392 else sprintf(branchname,"%sClusters%d",GetName(),i+1);
1395 if (lTC->GetBranch(branchname))
1397 Warning("MakeBranchC","Branch %s alread exists in TreeC",branchname);
1401 Info("MakeBranchC","Creating branch %s in TreeC",branchname);
1402 lTC->Branch(branchname,&((*fCtype)[i]), buffersize);
1404 } // end if fCtype && lTC
1408 //______________________________________________________________________
1409 void AliITS::GetTreeC(Int_t event){
1410 // Get the clusters tree for this event and set the branch address.
1412 // Int_t event Event number for the cluster tree.
1417 char branchname[30];
1418 const char *det[3] = {"SPD","SDD","SSD"};
1420 AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
1421 TTree * lTC = pITSLoader->TreeC();
1425 pITSLoader->CleanRawClusters();
1435 for (i=0; i<kNTYPES; i++) {
1436 AliITSDetType *iDetType=DetType(i);
1437 iDetType->GetClassNames(digclass,clclass);
1439 if (fCtype == 0x0) fCtype = new TObjArray(fNDetTypes);
1440 if(!fCtype->At(i)) fCtype->AddAt(new TClonesArray(clclass,1000),i);
1441 if(kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
1442 else sprintf(branchname,"%sClusters%d",GetName(),i+1);
1444 branch = lTC->GetBranch(branchname);
1445 if (branch) branch->SetAddress(&((*fCtype)[i]));
1449 Error("GetTreeC","cannot find Clusters Tree for event:%d",event);
1452 //______________________________________________________________________
1453 void AliITS::AddCluster(Int_t id, AliITSRawCluster *c){
1454 // Add a cluster to the list.
1456 // Int_t id Detector type number.
1457 // AliITSRawCluster *c Cluster class to be added to the tree of
1464 TClonesArray &lc = *((TClonesArray*)fCtype->At(id));
1468 new(lc[fNctype[id]++]) AliITSRawClusterSPD(*((AliITSRawClusterSPD*)c));
1471 new(lc[fNctype[id]++]) AliITSRawClusterSDD(*((AliITSRawClusterSDD*)c));
1474 new(lc[fNctype[id]++]) AliITSRawClusterSSD(*((AliITSRawClusterSSD*)c));
1478 //______________________________________________________________________
1479 void AliITS::ResetClusters(){
1480 // Reset number of clusters and the clusters array for ITS.
1487 for (i=0;i<kNTYPES;i++ ) ResetClusters(i);
1489 //______________________________________________________________________
1490 void AliITS::ResetClusters(Int_t i){
1491 // Reset number of clusters and the clusters array for this branch.
1493 // Int_t i Detector type number.
1499 if (fCtype->At(i)) ((TClonesArray*)fCtype->At(i))->Clear();
1500 if (fNctype) fNctype[i]=0;
1502 //______________________________________________________________________
1503 void AliITS::MakeBranchR(const char *file, Option_t *opt){
1504 // Creates Tree branches for the ITS Reconstructed points.
1506 // cont char *file File name where RecPoints branch is to be written
1507 // to. If blank it write the SDigits to the same
1508 // file in which the Hits were found.
1513 Int_t buffsz = 4000;
1514 char branchname[30];
1516 // only one branch for rec points for all detector types
1517 Bool_t oFast= (strstr(opt,"Fast")!=0);
1519 sprintf(branchname,"%sRecPointsF",GetName());
1521 sprintf(branchname,"%sRecPoints",GetName());
1525 if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
1526 if (fLoader->TreeR()) {
1527 if (fRecPoints == 0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
1528 MakeBranchInTree(fLoader->TreeR(),branchname,&fRecPoints,buffsz,file);
1531 //______________________________________________________________________
1532 void AliITS::SetTreeAddressR(TTree *treeR){
1533 // Set branch address for the Reconstructed points Trees.
1535 // TTree *treeR Tree containing the RecPoints.
1540 char branchname[30];
1543 if (fRecPoints == 0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
1545 sprintf(branchname,"%sRecPoints",GetName());
1546 branch = treeR->GetBranch(branchname);
1548 branch->SetAddress(&fRecPoints);
1551 sprintf(branchname,"%sRecPointsF",GetName());
1552 branch = treeR->GetBranch(branchname);
1554 branch->SetAddress(&fRecPoints);
1558 //______________________________________________________________________
1559 void AliITS::AddRecPoint(const AliITSRecPoint &r){
1560 // Add a reconstructed space point to the list
1562 // const AliITSRecPoint &r RecPoint class to be added to the tree
1563 // of reconstructed points TreeR.
1569 TClonesArray &lrecp = *fRecPoints;
1570 new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
1572 //______________________________________________________________________
1573 void AliITS::HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
1574 Option_t *opt0,Option_t *opt1,Text_t *flnm){
1575 // keep galice.root for signal and name differently the file for
1576 // background when add! otherwise the track info for signal will be lost !
1577 // the condition below will disappear when the geom class will be
1578 // initialized for all versions - for the moment it is only for v5 !
1580 // Int_t evnt Event to be processed.
1581 // Int_t bgrev Background Hit tree number.
1582 // Int_t size Size used by InitModules. See InitModules.
1583 // Option_t *opt0 Option passed to FillModules. See FillModules.
1584 // Option_t *opt1 String indicating if merging hits or not. To
1585 // merge hits set equal to "Add". Otherwise no
1586 // background hits are considered.
1587 // Test_t *flnm File name containing the background hits..
1593 if(!GetITSgeom()) return;
1594 AliITSLoader *pITSloader = (AliITSLoader*)fLoader;
1595 AliITSgeom *geom = GetITSgeom();
1597 const char *all = strstr(opt1,"All");
1598 const char *det[3] ={strstr(opt1,"SPD"),strstr(opt1,"SDD"),
1599 strstr(opt1,"SSD")};
1601 InitModules(size,nmodules);
1602 FillModules(evNumber,bgrev,nmodules,opt0,flnm);
1604 AliITSsimulation *sim = 0;
1605 AliITSDetType *iDetType = 0;
1606 AliITSmodule *mod = 0;
1609 //m.b. : this change is nothing but a nice way to make sure
1612 cout<<"HitsToFastRecPoints: N mod = "<<geom->GetIndexMax()<<endl;
1614 for(module=0;module<geom->GetIndexMax();module++)
1616 id = geom->GetModuleType(module);
1617 if (!all && !det[id]) continue;
1618 iDetType = DetType(id);
1619 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1622 Error("HitsToFastPoints","The simulation class was not instanciated!");
1625 mod = (AliITSmodule *)fITSmodules->At(module);
1626 sim->CreateFastRecPoints(mod,module,gRandom);
1627 cout<<module<<"\r";fflush(0);
1628 //gAlice->TreeR()->Fill();
1629 TTree *lTR = pITSloader->TreeR();
1630 TBranch *br=lTR->GetBranch("ITSRecPointsF");
1637 fLoader->WriteRecPoints("OVERWRITE");
1639 //______________________________________________________________________
1640 void AliITS::Digits2Reco(){
1641 // Find clusters and reconstruct space points.
1647 AliHeader *header=fLoader->GetRunLoader()->GetHeader();
1648 // to Digits to RecPoints for event in file, all digits in file, and
1649 // all ITS detectors.
1650 DigitsToRecPoints(header->GetEvent(),0,fOpt);
1652 //______________________________________________________________________
1653 void AliITS::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt){
1654 // cluster finding and reconstruction of space points
1655 // the condition below will disappear when the geom class will be
1656 // initialized for all versions - for the moment it is only for v5 !
1657 // 7 is the SDD beam test version
1659 // Int_t evNumber Event number to be processed.
1660 // Int_t lastentry Offset for module when not all of the modules
1662 // Option_t *opt String indicating which ITS sub-detectors should
1663 // be processed. If ="All" then all of the ITS
1664 // sub detectors are processed.
1670 if(!GetITSgeom()) return;
1671 AliITSgeom *geom = GetITSgeom();
1673 const char *all = strstr(opt,"All");
1674 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1676 static Bool_t setRec=kTRUE;
1677 if (setRec) SetDefaultClusterFinders();
1680 AliITSLoader *pITSloader = (AliITSLoader*)fLoader;
1681 TTree *treeC=pITSloader->TreeC();
1682 AliITSClusterFinder *rec = 0;
1683 AliITSDetType *iDetType = 0;
1684 Int_t id,module,first=0;
1685 for(module=0;module<geom->GetIndexMax();module++){
1686 id = geom->GetModuleType(module);
1687 if (!all && !det[id]) continue;
1688 if(det[id]) first = geom->GetStartDet(id);
1689 iDetType = DetType(id);
1690 rec = (AliITSClusterFinder*)iDetType->GetReconstructionModel();
1691 TClonesArray *itsDigits = this->DigitsAddress(id);
1693 Error("DigitsToRecPoints",
1694 "The reconstruction class was not instanciated! event=%d",
1698 this->ResetDigits();
1699 TTree *lTD = pITSloader->TreeD();
1701 lTD->GetEvent(lastentry+module);
1703 lTD->GetEvent(lastentry+(module-first));
1705 Int_t ndigits = itsDigits->GetEntriesFast();
1706 if (ndigits) rec->FindRawClusters(module);
1707 pITSloader->TreeR()->Fill();
1714 pITSloader->WriteRecPoints("OVERWRITE");
1715 pITSloader->WriteRawClusters("OVERWRITE");
1717 //______________________________________________________________________
1718 void AliITS::ResetRecPoints(){
1719 // Reset number of rec points and the rec points array.
1725 if (fRecPoints) fRecPoints->Clear();
1728 //______________________________________________________________________
1729 AliLoader* AliITS::MakeLoader(const char* topfoldername)
1731 //builds ITSgetter (AliLoader type)
1732 //if detector wants to use castomized getter, it must overload this method
1734 Info("MakeLoader","Creating AliITSLoader. Top folder is %s.",topfoldername);
1735 fLoader = new AliITSLoader(GetName(),topfoldername);