CMS 3D CMS Logo

DDG4SensitiveConverter.cc
Go to the documentation of this file.
2 
5 
6 #include "G4LogicalVolume.hh"
7 
9 
11 
13 
14  LogDebug("SimG4CoreGeometry") <<" DDG4SensitiveConverter::upDate() starts" ;
16 
17  for (auto ddg4 : ddg4s) {
18  const DDLogicalPart * part = (ddg4->getDDLogicalPart());
19  G4LogicalVolume * result = (ddg4->getG4LogicalVolume());
20 
21  std::string sClassName = getString("SensitiveDetector",part);
22  std::string sROUName = getString("ReadOutName",part);
23  std::string fff = result->GetName();
24  if (sClassName != "NotFound") {
25  LogDebug("SimG4CoreGeometry") << " DDG4SensitiveConverter: Sensitive " << fff
26  << " Class Name " << sClassName << " ROU Name " << sROUName;
27  fff = result->GetName();
28  catalog.insert(sClassName,sROUName,fff);
29  }
30  }
31  return catalog;
32 }
33 
35  const DDLogicalPart * part) {
36  std::vector<std::string> temp;
37  DDValue val(ss);
38  std::vector<const DDsvalues_type *> result = part->specifics();
39  bool foundIt = false;
40  for (auto stype : result) {
41  foundIt = DDfetch(stype,val);
42  if (foundIt) 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", " DDG4SensitiveConverter::getString Problem with Region tags - one and only one allowed: " + ss);
49  }
50  return temp[0];
51  }
52  return "NotFound";
53 }
54 
#define LogDebug(id)
std::vector< DDG4Dispatchable * > DDG4DispContainer
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:81
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:61
part
Definition: HCALResponse.h:20
SensitiveDetectorCatalog upDate(const DDG4DispContainer &ddg4s)