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 "AliITSRawClusterSPD.h"
92 #include "AliITSRawClusterSDD.h"
93 #include "AliITSRawClusterSSD.h"
94 #include "AliITSRecPoint.h"
95 #include "AliITSdigit.h"
96 #include "AliITSgeom.h"
97 #include "AliITShit.h"
98 #include "AliITSmodule.h"
99 #include "AliITSpList.h"
100 #include "AliITSresponseSDD.h"
101 #include "AliITSresponseSPD.h"
102 #include "AliITSresponseSSD.h"
103 #include "AliITSsegmentationSDD.h"
104 #include "AliITSsegmentationSPD.h"
105 #include "AliITSsegmentationSSD.h"
106 #include "AliITSsimulationSDD.h"
107 #include "AliITSsimulationSPD.h"
108 #include "AliITSsimulationSSD.h"
110 #include "AliITSDigitizer.h"
114 //______________________________________________________________________
115 AliITS::AliITS() : AliDetector() {
116 // Default initializer for ITS
117 // The default constructor of the AliITS class. In addition to
118 // creating the AliITS class it zeros the variables fIshunt (a member
119 // of AliDetector class), fEuclidOut, and fIdN, and zeros the pointers
120 // fITSpoints, fIdSens, and fIdName. The AliDetector default constructor
129 fIshunt = 0; // not zeroed in AliDetector.
136 // SetDetectors(); // default to fOpt="All". This variable not written out.
142 fNDetTypes = kNTYPES;
157 SetMarkerColor(kRed);
159 //______________________________________________________________________
160 AliITS::AliITS(const char *name, const char *title):AliDetector(name,title){
161 // The standard Constructor for the ITS class. In addition to
162 // creating the AliITS class, it allocates memory for the TClonesArrays
163 // fHits, fSDigits, fDigits, fITSpoints, and the TObjArray of fCtype
164 // (clusters). It also zeros the variables
165 // fIshunt (a member of AliDetector class), fEuclidOut, and fIdN, and zeros
166 // the pointers fIdSens and fIdName. To help in displaying hits via the
167 // ROOT macro display.C AliITS also sets the marker color to red. The
168 // variables passes with this constructor, const char *name and *title,
169 // are used by the constructor of AliDetector class. See AliDetector
170 // class for a description of these parameters and its constructor
173 // const char *name Detector name. Should always be "ITS"
174 // const char *title Detector title.
180 fIshunt = 0; // not zeroed in AliDetector
181 fHits = new TClonesArray("AliITShit", 1560);//not done in AliDetector
182 gAlice->GetMCApp()->AddHitList(fHits); // Not done in AliDetector.
187 SetDetectors(); // default to fOpt="All". This variable not written out.
193 fNDetTypes = kNTYPES;
194 fDetTypes = new TObjArray(fNDetTypes);
196 fSDigits = new TClonesArray("AliITSpListItem",1000);
199 fNdtype = new Int_t[fNDetTypes];
200 fDtype = new TObjArray(fNDetTypes);
202 fCtype = new TObjArray(fNDetTypes);
203 fNctype = new Int_t[fNDetTypes];
205 fRecPoints = new TClonesArray("AliITSRecPoint",1000);
209 for(i=0;i<fNDetTypes;i++) {
210 fDetTypes->AddAt(new AliITSDetType(),i);
215 SetMarkerColor(kRed);
218 //______________________________________________________________________
220 // Default destructor for ITS.
221 // The default destructor of the AliITS class. In addition to deleting
222 // the AliITS class it deletes the memory pointed to by the fHits, fDigits,
223 // fSDigits, fCtype, fITSmodules, fITSgeom, fRecPoints, fIdSens, fIdName,
224 // fITSpoints, fDetType and it's contents.
248 fRecPoints->Delete();
252 delete[] fIdName; // Array of TStrings
255 this->ClearModules();
258 }// end if fITSmodules!=0
276 } // end if fDetTypes
279 if (fITSgeom) delete fITSgeom;
281 //______________________________________________________________________
282 AliITS::AliITS(const AliITS &source) : AliDetector(source){
283 // Copy constructor. This is a function which is not allowed to be
284 // done to the ITS. It exits with an error.
286 // AliITS &source An AliITS class.
292 if(this==&source) return;
293 Error("Copy constructor",
294 "You are not allowed to make a copy of the AliITS");
297 //______________________________________________________________________
298 AliITS& AliITS::operator=(AliITS &source){
299 // Assignment operator. This is a function which is not allowed to be
300 // done to the ITS. It exits with an error.
302 // AliITS &source An AliITS class.
308 if(this==&source) return *this;
309 Error("operator=","You are not allowed to make a copy of the AliITS");
311 return *this; //fake return
313 //______________________________________________________________________
314 Int_t AliITS::DistancetoPrimitive(Int_t,Int_t) const{
315 // Distance from mouse to ITS on the screen. Dummy routine
316 // A dummy routine used by the ROOT macro display.C to allow for the
317 // use of the mouse (pointing device) in the macro. In general this should
318 // never be called. If it is it returns the number 9999 for any value of
321 // Int_t Dummy screen coordinate.
322 // Int_t Dummy screen coordinate.
326 // Int_t Dummy = 9999 distance to ITS.
330 //______________________________________________________________________
332 // Initializer ITS after it has been built
333 // This routine initializes the AliITS class. It is intended to be
334 // called from the Init function in AliITSv?. Besides displaying a banner
335 // indicating that it has been called it initializes the array fIdSens
336 // and sets the default segmentation, response, digit and raw cluster
337 // classes therefore it should be called after a call to CreateGeometry.
348 for(i=0;i<fIdN;i++) fIdSens[i] = gMC->VolId(fIdName[i]);
350 //______________________________________________________________________
351 void AliITS::SetDefaults(){
352 // sets the default segmentation, response, digit and raw cluster classes.
360 if(fDebug) printf("%s: SetDefaults\n",ClassName());
362 AliITSDetType *iDetType;
366 if (!iDetType->GetSegmentationModel()) {
367 AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(fITSgeom);
368 SetSegmentationModel(0,seg0);
370 if (!iDetType->GetResponseModel()) {
371 SetResponseModel(0,new AliITSresponseSPD());
373 // set digit and raw cluster classes to be used
375 const char *kData0=(iDetType->GetResponseModel())->DataType();
376 if (strstr(kData0,"real")) {
377 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSPD");
378 } else iDetType->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD");
382 if (!iDetType->GetResponseModel()) {
383 SetResponseModel(1,new AliITSresponseSDD("simulated"));
385 AliITSresponse *resp1=iDetType->GetResponseModel();
386 if (!iDetType->GetSegmentationModel()) {
387 AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(fITSgeom,resp1);
388 SetSegmentationModel(1,seg1);
390 const char *kData1=(iDetType->GetResponseModel())->DataType();
391 const char *kopt=iDetType->GetResponseModel()->ZeroSuppOption();
392 if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D")) || strstr(kData1,"real") ){
393 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD");
394 } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
398 if (!iDetType->GetSegmentationModel()) {
399 AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(fITSgeom);
400 SetSegmentationModel(2,seg2);
402 if (!iDetType->GetResponseModel()) {
403 SetResponseModel(2,new AliITSresponseSSD("simulated"));
405 const char *kData2=(iDetType->GetResponseModel())->DataType();
406 if (strstr(kData2,"real")) {
407 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSSD");
408 } else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
411 Warning("SetDefaults",
412 "Only the three basic detector types are initialized!");
415 //______________________________________________________________________
416 void AliITS::SetDefaultSimulation(){
417 // sets the default simulation.
425 AliITSDetType *iDetType;
426 AliITSsimulation *sim;
428 sim = iDetType->GetSimulationModel();
430 AliITSsegmentation *seg0=
431 (AliITSsegmentation*)iDetType->GetSegmentationModel();
432 AliITSresponse *res0 = (AliITSresponse*)iDetType->GetResponseModel();
433 AliITSsimulationSPD *sim0=new AliITSsimulationSPD(seg0,res0);
434 SetSimulationModel(0,sim0);
435 }else{ // simulation exists, make sure it is set up properly.
436 ((AliITSsimulationSPD*)sim)->Init(
437 (AliITSsegmentationSPD*) iDetType->GetSegmentationModel(),
438 (AliITSresponseSPD*) iDetType->GetResponseModel());
439 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
440 // (AliITSresponse*)iDetType->GetResponseModel());
441 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
442 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
445 sim = iDetType->GetSimulationModel();
447 AliITSsegmentation *seg1=
448 (AliITSsegmentation*)iDetType->GetSegmentationModel();
449 AliITSresponse *res1 = (AliITSresponse*)iDetType->GetResponseModel();
450 AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1);
451 SetSimulationModel(1,sim1);
452 }else{ // simulation exists, make sure it is set up properly.
453 ((AliITSsimulationSDD*)sim)->Init(
454 (AliITSsegmentationSDD*) iDetType->GetSegmentationModel(),
455 (AliITSresponseSDD*) iDetType->GetResponseModel());
456 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
457 // (AliITSresponse*)iDetType->GetResponseModel());
458 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
459 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
462 sim = iDetType->GetSimulationModel();
464 AliITSsegmentation *seg2=
465 (AliITSsegmentation*)iDetType->GetSegmentationModel();
466 AliITSresponse *res2 = (AliITSresponse*)iDetType->GetResponseModel();
467 AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2);
468 SetSimulationModel(2,sim2);
469 }else{ // simulation exists, make sure it is set up properly.
470 ((AliITSsimulationSSD*)sim)->Init(
471 (AliITSsegmentationSSD*) iDetType->GetSegmentationModel(),
472 (AliITSresponseSSD*) iDetType->GetResponseModel());
473 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
474 // (AliITSresponse*)iDetType->GetResponseModel());
475 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
476 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
479 //______________________________________________________________________
480 void AliITS::SetDefaultClusterFinders(){
481 // Sets the default cluster finders. Used in finding RecPoints.
490 AliITSDetType *iDetType;
494 if (!iDetType->GetReconstructionModel()) {
495 AliITSsegmentation *seg0 =
496 (AliITSsegmentation*)iDetType->GetSegmentationModel();
497 TClonesArray *dig0=DigitsAddress(0);
498 TClonesArray *recp0=ClustersAddress(0);
499 AliITSClusterFinderSPD *rec0 = new AliITSClusterFinderSPD(seg0,dig0,
501 SetReconstructionModel(0,rec0);
506 if (!iDetType->GetReconstructionModel()) {
507 AliITSsegmentation *seg1 =
508 (AliITSsegmentation*)iDetType->GetSegmentationModel();
509 AliITSresponse *res1 = (AliITSresponse*)iDetType->GetResponseModel();
510 TClonesArray *dig1=DigitsAddress(1);
511 TClonesArray *recp1=ClustersAddress(1);
512 AliITSClusterFinderSDD *rec1 =
513 new AliITSClusterFinderSDD(seg1,res1,dig1,recp1);
514 SetReconstructionModel(1,rec1);
519 if (!iDetType->GetReconstructionModel()) {
520 AliITSsegmentation *seg2=
521 (AliITSsegmentation*)iDetType->GetSegmentationModel();
522 TClonesArray *dig2=DigitsAddress(2);
523 AliITSClusterFinderSSD *rec2= new AliITSClusterFinderSSD(seg2,dig2);
524 SetReconstructionModel(2,rec2);
527 //______________________________________________________________________
528 void AliITS::MakeBranch(Option_t* option){
529 // Creates Tree branches for the ITS.
531 // Option_t *option String of Tree types S,D, and/or R.
532 // const char *file String of the file name where these branches
533 // are to be stored. If blank then these branches
534 // are written to the same tree as the Hits were
540 Bool_t cH = (strstr(option,"H")!=0);
541 Bool_t cS = (strstr(option,"S")!=0);
542 Bool_t cD = (strstr(option,"D")!=0);
543 Bool_t cR = (strstr(option,"R")!=0);
544 Bool_t cRF = (strstr(option,"RF")!=0);
547 if(cH && (fHits == 0x0)) fHits = new TClonesArray("AliITShit", 1560);
549 AliDetector::MakeBranch(option);
551 if(cS) MakeBranchS(0);
552 if(cD) MakeBranchD(0);
553 if(cR) MakeBranchR(0);
554 if(cRF) MakeBranchRF(0);
556 //______________________________________________________________________
557 void AliITS::SetTreeAddress(){
558 // Set branch address for the Trees.
565 TTree *treeS = fLoader->TreeS();
566 TTree *treeD = fLoader->TreeD();
567 TTree *treeR = fLoader->TreeR();
568 if (fLoader->TreeH() && (fHits == 0x0)) fHits = new TClonesArray("AliITShit", 1560);
570 AliDetector::SetTreeAddress();
572 SetTreeAddressS(treeS);
573 SetTreeAddressD(treeD);
574 SetTreeAddressR(treeR);
576 //______________________________________________________________________
577 AliITSDetType* AliITS::DetType(Int_t id){
578 // Return pointer to id detector type.
580 // Int_t id detector id number.
584 // returned, a pointer to a AliITSDetType.
586 return ((AliITSDetType*) fDetTypes->At(id));
588 //______________________________________________________________________
589 void AliITS::SetResponseModel(Int_t id, AliITSresponse *response){
590 // Set the response model for the id detector type.
592 // Int_t id detector id number.
593 // AliITSresponse* a pointer containing an instance of AliITSresponse
594 // to be stored/owned b y AliITSDetType.
600 ((AliITSDetType*) fDetTypes->At(id))->ResponseModel(response);
602 //______________________________________________________________________
603 void AliITS::SetSegmentationModel(Int_t id, AliITSsegmentation *seg){
604 // Set the segmentation model for the id detector type.
606 // Int_t id detector id number.
607 // AliITSsegmentation* a pointer containing an instance of
608 // AliITSsegmentation to be stored/owned b y
615 ((AliITSDetType*) fDetTypes->At(id))->SegmentationModel(seg);
617 //______________________________________________________________________
618 void AliITS::SetSimulationModel(Int_t id, AliITSsimulation *sim){
619 // Set the simulation model for the id detector type.
621 // Int_t id detector id number.
622 // AliITSresponse* a pointer containing an instance of AliITSresponse
623 // to be stored/owned b y AliITSDetType.
629 ((AliITSDetType*) fDetTypes->At(id))->SimulationModel(sim);
632 //______________________________________________________________________
633 void AliITS::SetReconstructionModel(Int_t id, AliITSClusterFinder *reconst){
634 // Set the cluster finder model for the id detector type.
636 // Int_t id detector id number.
637 // AliITSClusterFinder* a pointer containing an instance of
638 // AliITSClusterFinder to be stored/owned b y
645 ((AliITSDetType*) fDetTypes->At(id))->ReconstructionModel(reconst);
647 //______________________________________________________________________
648 void AliITS::SetClasses(Int_t id, const char *digit, const char *cluster){
649 // Set the digit and cluster classes name to be used for the id detector
652 // Int_t id detector id number.
653 // const char *digit Digit class name for detector id.
654 // const char *cluster Cluster class name for detector id.
660 ((AliITSDetType*) fDetTypes->At(id))->ClassNames(digit,cluster);
662 //______________________________________________________________________
663 void AliITS::AddHit(Int_t track, Int_t *vol, Float_t *hits){
665 // The function to add information to the AliITShit class. See the
666 // AliITShit class for a full description. This function allocates the
667 // necessary new space for the hit information and passes the variable
668 // track, and the pointers *vol and *hits to the AliITShit constructor
671 // Int_t track Track number which produced this hit.
672 // Int_t *vol Array of Integer Hit information. See AliITShit.h
673 // Float_t *hits Array of Floating Hit information. see AliITShit.h
679 TClonesArray &lhits = *fHits;
680 new(lhits[fNhits++]) AliITShit(fIshunt,track,vol,hits);
682 //______________________________________________________________________
683 void AliITS::InitModules(Int_t size,Int_t &nmodules){
684 // Initialize the modules array.
686 // Int_t size Size of array of the number of modules to be
687 // created. If size <=0 then the number of modules
688 // is gotten from AliITSgeom class kept in fITSgeom.
690 // Int_t &nmodules The number of modules existing.
695 fITSmodules->Delete();
697 } // end fir fITSmoudles
699 Int_t nl,indexMAX,index;
701 if(size<=0){ // default to using data stored in AliITSgeom
703 Error("InitModules","fITSgeom not defined");
705 } // end if fITSgeom==0
706 nl = fITSgeom->GetNlayers();
707 indexMAX = fITSgeom->GetModuleIndex(nl,fITSgeom->GetNladders(nl),
708 fITSgeom->GetNdetectors(nl))+1;
710 fITSmodules = new TObjArray(indexMAX);
711 for(index=0;index<indexMAX;index++){
712 fITSmodules->AddAt( new AliITSmodule(index),index);
715 fITSmodules = new TObjArray(size);
716 for(index=0;index<size;index++) {
717 fITSmodules->AddAt( new AliITSmodule(index),index);
723 //______________________________________________________________________
724 void AliITS::FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
725 Option_t *option,Text_t *filename){
726 // fill the modules with the sorted by module hits; add hits from
727 // background if option=Add.
729 // Int_t evnt Event to be processed.
730 // Int_t bgrev Background Hit tree number.
731 // Int_t nmodules Not used.
732 // Option_t *option String indicating if merging hits or not. To
733 // merge hits set equal to "Add". Otherwise no
734 // background hits are considered.
735 // Test_t *filename File name containing the background hits..
740 static TTree *trH1; //Tree with background hits
741 static Bool_t first=kTRUE;
743 const char *addBgr = strstr(option,"Add");
745 evnt = nmodules; // Dummy use of variables to remove warnings
748 file=new TFile(filename);
753 // Get Hits Tree header from file
754 if(trH1) delete trH1;
758 sprintf(treeName,"TreeH%d",bgrev);
759 trH1 = (TTree*)gDirectory->Get(treeName);
761 Error("FillModules","cannot find Hits Tree for event:%d",bgrev);
763 // Set branch addresses
766 FillModules(fLoader->TreeH(),0); // fill from this file's tree.
769 FillModules(trH1,10000000); // Default mask 10M.
770 TTree *fAli=fLoader->GetRunLoader()->TreeK();
772 if (fAli) fileAli =fAli->GetCurrentFile();
776 //______________________________________________________________________
777 void AliITS::FillModules(TTree *treeH, Int_t mask) {
778 // fill the modules with the sorted by module hits;
779 // can be called many times to do a merging
781 // TTree *treeH The tree containing the hits to be copied into
783 // Int_t mask The track number mask to indecate which file
784 // this hits came from.
792 Error("FillModules","Tree is NULL");
794 Int_t lay,lad,det,index;
798 sprintf(branchname,"%s",GetName());
799 TBranch *branch = treeH->GetBranch(branchname);
801 Error("FillModules","%s branch in TreeH not found",branchname);
804 branch->SetAddress(&fHits);
805 Int_t nTracks =(Int_t) treeH->GetEntries();
807 for(iPrimTrack=0; iPrimTrack<nTracks; iPrimTrack++){
809 Int_t nBytes = treeH->GetEvent(iPrimTrack);
810 if (nBytes <= 0) continue;
811 Int_t nHits = fHits->GetEntriesFast();
812 for(h=0; h<nHits; h++){
813 itsHit = (AliITShit *)fHits->UncheckedAt(h);
814 itsHit->GetDetectorID(lay,lad,det);
816 index = fITSgeom->GetModuleIndex(lay,lad,det);
818 index=det-1; // This should not be used.
819 } // end if [You must have fITSgeom for this to work!]
820 mod = GetModule(index);
821 itsHit->SetTrack(itsHit->GetTrack()+mask); // Set track mask.
822 mod->AddHit(itsHit,iPrimTrack,h);
823 } // end loop over hits
824 } // end loop over tracks
826 //______________________________________________________________________
827 void AliITS::ClearModules(){
828 // Clear the modules TObjArray.
834 if(fITSmodules) fITSmodules->Delete();
836 //______________________________________________________________________
837 void AliITS::MakeBranchS(const char *fl){
838 // Creates Tree Branch for the ITS summable digits.
840 // cont char *fl File name where SDigits branch is to be written
841 // to. If blank it write the SDigits to the same
842 // file in which the Hits were found.
847 Int_t buffersize = 4000;
850 // only one branch for SDigits.
851 sprintf(branchname,"%s",GetName());
854 if(fLoader->TreeS()){
855 if (fSDigits == 0x0) fSDigits = new TClonesArray("AliITSpListItem",1000);
856 MakeBranchInTree(fLoader->TreeS(),branchname,&fSDigits,buffersize,fl);
859 //______________________________________________________________________
860 void AliITS::SetTreeAddressS(TTree *treeS){
861 // Set branch address for the ITS summable digits Trees.
863 // TTree *treeS Tree containing the SDigits.
871 if (fSDigits == 0x0) fSDigits = new TClonesArray("AliITSpListItem",1000);
873 sprintf(branchname,"%s",GetName());
874 branch = treeS->GetBranch(branchname);
875 if (branch) branch->SetAddress(&fSDigits);
877 //______________________________________________________________________
878 void AliITS::MakeBranchInTreeD(TTree *treeD,const char *file){
879 // Creates Tree branches for the ITS.
881 // TTree *treeD Pointer to the Digits Tree.
882 // cont char *file File name where Digits branch is to be written
883 // to. If blank it write the SDigits to the same
884 // file in which the Hits were found.
889 Int_t buffersize = 4000;
892 sprintf(branchname,"%s",GetName());
893 // one branch for digits per type of detector
894 const char *det[3] = {"SPD","SDD","SSD"};
898 for (i=0; i<kNTYPES ;i++) {
899 DetType(i)->GetClassNames(digclass,clclass);
901 if (fDtype == 0x0) fDtype = new TObjArray(fNDetTypes);
902 if(!(fDtype->At(i))) fDtype->AddAt(new TClonesArray(digclass,1000),i);
905 for (i=0; i<kNTYPES ;i++) {
906 if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
907 else sprintf(branchname,"%sDigits%d",GetName(),i+1);
908 if (fDtype && treeD) {
909 MakeBranchInTree(treeD, branchname, &((*fDtype)[i]),buffersize,file);
913 //______________________________________________________________________
914 void AliITS::SetTreeAddressD(TTree *treeD){
915 // Set branch address for the Trees.
917 // TTree *treeD Tree containing the Digits.
923 const char *det[3] = {"SPD","SDD","SSD"};
930 for (i=0; i<kNTYPES; i++) {
931 DetType(i)->GetClassNames(digclass,clclass);
933 if (fDtype == 0x0) fDtype = new TObjArray(fNDetTypes);
934 if(!(fDtype->At(i))) fDtype->AddAt(new TClonesArray(digclass,1000),i);
936 if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
937 else sprintf(branchname,"%sDigits%d",GetName(),i+1);
939 branch = treeD->GetBranch(branchname);
940 if (branch) branch->SetAddress(&((*fDtype)[i]));
944 //______________________________________________________________________
945 void AliITS::Hits2SDigits(){
946 // Standard Hits to summable Digits function.
952 // return; // Using Hits in place of the larger sDigits.
953 fLoader->LoadHits("read");
954 fLoader->LoadSDigits("recreate");
955 AliRunLoader* rl = fLoader->GetRunLoader();
957 for (Int_t iEvent = 0; iEvent < rl->GetNumberOfEvents(); iEvent++) {
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 rl->GetEvent(iEvent);
962 if (!fLoader->TreeS()) fLoader->MakeTree("S");
965 HitsToSDigits(iEvent,0,-1," ",fOpt," ");
968 fLoader->UnloadHits();
969 fLoader->UnloadSDigits();
971 //______________________________________________________________________
972 void AliITS::Hits2PreDigits(){
973 // Standard Hits to summable Digits function.
979 AliHeader *header=fLoader->GetRunLoader()->GetHeader(); // Get event number from this file.
980 // Do the Hits to Digits operation. Use Standard input values.
981 // Event number from file, no background hit merging , use size from
982 // AliITSgeom class, option="All", input from this file only.
983 HitsToPreDigits(header->GetEvent(),0,-1," ",fOpt," ");
985 //______________________________________________________________________
986 AliDigitizer* AliITS::CreateDigitizer(AliRunDigitizer* manager) const
988 return new AliITSDigitizer(manager);
990 //______________________________________________________________________
991 void AliITS::SDigitsToDigits(Option_t *opt){
992 // Standard Summable digits to Digits function.
997 char name[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
999 if(!GetITSgeom()) return; // need transformations to do digitization.
1000 AliITSgeom *geom = GetITSgeom();
1002 const char *all = strstr(opt,"All");
1003 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1005 if( !det[0] && !det[1] && !det[2] ) all = "All";
1007 static Bool_t setDef=kTRUE;
1008 if (setDef) SetDefaultSimulation();
1011 AliITSsimulation *sim = 0;
1012 AliITSDetType *iDetType = 0;
1013 TTree *trees = fLoader->TreeS();
1014 if( !(trees && this->GetSDigits()) ){
1015 Error("SDigits2Digits","Error: No trees or SDigits. Returning.");
1018 sprintf( name, "%s", this->GetName() );
1019 TBranch *brchSDigits = trees->GetBranch( name );
1022 for(module=0;module<geom->GetIndexMax();module++){
1023 id = geom->GetModuleType(module);
1024 if (!all && !det[id]) continue;
1025 iDetType = DetType(id);
1026 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1028 Error("SDigit2Digits",
1029 "The simulation class was not instanciated!");
1032 sim->InitSimulationModule(module,gAlice->GetEvNumber());
1034 // add summable digits to module
1035 this->GetSDigits()->Clear();
1036 brchSDigits->GetEvent(module);
1037 sim->AddSDigitsToModule(GetSDigits(),0);
1039 // Digitise current module sum(SDigits)->Digits
1040 sim->FinishSDigitiseModule();
1042 // fills all branches - wasted disk space
1043 fLoader->TreeD()->Fill();
1044 this->ResetDigits();
1047 fLoader->TreeD()->GetEntries();
1049 fLoader->TreeD()->AutoSave();
1051 fLoader->TreeD()->Reset();
1054 //______________________________________________________________________
1055 void AliITS::Hits2Digits(){
1056 // Standard Hits to Digits function.
1062 fLoader->LoadHits("read");
1063 fLoader->LoadDigits("recreate");
1064 AliRunLoader* rl = fLoader->GetRunLoader();
1066 for (Int_t iEvent = 0; iEvent < rl->GetNumberOfEvents(); iEvent++) {
1067 // Do the Hits to Digits operation. Use Standard input values.
1068 // Event number from file, no background hit merging , use size from
1069 // AliITSgeom class, option="All", input from this file only.
1070 rl->GetEvent(iEvent);
1071 if (!fLoader->TreeD()) fLoader->MakeTree("D");
1074 HitsToDigits(iEvent,0,-1," ",fOpt," ");
1077 fLoader->UnloadHits();
1078 fLoader->UnloadDigits();
1080 //______________________________________________________________________
1081 void AliITS::HitsToSDigits(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. Dummy routine. Hits are ITS's Summable
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..
1101 // return; // using Hits instead of the larger sdigits.
1103 HitsToPreDigits(evNumber,bgrev,size,option,opt,filename);
1105 //______________________________________________________________________
1106 void AliITS::HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
1107 Option_t *option, Option_t *opt,Text_t *filename){
1108 // Keep galice.root for signal and name differently the file for
1109 // background when add! otherwise the track info for signal will be lost !
1110 // the condition below will disappear when the geom class will be
1111 // initialized for all versions - for the moment it is only for v5 !
1112 // 7 is the SDD beam test version.
1114 // Int_t evnt Event to be processed.
1115 // Int_t bgrev Background Hit tree number.
1116 // Int_t nmodules Not used.
1117 // Option_t *option String indicating if merging hits or not. To
1118 // merge hits set equal to "Add". Otherwise no
1119 // background hits are considered.
1120 // Test_t *filename File name containing the background hits..
1126 if(!GetITSgeom()) return; // need transformations to do digitization.
1127 AliITSgeom *geom = GetITSgeom();
1129 const char *all = strstr(opt,"All");
1130 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1132 static Bool_t setDef=kTRUE;
1133 if (setDef) SetDefaultSimulation();
1137 InitModules(size,nmodules);
1138 FillModules(evNumber,bgrev,nmodules,option,filename);
1140 AliITSsimulation *sim = 0;
1141 AliITSDetType *iDetType = 0;
1142 AliITSmodule *mod = 0;
1144 for(module=0;module<geom->GetIndexMax();module++){
1145 id = geom->GetModuleType(module);
1146 if (!all && !det[id]) continue;
1147 iDetType = DetType(id);
1148 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1150 Error("HitsToSDigits",
1151 "The simulation class was not instanciated!");
1154 mod = (AliITSmodule *)fITSmodules->At(module);
1155 sim->SDigitiseModule(mod,module,evNumber);
1156 // fills all branches - wasted disk space
1157 fLoader->TreeS()->Fill();
1163 fLoader->TreeS()->GetEntries();
1164 fLoader->TreeS()->AutoSave();
1165 fLoader->WriteSDigits("OVERWRITE");
1167 fLoader->TreeS()->Reset();
1169 //______________________________________________________________________
1170 void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
1171 Option_t *option, Option_t *opt,Text_t *filename){
1172 // Keep galice.root for signal and name differently the file for
1173 // background when add! otherwise the track info for signal will be lost !
1174 // the condition below will disappear when the geom class will be
1175 // initialized for all versions - for the moment it is only for v5 !
1176 // 7 is the SDD beam test version.
1178 // Int_t evnt Event to be processed.
1179 // Int_t bgrev Background Hit tree number.
1180 // Int_t nmodules Not used.
1181 // Option_t *option String indicating if merging hits or not. To
1182 // merge hits set equal to "Add". Otherwise no
1183 // background hits are considered.
1184 // Test_t *filename File name containing the background hits..
1190 if(!GetITSgeom()) return; // need transformations to do digitization.
1191 AliITSgeom *geom = GetITSgeom();
1193 const char *all = strstr(opt,"All");
1194 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1196 static Bool_t setDef=kTRUE;
1197 if (setDef) SetDefaultSimulation();
1201 InitModules(size,nmodules);
1202 FillModules(evNumber,bgrev,nmodules,option,filename);
1204 AliITSsimulation *sim = 0;
1205 AliITSDetType *iDetType = 0;
1206 AliITSmodule *mod = 0;
1208 for(module=0;module<geom->GetIndexMax();module++){
1209 id = geom->GetModuleType(module);
1210 if (!all && !det[id]) continue;
1211 iDetType = DetType(id);
1212 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1214 Error("HitsToDigits",
1215 "The simulation class was not instanciated!");
1218 mod = (AliITSmodule *)fITSmodules->At(module);
1219 sim->DigitiseModule(mod,module,evNumber);
1220 // fills all branches - wasted disk space
1221 fLoader->TreeD()->Fill();
1227 fLoader->TreeD()->GetEntries();
1228 fLoader->TreeD()->AutoSave();
1230 fLoader->TreeD()->Reset();
1232 //______________________________________________________________________
1233 void AliITS::ResetSDigits(){
1234 // Reset the Summable Digits array.
1240 if (fSDigits) fSDigits->Clear();
1243 //______________________________________________________________________
1244 void AliITS::ResetDigits(){
1245 // Reset number of digits and the digits array for the ITS detector.
1251 if (!fDtype) return;
1254 for (i=0;i<kNTYPES;i++ ) {
1255 if (fDtype->At(i)) ((TClonesArray*)fDtype->At(i))->Clear();
1256 if (fNdtype) fNdtype[i]=0;
1259 //______________________________________________________________________
1260 void AliITS::ResetDigits(Int_t i){
1261 // Reset number of digits and the digits array for this branch.
1267 if (fDtype->At(i)) ((TClonesArray*)fDtype->At(i))->Clear();
1268 if (fNdtype) fNdtype[i]=0;
1270 //______________________________________________________________________
1271 void AliITS::AddSumDigit(AliITSpListItem &sdig){
1272 // Adds the a module full of summable digits to the summable digits tree.
1274 // AliITSpListItem &sdig SDigit to be added to SDigits tree.
1280 TClonesArray &lsdig = *fSDigits;
1281 new(lsdig[fNSDigits++]) AliITSpListItem(sdig);
1283 //______________________________________________________________________
1284 void AliITS::AddRealDigit(Int_t id, Int_t *digits){
1285 // Add a real digit - as coming from data.
1287 // Int_t id Detector type number.
1288 // Int_t *digits Integer array containing the digits info. See
1295 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1296 new(ldigits[fNdtype[id]++]) AliITSdigit(digits);
1298 //______________________________________________________________________
1299 void AliITS::AddSimDigit(Int_t id, AliITSdigit *d){
1300 // Add a simulated digit.
1302 // Int_t id Detector type number.
1303 // AliITSdigit *d Digit to be added to the Digits Tree. See
1310 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1314 new(ldigits[fNdtype[id]++]) AliITSdigitSPD(*((AliITSdigitSPD*)d));
1317 new(ldigits[fNdtype[id]++]) AliITSdigitSDD(*((AliITSdigitSDD*)d));
1320 new(ldigits[fNdtype[id]++]) AliITSdigitSSD(*((AliITSdigitSSD*)d));
1324 //______________________________________________________________________
1325 void AliITS::AddSimDigit(Int_t id,Float_t phys,Int_t *digits,Int_t *tracks,
1326 Int_t *hits,Float_t *charges){
1327 // Add a simulated digit to the list.
1329 // Int_t id Detector type number.
1330 // Float_t phys Physics indicator. See AliITSdigits.h
1331 // Int_t *digits Integer array containing the digits info. See
1333 // Int_t *tracks Integer array [AliITSdigitS?D::GetNTracks()]
1334 // containing the track numbers that contributed to
1336 // Int_t *hits Integer array [AliITSdigitS?D::GetNTracks()]
1337 // containing the hit numbers, from AliITSmodule, that
1338 // contributed to this digit.
1339 // Float_t *charge Floating point array of the signals contributed
1340 // to this digit by each track.
1346 TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
1349 new(ldigits[fNdtype[id]++]) AliITSdigitSPD(digits,tracks,hits);
1352 new(ldigits[fNdtype[id]++]) AliITSdigitSDD(phys,digits,tracks,
1356 new(ldigits[fNdtype[id]++]) AliITSdigitSSD(digits,tracks,hits);
1360 //______________________________________________________________________
1361 void AliITS::MakeTreeC(Option_t *option){
1362 // Create a separate tree to store the clusters.
1364 // Option_t *option string which must contain "C" otherwise
1365 // no Cluster Tree is created.
1371 AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
1373 if (pITSLoader == 0x0) {
1374 Error("MakeTreeC","fLoader == 0x0 option=%s",option);
1377 if (pITSLoader->TreeC() == 0x0) pITSLoader->MakeTree("C");
1381 void AliITS::MakeBranchC()
1383 //Makes barnches in treeC
1384 AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
1385 if (pITSLoader == 0x0)
1387 Error("MakeTreeC","fLoader == 0x0");
1390 TTree * lTC = pITSLoader->TreeC();
1393 Error("MakeTreeC","Can not get TreeC from Loader");
1397 Int_t buffersize = 4000;
1398 char branchname[30];
1399 const char *det[3] = {"SPD","SDD","SSD"};
1403 // one branch for Clusters per type of detector
1405 for (i=0; i<kNTYPES ;i++)
1407 AliITSDetType *iDetType=DetType(i);
1408 iDetType->GetClassNames(digclass,clclass);
1410 if (fCtype == 0x0) fCtype = new TObjArray(fNDetTypes);
1411 if(!ClustersAddress(i))
1413 fCtype->AddAt(new TClonesArray(clclass,1000),i);
1415 if (kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
1416 else sprintf(branchname,"%sClusters%d",GetName(),i+1);
1419 if (lTC->GetBranch(branchname))
1421 Warning("MakeBranchC","Branch %s alread exists in TreeC",branchname);
1425 Info("MakeBranchC","Creating branch %s in TreeC",branchname);
1426 lTC->Branch(branchname,&((*fCtype)[i]), buffersize);
1428 } // end if fCtype && lTC
1432 //______________________________________________________________________
1433 void AliITS::GetTreeC(Int_t event){
1434 // Get the clusters tree for this event and set the branch address.
1436 // Int_t event Event number for the cluster tree.
1441 char branchname[30];
1442 const char *det[3] = {"SPD","SDD","SSD"};
1444 AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
1445 TTree * lTC = pITSLoader->TreeC();
1449 pITSLoader->CleanRawClusters();
1459 for (i=0; i<kNTYPES; i++) {
1460 AliITSDetType *iDetType=DetType(i);
1461 iDetType->GetClassNames(digclass,clclass);
1463 if (fCtype == 0x0) fCtype = new TObjArray(fNDetTypes);
1464 if(!fCtype->At(i)) fCtype->AddAt(new TClonesArray(clclass,1000),i);
1465 if(kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
1466 else sprintf(branchname,"%sClusters%d",GetName(),i+1);
1468 branch = lTC->GetBranch(branchname);
1469 if (branch) branch->SetAddress(&((*fCtype)[i]));
1473 Error("GetTreeC","cannot find Clusters Tree for event:%d",event);
1476 //______________________________________________________________________
1477 void AliITS::AddCluster(Int_t id, AliITSRawCluster *c){
1478 // Add a cluster to the list.
1480 // Int_t id Detector type number.
1481 // AliITSRawCluster *c Cluster class to be added to the tree of
1488 TClonesArray &lc = *((TClonesArray*)fCtype->At(id));
1492 new(lc[fNctype[id]++]) AliITSRawClusterSPD(*((AliITSRawClusterSPD*)c));
1495 new(lc[fNctype[id]++]) AliITSRawClusterSDD(*((AliITSRawClusterSDD*)c));
1498 new(lc[fNctype[id]++]) AliITSRawClusterSSD(*((AliITSRawClusterSSD*)c));
1502 //______________________________________________________________________
1503 void AliITS::ResetClusters(){
1504 // Reset number of clusters and the clusters array for ITS.
1511 for (i=0;i<kNTYPES;i++ ) ResetClusters(i);
1513 //______________________________________________________________________
1514 void AliITS::ResetClusters(Int_t i){
1515 // Reset number of clusters and the clusters array for this branch.
1517 // Int_t i Detector type number.
1523 if (fCtype->At(i)) ((TClonesArray*)fCtype->At(i))->Clear();
1524 if (fNctype) fNctype[i]=0;
1526 //______________________________________________________________________
1527 void AliITS::MakeBranchR(const char *file, Option_t *opt){
1528 // Creates Tree branches for the ITS Reconstructed points.
1530 // cont char *file File name where RecPoints branch is to be written
1531 // to. If blank it write the SDigits to the same
1532 // file in which the Hits were found.
1537 Int_t buffsz = 4000;
1538 char branchname[30];
1540 // only one branch for rec points for all detector types
1541 Bool_t oFast= (strstr(opt,"Fast")!=0);
1543 sprintf(branchname,"%sRecPointsF",GetName());
1545 sprintf(branchname,"%sRecPoints",GetName());
1549 if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
1550 if (fLoader->TreeR()) {
1551 if (fRecPoints == 0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
1552 MakeBranchInTree(fLoader->TreeR(),branchname,&fRecPoints,buffsz,file);
1555 //______________________________________________________________________
1556 void AliITS::SetTreeAddressR(TTree *treeR){
1557 // Set branch address for the Reconstructed points Trees.
1559 // TTree *treeR Tree containing the RecPoints.
1564 char branchname[30];
1567 if (fRecPoints == 0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
1569 sprintf(branchname,"%sRecPoints",GetName());
1570 branch = treeR->GetBranch(branchname);
1572 branch->SetAddress(&fRecPoints);
1575 sprintf(branchname,"%sRecPointsF",GetName());
1576 branch = treeR->GetBranch(branchname);
1578 branch->SetAddress(&fRecPoints);
1582 //______________________________________________________________________
1583 void AliITS::AddRecPoint(const AliITSRecPoint &r){
1584 // Add a reconstructed space point to the list
1586 // const AliITSRecPoint &r RecPoint class to be added to the tree
1587 // of reconstructed points TreeR.
1593 TClonesArray &lrecp = *fRecPoints;
1594 new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
1596 //______________________________________________________________________
1597 void AliITS::HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
1598 Option_t *opt0,Option_t *opt1,Text_t *flnm){
1599 // keep galice.root for signal and name differently the file for
1600 // background when add! otherwise the track info for signal will be lost !
1601 // the condition below will disappear when the geom class will be
1602 // initialized for all versions - for the moment it is only for v5 !
1604 // Int_t evnt Event to be processed.
1605 // Int_t bgrev Background Hit tree number.
1606 // Int_t size Size used by InitModules. See InitModules.
1607 // Option_t *opt0 Option passed to FillModules. See FillModules.
1608 // Option_t *opt1 String indicating if merging hits or not. To
1609 // merge hits set equal to "Add". Otherwise no
1610 // background hits are considered.
1611 // Test_t *flnm File name containing the background hits..
1617 if(!GetITSgeom()) return;
1618 AliITSLoader *pITSloader = (AliITSLoader*)fLoader;
1619 AliITSgeom *geom = GetITSgeom();
1621 const char *all = strstr(opt1,"All");
1622 const char *det[3] ={strstr(opt1,"SPD"),strstr(opt1,"SDD"),
1623 strstr(opt1,"SSD")};
1625 InitModules(size,nmodules);
1626 FillModules(evNumber,bgrev,nmodules,opt0,flnm);
1628 AliITSsimulation *sim = 0;
1629 AliITSDetType *iDetType = 0;
1630 AliITSmodule *mod = 0;
1633 //m.b. : this change is nothing but a nice way to make sure
1636 cout<<"HitsToFastRecPoints: N mod = "<<geom->GetIndexMax()<<endl;
1638 for(module=0;module<geom->GetIndexMax();module++)
1640 id = geom->GetModuleType(module);
1641 if (!all && !det[id]) continue;
1642 iDetType = DetType(id);
1643 sim = (AliITSsimulation*)iDetType->GetSimulationModel();
1646 Error("HitsToFastPoints","The simulation class was not instanciated!");
1649 mod = (AliITSmodule *)fITSmodules->At(module);
1650 sim->CreateFastRecPoints(mod,module,gRandom);
1651 cout<<module<<"\r";fflush(0);
1652 //gAlice->TreeR()->Fill();
1653 TTree *lTR = pITSloader->TreeR();
1654 TBranch *br=lTR->GetBranch("ITSRecPointsF");
1661 fLoader->WriteRecPoints("OVERWRITE");
1663 //______________________________________________________________________
1664 void AliITS::Digits2Reco(){
1665 // Find clusters and reconstruct space points.
1671 AliHeader *header=fLoader->GetRunLoader()->GetHeader();
1672 // to Digits to RecPoints for event in file, all digits in file, and
1673 // all ITS detectors.
1674 DigitsToRecPoints(header->GetEvent(),0,fOpt);
1676 //______________________________________________________________________
1677 void AliITS::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt){
1678 // cluster finding and reconstruction of space points
1679 // the condition below will disappear when the geom class will be
1680 // initialized for all versions - for the moment it is only for v5 !
1681 // 7 is the SDD beam test version
1683 // Int_t evNumber Event number to be processed.
1684 // Int_t lastentry Offset for module when not all of the modules
1686 // Option_t *opt String indicating which ITS sub-detectors should
1687 // be processed. If ="All" then all of the ITS
1688 // sub detectors are processed.
1694 if(!GetITSgeom()) return;
1695 AliITSgeom *geom = GetITSgeom();
1697 const char *all = strstr(opt,"All");
1698 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
1700 static Bool_t setRec=kTRUE;
1701 if (setRec) SetDefaultClusterFinders();
1704 AliITSLoader *pITSloader = (AliITSLoader*)fLoader;
1705 TTree *treeC=pITSloader->TreeC();
1706 AliITSClusterFinder *rec = 0;
1707 AliITSDetType *iDetType = 0;
1708 Int_t id,module,first=0;
1709 for(module=0;module<geom->GetIndexMax();module++){
1710 id = geom->GetModuleType(module);
1711 if (!all && !det[id]) continue;
1712 if(det[id]) first = geom->GetStartDet(id);
1713 iDetType = DetType(id);
1714 rec = (AliITSClusterFinder*)iDetType->GetReconstructionModel();
1715 TClonesArray *itsDigits = this->DigitsAddress(id);
1717 Error("DigitsToRecPoints",
1718 "The reconstruction class was not instanciated! event=%d",
1722 this->ResetDigits();
1723 TTree *lTD = pITSloader->TreeD();
1725 lTD->GetEvent(lastentry+module);
1727 lTD->GetEvent(lastentry+(module-first));
1729 Int_t ndigits = itsDigits->GetEntriesFast();
1730 if (ndigits) rec->FindRawClusters(module);
1731 pITSloader->TreeR()->Fill();
1738 pITSloader->WriteRecPoints("OVERWRITE");
1739 pITSloader->WriteRawClusters("OVERWRITE");
1741 //______________________________________________________________________
1742 void AliITS::ResetRecPoints(){
1743 // Reset number of rec points and the rec points array.
1749 if (fRecPoints) fRecPoints->Clear();
1752 //______________________________________________________________________
1753 AliLoader* AliITS::MakeLoader(const char* topfoldername)
1755 //builds ITSgetter (AliLoader type)
1756 //if detector wants to use castomized getter, it must overload this method
1758 Info("MakeLoader","Creating AliITSLoader. Top folder is %s.",topfoldername);
1759 fLoader = new AliITSLoader(GetName(),topfoldername);