Giter VIP home page Giter VIP logo

fun4all_compton's Introduction

fun4all_Compton

Setup on RACF

The easiest to get started is to use your RACF account. For setup instructions on other platforms, you will need to run the following commands inside the singularity container as outlined below.

Installing comptonRad

Download and compile the comptonRad generator sources:

mkdir -p ~/fun4all/compton
cd ~/fun4all/compton
git clone https://gitlab.com/eic/mceg/comptonRad
cd comptonRad
make

You can then run events by running ./main.exe. Modify the configuration by looking at the top of comrad.f and recompiling.

Installing fun4all_Compton

Download the fun4all_Compton macros and IO classes:

mkdir -p ~/fun4all/compton
cd ~/fun4all/compton
git clone https://github.com/cipriangal/fun4all_Compton
cd fun4all_Compton/source
mkdir build
cd build
../autogen.sh --prefix=$MYINSTALL
make install

Setup script

After installing fun4all_Compton, you will need to reload your environment (script see below):

source setup.sh

or you can add the ~/fun4all/lib directory to your LD_LIBRARY_PATH by hand:

export LD_LIBRARY_PATH=$MYINSTALL/lib:$LD_LIBRARY_PATH

Running

Visualize

root.exe
.x Fun4All_G4_BeamLine.C
.L DisplayOn.C
PHG4Reco *g4 = QTGui();  

Run gun

root.exe
.x Fun4All_G4_BeamLine.C
.L DisplayOn.C
PHG4Reco *g4 = DisplayOn(); // to still have the command line
Fun4AllServer *se = Fun4AllServer::instance();
se->run(1); // to shoot the geantinos

To run vizualizer with defaults:

root
.x Fun4All_G4_IP12Compton.C
.L DisplayOn.C
PHG4Reco *g4 = QTGui()

To run test electrons on the G4 terminal, use:

/Fun4All/run 1

Getting Compton events with ComRad

The ComRad package produces Compton events based on initial settings hard coded into the comrad.f file.

  • EB is the electron beam energy
  • EPHOT is the photon energy
  • SPIN array allows you to set the spin direction.

Some examples are given in the comments around where these variables are initialized. Modfiy the file and then recompile. The main.exe file that is created will output the events directly to the screen. Pipe it to a file of your choice. The convert2MILOU macro takes that file, parses it and creates a faux-MILOU generator text file that can be read in easily by standard EIC frameworks.

To convert the milou text file to a root file that can be read in by fun4all (with the eic cvmfs ENV set up):

root -l
gSystem->Load("libeicsmear")
erhic::DisKinematics::BoundaryWarning=false;
BuildTree("fauxMILOUfile.ml", ".", -1);

To run events:

root
.x Fun4All_G4_IP12Compton.C(100,"./milouIn.root","o_ComptonTst.root",false,18")

Setup on Linux with CVMFS and Singularity

If you have a Linux system, you can install CVMFS and install Singularity. This will allow you to start a shell inside the singularity container at /cvmfs/eic.opensciencegrid.org/singularity/rhic_sl7_ext with

singularity shell -B /cvmfs:/cvmfs /cvmfs/eic.opensciencegrid.org/singularity/rhic_sl7_ext

You should get a shell that looks like this:

Singularity>

You environment will be inherited from the host system. You may need to unset ROOTSYS for the following to work.

Singularity_shell script

You can create a 'singularity_shell.sh` script to run when you want to start the singularity container.

~/fun4all/singularity_shell.sh contains

#!/bin/bash
singularity shell -e -B /cvmfs:/cvmfs /cvmfs/eic.opensciencegrid.org/singularity/rhic_sl7_ext

Start the container with by running:

bash ~/fun4all/singularity_shell.sh

Setup script

You can create a setup.sh script to source when you enter the singularity container.

~/fun4all/setup.sh contains

#!/bin/bash
source /cvmfs/eic.opensciencegrid.org/x8664_sl7/opt/fun4all/core/bin/eic_setup.sh
export MYINSTALL=~/fun4all
source ${OPT_FUN4ALL}/bin/setup_local.sh $MYINSTALL

After starting the container, source this script:

source ~/fun4all/setup.sh

Platform independent setup (Windows, Mac, Linux):

Go to VirtualBox.md to download the "EIC Ubuntu 18.04LTS Image" virtual box image. Follow instructions there to enter the singularity shell.

fun4all_compton's People

Contributors

cipriangal avatar wdconinc avatar

Watchers

 avatar  avatar  avatar

Forkers

wdconinc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.