Skip to content
Snippets Groups Projects
Commit 2caa6889 authored by Markus Frank's avatar Markus Frank
Browse files

First version of running Geant$ converter from ROOT geometry

parent 648c19e9
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,7 @@ typedef G4AnyThing<G4VSolid> G4Tubs;
typedef G4AnyThing<G4VSolid> G4Trd;
typedef G4AnyThing<G4VSolid> G4Paraboloid;
typedef G4AnyThing<G4VSolid> G4Polycone;
typedef G4AnyThing<G4VSolid> G4Polyhedra;
typedef G4AnyThing<G4VSolid> G4Sphere;
typedef G4AnyThing<G4VSolid> G4Torus;
typedef G4AnyThing<G4VSolid> G4UnionSolid;
......@@ -70,6 +71,7 @@ typedef G4AnyThing<G4VAny> G4PVPlacement;
#include "G4Trd.hh"
#include "G4Paraboloid.hh"
#include "G4Polycone.hh"
#include "G4Polyhedra.hh"
#include "G4Sphere.hh"
#include "G4Torus.hh"
#include "G4UnionSolid.hh"
......@@ -97,7 +99,7 @@ namespace DD4hep {
std::map<const TGeoVolume*, G4LogicalVolume*> g4Volumes;
std::map<const TGeoNode*, G4PVPlacement*> g4Placements;
};
G4GeometryInfo* m_dataPtr;
G4GeometryInfo* m_dataPtr;
G4GeometryInfo& data() const { return *m_dataPtr; }
/// Constructor
......@@ -122,4 +124,3 @@ namespace DD4hep {
} // End namespace DD4hep
#endif // DD4HEP_GEANT4CONVERTER_H
// $Id:$
//====================================================================
// AIDA Detector description implementation
//--------------------------------------------------------------------
//
// Author : M.Frank
//
//====================================================================
#ifndef DD4HEP_GEANT4SENSITIVEDETECTOR_H
#define DD4HEP_GEANT4SENSITIVEDETECTOR_H
// Framework include files
#include "DD4hep/Readout.h"
#include "DD4hep/Detector.h"
// Geant 4 include files
#include "G4Step.hh"
#include "G4HCofThisEvent.hh"
#include "G4TouchableHistory.hh"
#include "G4VSensitiveDetector.hh"
/*
* DD4hep namespace declaration
*/
namespace DD4hep {
namespace Geometry {
struct LCDD;
};
/*
* Simulation namespace declaration
*/
namespace Simulation {
struct Geant4SensitiveDetector : public G4VSensitiveDetector {
typedef Geometry::LCDD LCDD;
typedef Geometry::Readout Readout;
typedef Geometry::DetElement DetElement;
/// Reference to the detector description object
LCDD& m_lcdd;
/// Reference to the detector element describing this sensitive element
DetElement m_detector;
/// Reference to the readout structure
Readout m_readout;
public:
/// Constructor
Geant4SensitiveDetector(const std::string& name, DetElement detector, LCDD& lcdd);
/// Standard destructor
virtual ~Geant4SensitiveDetector();
/** Method invoked at the begining of each event.
* The hits collection(s) created by this sensitive detector must
* be set to the G4HCofThisEvent object at one of these two methods.
*/
virtual void Initialize(G4HCofThisEvent* HCE);
/// Method invoked at the end of each event.
virtual void EndOfEvent(G4HCofThisEvent* HCE);
/// Method for generating hit(s) using the information of G4Step object.
virtual G4bool ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist) = 0;
/// Method is invoked if the event abortion is occured.
virtual void clear();
};
} // End namespace Simulation
} // End namespace DD4hep
#endif // DD4HEP_GEANT4SENSITIVEDETECTOR_H
No preview for this file type
// $Id:$
//====================================================================
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------
//
// Author : M.Frank
//
//====================================================================
#include "DDG4/Geant4SensitiveDetector.h"
using namespace DD4hep;
using namespace DD4hep::Simulation;
/// Constructor
Geant4SensitiveDetector::Geant4SensitiveDetector(const std::string& name, DetElement detector, LCDD& lcdd)
: G4VSensitiveDetector(name), m_detector(detector), m_lcdd(lcdd)
{
m_readout = detector.readout();
collectionName.insert("trackerCollection");
}
/// Standard destructor
Geant4SensitiveDetector::~Geant4SensitiveDetector() {
}
/// Method invoked at the begining of each event.
void Geant4SensitiveDetector::Initialize(G4HCofThisEvent* HCE) {
}
/// Method invoked at the end of each event.
void Geant4SensitiveDetector::EndOfEvent(G4HCofThisEvent* HCE) {
}
/// Method for generating hit(s) using the information of G4Step object.
G4bool Geant4SensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist) {
}
/// Method is invoked if the event abortion is occured.
void Geant4SensitiveDetector::clear() {
}
//DECLARE_TRANSLATION(LCDD2Geant4,create_g4);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment