|
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "GeoModelKernel/Units.h"
22 #include "GaudiKernel/MsgStream.h"
23 #include "GaudiKernel/SystemOfUnits.h"
59 , m_dbManager(dbManager)
60 , m_elements_created(false)
107 std::cout <<
"TileDetDescrManager : " << std::endl;
108 std::cout <<
" Number of Tile regions : " <<
m_tile_region_vec.size() << std::endl;
109 std::cout <<
" Number of Tile descr : " <<
m_tile_descr_vec.size() << std::endl;
118 std::cout <<
" Number of Tile modules : "
123 for (; first1 != last1; ++first1) {
127 std::cout <<
" Number of Tile cells : "
132 for (; first2 != last2; ++first2) {
136 std::cout << std::endl;
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();
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;
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);
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));
323 if (emin < 0.0 ) emin = 0.0;
331 double phi =
descr->phi_min() + dphi/2.;
333 for (
int iphi=0; iphi<nphi; ++iphi) {
373 for (
int isamp=0; isamp<nsamp; ++isamp) {
375 int neta =
descr->n_eta(isamp);
380 double rcenter =
descr->rcenter(isamp);
383 double deta =
descr->deta(isamp);
384 double eta =
descr->eta_min(isamp) + deta/2.;
386 for (
int ieta=0; ieta<neta; ++ieta) {
411 <<
" rcen = "<<rcenter
414 <<
" eta1 = " <<
eta1
415 <<
" eta2 = " <<
eta2
418 <<
" iphi = " << iphi
419 <<
" dphi = " << dphi );
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.;
503 double dz = 0.5 * fabs(cell_dim->
getZMax(0)
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" );
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);
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;
566 double oldv=elt->
volume();
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
580 <<
" ---------------------" );
584 double Radius2HL =
tan (
M_PI / 64. );
587 double epThickness = 0.0;
588 double epVolume = 0.0;
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);
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;
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);
667 rowVolume *= Radius2HL * (
deltaZ + epThickness );
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) )
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" );
749 double standardD4dz = elt->
dz();
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() );
831 double standardD5dz = elt->
dz();
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() );
860 <<
" tower = " << tower );
866 <<
"new volume: " << elt->
volume() <<
" "
867 << elt->
volume()/oldv*100-100 <<
" % diff"
868 <<
" iphi = " << iphi
869 <<
" dphi = " << dphi );
878 << tower <<
"," <<
sample <<
")" );
889 << n_modules <<
" half-modules were created for "
890 << n_regions <<
" Tile Regions" );
978 for (; first2 != last2; ++first2)
delete (*first2);
983 for (; first3 != last3; ++first3)
delete (*first3);
988 for (; first4 != last4; ++first4)
delete (*first4);
994 for (; first5 != last5; ++first5)
delete (*first5).second;
999 for (; first6 != last6; ++first6)
delete (*first6);
Identifier module_id(int section, int side, int module) const
tile_descr_const_iterator tile_descriptors_begin() const
TileCellDim * get_cell_dim(const Identifier &cell_id) const
size_type cell_hash_max(void) const
void set_dphi(double dphi)
set cylindric size dphi
void add_cellDim(int section, int side, int tower, int sample, TileCellDim *cellDim)
std::shared_ptr< TileDddbManager > TileDddbManager_ptr
Scalar phi() const
phi method
singleton-like access to IMessageSvc via open function and helper
std::vector< Identifier > ID
const CaloCell_ID * m_cell_id
double computeRowVolume(int iRow)
bool is_tile_gap(const Identifier &id) const
calo_element_map m_tile_cell_map
void add_cell(CaloDetDescrElement *cell)
Scalar eta() const
pseudorapidity method
IdContext cell_context(void) const
id for cells
void addTreeTop(PVConstLink)
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
int side(const Identifier &id) const
tile_region_vec m_tile_region_vec
int sample(const Identifier &id) const
void set_n_calo_depth(int n_calo_depth)
set number of calo depths
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
void setCaloEtaMin(double eta_min)
Set Eta Min.
bool is_tile_extbarrel(const Identifier &id) const
setEt setPhi setE277 setWeta2 eta1
int tower(const Identifier &id) const
tile_region_map m_tile_region_map
size_type module_hash_max(void) const
#define ATH_MSG_VERBOSE(x)
tile_descr_const_iterator tile_descriptors_end() const
def gap(flags, cells_name, *args, **kw)
value_type get_compact() const
Get the compact id.
IdContext module_context(void) const
id for modules
void set_deta(double deta)
set cylindric size deta
void setCaloZMin(double z_min)
Set Z Min.
calo_descr_vec m_calo_descr_vec
cell_dim_map m_cell_dim_map
virtual PVConstLink getTreeTop(unsigned int i) const override
scalo_descr_map m_calo_descr_map
void set_volume(double volume)
set cell volume
void set_dr(double dr)
set cylindric size dr
Definition of CaloDetDescriptor.
std::vector< PVConstLink > m_treeTops
static const double vExtendedCells[12]
void set_dz(double dz)
set cartezian size dz
calo_element_const_iterator tile_cell_begin() const
double getRMax(unsigned int index) const
calo_descr_vec m_tile_module_vec
void setCaloEtaMax(double eta_max)
Set Eta Max.
TileDetDescrManager(TileDddbManager_ptr dbManager)
Z-shift for ext.barrel introduced with Z-shift > 0, eta coordinate of the cell is shifted by Deta = t...
bool msgLvl(const MSG::Level lvl) const
Test the output level.
unsigned int getNRows() const
CaloSampling::CaloSample CaloSample
static const double vBarrelCells[23]
void add_module(IdentifierHash idhash, CaloDetDescriptor *module)
virtual unsigned int getNumTreeTops() const override
calo_element_vec m_tile_cell_vec
void setCaloZMax(double z_max)
Set Z Max.
Class to provide easy MsgStream access and capabilities.
calo_element_const_iterator tile_cell_end() const
void set_cylindric_raw(double eta_raw, double phi_raw, double r_raw)
set raw cylindric coordinates
Exception class for Tile Identifiers.
static const double vItcGapCells[6]
void set_cylindric(double eta, double phi, double r)
set cylindric coordinates
calo_descr_const_iterator tile_module_end() const
double getRMin(unsigned int index) const
void set_depth_in(std::vector< double > &calo_depth)
set vector of in depths
TileDddbManager_ptr m_dbManager
calo_descr_vec::const_iterator calo_descr_const_iterator
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const
create hash id from compact id (return == 0 for OK)
void set_r(double r)
set r
double shiftEta(double eta, double Rcen, double zshift)
void add_calodescr(CaloDetDescriptor *descriptor)
tile_region_const_iterator tile_region_begin() const
virtual Identifier identify() const
float volume() const
cell volume
void set_z(double z)
set z
tile_region_vec::const_iterator tile_region_const_iterator
calo_descr_const_iterator tile_module_begin() const
void setCaloPhiMin(double phi_min)
Set Phi Min.
double getZMax(unsigned int index) const
void add(TileDetDescrRegion *region)
void set_depth_out(std::vector< double > &calo_depth)
set vector of out depths
tile_descr_vec::const_iterator tile_descr_const_iterator
void setCaloPhiMax(double phi_max)
Set Phi Max.
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
void set_eta_phi_granularity(int neta, double deta, int nphi, double dphi)
Set Phi granularity.
#define ATH_MSG_WARNING(x)
void setCaloRMin(double r_min)
Set R Min.
tile_region_const_iterator tile_region_end() const
TileDddbManager * getDbManager() const
calo_element_vec::const_iterator calo_element_const_iterator
calo_descr_map m_tile_module_map
float phi() const
cell phi
int section(const Identifier &id) const
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
void setCaloRMax(double r_max)
Set R Max.
bool is_tile_barrel(const Identifier &id) const
Test of an Identifier to see if it belongs to a particular part of the calorimeter.
Identifier cell_id(const Identifier &any_id) const
This class provides access to constants in the Geometry DB.
constexpr int pow(int base, int exp) noexcept
tile_descr_vec m_tile_descr_vec
virtual bool do_checks(void) const override
Checks are performed by default in debug compilation and NOT in optimized compilation.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
double getZMin(unsigned int index) const
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Calo Subsystem specific Detector Elements + Dummy element for testing.