reorganization of sources, moving cmt pertaining structures into HEP folder
This commit is contained in:
34
src/HEP/Detectors/CMakeLists.txt
Normal file
34
src/HEP/Detectors/CMakeLists.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
set(HEADERS
|
||||
ChamberHitEvent.h
|
||||
DetectorChamber.h
|
||||
ExperimentFitEvent.h
|
||||
HierarchicalEncoding.h
|
||||
Hit.h
|
||||
HitMC.h
|
||||
LinearFit.h
|
||||
MuonError.h
|
||||
MuonEvent.h
|
||||
MuonScatter.h
|
||||
)
|
||||
|
||||
set(libname ${PACKAGE_LIBPREFIX}Detectors)
|
||||
set(ULIB_SHARED_LIBRARIES ${ULIB_SHARED_LIBRARIES} ${libname} PARENT_SCOPE)
|
||||
set(ULIB_SELECTED_MODULES ${ULIB_SELECTED_MODULES} Detectors PARENT_SCOPE)
|
||||
|
||||
## Headers-only INTERFACE library
|
||||
add_library(${libname} INTERFACE)
|
||||
target_include_directories(${libname} INTERFACE
|
||||
$<BUILD_INTERFACE:${SRC_DIR}>
|
||||
$<INSTALL_INTERFACE:${INSTALL_INC_DIR}>
|
||||
)
|
||||
|
||||
install(TARGETS ${libname}
|
||||
EXPORT "uLibTargets")
|
||||
|
||||
install(FILES ${HEADERS}
|
||||
DESTINATION ${INSTALL_INC_DIR}/HEP/Detectors)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
include(uLibTargetMacros)
|
||||
add_subdirectory(testing)
|
||||
endif()
|
||||
56
src/HEP/Detectors/ChamberHitEvent.h
Normal file
56
src/HEP/Detectors/ChamberHitEvent.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
#ifndef U_CHAMBERHITEVENT_H
|
||||
#define U_CHAMBERHITEVENT_H
|
||||
|
||||
#include "Core/Vector.h"
|
||||
#include "Hit.h"
|
||||
#include "ChamberDetector.h"
|
||||
|
||||
namespace uLib {
|
||||
|
||||
class ChamberHitEventData
|
||||
{
|
||||
public:
|
||||
uLibConstRefMacro (Hits, Vector<HitData> )
|
||||
uLibGetMacro (Idv, ChamberDetector::ID)
|
||||
private:
|
||||
friend class ChamberHitEvent;
|
||||
Vector<HitData> m_Hits;
|
||||
DetectorChamber::ID m_Idv; // -> chamber/view
|
||||
};
|
||||
|
||||
class ChamberHitEvent : public ChamberHitEventData {
|
||||
public:
|
||||
uLibRefMacro (Hits, Vector<HitData> )
|
||||
uLibSetMacro (Idv, ChamberDetector::ID)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // CHAMBERHITEVENT_H
|
||||
48
src/HEP/Detectors/DetectorChamber.h
Normal file
48
src/HEP/Detectors/DetectorChamber.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
#ifndef U_CHAMBERDETECTOR_H
|
||||
#define U_CHAMBERDETECTOR_H
|
||||
|
||||
#include "Core/Types.h"
|
||||
#include "Math/ContainerBox.h"
|
||||
|
||||
namespace uLib {
|
||||
|
||||
|
||||
class DetectorChamber : public ContainerBox {
|
||||
|
||||
public:
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // CHAMBERDETECTOR_H
|
||||
48
src/HEP/Detectors/ExperimentFitEvent.h
Normal file
48
src/HEP/Detectors/ExperimentFitEvent.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
#ifndef U_EXPERIMENTFITEVENT_H
|
||||
#define U_EXPERIMENTFITEVENT_H
|
||||
|
||||
namespace uLib {
|
||||
|
||||
|
||||
class ExperimentFitEventData {
|
||||
public:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // EXPERIMENTFITEVENT_H
|
||||
41
src/HEP/Detectors/HierarchicalEncoding.h
Normal file
41
src/HEP/Detectors/HierarchicalEncoding.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
#ifndef U_DETECTORS_HIERARCHICALENCODING_H
|
||||
#define U_DETECTORS_HIERARCHICALENCODING_H
|
||||
|
||||
#include <Core/BitCoding.h>
|
||||
|
||||
namespace uLib {
|
||||
|
||||
|
||||
|
||||
} // uLib
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // HIERARCHICALENCODING_H
|
||||
70
src/HEP/Detectors/Hit.h
Normal file
70
src/HEP/Detectors/Hit.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
#ifndef HIT_H
|
||||
#define HIT_H
|
||||
|
||||
#include "Math/BitCode.h"
|
||||
|
||||
namespace uLib {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class HitRawCode_CMSDrift :
|
||||
public BitCode4<unsigned short,6,3,2,5>
|
||||
{
|
||||
typedef unsigned short T;
|
||||
public:
|
||||
HitRawCode_CMSDrift() : BitCode4(0) {}
|
||||
HitRawCode_CMSDrift(const Vector4i &v) : BitCode4(v) {}
|
||||
HitRawCode_CMSDrift(T Chamber, T ROB, T TDC, T Channel ) {
|
||||
(*this) << Chamber, ROB, TDC, Channel;
|
||||
}
|
||||
|
||||
inline T Chamber() const { return m_data.bitf.field1; }
|
||||
inline void SetChamber(const T data) { m_data.bitf.field1 = data; }
|
||||
inline T ROB() const { return m_data.bitf.field2; }
|
||||
inline void SetROB(const T data) { m_data.bitf.field2 = data; }
|
||||
inline T TDC() const { return m_data.bitf.field3; }
|
||||
inline void SetTDC(const T data) { m_data.bitf.field3 = data; }
|
||||
inline T Channel() const { return m_data.bitf.field4; }
|
||||
inline void SetChannel(const T data) { m_data.bitf.field4 = data; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endif // HIT_H
|
||||
66
src/HEP/Detectors/HitMC.h
Normal file
66
src/HEP/Detectors/HitMC.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
#ifndef U_HITMC_H
|
||||
#define U_HITMC_H
|
||||
|
||||
#include "Math/Dense.h"
|
||||
#include "Hit.h"
|
||||
|
||||
namespace uLib {
|
||||
|
||||
|
||||
class HitMCData : public HitData{
|
||||
public:
|
||||
enum Type {
|
||||
PrimaryMu,
|
||||
SecondaryMu,
|
||||
DeltaRay
|
||||
};
|
||||
|
||||
inline const HPoint3f & Position() const { return this->m_Position; }
|
||||
inline enum Type GetType() const { return this->m_Type; }
|
||||
|
||||
protected:
|
||||
HPoint3f m_Position;
|
||||
enum Type m_Type;
|
||||
};
|
||||
|
||||
|
||||
class HitMC : public HitMCData {
|
||||
public:
|
||||
inline HPoint3f & Position() { return this->m_Position; }
|
||||
inline void SetType(enum Type name) { this->m_Type = name; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // HITMC_H
|
||||
71
src/HEP/Detectors/LinearFit.h
Normal file
71
src/HEP/Detectors/LinearFit.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
#ifndef U_LINEARFIT_H
|
||||
#define U_LINEARFIT_H
|
||||
|
||||
#include "Math/Dense.h"
|
||||
#include "ChamberDetector.h"
|
||||
|
||||
|
||||
namespace uLib {
|
||||
|
||||
class LinearFitData {
|
||||
public:
|
||||
inline const Vector2f & Position() const { return this->m_Position; }
|
||||
inline const Vector2f & Slope() const { return this->m_Slope; }
|
||||
inline const Vector2f & PositionError() const { return this->m_PositionError; }
|
||||
inline const Vector2f & SlopeError() const { return this->m_SlopeError; }
|
||||
inline int GetHitsNumber() const { return this->m_HitsNumber; }
|
||||
inline ChamberDetector::ID GetIdv() const { return this->m_Idv; }
|
||||
|
||||
protected:
|
||||
Vector2f m_Position;
|
||||
Vector2f m_Slope;
|
||||
Vector2f m_PositionError;
|
||||
Vector2f m_SlopeError;
|
||||
int m_HitsNumber;
|
||||
DetectorChamber::ID m_Idv;
|
||||
};
|
||||
|
||||
|
||||
class LinearFit : public LinearFitData {
|
||||
public:
|
||||
inline Vector2f & Position() { return this->m_Position; }
|
||||
inline Vector2f & Slope() { return this->m_Slope; }
|
||||
inline Vector2f & PositionError() { return this->m_PositionError; }
|
||||
inline Vector2f & SlopeError() { return this->m_SlopeError; }
|
||||
inline void SetHitsNumber(int name) { this->m_HitsNumber = name; }
|
||||
inline void SetIdv(ChamberDetector::ID name) { this->m_Idv = name; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // LINEARFIT_H
|
||||
25
src/HEP/Detectors/Makefile.am
Normal file
25
src/HEP/Detectors/Makefile.am
Normal file
@@ -0,0 +1,25 @@
|
||||
include $(top_srcdir)/Common.am
|
||||
|
||||
library_includedir = $(includedir)/libmutom-${PACKAGE_VERSION}/Detectors
|
||||
library_include_HEADERS = DetectorChamber.h \
|
||||
ExperimentFitEvent.h \
|
||||
GeantEvent.h \
|
||||
HitMC.h \
|
||||
MuonScatter.h \
|
||||
MuonEvent.h \
|
||||
MuonError.h \
|
||||
ChamberHitEvent.h \
|
||||
Hit.h \
|
||||
LinearFit.h \
|
||||
Solid.h \
|
||||
Matter.h \
|
||||
Scene.h
|
||||
|
||||
_DETECTORS_SOURCES = \
|
||||
Solid.cpp \
|
||||
Scene.cpp
|
||||
|
||||
noinst_LTLIBRARIES = libmutomdetectors.la
|
||||
libmutomdetectors_la_SOURCES = ${_DETECTORS_SOURCES}
|
||||
|
||||
|
||||
56
src/HEP/Detectors/MuonError.h
Normal file
56
src/HEP/Detectors/MuonError.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
#ifndef U_MUONERROR_H
|
||||
#define U_MUONERROR_H
|
||||
|
||||
#include "Math/Dense.h"
|
||||
|
||||
namespace uLib {
|
||||
|
||||
|
||||
class MuonErrorData {
|
||||
public:
|
||||
inline const Scalarf & Theta() const { return this->m_Theta; }
|
||||
inline const Scalarf & Phi() const { return this->m_Phi; }
|
||||
protected:
|
||||
Scalarf m_Theta;
|
||||
Scalarf m_Phi;
|
||||
};
|
||||
|
||||
|
||||
class MuonError : public MuonErrorData {
|
||||
public:
|
||||
inline Scalarf & Theta() { return this->m_Theta; }
|
||||
inline Scalarf & Phi() { return this->m_Phi; }
|
||||
};
|
||||
|
||||
|
||||
} // end ulib space
|
||||
|
||||
|
||||
#endif // U_MUONERROR_H
|
||||
73
src/HEP/Detectors/MuonEvent.h
Normal file
73
src/HEP/Detectors/MuonEvent.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
#ifndef U_MUONEVENT_H
|
||||
#define U_MUONEVENT_H
|
||||
|
||||
#include "Math/Dense.h"
|
||||
|
||||
namespace uLib {
|
||||
|
||||
|
||||
class MuonEventData {
|
||||
public:
|
||||
inline const HLine3f & LineIn() const { return this->m_LineIn; }
|
||||
inline const HLine3f & LineOut() const { return this->m_LineOut; }
|
||||
inline Scalarf GetMomentum() const { return this->m_Momentum; }
|
||||
|
||||
protected:
|
||||
HLine3f m_LineIn;
|
||||
HLine3f m_LineOut;
|
||||
Scalarf m_Momentum;
|
||||
};
|
||||
|
||||
|
||||
class MuonEvent : public MuonEventData {
|
||||
public:
|
||||
inline HLine3f & LineIn() { return this->m_LineIn; }
|
||||
inline HLine3f & LineOut() { return this->m_LineOut; }
|
||||
inline Scalarf & Momentum() { return this->m_Momentum; }
|
||||
|
||||
};
|
||||
|
||||
inline std::ostream&
|
||||
operator<< (std::ostream& stream, const MuonEventData &mu) {
|
||||
stream << " MuonEventData: --------------- \n"
|
||||
<< " P: " << mu.GetMomentum() << "\n"
|
||||
<< " IN: " << mu.LineIn() << "\n"
|
||||
<< " OUT: " << mu.LineOut() << "\n"
|
||||
<< " ------------------------------ \n";
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // end ulib space
|
||||
|
||||
|
||||
|
||||
#endif // U_MUONEVENT_H
|
||||
80
src/HEP/Detectors/MuonScatter.h
Normal file
80
src/HEP/Detectors/MuonScatter.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef U_MUONSCATTER_H
|
||||
#define U_MUONSCATTER_H
|
||||
|
||||
#include "Math/Dense.h"
|
||||
|
||||
namespace uLib {
|
||||
|
||||
|
||||
class MuonScatter {
|
||||
public:
|
||||
inline const HLine3f & LineIn() const { return this->m_LineIn; }
|
||||
inline const HError3f & ErrorIn() const { return this->m_ErrorIn; }
|
||||
inline const HLine3f & LineOut() const { return this->m_LineOut; }
|
||||
inline const HError3f & ErrorOut() const { return this->m_ErrorOut; }
|
||||
|
||||
inline HLine3f & LineIn() { return this->m_LineIn; }
|
||||
inline HError3f & ErrorIn() { return this->m_ErrorIn; }
|
||||
inline HLine3f & LineOut() { return this->m_LineOut; }
|
||||
inline HError3f & ErrorOut() { return this->m_ErrorOut; }
|
||||
|
||||
inline void SetMomentum(Scalarf name) { this->m_Momentum = name; }
|
||||
inline void SetMomentumPrime(Scalarf name) { this->m_MomentumPrime = name; }
|
||||
|
||||
inline Scalarf GetMomentum() const { return this->m_Momentum; }
|
||||
inline Scalarf GetMomentumPrime() const { return this->m_MomentumPrime; }
|
||||
|
||||
protected:
|
||||
HLine3f m_LineIn;
|
||||
HLine3f m_LineOut;
|
||||
HError3f m_ErrorIn;
|
||||
HError3f m_ErrorOut;
|
||||
Scalarf m_Momentum;
|
||||
Scalarf m_MomentumPrime;
|
||||
};
|
||||
|
||||
typedef MuonScatter MuonScatterData;
|
||||
|
||||
inline std::ostream&
|
||||
operator<< (std::ostream& stream, const MuonScatterData &mu) {
|
||||
stream << " MuonScatterData: ------------- \n"
|
||||
<< " P: " << mu.GetMomentum() << " Pprim: " << mu.GetMomentumPrime() << "\n"
|
||||
<< " IN: " << mu.LineIn() << "\n"
|
||||
<< " " << mu.ErrorIn() << "\n"
|
||||
<< " OUT: " << mu.LineOut() << "\n"
|
||||
<< " " << mu.ErrorOut() <<"\n"
|
||||
<< " ------------------------------ \n";
|
||||
return stream;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // U_MUONSCATTER_H
|
||||
15
src/HEP/Detectors/testing/CMakeLists.txt
Normal file
15
src/HEP/Detectors/testing/CMakeLists.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
# TESTS
|
||||
set( TESTS
|
||||
# GDMLSolidTest
|
||||
HierarchicalEncodingTest
|
||||
)
|
||||
|
||||
set(LIBRARIES
|
||||
${PACKAGE_LIBPREFIX}Core
|
||||
${PACKAGE_LIBPREFIX}Math
|
||||
Boost::serialization
|
||||
Boost::program_options
|
||||
Eigen3::Eigen
|
||||
${ROOT_LIBRARIES}
|
||||
)
|
||||
uLib_add_tests(Detectors)
|
||||
72
src/HEP/Detectors/testing/GDMLSolidTest.cpp
Normal file
72
src/HEP/Detectors/testing/GDMLSolidTest.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
|
||||
#include <Geant4/G4RunManager.hh>
|
||||
|
||||
#include <Geant4/G4Material.hh>
|
||||
#include <Geant4/G4NistManager.hh>
|
||||
|
||||
#include <Geant4/G4Box.hh>
|
||||
#include <Geant4/G4TessellatedSolid.hh>
|
||||
#include <Geant4/G4LogicalVolume.hh>
|
||||
#include <Geant4/G4PVPlacement.hh>
|
||||
|
||||
#include <Geant4/G4GDMLParser.hh>
|
||||
//#include <Geant4/G4GDMLRead.hh>
|
||||
//#include <Geant4/G4GDMLReadSolids.hh>
|
||||
|
||||
|
||||
#include "Detectors/Solid.h"
|
||||
#include "testing-prototype.h"
|
||||
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
// G4RunManager* runManager = new G4RunManager;
|
||||
|
||||
G4NistManager *nist = G4NistManager::Instance();
|
||||
G4Material *air = nist->FindOrBuildMaterial("G4_AIR");
|
||||
|
||||
|
||||
|
||||
G4Box *box = new G4Box("box",5,5,5);
|
||||
|
||||
G4LogicalVolume box_lv(NULL,NULL,"box test");
|
||||
box_lv.SetSolid(box);
|
||||
box_lv.SetMaterial(air);
|
||||
G4PVPlacement box_pl(0,G4ThreeVector(),&box_lv,"box test",0,0,0);
|
||||
|
||||
G4GDMLParser parser;
|
||||
|
||||
parser.Write("test_out.gdml",&box_lv);
|
||||
|
||||
|
||||
}
|
||||
50
src/HEP/Detectors/testing/HierarchicalEncodingTest.cpp
Normal file
50
src/HEP/Detectors/testing/HierarchicalEncodingTest.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
#include <iostream>
|
||||
#include <Detectors/Hit.h>
|
||||
|
||||
#include "testing-prototype.h"
|
||||
|
||||
using namespace uLib;
|
||||
|
||||
int main() {
|
||||
BEGIN_TESTING(Hierarchical Encoding);
|
||||
|
||||
|
||||
HitRawCode_CMSDrift code;
|
||||
code = Vector4i(5,6,2,8);
|
||||
|
||||
|
||||
|
||||
Vector4i v = code;
|
||||
|
||||
|
||||
std::cout << code << "\n";
|
||||
std::cout << v << "\n";
|
||||
|
||||
END_TESTING;
|
||||
}
|
||||
|
||||
16
src/HEP/Detectors/testing/Makefile.am
Normal file
16
src/HEP/Detectors/testing/Makefile.am
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
include $(top_srcdir)/Common.am
|
||||
|
||||
#AM_DEFAULT_SOURCE_EXT = .cpp
|
||||
|
||||
# if HAVE_CHECK
|
||||
TESTS = GDMLSolidTest
|
||||
|
||||
# else
|
||||
# TEST =
|
||||
# endif
|
||||
|
||||
LDADD = $(top_srcdir)/libmutom-${PACKAGE_VERSION}.la
|
||||
|
||||
check_PROGRAMS = $(TESTS)
|
||||
|
||||
37
src/HEP/Detectors/testing/testing-prototype.h
Normal file
37
src/HEP/Detectors/testing/testing-prototype.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
|
||||
All rights reserved
|
||||
|
||||
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
|
||||
|
||||
------------------------------------------------------------------
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3.0 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define BEGIN_TESTING(name) \
|
||||
static int _fail = 0; \
|
||||
printf("..:: Testing " #name " ::..\n");
|
||||
|
||||
#define TEST1(val) _fail += (val)==0
|
||||
#define TEST0(val) _fail += (val)!=0
|
||||
#define END_TESTING return _fail;
|
||||
|
||||
Reference in New Issue
Block a user