From 26bf77ecd71011fd73ccc624e774e95c1ea37f35 Mon Sep 17 00:00:00 2001 From: Raffaella De Vita Date: Mon, 12 Feb 2024 14:51:26 -0500 Subject: [PATCH 1/3] fixed bug in uRwell strip factory causing R2 strips not being created when the 2 region configuration was selected, changed uRWell service to always load the 2 region configuration --- .../org/jlab/detector/geant4/v2/URWELL/URWellStripFactory.java | 2 +- .../src/main/java/org/jlab/service/urwell/URWellEngine.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common-tools/clas-jcsg/src/main/java/org/jlab/detector/geant4/v2/URWELL/URWellStripFactory.java b/common-tools/clas-jcsg/src/main/java/org/jlab/detector/geant4/v2/URWELL/URWellStripFactory.java index 32683bf98..a7ec2edb5 100644 --- a/common-tools/clas-jcsg/src/main/java/org/jlab/detector/geant4/v2/URWELL/URWellStripFactory.java +++ b/common-tools/clas-jcsg/src/main/java/org/jlab/detector/geant4/v2/URWELL/URWellStripFactory.java @@ -74,7 +74,7 @@ public void init(DatabaseConstantProvider cp, boolean prototype, int regions) { factory = new URWellGeant4Factory(cp, prototype, regions); isProto = prototype; if(!isProto){ - nRegions = URWellConstants.NREGIONS; + nRegions = Math.min(URWellConstants.NMAXREGIONS, regions); nSectors = URWellConstants.NSECTORS; nChambers = URWellConstants.NCHAMBERS; nLayers = URWellConstants.NLAYERS; diff --git a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java index 15a338c75..1791ca21c 100644 --- a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java +++ b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java @@ -41,7 +41,7 @@ public boolean init() { // init ConstantsManager to read constants from CCDB String variationName = Optional.ofNullable(this.getEngineConfigString("variation")).orElse("default"); DatabaseConstantProvider cp = new DatabaseConstantProvider(11, variationName); - factory.init(cp); + factory.init(cp, false, 2); // register output banks for drop option this.registerOutputBank("URWELL::hits"); this.registerOutputBank("URWELL::clusters"); From af3abae3d8b3b7160c7b8fa0e09e82b57bb0ab3e Mon Sep 17 00:00:00 2001 From: Raffaella De Vita Date: Fri, 16 Feb 2024 14:45:40 -0500 Subject: [PATCH 2/3] setting number of layers/regions to maximum allowed --- .../src/main/java/org/jlab/service/urwell/URWellConstants.java | 3 ++- .../src/main/java/org/jlab/service/urwell/URWellEngine.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellConstants.java b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellConstants.java index 4c7ac644f..732c923fb 100644 --- a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellConstants.java +++ b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellConstants.java @@ -9,7 +9,8 @@ public class URWellConstants { // geometry public final static int NSECTOR = 6; - public final static int NLAYER = 2; + public final static int NLAYER = 4; + public final static int NREGION = 2; public final static int NCHAMBER = 3; public final static int[] NSTRIPS = { 542, 628, 714}; // number of strips for the three chambers public final static int[] STRIPMIN = { 1, 543, 1171}; // lower strip number diff --git a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java index 1791ca21c..3b1cff406 100644 --- a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java +++ b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java @@ -41,7 +41,7 @@ public boolean init() { // init ConstantsManager to read constants from CCDB String variationName = Optional.ofNullable(this.getEngineConfigString("variation")).orElse("default"); DatabaseConstantProvider cp = new DatabaseConstantProvider(11, variationName); - factory.init(cp, false, 2); + factory.init(cp, false, URWellConstants.NREGION); // register output banks for drop option this.registerOutputBank("URWELL::hits"); this.registerOutputBank("URWELL::clusters"); From 6154b7a83d1868f1d0a4f456122ec03b23fe68fd Mon Sep 17 00:00:00 2001 From: Raffaella De Vita Date: Mon, 19 Feb 2024 09:31:13 -0500 Subject: [PATCH 3/3] bug fixes to cross making for 2-regions configuration and banks --- etc/bankdefs/hipo4/urwell.json | 28 +++++++++---------- .../org/jlab/service/urwell/URWellCross.java | 12 ++++++-- .../org/jlab/service/urwell/URWellEngine.java | 3 +- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/etc/bankdefs/hipo4/urwell.json b/etc/bankdefs/hipo4/urwell.json index 63932105f..0981d24a0 100644 --- a/etc/bankdefs/hipo4/urwell.json +++ b/etc/bankdefs/hipo4/urwell.json @@ -7,10 +7,10 @@ "entries": [ {"name":"id", "type":"S", "info":"id of the hit"}, {"name":"sector", "type":"B", "info":"sector of URWELL"}, - {"name":"layer", "type":"B", "info":"Layer of URWELL (1-3:PCAL, 4-6:ECIN, 7-9:ECOUT"}, - {"name":"strip", "type":"S", "info":"Strip number"}, - {"name":"energy", "type":"F", "info":"Energy of the hit (eV)"}, - {"name":"time", "type":"F", "info":"Time of the hit (ns)"}, + {"name":"layer", "type":"B", "info":"layer of URWELL (1-3:PCAL, 4-6:ECIN, 7-9:ECOUT"}, + {"name":"strip", "type":"S", "info":"strip number"}, + {"name":"energy", "type":"F", "info":"energy of the hit (eV)"}, + {"name":"time", "type":"F", "info":"time of the hit (ns)"}, {"name":"clusterId", "type":"S", "info":"id of the cluster the hit belongs to"}, {"name":"status", "type":"S", "info":"status of the hit"} ] @@ -23,10 +23,10 @@ "entries": [ {"name":"id", "type":"S", "info":"id of the cluster"}, {"name":"sector", "type":"B", "info":"sector of URWELL"}, - {"name":"layer", "type":"B", "info":"Layer of URWELL"}, - {"name":"strip", "type":"S", "info":"Seed strip"}, - {"name":"energy", "type":"F", "info":"Energy of the cluster (eV)"}, - {"name":"time", "type":"F", "info":"Time of the cluster (ns)"}, + {"name":"layer", "type":"B", "info":"layer of URWELL"}, + {"name":"strip", "type":"S", "info":"seed strip"}, + {"name":"energy", "type":"F", "info":"energy of the cluster (eV)"}, + {"name":"time", "type":"F", "info":"time of the cluster (ns)"}, {"name":"xo", "type":"F", "info":"strip origin X coordinate (cm)"}, {"name":"yo", "type":"F", "info":"strip origin Y coordinate (cm)"}, {"name":"zo", "type":"F", "info":"strip origin Z coordinate (cm)"}, @@ -45,12 +45,12 @@ "entries": [ {"name":"id", "type":"S", "info":"id of the cross"}, {"name":"sector", "type":"B", "info":"sector of URWELL"}, - {"name":"layer", "type":"B", "info":"Layer of URWELL"}, - {"name":"energy", "type":"F", "info":"Energy of the cross (eV)"}, - {"name":"time", "type":"F", "info":"Time of the cross (ns)"}, - {"name":"x", "type":"F", "info":"X coordinate (cm)"}, - {"name":"y", "type":"F", "info":"Y coordinate (cm)"}, - {"name":"z", "type":"F", "info":"Z coordinate (cm)"}, + {"name":"region", "type":"B", "info":"region of URWELL"}, + {"name":"energy", "type":"F", "info":"energy of the cross (eV)"}, + {"name":"time", "type":"F", "info":"time of the cross (ns)"}, + {"name":"x", "type":"F", "info":"x coordinate (cm)"}, + {"name":"y", "type":"F", "info":"y coordinate (cm)"}, + {"name":"z", "type":"F", "info":"z coordinate (cm)"}, {"name":"cluster1", "type":"S", "info":"id of the cluster in the V layer"}, {"name":"cluster2", "type":"S", "info":"id of the cluster in the W layer"}, {"name":"status", "type":"S", "info":"status of the cluster"} diff --git a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellCross.java b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellCross.java index fb0189c8d..90fa1d2c4 100644 --- a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellCross.java +++ b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellCross.java @@ -15,6 +15,7 @@ public class URWellCross { private int id; private int sector; + private int region; private int chamber; private int cluster1; @@ -35,6 +36,7 @@ public URWellCross(URWellCluster c1, URWellCluster c2) { int nint = plane.intersectionSegment(c2.getLine(), point); if(nint==1) { this.sector = c1.getSector(); + this.region = (c1.getLayer()-1)/(URWellConstants.NLAYER/URWellConstants.NREGION)+1; this.cross = point; this.energy = c1.getEnergy() + c2.getEnergy(); this.time = (c1.getTime() + c2.getTime())/2; @@ -55,6 +57,10 @@ public int getSector() { return this.sector; } + public int getRegion() { + return this.region; + } + public int getChamber() { return this.chamber; } @@ -88,9 +94,9 @@ public static List createCrosses(List clusters) { List crosses = new ArrayList<>(); for(int is=0; is clustersV = URWellCluster.getClusters(clusters, is+1, il+1); - List clustersW = URWellCluster.getClusters(clusters, is+1, il+2); + for(int ir=0; ir clustersV = URWellCluster.getClusters(clusters, is+1, (URWellConstants.NLAYER/URWellConstants.NREGION)*ir+1); + List clustersW = URWellCluster.getClusters(clusters, is+1, (URWellConstants.NLAYER/URWellConstants.NREGION)*ir+2); for(URWellCluster v : clustersV) { for(URWellCluster w : clustersW) { diff --git a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java index 3b1cff406..fcb53c5ad 100644 --- a/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java +++ b/reconstruction/urwell/src/main/java/org/jlab/service/urwell/URWellEngine.java @@ -86,7 +86,7 @@ private void writeHipoBanks(DataEvent de, DataBank bankC = de.createBank("URWELL::clusters", clusters.size()); for(int c = 0; c < clusters.size(); c++){ - bankS.setShort("id", c, (short) clusters.get(c).getId()); + bankC.setShort("id", c, (short) clusters.get(c).getId()); bankC.setByte("sector", c, (byte) clusters.get(c).get(0).getDescriptor().getSector()); bankC.setByte("layer", c, (byte) clusters.get(c).get(0).getDescriptor().getLayer()); bankC.setShort("strip", c, (short) clusters.get(c).getMaxStrip()); @@ -106,6 +106,7 @@ private void writeHipoBanks(DataEvent de, for(int c = 0; c < crosses.size(); c++){ bankX.setShort("id", c, (short) crosses.get(c).getId()); bankX.setByte("sector", c, (byte) crosses.get(c).getSector()); + bankX.setByte("region", c, (byte) crosses.get(c).getRegion()); bankX.setFloat("energy", c, (float) crosses.get(c).getEnergy()); bankX.setFloat("time", c, (float) crosses.get(c).getTime()); bankX.setFloat("x", c, (float) crosses.get(c).point().x());