]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegFactory.h
Separating writing and reading of raw data (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONSegFactory.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 /* $Id$ */
5
6 /// \ingroup sim
7 /// \class AliMUONSegFactory
8 /// \brief New factory for building segmentations at all levels
9 //
10 /// The factory is associated with a AliMUONGeometryTransformer
11 /// object, used in geometry (module) segmentations for performing
12 /// trasformation between the global reference frame and the local DE one.
13 /// This transformer object can be passed by pointer or can be created 
14 /// by a factory and filled from the transformations data file.               
15 /// The transformer need not to be set if factory is used only
16 /// to create mapping segmentation:                                           \n
17 ///
18 /// Construction:
19 /// - AliMUONSegFactory  factory(kTransformer);
20 /// - AliMUONSegFactory  factory("transform.dat");
21 /// - AliMUONSegFactory  factory(0);                                          \n
22 ///
23 /// All created objects are registered in the AliMUONSegmentation
24 /// object, which can be accessed via GetSegmentation() method.
25 /// A repetetive call to the same Create.. method does not create
26 /// a new object but returns the existing one.                                \n                
27 /// 
28 /// Factory does not delete the created segmentation objects.
29 /// They have to be deleted in the client code via the AliMUONSegmentation
30 /// container:                                                                \n
31 /// delete factory.GetSegmentation();
32 ///
33 /// Authors: Ivana Hrivnacova, IPN Orsay
34
35 #ifndef ALI_MUON_SEG_FACTORY_H
36 #define ALI_MUON_SEG_FACTORY_H
37
38 #include "AliMpSegFactory.h"
39 #include "AliMpStringObjMap.h"
40
41 #include <TObject.h>
42
43 class AliMpVSegmentation;
44 class AliMUONVGeometryDESegmentation;
45 class AliMUONGeometrySegmentation;
46 class AliMUONSegmentation;
47 class AliMUONGeometryTransformer;
48
49 class AliMUONSegFactory : public  TObject {
50
51   public:
52     AliMUONSegFactory(const AliMUONGeometryTransformer* geometry);
53     AliMUONSegFactory(const TString& transformsFileName);
54     AliMUONSegFactory();
55     virtual ~AliMUONSegFactory();
56     
57     //
58     // Build methods
59     //
60     
61     AliMpVSegmentation*              
62       CreateMpSegmentation(Int_t detElemId, Int_t cath);
63               // Create mapping segmentation only 
64
65     AliMUONVGeometryDESegmentation*  
66       CreateDESegmentation(Int_t detElemId, Int_t cath);
67               // Create DE segmentation, operating in local reference frame
68     
69     AliMUONGeometrySegmentation*     
70       CreateModuleSegmentation(Int_t moduleId, Int_t cath); 
71               // Create module segmentation, operating in global reference frame
72
73     AliMUONSegmentation*  
74       CreateSegmentation(const TString& option = "default"); 
75               // Create segmentations on all levels and return their container.
76     
77     //
78     // Get method
79     //
80     AliMUONSegmentation* GetSegmentation() const;
81               // Returned segmentation contains all the lower level segmentations
82               // created with the factory
83
84   protected:
85     AliMUONSegFactory(const AliMUONSegFactory& rhs);
86     AliMUONSegFactory& operator=(const AliMUONSegFactory& rhs);
87
88   private:
89     // methods
90     Bool_t IsGeometryDefined(Int_t ichamber);
91     AliMUONSegmentation* Segmentation();
92     
93     // Old segmentations (not based on mapping)
94     void BuildStation3();
95     void BuildStation4();
96     void BuildStation5();
97     void BuildStation6();
98
99     // data members     
100     AliMpSegFactory       fMpSegFactory;   // Mapping segmentation factory
101     AliMpStringObjMap     fDESegmentations;// Map of DE segmentations to DE names
102     AliMUONSegmentation*  fSegmentation;   // Segmentation container 
103     const AliMUONGeometryTransformer* fkTransformer; // Geometry transformer
104
105   ClassDef(AliMUONSegFactory,0)  // MUON Factory for Chambers and Segmentation
106 };
107
108 inline AliMUONSegmentation* AliMUONSegFactory::GetSegmentation() const
109 { return fSegmentation; }
110
111 #endif //ALI_MUON_SEG_FACTORY_H
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126