diff --git a/DDRec/include/DDRec/BarrelDetector.h b/DDRec/include/DDRec/BarrelDetector.h new file mode 100644 index 0000000000000000000000000000000000000000..aa135ea44944e4e63a6597c01e3789a3a95e1c42 --- /dev/null +++ b/DDRec/include/DDRec/BarrelDetector.h @@ -0,0 +1,29 @@ +/* + * BarrelDetector.h + * + * Created on: Apr 3, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef BARRELDETECTOR_H_ +#define BARRELDETECTOR_H_ + +#include "DD4hep/Detector.h" + +namespace DD4hep { + +namespace DDRec { +class BarrelDetector: virtual public DetElement { + +public: + BarrelDetector(const DetElement& e) : DetElement(e) {}; + virtual ~BarrelDetector() {} + + bool isBarrel() const { + return true; + } +}; + +} /* namespace DDRec */ +} /* namespace DD4hep */ +#endif /* BARRELDETECTOR_H_ */ diff --git a/DDRec/include/DDRec/Calorimeter.h b/DDRec/include/DDRec/Calorimeter.h new file mode 100644 index 0000000000000000000000000000000000000000..d78bdc6a292909e190035c49835ee035ff279942 --- /dev/null +++ b/DDRec/include/DDRec/Calorimeter.h @@ -0,0 +1,30 @@ +/* + * Calorimeter.h + * + * Created on: Mar 27, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef CALORIMETER_H_ +#define CALORIMETER_H_ + +#include "DD4hep/Detector.h" +#include "LayeredSubdetector.h" + +namespace DD4hep { + +namespace DDRec { + +class Calorimeter: public LayeredSubdetector { + +public: + Calorimeter(const DetElement& e) : DetElement(e), LayeredSubdetector(e) {} + virtual ~Calorimeter() {} + + virtual bool isCalorimeter() const { + return true; + } +}; +} +} /* namespace DD4hep */ +#endif /* CALORIMETER_H_ */ diff --git a/DDRec/include/DDRec/CylindricalBarrelCalorimeter.h b/DDRec/include/DDRec/CylindricalBarrelCalorimeter.h new file mode 100644 index 0000000000000000000000000000000000000000..70bea24a5f45635994c6276108486fbfdd7ce31a --- /dev/null +++ b/DDRec/include/DDRec/CylindricalBarrelCalorimeter.h @@ -0,0 +1,25 @@ +/* + * CylindricalBarrelCalorimeter.h + * + * Created on: Apr 17, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef CYLINDRICALBARRELCALORIMETER_H_ +#define CYLINDRICALBARRELCALORIMETER_H_ + +#include "CylindricalCalorimeter.h" +#include "BarrelDetector.h" + +namespace DD4hep { +namespace DDRec { + +class CylindricalBarrelCalorimeter: public CylindricalCalorimeter, public BarrelDetector { +public: + CylindricalBarrelCalorimeter(const DetElement& e) : DetElement(e), CylindricalCalorimeter(e), BarrelDetector(e) {} + virtual ~CylindricalBarrelCalorimeter() {} +}; + +} /* namespace DDRec */ +} /* namespace DD4hep */ +#endif /* CYLINDRICALBARRELCALORIMETER_H_ */ diff --git a/DDRec/include/DDRec/CylindricalCalorimeter.h b/DDRec/include/DDRec/CylindricalCalorimeter.h new file mode 100644 index 0000000000000000000000000000000000000000..976c0f350a1adb6accc6c58fa3a43cc816a76872 --- /dev/null +++ b/DDRec/include/DDRec/CylindricalCalorimeter.h @@ -0,0 +1,25 @@ +/* + * CylindricalCalorimeter.h + * + * Created on: Apr 17, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef CYLINDRICALCALORIMETER_H_ +#define CYLINDRICALCALORIMETER_H_ + +#include "CylindricalDetector.h" +#include "Calorimeter.h" + +namespace DD4hep { +namespace DDRec { + +class CylindricalCalorimeter: public Calorimeter, public CylindricalDetector { +public: + CylindricalCalorimeter(const DetElement& e) : DetElement(e), Calorimeter(e), CylindricalDetector(e) {} + virtual ~CylindricalCalorimeter() {} +}; + +} /* namespace DDRec */ +} /* namespace DD4hep */ +#endif /* CYLINDRICALCALORIMETER_H_ */ diff --git a/DDRec/include/DDRec/CylindricalDetector.h b/DDRec/include/DDRec/CylindricalDetector.h new file mode 100644 index 0000000000000000000000000000000000000000..53a3a81f5d021ee0f13110774341a9d79dde79dd --- /dev/null +++ b/DDRec/include/DDRec/CylindricalDetector.h @@ -0,0 +1,43 @@ +/* + * CylindricalDetector.h + * + * Created on: Apr 16, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef CYLINDRICALDETECTOR_H_ +#define CYLINDRICALDETECTOR_H_ + +#include "DD4hep/Detector.h" +#include "DD4hep/Shapes.h" + +namespace DD4hep { +namespace DDRec { + +class CylindricalDetector: virtual public DetElement { +public: + CylindricalDetector(const DetElement& e) : DetElement(e) {} + virtual ~CylindricalDetector() {} + + double getRMin() const { + return getCylinder()->GetRmin(); + } + double getRMax() const { + return getCylinder()->GetRmax(); + } + double getZMin() const { + return -getCylinder()->GetDZ() / 2.; + } + double getZMax() const { + return getCylinder()->GetDZ() / 2.; + } + +protected: + Tube getCylinder() const { + return Tube(volume().solid()); + } +}; + +} /* namespace DDRec */ +} /* namespace DD4hep */ +#endif /* CYLINDRICALDETECTOR_H_ */ diff --git a/DDRec/include/DDRec/CylindricalEndcapCalorimeter.h b/DDRec/include/DDRec/CylindricalEndcapCalorimeter.h new file mode 100644 index 0000000000000000000000000000000000000000..958c37be733c210bc9a143a6eab65782ae84de38 --- /dev/null +++ b/DDRec/include/DDRec/CylindricalEndcapCalorimeter.h @@ -0,0 +1,25 @@ +/* + * CylindricalEndcapCalorimeter.h + * + * Created on: Apr 17, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef CYLINDRICALENDCAPCALORIMETER_H_ +#define CYLINDRICALENDCAPCALORIMETER_H_ + +#include "CylindricalCalorimeter.h" +#include "EndcapDetector.h" + +namespace DD4hep { +namespace DDRec { + +class CylindricalEndcapCalorimeter: public CylindricalCalorimeter, public EndcapDetector { +public: + CylindricalEndcapCalorimeter(const DetElement& e) : DetElement(e), CylindricalCalorimeter(e), EndcapDetector(e) {} + virtual ~CylindricalEndcapCalorimeter() {} +}; + +} /* namespace DDRec */ +} /* namespace DD4hep */ +#endif /* CYLINDRICALENDCAPCALORIMETER_H_ */ diff --git a/DDRec/include/DDRec/EndcapDetector.h b/DDRec/include/DDRec/EndcapDetector.h new file mode 100644 index 0000000000000000000000000000000000000000..07f5be5babefd346f1717ede0ca669fb8a695a46 --- /dev/null +++ b/DDRec/include/DDRec/EndcapDetector.h @@ -0,0 +1,28 @@ +/* + * EndcapDetector.h + * + * Created on: Apr 16, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef ENDCAPDETECTOR_H_ +#define ENDCAPDETECTOR_H_ + +#include "DD4hep/Detector.h" + +namespace DD4hep { +namespace DDRec { + +class EndcapDetector: virtual public DetElement { +public: + EndcapDetector(const DetElement& e) : DetElement(e) {} + virtual ~EndcapDetector() {} + + bool isEndcap() const { + return true; + } +}; + +} /* namespace DDRec */ +} /* namespace DD4hep */ +#endif /* ENDCAPDETECTOR_H_ */ diff --git a/DDRec/include/DDRec/Exceptions.h b/DDRec/include/DDRec/Exceptions.h new file mode 100644 index 0000000000000000000000000000000000000000..46895559ccf8ef4ad1a6f24f4fadfb5fcc0980b0 --- /dev/null +++ b/DDRec/include/DDRec/Exceptions.h @@ -0,0 +1,32 @@ +// $Id: Exceptions.h 513 2013-04-05 14:31:53Z gaede $ +//==================================================================== +// AIDA Detector description implementation for LCD +//-------------------------------------------------------------------- +// +// Author : A.Muennich +// +//==================================================================== +#ifndef EXCEPTIONS_H +#define EXCEPTIONS_H + +#include <exception> + +namespace DD4hep { + + + //define some exception to throw + class OutsideGeometryException : public std::exception{ + + protected: + std::string message; + OutsideGeometryException() { /*no_op*/ ; } + + public: + OutsideGeometryException( std::string text ){ + message = "OutsideGeometryException: " + text ; + } + virtual const char* what() const throw() { return message.c_str() ; } + virtual ~OutsideGeometryException() throw() { /*no_op*/; } + }; +} +#endif diff --git a/DDRec/include/DDRec/LayerStack.h b/DDRec/include/DDRec/LayerStack.h new file mode 100644 index 0000000000000000000000000000000000000000..efc9f7540f57512af3a84b7996f6dddb1d598bba --- /dev/null +++ b/DDRec/include/DDRec/LayerStack.h @@ -0,0 +1,57 @@ +/* + * LayerStack.h + * + * Created on: Apr 18, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef LAYERSTACK_H_ +#define LAYERSTACK_H_ + +#include "DD4hep/Detector.h" + +#include <vector> + +namespace DD4hep { +namespace DDRec { + +class LayerStack { +public: + LayerStack(const DetElement& det); + LayerStack(const LayerStack& layerStack, const DetElement& det); + virtual ~LayerStack(); + virtual int getNumberOfLayers() const = 0; + virtual int getNumberOfModules(int layerIndex = 1) const = 0; + virtual DetElement getModule(int layerIndex = 1, int moduleIndex = 1) const = 0; + double getThickness(int layerIndex = 1, int moduleIndex = 1) const; + double getRadiationLengths(int layerIndex = 1, int moduleIndex = 1) const; + double getInteractionLengths(int layerIndex = 1, int moduleIndex = 1) const; + double getTotalThickness(int moduleIndex = 1) const; + double getTotalInteractionLengths(int moduleIndex = 1) const; + double getTotalRadiationLengths(int moduleIndex = 1) const; + virtual int getNumberOfSlices(int layerIndex = 1, int moduleIndex = 1) const = 0; + virtual DetElement getSlice(int layerIndex = 1, int moduleIndex = 1, int sliceIndex = 1) const = 0; + virtual int getNumberOfSensors(int layerIndex = 1, int moduleIndex = 1) const = 0; + virtual DetElement getSensor(int layerIndex = 1, int moduleIndex = 1, int sensorIndex = 1) const = 0; + +protected: + DetElement det; +}; + +class PolyhedralCalorimeterLayerStack: public LayerStack { +public: + PolyhedralCalorimeterLayerStack(const DetElement& det); + PolyhedralCalorimeterLayerStack(const PolyhedralCalorimeterLayerStack& layerStack, const DetElement& det); + virtual ~PolyhedralCalorimeterLayerStack(); + int getNumberOfLayers() const; + int getNumberOfModules(int layerIndex = 1) const; + DetElement getModule(int layerIndex = 1, int moduleIndex = 1) const; + int getNumberOfSlices(int layerIndex = 1, int moduleIndex = 1) const; + DetElement getSlice(int layerIndex = 1, int moduleIndex = 1, int sliceIndex = 1) const; + int getNumberOfSensors(int layerIndex = 1, int moduleIndex = 1) const; + DetElement getSensor(int layerIndex = 1, int moduleIndex = 1, int sensorIndex = 1) const; +}; + +} /* namespace DDRec */ +} /* namespace DD4hep */ +#endif /* LAYERSTACK_H_ */ diff --git a/DDRec/include/DDRec/LayeredSubdetector.h b/DDRec/include/DDRec/LayeredSubdetector.h new file mode 100644 index 0000000000000000000000000000000000000000..ee3dd84ceb59a7a837f5411f352265fee8c3f857 --- /dev/null +++ b/DDRec/include/DDRec/LayeredSubdetector.h @@ -0,0 +1,78 @@ +/* + * LayeredSubdetector.h + * + * Created on: Mar 27, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef LAYEREDSUBDETECTOR_H_ +#define LAYEREDSUBDETECTOR_H_ + +#include "LayerStack.h" + +#include "DD4hep/Detector.h" + +namespace DD4hep { +namespace DDRec { + +class LayeredSubdetector: virtual public DetElement { +public: + LayeredSubdetector(const DetElement& e); + virtual ~LayeredSubdetector(); + + inline bool isLayered() const { + return true; + } + + inline int getNumberOfLayers() const { + return layerStack->getNumberOfLayers(); + } + + inline int getNumberOfSensors(int layerIndex, int moduleIndex = 1) const { + return layerStack->getNumberOfSensors(layerIndex, moduleIndex); + } + + inline DetElement getSensor(int layerIndex, int moduleIndex = 1, int sensorIndex = 1) const { + return layerStack->getSensor(layerIndex, moduleIndex, sensorIndex); + } + + inline double getLayerThickness(int layerIndex, int moduleIndex = 1) const { + return layerStack->getThickness(layerIndex, moduleIndex); + } + + inline double getInteractionLengths(int layerIndex, int moduleIndex = 1) const { + return layerStack->getInteractionLengths(layerIndex, moduleIndex); + } + + inline double getRadiationLengths(int layerIndex, int moduleIndex = 1) const { + return layerStack->getRadiationLengths(layerIndex, moduleIndex); + } + + inline double getMipEnergyLoss(int layerIndex, int moduleIndex = 1) const { + return 0.; + } + + inline double getTotalThickness(int moduleIndex = 1) const { + return layerStack->getTotalThickness(moduleIndex); + } + + inline double getTotalInteractionLengths(int moduleIndex = 1) const { + return layerStack->getTotalInteractionLengths(moduleIndex); + } + + inline double getTotalRadiationLengths(int moduleIndex = 1) const { + return layerStack->getTotalRadiationLengths(moduleIndex); + } + +protected: + LayerStack* layerStack; + +private: + void getExtension(); + +}; + +} /* namespace DDRec */ +} /* namespace DD4hep */ + +#endif /* LAYEREDSUBDETECTOR_H_ */ diff --git a/DDRec/include/DDRec/PolyhedralBarrelCalorimeter.h b/DDRec/include/DDRec/PolyhedralBarrelCalorimeter.h new file mode 100644 index 0000000000000000000000000000000000000000..0bf79bcc4f0804d15c1b8fa3a2783dea3791228c --- /dev/null +++ b/DDRec/include/DDRec/PolyhedralBarrelCalorimeter.h @@ -0,0 +1,25 @@ +/* + * PolyhedralBarrelCalorimeter.h + * + * Created on: Apr 3, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef POLYHEDRALBARRELCALORIMETER_H_ +#define POLYHEDRALBARRELCALORIMETER_H_ + +#include "BarrelDetector.h" +#include "PolyhedralCalorimeter.h" + +namespace DD4hep { +namespace DDRec { + +class PolyhedralBarrelCalorimeter: public BarrelDetector, public PolyhedralCalorimeter { +public: + PolyhedralBarrelCalorimeter(const DetElement& e) : DetElement(e), BarrelDetector(e), PolyhedralCalorimeter(e) {} + virtual ~PolyhedralBarrelCalorimeter() {} +}; + +} /* namespace DDRec */ +} /* namespace DD4hep */ +#endif /* POLYHEDRALBARRELCALORIMETER_H_ */ diff --git a/DDRec/include/DDRec/PolyhedralCalorimeter.h b/DDRec/include/DDRec/PolyhedralCalorimeter.h new file mode 100644 index 0000000000000000000000000000000000000000..1424ccb01d03cd1e25719fcd43248a126450befd --- /dev/null +++ b/DDRec/include/DDRec/PolyhedralCalorimeter.h @@ -0,0 +1,25 @@ +/* + * PolyhedralCalorimeter.h + * + * Created on: Apr 17, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef POLYHEDRALCALORIMETER_H_ +#define POLYHEDRALCALORIMETER_H_ + +#include "PolyhedralDetector.h" +#include "Calorimeter.h" + +namespace DD4hep { +namespace DDRec { + +class PolyhedralCalorimeter: public PolyhedralDetector, public Calorimeter { +public: + PolyhedralCalorimeter(const DetElement& e) : DetElement(e), Calorimeter(e), PolyhedralDetector(e) {} + virtual ~PolyhedralCalorimeter() {} +}; + +} /* namespace DDRec */ +} /* namespace DD4hep */ +#endif /* POLYHEDRALCALORIMETER_H_ */ diff --git a/DDRec/include/DDRec/PolyhedralDetector.h b/DDRec/include/DDRec/PolyhedralDetector.h new file mode 100644 index 0000000000000000000000000000000000000000..67eaed1d49ed52c179b7fde27a8c6b6fb8339bee --- /dev/null +++ b/DDRec/include/DDRec/PolyhedralDetector.h @@ -0,0 +1,43 @@ +/* + * PolyhedralDetector.h + * + * Created on: Apr 3, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef POLYHEDRALDETECTOR_H_ +#define POLYHEDRALDETECTOR_H_ + +#include "DD4hep/Detector.h" + +namespace DD4hep { +namespace DDRec { +class PolyhedralDetector : virtual public DetElement { +public: + PolyhedralDetector(const DetElement& e) : DetElement(e) {} + virtual ~PolyhedralDetector() {} + + int getNSides() const { + return getPolyhedra()->GetNedges(); + } + double getRMin() const { + return getPolyhedra()->GetRmin(0); + } + double getRMax() const { + return getPolyhedra()->GetRmax(0); + } + double getZMin() const { + return getPolyhedra()->GetZ(0); + } + double getZMax() const { + return getPolyhedra()->GetZ(1); + } + +protected: + PolyhedraRegular getPolyhedra() const { + return PolyhedraRegular(volume().solid()); + } +}; +} /* namespace DDRec */ +} /* namespace DD4hep */ +#endif /* POLYHEDRALDETECTOR_H_ */ diff --git a/DDRec/include/DDRec/PolyhedralEndcapCalorimeter.h b/DDRec/include/DDRec/PolyhedralEndcapCalorimeter.h new file mode 100644 index 0000000000000000000000000000000000000000..73f44487025d7f85642974275f885d1e391869bf --- /dev/null +++ b/DDRec/include/DDRec/PolyhedralEndcapCalorimeter.h @@ -0,0 +1,25 @@ +/* + * PolyhedralEndcapCalorimeter.h + * + * Created on: Apr 16, 2013 + * Author: Christian Grefe, CERN + */ + +#ifndef POLYHEDRALENDCAPCALORIMETER_H_ +#define POLYHEDRALENDCAPCALORIMETER_H_ + +#include "EndcapDetector.h" +#include "PolyhedralCalorimeter.h" + +namespace DD4hep { +namespace DDRec { + +class PolyhedralEndcapCalorimeter: public EndcapDetector, public PolyhedralCalorimeter { +public: + PolyhedralEndcapCalorimeter(const DetElement& e) : DetElement(e), EndcapDetector(e), PolyhedralCalorimeter(e) {} + virtual ~PolyhedralEndcapCalorimeter() {} +}; + +} /* namespace DDRec */ +} /* namespace DD4hep */ +#endif /* POLYHEDRALENDCAPCALORIMETER_H_ */