hps-java/src/main/java/org/lcsim/hps/util
diff -u -r1.6 -r1.7
--- ConvertToStdhep.java 5 Sep 2012 19:41:04 -0000 1.6
+++ ConvertToStdhep.java 8 Jan 2013 21:03:45 -0000 1.7
@@ -49,11 +49,12 @@
static double sigz = 0.0; // Luminous region size in z (mm)
//beam is positioned so that at first beam direction is in z, then rotated to correct orientation
static double rotx = 0.00; // Rotation of beam about X
- static double roty = 0.00; // Rotation of beam about Y
+ static double roty = 0.03; // Rotation of beam about Y
static double rotz = 0.00; // Rotation of beam about Z
static double maxLen = 200; // maximum decay length (mm)
- static double _ecm = 2.2; //GeV
+ static double _ecm = 6.6; //GeV
static int nInFiles = 10000; //number of input files
+ static int nBegin=0;
static StdhepWriter sw;
static int nmax = 500000; //maximum number of events to write to 1 stdhep file (new one opens if n>nmax)
static String fileType = "lhe";
@@ -61,17 +62,20 @@
// static String fileType="dat";
static int nread = -1; // a running total of number of events read/written to stdhep files
static boolean _eventFilter = false;
- static int _nEleRequired = 2;
-
+ static boolean _isMuon=false;
+// static int _nEleRequired = 2;
+ static int _nEleRequired = 0;
private static Options createCommandLineOptions() {
Options options = new Options();
options.addOption(new Option("m", true, "A' Mass (MeV)"));
options.addOption(new Option("e", true, "Beam Energy (GeV)"));
options.addOption(new Option("n", true, "Number of files to run."));
+ options.addOption(new Option("b", true, "First file number."));
options.addOption(new Option("x", true, "Beam sigma in x"));
options.addOption(new Option("y", true, "Beam sigma in y"));
options.addOption(new Option("s", false, "Filter Events"));
+ options.addOption(new Option("u", false, "Is muonic decay?"));
return options;
}
@@ -98,6 +102,7 @@
}
String massString = String.valueOf(aMass);
String ninString = String.valueOf(nInFiles);
+ String nbegString = String.valueOf(nBegin);
String ecmString = String.valueOf(_ecm);
String eptString = String.valueOf(_ecm);
String sigxString = String.valueOf(sigx);
@@ -106,7 +111,7 @@
// LCIO output file.
if (cl.hasOption("m")) {
massString = cl.getOptionValue("m");
- aMass = Integer.valueOf(massString);
+ if(!trident) aMass = Integer.valueOf(massString);
System.out.println(massString);
}
@@ -115,6 +120,11 @@
nInFiles = Integer.valueOf(ninString);
System.out.println(ninString);
}
+ if (cl.hasOption("b")) {
+ nbegString = cl.getOptionValue("b");
+ nBegin = Integer.valueOf(nbegString);
+ System.out.println(nbegString);
+ }
if (cl.hasOption("x")) {
sigxString = cl.getOptionValue("x");
@@ -139,11 +149,15 @@
_eventFilter = true;
filter = "selected";
}
+ if (cl.hasOption("u")) {
+ _isMuon = true;
+ }
sigxString=convertMicron(sigx);
sigyString=convertMicron(sigy);
// String postfix = "_20ux200u_beamspot_gammactau_0cm.stdhep";
- String postfix = "_"+sigxString+"x"+sigyString+"_beamspot_gammactau_0cm.stdhep";
+// String postfix = "_"+sigxString+"x"+sigyString+"_beamspot_gammactau_0cm.stdhep";
+ String postfix = "_"+sigxString+"x"+sigyString+"_beamspot_gammactau_0cm_30mrad.stdhep";
// String fDir="/nfs/slac/g/hps/mgraham/DarkPhoton/tvm/testrun/";
// String fileLabel = "ap2.2gev40mevsel";
@@ -153,19 +167,28 @@
//String fDir = "/nfs/slac/g/hps/mgraham/DarkPhoton/MadGraph/aMassEvents2pt2Ap100MeV/";
//String fileLabel = "ap2.2gev100mevall";
//String inLabel = "W2pt2GeV_Ap100MeV_";
-
- String fDir = "/nfs/slac/g/hps/mgraham/DarkPhoton/MadGraph/Events" + eptString + "Ap" + massString + "MeV/";
+
+ String fDir = "/nfs/slac/g/hps/mgraham/DarkPhoton/MadGraph/Events" + eptString + "Ap" + massString + "MeV/";
String fileLabel = "ap" + ecmString + "gev" + massString + "mev" + filter;
String inLabel = "W" + eptString + "GeV_Ap" + massString + "MeV_";
-
+ if(trident){
+ fDir = "/nfs/slac/g/hps/mgraham/DarkPhoton/MadGraph/Events" + eptString + massString + "/";
+ fileLabel = "ap" + ecmString + massString + filter;
+ inLabel = "W" + eptString + "GeV_" + massString + "_";
+ }
+ if(_isMuon){
+ fDir = "/nfs/slac/g/hps/mgraham/DarkPhoton/MadGraph/Events" + eptString + "Ap" + massString + "MeVMuon/";
+ fileLabel = "ap" + ecmString + "gev" + massString + "mevMuon" + filter;
+ inLabel = "W" + eptString + "GeV_Ap" + massString + "MeVMuon_";
+ }
String inPost = "_unweighted_events.lhe";
String outDir = "/nfs/slac/g/hps/mgraham/DarkPhoton/SignalEvents/";
- int nOutFile = 0;
+ int nOutFile = nBegin;
System.out.println(fDir + fileLabel);
- for (int i = 0; i < nInFiles; i++) {
+ for (int i = nBegin; i < nBegin+nInFiles; i++) {
int fnum = i + 1;
String snum = "_" + fnum;
if (fnum < 10000) {