GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
CalorimeterParametersImpl.cc
1 #include "gearimpl/CalorimeterParametersImpl.h"
2 
3 namespace gear{
4 
5 
6  CalorimeterParametersImpl::CalorimeterParametersImpl(double rMin, double zMax, int symOrder, double phi0) :
7  _type( CalorimeterParameters::BARREL) ,
8  _sym( symOrder ) ,
9  _phi( phi0 )
10 
11  {
12  _extent.resize(4) ;
13  _extent[0] = rMin ;
14  _extent[1] = rMin ; // dynamically computed from layers
15  _extent[2] = 0.0 ;
16  _extent[3] = zMax ;
17  }
18 
19 
20 
21  CalorimeterParametersImpl::CalorimeterParametersImpl(double rMin, double rMax, double zMin, int symOrder, double phi0) :
22  _type( CalorimeterParameters::ENDCAP) ,
23  _sym( symOrder ) ,
24  _phi( phi0 )
25 
26  {
27  _extent.resize(4) ;
28  _extent[0] = rMin ;
29  _extent[1] = rMax ;
30  _extent[2] = zMin ;
31  _extent[3] = zMin ;// dynamically computed from layers
32  }
33 
34  const std::vector<double>& CalorimeterParametersImpl::getExtent() const {
35 
36  int nLayer = _layout.getNLayers() ;
37 
38 
39  if( nLayer > 0 ) {
40 
41  if( _type == CalorimeterParameters::BARREL ) {
42 
43  // the first layer starts at rMin and the last layer ends at its distance from the origin plus its thickness
44 
45  _extent[1] = _layout.getDistance( nLayer-1 ) + _layout.getThickness( nLayer-1 ) ;
46 
47  } else {
48 
49  _extent[3] = _layout.getDistance( nLayer-1 ) + _layout.getThickness( nLayer-1 ) ;
50  }
51  }
52 
53  return _extent ;
54  }
55 
56 
57 }
Proposal for an abstract interface that defines geometry properties of a typical sampling calorimeter...
virtual int getNLayers() const
The total number of layers.
virtual double getThickness(int layerIndex) const
The thickness of the layer layerIndex - layer indexing starts at 0 for the layer closest to the origi...
virtual double getDistance(int layerIndex) const
The distance of the layer layerIndex from the origin - layer indexing starts at 0 for the layer close...
virtual const std::vector< double > & getExtent() const
Extent of the calorimeter in the r-z-plane [ rmin, rmax, zmin, zmax ] in mm.
CalorimeterParametersImpl(double rMin, double zMax, int symOrder=8, double phi0=0.0)
C&#39;tor for a cylindrical (octagonal) BARREL calorimeter.