diff --git a/.gitignore b/.gitignore index 555a2beb5b9b82f76bf2dabd227cb5e2e9af266a..c347b86104ffe490a049be365637f07c41c44a21 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ tmp.* .idea/** cmake-debug-build/** +.vscode/** diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4c9843953aedfea314e7996b98c26f44531b52e1..2ea66e119261eeefee05057b7ff9d805615490f3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,7 @@ build_image: - mkdir build - cd build - set +e && source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh; set -e - - set +e && asetup --input=../../calypso/asetup.faser master,latest,Athena; set -e + - set +e && asetup --input=../../calypso/asetup.faser Athena,22.0.18; set -e - cmake ../../calypso - make -j 3 artifacts: @@ -41,7 +41,7 @@ test_unittest: - yum -y install man - cd build - set +e && source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh; set -e - - set +e && asetup --input=../../calypso/asetup.faser master,latest,Athena; set -e + - set +e && asetup --input=../../calypso/asetup.faser Athena,22.0.18; set -e - set +e && source `find . -name 'setup.sh'`; set -e - ctest -j12 dependencies: diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000000000000000000000000000000000000..0653a28ac6ecf2e00d3ae1d0f2f95b5c55013ebe --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,17 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/cvmfs/sft.cern.ch/lcg/releases/gcc/8.3.0-cebb0/x86_64-centos7/bin/gcc", + "cStandard": "c99", + "cppStandard": "c++17", + "intelliSenseMode": "clang-x64", + "compileCommands": "${workspaceFolder}/build/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Control/CalypsoExample/SimHitExample/CMakeLists.txt b/Control/CalypsoExample/SimHitExample/CMakeLists.txt index cf8ec5638c3427e05a6a2b2f19f2023b19ee9b13..69c640d5916a82853ac556a399cb8a0074895ade 100644 --- a/Control/CalypsoExample/SimHitExample/CMakeLists.txt +++ b/Control/CalypsoExample/SimHitExample/CMakeLists.txt @@ -3,7 +3,7 @@ atlas_subdir( SimHitExample ) atlas_add_component( SimHitExample src/SimHitAlg.cxx src/components/SimHitExample_entries.cxx - LINK_LIBRARIES AthenaBaseComps GeneratorObjects TrackerSimEvent + LINK_LIBRARIES AthenaBaseComps GeneratorObjects TrackerSimEvent ScintSimEvent ) atlas_install_joboptions( share/*.py ) \ No newline at end of file diff --git a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx index 1f7888a545367241ee960e4bb457a699e6ffc030..b36f7a61da7f946aa783aa7a2fa6ed4ce39d7e68 100644 --- a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx +++ b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx @@ -18,12 +18,33 @@ StatusCode SimHitAlg::initialize() ATH_CHECK(histSvc()->regHist("/HIST/modulesSide1", m_moduleSide1)); ATH_CHECK(histSvc()->regHist("/HIST/modulesSide2", m_moduleSide2)); + m_plate_preshower = new TH2D("plate", "Scint Hit Plate", 3, -1, 1, 4, 0, 1 ); + m_plate_trigger = new TH2D("plate", "Scint Hit Plate", 3, -1, 1, 4, 0, 1 ); + m_plate_veto = new TH2D("plate", "Scint Hit Plate", 3, -1, 1, 4, 0, 1 ); + ATH_CHECK(histSvc()->regHist("/HIST/plate_preshower", m_plate_preshower)); + ATH_CHECK(histSvc()->regHist("/HIST/plate_trigger", m_plate_trigger)); + ATH_CHECK(histSvc()->regHist("/HIST/plate_veto", m_plate_veto)); + // initialize data handle keys ATH_CHECK( m_mcEventKey.initialize() ); ATH_CHECK( m_faserSiHitKey.initialize() ); + + //Sav things + ATH_CHECK( m_preshowerHitKey.initialize() ); + ATH_CHECK( m_triggerHitKey.initialize() ); + ATH_CHECK( m_vetoHitKey.initialize() ); + ATH_MSG_INFO( "Using GenEvent collection with key " << m_mcEventKey.key()); ATH_MSG_INFO( "Using Faser SiHit collection with key " << m_faserSiHitKey.key()); + + ATH_MSG_INFO( "Using ScintHit collection with key " << m_preshowerHitKey.key()); + ATH_MSG_INFO( "Using ScintHit collection with key " << m_triggerHitKey.key()); + ATH_MSG_INFO( "Using ScintHit collection with key " << m_vetoHitKey.key()); + + return StatusCode::SUCCESS; + + } StatusCode SimHitAlg::execute() @@ -36,6 +57,14 @@ StatusCode SimHitAlg::execute() SG::ReadHandle<FaserSiHitCollection> h_siHits(m_faserSiHitKey); ATH_MSG_INFO("Read FaserSiHitCollection with " << h_siHits->size() << " hits"); + SG::ReadHandle<ScintHitCollection> h_preshowerHits(m_preshowerHitKey); + ATH_MSG_INFO("Read ScintHitCollection/Preshower with " << h_preshowerHits->size() << " hits"); + SG::ReadHandle<ScintHitCollection> h_triggerHits(m_triggerHitKey); + ATH_MSG_INFO("Read ScintHitCollection/Trigger with " << h_triggerHits->size() << " hits"); + SG::ReadHandle<ScintHitCollection> h_vetoHits(m_vetoHitKey); + ATH_MSG_INFO("Read ScintHitCollectionVeto with " << h_vetoHits->size() << " hits"); + + // Since we have no pile-up, there should always be a single GenEvent in the container const HepMC::GenEvent* ev = (*h_mcEvents)[0]; if (ev == nullptr) @@ -46,25 +75,58 @@ StatusCode SimHitAlg::execute() ATH_MSG_INFO("Event contains " << ev->particles_size() << " truth particles" ); // The hit container might be empty because particles missed the wafers - if (h_siHits->size() == 0) return StatusCode::SUCCESS; - - // Loop over all hits; print and fill histogram - for (const FaserSiHit& hit : *h_siHits) - { - hit.print(); - m_hist->Fill( hit.energyLoss() ); - m_module->Fill( hit.getModule(), hit.getRow() ); - if (hit.getSensor() == 0) + //if (h_siHits->size() == 0) return StatusCode::SUCCESS; + + if (h_siHits->size()!=0){ + // Loop over all hits; print and fill histogram + for (const FaserSiHit& hit : *h_siHits) { - m_moduleSide1->Fill( hit.getModule(), hit.getRow()); + hit.print(); + m_hist->Fill( hit.energyLoss() ); + m_module->Fill( hit.getModule(), hit.getRow() ); + if (hit.getSensor() == 0) + { + m_moduleSide1->Fill( hit.getModule(), hit.getRow()); + } + else + { + m_moduleSide2->Fill( hit.getModule(), hit.getRow()); + } + } - else + } + + if (h_preshowerHits->size()!=0){ + for (const ScintHit& hit : *h_preshowerHits) { - m_moduleSide2->Fill( hit.getModule(), hit.getRow()); + hit.print(); + m_hist->Fill(hit.energyLoss()); + m_plate_preshower->Fill(hit.getStation(),hit.getPlate(),hit.energyLoss()); + } + } + if (h_triggerHits->size()!=0){ + for (const ScintHit& hit : *h_triggerHits) + { + hit.print(); + m_hist->Fill(hit.energyLoss()); + m_plate_trigger->Fill(hit.getStation(),hit.getPlate(),hit.energyLoss()); + + } } + if (h_vetoHits->size()!=0){ + for (const ScintHit& hit : *h_vetoHits) + { + hit.print(); + m_hist->Fill(hit.energyLoss()); + m_plate_veto->Fill(hit.getStation(),hit.getPlate(),hit.energyLoss()); + + } + } + + return StatusCode::SUCCESS; } diff --git a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h index ae775330b7cac07ed7e19cd1f13c063a11b0ba8c..773fc3171f7821193b3d18186401939206194743 100644 --- a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h +++ b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h @@ -1,8 +1,10 @@ #include "AthenaBaseComps/AthHistogramAlgorithm.h" #include "GeneratorObjects/McEventCollection.h" #include "TrackerSimEvent/FaserSiHitCollection.h" +#include "ScintSimEvent/ScintHitCollection.h" //New Sav #include <TH1.h> + /* SimHit reading example - Ryan Rice-Smith, UC Irvine */ class SimHitAlg : public AthHistogramAlgorithm @@ -22,9 +24,20 @@ class SimHitAlg : public AthHistogramAlgorithm TH2* m_moduleSide1; TH2* m_moduleSide2; + //ScintHit Histograms + TH2* m_plate_preshower; + TH2* m_plate_trigger; + TH2* m_plate_veto; + // Read handle keys for data containers // Any other event data can be accessed identically // Note the key names ("GEN_EVENT" or "SCT_Hits") are Gaudi properties and can be configured at run-time SG::ReadHandleKey<McEventCollection> m_mcEventKey { this, "McEventCollection", "GEN_EVENT" }; SG::ReadHandleKey<FaserSiHitCollection> m_faserSiHitKey { this, "FaserSiHitCollection", "SCT_Hits" }; + + //PreshowerHits, TriggerHits, VetoHits Sav new stuff + SG::ReadHandleKey<ScintHitCollection> m_scintHitKey { this, "ScintHitCollection", "Scint_Hits" }; //template. remove later + SG::ReadHandleKey<ScintHitCollection> m_preshowerHitKey { this, "ScintHitCollection", "PreshowerHits" }; + SG::ReadHandleKey<ScintHitCollection> m_triggerHitKey { this, "ScintHitCollection", "TriggerHits" }; + SG::ReadHandleKey<ScintHitCollection> m_vetoHitKey { this, "ScintHitCollection", "VetoHits" }; }; \ No newline at end of file