243 {
244 constexpr double halfHeight = 200. * Gaudi::Units::mm;
245 constexpr double shortEdge = 150. * Gaudi::Units::mm;
246 constexpr double longEdge = 300. * Gaudi::Units::mm;
247
248 constexpr double stripPitch = 5 * Gaudi::Units::mm;
249 constexpr double stripWidth = stripPitch / 3;
250 constexpr double stereoAngle = 20. * Gaudi::Units::deg;
251 constexpr unsigned int numStrips = 2.*halfHeight / stripPitch -1;
252 std::string
outFile{
"./Strip.root"};
254
255
256 std::unique_ptr<TFile>
file = std::make_unique<TFile>(
outFile.c_str(),
"RECREATE");
257
261 stripPitch, stripWidth, numStrips, 1);
267 std::cerr<<"runStripDesignDump() "<<__LINE__<<" -- Nominal design channel mapping failed "<<std::endl;
268 return EXIT_FAILURE;
269 }
270
275 constexpr unsigned numStripsRot = 2*longEdge / stripPitch -1;
277 stripPitch, stripWidth, numStripsRot, 1);
278
283 std::cerr<<"runStripDesignDump() "<<__LINE__<<" -- Flipped design channel mapping failed "<<std::endl;
284 return EXIT_FAILURE;
285 }
286
288 rotatedDesign.
defineTrapezoid(shortEdge, longEdge, halfHeight, stereoAngle);
290 stripPitch, stripWidth, numStrips, 0);
296 std::cerr<<"runStripDesignDump() "<<__LINE__<<" -- Stereo Rotated design channel mapping failed "<<std::endl;
297 return EXIT_FAILURE;
298 }
299
301 rotatedDesignNeg.
defineTrapezoid(shortEdge, longEdge, halfHeight, -stereoAngle);
303 stripPitch, stripWidth, numStrips, 1);
308 std::cerr<<"runStripDesignDump() "<<__LINE__<<" -- Rotated design VolII channel mapping failed "<<std::endl;
309 return EXIT_FAILURE;
310 }
311
312
314 flippedRotated.
defineTrapezoid(shortEdge, longEdge, halfHeight, stereoAngle);
316 stripPitch, stripWidth, numStrips, 1);
322 std::cerr<<"runStripDesignDump() "<<__LINE__<<" -- Rotated flipped design channel mapping failed "<<std::endl;
323 return EXIT_FAILURE;
324 }
325
327 diamondDesign.
defineDiamond(shortEdge, longEdge, halfHeight, halfHeight);
329 stripPitch, stripWidth, numStrips+ 25, 1);
330
334
335
337 flippedDiamond.
defineDiamond(shortEdge, longEdge, halfHeight, halfHeight);
339 stripPitch, stripWidth, numStrips, 1);
344
346 std::cerr<<"runStripDesignDump() "<<__LINE__<<" --- Diamond design forth and back mapping failed."<<std::endl;
347 return EXIT_FAILURE;
348 }
349
352 {
353
354
355 unsigned int wireCounter{1}, totWires{0}, nCycles{0};
357 while(totWires< numStrips) {
359 totWires+=wireCounter;
360 if (wireCounter == 1)
sign = 1;
361 else if (wireCounter == 5)
sign = -1;
363 ++nCycles;
364 }
366 stripPitch, stripWidth, nCycles, 1);
367
368
369 }
373 std::cerr<<"runStripDesignDump() "<<__LINE__<<" -- WireGroupDesign back & forth mapping of channels failed "<<std::endl;
374 return EXIT_FAILURE;
375 }
376
380 {
381
382
383 unsigned int wireCounter{1}, totWires{0}, nCycles{0};
385 while(totWires< numStrips) {
387 totWires+=wireCounter;
388 if (wireCounter == 1)
sign = 1;
389 else if (wireCounter == 5)
sign = -1;
391 ++nCycles;
392 }
394 stripPitch, stripWidth, nCycles, 1);
395
396 }
399
401 std::cerr<<"runStripDesignDump() "<<__LINE__<<" -- Flipped WireGroupDesign back & forth mapping of channels failed "<<std::endl;
402 return EXIT_FAILURE;
403 }
404
408 {
410 std::array<double, 25> bottomMountings{}, topMountings{};
411 for (
size_t i = 0 ;
i < bottomMountings.size(); ++
i){
412 bottomMountings[
i] =
rand.Uniform(-shortEdge, shortEdge);
413 topMountings[
i] =
rand.Uniform(-longEdge, longEdge);
414 }
415 std::sort(bottomMountings.begin(), bottomMountings.end());
416 std::sort(topMountings.begin(), topMountings.end());
417
418
419 for (
size_t i =0;
i < bottomMountings.size(); ++
i) {
420 flippedRadialDesign.
addStrip(bottomMountings[i], topMountings[i]);
421 }
422 }
425
427 std::cerr<<"runStripDesignDump() "<<__LINE__<<" -- Flipped Radial design mapping failed channel mapping failed "<<std::endl;
428 return EXIT_FAILURE;
429 }
432 {
433 const double edgeLength = 0.5* std::hypot(shortEdge - longEdge, 2* halfHeight);
434 std::array<double, 15> mountings{-0.95 * edgeLength, -0.76 * edgeLength, -0.63 *edgeLength,
435 -0.57 * edgeLength, -0.41 * edgeLength, -0.21 *edgeLength,
436 0, 0.16 * edgeLength, 0.34 *edgeLength,
437 0.42 * edgeLength, 0.53 * edgeLength, 0.66 *edgeLength,
438 0.75 * edgeLength, 0.86 * edgeLength, 0.99 *edgeLength};
439
440 for (
size_t i =0;
i < mountings.size(); ++
i) {
441 RadialDesign.
addStrip(mountings[i], -mountings[mountings.size()- 1 - i]);
442 }
443 }
447 std::cerr<<"runStripDesignDump() "<<__LINE__<<" -- Radial design mapping failed channel mapping failed "<<std::endl;
448 return EXIT_FAILURE;
449 }
450 return EXIT_SUCCESS;
451}
void addStrip(const double posOnBottom, const double posOnTop)
: Defines a new radial strip.
void defineDiamond(double HalfShortY, double HalfLongY, double HalfHeight, double yCutout)
Defines the edges of the sTGC diamond L3 sector.
void defineStripLayout(Amg::Vector2D &&posFirst, const double stripPitch, const double stripWidth, const int numStrips, const int numFirst=1)
Defines the layout of the strip detector by specifing the position of the first strip w....
void defineTrapezoid(double HalfShortY, double HalfLongY, double HalfHeight)
Defines the edges of the trapezoid.
void flipTrapezoid()
Flips the edges of the trapezoid boundaries by 90 degrees clockwise.
void declareGroup(const unsigned int x)
Adds a new group of wires to the design.
Eigen::Matrix< double, 2, 1 > Vector2D
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
void testChannelNumber(const StripDesign &design, TFile &outFile, const std::string &histoName)
void testBoundaries(const StripDesign &design, TFile &outFile, const std::string &histoName)
void createGraph(const StripDesign &design, TFile &outFile, const std::string &graphName)
bool testChamberBackForthMapping(const MuonGMR4::RadialStripDesign &design)