|
5 | 5 | import java.util.HashMap; |
6 | 6 | import java.util.List; |
7 | 7 | import java.util.Map; |
8 | | -import org.jlab.clas.physics.Particle; |
9 | 8 | import org.jlab.detector.base.DetectorType; |
10 | 9 | import org.jlab.geom.prim.Vector3D; |
11 | 10 | import org.jlab.io.base.DataBank; |
@@ -90,80 +89,6 @@ public static List<DetectorParticle> readDetectorParticles(DataEvent event, Stri |
90 | 89 | return particles; |
91 | 90 | } |
92 | 91 |
|
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 | | - |
167 | 92 | /** |
168 | 93 | * creates a bank with particles information. |
169 | 94 | * |
|
0 commit comments