Skip to content
Snippets Groups Projects
Commit bf026816 authored by Markus Frank's avatar Markus Frank Committed by MarkusFrankATcernch
Browse files

Fix compile error

parent 3381a37d
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "DigiIO.h" #include "DigiIO.h"
#include <DDG4/Geant4Data.h> #include <DDG4/Geant4Data.h>
#include <DDG4/Geant4Particle.h>
// ROOT include files // ROOT include files
#include <TBranch.h> #include <TBranch.h>
...@@ -123,4 +124,6 @@ namespace dd4hep { ...@@ -123,4 +124,6 @@ namespace dd4hep {
}; };
} // End namespace digi } // End namespace digi
} // End namespace dd4hep } // End namespace dd4hep
/// Factory instantiation
DECLARE_DIGIACTION_NS(dd4hep::digi,DigiDDG4ROOT) DECLARE_DIGIACTION_NS(dd4hep::digi,DigiDDG4ROOT)
...@@ -35,19 +35,27 @@ namespace dd4hep { ...@@ -35,19 +35,27 @@ namespace dd4hep {
/// Namespace for the Digitization part of the AIDA detector description toolkit /// Namespace for the Digitization part of the AIDA detector description toolkit
namespace digi { namespace digi {
/// Auto cast union to read objects from ROOT files
template <typename T> union input_data { template <typename T> union input_data {
/// Void type
const void* m_raw; const void* m_raw;
std::vector<T*>* m_items; /// Concrete type
std::vector<T*>* m_data;
/// Constructor
input_data(const void* p) { this->m_raw = p; } input_data(const void* p) { this->m_raw = p; }
void clear() { if ( this->m_items ) this->m_items->clear(); } /// Vector interface: get object
std::size_t size() { return (this->m_items) ? this->m_items->size() : 0UL; }
std::vector<T*>& get() { std::vector<T*>& get() {
if ( this->m_items ) return *(this->m_items); if ( this->m_data ) return *(this->m_data);
throw std::runtime_error("input_data: Invalid data!"); throw std::runtime_error("input_data: Invalid data!");
} }
/// Vector interface: clear items
void clear() { if ( this->m_data ) this->m_data->clear(); }
/// Vector interface: access array size
std::size_t size() { return (this->m_data) ? this->m_data->size() : 0UL; }
}; };
/// Generci I/O helper to input/output digi data /// Generic I/O helper to input/output digi data
/** /**
* *
* \author M.Frank * \author M.Frank
...@@ -135,18 +143,18 @@ namespace dd4hep { ...@@ -135,18 +143,18 @@ namespace dd4hep {
* \ingroup DD4HEP_DIGITIZATION * \ingroup DD4HEP_DIGITIZATION
*/ */
struct edm4hep_input { struct edm4hep_input {
typedef edm4hep::MutableMCParticle particle_type; typedef edm4hep::MutableMCParticle particle_type;
struct input_trackerhit_type {}; struct input_trackerhit_type {};
struct input_calorimeterhit_type {}; struct input_calorimeterhit_type {};
}; };
struct digi_input { struct digi_input {
typedef Particle particle_type; typedef Particle particle_type;
struct input_trackerhit_type {}; struct input_trackerhit_type {};
struct input_calorimeterhit_type {}; struct input_calorimeterhit_type {};
}; };
/// Generci I/O helper to output digi data in edm4hep format /// Generic I/O helper to output digi data in edm4hep format
/** /**
* *
* \author M.Frank * \author M.Frank
......
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