CMS 3D CMS Logo

DDG4SensitiveConverter.cc
Go to the documentation of this file.
3 
5 
8 
9 #include "G4LogicalVolume.hh"
10 
12 
14 
16  edm::LogVerbatim("SimG4CoreGeometry") << " DDG4SensitiveConverter::upDate() starts";
17 
18  for (auto ddg4 : ddg4s) {
19  const DDLogicalPart *part = (ddg4->getDDLogicalPart());
20  G4LogicalVolume *result = (ddg4->getG4LogicalVolume());
21 
22  std::string sClassName = getString("SensitiveDetector", part);
23  std::string sROUName = getString("ReadOutName", part);
24  std::string fff = result->GetName();
25  if (sClassName != "NotFound") {
26  edm::LogVerbatim("SimG4CoreGeometry")
27  << " DDG4SensitiveConverter: Sensitive " << fff << " Class Name " << sClassName << " ROU Name " << sROUName;
28  fff = result->GetName();
29  catalog.insert(sClassName, sROUName, fff);
30  }
31  }
32 }
33 
35  std::vector<std::string> temp;
36  DDValue val(ss);
37  std::vector<const DDsvalues_type *> result = part->specifics();
38  bool foundIt = false;
39  for (auto stype : result) {
40  foundIt = DDfetch(stype, val);
41  if (foundIt)
42  break;
43  }
44  if (foundIt) {
45  temp = val.strings();
46  if (temp.size() != 1) {
47  edm::LogError("SimG4CoreGeometry") << "DDG4SensitiveConverter - ERROR: I need 1 " << ss << " tags";
48  throw cms::Exception("SimG4CoreGeometry",
49  " DDG4SensitiveConverter::getString Problem with "
50  "Region tags - one and only one allowed: " +
51  ss);
52  }
53  return temp[0];
54  }
55  return "NotFound";
56 }
Log< level::Info, true > LogVerbatim
std::vector< DDG4Dispatchable * > DDG4DispContainer
void upDate(const DDG4DispContainer &ddg4s, SensitiveDetectorCatalog &)
Log< level::Error, false > LogError
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
std::string getString(const std::string &, const DDLogicalPart *)
part
Definition: HCALResponse.h:20