ATLAS Offline Software
Loading...
Searching...
No Matches
LArGeo::HEC2WheelConstruction Class Reference

GeoModel description of LAr HEC. More...

#include <HEC2WheelConstruction.h>

Collaboration diagram for LArGeo::HEC2WheelConstruction:

Public Member Functions

 HEC2WheelConstruction ()=default
 ~HEC2WheelConstruction ()=default
GeoIntrusivePtr< GeoFullPhysVol > GetEnvelope (bool fullGeo, bool posZSide=true)

Private Attributes

GeoIntrusivePtr< GeoFullPhysVol > m_physiHEC {}
bool m_posZSide {false}

Detailed Description

GeoModel description of LAr HEC.

The geometry is built and placed within HEC envelope which is implemented by LArGeoEndcap.

Definition at line 25 of file HEC2WheelConstruction.h.

Constructor & Destructor Documentation

◆ HEC2WheelConstruction()

LArGeo::HEC2WheelConstruction::HEC2WheelConstruction ( )
default

◆ ~HEC2WheelConstruction()

LArGeo::HEC2WheelConstruction::~HEC2WheelConstruction ( )
default

Member Function Documentation

◆ GetEnvelope()

GeoIntrusivePtr< GeoFullPhysVol > LArGeo::HEC2WheelConstruction::GetEnvelope ( bool fullGeo,
bool posZSide = true )

Definition at line 74 of file HEC2WheelConstruction.cxx.

75{
76 m_posZSide = posZSide;
77
78 if(m_physiHEC) return m_physiHEC->clone();
79
80 // Get access to the material manager:
81 ISvcLocator *svcLocator = Gaudi::svcLocator();
82
83 MsgStream log(Athena::getMessageSvc(),"HEC2WheelConstruction " );
84
85
86 log << MSG::DEBUG << "+++++++++++++++++++++++++++++++++++++++++++++++++++++" << endmsg;
87 log << MSG::DEBUG << "+ +" << endmsg;
88 log << MSG::DEBUG << "+ Start of HEC2Wheel GeoModel definition +" << endmsg;
89 log << MSG::DEBUG << "+ +" << endmsg;
90 log << MSG::DEBUG << "+++++++++++++++++++++++++++++++++++++++++++++++++++++" << endmsg;
91
92
93 SmartIF<StoreGateSvc> detStore{svcLocator->service("DetectorStore")};
94 if(!detStore.isValid()) {
95 throw std::runtime_error("Error in HEC2WheelConstruction, cannot access DetectorStore");
96 }
97
98 StoredMaterialManager* materialManager = nullptr;
99 if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) {
100 throw std::runtime_error("Error in HEC2WheelConstruction, cannot access Material Manager");
101 }
102
103 SmartIF<IRDBAccessSvc> pAccessSvc{svcLocator->service("RDBAccessSvc")};
104 if(!pAccessSvc.isValid()) {
105 throw std::runtime_error ("Cannot locate RDBAccessSvc!!");
106 }
107
108 SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
109 if(!geoModel.isValid()) {
110 throw std::runtime_error ("Cannot locate GeoModelSvc!!");
111 }
112
113 std::string AtlasVersion = geoModel->atlasVersion();
114 std::string LArVersion = geoModel->LAr_VersionOverride();
115 std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
116 std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
117
118 IRDBRecordset_ptr hadronicEndcap = pAccessSvc->getRecordsetPtr("HadronicEndcap",detectorKey, detectorNode);
119 if(hadronicEndcap->size()>0)
120 log << MSG::ALWAYS << "Using numbers from HadronicEndcap tag: " << hadronicEndcap->tagName() << endmsg;
121 else
122 throw std::runtime_error("Error in HECConstruction: hadronicEendcap not found");
123
124 IRDBRecordset_ptr hecLongitudinalBlock = pAccessSvc->getRecordsetPtr("HecLongitudinalBlock",detectorKey, detectorNode);
125 if(hecLongitudinalBlock->size()>0)
126 log << MSG::ALWAYS << "Using numbers from HecLongitudinalBlock tag: " << hecLongitudinalBlock->tagName() << endmsg;
127 else
128 throw std::runtime_error("Error in HECConstruction: hecLongitudinalBlock not found");
129
130 IRDBRecordset_ptr larPosition = pAccessSvc->getRecordsetPtr("LArPosition",detectorKey, detectorNode);
131 if (larPosition->size()==0 ) {
132 larPosition = pAccessSvc->getRecordsetPtr("LArPosition", "LArPosition-00");
133 if (larPosition->size()==0 ) {
134 throw std::runtime_error("Error, no lar position table in database!");
135 }
136 }
137
138 // This is a start for letting everyhting go cold (shrinkCold = 1.0 means warm; = 0.997 means cold)
139 double shrinkCold = 1.0 ;
140
141 double rInner1 = shrinkCold * (*hecLongitudinalBlock)[0]->getDouble("BLRMN")*cm;
142 double rInner2 = shrinkCold * (*hecLongitudinalBlock)[1]->getDouble("BLRMN")*cm;
143 double rOuter = shrinkCold * (*hecLongitudinalBlock)[0]->getDouble("BLRMX")*cm;
144 double wheelGap = shrinkCold * (*hadronicEndcap)[0]->getDouble("GAPWHL")*cm;
145
146
147 const GeoMaterial *LAr = materialManager->getMaterial("std::LiquidArgon");
148 if (!LAr) throw std::runtime_error("Error in HEC2WheelConstruction, std::LiquidArgon is not found.");
149
150 GeoPcon* solidHEC; //pointer to the solid HEC
151 const GeoLogVol* logicHEC; //pointer to the logical HEC
152 GeoIntrusivePtr<GeoFullPhysVol> physiHEC; //pointer to the physical HEC
153
154
155
156 // YIKES! Hard-coded numbers!!!
157
158 if (rOuter<2100.*mm) rOuter = shrinkCold *2130*mm; // Needs fixing in database to make room for HEC Clamping bars!
159 // Caution: We'll need 2 Routers - One for Wheel, one for Module!
160
161 double HEC1length = shrinkCold * 816.5*mm;
162 double HEC2length = shrinkCold * 961.0*mm;
163 double TotalWarmHEC = HEC1length + wheelGap + HEC2length ; // For the moment, this defines the HEC rear face
164 double TotalHECLength = TotalWarmHEC; // (where is that -cold- in the cryostat?
165
166 double zCoordinate[4];
167 zCoordinate[0]=shrinkCold * 0.0*cm;
168 zCoordinate[1]=shrinkCold * 28.05*cm;
169 zCoordinate[2]=shrinkCold * 28.051*cm;
170 zCoordinate[3]=shrinkCold * (181.9*cm+4.0*mm); // JFB, MGF: more room in the mother fiducal volume for misalignment.
171 // 37.2, 47.5, 203 cm for R
172
173 solidHEC = new GeoPcon(0., 2.*M_PI);
174 for (int i=0; i< 4; i++)
175 {
176 if (i<2) solidHEC->addPlane(zCoordinate[i],rInner1 - shrinkCold*1.*mm,rOuter);
177 else solidHEC->addPlane(zCoordinate[i],rInner2 - shrinkCold*1.*mm,rOuter);
178 }
179
180 std::string hecName = "LAr::HEC::Mother";
181 logicHEC = new GeoLogVol(hecName, solidHEC , LAr);
182 physiHEC = new GeoFullPhysVol(logicHEC);
183
184 //--- Make the Front Wheel alignable:
185
186 const IRDBRecord *posHec1 = GeoDBUtils::getTransformRecord(larPosition, m_posZSide ? "HEC1_POS":"HEC1_NEG");
187 Transform3D xfPosHec1 = posHec1 ? GeoDBUtils::getTransform(posHec1) : Translate3D(0.,0.,0.);
188 GeoAlignableTransform *xfHec1 = new GeoAlignableTransform(xfPosHec1);
189
190 std::string tag1 = m_posZSide? std::string("HEC1_POS") : std::string("HEC1_NEG");
191
192 HECWheelConstruction theFrontHEC(fullGeo,"front",false,m_posZSide) ;
193 GeoIntrusivePtr<GeoFullPhysVol> EnvelopeF = theFrontHEC.GetEnvelope();
194
195 StoredPhysVol *sPhysVolHec1 = new StoredPhysVol(EnvelopeF);
196 StatusCode sc=detStore->record(sPhysVolHec1,tag1);
197 if(!sc.isSuccess()) throw std::runtime_error ((std::string("Cannot store")+tag1).c_str());
198
199 StoredAlignX *sAlignX1 = new StoredAlignX(xfHec1);
200 sc=detStore->record(sAlignX1,tag1);
201 if(!sc.isSuccess()) throw std::runtime_error ((std::string("Cannot store")+tag1).c_str());
202
203 physiHEC->add(xfHec1);
204 physiHEC->add(new GeoIdentifierTag(0));
205 physiHEC->add(EnvelopeF);
206
207 //--- Now the Rear Wheel:
208
209 double Zpos = TotalHECLength - HEC2length ; // It is fixed at its end; position it from there.
210 const IRDBRecord *posHec2 = GeoDBUtils::getTransformRecord(std::move(larPosition), m_posZSide ? "HEC2_POS":"HEC2_NEG");
211 Transform3D xfPosHec2 = posHec2 ? GeoDBUtils::getTransform(posHec2):Translate3D(0.,0.,Zpos);
212
213
214 GeoAlignableTransform *xfHec2 = new GeoAlignableTransform(xfPosHec2);
215
216 std::string tag2 = m_posZSide? std::string("HEC2_POS") : std::string("HEC2_NEG");
217
218 HECWheelConstruction theRearHEC(fullGeo,"rear",false,m_posZSide);
219 GeoIntrusivePtr<GeoFullPhysVol> EnvelopeR = theRearHEC.GetEnvelope();
220
221 StoredPhysVol *sPhysVolHec2 = new StoredPhysVol(EnvelopeR);
222 sc=detStore->record(sPhysVolHec2,tag2);
223 if(!sc.isSuccess()) throw std::runtime_error ((std::string("Cannot store")+tag2).c_str());
224
225 StoredAlignX *sAlignX2 = new StoredAlignX(xfHec2);
226 sc=detStore->record(sAlignX2,tag2);
227 if(!sc.isSuccess()) throw std::runtime_error ((std::string("Cannot store")+tag2).c_str());
228
229 physiHEC->add(xfHec2);
230 physiHEC->add(new GeoIdentifierTag(1));
231 physiHEC->add(EnvelopeR);
232
233 return physiHEC;
234}
#define M_PI
#define endmsg
Eigen::Affine3d Transform3D
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
static Double_t sc
static const IRDBRecord * getTransformRecord(IRDBRecordset_ptr positionRecSet, const std::string &key)
Definition GeoDBUtils.h:23
static GeoTrf::Transform3D getTransform(const IRDBRecord *currentRec)
Definition GeoDBUtils.h:33
virtual std::string tagName() const =0
virtual unsigned int size() const =0
GeoIntrusivePtr< GeoFullPhysVol > m_physiHEC
virtual const GeoMaterial * getMaterial(const std::string &name)=0
IMessageSvc * getMessageSvc(bool quiet=false)
::StatusCode StatusCode
StatusCode definition for legacy code.

Member Data Documentation

◆ m_physiHEC

GeoIntrusivePtr<GeoFullPhysVol> LArGeo::HEC2WheelConstruction::m_physiHEC {}
private

Definition at line 35 of file HEC2WheelConstruction.h.

35{};

◆ m_posZSide

bool LArGeo::HEC2WheelConstruction::m_posZSide {false}
private

Definition at line 36 of file HEC2WheelConstruction.h.

36{false};

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