|
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 254 of file CaloDmDescrManager.cxx.
257 std::cout <<
"CaloDmDescrManager::build_element_list() -> Warning! Non empty list."
◆ get_calo_sample() [1/2]
Definition at line 481 of file CaloDmDescrManager.cxx.
483 if ( SamplingName ==
"PreSamplerB" ) {
485 }
else if ( SamplingName ==
"EMB1" ) {
487 }
else if ( SamplingName ==
"EMB2" ) {
489 }
else if ( SamplingName ==
"EMB3" ) {
491 }
else if ( SamplingName ==
"PreSamplerE" ) {
493 }
else if ( SamplingName ==
"EME1" ) {
495 }
else if ( SamplingName ==
"EME2" ) {
497 }
else if ( SamplingName ==
"EME3" ) {
499 }
else if ( SamplingName ==
"HEC0" ) {
501 }
else if ( SamplingName ==
"HEC1" ) {
503 }
else if ( SamplingName ==
"HEC2" ) {
505 }
else if ( SamplingName ==
"HEC3" ) {
507 }
else if ( SamplingName ==
"TileBar0" ) {
509 }
else if ( SamplingName ==
"TileBar1" ) {
511 }
else if ( SamplingName ==
"TileBar2" ) {
513 }
else if ( SamplingName ==
"TileGap1" ) {
515 }
else if ( SamplingName ==
"TileGap2" ) {
517 }
else if ( SamplingName ==
"TileGap3" ) {
519 }
else if ( SamplingName ==
"TileExt0" ) {
521 }
else if ( SamplingName ==
"TileExt1" ) {
523 }
else if ( SamplingName ==
"TileExt2" ) {
525 }
else if ( SamplingName ==
"FCAL0" ) {
527 }
else if ( SamplingName ==
"FCAL1" ) {
529 }
else if ( SamplingName ==
"FCAL2" ) {
532 std::cout <<
"Calorimeter sampling '" << SamplingName
533 <<
"' is not a valid Calorimeter sampling name and will be ignored! " << std::endl;
◆ get_calo_sample() [2/2]
Definition at line 543 of file CaloDmDescrManager.cxx.
546 if ( SamplingName.find(
"PreSamplerB") != std::string::npos ) {
548 }
else if ( SamplingName.find(
"EMB1") != std::string::npos ) {
550 }
else if ( SamplingName.find(
"EMB2") != std::string::npos ) {
552 }
else if ( SamplingName.find(
"EMB3") != std::string::npos ) {
554 }
else if ( SamplingName.find(
"PreSamplerE") != std::string::npos ) {
556 }
else if ( SamplingName.find(
"EME1") != std::string::npos ) {
558 }
else if ( SamplingName.find(
"EME2") != std::string::npos ) {
560 }
else if ( SamplingName.find(
"EME3") != std::string::npos ) {
562 }
else if ( SamplingName.find(
"HEC0") != std::string::npos ) {
564 }
else if ( SamplingName.find(
"HEC1") != std::string::npos ) {
566 }
else if ( SamplingName.find(
"HEC2") != std::string::npos ) {
568 }
else if ( SamplingName.find(
"HEC3") != std::string::npos ) {
570 }
else if ( SamplingName.find(
"TileBar0") != std::string::npos ) {
572 }
else if ( SamplingName.find(
"TileBar1") != std::string::npos ) {
574 }
else if ( SamplingName.find(
"TileBar2") != std::string::npos ) {
576 }
else if ( SamplingName.find(
"TileGap1") != std::string::npos ) {
578 }
else if ( SamplingName.find(
"TileGap2") != std::string::npos ) {
580 }
else if ( SamplingName.find(
"TileGap3") != std::string::npos ) {
582 }
else if ( SamplingName.find(
"TileExt0") != std::string::npos ) {
584 }
else if ( SamplingName.find(
"TileExt1") != std::string::npos ) {
586 }
else if ( SamplingName.find(
"TileExt2") != std::string::npos ) {
588 }
else if ( SamplingName.find(
"FCAL0") != std::string::npos ) {
590 }
else if ( SamplingName.find(
"FCAL1") != std::string::npos ) {
592 }
else if ( SamplingName.find(
"FCAL2") != std::string::npos ) {
595 std::cout <<
"CaloDmDescrManager::get_calo_sample() -> Calorimeter sampling '" << SamplingName
596 <<
"' is not a valid Calorimeter sampling name and will be ignored! " << std::endl;
600 if(SamplingName.find(
'(') == std::string::npos || SamplingName.find(
')') != SamplingName.size()-1 ){
601 std::cout <<
"CaloDmDescrManager::get_calo_sample() -> Can't parse calorimeter sampling '" << SamplingName <<
"' string! Something with brackets..." << std::endl;
604 std::string sEtaRange(SamplingName,SamplingName.find(
'(')+1);
605 std::istringstream iEtaRange( sEtaRange.c_str() );
609 std::cout <<
"CaloDmDescrManager::get_calo_sample() -> Can't parse calorimeter sampling '" << SamplingName <<
"' string!" << std::endl;
◆ get_dm_area()
◆ get_dm_hash()
Definition at line 185 of file CaloDmDescrManager.cxx.
191 std::cout <<
" input eta out of range"
193 <<
" myRegion->m_key: " << myRegion->
m_key
194 <<
" myRegion->etaMin(): " << myRegion->
etaMin()
195 <<
" myRegion->etaMax(): " << myRegion->
etaMax()
202 if(myRegion->
m_side < 0) {
203 neta = myRegion->
netaMax() - neta - 1;
206 if(xphi<0.0) xphi=2*
M_PI+xphi;
207 int nphi=
int(xphi/myRegion->
dphi());
209 std::cout <<
" key: " << myRegion->
m_key
210 <<
" side: " << myRegion->
m_side
211 <<
" etaMin: " << myRegion->
etaMin()
212 <<
" phiMax: " << myRegion->
etaMax()
215 <<
" myRegion->netaMax(): " << myRegion->
netaMax()
216 <<
" myRegion->nphiMax(): " << myRegion->
nphiMax()
219 if( (neta >=0 && neta < myRegion->netaMax()) && (nphi >=0 && nphi < myRegion->nphiMax()) ) {
226 std::cout <<
"CaloDmDescrManager::get_dm_hash() -> ERROR! p1." << std::endl;
230 std::cout <<
"CaloDmDescrManager::get_dm_hash() -> ERROR! p2."
231 <<
" key: " << myRegion->
m_key
232 <<
" side: " << myRegion->
m_side
233 <<
" myRegion->etaMin(): " << myRegion->
etaMin()
234 <<
" myRegion->etaMax(): " << myRegion->
etaMax()
235 <<
" myRegion->deta(): " << myRegion->
deta()
240 <<
" myRegion->netaMax(): " << myRegion->
netaMax()
241 <<
" myRegion->nphiMax(): " << myRegion->
nphiMax()
◆ get_dm_key()
◆ get_dm_region()
◆ get_element()
Definition at line 107 of file CaloDmDescrManager.cxx.
115 std::cout <<
"CaloDmDescrManager::get_element-> Error! Wrong dead material identifier! " <<
m_id_helper->
show_to_string(cellId) << std::endl;
121 std::cout <<
"CaloDmDescrManager::get_element-> Error! Bad hash id for dead material identifier " <<
hash << std::endl;
◆ initialize()
int CaloDmDescrManager::initialize |
( |
| ) |
|
◆ instance()
◆ load_regions()
StatusCode CaloDmDescrManager::load_regions |
( |
const std::string & |
DmRegionFileName | ) |
|
|
private |
Definition at line 318 of file CaloDmDescrManager.cxx.
325 log << MSG::WARNING <<
"CaloDmDescrManager::build_element_list() -> Warning! Non empty list."
328 return StatusCode::FAILURE;
335 std::ifstream
fin(
file.c_str());
338 return StatusCode::FAILURE;
343 while(
fin.getline(cLine,
sizeof(cLine)-1)){
344 if( strlen(cLine)==0 || cLine[0] ==
'#' || cLine[0] ==
'\n')
continue;
345 sLine = std::string(cLine);
346 std::istringstream mypars( sLine.c_str() );
349 float etamin, etamax, deta, dphi;
351 fin.getline(cLine,
sizeof(cLine)-1);
352 sLine = std::string(cLine);
353 std::istringstream mynei( sLine.c_str() );
355 std::vector<short> neighbours;
356 std::vector<float> CaloEtaMinVector;
357 std::vector<float> CaloEtaMaxVector;
358 while (mynei >> sKey) {
359 if(sKey.find(
"CaloSampleNeighbors") != std::string::npos)
continue;
360 if(sKey.find(
"Unknown") != std::string::npos)
continue;
361 float caloEtaMin, caloEtaMax;
364 neighbours.push_back((
int)nsmp);
365 CaloEtaMinVector.push_back(caloEtaMin);
366 CaloEtaMaxVector.push_back(caloEtaMax);
368 std::cout <<
"CaloDmDescrManager::load_regions() -> Fromat ERROR in line '" << sLine <<
"', key '" << sKey <<
"'" << std::endl;
369 return StatusCode::FAILURE;
374 int type=(
key-subdet*1000)/100;
375 int sampling=(
key-subdet*1000-
type*100)/10;
376 int region=(
key-subdet*1000-
type*100-sampling*10)/1;
377 if(subdet != 4 && subdet !=5) {
378 log << MSG::ERROR <<
" Error! Wrong subdet " << subdet <<
". Format error in line '" << sLine <<
"', key '" << sKey <<
"'" << std::endl;
379 return StatusCode::FAILURE;
391 }
else if (subdet == 5){
439 }
else if (subdet == 5){
445 while(
fin.getline(cLine,
sizeof(cLine)-1)) {
446 if(cLine[0] ==
'}')
break;
449 std::cout <<
"CaloDmDescrManager::load_regions() -> Fromat ERROR in line '" << sLine <<
"'" << std::endl;
450 return StatusCode::FAILURE;
473 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_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 :
#define CHECK_WITH_CONTEXT(...)
Evaluate an expression and check for errors, with an explicitly specified context name.
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
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)
IdentifierHash m_region_hash
size_type tile_region_hash_max(void) const
tile region hash table max size
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
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
ServiceHandle< StoreGateSvc > m_detStore
size_type tile_zone_hash_max(void) const
tile zone hash table max size
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
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)