-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from dildick/GEM-72X-II
Port SimG4CMS/Muon for GEM/ME0 from 62X SLHC to 72X
- Loading branch information
Showing
6 changed files
with
121 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#ifndef MuonMe0FrameRotation_H | ||
#define MuonMe0FrameRotation_H | ||
|
||
/** \class MuonMe0FrameRotation | ||
* | ||
* implementation of FrameRotation for the muon ME0 | ||
* | ||
* \author Arno Straessner, CERN <arno.straessner@cern.ch> | ||
* | ||
* Modification: | ||
* | ||
*/ | ||
|
||
#include "SimG4CMS/Muon/interface/MuonFrameRotation.h" | ||
#include "SimG4CMS/Muon/interface/MuonG4Numbering.h" | ||
|
||
#include "G4Step.hh" | ||
|
||
class DDCompactView; | ||
|
||
class MuonMe0FrameRotation : public MuonFrameRotation { | ||
|
||
public: | ||
MuonMe0FrameRotation( const DDCompactView& cpv ); | ||
virtual ~MuonMe0FrameRotation(); | ||
virtual Local3DPoint transformPoint(const Local3DPoint &, const G4Step *) const; | ||
|
||
private: | ||
MuonG4Numbering* g4numbering; | ||
int theSectorLevel; | ||
}; | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "SimG4CMS/Muon/interface/MuonMe0FrameRotation.h" | ||
#include "Geometry/MuonNumbering/interface/MuonDDDConstants.h" | ||
#include "Geometry/MuonNumbering/interface/MuonBaseNumber.h" | ||
|
||
#include "G4StepPoint.hh" | ||
#include "G4TouchableHistory.hh" | ||
|
||
//#define LOCAL_DEBUG | ||
|
||
MuonMe0FrameRotation::MuonMe0FrameRotation(const DDCompactView& cpv) : MuonFrameRotation::MuonFrameRotation(cpv) { | ||
g4numbering = new MuonG4Numbering(cpv); | ||
MuonDDDConstants muonConstants(cpv); | ||
int theLevelPart= muonConstants.getValue("level"); | ||
theSectorLevel = muonConstants.getValue("mg_sector")/theLevelPart; | ||
#ifdef LOCAL_DEBUG | ||
std::cout << "MuonMe0FrameRotation: theSectorLevel " << theSectorLevel | ||
<< std::endl; | ||
#endif | ||
} | ||
|
||
MuonMe0FrameRotation::~MuonMe0FrameRotation() { | ||
delete g4numbering; | ||
} | ||
|
||
Local3DPoint MuonMe0FrameRotation::transformPoint(const Local3DPoint & point,const G4Step * aStep=0) const { | ||
if (!aStep) return Local3DPoint(0.,0.,0.); | ||
|
||
//check if it is rotated | ||
#ifdef LOCAL_DEBUG | ||
std::cout << "Position " << aStep->GetPreStepPoint()->GetPosition() << std::endl; | ||
#endif | ||
MuonBaseNumber num = g4numbering->PhysicalVolumeToBaseNumber(aStep); | ||
bool rotated = (num.getBaseNo(theSectorLevel)>=50); | ||
#ifdef LOCAL_DEBUG | ||
std::cout << "MuonMe0FrameRotation num " << num.getBaseNo(theSectorLevel) | ||
<< " Rotation " << rotated << std::endl; | ||
#endif | ||
if (rotated) { | ||
// return Local3DPoint(-point.x(),point.z(),point.y()); | ||
return Local3DPoint(point.x(),point.z(),-point.y()); | ||
} else { | ||
return Local3DPoint(point.x(),point.z(),-point.y()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters