13 #include "GeoModelKernel/GeoTrd.h" 
   14 #include "GeoModelKernel/GeoTubs.h" 
   15 #include "GeoModelKernel/GeoLogVol.h" 
   16 #include "GeoModelKernel/GeoPhysVol.h" 
   17 #include "GeoModelKernel/GeoFullPhysVol.h" 
   18 #include "GeoModelKernel/GeoMaterial.h" 
   19 #include "GeoModelKernel/GeoNameTag.h" 
   20 #include "GeoModelKernel/GeoShapeUnion.h" 
   21 #include "GeoModelKernel/GeoShapeShift.h" 
   22 #include "GeoModelKernel/GeoDefinitions.h" 
   24 #include "GeoGenericFunctions/AbsFunction.h" 
   25 #include "GeoGenericFunctions/Variable.h" 
   26 #include "GeoModelKernel/GeoXF.h" 
   27 #include "GeoModelKernel/GeoSerialTransformer.h" 
   28 #include "GeoModelKernel/GeoSerialIdentifier.h" 
   29 #include "GeoModelKernel/GeoTransform.h" 
   34 #include "GaudiKernel/MsgStream.h" 
   35 #include "GaudiKernel/SystemOfUnits.h" 
   40 using namespace GeoXF;
 
   48         : m_detectorStore(pDetStore)
 
   51         , m_switches(switches)
 
   71   if (StatusCode::SUCCESS != 
m_detectorStore->retrieve(theMaterialManager, 
"MATERIALS")) {
 
   72     (*m_log) << MSG::ERROR << 
"Could not find Material Manager MATERIALS" << 
endmsg;
 
   75   const GeoMaterial* matAir = theMaterialManager->
getMaterial(
"std::Air");
 
   89   double thicknessWedgeMother, heightWedgeMother, dy1WedgeMother, dy2WedgeMother;
 
   98   double RInMin = 999999.9;
 
  101   bool IfEBNeg = 
false;
 
  102   bool IfEBPos = 
false;
 
  103   double tileTBEnvThickness = 0;
 
  104   double ZLengthEBarrelNeg =0, ZLengthEBarrelPos =0;
 
  109   double EBFingerLength = dbManager->
TIFGdz();
 
  111   double BFingerLength = dbManager->
TIFGdz();
 
  115   double FingerRmin = dbManager->
TILBrmax();
 
  118   for (
int i = 0; 
i < n_env ; ++
i) {
 
  139   (*m_log) << 
MSG::DEBUG << 
"tileTBEnvThickness 1 " << tileTBEnvThickness << 
endmsg;
 
  147   (*m_log) << 
MSG::DEBUG << 
"tileTBEnvThickness 2 " << tileTBEnvThickness << 
endmsg;
 
  155   (*m_log) << 
MSG::DEBUG << 
"tileTBEnvThickness 3 " << tileTBEnvThickness << 
endmsg;
 
  159   if ((!IfEBNeg)&&(!IfEBPos)) {
 
  161     tileTBEnvThickness += 2 * fabs(dbManager->
GetEnvDZ());
 
  164   (*m_log) << 
MSG::DEBUG << 
"Presence of barrel " << ((IfB) ? 
"true" : 
"false") << 
endmsg;
 
  165   (*m_log) << 
MSG::DEBUG << 
"Presence of positive ext.barrel " << ((IfEBPos) ? 
"true" : 
"false") << 
endmsg;
 
  166   (*m_log) << 
MSG::DEBUG << 
"Presence of negative ext.barrel " << ((IfEBNeg) ? 
"true" : 
"false") << 
endmsg;
 
  168   (*m_log) << 
MSG::DEBUG << 
"tileTBEnvThickness " << tileTBEnvThickness << 
endmsg;
 
  182   (*m_log) << 
MSG::DEBUG << 
"TileTB envelope parameters: " 
  183            << 
" length=" << tileTBEnvThickness << 
" cm" 
  184            << 
" Rmin=" << RInMin << 
" cm" 
  185            << 
" Rmax=" << ROutMax << 
" cm" 
  186            << 
" PhiMin=" << 
PhiMin << 
" deg" 
  187            << 
" PhiMax=" << 
PhiMax << 
" deg" 
  190   GeoLogVol* lvTileTBEnv = 
new GeoLogVol(
"TileTBEnv",tileTBEnv,matAir);
 
  191   GeoFullPhysVol* pvTileTBEnv = 
new GeoFullPhysVol(lvTileTBEnv);
 
  193   GeoFullPhysVol *pvBarrelMother     =0;
 
  194   GeoFullPhysVol *pvEBarrelMotherNeg =0, *pvEBarrelMotherPos =0;
 
  195   GeoFullPhysVol *pvFingerMotherNeg  =0, *pvFingerMotherPos  =0;
 
  196   GeoFullPhysVol *pvEFingerMotherNeg =0, *pvEFingerMotherPos =0;
 
  197   GeoFullPhysVol *pvITCMotherPos     =0, *pvITCMotherNeg     =0;
 
  200   for (
int EnvCounter = 0; EnvCounter < NumberOfEnv; ++EnvCounter) { 
 
  222       GeoTubs* barrelMother = GeneralMother;
 
  223       GeoLogVol* lvBarrelMother = 
new GeoLogVol(
"Barrel",barrelMother,matAir);
 
  224       pvBarrelMother = 
new GeoFullPhysVol(lvBarrelMother);
 
  226       (*m_log) << 
MSG::DEBUG << 
"Barrel envelope parameters: " 
  227                << 
" length=" << (dbManager->
GetEnvZLength() - 2 * BFingerLength) << 
" cm" 
  228                << 
" Rmin=" << (dbManager->
GetEnvRin()) << 
" cm" 
  229                << 
" Rmax=" << (dbManager->
GetEnvRout()) << 
" cm" 
  230                << 
" nMod=" << NumberOfMod
 
  242       GeoLogVol* lvFingerMother = 
new GeoLogVol(
"Finger",fingerMother,matAir);
 
  243       pvFingerMotherPos = 
new GeoFullPhysVol(lvFingerMother);
 
  244       pvFingerMotherNeg = 
new GeoFullPhysVol(lvFingerMother);
 
  246       (*m_log) << 
MSG::DEBUG << 
"Barrel finger envelope parameters: " 
  247                << 
" length=" << BFingerLength << 
" cm" 
  248                << 
" Rmin=" << FingerRmin << 
" cm" 
  249                << 
" Rmax=" << (dbManager->
GetEnvRout()) << 
" cm" 
  250                << 
" nMod=" << NumberOfMod
 
  261       GeoTubs* ebarrelMotherPos = GeneralMother;
 
  262       GeoLogVol* lvEBarrelMotherPos = 
new GeoLogVol(
"EBarrel",ebarrelMotherPos,matAir);
 
  263       pvEBarrelMotherPos = 
new GeoFullPhysVol(lvEBarrelMotherPos);
 
  265       (*m_log) << 
MSG::DEBUG << 
"Positive ext.barrel envelope parameters: " 
  266                << 
" length=" << (dbManager->
GetEnvZLength() - EBFingerLength) << 
" cm" 
  267                << 
" Rmin=" << (dbManager->
GetEnvRin()) << 
" cm" 
  268                << 
" Rmax=" << (dbManager->
GetEnvRout()) << 
" cm" 
  269                << 
" nMod=" << NumberOfMod
 
  279       GeoLogVol* lvEFingerMother = 
new GeoLogVol(
"EFinger",fingerMother,matAir);
 
  280       pvEFingerMotherPos = 
new GeoFullPhysVol(lvEFingerMother);
 
  282       (*m_log) << 
MSG::DEBUG << 
"Positive ext.barrel finger envelope parameters: " 
  283                << 
" length=" << EBFingerLength << 
" cm" 
  284                << 
" Rmin=" << FingerRmin << 
" cm" 
  285                << 
" Rmax=" << (dbManager->
GetEnvRout()) << 
" cm" 
  286                << 
" nMod=" << NumberOfMod
 
  296       GeoTubs* ebarrelMotherNeg = GeneralMother;
 
  297       GeoLogVol* lvEBarrelMotherNeg = 
new GeoLogVol(
"EBarrel",ebarrelMotherNeg,matAir);
 
  298       pvEBarrelMotherNeg = 
new GeoFullPhysVol(lvEBarrelMotherNeg);
 
  300       (*m_log) << 
MSG::DEBUG << 
"Negative ext.barrel envelope parameters: " 
  301                << 
" length=" << (dbManager->
GetEnvZLength() - EBFingerLength) << 
" cm" 
  302                << 
" Rmin=" << (dbManager->
GetEnvRin()) << 
" cm" 
  303                << 
" Rmax=" << (dbManager->
GetEnvRout()) << 
" cm" 
  304                << 
" nMod=" << NumberOfMod
 
  314       GeoLogVol* lvEFingerMother = 
new GeoLogVol(
"EFinger",fingerMother,matAir);
 
  315       pvEFingerMotherNeg = 
new GeoFullPhysVol(lvEFingerMother);
 
  317       (*m_log) << 
MSG::DEBUG << 
"Negative ext.barrel finger envelope parameters: " 
  318                << 
" length=" << EBFingerLength << 
" cm" 
  319                << 
" Rmin=" << FingerRmin << 
" cm" 
  320                << 
" Rmax=" << (dbManager->
GetEnvRout()) << 
" cm" 
  321                << 
" nMod=" << NumberOfMod
 
  332       GeoTubs* itcMother = GeneralMother;
 
  333       GeoLogVol* lvITCMother = 
new GeoLogVol(
"ITC",itcMother,matAir);
 
  334       pvITCMotherPos = 
new GeoFullPhysVol(lvITCMother);
 
  336       (*m_log) << 
MSG::DEBUG << 
"Positive ITC envelope parameters: " 
  338                << 
" Rmin=" << (dbManager->
GetEnvRin()) << 
" cm" 
  339                << 
" Rmax=" << (dbManager->
GetEnvRout()) << 
" cm" 
  340                << 
" nMod=" << NumberOfMod
 
  351       GeoTubs* itcMotherNeg = GeneralMother;
 
  352       GeoLogVol* lvITCMotherNeg = 
new GeoLogVol(
"ITC",itcMotherNeg,matAir);
 
  353       pvITCMotherNeg = 
new GeoFullPhysVol(lvITCMotherNeg);
 
  355       (*m_log) << 
MSG::DEBUG << 
"Negative ITC envelope parameters: " 
  357                << 
" Rmin=" << (dbManager->
GetEnvRin()) << 
" cm" 
  358                << 
" Rmax=" << (dbManager->
GetEnvRout()) << 
" cm" 
  359                << 
" nMod=" << NumberOfMod
 
  370     for (
int ModCounter = 0; ModCounter < NumberOfMod; ModCounter+=NumberOfMod) {
 
  375                << 
"ModCounter is " << ModCounter
 
  376                << 
" ModType is " << ModType
 
  377                << 
" ModPositionNumber is " << ModPositionNumber
 
  386       if ( EnvType == 1 || EnvType == 0 ) { 
 
  395         GeoTrd* barrelModuleMother = 
new GeoTrd(thicknessWedgeMother/2.,
 
  396                                                 thicknessWedgeMother/2.,
 
  399                                                 heightWedgeMother/2.);
 
  401         GeoLogVol* lvBarrelModuleMother = 
new GeoLogVol(
"BarrelModule",barrelModuleMother,matAir);
 
  402         PVLink pvBarrelModuleMother = 
new GeoPhysVol(lvBarrelModuleMother);
 
  414         GeoSerialTransformer* stBarrelModuleMother = 
new GeoSerialTransformer(pvBarrelModuleMother,
 
  415            &xfBarrelModuleMother,
 
  418           pvBarrelMother->add(
new GeoSerialIdentifier(ModPositionNumber));
 
  419           pvBarrelMother->add(stBarrelModuleMother);
 
  421           (*m_log) << MSG::ERROR << 
"pvBarrelMother is null in " << __func__ << 
endmsg;
 
  437         GeoTrd* fingerModuleMother = 
new GeoTrd(thicknessWedgeMother/2.,
 
  438                                                 thicknessWedgeMother/2.,
 
  441                                                 heightWedgeMother/2.);
 
  443         GeoLogVol* lvFingerModuleMother = 
new GeoLogVol(
"FingerModule",fingerModuleMother,matAir);
 
  444         PVLink pvFingerModuleMother = 
new GeoPhysVol(lvFingerModuleMother);
 
  447         sectionBuilder->
fillFinger(pvFingerModuleMother, 1,
 
  458         GeoSerialTransformer* stFingerModuleMotherPos = 
new GeoSerialTransformer(pvFingerModuleMother,
 
  459                                                                                  &xfFingerModuleMotherPos,
 
  461         pvFingerMotherPos->add(
new GeoSerialIdentifier(ModPositionNumber));
 
  462         pvFingerMotherPos->add(stFingerModuleMotherPos);
 
  466         GeoSerialTransformer* stFingerModuleMotherNeg = 
new GeoSerialTransformer(pvFingerModuleMother,
 
  467                                                                                  &xfFingerModuleMotherNeg,
 
  469         pvFingerMotherNeg->add(
new GeoSerialIdentifier(ModPositionNumber));
 
  470         pvFingerMotherNeg->add(stFingerModuleMotherNeg);
 
  476       if ((ModType == 2)&&(EnvType == 3)) {
 
  486         GeoTrd* ebarrelModuleMotherPos = 
new GeoTrd(thicknessWedgeMother/2.,
 
  487                                                     thicknessWedgeMother/2.,
 
  490                                                     heightWedgeMother/2.);
 
  492         GeoLogVol* lvEBarrelModuleMotherPos = 
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherPos,matAir);
 
  493         PVLink pvEBarrelModuleMotherPos = 
new GeoPhysVol(lvEBarrelModuleMotherPos);
 
  496         sectionBuilder->
fillSection(pvEBarrelModuleMotherPos,
 
  505         GeoSerialTransformer* stEBarrelModuleMotherPos = 
new GeoSerialTransformer(pvEBarrelModuleMotherPos,
 
  506                                                                                   &xfEBarrelModuleMotherPos,
 
  508         pvEBarrelMotherPos->add(
new GeoSerialIdentifier(ModPositionNumber));
 
  509         pvEBarrelMotherPos->add(stEBarrelModuleMotherPos);
 
  522         GeoTrd* efingerModuleMother = 
new GeoTrd(thicknessWedgeMother/2.,
 
  523                                                  thicknessWedgeMother/2.,
 
  526                                                  heightWedgeMother/2.);
 
  528         GeoLogVol* lvEFingerModuleMother = 
new GeoLogVol(
"EFingerModule",efingerModuleMother,matAir);
 
  529         PVLink pvEFingerModuleMother = 
new GeoPhysVol(lvEFingerModuleMother);
 
  532         sectionBuilder->
fillFinger(pvEFingerModuleMother,
 
  543         GeoSerialTransformer* stEFingerModuleMotherPos = 
new GeoSerialTransformer(pvEFingerModuleMother,
 
  544                                                                                   &xfEFingerModuleMotherPos,
 
  546         pvEFingerMotherPos->add(
new GeoSerialIdentifier(ModPositionNumber));
 
  547         pvEFingerMotherPos->add(stEFingerModuleMotherPos);
 
  553       if ((ModType == 2)&&(EnvType == 2)) {
 
  563         GeoTrd* ebarrelModuleMotherNeg = 
new GeoTrd(thicknessWedgeMother/2.,
 
  564                                                     thicknessWedgeMother/2.,
 
  567                                                     heightWedgeMother/2.);
 
  569         GeoLogVol* lvEBarrelModuleMotherNeg = 
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherNeg,matAir);
 
  570         PVLink pvEBarrelModuleMotherNeg = 
new GeoPhysVol(lvEBarrelModuleMotherNeg);
 
  573         sectionBuilder->
fillSection(pvEBarrelModuleMotherNeg,
 
  582         GeoSerialTransformer* stEBarrelModuleMotherNeg = 
new GeoSerialTransformer(pvEBarrelModuleMotherNeg,
 
  583                                                                                   &xfEBarrelModuleMotherNeg,
 
  585         pvEBarrelMotherNeg->add(
new GeoSerialIdentifier(ModPositionNumber));
 
  586         pvEBarrelMotherNeg->add(stEBarrelModuleMotherNeg);
 
  600         GeoTrd* efingerModuleMother = 
new GeoTrd(thicknessWedgeMother/2.,
 
  601                                                  thicknessWedgeMother/2.,
 
  604                                                  heightWedgeMother/2.);
 
  606         GeoLogVol* lvEFingerModuleMother = 
new GeoLogVol(
"EFingerModule",efingerModuleMother,matAir);
 
  607         PVLink pvEFingerModuleMother = 
new GeoPhysVol(lvEFingerModuleMother);
 
  610         sectionBuilder->
fillFinger(pvEFingerModuleMother,
 
  619         GeoSerialTransformer* stEFingerModuleMotherNeg = 
new GeoSerialTransformer(pvEFingerModuleMother,
 
  620                                                                                   &xfEFingerModuleMotherNeg,
 
  622         pvEFingerMotherNeg->add(
new GeoSerialIdentifier(ModPositionNumber));
 
  623         pvEFingerMotherNeg->add(stEFingerModuleMotherNeg);
 
  629       if (((ModType == 6050403)||(ModType == 403))&&(EnvType == 5)) {
 
  642         GeoTrd* itcModuleMotherPos = 
new GeoTrd(thicknessWedgeMother/2.,
 
  643                                                 thicknessWedgeMother/2.,
 
  646                                                 heightWedgeMother/2.);
 
  648         GeoLogVol* lvITCModuleMotherPos = 
new GeoLogVol(
"ITCModule",itcModuleMotherPos,matAir);
 
  649         PVLink pvITCModuleMotherPos = 
new GeoPhysVol(lvITCModuleMotherPos);
 
  664         GeoTrd* plug1SubMother = 
new GeoTrd(thicknessWedgeMother/2.,
 
  665                                             thicknessWedgeMother/2.,
 
  668                                             heightWedgeMother/2.);
 
  675         GeoTrd* plug2SubMother = 
new GeoTrd(thicknessWedgeMother/2.,
 
  676                                             thicknessWedgeMother/2.,
 
  679                                             heightWedgeMother/2.);
 
  685         const GeoShapeUnion& plug1ModuleMother = plug1SubMother->add(*plug2SubMother<<plug1SubOffset);
 
  686         GeoLogVol* lvPlug1ModuleMother = 
new GeoLogVol(
"Plug1Module",&plug1ModuleMother,matAir);
 
  687         PVLink pvPlug1ModuleMother = 
new GeoPhysVol(lvPlug1ModuleMother);
 
  690         sectionBuilder->
fillSection(pvPlug1ModuleMother, 3,
 
  698         GeoTransform* tfPlug1ModuleMother = 
new GeoTransform(GeoTrf::Translate3D(0.,
 
  703         pvITCModuleMotherPos->add(tfPlug1ModuleMother);
 
  704         pvITCModuleMotherPos->add(pvPlug1ModuleMother);
 
  714         GeoTrd* plug2ModuleMother = 
new GeoTrd(thicknessWedgeMother/2.,
 
  715                                                thicknessWedgeMother/2.,
 
  718                                                heightWedgeMother/2.);
 
  720         GeoLogVol* lvPlug2ModuleMother = 
new GeoLogVol(
"Plug2Module",plug2ModuleMother,matAir);
 
  721         PVLink pvPlug2ModuleMother = 
new GeoPhysVol(lvPlug2ModuleMother);
 
  736         pvITCModuleMotherPos->add(tfPlug2ModuleMother);
 
  737         pvITCModuleMotherPos->add(pvPlug2ModuleMother);
 
  741         GeoSerialTransformer* stITCModuleMotherPos = 
new GeoSerialTransformer(pvITCModuleMotherPos,
 
  742                                                                               &xfITCModuleMotherPos,
 
  744         pvITCMotherPos->add(
new GeoSerialIdentifier(ModPositionNumber));
 
  745         pvITCMotherPos->add(stITCModuleMotherPos);
 
  751       if (((ModType == 6050403)||(ModType == 403))&&(EnvType == 4)) {
 
  764         GeoTrd* itcModuleMotherNeg = 
new GeoTrd(thicknessWedgeMother/2.,
 
  765                                                 thicknessWedgeMother/2.,
 
  768                                                 heightWedgeMother/2.);
 
  770         GeoLogVol* lvITCModuleMotherNeg = 
new GeoLogVol(
"ITCModule",itcModuleMotherNeg,matAir);
 
  771         PVLink pvITCModuleMotherNeg = 
new GeoPhysVol(lvITCModuleMotherNeg);
 
  786         GeoTrd* plug1SubMother = 
new GeoTrd(thicknessWedgeMother/2.,
 
  787                                             thicknessWedgeMother/2.,
 
  790                                             heightWedgeMother/2.);
 
  797         GeoTrd* plug2SubMother = 
new GeoTrd(thicknessWedgeMother/2.,
 
  798                                             thicknessWedgeMother/2.,
 
  801                                             heightWedgeMother/2.);
 
  807         const GeoShapeUnion& plug1ModuleMother = plug1SubMother->add(*plug2SubMother<<plug1SubOffset);
 
  808         GeoLogVol* lvPlug1ModuleMother = 
new GeoLogVol(
"Plug1Module",&plug1ModuleMother,matAir);
 
  809         PVLink pvPlug1ModuleMother = 
new GeoPhysVol(lvPlug1ModuleMother);
 
  821         GeoTransform* tfPlug1ModuleMother = 
new GeoTransform(GeoTrf::Translate3D(0.,
 
  826         pvITCModuleMotherNeg->add(tfPlug1ModuleMother);
 
  827         pvITCModuleMotherNeg->add(pvPlug1ModuleMother);
 
  837         GeoTrd* plug2ModuleMother = 
new GeoTrd(thicknessWedgeMother/2.,
 
  838                                                thicknessWedgeMother/2.,
 
  841                                                heightWedgeMother/2.);
 
  843         GeoLogVol* lvPlug2ModuleMother = 
new GeoLogVol(
"Plug2Module",plug2ModuleMother,matAir);
 
  844         PVLink pvPlug2ModuleMother = 
new GeoPhysVol(lvPlug2ModuleMother);
 
  859         pvITCModuleMotherNeg->add(tfPlug2ModuleMother);
 
  860         pvITCModuleMotherNeg->add(pvPlug2ModuleMother);
 
  864         GeoSerialTransformer* stITCModuleMotherNeg = 
new GeoSerialTransformer(pvITCModuleMotherNeg,
 
  865                                                                               &xfITCModuleMotherNeg,
 
  867         pvITCMotherNeg->add(
new GeoSerialIdentifier(ModPositionNumber));
 
  868         pvITCMotherNeg->add(stITCModuleMotherNeg);
 
  874     if (EnvType == 1 || EnvType == 0) {
 
  875       GeoTransform* tfBarrelMother;
 
  877       if ((IfEBPos&&IfEBNeg)||((!IfEBPos)&&(!IfEBNeg))) {
 
  880       else if (IfEBPos&&(!IfEBNeg)) {
 
  883       else if ((!IfEBPos)&&IfEBNeg) {
 
  890       (*m_log) << 
MSG::DEBUG << 
"Positioning barrel with translation " << ztrans << 
" cm" << 
endmsg;
 
  891       GeoNameTag* ntBarrelModuleMother = 
new GeoNameTag(
"Barrel");
 
  893       pvTileTBEnv->add(tfBarrelMother);
 
  894       pvTileTBEnv->add(ntBarrelModuleMother);
 
  895       pvTileTBEnv->add(pvBarrelMother);
 
  897       GeoTransform* tfFingerMotherPos;
 
  899       if ((IfEBPos&&IfEBNeg)||((!IfEBPos)&&(!IfEBNeg))) {
 
  902       else if ((!IfEBPos)&&IfEBNeg) {
 
  903         ztrans = dbManager->
GetEnvDZ() + (tileTBEnvThickness/2. - BFingerLength/2.);
 
  905       else if (IfEBPos&&(!IfEBNeg)) {
 
  906         ztrans = dbManager->
GetEnvDZ() + (-tileTBEnvThickness/2. + dbManager->
GetEnvZLength() - BFingerLength/2.);
 
  912       (*m_log) << 
MSG::DEBUG << 
"Positioning positive barrel finger with translation " << ztrans
 
  914       GeoNameTag* ntFingerMotherPos = 
new GeoNameTag(
"TileFingerPos");
 
  915       pvTileTBEnv->add(tfFingerMotherPos);
 
  916       pvTileTBEnv->add(ntFingerMotherPos);
 
  917       pvTileTBEnv->add(pvFingerMotherPos);
 
  919       GeoTransform* tfFingerMotherNeg;
 
  921       if ((IfEBPos&&IfEBNeg)||((!IfEBPos)&&(!IfEBNeg))) {
 
  924       else if (IfEBPos&&(!IfEBNeg)) {
 
  925         ztrans = dbManager->
GetEnvDZ() + (-tileTBEnvThickness/2. + BFingerLength/2.);
 
  927       else if ((!IfEBPos)&&IfEBNeg) {
 
  928         ztrans = dbManager->
GetEnvDZ() + ( tileTBEnvThickness/2. - dbManager->
GetEnvZLength() + BFingerLength/2.);
 
  934       (*m_log) << 
MSG::DEBUG << 
"Positioning negative barrel finger with translation " << ztrans
 
  936       GeoNameTag* ntFingerMotherNeg = 
new GeoNameTag(
"TileFingerNeg");
 
  937       pvTileTBEnv->add(tfFingerMotherNeg);
 
  938       pvTileTBEnv->add(ntFingerMotherNeg);
 
  939       pvTileTBEnv->add(pvFingerMotherNeg);
 
  945       ztrans = (tileTBEnvThickness/2. - dbManager->
GetEnvZLength()/2. - EBFingerLength/2.);
 
  947       (*m_log) << 
MSG::DEBUG << 
"Positioning positive ext.barrel with translation " << ztrans
 
  950       GeoNameTag* ntEBarrelMotherPos = 
new GeoNameTag(
"EBarrelPos");
 
  951       pvTileTBEnv->add(tfEBarrelMotherPos);
 
  952       pvTileTBEnv->add(ntEBarrelMotherPos);
 
  953       pvTileTBEnv->add(pvEBarrelMotherPos);
 
  955       ztrans = (tileTBEnvThickness/2. - EBFingerLength/2.);
 
  957       (*m_log) << 
MSG::DEBUG << 
"Positioning positive ext.barrel finger with translation " << ztrans
 
  960       GeoNameTag* ntEFingerMotherPos = 
new GeoNameTag(
"TileEFingerPos");
 
  961       pvTileTBEnv->add(tfEFingerMotherPos);
 
  962       pvTileTBEnv->add(ntEFingerMotherPos);
 
  963       pvTileTBEnv->add(pvEFingerMotherPos);
 
  968       ztrans = (-tileTBEnvThickness/2. + dbManager->
GetEnvZLength()/2. + EBFingerLength/2.);
 
  970       (*m_log) << 
MSG::DEBUG << 
"Positioning negative ext.barrel with translation " << ztrans
 
  973       GeoNameTag* ntEBarrelMotherNeg = 
new GeoNameTag(
"EBarrelNeg");
 
  974       pvTileTBEnv->add(tfEBarrelMotherNeg);
 
  975       pvTileTBEnv->add(ntEBarrelMotherNeg);
 
  976       pvTileTBEnv->add(pvEBarrelMotherNeg);
 
  978       ztrans = (-tileTBEnvThickness/2. + EBFingerLength/2.);
 
  980       (*m_log) << 
MSG::DEBUG << 
"Positioning negative ext.barrel finger with translation " << ztrans
 
  983       GeoNameTag* ntEFingerMotherNeg = 
new GeoNameTag(
"TileEFingerNeg");
 
  984       pvTileTBEnv->add(tfEFingerMotherNeg);
 
  985       pvTileTBEnv->add(ntEFingerMotherNeg);
 
  986       pvTileTBEnv->add(pvEFingerMotherNeg);
 
  991       ztrans = (tileTBEnvThickness/2. - ZLengthEBarrelPos - dbManager->
GetEnvZLength()/2.);
 
  993       (*m_log) << 
MSG::DEBUG << 
"Positioning positive ITC with translation " << ztrans
 
  996       GeoNameTag* ntITCMotherPos = 
new GeoNameTag(
"ITCPos");
 
  997       pvTileTBEnv->add(tfITCMotherPos);
 
  998       pvTileTBEnv->add(ntITCMotherPos);
 
  999       pvTileTBEnv->add(pvITCMotherPos);
 
 1003       ztrans = (-tileTBEnvThickness/2. + ZLengthEBarrelNeg + dbManager->
GetEnvZLength()/2.);
 
 1005       (*m_log) << 
MSG::DEBUG << 
"Positioning negative ITC with translation " << ztrans
 
 1008       GeoNameTag* ntITCMotherNeg = 
new GeoNameTag(
"ITCNeg");
 
 1009       pvTileTBEnv->add(tfITCMotherNeg);
 
 1010       pvTileTBEnv->add(ntITCMotherNeg);
 
 1011       pvTileTBEnv->add(pvITCMotherNeg);
 
 1017   int nModulesInSection[6] = {0,0,0,0,0,0};
 
 1018   float zShiftInSection[6] = {0.0,0.0,0.0,0.0,0.0,0.0,};
 
 1021   for (
int EnvCounter = 0; EnvCounter < NumberOfEnv; ++EnvCounter) { 
 
 1027              << 
"EnvCounter is " << EnvCounter
 
 1028              << 
" EnvType is " << EnvType
 
 1029              << 
" Nmodules is " << NumberOfMod
 
 1033     if (EnvType == 1 || EnvType == 0) { 
 
 1034       nModulesInSection[0] = nModulesInSection[1] = NumberOfMod;
 
 1035       zShiftInSection[0] = zShiftInSection[1] = Zshift;
 
 1036     } 
else if ((EnvType >0) and (EnvType < 6)) {
 
 1037       nModulesInSection[EnvType] = NumberOfMod;
 
 1038       zShiftInSection[EnvType] = Zshift;
 
 1048   int side[6] = {0,1,0,1,0,1};
 
 1050   for (
int ii=0; ii<6; ++ii) {
 
 1056                                      zShiftInSection[ii+1], 
 
 1057                                      zShiftInSection[ii]);  
 
 1066                                    nModulesInSection[ii],   
 
 1067                                    zShiftInSection[ii]);    
 
 1070     descriptor->
set(idRegion);
 
 1074     cabling->setConnected(dete[ii],
side[ii],0,nModulesInSection[ii]);
 
 1079   GeoNameTag* 
nTag = 
new GeoNameTag(
"Tile");
 
 1081   world->add(pvTileTBEnv);
 
 1084   delete sectionBuilder;