1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
7 /// \class AliMUONSegFactory
8 /// \brief New factory for building segmentations at all levels
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
19 /// - AliMUONSegFactory factory(kTransformer);
20 /// - AliMUONSegFactory factory("volpath.dat", "transform.dat");
21 /// - AliMUONSegFactory factory(0); \n
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
28 /// Factory does not delete the created segmentation objects.
29 /// They have to be deleted in the client code via the AliMUONSegmentation
31 /// delete factory.GetSegmentation();
33 /// \author Ivana Hrivnacova, IPN Orsay
35 #ifndef ALI_MUON_SEG_FACTORY_H
36 #define ALI_MUON_SEG_FACTORY_H
38 #include "AliMpStringObjMap.h"
39 #include "AliMpCathodType.h"
43 class AliMpVSegmentation;
44 class AliMUONVGeometryDESegmentation;
45 class AliMUONGeometrySegmentation;
46 class AliMUONSegmentation;
47 class AliMUONGeometryTransformer;
49 class AliMUONSegFactory : public TObject {
52 AliMUONSegFactory(const AliMUONGeometryTransformer* geometry);
53 AliMUONSegFactory(const TString& volPathsFileName,
54 const TString& transformsFileName);
56 virtual ~AliMUONSegFactory();
62 AliMUONSegmentation* CreateSegmentation();
63 // Create segmentations on all levels and return their container.
68 AliMUONSegmentation* GetSegmentation() const;
69 // Returned segmentation contains all the lower level segmentations
70 // created with the factory
73 AliMUONSegFactory(const AliMUONSegFactory& rhs);
74 AliMUONSegFactory& operator=(const AliMUONSegFactory& rhs);
77 AliMUONVGeometryDESegmentation*
78 CreateDESegmentation(Int_t detElemId, AliMp::CathodType cath);
79 // Create DE segmentation, operating in local reference frame
82 CreateModuleSegmentations(Int_t chamberId, AliMp::CathodType cath);
83 // Create module segmentation(s) for a given chamber, operating
84 // in global reference frame
87 Bool_t IsGeometryDefined(Int_t ichamber);
88 AliMUONSegmentation* Segmentation();
91 AliMpStringObjMap fDESegmentations;///< Map of DE segmentations to DE seg names
92 AliMUONSegmentation* fSegmentation; ///< Segmentation container
93 const AliMUONGeometryTransformer* fkTransformer; ///< Geometry transformer
95 ClassDef(AliMUONSegFactory,0) // MUON Factory for Chambers and Segmentation
98 /// Return segmentation
99 inline AliMUONSegmentation* AliMUONSegFactory::GetSegmentation() const
100 { return fSegmentation; }
102 #endif //ALI_MUON_SEG_FACTORY_H