View Javadoc

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    * @author Norman A. Graf
10   *
11   * @version $Id: WhizardEventFilter.java,v 1.1 2011/02/02 17:40:57 ngraf Exp $
12   */
13  public class WhizardEventFilter extends Driver
14  {
15  
16      protected void process(EventHeader event)
17      {
18          /*
19           *LOI qqbar files for Ecm=500 GeV
20           uu    11775   e-L e+R
21           uu    11776   e-R e+L
22  
23           cc    11779   e-L e+R
24           cc    11780   e-R e+L
25  
26           dd    11795   e-L e+R
27           dd    11796   e-R e+L
28  
29           ss     11799   e-L e+R
30           ss     11800   e-R e+L
31  
32           bb    11803   e-L e+R
33           bb    11804   e-R e+L
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  }