Skip to content
Snippets Groups Projects
Geant4DataConversion.cpp 1.47 KiB
Newer Older
//==========================================================================
Markus Frank's avatar
Markus Frank committed
//  AIDA Detector description implementation 
//--------------------------------------------------------------------------
Markus Frank's avatar
Markus Frank committed
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
// Author     : M.Frank
//
//==========================================================================

// Framework include files
Markus Frank's avatar
Markus Frank committed
using namespace dd4hep::sim;

/// Default constructor
Geant4ConversionHelper::Geant4ConversionHelper() {
}

/// Default destructor
Geant4ConversionHelper::~Geant4ConversionHelper() {
}

/// Access to the data encoding using the volume manager and a specified volume id
Markus Frank's avatar
Markus Frank committed
std::string Geant4ConversionHelper::encoding(VolumeManager vm, VolumeID vid) {
  PlacedVolume      pv = vm.lookupVolumePlacement(vid);
Markus Frank's avatar
Markus Frank committed
  SensitiveDetector sd = pv.volume().sensitiveDetector();
  return encoding(sd);
}

/// Access to the hit encoding in this sensitive detector
Markus Frank's avatar
Markus Frank committed
std::string Geant4ConversionHelper::encoding(Handle<SensitiveDetectorObject> sd)   {
  IDDescriptor id = SensitiveDetector(sd).readout().idSpec();
  return id.fieldDescription();
}

/// Access to the hit encoding in this readout object
Markus Frank's avatar
Markus Frank committed
std::string Geant4ConversionHelper::encoding(Readout ro)   {
  IDDescriptor id = ro.idSpec();
  return id.fieldDescription();
}