ATLAS Offline Software
Loading...
Searching...
No Matches
GeoPixelModule Class Reference

#include <GeoPixelModule.h>

Inheritance diagram for GeoPixelModule:
Collaboration diagram for GeoPixelModule:

Public Member Functions

 GeoPixelModule (InDetDD::PixelDetectorManager *ddmgr, PixelGeometryManager *mgr, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > mapAX, GeoPixelSiCrystal &theSensor)
 GeoPixelModule (const GeoPixelModule &)=delete
GeoPixelModuleoperator= (const GeoPixelModule &)=delete
virtual ~GeoPixelModule ()=default
virtual GeoVPhysVol * Build () override
double Thickness ()
double ThicknessN ()
double ThicknessN_noSvc ()
double ThicknessP ()
double Width ()
double Length ()
double ModuleServiceThickness () const
double ModuleServiceWidth () const
Identifier getID ()

Protected Attributes

PixelGeometryManagerm_gmt_mgr
InDetMaterialManagerm_mat_mgr
InDetDD::PixelDetectorManagerm_DDmgr
GeoModelIO::ReadGeoModel * m_sqliteReader
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
const double m_epsilon

Private Member Functions

const GeoShape * addShape (const GeoShape *lastShape, const GeoShape *nextShape, const GeoTrf::Transform3D &trans)

Private Attributes

GeoIntrusivePtr< const GeoLogVol > m_theModule {nullptr}
Identifier m_id
GeoPixelSiCrystalm_theSensor
bool m_isModule3D {false}
double m_moduleSvcThickness {0.}
double m_moduleSvcWidth {0.}
int m_nbModuleSvc {0}

Detailed Description

Definition at line 14 of file GeoPixelModule.h.

Constructor & Destructor Documentation

◆ GeoPixelModule() [1/2]

GeoPixelModule::GeoPixelModule ( InDetDD::PixelDetectorManager * ddmgr,
PixelGeometryManager * mgr,
GeoModelIO::ReadGeoModel * sqliteReader,
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > mapFPV,
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > mapAX,
GeoPixelSiCrystal & theSensor )

Definition at line 25 of file GeoPixelModule.cxx.

31 : GeoVPixelFactory (ddmgr, mgr, sqliteReader, std::move(mapFPV), std::move(mapAX))
32 , m_theSensor(theSensor)
33{
34 //
35 // Define the log volume in the constructor, so I do it only once.
36 //
37 // The module orientation is
38 // x normal to the detector
39 // y in the phi direction
40 // z in the eta (z) direction
41
42 m_isModule3D=m_theSensor.GetModule3DFlag();
43 m_nbModuleSvc = m_gmt_mgr->PixelModuleServiceNumber();
44
45 if(!m_sqliteReader) {
46 int svcType = (m_isModule3D) ? 1 : 0;
47
48 //
49 // The Dimensions are in separate routines
50 //
51 double length = this->Length();
52 double thickness = this->Thickness();
53 double width = this->Width();
54 const GeoMaterial* air = m_mat_mgr->getMaterial("std::Air");
55
56 // const GeoShape * moduleShape = 0;
57 std::string logName = m_gmt_mgr->isBarrel() ? "ModuleBrl" : "ModuleEC";
58
59 if (ThicknessP() == ThicknessN()) {
60 const GeoBox* moduleBox = new GeoBox(thickness/2.,width/2.,length/2.);
61 const GeoShape * moduleShape = moduleBox;
62 m_theModule = new GeoLogVol(logName,moduleShape,air);
63 }
64 else {
65
66 // Shift so the center of the box is the center of the sensor.
67 double shift = 0.5 * (ThicknessP() - ThicknessN_noSvc());
68 // const GeoShape & shiftedBox = (*moduleBox) << GeoTrf::TranslateX3D(shift);
69 // moduleShape = &shiftedBox;
70
71 thickness = ThicknessP()+ThicknessN_noSvc();
72 const GeoBox* moduleBox = new GeoBox(thickness/2.,width/2.,length/2.);
73 const GeoShape & shiftedBox = (*moduleBox) << GeoTrf::TranslateX3D(shift);
74 const GeoShape * moduleShape = &shiftedBox;
75
76 if(m_moduleSvcThickness<0.001) {
77 m_theModule = new GeoLogVol(logName,moduleShape,air);
78 }
79 else {
80 const GeoShape * gblShape = nullptr;
81 gblShape = addShape(gblShape, moduleShape, GeoTrf::Transform3D::Identity() );
82
83 double svcWidth = width*.6;
84 m_moduleSvcWidth = svcWidth;
85 const GeoBox* moduleSvcBox1 = new GeoBox(m_moduleSvcThickness*.5,svcWidth*.25,length*.5);
86 double yShift = width*.5-svcWidth*.75;
87 double xShift = thickness*.5+m_moduleSvcThickness*.5;
88 gblShape = addShape(gblShape, moduleSvcBox1, (GeoTrf::TranslateX3D(-xShift)*GeoTrf::TranslateY3D(-yShift)) );
89
90 const GeoBox* moduleSvcBox2 = new GeoBox(m_moduleSvcThickness*.25,svcWidth*.25,length*.5);
91 yShift = width*.5-svcWidth*.25;
92 xShift = thickness*.5+m_moduleSvcThickness*.25;
93 gblShape = addShape(gblShape, moduleSvcBox2, (GeoTrf::TranslateX3D(-xShift)*GeoTrf::TranslateY3D(-yShift)) );
94
95 for(int iSvc=0; iSvc<m_nbModuleSvc; iSvc++)
96 {
97 int type = m_gmt_mgr->PixelModuleServiceModuleType(iSvc);
98 std::string name = m_gmt_mgr->PixelModuleServiceName(iSvc);
99 double offsetX = m_gmt_mgr->PixelModuleServiceOffsetX(iSvc);
100
101 if(type==svcType&&(name=="WingFlex"||offsetX<0)) {
102 double width_svc = m_gmt_mgr->PixelModuleServiceWidth(iSvc);
103 double thick_svc = m_gmt_mgr->PixelModuleServiceThick(iSvc);
104 double offsetY = m_gmt_mgr->PixelModuleServiceOffsetY(iSvc);
105 double xPos = -0.5*(m_gmt_mgr->PixelBoardThickness(m_isModule3D)-m_gmt_mgr->PixelHybridThickness(m_isModule3D)) - offsetX - thick_svc*.5;
106 const GeoBox* moduleSvcBox3 = new GeoBox(thick_svc*.5+.01,width_svc*.5+.01,length*.5+.01);
107 gblShape = addShape(gblShape, moduleSvcBox3, (GeoTrf::TranslateX3D(xPos)*GeoTrf::TranslateY3D(offsetY)) );
108 }
109 }
110
111 m_theModule = new GeoLogVol(logName,gblShape,air);
112 }
113 }
114 }
115
116}
double length(const pvec &v)
const double width
double ThicknessN_noSvc()
double m_moduleSvcWidth
GeoPixelSiCrystal & m_theSensor
GeoIntrusivePtr< const GeoLogVol > m_theModule
const GeoShape * addShape(const GeoShape *lastShape, const GeoShape *nextShape, const GeoTrf::Transform3D &trans)
double m_moduleSvcThickness
GeoModelIO::ReadGeoModel * m_sqliteReader
PixelGeometryManager * m_gmt_mgr
InDetMaterialManager * m_mat_mgr
GeoVPixelFactory(InDetDD::PixelDetectorManager *ddmgr, PixelGeometryManager *mgr, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > mapAX)

◆ GeoPixelModule() [2/2]

GeoPixelModule::GeoPixelModule ( const GeoPixelModule & )
delete

◆ ~GeoPixelModule()

virtual GeoPixelModule::~GeoPixelModule ( )
virtualdefault

Member Function Documentation

◆ addShape()

const GeoShape * GeoPixelModule::addShape ( const GeoShape * lastShape,
const GeoShape * nextShape,
const GeoTrf::Transform3D & trans )
private

Definition at line 318 of file GeoPixelModule.cxx.

319{
320 const GeoShape * shiftedShape = &(*nextShape << trans);
321 if (lastShape) {
322 lastShape = &(lastShape->add(*shiftedShape));
323 } else {
324 lastShape = shiftedShape;
325 }
326 return lastShape;
327}

◆ Build()

GeoVPhysVol * GeoPixelModule::Build ( )
overridevirtual

Implements GeoVPixelFactory.

Definition at line 119 of file GeoPixelModule.cxx.

119 {
120
121 if(m_sqliteReader) {
122 m_theSensor.Build();
123 m_id = m_theSensor.getID();
124 return nullptr;
125 }
126
127 GeoFullPhysVol* modulePhys = new GeoFullPhysVol(m_theModule);
128 //
129 // Place the Si Crystal
130 //
131 GeoVPhysVol *theSi = m_theSensor.Build();
132 m_id = m_theSensor.getID();
133 std::string sensorName = m_gmt_mgr->isBarrel() ? "SensorBrl" : "SensorEC";
134 GeoNameTag *tag = new GeoNameTag(sensorName);
135 modulePhys->add(tag);
136 // We give the barrel sensors an id of 100 and endcap sensors an id of 200 so that they can
137 // can be distinguished in the G4 sensitive detector.
138 int idTag = 100; // barrel
139 if (m_gmt_mgr->isEndcap()) {
140 idTag = 200; // endcap
141 }
142 modulePhys->add(new GeoIdentifierTag(idTag) );
143 //Sensor is centered so we don't need the transform.
144 //GeoTransform *xformsi = new GeoTransform(GeoTrf::Transform3D());
145 //modulePhys->add(xformsi);
146 modulePhys->add(theSi );
147 //
148 // Place the Hybrid
149 //
150 if (m_gmt_mgr->PixelHybridThickness(m_isModule3D)>0.00001*Gaudi::Units::mm){
152 double hybxpos = -0.5*(m_gmt_mgr->PixelBoardThickness(m_isModule3D)+m_gmt_mgr->PixelHybridThickness(m_isModule3D));
153 GeoTransform* xform = new GeoTransform(GeoTrf::TranslateX3D(hybxpos));
154 modulePhys->add(xform);
155 modulePhys->add(ph.Build() );
156 }
157
158 //
159 // Place the Chip
160 //
162 double chipxpos = 0.5*(m_gmt_mgr->PixelBoardThickness(m_isModule3D)+m_gmt_mgr->PixelChipThickness(m_isModule3D))+m_gmt_mgr->PixelChipGap(m_isModule3D);
163 double chipypos =m_gmt_mgr->PixelChipOffset(m_isModule3D);
164 GeoTransform* xform = new GeoTransform(GeoTrf::TranslateX3D(chipxpos)*GeoTrf::TranslateY3D(chipypos));
165 modulePhys->add(xform);
166 modulePhys->add(pc.Build() );
167
168 //
169 // Add the module services
170 //
171 if(m_nbModuleSvc==0) return modulePhys;
172
173 int svcType = (m_isModule3D) ? 1 : 0;
174 for(int iSvc=0; iSvc<m_nbModuleSvc; iSvc++)
175 {
176 int type = m_gmt_mgr->PixelModuleServiceModuleType(iSvc);
177
178 if(type==svcType){
179 double length = m_gmt_mgr->PixelModuleServiceLength(iSvc);
180 double width = m_gmt_mgr->PixelModuleServiceWidth(iSvc);
181 double thick = m_gmt_mgr->PixelModuleServiceThick(iSvc);
182 double offsetX = m_gmt_mgr->PixelModuleServiceOffsetX(iSvc);
183 double offsetY = m_gmt_mgr->PixelModuleServiceOffsetY(iSvc);
184 double offsetZ = m_gmt_mgr->PixelModuleServiceOffsetZ(iSvc);
185 std::string name = m_gmt_mgr->PixelModuleServiceName(iSvc);
186 std::string material = m_gmt_mgr->PixelModuleServiceMaterial(iSvc);
187
188 const GeoBox* svcBox = new GeoBox(thick*.5-0.01,width*.5,length*.5);
189 const GeoMaterial* svcMat = m_mat_mgr->getMaterialForVolume(material,svcBox->volume());
190 GeoLogVol* svcLogVol = new GeoLogVol(name, svcBox, svcMat);
191 GeoPhysVol* svcPhys = new GeoPhysVol(svcLogVol);
192
193 double xPos = -0.5*(m_gmt_mgr->PixelBoardThickness(m_isModule3D)-m_gmt_mgr->PixelHybridThickness(m_isModule3D)) - offsetX - thick*.5;
194 double yPos = offsetY;
195 double zPos = offsetZ;
196 GeoTransform* xform = new GeoTransform(GeoTrf::Translate3D(xPos,yPos,zPos));
197 modulePhys->add(xform);
198 modulePhys->add(svcPhys);
199 }
200 }
201
202
203 return modulePhys;
204}
Identifier m_id
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
InDetDD::PixelDetectorManager * m_DDmgr

◆ getID()

Identifier GeoPixelModule::getID ( )

Definition at line 313 of file GeoPixelModule.cxx.

313 {
314 return m_id;
315}

◆ Length()

double GeoPixelModule::Length ( )

Definition at line 299 of file GeoPixelModule.cxx.

299 {
300 // balcony is zero
301
302 // std::cout<<m_isModule3D<<" "<<m_gmt_mgr->PixelHybridLength(m_isModule3D)<<" "<<m_gmt_mgr->PixelBoardLength(m_isModule3D)<<" "<<m_gmt_mgr->PixelChipLength(m_isModule3D)<<std::endl;
303
304 double length = max( max( //max(
305 m_gmt_mgr->PixelHybridLength(m_isModule3D),
306 m_gmt_mgr->PixelBoardLength(m_isModule3D)),
307 //2*m_gmt_mgr->PixelBalcony()),
308 m_gmt_mgr->PixelChipLength(m_isModule3D));
309
310 return length;
311}
#define max(a, b)
Definition cfImp.cxx:41

◆ ModuleServiceThickness()

double GeoPixelModule::ModuleServiceThickness ( ) const
inline

Definition at line 33 of file GeoPixelModule.h.

33{ return m_moduleSvcThickness; }

◆ ModuleServiceWidth()

double GeoPixelModule::ModuleServiceWidth ( ) const
inline

Definition at line 34 of file GeoPixelModule.h.

34{ return m_moduleSvcWidth; }

◆ operator=()

GeoPixelModule & GeoPixelModule::operator= ( const GeoPixelModule & )
delete

◆ Thickness()

double GeoPixelModule::Thickness ( )

Definition at line 285 of file GeoPixelModule.cxx.

285 {
286 // This is total thickness of the module envelope
287 return ThicknessP()+ThicknessN();
288}

◆ ThicknessN()

double GeoPixelModule::ThicknessN ( )

Definition at line 238 of file GeoPixelModule.cxx.

238 {
239 //
240 // The module envelope is no longer forced to symmetric about its
241 // center to allow for room between the module and TMT. ThicknessN
242 // is the max of ThicknessP and thickness from the module center to
243 // the outer surface of the hybrid plus some safety.
244 //
245
246
247 double safety = 0.01*Gaudi::Units::mm;
248 double thickn = 0.5 * m_gmt_mgr->PixelBoardThickness(m_isModule3D)+ m_gmt_mgr->PixelHybridThickness(m_isModule3D) + safety;
249 double thick = max(thickn, ThicknessP());
250
251 if(m_nbModuleSvc==0) return thick;
252
253 double thickSvc=0;
254 int svcType = (m_isModule3D) ? 1 : 0;
255 for(int iSvc=0; iSvc<m_nbModuleSvc; iSvc++)
256 {
257 int type = m_gmt_mgr->PixelModuleServiceModuleType(iSvc);
258 if(type==svcType){
259 double locThick = m_gmt_mgr->PixelModuleServiceThick(iSvc);
260 double offsetX = m_gmt_mgr->PixelModuleServiceOffsetX(iSvc);
261 double tmp = offsetX+locThick;
262 thickSvc = std::max(thickSvc,tmp);
263 }
264 }
265 m_moduleSvcThickness = thickSvc;
266
267 return thick+thickSvc;
268}

◆ ThicknessN_noSvc()

double GeoPixelModule::ThicknessN_noSvc ( )

Definition at line 206 of file GeoPixelModule.cxx.

206 {
207 //
208 // The module envelope is no longer forced to symmetric about its
209 // center to allow for room between the module and TMT. ThicknessN
210 // is the max of ThicknessP and thickness from the module center to
211 // the outer surface of the hybrid plus some safety.
212 //
213 double safety = 0.01*Gaudi::Units::mm;
214 double thickn = 0.5 * m_gmt_mgr->PixelBoardThickness(m_isModule3D)+ m_gmt_mgr->PixelHybridThickness(m_isModule3D) + safety;
215 double thick = max(thickn, ThicknessP());
216
217 if(m_nbModuleSvc==0) return thick;
218
219 double thickSvc=0;
220 int svcType = (m_isModule3D) ? 1 : 0;
221 for(int iSvc=0; iSvc<m_nbModuleSvc; iSvc++)
222 {
223 int type = m_gmt_mgr->PixelModuleServiceModuleType(iSvc);
224 int fullSize = m_gmt_mgr->PixelModuleServiceFullSize(iSvc);
225 if(type==svcType&&fullSize==1){
226 double locThick = m_gmt_mgr->PixelModuleServiceThick(iSvc);
227 double offsetX = m_gmt_mgr->PixelModuleServiceOffsetX(iSvc);
228 double tmp = offsetX+locThick;
229 thickSvc = std::max(thickSvc,tmp);
230 }
231 }
232
233 return thick+thickSvc;
234
235}

◆ ThicknessP()

double GeoPixelModule::ThicknessP ( )

Definition at line 271 of file GeoPixelModule.cxx.

271 {
272 //
273 // The module envelope is no longer forced to symmetric about its
274 // center to allow for room between the module and TMT. ThicknessP
275 // is thickness from the module center to the outer surface of the
276 // chips plus some safety.
277
278 double safety = 0.01*Gaudi::Units::mm;
279 double thick = 0.5 * m_gmt_mgr->PixelBoardThickness(m_isModule3D) +
280 m_gmt_mgr->PixelChipThickness(m_isModule3D)+m_gmt_mgr->PixelChipGap(m_isModule3D) + safety;
281
282 return thick;
283}

◆ Width()

double GeoPixelModule::Width ( )

Definition at line 290 of file GeoPixelModule.cxx.

290 {
291
292 double chipypos =fabs(m_gmt_mgr->PixelChipOffset(m_isModule3D));
293 double width = max( max(
294 m_gmt_mgr->PixelBoardWidth(m_isModule3D),
295 m_gmt_mgr->PixelHybridWidth(m_isModule3D)),
296 m_gmt_mgr->PixelChipWidth(m_isModule3D)+2.*chipypos);
297 return width;
298}

Member Data Documentation

◆ m_DDmgr

InDetDD::PixelDetectorManager* GeoVPixelFactory::m_DDmgr
protectedinherited

Definition at line 45 of file GeoVPixelFactory.h.

◆ m_epsilon

const double GeoVPixelFactory::m_epsilon
protectedinherited

Definition at line 49 of file GeoVPixelFactory.h.

◆ m_gmt_mgr

PixelGeometryManager* GeoVPixelFactory::m_gmt_mgr
protectedinherited

Definition at line 43 of file GeoVPixelFactory.h.

◆ m_id

Identifier GeoPixelModule::m_id
private

Definition at line 42 of file GeoPixelModule.h.

◆ m_isModule3D

bool GeoPixelModule::m_isModule3D {false}
private

Definition at line 44 of file GeoPixelModule.h.

44{false};

◆ m_mapAX

std::shared_ptr<std::map<std::string, GeoAlignableTransform*> > GeoVPixelFactory::m_mapAX
protectedinherited

Definition at line 48 of file GeoVPixelFactory.h.

◆ m_mapFPV

std::shared_ptr<std::map<std::string, GeoFullPhysVol*> > GeoVPixelFactory::m_mapFPV
protectedinherited

Definition at line 47 of file GeoVPixelFactory.h.

◆ m_mat_mgr

InDetMaterialManager* GeoVPixelFactory::m_mat_mgr
protectedinherited

Definition at line 44 of file GeoVPixelFactory.h.

◆ m_moduleSvcThickness

double GeoPixelModule::m_moduleSvcThickness {0.}
private

Definition at line 46 of file GeoPixelModule.h.

46{0.};

◆ m_moduleSvcWidth

double GeoPixelModule::m_moduleSvcWidth {0.}
private

Definition at line 47 of file GeoPixelModule.h.

47{0.};

◆ m_nbModuleSvc

int GeoPixelModule::m_nbModuleSvc {0}
private

Definition at line 48 of file GeoPixelModule.h.

48{0};

◆ m_sqliteReader

GeoModelIO::ReadGeoModel* GeoVPixelFactory::m_sqliteReader
protectedinherited

Definition at line 46 of file GeoVPixelFactory.h.

◆ m_theModule

GeoIntrusivePtr<const GeoLogVol> GeoPixelModule::m_theModule {nullptr}
private

Definition at line 41 of file GeoPixelModule.h.

41{nullptr};

◆ m_theSensor

GeoPixelSiCrystal& GeoPixelModule::m_theSensor
private

Definition at line 43 of file GeoPixelModule.h.


The documentation for this class was generated from the following files: