]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegFactory.h
Make this class non static, correct a bug (float instead of double) in ReadPCB, and...
[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 base
7 /// \class AliMUONSegFactory
8 /// \brief New factory for building segmentations at all levels
9 ///
10 /// The factory is associated with the 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("volpath.dat", "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 /// \author Ivana Hrivnacova, IPN Orsay
34
35 #ifndef ALI_MUON_SEG_FACTORY_H
36 #define ALI_MUON_SEG_FACTORY_H
37
38 #include "AliMpStringObjMap.h"
39
40 #include <TObject.h>
41
42 class AliMpVSegmentation;
43 class AliMUONVGeometryDESegmentation;
44 class AliMUONGeometrySegmentation;
45 class AliMUONSegmentation;
46 class AliMUONGeometryTransformer;
47
48 class AliMUONSegFactory : public  TObject {
49
50   public:
51     AliMUONSegFactory(const AliMUONGeometryTransformer* geometry);
52     AliMUONSegFactory(const TString& volPathsFileName,
53                       const TString& transformsFileName);
54     AliMUONSegFactory();
55     virtual ~AliMUONSegFactory();
56     
57     //
58     // Build methods
59     //
60     
61     AliMUONSegmentation* CreateSegmentation(); 
62               // Create segmentations on all levels and return their container.
63     
64     //
65     // Get method
66     //
67     AliMUONSegmentation* GetSegmentation() const;
68               // Returned segmentation contains all the lower level segmentations
69               // created with the factory
70
71   protected:
72     AliMUONSegFactory(const AliMUONSegFactory& rhs);
73     AliMUONSegFactory& operator=(const AliMUONSegFactory& rhs);
74
75   private:
76     AliMUONVGeometryDESegmentation*  
77       CreateDESegmentation(Int_t detElemId, Int_t cath);
78               // Create DE segmentation, operating in local reference frame
79     
80     void
81       CreateModuleSegmentations(Int_t chamberId, Int_t cath); 
82               // Create module segmentation(s) for a given chamber, operating 
83               // in global reference frame
84
85     // methods
86     Bool_t IsGeometryDefined(Int_t ichamber);
87     AliMUONSegmentation* Segmentation();
88     
89     // data members     
90     AliMpStringObjMap     fDESegmentations;///< Map of DE segmentations to DE seg names
91     AliMUONSegmentation*  fSegmentation;   ///< Segmentation container 
92     const AliMUONGeometryTransformer* fkTransformer; ///< Geometry transformer
93
94   ClassDef(AliMUONSegFactory,0)  // MUON Factory for Chambers and Segmentation
95 };
96
97 /// Return segmentation
98 inline AliMUONSegmentation* AliMUONSegFactory::GetSegmentation() const
99 { return fSegmentation; }
100
101 #endif //ALI_MUON_SEG_FACTORY_H
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116