diff --git a/examples/noviceN04/Issues.txt b/examples/noviceN04/Issues.txt index 5e102245bd54a13a98f14587afff3a0f73447543..f3e97d48261de84dbe9c499d2df38aac29f59cfb 100644 --- a/examples/noviceN04/Issues.txt +++ b/examples/noviceN04/Issues.txt @@ -21,12 +21,4 @@ - vis attribute drawingStyle="wireframe" does not seem to work (w/ geoDisplay ) - - definition of rotations not intuitive - need clear documentation: - Rotation rot( 0, 0 , phi ) - behaves differently from RotationZ(phi) !!?? - - - original G4VSensitiveDetector classes are not yet used in DD4hep port - => need to change DDG4/Geant4SensitiveDetector .... - - -> exampleN04 does not yet work (crashes due to missing SDs) diff --git a/examples/noviceN04/compact/geant4.xml b/examples/noviceN04/compact/geant4.xml index edffb935ccf96125a714d5e85e657f3b63328076..a4a9a5d6869ab9ec638087cb4bf61adc084171c5 100644 --- a/examples/noviceN04/compact/geant4.xml +++ b/examples/noviceN04/compact/geant4.xml @@ -3,19 +3,19 @@ <sensitive_detectors> <sd name="TrackerN04" - type="Geant4Tracker" + type="DD4hepExN04TrackerSD" ecut="1.0*keV" verbose="true" hit_aggregation="position"> </sd> <sd name="CalorimeterN04" - type="Geant4Calorimeter" + type="DD4hepExN04CalorimeterSD" ecut="0.5*keV" verbose="true" hit_aggregation="position"> </sd> - <sd name="MuonN04" - type="Geant4Calorimeter" + <sd name="MuonN04" + type="DD4hepExN04MuonSD" ecut="0.5*keV" verbose="true" hit_aggregation="position"> diff --git a/examples/noviceN04/run1.mac b/examples/noviceN04/run1.mac index 69ba6a2e10580bcf4d8ac831cb2a39cd3e08702b..3117e3b8cf389d57c46ece8a5cccac404511af76 100644 --- a/examples/noviceN04/run1.mac +++ b/examples/noviceN04/run1.mac @@ -10,7 +10,7 @@ # /run/verbose 0 /event/verbose 0 -/tracking/verbose 1 +/tracking/verbose 0 # # muon 300 MeV to the direction (1.,0.,0.) # 3 events diff --git a/examples/noviceN04/src/SDWrapper.cc b/examples/noviceN04/src/SDWrapper.cc new file mode 100644 index 0000000000000000000000000000000000000000..8c713d274301ef76d08262025f3582093ae9e4a9 --- /dev/null +++ b/examples/noviceN04/src/SDWrapper.cc @@ -0,0 +1,58 @@ +#include "DDG4/Factories.h" +#include "DDG4/G4SDFactory.h" +#include "DD4hep/LCDD.h" + +#include "ExN04CalorimeterSD.hh" +#include "ExN04CalorimeterROGeometry.hh" +#include "ExN04MuonSD.hh" +#include "ExN04TrackerSD.hh" + + +namespace DD4hep { namespace Simulation { + + + /** Factory class to create an instance of ExN04CalorimeterSD + */ + class DD4hepExN04CalorimeterSD : public DD4hep::Simulation::G4SDFactory { + public: + virtual G4VSensitiveDetector* createSD(const std::string& name, Geometry::LCDD& lcdd){ + + G4String calorimeterSDname = "/mydet/calorimeter"; + ExN04CalorimeterSD * calorimeterSD = new ExN04CalorimeterSD(calorimeterSDname); + G4String ROgeometryName = "CalorimeterROGeom"; + G4VReadOutGeometry* calRO = new ExN04CalorimeterROGeometry(ROgeometryName); + calRO->BuildROGeometry(); + calRO->SetName(ROgeometryName); + calorimeterSD->SetROgeometry(calRO); + return calorimeterSD ; + } + } ; + /** Factory class to create an instance of ExN04TrackerSD + */ + class DD4hepExN04TrackerSD : public DD4hep::Simulation::G4SDFactory{ + public: + virtual G4VSensitiveDetector* createSD(const std::string& name, Geometry::LCDD& lcdd){ + G4String trackerSDname = "/mydet/tracker"; + return new ExN04TrackerSD(trackerSDname); + } + } ; + + /** Factory class to create an instance of ExN04MuonSD + */ + class DD4hepExN04MuonSD : public DD4hep::Simulation::G4SDFactory{ + public: + virtual G4VSensitiveDetector* createSD(const std::string& name, Geometry::LCDD& lcdd){ + G4String muonSDname = "/mydet/muon"; + return new ExN04MuonSD(muonSDname); + } + } ; + + + } +} // End namespace DD4hep::Simulation + +DECLARE_G4SDFACTORY(DD4hepExN04CalorimeterSD) +DECLARE_G4SDFACTORY(DD4hepExN04MuonSD) +DECLARE_G4SDFACTORY(DD4hepExN04TrackerSD) + +