Skip to content

Commit

Permalink
Merge branch 'dev_io_root' into dev_sim2root_merge
Browse files Browse the repository at this point in the history
# Conflicts:
#	sim2root/Common/sim2root.py
  • Loading branch information
lwpiotr committed Jan 8, 2025
2 parents 9402144 + 8be0351 commit 016b3cf
Show file tree
Hide file tree
Showing 31 changed files with 2,084 additions and 564 deletions.
Empty file modified data/download_data_grand.py
100755 → 100644
Empty file.
1 change: 0 additions & 1 deletion examples/grandlib_classes/data_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
if ROOT.gROOT.GetVersionInt() < 62602:
import os
os._exit(1)
e.file.Close()

else:
print("Please provide a ROOT filename with the trees")
Expand Down
412 changes: 278 additions & 134 deletions grand/dataio/root_trees.py

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions grand/dataio/vector_filling.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Methods for filling the vectors from NumPy arrays

template<typename Type>
int fill_vec_1D(Type *arr, int *shape, vector<Type> *v)
{
v->resize(shape[0]);
for(int i=0; i<shape[0]; ++i)
{
(*v)[i] = arr[i];
}

return 0;
}

template<typename Type>
int fill_vec_2D(Type *arr, int *shape, vector<vector<Type>> *v)
{
v->resize(shape[0], vector<Type>(shape[1]));
for(int i=0; i<shape[0]; ++i)
{
for(int j=0; j<shape[1]; ++j)
(*v)[i][j] = arr[i*shape[1]+j];
}

return 0;
}

template<typename Type>
int fill_vec_3D(Type *arr, int *shape, vector<vector<vector<Type>>> *v)
{
v->resize(shape[0], vector<vector<Type>>(shape[1], vector<Type>(shape[2])));
for(int i=0; i<shape[0]; ++i)
{
for(int j=0; j<shape[1]; ++j)
{
for(int k=0; k<shape[2]; ++k)
(*v)[i][j][k] = arr[i*shape[1]*shape[2]+j*shape[2]+k];
}
}

return 0;
}

2 changes: 1 addition & 1 deletion grand/dataio/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.0.2
201 changes: 129 additions & 72 deletions grand/grandlib_classes/grandlib_classes.py

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions granddb/config.ini → granddb/config.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ socket_timeout = 5
; At least one localdir (incoming) is needed.
; incoming directory must be an absolute path
[directories]
localdir = ["/home/fleg/DEV/myincoming","/home/fleg/DEV/GRAND/incoming","/home/fleg/"]
localdir = ["/home/fleg/incoming/"]

; remote repositories to search for data if not present in local directories
; repositories are given as list :
Expand All @@ -21,9 +21,10 @@ localdir = ["/home/fleg/DEV/myincoming","/home/fleg/DEV/GRAND/incoming","/home/f
; If credentials are required to access the repository, they should be given in the [credential] section using the same name
; repository CCIN2P3 is already defined in the database (so it's not necessary to define it here), but credentials for it have
; to be supplied in the [credentials] section below
; THIS DEFINITIONS OVERRIDE THE ONES FROM THE DATABASE
[repositories]
CC = ["ssh","cca.in2p3.fr",22,["/sps/grand/pengxiong/GP81_interpolation/GP81_1000m/SignalTimeSeries/","/sps/grand/pengxiong/Proton_ROOT/","/sps/trend/fleg/INCOMING"]]
WEB = [ "https", "github.com" , 443, ["/grand-mother/data_challenge1/raw/main/coarse_subei_traces_root/"]]
CC = ["ssh","cca.in2p3.fr",22,["/sps/grand/data/nancay/GRANDfiles"]]


; Credentials for repositories given as :
; Name = [user, keyfile]
Expand All @@ -34,20 +35,20 @@ WEB = [ "https", "github.com" , 443, ["/grand-mother/data_challenge1/raw/main/co
; For ssh protocol, it's highly encouraged to use an ssh-agent (to avoid to have to provide passwd interactively at each run)
; To run an ssh-agent just do : `eval $(ssh-agent)` and `ssh-add .ssh/id_rsa`
[credentials]
CC = ["legrand",""]
CCIN2P3 = ["legrand",""]
SSHTUNNEL = ["fleg",""]
CCIN2P3 = ["john",""]
CC = ["jim",""]
SSHTUNNEL = ["joe",""]

; database to use (only one database can be defined)
; Name = [server, port, database, login, passwd, sshtunnel_server, sshtunnel_port, sshtunnel_credentials ]
[database]
database = ["localhost", "" ,"granddb", "grandadmin", "popo","", "", ""]
#database = ["ccpgsqlexpe.in2p3.fr",6550,"granddb","grandadmin","rSM8X7vmB7Up2ngR","lpnclaude.in2p3.fr", 22, "SSHTUNNEL"]
database = ["localhost", "" ,"granddb", "grandadmin", "password","", "", ""]


; The following section is optional.
; it defines the repository where registered files need to go.
; repository_name = "path"
; if not provided, the files will go to the incoming section provided in section directories
; Useful only if you want to work on "localdir" but register files in a remote directory
#[registerer]
#CC = "/sps/grand/fleg/INCOMING"
#CCIN2P3 = "/sps/grand/data/auger/GRANDfiles"
29 changes: 14 additions & 15 deletions granddb/docker/pgsync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ groups:
repository_access: "where id_repository < (select max_value::BIGINT / 2 from pg_sequences where sequencename='repository_id_repository_seq') and id_protocol < (select max_value::BIGINT / 2 from pg_sequences where sequencename='protocol_id_protocol_seq')"
provider: "where id_provider < (select max_value::BIGINT / 2 from pg_sequences where sequencename='provider_id_provider_seq')"
file: "where id_file < (select max_value::BIGINT / 2 from pg_sequences where sequencename='file_id_file_seq')"
file_content: "where id_file < (select max_value::BIGINT / 2 from pg_sequences where sequencename='file_id_file_seq')"
dataset: "where id_dataset < (select max_value::BIGINT / 2 from pg_sequences where sequencename='dataset_id_dataset_seq')"
dataset_location: "where id_dataset < (select max_value::BIGINT / 2 from pg_sequences where sequencename='dataset_id_dataset_seq')"
file_location: "where id_file < (select max_value::BIGINT / 2 from pg_sequences where sequencename='file_id_file_seq') and id_repository < (select max_value::BIGINT / 2 from pg_sequences where sequencename='repository_id_repository_seq')"
tree_type: "where id_tree_type < (select max_value::BIGINT / 2 from pg_sequences where sequencename='tree_type_id_tree_type_seq')"
file_trees: "where id_file < (select max_value::BIGINT / 2 from pg_sequences where sequencename='file_id_file_seq') and id_tree_type < (select max_value::BIGINT / 2 from pg_sequences where sequencename='tree_type_id_tree_type_seq')"
modification_software: "where id_modification_software < (select max_value::BIGINT / 2 from pg_sequences where sequencename='modification_software_id_modification_software_seq')"
data_source: "where id_data_source < (select max_value::BIGINT / 2 from pg_sequences where sequencename='data_source_id_data_source_seq')"
data_generator: "where id_data_generator < (select max_value::BIGINT / 2 from pg_sequences where sequencename='data_generator_id_data_generator_seq')"
Expand All @@ -29,17 +31,14 @@ groups:
particule_type: "where id_particule_type < (select max_value::BIGINT / 2 from pg_sequences where sequencename='particule_type_id_particule_type_seq')"
event_type: "where id_event_type < (select max_value::BIGINT / 2 from pg_sequences where sequencename='event_type_id_event_type_seq')"
atmos_model: "where id_atmos_model < (select max_value::BIGINT / 2 from pg_sequences where sequencename='atmos_model_id_atmos_model_seq')"
trun: "where id_trun < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_trun_seq')"
trunnoise: "where id_trunnoise < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_trunnoise_seq')"
trunshowersim: "where id_trunshowersim < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_trunshowersim_seq')"
trunefieldsim: "where id_trunefieldsim < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_trunefieldsim_seq')"
tshower: "where id_tshower < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_tshower_seq')"
tshowersim: "where id_tshowersim < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_tshowersim_seq')"
tvoltage: "where id_tvoltage < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_tvoltage_seq')"
trawvoltage: "where id_trawvoltage < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_trawvoltage_seq')"
tadc: "where id_tadc < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_tadc_seq')"
tefield: "where id_tefield < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_tefield_seq')"
#run: "where id_run < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_run_seq')"
#event: "where id_event < (select max_value::BIGINT / 2 from pg_sequences where sequencename='event_id_event_seq')"
#file_contains: "where id_file < (select max_value::BIGINT / 2 from pg_sequences where sequencename='file_id_file_seq') and id_run < (select max_value::BIGINT / 2 from pg_sequences where sequencename='run_id_run_seq') and id_event < (select max_value::BIGINT / 2 from pg_sequences where sequencename='event_id_event_seq')"

trun: "where id_trun < (select max_value::BIGINT / 2 from pg_sequences where sequencename='trun_id_trun_seq')"
trunnoise: "where id_trunnoise < (select max_value::BIGINT / 2 from pg_sequences where sequencename='trunnoise_id_trunnoise_seq')"
trunshowersim: "where id_trunshowersim < (select max_value::BIGINT / 2 from pg_sequences where sequencename='trunshowersim_id_trunshowersim_seq')"
trunefieldsim: "where id_trunefieldsim < (select max_value::BIGINT / 2 from pg_sequences where sequencename='trunfieldsim_id_trunefieldsim_seq')"
trunvoltage: "where id_trunvoltage < (select max_value::BIGINT / 2 from pg_sequences where sequencename='trunvoltage_id_trunvoltage_seq')"
tshower: "where id_tshower < (select max_value::BIGINT / 2 from pg_sequences where sequencename='tshower_id_tshower_seq')"
tshowersim: "where id_tshowersim < (select max_value::BIGINT / 2 from pg_sequences where sequencename='tshowersim_id_tshowersim_seq')"
events: "where id_event < (select max_value::BIGINT / 2 from pg_sequences where sequencename='events_id_event_seq')"
transfer: "where id_raw_file < (select max_value::BIGINT / 2 from pg_sequences where sequencename='rawfile_id_raw_file_seq')"
rawfile: "where id_raw_file < (select max_value::BIGINT / 2 from pg_sequences where sequencename='rawfile_id_raw_file_seq')"
convertion: "where id_raw_file < (select max_value::BIGINT / 2 from pg_sequences where sequencename='rawfile_id_raw_file_seq')"
Loading

0 comments on commit 016b3cf

Please sign in to comment.