-
Notifications
You must be signed in to change notification settings - Fork 26
RGH Recoil TOF geometry and reconstruction #921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
niwgit
wants to merge
12
commits into
JeffersonLab:development
Choose a base branch
from
niwgit:recoil_tof_reco
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d6dee06
Implementation of recoil TOF geometry for RGH
niwgit 4ae199c
Added TDC bank for recoil TOF, change horizontal opening angle and ra…
niwgit fb3828a
Initial implementation of reconstruction for RGH recoil TOF
niwgit 07835d5
Few changes related to positioning TOF plane and save global coordina…
niwgit 7f9c892
Added sector info to RECOILTOF::clusters bank
niwgit d11a68c
Change sign of rotation angle for coordinate transformation
niwgit 861539a
Change long bar length in recoil TOF 20 cm -> 27.5 cm
niwgit de0916a
Merge branch 'development' into recoil_tof_reco
c-dilks c7d4611
Match the coatjava version and corrected parent in pom.xml
niwgit 9d0557a
Fix dependencies in pom.xml
niwgit 173bbe8
Added few more dependencies
niwgit 70bc333
Remove unused dependencies
niwgit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...ls/clas-jcsg/src/main/java/org/jlab/detector/geant4/v2/recoil_tof/RecoilTOFConstants.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package org.jlab.detector.geant4.v2.recoil_tof; | ||
|
|
||
|
|
||
| import org.jlab.detector.calib.utils.DatabaseConstantProvider; | ||
| import org.jlab.geom.prim.Point3D; | ||
|
|
||
|
|
||
| public class RecoilTOFConstants { | ||
|
|
||
| public final static int NSECTORS = 2; //number of sectors | ||
| public final static int NROWS = 5; //number of rows of bars in a sector | ||
| public final static int NCOLUMNS = 63; //number of columns of bars in a sector | ||
|
|
||
| public final static double LONG_BAR_LENGTH = 27.5; // cm | ||
| public final static double SHORT_BAR_LENGTH = 4; // cm | ||
|
|
||
| public final static double BAR_WIDTH = 1; // cm | ||
| public final static double BAR_THICKNESS = 0.5; // cm | ||
|
|
||
| public final static double HORIZONTAL_STARTING_ANGLE = 40.; | ||
| public final static double HORIZONTAL_OPENING_ANGLE = 29.; | ||
| public final static double RADIUS = 122.; // cm | ||
|
|
||
| public final static double WIDTH = NCOLUMNS * BAR_WIDTH; | ||
| public final static double LENGTH = (NROWS-1) * LONG_BAR_LENGTH + SHORT_BAR_LENGTH; | ||
| public final static double THICKNESS = 0.5; // cm | ||
|
|
||
|
|
||
| public static DatabaseConstantProvider connect( DatabaseConstantProvider cp ) | ||
| { | ||
|
|
||
| load(cp ); | ||
| return cp; | ||
| } | ||
|
|
||
| /** | ||
| * Reads all the necessary constants from CCDB into static variables. | ||
| * Please use a DatabaseConstantProvider to access CCDB and load the following tables: | ||
| * @param cp a ConstantProvider that has loaded the necessary tables | ||
| */ | ||
|
|
||
| public static synchronized void load( DatabaseConstantProvider cp ) | ||
| { | ||
| //WIDTH = NCOLUMNS * BAR_WIDTH; | ||
| //LENGTH = (NROWS-1) * LONG_BAR_LENGTH + SHORT_BAR_LENGTH; | ||
| //THICKNESS = 0.5; // cm | ||
| } | ||
|
|
||
| } | ||
|
|
||
|
|
144 changes: 144 additions & 0 deletions
144
...las-jcsg/src/main/java/org/jlab/detector/geant4/v2/recoil_tof/RecoilTOFGeant4Factory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| package org.jlab.detector.geant4.v2.recoil_tof; | ||
|
|
||
| import eu.mihosoft.vrl.v3d.Vector3d; | ||
| import org.jlab.detector.geant4.v2.Geant4Factory; | ||
| import org.jlab.detector.volume.G4World; | ||
| import org.jlab.detector.volume.G4Box; | ||
| import org.jlab.detector.volume.Geant4Basic; | ||
| import org.jlab.detector.calib.utils.DatabaseConstantProvider; | ||
|
|
||
| /** | ||
| * Generate GEANT4 volume for the RECOIL TOF detector | ||
| * | ||
| * @author Nilanga Wickramaarachchi | ||
| */ | ||
| public final class RecoilTOFGeant4Factory extends Geant4Factory { | ||
|
|
||
| private int nSectors = RecoilTOFConstants.NSECTORS; | ||
| private int nRows = RecoilTOFConstants.NROWS; | ||
| private int nCols = RecoilTOFConstants.NCOLUMNS; | ||
|
|
||
| public RecoilTOFGeant4Factory( DatabaseConstantProvider cp) { | ||
| RecoilTOFConstants.connect(cp ); | ||
| this.init(cp); | ||
| } | ||
|
|
||
| public void init(DatabaseConstantProvider cp) { | ||
|
|
||
| motherVolume = new G4World("root"); | ||
|
|
||
| for (int isector = 0; isector < nSectors; isector++) { | ||
| Geant4Basic sectorVolume = createSector(isector, nRows, nCols); | ||
|
|
||
| sectorVolume.setName("recoil_tof_sector" + (isector + 1)); | ||
| sectorVolume.setMother(motherVolume); | ||
| } | ||
| } | ||
|
|
||
|
|
||
| public Vector3d getCenterCoordinate(int isector) | ||
| { | ||
| int is=isector; | ||
| Vector3d vCenter = new Vector3d(0, 0, 0); | ||
|
|
||
| vCenter.x = (-1+is*2)*(RecoilTOFConstants.RADIUS)*Math.sin(Math.toRadians(RecoilTOFConstants.HORIZONTAL_OPENING_ANGLE/2+RecoilTOFConstants.HORIZONTAL_STARTING_ANGLE)); | ||
| vCenter.y = 0; | ||
| vCenter.z =RecoilTOFConstants.RADIUS*Math.cos(Math.toRadians(RecoilTOFConstants.HORIZONTAL_OPENING_ANGLE/2+RecoilTOFConstants.HORIZONTAL_STARTING_ANGLE)); | ||
| return vCenter; | ||
| } | ||
|
|
||
|
|
||
|
|
||
| public Geant4Basic createSector(int isector, int nRows, int nCols ) { | ||
|
|
||
| double hlx = RecoilTOFConstants.WIDTH/2+1; | ||
| double hly = RecoilTOFConstants.LENGTH/2+1; | ||
| double hlz = RecoilTOFConstants.THICKNESS/2+1; | ||
|
|
||
| Vector3d vCenter = this.getCenterCoordinate(isector); | ||
|
|
||
| Geant4Basic sectorVolume = new G4Box("recoil_tof_sector" + (isector + 1), hlx, hly, hlz); | ||
|
|
||
| if(isector==0) sectorVolume.rotate("yxz",Math.toRadians((RecoilTOFConstants.HORIZONTAL_OPENING_ANGLE/2+RecoilTOFConstants.HORIZONTAL_STARTING_ANGLE)),0,0); | ||
| if(isector==1) sectorVolume.rotate("yxz",Math.toRadians(-(RecoilTOFConstants.HORIZONTAL_OPENING_ANGLE/2+RecoilTOFConstants.HORIZONTAL_STARTING_ANGLE)),0,0); | ||
| sectorVolume.translate(vCenter.x, vCenter.y, vCenter.z); | ||
| sectorVolume.setId(isector + 1, 0, 0); | ||
|
|
||
| // Bars construction | ||
| for (int row = 0; row < nRows; row++) { | ||
| for (int col = 0; col < nCols; col++) { | ||
|
|
||
| Geant4Basic barVolume = this.createBar(isector, row, col); | ||
|
|
||
| barVolume.setName("bar_sector" + (isector + 1) + "_row" + (row + 1) + "_column" + (col + 1)); | ||
|
|
||
| barVolume.setMother(sectorVolume); | ||
|
|
||
| barVolume.setId(isector + 1, row +1, col+1, 0); | ||
| } | ||
| } | ||
|
|
||
| return sectorVolume; | ||
| } | ||
|
|
||
|
|
||
| public Geant4Basic createBar(int iSector, int iRow, int iCol) { | ||
|
|
||
| int nCols = RecoilTOFConstants.NCOLUMNS; | ||
|
|
||
| double barDX = RecoilTOFConstants.BAR_WIDTH/2; | ||
| double barDY; | ||
|
|
||
| if (iRow == (nRows - 1) / 2) barDY = RecoilTOFConstants.SHORT_BAR_LENGTH/2; | ||
| else barDY = RecoilTOFConstants.LONG_BAR_LENGTH/2; | ||
|
|
||
| double barDZ = RecoilTOFConstants.BAR_THICKNESS/2; | ||
|
|
||
| Geant4Basic barVolume = new G4Box("bar_sector" + (iSector + 1) + "_row" + (iRow + 1) + "_column" + (iCol + 1), barDX, barDY, barDZ); | ||
|
|
||
| // Constants for positioning | ||
| double y_start = -(RecoilTOFConstants.LENGTH - RecoilTOFConstants.LONG_BAR_LENGTH)/2; // Starting Y position | ||
| double x_spacing = RecoilTOFConstants.BAR_WIDTH; | ||
| double x_start = -(RecoilTOFConstants.WIDTH - x_spacing)/2; // starting X position | ||
| double dy_long = RecoilTOFConstants.LONG_BAR_LENGTH; | ||
| double dy_short = RecoilTOFConstants.SHORT_BAR_LENGTH; | ||
|
|
||
| //Position calculation | ||
| double z_pos = 0; | ||
| double x_pos = x_start + (iCol * x_spacing); | ||
|
|
||
| double y_pos; | ||
| if(iRow < (nRows - 1) / 2) | ||
| { | ||
| y_pos = y_start + (iRow * dy_long); | ||
| } | ||
| else if (iRow == (nRows - 1) / 2) // middle row | ||
| { | ||
| y_pos = 0; | ||
| } | ||
| else | ||
| { | ||
| y_pos = y_start + (iRow -1) * dy_long + dy_short; | ||
| } | ||
|
|
||
| barVolume.setPosition(x_pos, y_pos, z_pos); | ||
|
|
||
| return barVolume; | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
| public static void main(String[] args) { | ||
| DatabaseConstantProvider cp = new DatabaseConstantProvider(11, "default"); | ||
|
|
||
| RecoilTOFConstants.connect(cp); | ||
|
|
||
| RecoilTOFGeant4Factory factory = new RecoilTOFGeant4Factory(cp); | ||
|
|
||
| factory.getAllVolumes().forEach(volume -> { | ||
| System.out.println(volume.gemcString()); | ||
| }); | ||
|
|
||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| [ | ||
| { | ||
| "name": "RECOILTOF::hits", | ||
| "group": 22700, | ||
| "item": 21, | ||
| "info": "Reconstructed RECOILTOF hits", | ||
| "entries": [ | ||
| { | ||
| "name": "id", | ||
| "type": "S", | ||
| "info": "hit id" | ||
| }, { | ||
| "name": "sector", | ||
| "type": "I", | ||
| "info": "recoil tof sector" | ||
| }, { | ||
| "name": "row", | ||
| "type": "I", | ||
| "info": "recoil tof row" | ||
| },{ | ||
| "name": "column", | ||
| "type": "I", | ||
| "info": "recoil tof column" | ||
| },{ | ||
| "name": "time", | ||
| "type": "F", | ||
| "info": "time in ns" | ||
| },{ | ||
| "name": "x", | ||
| "type": "F", | ||
| "info": "x position in mm" | ||
| }, { | ||
| "name": "y", | ||
| "type": "F", | ||
| "info": "y position in mm" | ||
| }, { | ||
| "name": "z", | ||
| "type": "F", | ||
| "info": "z position in mm" | ||
| },{ | ||
| "name": "energy", | ||
| "type": "F", | ||
| "info": "deposited energy in MeV" | ||
| },{ | ||
| "name": "clusterid", | ||
| "type": "S", | ||
| "info": "id of cluster to which the hit was associated" | ||
| } | ||
| ] | ||
| },{ | ||
| "name": "RECOILTOF::clusters", | ||
| "group": 22700, | ||
| "item": 22, | ||
| "info": "Clusters in RECOILTOF", | ||
| "entries": [ | ||
| { | ||
| "name": "id", | ||
| "type": "S", | ||
| "info": "hit id" | ||
| }, { | ||
| "name": "N_bar", | ||
| "type": "I", | ||
| "info": "number of hits from the bars" | ||
| },{ | ||
| "name": "sector", | ||
| "type": "I", | ||
| "info": "sector number" | ||
| },{ | ||
| "name": "time", | ||
| "type": "F", | ||
| "info": "time in ns" | ||
| },{ | ||
| "name": "x", | ||
| "type": "F", | ||
| "info": "x position in mm" | ||
| }, { | ||
| "name": "y", | ||
| "type": "F", | ||
| "info": "y position in mm" | ||
| }, { | ||
| "name": "z", | ||
| "type": "F", | ||
| "info": "z position in mm" | ||
| },{ | ||
| "name": "energy", | ||
| "type": "F", | ||
| "info": "energy in MeV" | ||
| } | ||
| ] | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <groupId>org.jlab.clas12.detector</groupId> | ||
| <artifactId>clas12detector-recoiltof</artifactId> | ||
| <version>13.4.0-SNAPSHOT</version> | ||
| <packaging>jar</packaging> | ||
|
|
||
| <parent> | ||
| <groupId>org.jlab.clas12</groupId> | ||
| <artifactId>reconstruction</artifactId> | ||
| <version>13.4.0-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <dependencies> | ||
|
|
||
| <dependency> | ||
| <groupId>org.jlab.clas</groupId> | ||
| <artifactId>clas-detector</artifactId> | ||
| <version>13.4.0-SNAPSHOT</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.jlab.clas</groupId> | ||
| <artifactId>clas-io</artifactId> | ||
| <version>13.4.0-SNAPSHOT</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.jlab.clas</groupId> | ||
| <artifactId>clas-geometry</artifactId> | ||
| <version>13.4.0-SNAPSHOT</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.jlab.clas</groupId> | ||
| <artifactId>clas-reco</artifactId> | ||
| <version>13.4.0-SNAPSHOT</version> | ||
| </dependency> | ||
|
|
||
| </dependencies> | ||
|
|
||
| </project> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.