Skip to content
Snippets Groups Projects
Commit 8fac905d authored by Ishan Kiritbhai Vyas's avatar Ishan Kiritbhai Vyas Committed by Vakhtang Tsulaia
Browse files

sTgcReadoutElement - Fixing wireGroup Positions

Fixing padCorner function, adding 1.5 to beamlineRadius temporarily until it is fixed, modifying globalChannelPosition function to be more efficient
parent 736a77ef
No related branches found
No related tags found
No related merge requests found
......@@ -178,9 +178,7 @@ StatusCode sTgcReadoutGeomTool::loadDimensions(sTgcReadoutElement::defineArgs& d
define.stripLayers.push_back(std::move(stripLayer));
if (!define.stripDesign) define.stripDesign = stripDesign;
///Pads
/// defining frameOffset to correct the beamlineRadius
double frameOffset = -0.5 * (paramBook.lFrameWidth - paramBook.sFrameWidth);
double beamlineRadius = frameOffset + define.physVol->getAbsoluteTransform().translation().perp();
double beamlineRadius = (define.physVol->getAbsoluteTransform() * gapVol.transform).translation().perp();
padDesign->defineBeamlineRadius(beamlineRadius);
ATH_MSG_DEBUG("The beamline radius is: " << beamlineRadius);
StripLayer padLayer(gapVol.transform * Amg::getRotateY3D(180* Gaudi::Units::deg), padDesign, sTgcReadoutElement::createHash(gasGap, sTgcIdHelper::Pad, 0));
......
......@@ -460,6 +460,8 @@ std::set<sTgcChamber> readTreeDump(const std::string& inputFile) {
newWireGroup.gasGap = (*wireGroupGasGap)[wg];
newWireGroup.channelNumber = (*wireGroupNum)[wg];
newWireGroup.channelType = 2;
///Uncomment to avoid wireGroupPositions dump
//if (newWireGroup.channelNumber > 1) continue;
newchamber.channels.insert(std::move(newWireGroup));
}
......@@ -471,6 +473,8 @@ std::set<sTgcChamber> readTreeDump(const std::string& inputFile) {
newStrip.gasGap = (*stripGasGap)[s];
newStrip.channelNumber = (*stripNum)[s];
newStrip.channelType = 1;
///Uncomment to avoid stripPositions dump
//if (newStrip.channelNumber > 1) continue;
newchamber.channels.insert(std::move(newStrip));
}
......@@ -494,6 +498,8 @@ std::set<sTgcChamber> readTreeDump(const std::string& inputFile) {
newPad.gasGap = (*padGasGap)[p];
newPad.padEta = (*padEta)[p];
newPad.padPhi = (*padPhi)[p];
///Uncomment to avoid padPositions dump
//if (newPad.padEta > 0 || newPad.padPhi > 0) continue;
newchamber.pads.insert(std::move(newPad));
}
......@@ -651,7 +657,7 @@ int main( int argc, char** argv ) {
TEST_BASICPROP(padPhiShift[c], "shift of inner pad edges in phi direction in the layer "<< c + 1 << " are ");
TEST_BASICPROP(firstPadPhiDiv[c], "angular position of the outer edge of the first pad in the layer "<< c + 1 << " are ");
++c;
///Dumping local to global layer transformation
///Uncomment to dump the local to global layer transformation
/*
std::cout <<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "
<< "The test layer transform for layer "<< c << " is: " << Amg::toString(testLayer.transform)
......
......@@ -122,15 +122,29 @@ Amg::Vector2D sTgcReadoutElement::localChannelPosition(const IdentifierHash& mea
wireGroupCenter = std::move(*wireGroupCenterOpt);
unsigned int gasGap = gasGapNumber(measHash) + 1;
if (channelNumber(measHash) == 1) {
ATH_MSG_DEBUG("The first wire pos is: " << wireGroupCenter.x() + (0.5 * firstWireGroupWidth(gasGap))* wirePitch(measHash) );
wireGroupCenter.x() = 0.5*(wireGroupCenter.x() + (0.5 * firstWireGroupWidth(gasGap) - 1)* wirePitch(measHash) - 0.5 * lGapLength(measHash));
ATH_MSG_DEBUG("The first wiregroup width is " <<firstWireGroupWidth(gasGap));
ATH_MSG_DEBUG("The last wire pos is: " << wireGroupCenter.x() + ((firstWireGroupWidth(gasGap) + 1) / 2 - 1) * wirePitch(measHash) );
/// Shifting the first wireGroup center to the last wire of the first wireGroup
wireGroupCenter.x() = wireGroupCenter.x() + ((firstWireGroupWidth(gasGap) + 1) / 2 - 1) * wirePitch(measHash);
/// Defining the wireGroup center as the mean of the position of the last wire in the first group
/// and the left edge of the active area defined for pads to match the R3 description
wireGroupCenter.x() = 0.5 * (wireGroupCenter.x() - 0.5 * lPadLength(measHash));
}
else if (channelNumber(measHash) == numWireGroups(gasGap)) {
ATH_MSG_DEBUG("The last wire center before modification is: " << wireGroupCenter.x());
wireGroupCenter.x() = 0.5 * (wireGroupCenter.x() + 0.5*lGapLength(measHash) -
(wireGroupWidth(gasGap) * wirePitch(measHash)));
ATH_MSG_DEBUG("The last wire center after modification is: " << wireGroupCenter.x());
unsigned int lastWireGroupWidth = numWires(gasGap) - firstWireGroupWidth(gasGap) - (numWireGroups(gasGap) - 2) * wireGroupWidth(gasGap);
ATH_MSG_DEBUG("The last wire group width is: " << lastWireGroupWidth << " and half of that is: "<< lastWireGroupWidth / 2);
/// Shifting the last wireGroup center to the last wire of the second-last wireGroup
wireGroupCenter.x() = wireGroupCenter.x() - (lastWireGroupWidth / 2 + 1) * wirePitch(measHash);
ATH_MSG_DEBUG("The last wire of the last second group is at: " << wireGroupCenter.x());
/// Defining the wireGroup center as the mean of the position of the last wire in the second last group
/// and the right edge of the active area defined for pads to match the R3 description
wireGroupCenter.x() = 0.5 * (wireGroupCenter.x() + 0.5 * lPadLength(measHash));
}
else {
/// In R3, the center of the normal wireGroup is defined on the 10th wire, whereas, in R4
/// the center is defined on the 11th wire. So shifting by a wirePitch to match R3
wireGroupCenter.x() = wireGroupCenter.x() - wirePitch(measHash);
}
return wireGroupCenter;
}
......
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