Skip to content

Commit ac10aee

Browse files
committed
remove unnecssary branch lookup
1 parent 5a31121 commit ac10aee

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,9 +1337,8 @@ public HelicityDecoderData getDataEntries_HelicityDecoder(EvioDataEvent event){
13371337
public List<DetectorDataDgtz> getDataEntries_Scalers(EvioDataEvent event){
13381338

13391339
List<DetectorDataDgtz> scalerEntries = new ArrayList<>();
1340-
for(EvioTreeBranch branch : branchList){
1341-
int crate = branch.getTag();
1342-
for(EvioNode node : branch.getNodes()){
1340+
for(int crate : branchMap.keySet()) {
1341+
for(EvioNode node : branchMap.get(crate).getNodes()){
13431342
if(node.getTag()==57637 || node.getTag()==57621){
13441343
int num = node.getNum();
13451344
int[] intData = ByteDataTransformer.toIntArray(node.getStructureBuffer(true));
@@ -1414,11 +1413,9 @@ else if(node.getTag()==57621 && loop>=5) {
14141413
}
14151414

14161415
public List<DetectorDataDgtz> getDataEntries_VTP(EvioDataEvent event){
1417-
14181416
List<DetectorDataDgtz> vtpEntries = new ArrayList<>();
1419-
for(EvioTreeBranch branch : branchList){
1420-
int crate = branch.getTag();
1421-
for(EvioNode node : branch.getNodes()){
1417+
for(int crate : branchMap.keySet()) {
1418+
for(EvioNode node : branchMap.get(crate).getNodes()){
14221419
if(node.getTag()==57634){
14231420
int[] intData = ByteDataTransformer.toIntArray(node.getStructureBuffer(true));
14241421
for(int loop = 0; loop < intData.length; loop++){
@@ -1439,13 +1436,9 @@ public List<DetectorDataDgtz> getDataEntries_VTP(EvioDataEvent event){
14391436
* @return
14401437
*/
14411438
public List<DetectorDataDgtz> getDataEntries_TDC(EvioDataEvent event){
1442-
14431439
List<DetectorDataDgtz> tdcEntries = new ArrayList<>();
1444-
1445-
for(EvioTreeBranch branch : branchList){
1446-
int crate = branch.getTag();
1447-
EvioTreeBranch cbranch = this.getEventBranch(branchList, branch.getTag());
1448-
for(EvioNode node : cbranch.getNodes()){
1440+
for(int crate : branchMap.keySet()) {
1441+
for(EvioNode node : branchMap.get(crate).getNodes()){
14491442
if(node.getTag()==57607){
14501443
int[] intData = ByteDataTransformer.toIntArray(node.getStructureBuffer(true));
14511444
for(int loop = 2; loop < intData.length; loop++){
@@ -1472,10 +1465,8 @@ public List<DetectorDataDgtz> getDataEntries_TDC(EvioDataEvent event){
14721465
public List<DetectorDataDgtz> getDataEntries_TI(EvioDataEvent event){
14731466

14741467
List<DetectorDataDgtz> tiEntries = new ArrayList<>();
1475-
for(EvioTreeBranch branch : branchList){
1476-
int crate = branch.getTag();
1477-
EvioTreeBranch cbranch = this.getEventBranch(branchList, branch.getTag());
1478-
for(EvioNode node : cbranch.getNodes()){
1468+
for(int crate : branchMap.keySet()) {
1469+
for(EvioNode node : branchMap.get(crate).getNodes()){
14791470
if(node.getTag()==57610){
14801471
long[] longData = ByteDataTransformer.toLongArray(node.getStructureBuffer(true));
14811472
int[] intData = ByteDataTransformer.toIntArray(node.getStructureBuffer(true));

0 commit comments

Comments
 (0)