1 package org.lcsim.analysis;
2
3 import java.util.Map;
4 import org.lcsim.event.EventHeader;
5 import org.lcsim.util.Driver;
6
7
8
9
10
11
12
13 public class WhizardEventFilter extends Driver
14 {
15
16 protected void process(EventHeader event)
17 {
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 int[] lightQQbarProcesses
37 = {
38 11775, 11776, 11779, 11780, 11795, 11796, 11799, 11800, 11803, 11804
39 };
40 Map<String, int[]> iparams = event.getIntegerParameters();
41 int idrup = 0;
42 if (iparams.containsKey("idrup")) {
43 idrup = iparams.get("idrup")[0];
44 }
45 if (iparams.containsKey("_idrup")) {
46 idrup = iparams.get("_idrup")[0];
47 }
48
49 Map<String, float[]> fparams = event.getFloatParameters();
50 float weight = 1.0f;
51 if (fparams.containsKey("_weight")) {
52 weight = fparams.get("_weight")[0];
53 }
54
55 System.out.println("idrup= " + idrup + " : weight= " + weight);
56 boolean skipEvent = true;
57 for (int i = 0; i < lightQQbarProcesses.length; ++i) {
58 if (idrup == lightQQbarProcesses[i]) {
59 skipEvent = false;
60 }
61 }
62 if (skipEvent) {
63 throw new Driver.NextEventException();
64 }
65 }
66 }