CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MuonG4Numbering Class Reference

#include <MuonG4Numbering.h>

Public Member Functions

 MuonG4Numbering (const MuonGeometryConstants &muonConstants)
 
MuonBaseNumber PhysicalVolumeToBaseNumber (const G4Step *aStep)
 
 ~MuonG4Numbering ()
 

Private Member Functions

const bool copyNoRelevant (const int)
 
const int getCopyNoBaseNo (const int)
 
const int getCopyNoLevel (const int)
 
const int getCopyNoSuperNo (const int)
 

Private Attributes

int theBasePart
 
int theLevelPart
 
int theStartCopyNo
 
int theSuperPart
 

Detailed Description

class to handle the conversion to MuonBaseNumber from tree of G4 copy numbers extracted from G4VPhysicalVolume; needs DDD compatible format of G4 copy numbers; the format itself may in a later version also be defined by DDD constants

in the xml muon constant section one has to define level, super and base constants (eg. 1000,100,1) and the start value of the copy numbers (0 or 1)

Author
Arno Straessner, CERN arno..nosp@m.stra.nosp@m.essne.nosp@m.r@ce.nosp@m.rn.ch

Modification:

Definition at line 25 of file MuonG4Numbering.h.

Constructor & Destructor Documentation

◆ MuonG4Numbering()

MuonG4Numbering::MuonG4Numbering ( const MuonGeometryConstants muonConstants)

Definition at line 14 of file MuonG4Numbering.cc.

14  {
15  theLevelPart = muonConstants.getValue("level");
16  theSuperPart = muonConstants.getValue("super");
17  theBasePart = muonConstants.getValue("base");
18  theStartCopyNo = muonConstants.getValue("xml_starts_with_copyno");
19 
20  // some consistency checks
21 
22  if (theBasePart != 1) {
23  edm::LogVerbatim("MuonSim") << "MuonGeometryNumbering finds unusual base constant:" << theBasePart;
24  }
25  if (theSuperPart < 100) {
26  edm::LogVerbatim("MuonSim") << "MuonGeometryNumbering finds unusual super constant:" << theSuperPart;
27  }
28  if (theLevelPart < 10 * theSuperPart) {
29  edm::LogVerbatim("MuonSim") << "MuonGeometryNumbering finds unusual level constant:" << theLevelPart;
30  }
31  if ((theStartCopyNo != 0) && (theStartCopyNo != 1)) {
32  std::cout << "MuonGeometryNumbering finds unusual start value for copy numbers:" << theStartCopyNo << std::endl;
33  }
34 
35 #ifdef EDM_ML_DEBUG
36  edm::LogVerbatim("MuonSim") << "StartCopyNo = " << theStartCopyNo;
37  edm::LogVerbatim("MuonSim") << "MuonG4Numbering configured with"
38  << "Level = " << theLevelPart << " Super = " << theSuperPart << " Base = " << theBasePart
39  << " StartCopyNo = " << theStartCopyNo;
40 #endif
41 }

References gather_cfg::cout, MuonGeometryConstants::getValue(), theBasePart, theLevelPart, theStartCopyNo, and theSuperPart.

◆ ~MuonG4Numbering()

MuonG4Numbering::~MuonG4Numbering ( )
inline

Definition at line 28 of file MuonG4Numbering.h.

28 {};

Member Function Documentation

◆ copyNoRelevant()

const bool MuonG4Numbering::copyNoRelevant ( const int  copyno)
private

Definition at line 73 of file MuonG4Numbering.cc.

73 { return (copyno / theLevelPart) > 0; }

References theLevelPart.

Referenced by PhysicalVolumeToBaseNumber().

◆ getCopyNoBaseNo()

const int MuonG4Numbering::getCopyNoBaseNo ( const int  copyno)
private

Definition at line 71 of file MuonG4Numbering.cc.

71 { return copyno % theSuperPart; }

References theSuperPart.

Referenced by PhysicalVolumeToBaseNumber().

◆ getCopyNoLevel()

const int MuonG4Numbering::getCopyNoLevel ( const int  copyno)
private

Definition at line 67 of file MuonG4Numbering.cc.

67 { return copyno / theLevelPart; }

References theLevelPart.

Referenced by PhysicalVolumeToBaseNumber().

◆ getCopyNoSuperNo()

const int MuonG4Numbering::getCopyNoSuperNo ( const int  copyno)
private

Definition at line 69 of file MuonG4Numbering.cc.

69 { return (copyno % theLevelPart) / theSuperPart; }

References theLevelPart, and theSuperPart.

Referenced by PhysicalVolumeToBaseNumber().

◆ PhysicalVolumeToBaseNumber()

MuonBaseNumber MuonG4Numbering::PhysicalVolumeToBaseNumber ( const G4Step *  aStep)

Definition at line 43 of file MuonG4Numbering.cc.

43  {
45  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
46 
47  for (int ii = 0; ii < touch->GetHistoryDepth(); ii++) {
48  G4VPhysicalVolume* vol = touch->GetVolume(ii);
49  int copyno = vol->GetCopyNo();
50 #ifdef EDM_ML_DEBUG
51  edm::LogVerbatim("MuonSim") << "MuonG4Numbering: " << vol->GetName() << " " << copyno << std::endl
52  << "Split " << copyNoRelevant(copyno) << ":" << theLevelPart << ":" << theSuperPart
53  << " ";
54 #endif
55  if (copyNoRelevant(copyno)) {
56  num.addBase(getCopyNoLevel(copyno), getCopyNoSuperNo(copyno), getCopyNoBaseNo(copyno) - theStartCopyNo);
57 #ifdef EDM_ML_DEBUG
58  edm::LogVerbatim("MuonSim") << " NoLevel " << getCopyNoLevel(copyno) << " Super " << getCopyNoSuperNo(copyno)
59  << " Base " << getCopyNoBaseNo(copyno) << " Start " << theStartCopyNo;
60 #endif
61  }
62  }
63 
64  return num;
65 }

References copyNoRelevant(), getCopyNoBaseNo(), getCopyNoLevel(), getCopyNoSuperNo(), cuy::ii, EgammaValidation_cff::num, theLevelPart, theStartCopyNo, and theSuperPart.

Referenced by MuonSensitiveDetector::setDetUnitId(), and MuonRPCFrameRotation::transformPoint().

Member Data Documentation

◆ theBasePart

int MuonG4Numbering::theBasePart
private

Definition at line 40 of file MuonG4Numbering.h.

Referenced by MuonG4Numbering().

◆ theLevelPart

int MuonG4Numbering::theLevelPart
private

◆ theStartCopyNo

int MuonG4Numbering::theStartCopyNo
private

Definition at line 41 of file MuonG4Numbering.h.

Referenced by MuonG4Numbering(), and PhysicalVolumeToBaseNumber().

◆ theSuperPart

int MuonG4Numbering::theSuperPart
private
MuonG4Numbering::theSuperPart
int theSuperPart
Definition: MuonG4Numbering.h:39
MuonG4Numbering::getCopyNoBaseNo
const int getCopyNoBaseNo(const int)
Definition: MuonG4Numbering.cc:71
gather_cfg.cout
cout
Definition: gather_cfg.py:144
MuonG4Numbering::getCopyNoLevel
const int getCopyNoLevel(const int)
Definition: MuonG4Numbering.cc:67
MuonG4Numbering::theStartCopyNo
int theStartCopyNo
Definition: MuonG4Numbering.h:41
MuonG4Numbering::theBasePart
int theBasePart
Definition: MuonG4Numbering.h:40
MuonG4Numbering::theLevelPart
int theLevelPart
Definition: MuonG4Numbering.h:38
edm::LogVerbatim
Definition: MessageLogger.h:297
MuonGeometryConstants::getValue
int getValue(const std::string &name) const
Definition: MuonGeometryConstants.cc:8
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
MuonBaseNumber
Definition: MuonBaseNumber.h:21
MuonG4Numbering::copyNoRelevant
const bool copyNoRelevant(const int)
Definition: MuonG4Numbering.cc:73
MuonG4Numbering::getCopyNoSuperNo
const int getCopyNoSuperNo(const int)
Definition: MuonG4Numbering.cc:69
cuy.ii
ii
Definition: cuy.py:590