16 #include "Identifier/Identifier.h"
25 #include "GaudiKernel/StatusCode.h"
30 #include <type_traits>
73 return StatusCode::SUCCESS;
87 return StatusCode::SUCCESS;
97 static const int layer100[] = {
98 2, 2, 3, 2, 2, 2, 0, 2, 3, 2, 0, 2, 3, 2, 3, 2, 0, 2, 3, 0, 2, 0, 2, 3, 2, 2, 2, 0, 0, 0, 0, 0, 0, 3, 0, 3, 2, 0, 2,
99 2, 0, 3, 3, 3, 0, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 3, 2, 2, 2, 2, 2, 3, 3, 2, 3, 2, 2, 2, 3, 3, 3, 2, 2, 2, 2, 3, 3,
100 2, 3, 2, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2
102 static const int phi100[] = {
103 29, 29, 6, 13, 23, 13, 14, 29, 9, 29, 14, 29, 9, 29, 39, 32, 21, 32, 13, 22, 32, 22, 32, 13, 32, 32, 32, 20, 20, 20,
104 20, 20, 20, 13, 21, 17, 33, 5, 33, 33, 31, 6, 19, 47, 21, 37, 37, 37, 37, 33, 37, 37, 24, 33, 33, 47, 19, 33, 33,
105 37, 37, 37, 55, 9, 38, 24, 37, 38, 8, 9, 9, 26, 38, 38, 38, 38, 39, 39, 38, 11, 45, 54, 54, 24, 31, 14, 47, 45, 47,
108 static const int eta100[] = {
109 3, -4, -6, 2, 6, 3, -5, -1, 6, -2, -6, -5, 5, -3, 2, 6, -3, 5, 5, 3, 4, 2, 2, 2, -1, -3, -4, 1, -1, -2, -3, -4, 4,
110 -1, -5, 6, 2, 4, 3, 1, 6, -2, 6, 3, -6, -1, 2, 1, 3, -5, 4, 5, -3, -4, -3, -5, -2, -1, -2, -3, -2, -4, -3, 2, 3, -6,
111 -5, 4, 6, 1, -6, 1, 1, -5, -4, -3, -3, -5, -2, 1, 5, 5, 4, 4, 5, 4, -1, -5, 3, 4, 1, -5
113 constexpr
unsigned int layer100_n{
sizeof(layer100) /
sizeof(*layer100)};
114 constexpr
unsigned int phi100_n{
sizeof(phi100) /
sizeof(*phi100)};
115 constexpr
unsigned int eta100_n{
sizeof(eta100) /
sizeof(*eta100)};
116 constexpr
bool theseArraysAreEqualInLength{(layer100_n == phi100_n) and (phi100_n == eta100_n)};
118 static_assert(theseArraysAreEqualInLength,
"Coordinate arrays for <100> wafers are not of equal length");
124 if (elements==
nullptr) {
126 return StatusCode::SUCCESS;
130 if (not tracks.isValid()) {
132 return StatusCode::SUCCESS;
142 if (
track==
nullptr) {
149 if (trackStates==
nullptr) {
150 ATH_MSG_WARNING(
"for current track, TrackStateOnSurfaces == Null, no data will be written for this track");
170 if (RawDataClus==
nullptr) {
173 if (RawDataClus->detectorElement()->isSCT()) {
174 const Identifier sct_id{clus->
identify()};
186 for (
unsigned int i{0};
i < layer100_n;
i++) {
187 if ((layer100[
i] ==
layer) and (eta100[
i] ==
eta) and (phi100[
i] ==
phi)) {
193 const std::vector<Identifier>& rdoList{RawDataClus->rdoList()};
194 int nStrip{
static_cast<int>(rdoList.size())};
205 float phiToWafer{90.f};
206 float thetaToWafer(90.
f);
209 pTrack[0] = trkp->momentum().x();
210 pTrack[1] = trkp->momentum().y();
211 pTrack[2] = trkp->momentum().z();
218 bool passesCuts{
true};
220 (trkp->momentum().perp() > 500.) and
225 (std::abs(perigee->parameters()[
Trk::d0]) < 1.) and
227 (trkp->momentum().perp() > 500.) and
245 return StatusCode::SUCCESS;
255 ATH_MSG_DEBUG(
"Calling checkHists(true); true := end of run");
261 return StatusCode::SUCCESS;
266 return StatusCode::SUCCESS;
274 const std::string stem{
m_gpath +
"/SCT/GENERAL/lorentz/"};
277 static const std::string hNum[
N_BARRELS] = {
280 static const std::string hNumS[
N_SIDES] = {
283 static const int nProfileBins{360};
286 static const std::string histNames1[
nSurfaces]{
"_100",
"_111"};
287 static const std::string histNames2[
nSurfaces]{
"_100_",
"_111_"};
288 static const std::string histTitles[
nSurfaces]{
"100 - ",
"111 - "};
292 for (
unsigned int iSurface{0}; iSurface<
nSurfaces; iSurface++) {
294 histName =
"h_phiVsNstrips" + histNames2[iSurface] + hNum[
l] +
"Side" + hNumS[
side];
295 std::string histTitle;
296 histTitle = histTitles[iSurface] +
"Inc. Angle vs nStrips for Layer Side" + hNum[
l] + hNumS[
side];
306 return StatusCode::FAILURE;
308 return StatusCode::SUCCESS;
329 const float& sinAlpha,
const Identifier&
id,
340 if (element==
nullptr) {
341 ATH_MSG_ERROR(
"findAnglesToWaferSurface: failed to find detector element for id=" <<
346 float cosAlpha{std::sqrt(1.0
f - sinAlpha * sinAlpha)};
347 double phix{ cosAlpha * element->phiAxis().x() + sinAlpha * element->phiAxis().y()};
348 double phiy{-sinAlpha * element->phiAxis().x() + cosAlpha * element->phiAxis().y()};
350 double pNormal{
vec[0] * element->normal().x() +
vec[1] * element->normal().y() +
vec[2] * element->normal().z()};
351 double pEta{
vec[0] * element->etaAxis().x() +
vec[1] * element->etaAxis().y() +
vec[2] * element->etaAxis().z()};
352 double pPhi{
vec[0] * phix +
vec[1] * phiy +
vec[2] * element->phiAxis().z()};