New definition of the geometry based on builders and usign Ivana's envelop method...
[u/mrichter/AliRoot.git] / MUON / AliMUONVGeometryBuilder.cxx
CommitLineData
d1cd2474 1// $Id$
2//
3// Class AliMUONVGeometryBuilder
4// -----------------------------
5// Abstract base class for geometry construction per chamber(s).
6//
7// Author: Ivana Hrivnacova, IPN Orsay
8
9#include <TObjArray.h>
10
11#include "AliMUONVGeometryBuilder.h"
12#include "AliMUONChamber.h"
13
14ClassImp(AliMUONVGeometryBuilder)
15
16//______________________________________________________________________________
17AliMUONVGeometryBuilder::AliMUONVGeometryBuilder(
18 AliMUONChamber* ch1, AliMUONChamber* ch2,
19 AliMUONChamber* ch3, AliMUONChamber* ch4,
20 AliMUONChamber* ch5, AliMUONChamber* ch6)
21 : TObject(),
22 fChambers(0)
23 {
24// Standard constructor
25
26 // Create the chambers array
27 fChambers = new TObjArray();
28
29 if (ch1) fChambers->Add(ch1);
30 if (ch2) fChambers->Add(ch2);
31 if (ch3) fChambers->Add(ch3);
32 if (ch4) fChambers->Add(ch4);
33 if (ch5) fChambers->Add(ch5);
34 if (ch6) fChambers->Add(ch6);
35
36}
37
38
39//______________________________________________________________________________
40AliMUONVGeometryBuilder::AliMUONVGeometryBuilder()
41 : TObject(),
42 fChambers(0)
43{
44// Default constructor
45}
46
47
48//______________________________________________________________________________
49AliMUONVGeometryBuilder::AliMUONVGeometryBuilder(const AliMUONVGeometryBuilder& rhs)
50 : TObject(rhs)
51{
52 Fatal("Copy constructor",
53 "Copy constructor is not implemented.");
54}
55
56//______________________________________________________________________________
57AliMUONVGeometryBuilder::~AliMUONVGeometryBuilder() {
58//
59
60 delete fChambers;
61}
62
63//______________________________________________________________________________
64AliMUONVGeometryBuilder&
65AliMUONVGeometryBuilder::operator = (const AliMUONVGeometryBuilder& rhs)
66{
67 // check assignement to self
68 if (this == &rhs) return *this;
69
70 Fatal("operator=",
71 "Assignment operator is not implemented.");
72
73 return *this;
74}
75
76//
77// public methods
78//
79
80//______________________________________________________________________________
81AliMUONChamber* AliMUONVGeometryBuilder::GetChamber(Int_t chamberId) const
82{
83// Returns the chamber specified by chamberId
84// ---
85
86 for (Int_t i=0; i<fChambers->GetEntriesFast(); i++) {
87 AliMUONChamber* chamber = (AliMUONChamber*)fChambers->At(i);
88 if ( chamber->GetId() == chamberId) return chamber;
89 }
90
91 return 0;
92}