forked from key4hep/k4geo
/
Hcal_BarrelSD_v00.cpp
70 lines (48 loc) · 2.09 KB
/
Hcal_BarrelSD_v00.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//====================================================================
// lcgeo - LC detector models in DD4hep
//--------------------------------------------------------------------
// Geometry driver for semi-digitia HcalBarrel
//--------------------------------------------------------------------
// G.Grenier
// $Id$
//====================================================================
#include "DD4hep/DetFactoryHelper.h"
#include "XML/Layering.h"
#include "XML/Utilities.h"
#include "DDRec/DetectorData.h"
#include "LcgeoExceptions.h"
using namespace std;
using dd4hep::BUILD_ENVELOPE;
using dd4hep::DetElement;
using dd4hep::Detector;
using dd4hep::PlacedVolume;
using dd4hep::Ref_t;
using dd4hep::SensitiveDetector;
static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDetector sens) {
// static double tolerance = 0e0;
xml_det_t x_det = element;
string det_name = x_det.nameStr();
// xml_comp_t x_dim = x_det.dimensions();
// int nsides = x_dim.numsides();
// Hcal Barrel module shapers' parameters
// double Hcal_inner_radius = x_dim.rmin();
// double Hcal_outer_radius = x_dim.rmax();
// double detZ = x_dim.zhalf();
DetElement sdet( det_name,x_det.id() );
// --- create an envelope volume and position it into the world ---------------------
// Volume envelope =
dd4hep::xml::createPlacedEnvelope( theDetector, element , sdet ) ;
if( theDetector.buildType() == BUILD_ENVELOPE ) return sdet ;
//-----------------------------------------------------------------------------------
sens.setType("calorimeter");
// Some verbose output
cout << " \n\n\n CREATE DETECTOR: Hcal_BarrelSD_v00" << endl;
//-----------------------------------------------------------------------------------
//
// ... construct the calorimeter in its envelope
//
//-----------------------------------------------------------------------------------
// sdet.addExtension< DDRec::LayeredCalorimeterData >( caloData ) ;
return sdet;
}
DECLARE_DETELEMENT(Hcal_BarrelSD_v00, create_detector)