![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <CaloDmDescrManager.h>
Definition at line 131 of file CaloDmDescrManager.h.
◆ CaloDmDescrManager()
CaloDmDescrManager::CaloDmDescrManager |
( |
| ) |
|
◆ ~CaloDmDescrManager()
CaloDmDescrManager::~CaloDmDescrManager |
( |
| ) |
|
◆ build_element()
◆ build_element_vector()
void CaloDmDescrManager::build_element_vector |
( |
| ) |
|
|
private |
Definition at line 280 of file CaloDmDescrManager.cxx.
283 std::cout <<
"CaloDmDescrManager::build_element_list() -> Warning! Non empty list."
◆ get_calo_sample() [1/2]
Definition at line 507 of file CaloDmDescrManager.cxx.
509 if ( SamplingName ==
"PreSamplerB" ) {
511 }
else if ( SamplingName ==
"EMB1" ) {
513 }
else if ( SamplingName ==
"EMB2" ) {
515 }
else if ( SamplingName ==
"EMB3" ) {
517 }
else if ( SamplingName ==
"PreSamplerE" ) {
519 }
else if ( SamplingName ==
"EME1" ) {
521 }
else if ( SamplingName ==
"EME2" ) {
523 }
else if ( SamplingName ==
"EME3" ) {
525 }
else if ( SamplingName ==
"HEC0" ) {
527 }
else if ( SamplingName ==
"HEC1" ) {
529 }
else if ( SamplingName ==
"HEC2" ) {
531 }
else if ( SamplingName ==
"HEC3" ) {
533 }
else if ( SamplingName ==
"TileBar0" ) {
535 }
else if ( SamplingName ==
"TileBar1" ) {
537 }
else if ( SamplingName ==
"TileBar2" ) {
539 }
else if ( SamplingName ==
"TileGap1" ) {
541 }
else if ( SamplingName ==
"TileGap2" ) {
543 }
else if ( SamplingName ==
"TileGap3" ) {
545 }
else if ( SamplingName ==
"TileExt0" ) {
547 }
else if ( SamplingName ==
"TileExt1" ) {
549 }
else if ( SamplingName ==
"TileExt2" ) {
551 }
else if ( SamplingName ==
"FCAL0" ) {
553 }
else if ( SamplingName ==
"FCAL1" ) {
555 }
else if ( SamplingName ==
"FCAL2" ) {
558 std::cout <<
"Calorimeter sampling '" << SamplingName
559 <<
"' is not a valid Calorimeter sampling name and will be ignored! " << std::endl;
◆ get_calo_sample() [2/2]
Definition at line 569 of file CaloDmDescrManager.cxx.
572 if ( SamplingName.find(
"PreSamplerB") != std::string::npos ) {
574 }
else if ( SamplingName.find(
"EMB1") != std::string::npos ) {
576 }
else if ( SamplingName.find(
"EMB2") != std::string::npos ) {
578 }
else if ( SamplingName.find(
"EMB3") != std::string::npos ) {
580 }
else if ( SamplingName.find(
"PreSamplerE") != std::string::npos ) {
582 }
else if ( SamplingName.find(
"EME1") != std::string::npos ) {
584 }
else if ( SamplingName.find(
"EME2") != std::string::npos ) {
586 }
else if ( SamplingName.find(
"EME3") != std::string::npos ) {
588 }
else if ( SamplingName.find(
"HEC0") != std::string::npos ) {
590 }
else if ( SamplingName.find(
"HEC1") != std::string::npos ) {
592 }
else if ( SamplingName.find(
"HEC2") != std::string::npos ) {
594 }
else if ( SamplingName.find(
"HEC3") != std::string::npos ) {
596 }
else if ( SamplingName.find(
"TileBar0") != std::string::npos ) {
598 }
else if ( SamplingName.find(
"TileBar1") != std::string::npos ) {
600 }
else if ( SamplingName.find(
"TileBar2") != std::string::npos ) {
602 }
else if ( SamplingName.find(
"TileGap1") != std::string::npos ) {
604 }
else if ( SamplingName.find(
"TileGap2") != std::string::npos ) {
606 }
else if ( SamplingName.find(
"TileGap3") != std::string::npos ) {
608 }
else if ( SamplingName.find(
"TileExt0") != std::string::npos ) {
610 }
else if ( SamplingName.find(
"TileExt1") != std::string::npos ) {
612 }
else if ( SamplingName.find(
"TileExt2") != std::string::npos ) {
614 }
else if ( SamplingName.find(
"FCAL0") != std::string::npos ) {
616 }
else if ( SamplingName.find(
"FCAL1") != std::string::npos ) {
618 }
else if ( SamplingName.find(
"FCAL2") != std::string::npos ) {
621 std::cout <<
"CaloDmDescrManager::get_calo_sample() -> Calorimeter sampling '" << SamplingName
622 <<
"' is not a valid Calorimeter sampling name and will be ignored! " << std::endl;
626 if(SamplingName.find(
'(') == std::string::npos || SamplingName.find(
')') != SamplingName.size()-1 ){
627 std::cout <<
"CaloDmDescrManager::get_calo_sample() -> Can't parse calorimeter sampling '" << SamplingName <<
"' string! Something with brackets..." << std::endl;
630 std::string sEtaRange(SamplingName,SamplingName.find(
'(')+1);
631 std::istringstream iEtaRange( sEtaRange.c_str() );
635 std::cout <<
"CaloDmDescrManager::get_calo_sample() -> Can't parse calorimeter sampling '" << SamplingName <<
"' string!" << std::endl;
◆ get_dm_area()
◆ get_dm_hash()
Definition at line 211 of file CaloDmDescrManager.cxx.
217 std::cout <<
" input eta out of range"
219 <<
" myRegion->m_key: " << myRegion->
m_key
220 <<
" myRegion->etaMin(): " << myRegion->
etaMin()
221 <<
" myRegion->etaMax(): " << myRegion->
etaMax()
228 if(myRegion->
m_side < 0) {
229 neta = myRegion->
netaMax() - neta - 1;
232 if(xphi<0.0) xphi=2*
M_PI+xphi;
233 int nphi=
int(xphi/myRegion->
dphi());
235 std::cout <<
" key: " << myRegion->
m_key
236 <<
" side: " << myRegion->
m_side
237 <<
" etaMin: " << myRegion->
etaMin()
238 <<
" phiMax: " << myRegion->
etaMax()
241 <<
" myRegion->netaMax(): " << myRegion->
netaMax()
242 <<
" myRegion->nphiMax(): " << myRegion->
nphiMax()
245 if( (neta >=0 && neta < myRegion->netaMax()) && (nphi >=0 && nphi < myRegion->nphiMax()) ) {
252 std::cout <<
"CaloDmDescrManager::get_dm_hash() -> ERROR! p1." << std::endl;
256 std::cout <<
"CaloDmDescrManager::get_dm_hash() -> ERROR! p2."
257 <<
" key: " << myRegion->
m_key
258 <<
" side: " << myRegion->
m_side
259 <<
" myRegion->etaMin(): " << myRegion->
etaMin()
260 <<
" myRegion->etaMax(): " << myRegion->
etaMax()
261 <<
" myRegion->deta(): " << myRegion->
deta()
266 <<
" myRegion->netaMax(): " << myRegion->
netaMax()
267 <<
" myRegion->nphiMax(): " << myRegion->
nphiMax()
◆ get_dm_key()
◆ get_dm_region()
◆ get_element()
Definition at line 133 of file CaloDmDescrManager.cxx.
141 std::cout <<
"CaloDmDescrManager::get_element-> Error! Wrong dead material identifier! " <<
m_id_helper->
show_to_string(cellId) << std::endl;
147 std::cout <<
"CaloDmDescrManager::get_element-> Error! Bad hash id for dead material identifier " <<
hash << std::endl;
◆ initialize()
int CaloDmDescrManager::initialize |
( |
| ) |
|
Definition at line 76 of file CaloDmDescrManager.cxx.
80 ISvcLocator* svcLoc = Gaudi::svcLocator();
82 if (
sc.isFailure() ) {
84 <<
"Unable to get pointer to StoreGate Service" <<
endmsg;
91 <<
"Unable to retrieve caloDM_ID helper from DetectorStore" <<
endmsg;
98 <<
"Unable to retrieve AtlasDetectorID helper from DetectorStore" <<
endmsg;
105 if (
sc.isFailure()) {
◆ instance()
◆ load_regions()
StatusCode CaloDmDescrManager::load_regions |
( |
const std::string & |
DmRegionFileName | ) |
|
|
private |
Definition at line 344 of file CaloDmDescrManager.cxx.
351 log << MSG::WARNING <<
"CaloDmDescrManager::build_element_list() -> Warning! Non empty list."
354 return StatusCode::FAILURE;
361 std::ifstream
fin(
file.c_str());
364 return StatusCode::FAILURE;
369 while(
fin.getline(cLine,
sizeof(cLine)-1)){
370 if( strlen(cLine)==0 || cLine[0] ==
'#' || cLine[0] ==
'\n')
continue;
371 sLine = std::string(cLine);
372 std::istringstream mypars( sLine.c_str() );
375 float etamin, etamax, deta, dphi;
377 fin.getline(cLine,
sizeof(cLine)-1);
378 sLine = std::string(cLine);
379 std::istringstream mynei( sLine.c_str() );
381 std::vector<short> neighbours;
382 std::vector<float> CaloEtaMinVector;
383 std::vector<float> CaloEtaMaxVector;
384 while (mynei >> sKey) {
385 if(sKey.find(
"CaloSampleNeighbors") != std::string::npos)
continue;
386 if(sKey.find(
"Unknown") != std::string::npos)
continue;
387 float caloEtaMin, caloEtaMax;
390 neighbours.push_back((
int)nsmp);
391 CaloEtaMinVector.push_back(caloEtaMin);
392 CaloEtaMaxVector.push_back(caloEtaMax);
394 std::cout <<
"CaloDmDescrManager::load_regions() -> Fromat ERROR in line '" << sLine <<
"', key '" << sKey <<
"'" << std::endl;
395 return StatusCode::FAILURE;
400 int type=(
key-subdet*1000)/100;
401 int sampling=(
key-subdet*1000-
type*100)/10;
402 int region=(
key-subdet*1000-
type*100-sampling*10)/1;
403 if(subdet != 4 && subdet !=5) {
404 log << MSG::ERROR <<
" Error! Wrong subdet " << subdet <<
". Format error in line '" << sLine <<
"', key '" << sKey <<
"'" << std::endl;
405 return StatusCode::FAILURE;
417 }
else if (subdet == 5){
465 }
else if (subdet == 5){
471 while(
fin.getline(cLine,
sizeof(cLine)-1)) {
472 if(cLine[0] ==
'}')
break;
475 std::cout <<
"CaloDmDescrManager::load_regions() -> Fromat ERROR in line '" << sLine <<
"'" << std::endl;
476 return StatusCode::FAILURE;
499 return StatusCode::SUCCESS;
◆ reg_begin()
std::vector< CaloDmRegion * >::const_iterator CaloDmDescrManager::reg_begin |
( |
void |
| ) |
const |
|
inline |
◆ reg_end()
std::vector< CaloDmRegion * >::const_iterator CaloDmDescrManager::reg_end |
( |
void |
| ) |
const |
|
inline |
◆ show_element()
◆ m_caloDM_ID
◆ m_detStore
◆ m_DmElementVector
◆ m_DmRegionFileName
std::string CaloDmDescrManager::m_DmRegionFileName |
◆ m_DmRegionVector
std::vector<CaloDmRegion *> CaloDmDescrManager::m_DmRegionVector |
|
private |
◆ m_id_helper
The documentation for this class was generated from the following files:
std::vector< float > m_CaloSampleEtaMin
int dmat(const Identifier &id) const
return DMtype according to :
Scalar phi() const
phi method
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
size_type lar_region_hash_max(void) const
lar region hash table max size
CaloDmDescrElement * get_element(const Identifier &cellId) const
size_type lar_zone_hash_max(void) const
lar zone hash table max size
StoreGateSvc * m_detStore
Scalar eta() const
pseudorapidity method
int region(const Identifier &id) const
return region according to :
Scalar theta() const
theta method
void build_element_vector()
IdentifierHash lar_region_hash(Identifier LArRegionId) const
create a lar hash id from region id
Identifier tile_zone_id(IdentifierHash tile_zone_hash_id) const
create a tile zone id from hash id
const AtlasDetectorID * m_id_helper
StatusCode load_regions(const std::string &DmRegionFileName)
const Identifier region_id() const
IMessageSvc * getMessageSvc(bool quiet=false)
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
IdentifierHash m_region_hash
size_type tile_region_hash_max(void) const
tile region hash table max size
::StatusCode StatusCode
StatusCode definition for legacy code.
int pos_neg_z(const Identifier &id) const
return pos_neg_z according to :
bool is_lar(const Identifier &zoneId) const
to disentangle between LAr and Tile dead material
std::vector< CaloDmDescrElement * > m_DmElementVector
IdentifierHash tile_zone_hash(Identifier TileZoneId) const
create a tile hash id from zone id
static CaloCell_ID::CaloSample get_calo_sample(const std::string &SamplingName)
std::vector< float > m_CaloSampleEtaMax
Identifier region_id(int pos_neg_z, int dmat, int sampling, int region) const
build a region identifier valid for both LAr and Tiles
std::string m_DmRegionFileName
IdentifierHash tile_region_hash(Identifier TileRegionId) const
create a tile hash id from region id
int sampling(const Identifier &id) const
return sampling according to :
int get_dm_key(const Identifier &cellId) const
const CaloDM_ID * m_caloDM_ID
IdentifierHash lar_zone_hash(Identifier LArZoneId) const
create a lar hash id from zone id
int eta(const Identifier &id) const
return eta
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Identifier lar_zone_id(IdentifierHash lar_zone_hash_id) const
create a lar zone id from hash id
int phi(const Identifier &id) const
return phi
CaloDmDescrElement * build_element(const Identifier &cellId, const CaloDmRegion *myRegion)
std::vector< CaloDmRegion * > m_DmRegionVector
bool is_tile(const Identifier &zoneId) const
to disentangle between LAr and Tile dead material
size_type tile_zone_hash_max(void) const
tile zone hash table max size
Identifier zone_id(int pos_neg_z, int dat, int sampling, int region, int eta, int phi) const
build a zone identifier valid for both LAr and Tiles
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
std::vector< short > m_CaloSampleNeighbours
static int getArea(const int &dmkey, const float &eta)