Skip to content

Commit 4b25884

Browse files
committed
remove unused clas-physics references
1 parent 74aac16 commit 4b25884

10 files changed

Lines changed: 18 additions & 158 deletions

File tree

common-tools/clas-reco/src/main/java/org/jlab/clas/detector/DetectorData.java

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import java.util.HashMap;
66
import java.util.List;
77
import java.util.Map;
8-
import org.jlab.clas.physics.Particle;
98
import org.jlab.detector.base.DetectorType;
109
import org.jlab.geom.prim.Vector3D;
1110
import org.jlab.io.base.DataBank;
@@ -90,80 +89,6 @@ public static List<DetectorParticle> readDetectorParticles(DataEvent event, Stri
9089
return particles;
9190
}
9291

93-
/**
94-
* reads Detector Event, detector particles and detector responses and then
95-
* adds all associated responses to each particle.
96-
*
97-
* @param event
98-
* @return
99-
*/
100-
public static DetectorEvent readDetectorEvent(DataEvent event) {
101-
return DetectorData.readDetectorEvent(event, "REC::Particle", "REC::Detector");
102-
}
103-
104-
public static DetectorEvent readDetectorEvent(DataEvent event, String particle_bank, String response_bank) {
105-
106-
List<DetectorParticle> particles = DetectorData.readDetectorParticles(event, particle_bank);
107-
DetectorEvent detectorEvent = new DetectorEvent();
108-
for (DetectorParticle p : particles) {
109-
detectorEvent.addParticle(p);
110-
}
111-
112-
List<DetectorResponse> responses = DetectorData.readDetectorResponses(event, response_bank);
113-
for (DetectorResponse r : responses) {
114-
int association = r.getAssociation();
115-
if (association >= 0 && association < detectorEvent.getParticles().size()) {
116-
detectorEvent.getParticles().get(association).addResponse(r);
117-
}
118-
}
119-
120-
detectorEvent.getPhysicsEvent().clear();
121-
122-
for (DetectorParticle p : particles) {
123-
if (p.getPid() == 0) {
124-
Particle part = Particle.createWithMassCharge(
125-
p.getMass(), p.getCharge(),
126-
p.vector().x(), p.vector().y(), p.vector().z(),
127-
p.vertex().x(), p.vertex().y(), p.vertex().z()
128-
);
129-
detectorEvent.getPhysicsEvent().addParticle(part);
130-
} else {
131-
Particle part = Particle.createWithPid(p.getPid(),
132-
p.vector().x(), p.vector().y(), p.vector().z(),
133-
p.vertex().x(), p.vertex().y(), p.vertex().z()
134-
);
135-
detectorEvent.getPhysicsEvent().addParticle(part);
136-
}
137-
}
138-
139-
if (event.hasBank("MC::Particle") == true) {
140-
DataBank bank = event.getBank("MC::Particle");
141-
detectorEvent.getGeneratedEvent().clear();
142-
int nrows = bank.rows();
143-
for (int row = 0; row < nrows; row++) {
144-
detectorEvent.getGeneratedEvent().addGeneratedParticle(
145-
bank.getInt("pid", row),
146-
bank.getFloat("px", row),
147-
bank.getFloat("py", row),
148-
bank.getFloat("pz", row),
149-
bank.getFloat("vx", row),
150-
bank.getFloat("vy", row),
151-
bank.getFloat("vz", row)
152-
);
153-
detectorEvent.getPhysicsEvent().addGeneratedParticle(
154-
bank.getInt("pid", row),
155-
bank.getFloat("px", row),
156-
bank.getFloat("py", row),
157-
bank.getFloat("pz", row),
158-
bank.getFloat("vx", row),
159-
bank.getFloat("vy", row),
160-
bank.getFloat("vz", row)
161-
);
162-
}
163-
}
164-
return detectorEvent;
165-
}
166-
16792
/**
16893
* creates a bank with particles information.
16994
*

common-tools/clas-reco/src/main/java/org/jlab/clas/detector/DetectorEvent.java

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
import java.util.ArrayList;
44
import java.util.Collections;
55
import java.util.List;
6-
import org.jlab.clas.physics.Particle;
7-
import org.jlab.clas.physics.PhysicsEvent;
86
import org.jlab.detector.base.DetectorType;
9-
import org.jlab.io.base.DataEvent;
10-
117

128
/**
139
*
@@ -16,56 +12,19 @@
1612
public class DetectorEvent {
1713

1814
private final List<DetectorParticle> particleList = new ArrayList<>();
19-
private final PhysicsEvent generatedEvent = new PhysicsEvent();
20-
private final PhysicsEvent reconstructedEvent = new PhysicsEvent();
2115
private DetectorHeader eventHeader = new DetectorHeader();
2216

23-
public DetectorEvent(){
24-
25-
}
17+
public DetectorEvent(){}
2618

2719
public void sort() {
2820
Collections.sort(particleList);
2921
setAssociation();
3022
}
3123

32-
public static DetectorEvent readDetectorEvent(DataEvent event){
33-
return DetectorData.readDetectorEvent(event);
34-
}
35-
3624
public DetectorHeader getEventHeader() {
3725
return eventHeader;
3826
}
3927

40-
public PhysicsEvent getGeneratedEvent(){
41-
return this.generatedEvent;
42-
}
43-
44-
public PhysicsEvent getPhysicsEvent(){
45-
return this.reconstructedEvent;
46-
}
47-
48-
public DetectorParticle matchedParticle(int pid, int skip){
49-
Particle particle = generatedEvent.getParticleByPid(pid, skip);
50-
if(particle.p()<0.0000001) return new DetectorParticle();
51-
return matchedParticle(particle);
52-
}
53-
54-
public DetectorParticle matchedParticle(Particle p){
55-
double compare = 100.0;
56-
int index = -1;
57-
for(int i = 0; i < particleList.size();i++){
58-
if(p.charge()==particleList.get(i).getCharge()){
59-
if(particleList.get(i).compare(p.vector().vect())<compare){
60-
compare = particleList.get(i).compare(p.vector().vect());
61-
index = i;
62-
}
63-
}
64-
}
65-
if(index<0&&compare>0.2) return new DetectorParticle();
66-
return this.particleList.get(index);
67-
}
68-
6928
public void clear(){
7029
this.particleList.clear();
7130
}
@@ -180,14 +139,6 @@ public void setAssociation(){
180139
}
181140
}
182141

183-
public void addParticle(double px, double py, double pz,
184-
double vx, double vy, double vz){
185-
DetectorParticle particle = new DetectorParticle();
186-
particle.vector().setXYZ(px, py, pz);
187-
particle.vertex().setXYZ(vx, vy, vz);
188-
this.addParticle(particle);
189-
}
190-
191142
public DetectorParticle getTriggerParticle() {
192143
for (int ii=0; ii<particleList.size(); ii++) {
193144
if (particleList.get(ii).isTriggerParticle()) {

common-tools/clas-reco/src/main/java/org/jlab/clas/detector/DetectorResponse.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.jlab.clas.detector;
22

33
import java.util.ArrayList;
4-
import java.util.Comparator;
54
import java.util.List;
65
import org.jlab.detector.base.DetectorDescriptor;
76
import org.jlab.detector.base.DetectorType;

common-tools/clas-reco/src/main/java/org/jlab/clas/detector/TaggerResponse.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.jlab.io.base.DataBank;
99
import org.jlab.io.base.DataEvent;
1010

11-
1211
/**
1312
*
1413
* @author baltzell

reconstruction/ft/src/main/java/org/jlab/rec/ft/cal/FTCALEngine.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
import java.util.Arrays;
55
import java.util.List;
66
import javax.swing.JFrame;
7-
import org.jlab.clas.detector.DetectorData;
8-
import org.jlab.clas.detector.DetectorEvent;
9-
import org.jlab.clas.physics.PhysicsEvent;
107
import org.jlab.clas.reco.ReconstructionEngine;
118
import org.jlab.geom.prim.Vector3D;
129
import org.jlab.groot.data.H1F;
@@ -124,8 +121,6 @@ public static void main (String arg[]) {
124121
DataEvent event = (DataEvent) reader.getNextEvent();
125122
cal.processDataEvent(event);
126123

127-
DetectorEvent detectorEvent = DetectorData.readDetectorEvent(event);
128-
PhysicsEvent gen = detectorEvent.getGeneratedEvent();
129124
if(event.hasBank("FTCAL::clusters")) {
130125
DataBank bank = event.getBank("FTCAL::clusters");
131126
int nrows = bank.rows();
@@ -137,11 +132,11 @@ public static void main (String arg[]) {
137132
/// h5.fill(bank.getFloat("time",i)-124.25); // 124.25 offet for MC data
138133
h5.fill(bank.getFloat("time", i));
139134
h6.fill(cluster.x(), cluster.y());
140-
if(gen.countGenerated() != 0){
141-
h2.fill(bank.getFloat("energy",i)-gen.getGeneratedParticle(0).vector().p());
142-
h3.fill(Math.toDegrees(cluster.theta()-gen.getGeneratedParticle(0).theta()));
143-
h4.fill(Math.toDegrees(cluster.phi()-gen.getGeneratedParticle(0).phi()));
144-
}
135+
//if(gen.countGenerated() != 0){
136+
// h2.fill(bank.getFloat("energy",i)-gen.getGeneratedParticle(0).vector().p());
137+
// h3.fill(Math.toDegrees(cluster.theta()-gen.getGeneratedParticle(0).theta()));
138+
// h4.fill(Math.toDegrees(cluster.phi()-gen.getGeneratedParticle(0).phi()));
139+
//}
145140
}
146141
}
147142
}
@@ -153,12 +148,11 @@ public static void main (String arg[]) {
153148
canvas.cd(1); canvas.draw(h2);
154149
canvas.cd(2); canvas.draw(h3);
155150
canvas.cd(3); canvas.draw(h4);
156-
canvas.cd(4); canvas.draw(h6);
151+
canvas.cd(4); canvas.draw(h6);
157152
canvas.cd(5); canvas.draw(h5);
158153
frame.add(canvas);
159154
frame.setLocationRelativeTo(null);
160-
frame.setVisible(true);
155+
frame.setVisible(true);
156+
}
161157

162-
}
163-
164158
}

reconstruction/ft/src/main/java/org/jlab/rec/ft/hodo/FTHODOEngine.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,12 @@ public static void main (String arg[]) {
106106
DataEvent event = (DataEvent) reader.getNextEvent();
107107
cal.processDataEventUser(event);
108108

109-
DetectorEvent detectorEvent = DetectorData.readDetectorEvent(event);
110-
PhysicsEvent gen = detectorEvent.getGeneratedEvent();
111109
if(event.hasBank("FTHODO::clusters")) {
112110
DataBank bank = event.getBank("FTHODO::clusters");
113111
int nrows = bank.rows();
114112
for(int i=0; i<nrows;i++) {
115113
h1.fill(bank.getFloat("energy",i));
116-
h2.fill(bank.getFloat("energy",i)-gen.getParticle("[11]").vector().p());
114+
// h2.fill(bank.getFloat("energy",i)-gen.getParticle("[11]").vector().p());
117115
// h3.fill(bank.getFloat("clusterTheta",i)-gen.getParticle("[11]").theta()*180/Math.PI);
118116
// h4.fill(bank.getFloat("clusterPhi",i)-gen.getParticle("[11]").phi()*180/Math.PI);
119117
h5.fill(bank.getFloat("time",i));

reconstruction/ft/src/main/java/org/jlab/rec/ft/trk/FTTRKEngine.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ public static void main (String arg[]) {
170170
ArrayList<FTTRKCluster> clusters = trk.processDataEventAndGetClusters(event);
171171
int nStripsInClusters = 0;
172172

173-
DetectorEvent detectorEvent = DetectorData.readDetectorEvent(event);
174-
PhysicsEvent gen = detectorEvent.getGeneratedEvent();
175173
double maxcomp1=-100, maxcomp2=-100, maxcomp3=-100, maxcomp4=-100;
176174
int imax1 = -1, imax2 = -1, imax3 = -1, imax4 = -1;
177175
if(event.hasBank("FTTRK::hits")) {

reconstruction/ft/src/test/java/org/jlab/service/ft/FTTRKEngineTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ public static void main (String arg[]) {
215215
clusters = trk.processDataEventAndGetClusters(event);
216216
int nStripsInClusters = 0;
217217

218-
DetectorEvent detectorEvent = DetectorData.readDetectorEvent(event);
219-
PhysicsEvent gen = detectorEvent.getGeneratedEvent();
220218
double maxcomp1=-100, maxcomp2=-100, maxcomp3=-100, maxcomp4=-100;
221219
int imax1 = -1, imax2 = -1, imax3 = -1, imax4 = -1;
222220
if(event.hasBank("FTTRK::hits")) {

reconstruction/mu/src/main/java/org/jlab/rec/mucal/MUCALEngine.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ public static void main (String arg[]) {
127127
DataEvent event = (DataEvent) reader.getNextEvent();
128128
cal.processDataEvent(event);
129129

130-
DetectorEvent detectorEvent = DetectorData.readDetectorEvent(event);
131-
PhysicsEvent gen = detectorEvent.getGeneratedEvent();
132130
if(event.hasBank("MUCAL::clusters")) {
133131
DataBank bank = event.getBank("MUCAL::clusters");
134132
int nrows = bank.rows();
@@ -140,11 +138,11 @@ public static void main (String arg[]) {
140138
/// h5.fill(bank.getFloat("time",i)-124.25); // 124.25 offet for MC data
141139
h5.fill(bank.getFloat("time", i));
142140
h6.fill(cluster.x(), cluster.y());
143-
if(gen.countGenerated() != 0){
144-
h2.fill(bank.getFloat("energy",i)-gen.getGeneratedParticle(0).vector().p());
145-
h3.fill(Math.toDegrees(cluster.theta()-gen.getGeneratedParticle(0).theta()));
146-
h4.fill(Math.toDegrees(cluster.phi()-gen.getGeneratedParticle(0).phi()));
147-
}
141+
// if(gen.countGenerated() != 0){
142+
// h2.fill(bank.getFloat("energy",i)-gen.getGeneratedParticle(0).vector().p());
143+
// h3.fill(Math.toDegrees(cluster.theta()-gen.getGeneratedParticle(0).theta()));
144+
// h4.fill(Math.toDegrees(cluster.phi()-gen.getGeneratedParticle(0).phi()));
145+
// }
148146
}
149147
}
150148
}

reconstruction/mu/src/main/java/org/jlab/rec/muhd/MUHDEngine.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ public static void main (String arg[]) {
109109
DataEvent event = (DataEvent) reader.getNextEvent();
110110
cal.processDataEvent(event);
111111

112-
DetectorEvent detectorEvent = DetectorData.readDetectorEvent(event);
113-
PhysicsEvent gen = detectorEvent.getGeneratedEvent();
112+
//DetectorEvent detectorEvent = DetectorData.readDetectorEvent(event);
113+
//PhysicsEvent gen = detectorEvent.getGeneratedEvent();
114114
if(event.hasBank("MUHD::clusters")) {
115115
DataBank bank = event.getBank("MUHD::clusters");
116116
int nrows = bank.rows();
117117
for(int i=0; i<nrows;i++) {
118118
h1.fill(bank.getFloat("energy",i));
119-
h2.fill(bank.getFloat("energy",i)-gen.getParticle("[11]").vector().p());
119+
//h2.fill(bank.getFloat("energy",i)-gen.getParticle("[11]").vector().p());
120120
// h3.fill(bank.getFloat("clusterTheta",i)-gen.getParticle("[11]").theta()*180/Math.PI);
121121
// h4.fill(bank.getFloat("clusterPhi",i)-gen.getParticle("[11]").phi()*180/Math.PI);
122122
h5.fill(bank.getFloat("time",i));

0 commit comments

Comments
 (0)