]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSDetTypeRec.h
HLT mode retrieved from the OCDB and used to set SDD raw data format in simulation...
[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 #include "AliITSDDLModuleMapSDD.h"
18 #include "AliITSresponseSDD.h"
19 #include "AliITSgeom.h"
20 class TTree;
21 class TBranch;
22
23 //#include "AliITSLoader.h"
24 //#include "AliRunLoader.h"
25
26 class AliITSsegmentation;
27 class AliITSCalibration;
28 class AliITSCalibrationSSD;
29 class AliITSresponseSDD;
30 class AliITSClusterFinder;
31 class AliITSRawCluster;
32 class AliITSRecPoint;
33 class AliRawReader;
34 class AliITSGainSSDv2;
35 class AliITSBadChannelsSSDv2;
36 class AliITSNoiseSSDv2;
37
38 class AliITSDetTypeRec : public TObject {
39   public:
40     AliITSDetTypeRec(); // Default constructor
41  
42     virtual ~AliITSDetTypeRec(); // Proper Destructor
43
44     virtual AliITSgeom* GetITSgeom() const { return fITSgeom; }
45     virtual void SetITSgeom(AliITSgeom *geom) { fITSgeom = geom; }
46     virtual void SetDefaults();
47     virtual void SetDefaultClusterFinders();
48     virtual void SetDefaultClusterFindersV2(Bool_t rawdata=kFALSE);
49     virtual void MakeBranch(TTree *tree,Option_t *opt);
50     virtual void SetTreeAddressD(TTree* treeD);
51
52     virtual void SetSegmentationModel(Int_t dettype, AliITSsegmentation *seg);
53     virtual void SetCalibrationModel(Int_t iMod, AliITSCalibration *cal);
54     virtual void SetSPDDeadModel(Int_t iMod, AliITSCalibration *cal);
55     virtual void SetReconstructionModel(Int_t dettype, AliITSClusterFinder *rec);
56     virtual Bool_t GetCalibration();
57     virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype);
58     virtual AliITSCalibration* GetCalibrationModel(Int_t iMod);
59     virtual AliITSCalibration* GetSPDDeadModel(Int_t iMod);
60     virtual AliITSClusterFinder* GetReconstructionModel(Int_t dettype);
61     virtual AliITSDDLModuleMapSDD* GetDDLModuleMapSDD() const { return fDDLMapSDD;}
62     virtual AliITSresponseSDD* GetResponseSDD() const { return fRespSDD;}
63     virtual Bool_t IsHLTmodeC() const {return fIsHLTmodeC;}
64
65     virtual void SetDigitClassName(Int_t i,Char_t *digit) 
66       {fDigClassName[i]=digit;}
67     virtual void SetClusterClassName(Int_t i,Char_t *cluster)
68       {fClusterClassName[i]=cluster;}
69     virtual void SetRecPointClassName(Int_t i,Char_t *recpoint) 
70       {fRecPointClassName[i]=recpoint;}
71     
72     Char_t* GetDigitClassName(Int_t i) const {return fDigClassName[i];}
73     Char_t* GetClusterClassName(Int_t i) const {return fClusterClassName[i];}
74     Char_t* GetRecPointClassName(Int_t i) const {return fRecPointClassName[i];}
75     
76     TObjArray* GetDigits() const {return fDigits;} 
77     Int_t *Ndtype() {return fNdtype;}
78     TClonesArray *DigitsAddress(Int_t id) const {return ((TClonesArray*)(*fDigits)[id]);}
79     virtual void SelectVertexer(TString sel=" "){fSelectedVertexer = sel;}
80     //
81     virtual void AddCluster(Int_t branch, AliITSRawCluster *c);
82     virtual void ResetClusters(); 
83     virtual void ResetClusters(Int_t branch);
84     TBranch* MakeBranchInTree(TTree *tree, const char* name, const char *classname, void* address,Int_t size, Int_t splitlevel);
85
86     TObjArray    *Ctype()  {return fCtype;}
87     Int_t        *Nctype() {return fNctype;}
88     TClonesArray *ClustersAddress(Int_t id) const {return ((TClonesArray*)(*fCtype)[id]);}
89     virtual void ResetDigits();
90     virtual void ResetDigits(Int_t branch);
91
92     void MakeBranchR(TTree *treeR,Option_t *opt=" ");
93     void SetTreeAddressR(TTree *treeR);
94     void AddRecPoint(const AliITSRecPoint &p);
95     void ResetRecPoints(){if(fRecPoints) fRecPoints->Clear();fNRecPoints = 0;};
96     // Return pointer to rec points 
97     TClonesArray  *RecPoints()   {return fRecPoints;}
98     void MakeBranchRF(TTree *treeR){MakeBranchR(treeR,"Fast");}
99     void DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastEntry,Option_t *det,Bool_t v2=kFALSE);
100     void DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR,Option_t *det="All");
101
102   private:
103     // private methods
104     AliITSDetTypeRec(const AliITSDetTypeRec& rec);
105     AliITSDetTypeRec& operator=(const AliITSDetTypeRec &source);
106  
107     //conversion of the old SSD calibration objects tothe new ones
108     void ReadOldSSDNoise(TObjArray *array, 
109                          AliITSNoiseSSDv2 *noiseSSD);
110     void ReadOldSSDBadChannels(TObjArray *array, 
111                                AliITSBadChannelsSSDv2 *badChannelsSSD);
112     void ReadOldSSDGain(TObjArray *array, 
113                         AliITSGainSSDv2 *gainSSD);
114
115     //    virtual void SetLoader(AliITSLoader* loader) {fLoader=loader;}
116     static const Int_t fgkNdettypes;          // number of det. types
117     static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default
118     static const Int_t fgkDefaultNModulesSDD; // Total numbers of SDD modules by default
119     static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules by default
120     Int_t *fNMod;     // numbers of modules from different types
121
122     AliITSgeom   *fITSgeom;       //! ITS geometry
123
124     TObjArray    *fReconstruction;//! [NDet]
125     TObjArray    *fSegmentation;  //! [NDet]
126     TObjArray    *fCalibration;   //! [NMod]
127     AliITSCalibrationSSD* fSSDCalibration;  //! SSD calibration object
128     TObjArray    *fSPDDead;       //! [fgkDefaultNModulesSPD]
129     TObjArray    *fPreProcess;    //! [] e.g. Find Calibration values
130     TObjArray    *fPostProcess;   //! [] e.g. find primary vertex
131     TObjArray    *fDigits;        //! [NMod][NDigits]
132     AliITSDDLModuleMapSDD *fDDLMapSDD; //! mapping DDL/module -> SDD module number
133     AliITSresponseSDD *fRespSDD;  //! SDD response parameters 
134     Bool_t        fIsHLTmodeC;    //! flag for HLT mode C status (used by SDD)
135     Int_t        *fNdtype;        //! detector types  
136     Char_t*       fClusterClassName[3]; //! String with Cluster class name
137     Char_t*       fDigClassName[3];     //! String with digit class name.
138     Char_t*       fRecPointClassName[3];//! String with RecPoint class name
139
140     TObjArray    *fCtype;      //! List of clusters
141     Int_t        *fNctype;     //[fNDetTypes] Num. of clust. per type of det.
142
143     TClonesArray *fRecPoints;  //! List of reconstructed points
144     Int_t         fNRecPoints; // Number of rec points
145
146     TString fSelectedVertexer; // Vertexer selected in CreateVertexer
147     Bool_t fFirstcall;         //! flag
148
149     ClassDef(AliITSDetTypeRec,11) // ITS Reconstruction structure
150 };
151
152 #endif