diff --git a/Makefile b/Makefile index 6e5cef7f2095a2cf0463d1c52ac321e323b396a8..94192b3ac2d74d4e803286611e9cd95adce2d110 100644 --- a/Makefile +++ b/Makefile @@ -24,16 +24,28 @@ # try to preserve encoding CC = g++ +CODE_DIR = src +SIM_DIR = sim TESTS = check-lago -TARGETS = CFLAGS = -Wall -all: $(TESTS) $(TARGETS) +all: $(TESTS) + $(MAKE) -C $(CODE_DIR) + $(MAKE) -C $(CODE_DIR) install .PHONY: 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: ifndef LAGO_EASY diff --git a/README.md b/README.md index 1a40080c8d0a9742d16542edb7c89f9fd54eb5a4..cf5cc80a21d7cf5a408947e9be1ae16515561e31 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,7 @@ Please follow this simple instructions. ## 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 - make -from this directory. It will create the - LAGO_EASY -environment variable and modify the *.bashrc* file. Please source it again before to continue. +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. 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 ### Modifying geometry -The detector geometry is defined in the *Constants.h* file, located at the *src* directory. To modify it: - cd $LAGO_EASY - vim src/Constants.h +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: + + <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: ``` cpp +//DETECTOR CONSTANTS const double STATION_RADIUS = 0.70; //(m) const double STATION_HEIGHT = 1.46; //(m) const int NPM = 1; 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 RAD_PM = .1477;//(m) +const double HC_PM = .0776;//(m) +const double TOP_FACT = 1.; //white top ``` -Then recompile it - cd $LAGO_EASY/src +If you change detector geometry, you will need to recompile the whole package. Just execute <kbd>make</kbd> at the parent directory: +```bash + cd ${LAGO_EASY}/src make +``` ## Running -Go to the data directory, - - cd $LAGO_EASY/data +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 -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*: - - make + <kbd>make run</kbd> -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. diff --git a/configs.h b/configs.h new file mode 120000 index 0000000000000000000000000000000000000000..59f040c61c895db8fd70bb1f41817ce3398b4758 --- /dev/null +++ b/configs.h @@ -0,0 +1 @@ +src/Constants.h \ No newline at end of file diff --git a/data/Makefile b/data/Makefile deleted file mode 100644 index 7694f335a21bbdea2b0d94933e4d5b92ea3237cf..0000000000000000000000000000000000000000 --- a/data/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -all: - cd ../src && make - @echo "../src/EasySim" - @../src/EasySim || true - @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 "../src/Ascii $$i > $$nm.dat" && ../src/Ascii $$i > $$nm.dat && echo "Done"); done - @rm *.root - -clean: - rm -f calib_*.dat calib_*.root diff --git a/default.inp b/default.inp new file mode 120000 index 0000000000000000000000000000000000000000..7507a1d6d8609aa1dbb56ef7ae15f27e457b85a5 --- /dev/null +++ b/default.inp @@ -0,0 +1 @@ +sim/default.inp \ No newline at end of file diff --git a/sim/Makefile b/sim/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..78750bdb9fb2cac520db604eee4925afed4158f7 --- /dev/null +++ b/sim/Makefile @@ -0,0 +1,8 @@ +all: + @echo "../bin/EasySim" + @../bin/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`; [ $$nm.dat -nt $$i ] || (echo "../bin/Ascii $$i > $$nm.dat" && ../bin/Ascii $$i > $$nm.dat && echo "Done"); done + +clean: + rm -f calib_*.dat calib_*.root diff --git a/data/default.inp b/sim/default.inp similarity index 97% rename from data/default.inp rename to sim/default.inp index 32c37645dc34ce615c4b4d861efd592156241b38..e9e494a68e1481fd113b60aa2f434017ac73f0db 100644 --- a/data/default.inp +++ b/sim/default.inp @@ -7,7 +7,7 @@ ################################################ # # number of events (Number of particles injected in station) -NEvents 100 +NEvents 10000 # runnumber (Used for File naming, can be any string) RunNumber 01 # partmode (VEM| FIXEDTHETA| RANDOM| SCINTILLATOR| HORIZONTAL) @@ -15,11 +15,11 @@ RunNumber 01 # FIXEDTHETA for a fixed theta defined below # RANDOM for sin2theta distribution as expected # other should not be used -PartMode VEM +PartMode RANDOM # 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 1 +PartEnergy 0 # parttheta (in degrees relevant only in FIXEDTHETA mode) PartTheta 0 # diff --git a/src/Makefile b/src/Makefile index c494e3cb8077a085da89fdc8e4e125fa171496c9..12edb544c24c57963c296541e1be8645da9d838e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,29 +1,36 @@ -CPPFLAGS= -DCALIBONLY -Wno-deprecated -I`root-config --cflags` +CC=g++ +CPPFLAGS= -DCALIBONLY -Wno-deprecated -I`root-config --cflags` -Wall 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 -all: EasySim Ascii Trace +TARGETS=EasySim Ascii Trace + +all: $(TESTS) $(TARGETS) 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 + AnaDict.cc: Analyze.h rootcint -f AnaDict.cc -c Analyze.h .o: - g++ -c $< + $(CC) -c $< EasySim: ${SRC} EasySim.o - g++ -o $@ ${SRC} EasySim.o ${LINKFLAGS} + $(CC) -o $@ ${SRC} EasySim.o ${LINKFLAGS} Ascii: ${SRC} Ascii.o - g++ -o $@ ${SRC} Ascii.o ${LINKFLAGS} + $(CC) -o $@ ${SRC} Ascii.o ${LINKFLAGS} Trace: - g++ -o $@ trace.cc + $(CC) -o $@ trace.cc 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) # DO NOT DELETE