]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONVGeometryBuilder.cxx
Base Particle Cuts moved to the separate file. Property eneum defined namespace of...
[u/mrichter/AliRoot.git] / MUON / AliMUONVGeometryBuilder.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 // $Id$
17 //
18 // Class AliMUONVGeometryBuilder
19 // -----------------------------
20 // Abstract base class for geometry construction per chamber(s).
21 // Author: Ivana Hrivnacova, IPN Orsay
22 // 23/01/2004
23
24 #include <TObjArray.h>
25
26 #include "AliMUONVGeometryBuilder.h"
27 #include "AliMUONChamber.h"
28
29 ClassImp(AliMUONVGeometryBuilder)
30
31 //______________________________________________________________________________
32 AliMUONVGeometryBuilder::AliMUONVGeometryBuilder(
33                                 AliMUONChamber* ch1, AliMUONChamber* ch2,
34                                 AliMUONChamber* ch3, AliMUONChamber* ch4,
35                                 AliMUONChamber* ch5, AliMUONChamber* ch6)
36  : TObject(),
37    fChambers(0)
38  {
39 // Standard constructor
40
41   // Create the chambers array
42   fChambers = new TObjArray();
43   
44   if (ch1) fChambers->Add(ch1);
45   if (ch2) fChambers->Add(ch2);
46   if (ch3) fChambers->Add(ch3);
47   if (ch4) fChambers->Add(ch4);
48   if (ch5) fChambers->Add(ch5);
49   if (ch6) fChambers->Add(ch6);
50
51 }
52
53
54 //______________________________________________________________________________
55 AliMUONVGeometryBuilder::AliMUONVGeometryBuilder()
56  : TObject(),
57    fChambers(0)
58 {
59 // Default constructor
60 }
61
62
63 //______________________________________________________________________________
64 AliMUONVGeometryBuilder::AliMUONVGeometryBuilder(const AliMUONVGeometryBuilder& rhs)
65   : TObject(rhs)
66 {
67 // Protected copy constructor
68
69   Fatal("Copy constructor", 
70         "Copy constructor is not implemented.");
71 }
72
73 //______________________________________________________________________________
74 AliMUONVGeometryBuilder::~AliMUONVGeometryBuilder() {
75 //
76   if (fChambers) {
77     fChambers->Clear(); // Sets pointers to 0 sinche it is not the owner
78     delete fChambers;
79   }
80 }
81
82 //______________________________________________________________________________
83 AliMUONVGeometryBuilder& 
84 AliMUONVGeometryBuilder::operator = (const AliMUONVGeometryBuilder& rhs) 
85 {
86 // Protected assignement operator
87
88   // check assignement to self
89   if (this == &rhs) return *this;
90
91   Fatal("operator=", 
92         "Assignment operator is not implemented.");
93     
94   return *this;  
95 }
96
97 //
98 // public methods
99 //
100
101 //______________________________________________________________________________
102 AliMUONChamber*  AliMUONVGeometryBuilder::GetChamber(Int_t chamberId) const
103 {
104 // Returns the chamber specified by chamberId
105 // ---
106
107   for (Int_t i=0; i<fChambers->GetEntriesFast(); i++) {
108     AliMUONChamber* chamber = (AliMUONChamber*)fChambers->At(i);
109     if ( chamber->GetId() == chamberId) return chamber;
110   }   
111   
112   return 0;
113 }