CMS 3D CMS Logo

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

#include <DDG4SensitiveConverter.h>

Public Member Functions

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

Private Member Functions

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

Detailed Description

Definition at line 13 of file DDG4SensitiveConverter.h.

Constructor & Destructor Documentation

DDG4SensitiveConverter::DDG4SensitiveConverter ( )

Definition at line 11 of file DDG4SensitiveConverter.cc.

11 {}
DDG4SensitiveConverter::~DDG4SensitiveConverter ( )
virtual

Definition at line 13 of file DDG4SensitiveConverter.cc.

13 {}

Member Function Documentation

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

Definition at line 34 of file DDG4SensitiveConverter.cc.

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

Referenced by upDate().

34  {
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 }
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
std::vector< const DDsvalues_type * > specifics(void) const
returns the specific-data attached to the LogicalPart only (not to a DDExpandedNode) ...
void DDG4SensitiveConverter::upDate ( const DDG4DispContainer ddg4s,
SensitiveDetectorCatalog catalog 
)

Definition at line 15 of file DDG4SensitiveConverter.cc.

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

Referenced by DDG4Builder::BuildGeometry().

15  {
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 }
#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