ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
LArGeo::HEC2WheelConstruction Class Reference

GeoModel description of LAr HEC. More...

#include <HEC2WheelConstruction.h>

Collaboration diagram for LArGeo::HEC2WheelConstruction:

Public Member Functions

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

Private Attributes

GeoIntrusivePtr< GeoFullPhysVol > m_physiHEC
 
bool m_posZSide
 

Detailed Description

GeoModel description of LAr HEC.

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

Definition at line 26 of file HEC2WheelConstruction.h.

Constructor & Destructor Documentation

◆ HEC2WheelConstruction()

LArGeo::HEC2WheelConstruction::HEC2WheelConstruction ( )

Definition at line 76 of file HEC2WheelConstruction.cxx.

76  :
77  m_physiHEC(nullptr),
78  m_posZSide(false)
79 {
80 
81 }

◆ ~HEC2WheelConstruction()

LArGeo::HEC2WheelConstruction::~HEC2WheelConstruction ( )
virtual

Definition at line 84 of file HEC2WheelConstruction.cxx.

85 {;}

Member Function Documentation

◆ GetEnvelope()

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

Definition at line 88 of file HEC2WheelConstruction.cxx.

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

Member Data Documentation

◆ m_physiHEC

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

Definition at line 35 of file HEC2WheelConstruction.h.

◆ m_posZSide

bool LArGeo::HEC2WheelConstruction::m_posZSide
private

Definition at line 36 of file HEC2WheelConstruction.h.


The documentation for this class was generated from the following files:
GeoDBUtils::getTransformRecord
static const IRDBRecord * getTransformRecord(IRDBRecordset_ptr positionRecSet, const std::string &key)
Definition: GeoDBUtils.h:23
IRDBAccessSvc::getRecordsetPtr
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
IGeoModelSvc
Definition: IGeoModelSvc.h:17
LAr
Definition: LArVolumeBuilder.h:36
StoredAlignX
Definition: StoredAlignX.h:23
M_PI
#define M_PI
Definition: ActiveFraction.h:11
GeoDBUtils::getTransform
static GeoTrf::Transform3D getTransform(const IRDBRecord *currentRec)
Definition: GeoDBUtils.h:33
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
StoredPhysVol
Definition: StoredPhysVol.h:27
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
IGeoModelSvc::LAr_VersionOverride
virtual const std::string & LAr_VersionOverride() const =0
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
EventInfoWrite.AtlasVersion
AtlasVersion
Definition: EventInfoWrite.py:17
TrigConf::MSGTC::ALWAYS
@ ALWAYS
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:29
lumiFormat.i
int i
Definition: lumiFormat.py:92
IRDBAccessSvc
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
Definition: IRDBAccessSvc.h:45
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
plotBeamSpotCompare.tag1
string tag1
Definition: plotBeamSpotCompare.py:75
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
LArGeo::HEC2WheelConstruction::m_posZSide
bool m_posZSide
Definition: HEC2WheelConstruction.h:36
plotBeamSpotCompare.tag2
string tag2
Definition: plotBeamSpotCompare.py:76
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
IRDBRecord
IRDBRecord is one record in the IRDBRecordset object.
Definition: IRDBRecord.h:27
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
IGeoModelSvc::atlasVersion
virtual const std::string & atlasVersion() const =0
LArGeo::HEC2WheelConstruction::m_physiHEC
GeoIntrusivePtr< GeoFullPhysVol > m_physiHEC
Definition: HEC2WheelConstruction.h:35