Skip to content
Snippets Groups Projects
Commit 468aa401 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

Resolve "MRICH overlap in master branch"

(cherry picked from commit 3efb3867)
parent a6657833
No related branches found
No related tags found
1 merge request!216Resolve "MRICH overlap in master branch"
......@@ -91,19 +91,20 @@
</photodet>
</module>
<comment>
Modules are only listed here for one quadrant
Modules are only listed here for one quadrant. The modules point back to the
z0 position (should be their actual position, but breaks parametrization).
</comment>
<positions scale="1.03">
<positions scale="1.03" z0="157.5*cm">
<position x="-41.3250000000" y="178.6750000000"/>
<position x=" 96.0250000001" y="178.6750000000"/>
</positions>
<positions scale="1.036">
<positions scale="1.036" z0="157.5*cm">
<position x="-41.3250000000" y="316.0250000001"/>
<position x=" 96.0250000001" y="316.0250000001"/>
<position x="233.3750000002" y="178.6750000000"/>
<position x="233.3750000002" y="316.0250000001"/>
</positions>
<positions scale="1.052">
<positions scale="1.052" z0="157.5*cm">
<position x="-41.3250000000" y="453.3750000002"/>
<position x=" 96.0250000001" y="453.3750000002"/>
<position x="233.3750000002" y="453.3750000002"/>
......@@ -111,7 +112,7 @@
<position x="370.7250000003" y="316.0250000001"/>
<position x="370.7250000003" y="178.6750000000"/>
</positions>
<positions scale="1.078">
<positions scale="1.078" z0="157.5*cm">
<position x="-41.3250000000" y="590.7250000003"/>
<position x=" 96.0250000001" y="590.7250000003"/>
<position x="233.3750000002" y="590.7250000003"/>
......@@ -121,7 +122,7 @@
<position x="508.0750000004" y="316.0250000001"/>
<position x="508.0750000004" y="453.3750000002"/>
</positions>
<positions scale="1.09">
<positions scale="1.09" z0="157.5*cm">
<position x="-41.3250000000" y="728.0750000004"/>
<position x=" 96.0250000001" y="728.0750000004"/>
<!--position x="233.3750000002" y="728.0750000004"/-->
......@@ -132,7 +133,7 @@
<position x="645.4250000005" y="316.0250000001"/>
<position x="645.4250000005" y="178.6750000000"/>
</positions>
<positions scale="1.095">
<positions scale="1.095" z0="157.5*cm">
<!--position x="-41.3250000000" y="865.4250000005"/-->
<!--position x=" 96.0250000001" y="865.4250000005"/-->
<!--position x="233.3750000002" y="865.4250000005"/-->
......
......@@ -33,14 +33,15 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet
OpticalSurfaceManager surfMgr = description.surfaceManager();
// read module positions
std::vector<std::pair<double,double>> positions;
std::vector<std::tuple<double,double,double>> positions;
for (xml_coll_t x_positions_i(x_det, _Unicode(positions)); x_positions_i; ++x_positions_i) {
xml_comp_t x_positions = x_positions_i;
for (xml_coll_t x_position_i(x_positions, _U(position)); x_position_i; ++x_position_i) {
xml_comp_t x_position = x_position_i;
positions.push_back(
std::make_pair(x_positions.scale() * x_position.x() * mm,
x_positions.scale() * x_position.y() * mm));
std::make_tuple(x_positions.scale() * x_position.x() * mm,
x_positions.scale() * x_position.y() * mm,
-x_positions.z0()));
}
}
......@@ -303,20 +304,21 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet
for (auto& p: positions) {
// get positions in one quadrant
double x = p.first;
double y = p.second;
double z = -zpos;
double x = std::get<0>(p);
double y = std::get<1>(p);
double z0 = std::get<2>(p);
// and place in all quadrants (intentional shadowing)
for (auto& p: decltype(positions){{x,y}, {y,-x}, {-x,-y}, {-y,x}}) {
for (auto& p: decltype(positions){{x,y,z0}, {y,-x,z0}, {-x,-y,z0}, {-y,x,z0}}) {
// get positions (intentional shadowing)
double x = p.first;
double y = p.second;
double x = std::get<0>(p);
double y = std::get<1>(p);
double z0 = std::get<2>(p);
// get angles
double rotAngX = atan(y/z);
double rotAngY = -1.*atan(x/z);
double rotAngX = atan(y/z0);
double rotAngY = -1.*atan(x/z0);
/*
ROOT::Math::XYZVector x_location(p.x(), p.y(), zmin+std::signbit(zmin)*mod_length/2.0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment