Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ext mon detector restructure #1325

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ExtinctionMonitorFNAL/Geometry/inc/ExtMonFNAL.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace mu2e {
class ExtMonMaker;

class ExtMon : virtual public Detector {

public:

// all modules are the same
Expand All @@ -54,6 +55,10 @@ namespace mu2e {
CLHEP::Hep3Vector detectorCenterInMu2e() const;
const CLHEP::HepRotation& detectorRotationInMu2e() const;

const std::vector<double>& detectorMotherHS() const { return detectorMotherHS_; }
const CLHEP::Hep3Vector detectorMotherCenterInMu2e() const { return detectorMotherCenterInMu2e_; }
const CLHEP::HepRotation& detectorMotherRotationInMu2e() const { return spectrometerMagnet().magnetRotationInMu2e(); }

// Coordinate conversion to/from the Mu2e frame
// The ExtMonFNAL frame is defined in the following way:
//
Expand Down Expand Up @@ -122,6 +127,8 @@ namespace mu2e {
ExtMonFNALPlaneStack dn_;
ExtMonFNALMagnet spectrometerMagnet_;
CLHEP::HepRotationX dnToExtMonCoordinateRotation_;
std::vector<double> detectorMotherHS_;
CLHEP::Hep3Vector detectorMotherCenterInMu2e_;
};

//================================================================
Expand Down
4 changes: 0 additions & 4 deletions ExtinctionMonitorFNAL/Geometry/inc/ExtMonFNALPlaneStack.hh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ namespace mu2e {
const std::vector<double>& plane_xoffset() const { return m_plane_xoffset; }
const std::vector<double>& plane_yoffset() const { return m_plane_yoffset; }

const std::vector<double>& motherTransverseHalfSize() const { return m_motherTransverseHalfSize; }
const double motherStartZ() const { return m_motherStartZ; }
const double motherEndZ() const { return m_motherEndZ; }

// offset of plane center wrt the ref point
CLHEP::Hep3Vector planeOffsetInStack(unsigned iplane) const;

Expand Down
13 changes: 10 additions & 3 deletions GeometryService/src/ExtMonFNAL_Maker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ namespace mu2e {
config.getVectorDouble(prefix+".plane_zoffset", pt.m_plane_zoffset, -1);
config.getVectorDouble(prefix+".plane_xoffset", pt.m_plane_xoffset, -1);
config.getVectorDouble(prefix+".plane_yoffset", pt.m_plane_yoffset, -1);
config.getVectorDouble(prefix+".motherTransverseHalfSize", pt.m_motherTransverseHalfSize, -1);
pt.m_motherStartZ = config.getDouble(prefix+".motherStartZ");
pt.m_motherEndZ = config.getDouble(prefix+".motherEndZ");

if(!boost::is_sorted(pt.m_plane_zoffset)) {
throw cet::exception("GEOM")<<"ExtMonFNAL_Maker: ERROR: "
Expand Down Expand Up @@ -88,6 +85,16 @@ namespace mu2e {
det->dnToExtMonCoordinateRotation_ =
CLHEP::HepRotationX( -2 * det->spectrometerMagnet_.nominalBendHalfAngle());

//----------------------------------------------------------------
// Detector Mother
config.getVectorDouble("extMonFNAL.detectorMotherHS", det->detectorMotherHS_, -1);

double detectorMotherDistToMagnet = config.getDouble("extMonFNAL.detectorMotherDistToMagnet");
double detectorMotherZCoord = det->detectorMotherHS()[1] - detectorMotherDistToMagnet - det->spectrometerMagnet().outerHalfSize()[1];
CLHEP::Hep3Vector detectorMotherZVec = det->spectrometerMagnet().magnetRotationInMu2e()*CLHEP::Hep3Vector(0, detectorMotherZCoord, 0);
det->detectorMotherCenterInMu2e_ = det->spectrometerMagnet().geometricCenterInMu2e() + detectorMotherZVec;


//----------------

config.getVectorDouble("extMonFNAL.sensorHalfSize", det->module_.sensorHalfSize_, -1);
Expand Down
34 changes: 23 additions & 11 deletions Mu2eG4/geom/extmon_fnal_v02.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,31 @@ bool extMonFNAL.stackMotherSolid = true;
//================================================================
// Scintillator parameters

vector<double> extMonFNAL.scintHalfSize = { 54.0 , 42.0, 3.0 };
vector<double> extMonFNAL.Dn.scintFullSize = { 45.0 , 54.0, 3 };
vector<double> extMonFNAL.Up.scintFullSize = { 45 , 37, 3 };
string extMonFNAL.scintMaterial = "Scintillator";
double extMonFNAL.scintOffset = 29.0; // Distance from pixel plane center to center of scintillator closest to the pixels on outer ends of detector table
double extMonFNAL.scintInnerOffset = 33; // Distance from pixel plane center to center of scintillator on the magnet side
double extMonFNAL.scintPlaneOffset = 29.0; // Distance from pixel plane center to center of scintillator closest to the pixels on outer ends of detector table
double extMonFNAL.scintInnerOffset = -33; // Distance from pixel plane center to center of scintillator on the magnet side
double extMonFNAL.scintGap = 5.3; // Distance between the surfaces of the two adjacent scintillators

//================================================================
// The Ext Mon detector mother

vector<double> extMonFNAL.detectorMotherHS = { 150, 200, 750 };
double extMonFNAL.detectorMotherDistToMagnet = 1;
bool extMonFNAL.stackRotation = true;

//================================================================
// The pixel cooling tube parameters

double extMonFNAL.coolingTubeInRad = 1.5542;
double extMonFNAL.coolingTubeOutRad = 1.8542;
double extMonFNAL.coolingTubeLen = 52.685;
double extMonFNAL.coolingTubeTopLen = 34.57;
double extMonFNAL.coolingTubeTsSweptRad = 3.969;
double extMonFNAL.coolingTubePlaneOffset = 3.5;

//================================================================
// The upstream stack of the sensors.
//
// Location in room: the center is on the continuation of
Expand All @@ -195,9 +214,6 @@ double extMonFNAL.scintGap = 5.3; // Distance between the surfaces of th
// Details of the detector. All of these vectors should be
// of the same size: one entry per detector plane.
// The coordinates are relative to the detector box volume.
vector<double> extMonFNAL.up.motherTransverseHalfSize = { 115, 115 }; // x, y
double extMonFNAL.up.motherStartZ = 276.;
double extMonFNAL.up.motherEndZ = 676.;

vector<double> extMonFNAL.up.plane_zoffset = { +326., +426., +526., +626.};
vector<double> extMonFNAL.up.plane_xoffset = { 0., 0., 0., 0. };
Expand All @@ -221,18 +237,14 @@ vector<double> extMonFNAL.up.module_rotation = { 0., 0. };
// of the same size: one entry per detector plane.
// The coordinates are relative to the detector box volume.

vector<double> extMonFNAL.dn.motherTransverseHalfSize = { 115, 115 }; // x, y
double extMonFNAL.dn.motherStartZ = -676.;
double extMonFNAL.dn.motherEndZ = -276.;

vector<double> extMonFNAL.dn.plane_zoffset = {-626., -526., -426., -326.};
vector<double> extMonFNAL.dn.plane_xoffset = { 0., 0., 0., 0. };
vector<double> extMonFNAL.dn.plane_yoffset = { 0., 0., 0., 0. };

// Assumes all planes in the stack have same module layout (these offsets are used to mount modules on all planes)
vector<double> extMonFNAL.dn.module_xoffset = { 0., 0., 0. };
vector<double> extMonFNAL.dn.module_yoffset = { 16.7, 0., -16.7 };
vector<double> extMonFNAL.dn.module_zoffset = { 1., -1., 1. }; // just determines which side of the plane; all math is handed in constructExMonFNAL
vector<double> extMonFNAL.dn.module_zoffset = { 1., -1., 1. }; // just determines which side of the plane; all math is handed in constructExMonFNALDetector
vector<double> extMonFNAL.dn.module_rotation = { 0., 0., 180. };

//================================================================
Expand Down
31 changes: 3 additions & 28 deletions Mu2eG4/inc/constructExtMonFNAL.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,9 @@ namespace mu2e {

void constructExtMonFNALDetector(const VolumeInfo& room, const SimpleConfig& config);

void constructExtMonFNALMagnet(const ExtMonFNALMagnet& mag,
const VolumeInfo& parent,
const std::string& volNameSuffix,
const CLHEP::HepRotation& parentRotationInMu2e,
const SimpleConfig& config
);

void constructExtMonFNALPlanes(const VolumeInfo& mother,
const ExtMonFNALModule& module,
const ExtMonFNALPlaneStack& stack,
const std::string& volNameSuffix,
const SimpleConfig& config,
bool const forceAuxEdgeVisible,
bool const doSurfaceCheck,
bool const placePV
);

void constructExtMonFNALModules(const VolumeInfo& mother,
const G4ThreeVector& offset,
unsigned iplane,
const ExtMonFNALModule& module,
const ExtMonFNALPlaneStack& stack,
const std::string& volNameSuffix,
const SimpleConfig& config,
bool const forceAuxEdgeVisible,
bool const doSurfaceCheck,
bool const placePV
);
void constructExtMonFNALDetector(const VolumeInfo& mainParent,
const CLHEP::HepRotation& mainParentRotationInMu2e,
const SimpleConfig& config);

void constructExtMonFNALScintillators(const VolumeInfo& mother,
const ExtMonFNALPlaneStack& stack,
Expand Down
56 changes: 56 additions & 0 deletions Mu2eG4/inc/constructExtMonFNALDetector.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Sam Fine, 2024

#ifndef CONSTRUCTEXTMONFNALDETECTOR_HH
#define CONSTRUCTEXTMONFNALDETECTOR_HH

#include <string>

#include "Offline/Mu2eG4Helper/inc/VolumeInfo.hh"
#include "Offline/ExtinctionMonitorFNAL/Geometry/inc/ExtMonFNALPlaneStack.hh"
#include "Geant4/G4ThreeVector.hh"

namespace CLHEP { class HepRotation; }

namespace mu2e {

class SimpleConfig;
class ExtMonFNALMagnet;

void constructExtMonFNALDetector(const VolumeInfo& parent,
const CLHEP::HepRotation& parentRotationInMu2e,
const SimpleConfig& config
);

void constructExtMonFNALMagnet(const ExtMonFNALMagnet& mag,
const VolumeInfo& parent,
const std::string& volNameSuffix,
const CLHEP::HepRotation& parentRotationInMu2e,
const SimpleConfig& config
);

void constructExtMonFNALPlanes(const VolumeInfo& mother,
const ExtMonFNALModule& module,
const ExtMonFNALPlaneStack& stack,
const std::string& volNameSuffix,
const SimpleConfig& config,
bool const forceAuxEdgeVisible,
bool const doSurfaceCheck,
bool const placePV
);

void constructExtMonFNALModules(const VolumeInfo& mother,
const G4ThreeVector& offset,
unsigned iplane,
const ExtMonFNALModule& module,
const ExtMonFNALPlaneStack& stack,
const std::string& volNameSuffix,
const SimpleConfig& config,
bool const forceAuxEdgeVisible,
bool const doSurfaceCheck,
bool const placePV
);

}


#endif /* CONSTRUCTEXTMONFNALDETECTOR_HH */
Loading