]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpSegmentation.h
Need to include virtual class
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSegmentation.h
1 #ifndef ALI_MP_SEGMENTATION_H
2 #define ALI_MP_SEGMENTATION_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 // $Id$ 
8 // $MpId: AliMpSegmentation.h,v 1.7 2006/05/24 13:58:16 ivana Exp $ 
9
10 /// \ingroup management
11 /// \class AliMpSegmentation
12 /// \brief Singleton container class for mapping segmentations
13 ///
14 /// It provides access to mapping segmentations based on the
15 /// AliMpVSegmentation interface and to segmentations underlying
16 /// detectors (sector, slat, trigger).                                  \n
17 /// Mapping segmentations for all detection elements
18 /// are created at the first call to AliMpSegmentation::Instance().
19 /// The class is a singleton, it has all constructors
20 /// private, except for the special constructor for Root I/O.
21 ///
22 /// \author Ivana Hrivnacova, IPN Orsay; Laurent Aphecetche, SUBATECH
23
24 #ifndef ROOT_TObject
25 #  include <TObject.h>
26 #endif
27
28 #ifndef ALI_MP_STRING_OBJ_MAP_H
29 #  include "AliMpStringObjMap.h"
30 #endif
31
32 #ifndef ALI_MP_EX_MAP_H
33 #  include "AliMpExMap.h"
34 #endif
35
36 #ifndef ALI_MP_CATHOD_TYPE_H
37 #  include "AliMpCathodType.h"
38 #endif
39
40 #ifndef ALI_MP_V_SEGMENTATION_H
41 #  include "AliMpVSegmentation.h"
42 #endif
43
44 class AliMpDEStore;
45 class AliMpSegmentation;
46 class AliMpSlatMotifMap;
47 class AliMpDataStreams;
48 class AliMpSector;
49 class AliMpSlat;
50 class AliMpTrigger;
51 class TRootIOCtor;
52
53 class AliMpSegmentation : public  TObject {
54
55   public:
56     AliMpSegmentation(TRootIOCtor* /*ioCtor*/);
57     virtual ~AliMpSegmentation();
58     
59     // static methods
60     static AliMpSegmentation* Instance(Bool_t warn = true);
61     static AliMpSegmentation* ReadData(const AliMpDataStreams& dataStreams, 
62                                        Bool_t warn = true);
63
64     // methods
65     
66     //
67     // Access to segmentations
68     //
69     
70     const AliMpVSegmentation* GetMpSegmentation(
71                                  Int_t detElemId, AliMp::CathodType cath, 
72                                  Bool_t warn = true) const;
73
74     const AliMpVSegmentation* GetMpSegmentationByElectronics(
75                                  Int_t detElemId, Int_t elCardID, 
76                                  Bool_t warn = true) const;
77     //
78     // Access to sectors, slats, triggers
79     //
80
81     const AliMpSector*  GetSector(const AliMpVSegmentation* kSegmentation, 
82                                   Bool_t warn = true) const;
83     const AliMpSector*  GetSector(Int_t detElemId, AliMp::CathodType cath, 
84                                   Bool_t warn = true) const;
85     const AliMpSector*  GetSectorByElectronics(Int_t detElemId, Int_t elCardID, 
86                                   Bool_t warn = true) const;
87   
88     const AliMpSlat*    GetSlat(const AliMpVSegmentation* kSegmentation, 
89                                   Bool_t warn = true) const;
90     const AliMpSlat*    GetSlat(Int_t detElemId, AliMp::CathodType cath, 
91                                   Bool_t warn = true) const;
92     const AliMpSlat*    GetSlatByElectronics(Int_t detElemId, Int_t elCardID, 
93                                   Bool_t warn = true) const;
94   
95     const AliMpTrigger* GetTrigger(const AliMpVSegmentation* kSegmentation, 
96                                   Bool_t warn = true) const;
97     const AliMpTrigger* GetTrigger(Int_t detElemId, AliMp::CathodType cath, 
98                                   Bool_t warn = true) const;
99     const AliMpTrigger* GetTriggerByElectronics(Int_t detElemId, Int_t elCardID, 
100                                   Bool_t warn = true) const;
101   
102   private:
103     AliMpSegmentation(const AliMpDataStreams& dataStreams);
104     /// Not implemented
105     AliMpSegmentation(const AliMpSegmentation& rhs);
106     /// Not implemented
107     AliMpSegmentation& operator=(const AliMpSegmentation& rhs);
108
109     AliMpVSegmentation* CreateMpSegmentation(
110                               Int_t detElemId, AliMp::CathodType cath);
111                               
112
113     AliMpExMap* FillElCardsMap(Int_t detElemId);
114
115     // static data members
116     static AliMpSegmentation* fgInstance; ///< Singleton instance
117
118     // data members
119     const AliMpDataStreams&  fDataStreams;  //!< Data streams
120     AliMpDEStore*      fDetElements;    ///< Detection element store
121     AliMpStringObjMap  fMpSegmentations;///< Map of mapping segmentations to DE seg names
122     AliMpExMap         fElCardsMap;     ///< Map of el. cards IDs to segmentations
123     AliMpSlatMotifMap* fSlatMotifMap;   ///< Map of motif, motifTypes to avoid duplications and allow proper deletion
124     
125   ClassDef(AliMpSegmentation,3)  // The factory for building mapping segmentations
126 };
127
128 #endif //ALI_MP_SEGMENTATION_H
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143