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 | Private Attributes
MuonG4Numbering Class Reference

#include <MuonG4Numbering.h>

Public Member Functions

 MuonG4Numbering (const DDCompactView &cpv)
 
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 ( const DDCompactView cpv)

Definition at line 14 of file MuonG4Numbering.cc.

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

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

Definition at line 29 of file MuonG4Numbering.h.

29 {};

Member Function Documentation

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

Definition at line 93 of file MuonG4Numbering.cc.

References theLevelPart.

Referenced by PhysicalVolumeToBaseNumber().

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

Definition at line 89 of file MuonG4Numbering.cc.

References theSuperPart.

Referenced by PhysicalVolumeToBaseNumber().

89  {
90  return copyno%theSuperPart;
91 }
const int MuonG4Numbering::getCopyNoLevel ( const int  copyno)
private

Definition at line 81 of file MuonG4Numbering.cc.

References theLevelPart.

Referenced by PhysicalVolumeToBaseNumber().

81  {
82  return copyno/theLevelPart;
83 }
const int MuonG4Numbering::getCopyNoSuperNo ( const int  copyno)
private

Definition at line 85 of file MuonG4Numbering.cc.

References theLevelPart, and theSuperPart.

Referenced by PhysicalVolumeToBaseNumber().

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

Definition at line 50 of file MuonG4Numbering.cc.

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

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

51 {
52 
54  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
55 
56  for( int ii = 0; ii < touch->GetHistoryDepth(); ii++ ){
57  G4VPhysicalVolume* vol = touch->GetVolume(ii);
58  int copyno=vol->GetCopyNo();
59 #ifdef LOCAL_DEBUG
60  std::cout << "MuonG4Numbering: " << vol->GetName()<<" "<<copyno<<std::endl;
61  std::cout << "Split " << copyNoRelevant(copyno);
62 #endif
63  if (copyNoRelevant(copyno)) {
64  num.addBase(getCopyNoLevel(copyno),
65  getCopyNoSuperNo(copyno),
67 #ifdef LOCAL_DEBUG
68  std::cout << " NoLevel " << getCopyNoLevel(copyno) << " Super "
69  << getCopyNoSuperNo(copyno) << " Base "
70  << getCopyNoBaseNo(copyno) << " Start " << theStartCopyNo;
71 #endif
72  }
73 #ifdef LOCAL_DEBUG
74  std::cout << std::endl;
75 #endif
76  }
77 
78  return num;
79 }
const int getCopyNoLevel(const int)
void addBase(const int level, const int super, const int base)
const int getCopyNoBaseNo(const int)
int ii
Definition: cuy.py:588
const bool copyNoRelevant(const int)
tuple cout
Definition: gather_cfg.py:145
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

Definition at line 41 of file MuonG4Numbering.h.

Referenced by getCopyNoBaseNo(), getCopyNoSuperNo(), and MuonG4Numbering().