ATLAS Offline Software
Loading...
Searching...
No Matches
TileDetDescrManager Class Reference

#include <TileDetDescrManager.h>

Inheritance diagram for TileDetDescrManager:

Public Types

typedef std::vector< TileDetDescrRegion * > tile_region_vec
typedef tile_region_vec::size_type tile_region_vec_size
typedef tile_region_vec::const_iterator tile_region_const_iterator
typedef std::vector< TileDetDescriptor * > tile_descr_vec
typedef tile_descr_vec::size_type tile_descr_vec_size
typedef tile_descr_vec::const_iterator tile_descr_const_iterator
typedef std::vector< CaloDetDescriptor * > calo_descr_vec
typedef calo_descr_vec::size_type calo_descr_vec_size
typedef calo_descr_vec::const_iterator calo_descr_const_iterator
typedef std::vector< CaloDetDescrElement * > calo_element_vec
typedef calo_element_vec::size_type calo_element_vec_size
typedef calo_element_vec::const_iterator calo_element_const_iterator
typedef std::map< unsigned int, TileDetDescrRegion *, std::less< unsigned int > > tile_region_map
typedef std::map< unsigned int, CaloDetDescriptor *, std::less< int > > scalo_descr_map
typedef std::map< unsigned int, CaloDetDescriptor *, std::less< unsigned int > > calo_descr_map
typedef std::map< unsigned int, CaloDetDescrElement *, std::less< unsigned int > > calo_element_map
typedef std::map< unsigned int, TileCellDim *, std::less< unsigned int > > cell_dim_map

Public Member Functions

 TileDetDescrManager (TileDddbManager_ptr dbManager)
 Z-shift for ext.barrel introduced with Z-shift > 0, eta coordinate of the cell is shifted by Deta = tile_zshift * tanh(eta) / Zcen = = tile_zshift * tanh(eta) * tan(2 * atan(exp(-eta))) / Rcen where Zcen and Rcen are Z and R coordinate of the cell center.
 ~TileDetDescrManager ()
virtual unsigned int getNumTreeTops () const override
virtual PVConstLink getTreeTop (unsigned int i) const override
void addTreeTop (PVConstLink)
TileDddbManagergetDbManager () const
void releaseDbManager ()
TileDetDescrRegionfind_tile_region (const Identifier &region_id) const
tile_region_const_iterator tile_region_begin () const
tile_region_const_iterator tile_region_end () const
tile_region_vec_size tile_region_size () const
tile_descr_const_iterator tile_descriptors_begin () const
tile_descr_const_iterator tile_descriptors_end () const
tile_descr_vec_size tile_descriptors_size () const
calo_descr_const_iterator calo_descriptors_begin () const
calo_descr_const_iterator calo_descriptors_end () const
calo_descr_vec_size calo_descriptors_size () const
CaloDetDescriptorget_calo_descriptor (CaloCell_ID::CaloSample sample, int side) const
calo_descr_const_iterator tile_module_begin () const
calo_descr_const_iterator tile_module_end () const
calo_descr_vec_size tile_module_size () const
CaloDetDescriptorget_module_element (const IdentifierHash module_hash) const
CaloDetDescriptorget_module_element (const Identifier &module_id) const
calo_element_const_iterator tile_cell_begin () const
calo_element_const_iterator tile_cell_end () const
calo_element_vec_size tile_cell_size () const
CaloDetDescrElementget_cell_element (unsigned int cell_hash) const
CaloDetDescrElementget_cell_element (const IdentifierHash cell_hash) const
CaloDetDescrElementget_cell_element (const Identifier &cell_id) const
TileCellDimget_cell_dim (const Identifier &cell_id) const
const TileIDget_id () const
const TileHWIDget_hwid () const
void print () const
void create_elements ()
void create_elements (bool checks)
void add (TileDetDescrRegion *region)
void add (TileDetDescriptor *descriptor)
void add_calodescr (CaloDetDescriptor *descriptor)
void add_module (IdentifierHash idhash, CaloDetDescriptor *module)
void add_cell (CaloDetDescrElement *cell)
void add_cellDim (int section, int side, int tower, int sample, TileCellDim *cellDim)
void set_helper (const TileID *id)
void set_helper (const CaloCell_ID *id)
void set_helper (const TileHWID *id)
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Static Public Attributes

static const double vBarrelCells [23]
static const double vExtendedCells [12]
static const double vItcGapCells [6]

Private Member Functions

const TileDetDescrManageroperator= (const TileDetDescrManager &right)
 TileDetDescrManager (const TileDetDescrManager &right)
void clear ()
double shiftEta (double eta, double Rcen, double zshift)
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

std::vector< PVConstLink > m_treeTops
TileDddbManager_ptr m_dbManager
bool m_elements_created
const TileIDm_tile_id
const CaloCell_IDm_cell_id
const TileHWIDm_tile_hwid
tile_region_vec m_tile_region_vec
tile_region_map m_tile_region_map
tile_descr_vec m_tile_descr_vec
calo_descr_vec m_calo_descr_vec
scalo_descr_map m_calo_descr_map
calo_descr_vec m_tile_module_vec
calo_descr_map m_tile_module_map
calo_element_vec m_tile_cell_vec
calo_element_map m_tile_cell_map
cell_dim_map m_cell_dim_map
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Definition at line 32 of file TileDetDescrManager.h.

Member Typedef Documentation

◆ calo_descr_const_iterator

typedef calo_descr_vec::const_iterator TileDetDescrManager::calo_descr_const_iterator

Definition at line 52 of file TileDetDescrManager.h.

◆ calo_descr_map

typedef std::map<unsigned int, CaloDetDescriptor*, std::less<unsigned int> > TileDetDescrManager::calo_descr_map

Definition at line 60 of file TileDetDescrManager.h.

◆ calo_descr_vec

Definition at line 50 of file TileDetDescrManager.h.

◆ calo_descr_vec_size

typedef calo_descr_vec::size_type TileDetDescrManager::calo_descr_vec_size

Definition at line 51 of file TileDetDescrManager.h.

◆ calo_element_const_iterator

typedef calo_element_vec::const_iterator TileDetDescrManager::calo_element_const_iterator

Definition at line 56 of file TileDetDescrManager.h.

◆ calo_element_map

typedef std::map<unsigned int, CaloDetDescrElement*, std::less<unsigned int> > TileDetDescrManager::calo_element_map

Definition at line 61 of file TileDetDescrManager.h.

◆ calo_element_vec

Definition at line 54 of file TileDetDescrManager.h.

◆ calo_element_vec_size

typedef calo_element_vec::size_type TileDetDescrManager::calo_element_vec_size

Definition at line 55 of file TileDetDescrManager.h.

◆ cell_dim_map

typedef std::map<unsigned int, TileCellDim*, std::less<unsigned int> > TileDetDescrManager::cell_dim_map

Definition at line 62 of file TileDetDescrManager.h.

◆ scalo_descr_map

typedef std::map<unsigned int, CaloDetDescriptor*, std::less<int> > TileDetDescrManager::scalo_descr_map

Definition at line 59 of file TileDetDescrManager.h.

◆ tile_descr_const_iterator

typedef tile_descr_vec::const_iterator TileDetDescrManager::tile_descr_const_iterator

Definition at line 48 of file TileDetDescrManager.h.

◆ tile_descr_vec

Definition at line 46 of file TileDetDescrManager.h.

◆ tile_descr_vec_size

typedef tile_descr_vec::size_type TileDetDescrManager::tile_descr_vec_size

Definition at line 47 of file TileDetDescrManager.h.

◆ tile_region_const_iterator

typedef tile_region_vec::const_iterator TileDetDescrManager::tile_region_const_iterator

Definition at line 44 of file TileDetDescrManager.h.

◆ tile_region_map

typedef std::map<unsigned int, TileDetDescrRegion*, std::less<unsigned int> > TileDetDescrManager::tile_region_map

Definition at line 58 of file TileDetDescrManager.h.

◆ tile_region_vec

Definition at line 42 of file TileDetDescrManager.h.

◆ tile_region_vec_size

typedef tile_region_vec::size_type TileDetDescrManager::tile_region_vec_size

Definition at line 43 of file TileDetDescrManager.h.

Constructor & Destructor Documentation

◆ TileDetDescrManager() [1/2]

TileDetDescrManager::TileDetDescrManager ( TileDddbManager_ptr dbManager)

Z-shift for ext.barrel introduced with Z-shift > 0, eta coordinate of the cell is shifted by Deta = tile_zshift * tanh(eta) / Zcen = = tile_zshift * tanh(eta) * tan(2 * atan(exp(-eta))) / Rcen where Zcen and Rcen are Z and R coordinate of the cell center.

After the shift cell width becomes smaller than nominal value (e.g. 0.098 instead of 0.1)

What is the correct eta for gap/crack scintillators is an open question, in any case their sizes in eta/phi do not match sizes in R/Z so one can leave them without shift but for the moment Z-shift is applied to ITC/gap/crack in the same way as for all Ext.Barrel cells

Definition at line 57 of file TileDetDescrManager.cxx.

58 : AthMessaging ("TileDetDescrManager")
59 , m_dbManager(std::move(dbManager))
60 , m_elements_created(false)
61 , m_tile_id(0)
62 , m_cell_id(0)
63 , m_tile_hwid(0)
64{
65 setName("Tile");
66}
AthMessaging()
Default constructor:
const CaloCell_ID * m_cell_id
const TileHWID * m_tile_hwid
TileDddbManager_ptr m_dbManager

◆ ~TileDetDescrManager()

TileDetDescrManager::~TileDetDescrManager ( )

Definition at line 68 of file TileDetDescrManager.cxx.

69{
70 clear();
71}

◆ TileDetDescrManager() [2/2]

TileDetDescrManager::TileDetDescrManager ( const TileDetDescrManager & right)
private

Member Function Documentation

◆ add() [1/2]

void TileDetDescrManager::add ( TileDetDescriptor * descriptor)

Definition at line 900 of file TileDetDescrManager.cxx.

901{
902 m_tile_descr_vec.push_back(descriptor);
903}
tile_descr_vec m_tile_descr_vec

◆ add() [2/2]

void TileDetDescrManager::add ( TileDetDescrRegion * region)

Definition at line 894 of file TileDetDescrManager.cxx.

895{
896 m_tile_region_vec.push_back(region);
898}
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
tile_region_map m_tile_region_map
tile_region_vec m_tile_region_vec
virtual Identifier identify() const

◆ add_calodescr()

void TileDetDescrManager::add_calodescr ( CaloDetDescriptor * descriptor)

Definition at line 905 of file TileDetDescrManager.cxx.

906{
907 int index = descr->getSampling(0)*descr->calo_sign();
908 m_calo_descr_vec.push_back(descr);
910
911 ATH_MSG_VERBOSE( "new Tile CaloDetDescriptor" );
912 ATH_MSG_VERBOSE( " index " << index );
913 ATH_MSG_VERBOSE( " calo_sample " << descr->getSampling(0) );
914 ATH_MSG_VERBOSE( " calo_sign " << descr->calo_sign() );
915 ATH_MSG_VERBOSE( " layer " << descr->layer() );
916 ATH_MSG_VERBOSE( " is tile " << ((descr->is_tile()) ? "true" : "false" ) );
917 // ATH_MSG_VERBOSE( " is cylindric " << (descr->is_cylindric() ? "true" : "false") );
918 // ATH_MSG_VERBOSE( " is ec_cylindric " << (descr->is_ec_cylindric() ? "true" : "false") );
919 ATH_MSG_VERBOSE( " deta " << descr->deta() );
920 ATH_MSG_VERBOSE( " dphi " << descr->dphi() );
921 ATH_MSG_VERBOSE( " n_eta " << descr->n_eta() );
922 ATH_MSG_VERBOSE( " n_phi " << descr->n_phi() );
923 ATH_MSG_VERBOSE( " calo_eta_min " << descr->calo_eta_min() );
924 ATH_MSG_VERBOSE( " calo_eta_max " << descr->calo_eta_max() );
925 ATH_MSG_VERBOSE( " calo_phi_min " << descr->calo_phi_min() );
926 ATH_MSG_VERBOSE( " calo_phi_max " << descr->calo_phi_max() );
927 ATH_MSG_VERBOSE( " calo_r_min " << descr->calo_r_min() );
928 ATH_MSG_VERBOSE( " calo_r_max " << descr->calo_r_max() );
929 ATH_MSG_VERBOSE( " calo_z_min " << descr->calo_z_min() );
930 ATH_MSG_VERBOSE( " calo_z_max " << descr->calo_z_max() );
931}
#define ATH_MSG_VERBOSE(x)
scalo_descr_map m_calo_descr_map
calo_descr_vec m_calo_descr_vec
str index
Definition DeMoScan.py:362
list descr
print "%s.properties()" % self.__name__

◆ add_cell()

void TileDetDescrManager::add_cell ( CaloDetDescrElement * cell)

Definition at line 939 of file TileDetDescrManager.cxx.

940{
941 m_tile_cell_vec[cell->subcalo_hash()] = cell;
942 unsigned int id = m_tile_id->cell_id(cell->subcalo_hash()).get_identifier32().get_compact();
944}
calo_element_map m_tile_cell_map
calo_element_vec m_tile_cell_vec

◆ add_cellDim()

void TileDetDescrManager::add_cellDim ( int section,
int side,
int tower,
int sample,
TileCellDim * cellDim )

Definition at line 946 of file TileDetDescrManager.cxx.

947{
948 unsigned int ID = m_tile_id->cell_id(section,side,0,tower,sample).get_identifier32().get_compact();
949 m_cell_dim_map[ID] = cellDim;
950}
std::vector< Identifier > ID
void section(const std::string &sec)

◆ add_module()

void TileDetDescrManager::add_module ( IdentifierHash idhash,
CaloDetDescriptor * module )

Definition at line 933 of file TileDetDescrManager.cxx.

934{
935 m_tile_module_vec[idhash] = module;
936 m_tile_module_map[module->identify().get_identifier32().get_compact()] = module;
937}
calo_descr_map m_tile_module_map
calo_descr_vec m_tile_module_vec

◆ addTreeTop()

void TileDetDescrManager::addTreeTop ( PVConstLink link)

Definition at line 88 of file TileDetDescrManager.cxx.

89{
90 m_treeTops.push_back(link);
91}
std::vector< PVConstLink > m_treeTops

◆ calo_descriptors_begin()

calo_descr_const_iterator TileDetDescrManager::calo_descriptors_begin ( ) const
inline

Definition at line 112 of file TileDetDescrManager.h.

113 { return m_calo_descr_vec.begin(); }

◆ calo_descriptors_end()

calo_descr_const_iterator TileDetDescrManager::calo_descriptors_end ( ) const
inline

Definition at line 115 of file TileDetDescrManager.h.

116 { return m_calo_descr_vec.end(); }

◆ calo_descriptors_size()

calo_descr_vec_size TileDetDescrManager::calo_descriptors_size ( ) const
inline

Definition at line 118 of file TileDetDescrManager.h.

119 { return m_calo_descr_vec.size(); }

◆ clear()

void TileDetDescrManager::clear ( )
private

Definition at line 968 of file TileDetDescrManager.cxx.

969{
970 // Remove regions and descriptors
973 for (; first != last; ++first) delete (*first);
974 m_tile_region_vec.clear();
975
978 for (; first2 != last2; ++first2) delete (*first2);
979 m_tile_descr_vec.clear();
980
983 for (; first3 != last3; ++first3) delete (*first3);
984 m_tile_module_vec.clear();
985
988 for (; first4 != last4; ++first4) delete (*first4);
989 m_tile_cell_vec.clear();
990
991 // Remove Cell Dim's
992 cell_dim_map::const_iterator first5 = m_cell_dim_map.begin();
993 cell_dim_map::const_iterator last5 = m_cell_dim_map.end();
994 for (; first5 != last5; ++first5) delete (*first5).second;
995
996 // clear cell descriptors used in CaloDetDescrManager
999 for (; first6 != last6; ++first6) delete (*first6);
1000 m_calo_descr_vec.clear();
1001}
calo_element_vec::const_iterator calo_element_const_iterator
tile_descr_vec::const_iterator tile_descr_const_iterator
tile_region_vec::const_iterator tile_region_const_iterator
calo_descr_vec::const_iterator calo_descr_const_iterator
bool first
Definition DeMoScan.py:534

◆ create_elements() [1/2]

void TileDetDescrManager::create_elements ( )

Definition at line 139 of file TileDetDescrManager.cxx.

140{
141 create_elements (m_tile_id->do_checks());
142}

◆ create_elements() [2/2]

void TileDetDescrManager::create_elements ( bool checks)

Definition at line 143 of file TileDetDescrManager.cxx.

144{
145 ATH_MSG_INFO( "Entering create_elements()" );
146
147 // resize vectors :
148 m_tile_module_vec.resize( (int) m_tile_id->module_hash_max(),0);
149 m_tile_cell_vec.resize( (int) m_tile_id->cell_hash_max(),0);
150
151 IdContext module_context = m_tile_id->module_context();
152 IdContext cell_context = m_tile_id->cell_context();
153
156
157 int n_regions = 0;
158 int n_modules = 0;
159 int n_cells = 0;
160
161 // For each descriptor :
162 ATH_MSG_DEBUG( "Looping over descriptors..." );
163
164 for (; first != last; ++first) {
165
166 TileDetDescriptor* descr = *first;
167 Identifier reg_id = descr->identify();
168
169 int section = m_tile_id->section(reg_id);
170 int side = m_tile_id->side(reg_id);
171
172 double zshift = descr->zshift();
173 bool doZshift = (zshift != 0.0);
174
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" );
179 }
180 ++n_regions;
181
182 ATH_MSG_DEBUG( "descriptor - " << reg_id << ", " << section << ", " << side
183 << ", " << zshift << ", " << doZshift
184 << ", " << etasign << ", " << n_regions );
185
186 int nsamp = descr->n_samp();
187
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();
192
193 // create calo descriptors per one calo sample firsrt ( 6 * 3 = 18 in total)
194 CaloDetDescriptor* caloDescr;
195
196 int calo_sample0;
197 if ( m_tile_id->is_tile_barrel(reg_id))
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;
203 else
204 calo_sample0 = CaloCell_ID::Unknown;
205 std::vector<double> depth_in(1);
206 std::vector<double> depth_out(1);
207
208 bool gap = (nsamp > (int)TileID::SAMP_E);
209 for (int isamp=0; isamp<(int)TileID::SAMP_E; ++isamp) {
210
211 int neta = descr->n_eta(isamp);
212
213 if (neta>0) {
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;
222 depth_in[0] = rmin;
223 depth_out[0] = rmax;
224
225 if ((zmax+zmin)/2. < 0) {
226 double ztmp = zmax;
227 zmax = -zmin;
228 zmin = -ztmp;
229 }
230
232
233 caloDescr = new CaloDetDescriptor(reg_id,static_cast<const AtlasDetectorID *>(m_tile_id),m_cell_id,sample,isamp);
234 // caloDescr->set_cylindric(emin,emax,phi_min,phi_max,rmin,rmax,zmin,zmax,gap);
235 // --
236 caloDescr->setCaloEtaMin(emin);
237 caloDescr->setCaloEtaMax(emax);
238 caloDescr->setCaloPhiMin(phi_min);
239 caloDescr->setCaloPhiMax(phi_max);
240 caloDescr->setCaloRMin(rmin);
241 caloDescr->setCaloRMax(rmax);
242 caloDescr->setCaloZMin(zmin);
243 caloDescr->setCaloZMax(zmax);
244 // --
245
246 caloDescr->set_eta_phi_granularity(neta,deta,nphi,dphi);
247 caloDescr->set_n_calo_depth(1);
248 caloDescr->set_depth_in(depth_in);
249 caloDescr->set_depth_out(depth_out);
250 add_calodescr(caloDescr);
251 }
252 }
253
254 // special case - all gap scin in one sample
255 if (gap) {
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;
262
263 for (int isamp=TileID::SAMP_E; isamp<nsamp; ++isamp) {
264
265 int neta = descr->n_eta(isamp);
266
267 if (neta>0) {
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));
274 }
275 }
276
277 if ((zmax+zmin)/2. < 0) {
278 double ztmp = zmax;
279 zmax = -zmin;
280 zmin = -ztmp;
281 }
282
283 double deta = 0.1; // fixed deta for gap scin
284 int neta = (emax>1.65) ? 7 : 6; // fixed number of eta bins for gap scin - 6 for RUN1/RUN2, 7 for RUN3/RUN4
285 depth_in[0] = zmin;
286 depth_out[0] = zmax;
287 CaloCell_ID::CaloSample sample = CaloCell_ID::TileGap3;
288
289 caloDescr = new CaloDetDescriptor(reg_id,static_cast<const AtlasDetectorID *>(m_tile_id),m_cell_id,sample,TileID::SAMP_E);
290 // caloDescr->set_cylindric(emin,emax,phi_min,phi_max,rmin,rmax,zmin,zmax,true);
291 // --
292 caloDescr->setCaloEtaMin(emin);
293 caloDescr->setCaloEtaMax(emax);
294 caloDescr->setCaloPhiMin(phi_min);
295 caloDescr->setCaloPhiMax(phi_max);
296 caloDescr->setCaloRMin(rmin);
297 caloDescr->setCaloRMax(rmax);
298 caloDescr->setCaloZMin(zmin);
299 caloDescr->setCaloZMax(zmax);
300 // --
301
302 caloDescr->set_eta_phi_granularity(neta,deta,nphi,dphi);
303 caloDescr->set_n_calo_depth(1);
304 caloDescr->set_depth_in(depth_in);
305 caloDescr->set_depth_out(depth_out);
306 add_calodescr(caloDescr);
307 }
308
309
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;
315
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));
322 }
323 if (emin < 0.0 ) emin = 0.0; // avoid emin = -0.1 because of D0 in barrel
324 if (etasign < 0) {
325 double etmp = emax;
326 emax = -emin;
327 emin = -etmp;
328 }
329
330 // and now create calo descriptors per every module ( 6 * 64 = 384 in total)
331 double phi = descr->phi_min() + dphi/2.;
332
333 for (int iphi=0; iphi<nphi; ++iphi) {
334
335 int module = iphi; // we count modules from 0 to N always
336
337 // Temporary solution for cell volumes
338 int volumeIndex = 0;
339 // ------------ Temporary solution for cell volumes
340
341 CaloDetDescriptor* modDescr;
342
343 try {
344 Identifier id = m_tile_id->module_id(section,side,module, checks);
345 IdentifierHash idhash;
346 /* int result = */ m_tile_id->get_hash(id,idhash,&module_context);
347 modDescr = new CaloDetDescriptor(id,static_cast<const AtlasDetectorID *>(m_tile_id),m_cell_id);
348 // modDescr->set_cylindric(emin,emax,phi-dphi/2.,phi+dphi/2,rmin,rmax);
349 // --
350 modDescr->setCaloEtaMin(emin);
351 modDescr->setCaloEtaMax(emax);
352 modDescr->setCaloPhiMin(phi-dphi/2.);
353 modDescr->setCaloPhiMax(phi+dphi/2.);
354 modDescr->setCaloRMin(rmin);
355 modDescr->setCaloRMax(rmax);
356 modDescr->setCaloZMin(rmin*sinh(emin));
357 modDescr->setCaloZMax(rmax*sinh(emax));
358
359 // --
360 // modDescr->set_depth(delr,nsamp);
361 modDescr->set_n_calo_depth(nsamp);
362 modDescr->set_depth_in(delr);
363 add_module(idhash,modDescr);
364 ++n_modules;
365 } catch ( const TileID_Exception& ) {
366 ATH_MSG_ERROR( "can't build module ID from ("
367 << section << ","
368 << side << ","
369 << module << ")" );
370 continue;
371 }
372
373 for (int isamp=0; isamp<nsamp; ++isamp) {
374
375 int neta = descr->n_eta(isamp);
376
377 if (neta>0) {
378
379 int sample = std::min(isamp,(int)TileID::SAMP_E); // all gap scin are in sampling 3
380 double rcenter = descr->rcenter(isamp);
381 double dr = descr->dr(isamp);
382
383 double deta = descr->deta(isamp);
384 double eta = descr->eta_min(isamp) + deta/2.; // this is unsigned eta
385
386 for (int ieta=0; ieta<neta; ++ieta) {
387
388 int tower = (sample == (int)TileID::SAMP_E) ? isamp : (int)((eta + 0.01) * 10); // tower number in 0.1 granularity
389
390 try {
391 Identifier id = m_tile_id->cell_id(section,side,module,tower,sample,checks);
392 IdentifierHash idhash;
393 /* int result = */ m_tile_id->get_hash(id,idhash,&cell_context);
394
395 TileDetectorElement* elt = new TileDetectorElement(
397
398 TileCellDim* cell_dim = get_cell_dim(id);
399
400 // ideal eta/phi for all the cells
401 elt->set_cylindric_raw(eta*etasign,phi,rcenter);
402
403 if (doZshift) {
404
405 double eta1 = shiftEta(eta-deta/2,rcenter,zshift);
406 double eta2 = shiftEta(eta+deta/2,rcenter,zshift);
407
408 if (0 == iphi) {
409 ATH_MSG_VERBOSE( "side/sec/mod/twr/samp="
410 <<side<<"/"<<section<<"/"<<module<<"/"<<tower<<"/"<<sample
411 << " rcen = "<<rcenter
412 << " dr = "<<dr
413 << " eta = " << eta
414 << " eta1 = " << eta1
415 << " eta2 = " << eta2
416 << " eta' = " << (eta1+eta2)/2.
417 << " deta = " << (eta2-eta1)
418 << " iphi = " << iphi
419 << " dphi = " << dphi );
420 }
421
422 elt->set_cylindric((eta1+eta2)/2.*etasign,phi,rcenter);
423// elt->set_cylindric_size((eta2-eta1),dphi,dr);
424// keep ideal deta for the cell (0.1 or 0.2) instead of (eta2-eta1),
425// otherwise algorithms which use "eta_raw" and "deta" might fail
426// elt->set_cylindric_size(deta,dphi,dr);
427 elt->set_deta(deta);
428 elt->set_dphi(dphi);
429 elt->set_dr(dr);
430
431 } else {
432
433 if (0 == iphi) {
434 ATH_MSG_VERBOSE( "side/sec/mod/twr/samp="
435 <<side<<"/"<<section<<"/"<<module<<"/"<<tower<<"/"<<sample
436 << " rcen = "<<rcenter
437 << " dr = "<<dr
438 << " eta = " << eta
439 << " deta = " << deta
440 << " iphi = " << iphi
441 << " dphi = " << dphi );
442 }
443
444 elt->set_cylindric(eta*etasign,phi,rcenter);
445 // elt->set_cylindric_size(deta,dphi,dr);
446 elt->set_deta(deta);
447 elt->set_dphi(dphi);
448 elt->set_dr(dr);
449 }
450
451 // Temporary solution for cell volumes
452 if (section == TileID::BARREL && side == -1 && ieta == 0 && sample == 2)
453 ++volumeIndex; // skip D0 in negative side
454 if (section == TileID::BARREL)
455 elt->set_volume(vBarrelCells[volumeIndex++]);
456 else if (section == TileID::EXTBAR)
457 elt->set_volume(vExtendedCells[volumeIndex++]);
458 else if (section == TileID::GAPDET)
459 elt->set_volume(vItcGapCells[volumeIndex++]);
460
461 // ----------------- Final solution for cell volumes
462 if (cell_dim) {
463
464 double oldz = elt->z();
465 double olddz = elt->dz();
466 int ic=cell_dim->getNRows()-1;
467 double z1=0,z2=0;
468 if (side < 0) {
469 z1 = cell_dim->getZMax(0);
470 for ( ; ic>=0; --ic) {
471 z2 = cell_dim->getZMin(ic);
472 if (0 == iphi)
473 ATH_MSG_DEBUG( "z2: " << z2 << ", ZMax: " << cell_dim->getZMax(ic) << ", diff: " << z2-cell_dim->getZMax(ic) );
474 if (fabs(z2-cell_dim->getZMax(ic))>0.1) break;
475 }
476 } else {
477 z1 = cell_dim->getZMin(0);
478 for ( ; ic>=0; --ic) {
479 z2 = cell_dim->getZMax(ic);
480 if (0 == iphi)
481 ATH_MSG_DEBUG( "z2: " << z2 << ", ZMin: " << cell_dim->getZMin(ic) << ", diff: " << z2-cell_dim->getZMin(ic) );
482 if (fabs(z2-cell_dim->getZMin(ic))>0.1) break;
483 }
484 }
485
486 if (ic<0) {
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." );
488 }
489
490 double z = (z1+z2)/2.;
491
492 // D-layer has cells that are centered at 0.
493 // For these cells, the above calculation will usually
494 // come out to ~ 1e-14, the exact value varying depending
495 // on platform. For reproducibility, force very small
496 // numbers to 0.
497 if (std::abs(z) < 1e-8 * Gaudi::Units::mm) {
498 if (0 == iphi)
499 ATH_MSG_DEBUG( "Cell D0 - put cell center at Z=0" );
500 z = 0;
501 }
502
503 double dz = 0.5 * fabs(cell_dim->getZMax(0) // special
504 -cell_dim->getZMin(0) // calculations
505 +cell_dim->getZMax(ic) // to get BC cells
506 -cell_dim->getZMin(ic)); // size and position right
507
508 if (section == TileID::BARREL && sample==1 && tower < 8) {
509 if (msgLvl (MSG::VERBOSE) && 0 == iphi) {
510 double z1 = 0.5*(cell_dim->getZMax(0)+cell_dim->getZMin(0));
511 double dz1 = fabs(cell_dim->getZMax(0)-cell_dim->getZMin(0));
512 double z2 = 0.5*(cell_dim->getZMax(ic)+cell_dim->getZMin(ic));
513 double dz2 = fabs(cell_dim->getZMax(ic)-cell_dim->getZMin(ic));
514 ATH_MSG_VERBOSE( "old z/dz: " << oldz << " " << olddz << std::endl
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" );
518 }
519 } else if ( (section == TileID::GAPDET) && (sample == TileID::SAMP_E) ) {
520
521 elt->set_z( descr->zcenter(isamp) );
522 elt->set_dz( descr->dz(isamp) );
523 if (0 == iphi) {
524 ATH_MSG_VERBOSE( "old z/dz: " << oldz << " " << olddz << std::endl
525 <<"new z/dz: " << elt->z() << " " << elt->dz() << " "
526 << elt->z()/oldz*100-100 << " % diff "
527 <<"use z/dz from descriptor for E cells" );
528 }
529
530 } else {
531 // elt->set_z_pos_and_size(z,dz);
532 elt->set_z(z);
533 elt->set_dz(dz);
534 if (0 == iphi) {
535 ATH_MSG_VERBOSE( "old z/dz: " << oldz << " " << olddz << std::endl
536 <<"new z/dz: " << elt->z() << " " << elt->dz() << " "
537 << elt->z()/(oldz+1.e-10)*100-100 << " % diff" );
538 }
539 }
540
541
542 double oldr = elt->r();
543 double olddr = elt->dr();
544 double r1 = cell_dim->getRMin(0);
545 double r2 = cell_dim->getRMax(ic);
546 // elt->set_r_pos_and_size((r1+r2)/2.,fabs(r2-r1));
547
548 elt->set_r((r1+r2)/2.);
549 elt->set_dr(fabs(r2-r1));
550 if (0 == iphi) {
551 ATH_MSG_VERBOSE( "old r/dr: " << oldr << " " << olddr << std::endl
552 <<"new r/dr: " << elt->r() << " " << elt->dr() << " "
553 << elt->r()/(oldr+1.e-10)*100-100 << " % diff" );
554 }
555
556 double oldv=elt->volume();
557 double newv = cell_dim->getVolume(); // ps cell volume to correct for special cells
558 elt->set_volume(newv);
559 //
560 // ps cutout region in ext. barrel
561 //
562 int ModuleNcp = module + 1;
563
564 if ( ( section == TileID::EXTBAR ) && ( TileID::SAMP_A == sample ) && ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) && ( (tower == 11) || (tower == 12) || (tower == 15) ) )
565 {
566 double oldv=elt->volume();
567
568 if (msgLvl (MSG::VERBOSE)) {
569 ATH_MSG_VERBOSE( "CUTOUT CELL VOLUME UPDATE"<< std::endl
570 <<"old volume: " << oldv << std::endl
571 << " iphi = " << iphi
572 << " phi = " << (module + 0.5)*dphi <<" phi2 = "<<elt->phi()
573 << std::endl
574 << " Mod# = " << ModuleNcp <<" module = "<<module<<" tower = "<<tower
575 << std::endl
576 <<"sample = "<<sample
577 <<" A = " << (TileID::SAMP_A == sample)
578 <<" BC = "<< (TileID::SAMP_BC == sample)
579 <<" D = " << (TileID::SAMP_D == sample)
580 <<" ---------------------" );
581 cell_dim->print();
582 }
583
584 double Radius2HL = tan ( M_PI / 64. );
585
586 m_dbManager->SetCurrentSection(TileID::EXTBAR);
587 double epThickness = 0.0; // only used for tower == 15
588 double epVolume = 0.0; // only used for tower == 15
589 if ( tower == 15 ) epThickness = m_dbManager->TILBdzend2() * Gaudi::Units::cm;
590
591 double volumeInRow[5]; // book large array
592 for (int iRow = 0; iRow < 5; iRow++) volumeInRow[iRow] = 0.;
593
594
595 for (unsigned int iRow = 0; iRow < cell_dim->getNRows(); iRow++)
596 {
597 double rowVolume = cell_dim->computeRowVolume(iRow);
598 double oldrv = rowVolume;
599
600 ATH_MSG_VERBOSE( " *** rowVolume = "<<rowVolume<<" volumeInRow = "<< volumeInRow[iRow] );
601
602 ATH_MSG_DEBUG( "Computing radMax and deltaZ..." );
603 double radMax = cell_dim->getRMax(iRow), radMin = cell_dim->getRMin(iRow);
604 double deltaZ = cell_dim->getZMax(iRow) - cell_dim->getZMin(iRow);
605
606 ATH_MSG_VERBOSE( "deltaz = "<<deltaZ<<" rmax = "<<radMax<<" rmin = "<<radMin<<" rowVolume = "<<rowVolume<<" oldrv = "<<oldrv<<" irow = "<<iRow<<" tower = "<<tower );
607
608 if ( 15 == tower )
609 {
610 if ( m_dbManager->addPlatesToCell() )
611 {
612 epVolume = ( rowVolume/deltaZ ) * epThickness;
613 rowVolume -= epVolume;
614 deltaZ -= epThickness;
615
616 ATH_MSG_VERBOSE( " \t\t epV = "<<epVolume<<" epT = "<<epThickness << " diff = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
617 }
618
619 volumeInRow[iRow] += (rowVolume * (32./48) ); // the remaining 32 periods which are not cutted out
620 deltaZ *= 16./48.; // dz of the cutted part
621 rowVolume *= 16./48.; // volume of the cutted part of the cell, but before cut
622 ATH_MSG_VERBOSE( " *** 15 rowVolume = "<<rowVolume<<" volumeInRow = "<< volumeInRow[iRow] <<" diff = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
623 }
624 else if ( 12 == tower )
625 {
626 volumeInRow[iRow] += (rowVolume * (2./25) ); // the remaining 2 periods which are not cutted out
627 deltaZ *= 23./25.; // dz of the cutted part
628 rowVolume *= 23./25.; // volume of the cutted part of the cell, but before cut
629 ATH_MSG_VERBOSE( " *** 12 rowVolume = "<<rowVolume<<" volumeInRow = "<< volumeInRow[iRow] << " % = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
630 }
631
632 ATH_MSG_VERBOSE( "deltaz = "<<deltaZ<<" rmax = "<<radMax<<" rmin = "<<radMin<<" changed dz ?"<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
633
634 if ( (ModuleNcp == 61) || (ModuleNcp == 36) )
635 {
636 if ( iRow == 0 )
637 rowVolume = 0.;
638 else if ( iRow == 1 )
639 {
640 if (15 != tower)
641 {
642 rowVolume = 2.*radMax + radMin;
643 rowVolume *= 0.5*(radMax - radMin);
644 rowVolume *= Radius2HL * deltaZ;
645 }
646 else
647 {
648 rowVolume += epVolume;
649 }
650 }
651 else if (15 == tower) rowVolume += epVolume;
652
653 volumeInRow[iRow] += rowVolume;
654
655 ATH_MSG_VERBOSE( " *** rowVolume = "<<rowVolume<<" volumeInRow = "<< volumeInRow[iRow] << " % = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
656 } // Module 61 36
657
658 if ( (ModuleNcp == 62) || (ModuleNcp == 35) )
659 {
660 if ( iRow == 0 )
661 {
662 if (15 == tower)
663 {
664 rowVolume = radMax + radMin;
665 rowVolume *= (radMax - radMin);
666 rowVolume -= 0.5*radMin*(27*Gaudi::Units::mm);
667 rowVolume *= Radius2HL * ( deltaZ + epThickness ); // adding volume of cutted endplate
668 }
669 else
670 {
671 rowVolume = radMax - radMin - 35*Gaudi::Units::mm;
672 rowVolume *= (radMax + radMin);
673 rowVolume *= Radius2HL * deltaZ;
674 }
675 }
676 else if (15 == tower) rowVolume += epVolume;
677
678 volumeInRow[iRow] += rowVolume;
679 ATH_MSG_VERBOSE( " *** rowVolume = "<<rowVolume<<" volumeInRow = "<< volumeInRow[iRow] << " % = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
680 } // Module 62 35
681
682 if ( (ModuleNcp == 60) || (ModuleNcp == 37) )
683 {
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 ) )
688 {
689 if ( iRow < 2 )
690 rowVolume = 0;
691 else
692 rowVolume += epVolume;
693 }
694 else if ( iRow == 0 )
695 {
696 rowVolume = (radMax + radMin) * Radius2HL ;
697
698 rowVolume += 2.*deltax + (radMax - radMin)* pstan ;
699
700 // std::cout <<"\t\t\t test = "<<( 2.*deltax + (radMax - radMin)* pstan)/(radMax + radMin)* Radius2HL<<" dx = "<<deltax<<" rmin = "<<radMin<<" rmax = "<<radMax<<" pstan = "<<pstan<<std::endl;
701
702 rowVolume *= 0.5 * (radMax - radMin) * deltaZ;
703
704 // rowVolume *= (radMax - radMin) * Radius2HL * deltaZ;
705 }
706 else if ( iRow == 1 )
707 {
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;
713 rowVolume *= deltaZ;
714 }
715
716 volumeInRow[iRow] += rowVolume;
717 ATH_MSG_VERBOSE( " *** rowVolume = "<<rowVolume<<" volumeInRow = "<< volumeInRow[iRow] << " % = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
718 } // Module 60 37
719
720 ATH_MSG_VERBOSE( " *** rowVolume = "<<rowVolume<<" volumeInRow = "<< volumeInRow[iRow] << " % = "<<(volumeInRow[iRow] - oldrv)/oldrv*100. );
721 } // for iRow
722
723
724 double totalVolume = 0;
725 for (unsigned int iRow = 0; iRow < cell_dim->getNRows(); iRow++) totalVolume += volumeInRow[iRow];
726 elt->set_volume( totalVolume );
727
728 ATH_MSG_VERBOSE( "\n total volume = "
729 << elt->volume() << " cell_dim xCheck ( "
730 << cell_dim->getVolume() <<" ) "
731 << elt->volume()/oldv*100-100 << " % diff" );
732
733
734 ATH_MSG_VERBOSE( "-----------------------------------------------" );
735 }
736 //
737 // ps special D4
738 //
739 if ( (section == TileID::GAPDET) && (sample == TileID::SAMP_D) )
740 {
741 if (side == -1) m_dbManager->SetCurrentEnvByType(4);
742 if (side == 1) m_dbManager->SetCurrentEnvByType(5);
743
744 m_dbManager->SetCurrentModuleByIndex(module);
745 m_dbManager->SetCurrentSection(TileDddbManager::TILE_PLUG1);
746 int Id4 = int(fmod(m_dbManager->GetModType(),10));
747 m_dbManager->SetCurrentSection(Id4);
748
749 double standardD4dz = elt->dz();
750 double specialD4dz = m_dbManager->TILBdzmodul()*Gaudi::Units::cm;
751 if (! m_dbManager->addPlatesToCell()) specialD4dz -= m_dbManager->TILBdzend1()*Gaudi::Units::cm;
752 // special case of non-existing D4 in EBA15 and EBC18
753 // if ( Id4 == 8 ) specialD4dz = 0.; commented out - don't set size to zero - it'll be used in TICAL derivation code
754
755 if (elt->z() > 0.)
756 elt->set_z(elt->z()+0.5*(standardD4dz-specialD4dz));
757 else
758 elt->set_z(elt->z()-0.5*(standardD4dz-specialD4dz));
759 elt->set_dz(specialD4dz);
760 elt->set_volume(newv * specialD4dz/(standardD4dz));
761
762 if (Id4 > 3) {
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" );
766
767 ATH_MSG_VERBOSE( "spD4 old volume: " << oldv << std::endl
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() );
772 }
773 }
774 //
775 // ps special C10
776 //
777
778 /*
779 if ( (section == TileID::GAPDET) && (sample == TileID::SAMP_C) )
780 {
781 if (side == -1) m_dbManager->SetCurrentEnvByType(4);
782 if (side == 1) m_dbManager->SetCurrentEnvByType(5);
783
784 m_dbManager->SetCurrentModuleByIndex(module);
785 m_dbManager->SetCurrentSection(TileDddbManager::TILE_PLUG2);
786 int Ic10 = int(fmod(m_dbManager->GetModType()/100,100));
787
788 double standardC10dz = elt->dz();
789 double standardC10vol = elt->volume();
790
791 if ( Ic10 == 14 )
792 {
793 m_dbManager->SetCurrentSection( Ic10 );
794 m_dbManager->SetCurrentScin( m_dbManager->TILBcurscint() );
795
796 double specialC10dz = m_dbManager->SCNTdt();
797 elt->set_dz(specialC10dz);
798 elt->set_volume(standardC10vol * specialC10dz/standardC10dz );
799
800 if ( m_verbose )
801 std::cout<<"C10 old z/dz: " << oldz << " " << standardC10dz << std::endl
802 <<"C10 new z/dz: " << elt->z() << " " << elt->dz() << " "
803 << elt->z()/(oldz+1.e-10)*100-100 << " % diff" << std::endl;
804 if ( m_verbose )
805 std::cout<<"spC10 old volume: " << newv << std::endl
806 <<"spC10 new volume: " << elt->volume() << " "
807 << elt->volume()/oldv*100-100 << " % diff"
808 << " iphi = " << iphi
809 << " dphi = " << dphi
810 << std::endl;
811 }
812 }
813 */
814
815 //
816 // ps special D5+D4
817 //
818 if ( (section == TileID::EXTBAR) && (sample == TileID::SAMP_D) && (tower == 10) )
819 {
820 // this is needed to read special D4 type and its size
821 if (side == -1) m_dbManager->SetCurrentEnvByType(4);
822 if (side == 1) m_dbManager->SetCurrentEnvByType(5);
823 m_dbManager->SetCurrentModuleByIndex(module);
824 m_dbManager->SetCurrentSection(TileDddbManager::TILE_PLUG1);
825 int Id4 = int(fmod(m_dbManager->GetModType(),10));
826 m_dbManager->SetCurrentSection(Id4);
827
828 if ( Id4 == 8 )
829 {
830 oldz = elt->z();
831 double standardD5dz = elt->dz();
832 double specialD4dz = m_dbManager->TILBdzmodul()*Gaudi::Units::cm;
833 double specialD4Rin = m_dbManager->TILBrmin()*Gaudi::Units::cm;
834 if (m_dbManager->addPlatesToCell()) {
835 specialD4Rin -= m_dbManager->TILBdrfront()*Gaudi::Units::cm;
836 } else {
837 specialD4dz -= m_dbManager->TILBdzend1()*Gaudi::Units::cm;
838 }
839 double newS = (pow((elt->r() + elt->dr()/2.),2) - specialD4Rin*specialD4Rin)/(2.*elt->r()*elt->dr());
840 elt->set_volume(elt->volume()* (1. + newS*specialD4dz/standardD5dz));
841 /* commented out - don't change z and dz for special D5+D4
842 elt->set_dz(specialD4dz + standardD5dz);
843 if (elt->z() > 0.)
844 elt->set_z(elt->z()-0.5*specialD4dz);
845 else
846 elt->set_z(elt->z()+0.5*specialD4dz);
847 */
848
849 ATH_MSG_VERBOSE( "D5 old z/dz: " << oldz << " " << standardD5dz << " spD4 dz: " << specialD4dz );
850 ATH_MSG_VERBOSE( "D5+D4 new z/dz: " << elt->z() << " " << elt->dz() << " " );
851 ATH_MSG_VERBOSE( "D5+D4 old volume: " << newv << std::endl
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() );
857 ATH_MSG_VERBOSE( " module = "<< module
858 << " sample = " << sample
859 << " section = " << section
860 << " tower = " << tower );
861 }
862 }
863
864 if (0 == iphi) {
865 ATH_MSG_VERBOSE( "old volume: " << oldv << std::endl
866 <<"new volume: " << elt->volume() << " "
867 << elt->volume()/oldv*100-100 << " % diff"
868 << " iphi = " << iphi
869 << " dphi = " << dphi );
870 }
871 }
872
873 add_cell(elt);
874 ++n_cells;
875 } catch ( const TileID_Exception& ) {
876 ATH_MSG_ERROR( "can't build cell ID from ("
877 << section << "," << side << "," << module << ","
878 << tower << "," << sample << ")" );
879 }
880 eta += deta;
881 }
882 }
883 }
884 phi += dphi;
885 }
886 }
887
888 ATH_MSG_DEBUG( n_cells << " cells and "
889 << n_modules << " half-modules were created for "
890 << n_regions << " Tile Regions" );
891}
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define z
constexpr int pow(int base, int exp) noexcept
bool msgLvl(const MSG::Level lvl) const
Test the output level.
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
void set_depth_out(std::vector< double > &calo_depth)
set vector of out depths
void setCaloRMin(double r_min)
Set R Min.
void set_eta_phi_granularity(int neta, double deta, int nphi, double dphi)
Set Phi granularity.
void setCaloZMax(double z_max)
Set Z Max.
void set_n_calo_depth(int n_calo_depth)
set number of calo depths
void setCaloZMin(double z_min)
Set Z Min.
void setCaloPhiMin(double phi_min)
Set Phi Min.
void setCaloPhiMax(double phi_max)
Set Phi Max.
void setCaloRMax(double r_max)
Set R Max.
void set_depth_in(std::vector< double > &calo_depth)
set vector of in depths
void setCaloEtaMin(double eta_min)
Set Eta Min.
void setCaloEtaMax(double eta_max)
Set Eta Max.
double getZMax(unsigned int index) const
unsigned int getNRows() const
Definition TileCellDim.h:25
void print() const
double getVolume() const
Definition TileCellDim.h:26
double getRMax(unsigned int index) const
double getZMin(unsigned int index) const
double computeRowVolume(int iRow)
double getRMin(unsigned int index) const
void add_calodescr(CaloDetDescriptor *descriptor)
double shiftEta(double eta, double Rcen, double zshift)
tile_descr_const_iterator tile_descriptors_begin() const
tile_descr_const_iterator tile_descriptors_end() const
void add_module(IdentifierHash idhash, CaloDetDescriptor *module)
void add_cell(CaloDetDescrElement *cell)
static const double vBarrelCells[23]
static const double vItcGapCells[6]
static const double vExtendedCells[12]
TileCellDim * get_cell_dim(const Identifier &cell_id) const
void set_r(double r)
set r
void set_cylindric(double eta, double phi, double r)
set cylindric coordinates
void set_dz(double dz)
set cartezian size dz
void set_z(double z)
set z
void set_dr(double dr)
set cylindric size dr
void set_dphi(double dphi)
set cylindric size dphi
void set_cylindric_raw(double eta_raw, double phi_raw, double r_raw)
set raw cylindric coordinates
void set_deta(double deta)
set cylindric size deta
@ NOT_VALID_HASH
Definition TileHWID.h:314
gap(flags, cells_name, *args, **kw)
int ic
Definition grepfile.py:33
setEt setPhi setE277 setWeta2 eta1

◆ find_tile_region()

TileDetDescrRegion * TileDetDescrManager::find_tile_region ( const Identifier & region_id) const
inline

Definition at line 85 of file TileDetDescrManager.h.

86 { tile_region_map::const_iterator it = m_tile_region_map.find(region_id.get_identifier32().get_compact());
87 if (it != m_tile_region_map.end() ) return (*it).second; else return NULL;
88 }

◆ get_calo_descriptor()

CaloDetDescriptor * TileDetDescrManager::get_calo_descriptor ( CaloCell_ID::CaloSample sample,
int side ) const
inline

Definition at line 121 of file TileDetDescrManager.h.

122 { scalo_descr_map::const_iterator it = m_calo_descr_map.find((int)sample*side);
123 if (it != m_calo_descr_map.end() ) return (*it).second; else return NULL;
124 }

◆ get_cell_dim()

TileCellDim * TileDetDescrManager::get_cell_dim ( const Identifier & cell_id) const

Definition at line 952 of file TileDetDescrManager.cxx.

953{
954 int section = m_tile_id->section(cell_id);
955 if (section == Tile_Base_ID::AUXDET) return NULL;
956 int side = m_tile_id->side(cell_id);
957 int tower = m_tile_id->tower(cell_id);
958 int sample = m_tile_id->sample(cell_id);
959
960 unsigned int newCell = m_tile_id->cell_id(section,side,0,tower,sample).get_identifier32().get_compact();
961 if (m_cell_dim_map.find(newCell) != m_cell_dim_map.end()) {
962 return (*m_cell_dim_map.find(newCell)).second;
963 } else {
964 return NULL;
965 }
966}

◆ get_cell_element() [1/3]

CaloDetDescrElement * TileDetDescrManager::get_cell_element ( const Identifier & cell_id) const
inline

Definition at line 162 of file TileDetDescrManager.h.

163 { calo_element_map::const_iterator it = m_tile_cell_map.find(cell_id.get_identifier32().get_compact());
164 if (it != m_tile_cell_map.end() ) return (*it).second; else return NULL;
165 }

◆ get_cell_element() [2/3]

CaloDetDescrElement * TileDetDescrManager::get_cell_element ( const IdentifierHash cell_hash) const
inline

Definition at line 159 of file TileDetDescrManager.h.

160 { return m_tile_cell_vec[(unsigned int)cell_hash]; }

◆ get_cell_element() [3/3]

CaloDetDescrElement * TileDetDescrManager::get_cell_element ( unsigned int cell_hash) const
inline

Definition at line 156 of file TileDetDescrManager.h.

157 { return m_tile_cell_vec[cell_hash]; }

◆ get_hwid()

const TileHWID * TileDetDescrManager::get_hwid ( ) const
inline

Definition at line 173 of file TileDetDescrManager.h.

173{ return m_tile_hwid;}

◆ get_id()

const TileID * TileDetDescrManager::get_id ( ) const
inline

Definition at line 172 of file TileDetDescrManager.h.

172{ return m_tile_id;}

◆ get_module_element() [1/2]

CaloDetDescriptor * TileDetDescrManager::get_module_element ( const Identifier & module_id) const
inline

Definition at line 140 of file TileDetDescrManager.h.

141 { calo_descr_map::const_iterator it = m_tile_module_map.find(module_id.get_identifier32().get_compact());
142 if (it != m_tile_module_map.end() ) return (*it).second; else return NULL;
143 }

◆ get_module_element() [2/2]

CaloDetDescriptor * TileDetDescrManager::get_module_element ( const IdentifierHash module_hash) const
inline

Definition at line 137 of file TileDetDescrManager.h.

138 { return m_tile_module_vec[(unsigned int)module_hash]; }

◆ getDbManager()

TileDddbManager * TileDetDescrManager::getDbManager ( ) const

Definition at line 94 of file TileDetDescrManager.cxx.

95{
96 return m_dbManager.get();
97}

◆ getNumTreeTops()

unsigned int TileDetDescrManager::getNumTreeTops ( ) const
overridevirtual

Definition at line 74 of file TileDetDescrManager.cxx.

75{
76 return m_treeTops.size();
77}

◆ getTreeTop()

PVConstLink TileDetDescrManager::getTreeTop ( unsigned int i) const
overridevirtual

Definition at line 79 of file TileDetDescrManager.cxx.

80{
81 if (i<m_treeTops.size())
82 return m_treeTops[i];
83 else
84 return 0;
85}

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 178 of file AthMessaging.h.

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ operator=()

const TileDetDescrManager & TileDetDescrManager::operator= ( const TileDetDescrManager & right)
private

◆ print()

void TileDetDescrManager::print ( ) const

Definition at line 105 of file TileDetDescrManager.cxx.

106{
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;
110
113
114 for (; first != last; ++first) {
115 (*first)->print();
116 }
117
118 std::cout << " Number of Tile modules : "
119 << m_tile_module_vec.size() << std::endl;
120
123 for (; first1 != last1; ++first1) {
124 (*first1)->print(); // too many !
125 }
126
127 std::cout << " Number of Tile cells : "
128 << m_tile_cell_vec.size() << std::endl;
129
132 for (; first2 != last2; ++first2) {
133 (*first2)->print(); // too many !
134 }
135
136 std::cout << std::endl;
137}
tile_region_const_iterator tile_region_begin() const
calo_element_const_iterator tile_cell_end() const
calo_element_const_iterator tile_cell_begin() const
calo_descr_const_iterator tile_module_end() const
calo_descr_const_iterator tile_module_begin() const
tile_region_const_iterator tile_region_end() const

◆ releaseDbManager()

void TileDetDescrManager::releaseDbManager ( )

Definition at line 100 of file TileDetDescrManager.cxx.

101{
102 m_dbManager.reset();
103}

◆ set_helper() [1/3]

void TileDetDescrManager::set_helper ( const CaloCell_ID * id)
inline

Definition at line 191 of file TileDetDescrManager.h.

191{ m_cell_id = id; }

◆ set_helper() [2/3]

void TileDetDescrManager::set_helper ( const TileHWID * id)
inline

Definition at line 192 of file TileDetDescrManager.h.

192{ m_tile_hwid = id; }

◆ set_helper() [3/3]

void TileDetDescrManager::set_helper ( const TileID * id)
inline

Definition at line 190 of file TileDetDescrManager.h.

190{ m_tile_id = id; }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ shiftEta()

double TileDetDescrManager::shiftEta ( double eta,
double Rcen,
double zshift )
inlineprivate

Definition at line 234 of file TileDetDescrManager.h.

234 {
235 return eta + zshift * tanh(eta) * tan(2 * atan(exp(-eta))) / Rcen;
236 }

◆ tile_cell_begin()

calo_element_const_iterator TileDetDescrManager::tile_cell_begin ( ) const
inline

Definition at line 147 of file TileDetDescrManager.h.

148 { return m_tile_cell_vec.begin(); }

◆ tile_cell_end()

calo_element_const_iterator TileDetDescrManager::tile_cell_end ( ) const
inline

Definition at line 150 of file TileDetDescrManager.h.

151 { return m_tile_cell_vec.end(); }

◆ tile_cell_size()

calo_element_vec_size TileDetDescrManager::tile_cell_size ( ) const
inline

Definition at line 153 of file TileDetDescrManager.h.

154 { return m_tile_cell_vec.size(); }

◆ tile_descriptors_begin()

tile_descr_const_iterator TileDetDescrManager::tile_descriptors_begin ( ) const
inline

Definition at line 101 of file TileDetDescrManager.h.

102 { return m_tile_descr_vec.begin(); }

◆ tile_descriptors_end()

tile_descr_const_iterator TileDetDescrManager::tile_descriptors_end ( ) const
inline

Definition at line 104 of file TileDetDescrManager.h.

105 { return m_tile_descr_vec.end(); }

◆ tile_descriptors_size()

tile_descr_vec_size TileDetDescrManager::tile_descriptors_size ( ) const
inline

Definition at line 107 of file TileDetDescrManager.h.

108 { return m_tile_descr_vec.size(); }

◆ tile_module_begin()

calo_descr_const_iterator TileDetDescrManager::tile_module_begin ( ) const
inline

Definition at line 128 of file TileDetDescrManager.h.

129 { return m_tile_module_vec.begin(); }

◆ tile_module_end()

calo_descr_const_iterator TileDetDescrManager::tile_module_end ( ) const
inline

Definition at line 131 of file TileDetDescrManager.h.

132 { return m_tile_module_vec.end(); }

◆ tile_module_size()

calo_descr_vec_size TileDetDescrManager::tile_module_size ( ) const
inline

Definition at line 134 of file TileDetDescrManager.h.

135 { return m_tile_module_vec.size(); }

◆ tile_region_begin()

tile_region_const_iterator TileDetDescrManager::tile_region_begin ( ) const
inline

Definition at line 90 of file TileDetDescrManager.h.

91 { return m_tile_region_vec.begin(); }

◆ tile_region_end()

tile_region_const_iterator TileDetDescrManager::tile_region_end ( ) const
inline

Definition at line 93 of file TileDetDescrManager.h.

94 { return m_tile_region_vec.end(); }

◆ tile_region_size()

tile_region_vec_size TileDetDescrManager::tile_region_size ( ) const
inline

Definition at line 96 of file TileDetDescrManager.h.

97 { return m_tile_region_vec.size(); }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_calo_descr_map

scalo_descr_map TileDetDescrManager::m_calo_descr_map
private

Definition at line 221 of file TileDetDescrManager.h.

◆ m_calo_descr_vec

calo_descr_vec TileDetDescrManager::m_calo_descr_vec
private

Definition at line 220 of file TileDetDescrManager.h.

◆ m_cell_dim_map

cell_dim_map TileDetDescrManager::m_cell_dim_map
private

Definition at line 231 of file TileDetDescrManager.h.

◆ m_cell_id

const CaloCell_ID* TileDetDescrManager::m_cell_id
private

Definition at line 212 of file TileDetDescrManager.h.

◆ m_dbManager

TileDddbManager_ptr TileDetDescrManager::m_dbManager
private

Definition at line 207 of file TileDetDescrManager.h.

◆ m_elements_created

bool TileDetDescrManager::m_elements_created
private

Definition at line 209 of file TileDetDescrManager.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_tile_cell_map

calo_element_map TileDetDescrManager::m_tile_cell_map
private

Definition at line 229 of file TileDetDescrManager.h.

◆ m_tile_cell_vec

calo_element_vec TileDetDescrManager::m_tile_cell_vec
private

Definition at line 228 of file TileDetDescrManager.h.

◆ m_tile_descr_vec

tile_descr_vec TileDetDescrManager::m_tile_descr_vec
private

Definition at line 217 of file TileDetDescrManager.h.

◆ m_tile_hwid

const TileHWID* TileDetDescrManager::m_tile_hwid
private

Definition at line 213 of file TileDetDescrManager.h.

◆ m_tile_id

const TileID* TileDetDescrManager::m_tile_id
private

Definition at line 211 of file TileDetDescrManager.h.

◆ m_tile_module_map

calo_descr_map TileDetDescrManager::m_tile_module_map
private

Definition at line 225 of file TileDetDescrManager.h.

◆ m_tile_module_vec

calo_descr_vec TileDetDescrManager::m_tile_module_vec
private

Definition at line 224 of file TileDetDescrManager.h.

◆ m_tile_region_map

tile_region_map TileDetDescrManager::m_tile_region_map
private

Definition at line 216 of file TileDetDescrManager.h.

◆ m_tile_region_vec

tile_region_vec TileDetDescrManager::m_tile_region_vec
private

Definition at line 215 of file TileDetDescrManager.h.

◆ m_treeTops

std::vector<PVConstLink> TileDetDescrManager::m_treeTops
private

Definition at line 204 of file TileDetDescrManager.h.

◆ vBarrelCells

const double TileDetDescrManager::vBarrelCells
static
Initial value:
= {17799.76*Gaudi::Units::cm3,
17799.76*Gaudi::Units::cm3,
18459.01*Gaudi::Units::cm3,
18459.01*Gaudi::Units::cm3,
19777.51*Gaudi::Units::cm3,
20436.76*Gaudi::Units::cm3,
21096.01*Gaudi::Units::cm3,
23073.76*Gaudi::Units::cm3,
24392.26*Gaudi::Units::cm3,
21096.01*Gaudi::Units::cm3,
75726.60*Gaudi::Units::cm3,
77024.24*Gaudi::Units::cm3,
77024.24*Gaudi::Units::cm3,
81574.95*Gaudi::Units::cm3,
81574.95*Gaudi::Units::cm3,
88401.02*Gaudi::Units::cm3,
91974.02*Gaudi::Units::cm3,
91014.21*Gaudi::Units::cm3,
34219.80*Gaudi::Units::cm3,
110000.61*Gaudi::Units::cm3,
111375.62*Gaudi::Units::cm3,
118250.66*Gaudi::Units::cm3,
137500.77*Gaudi::Units::cm3}

Definition at line 6 of file TileDetDescrManager.h.

◆ vExtendedCells

const double TileDetDescrManager::vExtendedCells
static
Initial value:
= {11863.88*Gaudi::Units::cm3,
32955.21*Gaudi::Units::cm3,
36909.84*Gaudi::Units::cm3,
39546.25*Gaudi::Units::cm3,
63274.01*Gaudi::Units::cm3,
44472.59*Gaudi::Units::cm3,
75047.49*Gaudi::Units::cm3,
83386.10*Gaudi::Units::cm3,
88945.18*Gaudi::Units::cm3,
97283.79*Gaudi::Units::cm3,
293772.18*Gaudi::Units::cm3,
338967.89*Gaudi::Units::cm3}

Definition at line 30 of file TileDetDescrManager.h.

32 : public GeoVDetectorManager, public AthMessaging
33{
34public:
35 // Temporary solution for cell volumes
36 // these numbers are normally overwritten by numbers from GeoModel in releases after 12.0.0
37 static const double vBarrelCells[23];
38 static const double vExtendedCells[12];
39 static const double vItcGapCells[6];
40
41 // TYPEDEFS
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.

◆ vItcGapCells

const double TileDetDescrManager::vItcGapCells
static
Initial value:
= {13461.47*Gaudi::Units::cm3,
46542.48*Gaudi::Units::cm3,
1292.80*Gaudi::Units::cm3,
1244.11*Gaudi::Units::cm3,
776.24*Gaudi::Units::cm3,
468.36*Gaudi::Units::cm3}

Definition at line 43 of file TileDetDescrManager.h.


The documentation for this class was generated from the following files: