58 ATH_MSG_DEBUG(
"TRT_StrawNeighbourSvc initialize method called");
60 if (StatusCode::SUCCESS!=
m_detStore.retrieve()) {
62 return StatusCode::FAILURE;
68 return StatusCode::FAILURE;
72 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};
74 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};
77 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};
79 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};
82 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};
84 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};
89 int chipIndexToChipHardware_A0[] = {2, 1, 3, 0, 6, 5, 7, 4, 10, 9, 11, 8};
90 int chipIndexToChipHardware_A8[] = {8, 11, 9, 10, 4, 7, 5, 6, 0, 3, 1, 2};
91 int chipIndexToChipHardware_C0[] = {1, 2, 0, 3, 5, 6, 4, 7, 9, 10, 8, 11};
92 int chipIndexToChipHardware_C8[] = {11, 8, 10, 9, 7, 4, 6, 5, 3, 0, 2, 1};
94 int *chip_list[] = {chipIndexToChipHardware_A0, chipIndexToChipHardware_A8, chipIndexToChipHardware_C0, chipIndexToChipHardware_C8};
95 for (
int i=0;
i<4;
i++)
for (
int j=0; j<12; j++) map_list[
i][j] = chip_list[
i][j];
102 SmartIF<IRDBAccessSvc> iAccessSvc{service(
"RDBAccessSvc")};
105 throw GaudiException(
"Could not initalize RDBAccessSvc",
"TRT_GeoModel",StatusCode::FAILURE);
108 SmartIF<IGeoModelSvc> geoModel{service(
"GeoModelSvc")};
111 throw GaudiException(
"Could not locate GeoModelSvc",
"TRT_GeoModel",StatusCode::FAILURE);
114 const std::string& detectorKey = versionKey.tag();
115 const std::string& detectorNode = versionKey.node();
116 IRDBRecordset_ptr RDB_TRTElec = iAccessSvc->getRecordsetPtr(
"TRTBarElecToStrawRel",detectorKey,detectorNode);
118 if (RDB_TRTElec->size()==0) {
119 RDB_TRTElec = iAccessSvc->getRecordsetPtr(
"TRTBarElecToStrawRel",
"TRTBarElecToStrawRel-02");
120 msg(MSG::INFO) <<
"The folder: InnerDetector->TRT->TRTBarrel->TRTBarrelElectronics not found in DetDesc tag. Using hardcoded tag: TRTBarElecToStrawRel-02" <<
endmsg;
126 const int numberOfm1layers=19;
127 const int numberOfm2layers=24;
128 const int numberOfm3layers=30;
130 int layer_m1_array[numberOfm1layers]= {15,16,16,16,16,17,17,17,17,17,18,18,18,18,18,19,19,19,18};
131 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};
132 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};
137 for (
i=0;
i<numberOfm1layers ;
i++){
139 acc +=layer_m1_array[
i];
144 for (
i=0;
i<numberOfm2layers;
i++){
146 acc +=layer_m2_array[
i];
151 for (
i=0;
i<numberOfm3layers;
i++){
153 acc +=layer_m3_array[
i];
164 int stnm=0, pad=0, previous_pad=1,
layer = 0, pad_rel_mod=0;
167 std::vector<std::vector<int> >
dummy1;
168 std::vector<int> dummy12;
169 std::vector<std::vector<int> >
dummy2;
171 std::vector<std::vector<int> >
dummy3;
172 std::vector<int> dummy32;
174 std::vector<std::vector<int> > dumdumdum1;
175 std::vector<std::vector<int> > dumdumdum2;
176 std::vector<std::vector<int> > dumdumdum3;
177 std::vector<int> dumdum ;
178 for (
unsigned int d =0;
d<=100;
d++ ) {
179 dumdumdum1.push_back(dumdum);
180 dumdumdum2.push_back(dumdum);
181 dumdumdum3.push_back(dumdum);
194 if (!(
layer==0))
break;
195 stnm = RDBVars__TRTElec->
getInt(
"STRAWNUM");
196 pad = RDBVars__TRTElec->
getInt(
"HVPADRELSTRAW");
197 pad_rel_mod = RDBVars__TRTElec->
getInt(
"HVPADRELMOD");
198 m_m1.push_back(pad_rel_mod);
199 if (pad==previous_pad) dummy12.push_back(stnm);
200 else if (pad != previous_pad) {
202 dummy1.push_back(dummy12);
204 dummy12.push_back(stnm);
206 chip=(RDBVars__TRTElec->
getDouble(
"CHIPRELSTRAW"));
208 (dumdumdum1[(
int)chip]).push_back(
straw+1);
221 if (!(
layer==1))
break;
222 stnm = RDBVars__TRTElec->
getInt(
"STRAWNUM");
223 pad = RDBVars__TRTElec->
getInt(
"HVPADRELSTRAW");
224 pad_rel_mod = RDBVars__TRTElec->
getInt(
"HVPADRELMOD");
225 m_m2.push_back(pad_rel_mod);
226 if (pad==previous_pad)
dummy22.push_back(stnm);
227 else if (pad != previous_pad) {
233 chip=(RDBVars__TRTElec->
getDouble(
"CHIPRELSTRAW"));
235 (dumdumdum2[(
int)chip]).push_back(
straw+1-329);
247 if (
straw>1641)
break;
250 if (!(
layer==2))
break;
251 stnm = RDBVars__TRTElec->
getInt(
"STRAWNUM");
252 pad = RDBVars__TRTElec->
getInt(
"HVPADRELSTRAW");
253 pad_rel_mod = RDBVars__TRTElec->
getInt(
"HVPADRELMOD");
254 m_m3.push_back(pad_rel_mod);
255 if (pad==previous_pad) dummy32.push_back(stnm);
256 else if (pad != previous_pad) {
258 dummy3.push_back(dummy32);
260 dummy32.push_back(stnm);
262 chip=(RDBVars__TRTElec->
getDouble(
"CHIPRELSTRAW"));
264 (dumdumdum3[(
int)chip]).push_back(
straw+1-329-520);
274 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");
278 int numberOfStraws[75] = {0,
302 int TripletOrientation[2][32] = {
315 for(
int j=0; j<2; j++)
316 for(
int jj=0; jj<32; jj++)
320 return StatusCode::SUCCESS;