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::DDG4SensitiveConverter ( )

Definition at line 11 of file DDG4SensitiveConverter.cc.

11 {}

◆ ~DDG4SensitiveConverter()

DDG4SensitiveConverter::~DDG4SensitiveConverter ( )
virtual

Definition at line 13 of file DDG4SensitiveConverter.cc.

13 {}

Member Function Documentation

◆ getString()

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

Definition at line 34 of file DDG4SensitiveConverter.cc.

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 }

References DDfetch(), Exception, mps_fire::result, contentValuesCheck::ss, groupFilesInBlocks::temp, and heppy_batch::val.

Referenced by upDate().

◆ upDate()

void DDG4SensitiveConverter::upDate ( const DDG4DispContainer ddg4s,
SensitiveDetectorCatalog catalog 
)

Definition at line 15 of file DDG4SensitiveConverter.cc.

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 }

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

getEcalConditions_orcoffint2r_cff.catalog
catalog
Definition: getEcalConditions_orcoffint2r_cff.py:40
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
part
part
Definition: HCALResponse.h:20
DDfetch
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
heppy_batch.val
val
Definition: heppy_batch.py:351
DDValue
Definition: DDValue.h:21
Exception
Definition: hltDiff.cc:246
mps_fire.result
result
Definition: mps_fire.py:303
DDG4SensitiveConverter::getString
std::string getString(const std::string &, const DDLogicalPart *)
Definition: DDG4SensitiveConverter.cc:34