CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
DDG4SensitiveConverter Class Reference

#include <DDG4SensitiveConverter.h>

Public Member Functions

 DDG4SensitiveConverter ()
 
SensitiveDetectorCatalog upDate (const DDG4DispContainer &ddg4s)
 
virtual ~DDG4SensitiveConverter ()
 

Private Member Functions

std::string getString (const std::string &, const DDLogicalPart *)
 

Detailed Description

Definition at line 12 of file DDG4SensitiveConverter.h.

Constructor & Destructor Documentation

DDG4SensitiveConverter::DDG4SensitiveConverter ( )

Definition at line 8 of file DDG4SensitiveConverter.cc.

8 {}
DDG4SensitiveConverter::~DDG4SensitiveConverter ( )
virtual

Definition at line 10 of file DDG4SensitiveConverter.cc.

10 {}

Member Function Documentation

std::string DDG4SensitiveConverter::getString ( const std::string &  ss,
const DDLogicalPart part 
)
private

Definition at line 33 of file DDG4SensitiveConverter.cc.

References DDfetch(), Exception, mps_fire::result, DDLogicalPart::specifics(), DDValue::strings(), groupFilesInBlocks::temp, and heppy_batch::val.

Referenced by upDate().

33  {
34  std::vector<std::string> temp;
35  DDValue val(ss);
36  std::vector<const DDsvalues_type *> result = part->specifics();
37  bool foundIt = false;
38  for (auto stype : result) {
39  foundIt = DDfetch(stype, val);
40  if (foundIt)
41  break;
42  }
43  if (foundIt) {
44  temp = val.strings();
45  if (temp.size() != 1) {
46  edm::LogError("SimG4CoreGeometry") << "DDG4SensitiveConverter - ERROR: I need 1 " << ss << " tags";
47  throw cms::Exception("SimG4CoreGeometry",
48  " DDG4SensitiveConverter::getString Problem with "
49  "Region tags - one and only one allowed: " +
50  ss);
51  }
52  return temp[0];
53  }
54  return "NotFound";
55 }
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:81
std::vector< const DDsvalues_type * > specifics(void) const
returns the specific-data attached to the LogicalPart only (not to a DDExpandedNode) ...
SensitiveDetectorCatalog DDG4SensitiveConverter::upDate ( const DDG4DispContainer ddg4s)

Definition at line 12 of file DDG4SensitiveConverter.cc.

References getEcalConditions_orcoffint2r_cff::catalog, getString(), SensitiveDetectorCatalog::insert(), LogDebug, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DDG4Builder::BuildGeometry().

12  {
13  LogDebug("SimG4CoreGeometry") << " DDG4SensitiveConverter::upDate() starts";
15 
16  for (auto ddg4 : ddg4s) {
17  const DDLogicalPart *part = (ddg4->getDDLogicalPart());
18  G4LogicalVolume *result = (ddg4->getG4LogicalVolume());
19 
20  std::string sClassName = getString("SensitiveDetector", part);
21  std::string sROUName = getString("ReadOutName", part);
22  std::string fff = result->GetName();
23  if (sClassName != "NotFound") {
24  LogDebug("SimG4CoreGeometry") << " DDG4SensitiveConverter: Sensitive " << fff << " Class Name " << sClassName
25  << " ROU Name " << sROUName;
26  fff = result->GetName();
27  catalog.insert(sClassName, sROUName, fff);
28  }
29  }
30  return catalog;
31 }
#define LogDebug(id)
void insert(const std::string &, const std::string &, const std::string &)
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