ATLAS Offline Software
Loading...
Searching...
No Matches
LArWheelSolidTests.cxx File Reference
#include <iostream>
#include <stdexcept>
#include <format>
#include <map>
#include "TRandom3.h"
#include "TF1.h"
#include "TNtupleD.h"
#include "TFile.h"
#include "TROOT.h"
#include "GeoSpecialShapes/LArWheelCalculator.h"
#include "LArWheelSolid.h"
#include "CLHEP/Units/SystemOfUnits.h"
#include "CLHEP/Units/PhysicalConstants.h"
#include <stdlib.h>
#include "CxxUtils/checker_macros.h"

Go to the source code of this file.

Functions

static void get_r (const G4VSolid *p, G4double z, G4double &rmin, G4double &rmax)
double LArWheelSolid_fcn_area (double *x, double *p)
double LArWheelSolid_fcn_vol (double *x, double *p)
double LArWheelSolid_fcn_area_on_pc (double *x, double *p)
double LArWheelSolid_get_dl (double *x, double *par, G4int side)
static double fcn_length (double *x, double *p)
double LArWheelSolid_fcn_side_area (double *x, double *p)

Variables

 ATLAS_NO_CHECK_FILE_THREAD_SAFETY
static double IntPrecision = 0.0001
static TRandom * rnd = 0
static std::map< double, LArWheelSolid * > solid

Function Documentation

◆ fcn_length()

double fcn_length ( double * x,
double * p )
static

Definition at line 593 of file LArWheelSolidTests.cxx.

594{
595 return LArWheelSolid_get_dl(x, p, 1) + LArWheelSolid_get_dl(x, p, -1);
596}
double LArWheelSolid_get_dl(double *x, double *par, G4int side)
#define x

◆ get_r()

void get_r ( const G4VSolid * p,
G4double z,
G4double & rmin,
G4double & rmax )
static

Definition at line 55 of file LArWheelSolidTests.cxx.

58{
59 G4ThreeVector from(10.*CLHEP::m, 0., z);
60 rmax = from[0] - p->DistanceToIn(from, G4ThreeVector(-1., 0., 0.));
61 from[0] = 0.;
62 rmin = p->DistanceToIn(from, G4ThreeVector(1., 0., 0.));
63}
#define z

◆ LArWheelSolid_fcn_area()

double LArWheelSolid_fcn_area ( double * x,
double * p )

Definition at line 526 of file LArWheelSolidTests.cxx.

527{
528 const double &z = x[0];
529 const double &r = p[0];
530 const double &index = p[1];
531
532 G4ThreeVector a(0., r, z);
533 double b = solid[index]->GetCalculator()->AmplitudeOfSurface(a, -1, 121) // sagging ignored, effect should be negligible, use arbitrary fan number
534 - solid[index]->GetCalculator()->AmplitudeOfSurface(a, 1, 121);
535 return b;
536}
static Double_t a
static std::map< double, LArWheelSliceSolid * > solid
int r
Definition globals.cxx:22
Definition index.py:1

◆ LArWheelSolid_fcn_area_on_pc()

double LArWheelSolid_fcn_area_on_pc ( double * x,
double * p )

Definition at line 546 of file LArWheelSolidTests.cxx.

547{
548 const double &z = x[0];
549 const double &index = p[0];
550
551 G4double rmin, rmax;
552 get_r(solid[index]->m_BoundingShape, z, rmin, rmax);
553
554 double result = 0.;
555 G4ThreeVector a(0., rmin, z);
556 result += solid[index]->GetCalculator()->AmplitudeOfSurface(a, -1, 232) // sagging ignored, effect should be negligible, use arbitrary fan number
557 - solid[index]->GetCalculator()->AmplitudeOfSurface(a, 1, 232);
558 a[1] = rmax;
559 result += solid[index]->GetCalculator()->AmplitudeOfSurface(a, -1, 343)
560 - solid[index]->GetCalculator()->AmplitudeOfSurface(a, 1, 343);
561
562 return result;
563}
static void get_r(const G4VSolid *p, G4double z, G4double &rmin, G4double &rmax)

◆ LArWheelSolid_fcn_side_area()

double LArWheelSolid_fcn_side_area ( double * x,
double * p )

Definition at line 598 of file LArWheelSolidTests.cxx.

599{
600 const double &r = x[0];
601 const double &index = p[0];
602
603 return solid[index]->get_length_at_r(r);
604}

◆ LArWheelSolid_fcn_vol()

double LArWheelSolid_fcn_vol ( double * x,
double * p )

Definition at line 538 of file LArWheelSolidTests.cxx.

539{
540 const double &r = x[0];
541 const double &index = p[0];
542
543 return solid[index]->get_area_at_r(r);
544}

◆ LArWheelSolid_get_dl()

double LArWheelSolid_get_dl ( double * x,
double * par,
G4int side )

Definition at line 566 of file LArWheelSolidTests.cxx.

567{
568 const double &z = x[0];
569 const double &r = par[0];
570 const double &index = par[1];
571
572 const double h = 0.001;
573
574 //check what happens if z+h > m_Zmax etc
575 G4ThreeVector p(0., r, z + h);
576 G4double D1 = solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665); // sagging ignored, effect should be negligible, use arbitrary fan number
577 p[2] = z - h;
578 D1 -= solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665);
579 D1 /= 2 * h;
580
581 p[2] = z + h / 2;
582 G4double D2 = solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665);
583 p[2] = z - h / 2;
584 D2 -= solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665);
585 D2 /= h;
586
587 G4double D = (D2 * 4 - D1) / 3.;
588 G4double dl = sqrt(1 + D * D);
589
590 return dl;
591}
Header file for AthHistogramAlgorithm.

Variable Documentation

◆ ATLAS_NO_CHECK_FILE_THREAD_SAFETY

ATLAS_NO_CHECK_FILE_THREAD_SAFETY

Definition at line 25 of file LArWheelSolidTests.cxx.

◆ IntPrecision

double IntPrecision = 0.0001
static

Definition at line 27 of file LArWheelSolidTests.cxx.

◆ rnd

TRandom* rnd = 0
static

Definition at line 65 of file LArWheelSolidTests.cxx.

◆ solid

std::map<double, LArWheelSolid *> solid
static

Definition at line 524 of file LArWheelSolidTests.cxx.