ATLAS Offline Software
Loading...
Searching...
No Matches
LArWheelSolidTests.cxx File Reference
#include <iostream>
#include <stdexcept>
#include "boost/io/ios_state.hpp"
#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 597 of file LArWheelSolidTests.cxx.

598{
599 return LArWheelSolid_get_dl(x, p, 1) + LArWheelSolid_get_dl(x, p, -1);
600}
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 530 of file LArWheelSolidTests.cxx.

531{
532 const double &z = x[0];
533 const double &r = p[0];
534 const double &index = p[1];
535
536 G4ThreeVector a(0., r, z);
537 double b = solid[index]->GetCalculator()->AmplitudeOfSurface(a, -1, 121) // sagging ignored, effect should be negligible, use arbitrary fan number
538 - solid[index]->GetCalculator()->AmplitudeOfSurface(a, 1, 121);
539 return b;
540}
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 550 of file LArWheelSolidTests.cxx.

551{
552 const double &z = x[0];
553 const double &index = p[0];
554
555 G4double rmin, rmax;
556 get_r(solid[index]->m_BoundingShape, z, rmin, rmax);
557
558 double result = 0.;
559 G4ThreeVector a(0., rmin, z);
560 result += solid[index]->GetCalculator()->AmplitudeOfSurface(a, -1, 232) // sagging ignored, effect should be negligible, use arbitrary fan number
561 - solid[index]->GetCalculator()->AmplitudeOfSurface(a, 1, 232);
562 a[1] = rmax;
563 result += solid[index]->GetCalculator()->AmplitudeOfSurface(a, -1, 343)
564 - solid[index]->GetCalculator()->AmplitudeOfSurface(a, 1, 343);
565
566 return result;
567}
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 602 of file LArWheelSolidTests.cxx.

603{
604 const double &r = x[0];
605 const double &index = p[0];
606
607 return solid[index]->get_length_at_r(r);
608}

◆ LArWheelSolid_fcn_vol()

double LArWheelSolid_fcn_vol ( double * x,
double * p )

Definition at line 542 of file LArWheelSolidTests.cxx.

543{
544 const double &r = x[0];
545 const double &index = p[0];
546
547 return solid[index]->get_area_at_r(r);
548}

◆ LArWheelSolid_get_dl()

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

Definition at line 570 of file LArWheelSolidTests.cxx.

571{
572 const double &z = x[0];
573 const double &r = par[0];
574 const double &index = par[1];
575
576 const double h = 0.001;
577
578 //check what happens if z+h > m_Zmax etc
579 G4ThreeVector p(0., r, z + h);
580 G4double D1 = solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665); // sagging ignored, effect should be negligible, use arbitrary fan number
581 p[2] = z - h;
582 D1 -= solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665);
583 D1 /= 2 * h;
584
585 p[2] = z + h / 2;
586 G4double D2 = solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665);
587 p[2] = z - h / 2;
588 D2 -= solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665);
589 D2 /= h;
590
591 G4double D = (D2 * 4 - D1) / 3.;
592 G4double dl = sqrt(1 + D * D);
593
594 return dl;
595}
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 528 of file LArWheelSolidTests.cxx.