164 for (; first != last; ++first) {
172 double zshift = descr->zshift();
173 bool doZshift = (zshift != 0.0);
175 int etasign = descr->sign_eta();
176 if (side != etasign) {
177 ATH_MSG_ERROR(
"side and eta sign in TileDetDescriptor[" << n_regions
178 <<
"] do not match" );
183 <<
", " << zshift <<
", " << doZshift
184 <<
", " << etasign <<
", " << n_regions );
186 int nsamp = descr->n_samp();
188 int nphi = descr->n_phi();
189 double dphi = descr->dphi();
190 double phi_min = descr->phi_min();
191 double phi_max = descr->phi_max();
198 calo_sample0 = (int)CaloCell_ID::TileBar0;
199 else if (
m_tile_id->is_tile_extbarrel(reg_id))
200 calo_sample0 = (int)CaloCell_ID::TileExt0;
201 else if (
m_tile_id->is_tile_gap(reg_id))
202 calo_sample0 = (int)CaloCell_ID::TileGap1 - 1;
204 calo_sample0 = CaloCell_ID::Unknown;
205 std::vector<double> depth_in(1);
206 std::vector<double> depth_out(1);
211 int neta = descr->n_eta(isamp);
214 int neta = descr->n_eta(isamp);
215 double deta = descr->deta(isamp);
216 double emin = descr->eta_min(isamp);
217 double emax = descr->eta_max(isamp);
218 double rmin = descr->rcenter(isamp)-descr->dr(isamp)/2;
219 double rmax = descr->rcenter(isamp)+descr->dr(isamp)/2;
220 double zmin = descr->zcenter(isamp)-descr->dz(isamp)/2;
221 double zmax = descr->zcenter(isamp)+descr->dz(isamp)/2;
225 if ((zmax+zmin)/2. < 0) {
256 double emin = 1.e+10;
257 double emax =-1.e+10;
258 double rmin = 1.e+10;
259 double rmax =-1.e+10;
260 double zmin = 1.e+10;
261 double zmax =-1.e+10;
265 int neta = descr->n_eta(isamp);
268 emin = std::min(emin,(
double)descr->eta_min(isamp));
269 emax = std::max(emax,(
double)descr->eta_max(isamp));
270 rmin = std::min(rmin,(
double)(descr->rcenter(isamp)-descr->dr(isamp)/2));
271 rmax = std::max(rmax,(
double)(descr->rcenter(isamp)+descr->dr(isamp)/2));
272 zmin = std::min(zmin,(
double)(descr->zcenter(isamp)-descr->dz(isamp)/2));
273 zmax = std::max(zmax,(
double)(descr->zcenter(isamp)+descr->dz(isamp)/2));
277 if ((zmax+zmin)/2. < 0) {
284 int neta = (emax>1.65) ? 7 : 6;
310 double emin = 99999.0;
311 double emax =-99999.0;
312 double rmin = 99999.0;
313 double rmax =-99999.0;
314 std::vector<double> delr;
316 for (
int isamp=0; isamp<nsamp; ++isamp) {
317 delr.push_back(descr->dr(isamp));
318 emin = std::min(emin,(
double)descr->eta_min(isamp));
319 emax = std::max(emax,(
double)descr->eta_max(isamp));
320 rmin = std::min(rmin,(
double)(descr->rcenter(isamp)-descr->dr(isamp)/2));
321 rmax = std::max(rmax,(
double)(descr->rcenter(isamp)+descr->dr(isamp)/2));
323 if (emin < 0.0 ) emin = 0.0;
331 double phi = descr->phi_min() + dphi/2.;
333 for (
int iphi=0; iphi<nphi; ++iphi) {
346 m_tile_id->get_hash(
id,idhash,&module_context);
373 for (
int isamp=0; isamp<nsamp; ++isamp) {
375 int neta = descr->n_eta(isamp);
380 double rcenter = descr->rcenter(isamp);
381 double dr = descr->dr(isamp);
383 double deta = descr->deta(isamp);
384 double eta = descr->eta_min(isamp) + deta/2.;
386 for (
int ieta=0; ieta<neta; ++ieta) {
393 m_tile_id->get_hash(
id,idhash,&cell_context);
410 <<side<<
"/"<<
section<<
"/"<<module<<
"/"<<tower<<
"/"<<sample
411 <<
" rcen = "<<rcenter
414 <<
" eta1 = " << eta1
415 <<
" eta2 = " << eta2
416 <<
" eta' = " << (eta1+eta2)/2.
417 <<
" deta = " << (eta2-eta1)
418 <<
" iphi = " << iphi
419 <<
" dphi = " << dphi );
435 <<side<<
"/"<<
section<<
"/"<<module<<
"/"<<tower<<
"/"<<sample
436 <<
" rcen = "<<rcenter
439 <<
" deta = " << deta
440 <<
" iphi = " << iphi
441 <<
" dphi = " << dphi );
464 double oldz = elt->
z();
465 double olddz = elt->
dz();
470 for ( ; ic>=0; --ic) {
474 if (fabs(z2-cell_dim->
getZMax(ic))>0.1)
break;
478 for ( ; ic>=0; --ic) {
482 if (fabs(z2-cell_dim->
getZMin(ic))>0.1)
break;
487 ATH_MSG_WARNING(
"TileDetDescrManager -- ic < 0! Expect crashes or misbehavior! ==> This should be checked, because 'ic' should be related to the numbers of rows!! Note: 'ic' gets < 0 when z2-cell_dim is too small and does not make the above loop break; that can be caused, for example, if 'barrelPeriodThickness' and 'extendedPeriodThickness' are not set (or set to the default 0. value) and, as a result, ZMax is not properly set." );
490 double z = (z1+z2)/2.;
497 if (std::abs(
z) < 1e-8 * Gaudi::Units::mm) {
503 double dz = 0.5 * fabs(cell_dim->
getZMax(0)
509 if (
msgLvl (MSG::VERBOSE) && 0 == iphi) {
515 <<
"new z/dz: " <<
z <<
" " << dz <<
" ( B: " << z1 <<
" " << dz1 <<
" C: " << z2 <<
" " << dz2 <<
" ) "
516 <<
z/oldz*100-100 <<
" % diff "
517 <<
"do not change z/dz for BC cells in barrel" );
521 elt->
set_z( descr->zcenter(isamp) );
522 elt->
set_dz( descr->dz(isamp) );
525 <<
"new z/dz: " << elt->
z() <<
" " << elt->
dz() <<
" "
526 << elt->
z()/oldz*100-100 <<
" % diff "
527 <<
"use z/dz from descriptor for E cells" );
536 <<
"new z/dz: " << elt->
z() <<
" " << elt->
dz() <<
" "
537 << elt->
z()/(oldz+1.e-10)*100-100 <<
" % diff" );
542 double oldr = elt->
r();
543 double olddr = elt->
dr();
544 double r1 = cell_dim->
getRMin(0);
545 double r2 = cell_dim->
getRMax(ic);
548 elt->
set_r((r1+r2)/2.);
552 <<
"new r/dr: " << elt->
r() <<
" " << elt->
dr() <<
" "
553 << elt->
r()/(oldr+1.e-10)*100-100 <<
" % diff" );
556 double oldv=elt->
volume();
562 int ModuleNcp =
module + 1;
564 if ( (
section ==
TileID::EXTBAR ) && (
TileID::SAMP_A == sample ) && ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) && ( (tower == 11) || (tower == 12) || (tower == 15) ) )
566 double oldv=elt->
volume();
568 if (
msgLvl (MSG::VERBOSE)) {
570 <<
"old volume: " << oldv << std::endl
571 <<
" iphi = " << iphi
572 <<
" phi = " << (module + 0.5)*dphi <<
" phi2 = "<<elt->
phi()
574 <<
" Mod# = " << ModuleNcp <<
" module = "<<module<<
" tower = "<<tower
576 <<
"sample = "<<sample
580 <<
" ---------------------" );
584 double Radius2HL = tan (
M_PI / 64. );
587 double epThickness = 0.0;
588 double epVolume = 0.0;
589 if ( tower == 15 ) epThickness =
m_dbManager->TILBdzend2() * Gaudi::Units::cm;
591 double volumeInRow[5];
592 for (
int iRow = 0; iRow < 5; iRow++) volumeInRow[iRow] = 0.;
595 for (
unsigned int iRow = 0; iRow < cell_dim->
getNRows(); iRow++)
598 double oldrv = rowVolume;
600 ATH_MSG_VERBOSE(
" *** rowVolume = "<<rowVolume<<
" volumeInRow = "<< volumeInRow[iRow] );
603 double radMax = cell_dim->
getRMax(iRow), radMin = cell_dim->
getRMin(iRow);
604 double deltaZ = cell_dim->
getZMax(iRow) - cell_dim->
getZMin(iRow);
606 ATH_MSG_VERBOSE(
"deltaz = "<<deltaZ<<
" rmax = "<<radMax<<
" rmin = "<<radMin<<
" rowVolume = "<<rowVolume<<
" oldrv = "<<oldrv<<
" irow = "<<iRow<<
" tower = "<<tower );
612 epVolume = ( rowVolume/deltaZ ) * epThickness;
613 rowVolume -= epVolume;
614 deltaZ -= epThickness;
616 ATH_MSG_VERBOSE(
" \t\t epV = "<<epVolume<<
" epT = "<<epThickness <<
" diff = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
619 volumeInRow[iRow] += (rowVolume * (32./48) );
621 rowVolume *= 16./48.;
622 ATH_MSG_VERBOSE(
" *** 15 rowVolume = "<<rowVolume<<
" volumeInRow = "<< volumeInRow[iRow] <<
" diff = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
624 else if ( 12 == tower )
626 volumeInRow[iRow] += (rowVolume * (2./25) );
628 rowVolume *= 23./25.;
629 ATH_MSG_VERBOSE(
" *** 12 rowVolume = "<<rowVolume<<
" volumeInRow = "<< volumeInRow[iRow] <<
" % = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
632 ATH_MSG_VERBOSE(
"deltaz = "<<deltaZ<<
" rmax = "<<radMax<<
" rmin = "<<radMin<<
" changed dz ?"<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
634 if ( (ModuleNcp == 61) || (ModuleNcp == 36) )
638 else if ( iRow == 1 )
642 rowVolume = 2.*radMax + radMin;
643 rowVolume *= 0.5*(radMax - radMin);
644 rowVolume *= Radius2HL * deltaZ;
648 rowVolume += epVolume;
651 else if (15 == tower) rowVolume += epVolume;
653 volumeInRow[iRow] += rowVolume;
655 ATH_MSG_VERBOSE(
" *** rowVolume = "<<rowVolume<<
" volumeInRow = "<< volumeInRow[iRow] <<
" % = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
658 if ( (ModuleNcp == 62) || (ModuleNcp == 35) )
664 rowVolume = radMax + radMin;
665 rowVolume *= (radMax - radMin);
666 rowVolume -= 0.5*radMin*(27*Gaudi::Units::mm);
667 rowVolume *= Radius2HL * ( deltaZ + epThickness );
671 rowVolume = radMax - radMin - 35*Gaudi::Units::mm;
672 rowVolume *= (radMax + radMin);
673 rowVolume *= Radius2HL * deltaZ;
676 else if (15 == tower) rowVolume += epVolume;
678 volumeInRow[iRow] += rowVolume;
679 ATH_MSG_VERBOSE(
" *** rowVolume = "<<rowVolume<<
" volumeInRow = "<< volumeInRow[iRow] <<
" % = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
682 if ( (ModuleNcp == 60) || (ModuleNcp == 37) )
684 double deltax = 38.7*std::cos(25.3125*Gaudi::Units::deg);
685 double pstan = std::tan(25.3125*Gaudi::Units::deg);
686 double inv_pstan = 1. / pstan;
687 if ( ( 15 == tower ) )
692 rowVolume += epVolume;
694 else if ( iRow == 0 )
696 rowVolume = (radMax + radMin) * Radius2HL ;
698 rowVolume += 2.*deltax + (radMax - radMin)* pstan ;
702 rowVolume *= 0.5 * (radMax - radMin) * deltaZ;
706 else if ( iRow == 1 )
708 double radMin0 = cell_dim->
getRMin(0);
709 rowVolume = (radMax + radMin) * Radius2HL;
710 rowVolume += 2.*deltax + (radMax + radMin - 2.*radMin0 )* pstan ;
711 rowVolume *= 0.5 * (radMax - radMin) ;
712 rowVolume -= 0.5 * std::pow( deltax + (radMax - radMin0) * pstan - radMax * Radius2HL, 2) * inv_pstan;
716 volumeInRow[iRow] += rowVolume;
717 ATH_MSG_VERBOSE(
" *** rowVolume = "<<rowVolume<<
" volumeInRow = "<< volumeInRow[iRow] <<
" % = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
720 ATH_MSG_VERBOSE(
" *** rowVolume = "<<rowVolume<<
" volumeInRow = "<< volumeInRow[iRow] <<
" % = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
724 double totalVolume = 0;
725 for (
unsigned int iRow = 0; iRow < cell_dim->
getNRows(); iRow++) totalVolume += volumeInRow[iRow];
729 << elt->
volume() <<
" cell_dim xCheck ( "
731 << elt->
volume()/oldv*100-100 <<
" % diff" );
741 if (side == -1)
m_dbManager->SetCurrentEnvByType(4);
742 if (side == 1)
m_dbManager->SetCurrentEnvByType(5);
749 double standardD4dz = elt->
dz();
750 double specialD4dz =
m_dbManager->TILBdzmodul()*Gaudi::Units::cm;
756 elt->
set_z(elt->
z()+0.5*(standardD4dz-specialD4dz));
758 elt->
set_z(elt->
z()-0.5*(standardD4dz-specialD4dz));
760 elt->
set_volume(newv * specialD4dz/(standardD4dz));
763 ATH_MSG_VERBOSE(
"spD4 old z/dz: " << oldz <<
" " << standardD4dz << std::endl
764 <<
"spD4 new z/dz: " << elt->
z() <<
" " << elt->
dz() <<
" "
765 << elt->
z()/(oldz+1.e-10)*100-100 <<
" % diff" );
768 <<
"spD4 new volume: " << elt->
volume() <<
" "
769 << elt->
volume()/oldv*100-100 <<
" % diff"
770 <<
" iphi = " << iphi
771 <<
" dphi = " << dphi <<
" phi = " << (module + 0.5)*dphi -
M_PI <<
" phi2 = "<<elt->
phi() );
821 if (side == -1)
m_dbManager->SetCurrentEnvByType(4);
822 if (side == 1)
m_dbManager->SetCurrentEnvByType(5);
831 double standardD5dz = elt->
dz();
832 double specialD4dz =
m_dbManager->TILBdzmodul()*Gaudi::Units::cm;
833 double specialD4Rin =
m_dbManager->TILBrmin()*Gaudi::Units::cm;
835 specialD4Rin -=
m_dbManager->TILBdrfront()*Gaudi::Units::cm;
837 specialD4dz -=
m_dbManager->TILBdzend1()*Gaudi::Units::cm;
839 double newS = (
pow((elt->
r() + elt->
dr()/2.),2) - specialD4Rin*specialD4Rin)/(2.*elt->
r()*elt->
dr());
849 ATH_MSG_VERBOSE(
"D5 old z/dz: " << oldz <<
" " << standardD5dz <<
" spD4 dz: " << specialD4dz );
852 <<
"D5+D4 new volume: " << elt->
volume() <<
" "
853 << elt->
volume()/oldv*100-100 <<
" % diff"
854 <<
" iphi = " << iphi
855 <<
" dphi = " << dphi <<
" Id4 = "<< Id4 <<
" modType = "<<
m_dbManager->GetModType()
856 <<
" phi = " << (module + 0.5)*dphi -
M_PI<<
" phi2 = "<<elt->
phi() );
858 <<
" sample = " << sample
860 <<
" tower = " << tower );
866 <<
"new volume: " << elt->
volume() <<
" "
867 << elt->
volume()/oldv*100-100 <<
" % diff"
868 <<
" iphi = " << iphi
869 <<
" dphi = " << dphi );
877 <<
section <<
"," << side <<
"," << module <<
","
878 << tower <<
"," << sample <<
")" );
889 << n_modules <<
" half-modules were created for "
890 << n_regions <<
" Tile Regions" );
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...