1 #ifndef ALI_MP_SEGMENTATION_H
2 #define ALI_MP_SEGMENTATION_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
8 // $MpId: AliMpSegmentation.h,v 1.7 2006/05/24 13:58:16 ivana Exp $
10 /// \ingroup management
11 /// \class AliMpSegmentation
12 /// \brief Singleton container class for mapping segmentations
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.
22 /// \author Ivana Hrivnacova, IPN Orsay; Laurent Aphecetche, SUBATECH
28 #ifndef ALI_MP_STRING_OBJ_MAP_H
29 # include "AliMpStringObjMap.h"
32 #ifndef ALI_MP_EX_MAP_H
33 # include "AliMpExMap.h"
36 #ifndef ALI_MP_CATHOD_TYPE_H
37 # include "AliMpCathodType.h"
41 class AliMpSegmentation;
42 class AliMpVSegmentation;
43 class AliMpSlatMotifMap;
44 class AliMpDataStreams;
52 class AliMpSegmentation : public TObject {
55 AliMpSegmentation(TRootIOCtor* ioCtor);
56 virtual ~AliMpSegmentation();
59 static AliMpSegmentation* Instance(Bool_t warn = true);
60 static AliMpSegmentation* ReadData(const AliMpDataStreams& dataStreams,
66 // Access to segmentations
69 const AliMpVSegmentation* GetMpSegmentation(
70 Int_t detElemId, AliMp::CathodType cath,
71 Bool_t warn = true) const;
73 const AliMpVSegmentation* GetMpSegmentationByElectronics(
74 Int_t detElemId, Int_t elCardID,
75 Bool_t warn = true) const;
77 // Access to sectors, slats, triggers
80 const AliMpSector* GetSector(const AliMpVSegmentation* kSegmentation,
81 Bool_t warn = true) const;
82 const AliMpSector* GetSector(Int_t detElemId, AliMp::CathodType cath,
83 Bool_t warn = true) const;
84 const AliMpSector* GetSectorByElectronics(Int_t detElemId, Int_t elCardID,
85 Bool_t warn = true) const;
87 const AliMpSlat* GetSlat(const AliMpVSegmentation* kSegmentation,
88 Bool_t warn = true) const;
89 const AliMpSlat* GetSlat(Int_t detElemId, AliMp::CathodType cath,
90 Bool_t warn = true) const;
91 const AliMpSlat* GetSlatByElectronics(Int_t detElemId, Int_t elCardID,
92 Bool_t warn = true) const;
94 const AliMpTrigger* GetTrigger(const AliMpVSegmentation* kSegmentation,
95 Bool_t warn = true) const;
96 const AliMpTrigger* GetTrigger(Int_t detElemId, AliMp::CathodType cath,
97 Bool_t warn = true) const;
98 const AliMpTrigger* GetTriggerByElectronics(Int_t detElemId, Int_t elCardID,
99 Bool_t warn = true) const;
102 AliMpSegmentation(const AliMpDataStreams& dataStreams);
104 AliMpSegmentation(const AliMpSegmentation& rhs);
106 AliMpSegmentation& operator=(const AliMpSegmentation& rhs);
108 AliMpVSegmentation* CreateMpSegmentation(
109 const AliMpDataStreams& dataStreams,
110 Int_t detElemId, AliMp::CathodType cath);
113 AliMpExMap* FillElCardsMap(Int_t detElemId);
115 // static data members
116 static AliMpSegmentation* fgInstance; ///< Singleton instance
119 AliMpDEStore* fDetElements; ///< Detection element store
120 AliMpStringObjMap fMpSegmentations;///< Map of mapping segmentations to DE seg names
121 AliMpExMap fElCardsMap; ///< Map of el. cards IDs to segmentations
122 AliMpSlatMotifMap* fSlatMotifMap; ///< Map of motif, motifTypes to avoid duplications and allow proper deletion
124 ClassDef(AliMpSegmentation,3) // The factory for building mapping segmentations
127 #endif //ALI_MP_SEGMENTATION_H