]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSDetTypeRec.h
Fix of parsing bug related to the reading of the calib header. Added consistency...
[u/mrichter/AliRoot.git] / ITS / AliITSDetTypeRec.h
1 #ifndef ALIITSDETTYPEREC_H
2 #define ALIITSDETTYPEREC_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /*
7 $Id$ 
8 */
9
10 ////////////////////////////////////////////////////////////////////////
11 // This class contains all of the "external" information needed to do //
12 // detector specific reconstruction for the ITS.                      //
13 ////////////////////////////////////////////////////////////////////////
14 #include <TObject.h>
15 #include <TObjArray.h>
16 #include <TClonesArray.h>
17
18 class TTree;
19 class TBranch;
20
21 //#include "AliITSLoader.h"
22 //#include "AliRunLoader.h"
23
24 class AliITSsegmentation;
25 class AliITSCalibration;
26 class AliITSClusterFinder;
27 class AliITSRawCluster;
28 class AliITSRecPoint;
29 class AliRawReader;
30 class AliITSgeom;
31
32
33 class AliITSDetTypeRec : public TObject {
34   public:
35     AliITSDetTypeRec(); // Default constructor
36  
37     virtual ~AliITSDetTypeRec(); // Proper Destructor
38
39     virtual AliITSgeom* GetITSgeom() const { return fITSgeom; }
40     virtual void SetITSgeom(AliITSgeom *geom) { fITSgeom = geom; }
41     virtual void SetDefaults();
42     virtual void SetDefaultClusterFinders();
43     virtual void SetDefaultClusterFindersV2(Bool_t rawdata=kFALSE);
44     virtual void MakeBranch(TTree *tree,Option_t *opt);
45     virtual void SetTreeAddressD(TTree* treeD);
46
47     virtual void SetSegmentationModel(Int_t dettype, AliITSsegmentation *seg);
48     virtual void SetCalibrationModel(Int_t iMod, AliITSCalibration *cal);
49     virtual void SetReconstructionModel(Int_t dettype, AliITSClusterFinder *rec);
50     virtual Bool_t GetCalibration();
51     virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype);
52     virtual AliITSCalibration* GetCalibrationModel(Int_t iMod);
53     virtual AliITSClusterFinder* GetReconstructionModel(Int_t dettype);
54
55     virtual void SetDigitClassName(Int_t i,Char_t *digit) 
56       {fDigClassName[i]=digit;}
57     virtual void SetClusterClassName(Int_t i,Char_t *cluster)
58       {fClusterClassName[i]=cluster;}
59     virtual void SetRecPointClassName(Int_t i,Char_t *recpoint) 
60       {fRecPointClassName[i]=recpoint;}
61     
62     Char_t* GetDigitClassName(Int_t i) const {return fDigClassName[i];}
63     Char_t* GetClusterClassName(Int_t i) const {return fClusterClassName[i];}
64     Char_t* GetRecPointClassName(Int_t i) const {return fRecPointClassName[i];}
65     
66     TObjArray* GetDigits() const {return fDigits;} 
67     Int_t *Ndtype() {return fNdtype;}
68     TClonesArray *DigitsAddress(Int_t id) const {return ((TClonesArray*)(*fDigits)[id]);}
69     virtual void SelectVertexer(TString sel=" "){fSelectedVertexer = sel;}
70     //
71     virtual void AddCluster(Int_t branch, AliITSRawCluster *c);
72     virtual void ResetClusters(); 
73     virtual void ResetClusters(Int_t branch);
74     TBranch* MakeBranchInTree(TTree *tree, const char* name, const char *classname, void* address,Int_t size, Int_t splitlevel);
75
76     TObjArray    *Ctype()  {return fCtype;}
77     Int_t        *Nctype() {return fNctype;}
78     TClonesArray *ClustersAddress(Int_t id) const {return ((TClonesArray*)(*fCtype)[id]);}
79     virtual void ResetDigits();
80     virtual void ResetDigits(Int_t branch);
81
82     void MakeBranchR(TTree *treeR,Option_t *opt=" ");
83     void SetTreeAddressR(TTree *treeR);
84     void AddRecPoint(const AliITSRecPoint &p);
85     void ResetRecPoints(){if(fRecPoints) fRecPoints->Clear();fNRecPoints = 0;};
86     // Return pointer to rec points 
87     TClonesArray  *RecPoints()   {return fRecPoints;}
88     void MakeBranchRF(TTree *treeR){MakeBranchR(treeR,"Fast");}
89     void DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastEntry,Option_t *det,Bool_t v2=kFALSE);
90     void DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR,Option_t *det="All");
91
92   private:
93     // private methods
94     AliITSDetTypeRec(const AliITSDetTypeRec& rec);
95     AliITSDetTypeRec& operator=(const AliITSDetTypeRec &source);
96  
97     //    virtual void SetLoader(AliITSLoader* loader) {fLoader=loader;}
98     static const Int_t fgkNdettypes;          // number of det. types
99     static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default
100     static const Int_t fgkDefaultNModulesSDD; // Total numbers of SDD modules by default
101     static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules by default
102     Int_t *fNMod;     // numbers of modules from different types
103
104     AliITSgeom   *fITSgeom;       //! ITS geometry
105
106     TObjArray    *fReconstruction;//! [NDet]
107     TObjArray    *fSegmentation;  //! [NDet]
108     TObjArray    *fCalibration;   //! [NMod]
109     TObjArray    *fPreProcess;    //! [] e.g. Find Calibration values
110     TObjArray    *fPostProcess;   //! [] e.g. find primary vertex
111     TObjArray    *fDigits;        //! [NMod][NDigits]
112     Int_t        *fNdtype;        //! detector types  
113     Char_t*       fClusterClassName[3]; //! String with Cluster class name
114     Char_t*       fDigClassName[3];     //! String with digit class name.
115     Char_t*       fRecPointClassName[3];//! String with RecPoint class name
116
117     TObjArray    *fCtype;      //! List of clusters
118     Int_t        *fNctype;     //[fNDetTypes] Num. of clust. per type of det.
119
120     TClonesArray *fRecPoints;  //! List of reconstructed points
121     Int_t         fNRecPoints; // Number of rec points
122
123     TString fSelectedVertexer; // Vertexer selected in CreateVertexer
124     Bool_t fFirstcall;         //! flag
125
126     ClassDef(AliITSDetTypeRec,7) // ITS Reconstruction structure
127 };
128
129 #endif