From 5e76960f7f22b36e47a1f49f859864584bf9a8f6 Mon Sep 17 00:00:00 2001 From: Chengdong Fu <fucd@ihep.ac.cn> Date: Tue, 22 Jun 2021 09:30:13 +0800 Subject: [PATCH] add header files --- Analysis/DumpEvent/src/DumpMCParticleAlg.h | 51 ++++++++++++++++++++ Analysis/DumpEvent/src/DumpTrackAlg.h | 56 ++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 Analysis/DumpEvent/src/DumpMCParticleAlg.h create mode 100644 Analysis/DumpEvent/src/DumpTrackAlg.h diff --git a/Analysis/DumpEvent/src/DumpMCParticleAlg.h b/Analysis/DumpEvent/src/DumpMCParticleAlg.h new file mode 100644 index 00000000..bf9b16bc --- /dev/null +++ b/Analysis/DumpEvent/src/DumpMCParticleAlg.h @@ -0,0 +1,51 @@ +#ifndef DumpMCParticleAlg_h +#define DumpMCParticleAlg_h 1 + +#include "k4FWCore/DataHandle.h" +#include "GaudiKernel/Algorithm.h" + +#include "edm4hep/MCParticleCollection.h" +#include "edm4hep/TrackCollection.h" + +#include "GaudiKernel/NTuple.h" + +class DumpMCParticleAlg : public Algorithm { + public: + // Constructor of this form must be provided + DumpMCParticleAlg( const std::string& name, ISvcLocator* pSvcLocator ); + + // Three mandatory member functions of any algorithm + StatusCode initialize() override; + StatusCode execute() override; + StatusCode finalize() override; + + private: + DataHandle<edm4hep::MCParticleCollection> _inMCColHdl{"MCParticle", Gaudi::DataHandle::Reader, this}; + + Gaudi::Property<double> m_field{this, "Field", 3.0}; + + NTuple::Tuple* m_tuple; + NTuple::Item<long> m_nParticles; + NTuple::Array<int> m_pdgID; + NTuple::Array<int> m_genStatus; + NTuple::Array<int> m_simStatus; + NTuple::Array<float> m_charge; + NTuple::Array<float> m_time; + NTuple::Array<double> m_mass; + NTuple::Array<double> m_vx; + NTuple::Array<double> m_vy; + NTuple::Array<double> m_vz; + NTuple::Array<float> m_px; + NTuple::Array<float> m_py; + NTuple::Array<float> m_pz; + NTuple::Array<float> m_d0; + NTuple::Array<float> m_phi0; + NTuple::Array<float> m_omega; + NTuple::Array<float> m_z0; + NTuple::Array<float> m_tanLambda; + + int _nEvt; + std::string m_thisName; +}; + +#endif diff --git a/Analysis/DumpEvent/src/DumpTrackAlg.h b/Analysis/DumpEvent/src/DumpTrackAlg.h new file mode 100644 index 00000000..91c526de --- /dev/null +++ b/Analysis/DumpEvent/src/DumpTrackAlg.h @@ -0,0 +1,56 @@ +#ifndef DumpTrackAlg_h +#define DumpTrackAlg_h 1 + +#include "k4FWCore/DataHandle.h" +#include "GaudiKernel/Algorithm.h" + +#include "edm4hep/MCParticleCollection.h" +#include "edm4hep/TrackCollection.h" + +#include "GaudiKernel/NTuple.h" + +class DumpTrackAlg : public Algorithm { + public: + // Constructor of this form must be provided + DumpTrackAlg( const std::string& name, ISvcLocator* pSvcLocator ); + + // Three mandatory member functions of any algorithm + StatusCode initialize() override; + StatusCode execute() override; + StatusCode finalize() override; + + private: + DataHandle<edm4hep::MCParticleCollection> _inMCColHdl{"MCParticle", Gaudi::DataHandle::Reader, this}; + DataHandle<edm4hep::TrackCollection> _inTrackColHdl{"SiTracks", Gaudi::DataHandle::Reader, this}; + + Gaudi::Property<double> m_field{this, "Field", 3.0}; + + NTuple::Tuple* m_tuple; + NTuple::Item<long> m_nTracks; + NTuple::Array<float> m_x; + NTuple::Array<float> m_y; + NTuple::Array<float> m_z; + NTuple::Array<float> m_px; + NTuple::Array<float> m_py; + NTuple::Array<float> m_pz; + NTuple::Array<float> m_d0; + NTuple::Array<float> m_phi0; + NTuple::Array<float> m_omega; + NTuple::Array<float> m_z0; + NTuple::Array<float> m_tanLambda; + NTuple::Array<float> m_sigma_d0; + NTuple::Array<float> m_sigma_phi0; + NTuple::Array<float> m_sigma_omega; + NTuple::Array<float> m_sigma_z0; + NTuple::Array<float> m_sigma_tanLambda; + NTuple::Array<int> m_nHitsVXD; + NTuple::Array<int> m_nHitsFTD; + NTuple::Array<int> m_nHitsSIT; + NTuple::Array<int> m_nHitsGAS; + NTuple::Array<int> m_nHitsSET; + + int _nEvt; + std::string m_thisName; +}; + +#endif -- GitLab