Commit 98677fd7 authored by William Patrick Mccormack's avatar William Patrick Mccormack Committed by Ewelina Maria Lobodzinska
Browse files

Add Cross Section Printout to logfile for SuperChic

parent 232fdf7e
......@@ -30,7 +30,7 @@ An example jobOptions file with pythia showering can be found at /athena/Generat
## Some Notes
* The S^2 model can be changed by adjusting the Init.isurv value
* The Init.diff should be either 'el', 'sda', 'sdb', or 'dd'. Be careful to make sure that the "BeamRemnants:unresolvedHadron = 0" component of the pythia commands is adjusted accordingly below (el -> 0, sda -> 2, sdb ->1, and dd -> 3)
* The Init.diff should be either 'el', 'sda', 'sdb', or 'dd'. Be careful to make sure that the "BeamRemnants:unresolvedHadron = 0" component of the pythia commands is adjusted accordingly below (el -> 3, sda -> 2, sdb ->1, and dd -> 0)
* The list of processes for Init.proc can be found in section 7 of the [manual](https://superchic.hepforge.org/superchic4.pdf)
* Output kinematics can of course be changed from what is in the samples. Two body decays use "a" and "b" particles (as in pta and ptb). Four body decays use "a", "b", "c", "d", and so forth.
* Cuts that have "x" in them refer to the hard process as a whole, so e.g. the di-lepton system in a di-lepton event
......
......@@ -14,11 +14,12 @@ class LheEVNTFiller(EvgenAlg):
super(LheEVNTFiller, self).__init__(name=name)
fileName = "evrecs/evrecout.dat"
outputFileName = "outputs/outputout.dat"
eventsProcessed = 0
def initialize(self):
seed = None
if(os.path.isfile(self.fileName)):
if(os.path.isfile(self.fileName) and os.path.isfile(self.outputFileName)):
print(self.fileName)
return StatusCode.Success
else:
......@@ -30,7 +31,26 @@ class LheEVNTFiller(EvgenAlg):
eventsSeen = 0
firstLine = True
particlesSeen = 0
xsWritten = False
if( not xsWritten ):
with open(self.outputFileName,'r') as inputOutputFile:
for line in inputOutputFile:
if 'Cross section =' in line:
print(line)
splitLine = line.split()
factor = 1.
if(splitLine[-1] == "pb"):
factor = 0.001
if(splitLine[-1] == "fb"):
factor = 0.000001
if(splitLine[-1] == "ub"):
factor = 1000.
if(splitLine[-1] == "mb"):
factor = 1000000.
print("MetaData: cross-section (nb)= "+str(float(splitLine[3])*factor))
xsWritten = True
with open(self.fileName,'r') as inputfile:
event = False
for line in inputfile:
......
......@@ -120,7 +120,7 @@ def writeInputDAT(Init):
outF.write("********************Unweighted events**********************************************\n")
outF.write("***********************************************************************************\n")
outF.write(Init.genunw + " ! [genunw] : Generate unweighted events \n")
outF.write(Init.nev + " ! [nev] : Number of events (1 or a small value is recommended) ( the number of produced total events are controlled by athena ) \n")
outF.write(Init.nev + " ! [nev] : Number of events (preferably controlled by maxEvents option in Gen_tf command) \n")
outF.write(Init.erec + " ! [erec] : Event record format ('hepmc','lhe','hepevt') \n")
outF.write(Init.readwt + " ! [readwt] : Set to true to read in pre-calculated maxium weight below \n")
outF.write(Init.wtmax + " ! [wtmax] : Maximum weight \n")
......
......@@ -59,5 +59,7 @@ import Superchic_i.EventFiller as EF
ef = EF.LheEVNTFiller()
fileName = "evrecs/evrec"+Init.outtg[1:-1]+".dat"
ef.fileName = fileName
outputFileName = "outputs/output"+Init.outtg[1:-1]+".dat"
ef.outputFileName = outputFileName
genSeq += ef
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment