AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMFTLadderSegmentation.cxx
Go to the documentation of this file.
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 // $Id$
16 
17 //-----------------------------------------------------------------------------
22 // author Raphael Tieulent <raphael.tieulent@cern.ch>
23 //-----------------------------------------------------------------------------
24 
25 #include "AliLog.h"
26 #include "AliMFTConstants.h"
28 #include "AliMFTGeometry.h"
29 
33 
34 //====================================================================================================================================================
36 
39  fChips(NULL)
40 {
41 
42 
43 }
44 
45 //====================================================================================================================================================
50  fChips(NULL)
51 {
52  SetUniqueID(uniqueID);
53 
55 
56  SetName(Form("MFT_L_%d_%d_%d",
57  mftGeom->GetHalfMFTID(GetUniqueID()),
58  mftGeom->GetHalfDiskID(GetUniqueID()),
59  mftGeom->GetLadderID(GetUniqueID()) ));
60 
61  // constructor
62 
63 }
64 
65 //====================================================================================================================================================
68  AliMFTVSegmentation(ladder),
69  fNSensors(ladder.fNSensors)
70 {
71  // copy constructor
72 
73  if (ladder.fChips) fChips = new TClonesArray(*(ladder.fChips));
74  else fChips = new TClonesArray("AliMFTChipSegmentation",fNSensors);
75 
76  fChips -> SetOwner(kTRUE);
77 
78 
79 }
80 
81 //====================================================================================================================================================
82 
84 
85  // Assignment operator
86 
87  // check assignement to self
88  if (this != &ladder) {
89 
90  // base class assignement
91  TNamed::operator=(ladder);
92 
93  // clear memory
94  Clear("");
95 
96  if (ladder.fChips) fChips = new TClonesArray(*(ladder.fChips));
97  else fChips = new TClonesArray("AliMFTChipSegmentation",fNSensors);
98  fChips -> SetOwner(kTRUE);
99 
100  }
101 
102  return *this;
103 
104 }
105 
106 //====================================================================================================================================================
109 
110  if (!fChips) {
111  fChips = new TClonesArray("AliMFTChipSegmentation",fNSensors);
112  fChips -> SetOwner(kTRUE);
113  }
114 
116 
117  for (Int_t iSensor=0; iSensor<fNSensors; iSensor++) {
118  UInt_t sensorUniqueID = mftGeom->GetObjectID(AliMFTGeometry::kSensorType,
119  mftGeom->GetHalfMFTID(GetUniqueID()),
120  mftGeom->GetHalfDiskID(GetUniqueID()),
121  mftGeom->GetLadderID(GetUniqueID()),
122  iSensor);
123 
124  AliMFTChipSegmentation *chip = new AliMFTChipSegmentation(sensorUniqueID);
125 
126  new ((*fChips)[iSensor]) AliMFTChipSegmentation(*chip);
127  delete chip;
128  }
129 
130 }
131 
132 
133 //====================================================================================================================================================
137 
138  if (sensorID<0 || sensorID>=fNSensors) return NULL;
139 
140  AliMFTChipSegmentation *chip = (AliMFTChipSegmentation*) fChips->At(sensorID);
141 
142  return chip;
143 
144 }
145 
146 
147 //==================================================================================================================
151 
152  AliInfo(Form("Ladder %s (Unique ID = %d)",GetName(),GetUniqueID()));
153  GetTransformation()->Print();
154  AliInfo(Form("N Sensors = %d",GetNSensors()));
155  if(opt && (strstr(opt,"sensor")||strstr(opt,"s"))){
156  for (int i=0; i<GetNSensors(); i++) GetSensor(i)->Print("");
157 
158  }
159 
160 }
161 
virtual void Print(Option_t *opt="")
TGeoCombiTrans * GetTransformation() const
Returns the Transformation Combining a Rotation followed by a Translation.
Chip Segmentation description.
Int_t GetLadderID(UInt_t uniqueID) const
Returns Ladder ID based on Unique ID provided.
virtual void Print(Option_t *)
Print out Sensor information (Name, ID, position, orientation)
Int_t fNSensors
Number of Sensors holded by the ladder.
UInt_t GetObjectID(ObjectTypes type, Int_t half=0, Int_t disk=0, Int_t ladder=0, Int_t chip=0) const
Returns the object Unique ID.
Abstract base class for MFT Segmentation description.
TClonesArray * fChips
Array of pointer to AliMFTChipSegmentation.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
void CreateSensors()
Creates the Sensors Segmentation array on the Ladder.
Int_t GetNSensors() const
Returns number of Sensor on the ladder.
virtual void Clear(const Option_t *)
AliMFTChipSegmentation * GetSensor(Int_t sensor) const
static AliMFTGeometry * Instance()
Retuns MFT Geometry singleton object.
AliMFTLadderSegmentation()
Default constructor.
Description of the virtual segmentation of a ladder.
AliMFTLadderSegmentation & operator=(const AliMFTLadderSegmentation &ladder)
Int_t GetHalfMFTID(UInt_t uniqueID) const
Returns Half-MFT ID based on Unique ID provided.
Int_t GetHalfDiskID(UInt_t uniqueID) const
Returns Half-Disk ID based on Unique ID provided.
Class Handling both Virutal Segmentation and Real Volumes.