From 759487374c188eff08edcd858342a0713e236a6d Mon Sep 17 00:00:00 2001
From: myliu <201916234@mail.sdu.edu.cn>
Date: Tue, 9 Feb 2021 18:41:56 +0800
Subject: [PATCH] Ecal fast simulation

---
 .../CRD_common_v01/Ecal_Crystal_Barrel_v01_01.xml  |  7 ++++++-
 Detector/DetCRD/src/Calorimeter/CRDEcal.cpp        |  1 +
 Simulation/CMakeLists.txt                          |  1 +
 Simulation/DetSimCore/src/DetSimAlg.cpp            | 14 ++++++++++++++
 4 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Barrel_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Barrel_v01_01.xml
index b408c7a3..6d3b3a7f 100644
--- a/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Barrel_v01_01.xml
+++ b/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Barrel_v01_01.xml
@@ -6,8 +6,13 @@
     <constant name="ecalbarrel_zlength"      value="Ecal_barrel_half_length*2"/>   <!--Must be n*10*mm! -->
   </define>
 
+  <regions>
+    <region name="EcalBarrelRegion">
+    </region>
+  </regions>
+
   <detectors>
-    <detector id="DetID_ECAL" name="CaloDetector" type="CRDEcalBarrel" readout="EcalBarrelCollection" vis="Invisible" sensitive="true">
+    <detector id="DetID_ECAL" name="CaloDetector" type="CRDEcalBarrel" readout="EcalBarrelCollection" vis="Invisible" sensitive="true" region="EcalBarrelRegion">
       <!-- Use cm as unit if you want to use Pandora for reconstruction -->
     </detector>
   </detectors>
diff --git a/Detector/DetCRD/src/Calorimeter/CRDEcal.cpp b/Detector/DetCRD/src/Calorimeter/CRDEcal.cpp
index 2fa11cff..9d1b6b79 100644
--- a/Detector/DetCRD/src/Calorimeter/CRDEcal.cpp
+++ b/Detector/DetCRD/src/Calorimeter/CRDEcal.cpp
@@ -67,6 +67,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
 	dd4hep::Volume	envelopeVol(det_name, envelope, air);
 	dd4hep::PlacedVolume	envelopePlv = motherVol.placeVolume(envelopeVol, Position(0,0,0));
 	envelopeVol.setVisAttributes(theDetector, "InvisibleWithChildren" );
+    envelopeVol.setRegion(theDetector,x_det.regionStr());
 	ECAL.setPlacement(envelopePlv);
 
     //Define specific material and volumen for detElement
diff --git a/Simulation/CMakeLists.txt b/Simulation/CMakeLists.txt
index 3ce6540c..11a935cb 100644
--- a/Simulation/CMakeLists.txt
+++ b/Simulation/CMakeLists.txt
@@ -3,6 +3,7 @@ add_subdirectory(DetSimAna)
 add_subdirectory(DetSimCore)
 add_subdirectory(DetSimDedx)
 add_subdirectory(DetSimFastModel)
+add_subdirectory(DetSimFastEcal)
 add_subdirectory(DetSimGeom)
 add_subdirectory(DetSimInterface)
 add_subdirectory(DetSimSD)
diff --git a/Simulation/DetSimCore/src/DetSimAlg.cpp b/Simulation/DetSimCore/src/DetSimAlg.cpp
index 31583d82..a84e074e 100644
--- a/Simulation/DetSimCore/src/DetSimAlg.cpp
+++ b/Simulation/DetSimCore/src/DetSimAlg.cpp
@@ -73,6 +73,20 @@ DetSimAlg::initialize() {
         fastsim_physics->ActivateFastSimulation("e-");
         fastsim_physics->ActivateFastSimulation("e+");
         fastsim_physics->ActivateFastSimulation("gamma");
+        fastsim_physics->ActivateFastSimulation("mu-");
+        fastsim_physics->ActivateFastSimulation("pi0");
+        fastsim_physics->ActivateFastSimulation("pi+");
+        fastsim_physics->ActivateFastSimulation("pi-");
+        fastsim_physics->ActivateFastSimulation("tau+");
+        fastsim_physics->ActivateFastSimulation("tau-");
+        fastsim_physics->ActivateFastSimulation("K0");
+        fastsim_physics->ActivateFastSimulation("K-");
+        fastsim_physics->ActivateFastSimulation("K+");
+        fastsim_physics->ActivateFastSimulation("Z0");
+        fastsim_physics->ActivateFastSimulation("W-");
+        fastsim_physics->ActivateFastSimulation("h0");
+        fastsim_physics->ActivateFastSimulation("nu_mu");
+        fastsim_physics->ActivateFastSimulation("nu_ebar");
         modularPhysicsList->RegisterPhysics(fastsim_physics);
 
         physicsList = modularPhysicsList;
-- 
GitLab