|
ATLAS Offline Software
|
Go to the documentation of this file.
41 #include "GaudiKernel/ISvcLocator.h"
42 #include "GaudiKernel/MsgStream.h"
43 #include "GaudiKernel/IMessageSvc.h"
51 MsgStream
log(
msgSvc,
"buildCaloDetDescr");
54 SmartIF<StoreGateSvc>
detStore{svcLocator->service(
"DetectorStore")};
56 throw std::runtime_error(
"buildCaloDetDescr failed to acquire a pointer to DetectorStore");
59 if(
detStore->retrieve(cell_id,
"CaloCell_ID")!=StatusCode::SUCCESS)
60 throw std::runtime_error(
"buildCaloDetDescr failed to acquire a pointer to CaloCell_ID helper");
64 if(
detStore->retrieve(caloId_mgr,
"CaloIdManager")!=StatusCode::SUCCESS)
65 throw std::runtime_error(
"buildCaloDetDescr failed to acquire a pointer to CaloIdManager helper");
70 std::unique_ptr<CaloDetDescrManager> caloMgr = std::make_unique<CaloDetDescrManager>();
85 const LArEM_ID* em_id = caloId_mgr->getEM_ID();
86 const LArHEC_ID* hec_id = caloId_mgr->getHEC_ID();
87 const LArFCAL_ID* fcal_id = caloId_mgr->getFCAL_ID();
90 bool isTestBeam =
false;
94 log << MSG::WARNING <<
"Could not get LArDetectorManager. Assuming TestBeam=false" <<
endmsg;
97 isTestBeam = larMgr->isTestBeam();
116 log << MSG::WARNING <<
"Could not get the EMBDetectorManager. No Calo Elements will be built for EMB" <<
endmsg;
122 for (embregIt=embManager->beginDetectorRegion(); embregIt!=embManager->endDetectorRegion(); ++embregIt) {
150 caloMgr->
add(embDescr);
153 double z_min = 10000.;
154 double z_max = -10000.;
155 double r_min = 10000.;
156 double r_max = -10000.;
158 double reg_min = 10000.;
159 double reg_max = -10000.;
161 std::vector<double> depth_in;
162 std::vector<double> depth_out;
172 , cellPtr->getSamplingIndex()
173 , cellPtr->getRegionIndex()
179 posShiftInd = cell_id->calo_cell_hash(chanId) - minHash;
180 elementPosShift.
dx = cellPosShift->
deltaX(posShiftInd);
181 elementPosShift.
dy = cellPosShift->
deltaY(posShiftInd);
182 elementPosShift.
dz = cellPosShift->
deltaZ(posShiftInd);
192 , cellPosShift ? &elementPosShift :
nullptr);
195 phi_min = embElement->
phi() - 0.5*embElement->
dphi();
200 phi_min = embElement->
phi() - 0.5*embElement->
dphi();
207 caloMgr->
add(embElement);
209 if(r_min > embElement->
r()-0.5*embElement->
dr())
210 r_min = embElement->
r()-0.5*embElement->
dr();
211 if(r_max < embElement->
r()+0.5*embElement->
dr())
212 r_max = embElement->
r()+0.5*embElement->
dr();
214 if(z_min > std::abs(embElement->
z_raw())-0.5*embElement->
dz())
215 z_min = std::abs(embElement->
z_raw())-0.5*embElement->
dz();
216 if(z_max < std::abs(embElement->
z_raw())+0.5*embElement->
dz())
217 z_max = std::abs(embElement->
z_raw())+0.5*embElement->
dz();
219 if(reg_min > embElement->
eta()-0.5*embElement->
deta())
220 reg_min = embElement->
eta()-0.5*embElement->
deta();
221 if(reg_max < embElement->
eta()+0.5*embElement->
deta())
222 reg_max = embElement->
eta()+0.5*embElement->
deta();
285 log << MSG::WARNING <<
"Could not get the EMECDetectorManager. No Calo Elements will be built for EMEC" <<
endmsg;
291 for (emecregIt=emecManager->beginDetectorRegion(); emecregIt!=emecManager->endDetectorRegion(); ++emecregIt) {
311 throw std::runtime_error(
"Wrong Endcap Index for EMEC region " +
std::to_string(endcapInd));
322 throw std::runtime_error(
"Wrong Radial Index for EMEC region " +
std::to_string(radialInd));
334 caloMgr->
add(emecDescr);
337 double z_min = 10000.;
338 double z_max = -10000.;
339 double r_min = 10000.;
340 double r_max = -10000.;
342 double reg_min = 10000.;
343 double reg_max = -10000.;
345 std::vector<double> depth_in;
346 std::vector<double> depth_out;
355 , cellPtr->getSamplingIndex()
356 , cellPtr->getRegionIndex()
362 posShiftInd = cell_id->calo_cell_hash(chanId) - minHash;
363 elementPosShift.
dx = cellPosShift->
deltaX(posShiftInd);
364 elementPosShift.
dy = cellPosShift->
deltaY(posShiftInd);
365 elementPosShift.
dz = cellPosShift->
deltaZ(posShiftInd);
375 , cellPosShift ? &elementPosShift :
nullptr);
376 if((cellPosShift &&
iPhi==0)
378 phi_min = emecElement->
phi() - 0.5*emecElement->
dphi();
383 caloMgr->
add(emecElement);
385 if(r_min > emecElement->
r()-0.5*emecElement->
dr())
386 r_min = emecElement->
r()-0.5*emecElement->
dr();
387 if(r_max < emecElement->
r()+0.5*emecElement->
dr())
388 r_max = emecElement->
r()+0.5*emecElement->
dr();
390 if(z_min > std::abs(emecElement->
z_raw())-0.5*emecElement->
dz())
391 z_min = std::abs(emecElement->
z_raw())-0.5*emecElement->
dz();
392 if(z_max < std::abs(emecElement->
z_raw())+0.5*emecElement->
dz())
393 z_max = std::abs(emecElement->
z_raw())+0.5*emecElement->
dz();
395 if(reg_min > emecElement->
eta()-0.5*emecElement->
deta())
396 reg_min = emecElement->
eta()-0.5*emecElement->
deta();
397 if(reg_max < emecElement->
eta()+0.5*emecElement->
deta())
398 reg_max = emecElement->
eta()+0.5*emecElement->
deta();
402 depth_in.push_back(std::abs(emecElement->
z_raw())-emecElement->
dz());
403 depth_out.push_back(std::abs(emecElement->
z_raw())+emecElement->
dz());
459 log << MSG::WARNING <<
"Could not get the HECDetectorManager. No Calo Elements will be built for HEC" <<
endmsg;
465 for (hecregIt=hecManager->beginDetectorRegion(); hecregIt!=hecManager->endDetectorRegion(); ++hecregIt) {
484 caloMgr->
add(hecDescr);
487 float z_min = 10000.f;
488 float z_max = -10000.f;
489 double r_min = 10000.;
490 double r_max = -10000.;
492 double reg_min = 10000.;
493 double reg_max = -10000.;
495 std::vector<double> depth_in;
496 std::vector<double> depth_out;
508 , cellPtr->getSamplingIndex()
509 , cellPtr->getRegionIndex()
515 posShiftInd = cell_id->calo_cell_hash(chanId) - minHash;
516 elementPosShift.
dx = cellPosShift->
deltaX(posShiftInd);
517 elementPosShift.
dy = cellPosShift->
deltaY(posShiftInd);
518 elementPosShift.
dz = cellPosShift->
deltaZ(posShiftInd);
528 , cellPosShift ? &elementPosShift :
nullptr);
530 if((cellPosShift &&
iPhi==0)
532 phi_min = hecElement->
phi() - 0.5*hecElement->
dphi();
538 caloMgr->
add(hecElement);
545 if(z_min > std::abs(hecElement->
z_raw())-hecElement->
dz())
546 z_min = std::abs(hecElement->
z_raw())-hecElement->
dz();
547 if(z_max < std::abs(hecElement->
z_raw())+hecElement->
dz())
548 z_max = std::abs(hecElement->
z_raw())+hecElement->
dz();
550 if(reg_min > hecElement->
eta()-0.5*hecElement->
deta())
551 reg_min = hecElement->
eta()-0.5*hecElement->
deta();
552 if(reg_max < hecElement->
eta()+0.5*hecElement->
deta())
553 reg_max = hecElement->
eta()+0.5*hecElement->
deta();
556 depth_in.push_back(std::abs(hecElement->
z_raw())-hecElement->
dz());
557 depth_out.push_back(std::abs(hecElement->
z_raw())+hecElement->
dz());
616 log << MSG::WARNING <<
"Could not get the FCALDetectorManager. No Calo Elements will be built for FCAL" <<
endmsg;
622 for (fcalmodIt=fcalManager->beginFCAL(); fcalmodIt!=fcalManager->endFCAL(); ++fcalmodIt) {
641 caloMgr->
add(fcalDescr);
643 double eta_min = 10000.;
644 double eta_max = -10000.;
645 double z_min = 10000.;
646 double z_max = -10000.;
647 double r_min = 10000.;
648 double r_max = -10000.;
650 double reg_min = 10000.;
651 double reg_max = -10000.;
653 std::vector<double> depth_in;
654 std::vector<double> depth_out;
659 for (fcaltileIt=fcalmodule->
beginTiles(); fcaltileIt!=fcalmodule->
endTiles(); ++fcaltileIt) {
662 , fcaltileIt->getIndexJ()
663 , fcaltileIt->getIndexI());
666 posShiftInd = cell_id->calo_cell_hash(chanId) - minHash;
667 elementPosShift.
dx = cellPosShift->
deltaX(posShiftInd);
668 elementPosShift.
dy = cellPosShift->
deltaY(posShiftInd);
669 elementPosShift.
dz = cellPosShift->
deltaZ(posShiftInd);
679 , cellPosShift ? &elementPosShift :
nullptr);
682 unsigned int numTubes = fcaltileIt->getNumTubes();
684 fcalElement->
set_volume(.5*sqrt(3)*numTubes*tubeSpacing*tubeSpacing*dz);
686 caloMgr->
add(fcalElement);
688 if(eta_min > std::abs(fcalElement->
eta_raw())-0.5*fcalElement->
deta())
689 eta_min = std::abs(fcalElement->
eta_raw())-0.5*fcalElement->
deta();
690 if(eta_max < std::abs(fcalElement->
eta_raw())+0.5*fcalElement->
deta())
691 eta_max = std::abs(fcalElement->
eta_raw())+0.5*fcalElement->
deta();
692 if(r_min > fcalElement->
r() - 0.5*fcalElement->
dr())
693 r_min = fcalElement->
r() - 0.5*fcalElement->
dr();
694 if(r_max < fcalElement->
r() + 0.5*fcalElement->
dr())
695 r_max = fcalElement->
r() + 0.5*fcalElement->
dr();
696 if(z_min > std::abs(fcalElement->
z_raw()) - 0.5*fcalElement->
dz())
697 z_min = std::abs(fcalElement->
z_raw()) - 0.5*fcalElement->
dz();
698 if(z_max < std::abs(fcalElement->
z_raw()) + 0.5*fcalElement->
dz())
699 z_max = std::abs(fcalElement->
z_raw()) + 0.5*fcalElement->
dz();
700 if(reg_min > fcalElement->
eta()-0.5*fcalElement->
deta())
701 reg_min = fcalElement->
eta()-0.5*fcalElement->
deta();
702 if(reg_max < fcalElement->
eta()+0.5*fcalElement->
deta())
703 reg_max = fcalElement->
eta()+0.5*fcalElement->
deta();
706 depth_in.push_back(std::abs(fcalElement->
z_raw()) - fcalElement->
dz());
707 depth_out.push_back(std::abs(fcalElement->
z_raw()) + fcalElement->
dz());
751 log << MSG::WARNING <<
"Could not get the TileDetectorManager. No Calo Elements will be built for Tile" <<
endmsg;
756 unsigned idHashMax = maxHash-minHash;
757 for(
unsigned int idhash=0; idhash < idHashMax; ++idhash) {
760 caloMgr->
add(newelt);
764 std::vector<CaloDetDescriptor*>::const_iterator itr = tile_mgr->calo_descriptors_begin();
765 std::vector<CaloDetDescriptor*>::const_iterator
end = tile_mgr->calo_descriptors_end();
767 for(; itr !=
end; ++itr) {
780 if(
detStore->retrieve(cDDEvec) == StatusCode::SUCCESS) {
float deta() const
cell deta
const EMBDetDescr * getDescriptor() const
Returns the Descriptor for this region.
Ensure that the extensions for the Vector3D are properly loaded.
unsigned int beginEtaIndex() const
Returns the first eta index in the region.
void setLArRegMin(double reg_min)
Set LAr Region Eta Min.
A manager class providing access to readout geometry information for the forward calorimeter.
GeoIntrusivePtr< const HECCell > HECCellConstLink
@Class: HECCellConstLink
EMECDetectorRegion::DetectorSide getEndcapIndex() const
The endcap index.
LAr EMEC Detector Element.
Smart Pointer to EMEC Cells. This reference counted link allocates on demand. It audits the total poi...
std::vector< const FCALModule * >::const_iterator ConstIterator
A manager class providing access to readout geometry information for the electromagnetic endcap calor...
unsigned int beginPhiIndex() const
returns the first phi index in the region.
Scalar eta() const
pseudorapidity method
void setLArPhiMin(double phi_min)
Set LAr Region Phi Min.
Identifier region_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
const CellBinning & getPhiBinning() const
The Binning in Phi.
dx,dy,dz displacement of the calorimeter cell caused by sagging
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
FCALModule::ConstIterator endTiles() const
Iteration over FCAL Tiles.
unsigned int getSamplingIndex() const
Returns the Sampling Layer Index.
unsigned int beginPhiIndex() const
returns the first phi index in the region.
void set_n_calo_depth(int n_calo_depth)
set number of calo depths
void setCaloEtaMin(double eta_min)
Set Eta Min.
void setLArRegMax(double reg_max)
Set LAr Region Eta Max.
unsigned int beginEtaIndex() const
returns the first eta index in the region.
IdentifierHash channel_hash(Identifier channelId) const
Convert a connected channel (cell) Identifier to a hash code.
Helper class for LArHEC offline identifiers.
unsigned int beginEtaIndex() const
returns the first eta index in the region.
void add(CaloDetDescrElement *element)
add Calo DD element to the elements vector
contType::size_type size_type
LAr subsystem specific descriptors.
LAr EMB Detector Element.
Identifier region_id(const ExpandedIdentifier &exp_id) const
region identifier for a channel from ExpandedIdentifier
unsigned int getRadialIndex() const
Returns the Radial (Outer Wheel=0,InnerWheel=1) Index.
Identifier channel_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
const CellBinning & getPhiBinning() const
The Binning in Phi.
GeoIntrusivePtr< const EMBCell > EMBCellConstLink
void set_lar_geometry(const std::string &geom)
set lar geometry label, distinguish between full atlas and TB
Definition of CaloDetDescrManager.
float eta_raw() const
cell eta_raw
void setCaloZMin(double z_min)
Set Z Min.
LAr HEC Detector Element.
unsigned int beginPhiIndex() const
Returns the first phi index in the region.
void set_volume(double volume)
set cell volume
unsigned int getRegionIndex() const
Returns the Region Index.
Container for a cell-level rescaling-factors, typically obtained by Z->ee intercalibration.
A manager class providing access to readout geometry information for the electromagnetic barrel calor...
IdentifierHash channel_hash(Identifier channelId) const
create hash id from channel id
const std::string & layout()
void setCaloEtaMax(double eta_max)
Set Eta Max.
This class initializes the Calo (LAr and Tile) offline identifiers.
msgSvc
Provide convenience handles for various services.
int n_phi() const
phi granularity
std::vector< FCALTile >::const_iterator ConstIterator
Description of a region of homogenous granularity in the hadronic endcap calorimeter.
void set_helper(const CaloCell_ID *idHelper)
set calo Cell ID helper
const CellBinning & getEtaBinning() const
The Binning in Eta.
::StatusCode StatusCode
StatusCode definition for legacy code.
double getFullDepthZ(const FCALTile &) const
Gets Tile (full) Depth.
LAr FCAL Detector Element.
Identifier channel_id(const ExpandedIdentifier &exp_id) const
cell identifier for a channel from ExpandedIdentifier
const EMECDetDescr * getDescriptor() const
Returns the Descriptor for this region.
void setCaloZMax(double z_max)
Set Z Max.
Identifier module_id(const ExpandedIdentifier &exp_id) const
module identifier for a channel from ExpandedIdentifier
Helper class for offline cell identifiers.
IdentifierHash channel_hash(Identifier channelId) const
create hash id from channel id
Stored in storegate. Provides access to EMB, EMEC, HEC and FCAL Detector Managers....
void set_depth_in(std::vector< double > &calo_depth)
set vector of in depths
A manager class providing access to readout geometry information for the hadronic endcap calorimeter.
const CellBinning & getEtaBinning() const
The Binning in Eta.
void add_tile(CaloDetDescriptor *descr)
add tile descriptor to the tile descriptors vector
HECDetectorRegion::DetectorSide getEndcapIndex() const
The endcap index.
FCALModule::Module getModuleIndex() const
Returns the Module (1,2, or 3)
double getFcalTubeSpacing(int sampling)
void setLArEtaMin(double eta_min)
Set LAr Region Phi Max.
float deltaZ(const size_type &hashID) const
const CellBinning & getEtaBinning() const
The Binning in Eta.
std::string to_string(const DetectorType &type)
unsigned int getSamplingIndex() const
Returns the Sampling Layer Index.
EMBDetectorRegion::DetectorSide getEndcapIndex() const
The endcap index.
void setCaloPhiMin(double phi_min)
Set Phi Min.
Identifier channel_id(const ExpandedIdentifier &exp_id) const
channel identifier for a channel from ExpandedIdentifier
EMBCellConstLink getEMBCell(unsigned int ieta, unsigned int iphi) const
Access to Cells.
float z_raw() const
cell z_raw
unsigned int getRegionIndex() const
Returns the Region Index.
void set_depth_out(std::vector< double > &calo_depth)
set vector of out depths
FCALModule::Endcap getEndcapIndex() const
Returns the side (O=Negative, 1=Positive)
float dphi() const
cell dphi
void setCaloPhiMax(double phi_max)
Set Phi Max.
EMECCellConstLink getEMECCell(unsigned int ieta, unsigned int iphi) const
Access to Cells.
const CellBinning & getPhiBinning() const
The Binning in Phi.
void setCaloRMin(double r_min)
Set R Min.
std::vector< const EMBDetectorRegion * >::const_iterator DetectorRegionConstIterator
HECCellConstLink getHECCell(unsigned int ieta, unsigned int iphi) const
Retrieve a cell with eta index and phi index.
std::unique_ptr< CaloDetDescrManager > buildCaloDetDescrNoAlign(ISvcLocator *svcLocator, IMessageSvc *msgSvc)
std::vector< const HECDetectorRegion * >::const_iterator DetectorRegionConstIterator
float eta() const
cell eta
Helper class for LArEM offline identifiers.
float phi() const
cell phi
const HECDetDescr * getDescriptor() const
Returns the Descriptor for this region.
void initialize()
initialization of the manager, used by the Converter when it creates the Manager
unsigned int getRegionIndex() const
Returns the Region Index.
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.
Helper class for LArFCAL offline identifiers.
setScale setgFexType iEta
double CellVolume(Identifier cell_id)
FCALModule::ConstIterator beginTiles() const
Iteration over FCAL Tiles.
std::unique_ptr< CaloDetDescrManager > buildCaloDetDescr(ISvcLocator *svcLocator, IMessageSvc *msgSvc, const GeoAlignmentStore *geoAlignStore, const CaloRec::CaloCellPositionShift *cellPosShift)
float deltaX(const size_type &hashID) const
unsigned int getSamplingIndex() const
Returns the Sampling Layer Index (0-3)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
std::vector< const EMECDetectorRegion * >::const_iterator DetectorRegionConstIterator
Container for a cell-level position corrections to account for distorsion of calo shape in reconstruc...
Calo Subsystem specific Detector Elements + Dummy element for testing.
float deltaY(const size_type &hashID) const