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