Skip to content
Snippets Groups Projects
Commit 04fce5f0 authored by Hernán Asorey's avatar Hernán Asorey
Browse files

No need to enter into sim and src directory

parent bc269955
No related branches found
No related tags found
No related merge requests found
...@@ -24,16 +24,28 @@ ...@@ -24,16 +24,28 @@
# try to preserve encoding # try to preserve encoding
CC = g++ CC = g++
CODE_DIR = src
SIM_DIR = sim
TESTS = check-lago TESTS = check-lago
TARGETS =
CFLAGS = -Wall CFLAGS = -Wall
all: $(TESTS) $(TARGETS) all: $(TESTS)
$(MAKE) -C $(CODE_DIR)
$(MAKE) -C $(CODE_DIR) install
.PHONY: clean .PHONY: clean
clean: clean:
rm -f $(TARGETS) rm -f bin/*
$(MAKE) -C $(CODE_DIR) clean
run:
$(MAKE) -C $(SIM_DIR)
fullclean:
rm -f bin/*
$(MAKE) -C $(CODE_DIR) clean
$(MAKE) -C $(SIM_DIR) clean
check-lago: check-lago:
ifndef LAGO_EASY ifndef LAGO_EASY
......
...@@ -28,11 +28,7 @@ Please follow this simple instructions. ...@@ -28,11 +28,7 @@ Please follow this simple instructions.
## Requirements ## Requirements
You just need a working [ROOT](http://root.cern.ch/) installation (ROOT v 5.34.36 or higher is the recommended version). Then you just You just need a working [ROOT](http://root.cern.ch/) installation (ROOT v 5.34.36 or higher is the recommended version). Then you just execute <kbd>make</kbd> at the main directory. It will create the <kbd>${LAGO_EASY}</kbd> environment variable and modify the <kbd>$HOME/.bashrc</kbd> file. Please source it again before to continue.
make
from this directory. It will create the
LAGO_EASY
environment variable and modify the *.bashrc* file. Please source it again before to continue.
Please report any installation problems please [email us](mailto:lago@lagoproject.org). Please report any installation problems please [email us](mailto:lago@lagoproject.org).
...@@ -40,32 +36,33 @@ Please report any installation problems please [email us](mailto:lago@lagoprojec ...@@ -40,32 +36,33 @@ Please report any installation problems please [email us](mailto:lago@lagoprojec
### Modifying geometry ### Modifying geometry
The detector geometry is defined in the *Constants.h* file, located at the *src* directory. To modify it: The detector geometry is defined in the <kbd>src/Constants.h</kbd> file. A symbolink link named <kbd>configs.h</kbd> is provided. To modify just edit this file:
cd $LAGO_EASY
vim src/Constants.h <kbd>vim configs.h</kbd>
and modify it by changing the values of STATION_RADIUS, STATION_HEIGHT and the number and position of PMTs (NPM X_PM and Y_PM). For example, for one of our detectors deployed at the LAGO Bariloche site, the configuring block is: and modify it by changing the values of STATION_RADIUS, STATION_HEIGHT and the number and position of PMTs (NPM X_PM and Y_PM). For example, for one of our detectors deployed at the LAGO Bariloche site, the configuring block is:
``` cpp ``` cpp
//DETECTOR CONSTANTS
const double STATION_RADIUS = 0.70; //(m) const double STATION_RADIUS = 0.70; //(m)
const double STATION_HEIGHT = 1.46; //(m) const double STATION_HEIGHT = 1.46; //(m)
const int NPM = 1; const int NPM = 1;
const double X_PM[NPM] = {0.}; // (0,0) is the center of the tank roof const double X_PM[NPM] = {0.}; // (0,0) is the center of the tank roof
const double Y_PM[NPM] = {0.}; // (0,0) is the center of the tank roof const double Y_PM[NPM] = {0.}; // (0,0) is the center of the tank roof
const double RAD_PM = .1477;//(m)
const double HC_PM = .0776;//(m)
const double TOP_FACT = 1.; //white top
``` ```
Then recompile it If you change detector geometry, you will need to recompile the whole package. Just execute <kbd>make</kbd> at the parent directory:
cd $LAGO_EASY/src ```bash
cd ${LAGO_EASY}/src
make make
```
## Running ## Running
Go to the data directory, The simulation execution is governed by the <kbd>default.inp</kbd> file. Just edit if following the examples given in that file. It is straightforward. Please be sure to be in CALIB mode (SHOWER mode is deactivated in LAGO code). Then, for run the simulation just use
cd $LAGO_EASY/data
and edit the *default.inp* file. It is straightforward. Be sure to be in CALIB mode (SHOWER mode is deactivated in LAGO code). Then, just run it from the data directory using *make*: <kbd>make run</kbd>
make
It will provide a **root** file with a specific name depending on the parameters defined in the *default.inp* file. It is then converted in ASCII, extracting the FADC traces, producing a *.dat* ASCII file. in the parent directory. It will provide a <kbd>.root</kbd> file with a specific name depending on the parameters defined in the <kbd>default.inp</kbd> file. It is then converted into ASCII, extracting the FADC traces, producing a <kbd>.dat</kbd> ASCII file.
~
src/Constants.h
\ No newline at end of file
sim/default.inp
\ No newline at end of file
all: all:
cd ../src && make @echo "../bin/EasySim"
@echo "../src/EasySim" @../bin/EasySim || true
@../src/EasySim || true @for i in *.root; do nm=`basename $$i .root`; [ -f $$nm.dat ] || (echo "../bin/Ascii $$i > $$nm.dat" && ../bin/Ascii $$i > $$nm.dat && echo "Done"); done
@for i in *.root ; do nm=`basename $$i .root`; [ -f $$nm.dat ] || (echo "../src/Ascii $$i > $$nm.dat" && ../src/Ascii $$i > $$nm.dat && echo "Done"); done @for i in *.root ; do nm=`basename $$i .root`; [ $$nm.dat -nt $$i ] || (echo "../bin/Ascii $$i > $$nm.dat" && ../bin/Ascii $$i > $$nm.dat && echo "Done"); done
@for i in *.root ; do nm=`basename $$i .root`; [ $$nm.dat -nt $$i ] || (echo "../src/Ascii $$i > $$nm.dat" && ../src/Ascii $$i > $$nm.dat && echo "Done"); done
@rm *.root
clean: clean:
rm -f calib_*.dat calib_*.root rm -f calib_*.dat calib_*.root
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
################################################ ################################################
# #
# number of events (Number of particles injected in station) # number of events (Number of particles injected in station)
NEvents 100 NEvents 10000
# runnumber (Used for File naming, can be any string) # runnumber (Used for File naming, can be any string)
RunNumber 01 RunNumber 01
# partmode (VEM| FIXEDTHETA| RANDOM| SCINTILLATOR| HORIZONTAL) # partmode (VEM| FIXEDTHETA| RANDOM| SCINTILLATOR| HORIZONTAL)
...@@ -15,11 +15,11 @@ RunNumber 01 ...@@ -15,11 +15,11 @@ RunNumber 01
# FIXEDTHETA for a fixed theta defined below # FIXEDTHETA for a fixed theta defined below
# RANDOM for sin2theta distribution as expected # RANDOM for sin2theta distribution as expected
# other should not be used # other should not be used
PartMode VEM PartMode RANDOM
# partcode (3 for muons, 2 for electrons, 1 for gammas,0 for all) # partcode (3 for muons, 2 for electrons, 1 for gammas,0 for all)
PartCode 3 PartCode 0
# partenergy (in GeV = 1 Gev for VEM, 0=spectrum) # partenergy (in GeV = 1 Gev for VEM, 0=spectrum)
PartEnergy 1 PartEnergy 0
# parttheta (in degrees relevant only in FIXEDTHETA mode) # parttheta (in degrees relevant only in FIXEDTHETA mode)
PartTheta 0 PartTheta 0
# #
......
CPPFLAGS= -DCALIBONLY -Wno-deprecated -I`root-config --cflags` CC=g++
CPPFLAGS= -DCALIBONLY -Wno-deprecated -I`root-config --cflags` -Wall
LINKFLAGS= `root-config --libs` LINKFLAGS= `root-config --libs`
SRC=Event.o Station.o Array.o Particle.o EventDict.o ShowerParam.o Utils.o BuildProcessesTables.o FastSimulation.o ManageEvent.o EasySimConfig.o Analyze.o AnaDict.o SRC=Event.o Station.o Array.o Particle.o EventDict.o ShowerParam.o Utils.o BuildProcessesTables.o FastSimulation.o ManageEvent.o EasySimConfig.o Analyze.o AnaDict.o
all: EasySim Ascii Trace TARGETS=EasySim Ascii Trace
all: $(TESTS) $(TARGETS)
EventDict.cc: Event.h Station.h Array.h Particle.h EasySimLinkDef.h EventDict.cc: Event.h Station.h Array.h Particle.h EasySimLinkDef.h
rootcint -f EventDict.cc -c Event.h Station.h Array.h Particle.h EasySimLinkDef.h rootcint -f EventDict.cc -c Event.h Station.h Array.h Particle.h EasySimLinkDef.h
AnaDict.cc: Analyze.h AnaDict.cc: Analyze.h
rootcint -f AnaDict.cc -c Analyze.h rootcint -f AnaDict.cc -c Analyze.h
.o: .o:
g++ -c $< $(CC) -c $<
EasySim: ${SRC} EasySim.o EasySim: ${SRC} EasySim.o
g++ -o $@ ${SRC} EasySim.o ${LINKFLAGS} $(CC) -o $@ ${SRC} EasySim.o ${LINKFLAGS}
Ascii: ${SRC} Ascii.o Ascii: ${SRC} Ascii.o
g++ -o $@ ${SRC} Ascii.o ${LINKFLAGS} $(CC) -o $@ ${SRC} Ascii.o ${LINKFLAGS}
Trace: Trace:
g++ -o $@ trace.cc $(CC) -o $@ trace.cc
clean: clean:
rm -f *.o *Dict* EasySim Ascii Trace rm -f $(TARGETS) *.o *Dict*
install:
cp $(TARGETS) ../bin/
# dependencies added by makedep (and slightly alterated for ROOT dictionnaries) # dependencies added by makedep (and slightly alterated for ROOT dictionnaries)
# DO NOT DELETE # DO NOT DELETE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment