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

First commit

parents
No related branches found
No related tags found
No related merge requests found
LICENSE 0 → 100644
Copyright (c) 2012, The LAGO Project
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Makefile 0 → 100644
# Makefile --
# Copyright (C) 2012-TODAY The LAGO Project, http://lagoproject.org, lago-pi@lagoproject.org
# Original authors: Hernán Asorey
# e-mail: asoreyh@cab.cnea.gov.ar (asoreyh@gmail.com)
# Laboratorio de Detección de Partículas y Radiación (LabDPR)
# Centro Atómico Bariloche - San Carlos de Bariloche, Argentina
#
# LICENSE BSD-3-Clause
# Copyright (c) 2012, The LAGO Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# -*- coding: utf8 -*-
# try to preserve encoding
CC = g++
TESTS = check-lago
TARGETS =
CFLAGS = -Wall
all: $(TESTS) $(TARGETS)
.PHONY: clean
clean:
rm -f $(TARGETS)
check-lago:
ifndef LAGO_EASY
$(info LAGO_EASY is not set.)
$(info I will define it to $PWD, and modify the .bashrc)
$(shell $(PWD)/lago-easy.sh)
LAGO_EASY=$(PWD)
endif
# ![The LAGO Project](http://lagoproject.org/images/lago-logo-90.png "The LAGO Project") The LAGO EASY suite
| CODENAME | EASY |
|-------------------|:------|
| COPYRIGHT | (C) 2012-Today, The LAGO Project, [lagoproject.org](http://lagoproject.org)|
| LICENSE | BSD-3-Clause |
| REPOSITORY | https://github.com/lagoproject |
| CONTACT | [lago@lagoproject.org](mailto:lago@lagoproject.org)|
| DESCRIPTION | The LAGO project deploys and operates a network of water Cherenkov detectors (WCD) with a unified data structure. Here you will find the latest stable (prod) version of the detector simulation tools of the LAGO project |
| CONTRIBUTORS | If you want to contribute to this project please [send us an email](mailto:lago@lagoproject.org)|
| CODE GUIDELINES | |
|-------------------|:------|
| FILE ENCODING | UTF8 (please use <kbd>iconv -f YOUR_ENCODING -t UTF-8 file_to_convert > converted_file </kbd> before to push) |
| LANGUAGE | English (preferred) |
| INDENT STYLE | [Stroustrup](http://en.wikipedia.org/wiki/Indent_style#Variant:_Stroustrup) using 1 tab for 4 columns wide. check [here for vim setup](http://tedlogan.com/techblog3.html) |
| | If you prefer, please use: <kbd>astyle -t4 -A4 -y file_to_convert</kbd> before to push
| VERSIONING | Sequence-based identifiers, v<version>r<release>. First public release: **v1r0**
| INSTALL | After installing dependences (see INSTALL), just *make*
| USAGE | Please visit our [wikipage](http://wiki.lagoproject.org) (internal use only)|
The [Latin American Giant Observatory (LAGO)](http://lagoproject.org) is an extended Astroparticle Observatory at global scale. It is mainly oriented to basic research on three branches of Astroparticle physics: the Extreme Universe, Space Weather phenomena, and Atmospheric Radiation at ground level.
# INSTALL
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.
Please report any installation problems please [email us](mailto:lago@lagoproject.org).
## Usage
### 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
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
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
```
Then recompile it
cd $LAGO_EASY/src
make
## Running
Go to the data directory,
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*:
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.
~
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
################################################
# #
# LAGO EASY configuration #
# #
# format: keyword value #
# #
################################################
#
# number of events (Number of particles injected in station)
NEvents 100
# runnumber (Used for File naming, can be any string)
RunNumber 01
# partmode (VEM| FIXEDTHETA| RANDOM| SCINTILLATOR| HORIZONTAL)
# VEM for vertical and central particles
# FIXEDTHETA for a fixed theta defined below
# RANDOM for sin2theta distribution as expected
# other should not be used
PartMode VEM
# partcode (3 for muons, 2 for electrons, 1 for gammas,0 for all)
PartCode 3
# partenergy (in GeV = 1 Gev for VEM, 0=spectrum)
PartEnergy 1
# parttheta (in degrees relevant only in FIXEDTHETA mode)
PartTheta 0
#
#######################
#
# TYPICAL USES
#
#######################
#
# VEM (muons, 1 GeV)
####################
#PartMode VEM
#PartCode 3
#PartEnergy 1
#############
#
# Inclined muons at 60 deg, 1 GeV
#################################
#PartMode FIXEDTHETA
#PartCode 3
#PartEnergy 1
#PartTheta 60
#############
#
# Background
############
#PartMode RANDOM
#PartCode 0
#PartEnergy 0
#############
#
#
# Some other values can be modified but should probably not be modified
# for most users...
#
# simmode (FAST | DETAILED | SAMPLE)
# recommended: DETAILED
#SimMode DETAILED
# muemmode (DEFAULT | MUEM) (if MUEM, mu and em traces)
# recommended: DEFAULT
#MuEmMode DEFAULT
# elecmode (DEFAULT | FULL | PM | SHOWSAT)(if FULL intermediate elecsim written)
# recommended: PM
#ElecMode PM
#!/bin/bash
# lago-easy.sh
# define LAGO_EASY and modify .bashrc
# Copyright (C) 2012-TODAY The LAGO Project, http://lagoproject.org, lago-pi@lagoproject.org
# Original authors: Hernán Asorey
# e-mail: asoreyh@cab.cnea.gov.ar (asoreyh@gmail.com)
# Laboratorio de Detección de Partículas y Radiación (LabDPR)
# Centro Atómico Bariloche - San Carlos de Bariloche, Argentina
#
# LICENSE BSD-3-Clause
# Copyright (c) 2012, The LAGO Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# -*- coding: utf8 -*-
# try to preserve encoding
export LAGO_EASY=${PWD}
date=$(date -u)
echo "#
## Changes added by the LAGO EASY suite on $date
#
export LAGO_EASY=\"${LAGO_EASY}\"
# export PATH=\"\${LAGO_EASY}:\$PATH\"
" >> ${HOME}/.bashrc
source ${HOME}/.bashrc
This diff is collapsed.
#ifndef _ANALYZE_H
#define _ANALYZE_H
#include "TObject.h"
#include "TCanvas.h"
#include "TGraph.h"
#include "TVector3.h"
#include "TTree.h"
#include "TFile.h"
#include "TBrowser.h"
#include "Event.h"
#include "Array.h"
#include "TBranch.h"
#include <vector>
#include <map>
#include "TChain.h"
class Analyze : public TObject{
private:
TList *fCanvasList;
TList *fHisto1;
TList *fHistTitle;
TList *fHistAxis;
TCanvas* fCanvas;
TFile* fFile;
TTree * fTree;
TChain* fChain;
Event* fEvent;
TBranch* fBranch;
Array* fArray;
Array* fCoreArray;
HitStation* fHitStation;
vector<HitStation> fStList;
public:
Analyze();
~Analyze();
void DirectLight();
void DoLadybot3D();
void DrawArray();
void DrawAnodeDynode();
void DrawBalance(int ipm);
void DrawEvent(int nev);
void DrawMuonDecay();
void DrawMuons();
void DrawMuons(int opt);
void DrawMuons(int n1,int n2,int opt);
void DrawMuonSpectrum();
void DrawMuonsCharge(int ipm);
void DrawMuonsFE();
void DrawMuonTimes();
void DrawOneFE(int num,int ipm); //Draw sum of PMTS
void DrawOneFE(int num,int ipm,int ichan); //Draw sum of PMTS
void DrawOnePM(int num,int ipm); //Draw sum of PMTS
void DrawOnePM(int num,int ipm,int ichan); //Draw sum of PMTS
void DrawOneProfile(int num); //Draw sum of PMTS
void DrawOneProfile(int num,int ipm); //Draw sum of PMTS
void DrawOneTrace(int num); //Draw sum of PMTS
void DrawOneTrace(int num,int ipm);
void DrawOneTrace(int num,int ipm,int ichan);
void DrawOneTraceInVEM(int num,int ipm,int ichan);
void DrawPulseShape();
void DrawTraces(); //Draw sum of PMTS
void DrawTraces(int ipm);
void DrawTracesInVem(); //Draw sum of PMTS
void DrawTracesInVem(int ipm);
void GetEvent(int event);
void GetEvents();
void GetEvents(int ista);
void PlotDistances();
void PlotPMTBalance();
void PrintTree();
void ReadFile(char * file );
void TestAnodeDynode();
void TestNewTOT();
/*
void DrawEvent();
void Help();
*/
private:
ClassDef(Analyze,1)
};
#endif
This diff is collapsed.
#ifndef _ANALYZESTAR_H
#define _ANALYZESTAR_H
#include "TObject.h"
#include "TCanvas.h"
#include "TGraph.h"
#include "TVector3.h"
#include "TTree.h"
#include "TFile.h"
#include "TBrowser.h"
#include "Event.h"
#include "Array.h"
#include "TBranch.h"
#include <vector>
#include <map>
#include "TChain.h"
class AnalyzeStar : public TObject{
private:
TList *fCanvasList;
TList *fHisto1;
TList *fHistTitle;
TList *fHistAxis;
TCanvas* fCanvas;
TFile* fFile;
TTree * fTree;
TChain* fChain;
Event* fEvent;
TBranch* fBranch;
Array* fArray;
Array* fCoreArray;
HitStation* fHitStation;
vector<HitStation> fStList;
public:
AnalyzeStar();
~AnalyzeStar();
void CompareProfiles();
void ComputeNbotDistr(int energy, int tta);
void DoLadybot();
void DoLadybotToT();
void DoLTP(char *energy);
void DrawSaturatedTrace(int ipm );
void DrawSaturatedTrace();
void GetStation(Int_t sta);
void GetStation(Int_t sta,Int_t gain);
void LateralProfile();
void PlotNbotDistr();
void PrintS1000(char *energy);
void PrintTree();
void ReadFilesCDF(char * Energy,char * tta);
void ReadFilesLTP();
void ReadFile(char * file ,int opt);
/*
void DrawEvent();
void Help();
*/
private:
ClassDef(AnalyzeStar,1)
};
#endif
This diff is collapsed.
//----------------------------------------------------------------------
/*
File Array.h
*/
//----------------------------------------------------------------------
#ifndef ARRAY_H
#define ARRAY_H
#include <cmath>
#include <vector>
#include <string>
#include "TObject.h"
#include "Constants.h"
#include "Station.h"
//----------------------------------------------------------------
/*
class Array
The array of Stations used for the simulation.
An array can be the full array or a preselected array of station.
An array can be created 3 different ways :
- by reading a list of stations in a file
- a default array can be created automatically ( then the
argument is the number of stations wanted in the array )
- from a vector of stations
*/
//----------------------------------------------------------------
class Array : public TObject
{
private:
public:
vector<Station> fStationList;
Double_t fNorMin;
Double_t fNorMax;
Double_t fEasMin;
Double_t fEasMax;
Double_t fNorMean;
Double_t fEasMean;
Double_t fNorWidth;
Double_t fEasWidth;
Array(){};
Array(vector<Station> tanklist);
Array(Int_t size);
Array(Double_t theta,Double_t phi,Double_t E0, Double_t N0);
Array(string arrayfilename);
~Array(){};
void Fill(Station* sta);
Int_t Size();
ClassDef(Array,1)
};
extern Array *gArray;
extern Array *gHexagArray;
#endif
#include "Analyze.h"
#include <iostream>
using namespace std;
int main(int argc,char** argv) {
if (argc!=2) {
cerr << "Syntax: " << argv[0] << " file.root" << endl;
cerr << " Produces an ascii file with the following format:" << endl;
cerr << " ParticuleNumber FADCBin(0-100) PMId(0-n) ADCValue" << endl;
return 1;
}
TFile * File = new TFile(argv[1],"READ");
TTree* Tree = (TTree *) File->Get("TreeEvent");
TBranch* Branch= Tree->GetBranch("event");
Event* Event = 0;
Tree->SetBranchAddress("event",&Event);
HitStation* sta;
vector<HitStation> StList;
int NEntries=(int)Tree->GetEntries();
cerr << NEntries << " particles to analyze" << endl;
cout << "# Ascii dump version 0.2" << endl;
cout << "# 2" << endl;
cout << "# ParticuleNumber FADCBin(0-100) PMId(0-n) ADCValue" << endl;
for(int i=0; i<NEntries; i++) {
Tree->GetEvent(i);
if(i%100==0) cerr << i << " particles done" << endl;
StList = Event->fHitStationList;
sta=&(StList[0]);
for (int ipm=0;ipm<NPM;ipm++)
for(int k=0; k<100; k++)
cout << i << " " << k << " " << ipm << " " << sta->fPMT[ipm].fADC[0][k] << endl;
}
cerr << NEntries << " particles done" << endl;
return 0;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
//----------------------------------------------------------------------
/*
EASYSIM Program - IPN Orsay since December 2002
File EasySim.h
*/
//----------------------------------------------------------------------
#ifndef EASYSIM_H
#define EASYSIM_H
using namespace std;
#include <string>
#include <TROOT.h>
#include <TFile.h>
#include <TTree.h>
#include <TBranch.h>
#ifndef CALIBONLY
#include "Shower_ROOT.h"
#include "ShowerGrnd_ROOT.h"
#include "PartGrnd_ROOT.h"
#include "Header_ROOT.h"
#include "HeaderAires_ROOT.h"
#endif
#include "EasySimConfig.h"
inline bool string_contains(string line, string s) {
// ligb++ equivalent: return line.find(s);
return line.find(s)==string::npos?false:true;
}
inline string string_before(string line, string seperator) {
// ligb++ equivalent: return line.before(seperator);
return line.substr(0,line.find(seperator));
}
inline string string_after(string line, string seperator) {
// ligb++ equivalent: return line.before(seperator);
return line.substr(line.find(seperator)+1);
}
#endif
This diff is collapsed.
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