diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000000000000000000000000000000000..11bdfea9d58845f7a46b066e9e6682d4bcfd9e0d --- /dev/null +++ b/.clang-format @@ -0,0 +1,10 @@ +--- +BasedOnStyle: LLVM +BreakConstructorInitializersBeforeComma: true +ConstructorInitializerAllOnOneLineOrOnePerLine: true +Cpp11BracedListStyle: true +Standard: Cpp11 +#SpaceBeforeParens: ControlStatements +SpaceAfterControlStatementKeyword: true +PointerBindsToType: true +... diff --git a/.gitignore b/.gitignore index 831c69456261a98ab4d5a87b60908cdb83f9c6e2..176904b71c3c7f8f56bc8d292949ad99b49e7151 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,37 @@ -results/* -data/* -datasets/* -data -calorimeters/test/ +# Compiled Object files +*.slo +*.lo +*.o + +# Compiled Dynamic libraries +*.so +*.dylib + +# Compiled Static libraries +*.lai +*.la +*.a + +# build trees +DEBUG*/* +BUILD*/* +RELEASE*/* +TEST*/* + +# cmake +CMakeCache.txt +CMakeFiles +Makefile +cmake_install.cmake +install_manifest.txt + +# vim +~* +*.swp +*.swo + +# python +__pycache__/ +*.py[cod] +*$py.class +.ipynb_checkpoints diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a2502a9efcb27b5705d011796db01f5b6b0667ce..89ad5bdae05807ce929ffe83229665adcfc9975f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: eicweb.phy.anl.gov:4567/eic/npdet/npdet:latest +image: eicweb.phy.anl.gov:4567/eic/npdet/npdet:latest default: artifacts: @@ -88,6 +88,7 @@ cal_test_3_zdc_neutrons_reader: tags: - sodium script: + - source /etc/profile - root -b -q calorimeters/zdc_neutrons_reader.cxx allow_failure: true @@ -107,19 +108,30 @@ track_test_1_dummy_test: - bash trackers/dummy_test.sh allow_failure: true -roman_pot_benchmark: +roman_pot_nhits: stage: benchmarks tags: - sodium script: + - source /etc/profile - root -b -q trackers/simple_tracking.cxx+ allow_failure: true +roman_pot_eta: + stage: benchmarks + tags: + - sodium + script: + - source /etc/profile + - root -b -q trackers/roman_pot_hit_eta.cxx+ + allow_failure: true + zdc_benchmark: stage: benchmarks tags: - sodium script: + - source /etc/profile - ls -lrth sim_output - root -b -q calorimeters/simple_checking.cxx+ allow_failure: true @@ -178,6 +190,5 @@ deploy_results: # - cd doc && doxygen Doxyfile && mv doxygen_output/html/ ../public/ # artifacts: # paths: - # - public - # only: + # - public # only: # - master diff --git a/calorimeters/run_simulation_zdc.sh b/calorimeters/run_simulation_zdc.sh index 76216c4b313af59c29eec22e294b8d4c0cc4615a..abcccd9bfd23bd47173d59585fa9bac9953ca674 100755 --- a/calorimeters/run_simulation_zdc.sh +++ b/calorimeters/run_simulation_zdc.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /usr/local/bin/thisdd4hep.sh +source /etc/profile ddsim --runType batch --numberOfEvents 100 \ --compactFile ./calorimeters/ZDC_example.xml \ diff --git a/trackers/roman_pot_hit_eta.cxx b/trackers/roman_pot_hit_eta.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ebe3b06c65f339789ecc6ae7c9151122e6a029fd --- /dev/null +++ b/trackers/roman_pot_hit_eta.cxx @@ -0,0 +1,62 @@ +//R__LOAD_LIBRARY(libfmt.so) +//#include "fmt/core.h" +R__LOAD_LIBRARY(libDDG4IO.so) +// +//#include "DD4hep/Detector.h" +#include "DDG4/Geant4Data.h" +//#include "DDRec/CellIDPositionConverter.h" +//#include "DDRec/SurfaceManager.h" +//#include "DDRec/Surface.h" +#include "ROOT/RDataFrame.hxx" +// +//#include "lcio2/MCParticleData.h" +//#include "lcio2/ReconstructedParticleData.h" + +//#include "Math/Vector3D.h" +//#include "Math/Vector4D.h" +//#include "Math/VectorUtil.h" +#include "TCanvas.h" +//#include "TLegend.h" +//#include "TMath.h" +//#include "TRandom3.h" +//#include "TFile.h" +//#include "TH1F.h" +//#include "TH1D.h" +//#include "TTree.h" +#include "TChain.h" +//#include "TF1.h" +#include <random> +//#include "lcio2/TrackerRawDataData.h" +//#include "lcio2/TrackerRawData.h" + +void roman_pot_hit_eta(const char* fname = "./sim_output/roman_pot_out.root"){ + + ROOT::EnableImplicitMT(); // Tell ROOT you want to go parallel + double degree = TMath::Pi()/180.0; + + TChain* t = new TChain("EVENT"); + t->Add(fname); + + ROOT::RDataFrame d0(*t); + auto hits_eta = [&](const std::vector<dd4hep::sim::Geant4Tracker::Hit*>& hits){ + std::vector<double> result; + for (const auto& h: hits){ + result.push_back(h->momentum.eta()); + } + return result; + }; + + auto d1 = d0.Define("hits_eta", hits_eta, {"ForwardRomanPotHits"}); + + auto h1 = d1.Histo1D(TH1D("h1", "hits_eta", 300, 0,20), "hits_eta"); + auto n1 = h1->GetMean(); + std::cout << "Pseudorapidity of hits: " << n1 << std::endl; + TCanvas* c = new TCanvas(); + h1->DrawClone(); + + if (n1 < 5) { + std::quick_exit(1); + } + +} + diff --git a/trackers/roman_pot_simu.sh b/trackers/roman_pot_simu.sh index 7f15f490dcdcaf8694db65736c28304c8c728a44..5d2daaa36db1d1220dc0b05537e2f5d961b4057c 100755 --- a/trackers/roman_pot_simu.sh +++ b/trackers/roman_pot_simu.sh @@ -1,6 +1,6 @@ #!/bin/bash -source /usr/local/bin/thisdd4hep.sh +source /etc/profile ddsim --runType batch -N 300 \ --inputFiles ./data/forward_ions.hepmc \