49 G4VPhysicalVolume* ParallelWorld = GetWorld();
52 std::vector<G4LogicalVolume*> OpDetVolumes;
53 std::vector<G4Transform3D> OpDetTransformations;
56 G4VPhysicalVolume* WorldPhysical = g4b::DetectorConstruction::GetWorld();
59 std::vector<G4Transform3D> EmptyVector;
71 OpDetSensitiveDetector* TheSD =
74 if (OpDetVolumes.size() > 0) {
77 for (
unsigned int i = 0; i != OpDetVolumes.size(); i++) {
78 std::stringstream VolumeName;
80 VolumeName.str(
"OpDetVolume_");
83 G4Transform3D TheTransform = OpDetTransformations.at(i);
85 G4VSolid* TheSolid = OpDetVolumes.at(i)->GetSolid();
86 G4Material* TheMaterial = OpDetVolumes.at(i)->GetMaterial();
87 G4LogicalVolume* TheLogVolume =
88 new G4LogicalVolume(TheSolid, TheMaterial, VolumeName.str().c_str());
90 TheLogVolume->SetSensitiveDetector(TheSD);
92 G4PVPlacement* ThePlacement =
new G4PVPlacement(
93 TheTransform, VolumeName.str().c_str(), TheLogVolume, ParallelWorld,
false, 0);
97 TheOpDetLookup->AddPhysicalVolume(ThePlacement);
103 std::vector<G4LogicalVolume*> OpParamVolumesFound;
104 std::vector<G4Transform3D> OpParamTransformationsFound;
114 if ((OpParamModels.size() != OpParamVolumes.size()) ||
115 (OpParamModels.size() != OpParamOrientations.size()) ||
116 (OpParamModels.size() != OpParamParameters.size())) {
118 <<
"sizes of OpParam specification vectors do not match\n";
121 for (
size_t imodel = 0; imodel != OpParamVolumes.size(); ++imodel) {
124 OpParamVolumes.at(imodel),
127 OpParamTransformationsFound);
129 <<
"Found " << OpParamVolumesFound.size() <<
" volumes of name " 130 << OpParamVolumes.at(imodel) <<
" to attach optical parameterization " 131 << OpParamModels.at(imodel) <<
std::endl;
137 std::stringstream SDName(
"");
138 SDName << OpParamModels.at(imodel) <<
"_" << imodel;
140 OpParamSD* ParamSD =
new OpParamSD(SDName.str().c_str(),
141 OpParamModels.at(imodel),
142 OpParamOrientations.at(imodel),
143 OpParamParameters.at(imodel));
145 if (OpParamVolumesFound.size() > 0) {
146 for (
unsigned int ivol = 0; ivol != OpParamVolumes.size(); ivol++) {
147 std::stringstream VolumeName;
149 VolumeName.str(
"OpParamVolume_");
152 G4Transform3D TheTransform = OpParamTransformationsFound.at(ivol);
154 G4VSolid* TheSolid = OpParamVolumesFound.at(ivol)->GetSolid();
155 G4Material* TheMaterial = OpParamVolumesFound.at(ivol)->GetMaterial();
156 G4LogicalVolume* TheLogVolume =
157 new G4LogicalVolume(TheSolid, TheMaterial, VolumeName.str().c_str());
159 G4PVPlacement* ThePlacement =
new G4PVPlacement(
160 TheTransform, VolumeName.str().c_str(), TheLogVolume, ParallelWorld,
false, 0);
162 TheLogVolume->SetSensitiveDetector(ParamSD);
165 ThePlacement->GetTranslation();
void FindVolumes(G4VPhysicalVolume *, G4String, std::vector< G4Transform3D >, std::vector< G4LogicalVolume * > &, std::vector< G4Transform3D > &)
const std::vector< std::vector< std::vector< double > > > & OpticalParamParameters() const
G4String fOpDetSensitiveName
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< G4Transform3D > fOpDetTransformations
const std::vector< std::string > & OpticalParamVolumes() const
bool const fUseLitePhotons
Pass-through option for sensitive detector.
std::vector< G4LogicalVolume * > fOpDetVolumes
const std::vector< std::string > & OpticalParamModels() const
const std::vector< int > & OpticalParamOrientations() const
static OpDetLookup * Instance()
OpDetLookup * TheOpDetLookup
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)