Skip to content

Commit 06d8a7e

Browse files
imported muCLAS12/ddvcs reconstruction from ddvcs branch creating new dedicated mu package
1 parent f8f7fd8 commit 06d8a7e

23 files changed

Lines changed: 4132 additions & 7 deletions

File tree

‎common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorType.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ public enum DetectorType {
3232
AHDC (24, "AHDC"),
3333
ATOF (25, "ATOF"),
3434
RECOIL (26, "RECOIL"),
35+
MUCAL (28, "MUCAL"),
36+
MUVT (29, "MUVT"),
37+
MURT (30, "MURT"),
38+
MURH (31, "MURH"),
3539
TARGET (100, "TARGET"),
3640
MAGNETS (101, "MAGNETS");
3741

‎common-tools/clas-jcsg/src/main/java/org/jlab/detector/geant4/v2/DCGeant4Factory.java‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ public final class DCGeant4Factory extends Geant4Factory {
579579
private final HashMap<String, String> properties = new HashMap<>();
580580
private int nsgwires;
581581

582+
private final double x_enlargement = 1.00;
582583
private final double y_enlargement = 3.65;
583584
private final double z_enlargement = -2.46;
584585
private final double microgap = 0.01;
@@ -823,19 +824,20 @@ private Geant4Basic getRegion(int isec, int ireg) {
823824
}
824825

825826
private Geant4Basic getLayer(int isec, int isuper, int ilayer) {
826-
return getRegion(isec, isuper/2).getChildren().get((isuper%2)*6 + ilayer);
827+
return getRegion(isec, isuper/2).getChildren().get(0).getChildren().get((isuper%2)*6 + ilayer);
827828
}
828829
///////////////////////////////////////////////////
829830
public Geant4Basic createRegion(int isector, int iregion) {
830831
Wire regw0 = new Wire(isector+1, iregion * 2, 0, 0);
831832
Wire regw1 = new Wire(isector+1, iregion * 2 + 1, 7, nsgwires - 1);
832833

833-
double dx_shift = y_enlargement * Math.tan(Math.toRadians(29.5));
834+
double dx_shift = y_enlargement * Math.tan(dbref.thopen(iregion)/2);
835+
double extra = 0.2;
834836

835837
double reg_dz = (dbref.frontgap(iregion) + dbref.backgap(iregion) + dbref.midgap(iregion) + dbref.superwidth(iregion * 2) + dbref.superwidth(iregion * 2 + 1)) / 2.0 + z_enlargement;
836-
double reg_dx0 = Math.abs(regw0.bottom().x) - dx_shift + 1.0;
837-
double reg_dx1 = Math.abs(regw1.top().x) + dx_shift + 1.0;
838-
double reg_dy = regw1.top().minus(regw0.bottom()).y / Math.cos(dbref.thtilt(iregion)) / 2.0 + y_enlargement + 1.0;
838+
double reg_dx0 = Math.abs(regw0.bottom().x) - dx_shift + x_enlargement;
839+
double reg_dx1 = Math.abs(regw1.top().x) + dx_shift + x_enlargement;
840+
double reg_dy = regw1.top().minus(regw0.bottom()).y / Math.cos(dbref.thtilt(iregion)) / 2.0 + y_enlargement;
839841
double reg_skew = 0.0;
840842
double reg_thtilt = dbref.thtilt(iregion);
841843

@@ -852,6 +854,17 @@ public Geant4Basic createRegion(int isector, int iregion) {
852854
regionVolume.translate(vcenter.x, vcenter.y, vcenter.z);
853855
regionVolume.setId(isector + 1, iregion + 1, 0, 0);
854856

857+
double gas_dx0 = reg_dx0 - x_enlargement + dx_shift + extra;
858+
double gas_dx1 = reg_dx1 - x_enlargement - dx_shift + extra;
859+
double gas_dy = reg_dy - y_enlargement + extra;
860+
Geant4Basic regionGas = new G4Trap("regionGas" + (iregion + 1) + "_s" + (isector + 1),
861+
reg_dz, -reg_thtilt, Math.toRadians(90.0),
862+
gas_dy, gas_dx0, gas_dx1, 0.0,
863+
gas_dy, gas_dx0, gas_dx1, 0.0);
864+
regionGas.setPosition(0, 0, 0);
865+
regionGas.setMother(regionVolume);
866+
regionGas.setId(isector + 1, iregion + 1, 0, 0);
867+
855868
for (int isup = 0; isup < 2; isup++) {
856869
int isuper = iregion * 2 + isup;
857870
Geant4Basic superlayerVolume = this.createSuperlayer(isuper);
@@ -864,7 +877,7 @@ public Geant4Basic createRegion(int isector, int iregion) {
864877
superlayerVolume.rotate("zxy", -dbref.thster(isuper), 0.0, 0.0);
865878

866879
superlayerVolume.setPosition(slshift.x, slshift.y, slshift.z);
867-
superlayerVolume.setMother(regionVolume);
880+
superlayerVolume.setMother(regionGas);
868881
superlayerVolume.setId(isector + 1, iregion + 1, isuper + 1);
869882

870883
int nsglayers = dbref.nsenselayers(isuper) + dbref.nguardlayers(isuper);
@@ -879,7 +892,7 @@ public Geant4Basic createRegion(int isector, int iregion) {
879892
layerVolume.rotate("zxy", -dbref.thster(isuper), 0.0, 0.0);
880893

881894
layerVolume.setPosition(lshift.x, lshift.y, lshift.z);
882-
layerVolume.setMother(regionVolume);
895+
layerVolume.setMother(regionGas);
883896
layerVolume.setId(isector + 1, iregion + 1, isuper + 1, ilayer);
884897
}
885898
}

‎etc/bankdefs/hipo4/data.json‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,66 @@
396396
{ "name":"TDC" , "type":"I", "info":"TDC value"}
397397
]
398398
},
399+
{
400+
"name" : "MUCAL::adc",
401+
"group": 22800,
402+
"item" : 11,
403+
"info": "ADC bank for the muCLAS12 Electromagnetic Calorimeter",
404+
"entries":[
405+
{ "name":"sector" , "type":"B", "info":"sector (=1)"},
406+
{ "name":"layer" , "type":"B", "info":"layer (1-6)"},
407+
{ "name":"component" , "type":"S", "info":"strip"},
408+
{ "name":"order" , "type":"B", "info":"order: 0 - ADCL , 1 - ADCR"},
409+
{ "name":"ADC" , "type":"I", "info":"ADC maximum"},
410+
{ "name":"time" , "type":"F", "info":"time from pulse fit"},
411+
{ "name":"ped" , "type":"S", "info":"pedestal from pulse analysis"}
412+
]
413+
},
414+
{
415+
"name" : "MUVT::adc",
416+
"group": 22900,
417+
"item" : 11,
418+
"info": "ADC bank for the muCLAS12 Vertex Tracker",
419+
"entries":[
420+
{"name":"sector" , "type":"B", "info":"sector (=1)"},
421+
{"name":"layer" , "type":"B", "info":"layer (=1)"},
422+
{"name":"component" , "type":"S", "info":"crystal id"},
423+
{ "name":"order" , "type":"B", "info":"order: 0 - ADCL , 1 - ADCR"},
424+
{ "name":"ADC" , "type":"I", "info":"ADC integral from pulse fit"},
425+
{ "name":"time" , "type":"F", "info":"time from pulse fit"},
426+
{ "name":"ped" , "type":"S", "info":"pedestal from pulse analysis"}
427+
]
428+
},
429+
{
430+
"name" : "MURT::adc",
431+
"group": 23000,
432+
"item" : 11,
433+
"info": "ADC bank for the muCLAS12 Recoil Tracker",
434+
"entries":[
435+
{"name":"sector" , "type":"B", "info":"sector (=1)"},
436+
{"name":"layer" , "type":"B", "info":"layer (=1)"},
437+
{"name":"component" , "type":"S", "info":"crystal id"},
438+
{ "name":"order" , "type":"B", "info":"order: 0 - ADCL , 1 - ADCR"},
439+
{ "name":"ADC" , "type":"I", "info":"ADC integral from pulse fit"},
440+
{ "name":"time" , "type":"F", "info":"time from pulse fit"},
441+
{ "name":"ped" , "type":"S", "info":"pedestal from pulse analysis"}
442+
]
443+
},
444+
{
445+
"name" : "MURH::adc",
446+
"group": 23100,
447+
"item" : 11,
448+
"info": "ADC bank for the muCLAS12 Recoil Hodoscope",
449+
"entries":[
450+
{"name":"sector" , "type":"B", "info":"sector (1-8)"},
451+
{"name":"layer" , "type":"B", "info":"layer (1-2)"},
452+
{"name":"component" , "type":"S", "info":"tile id"},
453+
{ "name":"order" , "type":"B", "info":"order: 0 - ADCL , 1 - ADCR"},
454+
{ "name":"ADC" , "type":"I", "info":"ADC integral from pulse fit"},
455+
{ "name":"time" , "type":"F", "info":"time from pulse fit"},
456+
{ "name":"ped" , "type":"S", "info":"pedestal from pulse analysis"}
457+
]
458+
},
399459
{
400460
"name" : "RF::adc",
401461
"group": 21700,

‎etc/bankdefs/hipo4/mu.json‎

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
[
2+
{
3+
"name": "MUCAL::hits",
4+
"group": 22800,
5+
"item" : 21,
6+
"info": "Reconstructed Hits in muCLAS12 calorimeter",
7+
"entries": [
8+
{"name":"idx", "type":"B", "info":"x id of grid"},
9+
{"name":"idy", "type":"B", "info":"y id of grid"},
10+
{"name":"x", "type":"F", "info":"Hit X position (cm)" },
11+
{"name":"y", "type":"F", "info":"Hit Y position (cm)" },
12+
{"name":"z", "type":"F", "info":"Hit Z position (cm)" },
13+
{"name":"energy", "type":"F", "info":"Hit Energy" },
14+
{"name":"time", "type":"F", "info":"Hit Time" },
15+
{"name":"hitID", "type":"S", "info":"Hit Pointer to ADC bank"},
16+
{"name":"clusterID", "type":"S", "info":"Hit Pointer to Cluster Bank"}
17+
]
18+
},
19+
{
20+
"name": "MUCAL::clusters",
21+
"group": 22800,
22+
"item" : 22,
23+
"info": "Reconstructed Clusters in muCLAS12 calorimeter",
24+
"entries": [
25+
{"name":"size", "type":"S", "info":"Cluster size" },
26+
{"name":"id", "type":"S", "info":"Cluster ID" },
27+
{"name":"x", "type":"F", "info":"Cluster centroid X moment (cm)" },
28+
{"name":"y", "type":"F", "info":"Cluster centroid Y moment (cm)" },
29+
{"name":"z", "type":"F", "info":"Cluster centroid Z moment (cm)" },
30+
{"name":"widthX", "type":"F", "info":"Cluster width in x (cm)" },
31+
{"name":"widthY", "type":"F", "info":"Cluster width in y (cm)" },
32+
{"name":"radius", "type":"F", "info":"Cluster radius (cm)" },
33+
{"name":"time", "type":"F", "info":"Cluster timing information" },
34+
{"name":"energy", "type":"F", "info":"Cluster total energy" },
35+
{"name":"maxEnergy", "type":"F", "info":"Cluster maximum energy" },
36+
{"name":"recEnergy", "type":"F", "info":"Cluster reconstructed energy" }
37+
]
38+
},
39+
{
40+
"name": "MUVT::hits",
41+
"group": 22900,
42+
"item" : 21,
43+
"info": "MUVT hits",
44+
"entries": [
45+
{"name":"id", "type":"S", "info":"id of the hit"},
46+
{"name":"sector", "type":"B", "info":"sector number"},
47+
{"name":"layer", "type":"B", "info":"layer number"},
48+
{"name":"strip", "type":"S", "info":"strip number"},
49+
{"name":"energy", "type":"F", "info":"energy of the hit (eV)"},
50+
{"name":"time", "type":"F", "info":"time of the hit (ns)"},
51+
{"name":"clusterId", "type":"S", "info":"id of the cluster the hit belongs to"},
52+
{"name":"status", "type":"S", "info":"status of the hit"}
53+
]
54+
},
55+
{
56+
"name": "MUVT::clusters",
57+
"group": 22900,
58+
"item" : 22,
59+
"info": "reconstructed clusters from MUVT",
60+
"entries": [
61+
{"name":"id", "type":"S", "info":"id of the cluster"},
62+
{"name":"sector", "type":"B", "info":"sector"},
63+
{"name":"layer", "type":"B", "info":"layer"},
64+
{"name":"strip", "type":"S", "info":"seed strip"},
65+
{"name":"energy", "type":"F", "info":"energy of the cluster (eV)"},
66+
{"name":"time", "type":"F", "info":"time of the cluster (ns)"},
67+
{"name":"xo", "type":"F", "info":"strip origin X coordinate (cm)"},
68+
{"name":"yo", "type":"F", "info":"strip origin Y coordinate (cm)"},
69+
{"name":"zo", "type":"F", "info":"strip origin Z coordinate (cm)"},
70+
{"name":"xe", "type":"F", "info":"strip end X coordinate (cm)"},
71+
{"name":"ye", "type":"F", "info":"strip end Y coordinate (cm)"},
72+
{"name":"ze", "type":"F", "info":"strip end Z coordinate (cm)"},
73+
{"name":"size", "type":"S", "info":"size of the cluster"},
74+
{"name":"status", "type":"S", "info":"status of the cluster"}
75+
]
76+
},
77+
{
78+
"name": "MUVT::crosses",
79+
"group": 22900,
80+
"item" : 23,
81+
"info": "reconstructed crosses from MUVT",
82+
"entries": [
83+
{"name":"id", "type":"S", "info":"id of the cross"},
84+
{"name":"sector", "type":"B", "info":"sector"},
85+
{"name":"region", "type":"B", "info":"region"},
86+
{"name":"energy", "type":"F", "info":"energy of the cross (eV)"},
87+
{"name":"time", "type":"F", "info":"time of the cross (ns)"},
88+
{"name":"x", "type":"F", "info":"x coordinate (cm)"},
89+
{"name":"y", "type":"F", "info":"y coordinate (cm)"},
90+
{"name":"z", "type":"F", "info":"z coordinate (cm)"},
91+
{"name":"cluster1", "type":"S", "info":"id of the cluster in the V layer"},
92+
{"name":"cluster2", "type":"S", "info":"id of the cluster in the W layer"},
93+
{"name":"status", "type":"S", "info":"status of the cluster"}
94+
]
95+
},
96+
{
97+
"name": "MUVT::tracks",
98+
"group": 22900,
99+
"item" : 36,
100+
"info": "reconstructed tracks using MUVT information",
101+
"entries": [
102+
{"name":"index", "type":"S", "info":"index of the track in the DC bank"},
103+
{"name":"status", "type":"B", "info":"status of the track (0: refitted using FMT, 1: original DC track)"},
104+
{"name":"sector", "type":"B", "info":"sector of the track in DC"},
105+
{"name":"vx", "type":"F", "info":"Vertex x-position of the swam track to the DOCA to the beamline (in cm)"},
106+
{"name":"vy", "type":"F", "info":"Vertex y-position of the swam track to the DOCA to the beamline (in cm)"},
107+
{"name":"vz", "type":"F", "info":"Vertex z-position of the swam track to the DOCA to the beamline (in cm)"},
108+
{"name":"px", "type":"F", "info":"3-momentum x-coordinate of the swam track to the DOCA to the beamline (in GeV)"},
109+
{"name":"py", "type":"F", "info":"3-momentum y-coordinate of the swam track to the DOCA to the beamline (in GeV)"},
110+
{"name":"pz", "type":"F", "info":"3-momentum z-coordinate of the swam track to the DOCA to the beamline (in GeV)"},
111+
{"name":"charge", "type":"B", "info":"charge of the track"},
112+
{"name":"chi2", "type":"F", "info":"chi^2 of the fit"},
113+
{"name":"NDF", "type":"B", "info":"number of degrees of freedom of the fit"}
114+
]
115+
},
116+
{
117+
"name": "MUVT::trajectory",
118+
"group": 22900,
119+
"item" : 37,
120+
"info": "MUVT tracks trajectory bank",
121+
"entries": [
122+
{"name":"index", "type":"S", "info":"index of the track in the DC bank"},
123+
{"name":"detector", "type":"B", "info":"id of the detector"},
124+
{"name":"layer", "type":"B", "info":"id of the layer"},
125+
{"name":"x", "type":"F", "info":"track x position at detector surface (cm)"},
126+
{"name":"y", "type":"F", "info":"track y position at detector surface (cm)"},
127+
{"name":"z", "type":"F", "info":"track z position at detector surface (cm)"},
128+
{"name":"tx", "type":"F", "info":"track unit direction vector x component at detector surface"},
129+
{"name":"ty", "type":"F", "info":"track unit direction vector y component at detector surface"},
130+
{"name":"tz", "type":"F", "info":"track unit direction vector z component at detector surface"},
131+
{"name":"lx", "type":"F", "info":"track x position in local coordinates (cm)"},
132+
{"name":"ly", "type":"F", "info":"track y position in local coordinates (cm)"},
133+
{"name":"lz", "type":"F", "info":"track z position in local coordinates (cm)"},
134+
{"name":"dx", "type":"F", "info":"DC track x position in local coordinates (cm)"},
135+
{"name":"dy", "type":"F", "info":"DC track y position in local coordinates (cm)"},
136+
{"name":"dz", "type":"F", "info":"DC track z position in local coordinates (cm)"},
137+
{"name":"path", "type":"F", "info":"pathlength of the track from the track vertex to the detector surface (cm)"}
138+
]
139+
},
140+
{
141+
"name": "MURH::hits",
142+
"group": 23100,
143+
"item" : 21,
144+
"info": "Reconstructed Hits in muCLAS12 hodoscope",
145+
"entries": [
146+
{"name":"sector", "type":"B", "info":"sector number"},
147+
{"name":"layer", "type":"B", "info":"layer number"},
148+
{"name":"component", "type":"S", "info":"component number"},
149+
{"name":"x", "type":"F", "info":"Hit X position (cm)" },
150+
{"name":"y", "type":"F", "info":"Hit Y position (cm)" },
151+
{"name":"z", "type":"F", "info":"Hit Z position (cm)" },
152+
{"name":"energy", "type":"F", "info":"Hit Energy" },
153+
{"name":"time", "type":"F", "info":"Hit Time" },
154+
{"name":"hitID", "type":"S", "info":"Hit Pointer to ADC bank"},
155+
{"name":"clusterID", "type":"S", "info":"Hit Pointer to Cluster Bank"}
156+
]
157+
},
158+
{
159+
"name": "MURH::clusters",
160+
"group": 23100,
161+
"item" : 22,
162+
"info": "Reconstructed clusters in muCLAS12 hodoscope",
163+
"entries": [
164+
{"name":"size", "type":"S", "info":"Cluster size" },
165+
{"name":"id", "type":"S", "info":"Cluster ID" },
166+
{"name":"x", "type":"F", "info":"Cluster centroid X moment (cm)" },
167+
{"name":"y", "type":"F", "info":"Cluster centroid Y moment (cm)" },
168+
{"name":"z", "type":"F", "info":"Cluster centroid Z moment (cm)" },
169+
{"name":"widthX", "type":"F", "info":"Cluster width in x (cm)" },
170+
{"name":"widthY", "type":"F", "info":"Cluster width in y (cm)" },
171+
{"name":"radius", "type":"F", "info":"Cluster radius (cm)" },
172+
{"name":"time", "type":"F", "info":"Cluster timing information" },
173+
{"name":"energy", "type":"F", "info":"Cluster total energy" }
174+
]
175+
}
176+
]

0 commit comments

Comments
 (0)