]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSDetTypeRec.h
merging RecPoints and ClustersV2. All ClusterFinders produce AliITSRecPoints objects...
[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 #include "AliITSLoader.h"
19 #include "AliRunLoader.h"
20
21 class AliITSsegmentation;
22 class AliITSCalibration;
23 class AliITSClusterFinder;
24 class AliITSRawCluster;
25 class AliITSRecPoint;
26 class AliRawReader;
27 class AliITSgeom;
28
29
30 class AliITSDetTypeRec : public TObject {
31   public:
32     AliITSDetTypeRec(); // Default constructor
33     AliITSDetTypeRec(const AliITSDetTypeRec& rec);
34     AliITSDetTypeRec& operator=(const AliITSDetTypeRec &source);
35
36     virtual ~AliITSDetTypeRec(); // Proper Destructor
37     AliITSgeom* GetITSgeom()const{return fGeom;}
38     void SetITSgeom(AliITSgeom *geom) {fGeom=geom;}
39
40     virtual void SetLoader(AliITSLoader* loader) {fLoader=loader;}
41     AliITSLoader* GetLoader() const {return fLoader;}
42     virtual void SetDefaults();
43     virtual void SetDefaultClusterFinders();
44     virtual void SetDefaultClusterFindersV2(Bool_t rawdata=kFALSE);
45     virtual void MakeBranch(Option_t *opt);
46     virtual void SetTreeAddress();
47     virtual void SetTreeAddressD(TTree* treeD);
48
49     virtual void SetSegmentationModel(Int_t dettype, AliITSsegmentation *seg);
50     virtual void SetCalibrationModel(Int_t iMod, AliITSCalibration *cal);
51     virtual void SetReconstructionModel(Int_t dettype, AliITSClusterFinder *rec);
52     virtual Bool_t GetCalibration();
53     virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype);
54     virtual AliITSCalibration* GetCalibrationModel(Int_t iMod);
55     virtual AliITSClusterFinder* GetReconstructionModel(Int_t dettype);
56
57     virtual void SetDigitClassName(Int_t i,Char_t *digit) 
58       {fDigClassName[i]=digit;}
59     virtual void SetClusterClassName(Int_t i,Char_t *cluster)
60       {fClusterClassName[i]=cluster;}
61     virtual void SetRecPointClassName(Int_t i,Char_t *recpoint) 
62       {fRecPointClassName[i]=recpoint;}
63     
64     Char_t* GetDigitClassName(Int_t i) const {return fDigClassName[i];}
65     Char_t* GetClusterClassName(Int_t i) const {return fClusterClassName[i];}
66     Char_t* GetRecPointClassName(Int_t i) const {return fRecPointClassName[i];}
67     
68     TObjArray* GetDigits() const {return fDigits;} 
69     Int_t *Ndtype() {return fNdtype;}
70     TClonesArray *DigitsAddress(Int_t id) const {return ((TClonesArray*)(*fDigits)[id]);}
71     virtual void SelectVertexer(TString sel=" "){fSelectedVertexer = sel;}
72     //
73     virtual void MakeTreeC();
74     virtual void GetTreeC(Int_t event);
75     virtual void AddCluster(Int_t branch, AliITSRawCluster *c);
76     virtual void ResetClusters(); 
77     virtual void ResetClusters(Int_t branch);
78     virtual void MakeBranchC();
79     TBranch* MakeBranchInTree(TTree *tree, const char* name, const char *classname, void* address,Int_t size, Int_t splitlevel, const char */*file*/);
80
81     TObjArray    *Ctype()  {return fCtype;}
82     Int_t        *Nctype() {return fNctype;}
83     TClonesArray *ClustersAddress(Int_t id) const {return ((TClonesArray*)(*fCtype)[id]);}
84     virtual void ResetDigits();
85     virtual void ResetDigits(Int_t branch);
86
87     void MakeBranchR(const char *file, Option_t *opt=" ");
88     void SetTreeAddressR(TTree *treeR);
89     void AddRecPoint(const AliITSRecPoint &p);
90     void ResetRecPoints(){if(fRecPoints) fRecPoints->Clear();fNRecPoints = 0;};
91     // Return pointer to rec points 
92     TClonesArray  *RecPoints()   {return fRecPoints;}
93     void MakeBranchRF(const char *file){MakeBranchR(file,"Fast");}
94     //    void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
95     //             Option_t *add, Option_t *det, const char *filename);
96     void Digits2Reco(){
97         DigitsToRecPoints(fLoader->GetRunLoader()->GetEventNumber(),0,"All");}
98     void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det,Bool_t v2=kFALSE);
99     void DigitsToRecPoints(AliRawReader* rawReader);
100
101     virtual void SetRunNumber(Int_t rn=0){fRunNumber = rn;}
102     virtual Int_t GetRunNumber() const {return fRunNumber;}
103
104   private:
105
106     static const Int_t fgkNdettypes;          // number of det. types
107     static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default
108     static const Int_t fgkDefaultNModulesSDD; // Total numbers of SDD modules by default
109     static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules by default
110     Int_t fNMod[3];                           // numbers of modules from different types
111
112     AliITSgeom   *fGeom;          // ITS geometry
113     TObjArray    *fReconstruction;//! [NDet]
114     TObjArray    *fSegmentation;  //! [NDet]
115     TObjArray    *fCalibration;   //! [NMod]
116     TObjArray    *fPreProcess;    //! [] e.g. Find Calibration values
117     TObjArray    *fPostProcess;   //! [] e.g. find primary vertex
118     TObjArray    *fDigits;        //! [NMod][NDigits]
119     Int_t        *fNdtype;        //! detector types  
120     Char_t*       fClusterClassName[3]; //! String with Cluster class name
121     Char_t*       fDigClassName[3];     //! String with digit class name.
122     Char_t*       fRecPointClassName[3];//! String with RecPoint class name
123
124     TObjArray    *fCtype;      //! List of clusters
125     Int_t        *fNctype;     //[fNDetTypes] Num. of clust. per type of det.
126
127     TClonesArray *fRecPoints;  //! List of reconstructed points
128     Int_t         fNRecPoints; // Number of rec points
129
130     TString fSelectedVertexer; // Vertexer selected in CreateVertexer
131     AliITSLoader* fLoader;     // ITS loader
132     Int_t         fRunNumber;    //! run number (to access DB)
133
134     ClassDef(AliITSDetTypeRec,4) // ITS Reconstruction structure
135 };
136
137 #endif