15#include "GeoModelKernel/GeoDefinitions.h"
20#define SYSTEM_OF_UNITS Gaudi::Units
26 ,
const std::map<std::string,unsigned>& trdMap
27 ,
const std::string& detKey
28 ,
const std::string& detNode)
30 MsgStream log(msgSvc,
"buildMbtsReadout");
39 StatusCode
sc = detStore->retrieve(tileTBID);
40 if(
sc.isFailure() || !tileTBID) {
41 log << MSG::ERROR <<
"Failed to initialize TileTBID" <<
endmsg;
47 log << MSG::ERROR <<
"No lar position record in the database" <<
endmsg;
48 return StatusCode::FAILURE;
52 double globalZMM = xfPos.translation().z() + zposMM;
58 for(
int side=0; side<2; side++) {
59 int sidesign = (side ? -1 : 1);
61 for(
unsigned int scinId=0; scinId<2; scinId++) {
63 double dx1Scin(0.), dzScin(0.), zposScin(0.), rposScin(0.), scineta(0.), scindeta(0.),
deltaPhi(0.), startPhi(0.);
65 if(mbtsGen->
size()==0) {
67 const IRDBRecord* curScin = (*mbtsScin)[scinId];
69 nScin = curScin->
getInt(
"SCINNUM");
71 dx1Scin = curScin->
getDouble(
"DX1")*SYSTEM_OF_UNITS::mm;
72 dzScin = curScin->
getDouble(
"DZ")*SYSTEM_OF_UNITS::mm;
73 zposScin = curScin->
getDouble(
"ZPOS")*SYSTEM_OF_UNITS::mm;
74 rposScin = curScin->
getDouble(
"RPOS")*SYSTEM_OF_UNITS::mm;
81 deltaPhi = 360.*SYSTEM_OF_UNITS::deg/nScin;
83 startPhi = curScin->
getDouble(
"STARTPHI");
88 std::string scinName = (scinId==0?
"MBTS1":
"MBTS2");
89 const IRDBRecord* curScin = (*mbtsTrds)[trdMap.at(scinName)];
90 nScin = (*mbtsGen)[0]->
getInt(
"NSCIN");
92 dx1Scin = curScin->
getDouble(
"DX1")*SYSTEM_OF_UNITS::mm;
93 dzScin = curScin->
getDouble(
"DZ")*SYSTEM_OF_UNITS::mm;
94 zposScin = (*mbtsGen)[0]->getDouble(
"ZPOSENV")*SYSTEM_OF_UNITS::mm;
95 rposScin = ((*mbtsGen)[0]->getDouble(
"RPOSENV")+curScin->
getDouble(
"ZPOS"))*SYSTEM_OF_UNITS::mm;
98 startPhi = (*mbtsGen)[0]->getDouble(
"STARTPHI");
99 deltaPhi = 360.*SYSTEM_OF_UNITS::deg/nScin;
107 mbtsDDE->
set_z((globalZMM + zposScin)*sidesign);
109 mbtsDDE->
set_r(rposScin);
117 mbtsManager->
add(mbtsDDE);
123 sc = detStore->record(mbtsManager,
"MBTS");
125 log << MSG::FATAL <<
"Failed to record MBTS Detector Manager into the DS" <<
endmsg;
Scalar eta() const
pseudorapidity method
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
Calo Subsystem specific Detector Elements + Dummy element for testing.
Definition of the abstract IRDBAccessSvc interface.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition of the abstract IRDBRecord interface.
Definition of the abstract IRDBRecordset interface.
Helper function for building readout geometry of the MBTS.
static const IRDBRecord * getTransformRecord(IRDBRecordset_ptr positionRecSet, const std::string &key)
static GeoTrf::Transform3D getTransform(const IRDBRecord *currentRec)
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
IRDBRecord is one record in the IRDBRecordset object.
virtual bool isFieldNull(const std::string &fieldName) const =0
Check if the field value is NULL.
virtual int getInt(const std::string &fieldName) const =0
Get int field value.
virtual double getDouble(const std::string &fieldName) const =0
Get double field value.
virtual unsigned int size() const =0
void add(CaloDetDescrElement *element)
void set_id(const Identifier &id)
void set_deta(double deta)
void set_dphi(double dphi)
The Athena Transient Store API.
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
Identifier channel_id(int type, int module, int channel) const
identifer for one channel of a Tile testbeam detector
StatusCode buildMbtsReadout(StoreGateSvc *detStore, IRDBAccessSvc *paramSvc, IMessageSvc *msgSvc, double zposMM, const std::map< std::string, unsigned > &trdMap, const std::string &detKey, const std::string &detNode)