diff --git a/Detector/DetCRD/compact/CRD_common_v01/Ecal_Rotated_Crystal_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/Ecal_Rotated_Crystal_v01_01.xml index eef2ba3cfdbe9e3c0dba6ad0c913ed870a3f41ef..1301bd434ca98656baf082d54b91ff6362ee65e6 100644 --- a/Detector/DetCRD/compact/CRD_common_v01/Ecal_Rotated_Crystal_v01_01.xml +++ b/Detector/DetCRD/compact/CRD_common_v01/Ecal_Rotated_Crystal_v01_01.xml @@ -22,6 +22,7 @@ <shape type="Tube" rmin="Ecal_barrel_inner_radius" rmax="Ecal_barrel_outer_radius_redef" dz="Ecal_barrel_half_length" material="Air"/> <!--/shape--> </envelope> + <sensitive type="scintillator"/> <dimensions rmin="Ecal_barrel_inner_radius" rmax="Ecal_barrel_outer_radius_redef" zhalf="Ecal_barrel_half_length_correct" alpha="Ecal_crystal_rotate_angle" nphi="1368" nz="numberZ" gap="0"/> <crystal material="G4_BGO" vis="ECALVis"/> </detector> diff --git a/Detector/DetCRD/src/Calorimeter/RotatedCrystalCalorimeter_v01_geo.cpp b/Detector/DetCRD/src/Calorimeter/RotatedCrystalCalorimeter_v01_geo.cpp index ec6e9fa5c229c348edccc36089d8cb59e24b7c1d..9de1e8a096edcf3f4d41d6269ef3353a830bcf60 100644 --- a/Detector/DetCRD/src/Calorimeter/RotatedCrystalCalorimeter_v01_geo.cpp +++ b/Detector/DetCRD/src/Calorimeter/RotatedCrystalCalorimeter_v01_geo.cpp @@ -97,9 +97,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s Volume crystalVol("crystal_whole", crystalTrap, crystalMat); crystalVol.setVisAttributes(description, crystalVis); - sens.setType("calorimeter"); + if ( x_det.isSensitive() ) { + xml_dim_t sd_typ = x_det.child(_U(sensitive)); + sens.setType(sd_typ.typeStr()); + crystalVol.setSensitiveDetector(sens); + } // TODO: crystal pack - crystalVol.setSensitiveDetector(sens); + for (xml_coll_t xp(x_crystal, _U(slice)); xp; ++xp){ // xml_comp_t x_slice = xp; diff --git a/Simulation/DetSimGeom/src/AnExampleDetElemTool.cpp b/Simulation/DetSimGeom/src/AnExampleDetElemTool.cpp index ff20af31bc40cd2d24304e83e2c9bbadffc6a171..e7ea439453243102e5260c8d03c1e83dfc0dd86a 100644 --- a/Simulation/DetSimGeom/src/AnExampleDetElemTool.cpp +++ b/Simulation/DetSimGeom/src/AnExampleDetElemTool.cpp @@ -101,7 +101,7 @@ AnExampleDetElemTool::ConstructSDandField() { // try to use SD tool to find the SD if (!g4sd) { - if (typ=="calorimeter") { + if (typ=="calorimeter" || typ=="scintillator") { m_calo_sdtool = ToolHandle<ISensDetTool>("CalorimeterSensDetTool"); if (m_calo_sdtool) { info() << "Find the CalorimeterSensDetTool." << endmsg; diff --git a/Simulation/DetSimSD/include/DetSimSD/CaloSensitiveDetector.h b/Simulation/DetSimSD/include/DetSimSD/CaloSensitiveDetector.h index db161be4269e9ba94c071a50f647b5a99b38ec19..ca7d15dee75d6a1737ef2486df0716c003d524a0 100644 --- a/Simulation/DetSimSD/include/DetSimSD/CaloSensitiveDetector.h +++ b/Simulation/DetSimSD/include/DetSimSD/CaloSensitiveDetector.h @@ -32,6 +32,7 @@ protected: HitCollection* m_hc; std::map<unsigned long, CalorimeterHit*> m_hitMap; bool m_isMergeEnabled; + bool m_applyBirksLaw = false; };