Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CCalG4Ecal Class Reference

#include <CCalG4Ecal.hh>

Inheritance diagram for CCalG4Ecal:
Collaboration diagram for CCalG4Ecal:

Public Types

enum  CMType { module1, module2 }
 

Public Member Functions

 CCalG4Ecal (const G4String &name)
 
virtual ~CCalG4Ecal ()
 
void setType (CMType ty)
 
- Public Member Functions inherited from CCalEcal
 CCalEcal (const G4String &name)
 
virtual ~CCalEcal ()
 
G4String getGenMat () const
 
double getWidBox () const
 
double getLengBox () const
 
double getXpos () const
 
double getYpos () const
 
double getZpos () const
 
double getThetaX () const
 
double getPhiX () const
 
double getThetaY () const
 
double getPhiY () const
 
double getThetaZ () const
 
double getPhiZ () const
 
G4String getLayMat () const
 
int getLayNum () const
 
double getLayRadius () const
 
double getLayAngle () const
 
double getLengFront () const
 
double getLayPar (unsigned int i) const
 
G4String getCrystMat () const
 
int getCrystNum () const
 
double getCrystLength () const
 
double getCrystTol () const
 
double getCrystPar (unsigned int i) const
 
G4String getSuppMat () const
 
double getDxSupp () const
 
double getDySupp () const
 
double getDzSupp () const
 
double getDistSupp () const
 
- Public Member Functions inherited from CCalDetector
 CCalDetector (const G4String &name)
 
virtual ~CCalDetector ()
 
void constructHierarchy ()
 
void construct ()
 
void addDetector (CCalDetector *)
 
G4String Name () const
 
G4String baseFileName () const
 
G4String File () const
 
CCalDetectorgetDaughter (int i) const
 
int getNDaughters () const
 
G4bool operator== (const CCalDetector &left) const
 
G4bool operator!= (const CCalDetector &left) const
 
- Public Member Functions inherited from CCalG4Able
 CCalG4Able (G4String name)
 
virtual ~CCalG4Able ()
 
G4VPhysicalVolumePhysicalVolume (G4VPhysicalVolume *)
 
void setVisType (CCalVisualisable::visType, G4LogicalVolume *)
 
void setSensitivity (G4bool sens=true)
 
G4bool isSensitive () const
 
G4String G4Name () const
 
void setName (const G4String &name)
 
G4bool operator== (const CCalG4Able &right) const
 

Static Public Attributes

static G4String idName = "CrystalMatrix"
 

Protected Member Functions

virtual G4VPhysicalVolumeconstructIn (G4VPhysicalVolume *)
 
virtual void constructSensitive ()
 
- Protected Member Functions inherited from CCalEcal
virtual int readFile ()
 
virtual void constructDaughters ()
 
- Protected Member Functions inherited from CCalDetector
int buildFromFile ()
 
- Protected Member Functions inherited from CCalG4Able
void AddCCalG4Able (CCalG4Able *)
 

Additional Inherited Members

- Protected Attributes inherited from CCalDetector
G4String detectorName
 
G4String fileName
 
G4String pathName
 
CCalDetectorTable theDetectorsInside
 
int constructFlag
 
- Protected Attributes inherited from CCalG4Able
G4VPhysicalVolumedetPhysicalVolume
 
CCalG4AbleTable theG4DetectorsInside
 
G4String g4ableName
 
G4bool sensitivity
 
CCalVisualisable visProperties
 
G4VisAttributesg4VisAtt [CCalVisualisable::TotalVisTypes]
 

Detailed Description

Definition at line 39 of file CCalG4Ecal.hh.

Member Enumeration Documentation

Enumerator
module1 
module2 

Definition at line 42 of file CCalG4Ecal.hh.

Constructor & Destructor Documentation

CCalG4Ecal::CCalG4Ecal ( const G4String name)

Definition at line 65 of file CCalG4Ecal.cc.

65  :
66  CCalEcal(name), CCalG4Able(name), type(module1) {}
CCalG4Able(G4String name)
Definition: CCalG4Able.cc:49
CCalEcal(const G4String &name)
Definition: CCalEcal.hh:38
CCalG4Ecal::~CCalG4Ecal ( )
virtual

Definition at line 68 of file CCalG4Ecal.cc.

68 {}

Member Function Documentation

G4VPhysicalVolume * CCalG4Ecal::constructIn ( G4VPhysicalVolume mother)
protectedvirtual

Implements CCalG4Able.

Definition at line 74 of file CCalG4Ecal.cc.

74  {
75  G4cout << "==>> Constructing CCalG4Ecal..." << G4endl;
76 
78  // Construction of global volume as a Box
79 
80  if (!crystalmatrixLog) {
81  crystalmatrixLog = constructGlobal();
82  }
84 
85  G4double x, y, z;
86  if (mother != 0) {
87  x = getXpos()*mm;
88  y = getYpos()*mm;
89  z = getZpos()*mm;
90  } else {
91  x = y = z = 0;
92  }
93 
94  int num;
95  if (type == module2) {
96  num = 2;
97  } else {
98  num = 1;
99  }
100 #ifdef pdebug
101  G4String name("Null");
102  if (mother != 0) name = mother->GetName();
103  G4cout << crystalmatrixLog->GetName() << " Number " << num << " positioned in "
104  << name << " at (" << x << ", " << y << ", " << z << ")";
105 #endif
106 
107  G4RotationMatrix* cmrot = 0;
108  if (mother != 0) {
109  G4String rotstr = idName + num;
110  cmrot = rotfact->findMatrix(rotstr);
111  if (!cmrot) {
112 #ifdef ddebug
113  G4cout << "Creating a new rotation: " << rotstr << tab
114  << getThetaX()*deg << "," << getPhiX()*deg << ","
115  << getThetaY()*deg << "," << getPhiY()*deg << ","
116  << getThetaZ()*deg << "," << getPhiZ()*deg << G4endl;
117 #endif
118  cmrot = rotfact->AddMatrix(rotstr, getThetaX()*deg, getPhiX()*deg,
119  getThetaY()*deg, getPhiY()*deg,
120  getThetaZ()*deg, getPhiZ()*deg);
121  } // if !cmrot
122 #ifdef pdebug
123  G4cout << " rotation by (" << getThetaX() << ", " << getPhiX() << ", "
124  << getThetaY() << "," << getPhiY() << ", " << getThetaZ() << ", "
125  << getPhiZ() << ")" << G4endl;
126 #endif
127  } else {
128 #ifdef pdebug
129  G4cout << " without rotation..." << G4endl;
130 #endif
131  }
132 
133  G4PVPlacement* crystalmatrix;
134  if (mother != 0) {
135  crystalmatrix = new G4PVPlacement(cmrot, G4ThreeVector(x,y,z),
136  crystalmatrixLog, idName,
137  mother->GetLogicalVolume(), false, num);
138  } else {
139  crystalmatrix = new G4PVPlacement(cmrot, G4ThreeVector(x,y,z),
140  idName, crystalmatrixLog,
141  mother, false, num);
142  }
143  G4cout << "<<== End of CCalG4Ecal construction ..." << G4endl;
144 
145  return crystalmatrix;
146 }
const XML_Char * name
Definition: expat.h:151
static constexpr double mm
Definition: G4SIunits.hh:115
double getPhiX() const
Definition: CCalEcal.hh:50
double getXpos() const
Definition: CCalEcal.hh:46
CLHEP::Hep3Vector G4ThreeVector
double getPhiY() const
Definition: CCalEcal.hh:52
double getZpos() const
Definition: CCalEcal.hh:48
tuple x
Definition: test.py:50
G4RotationMatrix * AddMatrix(const G4String &name, G4double th1, G4double phi1, G4double th2, G4double phi2, G4double th3, G4double phi3)
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
static G4String idName
Definition: CCalG4Ecal.hh:51
std::ostream & tab(std::ostream &)
Definition: CCalutils.cc:89
double getThetaX() const
Definition: CCalEcal.hh:49
static CCalRotationMatrixFactory * getInstance()
double getPhiZ() const
Definition: CCalEcal.hh:54
double getThetaY() const
Definition: CCalEcal.hh:51
G4LogicalVolume * GetLogicalVolume() const
double getYpos() const
Definition: CCalEcal.hh:47
G4RotationMatrix * findMatrix(const G4String &)
tuple z
Definition: test.py:28
#define G4endl
Definition: G4ios.hh:61
double getThetaZ() const
Definition: CCalEcal.hh:53
const G4String & GetName() const
double G4double
Definition: G4Types.hh:76
static constexpr double deg
Definition: G4SIunits.hh:152

Here is the call graph for this function:

void CCalG4Ecal::constructSensitive ( )
protectedvirtual

Reimplemented from CCalG4Able.

Definition at line 276 of file CCalG4Ecal.cc.

276  {
277 
278 #ifdef debug
279  G4cout << "Now registering CrystalMatrix LogicalVolume's to SD's:" << G4endl;
280 #endif
281  if (sensitiveLogs.size()>0) {
283  G4String SDname = idName;
284  for(std::vector<ptrG4Log>::iterator iter=sensitiveLogs.begin();
285  iter<sensitiveLogs.end(); iter++) {
286  sensDets->registerVolume(SDname, (*iter));
287 #ifdef sdebug
288  G4cout << "Register volume " << (*iter)->GetName() << " for" << SDname
289  << G4endl;
290 #endif
291  }
292  }
293 
294 }
static CCalSensitiveDetectors * getInstance()
void registerVolume(const G4String &name, G4LogicalVolume *)
G4GLOB_DLL std::ostream G4cout
static G4String idName
Definition: CCalG4Ecal.hh:51
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void CCalG4Ecal::setType ( CMType  ty)
inline

Definition at line 48 of file CCalG4Ecal.hh.

48 {type = ty;}

Here is the caller graph for this function:

Member Data Documentation

G4String CCalG4Ecal::idName = "CrystalMatrix"
static

Definition at line 51 of file CCalG4Ecal.hh.


The documentation for this class was generated from the following files: