CMS 3D CMS Logo

DDG4SensitiveConverter.cc
Go to the documentation of this file.
3 
5 
8 
9 #include "G4LogicalVolume.hh"
10 
12 
14 
16  LogDebug("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  LogDebug("SimG4CoreGeometry") << " DDG4SensitiveConverter: Sensitive " << fff << " Class Name " << sClassName
27  << " 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 }
#define LogDebug(id)
std::vector< DDG4Dispatchable * > DDG4DispContainer
void upDate(const DDG4DispContainer &ddg4s, SensitiveDetectorCatalog &)
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
void insert(const std::string &, const std::string &, const std::string &)
std::vector< const DDsvalues_type * > specifics(void) const
returns the specific-data attached to the LogicalPart only (not to a DDExpandedNode) ...
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
std::string getString(const std::string &, const DDLogicalPart *)
const std::vector< std::string > & strings() const
a reference to the std::string-valued values stored in the given instance of DDValue ...
Definition: DDValue.h:60
part
Definition: HCALResponse.h:20