#include "TGeoManager.h"
#include "AOpticalComponent.h"
ClassImp(AOpticalComponent);
AOpticalComponent::AOpticalComponent()
: TGeoVolume(), fBorderSurfaceConditionArray(0) {}
AOpticalComponent::AOpticalComponent(const char* name, const TGeoShape* shape,
const TGeoMedium* med)
: TGeoVolume(name, shape, med), fBorderSurfaceConditionArray(0) {
#if ROOT_VERSION(5, 34, 16) <= ROOT_VERSION_CODE
if (GetMedium() == TGeoVolume::DummyMedium()) {
SetMedium(GetOpaqueVacuumMedium());
}
#endif
}
AOpticalComponent::~AOpticalComponent() {
SafeDelete(fBorderSurfaceConditionArray);
}
void AOpticalComponent::AddBorderSurfaceCondition(
ABorderSurfaceCondition* condition) {
if (!fBorderSurfaceConditionArray) {
fBorderSurfaceConditionArray = new TObjArray;
fBorderSurfaceConditionArray->SetOwner(kTRUE);
}
fBorderSurfaceConditionArray->Add(condition);
}
ABorderSurfaceCondition* AOpticalComponent::FindBorderSurfaceCondition(
AOpticalComponent* component2) {
if (!fBorderSurfaceConditionArray) {
return 0;
}
for (Int_t i = 0; i < fBorderSurfaceConditionArray->GetEntries(); i++) {
if (((ABorderSurfaceCondition*)(*fBorderSurfaceConditionArray)[i])
->GetComponent2() == component2) {
return (ABorderSurfaceCondition*)(*fBorderSurfaceConditionArray)[i];
}
}
return 0;
}
TGeoMaterial* AOpticalComponent::GetOpaqueVacuumMaterial() const {
if (!fGeoManager) {
return 0;
}
TGeoMaterial* mat = fGeoManager->GetMaterial("ROBAST_OpaqueVacuumMaterial");
if (!mat) {
mat = new TGeoMaterial("ROBAST_OpaqueVacuumMaterial", 0, 0, 0);
}
return mat;
}
TGeoMaterial* AOpticalComponent::GetTransparentVacuumMaterial() const {
if (!fGeoManager) {
return 0;
}
TGeoMaterial* mat =
fGeoManager->GetMaterial("ROBAST_TransparentVacuumMaterial");
if (!mat) {
mat = new TGeoMaterial("ROBAST_TransparentVacuumMaterial", 0, 0, 0);
mat->SetTransparency(70);
}
return mat;
}
TGeoMedium* AOpticalComponent::GetOpaqueVacuumMedium() const {
if (!fGeoManager) {
return 0;
}
TGeoMedium* med = fGeoManager->GetMedium("ROBAST_OpaqueVacuumMedium");
if (!med) {
TGeoMaterial* mat = GetOpaqueVacuumMaterial();
med = new TGeoMedium("ROBAST_OpaqueVacuumMedium", 1, mat);
}
return med;
}
TGeoMedium* AOpticalComponent::GetTransparentVacuumMedium() const {
if (!fGeoManager) {
return 0;
}
TGeoMedium* med = fGeoManager->GetMedium("ROBAST_TransparentVacuumMedium");
if (!med) {
TGeoMaterial* mat = GetTransparentVacuumMaterial();
med = new TGeoMedium("ROBAST_TransparentVacuumMedium", 1, mat);
}
return med;
}
AOpticalComponent.cxx:100 AOpticalComponent.cxx:101 AOpticalComponent.cxx:102 AOpticalComponent.cxx:103 AOpticalComponent.cxx:104 AOpticalComponent.cxx:105 AOpticalComponent.cxx:106 AOpticalComponent.cxx:107 AOpticalComponent.cxx:108 AOpticalComponent.cxx:109 AOpticalComponent.cxx:110 AOpticalComponent.cxx:111 AOpticalComponent.cxx:112 AOpticalComponent.cxx:113 AOpticalComponent.cxx:114 AOpticalComponent.cxx:115 AOpticalComponent.cxx:116 AOpticalComponent.cxx:117 AOpticalComponent.cxx:118 AOpticalComponent.cxx:119 AOpticalComponent.cxx:120 AOpticalComponent.cxx:121 AOpticalComponent.cxx:122 AOpticalComponent.cxx:123 AOpticalComponent.cxx:124 AOpticalComponent.cxx:125