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 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 &  s,
const DDLogicalPart part 
)
private

Definition at line 38 of file DDG4SensitiveConverter.cc.

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

Referenced by upDate().

39  {
40  std::vector<std::string> temp;
41  DDValue val(s);
42  std::vector<const DDsvalues_type *> result = part->specifics();
43  std::vector<const DDsvalues_type *>::iterator it = result.begin();
44  bool foundIt = false;
45  for (; it != result.end(); ++it) {
46  foundIt = DDfetch(*it,val);
47  if (foundIt) break;
48  }
49  if (foundIt) {
50  temp = val.strings();
51  if (temp.size() != 1) {
52  edm::LogError("SimG4CoreGeometry") << "DDG4SensitiveConverter - ERROR: I need 1 " << s << " tags" ;
53  throw cms::Exception("SimG4CoreGeometry", " DDG4SensitiveConverter::getString Problem with Region tags - one and only one allowed: " + s);
54  }
55  return temp[0];
56  }
57  return "NotFound";
58 }
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 15 of file DDG4SensitiveConverter.cc.

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

Referenced by DDG4Builder::BuildGeometry().

15  {
16 
17  LogDebug("SimG4CoreGeometry") <<" DDG4SensitiveConverter::upDate() starts" ;
19 
20  for (unsigned int i=0; i<ddg4s.size(); i++) {
21  DDG4Dispatchable * ddg4 = ddg4s[i];
22  const DDLogicalPart * part = (ddg4->getDDLogicalPart());
23  G4LogicalVolume * result = (ddg4->getG4LogicalVolume());
24 
25  std::string sClassName = getString("SensitiveDetector",part);
26  std::string sROUName = getString("ReadOutName",part);
27  std::string fff = result->GetName();
28  if (sClassName != "NotFound") {
29  LogDebug("SimG4CoreGeometry") << " DDG4SensitiveConverter: Sensitive " << fff
30  << " Class Name " << sClassName << " ROU Name " << sROUName ;
31  fff = result->GetName();
32  catalog.insert(sClassName,sROUName,fff);
33  }
34  }
35  return catalog;
36 }
#define LogDebug(id)
const DDLogicalPart * getDDLogicalPart() const
void insert(const std::string &, const std::string &, const std::string &)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
std::string getString(const std::string &, const DDLogicalPart *)
G4LogicalVolume * getG4LogicalVolume() const
part
Definition: HCALResponse.h:20