ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TRT_CablingSvc Class Reference

#include <TRT_CablingSvc.h>

Inheritance diagram for TRT_CablingSvc:
Collaboration diagram for TRT_CablingSvc:

Public Member Functions

 TRT_CablingSvc (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~TRT_CablingSvc ()
 
virtual StatusCode initialize ()
 
Identifier getIdentifier (const eformat::SubDetector &subdetector, const unsigned &rod, const int &bufferOffset, IdentifierHash &hashId) const
 
uint32_t getBufferOffset (const Identifier &StrawId)
 
std::vector< uint32_t > getRobID (Identifier &id) const
 
const std::vector< uint32_t > & getAllRods () const
 

Private Attributes

const InDetDD::TRT_DetectorManagerm_manager
 
const TRT_IDm_idHelper
 
IdContext m_cntx
 
TRT_CablingDatam_cabling
 
TRT_FillCablingData_SR1_ECCm_cablingTool_SR1_ECC
 
TRT_FillCablingData_SR1m_cablingTool_SR1
 
TRT_FillCablingData_TB04m_cablingTool_TB
 
TRT_FillCablingData_DC1m_cablingTool_DC1
 
TRT_FillCablingData_DC2m_cablingTool_DC2
 
TRT_FillCablingData_DC3m_cablingTool_DC3
 
int m_TRTLayout
 
int m_numberOfStrawsInROD
 
int m_numberOfStrawsInBarrelROD
 
int m_shiftForLeftEndCapStraws
 
int m_shiftForLeftBarrelStraws
 
int m_shiftForRightBarrelStraws
 
int m_shiftForRightEndCapStraws
 

Detailed Description

Definition at line 36 of file TRT_CablingSvc.h.

Constructor & Destructor Documentation

◆ TRT_CablingSvc()

TRT_CablingSvc::TRT_CablingSvc ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 23 of file TRT_CablingSvc.cxx.

25  : base_class( name, pSvcLocator ),
26  m_manager ( nullptr ),
27  m_idHelper ( nullptr ),
28  m_cabling ( nullptr ),
29  m_cablingTool_SR1_ECC ( nullptr ),
30  m_cablingTool_SR1 ( nullptr ),
31  m_cablingTool_TB ( nullptr ),
32  m_cablingTool_DC1 ( nullptr ),
33  m_cablingTool_DC2 ( nullptr ),
34  m_cablingTool_DC3 ( nullptr ),
35  m_TRTLayout ( 0 ),
42 {
43  // declareInterface< ITRT_CablingSvc >( this );
44 }

◆ ~TRT_CablingSvc()

TRT_CablingSvc::~TRT_CablingSvc ( )
virtual

Definition at line 47 of file TRT_CablingSvc.cxx.

48 {}

Member Function Documentation

◆ getAllRods()

const std::vector< uint32_t > & TRT_CablingSvc::getAllRods ( ) const

Definition at line 271 of file TRT_CablingSvc.cxx.

272 {
273  return m_cabling->get_allRods();
274 }

◆ getBufferOffset()

uint32_t TRT_CablingSvc::getBufferOffset ( const Identifier StrawId)

Definition at line 253 of file TRT_CablingSvc.cxx.

254 {
255 
256  // DC3 Case
257  if ( m_TRTLayout == 6 )
258  {
259  return m_cabling->get_BufferOffset( StrawId );
260  }
261  else
262  {
263  ATH_MSG_FATAL( "TRT_CablingSvc::getBufferOffset called in invalid case !" );
264  assert(0);
265  }
266 
267  return 0;
268 }

◆ getIdentifier()

Identifier TRT_CablingSvc::getIdentifier ( const eformat::SubDetector &  subdetector,
const unsigned &  rod,
const int &  bufferOffset,
IdentifierHash hashId 
) const

Definition at line 199 of file TRT_CablingSvc.cxx.

202 {
203  int intRod = (int) rod;
204  int shift;
205 
206  // TB04, SR1 or DC3 Case
207  if ( m_TRTLayout == 1 || m_TRTLayout == 4 || m_TRTLayout == 5 || m_TRTLayout == 6 )
208  {
209  hashId = m_cabling->get_identifierHashForAllStraws(intRod, bufferOffset);
210  return m_cabling->get_identifierForAllStraws(intRod, bufferOffset);
211  }
212 
213  // DC1, DC2 Case
214  int straw = bufferOffset;
215  if (subdetector == eformat::TRT_ENDCAP_A_SIDE)
216  {
218  intRod * m_numberOfStrawsInROD + straw;
219  hashId = m_cabling->get_identifierHashForAllStraws(shift);
220  return m_cabling->get_identifierForAllStraws(shift);
221  }
222 
223  if (subdetector == eformat::TRT_BARREL_A_SIDE)
224  {
225  shift = m_shiftForLeftBarrelStraws +
227  hashId = m_cabling->get_identifierHashForAllStraws(shift);
228  return m_cabling->get_identifierForAllStraws(shift);
229  }
230 
231  if (subdetector == eformat::TRT_BARREL_C_SIDE)
232  {
235  hashId = m_cabling->get_identifierHashForAllStraws(shift);
236  return m_cabling->get_identifierForAllStraws(shift);
237  }
238 
240  intRod * m_numberOfStrawsInROD + straw;
241  hashId = m_cabling->get_identifierHashForAllStraws(shift);
242  return m_cabling->get_identifierForAllStraws(shift);
243 
244 }

◆ getRobID()

std::vector< uint32_t > TRT_CablingSvc::getRobID ( Identifier id) const

Definition at line 156 of file TRT_CablingSvc.cxx.

157 {
158 
159  // TB Case
160  if (m_TRTLayout == 1)
161  {
162  return m_cablingTool_TB->getRobID(id);
163  }
164  // DC1 Case
165  else if (m_TRTLayout == 2)
166  {
167  return m_cablingTool_DC1->getRobID(id);
168  }
169  // DC2
170  else if ( m_TRTLayout == 3 )
171  {
172  return m_cablingTool_DC2->getRobID(id);
173  }
174  // SR1 Barrel
175  else if ( m_TRTLayout == 4 )
176  {
177  return m_cablingTool_SR1->getRobID( id );
178  }
179  // SR1 EC C
180  else if ( m_TRTLayout == 5 )
181  {
182  return m_cablingTool_SR1_ECC->getRobID( id );
183  }
184  // DC3
185  else if ( m_TRTLayout == 6 )
186  {
187  return m_cablingTool_DC3->getRobID(id);
188  }
189  else
190  {
191  // std::vector<uint32_t> *vint = new std::vector<uint32_t>;
192  // return *vint;
193 
194  std::vector<uint32_t> v;
195  return v;
196  }
197 }

◆ initialize()

StatusCode TRT_CablingSvc::initialize ( )
virtual

Definition at line 53 of file TRT_CablingSvc.cxx.

54 {
55  StatusCode sc;
56  ATH_MSG_INFO( "TRT_CablingSvc::initialize" );
57 
58  // Retrieve Detector Store
59  ServiceHandle<StoreGateSvc> detStore("DetectorStore",name());
60  if (detStore.retrieve().isFailure())
61  {
62  ATH_MSG_FATAL( "Detector service not found !" );
63  return StatusCode::FAILURE;
64  }
65 
66 
67  // Retrieve detector manager
68  sc = detStore->retrieve(m_manager,"TRT");
69  if (sc.isFailure()) {
70  ATH_MSG_FATAL( "Cannot retrieve TRT_DetectorManager!" );
71  return StatusCode::FAILURE;
72  }
73 
74  // Get the TRT Helper
75  if (detStore->retrieve(m_idHelper, "TRT_ID").isFailure())
76  {
77  ATH_MSG_FATAL( "Could not get TRT ID helper" );
78  return StatusCode::FAILURE;
79  }
81 
82  // Get ToolSvc
83  SmartIF<IToolSvc> toolSvc{service("ToolSvc")};
84  ATH_CHECK( toolSvc.isValid() );
85 
86  // Get tool for filling of cabling data
87  std::string toolType;
88  if (m_manager->getLayout()=="TestBeam")
89  {
90  m_TRTLayout = 1;
91  toolType = "TRT_FillCablingData_TB04";
92  ATH_MSG_INFO( "TRT TB04 Cabling" );
93  if(StatusCode::SUCCESS !=toolSvc->retrieveTool(toolType,m_cablingTool_TB))
94  {
95  ATH_MSG_ERROR( " Can't get TRT_FillCablingData_TB04 tool " );
96  return StatusCode::FAILURE;
97  }
99  }
100  // DC1
101  else if ((m_manager->getLayout() == "Initial") ||
102  (m_manager->getLayout() == "Final") )
103  {
104  m_TRTLayout = 6;
105  toolType = "TRT_FillCablingData_DC3";
106  ATH_MSG_INFO( "TRT DC3 Cabling" );
107  if( StatusCode::SUCCESS !=
108  toolSvc->retrieveTool(toolType,m_cablingTool_DC3) )
109  {
110  ATH_MSG_ERROR( " Can't get TRT_FillCablingData_DC3 tool " );
111  return StatusCode::FAILURE;
112  }
113 
115 
116  }
117  else if ( m_manager->getLayout()=="SR1" ) // SR1 Barrel cosmics layout
118  {
119  m_TRTLayout = 4;
120  toolType = "TRT_FillCablingData_SR1";
121  ATH_MSG_INFO( "TRT SR1 Cabling" );
122  if(StatusCode::SUCCESS !=toolSvc->retrieveTool(toolType,m_cablingTool_SR1))
123  {
124  ATH_MSG_ERROR( " Can't get TRT_FillCablingData_SR1 tool " );
125  return StatusCode::FAILURE;
126  }
127 
129  }
130  else if ( m_manager->getLayout()=="SR1-EndcapC" ) // SR1 EC C cosmics layout
131  {
132  m_TRTLayout = 5;
133  toolType = "TRT_FillCablingData_SR1_ECC";
134  ATH_MSG_INFO( "TRT SR1 Cabling" );
135  if( StatusCode::SUCCESS !=
136  toolSvc->retrieveTool(toolType,m_cablingTool_SR1_ECC) )
137  {
138  ATH_MSG_ERROR( " Can't get TRT_FillCablingData_SR1_ECC tool " );
139  return StatusCode::FAILURE;
140  }
141 
143  }
144  else
145  {
146  ATH_MSG_FATAL( " Layout is not defined for TRT_FillCablingData (" << m_manager->getLayout() << ")! " );
147  return StatusCode::FAILURE;
148  }
149 
150  ATH_MSG_INFO( "TRT_CablingSvc::initializiation finished" );
151 
152  return sc;
153 }

Member Data Documentation

◆ m_cabling

TRT_CablingData* TRT_CablingSvc::m_cabling
private

Definition at line 69 of file TRT_CablingSvc.h.

◆ m_cablingTool_DC1

TRT_FillCablingData_DC1* TRT_CablingSvc::m_cablingTool_DC1
private

Definition at line 74 of file TRT_CablingSvc.h.

◆ m_cablingTool_DC2

TRT_FillCablingData_DC2* TRT_CablingSvc::m_cablingTool_DC2
private

Definition at line 75 of file TRT_CablingSvc.h.

◆ m_cablingTool_DC3

TRT_FillCablingData_DC3* TRT_CablingSvc::m_cablingTool_DC3
private

Definition at line 76 of file TRT_CablingSvc.h.

◆ m_cablingTool_SR1

TRT_FillCablingData_SR1* TRT_CablingSvc::m_cablingTool_SR1
private

Definition at line 72 of file TRT_CablingSvc.h.

◆ m_cablingTool_SR1_ECC

TRT_FillCablingData_SR1_ECC* TRT_CablingSvc::m_cablingTool_SR1_ECC
private

Definition at line 71 of file TRT_CablingSvc.h.

◆ m_cablingTool_TB

TRT_FillCablingData_TB04* TRT_CablingSvc::m_cablingTool_TB
private

Definition at line 73 of file TRT_CablingSvc.h.

◆ m_cntx

IdContext TRT_CablingSvc::m_cntx
private

Definition at line 68 of file TRT_CablingSvc.h.

◆ m_idHelper

const TRT_ID* TRT_CablingSvc::m_idHelper
private

Definition at line 67 of file TRT_CablingSvc.h.

◆ m_manager

const InDetDD::TRT_DetectorManager* TRT_CablingSvc::m_manager
private

Definition at line 66 of file TRT_CablingSvc.h.

◆ m_numberOfStrawsInBarrelROD

int TRT_CablingSvc::m_numberOfStrawsInBarrelROD
private

Definition at line 81 of file TRT_CablingSvc.h.

◆ m_numberOfStrawsInROD

int TRT_CablingSvc::m_numberOfStrawsInROD
private

Definition at line 80 of file TRT_CablingSvc.h.

◆ m_shiftForLeftBarrelStraws

int TRT_CablingSvc::m_shiftForLeftBarrelStraws
private

Definition at line 83 of file TRT_CablingSvc.h.

◆ m_shiftForLeftEndCapStraws

int TRT_CablingSvc::m_shiftForLeftEndCapStraws
private

Definition at line 82 of file TRT_CablingSvc.h.

◆ m_shiftForRightBarrelStraws

int TRT_CablingSvc::m_shiftForRightBarrelStraws
private

Definition at line 84 of file TRT_CablingSvc.h.

◆ m_shiftForRightEndCapStraws

int TRT_CablingSvc::m_shiftForRightEndCapStraws
private

Definition at line 85 of file TRT_CablingSvc.h.

◆ m_TRTLayout

int TRT_CablingSvc::m_TRTLayout
private

Definition at line 77 of file TRT_CablingSvc.h.


The documentation for this class was generated from the following files:
TRT_CablingSvc::m_cablingTool_SR1
TRT_FillCablingData_SR1 * m_cablingTool_SR1
Definition: TRT_CablingSvc.h:72
TRT_FillCablingData_TB04::fillData
TRT_CablingData * fillData()
Definition: TRT_FillCablingData_TB04.cxx:100
TRT_FillCablingData_DC3::fillData
TRT_CablingData * fillData()
Definition: TRT_FillCablingData_DC3.cxx:135
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TRT::Hit::straw
@ straw
Definition: HitInfo.h:82
TRT_CablingSvc::m_numberOfStrawsInROD
int m_numberOfStrawsInROD
Definition: TRT_CablingSvc.h:80
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TRT_CablingSvc::m_shiftForLeftBarrelStraws
int m_shiftForLeftBarrelStraws
Definition: TRT_CablingSvc.h:83
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TRT_CablingSvc::m_cablingTool_SR1_ECC
TRT_FillCablingData_SR1_ECC * m_cablingTool_SR1_ECC
Definition: TRT_CablingSvc.h:71
TRT_FillCablingData_TB04::getRobID
std::vector< uint32_t > getRobID(Identifier id) const
Definition: TRT_FillCablingData_TB04.cxx:407
TRT_CablingSvc::m_manager
const InDetDD::TRT_DetectorManager * m_manager
Definition: TRT_CablingSvc.h:66
TRT_CablingData::get_allRods
const std::vector< uint32_t > & get_allRods() const
Definition: TRT_CablingData.cxx:187
TRT_CablingSvc::m_cablingTool_DC3
TRT_FillCablingData_DC3 * m_cablingTool_DC3
Definition: TRT_CablingSvc.h:76
TRT_FillCablingData_SR1::getRobID
std::vector< uint32_t > getRobID(Identifier id) const
Definition: TRT_FillCablingData_SR1.cxx:987
TRT_CablingSvc::m_cablingTool_DC2
TRT_FillCablingData_DC2 * m_cablingTool_DC2
Definition: TRT_CablingSvc.h:75
TRT_FillCablingData_DC3::getRobID
std::vector< uint32_t > getRobID(Identifier id) const
Definition: TRT_FillCablingData_DC3.cxx:1980
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TRT_CablingData::get_identifierHashForAllStraws
IdentifierHash get_identifierHashForAllStraws(int rod, int bufferPosition) const
Definition: TRT_CablingData.cxx:127
TRT_CablingData::get_BufferOffset
uint32_t get_BufferOffset(Identifier StrawId)
Definition: TRT_CablingData.cxx:146
TRT_FillCablingData_SR1::fillData
TRT_CablingData * fillData()
Definition: TRT_FillCablingData_SR1.cxx:96
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TRT_ID::straw_layer_context
IdContext straw_layer_context(void) const
straw_layer id
Definition: TRT_ID.h:713
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDetDD::InDetDetectorManager::getLayout
const std::string & getLayout() const
Definition: InDetDetectorManager.cxx:38
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TRT_CablingSvc::m_shiftForRightEndCapStraws
int m_shiftForRightEndCapStraws
Definition: TRT_CablingSvc.h:85
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
TRT_CablingSvc::m_cablingTool_TB
TRT_FillCablingData_TB04 * m_cablingTool_TB
Definition: TRT_CablingSvc.h:73
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TRT_CablingSvc::m_cabling
TRT_CablingData * m_cabling
Definition: TRT_CablingSvc.h:69
TRT_CablingData::get_identifierForAllStraws
Identifier get_identifierForAllStraws(int rod, int bufferPosition) const
Definition: TRT_CablingData.cxx:120
python.PyAthena.v
v
Definition: PyAthena.py:154
TRT_FillCablingData_DC2::getRobID
std::vector< uint32_t > getRobID(Identifier &id) const
Definition: TRT_FillCablingData_DC2.cxx:788
TRT_CablingSvc::m_cntx
IdContext m_cntx
Definition: TRT_CablingSvc.h:68
TRT_CablingSvc::m_numberOfStrawsInBarrelROD
int m_numberOfStrawsInBarrelROD
Definition: TRT_CablingSvc.h:81
TRT_FillCablingData_SR1_ECC::fillData
TRT_CablingData * fillData()
Definition: TRT_FillCablingData_SR1_ECC.cxx:101
TRT_CablingSvc::m_cablingTool_DC1
TRT_FillCablingData_DC1 * m_cablingTool_DC1
Definition: TRT_CablingSvc.h:74
TRT_CablingSvc::m_TRTLayout
int m_TRTLayout
Definition: TRT_CablingSvc.h:77
TRT_CablingSvc::m_shiftForRightBarrelStraws
int m_shiftForRightBarrelStraws
Definition: TRT_CablingSvc.h:84
TRT_FillCablingData_SR1_ECC::getRobID
std::vector< uint32_t > getRobID(Identifier id) const
Definition: TRT_FillCablingData_SR1_ECC.cxx:1103
TRT_CablingSvc::m_shiftForLeftEndCapStraws
int m_shiftForLeftEndCapStraws
Definition: TRT_CablingSvc.h:82
TRT_FillCablingData_DC1::getRobID
std::vector< uint32_t > getRobID(Identifier &id) const
Definition: TRT_FillCablingData_DC1.cxx:786
ServiceHandle< StoreGateSvc >
TRT_CablingSvc::m_idHelper
const TRT_ID * m_idHelper
Definition: TRT_CablingSvc.h:67