Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaSubDetector.h
Go to the documentation of this file.
1#ifndef Podd_THaSubDetector_h_
2#define Podd_THaSubDetector_h_
3
5//
6// THaSubDetector
7//
8// Abstract base class for a generic Hall A detector. This class
9// describes a subdetector (part of an actual detector). It cannot
10// be added to an apparatus, but it must be contained in either
11// another detector or subdetector.
12//
14
15#include "THaDetector.h"
16#include "TRef.h"
17
18class THaApparatus;
19
21
22public:
23 virtual ~THaSubDetector() = default;
24
25 // Get parent (sub)detector (one level up)
27 return static_cast<THaDetectorBase*>(fParent.GetObject());
28 }
29 // For backward compatibility
30 THaDetectorBase* GetDetector() const { return GetParent(); }
31 // Search for parent THaDetector (not subdetector)
34
35 virtual void SetParent( THaDetectorBase* );
36 void SetDetector( THaDetectorBase* det ) { SetParent(det); }
37
38protected:
39
40 virtual const char* GetDBFileName() const;
41 virtual void MakePrefix();
42
43 //Only derived classes may construct me
44 THaSubDetector( const char* name, const char* description,
45 THaDetectorBase* parent );
46 THaSubDetector() {} // For ROOT RTTI
47
48 private:
49 TRef fParent; // (Sub)detector containing this subdetector
50
51 public:
52 ClassDef(THaSubDetector,1) //ABC for a subdetector
53};
54
55#endif
#define ClassDef(name, id)
THaDetectorBase * GetDetector() const
THaDetectorBase * GetParent() const
void SetDetector(THaDetectorBase *det)
THaSubDetector(const char *name, const char *description, THaDetectorBase *parent)
virtual void SetParent(THaDetectorBase *)
virtual void MakePrefix()
virtual const char * GetDBFileName() const
THaApparatus * GetApparatus() const
THaDetector * GetMainDetector() const
virtual ~THaSubDetector()=default
TObject * GetObject() const