@@ -136,7 +136,7 @@ public void translate(List<DetectorDataDgtz> detectorData){
136136 tables .add (translationManager .getConstants (runNumber , name ));
137137 }
138138
139- for (DetectorDataDgtz data : detectorData ){
139+ for (DetectorDataDgtz data : detectorData ) {
140140
141141 int crate = data .getDescriptor ().getCrate ();
142142 int slot = data .getDescriptor ().getSlot ();
@@ -145,26 +145,24 @@ public void translate(List<DetectorDataDgtz> detectorData){
145145
146146 for (int j =0 ; j <tablesTrans .size (); ++j ) {
147147
148- IndexedTable table = tables .get (j );
148+ IndexedTable t = tables .get (j );
149+
150+ if (t .hasEntryByHash (hash )) {
149151
150- if (table .hasEntryByHash (hash )==true ){
151- int sector = table .getIntValueByHash ("sector" , hash );
152- int layer = table .getIntValueByHash ("layer" , hash );
153- int component = table .getIntValueByHash ("component" , hash );
154- int order = table .getIntValueByHash ("order" , hash );
152+ int sector = t .getIntValueByHash ("sector" , hash );
153+ int layer = t .getIntValueByHash ("layer" , hash );
154+ int component = t .getIntValueByHash ("component" , hash );
155+ int order = t .getIntValueByHash ("order" , hash );
155156
156157 data .getDescriptor ().setSectorLayerComponent (sector , layer , component );
157158 data .getDescriptor ().setOrder (order );
158159 data .getDescriptor ().setType (keysTrans .get (j ));
159160
160- for (int i = 0 ; i < data .getADCSize (); i ++) {
161- data .getADCData (i ).setOrder (order );
162- }
163- for (int i = 0 ; i < data .getTDCSize (); i ++) {
164- data .getTDCData (i ).setOrder (order );
165- }
161+ for (int i = 0 ; i < data .getADCSize (); i ++) data .getADCData (i ).setOrder (order );
162+ for (int i = 0 ; i < data .getTDCSize (); i ++) data .getTDCData (i ).setOrder (order );
166163
167- // crate/slot/channel must map to a unique detector:
164+ // Assume there's only one instance of this crate/slot/channel
165+ // in all translation tables, and we found it, so stop:
168166 break ;
169167 }
170168 }
0 commit comments