#include <SimG4CMS/Muon/interface/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 |
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)
Modification:
Definition at line 25 of file MuonG4Numbering.h.
MuonG4Numbering::MuonG4Numbering | ( | const DDCompactView & | cpv | ) |
Definition at line 12 of file MuonG4Numbering.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), MuonDDDConstants::getValue(), LogDebug, theBasePart, theLevelPart, theStartCopyNo, and theSuperPart.
00012 { 00013 MuonDDDConstants muonConstants(cpv); 00014 theLevelPart=muonConstants.getValue("level"); 00015 theSuperPart=muonConstants.getValue("super"); 00016 theBasePart=muonConstants.getValue("base"); 00017 theStartCopyNo=muonConstants.getValue("xml_starts_with_copyno"); 00018 00019 // some consistency checks 00020 00021 if (theBasePart!=1) { 00022 std::cout << "MuonDDDNumbering finds unusual base constant:" 00023 <<theBasePart<<std::endl; 00024 } 00025 if (theSuperPart<100) { 00026 std::cout << "MuonDDDNumbering finds unusual super constant:" 00027 <<theSuperPart<<std::endl; 00028 } 00029 if (theLevelPart<10*theSuperPart) { 00030 std::cout << "MuonDDDNumbering finds unusual level constant:" 00031 <<theLevelPart<<std::endl; 00032 } 00033 if ((theStartCopyNo!=0)&&(theStartCopyNo!=1)) { 00034 std::cout << "MuonDDDNumbering finds unusual start value for copy numbers:" 00035 <<theStartCopyNo<<std::endl; 00036 } 00037 00038 LogDebug("MuonSimDebug") << "MuonG4Numbering configured with"<<std::endl; 00039 LogDebug("MuonSimDebug") << "Level = "<<theLevelPart<<" "; 00040 LogDebug("MuonSimDebug") << "Super = "<<theSuperPart<<" "; 00041 LogDebug("MuonSimDebug") << "Base = "<<theBasePart<<" "; 00042 LogDebug("MuonSimDebug") << "StartCopyNo = "<<theStartCopyNo<<std::endl; 00043 00044 }
MuonG4Numbering::~MuonG4Numbering | ( | ) | [inline] |
const bool MuonG4Numbering::copyNoRelevant | ( | const | int | ) | [private] |
Definition at line 78 of file MuonG4Numbering.cc.
References theLevelPart.
Referenced by PhysicalVolumeToBaseNumber().
00078 { 00079 return (copyno/theLevelPart)>0; 00080 }
const int MuonG4Numbering::getCopyNoBaseNo | ( | const | int | ) | [private] |
Definition at line 74 of file MuonG4Numbering.cc.
References theSuperPart.
Referenced by PhysicalVolumeToBaseNumber().
00074 { 00075 return copyno%theSuperPart; 00076 }
const int MuonG4Numbering::getCopyNoLevel | ( | const | int | ) | [private] |
Definition at line 66 of file MuonG4Numbering.cc.
References theLevelPart.
Referenced by PhysicalVolumeToBaseNumber().
00066 { 00067 return copyno/theLevelPart; 00068 }
const int MuonG4Numbering::getCopyNoSuperNo | ( | const | int | ) | [private] |
Definition at line 70 of file MuonG4Numbering.cc.
References theLevelPart, and theSuperPart.
Referenced by PhysicalVolumeToBaseNumber().
00070 { 00071 return (copyno%theLevelPart)/theSuperPart; 00072 }
MuonBaseNumber MuonG4Numbering::PhysicalVolumeToBaseNumber | ( | const G4Step * | aStep | ) |
Definition at line 46 of file MuonG4Numbering.cc.
References MuonBaseNumber::addBase(), copyNoRelevant(), lat::endl(), getCopyNoBaseNo(), getCopyNoLevel(), getCopyNoSuperNo(), LogDebug, funct::num(), and theStartCopyNo.
Referenced by MuonSensitiveDetector::setDetUnitId(), and MuonRpcFrameRotation::transformPoint().
00047 { 00048 00049 MuonBaseNumber num; 00050 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable(); 00051 00052 for( int ii = 0; ii < touch->GetHistoryDepth(); ii++ ){ 00053 G4VPhysicalVolume* vol = touch->GetVolume(ii); 00054 int copyno=vol->GetCopyNo(); 00055 LogDebug("MuonSimDebug") << "MuonG4Numbering: " << vol->GetName()<<" "<<copyno<<std::endl; 00056 if (copyNoRelevant(copyno)) { 00057 num.addBase(getCopyNoLevel(copyno), 00058 getCopyNoSuperNo(copyno), 00059 getCopyNoBaseNo(copyno)-theStartCopyNo); 00060 } 00061 } 00062 00063 return num; 00064 }
int MuonG4Numbering::theBasePart [private] |
int MuonG4Numbering::theLevelPart [private] |
Definition at line 40 of file MuonG4Numbering.h.
Referenced by copyNoRelevant(), getCopyNoLevel(), getCopyNoSuperNo(), and MuonG4Numbering().
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().