diff --git a/.gitignore b/.gitignore index 04088e1..7a2065d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ build athena sim/macro/tmp*.mac + +# macOs +.DS_STORE diff --git a/CMakeLists.txt b/CMakeLists.txt index 88ed40b..d33e23a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) project(IRT - VERSION 1.0.2 + VERSION 2.0.0 LANGUAGES CXX ) @@ -9,18 +9,22 @@ cmake_policy(SET CMP0079 NEW) # allow `target_link_libraries` from any dir #---------------------------------------------------------------------------- # options -option(EVALUATION "Build evaluation programs" OFF) -option(DELPHES "Delphes card production" ON) +option(EVALUATION "Build evaluation programs" OFF) +option(DELPHES "Delphes card production" ON) +option(IRT_ROOT_IO "Generate dictionary for ROOT I/O of libIRT objects" ON) #---------------------------------------------------------------------------- # dependencies -find_package(ROOT 6.0.00 REQUIRED COMPONENTS RIO Hist Tree ROOTDataFrame) +list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS}) +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +find_package(ROOT 6 REQUIRED COMPONENTS Core RIO Hist Tree) include(${ROOT_USE_FILE}) #---------------------------------------------------------------------------- # flags +include(GNUInstallDirs) # standard GNU installation include(CheckCXXCompilerFlag) set(CMAKE_CXX_FLAGS "-std=c++0x") @@ -40,18 +44,15 @@ endif() #---------------------------------------------------------------------------- # IRT library -set(IRT_LIB IRT) - -include_directories( +# headers +include_directories( ${PROJECT_SOURCE_DIR}/include ${ROOT_INCLUDE_DIRS} - - # For now assume that newly installed edm4eic::(CherenkovPID, ...) event structures are available - # in the same place where IRT is supposed to be installed; - ${CMAKE_INSTALL_PREFIX}/include ) -file(GLOB HEADERS ${PROJECT_SOURCE_DIR}/include/*.h ) +file(GLOB HEADERS ${PROJECT_SOURCE_DIR}/include/*.h) +list(FILTER HEADERS EXCLUDE REGEX "LinkDef\\.h$") +# sources set(IRT_SRC ${PROJECT_SOURCE_DIR}/source/ParametricSurface.cc ${PROJECT_SOURCE_DIR}/source/SphericalSurface.cc @@ -61,28 +62,43 @@ set(IRT_SRC ${PROJECT_SOURCE_DIR}/source/FlatSurface.cc ${PROJECT_SOURCE_DIR}/source/IRT.cc ${PROJECT_SOURCE_DIR}/source/ChargedParticle.cc - ${PROJECT_SOURCE_DIR}/source/DigitizedHit.cc ${PROJECT_SOURCE_DIR}/source/GeantImport.cc ${PROJECT_SOURCE_DIR}/source/Configuration.cc ${PROJECT_SOURCE_DIR}/source/Calibration.cc ${PROJECT_SOURCE_DIR}/source/Digitization.cc ${PROJECT_SOURCE_DIR}/source/ReconstructionFactory.cc - - G__IRT.cxx ) +if(IRT_ROOT_IO) + set(IRT_DICT G__${CMAKE_PROJECT_NAME}) + list(APPEND IRT_SRC ${IRT_DICT}.cxx) +endif() -set(IRT_ROOTMAP ${CMAKE_CURRENT_BINARY_DIR}/lib${IRT_LIB}_rdict.pcm ${CMAKE_CURRENT_BINARY_DIR}/lib${IRT_LIB}.rootmap ) -root_generate_dictionary(G__IRT ${HEADERS} LINKDEF irtLinkDef.h) - -add_library(${IRT_LIB} SHARED ${IRT_SRC} ) -target_link_libraries(${IRT_LIB} ${ROOT_LIBRARIES} EG ) -target_compile_options(${IRT_LIB} PRIVATE -Wall -Wno-misleading-indentation) -target_include_directories(${IRT_LIB} PUBLIC +# library target +add_library(${CMAKE_PROJECT_NAME} SHARED ${IRT_SRC} ) +target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Wno-misleading-indentation) +if(NOT IRT_ROOT_IO) + # disable calling of `ClassDef` etc. if not generating ROOT dictionary + message(STATUS "NOTE: disabling ROOT dictionary generation") + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC DISABLE_ROOT_IO) +endif() +target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC $ $ ) +# ROOT I/O dictionary generation +if(IRT_ROOT_IO) + set(IRT_ROOTMAP + ${CMAKE_CURRENT_BINARY_DIR}/lib${CMAKE_PROJECT_NAME}_rdict.pcm + ${CMAKE_CURRENT_BINARY_DIR}/lib${CMAKE_PROJECT_NAME}.rootmap + ) + root_generate_dictionary(${IRT_DICT} ${HEADERS} LINKDEF include/irtLinkDef.h) +endif() + +# linking +target_link_libraries(${CMAKE_PROJECT_NAME} ROOT::Core ROOT::RIO ROOT::Rint ROOT::Tree ROOT::EG) + #---------------------------------------------------------------------------- # optional targets @@ -99,47 +115,50 @@ endif() install(FILES ${HEADERS} - DESTINATION include/IRT + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME} ) -install(TARGETS ${IRT_LIB} - EXPORT ${PROJECT_NAME}Targets - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/IRT -) -install(FILES - ${IRT_ROOTMAP} - DESTINATION lib +install(TARGETS ${CMAKE_PROJECT_NAME} + EXPORT ${CMAKE_PROJECT_NAME}Targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME} ) +if(IRT_ROOT_IO) + install(FILES + ${IRT_ROOTMAP} + DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +endif() #---------------------------------------------------------------------------- # package config include(CMakePackageConfigHelpers) -install(EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Targets.cmake - DESTINATION lib/IRT + +install(EXPORT ${CMAKE_PROJECT_NAME}Targets + FILE ${CMAKE_PROJECT_NAME}Targets.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME} ) -set(TARGETS_INSTALL_PATH lib/IRT/IRTTargets.cmake) +set(TARGETS_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}/${CMAKE_PROJECT_NAME}Targets.cmake) configure_package_config_file( - cmake/IRTConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/IRTConfig.cmake - INSTALL_DESTINATION lib/IRT - PATH_VARS TARGETS_INSTALL_PATH + cmake/${CMAKE_PROJECT_NAME}Config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME} + PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR TARGETS_INSTALL_PATH ) write_basic_package_version_file( - "IRTConfigVersion.cmake" + "${CMAKE_PROJECT_NAME}ConfigVersion.cmake" VERSION ${VERSION} COMPATIBILITY SameMajorVersion ) install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/IRTConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/IRTConfigVersion.cmake - DESTINATION lib/IRT + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME} ) diff --git a/cmake/IRTConfig.cmake.in b/cmake/IRTConfig.cmake.in index 907e121..102d9ff 100644 --- a/cmake/IRTConfig.cmake.in +++ b/cmake/IRTConfig.cmake.in @@ -1,3 +1,5 @@ @PACKAGE_INIT@ include("@PACKAGE_TARGETS_INSTALL_PATH@") +set_and_check(IRT_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") +set_and_check(IRT_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@") check_required_components(IRT) diff --git a/delphes/CMakeLists.txt b/delphes/CMakeLists.txt index e12784b..8ad6fd2 100644 --- a/delphes/CMakeLists.txt +++ b/delphes/CMakeLists.txt @@ -28,6 +28,6 @@ TARGET_LINK_LIBRARIES(${DELPHES_LIB} ${ROOT_LIBRARIES} EG ) #---------------------------------------------------------------------------- -INSTALL(FILES ${DELPHES_ROOTMAP} DESTINATION lib) -install(TARGETS ${DELPHES_LIB} DESTINATION lib) +INSTALL(FILES ${DELPHES_ROOTMAP} DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ${DELPHES_LIB} DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/delphes/include/DelphesConfig.h b/delphes/include/DelphesConfig.h index c66fbfb..52e01d7 100644 --- a/delphes/include/DelphesConfig.h +++ b/delphes/include/DelphesConfig.h @@ -37,7 +37,9 @@ class MassHypothesis: public TObject { double m_Threshold; +#ifndef DISABLE_ROOT_IO ClassDef(MassHypothesis, 1) +#endif }; class MomentumRange: public TObject { @@ -76,7 +78,9 @@ class MomentumRange: public TObject { std::vector m_SigmaValues; MomentumRange::range m_Range; +#ifndef DISABLE_ROOT_IO ClassDef(MomentumRange, 2) +#endif }; class EtaRange: public TObject { @@ -143,7 +147,9 @@ class EtaRange: public TObject { double m_Min, m_Max; +#ifndef DISABLE_ROOT_IO ClassDef(EtaRange, 1) +#endif }; class DelphesConfig: public TObject { @@ -267,7 +273,9 @@ class DelphesConfig: public TObject { // FIXME: need seed setting method; TRandom m_rndm; //! +#ifndef DISABLE_ROOT_IO ClassDef(DelphesConfig, 1) +#endif }; #endif diff --git a/delphes/include/DelphesConfigDIRC.h b/delphes/include/DelphesConfigDIRC.h index 690caf3..41d96a7 100644 --- a/delphes/include/DelphesConfigDIRC.h +++ b/delphes/include/DelphesConfigDIRC.h @@ -2,7 +2,7 @@ #ifndef _DELPHES_CONFIG_DIRC_ #define _DELPHES_CONFIG_DIRC_ -#include +#include "DelphesConfig.h" class DelphesConfigDIRC: public DelphesConfig { public: @@ -59,7 +59,9 @@ class DelphesConfigDIRC: public DelphesConfig { std::string m_ParameterizationMap; +#ifndef DISABLE_ROOT_IO ClassDef(DelphesConfigDIRC, 1) +#endif }; #endif diff --git a/delphes/include/DelphesConfigRICH.h b/delphes/include/DelphesConfigRICH.h index d8e786f..a1ef43c 100644 --- a/delphes/include/DelphesConfigRICH.h +++ b/delphes/include/DelphesConfigRICH.h @@ -4,7 +4,7 @@ #ifndef _DELPHES_CONFIG_RICH_ #define _DELPHES_CONFIG_RICH_ -#include +#include "DelphesConfig.h" class DelphesConfigRICH: public DelphesConfig { public: @@ -33,7 +33,9 @@ class DelphesConfigRICH: public DelphesConfig { return GetTrackingSmearing(momentum.Mag(), momentum.Eta()); }; +#ifndef DISABLE_ROOT_IO ClassDef(DelphesConfigRICH, 3) +#endif }; #endif diff --git a/delphes/include/DelphesConfigTOF.h b/delphes/include/DelphesConfigTOF.h index 1552685..e5a803c 100644 --- a/delphes/include/DelphesConfigTOF.h +++ b/delphes/include/DelphesConfigTOF.h @@ -2,7 +2,7 @@ #ifndef _DELPHES_CONFIG_TOF_ #define _DELPHES_CONFIG_TOF_ -#include +#include "DelphesConfig.h" class DelphesConfigTOF: public DelphesConfig { public: @@ -73,7 +73,9 @@ class DelphesConfigTOF: public DelphesConfig { double m_InstallationDistance; +#ifndef DISABLE_ROOT_IO ClassDef(DelphesConfigTOF, 2) +#endif }; #endif diff --git a/delphes/include/DrcPidFast.h b/delphes/include/DrcPidFast.h index b1d5743..366433e 100644 --- a/delphes/include/DrcPidFast.h +++ b/delphes/include/DrcPidFast.h @@ -4,11 +4,11 @@ #ifndef DrcPidFast_h #define DrcPidFast_h 1 -#include "TFile.h" -#include "TH2F.h" -#include "TVector3.h" -#include "TRandom.h" -#include "TF1.h" +#include +#include +#include +#include +#include #include diff --git a/delphes/source/DelphesConfig.cc b/delphes/source/DelphesConfig.cc index e66c2f4..1fba304 100644 --- a/delphes/source/DelphesConfig.cc +++ b/delphes/source/DelphesConfig.cc @@ -1,7 +1,7 @@ #include -#include +#include "DelphesConfig.h" #define _ERROR_(message) { printf("\n\n %s\n", message); exit(1); } diff --git a/delphes/source/DelphesConfigDIRC.cc b/delphes/source/DelphesConfigDIRC.cc index 27fedee..876d13a 100644 --- a/delphes/source/DelphesConfigDIRC.cc +++ b/delphes/source/DelphesConfigDIRC.cc @@ -1,6 +1,6 @@ -#include -#include +#include "DelphesConfigDIRC.h" +#include "DrcPidFast.h" // ------------------------------------------------------------------------------------- diff --git a/delphes/source/DelphesConfigRICH.cc b/delphes/source/DelphesConfigRICH.cc index 05666a4..ca38ab1 100644 --- a/delphes/source/DelphesConfigRICH.cc +++ b/delphes/source/DelphesConfigRICH.cc @@ -1,6 +1,6 @@ -#include +#include "DelphesConfigRICH.h" // ------------------------------------------------------------------------------------- diff --git a/delphes/source/DelphesConfigTOF.cc b/delphes/source/DelphesConfigTOF.cc index c5de9e8..6439753 100644 --- a/delphes/source/DelphesConfigTOF.cc +++ b/delphes/source/DelphesConfigTOF.cc @@ -1,5 +1,5 @@ -#include +#include "DelphesConfigTOF.h" // Speed of light; [mm/ps]; #define _SoL_ ( 0.29979) diff --git a/detectors/CMakeLists.txt b/detectors/CMakeLists.txt deleted file mode 100644 index e173aa3..0000000 --- a/detectors/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -cmake_minimum_required(VERSION 3.12 FATAL_ERROR) - -# CMP0074: find_package() uses _ROOT variables -cmake_policy(SET CMP0074 NEW) - -PROJECT(athena) - -set(CMAKE_CXX_STANDARD 17) -find_package( DD4hep REQUIRED COMPONENTS DDCore DDG4) -find_package(IRT REQUIRED) - -SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-int-to-pointer-cast") - -#----------------------------------------------------------------------------------- - -set(a_lib_name athena) - -dd4hep_configure_output() - -dd4hep_add_plugin(${a_lib_name} SOURCES - src/PFRICH_geo.cpp - src/DRICH_geo.cpp - ) - -target_link_libraries(${a_lib_name} - PUBLIC DD4hep::DDCore IRT - ) - -#----------------------------------------------------------------------------------- - -# Install the detector description files. -install(DIRECTORY compact/ - DESTINATION share/${PROJECT_NAME}/compact - FILES_MATCHING PATTERN "*.xml" - ) diff --git a/detectors/compact/drich.xml b/detectors/compact/drich.xml deleted file mode 100644 index f11497d..0000000 --- a/detectors/compact/drich.xml +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -- `DRICH_debug_optics`: 1 = all components become vacuum, except for mirrors; test opticalphotons from IP - 2 = all components become vacuum, except for mirrors and `gasvol`, test charged particles from IP - 0 = off -- `DRICH_debug_mirror`: 1 = draw full mirror shape for single sector; 0 = off -- `DRICH_debug_sensors`: 1 = draw full sensor sphere for a single sector; 0 = off - - - - - - - - - - - - -### dRICh: ***d***ual ***R***ing ***I***maging ***Ch***erenkov detector - - - - - - -#### Vessel -- the dRICh vessel is composed of two parts: - - tank: cylindrical region containing most of the detector components - - snout: conical region at the front of the vessel, containing the aerogel -- dimensions: - - `zmin`: z-position of vessel front plane - - `length`: overall z-length of the full vessel - - `snout_length`: length of cone-shaped snout region, housing aerogel - - `rmin0` and `rmin1`: bore radius at front plane and back plane, respectively - - `rmax0` and `rmax1`: outer radius of snout at front plane and snout-back (tank-front) plane, respectively - - `rmax2`: outer radius of tank, the main cylindrical vessel volume - - `nsectors`: number of azimuthal sectors - - `wall_thickness`: thickness of radial walls - - `window_thickness`: thickness of entrance and exit disks - - - - - - -#### Radiator -- radiator is defined in a wedge of azimuthal space, composed of aerogel and a - filter; the filter is applied to the back of the aerogel, so that it separates - the aerogel and gas radiators -- dimensions: - - `phiw`: azimuthal width of wedge - - `thickness`: radiator thickness, defined separately for aerogel and filter - - `frontplane`: front of the aerogel, w.r.t. front plane of the vessel envelope - - `pitch`: controls the angle of the radiator (0=vertical) - - - - - - - - - -#### Spherical mirror -- spherical mirrors are built from spherical patches, and positioned near the - vessel back plane, separately for each sector -- dimensions: - - `backplane`: the position of the maximum z-plane intersected by the sphere, - w.r.t. the back plane of vessel envelope - - `rmin` and `rmax`: polar angle boundaries - - `phiw`: azimuthal width of one sector - - `thickness` is the radial thickness of the mirror; note that `backplane` is given for the - reflective mirror surface, the inner radius of the sphere - - `focus_tune*` are tuning parameters for the focal region: - - `focus_tune_z` and `focus_tune_x` will move the focal region, with respect - to the sensor sphere center (i.e., set both to zero for focus at the sensor sphere center - (ignoring spherical aberrations effects)) -- other settings: - - `debug`: set to 1 so draw reference sphere instead, view with y-clipping - - - - - - -#### Sensors - - - - - - -##### Sensor module -- based on [Hamamatsu H13700 MAPMT](https://www.hamamatsu.com/us/en/product/type/H13700/index.html): - - not ideal for a magnetic field, SiPM matrix would be better - - effective area: 48.5x48.5 mm - - enclosure size: 52x52 mm - - 16x16 channel matrix (cf. readout segmentation below) - - pixel size: 3x3 mm -- dimensions: - - `side`: side length of the square module - - `thickness`: thickness of the sensor module - - `gap`: provides room between the squares, to help prevent them from overlapping - - note: the value of `side` will determine how many sensors there are, since the - sensor placement algorithm will try to place as many as it can in the specified - spherical patch below - - - - - - -##### Sensor sphere -- sensors will be placed on a sphere, using a "disco ball" tiling algorithm; each - sector has its own sensor sphere - - sphere dimensions: - - `centerx` and `centerz`: sphere center, defined w.r.t. vessel front plane, - for the sector on +x axis - - `radius`: radius of the sensor sphere - - other settings: - - `debug`: set to 1 so draw reference sphere instead, view with y-clipping -- sensors will be limited to a patch of the sphere - - patch dimensions: - - `phiw`: defines half the angle between the azimuthal boundaries - - `rmin` and `rmax`: radial cut boundaries - - `zmin`: z-plane cut - - - - - - - - - - - -#### Readout -- segmentation: square matrix of pixels - - `grid_size_x,y`: size of each sensor, but note we must divide sensor size - by 1 less than the number of pixels, to account for fenceposting - - `offset_x,y`: specified such that the `x` and `y` indicators are unsigned -- indicators and `cellID` bits: - - | indicator | offset | length | - |-----------|--------|--------| - | dRICh ID | 0 | 8 | - | sector | 8 | 3 | - | sensor | 11 | 12 | - | x pixel | 23 | 16 | - | y pixel | 39 | 16 | - - - - - - system:8,sector:3,module:12,x:23:16,y:16 - - - - - diff --git a/detectors/compact/pfrich.xml b/detectors/compact/pfrich.xml deleted file mode 100644 index 93335f3..0000000 --- a/detectors/compact/pfrich.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -- `PFRICH_debug_optics`: 1 = all components become vacuum; test opticalphotons from IP - 2 = all components become vacuum, except for `gasvol`, test charged particles from IP - 0 = off - - - - - - - - - - -### pfRICH: Proximity Focusing RICH - - - - - - -#### Vessel -- dimensions: - - `zmin`: z-position of vessel front plane - - `length`: overall z-length of the full vessel - - `rmin0` and `rmin1`: bore radius at front plane and back plane, respectively - - `rmax0` and `rmax1`: outer radius of vessel, at front plane and back plane, respectively - - `nsectors`: number of azimuthal sectors - - `wall_thickness`: thickness of radial walls - - `window_thickness`: thickness of entrance and exit disks - - - - - - -#### Radiator -- radiator is defined in a wedge of azimuthal space, composed of aerogel and a - filter; the filter is applied to the back of the aerogel, so that it separates - the aerogel and gas radiators -- dimensions: - - `frontplane`: front of the aerogel, w.r.t. front plane of the vessel envelope - - `rmin` and `rmax`: inner and outer radius - - `phiw`: azimuthal width of wedge - - `thickness`: radiator thickness, defined separately for aerogel and filter - - `pitch`: controls the angle of the radiator (0=vertical) - - - - - - - - - - -#### Sensors - - - - - - -##### Sensor module -- based on Hamamatsu S13361-3050AE-08 - - effective area: 24.0 x 24.0 mm - - enclosure size: 25.8 x 25.8 mm - - pixel size: 3x3 mm (8x8 matrix) - - thickness: 1.5 mm -- dimensions: - - `side`: side length of the square module - - `thickness`: thickness of the sensor module - - `gap`: provides room between the squares, to help prevent them from overlapping - - note: the values of `side` and `gap` will determine how many sensors there are, since the - sensor placement algorithm will try to place as many as it can in the specified region - - - - - - -##### Sensor plane -- sensors will be placed on a plane - - plane dimensions: - - `frontplane`: z-position of the sensor plane active surface (e.g., photocathode), w.r.t aerogel backplane; - absolute value of this number is the distance between aerogel/filter boundary and sensor surface - - `rmin`: minimum radial position of a sensor's centroid - - `rmax`: maximum radial position of a sensor's centroid - - - - - - - - - -#### Readout -- segmentation: square matrix of pixels - - `grid_size_x,y`: size of each sensor, but note we must divide sensor size - by 1 less than the number of pixels, to account for fenceposting - - `offset_x,y`: specified such that the `x` and `y` indicators are unsigned -- indicators and `cellID` bits: - - | indicator | offset | length | - |-----------|--------|--------| - | pfRICH ID | 0 | 8 | - | sensor | 8 | 12 | - | x pixel | 20 | 16 | - | y pixel | 36 | 16 | - - - - - - system:8,module:12,x:20:16,y:16 - - - - - diff --git a/detectors/compact/subsystem_views/drich_only.xml b/detectors/compact/subsystem_views/drich_only.xml deleted file mode 100644 index 5769b9e..0000000 --- a/detectors/compact/subsystem_views/drich_only.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/detectors/compact/subsystem_views/pfrich_only.xml b/detectors/compact/subsystem_views/pfrich_only.xml deleted file mode 100644 index 786dbfa..0000000 --- a/detectors/compact/subsystem_views/pfrich_only.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/detectors/src/DRICH_geo.cpp b/detectors/src/DRICH_geo.cpp deleted file mode 100644 index 9cc81b0..0000000 --- a/detectors/src/DRICH_geo.cpp +++ /dev/null @@ -1,669 +0,0 @@ -//========================================================================== -// dRICh: Dual Ring Imaging Cherenkov Detector -//-------------------------------------------------------------------------- -// -// Author: Christopher Dilks (Duke University) -// -// - Design Adapted from Standalone Fun4all and GEMC implementations -// [ Evaristo Cisbani, Cristiano Fanelli, Alessio Del Dotto, et al. ] -// -//========================================================================== - -#include - -#include "DDRec/DetectorData.h" -#include "DD4hep/DetFactoryHelper.h" -#include "DD4hep/Printout.h" - -using namespace dd4hep; -using namespace dd4hep::rec; - -#include -#include -#include -#include -#include - -// create the detector -static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) { - xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - - DetElement det(detName, detID); - xml::Component dims = detElem.dimensions(); - OpticalSurfaceManager surfMgr = desc.surfaceManager(); - - //@@@ Create output file and a geometry object pointer; - std::string str = detName; std::transform(str.begin(), str.end(), str.begin(), ::tolower); - auto fout = new TFile((str + "-config.root").c_str(), "RECREATE"); - auto geometry = new CherenkovDetectorCollection(); - // Yes, a single detector per .root file in this environment; - auto detector = geometry->AddNewDetector(detName.c_str()); - - // attributes ----------------------------------------------------------- - // - vessel - double vesselZmin = dims.attr(_Unicode(zmin)); - double vesselLength = dims.attr(_Unicode(length)); - double vesselRmin0 = dims.attr(_Unicode(rmin0)); - double vesselRmin1 = dims.attr(_Unicode(rmin1)); - double vesselRmax0 = dims.attr(_Unicode(rmax0)); - double vesselRmax1 = dims.attr(_Unicode(rmax1)); - double vesselRmax2 = dims.attr(_Unicode(rmax2)); - double snoutLength = dims.attr(_Unicode(snout_length)); - int nSectors = dims.attr(_Unicode(nsectors)); - double wallThickness = dims.attr(_Unicode(wall_thickness)); - double windowThickness = dims.attr(_Unicode(window_thickness)); - auto vesselMat = desc.material(detElem.attr(_Unicode(material))); - auto gasvolMat = desc.material(detElem.attr(_Unicode(gas))); - auto vesselVis = desc.visAttributes(detElem.attr(_Unicode(vis_vessel))); - auto gasvolVis = desc.visAttributes(detElem.attr(_Unicode(vis_gas))); - // - radiator (applies to aerogel and filter) - auto radiatorElem = detElem.child(_Unicode(radiator)); - double radiatorRmin = radiatorElem.attr(_Unicode(rmin)); - double radiatorRmax = radiatorElem.attr(_Unicode(rmax)); - double radiatorPhiw = radiatorElem.attr(_Unicode(phiw)); - double radiatorPitch = radiatorElem.attr(_Unicode(pitch)); - double radiatorFrontplane = radiatorElem.attr(_Unicode(frontplane)); - // - aerogel - auto aerogelElem = radiatorElem.child(_Unicode(aerogel)); - auto aerogelMat = desc.material(aerogelElem.attr(_Unicode(material))); - auto aerogelVis = desc.visAttributes(aerogelElem.attr(_Unicode(vis))); - double aerogelThickness = aerogelElem.attr(_Unicode(thickness)); - // - filter - auto filterElem = radiatorElem.child(_Unicode(filter)); - auto filterMat = desc.material(filterElem.attr(_Unicode(material))); - auto filterVis = desc.visAttributes(filterElem.attr(_Unicode(vis))); - double filterThickness = filterElem.attr(_Unicode(thickness)); - // - mirror - auto mirrorElem = detElem.child(_Unicode(mirror)); - auto mirrorMat = desc.material(mirrorElem.attr(_Unicode(material))); - auto mirrorVis = desc.visAttributes(mirrorElem.attr(_Unicode(vis))); - auto mirrorSurf = surfMgr.opticalSurface(mirrorElem.attr(_Unicode(surface))); - double mirrorBackplane = mirrorElem.attr(_Unicode(backplane)); - double mirrorThickness = mirrorElem.attr(_Unicode(thickness)); - double mirrorRmin = mirrorElem.attr(_Unicode(rmin)); - double mirrorRmax = mirrorElem.attr(_Unicode(rmax)); - double mirrorPhiw = mirrorElem.attr(_Unicode(phiw)); - double focusTuneZ = mirrorElem.attr(_Unicode(focus_tune_z)); - double focusTuneX = mirrorElem.attr(_Unicode(focus_tune_x)); - // - sensor module - auto sensorElem = detElem.child(_Unicode(sensors)).child(_Unicode(module)); - auto sensorMat = desc.material(sensorElem.attr(_Unicode(material))); - auto sensorVis = desc.visAttributes(sensorElem.attr(_Unicode(vis))); - auto sensorSurf = surfMgr.opticalSurface(sensorElem.attr(_Unicode(surface))); - double sensorSide = sensorElem.attr(_Unicode(side)); - double sensorGap = sensorElem.attr(_Unicode(gap)); - double sensorThickness = sensorElem.attr(_Unicode(thickness)); - // - sensor sphere - auto sensorSphElem = detElem.child(_Unicode(sensors)).child(_Unicode(sphere)); - double sensorSphRadius = sensorSphElem.attr(_Unicode(radius)); - double sensorSphCenterX = sensorSphElem.attr(_Unicode(centerx)); - double sensorSphCenterZ = sensorSphElem.attr(_Unicode(centerz)); - // - sensor sphere patch cuts - auto sensorSphPatchElem = detElem.child(_Unicode(sensors)).child(_Unicode(sphericalpatch)); - double sensorSphPatchPhiw = sensorSphPatchElem.attr(_Unicode(phiw)); - double sensorSphPatchRmin = sensorSphPatchElem.attr(_Unicode(rmin)); - double sensorSphPatchRmax = sensorSphPatchElem.attr(_Unicode(rmax)); - double sensorSphPatchZmin = sensorSphPatchElem.attr(_Unicode(zmin)); - // - debugging switches - int debug_optics_mode = detElem.attr(_Unicode(debug_optics)); - bool debug_mirror = mirrorElem.attr(_Unicode(debug)); - bool debug_sensors = sensorSphElem.attr(_Unicode(debug)); - - auto qradiatorElem = detElem.child(_Unicode(radiator)); - //auto readoutElem = detElem.child(_Unicode(readouts));//.child(_Unicode(readout)); - //auto id = readoutElem.attr(_Unicode(id)); - //printf("@S@ %s\n", id.c_str()); - - // if debugging optics, override some settings - bool debug_optics = debug_optics_mode > 0; - if(debug_optics) { - printout(WARNING,"DRICH_geo","DEBUGGING DRICH OPTICS"); - switch(debug_optics_mode) { - case 1: vesselMat = aerogelMat = filterMat = sensorMat = gasvolMat = desc.material("VacuumOptical"); break; - case 2: vesselMat = aerogelMat = filterMat = sensorMat = desc.material("VacuumOptical"); break; - default: printout(FATAL,"DRICH_geo","UNKNOWN debug_optics_mode"); return det; - }; - aerogelVis = sensorVis = mirrorVis; - gasvolVis = vesselVis = desc.invisible(); - }; - - - // BUILD VESSEL ==================================================================== - /* - `vessel`: aluminum enclosure, the mother volume of the dRICh - * - `gasvol`: gas volume, which fills `vessel`; all other volumes defined below - * are children of `gasvol` - * - the dRICh vessel geometry has two regions: the snout refers to the conic region - * in the front, housing the aerogel, while the tank refers to the cylindrical - * region, housing the rest of the detector components - */ - - // derived attributes - double tankLength = vesselLength - snoutLength; - double vesselZmax = vesselZmin + vesselLength; - - // snout solids - double boreDelta = vesselRmin1 - vesselRmin0; - Cone vesselSnout( - snoutLength/2.0, - vesselRmin0, - vesselRmax0, - vesselRmin0 + boreDelta * snoutLength / vesselLength, - vesselRmax1 - ); - Cone gasvolSnout( - /* note: `gasvolSnout` extends a bit into the tank, so it touches `gasvolTank` - * - the extension distance is equal to the tank `windowThickness`, so the - * length of `gasvolSnout` == length of `vesselSnout` - * - the extension backplane radius is calculated using similar triangles - */ - snoutLength/2.0, - vesselRmin0 + wallThickness, - vesselRmax0 - wallThickness, - vesselRmin0 + boreDelta * (snoutLength-windowThickness) / vesselLength + wallThickness, - vesselRmax1 - wallThickness + windowThickness * (vesselRmax1 - vesselRmax0) / snoutLength - ); - - // tank solids - Cone vesselTank( - tankLength/2.0, - vesselSnout.rMin2(), - vesselRmax2, - vesselRmin1, - vesselRmax2 - ); - Cone gasvolTank( - tankLength/2.0 - windowThickness, - gasvolSnout.rMin2(), - vesselRmax2 - wallThickness, - vesselRmin1 + wallThickness, - vesselRmax2 - wallThickness - ); - - // snout + tank solids - UnionSolid vesselUnion( - vesselTank, - vesselSnout, - Position(0., 0., -vesselLength/2.) - ); - UnionSolid gasvolUnion( - gasvolTank, - gasvolSnout, - Position(0., 0., -vesselLength/2. + windowThickness) - ); - - // extra solids for `debug_optics` only - Box vesselBox(1001,1001,1001); - Box gasvolBox(1000,1000,1000); - - // choose vessel and gasvol solids (depending on `debug_optics_mode` (0=disabled)) - Solid vesselSolid, gasvolSolid; - switch(debug_optics_mode) { - case 0: vesselSolid=vesselUnion; gasvolSolid=gasvolUnion; break; // `!debug_optics` - case 1: vesselSolid=vesselBox; gasvolSolid=gasvolBox; break; - case 2: vesselSolid=vesselBox; gasvolSolid=gasvolUnion; break; - }; - - // volumes - Volume vesselVol(detName, vesselSolid, vesselMat); - Volume gasvolVol(detName+"_gas", gasvolSolid, gasvolMat); - vesselVol.setVisAttributes(vesselVis); - gasvolVol.setVisAttributes(gasvolVis); - - // Used in several places; - TVector3 nx(1,0,0), ny(0,-1,0); - - // Get access to the readout structure decoder; may want to simply call desc.readout("DRICHHits"); - const auto &rdspecs = desc.readouts(); - if (rdspecs.size() != 1) { - printout(FATAL,"DRICH_geo","Expect a single readout structure in XML file"); - return det; - } //if - // Do not mess up with casting of (*desc.readouts().begin()).second; just call desc.readout(); - const auto decoder = desc.readout((*rdspecs.begin()).first.c_str()).idSpec().decoder(); - const auto &mvalue = (*decoder)["module"], &svalue = (*decoder)["sector"]; - uint64_t msmask = mvalue.mask() | svalue.mask(); - detector->SetReadoutCellMask(msmask); - unsigned moffset = mvalue.offset(), soffset = svalue.offset(); - - { - // FIXME: Z-location does not really matter here, right?; but Z-axis orientation does; - auto boundary = new FlatSurface(TVector3(0,0,vesselZmin), nx, ny); - - // FIXME: have no connection to GEANT G4LogicalVolume pointers; however all is needed - // is to make them unique so that std::map work internally; resort to using integers, - // who cares; material pointer can seemingly be '0', and effective refractive index - // for all radiators will be assigned at the end by hand; FIXME: should assign it on - // per-photon basis, at birth, like standalone GEANT code does; - for(int isec=0; isecSetContainerVolume(detector, "GasVolume", isec, (G4LogicalVolume*)(0x0), 0, boundary); - } - - // How about PlacedVolume::transformation2mars(), guys?; FIXME: make it simple for now, - // assuming no rotations involved; [cm]; - double vesselOffset = (vesselZmin + vesselZmax)/2; - - // reference positions - // - the vessel is created such that the center of the cylindrical tank volume - // coincides with the origin; this is called the "origin position" of the vessel - // - when the vessel (and its children volumes) is placed, it is translated in - // the z-direction to be in the proper ATHENA-integration location - // - these reference positions are for the frontplane and backplane of the vessel, - // with respect to the vessel origin position - auto originFront = Position(0., 0., -tankLength/2.0 - snoutLength ); - auto originBack = Position(0., 0., tankLength/2.0 ); - - // initialize sensor centroids (used for mirror parameterization below); this is - // the average (x,y,z) of the placed sensors, w.r.t. originFront - double sensorCentroidX = 0; - double sensorCentroidZ = 0; - int sensorCount = 0; - - // sensitive detector type - sens.setType("photoncounter"); - - // place gas volume - PlacedVolume gasvolPV = vesselVol.placeVolume(gasvolVol,Position(0, 0, 0)); - DetElement gasvolDE(det, "gasvol_de", 0); - gasvolDE.setPlacement(gasvolPV); - - // place mother volume (vessel) - Volume motherVol = desc.pickMotherVolume(det); - // FIXME: usage of this translation assumes gasvolume2vessel translation is (0,0,0); - auto gasvolume2master = Position(0, 0, vesselZmin) - originFront; - printf("@M@ %7.1f %7.1f %7.1f\n", gasvolume2master.x()/mm, gasvolume2master.y()/mm, gasvolume2master.z()/mm); - PlacedVolume vesselPV = motherVol.placeVolume(vesselVol, gasvolume2master); - vesselPV.addPhysVolID("system", detID); - det.setPlacement(vesselPV); - - // [0,0]: have neither access to G4VSolid nor to G4Material; IRT code does not care; fine; - auto pd = new CherenkovPhotonDetector(0, 0); - // FIXME: '0' stands for the unknown (and irrelevant) G4LogicalVolume; - geometry->AddPhotonDetector(detector, 0, pd); - - // SECTOR LOOP ////////////////////////////////// - for(int isec=0; isecAddFlatRadiator(detector, "Aerogel", isec, (G4LogicalVolume*)(0x1), 0, surface, aerogelThickness/mm); - } //if - - // filter placement and surface properties -#if _LATER_ - if(!debug_optics) { - auto filterPV = gasvolVol.placeVolume(filterVol, - RotationZ(sectorRotation) // rotate about beam axis to sector - * Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront - * RotationY(radiatorPitch) // change polar angle - * Translation3D(0., 0., (aerogelThickness+filterThickness)/2.) // move to aerogel backplane - ); - DetElement filterDE(det, Form("filter_de%d", isec), isec); - filterDE.setPlacement(filterPV); - //SkinSurface filterSkin(desc, filterDE, Form("mirror_optical_surface%d", isec), filterSurf, filterVol); - //filterSkin.isValid(); - - /*if (!isec)*/ { - TVector3 nx(1,0,0), ny(0,-1,0); - - // FIXME: create a small air gap in the geometry as well; - auto surface = new FlatSurface((1/mm)*TVector3(0,0,vesselOffset+filterPV.position().z()+0.01*mm), nx, ny); - geometry->AddFlatRadiator(detector, isec, (G4LogicalVolume*)(0x2), 0, surface, filterThickness/mm); - } //if - }; -#endif - - - // BUILD MIRRORS ==================================================================== - - // derive spherical mirror parameters `(zM,xM,rM)`, for given image point - // coordinates `(zI,xI)` and `dO`, defined as the z-distance between the - // object and the mirror surface - // - all coordinates are specified w.r.t. the object point coordinates - // - this is point-to-point focusing, but it can be used to effectively steer - // parallel-to-point focusing - double zM,xM,rM; - auto FocusMirror = [&zM,&xM,&rM](double zI, double xI, double dO) { - zM = dO*zI / (2*dO-zI); - xM = dO*xI / (2*dO-zI); - rM = dO - zM; - }; - - // attributes, re-defined w.r.t. IP, needed for mirror positioning - double zS = sensorSphCenterZ + vesselZmin; // sensor sphere attributes - double xS = sensorSphCenterX; - double rS = sensorSphRadius; - double B = vesselZmax - mirrorBackplane; // distance between IP and mirror back plane - - // focus 1: set mirror to focus IP on center of sensor sphere `(zS,xS)` - /*double zF = zS; - double xF = xS; - FocusMirror(zF,xF,B);*/ - - // focus 2: move focal region along sensor sphere radius, according to `focusTuneLong` - // - specifically, along the radial line which passes through the approximate centroid - // of the sensor region `(sensorCentroidZ,sensorCentroidX)` - // - `focusTuneLong` is the distance to move, given as a fraction of `sensorSphRadius` - // - `focusTuneLong==0` means `(zF,xF)==(zS,xS)` - // - `focusTuneLong==1` means `(zF,xF)` will be on the sensor sphere, near the centroid - /* - double zC = sensorCentroidZ + vesselZmin; - double xC = sensorCentroidX; - double slopeF = (xC-xS) / (zC-zS); - double thetaF = std::atan(std::fabs(slopeF)); - double zF = zS + focusTuneLong * sensorSphRadius * std::cos(thetaF); - double xF = xS - focusTuneLong * sensorSphRadius * std::sin(thetaF); - //FocusMirror(zF,xF,B); - - // focus 3: move along line perpendicular to focus 2's radial line, - // according to `focusTunePerp`, with the same numerical scale as `focusTuneLong` - zF += focusTunePerp * sensorSphRadius * std::cos(M_PI/2-thetaF); - xF += focusTunePerp * sensorSphRadius * std::sin(M_PI/2-thetaF); - FocusMirror(zF,xF,B); - */ - - // focus 4: use (z,x) coordinates for tune parameters - double zF = zS + focusTuneZ; - double xF = xS + focusTuneX; - FocusMirror(zF,xF,B); - - /* - // print some calculated parameters, viz. mirror attributes - //printf("(zC,xC) = ( %.2f, %.2f )\n",zC,xC); - //printf("zS = %f\n",zS); - //printf("xS = %f\n",xS); - //printf("B = %f\n",B); - printf("zM = %f\n",zM); - printf("xM = %f\n",xM); - printf("rM = %f\n",rM); - */ - - // re-define mirror attributes to be w.r.t vessel front plane - double mirrorCenterZ = zM - vesselZmin; - double mirrorCenterX = xM; - double mirrorRadius = rM; - - // spherical mirror patch cuts and rotation - double mirrorThetaRot = std::asin(mirrorCenterX/mirrorRadius); - double mirrorTheta1 = mirrorThetaRot - std::asin((mirrorCenterX-mirrorRmin)/mirrorRadius); - double mirrorTheta2 = mirrorThetaRot + std::asin((mirrorRmax-mirrorCenterX)/mirrorRadius); - - // if debugging, draw full sphere - if(debug_mirror) { mirrorTheta1=0; mirrorTheta2=M_PI; /*mirrorPhiw=2*M_PI;*/ }; - - // solid : create sphere at origin, with specified angular limits; - // phi limits are increased to fill gaps (overlaps are cut away later) - Sphere mirrorSolid1( - mirrorRadius, - mirrorRadius + mirrorThickness, - mirrorTheta1, - mirrorTheta2, - -40*degree, - 40*degree - ); - - // mirror placement transformation (note: transformations are in reverse order) - auto mirrorPos = Position(mirrorCenterX, 0., mirrorCenterZ) + originFront; - Transform3D mirrorPlacement( - Translation3D(mirrorPos.x(), mirrorPos.y(), mirrorPos.z()) // re-center to specified position - * RotationY(-mirrorThetaRot) // rotate about vertical axis, to be within vessel radial walls - ); - - // cut overlaps with other sectors using "pie slice" wedges, to the extent specified - // by `mirrorPhiw` - Tube pieSlice( 0.01*cm, vesselRmax2, tankLength/2.0, -mirrorPhiw/2.0, mirrorPhiw/2.0); - IntersectionSolid mirrorSolid2( pieSlice, mirrorSolid1, mirrorPlacement ); - - // mirror volume, attributes, and placement - Volume mirrorVol(detName+"_mirror_"+secName, mirrorSolid2, mirrorMat); - mirrorVol.setVisAttributes(mirrorVis); - { - Transform3D slice2gasvolume = RotationZ(sectorRotation)*Translation3D(0,0,0); - { - auto translation = (slice2gasvolume*mirrorPlacement).Translation();//.Vect(); - //auto x = (trans * (Position(0, 0, vesselZmin) - originFront)).Translation();//.Vect(); - //auto rotation = trans.Rotation(); - //const TGeoMatrix& localToGlobal = filterDE.nominal().worldTransformation(); - //localToGlobal.LocalToMaster(l, g); - double xx, yy, zz; - translation.GetComponents(xx, yy, zz); - printf("@M@ %10.5f %10.5f %10.5f\n", xx/mm, yy/mm, zz/mm); - - auto surface = new SphericalSurface((1/mm)*TVector3( - xx+gasvolume2master.x(), - yy+gasvolume2master.y(), - zz+gasvolume2master.z()), - mirrorRadius/mm); - //#if _TODAY_ - detector->AddOpticalBoundary(isec, new OpticalBoundary(detector->GetContainerVolume(), surface, false)); - - // Complete the radiator volume description; this is the rear side of the container gas volume; - detector->GetRadiator("GasVolume")->m_Borders[isec].second = surface; - //#endif - } - auto mirrorPV2 = gasvolVol.placeVolume(mirrorVol, slice2gasvolume); // rotate about beam axis to sector - //RotationZ(sectorRotation) // rotate about beam axis to sector - // * Translation3D(0,0,0) - // ); - - // properties - DetElement mirrorDE(det, Form("mirror_de%d", isec), isec); - mirrorDE.setPlacement(mirrorPV2); - { - //double l[3] = {0.0, 0.0, 0.0}, g[3], m[3]; - //mirrorPV2.ptr()->LocalToMaster(l, g); - //vesselPV. ptr()->LocalToMaster(g, m); - //printf("@M@ %10.5f %10.5f %10.5f\n", m[0]/mm, m[1]/mm, m[2]/mm); - } - SkinSurface mirrorSkin(desc, mirrorDE, Form("mirror_optical_surface%d", isec), mirrorSurf, mirrorVol); - mirrorSkin.isValid(); - } - - - // BUILD SENSORS ==================================================================== - - // if debugging sphere properties, restrict number of sensors drawn - if(debug_sensors) { sensorSide = 2*M_PI*sensorSphRadius / 64; }; - - // solid and volume: single sensor module - Box sensorSolid(sensorSide/2., sensorSide/2., sensorThickness/2.); - Volume sensorVol(detName+"_sensor_"+secName, sensorSolid, sensorMat); - sensorVol.setVisAttributes(sensorVis); - - auto sensorSphPos = Position(sensorSphCenterX, 0., sensorSphCenterZ) + originFront; - - // sensitivity - if(!debug_optics) sensorVol.setSensitiveDetector(sens); - - // SENSOR MODULE LOOP ------------------------ - /* ALGORITHM: generate sphere of positions - * - NOTE: there are two coordinate systems here: - * - "global" the main ATHENA coordinate system - * - "generator" (vars end in `Gen`) is a local coordinate system for - * generating points on a sphere; it is related to the global system by - * a rotation; we do this so the "patch" (subset of generated - * positions) of sensors we choose to build is near the equator, where - * point distribution is more uniform - * - PROCEDURE: loop over `thetaGen`, with subloop over `phiGen`, each divided evenly - * - the number of points to generate depends how many sensors (+`sensorGap`) - * can fit within each ring of constant `thetaGen` or `phiGen` - * - we divide the relevant circumference by the sensor - * size(+`sensorGap`), and this number is allowed to be a fraction, - * because likely we don't care about generating a full sphere and - * don't mind a "seam" at the overlap point - * - if we pick a patch of the sphere near the equator, and not near - * the poles or seam, the sensor distribution will appear uniform - */ - - // initialize module number for this sector - int imod=0; - - // thetaGen loop: iterate less than "0.5 circumference / sensor size" times - double nTheta = M_PI*sensorSphRadius / (sensorSide+sensorGap); - for(int t=0; t<(int)(nTheta+0.5); t++) { - double thetaGen = t/((double)nTheta) * M_PI; - - // phiGen loop: iterate less than "circumference at this latitude / sensor size" times - double nPhi = 2*M_PI * sensorSphRadius * std::sin(thetaGen) / (sensorSide+sensorGap); - for(int p=0; p<(int)(nPhi+0.5); p++) { - double phiGen = p/((double)nPhi) * 2*M_PI - M_PI; // shift to [-pi,pi] - - // determine global phi and theta - // - convert {radius,thetaGen,phiGen} -> {xGen,yGen,zGen} - double xGen = sensorSphRadius * std::sin(thetaGen) * std::cos(phiGen); - double yGen = sensorSphRadius * std::sin(thetaGen) * std::sin(phiGen); - double zGen = sensorSphRadius * std::cos(thetaGen); - // - convert {xGen,yGen,zGen} -> global {x,y,z} via rotation - double x = zGen; - double y = xGen; - double z = yGen; - // - convert global {x,y,z} -> global {phi,theta} - double phi = std::atan2(y,x); - double theta = std::acos(z/sensorSphRadius); - - // shift global coordinates so we can apply spherical patch cuts - double zCheck = z + sensorSphCenterZ; - double xCheck = x + sensorSphCenterX; - double yCheck = y; - double rCheck = std::hypot(xCheck,yCheck); - double phiCheck = std::atan2(yCheck,xCheck); - - // patch cut - bool patchCut = - std::fabs(phiCheck) < sensorSphPatchPhiw - && zCheck > sensorSphPatchZmin - && rCheck > sensorSphPatchRmin - && rCheck < sensorSphPatchRmax; - if(debug_sensors) patchCut = std::fabs(phiCheck) < sensorSphPatchPhiw; - if(patchCut) { - - // append sensor position to centroid calculation - if(isec==0) { - sensorCentroidX += xCheck; - sensorCentroidZ += zCheck; - sensorCount++; - }; - - // placement (note: transformations are in reverse order) - // - transformations operate on global coordinates; the corresponding - // generator coordinates are provided in the comments - auto sensorPV = gasvolVol.placeVolume(sensorVol, - RotationZ(sectorRotation) // rotate about beam axis to sector - * Translation3D(sensorSphPos.x(), sensorSphPos.y(), sensorSphPos.z()) // move sphere to reference position - * RotationX(phiGen) // rotate about `zGen` - * RotationZ(thetaGen) // rotate about `yGen` - * Translation3D(sensorSphRadius, 0., 0.) // push radially to spherical surface - * RotationY(M_PI/2) // rotate sensor to be compatible with generator coords - * RotationZ(-M_PI/2) // correction for readout segmentation mapping - ); - - { - // nx[] and ny[] orientation should be the same as in pfRICH, right?; - double xxl[3] = {0.0, 0.0, 0.0}, bff[3], xxg[3], nxl[3] = {1.0, 0.0, 0.0}, nyl[3] = {0.0, 1.0, 0.0}, nxg[3], nyg[3]; - sensorPV.ptr()->LocalToMaster(xxl, bff); - vesselPV.ptr()->LocalToMaster(bff, xxg); - //printf("@G@ %10.5f %10.5f %10.5f\n", xxg[0]/mm, xxg[1]/mm, xxg[2]/mm); - - sensorPV.ptr()->LocalToMasterVect(nxl, nxg); - sensorPV.ptr()->LocalToMasterVect(nyl, nyg); - { - TVector3 nx(nxg), ny(nyg); - //printf("@G@ %10.5f %10.5f %10.5f\n", xxg[0]/mm, xxg[1]/mm, xxg[2]/mm); - auto surface = new FlatSurface((1/mm)*TVector3(xxg), nx, ny); - - // This is the essential {sector,module} part of the cell index; - uint64_t imodsec = ((uint64_t(imod) << moffset) | (uint64_t(isec) << soffset)) & msmask; - detector->CreatePhotonDetectorInstance(isec, pd, imodsec, surface); - - // properties: {isec,imod} pair will be encoded later on as 'imodsec' bit pattern; - sensorPV.addPhysVolID("sector", isec).addPhysVolID("module", imod); - // Do not mind to use 'imodsec' index here as well; - DetElement sensorDE(det, Form("sensor_de%d_%d", isec, imod), imodsec); - sensorDE.setPlacement(sensorPV); - if(!debug_optics) { - SkinSurface sensorSkin(desc, sensorDE, Form("sensor_optical_surface%d", isec), sensorSurf, sensorVol); - sensorSkin.isValid(); - }; - - //printf("@S@ -> %4d -> %4d %4d %4d %4d\n", sensorPV.ptr()->GetNumber(), - // isec, imod, imodsec, sensorDE.id()); - } - } - - // increment sensor module number - imod++; - - }; // end patch cuts - }; // end phiGen loop - }; // end thetaGen loop - - // calculate centroid sensor position - if(isec==0) { - sensorCentroidX /= sensorCount; - sensorCentroidZ /= sensorCount; - }; - - // END SENSOR MODULE LOOP ------------------------ - - }; // END SECTOR LOOP ////////////////////////// - - - //@@@ Write the geometry out as a custom TObject class instance; FIXME: unify pfRICH & dRICH; - { - // FIXME: PFRICH_geo.cpp cut'n'paste; C2F6, aerogel, acrylic in this sequence; - const char *name[] = {"GasVolume", "Aerogel"};//, "Filter"}; - double n[] = { 1.0000, 1.0170};//, 1.5017}; - //double n[] = {1.00080, 1.0170, 1.5017}; - - for(unsigned ir=0; irGetRadiator(name[ir]); - - if (radiator) radiator->SetReferenceRefractiveIndex(n[ir]); - } //for ir - - geometry->Write(); - fout->Close(); - } - - return det; -}; - -// clang-format off -DECLARE_DETELEMENT(athena_DRICH, createDetector) diff --git a/detectors/src/PFRICH_geo.cpp b/detectors/src/PFRICH_geo.cpp deleted file mode 100644 index bcd2946..0000000 --- a/detectors/src/PFRICH_geo.cpp +++ /dev/null @@ -1,365 +0,0 @@ -//---------------------------------- -// pfRICH: Proximity Focusing RICH -// Author: C. Dilks -//---------------------------------- - -#include - -#include "DDRec/DetectorData.h" -#include "DD4hep/DetFactoryHelper.h" -#include "DD4hep/Printout.h" - -#include -#include -#include -#include -#include - -using namespace dd4hep; - -// create the detector -static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) { - xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - - DetElement det(detName, detID); - xml::Component dims = detElem.dimensions(); - OpticalSurfaceManager surfMgr = desc.surfaceManager(); - - //@@@ Create output file and a geometry object pointer; - std::string str = detName; std::transform(str.begin(), str.end(), str.begin(), ::tolower); - auto fout = new TFile((str + "-config.root").c_str(), "RECREATE"); - auto geometry = new CherenkovDetectorCollection(); - // Yes, a single detector per .root file in this environment; - auto detector = geometry->AddNewDetector(detName.c_str()); - - // attributes ----------------------------------------------------------- - // - vessel - double vesselLength = dims.attr(_Unicode(length)); - double vesselZmin = dims.attr(_Unicode(zmin)); - double vesselZmax = dims.attr(_Unicode(zmax)); - double vesselRmin0 = dims.attr(_Unicode(rmin0)); - double vesselRmin1 = dims.attr(_Unicode(rmin1)); - double vesselRmax0 = dims.attr(_Unicode(rmax0)); - double vesselRmax1 = dims.attr(_Unicode(rmax1)); - int nSectors = dims.attr(_Unicode(nsectors)); - double wallThickness = dims.attr(_Unicode(wall_thickness)); - double windowThickness = dims.attr(_Unicode(window_thickness)); - auto vesselMat = desc.material(detElem.attr(_Unicode(material))); - auto gasvolMat = desc.material(detElem.attr(_Unicode(gas))); - auto vesselVis = desc.visAttributes(detElem.attr(_Unicode(vis_vessel))); - auto gasvolVis = desc.visAttributes(detElem.attr(_Unicode(vis_gas))); - // - radiator (applies to aerogel and filter) - auto radiatorElem = detElem.child(_Unicode(radiator)); - double radiatorRmin = radiatorElem.attr(_Unicode(rmin)); - double radiatorRmax = radiatorElem.attr(_Unicode(rmax)); - double radiatorPhiw = radiatorElem.attr(_Unicode(phiw)); - double radiatorPitch = radiatorElem.attr(_Unicode(pitch)); - double radiatorFrontplane = radiatorElem.attr(_Unicode(frontplane)); - // - aerogel - auto aerogelElem = radiatorElem.child(_Unicode(aerogel)); - auto aerogelMat = desc.material(aerogelElem.attr(_Unicode(material))); - auto aerogelVis = desc.visAttributes(aerogelElem.attr(_Unicode(vis))); - double aerogelThickness = aerogelElem.attr(_Unicode(thickness)); - // - filter - auto filterElem = radiatorElem.child(_Unicode(filter)); - auto filterMat = desc.material(filterElem.attr(_Unicode(material))); - auto filterVis = desc.visAttributes(filterElem.attr(_Unicode(vis))); - double filterThickness = filterElem.attr(_Unicode(thickness)); - // - sensor module - auto sensorElem = detElem.child(_Unicode(sensors)).child(_Unicode(module)); - auto sensorMat = desc.material(sensorElem.attr(_Unicode(material))); - auto sensorVis = desc.visAttributes(sensorElem.attr(_Unicode(vis))); - auto sensorSurf = surfMgr.opticalSurface(sensorElem.attr(_Unicode(surface))); - double sensorSide = sensorElem.attr(_Unicode(side)); - double sensorGap = sensorElem.attr(_Unicode(gap)); - double sensorThickness = sensorElem.attr(_Unicode(thickness)); - // - sensor plane - auto sensorPlaneElem = detElem.child(_Unicode(sensors)).child(_Unicode(plane)); - double sensorPlaneFrontplane = sensorPlaneElem.attr(_Unicode(frontplane)); - double sensorPlaneRmin = sensorPlaneElem.attr(_Unicode(rmin)); - double sensorPlaneRmax = sensorPlaneElem.attr(_Unicode(rmax)); - // - debugging switches - int debug_optics_mode = detElem.attr(_Unicode(debug_optics)); - - // if debugging optics, override some settings - bool debug_optics = debug_optics_mode > 0; - if(debug_optics) { - printout(WARNING,"PFRICH_geo","DEBUGGING PFRICH OPTICS"); - switch(debug_optics_mode) { - case 1: vesselMat = aerogelMat = filterMat = sensorMat = gasvolMat = desc.material("VacuumOptical"); break; - case 2: vesselMat = aerogelMat = filterMat = sensorMat = desc.material("VacuumOptical"); break; - default: printout(FATAL,"PFRICH_geo","UNKNOWN debug_optics_mode"); return det; - }; - aerogelVis = sensorVis; - gasvolVis = vesselVis = desc.invisible(); - }; - - // BUILD VESSEL ////////////////////////////////////// - /* - `vessel`: aluminum enclosure, the mother volume of the pfRICh - * - `gasvol`: gas volume, which fills `vessel`; all other volumes defined below - * are children of `gasvol` - */ - - // tank solids - Cone vesselTank( - vesselLength/2.0, - vesselRmin1, - vesselRmax1, - vesselRmin0, - vesselRmax0 - ); - Cone gasvolTank( - vesselLength/2.0 - windowThickness, - vesselRmin1 + wallThickness, - vesselRmax1 - wallThickness, - vesselRmin0 + wallThickness, - vesselRmax0 - wallThickness - ); - - // extra solids for `debug_optics` only - Box vesselBox(1001,1001,1001); - Box gasvolBox(1000,1000,1000); - - // choose vessel and gasvol solids (depending on `debug_optics_mode` (0=disabled)) - Solid vesselSolid, gasvolSolid; - switch(debug_optics_mode) { - case 0: vesselSolid=vesselTank; gasvolSolid=gasvolTank; break; // `!debug_optics` - case 1: vesselSolid=vesselBox; gasvolSolid=gasvolBox; break; - case 2: vesselSolid=vesselBox; gasvolSolid=gasvolTank; break; - }; - - // volumes - Volume vesselVol(detName, vesselSolid, vesselMat); - Volume gasvolVol(detName+"_gas", gasvolSolid, gasvolMat); - vesselVol.setVisAttributes(vesselVis); - gasvolVol.setVisAttributes(gasvolVis); - - // Used in several places; - TVector3 nx(1,0,0), ny(0,1,0); - - // Get access to the readout structure decoder; may want to simply call desc.readout("DRICHHits"); - const auto &rdspecs = desc.readouts(); - if (rdspecs.size() != 1) { - printout(FATAL,"PFRICH_geo","Expect a single readout structure in XML file"); - return det; - } //if - // Do not mess up with casting of (*desc.readouts().begin()).second; just call desc.readout(); - const auto decoder = desc.readout((*rdspecs.begin()).first.c_str()).idSpec().decoder(); - const auto &mvalue = (*decoder)["module"]; - uint64_t msmask = mvalue.mask(); - detector->SetReadoutCellMask(msmask); - unsigned moffset = mvalue.offset(); - - { - // FIXME: Z-location does not really matter here, right?; but Z-axis orientation does; - auto boundary = new FlatSurface(TVector3(0,0,vesselZmin), nx, ny); - - // FIXME: have no connection to GEANT G4LogicalVolume pointers; however all is needed - // is to make them unique so that std::map works internally; resort to using integers, - // who cares; material pointer can seemingly be '0', and the effective refractive index - // for all radiators will be assigned at the end by hand; FIXME: should assign it on - // per-photon basis, at birth, like standalone GEANT code does; - geometry->SetContainerVolume(detector, "GasVolume", 0, (G4LogicalVolume*)(0x0), 0, boundary); - } - - // How about PlacedVolume::transformation2mars(), guys?; FIXME: make it simple for now, - // assuming no rotations involved; [cm]; - double vesselOffset = (vesselZmin + vesselZmax)/2; - - // reference positions - // - the vessel is created such that the center of the cylindrical tank volume - // coincides with the origin; this is called the "origin position" of the vessel - // - when the vessel (and its children volumes) is placed, it is translated in - // the z-direction to be in the proper ATHENA-integration location - // - these reference positions are for the frontplane and backplane of the vessel, - // with respect to the vessel origin position - auto originFront = Position(0., 0., vesselLength/2.0 ); - auto originBack = Position(0., 0., -vesselLength/2.0 ); - - // sensitive detector type - sens.setType("photoncounter"); - - // place gas volume - PlacedVolume gasvolPV = vesselVol.placeVolume(gasvolVol,Position(0, 0, 0)); - DetElement gasvolDE(det, "gasvol_de", 0); - gasvolDE.setPlacement(gasvolPV); - - // place mother volume (vessel) - Volume motherVol = desc.pickMotherVolume(det); - PlacedVolume vesselPV = motherVol.placeVolume(vesselVol, - Position(0, 0, vesselZmin) - originFront - ); - vesselPV.addPhysVolID("system", detID); - det.setPlacement(vesselPV); - - // SECTOR LOOP ////////////////////////////////// - for(int isec=0; isecAddFlatRadiator(detector, "Aerogel", isec, (G4LogicalVolume*)(0x1), - 0, surface, aerogelThickness/mm); - } //if - - // filter placement and surface properties - if(!debug_optics) { - auto filterPV = gasvolVol.placeVolume(filterVol, - RotationZ(sectorRotation) // rotate about beam axis to sector - * Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront - * RotationY(radiatorPitch) // change polar angle - * Translation3D(0., 0., -(aerogelThickness+filterThickness)/2.) // move to aerogel backplane - ); - DetElement filterDE(det, Form("filter_de%d", isec), isec); - filterDE.setPlacement(filterPV); - //SkinSurface filterSkin(desc, filterDE, Form("mirror_optical_surface%d", isec), filterSurf, filterVol); - //filterSkin.isValid(); - - if (!isec) { - // FIXME: create a small air gap in the geometry as well; - auto surface = new FlatSurface((1/mm)*TVector3(0,0,vesselOffset+filterPV.position().z()-0.01*mm), nx, ny); - geometry->AddFlatRadiator(detector, "Filter", isec, (G4LogicalVolume*)(0x2), 0, surface, filterThickness/mm); - } //if - } //if - }; // END SECTOR LOOP ////////////////////////// - - - // BUILD SENSORS /////////////////////// - - // solid and volume: single sensor module - Box sensorSolid(sensorSide/2., sensorSide/2., sensorThickness/2.); - Volume sensorVol(detName+"_sensor", sensorSolid, sensorMat); - sensorVol.setVisAttributes(sensorVis); - - // sensitivity - if(!debug_optics) sensorVol.setSensitiveDetector(sens); - - // sensor plane positioning: we want |`sensorPlaneFrontplane`| to be the distance between the - // aerogel backplane (i.e., aerogel/filter boundary) and the sensor active surface (e.g, photocathode) - double sensorZpos = radiatorFrontplane - aerogelThickness + sensorPlaneFrontplane - 0.5*sensorThickness; - auto sensorPlanePos = Position(0., 0., sensorZpos) + originFront; // reference position - // miscellaneous - int imod=0; // module number - double tBoxMax = vesselRmax1; // sensors will be tiled in tBox, within annular limits - - // [0,0]: have neither access to G4VSolid nor to G4Material; IRT code does not care; fine; - auto pd = new CherenkovPhotonDetector(0, 0); - // FIXME: '0' stands for the unknown (and irrelevant) G4LogicalVolume; - geometry->AddPhotonDetector(detector, 0, pd); - - // SENSOR MODULE LOOP ------------------------ - /* cartesian tiling loop - * - start at (x=0,y=0), to center the grid - * - loop over positive-x positions; for each, place the corresponding negative-x sensor too - * - nested similar loop over y positions - */ - double sx,sy; - for(double usx=0; usx<=tBoxMax; usx+=sensorSide+sensorGap) { - for(int sgnx=1; sgnx>=(usx>0?-1:1); sgnx-=2) { - for(double usy=0; usy<=tBoxMax; usy+=sensorSide+sensorGap) { - for(int sgny=1; sgny>=(usy>0?-1:1); sgny-=2) { - - //if (imod) continue; - - // sensor (x,y) center - sx = sgnx*usx; - sy = sgny*usy; - - // annular cut - if(std::hypot(sx,sy)sensorPlaneRmax) continue; - - // placement (note: transformations are in reverse order) - auto sensorPV = gasvolVol.placeVolume(sensorVol,Transform3D( - Translation3D(sensorPlanePos.x(), sensorPlanePos.y(), sensorPlanePos.z()) // move to reference position - * Translation3D(sx, sy, 0.) // move to grid position - )); - - // generate LUT for module number -> sensor position, for readout mapping tests - //printf("%d %f %f\n",imod,sensorPV.position().x(),sensorPV.position().y()); - - { - // Assume that photosensors can have different 3D surface parameterizations; - auto surface = new FlatSurface((1/mm)*TVector3(0.0, 0, vesselOffset+sensorPV.position().z()), nx, ny); - - uint64_t imodsec = (uint64_t(imod) << moffset) & msmask; - detector->CreatePhotonDetectorInstance(0, pd, imodsec, surface); - - // Yes, since there are no mirrors in this detector, just close the gas radiator volume by hand (once), - // assuming that all the sensors will be sitting at roughly the same location along the beam line anyway; - if (!imod) detector->GetRadiator("GasVolume")->m_Borders[0].second = - dynamic_cast(surface); - - // properties - sensorPV.addPhysVolID("module", imod); - DetElement sensorDE(det, Form("sensor_de_%d", imod), imodsec); - sensorDE.setPlacement(sensorPV); - if(!debug_optics) { - SkinSurface sensorSkin(desc, sensorDE, "sensor_optical_surface", sensorSurf, sensorVol); // TODO: 3rd arg needs `imod`? - sensorSkin.isValid(); - }; - } - - // increment sensor module number - imod++; - }; - }; - }; - }; - // END SENSOR MODULE LOOP ------------------------ - - //@@@ Write the geometry out as a custom TObject class instance; - { - // FIXME: import from the geometry database; FIXME: crappy style in general; - const char *name[] = {"GasVolume", "Aerogel", "Filter"}; - double n[] = { 1.0000, 1.0195, 1.5017}; - - for(unsigned ir=0; irGetRadiator(name[ir]); - - if (radiator) radiator->SetReferenceRefractiveIndex(n[ir]); - } //for ir - - geometry->Write(); - fout->Close(); - } - - return det; -}; - -// clang-format off -DECLARE_DETELEMENT(athena_PFRICH, createDetector) diff --git a/drich-testIRT.py b/drich-testIRT.py deleted file mode 100644 index 73aed7d..0000000 --- a/drich-testIRT.py +++ /dev/null @@ -1,76 +0,0 @@ -from Gaudi.Configuration import * -from GaudiKernel import SystemOfUnits as units - -from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc -from Configurables import PodioInput -from Configurables import Jug__PID__IRTAlgorithm as IRTAlgorithm - -# Well, for now only need DRICH geometry for this example; -geo_service = GeoSvc("GeoSvc", detectors=["drich_only.xml"]) - -# Input file after 'npsim' pass; -podioevent = EICDataSvc("EventDataSvc", inputs=["drich-data.root"]) - -# S13660-3050AE-08 SiPM quantum efficiency [(wavelength [nm], q.e.)] -# Note: this is consistent with S13361-3050AE-08 (for DRICH) -qe_data = [ - (325, 0.04), - (340, 0.10), - (350, 0.20), - (370, 0.30), - (400, 0.35), - (450, 0.40), - (500, 0.38), - (550, 0.35), - (600, 0.27), - (650, 0.20), - (700, 0.15), - (750, 0.12), - (800, 0.08), - (850, 0.06), - (900, 0.04) -] - -radiators = [ - "Aerogel zbins=5 smearing=gaussian 2mrad rindex=1.0190 attenuation[mm]=48.0", - "GasVolume zbins=10 smearing=gaussian 5mrad rindex=1.00076" -] - -podioinput = PodioInput( - "PodioReader", - # Input collections: MC truth tracks and DRICH raw hits (photons); - collections=["mcparticles", "DRICHHits"], - OutputLevel=DEBUG - ) - -irtrec = IRTAlgorithm( - # Input collections: MC truth tracks and DRICH raw hits (photons); - inputMCParticles="mcparticles", - - # DRICH optics configuration produced by DRICH_geo.cpp code along with the dd4hep XML file; - ConfigFile="drich-config.root", - Radiators=[ (r) for r in radiators ], - - # SiPM PDE; FIXME: units.eV coefficient gives extra x1000 (?); - QEcurve=[ ((1239.84/a), b) for a, b in qe_data ], - # Rebin the QE in that many equidistant bins internally; - QEbins="100", - # SiPM geometric fill factor and "safety factor" for the photon count estimates; - #GeometricEfficiency="1.00", - SafetyFactor="0.70", - ) - -# Output ROOT file; keep the input collections as well, append DRICH PID tables; -out = PodioOutput("out", filename="drich-reco.root") -out.outputCommands = ["keep *"] - -ApplicationMgr( - TopAlg = [podioinput, irtrec, out], - EvtSel = 'NONE', - # Process that many events; - EvtMax = 50000, - ExtSvc = [podioevent], - OutputLevel = DEBUG, - PluginDebugLevel = 2 - ) - diff --git a/evaluation/source/reader.cc b/evaluation/source/reader.cc index 16158d2..6c15166 100644 --- a/evaluation/source/reader.cc +++ b/evaluation/source/reader.cc @@ -11,8 +11,8 @@ #include "dd4pod/TrackerHitCollection.h" // IRT -#include -#include +#include "CherenkovEvent.h" +#include "CherenkovDetectorCollection.h" // Optionally: mimic low wave length cutoff and average QE x Geometric sensor efficiency; #define _WAVE_LENGTH_CUTOFF_ (350.0) diff --git a/include/BitMask.h b/include/BitMask.h index 039af06..9f9a89c 100644 --- a/include/BitMask.h +++ b/include/BitMask.h @@ -19,7 +19,9 @@ class BitMask: public TObject { private: ULong64_t m_Mask; +#ifndef DISABLE_ROOT_IO ClassDef(BitMask,1); +#endif }; #endif diff --git a/include/Calibration.h b/include/Calibration.h index 9365869..f173ae7 100644 --- a/include/Calibration.h +++ b/include/Calibration.h @@ -7,7 +7,7 @@ class TDatabasePDG; #ifndef _CALIBRATION_ #define _CALIBRATION_ -#include +#include "Configuration.h" // 5 degree binning for calibration purposes suffices?; #define _THETA_BIN_COUNT_ (180/5) diff --git a/include/ChargedParticle.h b/include/ChargedParticle.h index f556bb3..fc4ca71 100644 --- a/include/ChargedParticle.h +++ b/include/ChargedParticle.h @@ -6,11 +6,11 @@ #ifndef _CHARGED_PARTICLE_ #define _CHARGED_PARTICLE_ -#include -#include -#include -#include -#include +#include "CherenkovRadiator.h" +#include "RadiatorHistory.h" +#include "TransientParticle.h" +#include "CherenkovPID.h" +#include "DigitizedHit.h" class ChargedParticle: public TransientParticle { public: @@ -102,7 +102,9 @@ class ChargedParticle: public TransientParticle { public: bool m_HadronicInteractionOccured; +#ifndef DISABLE_ROOT_IO ClassDef(ChargedParticle, 6); +#endif }; #endif diff --git a/include/ChargedParticleStep.h b/include/ChargedParticleStep.h index a68beab..8fc8666 100644 --- a/include/ChargedParticleStep.h +++ b/include/ChargedParticleStep.h @@ -23,7 +23,9 @@ class ChargedParticleStep: public TObject { //double m_Length; double m_Time; +#ifndef DISABLE_ROOT_IO ClassDef(ChargedParticleStep, 2); +#endif }; #endif diff --git a/include/CherenkovDetector.h b/include/CherenkovDetector.h index 56fceff..56d3005 100644 --- a/include/CherenkovDetector.h +++ b/include/CherenkovDetector.h @@ -8,7 +8,7 @@ #ifndef _CHERENKOV_DETECTOR_ #define _CHERENKOV_DETECTOR_ -#include +#include "CherenkovPhotonDetector.h" class CherenkovMirrorGroup; class OpticalBoundary; class G4LogicalVolume; @@ -129,6 +129,9 @@ class CherenkovDetector: public TObject { m_OpticalBoundaryStorage.push_back(boundary); }; + // readout ID -> pixel position converter (for external usage) + std::function m_ReadoutIDToPosition; //! + private: TString m_Name; // This is needed for dd4hep cell index decoding; @@ -142,7 +145,9 @@ class CherenkovDetector: public TObject { std::map _m_Radiators; //+std::vector m_MirrorGroups; +#ifndef DISABLE_ROOT_IO ClassDef(CherenkovDetector, 6); +#endif }; #endif diff --git a/include/CherenkovDetectorCollection.h b/include/CherenkovDetectorCollection.h index 3270bbc..b7d0ab7 100644 --- a/include/CherenkovDetectorCollection.h +++ b/include/CherenkovDetectorCollection.h @@ -12,8 +12,8 @@ class G4OpticalSurface; class CherenkovMirror; class CherenkovPhotonDetector; -#include -#include +#include "BitMask.h" +#include "CherenkovDetector.h" #define _STORE_ORPHAN_PHOTONS_ (0x00000001) #define _STORE_REFLECTION_POINTS_ (0x00000002) @@ -149,9 +149,10 @@ class CherenkovDetectorCollection: public BitMask { std::map _m_Detectors; +#ifndef DISABLE_ROOT_IO //std::vector m_OrphanPhotons; - ClassDef(CherenkovDetectorCollection, 2); +#endif // !DISABLE_ROOT_IO }; #endif diff --git a/include/CherenkovEvent.h b/include/CherenkovEvent.h index 04b610a..552a0f9 100644 --- a/include/CherenkovEvent.h +++ b/include/CherenkovEvent.h @@ -4,7 +4,7 @@ #ifndef _CHERENKOV_EVENT_ #define _CHERENKOV_EVENT_ -#include +#include "ChargedParticle.h" class OpticalPhoton; @@ -31,10 +31,11 @@ class CherenkovEvent: public TObject { private: std::set m_ChargedParticles; - std::vector m_OrphanPhotons; +#ifndef DISABLE_ROOT_IO ClassDef(CherenkovEvent, 2); +#endif }; #endif diff --git a/include/CherenkovMirror.h b/include/CherenkovMirror.h index 901798d..17b2505 100644 --- a/include/CherenkovMirror.h +++ b/include/CherenkovMirror.h @@ -2,12 +2,12 @@ #ifndef _CHERENKOV_MIRROR_ #define _CHERENKOV_MIRROR_ -#include -#include -#include -#include -#include -#include +#include "G4Object.h" +#include "FlatSurface.h" +#include "SphericalSurface.h" +#include "CylindricalSurface.h" +#include "ConicalSurface.h" +#include "ParametricSurface.h" class CherenkovWaveLengthRange; @@ -18,7 +18,9 @@ class SurfaceCopy: public G4ObjectCopy { ParametricSurface *m_Surface; +#ifndef DISABLE_ROOT_IO ClassDef(SurfaceCopy, 1); +#endif }; class CherenkovMirror: public G4Object { @@ -45,7 +47,9 @@ class CherenkovMirror: public G4Object { private: G4OpticalSurface *m_MirrorSurface; //! +#ifndef DISABLE_ROOT_IO ClassDef(CherenkovMirror, 1); +#endif }; class FlatMirror: public CherenkovMirror, public FlatSurface { @@ -56,7 +60,9 @@ class FlatMirror: public CherenkovMirror, public FlatSurface { CherenkovMirror(solid, material), FlatSurface(x0, nx, ny, sx, sy) {}; ~FlatMirror() {}; +#ifndef DISABLE_ROOT_IO ClassDef(FlatMirror, 2); +#endif }; class SphericalMirror: public CherenkovMirror, public SphericalSurface { @@ -66,7 +72,9 @@ class SphericalMirror: public CherenkovMirror, public SphericalSurface { CherenkovMirror(solid, material), SphericalSurface(x0, r0) {}; ~SphericalMirror() {}; +#ifndef DISABLE_ROOT_IO ClassDef(SphericalMirror, 2); +#endif }; class CylindricalMirror: public CherenkovMirror, public CylindricalSurface { @@ -76,7 +84,9 @@ class CylindricalMirror: public CherenkovMirror, public CylindricalSurface { CherenkovMirror(solid, material), CylindricalSurface(x0, nz, r0, dz) {}; ~CylindricalMirror() {}; +#ifndef DISABLE_ROOT_IO ClassDef(CylindricalMirror, 1); +#endif }; class ConicalMirror: public CherenkovMirror, public ConicalSurface { @@ -86,7 +96,9 @@ class ConicalMirror: public CherenkovMirror, public ConicalSurface { CherenkovMirror(solid, material), ConicalSurface(x0, nz, r0, r1, dz) {}; ~ConicalMirror() {}; +#ifndef DISABLE_ROOT_IO ClassDef(ConicalMirror, 1); +#endif }; #if 0 @@ -100,7 +112,9 @@ class CherenkovMirrorGroup: public TObject { private: std::vector m_Mirrors; +#ifndef DISABLE_ROOT_IO ClassDef(CherenkovMirrorGroup, 1); +#endif }; #endif diff --git a/include/CherenkovPID.h b/include/CherenkovPID.h index 7f4bbd4..2e85e0d 100644 --- a/include/CherenkovPID.h +++ b/include/CherenkovPID.h @@ -1,4 +1,5 @@ +#include #include #include @@ -56,7 +57,9 @@ class MassHypothesis { class CherenkovPID { public: CherenkovPID( void ) {}; - ~CherenkovPID() {}; + ~CherenkovPID() { + std::for_each(m_Hypotheses.begin(), m_Hypotheses.end(), [](auto* h){ delete h; }); + }; void AddMassHypothesis(double mass) { m_Hypotheses.push_back(new MassHypothesis(mass)); }; unsigned GetHypothesesCount( void ) const { return m_Hypotheses.size(); }; diff --git a/include/CherenkovPhotonDetector.h b/include/CherenkovPhotonDetector.h index f8b6f86..2372472 100644 --- a/include/CherenkovPhotonDetector.h +++ b/include/CherenkovPhotonDetector.h @@ -4,12 +4,12 @@ #ifndef _CHERENKOV_PHOTON_DETECTOR_ #define _CHERENKOV_PHOTON_DETECTOR_ -#include -#include +#include "G4Object.h" +#include "FlatSurface.h" class G4DataInterpolation; -#include +#include "IRT.h" class CherenkovPhotonDetector: public G4Object { public: @@ -89,7 +89,9 @@ class CherenkovPhotonDetector: public G4Object { unsigned m_CopyIdentifierLevel; //! +#ifndef DISABLE_ROOT_IO ClassDef(CherenkovPhotonDetector, 6); +#endif }; #endif diff --git a/include/CherenkovRadiator.h b/include/CherenkovRadiator.h index 7e1ab38..63e98e2 100644 --- a/include/CherenkovRadiator.h +++ b/include/CherenkovRadiator.h @@ -11,7 +11,7 @@ class TH1D; #ifndef _CHERENKOV_RADIATOR_ #define _CHERENKOV_RADIATOR_ -#include +#include "ParametricSurface.h" class G4LogicalVolume; class G4RadiatorMaterial; @@ -37,7 +37,7 @@ class CherenkovRadiator: public TObject { m_ReferenceRefractiveIndex(0.0), m_ReferenceAttenuationLength(0.0), m_TrajectoryBinCount(1), m_Smearing(0.0), m_GaussianSmearing(false), m_CalibrationPhotonCount(0), m_DetectedPhotonCount(0), - m_DetectedToCalibrationPhotonRatio(0.0), m_YieldStat(0), m_YieldCff(0.0) { + m_DetectedToCalibrationPhotonRatio(0.0), m_YieldStat(0), m_YieldCff(0.0), m_ID(0) { m_LogicalVolumes.push_back(volume); }; ~CherenkovRadiator() {}; @@ -108,6 +108,7 @@ class CherenkovRadiator: public TObject { // Transient variables for the ReconstructionFactory convenience; unsigned m_TrajectoryBinCount; //! + // This is a hack for now; double m_Smearing; //! bool m_GaussianSmearing; //! @@ -127,9 +128,12 @@ class CherenkovRadiator: public TObject { unsigned m_YieldStat; //! double m_YieldCff; //! + unsigned m_ID; //! std::vector m_Calibrations; //! +#ifndef DISABLE_ROOT_IO ClassDef(CherenkovRadiator, 8); +#endif }; #endif diff --git a/include/Configuration.h b/include/Configuration.h index 183aab1..2818f73 100644 --- a/include/Configuration.h +++ b/include/Configuration.h @@ -6,7 +6,7 @@ class TH1D; #ifndef _CONFIGURATION_ #define _CONFIGURATION_ -#include +#include "GeantImport.h" class CherenkovRadiator; class Configuration: public virtual GeantImport { diff --git a/include/ConicalSurface.h b/include/ConicalSurface.h index 7e3b738..bbe1db2 100644 --- a/include/ConicalSurface.h +++ b/include/ConicalSurface.h @@ -1,5 +1,5 @@ -#include +#include "ParametricSurface.h" #ifndef _IRT_CONICAL_SURFACE_ #define _IRT_CONICAL_SURFACE_ @@ -79,7 +79,9 @@ class ConicalSurface: public ParametricSurface { TVector3 m_Nz, m_Nr; double m_R0, m_R1, m_Dz, m_Alfa, m_Rc, m_Slope; +#ifndef DISABLE_ROOT_IO ClassDef(ConicalSurface, 1); +#endif }; #endif diff --git a/include/CylindricalSurface.h b/include/CylindricalSurface.h index f424cba..f92f3bb 100644 --- a/include/CylindricalSurface.h +++ b/include/CylindricalSurface.h @@ -3,7 +3,7 @@ // Yes, prefer to keep it separately even that it is a subset of a ConicalSurface; // -#include +#include "ParametricSurface.h" #ifndef _IRT_CYLINDRICAL_SURFACE_ #define _IRT_CYLINDRICAL_SURFACE_ @@ -74,7 +74,9 @@ class CylindricalSurface: public ParametricSurface { TVector3 m_Nz, m_Nr; double m_Radius, m_Alfa; +#ifndef DISABLE_ROOT_IO ClassDef(CylindricalSurface, 1); +#endif }; #endif diff --git a/include/Digitization.h b/include/Digitization.h index 3fa5752..c87b177 100644 --- a/include/Digitization.h +++ b/include/Digitization.h @@ -4,8 +4,8 @@ #ifndef _DIGITIZATION_ #define _DIGITIZATION_ -#include -#include +#include "DigitizedHit.h" +#include "Configuration.h" class CherenkovPhotonDetector; struct BlackoutCell { diff --git a/include/DigitizedHit.h b/include/DigitizedHit.h index 494216d..df52e85 100644 --- a/include/DigitizedHit.h +++ b/include/DigitizedHit.h @@ -9,8 +9,8 @@ #ifndef _DIGITIZED_HIT_ #define _DIGITIZED_HIT_ -#include -#include +#include "CherenkovPhotonDetector.h" +#include "SinglePDF.h" class ChargedParticle; class IRT; diff --git a/include/FlatSurface.h b/include/FlatSurface.h index 2cc1abe..4567426 100644 --- a/include/FlatSurface.h +++ b/include/FlatSurface.h @@ -1,5 +1,5 @@ -#include +#include "ParametricSurface.h" #ifndef _IRT_FLAT_SURFACE_ #define _IRT_FLAT_SURFACE_ @@ -53,7 +53,9 @@ class FlatSurface: public ParametricSurface, public LocalCoordinatesXY { private: TVector3 m_Nx, m_Ny, m_Nz; +#ifndef DISABLE_ROOT_IO ClassDef(FlatSurface, 1); +#endif }; #endif diff --git a/include/G4Object.h b/include/G4Object.h index a320c43..474ba98 100644 --- a/include/G4Object.h +++ b/include/G4Object.h @@ -27,7 +27,9 @@ class G4ObjectCopy: public TObject { G4VPhysicalVolume *m_PhysicalVolume; //! +#ifndef DISABLE_ROOT_IO ClassDef(G4ObjectCopy, 1); +#endif }; class G4Object: public TObject { @@ -72,7 +74,9 @@ class G4Object: public TObject { // This call is deferred to the moment after all cuts on this solid are applied; void DefineLogicalVolume( void ); +#ifndef DISABLE_ROOT_IO ClassDef(G4Object, 2) +#endif }; #endif diff --git a/include/GeantImport.h b/include/GeantImport.h index cb5e199..8d44fe4 100644 --- a/include/GeantImport.h +++ b/include/GeantImport.h @@ -4,7 +4,7 @@ #ifndef _GEANT_IMPORT_ #define _GEANT_IMPORT_ -#include +#include "CherenkovEvent.h" class CherenkovDetector; class GeantImport { diff --git a/include/IRT.h b/include/IRT.h index 37824dc..2640e2e 100644 --- a/include/IRT.h +++ b/include/IRT.h @@ -19,10 +19,10 @@ // Refractive index variation; in units of the (1-n); ~1% makes sense?; //#define _IRT_DERIVATIVE_NNN_STEP_ (0.01) -#include -#include -#include -#include +#include "CherenkovRadiator.h" +#include "OpticalBoundary.h" +#include "ParametricSurface.h" +#include "IRTSolution.h" class IRT: public TObject { public: @@ -67,7 +67,9 @@ class IRT: public TObject { std::vector _m_OpticalBoundaries; //std::vector _m_OpticalBoundaries; +#ifndef DISABLE_ROOT_IO ClassDef(IRT, 3); +#endif }; #endif diff --git a/include/OpticalBoundary.h b/include/OpticalBoundary.h index 9b11a8e..bad9022 100644 --- a/include/OpticalBoundary.h +++ b/include/OpticalBoundary.h @@ -5,7 +5,7 @@ #ifndef _OPTICAL_BOUNDARY_ #define _OPTICAL_BOUNDARY_ -#include +#include "CherenkovRadiator.h" class ParametricSurface; class OpticalBoundary: public TObject { @@ -37,7 +37,9 @@ class OpticalBoundary: public TObject { // Working variables; FIXME: not multithreading friendly; static thread_local TVector3 m_ImpactPoint, m_IncomingDirection, m_OutgoingDirection; //! +#ifndef DISABLE_ROOT_IO ClassDef(OpticalBoundary, 1); +#endif }; #endif diff --git a/include/OpticalPhoton.h b/include/OpticalPhoton.h index 253096c..cdd63f0 100644 --- a/include/OpticalPhoton.h +++ b/include/OpticalPhoton.h @@ -8,12 +8,12 @@ #ifndef _OPTICAL_PHOTON_ #define _OPTICAL_PHOTON_ -#include -#include +#include "TransientParticle.h" +#include "CherenkovPhotonDetector.h" class ReflectionPoint; class ChargedParticle; -#include -#include +#include "RefractionPoint.h" +#include "SinglePDF.h" class OpticalPhoton: public TransientParticle { public: @@ -98,7 +98,9 @@ class OpticalPhoton: public TransientParticle { // Average estimated phi angle; no need to know it precisely (?); std::map m_Phi; //! +#ifndef DISABLE_ROOT_IO ClassDef(OpticalPhoton, 11); +#endif }; #endif diff --git a/include/ParametricSurface.h b/include/ParametricSurface.h index 861b455..6859253 100644 --- a/include/ParametricSurface.h +++ b/include/ParametricSurface.h @@ -71,7 +71,9 @@ class ParametricSurface: public TObject { private: double m_Umin, m_Umax, m_Vmin, m_Vmax; +#ifndef DISABLE_ROOT_IO ClassDef(ParametricSurface, 1); +#endif }; class LocalCoordinatesXY: public TObject { @@ -82,7 +84,9 @@ class LocalCoordinatesXY: public TObject { virtual double GetLocalX(const TVector3 &xx) const = 0; virtual double GetLocalY(const TVector3 &xx) const = 0; +#ifndef DISABLE_ROOT_IO ClassDef(LocalCoordinatesXY, 1); +#endif }; #endif diff --git a/include/RadiatorHistory.h b/include/RadiatorHistory.h index a05a9b3..830995f 100644 --- a/include/RadiatorHistory.h +++ b/include/RadiatorHistory.h @@ -7,8 +7,8 @@ #ifndef _RADIATOR_HISTORY_ #define _RADIATOR_HISTORY_ -#include -#include +#include "OpticalPhoton.h" +#include "ChargedParticleStep.h" class RadiatorHistory: public TObject { public: @@ -78,7 +78,9 @@ class RadiatorHistory: public TObject { std::map m_StepBuffer; //! +#ifndef DISABLE_ROOT_IO ClassDef(RadiatorHistory, 1); +#endif }; #endif diff --git a/include/ReconstructionFactory.h b/include/ReconstructionFactory.h index 8945648..3f0be86 100644 --- a/include/ReconstructionFactory.h +++ b/include/ReconstructionFactory.h @@ -1,9 +1,9 @@ class TParticlePDG; -#include -#include -#include +#include "Configuration.h" +#include "Calibration.h" +#include "Digitization.h" #ifndef _RECONSTRUCTION_FACTORY_ #define _RECONSTRUCTION_FACTORY_ diff --git a/include/ReflectionPoint.h b/include/ReflectionPoint.h index 887d259..d0a0834 100644 --- a/include/ReflectionPoint.h +++ b/include/ReflectionPoint.h @@ -6,7 +6,7 @@ #ifndef _REFLECTION_POINT_ #define _REFLECTION_POINT_ -#include +#include "CherenkovMirror.h" class ReflectionPoint: public TObject { public: @@ -20,7 +20,9 @@ class ReflectionPoint: public TObject { //unsigned m_VolumeCopy; // FIXME: unused TVector3 m_Position, m_Momentum; +#ifndef DISABLE_ROOT_IO ClassDef(ReflectionPoint, 1); +#endif }; #endif diff --git a/include/RefractionPoint.h b/include/RefractionPoint.h index 1718366..66c8cab 100644 --- a/include/RefractionPoint.h +++ b/include/RefractionPoint.h @@ -6,7 +6,7 @@ #ifndef _REFRACTION_POINT_ #define _REFRACTION_POINT_ -#include +#include "CherenkovRadiator.h" class RefractionPoint: public TObject { public: @@ -25,7 +25,9 @@ class RefractionPoint: public TObject { //unsigned m_VolumeCopy; TVector3 m_Position, m_Momenta[2]; +#ifndef DISABLE_ROOT_IO ClassDef(RefractionPoint, 1); +#endif }; #endif diff --git a/include/SinglePDF.h b/include/SinglePDF.h index 34dce15..f90ec72 100644 --- a/include/SinglePDF.h +++ b/include/SinglePDF.h @@ -16,7 +16,9 @@ class SinglePDF: public TObject { virtual double GetAverage(void) const = 0; virtual bool WithinRange(double x, double dx = 0.0) const = 0; +#ifndef DISABLE_ROOT_IO ClassDef(SinglePDF, 1); +#endif }; class UniformPDF: public SinglePDF { @@ -71,7 +73,9 @@ class UniformPDF: public SinglePDF { private: double m_X0, m_X1, m_Weight, m_Norm, m_Sigma; +#ifndef DISABLE_ROOT_IO ClassDef(UniformPDF, 1); +#endif }; class VectorPDF: public TObject { @@ -153,7 +157,9 @@ class VectorPDF: public TObject { private: std::vector m_Members; +#ifndef DISABLE_ROOT_IO ClassDef(VectorPDF, 1); +#endif }; diff --git a/include/SphericalSurface.h b/include/SphericalSurface.h index 0a1e78d..9cec9f2 100644 --- a/include/SphericalSurface.h +++ b/include/SphericalSurface.h @@ -1,5 +1,5 @@ -#include +#include "ParametricSurface.h" #ifndef _IRT_SPHERICAL_SURFACE_ #define _IRT_SPHERICAL_SURFACE_ @@ -43,7 +43,9 @@ class SphericalSurface: public ParametricSurface { bool m_Concave; double m_Radius; +#ifndef DISABLE_ROOT_IO ClassDef(SphericalSurface, 2); +#endif }; #endif diff --git a/include/TransientParticle.h b/include/TransientParticle.h index 1eed960..d4f4cab 100644 --- a/include/TransientParticle.h +++ b/include/TransientParticle.h @@ -33,7 +33,9 @@ class TransientParticle: public TObject { bool m_PrimaryParticle; +#ifndef DISABLE_ROOT_IO ClassDef(TransientParticle, 4); +#endif }; #endif diff --git a/irtLinkDef.h b/include/irtLinkDef.h similarity index 100% rename from irtLinkDef.h rename to include/irtLinkDef.h diff --git a/pfrich-testIRT.py b/pfrich-testIRT.py deleted file mode 100644 index c56d990..0000000 --- a/pfrich-testIRT.py +++ /dev/null @@ -1,78 +0,0 @@ -from Gaudi.Configuration import * -from GaudiKernel import SystemOfUnits as units - -from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc -from Configurables import PodioInput -from Configurables import Jug__PID__IRTAlgorithm as IRTAlgorithm - -# Well, for now only need pfRICH geometry for this example; -geo_service = GeoSvc("GeoSvc", detectors=["pfrich_only.xml"]) - -# Input file after 'npsim' pass; -podioevent = EICDataSvc("EventDataSvc", inputs=["pfrich-data.root"]) - -# S13660-3050AE-08 SiPM quantum efficiency [(wavelength [nm], q.e.)] -# Note: this is consistent with S13361-3050AE-08 (for pfRICH) -qe_data = [ - (325, 0.04), - (340, 0.10), - (350, 0.20), - (370, 0.30), - (400, 0.35), - (450, 0.40), - (500, 0.38), - (550, 0.35), - (600, 0.27), - (650, 0.20), - (700, 0.15), - (750, 0.12), - (800, 0.08), - (850, 0.06), - (900, 0.04) -] - -radiators = [ - #"Aerogel zbins=10 smearing=uniform 12mrad rindex=1.0190" - #"Aerogel zbins=10 smearing=gaussian 4mrad rindex=1.0190" - "Aerogel zbins=10 smearing=gaussian 4mrad rindex=1.0190 attenuation[mm]=48.0" -] - -podioinput = PodioInput( - "PodioReader", - # Input collections: MC truth tracks and pfRICH raw hits (photons); - collections=["mcparticles", "PFRICHHits"], - OutputLevel=DEBUG - ) - -irtrec = IRTAlgorithm( - # Input collections: MC truth tracks and pfRICH raw hits (photons); - inputMCParticles="mcparticles", - - #Detector="PFRICH", - # pfRICH optics configuration produced by PFRICH_geo.cpp code along with the dd4hep XML file; - ConfigFile="pfrich-config.root", - Radiators=[ (r) for r in radiators ], - - # SiPM PDE; FIXME: units.eV coefficient gives extra x1000 (?); - QEcurve=[ ((1239.84/a), b) for a, b in qe_data ], - # Rebin the QE in that many equidistant bins internally; - QEbins="100", - # SiPM geometric fill factor and "safety factor" for the photon count estimates; - #GeometricEfficiency="1.00", - SafetyFactor="0.70", - ) - -# Output ROOT file; keep the input collections as well, append pfRICH PID tables; -out = PodioOutput("out", filename="pfrich-reco.root") -out.outputCommands = ["keep *"] - -ApplicationMgr( - TopAlg = [podioinput, irtrec, out], - EvtSel = 'NONE', - # Process that many events; - EvtMax = 5000, - ExtSvc = [podioevent], - OutputLevel = DEBUG, - PluginDebugLevel = 2 - ) - diff --git a/source/Calibration.cc b/source/Calibration.cc index 62b8334..b870eea 100644 --- a/source/Calibration.cc +++ b/source/Calibration.cc @@ -3,8 +3,8 @@ #include #include -#include -#include +#include "Calibration.h" +#include "CherenkovDetector.h" // FIXME: yes, fix it please; static unsigned hdim = 100; diff --git a/source/ChargedParticle.cc b/source/ChargedParticle.cc index 364e4d7..ff72c10 100644 --- a/source/ChargedParticle.cc +++ b/source/ChargedParticle.cc @@ -9,7 +9,7 @@ #include -#include +#include "ChargedParticle.h" // ------------------------------------------------------------------------------------- diff --git a/source/Configuration.cc b/source/Configuration.cc index 554e861..44fd248 100644 --- a/source/Configuration.cc +++ b/source/Configuration.cc @@ -1,8 +1,8 @@ #include -#include -#include +#include "CherenkovDetector.h" +#include "Configuration.h" #define _SPE_THETA_RESOLUTION_DEFAULT_ (0.0040) diff --git a/source/ConicalSurface.cc b/source/ConicalSurface.cc index f4c58bb..733d645 100644 --- a/source/ConicalSurface.cc +++ b/source/ConicalSurface.cc @@ -1,7 +1,7 @@ #include -#include +#include "ConicalSurface.h" // ------------------------------------------------------------------------------------- diff --git a/source/CylindricalSurface.cc b/source/CylindricalSurface.cc index 3c76166..592f4d8 100644 --- a/source/CylindricalSurface.cc +++ b/source/CylindricalSurface.cc @@ -1,7 +1,7 @@ #include -#include +#include "CylindricalSurface.h" // ------------------------------------------------------------------------------------- diff --git a/source/Digitization.cc b/source/Digitization.cc index 3d09089..76cc1db 100644 --- a/source/Digitization.cc +++ b/source/Digitization.cc @@ -1,10 +1,10 @@ #include -#include +#include "CherenkovDetector.h" -#include -#include +#include "GeantImport.h" +#include "Digitization.h" // Kind of digitization; may want to comment out (or set very fine) for debugging; #define _SENSOR_ACTIVE_AREA_PIXELLATION_DEFAULT_ (32) diff --git a/source/DigitizedHit.cc b/source/DigitizedHit.cc index e3f6336..ef0bf99 100644 --- a/source/DigitizedHit.cc +++ b/source/DigitizedHit.cc @@ -1,5 +1,5 @@ -#include +#include "DigitizedHit.h" // ------------------------------------------------------------------------------------- diff --git a/source/FlatSurface.cc b/source/FlatSurface.cc index 1b0cf1e..a6ab38c 100644 --- a/source/FlatSurface.cc +++ b/source/FlatSurface.cc @@ -1,5 +1,5 @@ -#include +#include "FlatSurface.h" // ------------------------------------------------------------------------------------- diff --git a/source/GeantImport.cc b/source/GeantImport.cc index 3b5417e..0d52ba7 100644 --- a/source/GeantImport.cc +++ b/source/GeantImport.cc @@ -1,9 +1,9 @@ #include -#include -#include -#include +#include "CherenkovDetectorCollection.h" +#include "CherenkovEvent.h" +#include "GeantImport.h" // ------------------------------------------------------------------------------------- diff --git a/source/IRT.cc b/source/IRT.cc index a80311e..1ef77db 100644 --- a/source/IRT.cc +++ b/source/IRT.cc @@ -1,5 +1,5 @@ -#include +#include "IRT.h" thread_local TVector3 OpticalBoundary::m_ImpactPoint, OpticalBoundary::m_IncomingDirection; thread_local TVector3 OpticalBoundary::m_OutgoingDirection; diff --git a/source/ParametricSurface.cc b/source/ParametricSurface.cc index bc84444..63c498b 100644 --- a/source/ParametricSurface.cc +++ b/source/ParametricSurface.cc @@ -1,5 +1,5 @@ -#include +#include "ParametricSurface.h" // ------------------------------------------------------------------------------------- diff --git a/source/ReconstructionFactory.cc b/source/ReconstructionFactory.cc index 08eb6e2..c187236 100644 --- a/source/ReconstructionFactory.cc +++ b/source/ReconstructionFactory.cc @@ -13,9 +13,9 @@ #include #include -#include -#include -#include +#include "CherenkovDetectorCollection.h" +#include "CherenkovEvent.h" +#include "ReconstructionFactory.h" // ------------------------------------------------------------------------------------- diff --git a/source/SphericalSurface.cc b/source/SphericalSurface.cc index da5592b..f02c1c6 100644 --- a/source/SphericalSurface.cc +++ b/source/SphericalSurface.cc @@ -1,5 +1,5 @@ -#include +#include "SphericalSurface.h" // -------------------------------------------------------------------------------------