Commit d29be3da authored by Prabhakar Palni's avatar Prabhakar Palni
Browse files

Implementation of Frank Siegert's comments and suggestions to various codes in Superchic Interface

parent 1bd437c7
......@@ -24,10 +24,6 @@ atlas_depends_on_subdirs(
# External dependencies:
find_package( CLHEP )
find_package( HepMC COMPONENTS HepMC HepMCfio )
## TODO Currently FindSuperchic.cmake do not find the superchic generator libraries as it is under atlasexternals
#include("FindSuperchic.cmake")
find_package( Superchic )
atlas_disable_as_needed()
......
......@@ -15,8 +15,11 @@ extern "C" {
/**
@class Atlas_HEPEVT_modified.h
@brief Needed fot interface of Superchic_i to Superchic3.03 generator
@brief Needed fot interface of Superchic_i to Superchic3.03 generator
to store the umodified HEPEVT common.
This code was directly copied from Tailola_i package https://gitlab.cern.ch/atlas/athena/blob/21.6/Generators/Tauola_i/Tauola_i/Atlas_HEPEVT.h
with minor changes, original author list is following. This modified class takes into account the length of the array in hepevt parameteri nmxhep which is set to (nmxhep=4000) instead of HEPEVT standard event common which uses nmxhep=10000
@author Borut Paul Kersevan (BPK), June 2003
......@@ -75,9 +78,10 @@ private:
int m_dummy;
double m_realdummy;
static HEPEVT* s_atlas_HEPEVT;
// s_HEPEVT is needed access the umodified HEPEVT common block information
static HEPEVT* s_HEPEVT;
HEPEVT m_atlas_HEPEVT;
HEPEVT m_HEPEVT;
};
......
......@@ -6,5 +6,5 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
// initialise pointer
void Atlas_HEPEVT_modified::init(void) {
if (!s_atlas_HEPEVT) s_atlas_HEPEVT = static_cast<HEPEVT*>(atlas_hepevt_modified_address_());
if (!s_HEPEVT) s_HEPEVT = static_cast<HEPEVT*>(atlas_hepevt_modified_address_());
}
......@@ -22,13 +22,8 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#define GENERATORMODULESSUPERCHIC_H
#include "GeneratorModules/GenModule.h"
#include "Superchic_i/Atlas_HEPEVT_modified.h"
#include "HepMC/IO_GenEvent.h"
#include "HepMC/IO_HEPEVT.h"
#include "HepMC/GenEvent.h"
using std::string;
typedef std::vector<std::string> CommandVector;
......@@ -66,7 +61,7 @@ protected:
unsigned int m_proc;
std::string m_beam;
std::string m_outtg;
std::string m_sfaci; // TODO check this ?
std::string m_sfaci;
std::string m_an;
std::string m_az;
std::string m_rz;
......
\documentclass[11pt]{article}
\newdimen\SaveHeight \SaveHeight=\textheight
\textwidth=6.5in
\textheight=8.9in
\textwidth=6.5in
\textheight=9.0in
\hoffset=-.5in
\voffset=-1in
\def\topfraction{1.}
\def\textfraction{0.}
\def\topfraction{1.}
\def\textfraction{0.}
\begin{document}
\title{Superchic\_i: An interface between SuperChic MC event generator for CEP and Athena
version in release 21.6}
\author{ Prabhakar Palni (Prabhakar.Palni@cern.ch)}
%\today
\maketitle
\section{Introduction}
SuperChic 3 Monte Carlo event generator for central exclusive production
This interface package runs SuperChic MC Generator (v3.05) within Athena framework, and stores the events output into the transient store in HepMC format.
SuperChic MC event generator is dedicated for Central exclusive production (CEP) processes in high-energy hadron-hadron collisions (pp, pA, and AA beams) for both photon and QCD-initiated production. This documentation gives you some details about setting up the Superchic interface (which is prepared using the latest available Superchic version 3.05) and activating the module using the JobOptions.
In order to initialize and calculate input parameters like such as opacity,screening amplitude,sudakov factor, and skewed PDF the subroutine calcparam.F is used. To generate events superchicrun.F subroutine is used which inheritates from the superchic.f subroutine.
\section{Usage of Job Options}
The example job option file can be found under the following path.
{\bf Superchic\_i/share/jobOptions.Superchic.py }
Before running this script, first setup the athena
{\bf asetup 21.6,latest,AthGeneration,slc6 }
Above command sets up the latest AthGeneration cache.
The Superchic input parameters can be set from the job options service. The
default parameters initializes the Superchic for PbPb beams at center-of-mass energy per nucleon of 5.02 TeV for the light by light scattering process [$\gamma \gamma \rightarrow \gamma \gamma$ (process no. 59)].
{\bf All the parameters passed to Superchic are in the units specified
in the Superchic manual https://superchic.hepforge.org/superchic3.pdf }
The default jobOptions.Superchic.py file can be copied to your test run directory. The initialization parameters can be changed via the following line in the jobOptions.py
\begin{verbatim}Superchic.Initialize = ["parameter_1 value_1", "parameter_2 value_2"]
\end{verbatim}
Each quoted string sets one parameter value in the fortran variable format. You can set all the input parameters
separated by commas, however, the important ones are listed below.
{\bf parameter\_1:} must be one of the following variable names, an error message is returned if the specified variable is not in the input parameter list.
{\bf value\_1:} is the input parameter's value.\\
JO Example:\\
The following command generates 10 events for Pb+Pb collisions at 5.02 TeV center-of-mass energy along with important input parameters for process 59 i.e $\gamma \gamma \rightarrow \gamma \gamma$. \\
Running the Job Option to produce events
\begin{verbatim}
Generate_tf.py --ecmEnergy=5020.0 --maxEvents=10 --firstEvent=1 --randomSeed=14
--outputEVNTFile=test.pool.root --jobConfig jobOptions.Superchic.py
\end{verbatim}
Example of the initialization of the input parameters in the JO is shown below.
\begin{verbatim}
genSeq.Superchic.Initialize = \
["rts 5.02d3", # set the COM collision energy (in fortran syntax)
"isurv 4", # Model of soft survival
"intag 'in5'", # for input files
"PDFname 'MMHT2014lo68cl'", # PDF set name
"PDFmember 0", # PDF member
"proc 59", # Process number (59:gg->gg, 56:gg->ee, 57:gg->mumu)
"beam 'ion'", # Beam type ('prot', 'ion','ionp')
"outtg 'out'", # for output file name
"sfaci .false." # Include soft survival effects
]
\end{verbatim}
One can also add the kinematical cuts to the outgoing particles or the system, details can be found in the manual.
%
%{\large \bf Random Numbers}\\
%
% Superchic\_i is using the AtRndmGenSvc Athena Service to provide to Superchic (via the ran function,
% found in Superchic\_i/src/ran.F) the necessary random numbers. This service is using the RanecuEngine of CLHEP,
% and is based on the ``stream'' logic, each stream being able to provide an idependent sequence of random
% numbers. Superchic\_i is using two streams: Superchic\_INIT and Superchic. The first stream is used to provide
% random numbers for the initialization phase of Superchic and the second one for the event generation. The user
% can set the initial seeds of each stream via the following option in the jobOption file.
%
% \begin{verbatim}
% AtRndmGenSvc.Seeds = [``Superchic_INIT 2345533 9922199'', ``Superchic 5498921 659091'']
% \end{verbatim}
%
% The above sets the seeds of the Superchic\_INIT stream to 2345533 and 9922199 and of the Superchic one to
% 5498921 and 659091. If the user will not set the seeds of a stream then the AtRndmGenSvc will use default
% values.
%
% The seeds of the Random number service are saved for each event in the HepMC Event record and they are printed
% on screen by DumpMC. In this way an event can be reproduced easily. The user has to rerun the job by simply seting
% the seeds of the Superchic stream (the seeds of the Superchic\_INIT stream should stay the same) to the seeds of that
% event.
%
% Additionaly the AtRndmGenSvc is dumping into a file (AtRndmGenSvc.out) the seeds of all the streams at the end
% of the job. This file can be read back by the service if the user set the option
% \begin{verbatim} AtRndmGenSvc.ReadFromFile = true \end{verbatim} (default = false). In this case the file
% AtRndmGenSvc.out is read and the streams saved in this file are created with seeds as in this file. The name of
% the file to be read can be set by the user via the option
% \begin{verbatim} AtRndmGenSvc.FileToRead = MyFileName \end{verbatim}
%
% The above file is also written out when a job crashes. {\bf This last option (when job crashing) is currently not
% working, waiting for a modification in Athena}.
%
% The {\bf Superchic\_i/share/jobOptions.Superchic.py } contains the above options.\\
\section{Running SuperChic in Standalone way}
One can directly carry out following commands in the fresh terminal to produce superchic events in standalone way.
\begin{tiny}
\begin{verbatim}
source /cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/superchic/3.05/x86_64-slc6-gcc49-opt/superchicenv-genser.sh
cp -rf /cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/superchic/3.05/x86_64-slc6-gcc49-opt/bin /tmp/cern_username/
cd /tmp/cern_username/bin/
export LHAPATH=/cvmfs/sft.cern.ch/lcg/external/lhapdfsets/current/
./init < input.DAT
./superchic < input.DAT
\end{verbatim}
\end{tiny}
You can change the input.DAT file to change the C.O.M collision energy for the particular process, process no., numberof events etc. Above commands will produce output stored under the directory {\bf 'evrecs' }.
\end{document}
evgenConfig.description = "Superchic gamma + gamma UPC collisions at 5020 GeV"
evgenConfig.keywords = ["2photon","2lepton"]
#evgenConfig.weighting = 0
evgenConfig.contact = ["prabhakar.palni@cern.ch"]
if not os.path.exists('inputs'):
os.makedirs('inputs')
if not os.path.exists('evrecs'):
os.makedirs('evrecs')
from Superchic_i.Superchic_iConf import Superchic_i
genSeq += Superchic_i("Superchic")
genSeq.Superchic.McEventKey = "GEN_EVENT"
evgenConfig.generators += ["Superchic"]
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
_evgenstream = AthenaPoolOutputStream("StreamEVGEN")
_evgenstream.ItemList = ["2101#*","133273#GEN_EVENT"]
del _evgenstream
# TODO: Sort out proper param setting based on runArgs.ecmEnergy
if int(runArgs.ecmEnergy) != 5020:
evgenLog.error(" Set beam energy in JO initialization with parameter rts ")
sys.exit(1)
genSeq.Superchic.Initialize = \
["rts 5.02d3", # set the COM collision energy (in fortran syntax)
"isurv 4", # Model of soft survival
"intag 'in5'", # for input files
"PDFname 'MMHT2014lo68cl'", # PDF set name
"PDFmember 0", # PDF member
"proc 59", # Process number (59 = gg->gg, 56 =gg->ee )
"beam 'ion'", # Beam type ('prot', 'ion')
"outtg 'out'", # for output file name
"sfaci .false.", # Include soft survival effects
"ncall 100000", # Number of calls for preconditioning
"itmx 1", # Number of iterations for preconditioning
"prec 1.0d0" # precision
]
......@@ -4,10 +4,8 @@
//
// Description:
//
// Needed for interface of Superchic_i to Superchic3.03 generator
// to store the umodified HEPEVT common.
//
// Copied directly from the Tauolo_i and modified a bit
// Needed for interface of Superchic_i to Superchic3.05 generator
// to store the umodified HEPEVT common. Copied directly from the Tauolo_i and modified a bit
// Author List:
// Borut Paul Kersevan (BPK), June 2003
//
......@@ -21,17 +19,17 @@
#include "Superchic_i/Atlas_HEPEVT_modified.h"
// set pointer to zero at start
Atlas_HEPEVT_modified::HEPEVT* Atlas_HEPEVT_modified::s_atlas_HEPEVT =0;
Atlas_HEPEVT_modified::HEPEVT* Atlas_HEPEVT_modified::s_HEPEVT =0;
// Constructor
Atlas_HEPEVT_modified::Atlas_HEPEVT_modified()
{
m_atlas_HEPEVT.nevhep = 0;
m_atlas_HEPEVT.nhep = 0;
m_HEPEVT.nevhep = 0;
m_HEPEVT.nhep = 0;
for(int i=0 ; i< s_lenNmxhep; i++ ){
m_atlas_HEPEVT.idhep[i] = 0;
m_atlas_HEPEVT.isthep[i] = 0;
m_HEPEVT.idhep[i] = 0;
m_HEPEVT.isthep[i] = 0;
}
m_dummy = 0;
......@@ -47,27 +45,27 @@ Atlas_HEPEVT_modified::~Atlas_HEPEVT_modified()
void Atlas_HEPEVT_modified::fill()
{
init(); // check COMMON is initialized
m_atlas_HEPEVT= *(s_atlas_HEPEVT);
m_HEPEVT= *(s_HEPEVT);
return;
}
void Atlas_HEPEVT_modified::spill()
{
s_atlas_HEPEVT =0; //re-init the pointer
s_HEPEVT =0; //re-init the pointer
init(); // check COMMON is initialized
*(s_atlas_HEPEVT)=m_atlas_HEPEVT;
*(s_HEPEVT)=m_HEPEVT;
return;
}
int& Atlas_HEPEVT_modified::nevhep() {
init(); // check COMMON is initialized
return s_atlas_HEPEVT->nevhep;
return s_HEPEVT->nevhep;
}
int& Atlas_HEPEVT_modified::nhep() {
init(); // check COMMON is initialized
return s_atlas_HEPEVT->nhep;
return s_HEPEVT->nhep;
}
int& Atlas_HEPEVT_modified::isthep(int nh) {
......@@ -79,7 +77,7 @@ int& Atlas_HEPEVT_modified::isthep(int nh) {
return m_dummy;
}
return s_atlas_HEPEVT->isthep[nh-1];
return s_HEPEVT->isthep[nh-1];
}
int& Atlas_HEPEVT_modified::idhep(int nh) {
......@@ -91,7 +89,7 @@ int& Atlas_HEPEVT_modified::idhep(int nh) {
return m_dummy;
}
return s_atlas_HEPEVT->idhep[nh-1];
return s_HEPEVT->idhep[nh-1];
}
int& Atlas_HEPEVT_modified::jmohep(int i, int nh) {
......@@ -104,7 +102,7 @@ int& Atlas_HEPEVT_modified::jmohep(int i, int nh) {
return m_dummy;
}
return s_atlas_HEPEVT->jmohep[nh-1][i-1];
return s_HEPEVT->jmohep[nh-1][i-1];
}
int& Atlas_HEPEVT_modified::jdahep(int i, int nh) {
......@@ -117,7 +115,7 @@ int& Atlas_HEPEVT_modified::jdahep(int i, int nh) {
return m_dummy;
}
return s_atlas_HEPEVT->jdahep[nh-1][i-1];
return s_HEPEVT->jdahep[nh-1][i-1];
}
double& Atlas_HEPEVT_modified::phep(int j, int nh) {
......@@ -130,7 +128,7 @@ double& Atlas_HEPEVT_modified::phep(int j, int nh) {
return m_realdummy;
}
return s_atlas_HEPEVT->phep[nh-1][j-1];
return s_HEPEVT->phep[nh-1][j-1];
}
double& Atlas_HEPEVT_modified::vhep(int k, int nh) {
......@@ -143,5 +141,5 @@ double& Atlas_HEPEVT_modified::vhep(int k, int nh) {
return m_realdummy;
}
return s_atlas_HEPEVT->vhep[nh-1][k-1];
return s_HEPEVT->vhep[nh-1][k-1];
}
......@@ -22,8 +22,6 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#include "HepMC/GenEvent.h"
#include "HepMC/GenVertex.h"
#include "HepMC/GenParticle.h"
#include "HepMC/IO_HEPEVT.h"
#include "HepMC/HEPEVT_Wrapper.h"
#include <stdlib.h>
#include <iostream>
......@@ -43,10 +41,7 @@ namespace{
static std::string superchic_stream = "SUPERCHIC_INIT";
}
using HepMC::HEPEVT_Wrapper;
// store the HEPEVT common information from the superchic3.03 hepevt output.
// store the HEPEVT common information from the hepevt output.
Atlas_HEPEVT_modified* Superchic_i::s_atlas_HEPEVT = new Atlas_HEPEVT_modified();
// call fortran subroutines to calculate parameters and then generate events
......@@ -149,11 +144,6 @@ Superchic_i::~Superchic_i()
static const bool CREATEIFNOTTHERE(true);
ATH_CHECK( service("AtRndmGenSvc", p_AtRndmGenSvc, CREATEIFNOTTHERE) );
// Set size of common blocks in HEPEVT: note these correspond to stdhep
HepMC::HEPEVT_Wrapper::set_sizeof_int(4);
HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
HepMC::HEPEVT_Wrapper::set_max_number_entries(4000);
// Save the SUPERCHIC_INIT stream seeds....
CLHEP::HepRandomEngine* engine = p_AtRndmGenSvc->GetEngine(superchic_stream);
const long* sip = engine->getSeeds();
......@@ -235,8 +225,6 @@ Superchic_i::~Superchic_i()
HepMC::GenVertex* v1 = new HepMC::GenVertex();
evt->add_vertex( v1 );
// HepMC::HEPEVT_Wrapper::print_hepevt();
// use the s_atlas_HEPEVT ponter to obtain the information from the common block
int npart = s_atlas_HEPEVT->nhep();
......
Supports Markdown
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