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 DDCompactView &cpv)
 
 MuonG4Numbering (const MuonDDDConstants &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 26 of file MuonG4Numbering.h.

Constructor & Destructor Documentation

MuonG4Numbering::MuonG4Numbering ( const DDCompactView cpv)

Definition at line 14 of file MuonG4Numbering.cc.

MuonG4Numbering(const DDCompactView &cpv)
MuonG4Numbering::MuonG4Numbering ( const MuonDDDConstants muonConstants)

Definition at line 16 of file MuonG4Numbering.cc.

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

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

Member Function Documentation

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

Definition at line 79 of file MuonG4Numbering.cc.

References theLevelPart.

Referenced by PhysicalVolumeToBaseNumber(), and ~MuonG4Numbering().

79 { return (copyno / theLevelPart) > 0; }
const int MuonG4Numbering::getCopyNoBaseNo ( const int  copyno)
private

Definition at line 77 of file MuonG4Numbering.cc.

References theSuperPart.

Referenced by PhysicalVolumeToBaseNumber(), and ~MuonG4Numbering().

77 { return copyno % theSuperPart; }
const int MuonG4Numbering::getCopyNoLevel ( const int  copyno)
private

Definition at line 73 of file MuonG4Numbering.cc.

References theLevelPart.

Referenced by PhysicalVolumeToBaseNumber(), and ~MuonG4Numbering().

73 { return copyno / theLevelPart; }
const int MuonG4Numbering::getCopyNoSuperNo ( const int  copyno)
private

Definition at line 75 of file MuonG4Numbering.cc.

References theLevelPart, and theSuperPart.

Referenced by PhysicalVolumeToBaseNumber(), and ~MuonG4Numbering().

75 { return (copyno % theLevelPart) / theSuperPart; }
MuonBaseNumber MuonG4Numbering::PhysicalVolumeToBaseNumber ( const G4Step *  aStep)

Definition at line 47 of file MuonG4Numbering.cc.

References MuonBaseNumber::addBase(), copyNoRelevant(), gather_cfg::cout, getCopyNoBaseNo(), getCopyNoLevel(), getCopyNoSuperNo(), cuy::ii, pileupDistInMC::num, theLevelPart, theStartCopyNo, and theSuperPart.

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

47  {
49  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
50 
51  for (int ii = 0; ii < touch->GetHistoryDepth(); ii++) {
52  G4VPhysicalVolume* vol = touch->GetVolume(ii);
53  int copyno = vol->GetCopyNo();
54 #ifdef LOCAL_DEBUG
55  std::cout << "MuonG4Numbering: " << vol->GetName() << " " << copyno << std::endl
56  << "Split " << copyNoRelevant(copyno) << ":" << theLevelPart << ":" << theSuperPart << " ";
57 #endif
58  if (copyNoRelevant(copyno)) {
59  num.addBase(getCopyNoLevel(copyno), getCopyNoSuperNo(copyno), getCopyNoBaseNo(copyno) - theStartCopyNo);
60 #ifdef LOCAL_DEBUG
61  std::cout << " NoLevel " << getCopyNoLevel(copyno) << " Super " << getCopyNoSuperNo(copyno) << " Base "
62  << getCopyNoBaseNo(copyno) << " Start " << theStartCopyNo;
63 #endif
64  }
65 #ifdef LOCAL_DEBUG
66  std::cout << std::endl;
67 #endif
68  }
69 
70  return num;
71 }
const int getCopyNoLevel(const int)
void addBase(const int level, const int super, const int base)
const int getCopyNoBaseNo(const int)
ii
Definition: cuy.py:590
const bool copyNoRelevant(const int)
const int getCopyNoSuperNo(const int)

Member Data Documentation

int MuonG4Numbering::theBasePart
private

Definition at line 42 of file MuonG4Numbering.h.

Referenced by MuonG4Numbering().

int MuonG4Numbering::theLevelPart
private
int MuonG4Numbering::theStartCopyNo
private

Definition at line 43 of file MuonG4Numbering.h.

Referenced by MuonG4Numbering(), and PhysicalVolumeToBaseNumber().

int MuonG4Numbering::theSuperPart
private