- Welding section on absorber side (LHCVC2C_001)
[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).
d1cd2474 6// Author: Ivana Hrivnacova, IPN Orsay
5f1df83a 7// 23/01/2004
d1cd2474 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//
86b48c39 59 if (fChambers) {
60 fChambers->Clear(); // Sets pointers to 0 sinche it is not the owner
61 delete fChambers;
62 }
d1cd2474 63}
64
65//______________________________________________________________________________
66AliMUONVGeometryBuilder&
67AliMUONVGeometryBuilder::operator = (const AliMUONVGeometryBuilder& rhs)
68{
69 // check assignement to self
70 if (this == &rhs) return *this;
71
72 Fatal("operator=",
73 "Assignment operator is not implemented.");
74
75 return *this;
76}
77
78//
79// public methods
80//
81
82//______________________________________________________________________________
83AliMUONChamber* AliMUONVGeometryBuilder::GetChamber(Int_t chamberId) const
84{
85// Returns the chamber specified by chamberId
86// ---
87
88 for (Int_t i=0; i<fChambers->GetEntriesFast(); i++) {
89 AliMUONChamber* chamber = (AliMUONChamber*)fChambers->At(i);
90 if ( chamber->GetId() == chamberId) return chamber;
91 }
92
93 return 0;
94}