StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiGenericDetectorGroup.cxx
1 // $Id: StiGenericDetectorGroup.cxx,v 2.7 2018/06/29 21:46:26 smirnovd Exp $
2 // Author: Valeri Fine, Dec 2006
3 
4 #include <cassert>
5 #include <stdexcept>
6 #include "StiGenericDetectorGroup.h"
7 #include "Sti/StiDetectorBuilder.h"
8 
9 //_____________________________________________________________________________
10 StiGenericDetectorGroup::StiGenericDetectorGroup(const string & name)
11  : Named(name),
12  _detectorBuilder(0),
13  _groupId(-1)
14 {
15 
16 }
17 
18 //_____________________________________________________________________________
19 StiGenericDetectorGroup::StiGenericDetectorGroup(const string & name,
20  StiDetectorBuilder * detectorBuilder)
21  : Named(name),
22  _detectorBuilder(detectorBuilder),
23  _groupId(-1)
24 {
25 }
26 
27 //_____________________________________________________________________________
28 StiGenericDetectorGroup::~StiGenericDetectorGroup()
29 {
30  delete _detectorBuilder;
31 }
32 //_____________________________________________________________________________
34 {
35  assert(_detectorBuilder);
36  return _detectorBuilder;
37 }
38 
39 
40 //_____________________________________________________________________________
42 {
43  if (_detectorBuilder) _detectorBuilder->setGroupId(id);
44  _groupId = id;
45 }
46 
47 //_____________________________________________________________________________
48 int StiGenericDetectorGroup::getGroupId() const
49 {
50  return _groupId;
51 }
Definition: Named.h:16
int _groupId
Detector group identifier.
virtual StiDetectorBuilder * getDetectorBuilder()
Get a detector builder appropriate for this detector group.