Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions
CCalG4Ecal Class Reference

#include <CCalG4Ecal.hh>

Inheritance diagram for CCalG4Ecal:
CCalEcal CCalG4Able CCalDetector

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
 
CCalDetectorTable theDetectorsInside
 
int constructFlag
 
- Protected Attributes inherited from CCalG4Able
G4VPhysicalVolumedetPhysicalVolume
 
CCalG4AbleTable theG4DetectorsInside
 
G4String g4ableName
 
G4bool sensitivity
 
CCalVisualisable visProperties
 
G4VisAttributesg4VisAtt [CCalVisualisable::TotalVisTypes]
 
- Static Protected Attributes inherited from CCalDetector
static G4String pathName = getenv("CCAL_GEOMPATH")
 

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.

References CCalRotationMatrixFactory::AddMatrix(), python.hepunit::deg, CCalRotationMatrixFactory::findMatrix(), G4cout, G4endl, CCalRotationMatrixFactory::getInstance(), G4VPhysicalVolume::GetLogicalVolume(), G4VPhysicalVolume::GetName(), G4LogicalVolume::GetName(), CCalEcal::getPhiX(), CCalEcal::getPhiY(), CCalEcal::getPhiZ(), CCalEcal::getThetaX(), CCalEcal::getThetaY(), CCalEcal::getThetaZ(), CCalEcal::getXpos(), CCalEcal::getYpos(), CCalEcal::getZpos(), idName, python.hepunit::mm, module2, tab(), test::x, and z.

74  {
75  G4cout << "==>> Constructing CCalG4Ecal..." << G4endl;
76 
77  ///////////////////////////////////////////////////////////////
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 }
double getPhiX() const
Definition: CCalEcal.hh:50
double getXpos() const
Definition: CCalEcal.hh:46
G4String GetName() const
CLHEP::Hep3Vector G4ThreeVector
G4double z
Definition: TRTMaterials.hh:39
double getPhiY() const
Definition: CCalEcal.hh:52
double getZpos() const
Definition: CCalEcal.hh:48
const XML_Char * name
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 &)
#define G4endl
Definition: G4ios.hh:61
double getThetaZ() const
Definition: CCalEcal.hh:53
double G4double
Definition: G4Types.hh:76
void CCalG4Ecal::constructSensitive ( )
protectedvirtual

Reimplemented from CCalG4Able.

Definition at line 276 of file CCalG4Ecal.cc.

References G4cout, G4endl, CCalSensitiveDetectors::getInstance(), idName, and CCalSensitiveDetectors::registerVolume().

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
void CCalG4Ecal::setType ( CMType  ty)
inline

Definition at line 48 of file CCalG4Ecal.hh.

Referenced by CCalG4Hall::constructDaughters().

48 {type = ty;}

Field Documentation

G4String CCalG4Ecal::idName = "CrystalMatrix"
static

Definition at line 51 of file CCalG4Ecal.hh.

Referenced by constructIn(), and constructSensitive().


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