59 ATH_MSG_DEBUG(
"TRT_StrawNeighbourSvc initialize method called");
61 if (StatusCode::SUCCESS!=
m_detStore.retrieve()) {
63 return StatusCode::FAILURE;
69 return StatusCode::FAILURE;
73 int chipConversionSocketToChip_m1[]={0,1,2,3,4,21,7,6,5,20,19,8,9,16,17,18,10,15,14,13,12,11};
75 int chipConversionChipToSocket_m1[] = {0,1,2,3,4,8,7,6,11,12,16,21,20,19,18,17,13,14,15,10,9,5};
78 int chipConversionSocketToChip_m2[] = {0,5,4,3,2,1,33,6,7,8,9,32,31,12,11,10,27,28,29,30,13,14,26,25,24,23,22,15,16,17,18,19,20,21};
80 int chipConversionChipToSocket_m2[] = {0,5,4,3,2,1,7,8,9,10,15,14,13,20,21,27,28,29,30,31,32,33,26,25,24,23,22,16,17,18,19,12,11,6};
83 int chipConversionSocketToChip_m3[] = {0,1,2,3,4,5,6,50,11,10,9,8,7,49,12,13,14,15,48,47,46,18,17,16,42,43,44,45,19,20,41,40,39,38,37,22,21,31,32,33,34,35,36,23,30,29,28,27,26,25,24};
85 int chipConversionChipToSocket_m3[] = {0,1,2,3,4,5,6,12,11,10,9,8,14,15,16,17,23,22,21,28,29,36,35,43,50,49,48,47,46,45,44,37,38,39,40,41,42,34,33,32,31,30,24,25,26,27,20,19,18,13,7};
90 int chipIndexToChipHardware_A0[] = {2, 1, 3, 0, 6, 5, 7, 4, 10, 9, 11, 8};
91 int chipIndexToChipHardware_A8[] = {8, 11, 9, 10, 4, 7, 5, 6, 0, 3, 1, 2};
92 int chipIndexToChipHardware_C0[] = {1, 2, 0, 3, 5, 6, 4, 7, 9, 10, 8, 11};
93 int chipIndexToChipHardware_C8[] = {11, 8, 10, 9, 7, 4, 6, 5, 3, 0, 2, 1};
95 int *chip_list[] = {chipIndexToChipHardware_A0, chipIndexToChipHardware_A8, chipIndexToChipHardware_C0, chipIndexToChipHardware_C8};
96 for (
int i=0;
i<4;
i++)
for (
int j=0; j<12; j++) map_list[
i][j] = chip_list[
i][j];
103 ISvcLocator* svcLocator = Gaudi::svcLocator();
106 if (
result.isFailure() || iAccessSvc ==
nullptr ) {
108 throw GaudiException(
"Could not initalize RDBAccessSvc",
"TRT_GeoModel",StatusCode::FAILURE);
112 result = svcLocator->service (
"GeoModelSvc",geoModel);
113 if (
result.isFailure()) {
115 throw GaudiException(
"Could not locate GeoModelSvc",
"TRT_GeoModel",StatusCode::FAILURE);
118 const std::string& detectorKey = versionKey.tag();
119 const std::string& detectorNode = versionKey.node();
122 if (RDB_TRTElec->size()==0) {
123 RDB_TRTElec = iAccessSvc->
getRecordsetPtr(
"TRTBarElecToStrawRel",
"TRTBarElecToStrawRel-02");
124 msg(MSG::INFO) <<
"The folder: InnerDetector->TRT->TRTBarrel->TRTBarrelElectronics not found in DetDesc tag. Using hardcoded tag: TRTBarElecToStrawRel-02" <<
endmsg;
130 const int numberOfm1layers=19;
131 const int numberOfm2layers=24;
132 const int numberOfm3layers=30;
134 int layer_m1_array[numberOfm1layers]= {15,16,16,16,16,17,17,17,17,17,18,18,18,18,18,19,19,19,18};
135 int layer_m2_array[numberOfm2layers]= {19,20,20,20,20,20,21,21,21,21,21,22,22,22,22,22,23,23,23,23,23,24,24,23};
136 int layer_m3_array[numberOfm3layers]= {23,24,24,24,24,25,25,25,25,25,26,26,26,26,26,27,27,27,27,27,28,28,28,28,28,29,29,29,29,28};
141 for (
i=0;
i<numberOfm1layers ;
i++){
143 acc +=layer_m1_array[
i];
148 for (
i=0;
i<numberOfm2layers;
i++){
150 acc +=layer_m2_array[
i];
155 for (
i=0;
i<numberOfm3layers;
i++){
157 acc +=layer_m3_array[
i];
168 int stnm=0, pad=0, previous_pad=1,
layer = 0, pad_rel_mod=0;
171 std::vector<std::vector<int> >
dummy1;
172 std::vector<int> dummy12;
173 std::vector<std::vector<int> >
dummy2;
175 std::vector<std::vector<int> >
dummy3;
176 std::vector<int> dummy32;
178 std::vector<std::vector<int> > dumdumdum1;
179 std::vector<std::vector<int> > dumdumdum2;
180 std::vector<std::vector<int> > dumdumdum3;
181 std::vector<int> dumdum ;
182 for (
unsigned int d =0;
d<=100;
d++ ) {
183 dumdumdum1.push_back(dumdum);
184 dumdumdum2.push_back(dumdum);
185 dumdumdum3.push_back(dumdum);
198 if (!(
layer==0))
break;
199 stnm = RDBVars__TRTElec->
getInt(
"STRAWNUM");
200 pad = RDBVars__TRTElec->
getInt(
"HVPADRELSTRAW");
201 pad_rel_mod = RDBVars__TRTElec->
getInt(
"HVPADRELMOD");
202 m_m1.push_back(pad_rel_mod);
203 if (pad==previous_pad) dummy12.push_back(stnm);
204 else if (pad != previous_pad) {
206 dummy1.push_back(dummy12);
208 dummy12.push_back(stnm);
210 chip=(RDBVars__TRTElec->
getDouble(
"CHIPRELSTRAW"));
212 (dumdumdum1[(
int)chip]).push_back(
straw+1);
225 if (!(
layer==1))
break;
226 stnm = RDBVars__TRTElec->
getInt(
"STRAWNUM");
227 pad = RDBVars__TRTElec->
getInt(
"HVPADRELSTRAW");
228 pad_rel_mod = RDBVars__TRTElec->
getInt(
"HVPADRELMOD");
229 m_m2.push_back(pad_rel_mod);
230 if (pad==previous_pad)
dummy22.push_back(stnm);
231 else if (pad != previous_pad) {
237 chip=(RDBVars__TRTElec->
getDouble(
"CHIPRELSTRAW"));
239 (dumdumdum2[(
int)chip]).push_back(
straw+1-329);
251 if (
straw>1641)
break;
254 if (!(
layer==2))
break;
255 stnm = RDBVars__TRTElec->
getInt(
"STRAWNUM");
256 pad = RDBVars__TRTElec->
getInt(
"HVPADRELSTRAW");
257 pad_rel_mod = RDBVars__TRTElec->
getInt(
"HVPADRELMOD");
258 m_m3.push_back(pad_rel_mod);
259 if (pad==previous_pad) dummy32.push_back(stnm);
260 else if (pad != previous_pad) {
262 dummy3.push_back(dummy32);
264 dummy32.push_back(stnm);
266 chip=(RDBVars__TRTElec->
getDouble(
"CHIPRELSTRAW"));
268 (dumdumdum3[(
int)chip]).push_back(
straw+1-329-520);
278 if (!((
m_m1.size()==330)&&(
m_m2.size()==521)&&(
m_m3.size()==794) ))
ATH_MSG_WARNING(
"Initialization of TRT_StrawNeighbourTool incomplete. Depending on usage, this can give rise to runtime problems");
282 int numberOfStraws[75] = {0,
306 int TripletOrientation[2][32] = {
319 for(
int j=0; j<2; j++)
320 for(
int jj=0; jj<32; jj++)
324 return StatusCode::SUCCESS;