forked from eic/fun4all_eicdetectors
-
Notifications
You must be signed in to change notification settings - Fork 2
/
PHG4CrystalCalorimeterDetector.h
95 lines (71 loc) · 2.62 KB
/
PHG4CrystalCalorimeterDetector.h
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Tell emacs that this is a C++ source
// -*- C++ -*-.
#ifndef G4DETECTORS_PHG4CRYSTALCALORIMETERDETECTOR_H
#define G4DETECTORS_PHG4CRYSTALCALORIMETERDETECTOR_H
#include "PHG4CrystalCalorimeterDefs.h"
#include <g4main/PHG4Detector.h>
#include <map>
#include <set>
#include <string>
class G4LogicalVolume;
class G4Material;
class G4VPhysicalVolume;
class PHCompositeNode;
class PHG4CrystalCalorimeterDisplayAction;
class PHG4Subsystem;
class PHParameters;
/**
* \file ${file_name}
* \brief Module to build crystal calorimeter in Geant4
* \author Nils Feege <nils.feege@stonybrook.edu>
*/
class PHG4CrystalCalorimeterDetector : public PHG4Detector
{
public:
//! constructor
PHG4CrystalCalorimeterDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, PHParameters *parameters, const std::string &dnam);
//! destructor
virtual ~PHG4CrystalCalorimeterDetector() {}
//! construct
virtual void ConstructMe(G4LogicalVolume *world);
//! check if volume is in this calorimeter
virtual int IsInCrystalCalorimeter(G4VPhysicalVolume *) const;
// ----- accessing member variables: ------------
void SuperDetector(const std::string &name) { m_SuperDetector = name; }
const std::string SuperDetector() const { return m_SuperDetector; }
int get_DetectorId() const { return m_DetectorId; }
void DetectorId(const int i) { m_DetectorId = i; }
// ----- additional accessors used by derived classes: ------------
PHParameters *GetParams() { return m_Params; }
protected: // for variables also used in PHG4ProjCrystalCalorimeterDetector
PHG4CrystalCalorimeterDisplayAction *GetDisplayAction() { return m_DisplayAction; }
G4Material *GetCarbonFiber();
virtual int GetCaloType() const { return PHG4CrystalCalorimeterDefs::CaloType::nonprojective; }
private: // private stuff
G4LogicalVolume *ConstructTower();
int PlaceTower(G4LogicalVolume *envelope, G4LogicalVolume *tower);
int ParseParametersFromTable();
struct towerposition
{
G4double x;
G4double y;
G4double z;
int idx_j;
int idx_k;
};
int m_DetectorId = 0;
std::string m_SuperDetector;
PHParameters *m_Params = nullptr;
PHG4CrystalCalorimeterDisplayAction *m_DisplayAction = nullptr;
std::string _towerlogicnameprefix;
std::map<std::string, G4double> _map_global_parameter;
std::map<std::string, towerposition> _map_tower;
std::set<G4VPhysicalVolume *> m_ActiveVolumeSet;
std::set<G4VPhysicalVolume *> m_PassiveVolumeSet;
// since getting parameters is a map search we do not want to
// do this in every step, the parameters used are cached
// in the following variables
int m_IsActive;
int m_AbsorberActive;
};
#endif