From c9d3eac038023fea7282375aba373e98245bc806 Mon Sep 17 00:00:00 2001 From: Paolo Andreetto Date: Mon, 16 Mar 2020 15:38:11 +0100 Subject: [PATCH] Moved class from mutom-g4-castor --- src/Root/CMakeLists.txt | 3 +++ src/Root/Linkdef.h | 1 + src/Root/muCastorInfo.cpp | 44 ++++++++++++++++++++++++++++++++++++ src/Root/muCastorInfo.h | 44 ++++++++++++++++++++++++++++++++++++ src/Root/muCastorMCTrack.cpp | 8 +------ src/Root/muCastorMCTrack.h | 11 +-------- 6 files changed, 94 insertions(+), 17 deletions(-) create mode 100644 src/Root/muCastorInfo.cpp create mode 100644 src/Root/muCastorInfo.h diff --git a/src/Root/CMakeLists.txt b/src/Root/CMakeLists.txt index e39d9ac..32aa3c0 100644 --- a/src/Root/CMakeLists.txt +++ b/src/Root/CMakeLists.txt @@ -7,6 +7,7 @@ set(HEADERS muBlastMCTrack.h muCastorMCTrack.h muCastorHit.h + muCastorInfo.h ) set(DICTIONARY_HEADERS @@ -18,6 +19,7 @@ set(DICTIONARY_HEADERS muBlastMCTrack.h muCastorMCTrack.h muCastorHit.h + muCastorInfo.h ) SET(SOURCES @@ -27,6 +29,7 @@ SET(SOURCES muBlastMCTrack.cpp muCastorMCTrack.cpp muCastorHit.cpp + muCastorInfo.cpp ) set(LIBRARIES diff --git a/src/Root/Linkdef.h b/src/Root/Linkdef.h index 5ecbdaf..473df4e 100644 --- a/src/Root/Linkdef.h +++ b/src/Root/Linkdef.h @@ -78,6 +78,7 @@ using namespace ROOT::Mutom; #pragma link C++ class muBlastHit+; #pragma link C++ class muCastorMCTrack+; #pragma link C++ class muCastorHit+; +#pragma link C++ class muCastorInfo+; #endif // __CINT__ diff --git a/src/Root/muCastorInfo.cpp b/src/Root/muCastorInfo.cpp new file mode 100644 index 0000000..502564a --- /dev/null +++ b/src/Root/muCastorInfo.cpp @@ -0,0 +1,44 @@ +//------------------------------------------------ +// The Virtual Monte Carlo examples +// Copyright (C) 2007, 2008 Ivana Hrivnacova +// All rights reserved. +// +// For the licensing terms see geant4_vmc/LICENSE. +// Contact: vmc@pcroot.cern.ch +//------------------------------------------------- + +/// \file muCastorInfo.cxx +/// \brief Implementation of the muCastorInfo class +/// +/// \author G. Bonomi, A. Donzella - INFN + +#include + +#include "muCastorInfo.h" + +/// \cond CLASSIMP +ClassImp(muCastorInfo) +/// \endcond + +using namespace std; + +//_____________________________________________________________________________ +muCastorInfo::muCastorInfo() + : fMuGen(-1) +{ +/// Default constructor +} +//_____________________________________________________________________________ +muCastorInfo::~muCastorInfo() +{ +/// Destructor +} +//_____________________________________________________________________________ +void muCastorInfo::Print(const Option_t* /*opt*/) const +{ +/// Printing + + cout << " Generated muons: " << fMuGen + << endl; +} + diff --git a/src/Root/muCastorInfo.h b/src/Root/muCastorInfo.h new file mode 100644 index 0000000..96d3b45 --- /dev/null +++ b/src/Root/muCastorInfo.h @@ -0,0 +1,44 @@ +#ifndef muCastor_RUN_H +#define muCastor_RUN_H + +//------------------------------------------------ +// The Virtual Monte Carlo examples +// Copyright (C) 2007, 2008 Ivana Hrivnacova +// All rights reserved. +// +// For the licensing terms see geant4_vmc/LICENSE. +// Contact: vmc@pcroot.cern.ch +//------------------------------------------------- + +/// \file muCastorInfo.h +/// \brief Definition of the muCastorInfo class +/// +/// \authors G. Bonomi, A. Donzella - INFN + +#include +#include + +class muCastorInfo : public TObject +{ + public: + muCastorInfo(); + virtual ~muCastorInfo(); + + // methods + virtual void Print(const Option_t* option = "") const; + + void SetMuGen (Int_t muGen) { fMuGen = muGen; }; + void SetMuTrk (Int_t muTrk) { fMuTrk = muTrk; }; + + Int_t GetMuGen() { return fMuGen; }; + + private: + Int_t fMuGen; // Generated muons + Int_t fMuTrk; // Tracked muons + + ClassDef(muCastorInfo,1) //muCastorInfo +}; + +#endif //muCastor_RUN_H + + diff --git a/src/Root/muCastorMCTrack.cpp b/src/Root/muCastorMCTrack.cpp index af88e29..260cbbb 100644 --- a/src/Root/muCastorMCTrack.cpp +++ b/src/Root/muCastorMCTrack.cpp @@ -6,11 +6,9 @@ // Martin Subieta martin.subieta@ing.unibs.it //****************************************************************************************** -#include - -#include "Detectors/MuonScatter.h" #include #include +#include using namespace std; @@ -32,8 +30,6 @@ uLib::MuonScatter &operator << (uLib::MuonScatter &mu, const muCastorMCTrack &bs return mu; } -//namespace ROOT { -//namespace Mutom { // ----- Default constructor ------------------------------------------- muCastorMCTrack::muCastorMCTrack() { @@ -223,5 +219,3 @@ void muCastorMCTrack::Reset() fPntE = 0; } -//} // Mutom -//} // ROOT diff --git a/src/Root/muCastorMCTrack.h b/src/Root/muCastorMCTrack.h index aabc33f..f06526c 100644 --- a/src/Root/muCastorMCTrack.h +++ b/src/Root/muCastorMCTrack.h @@ -12,17 +12,10 @@ #include "vector" #include "TObject.h" #include "TParticle.h" +#include "Detectors/MuonScatter.h" class TClonesArray; - -namespace uLib { -class MuonScatter; -} - -//namespace ROOT { -//namespace Mutom { - class muCastorMCTrack : public TObject { @@ -89,8 +82,6 @@ public: ClassDef(muCastorMCTrack,1); }; -//} // Mutom -//} // ROOT uLib::MuonScatter &operator << (uLib::MuonScatter &mu, const muCastorMCTrack &bsmu); #endif //muCastor_MCTRACK_H