test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 14 of file DDG4SensitiveConverter.cc.

14 {}
DDG4SensitiveConverter::~DDG4SensitiveConverter ( )
virtual

Definition at line 16 of file DDG4SensitiveConverter.cc.

16 {}

Member Function Documentation

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

Definition at line 41 of file DDG4SensitiveConverter.cc.

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

Referenced by upDate().

42  {
43  std::vector<std::string> temp;
44  DDValue val(s);
45  std::vector<const DDsvalues_type *> result = part->specifics();
46  std::vector<const DDsvalues_type *>::iterator it = result.begin();
47  bool foundIt = false;
48  for (; it != result.end(); ++it) {
49  foundIt = DDfetch(*it,val);
50  if (foundIt) break;
51  }
52  if (foundIt) {
53  temp = val.strings();
54  if (temp.size() != 1) {
55  edm::LogError("SimG4CoreGeometry") << "DDG4SensitiveConverter - ERROR: I need 1 " << s << " tags" ;
56  throw SimG4Exception("DDG4SensitiveConverter: Problem with Region tags: one and only one is allowed");
57  }
58  return temp[0];
59  }
60  return "NotFound";
61 }
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:80
std::vector< const DDsvalues_type * > specifics(void) const
returns the specific-data attached to the LogicalPart only (not to a DDExpandedNode) ...
tuple result
Definition: mps_fire.py:83
SensitiveDetectorCatalog DDG4SensitiveConverter::upDate ( const DDG4DispContainer ddg4s)

Definition at line 18 of file DDG4SensitiveConverter.cc.

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

Referenced by DDG4Builder::BuildGeometry().

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