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

#include <BarrelConstruction.h>

Collaboration diagram for LArGeo::BarrelConstruction:

Public Member Functions

 BarrelConstruction (bool fullGeo, const VDetectorParameters *params)
 
virtual ~BarrelConstruction ()
 
GeoIntrusivePtr< GeoFullPhysVol > GetPositiveEnvelope ()
 
GeoIntrusivePtr< GeoFullPhysVol > GetNegativeEnvelope ()
 
void setBarrelSagging (bool flag)
 
void setBarrelCellVisLimit (int maxCell)
 
void printParams ()
 

Private Member Functions

void MakeEnvelope ()
 
 BarrelConstruction (const BarrelConstruction &)
 
BarrelConstructionoperator= (const BarrelConstruction &)
 

Private Attributes

const LArGeo::VDetectorParametersm_parameters {}
 
bool m_A_SAGGING {}
 
int m_NVISLIM {-1}
 
GeoIntrusivePtr< GeoFullPhysVol > m_ecamPhysicalPos {}
 
GeoIntrusivePtr< GeoFullPhysVol > m_ecamPhysicalNeg {}
 
bool m_fullGeo {}
 

Detailed Description

Definition at line 21 of file BarrelConstruction.h.

Constructor & Destructor Documentation

◆ BarrelConstruction() [1/2]

LArGeo::BarrelConstruction::BarrelConstruction ( bool  fullGeo,
const VDetectorParameters params 
)

Definition at line 107 of file BarrelConstruction.cxx.

110  m_fullGeo(fullGeo)
111 {
112 }

◆ ~BarrelConstruction()

LArGeo::BarrelConstruction::~BarrelConstruction ( )
virtualdefault

◆ BarrelConstruction() [2/2]

LArGeo::BarrelConstruction::BarrelConstruction ( const BarrelConstruction )
private

Member Function Documentation

◆ GetNegativeEnvelope()

GeoIntrusivePtr< GeoFullPhysVol > LArGeo::BarrelConstruction::GetNegativeEnvelope ( )

Definition at line 126 of file BarrelConstruction.cxx.

126  {
128  return m_ecamPhysicalNeg;
129 }

◆ GetPositiveEnvelope()

GeoIntrusivePtr< GeoFullPhysVol > LArGeo::BarrelConstruction::GetPositiveEnvelope ( )

Definition at line 121 of file BarrelConstruction.cxx.

121  {
123  return m_ecamPhysicalPos;
124 }

◆ MakeEnvelope()

void LArGeo::BarrelConstruction::MakeEnvelope ( )
private

Definition at line 131 of file BarrelConstruction.cxx.

132 {
133  ISvcLocator *svcLocator = Gaudi::svcLocator();
134  IMessageSvc * msgSvc;
135  if (svcLocator->service("MessageSvc", msgSvc, true )==StatusCode::FAILURE) {
136  throw std::runtime_error("Error in BarrelConstruction, cannot access MessageSvc");
137  }
138  MsgStream log(msgSvc, "BarrelConstruction");
139 
140 
141  log << MSG::DEBUG;
142 
143  log << "++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
144  log << "+ +" << std::endl;
145  log << "+ Start of Barrel EM GeoModel definition +" << std::endl;
146  log << "+ +" << std::endl;
147  log << "++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
148 
149  log << " " << std::endl;
150  log << "Sagging in geometry " << m_A_SAGGING << std::endl;
151  log << " " << std::endl;
152  log << " " << endmsg;
153 
154  if(msgSvc->outputLevel("BarrelConstruction") <= MSG::DEBUG) {
155  printParams();
156  }
157 
158  bool doDetailedAbsorberStraight = false;
159  bool doDetailedAbsorberFold = false;
160 
161  IGeoModelSvc *geoModel;
162  IRDBAccessSvc* rdbAccess;
163  if(svcLocator->service ("GeoModelSvc",geoModel) == StatusCode::FAILURE)
164  throw std::runtime_error("Error in BarrelConstruction, cannot access GeoModelSvc");
165  if(svcLocator->service ("RDBAccessSvc",rdbAccess) == StatusCode::FAILURE)
166  throw std::runtime_error("Error in BarrelConstruction, cannot access RDBAccessSvc");
167  DecodeVersionKey larVersionKey(geoModel, "LAr");
168 
169  log << MSG::INFO << "Getting primary numbers for " << larVersionKey.node() << ", " << larVersionKey.tag() << endmsg;
170 
171  IRDBRecordset_ptr switchSet = rdbAccess->getRecordsetPtr("LArSwitches", larVersionKey.tag(), larVersionKey.node());
172  if ((*switchSet).size() !=0) {
173  const IRDBRecord *switches = (*switchSet)[0];
174  if (!switches->isFieldNull("DETAILED_ABSORBER")) {
175  if (switches->getInt("DETAILED_ABSORBER") !=0) {
176  log << MSG::DEBUG << " DETAILED_ABSORBER is 1 " << endmsg;
177  doDetailedAbsorberStraight = true;
178  doDetailedAbsorberFold = true;
179  } else {
180  log << MSG::DEBUG << " DETAILED_ABSORBER is 0 " << endmsg;
181  }
182  } else {
183  log << MSG::DEBUG << " no DETAILED_ABSORBER structure in DB " << endmsg;
184  }
185  } else {
186  log << MSG::WARNING << " LArSwitches structure not found " << endmsg;
187  }
188 
189  log << MSG::INFO << " Makes detailed absorber sandwich ? " << doDetailedAbsorberStraight << " " << doDetailedAbsorberFold << endmsg;
190  log << MSG::INFO << " Use sagging in geometry ? " << m_A_SAGGING << endmsg;
191 
192  GeoGenfun::Cos Cos;
193  GeoGenfun::Sin Sin;
194  GeoGenfun::Sqrt Sqrt;
195  GeoGenfun::ATan ATan;
196 
197  double twopi64 = Gaudi::Units::pi/32.;
198  double twopi32 = 2.*twopi64;
199 
200 
202  if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) {
203  throw std::runtime_error("Error in LArDetectorFactory, cannot access DetectorStore");
204  }
205 
206 
207  StoredMaterialManager* materialManager = nullptr;
208  if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) {
209  throw std::runtime_error("Error in BarrelConstruction, stored MaterialManager is not found.");
210  }
211 
212  const GeoMaterial *Iron = materialManager->getMaterial("std::Iron");
213  if (!Iron) throw std::runtime_error("Error in BarrelConstruction, std::Iron is not found.");
214 
215  const GeoMaterial *LAr = materialManager->getMaterial("std::LiquidArgon");
216  if (!LAr) throw std::runtime_error("Error in BarrelConstruction, std::LiquidArgon is not found.");
217 
218  const GeoMaterial *Lead = materialManager->getMaterial("std::Lead");
219  if (!Lead) throw std::runtime_error("Error in BarrelConstruction, std::Lead is not found.");
220 
221  const GeoMaterial *G10_bar = materialManager->getMaterial("LAr::G10_bar");
222  if (!G10_bar) throw std::runtime_error("Error in BarrelConstruction, LAr::G10_bar is not found.");
223 
224  const GeoMaterial *Moth_elect = materialManager->getMaterial("LAr::MBoards");
225  if (!Moth_elect) throw std::runtime_error("Error in BarrelConstruction, LAr::MBoards is not found.");
226 
227  const GeoMaterial *Cable_elect = materialManager->getMaterial("LAr::Cables");
228  if (!Cable_elect) throw std::runtime_error("Error in BarrelConstruction, LAr::Cables is not found.");
229 
230  const GeoMaterial *Thin_abs = materialManager->getMaterial("LAr::Thinabs");
231  if (!Thin_abs) throw std::runtime_error("Error in BarrelConstruction, LAr::Thinabs is not found.");
232 
233  const GeoMaterial *Thick_abs = materialManager->getMaterial("LAr::Thickabs");
234  if (!Thick_abs) throw std::runtime_error("Error in BarrelConstruction, LAr::Thickabs is not found.");
235 
236  const GeoMaterial *Kapton_Cu = materialManager->getMaterial("LAr::KaptonC");
237  if (!Kapton_Cu) throw std::runtime_error("Error in BarrelConstruction, LAr::KaptonC is not found.");
238 
239  const GeoMaterial *Sumb = materialManager->getMaterial("LAr::SBoard");
240  if (!Sumb) throw std::runtime_error("Error in BarrelConstruction, LAr::SBoard is not found.");
241 
242  const GeoMaterial *Glue = materialManager->getMaterial("LAr::Glue");
243  if (!Glue) throw std::runtime_error("Error in BarrelConstruction, LAr::Glue is not found.");
244 
245  const GeoElement *Pb = materialManager->getElement("Lead");
246  if (!Pb) throw std::runtime_error("Error in BarrelConstruction, element lead not found ");
247 
248  const GeoElement *Fe = materialManager->getElement("Iron");
249  if (!Fe) throw std::runtime_error("Error in BarrelConstruction, element Fe not found ");
250 
251 
252  double contract = m_parameters->GetValue("LArEMBAbsorberContraction");
253 
254  double density_lead = Lead->getDensity()/(contract*contract*contract);
255  GeoRef<GeoMaterial> myLead (new GeoMaterial("myLead",density_lead));
256  myLead->add(Pb,1.0);
257  myLead->lock();
258 
259  double density_iron = Iron->getDensity()/(contract*contract*contract);
260  GeoRef<GeoMaterial> myIron (new GeoMaterial("myIron",density_iron));
261  myIron->add(Fe,1.0);
262  myIron->lock();
263 
264 
265 
266 #ifdef DEBUGGEO
267  std::cout << "*** BarrelConstruction: List of Materials, density,X0,Lambda " << std::endl;
268  std::cout << " Iron " << Iron->getDensity() << " "
269  << Iron->getRadLength() << " "
270  << Iron->getIntLength() << std::endl;
271  std::cout << " LAR " << LAr->getDensity() << " "
272  << LAr->getRadLength() << " "
273  << LAr->getIntLength() << std::endl;
274  std::cout << " G10_bar " << G10_bar->getDensity() << " "
275  << G10_bar->getRadLength() << " "
276  << G10_bar->getIntLength() << std::endl,
277  std::cout << " Moth_elect " << Moth_elect->getDensity() << " "
278  << Moth_elect->getRadLength() << " "
279  << Moth_elect->getIntLength() << std::endl;
280  std::cout << " Cable " << Cable_elect->getDensity() << " "
281  << Cable_elect->getRadLength() << " "
282  << Cable_elect->getIntLength() << std::endl;
283  std::cout << " Sumb " << Sumb->getDensity() << " "
284  << Sumb->getRadLength() << " "
285  << Sumb->getIntLength() << std::endl;
286  std::cout << " Thin_abs " << Thin_abs->getDensity() << " "
287  << Thin_abs->getRadLength() << " "
288  << Thin_abs->getIntLength() << std::endl;
289  std::cout << " Thick_abs " << Thick_abs->getDensity() << " "
290  << Thick_abs->getRadLength() << " "
291  << Thick_abs->getIntLength() << std::endl;
292  std::cout << " Kapton_Cu " << Kapton_Cu->getDensity() << " "
293  << Kapton_Cu->getRadLength() << " "
294  << Kapton_Cu->getIntLength() << std::endl;
295 #endif
296  std::string baseName = "LAr::EMB::";
297 
298 
299  // -------------------------------------------------------------
300  // start Detector geometry
301  //--------------------------------------------------------------
302 
303  double Moth_Z_min = m_parameters->GetValue("LArEMBMotherZmin");
304  double Moth_Z_max = m_parameters->GetValue("LArEMBMotherZmax");
305 
306  // radius and phi ranges of EM barrel
307 
308  double Moth_inner_radius = m_parameters->GetValue("LArEMBMotherRmin");
309  double Moth_outer_radius = m_parameters->GetValue("LArEMBMotherRmax");
310 
311  double Moth_Phi_Min = 0.;
312  double Moth_Phi_Max = m_parameters->GetValue("LArEMBphiMaxBarrel")*Gaudi::Units::deg;
313 
314 #ifdef DEBUGGEO
315  std::cout << " *** Mother volume (Ecam) parameters " << std::endl;
316  std::cout << " Rmin/Rmax " << Moth_inner_radius << " " << Moth_outer_radius << std::endl;
317  std::cout << " Zmin/Zmax " << Moth_Z_min << " " << Moth_Z_max << std::endl;
318  std::cout << " phi1,Dphi (Gaudi::Units::deg)" << Moth_Phi_Min/Gaudi::Units::deg << " " << Moth_Phi_Max/Gaudi::Units::deg << std::endl;
319 #endif
320 
321  // number of zigs for accordion
322  int Nbrt = (int) ( m_parameters->GetValue("LArEMBnoOFAccZigs") ); // =14
323 
324  // Z coordinates for half barrel in
325  double Bar_Z_min = Moth_Z_min;
326  double Bar_Z_max = Moth_Z_max;
327 
328  // Radius of the first fold
329 //GU -> to be consistent with hard coded geometry
330  double Rhocen1 = m_parameters->GetValue("LArEMBRadiusAtCurvature",0);
331 
332  // R and Z coordinates of ETA_cuts.
333  double Bar_Eta_cut = (double) (m_parameters->GetValue("LArEMBMaxEtaAcceptance"));
334 #ifdef DEBUGGEO
335  std::cout << " Bar_Eta_cut " << Bar_Eta_cut << std::endl;
336 #endif
337 
338  double Bar_Z_cut, Bar_Rcmx ;
339 // z max at low radius
340  Bar_Z_cut = (double) (m_parameters->GetValue("LArEMBMotherZmin"))
341  + (double) (m_parameters->GetValue("LArEMBG10FrontDeltaZ"));
342 // minimal radius at Bar_z_max
343  Bar_Rcmx = (double) (m_parameters->GetValue("LArEMBRminHighZ"));
344 
345  double Zp0 = 0.;
346 
347  // Half-length of this Half barrel
348  double Zhalf = (Bar_Z_max-Bar_Z_min)/2.;
349  // Half-length of the half barrel up to Zcut
350  double Zhalfc = (Bar_Z_cut-Bar_Z_min)/2.;
351 
352 
353  // Accordion shape parameters:
354  // rho phi of curvature centers and delta's
355  // IN 2D_transverse LOCAL framework of a layer and symetry axis as X_axis
356  // delta's are GEOMETRICAL angles of straight parts w.r. the Y_axis )
357 
358  double Rhocen[15], Phicen[15], Delta[15], deltay[15], deltax[15], TetaTrans[15];
359  for (int idat=0; idat<15; idat++)
360  {
361  Rhocen[idat] =
362  (double) (m_parameters->GetValue("LArEMBRadiusAtCurvature",idat));
363  Phicen[idat] =
364  (double) (m_parameters->GetValue("LArEMBPhiAtCurvature",idat));
365  Delta[idat] =
366  (double) (m_parameters->GetValue("LArEMBDeltaZigAngle",idat));
367  if(idat == 14) Delta[idat] = (90.0) * Gaudi::Units::deg;
368 
369  // Maximum SAGGING displacement for each of the fifteen folds in Gaudi::Units::mm
370  // (should be 0.0, 0.17, 0.30, 0.63, 0.78, 1.06, 1.09, 1.21, 1.07, 1.03, 0.74, 0.61, 0.27, 0.20, 0.0)
371 //GUtmp sagging amplied by 10
372  if (m_A_SAGGING) {
373  deltay[idat] =
374  (double) (m_parameters->GetValue("LArEMBSaggingAmplitude",idat));
375  deltax[idat] =
376  (double) (m_parameters->GetValue("LArEMBSaggingAmplitude2",idat));
377  }
378  else {
379  deltay[idat]=0.;
380  deltax[idat]=0.;
381  }
382 
383  // eta of lead transition
384  double etaTrans = (double) (m_parameters->GetValue("LArEMBEtaTrans",idat));
385  TetaTrans[idat] = 2.*atan(exp(-etaTrans));
386 
387 // #ifdef DEBUGGEO
388  log << MSG::DEBUG << "idat " << idat << " Rhocen/Phice/Delta/deltay/deltax/etatrans "
389  << Rhocen[idat] << " " << Phicen[idat]*(1./Gaudi::Units::deg) << " "
390  << Delta[idat]*(1./Gaudi::Units::deg) << " " << deltay[idat] << " " << deltax[idat]
391  << " " << etaTrans << endmsg;
392 // #endif
393 
394 
395  }
396 
397 // parity of accordion waves
398  int checkParity=0; // for case where first absorber wave goes up
399  if (Phicen[0]<0.) checkParity=1; // case where first absorber wave goes down
400 
401 
402  int Ncell = (int) (m_parameters->GetValue("LArEMBnoOFPhysPhiCell"));
403  int Nabsorber = (Ncell==64) ? Ncell + 1 : Ncell;
404  int Nelectrode = Ncell;
405 
406  // If the user has specifically limited the number of cells (e.g. for visualization)
407  // then only create this number....
408  if (m_NVISLIM > 0) Nabsorber = m_NVISLIM;
409  if (m_NVISLIM > 0) Nelectrode = m_NVISLIM;
410  if (m_NVISLIM > 0) {
411  log << MSG::WARNING;
412  log << "================LAr BarrelConstruction===========================" << std::endl;
413  log << "===YOU ARE RUNNING WITH A LIMITED SLICE OF BARREL ACCORDEON ===" << std::endl;
414  log << "===THIS OPTION IS FOR VISUALIZATION OR OTHER TESTING, ONLY!! ===" << std::endl;
415  log << "===AND IF THIS IS NOT YOUR INTENTION PLEASE BE SURE TO SET ===" << std::endl;
416  log << "===THE FLAG GeoModelSvc.LArDetectorTool.BarrelCellVisLimit=-1 ===" << std::endl;
417  log << "===Remember there are no defaults in Athena. Thank you. ===" << std::endl;
418  log << "=================================================================" << std::endl;
419  log << MSG::INFO;
420  }
421 
422 
423 // z of end of G10 ring
424  double z1 = m_parameters->GetValue("LArEMBG10FrontDeltaZ")+ Moth_Z_min;
425 // radius of end of G10 ring
426  const double r1 = Moth_inner_radius
427  + m_parameters->GetValue("LArEMBInnerElectronics")
428  + m_parameters->GetValue("LArEMBG10SupportBarsIn");
429 // minimum radius at end of volume
430  const double r2 = m_parameters->GetValue("LArEMBRminHighZ");
431  const double inv_r2_r1 = 1. / (r2-r1);
432 
433 // max z of Stac (@ r = Rhocen[0] )
434  double zmax1_Stac = z1 + (Rhocen[0]-r1)*(Moth_Z_max-z1)*inv_r2_r1;
435 
436 
437  // Construct the container volume (Accordion plates, G10 bars, etc...)
438  // for the LAr in the Barrel
439  // That is the volume ECAM
440  // Define the volume into which we'll place all other EMB elements.
441  // ==GU 11/06/2003
442  // in test beam case need to have ECAM between -1.555 and size 24.055 degrees
443  // (i.e. a little bit wider than one calorimeter module)
444  // (we need to have ECAM volume sligthly wider than STAC to avoid G4 tracking becoming
445  // very confused at the common surface between ECAM and STAC)
446  //-----------------ECAM---------------------------------------------------------//
447  { //
448  double Moth_Phi_Min2 = (Ncell == 64) ? -1.555*Gaudi::Units::deg : 0.; //
449  double Moth_Phi_Max2 = (Ncell == 64) ? 25.61*Gaudi::Units::deg : 2*M_PI; //
450  //
451  double safety_rhocen1 = 0.040*Gaudi::Units::mm; //
452  double Zplan[] = {Bar_Z_min-Zp0,Bar_Z_cut-Zp0,Bar_Z_max-Zp0}; //
453  double Riacc[] = {Moth_inner_radius,Moth_inner_radius, Rhocen1-safety_rhocen1}; //
454  double Roacc[] = {Moth_outer_radius,Moth_outer_radius,Moth_outer_radius}; //
455  //
456 #ifdef DEBUGGEO
457  std::cout << " *** Parameters for ECAM Pcon volume " << std::endl;
458  std::cout << " Zplan " << Zplan[0] << " " << Zplan[1] << " " << Zplan[2] << std::endl;
459  std::cout << " Rin " << Riacc[0] << " " << Riacc[1] << " " << Riacc[2] << std::endl;
460  std::cout << " Rout " << Roacc[0] << " " << Roacc[1] << " " << Roacc[2] << std::endl;
461  std::cout << " PhiMin,Dphi " << Moth_Phi_Min2/Gaudi::Units::deg << " " << Moth_Phi_Max2/Gaudi::Units::deg << std::endl;
462 #endif
463  int ecamArraySize = sizeof(Zplan) / sizeof(double); //
464  std::string name = baseName + "ECAM"; //
465  GeoPcon* pCon = new GeoPcon(Moth_Phi_Min2, // starting phi //
466  Moth_Phi_Max2); // moth_phi_max2=Dphi //
467  // //
468  for (int i=0; i< ecamArraySize; i++) //
469  { //
470  pCon->addPlane(Zplan[i],Riacc[i],Roacc[i]); //
471  } //
472  const GeoLogVol* logVol = new GeoLogVol(name,pCon,LAr); //
473  m_ecamPhysicalPos = new GeoFullPhysVol(logVol); //
474  m_ecamPhysicalNeg = new GeoFullPhysVol(logVol); //
475  //
476  // store FullPhysicalVolumes in the manager //
477  //_manager->set_volLink(CaloSubdetNames::EMB_POS,m_ecamPhysicalPos); //
478  //_manager->set_volLink(CaloSubdetNames::EMB_NEG,m_ecamPhysicalNeg); //
479  {
481  StatusCode status=detStore->record(sPhysVol,"EMB_POS");
482  if(!status.isSuccess()) throw std::runtime_error ("Cannot store EMB_POS");
483  }
484  {
486  StatusCode status=detStore->record(sPhysVol,"EMB_NEG");
487  if(!status.isSuccess()) throw std::runtime_error ("Cannot store EMB_NEG");
488  }
489  } //
490  //------------------------------------------------------------------------------//
491 
492  if(!m_fullGeo) return;
493 
494  //
495  // Front and Back ELECTRONICS in ECAM
496  //
497 #ifdef BUILD_FRONT_ELECTRONICS
498 
499  // Front Electronics are in a TUBE
500 
501 
502  //-----------------TELF---------------------------------------------------------//
503  GeoIntrusivePtr<GeoPhysVol>Elnicsf_phys=nullptr;
504  double Xel1f;
505  {
506  // WARNING : this "hard_coded" 0.010*Gaudi::Units::mm is a "security" to avoid
507  // fake "overlapping" diagnostics with "DAVID"
508  Xel1f = m_parameters->GetValue("LArEMBInnerElectronics"); // 23.*Gaudi::Units::mm
509  double DeltaZ = Zhalfc;
510  double Zpos = Zhalfc+Bar_Z_min;
511  double Rmini = Moth_inner_radius + 0.010*Gaudi::Units::mm;
512  double Rmaxi = Rmini+Xel1f - 0.010*Gaudi::Units::mm;
513  std::string name = baseName + "TELF";
514 #ifdef DEBUGGEO
515  std::cout << " *** parameters for TELF tubs " << std::endl;
516  std::cout << " DeltaZ " << DeltaZ << std::endl;
517  std::cout << " Rmin/Rmax " << Rmini << " " << Rmaxi << std::endl,
518  std::cout << " PhiMin,Dphi " << Moth_Phi_Min/Gaudi::Units::deg << " " << Moth_Phi_Max/Gaudi::Units::deg << std::endl;
519  std::cout << " Zpos in ECAM " << Zpos << std::endl;
520 #endif
521  GeoTubs* tubs = new GeoTubs(Rmini, // rmin
522  Rmaxi, // rmax
523  DeltaZ, // deltaZ/2.
524  Moth_Phi_Min, // phi min
525  Moth_Phi_Max); // deltaphi
526  const GeoLogVol* logVol = new GeoLogVol(name,tubs,LAr);
527  Elnicsf_phys = new GeoPhysVol(logVol);
528  m_ecamPhysicalPos->add(new GeoTransform(GeoTrf::TranslateZ3D(Zpos)));
529  m_ecamPhysicalPos->add(Elnicsf_phys);
530  m_ecamPhysicalNeg->add(new GeoTransform(GeoTrf::TranslateZ3D(Zpos)));
531  m_ecamPhysicalNeg->add(Elnicsf_phys);
532  }
533  //------------------------------------------------------------------------------//
534 
535 
536  // GU 28-07-2005
537  //------- effective Copper + LAr mixture to accoung for pins+summing boards
538  // (follow mixture described in Pascal Perrodo note
539  GeoIntrusivePtr<GeoPhysVol>Sumb_phys=nullptr;
540  {
541  double ThickSum = 10.*Gaudi::Units::mm; // FIXME should be in geometry database
542  double Rmini = Moth_inner_radius+Xel1f-ThickSum;
543  double Rmaxi = Moth_inner_radius+Xel1f -0.020*Gaudi::Units::mm; // safety margin
544  double DeltaZ = Zhalfc;
545  double Zpos=0.;
546  std::string name = baseName + "SUMB";
547 #ifdef DEBUGGEO
548  std::cout << " *** parameters for SUMB tubs " << std::endl;
549  std::cout << " DeltaZ " << DeltaZ << std::endl;
550  std::cout << " Rmin/Rmax " << Rmini << " " << Rmaxi << std::endl,
551  std::cout << " PhiMin,Dphi " << Moth_Phi_Min/Gaudi::Units::deg << " " << Moth_Phi_Max/Gaudi::Units::deg << std::endl;
552  std::cout << " Zpos in TELF " << Zpos << std::endl;
553 #endif
554 
555  GeoTubs * tubs = new GeoTubs(Rmini,Rmaxi,DeltaZ,Moth_Phi_Min,Moth_Phi_Max);
556  const GeoLogVol* logVol = new GeoLogVol(name,tubs,Sumb);
557  Sumb_phys = new GeoPhysVol(logVol);
558  Elnicsf_phys->add(new GeoTransform(GeoTrf::TranslateZ3D(Zpos)));
559  Elnicsf_phys->add(Sumb_phys);
560  }
561 
562 
563  // Solids and Logical Volumes for Mother_Boards and cables-------------------//
564  {
565  double ClearancePS = m_parameters->GetValue("LArEMBMoBoclearfrPS");
566  double RhoPosB = Moth_inner_radius + ClearancePS;
567  double bdx = .5*(m_parameters->GetValue("LArEMBMoBoTchickness")); // 4.3/2.*Gaudi::Units::mm
568  double bdy = .5*(m_parameters->GetValue("LArEMBMoBoHeight")); // 72.3/2.*Gaudi::Units::mm;
569  double bdz = Zhalfc - 0.007*Gaudi::Units::mm;
570 
571  //------------------------MOTHERBOARDS--------------------------------------------//
572  // JFB Make & Place the motherboards inside overall tube //
573  { //
574  double PhiOrig = 0.; //
575  int NoOFboard = (int) m_parameters->GetValue("LArEMBnoOFmothboard"); // 32
576  double PhiPos0 = twopi64 + PhiOrig; //
577  // //
578  std::string name = baseName + "MOAC"; //
579 #ifdef DEBUGGEO
580  std::cout << " *** parameters for MotherBoard (box)" << std::endl;
581  std::cout << " dx,dy,dz " << bdx << " " << bdy << " " << bdz << std::endl;
582  std::cout << " Radius pos " << RhoPosB << std::endl;
583  std::cout << " Phi0,Dphi " << PhiPos0/Gaudi::Units::deg << " " << twopi32/Gaudi::Units::deg << std::endl;
584 #endif
585  GeoBox * box = new GeoBox(bdx,bdy,bdz); //
586  const GeoLogVol * logVol = new GeoLogVol(name,box,Moth_elect); //
587  GeoPhysVol * pV = new GeoPhysVol(logVol); //
588  GeoSerialIdentifier * iD = new GeoSerialIdentifier(0); //
589  GeoGenfun::Variable c; //
590  GeoGenfun::GENFUNCTION PhiPos = PhiPos0 + twopi32*c; //
591  GeoXF::TRANSFUNCTION TX = //
592  GeoXF::Pow(GeoTrf::TranslateX3D(1.0),RhoPosB*Cos(PhiPos))* //
593  GeoXF::Pow(GeoTrf::TranslateY3D(1.0),RhoPosB*Sin(PhiPos))* //
594  GeoXF::Pow(GeoTrf::RotateZ3D(1.0),PhiPos); //
595  GeoSerialTransformer *st = new GeoSerialTransformer(pV, &TX, NoOFboard); //
596  Elnicsf_phys->add(iD); //
597  Elnicsf_phys->add(st); //
598  // //
599  } //
600  //--------------------------------------------------------------------------------//
601 
602  //** GU: GeoModel GeoTrap constructor only has the 11 argument
603  // full list and not some possible shorter versions of G4
604  // => add the needed arguments
605  // Dz=Dzc,Theta=0,Phi=0,DyDzn=Dy1,DxDyndzn=Dx1 Dxdypdzn=Dx1
606  // Angleydzn=0, DyDzp=Dy2,Dxdnydzp=Dx2,dwdypdzp=Dx2
607  // Angleydzp=0
608  //---------------------------------CABLES-----------------------------------------//
609  // JFB Place the cables //
610  { //
611  // //
612  double Dzc = Zhalfc - 0.007*Gaudi::Units::mm; //
613  double Dx1 = .5*(m_parameters->GetValue("LArEMBCablethickat0")); // 1./2.*Gaudi::Units::mm
614  double Dx2 = .5*Bar_Eta_cut*(m_parameters->GetValue("LArEMBthickincrfac")); //
615  // Dx2 should be 5.17/2.*Bar_Eta_cut*Gaudi::Units::mm Trapezoid's side linear with Eta //
616  double Dy1 = .5*(m_parameters->GetValue("LArEMBCableEtaheight")); // 70./2.*Gaudi::Units::mm
617  double Dy2 = Dy1; //
618  // //
619  int NoOFcable = (int) m_parameters->GetValue("LArEMBnoOFcableBundle"); // 64
620  double RhoPosC = Moth_inner_radius + ClearancePS; //
621  // //
622  std::string name = baseName + "CAAC"; //
623 #ifdef DEBUGGEO
624  std::cout << " *** Parameters for Cable (Trap) " << std::endl;
625  std::cout << " Dzc " << Dzc << std::endl;
626  std::cout << " Dx1,Dx2 (half thickness at eta=0 and etamax " << Dx1 << " " << Dx2 << std::endl;
627  std::cout << " Dy1,Dy2 " << Dy1 << " " << Dy2 << std::endl;
628  std::cout << " Radial Position " << RhoPosC << std::endl;
629 #endif
630  // GeoTrap* trap = new GeoTrap(Dx1,Dx2,Dy1,Dy2,Dzc); //
631  GeoTrap* trap = new GeoTrap(Dzc,0.,0.,Dy1,Dx1,Dx1,0., //
632  Dy2,Dx2,Dx2,0.); //
633  const GeoLogVol* logVol = new GeoLogVol(name,trap,Cable_elect); //
634  // //
635  GeoPhysVol * pV = new GeoPhysVol(logVol); //
636  GeoSerialIdentifier * iD = new GeoSerialIdentifier(0); //
637  double PhiPos0 = (twopi64 - asin(bdy/RhoPosB))/2.; //
638 #ifdef DEBUGGEO
639  std::cout << " PhiPos0 " << PhiPos0 << std::endl;
640 #endif
641  GeoGenfun::Variable I; //
642  // //
643  // -------------Make a Kronecker Delta Here--------// //
644  GeoGenfun::Rectangular KDelta; // //
645  KDelta.baseline().setValue(0.0); // //
646  KDelta.height().setValue(1.0); // //
647  KDelta.x0().setValue(-0.5); // //
648  KDelta.x1().setValue(0.5); // //
649  //-------------------------------------------------// //
650  // //
651  GeoGenfun::Mod Mod1(1.0),Mod2(2.0),Mod4(4.0); //
652  GeoGenfun::GENFUNCTION Int = I - Mod1; //
653  GeoGenfun::GENFUNCTION Ccopy = Int(I + 0.5); //
654  GeoGenfun::GENFUNCTION PhiOrig = 22.5*Gaudi::Units::deg*Int(Ccopy/4); //
655  GeoGenfun::GENFUNCTION PhiPos1 = PhiPos0 + PhiOrig; //
656  GeoGenfun::GENFUNCTION PhiPos2 = twopi32 - PhiPos0 + PhiOrig; //
657  GeoGenfun::GENFUNCTION PhiPos00 = //
658  (KDelta(Mod4(Ccopy)-2) + KDelta(Mod4(Ccopy)-3))*PhiPos2 + //
659  (1.0-KDelta(Mod4(Ccopy)-2)-KDelta(Mod4(Ccopy)-3))*PhiPos1; //
660  GeoGenfun::GENFUNCTION PhiPos = PhiPos00 + Mod2(Ccopy)*twopi32; //
661  GeoXF::TRANSFUNCTION TX = //
662  GeoXF::Pow(GeoTrf::TranslateX3D(1.0),RhoPosC*Cos(PhiPos))* //
663  GeoXF::Pow(GeoTrf::TranslateY3D(1.0),RhoPosC*Sin(PhiPos))* //
664  GeoXF::Pow(GeoTrf::RotateZ3D(1.0),PhiPos); //
665  GeoSerialTransformer *st = new GeoSerialTransformer(pV, &TX, NoOFcable); //
666 #ifdef DEBUGGEO
667  for (int ii=0;ii<NoOFcable;ii++) {
668  std::cout << "copy, phi " << ii << " " << PhiPos(ii)/Gaudi::Units::deg << std::endl;
669  }
670 #endif
671  Elnicsf_phys->add(iD); //
672  Elnicsf_phys->add(st); //
673  // //
674  } //
675  //--------------------------------------------------------------------------------//
676  }
677 #endif // BUILD_FRONT_ELECTRONICS
678 
679  // add 1.3 Gaudi::Units::mm in z to allow cleareance for absorber with non //
680  // 0 thickness, at eta=1.475, low r part of the barrel //
681  // this affects STAC and TELB volumes //
682  double clearance = 1.3*Gaudi::Units::mm;
683 
684 #ifdef BUILD_HIGHETA_ELECTRONICS
685 
686  // back electronics are in an extruded cone
687  //
688  // ***GU: GeoCons be very careful, the order of the arguments
689  // is NOT the same as in G4Cons routine!!!
690  // G4 order: Rmin1,Rmax1,Rmin2,Rmax2,DeltaZ,phi0,Dphi
691  // Geo order: Rmin1,Rmin2,Rmax1,Rmax2,DeltaZ,phi0,Dphi
692  //---------------------------------HIGHETA ELECTRONICS----------------------------//
693  { //
694  // //
695  // GU fix of TELB //
696  double ze1= zmax1_Stac+clearance; //
697  double ze2 = Bar_Z_max; //
698  double safety = 0.05*Gaudi::Units::mm;
699  double DeltaZ = 0.5*(ze2-ze1)-safety; // 50 micron for safety.
700  double Zpos = ze1+DeltaZ+0.5*safety; //
701  double Rmini1 = Rhocen[0] - .030*Gaudi::Units::mm; //
702  double Rmaxi1 = Rhocen[0] - .020*Gaudi::Units::mm; //
703  double Rmini2 = Rhocen[0] - .030*Gaudi::Units::mm; //
704  double Rmaxi2 = Bar_Rcmx - clearance - .070*Gaudi::Units::mm; //
705  std::string name = baseName + "TELB"; //
706 #ifdef DEBUGGEO
707  std::cout << " *** Parameters for high eta electronics (Cons) " <<std::endl;
708  std::cout << " Rmini1,Rmini2,Rmaxi1,Rmaxi2 " << Rmini1 << " " << Rmini2 << " "
709  << Rmaxi1 << " " << Rmaxi2 << std::endl,
710  std::cout << " DeltaZ " << DeltaZ << std::endl;
711  std::cout << " Phi_Min,Dphi " << Moth_Phi_Min/Gaudi::Units::deg << " " << Moth_Phi_Max/Gaudi::Units::deg << std::endl;
712  std::cout << " Zpos " << Zpos << std::endl;
713 #endif
714  GeoCons* cons = new GeoCons(Rmini1,Rmini2,Rmaxi1,Rmaxi2, //
715  DeltaZ,Moth_Phi_Min,Moth_Phi_Max); //
716  const GeoLogVol* logVol = new GeoLogVol(name,cons,Cable_elect); //
717  GeoIntrusivePtr<GeoPhysVol> physVol = new GeoPhysVol(logVol); //
718  m_ecamPhysicalPos->add(new GeoTransform(GeoTrf::TranslateZ3D(Zpos))); //
719  m_ecamPhysicalPos->add(physVol); //
720  m_ecamPhysicalNeg->add(new GeoTransform(GeoTrf::TranslateZ3D(Zpos))); //
721  m_ecamPhysicalNeg->add(physVol); //
722  // //
723  } //
724  //--------------------------------------------------------------------------------//
725 
726 #endif // BUILD_HIGHETA_ELECTRONICS
727 
728 
729 //
730 // Front and back G10 : TUBES in ECAM
731 //
732 
733 #ifdef BUILD_FRONT_G10
734 
735 
736  //---------------------------------FRONT G10-------------------------------------//
737  { //
738  double Xel1f = m_parameters->GetValue("LArEMBInnerElectronics"); // 23.*Gaudi::Units::mm
739  double Xg10f = m_parameters->GetValue("LArEMBG10SupportBarsIn"); // 20.*Gaudi::Units::mm
740  double DeltaZ = 0.5* m_parameters->GetValue("LArEMBG10FrontDeltaZ"); //
741  double Zpos = DeltaZ+Bar_Z_min; //
742  double Rmini = Moth_inner_radius + Xel1f; //
743  double Rmaxi = Rmini+Xg10f; //
744  std::string name = baseName + "GTENF"; //
745 #ifdef DEBUGGEO
746  std::cout << " *** parameters for front G10 ring (tubs) " << std::endl;
747  std::cout << " Rmini,Rmaxi " << Rmini << " " << Rmaxi << std::endl;
748  std::cout << " DeltaZ " << DeltaZ << std::endl;
749  std::cout << " phimin,dphi " << Moth_Phi_Min/Gaudi::Units::deg << " " << Moth_Phi_Max/Gaudi::Units::deg << std::endl;
750  std::cout << " Zpos " << Zpos << std::endl;
751 #endif
752  GeoTubs* tubs = new GeoTubs(Rmini,Rmaxi,DeltaZ,Moth_Phi_Min,Moth_Phi_Max); //
753  const GeoLogVol* logVol = new GeoLogVol(name,tubs,G10_bar); //
754  GeoIntrusivePtr<GeoPhysVol> physVol = new GeoPhysVol(logVol); //
755  m_ecamPhysicalPos->add(new GeoTransform(GeoTrf::TranslateZ3D(Zpos))); //
756  m_ecamPhysicalPos->add(physVol); //
757  m_ecamPhysicalNeg->add(new GeoTransform(GeoTrf::TranslateZ3D(Zpos))); //
758  m_ecamPhysicalNeg->add(physVol); //
759 
760  IRDBRecordset_ptr extraCones = rdbAccess->getRecordsetPtr("LArCones",
761  larVersionKey.tag(),
762  larVersionKey.node());
763  if (extraCones->size() > 0 ) {
764  for(const IRDBRecord_ptr& cone : *extraCones) {
765  const std::string& conName = cone->getString("CONE");
766  if (conName=="ExtraInBar") {
767  double extra_dz = 0.5*( cone->getDouble("DZ") );
768  double extra_rmin1 = cone->getDouble("RMIN1");
769  double extra_rmin2 = cone->getDouble("RMIN2");
770  double extra_rmax1 = cone->getDouble("RMAX1");
771  double extra_rmax2 = cone->getDouble("RMAX2");
772  double extra_phi0 = cone->getDouble("PHI0");
773  double extra_dphi = cone->getDouble("DPHI");
774  double extra_zpos = cone->getDouble("ZPOS");
775 
776  std::string name = baseName + "ExtraMat1";
777  GeoCons* cons = new GeoCons(extra_rmin1,extra_rmin2,extra_rmax1,extra_rmax2,
778  extra_dz,extra_phi0,extra_dphi);
779  const GeoLogVol* logVol = new GeoLogVol(name,cons,Lead);
780  GeoIntrusivePtr<GeoPhysVol> physVol2 = new GeoPhysVol(logVol);
781  physVol->add(new GeoTransform(GeoTrf::TranslateZ3D(extra_zpos)));
782  physVol->add(physVol2);
783  }
784  }
785  }
786 
787  } //
788  //-------------------------------------------------------------------------------//
789 #endif // BUILD_FRONT_G10
790 
791 #ifdef BUILD_BACK_G10
792 
793  //---------------------------------BACK G10-------------------------------------//
794  { //
795  double DeltaZ = Zhalf; //
796  double Zpos = Zhalf+Bar_Z_min; //
797  double Xtal = m_parameters->GetValue("LArEMBLArGapTail")+ 0.1*Gaudi::Units::mm; // 13.*Gaudi::Units::mm
798  double Rmini = Rhocen[Nbrt]+Xtal; // //
799  // GU to be sure that GTENB does not go outside mother ECAM volume //
800  // Rmaxi = Rmini+Xg10b; //
801  double Rmaxi = Moth_outer_radius-0.01*Gaudi::Units::mm; // 10 microns for more safety.. //
802  // //
803  std::string name = baseName +"GTENB"; //
804 #ifdef DEBUGGEO
805  std::cout << " *** parameters for back G10 ring (tubs) " << std::endl;
806  std::cout << " Rmini,Rmaxi " << Rmini << " " << Rmaxi << std::endl;
807  std::cout << " DeltaZ " << DeltaZ << std::endl;
808  std::cout << " phimin,dphi " << Moth_Phi_Min/Gaudi::Units::deg << " " << Moth_Phi_Max/Gaudi::Units::deg << std::endl;
809  std::cout << " Zpos " << Zpos << std::endl;
810 #endif
811 
812  GeoTubs* tubs = new GeoTubs(Rmini,Rmaxi,DeltaZ,Moth_Phi_Min,Moth_Phi_Max); //
813  const GeoLogVol* logVol = new GeoLogVol(name,tubs,G10_bar); //
814  GeoIntrusivePtr<GeoPhysVol> physVol = new GeoPhysVol(logVol); //
815  m_ecamPhysicalPos->add(new GeoTransform(GeoTrf::TranslateZ3D(Zpos))); //
816  m_ecamPhysicalPos->add(physVol); //
817  m_ecamPhysicalNeg->add(new GeoTransform(GeoTrf::TranslateZ3D(Zpos))); //
818  m_ecamPhysicalNeg->add(physVol); //
819  } //
820  //------------------------------------------------------------------------------//
821 #endif // BUILD_BACK_G10
822 
823 
824  GeoIntrusivePtr<GeoPhysVol>stacPhysical=nullptr;
825  //---------------------------------ACCORDION VOLUME---------------------------//
826  // STAC = Pcon: LAr volume in which the accordion structure is located //
827  // (the front/back small straight parts are in ECAM not in STAC) //
828  // in test beam case need to have STAC between -1.055 and size 23.555 degrees
829  // (i.e. a little bit wider than one calorimeter module)
830  { //
831 
832  double Moth_Phi_Min2 = (Ncell == 64) ? -1.055*Gaudi::Units::deg : 0.; //
833  double Moth_Phi_Max2 = (Ncell == 64) ? 24.61*Gaudi::Units::deg : 2*M_PI; //
834 
835  double Zplan1[] = {Bar_Z_min,zmax1_Stac+clearance,Bar_Z_max}; //
836  double Riacc1[] = {Rhocen[0],Rhocen[0], Bar_Rcmx-clearance}; //
837  double Roacc1[] = {Rhocen[Nbrt],Rhocen[Nbrt],Rhocen[Nbrt]}; //
838  // //
839  std::string name = baseName + "STAC"; //
840 #ifdef DEBUGGEO
841  std::cout << " *** Parameters for STAC Pcon volume " << std::endl;
842  std::cout << " Zplan " << Zplan1[0] << " " << Zplan1[1] << " " << Zplan1[2] << std::endl;
843  std::cout << " Rin " << Riacc1[0] << " " << Riacc1[1] << " " << Riacc1[2] << std::endl;
844  std::cout << " Rout " << Roacc1[0] << " " << Roacc1[1] << " " << Roacc1[2] << std::endl;
845  std::cout << " PhiMin,Dphi " << Moth_Phi_Min2/Gaudi::Units::deg << " " << Moth_Phi_Max2/Gaudi::Units::deg << std::endl;
846  std::cout << " Zpos " << -Zp0 << std::endl;
847 #endif
848  GeoPcon* pCone = new GeoPcon(Moth_Phi_Min2,Moth_Phi_Max2); //
849  for (int i=0; i<3; i++) pCone->addPlane(Zplan1[i],Riacc1[i],Roacc1[i]); //
850  const GeoLogVol* logVol = new GeoLogVol(name,pCone,LAr); //
851  stacPhysical = new GeoPhysVol(logVol); //
852  m_ecamPhysicalPos->add(new GeoTransform(GeoTrf::TranslateZ3D(-Zp0))); //
853  m_ecamPhysicalPos->add(stacPhysical); //
854  m_ecamPhysicalNeg->add(new GeoTransform(GeoTrf::TranslateZ3D(-Zp0))); //
855  m_ecamPhysicalNeg->add(stacPhysical); //
856  } //
857  //----------------------------------------------------------------------------//
858 
859 #ifdef BUILD_ACCORDION_PLATES
860  {
861  // Construct the straight and the corner parts of the Accordion plates
862 
863  double Xtip_pb = m_parameters->GetValue("LArEMBLeadTipThickFront");
864  double Xtip_pc = m_parameters->GetValue("LArEMBLeadTipThickEnd");
865  double Xtip_gt = m_parameters->GetValue("LArEMBG10TipThickFront");
866  double Xtip_gs = m_parameters->GetValue("LArEMBG10TipThickEnd");
867  double Thgl = m_parameters->GetValue("LArEMBThickAbsGlue");
868  double Thfe = m_parameters->GetValue("LArEMBThickAbsIron");
869  double Thpb = m_parameters->GetValue("LArEMBThickAbsLead");
870  double Thpb_thin = m_parameters->GetValue("LArEMBThinAbsLead");
871  double Thcu = m_parameters->GetValue("LArEMBThickElecCopper");
872  double Thfg = m_parameters->GetValue("LArEMBThickElecKapton");
873  double Psi = m_parameters->GetValue("LArEMBPhiGapAperture"); // 360.*Gaudi::Units::deg/1024
874  double Contract = m_parameters->GetValue("LArEMBAbsorberContraction");
875 
876  double Thce = (Thpb+Thgl+Thfe)*Contract;
877  double Thel = Thcu+Thfg;
878 
879  double Alfa = Psi; // size of one phi cell
880 
881  double Zmin = Bar_Z_min;
882  double Zmax = Bar_Z_max;
883 // Zcp1 = z max for eta=0.8 at the radius of the middle of the fold
884 // Zcp2 = z max for eta=1.475 at the radius of the middle of the fold
885 // Along = lenght of the straight sections
886  double Zcp1[15]={};
887  double Zcp2[15]={};
888  double Along[14]={};
889 
890 // Rhol = radius at the beginning of the straight section
891 // Rhoh = radius at the end of the straight section
892 // Zcp1l = z max for eta=0.8 at the beginning of the straight section
893 // Zcp1h = z max for eta=0.8 at the end of the straight section
894 // Zcp2l = z max for eta~=1.475 at the beginning of the straight section
895 // Zcp2h = z max for eta~=1.475 at the end of the straight section
896  double Zcp1l[14]={},Zcp1h[14]={},Zcp2l[14]={},Zcp2h[14]={};
897  double Rhol[14]={},Rhoh[14]={};
898 
899  double safety_along = 0.007*Gaudi::Units::mm;
900 
901 
902  // Compute centers of curvature coordinates in a local frame.
903 
904  double Cenx[15]={0}, Ceny[15]={0} ;
905  for (int jf=0; jf<(Nbrt+1); jf++)
906  {
907  Cenx[jf] = Rhocen[jf]*cos(Phicen[jf]); // Phicen[] already in radians
908  Ceny[jf] = Rhocen[jf]*sin(Phicen[jf]);
909  Zcp1[jf] = Rhocen[jf]/tan(TetaTrans[jf]);
910  if (Rhocen[jf] < r2)
911  Zcp2[jf] = z1 + (Rhocen[jf]-r1)*inv_r2_r1*(Moth_Z_max-z1);
912  else
913  Zcp2[jf]=Moth_Z_max;
914 
915 #ifdef DEBUGGEO
916  std::cout << " jf " << jf
917  << "Cenx/Ceny " << Cenx[jf] << " " << Ceny[jf] << " "
918  << "Zcp1/Zcp2 " << Zcp1[jf] << " " << Zcp2[jf] << std::endl;
919 #endif
920 
921  }
922 
923 // Compute staight lengths of folds
924  double Rint = m_parameters->GetValue("LArEMBNeutFiberRadius");
925  for (int jl=0; jl<Nbrt; jl++)
926  {
927  double Adisc2 = (Cenx[jl+1]-Cenx[jl])*(Cenx[jl+1]-Cenx[jl])+
928  (Ceny[jl+1]-Ceny[jl])*(Ceny[jl+1]-Ceny[jl]);
929  double Along2 = Adisc2 - 4.*Rint*Rint;
930  Along[jl] = sqrt(Along2);
931 #ifdef DEBUGGEO
932  std::cout << "jl " << jl
933  << "straight length " << Along[jl] << std::endl;
934 #endif
935  double ddelta = M_PI/2.-Delta[jl];
936 // different parity depending on direction of first wave
937  if (checkParity==0) {
938  if (jl%2==1) ddelta=-1.*ddelta;
939  } else {
940  if (jl%2==0) ddelta=-1.*ddelta;
941  }
942  double xlong=Along[jl]-2.*safety_along;
943  double x2=0.5*(Cenx[jl+1]+Cenx[jl])+0.5*xlong*cos(ddelta);
944  double y2=0.5*(Ceny[jl+1]+Ceny[jl])+0.5*xlong*sin(ddelta);
945  double x1=0.5*(Cenx[jl+1]+Cenx[jl])-0.5*xlong*cos(ddelta);
946  double y1=0.5*(Ceny[jl+1]+Ceny[jl])-0.5*xlong*sin(ddelta);
947  Rhol[jl] = sqrt(x1*x1+y1*y1);
948  Rhoh[jl] = sqrt(x2*x2+y2*y2);
949  Zcp1l[jl] = Rhol[jl]/tan(TetaTrans[jl]);
950  Zcp1h[jl] = Rhoh[jl]/tan(TetaTrans[jl+1]);
951  if (Rhol[jl] < r2)
952  Zcp2l[jl] = z1 + (Rhol[jl]-r1)*inv_r2_r1*(Moth_Z_max-z1);
953  else
954  Zcp2l[jl]=Moth_Z_max;
955  if (Rhoh[jl] < r2)
956  Zcp2h[jl] = z1 + (Rhoh[jl]-r1)*inv_r2_r1*(Moth_Z_max-z1);
957  else
958  Zcp2h[jl]=Moth_Z_max;
959 #ifdef DEBUGGEO
960  std::cout << "x1,y1,x2,y2 " << x1 << " " << y1 << " " << x2 << " "
961  << y2 << std::endl;
962  std::cout << " lower/upper radius " << Rhol[jl] << " " << Rhoh[jl]
963  << " Z for eta0.8 " << Zcp1l[jl] << " " << Zcp1h[jl]
964  << " Z for etamax " << Zcp2l[jl] << " " << Zcp2h[jl] << std::endl;
965 #endif
966  }
967 
968 
969 
970  double Gama0 = m_parameters->GetValue("LArEMBAbsPhiFirst");
971 
972  GeoGenfun::Variable icopy;
973  GeoGenfun::GENFUNCTION Game = Gama0 + Psi/2 + Alfa*icopy;
974  GeoGenfun::GENFUNCTION Gama = Gama0 + Alfa*icopy;
975 
976  // Creation of the straight absorber parts. Front (TIPB) & Back (TIPC)
977  // Creation of the straight electrode parts. Front (TIPK) & Back (TIPL)
978 
979  enum FB {FRONT, BACK, TERM};
980 
981  for (int fb=FRONT; fb!=TERM; fb++)
982  {
983 
984  int irl = fb==FRONT ? 0 : Nbrt;
985 
986  double Xtips = Xtip_pb + Xtip_gt;
987  double Xtipt = Xtip_pc + Xtip_gs;
988 
989  // Absorber (thick, thin)
990  {
991  double radius = fb==FRONT ? Cenx[0] - Xtip_pb/2 : Cenx[Nbrt] + Xtipt/2;
992  double Xhalfb = fb==FRONT ? Xtip_pb/2 -0.002*Gaudi::Units::mm : Xtipt/2 - .004*Gaudi::Units::mm;
993  double Zhalfb = fb==FRONT ? (Bar_Z_cut-Zmin)/2. : (Zmax-Zmin)/2.;
994  double dz01 = (std::min(Zcp1[irl],Zmax)-Zmin)/2.; // half lenght for thick lead
995 
996  std::string name = baseName + "FrontBack::Absorber";
997  GeoBox *box = new GeoBox(Xhalfb,Thce/2,Zhalfb);
998  GeoBox *box2 = new GeoBox(Xhalfb,Thce/2,dz01);
999  const GeoLogVol *logVol = new GeoLogVol(name,box,Thin_abs);
1000  const GeoLogVol *logVol2 = new GeoLogVol(name,box2,Thick_abs);
1001  GeoIntrusivePtr<GeoPhysVol> physVol = new GeoPhysVol(logVol);
1002  GeoIntrusivePtr<GeoPhysVol> physVol2 = new GeoPhysVol(logVol2);
1003  physVol->add(new GeoTransform(GeoTrf::Translate3D(0.,0.,dz01-Zhalfb)));
1004  physVol->add(physVol2);
1005  GeoGenfun::GENFUNCTION Xcd = radius*Cos(Gama);
1006  GeoGenfun::GENFUNCTION Ycd = radius*Sin(Gama);
1007  GeoGenfun::GENFUNCTION Zcd = GeoGenfun::FixedConstant(Zmin+Zhalfb);
1008 
1009 
1010  GeoXF::TRANSFUNCTION TX =
1011  GeoXF::Pow(GeoTrf::TranslateX3D(1.0),Xcd) *
1012  GeoXF::Pow(GeoTrf::TranslateY3D(1.0),Ycd) *
1013  GeoXF::Pow(GeoTrf::TranslateZ3D(1.0),Zcd) *
1014  GeoXF::Pow(GeoTrf::RotateZ3D(1.0),Gama);
1015  GeoSerialTransformer *st = new GeoSerialTransformer(physVol, &TX, Nabsorber);
1016  m_ecamPhysicalPos->add(st);
1017  m_ecamPhysicalNeg->add(st);
1018 #ifdef DEBUGGEO
1019  if (fb==FRONT) std::cout << " *** Front tip Absorber " << std::endl;
1020  else std::cout << " *** Back tip Absorber " << std::endl;
1021  std::cout << " Thin Abs Box " << Xhalfb << " " << Thce/2. << " " << Zhalfb << std::endl;
1022  std::cout << " Thick Abs Box " << Xhalfb << " " << Thce/2. << " " << dz01 << std::endl;
1023  std::cout << " Z position thick in thin " << dz01-Zhalfb << std::endl;
1024  std::cout << " Radial position " << radius << std::endl;
1025  std::cout << " Phi0 (Gaudi::Units::deg) " << Gama(0)/Gaudi::Units::deg << std::endl;
1026  std::cout << " Z position in ECAM " << Zmin+Zhalfb << std::endl;
1027 #endif
1028  }
1029  // G10 (only for front part)
1030  if (fb==FRONT)
1031  {
1032  double Xhalfbg = Xtip_gt/2-0.002*Gaudi::Units::mm;
1033  double radiusg = Cenx[0]-Xtip_pb/2. - Xtips/2 ;
1034  double Zhalfbg = (Bar_Z_cut-Zmin)/2. ;
1035  std::string name = baseName + "FrontBack::G10";
1036 #ifdef DEBUGGEO
1037  std::cout << " *** Front tip G10 " << std::endl;
1038  std::cout << " Box parameters " << Xhalfbg << " " << Thce/2. << " " << Zhalfbg << std::endl;
1039 #endif
1040  GeoBox *box = new GeoBox(Xhalfbg,Thce/2,Zhalfbg);
1041  const GeoLogVol *logVol = new GeoLogVol(name,box,G10_bar);
1042  GeoPhysVol *physVol = new GeoPhysVol(logVol);
1043 
1044 #ifdef BUILD_FRONT_STEEL
1045 // GU 28-07-2005
1046 // add small iron pieces on each side of the G10
1047  name = baseName + "FrontBack::Steel";
1048  double Tgfe = m_parameters->GetValue("LArEMBThinAbsIron");
1049 #ifdef DEBUGGEO
1050  std::cout << " Iron Box parameters " << Xhalfbg
1051  << " " << Tgfe/4. << " " << Zhalfbg << std::endl;
1052 #endif
1053  GeoBox *box2 = new GeoBox(Xhalfbg,Tgfe/4.,Zhalfbg);
1054  const GeoLogVol *logVol2 = new GeoLogVol(name,box2,Iron);
1055  GeoIntrusivePtr<GeoPhysVol>physVol2 = new GeoPhysVol(logVol2);
1056 #ifdef DEBUGGEO
1057  std::cout << " Position Iron in G10 at y = +- " << 0.5*(+Thce-Tgfe/2.) << std::endl;
1058 #endif
1059  physVol->add(new GeoTransform(GeoTrf::Translate3D(0.,0.5*(-Thce+Tgfe/2.),0.)));
1060  physVol->add(physVol2);
1061  physVol->add(new GeoTransform(GeoTrf::Translate3D(0.,0.5*(+Thce-Tgfe/2.),0.)));
1062  physVol->add(physVol2);
1063 #endif // build_front_steel
1064 
1065 // position of G10+Steel inside LAr bath
1066  GeoGenfun::GENFUNCTION Xcd = radiusg*Cos(Gama);
1067  GeoGenfun::GENFUNCTION Ycd = radiusg*Sin(Gama);
1068  GeoGenfun::GENFUNCTION Zcd = GeoGenfun::FixedConstant(Zhalfbg+Zmin);
1069  GeoXF::TRANSFUNCTION TX =
1070  GeoXF::Pow(GeoTrf::TranslateX3D(1.0),Xcd) *
1071  GeoXF::Pow(GeoTrf::TranslateY3D(1.0),Ycd) *
1072  GeoXF::Pow(GeoTrf::TranslateZ3D(1.0),Zcd) *
1073  GeoXF::Pow(GeoTrf::RotateZ3D(1.0),Gama);
1074  GeoSerialTransformer *st = new GeoSerialTransformer(physVol, &TX, Nabsorber);
1075  m_ecamPhysicalPos->add(st);
1076  m_ecamPhysicalNeg->add(st);
1077 #ifdef DEBUGGEO
1078  std::cout << " Radial position G10 tip " << radiusg << std::endl;
1079  std::cout << " Phi0 (Gaudi::Units::deg)" << Gama(0)/Gaudi::Units::deg << std::endl;
1080  std::cout << " Zposition in ECAM " << Zmin+Zhalfbg << std::endl;
1081 #endif
1082 
1083  }
1084  // Electrode
1085  {
1086  double Xhalfbe = fb==FRONT ? Xtips/2 -0.002*Gaudi::Units::mm : Xtipt/2 - .004*Gaudi::Units::mm;
1087  double Zhalfbe = fb==FRONT ? (Bar_Z_cut-Zmin)/2. : (Zmax - Zmin)/2;
1088  double radiuse = fb==FRONT ? Cenx[0] - Xtips/2 : Cenx[Nbrt] + Xtipt/2;
1089  std::string name = baseName + "FrontBack::Electrode";
1090  GeoBox *box = new GeoBox(Xhalfbe,Thel/2,Zhalfbe);
1091  const GeoLogVol *logVol = new GeoLogVol(name,box,Kapton_Cu);
1092  GeoIntrusivePtr<GeoPhysVol> physVol = new GeoPhysVol(logVol);
1093  GeoGenfun::GENFUNCTION Xcd = radiuse*Cos(Game);
1094  GeoGenfun::GENFUNCTION Ycd = radiuse*Sin(Game);
1095  GeoGenfun::GENFUNCTION Zcd = GeoGenfun::FixedConstant(Zmin+Zhalfbe);
1096 
1097  GeoXF::TRANSFUNCTION TX =
1098  GeoXF::Pow(GeoTrf::TranslateX3D(1.0),Xcd) *
1099  GeoXF::Pow(GeoTrf::TranslateY3D(1.0),Ycd) *
1100  GeoXF::Pow(GeoTrf::TranslateZ3D(1.0),Zcd) *
1101  GeoXF::Pow(GeoTrf::RotateZ3D(1.0),Game);
1102 
1103  GeoSerialTransformer *st = new GeoSerialTransformer(physVol, &TX, Nelectrode);
1104  m_ecamPhysicalPos->add(st);
1105  m_ecamPhysicalNeg->add(st);
1106 
1107 #ifdef DEBUGGEO
1108  if (fb==FRONT) std::cout << " *** Front tip electrode " << std::endl;
1109  else std::cout << " *** Back tip electrode " << std::endl;
1110  std::cout << " Box " << Xhalfbe << " " << Thel/2. << " " << Zhalfbe << std::endl;
1111  std::cout << " Radial position " << radiuse << std::endl;
1112  std::cout << " Phi0 (Gaudi::Units::deg)" << Game(0)/Gaudi::Units::deg << std::endl;
1113  std::cout << " Z position in ECAM " << Zmin+Zhalfbe << std::endl;
1114 #endif
1115 
1116 
1117  }
1118  }
1119 
1120 
1121  GeoStraightAccSection *gStraightElectrodes=nullptr;
1122  GeoStraightAccSection *gStraightAbsorbers =nullptr;
1123  //
1124  // Loop through the straight and corner(Fold) parts of the Accordion plates
1125  // Repeat each part around Phi, then move to the next, towards outer radii
1126  //
1127 
1128 // GU 09/06/2004 add some safety in z size
1129  double safety_zlen=0.050*Gaudi::Units::mm;
1130 
1131  for(int irl=0; irl<Nbrt; irl++) // loop over zig-zag in radius
1132  {
1133 #ifdef DEBUGGEO
1134  std::cout << " ----- irl = " << irl << std::endl;
1135 #endif
1136  int iparit;
1137 // different parity depending on direction of first wave
1138  if (checkParity==0) {
1139  iparit= (1-2*(irl%2)); // +1 for irl=0,2,4,.. -1 for irl=1,3,5,..
1140  } else {
1141  iparit=(2*(irl%2)-1); // -1 for irl=0,2,3... +1 for irl=1,3,5
1142  }
1143 
1144 // length of tubs for folds
1145  double Zcon1 = Zcp2[irl];
1146  double Zcon2 = Zcp2[irl+1];
1147 // if the radius at the lower edge of this fold is smaller than
1148 // Bar_rcmx, take the lenght at this radius instead of the radius
1149 // of the fold to avoid going outside the mother volume
1150  if (irl>0 && Rhoh[irl-1] < Bar_Rcmx) Zcon1=Zcp2h[irl-1];
1151  if (Rhoh[irl] < Bar_Rcmx) Zcon2=Zcp2h[irl];
1152 
1153  double dz0 = (std::min(Zcon1,Zmax)-Zmin)/2.; // half lenght in z (fold)
1154  double dza = (std::min(Zcon2,Zmax)-Zmin)/2.; // (for last fold)
1155  double dz01 = (std::min(Zcp1[irl],Zmax)-Zmin)/2.; // half lenght for thick lead
1156  double dza1 = (std::min(Zcp1[irl+1],Zmax)-Zmin)/2.;
1157 
1158 
1159 // special case if Rhocen[il] < Bar_Rcmx < Rhocen[il+1]
1160 // we had to divide the fold in two different pieces to deal with the shape
1161  int ndivi=1;
1162  if (Rhocen[irl] < Bar_Rcmx && Rhocen[irl+1] > Bar_Rcmx) {
1163 #ifdef DEBUGGEO
1164  std::cout << " Divide section in two pieces at r= " << Bar_Rcmx << std::endl;
1165 #endif
1166  ndivi=2;
1167  }
1168 
1169  for (int idivi=0;idivi<ndivi;idivi++) {
1170 
1171  // lenght in z at beginning and end of straigth part
1172  double bl1,tl1;
1173  double frac;
1174  if (ndivi==1) {
1175  bl1 = (std::min(Zcp2l[irl],Zmax)-Zmin)/2.;
1176  tl1 = (std::min(Zcp2h[irl],Zmax)-Zmin)/2.;
1177  frac=1.;
1178  }
1179  else {
1180  if (idivi==0) {
1181  bl1 = (std::min(Zcp2l[irl],Zmax)-Zmin)/2.;
1182  tl1 = (Zmax-Zmin)/2.;
1183  frac=(Bar_Rcmx-Rhol[irl])/(Rhoh[irl]-Rhol[irl]);
1184  }
1185  else {
1186  bl1 = (Zmax-Zmin)/2.;
1187  tl1 = (Zmax-Zmin)/2.;
1188  frac=(Rhoh[irl]-Bar_Rcmx)/(Rhoh[irl]-Rhol[irl]);
1189  }
1190 #ifdef DEBUGGEO
1191  std::cout << " Division " << idivi << " fraction of straight section " << frac << std::endl;
1192 #endif
1193  }
1194 //GU 09/06/2004 add small safety in size tl1 and bl1
1195  tl1=tl1-safety_zlen;
1196  bl1=bl1-safety_zlen;
1197 
1198 // =================================== Absorbers
1199  {
1200 
1201  // thickness of absorber
1202  double Dz = Thce/2.;
1203 
1204  // For absorbers
1205  GeoGenfun::GENFUNCTION x1a = LArGeo::Fx(irl+0., Gama, Cenx, Ceny)
1206  +deltay[irl]*LArGeo::Del1(Gama)
1207  +deltax[irl]*LArGeo::Del2(Gama);
1208  GeoGenfun::GENFUNCTION x2a = LArGeo::Fx(irl+1., Gama, Cenx, Ceny)
1209  +deltay[irl+1]*LArGeo::Del1(Gama)
1210  +deltax[irl+1]*LArGeo::Del2(Gama);
1211  GeoGenfun::GENFUNCTION y1a = LArGeo::Fy(irl+0., Gama, Cenx, Ceny)
1212  -deltay[irl]*LArGeo::Del2(Gama)
1213  +deltax[irl]*LArGeo::Del1(Gama);
1214  GeoGenfun::GENFUNCTION y2a = LArGeo::Fy(irl+1., Gama, Cenx, Ceny)
1215  -deltay[irl+1]*LArGeo::Del2(Gama)
1216  +deltax[irl+1]*LArGeo::Del1(Gama);
1217  GeoGenfun::GENFUNCTION dx = x2a - x1a;
1218  GeoGenfun::GENFUNCTION dy = y2a - y1a;
1219 
1220  // Da the two fold centers distance, da straight part length
1221 
1222  GeoGenfun::GENFUNCTION Da = Sqrt ( dx*dx + dy*dy );
1223  GeoGenfun::GENFUNCTION da = Sqrt ( (Da - 2.*Rint)*(Da + 2.*Rint) );
1224 
1225  // newalpha (slant angle) value of the rotation angle around Z_axis
1226  GeoGenfun::GENFUNCTION cosalfa = (da*dx -iparit*2.*Rint*dy)/Da/Da;
1227  GeoGenfun::GENFUNCTION sinalfa = (da*dy +iparit*2.*Rint*dx)/Da/Da;
1228  GeoGenfun::GENFUNCTION newalpha = LArGeo::ATan2(sinalfa,cosalfa);
1229 
1230  GeoGenfun::GENFUNCTION h1 = da/2. * frac - .007*Gaudi::Units::mm;
1231 
1232  double Zx0 = (tl1+bl1)/2.;
1233 // thick absorber pieces
1234 // more correct computation with z lenght computed exactly at the
1235 // radius of the end and the beginning of the straight sections
1236  double Xb1,Xt1;
1237  if (ndivi==1) {
1238  Xb1 = (Zcp1l[irl]-Zmin)/2.;
1239  Xt1 = (Zcp1h[irl]-Zmin)/2.;
1240  } else {
1241  double xfrac=(Bar_Rcmx-Rhol[irl])/(Rhoh[irl]-Rhol[irl]);
1242  if (idivi==0) {
1243  Xb1 = (Zcp1l[irl]-Zmin)/2.;
1244  Xt1 = (xfrac*Zcp1h[irl]+(1.-xfrac)*Zcp1l[irl]-Zmin)/2.;
1245  }
1246  else {
1247  Xb1 = (xfrac*Zcp1h[irl]+(1.-xfrac)*Zcp1l[irl]-Zmin)/2.;
1248  Xt1 = (Zcp1h[irl]-Zmin)/2.;
1249  }
1250  }
1251  // translation in x to include thick absorber into thin absorber
1252  double Xtrans = (Xb1+Xt1)/2.-Zx0 + .007*Gaudi::Units::mm;
1253 
1254  // lengths that remain to be covered with the thin absorber
1255  double Xt2 = tl1-Xt1;
1256  double Xb2 = bl1-Xb1;
1257 
1258  // trabslation that would be needed to include think absorber only into overall thin+thick volume
1259  double Xtrans2 = Zx0 - (Xb2+Xt2)/2.;
1260  Xt2 = Xt2 -0.007*Gaudi::Units::mm;
1261  Xb2 = Xb2 -0.007*Gaudi::Units::mm;
1262 
1263 
1264  GeoGenfun::GENFUNCTION alpha = ATan(0.5*(bl1-tl1)/h1);
1265  GeoGenfun::GENFUNCTION alpha_t = ATan(0.5*(Xb1-Xt1)/h1);
1266 
1267  // angle that would be needed for trap do describe only thin absorber
1268  // ------------------|---------X---------|
1269  // <-------------------------------------> 2*tl1
1270  // <---------> Xt2
1271  //
1272  // <---------------------------------> 2*bl1
1273  // <--------> Xb2
1274  // ---------------|--------X---------|
1275  // alpha = (-) angle between X's
1276  // tan(alpha) = delta X size / width, deltaX size = 2*tl1-Xt2-(2*bl1-Xb2), width = 2.*h1
1277  GeoGenfun::GENFUNCTION alpha_2 = ATan((2.*bl1-Xb2-(2.*tl1-Xt2))/(2.*h1));
1278 
1279 
1280  // .newalpha is already computed angle wrt z axis
1281  // P/2 rotation is to get absorber aligned along local x axis
1282  // instead of y, then rotate with angle newalpha
1283  GeoGenfun::GENFUNCTION alfrot = -M_PI/2. - newalpha;
1284 
1285  GeoGenfun::GENFUNCTION Xcd = (x1a + x2a)/2. + (2.*idivi-1.)*(1.-frac)*da/2.*cosalfa;
1286  GeoGenfun::GENFUNCTION Ycd = (y1a + y2a)/2. + (2.*idivi-1.)*(1.-frac)*da/2.*sinalfa;
1287  GeoGenfun::GENFUNCTION Zcd = GeoGenfun::FixedConstant(Zmin+(tl1+bl1)/2.+safety_zlen);
1288 
1289  GeoXF::TRANSFUNCTION TX =
1290  GeoXF::Pow(GeoTrf::TranslateX3D(1.0),Xcd) *
1291  GeoXF::Pow(GeoTrf::TranslateY3D(1.0),Ycd) *
1292  GeoXF::Pow(GeoTrf::TranslateZ3D(1.0),Zcd) *
1293  GeoXF::Pow(GeoTrf::RotateZ3D(1.0),-alfrot)*
1294  GeoTrf::RotateY3D(-90*Gaudi::Units::deg);
1295 
1296  //
1297 
1298  for (int instance = 0; instance < Nabsorber; instance++)
1299  {
1300 
1301  // Define some commonly-used volume names.
1302  std::string thinName = baseName + "ThinAbs::Straight";
1303  std::string thickName = baseName + "ThickAbs::Straight";
1304 
1305 #ifdef DEBUGGEO
1306  std::cout << " *** thinAbs trap parameters " << std::endl;
1307  std::cout << " Thickness " << Dz << std::endl;
1308  std::cout << " h1 (rad leng) " << h1(instance) << std::endl;
1309  std::cout << " tl1,bl1 " << tl1 << " " << bl1 << std::endl;
1310  std::cout << " alpha " << alpha(instance) << std::endl;
1311  std::cout << " *** thickAbs trap parameters " << std::endl;
1312  std::cout << " Thickness " << Dz << std::endl;
1313  std::cout << " h1 (rad leng) " << h1(instance) << std::endl;
1314  std::cout << " tl1,bl1 " << Xt1 << " " << Xb1 << std::endl;
1315  std::cout << " alpha " << alpha_t(instance) << std::endl;
1316 
1317  std::cout << " Position absorber x,y,z " << Xcd(instance) << " " << Ycd(instance)
1318  << " " << Zcd(instance) << std::endl;
1319  std::cout << " Rotation along Z " << -alfrot(instance)/deg << std::endl;
1320  std::cout << " Rotation along Y " << -90 << std::endl;
1321 
1322 #endif
1323 
1324 
1325  GeoIntrusivePtr<GeoPhysVol> thinPhys = nullptr;
1326  GeoTrap* thinTrap = new GeoTrap(Dz,0.,0.,h1(instance),tl1,bl1,alpha(instance),
1327  h1(instance),tl1,bl1,alpha(instance));
1328  if (!doDetailedAbsorberStraight) {
1329 
1330  const GeoLogVol* thinLog = new GeoLogVol(thinName,thinTrap,Thin_abs);
1331  thinPhys = new GeoPhysVol(thinLog);
1332 
1333  GeoTrap* thickTrap = new GeoTrap(Dz,0.,0.,h1(instance),Xt1,Xb1,alpha_t(instance),
1334  h1(instance),Xt1,Xb1,alpha_t(instance));
1335  const GeoLogVol* thickLog = new GeoLogVol(thickName,thickTrap,Thick_abs);
1336  GeoIntrusivePtr<GeoPhysVol> thickPhys = new GeoPhysVol(thickLog);
1337  // put thick absorber in straight_phys
1338  thinPhys->add(new GeoTransform(GeoTrf::TranslateX3D(Xtrans)));
1339  thinPhys->add(thickPhys);
1340 
1341 #ifdef DEBUGGEO
1342  std::cout << " Position thick Abs in Thin at " << Xtrans << std::endl;
1343 #endif
1344  }
1345 
1346  if (doDetailedAbsorberStraight) {
1347 
1348  // overall volume => steel
1349 #ifdef DEBUGGEO
1350  std::cout << " dz overall absorber volume " << Dz << " radial length " << h1(instance) <<
1351  " lenghts " << tl1 << " " << bl1 << " Angle y axis " << alpha(instance) << std::endl;
1352 #endif
1353  const GeoLogVol* thinLog = new GeoLogVol(thinName,thinTrap,myIron);
1354  thinPhys = new GeoPhysVol(thinLog);
1355 
1356  // inside steel put glue, Dz size = Dz size of steel - total thickness of steel/2. covers full eta range
1357 
1358  double dz_glue = Dz - 0.5*Thfe*Contract;
1359 #ifdef DEBUGGEO
1360  std::cout << " dz glue volume in which lead will be put " << dz_glue << std::endl;
1361 #endif
1362  GeoTrap* thickTrapGlue = new GeoTrap(dz_glue,0.,0.,h1(instance),tl1,bl1,alpha(instance),
1363  h1(instance),tl1,bl1,alpha(instance));
1364  std::string thickGlueName = baseName + "ThickAbsGlue::Straight";
1365  const GeoLogVol* thickTrapGlueLog = new GeoLogVol(thickGlueName,thickTrapGlue, Glue);
1366  GeoIntrusivePtr<GeoPhysVol> thickTrapGluePhys = new GeoPhysVol(thickTrapGlueLog);
1367  thinPhys->add(new GeoTransform(GeoTrf::Translate3D(0.,0.,0.)));
1368  thinPhys->add(thickTrapGluePhys);
1369 
1370  // inside glue put lead, Dz size = 0.5*Thpb*Contract, 2 separate volumes for eta<0.8 and eta>0.8
1371  double dz_lead_thick=0.5*Thpb*Contract;
1372 #ifdef DEBUGGEO
1373  std::cout << " dz thick lead " << dz_lead_thick << " lenghts " << Xt1 << " " << Xb1 << " Angle y axis " << alpha_t(instance) << std::endl;
1374  std::cout << " position in overall absorber at X trans " << Xtrans << std::endl;
1375 #endif
1376  GeoTrap* thickTrapLead = new GeoTrap(dz_lead_thick,0.,0.,h1(instance),Xt1,Xb1,alpha_t(instance),
1377  h1(instance),Xt1,Xb1,alpha_t(instance));
1378  std::string thickLeadName= baseName+"ThickAbsLead::Straight";
1379  const GeoLogVol* thickTrapLeadLog = new GeoLogVol(thickLeadName,thickTrapLead, myLead);
1380  GeoIntrusivePtr<GeoPhysVol> thickTrapLeadPhys = new GeoPhysVol(thickTrapLeadLog);
1381  thickTrapGluePhys->add(new GeoTransform(GeoTrf::TranslateX3D(Xtrans)));
1382  thickTrapGluePhys->add(thickTrapLeadPhys);
1383 
1384  double dz_lead_thin = 0.5*Thpb_thin*Contract;
1385 #ifdef DEBUGGEO
1386  std::cout << " dz thin lead " << dz_lead_thin << " lenghts " << Xt2 << " " << Xb2 << " Angle y axis " << alpha_2(instance) << std::endl;
1387  std::cout << " position in overall absorber at X trans " << Xtrans2 << std::endl;
1388 #endif
1389  GeoTrap* thinTrapLead = new GeoTrap(dz_lead_thin,0.,0.,h1(instance),Xt2,Xb2,alpha_2(instance),
1390  h1(instance),Xt2,Xb2,alpha_2(instance));
1391  std::string thinLeadName = baseName+"ThinAbsLead::Straight";
1392  const GeoLogVol* thinTrapLeadLog = new GeoLogVol(thinLeadName,thinTrapLead, myLead);
1393  GeoIntrusivePtr<GeoPhysVol> thinTrapLeadPhys = new GeoPhysVol(thinTrapLeadLog);
1394  thickTrapGluePhys->add(new GeoTransform(GeoTrf::TranslateX3D(Xtrans2)));
1395  thickTrapGluePhys->add(thinTrapLeadPhys);
1396 
1397 
1398  }
1399 
1400  //------------------------------------------------------------------------
1401  // JFB. If there is no sagging we can exit this loop after only one pass..
1402  // We simply declare the placement recipe, and place the first phys Vol
1403  // everywhere.
1404  //------------------------------------------------------------------------
1405  if (m_A_SAGGING) {
1406  if (!gStraightAbsorbers) gStraightAbsorbers = new GeoStraightAccSection();
1407  gStraightAbsorbers->XCent(instance,irl)=TX(instance)(0,3); //dx
1408  gStraightAbsorbers->YCent(instance,irl)=TX(instance)(1,3); //dy
1409  gStraightAbsorbers->Cosu(instance,irl) =-(TX(instance)(0,1)); //xy
1410  gStraightAbsorbers->Sinu(instance,irl) = (TX(instance)(0,2)); //xz
1411  gStraightAbsorbers->HalfLength(instance,irl) = thinTrap->getDydzn();
1412 
1413  stacPhysical->add(new GeoTransform(TX(instance)));
1414  int icopytot=1000000*idivi+10000*irl+instance;
1415  stacPhysical->add(new GeoIdentifierTag(icopytot));
1416  stacPhysical->add(thinPhys);
1417  }
1418  else {
1419  if (!gStraightAbsorbers) gStraightAbsorbers = new GeoStraightAccSection();
1420  gStraightAbsorbers->setTransform (irl,TX);
1421  gStraightAbsorbers->setHalfLength(irl,thinTrap->getDydzn());
1422  GeoSerialTransformer *st = new GeoSerialTransformer(thinPhys, &TX, Nabsorber);
1423  stacPhysical->add(new GeoSerialIdentifier(irl*10000+idivi*1000000));
1424  stacPhysical->add(st);
1425  break;
1426  }
1427  } // loop over instances
1428 
1429 
1430  if (idivi==0) {
1431 // Folds
1432  double phi0_safety=0.;
1433  if (irl==0) phi0_safety=0.003;
1434 
1435 // for most section, one fold = fold at the beginning of this section
1436 // for last section, should also to last fold, at the end of the section
1437 
1438  int irl1=irl;
1439  int irl2 = (irl==Nbrt-1) ? irl+1 : irl;
1440 
1441  for (int jrl=irl1; jrl<=irl2; jrl++) {
1442 
1443 // get slant angle for the previous zig-zag
1444  int iirl=jrl-1;
1445  if (iirl<0) iirl=1;
1446  GeoGenfun::GENFUNCTION x0a = LArGeo::Fx(iirl, Gama, Cenx, Ceny)
1447  +deltay[iirl]*LArGeo::Del1(Gama)
1448  +deltax[iirl]*LArGeo::Del2(Gama);
1449  GeoGenfun::GENFUNCTION y0a = LArGeo::Fy(iirl, Gama, Cenx, Ceny)
1450  -deltay[iirl]*LArGeo::Del2(Gama)
1451  +deltax[iirl]*LArGeo::Del1(Gama);
1452  GeoGenfun::GENFUNCTION dx0 = x1a - x0a;
1453  GeoGenfun::GENFUNCTION dy0 = y1a - y0a;
1454  // Da the two fold centers distance, da straight part length
1455  GeoGenfun::GENFUNCTION Da0 = Sqrt ( dx0*dx0 + dy0*dy0 );
1456  GeoGenfun::GENFUNCTION da0 = Sqrt ( (Da0 - 2.*Rint)*(Da0 + 2.*Rint) );
1457  // newalpha (slant angle) value of the rotation angle around Z_axis
1458  GeoGenfun::GENFUNCTION cosalfa0 = (da0*dx0 +iparit*2.*Rint*dy0)/Da0/Da0;
1459  GeoGenfun::GENFUNCTION sinalfa0 = (da0*dy0 -iparit*2.*Rint*dx0)/Da0/Da0;
1460  GeoGenfun::GENFUNCTION alpha_prev = LArGeo::ATan2(sinalfa0,cosalfa0);
1461 
1462 #ifdef DEBUGGEO
1463  if (jrl>0 && jrl<Nbrt) {
1464  std::cout << "x1,y1,x0,y0 " << x1a(0) << " " << y1a(0) << " "
1465  << x0a(0) << " " << y0a(0) << std::endl;
1466  std::cout << " newalpha, alpha_prev " << newalpha(0) << " "
1467  << alpha_prev(0) << std::endl;
1468  }
1469 #endif
1470  GeoGenfun::Mod Mod2Pi(2*M_PI);
1471 // down folds (add +M_PI and then rotate by -M_PI to follow same logic as old code)
1472  GeoGenfun::GENFUNCTION phi0_dfold_0 =
1473  GeoGenfun::FixedConstant(M_PI/2.+phi0_safety);
1474  GeoGenfun::GENFUNCTION dphi_dfold_0 = Mod2Pi(newalpha-phi0_safety - Gama);
1475  GeoGenfun::GENFUNCTION phi0_dfold_1 = Mod2Pi(M_PI/2.+ alpha_prev - Gama);
1476  GeoGenfun::GENFUNCTION dphi_dfold_1 = Mod2Pi(newalpha-alpha_prev);
1477  GeoGenfun::GENFUNCTION phi0_dfold_2 = Mod2Pi(M_PI/2.+ newalpha - Gama);
1478  GeoGenfun::GENFUNCTION dphi_dfold_2 = Mod2Pi(- newalpha + Gama);
1479 // up folds
1480  GeoGenfun::GENFUNCTION phi0_ufold_0 =
1481  Mod2Pi(M_PI/2.+newalpha-Gama);
1482  GeoGenfun::GENFUNCTION dphi_ufold_0 = Mod2Pi(-newalpha+Gama-phi0_safety);
1483  GeoGenfun::GENFUNCTION phi0_ufold_1 = Mod2Pi(M_PI/2. + newalpha - Gama);
1484  GeoGenfun::GENFUNCTION dphi_ufold_1 = Mod2Pi(alpha_prev - newalpha);
1485  GeoGenfun::GENFUNCTION phi0_ufold_2 = GeoGenfun::FixedConstant(M_PI/2.);
1486  GeoGenfun::GENFUNCTION dphi_ufold_2 = Mod2Pi(newalpha-Gama);
1487 
1488  const GeoGenfun::AbsFunction* phi0_fold=nullptr;
1489  const GeoGenfun::AbsFunction* dphi_fold=nullptr;
1490  const GeoXF::Function* TXfold=nullptr;
1491 
1492  std::string thinName;
1493  std::string thickName;
1494  if (jrl%2==checkParity) {
1495  thinName = baseName + "ThinAbs::CornerDownFold";
1496  thickName = baseName + "ThickAbs::CornerDownFold";
1497  } else {
1498  thinName = baseName + "ThinAbs::CornerUpFold";
1499  thickName = baseName + "ThickAbs::CornerUpFold";
1500  }
1501 
1502 // radius of tubs for folds
1503  double Rcmin=Rint-Thce/2.;
1504  double Rcmax=Rint+Thce/2.;
1505 
1506 // GU 09/06/2004 add some safety in z size
1507  double ddz0 = dz0-safety_zlen;
1508  double ddz01 = dz01-safety_zlen;
1509  if (jrl==Nbrt){
1510  ddz0=dza-safety_zlen;
1511  ddz01=dza1-safety_zlen;
1512  }
1513 
1514 
1515  GeoGenfun::GENFUNCTION zpos = GeoGenfun::FixedConstant(Zmin+dz0);
1516  double phirot=0;
1517  if (jrl%2==checkParity) phirot = -M_PI;
1518  GeoXF::TRANSFUNCTION TXfold1=
1519  GeoXF::Pow(GeoTrf::TranslateX3D(1.0),x1a) *
1520  GeoXF::Pow(GeoTrf::TranslateY3D(1.0),y1a) *
1521  GeoXF::Pow(GeoTrf::TranslateZ3D(1.0),zpos) *
1522  GeoXF::Pow(GeoTrf::RotateZ3D(1.0),Gama+phirot);
1523  GeoXF::TRANSFUNCTION TXfold2 =
1524  GeoXF::Pow(GeoTrf::TranslateX3D(1.0),x2a) *
1525  GeoXF::Pow(GeoTrf::TranslateY3D(1.0),y2a) *
1526  GeoXF::Pow(GeoTrf::TranslateZ3D(1.0),zpos) *
1527  GeoXF::Pow(GeoTrf::RotateZ3D(1.0),Gama+phirot);
1528 
1529 // first fown fold
1530  if (jrl==0 && checkParity==0) {
1531  phi0_fold = &(phi0_dfold_0);
1532  dphi_fold = &(dphi_dfold_0);
1533  TXfold = &(TXfold1);
1534  }
1535 // normal fold
1536  if (jrl%2==checkParity && jrl >0 && jrl<Nbrt) {
1537  phi0_fold = &(phi0_dfold_1);
1538  dphi_fold = &(dphi_dfold_1);
1539  TXfold = &(TXfold1);
1540  }
1541 // last fold if down
1542  if (jrl%2 ==checkParity && jrl == Nbrt) {
1543  phi0_fold = &(phi0_dfold_2);
1544  dphi_fold = &(dphi_dfold_2);
1545  TXfold = &(TXfold2);
1546  }
1547 // first up fold
1548  if (jrl==0 && checkParity==1) {
1549  phi0_fold = &(phi0_ufold_0);
1550  dphi_fold = &(dphi_ufold_0);
1551  TXfold = &(TXfold1);
1552  }
1553 // up fold
1554  if (jrl%2 ==(1-checkParity) && jrl>0 && jrl < Nbrt) {
1555  phi0_fold = &(phi0_ufold_1);
1556  dphi_fold = &(dphi_ufold_1);
1557  TXfold = &(TXfold1);
1558  }
1559 // last fold if up
1560  if (jrl%2==(1-checkParity) && jrl==Nbrt) {
1561  phi0_fold = &(phi0_ufold_2);
1562  dphi_fold = &(dphi_ufold_2);
1563  TXfold = &(TXfold2);
1564  }
1565 
1566  if (!phi0_fold || !dphi_fold || !TXfold) {
1567  log << MSG::INFO << " LArGeoBarrel::BarrelConstruction fold not defined..." << endmsg;
1568  }
1569  else
1570  for (int instance = 0; instance < Nabsorber; instance++)
1571  {
1572 
1573  GeoIntrusivePtr<GeoPhysVol> thinPhys = nullptr;
1574 
1575  if (!doDetailedAbsorberFold) {
1576  GeoTubs* thinTubs = new GeoTubs(Rcmin,Rcmax,ddz0,
1577  (*phi0_fold)(instance),(*dphi_fold)(instance));
1578  GeoTubs* thickTubs = new GeoTubs(Rcmin,Rcmax,ddz01,
1579  (*phi0_fold)(instance),(*dphi_fold)(instance));
1580 #ifdef DEBUGGEO
1581  std::cout << " Thin Abs Corner (tubs) " << std::endl;
1582  std::cout << " Rmin,Rmax,dZ,phi0,Dphi[rad] " << Rcmin << " " << Rcmax << " "
1583  << ddz0 << " " << (*phi0_fold)(instance) << " "
1584  <<(*dphi_fold)(instance) << std::endl;
1585  std::cout << " Thick Abs Corner (tubs) " << std::endl;
1586  std::cout << " Rmin,Rmax,dZ,phi0,Dphi[rad] " << Rcmin << " " << Rcmax << " "
1587  << ddz01 << " " << (*phi0_fold)(instance) << " "
1588  << (*dphi_fold)(instance) << std::endl;
1589 #endif
1590  const GeoLogVol* thinLog = new GeoLogVol(thinName,thinTubs,Thin_abs);
1591  const GeoLogVol* thickLog = new GeoLogVol(thickName,thickTubs,Thick_abs);
1592 
1593  thinPhys = new GeoPhysVol(thinLog);
1594  GeoIntrusivePtr<GeoPhysVol> thickPhys = new GeoPhysVol(thickLog);
1595 
1596  thinPhys->add(new GeoTransform(GeoTrf::TranslateZ3D(ddz01-ddz0)));
1597  thinPhys->add(thickPhys);
1598 #ifdef DEBUGGEO
1599  std::cout << " Position Thick fold in Thin Z = " << ddz01-ddz0 << std::endl;
1600 #endif
1601 
1602  }
1603 
1604  if (doDetailedAbsorberFold) {
1605 
1606  // bigger volume in steel to cover outer edges of absorber
1607  GeoTubs* thinTubs = new GeoTubs(Rcmin,Rcmax,ddz0,
1608  (*phi0_fold)(instance),(*dphi_fold)(instance));
1609  const GeoLogVol* thinLog = new GeoLogVol(thinName,thinTubs,myIron);
1610  thinPhys = new GeoPhysVol(thinLog);
1611 
1612 #ifdef DEBUGGEO
1613  std::cout << " overall fold volume rmin,rmax,dz " << Rcmin << " " << Rcmax << " " << ddz0 << std::endl;
1614 #endif
1615 
1616  // put inside volume with glue
1617  GeoTubs* glueTubs = new GeoTubs(Rcmin+0.5*Thfe*Contract,Rcmax-0.5*Thfe*Contract,ddz0,
1618  (*phi0_fold)(instance),(*dphi_fold)(instance));
1619  std::string foldGlueName = baseName+"Glue::Fold";
1620  const GeoLogVol* glueTubsLog = new GeoLogVol(foldGlueName,glueTubs,Glue);
1621  GeoIntrusivePtr<GeoPhysVol> glueTubsPhys = new GeoPhysVol(glueTubsLog);
1622  thinPhys->add(new GeoTransform(GeoTrf::TranslateZ3D(0.)));
1623  thinPhys->add(glueTubsPhys);
1624 #ifdef DEBUGGEO
1625  std::cout << " glue fold volume " << Rcmin+0.5*Thfe*Contract << " " << Rcmax-0.5*Thfe*Contract << " " << ddz0 << std::endl;
1626 #endif
1627 
1628  // put inside glue, volumes for lead, 2 thickness => 2 volumes
1629 
1630  // thick lead
1631  GeoTubs* thickLeadTubs = new GeoTubs(Rint-0.5*Thpb*Contract,Rint+0.5*Thpb*Contract,ddz01,
1632  (*phi0_fold)(instance),(*dphi_fold)(instance));
1633  std::string foldThickLeadName = baseName+"ThickLead::Fold";
1634  const GeoLogVol* thickLeadLog = new GeoLogVol(foldThickLeadName,thickLeadTubs,myLead);
1635  GeoIntrusivePtr<GeoPhysVol> thickLeadPhys = new GeoPhysVol(thickLeadLog);
1636  glueTubsPhys->add(new GeoTransform(GeoTrf::TranslateZ3D(ddz01-ddz0)));
1637  glueTubsPhys->add(thickLeadPhys);
1638 #ifdef DEBUGGEO
1639  std::cout << " thick lead volume " << Rint-Thpb*Contract << " " << Rint+Thpb*Contract << " " << ddz01 << std::endl;
1640  std::cout << " put in glue fold volume with z translation " << ddz01-ddz0 << std::endl;
1641 #endif
1642 
1643  // thin lead
1644  GeoTubs* thinLeadTubs = new GeoTubs(Rint-0.5*Thpb_thin*Contract,Rint+0.5*Thpb_thin*Contract,ddz0-ddz01,
1645  (*phi0_fold)(instance),(*dphi_fold)(instance));
1646  std::string foldThinLeadName = baseName+"ThinLead::Fold";
1647  const GeoLogVol* thinLeadLog = new GeoLogVol(foldThinLeadName,thinLeadTubs,myLead);
1648  GeoIntrusivePtr<GeoPhysVol> thinLeadPhys = new GeoPhysVol(thinLeadLog);
1649  glueTubsPhys->add(new GeoTransform(GeoTrf::TranslateZ3D(ddz01)));
1650  glueTubsPhys->add(thinLeadPhys);
1651 
1652 #ifdef DEBUGGEO
1653  std::cout << " thin lead volume " << Rint-Thpb_thin*Contract << " " << Rint+Thpb_thin*Contract << " " << ddz01 << std::endl;
1654  std::cout << " put in glue fold volume with z translation " << ddz01 << std::endl;
1655 #endif
1656 
1657 
1658 
1659  }
1660 
1661 #ifdef DEBUGGEO
1662  if (jrl !=Nbrt) {
1663  std::cout << " Position absorber fold x,y,z,rotation/z " << x1a(instance) <<
1664  " " << y1a(instance) << " " << zpos(instance) << " "
1665  << Gama(instance) << std::endl;
1666  } else {
1667  std::cout << " Position absorber fold x,y,z,rotation/z " << x2a(instance) <<
1668  " " << y2a(instance) << " " << zpos(instance) << " "
1669  << Gama(instance) << std::endl;
1670  }
1671 #endif
1672  if (m_A_SAGGING) {
1673  stacPhysical->add(new GeoTransform((*TXfold)(instance)));
1674  int icopytot = 10000*jrl+instance;
1675  stacPhysical->add(new GeoIdentifierTag(icopytot));
1676  stacPhysical->add(thinPhys);
1677  }
1678  else {
1679  GeoSerialTransformer *st = new GeoSerialTransformer(thinPhys, TXfold, Nabsorber);
1680  stacPhysical->add(new GeoSerialIdentifier(jrl*10000));
1681  stacPhysical->add(st);
1682  break;
1683  }
1684 
1685  } // loop over absorber folds instance
1686  } // loop over jrl
1687 
1688  } // idivi==0
1689  } // end absorbers
1690 
1691 // ======================== Electrodes:
1692  {
1693 
1694  // thickness of electrode
1695  double Dze = Thel/2.;
1696 
1697  // For electrodes
1698  GeoGenfun::GENFUNCTION x1e = LArGeo::Fx(irl+0., Game, Cenx, Ceny)
1699  +deltay[irl]*LArGeo::Del1(Game)
1700  +deltax[irl]*LArGeo::Del2(Game);
1701  GeoGenfun::GENFUNCTION x2e = LArGeo::Fx(irl+1., Game, Cenx, Ceny)
1702  +deltay[irl+1]*LArGeo::Del1(Game)
1703  +deltax[irl+1]*LArGeo::Del2(Game);
1704  GeoGenfun::GENFUNCTION y1e = LArGeo::Fy(irl+0., Game, Cenx, Ceny)
1705  -deltay[irl]*LArGeo::Del2(Game)
1706  +deltax[irl]*LArGeo::Del1(Game);
1707  GeoGenfun::GENFUNCTION y2e = LArGeo::Fy(irl+1., Game, Cenx, Ceny)
1708  -deltay[irl+1]*LArGeo::Del2(Game)
1709  +deltax[irl+1]*LArGeo::Del1(Game);
1710  GeoGenfun::GENFUNCTION dxe = x2e - x1e;
1711  GeoGenfun::GENFUNCTION dye = y2e - y1e;
1712  // De the two fold centers distance, de straight part length
1713  GeoGenfun::GENFUNCTION De = Sqrt ( dxe*dxe + dye*dye );
1714  GeoGenfun::GENFUNCTION de = Sqrt ( (De - 2.*Rint)*(De + 2.*Rint) );
1715 
1716  //newalphe (slant angle) value of the rotation angle around Z_axis
1717  GeoGenfun::GENFUNCTION cosalfae = (de*dxe -iparit*2.*Rint*dye)/De/De;
1718  GeoGenfun::GENFUNCTION sinalfae = (de*dye +iparit*2.*Rint*dxe)/De/De;
1719  GeoGenfun::GENFUNCTION newalphe = LArGeo::ATan2(sinalfae,cosalfae);
1720 
1721 
1722  // newalphae is already computed angle wrt z axis
1723  // P/2 rotation is to get absorber aligned along local x axis
1724  // instead of y, then rotate with angle newalpha
1725  GeoGenfun::GENFUNCTION alfrote = -M_PI/2. - newalphe;
1726 
1727  GeoGenfun::GENFUNCTION Xcde = (x1e + x2e)/2.+ (2.*idivi-1.)*(1.-frac)*de/2.*cosalfae;
1728  GeoGenfun::GENFUNCTION Ycde = (y1e + y2e)/2.+ (2.*idivi-1.)*(1.-frac)*de/2.*sinalfae;
1729  GeoGenfun::GENFUNCTION Zcde = GeoGenfun::FixedConstant(Zmin+(tl1+bl1)/2.+safety_zlen);
1730 
1731 
1732  GeoGenfun::GENFUNCTION h1e = de/2.*frac - .007*Gaudi::Units::mm;
1733  GeoGenfun::GENFUNCTION alpha_e = ATan(0.5*(bl1-tl1)/h1e);
1734 
1735 
1736  GeoXF::TRANSFUNCTION TXE =
1737  GeoXF::Pow(GeoTrf::TranslateX3D(1.0),Xcde) *
1738  GeoXF::Pow(GeoTrf::TranslateY3D(1.0),Ycde) *
1739  GeoXF::Pow(GeoTrf::TranslateZ3D(1.0),Zcde) *
1740  GeoXF::Pow(GeoTrf::RotateZ3D(1.0),-alfrote)*
1741  GeoTrf::RotateY3D(-90*Gaudi::Units::deg);
1742 
1743 
1744  for (int instance = 0; instance < Nelectrode; instance++)
1745  {
1746  std::string name = baseName + "Electrode::Straight";
1747 #ifdef DEBUGGEO
1748  std::cout << " *** Electrode trap parameters " << std::endl;
1749  std::cout << " Thickness " << Dze << std::endl;
1750  std::cout << " h1 (rad leng) " << h1e(instance) << std::endl;
1751  std::cout << " tl1,tb1 " << tl1 << " " << bl1 << std::endl;
1752  std::cout << " alpha " << alpha_e(instance) << std::endl;
1753  std::cout << " Position electrode x,y,z " << Xcde(instance) << " " << Ycde(instance)
1754  << " " << Zcde(instance) << std::endl;
1755  std::cout << " Rotation along Z " << -alfrote(instance)/deg << std::endl;
1756  std::cout << " Rotation along Y " << -90 << std::endl;
1757 
1758 #endif
1759 
1760  GeoTrap* trap = new GeoTrap(Dze,0.,0.,h1e(instance),tl1,bl1,alpha_e(instance),
1761  h1e(instance),tl1,bl1,alpha_e(instance));
1762  const GeoLogVol* logVol = new GeoLogVol(name,trap,Kapton_Cu);
1763  GeoIntrusivePtr<GeoPhysVol> physVol = new GeoPhysVol(logVol);
1764  //------------------------------------------------------------------------
1765  // JFB. If there is no sagging we can exit this loop after only one pass..
1766  // We simply declare the placement recipe, and place the first phys Vol
1767  // everywhere.
1768  //------------------------------------------------------------------------
1769  if (m_A_SAGGING) {
1770  if (!gStraightElectrodes) gStraightElectrodes = new GeoStraightAccSection();
1771  gStraightElectrodes->XCent(instance,irl)=TXE(instance)(0,3); //dx
1772  gStraightElectrodes->YCent(instance,irl)=TXE(instance)(1,3); //dy
1773  gStraightElectrodes->Cosu(instance,irl) =-(TXE(instance)(0,1)); //xy
1774  gStraightElectrodes->Sinu(instance,irl) = (TXE(instance)(0,2)); //xz
1775  gStraightElectrodes->HalfLength(instance,irl) = trap->getDydzn();
1776 
1777  stacPhysical->add(new GeoTransform(TXE(instance)));
1778  int icopytot=1000000*idivi+10000*irl+instance;
1779  stacPhysical->add(new GeoIdentifierTag(icopytot));
1780  stacPhysical->add(physVol);
1781  }
1782  else {
1783  if (!gStraightElectrodes) gStraightElectrodes = new GeoStraightAccSection();
1784  gStraightElectrodes->setTransform (irl,TXE);
1785  gStraightElectrodes->setHalfLength(irl,trap->getDydzn());
1786  GeoSerialTransformer *st = new GeoSerialTransformer(physVol, &TXE, Nelectrode);
1787  stacPhysical->add(new GeoSerialIdentifier(irl*10000+idivi*1000000));
1788  stacPhysical->add(st);
1789  break;
1790  }
1791  } // loop over instances
1792 
1793 
1794 
1795  if (idivi==0) {
1796 // Folds
1797  double phi0_safety=0.;
1798  if (irl==0) phi0_safety=0.003;
1799 
1800 // for most section, one fold = fold at the beginning of this section
1801 // for last section, should also to last fold, at the end of the section
1802 
1803  int irl1=irl;
1804  int irl2 = (irl==Nbrt-1) ? irl+1 : irl;
1805 
1806  for (int jrl=irl1; jrl<=irl2; jrl++) {
1807 
1808 // get slant angle for the previous zig-zag
1809  int iirl=jrl-1;
1810  if (iirl<0) iirl=1;
1811  GeoGenfun::GENFUNCTION x0e = LArGeo::Fx(iirl, Game, Cenx, Ceny)
1812  +deltay[iirl]*LArGeo::Del1(Game)
1813  +deltax[iirl]*LArGeo::Del2(Game);
1814  GeoGenfun::GENFUNCTION y0e = LArGeo::Fy(iirl, Game, Cenx, Ceny)
1815  -deltay[iirl]*LArGeo::Del2(Game)
1816  +deltax[iirl]*LArGeo::Del1(Game);
1817  GeoGenfun::GENFUNCTION dx0 = x1e - x0e;
1818  GeoGenfun::GENFUNCTION dy0 = y1e - y0e;
1819  // Da the two fold centers distance, da straight part length
1820  GeoGenfun::GENFUNCTION Da0 = Sqrt ( dx0*dx0 + dy0*dy0 );
1821  GeoGenfun::GENFUNCTION da0 = Sqrt ( (Da0 - 2.*Rint)*(Da0 + 2.*Rint) );
1822  // newalpha (slant angle) value of the rotation angle around Z_axis
1823  GeoGenfun::GENFUNCTION cosalfa0 = (da0*dx0 +iparit*2.*Rint*dy0)/Da0/Da0;
1824  GeoGenfun::GENFUNCTION sinalfa0 = (da0*dy0 -iparit*2.*Rint*dx0)/Da0/Da0;
1825  GeoGenfun::GENFUNCTION alphe_prev = LArGeo::ATan2(sinalfa0,cosalfa0);
1826 
1827 #ifdef DEBUGGEO
1828  if (jrl>0 && jrl<Nbrt) {
1829  std::cout << " newalphae, alphae_prev " << newalphe(0) << " "
1830  << alphe_prev(0) << std::endl;
1831  }
1832 #endif
1833 
1834 // down folds (add +M_PI and then rotate by -M_PI to follow same logic as old code)
1835  GeoGenfun::Mod Mod2Pi(2*M_PI);
1836  GeoGenfun::GENFUNCTION phi0_dfold_0 =
1837  GeoGenfun::FixedConstant(M_PI/2.+phi0_safety);
1838  GeoGenfun::GENFUNCTION dphi_dfold_0 = Mod2Pi(newalphe-phi0_safety-Game);
1839  GeoGenfun::GENFUNCTION phi0_dfold_1 = Mod2Pi(M_PI/2.+ alphe_prev - Game);
1840  GeoGenfun::GENFUNCTION dphi_dfold_1 = Mod2Pi(newalphe-alphe_prev);
1841  GeoGenfun::GENFUNCTION phi0_dfold_2 = Mod2Pi(M_PI/2.+ newalphe - Game);
1842  GeoGenfun::GENFUNCTION dphi_dfold_2 = Mod2Pi(- newalphe + Game);
1843 // up folds
1844  GeoGenfun::GENFUNCTION phi0_ufold_0 =
1845  Mod2Pi(M_PI/2.+newalphe-Game);
1846  GeoGenfun::GENFUNCTION dphi_ufold_0 = Mod2Pi(-newalphe+Game-phi0_safety);
1847  GeoGenfun::GENFUNCTION phi0_ufold_1 = Mod2Pi(M_PI/2. + newalphe - Game);
1848  GeoGenfun::GENFUNCTION dphi_ufold_1 = Mod2Pi(alphe_prev - newalphe);
1849  GeoGenfun::GENFUNCTION phi0_ufold_2 = GeoGenfun::FixedConstant(M_PI/2.);
1850  GeoGenfun::GENFUNCTION dphi_ufold_2 = Mod2Pi(newalphe - Game);
1851 
1852  const GeoGenfun::AbsFunction* phi0_fold=nullptr;
1853  const GeoGenfun::AbsFunction* dphi_fold=nullptr;
1854  const GeoXF::Function* TXfold=nullptr;
1855 
1856  std::string eName;
1857  if (jrl%2==checkParity) {
1858  eName = baseName + "Electrode::CornerDownFold";
1859  } else {
1860  eName = baseName + "Electrode::CornerUpFold";
1861  }
1862 
1863 // radius of tubs for folds
1864  double Rcmine=Rint-Thel/2.;
1865  double Rcmaxe=Rint+Thel/2.;
1866 
1867 // GU 09/06/2004 add some safety in z size
1868  double ddz0 = dz0-safety_zlen;
1869  if (jrl==Nbrt) {
1870  ddz0 = dza - safety_zlen;
1871  }
1872 
1873  GeoGenfun::GENFUNCTION zpos = GeoGenfun::FixedConstant(Zmin+dz0);
1874  double phirot = 0;
1875  if (jrl%2==checkParity) phirot = -M_PI;
1876  GeoXF::TRANSFUNCTION TXfold1=
1877  GeoXF::Pow(GeoTrf::TranslateX3D(1.0),x1e) *
1878  GeoXF::Pow(GeoTrf::TranslateY3D(1.0),y1e) *
1879  GeoXF::Pow(GeoTrf::TranslateZ3D(1.0),zpos) *
1880  GeoXF::Pow(GeoTrf::RotateZ3D(1.0),Game+phirot);
1881  GeoXF::TRANSFUNCTION TXfold2 =
1882  GeoXF::Pow(GeoTrf::TranslateX3D(1.0),x2e) *
1883  GeoXF::Pow(GeoTrf::TranslateY3D(1.0),y2e) *
1884  GeoXF::Pow(GeoTrf::TranslateZ3D(1.0),zpos) *
1885  GeoXF::Pow(GeoTrf::RotateZ3D(1.0),Game+phirot);
1886 
1887 // first fown fold
1888  if (jrl==0 && checkParity==0) {
1889  phi0_fold = &(phi0_dfold_0);
1890  dphi_fold = &(dphi_dfold_0);
1891  TXfold = &(TXfold1);
1892  }
1893 // normal fold
1894  if (jrl%2==checkParity && jrl >0 && jrl<Nbrt) {
1895  phi0_fold = &(phi0_dfold_1);
1896  dphi_fold = &(dphi_dfold_1);
1897  TXfold = &(TXfold1);
1898  }
1899 // last fold if down
1900  if (jrl%2 ==checkParity && jrl == Nbrt) {
1901  phi0_fold = &(phi0_dfold_2);
1902  dphi_fold = &(dphi_dfold_2);
1903  TXfold = &(TXfold2);
1904  }
1905 // first up fold
1906  if (jrl==0 && checkParity==1 ) {
1907  phi0_fold = &(phi0_ufold_0);
1908  dphi_fold = &(dphi_ufold_0);
1909  TXfold = &(TXfold1);
1910 
1911  }
1912 // up fold
1913  if (jrl%2 ==(1-checkParity) && jrl>0 && jrl < Nbrt) {
1914  phi0_fold = &(phi0_ufold_1);
1915  dphi_fold = &(dphi_ufold_1);
1916  TXfold = &(TXfold1);
1917  }
1918 // last fold if up
1919  if (jrl%2==(1-checkParity) && jrl==Nbrt) {
1920  phi0_fold = &(phi0_ufold_2);
1921  dphi_fold = &(dphi_ufold_2);
1922  TXfold = &(TXfold2);
1923  }
1924 
1925  if (!phi0_fold || !dphi_fold || !TXfold) {
1926  log << MSG::INFO << " LArGeoBarrel::BarrelConstruction fold not defined..." << endmsg;
1927  }
1928  else
1929  for (int instance = 0; instance < Nelectrode; instance++)
1930  {
1931 
1932  GeoTubs* foldeTubs = new GeoTubs(Rcmine,Rcmaxe,ddz0,
1933  (*phi0_fold)(instance),(*dphi_fold)(instance));
1934 #ifdef DEBUGGEO
1935  std::cout << " Electrode Corner (tubs) " << std::endl;
1936  std::cout << " Rmin,Rmax,dZ,phi0,Dphi[rad] " << Rcmine << " " << Rcmaxe << " "
1937  << ddz0 << " " << (*phi0_fold)(instance) << " "
1938  <<(*dphi_fold)(instance) << std::endl;
1939 #endif
1940  const GeoLogVol* foldeLog = new GeoLogVol(eName,foldeTubs,Kapton_Cu);
1941 
1942  GeoIntrusivePtr<GeoPhysVol> foldePhys = new GeoPhysVol(foldeLog);
1943 
1944 #ifdef DEBUGGEO
1945  if (jrl!=Nbrt) {
1946  std::cout << " Position electrode fold x,y,z,rotation/z " << x1e(instance) <<
1947  " " << y1e(instance) << " " << zpos(instance) << " "
1948  << Game(instance) << std::endl;
1949  } else {
1950  std::cout << " Position electrode fold x,y,z,rotation/z " << x2e(instance) <<
1951  " " << y2e(instance) << " " << zpos(instance) << " "
1952  << Game(instance) << std::endl;
1953  }
1954 #endif
1955  if (m_A_SAGGING) {
1956  stacPhysical->add(new GeoTransform((*TXfold)(instance)));
1957  int icopytot = 10000*jrl+instance;
1958  stacPhysical->add(new GeoIdentifierTag(icopytot));
1959  stacPhysical->add(foldePhys);
1960  }
1961  else {
1962  GeoSerialTransformer *st = new GeoSerialTransformer(foldePhys, TXfold, Nelectrode);
1963  stacPhysical->add(new GeoSerialIdentifier(jrl*10000));
1964  stacPhysical->add(st);
1965  break;
1966  }
1967 
1968  } // loop over electrode folds instance
1969  } // loop over jrl
1970 
1971  } // idivi==0
1972  } // end electrodes
1973  } // end loop over ndivi
1974  } // end loop over irl (zig-zag)
1975  {
1976  StatusCode status = detStore->record(gStraightElectrodes,"STRAIGHTELECTRODES");
1977  if(!status.isSuccess()) throw std::runtime_error ("Cannot store STRAIGHTELECTRODES structure");
1978  }
1979  {
1980  StatusCode status = detStore->record(gStraightAbsorbers,"STRAIGHTABSORBERS");
1981  if(!status.isSuccess()) throw std::runtime_error ("Cannot store STRAIGHTABSORBERS structure");
1982  }
1983  }
1984 
1985 #endif // BUILD_ACCORDION_PLATES
1986 
1987  log << MSG::DEBUG << "++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
1988  log << "+ +" << std::endl;
1989  log << "+ END of Barrel EM GeoModel definition +" << std::endl;
1990  log << "+ +" << std::endl;
1991  log << "++++++++++++++++++++++++++++++++++++++++++++++++++++" << endmsg;
1992 
1993 
1994 }

◆ operator=()

BarrelConstruction& LArGeo::BarrelConstruction::operator= ( const BarrelConstruction )
private

◆ printParams()

void LArGeo::BarrelConstruction::printParams ( )

Definition at line 1996 of file BarrelConstruction.cxx.

1997 {
1998  std::cout << "******** Print out of LArBarrel Accordion parameters " << std::endl;
1999  std::cout << "Absorber parameters: " <<std::endl;
2000  std::cout << "Glue for ThinAbs " <<
2001  m_parameters->GetValue("LArEMBThinAbsGlue") << std::endl;
2002  std::cout << "Iron for ThinAbs " <<
2003  m_parameters->GetValue("LArEMBThinAbsIron") << std::endl;
2004  std::cout << "Lead for ThinAbs " <<
2005  m_parameters->GetValue("LArEMBThinAbsLead") << std::endl;
2006  std::cout << "Glue for ThickAbs " <<
2007  m_parameters->GetValue("LArEMBThickAbsGlue") << std::endl;
2008  std::cout << "Iron for ThickAbs " <<
2009  m_parameters->GetValue("LArEMBThickAbsIron") << std::endl;
2010  std::cout << "Lead for ThickAbs "
2011  << m_parameters->GetValue("LArEMBThickAbsLead") << std::endl;
2012 
2013  std::cout << "Electrode parameters: " << std::endl;
2014  std::cout << "Copper thickness " <<
2015  m_parameters->GetValue("LArEMBThickElecCopper") << std::endl;
2016  std::cout << "Kapton thickness " <<
2017  m_parameters->GetValue("LArEMBThickElecKapton") << std::endl;
2018 
2019  std::cout << "Accordion geometry description " << std::endl;
2020  std::cout << "phi first absorber " <<
2021  m_parameters->GetValue("LArEMBAbsPhiFirst") << std::endl;
2022  std::cout << "zmin of absorber " <<
2023  m_parameters->GetValue("LArEMBMotherZmin") << std::endl;
2024  std::cout << "zmax of absorber " <<
2025  m_parameters->GetValue("LArEMBMotherZmax") << std::endl;
2026  std::cout << "Max eta " <<
2027  m_parameters->GetValue("LArEMBMaxEtaAcceptance") << std::endl;
2028  std::cout << "Nominal eta lead change " <<
2029  m_parameters->GetValue("LArEMBThickEtaAcceptance") << std::endl;
2030  std::cout << "Number of abs in phi " <<
2031  m_parameters->GetValue("LArEMBnoOFPhysPhiCell") << std::endl;
2032  std::cout << "Dphi between absorbers " <<
2033  m_parameters->GetValue("LArEMBPhiGapAperture") << std::endl;
2034  std::cout << "Rmin Mother " <<
2035  m_parameters->GetValue("LArEMBMotherRmin") << std::endl;
2036  std::cout << "Rmax Mother " <<
2037  m_parameters->GetValue("LArEMBMotherRmax") << std::endl;
2038  std::cout << "Rmin at zmax " <<
2039  m_parameters->GetValue("LArEMBRminHighZ") << std::endl;
2040  std::cout << "Phimax barrel " <<
2041  m_parameters->GetValue("LArEMBphiMaxBarrel") << std::endl;
2042  std::cout << "Number of zigs " <<
2043  m_parameters->GetValue("LArEMBnoOFAccZigs") << std::endl;
2044  std::cout << "Fold Gaudi::Units::rad of curvature " <<
2045  m_parameters->GetValue("LArEMBNeutFiberRadius") << std::endl;
2046  for (int i=0;i<15;i++) {
2047  std::cout << "Fold " << i << " radius " <<
2048  m_parameters->GetValue("LArEMBRadiusAtCurvature",i) << std::endl;
2049  }
2050  for (int i=0;i<15;i++) {
2051  std::cout << "Fold " << i << " phi0 " <<
2052  m_parameters->GetValue("LArEMBPhiAtCurvature",i) << std::endl;
2053  }
2054  for (int i=0;i<15;i++) {
2055  std::cout << "Fold " << i << " eta trans " <<
2056  m_parameters->GetValue("LArEMBEtaTrans",i) << std::endl;
2057  }
2058  for (int i=0;i<14;i++) {
2059  std::cout << "zig " << i << " angle " <<
2060  m_parameters->GetValue("LArEMBDeltaZigAngle",i) << std::endl;
2061  }
2062 
2063  std::cout << "Fiducial active region definition " << std::endl;
2064  std::cout << "Zmin " <<
2065  m_parameters->GetValue("LArEMBfiducialMothZmin") << std::endl;
2066  std::cout << "Zmax " <<
2067  m_parameters->GetValue("LArEMBfiducialMothZmax") << std::endl;
2068  std::cout << "Rmin " <<
2069  m_parameters->GetValue("LArEMBRadiusInnerAccordion") << std::endl;
2070  std::cout << "Rmax " <<
2071  m_parameters->GetValue("LArEMBFiducialRmax") << std::endl;
2072  std::cout << "Inactive DR S1 to S2 " <<
2073  m_parameters->GetValue("LArEMBDeltaRS12") << std::endl;
2074 
2075  std::cout << "Description of matter from PS to strip " << std::endl;
2076  std::cout << "DeltaR for LAR+Cable+MotherBoard volume " <<
2077  m_parameters->GetValue("LArEMBInnerElectronics") << std::endl;
2078  std::cout << "Number of cable volumes " <<
2079  m_parameters->GetValue("LArEMBnoOFcableBundle") << std::endl;
2080  std::cout << "Cable Cu fraction " <<
2081  m_parameters->GetValue("LArEMBmasspercentCu") << std::endl;
2082  std::cout << "Cable Kapton fraction " <<
2083  m_parameters->GetValue("LArEMBmasspercentKap") << std::endl;
2084  std::cout << "Cable thickness@eta=0 " <<
2085  m_parameters->GetValue("LArEMBCablethickat0") << std::endl;
2086  std::cout << "Cable thick increase/eta " <<
2087  m_parameters->GetValue("LArEMBthickincrfac") << std::endl;
2088  std::cout << "Cable width " <<
2089  m_parameters->GetValue("LArEMBCableEtaheight") << std::endl;
2090  std::cout << "DR of cable from PS " <<
2091  m_parameters->GetValue("LArEMBCablclearfrPS") << std::endl;
2092  std::cout << "Number of motherboard " <<
2093  m_parameters->GetValue("LArEMBnoOFmothboard") << std::endl;
2094  std::cout << "MotherBoard Cu thickness " <<
2095  m_parameters->GetValue("LArEMBCuThickness") << std::endl;
2096  std::cout << "MotherBoard G10 thickness " <<
2097  m_parameters->GetValue("LArEMBG10Thickness") << std::endl;
2098  std::cout << "MotherBoard thickness " <<
2099  m_parameters->GetValue("LArEMBMoBoTchickness") << std::endl;
2100  std::cout << "MotherBoard width " <<
2101  m_parameters->GetValue("LArEMBMoBoHeight") << std::endl;
2102  std::cout << "MotherBoard DR from PS " <<
2103  m_parameters->GetValue("LArEMBMoBoclearfrPS") << std::endl;
2104  std::cout << "G10 inner ring thickness " <<
2105  m_parameters->GetValue("LArEMBG10SupportBarsIn") << std::endl;
2106  std::cout << "Dz G10 inner ring " <<
2107  m_parameters->GetValue("LArEMBG10FrontDeltaZ") << std::endl;
2108  std::cout << "G10 front tip " <<
2109  m_parameters->GetValue("LArEMBG10TipThickFront") << std::endl;
2110  std::cout << "Absorber front tip " <<
2111  m_parameters->GetValue("LArEMBLeadTipThickFront") << std::endl;
2112  std::cout << "Description of matter after accordion " << std::endl;
2113  std::cout << "G10 outer ring thickness " <<
2114  m_parameters->GetValue("LArEMBG10SupportBarsOut") << std::endl,
2115  std::cout << "Absorber outer tip " <<
2116  m_parameters->GetValue("LArEMBLeadTipThickEnd") << std::endl;
2117  std::cout << "G10 outer tip " <<
2118  m_parameters->GetValue("LArEMBG10TipThickEnd") << std::endl;
2119  std::cout << "total outer tip DeltaR " <<
2120  m_parameters->GetValue("LArEMBLArGapTail") << std::endl;
2121 }

◆ setBarrelCellVisLimit()

void LArGeo::BarrelConstruction::setBarrelCellVisLimit ( int  maxCell)
inline

Definition at line 37 of file BarrelConstruction.h.

37 {m_NVISLIM = maxCell;}

◆ setBarrelSagging()

void LArGeo::BarrelConstruction::setBarrelSagging ( bool  flag)
inline

Definition at line 36 of file BarrelConstruction.h.

36 {m_A_SAGGING = flag;}

Member Data Documentation

◆ m_A_SAGGING

bool LArGeo::BarrelConstruction::m_A_SAGGING {}
private

Definition at line 54 of file BarrelConstruction.h.

◆ m_ecamPhysicalNeg

GeoIntrusivePtr<GeoFullPhysVol> LArGeo::BarrelConstruction::m_ecamPhysicalNeg {}
private

Definition at line 59 of file BarrelConstruction.h.

◆ m_ecamPhysicalPos

GeoIntrusivePtr<GeoFullPhysVol> LArGeo::BarrelConstruction::m_ecamPhysicalPos {}
private

Definition at line 58 of file BarrelConstruction.h.

◆ m_fullGeo

bool LArGeo::BarrelConstruction::m_fullGeo {}
private

Definition at line 61 of file BarrelConstruction.h.

◆ m_NVISLIM

int LArGeo::BarrelConstruction::m_NVISLIM {-1}
private

Definition at line 55 of file BarrelConstruction.h.

◆ m_parameters

const LArGeo::VDetectorParameters* LArGeo::BarrelConstruction::m_parameters {}
private

Definition at line 52 of file BarrelConstruction.h.


The documentation for this class was generated from the following files:
IRDBRecord::getInt
virtual int getInt(const std::string &fieldName) const =0
Get int field value.
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
VertexShift::Zmax
const float Zmax
Definition: VertexShift.h:26
GeoStraightAccSection
Record of All Electrode Straight Pieces.
Definition: GeoStraightAccSection.h:24
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
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
LArGeo::BarrelConstruction::m_parameters
const LArGeo::VDetectorParameters * m_parameters
Definition: BarrelConstruction.h:52
LAr
Definition: LArVolumeBuilder.h:36
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
GeoStraightAccSection::Sinu
const double & Sinu(int stackid, int cellid) const
Zmin
double Zmin
Definition: LArDetectorConstructionTBEC.cxx:56
StoredMaterialManager::getElement
virtual const GeoElement * getElement(const std::string &name)=0
M_PI
#define M_PI
Definition: ActiveFraction.h:11
deg
#define deg
Definition: SbPolyhedron.cxx:17
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
MCP::ScaleSmearParam::r2
@ r2
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
read_hist_ntuple.h1
h1
Definition: read_hist_ntuple.py:21
LArGeo::BarrelConstruction::m_NVISLIM
int m_NVISLIM
Definition: BarrelConstruction.h:55
LArGeo::BarrelConstruction::m_A_SAGGING
bool m_A_SAGGING
Definition: BarrelConstruction.h:54
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
LArGeo::Fx
GeoGenfun::FunctionNoop Fx(double r, GeoGenfun::GENFUNCTION G, const double Cenx[], const double Ceny[])
Definition: BarrelAuxFunctions.cxx:16
pi
#define pi
Definition: TileMuonFitter.cxx:65
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
GeoStraightAccSection::YCent
const double & YCent(int stackid, int cellid) const
StoredPhysVol
Definition: StoredPhysVol.h:27
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
LArGeo::Del1
GeoGenfun::FunctionNoop Del1(GeoGenfun::GENFUNCTION G)
Definition: BarrelAuxFunctions.cxx:34
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
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
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
checkxAOD.frac
frac
Definition: Tools/PyUtils/bin/checkxAOD.py:256
Dz
double Dz
Definition: LArDetectorConstructionTBEC.cxx:57
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
DecodeVersionKey
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
Definition: DecodeVersionKey.h:18
master.flag
bool flag
Definition: master.py:29
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
LArGeo::BarrelConstruction::m_ecamPhysicalPos
GeoIntrusivePtr< GeoFullPhysVol > m_ecamPhysicalPos
Definition: BarrelConstruction.h:58
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
LArGeo::Del2
GeoGenfun::FunctionNoop Del2(GeoGenfun::GENFUNCTION G)
Definition: BarrelAuxFunctions.cxx:42
LArGeo::VDetectorParameters::GetValue
virtual double GetValue(const std::string &, const int i0=INT_MIN, const int i1=INT_MIN, const int i2=INT_MIN, const int i3=INT_MIN, const int i4=INT_MIN) const =0
GeoStraightAccSection::Cosu
const double & Cosu(int stackid, int cellid) const
min
#define min(a, b)
Definition: cfImp.cxx:40
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
LArGeo::BarrelConstruction::m_ecamPhysicalNeg
GeoIntrusivePtr< GeoFullPhysVol > m_ecamPhysicalNeg
Definition: BarrelConstruction.h:59
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
LArGeo::Fy
GeoGenfun::FunctionNoop Fy(double r, GeoGenfun::GENFUNCTION G, const double Cenx[], const double Ceny[])
Definition: BarrelAuxFunctions.cxx:25
LArGeo::BarrelConstruction::printParams
void printParams()
Definition: BarrelConstruction.cxx:1996
IRDBRecord::isFieldNull
virtual bool isFieldNull(const std::string &fieldName) const =0
Check if the field value is NULL.
GeoStraightAccSection::setHalfLength
void setHalfLength(int stackid, double halfLength)
Definition: GeoStraightAccSection.cxx:56
IRDBRecord
IRDBRecord is one record in the IRDBRecordset object.
Definition: IRDBRecord.h:27
DEBUG
#define DEBUG
Definition: page_access.h:11
IRDBRecord_ptr
std::unique_ptr< IRDBRecord > IRDBRecord_ptr
Definition: IRDBRecordset.h:23
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
GeoStraightAccSection::HalfLength
const double & HalfLength(int stackid, int cellid) const
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
GeoStraightAccSection::XCent
const double & XCent(int stackid, int cellid) const
merge.status
status
Definition: merge.py:17
GeoStraightAccSection::setTransform
void setTransform(int stackid, GeoXF::TRANSFUNCTION TXE)
Definition: GeoStraightAccSection.cxx:60
I
#define I(x, y, z)
Definition: MD5.cxx:116
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
MCP::ScaleSmearParam::r1
@ r1
LArGeo::BarrelConstruction::m_fullGeo
bool m_fullGeo
Definition: BarrelConstruction.h:61
LArGeo::BarrelConstruction::MakeEnvelope
void MakeEnvelope()
Definition: BarrelConstruction.cxx:131
python.compressB64.c
def c
Definition: compressB64.py:93
maxCell
#define maxCell
GeoRef
GeoIntrusivePtr< T > GeoRef
Definition: GeoRef.h:20
LArGeo::ATan2
GeoGenfun::FunctionNoop ATan2(GeoGenfun::GENFUNCTION y, GeoGenfun::GENFUNCTION x)
Definition: BarrelAuxFunctions.cxx:50