ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
LArStraightAbsorbers Class Reference

#include <LArStraightAbsorbers.h>

Collaboration diagram for LArStraightAbsorbers:

Public Member Functions

double XCentAbs (int stackid, int cellid) const
 
double YCentAbs (int stackid, int cellid) const
 
double HalfLength (int stackid, int cellid) const
 
double Cosu (int stackid, int cellid) const
 
double Sinu (int stackid, int cellid) const
 

Static Public Member Functions

static const LArStraightAbsorbersGetInstance (const std::string &strDetector="")
 

Private Member Functions

 LArStraightAbsorbers (const std::string &strDetector="")
 
void initXYCentAbs (const PhysicalVolumeAccessor &theAbsorbers, int stackid, int cellid)
 
void initHalfLength (const PhysicalVolumeAccessor &theAbsorbers, int stackid, int cellid)
 
double SlantAbs (const PhysicalVolumeAccessor &theAbsorbers, int stackid, int cellid) const
 

Private Attributes

double m_xcent [1024][14] {}
 
double m_ycent [1024][14] {}
 
double m_cosu [1024][14] {}
 
double m_sinu [1024][14] {}
 
double m_halflength [1024][14] {}
 
int m_parity
 

Detailed Description

Definition at line 11 of file LArStraightAbsorbers.h.

Constructor & Destructor Documentation

◆ LArStraightAbsorbers()

LArStraightAbsorbers::LArStraightAbsorbers ( const std::string &  strDetector = "")
private

Definition at line 17 of file LArStraightAbsorbers.cxx.

18 {
20  if (parameters->GetValue("LArEMBPhiAtCurvature",0)>0.) m_parity=0; // first wave goes up
21  else m_parity=1; // first wave goes down
22 
23  static const std::string prefix = strDetector.empty() ? "" : strDetector+"::";
24  static const PhysicalVolumeAccessor pva(prefix+"LAr::EMB::STAC",
25  prefix+"LAr::EMB::ThinAbs::Straight");
26 
27  for (int stackid=0; stackid<14; stackid++) {
28  for (int cellid=0; cellid<1024; cellid++) {
29  initXYCentAbs(pva, stackid,cellid);
30  initHalfLength(pva, stackid,cellid);
31  const double slant = SlantAbs(pva, stackid,cellid);
32  sincos(slant, &m_sinu[cellid][stackid], &m_cosu[cellid][stackid]);
33  }
34  }
35 }

Member Function Documentation

◆ Cosu()

double LArStraightAbsorbers::Cosu ( int  stackid,
int  cellid 
) const
inline

Definition at line 28 of file LArStraightAbsorbers.h.

28 { return m_cosu[cellid][stackid]; }

◆ GetInstance()

const LArStraightAbsorbers * LArStraightAbsorbers::GetInstance ( const std::string &  strDetector = "")
static

Definition at line 11 of file LArStraightAbsorbers.cxx.

12 {
13  static const LArStraightAbsorbers instance(strDetector);
14  return &instance;
15 }

◆ HalfLength()

double LArStraightAbsorbers::HalfLength ( int  stackid,
int  cellid 
) const
inline

Definition at line 27 of file LArStraightAbsorbers.h.

27 { return m_halflength[cellid][stackid]; }

◆ initHalfLength()

void LArStraightAbsorbers::initHalfLength ( const PhysicalVolumeAccessor theAbsorbers,
int  stackid,
int  cellid 
)
private

Definition at line 78 of file LArStraightAbsorbers.cxx.

79 {
80  double l = 0.;
81  const int id=cellid+stackid*10000;
82  const G4VPhysicalVolume *pv=theAbsorbers.GetPhysicalVolume(id);
83  if (pv) {
84  const G4LogicalVolume* lv = pv->GetLogicalVolume();
85  const G4Trap* trap = (G4Trap*) lv->GetSolid();
86  const G4VPhysicalVolume *pv2=theAbsorbers.GetPhysicalVolume(1000000+id);
87  if (!pv2) l = trap->GetYHalfLength1();
88  else {
89  const G4LogicalVolume* lv2 = pv2->GetLogicalVolume();
90  const G4Trap* trap2 = (G4Trap*) lv2->GetSolid();
91  l = trap->GetYHalfLength1()+trap2->GetYHalfLength1();
92  }
93  }
94  m_halflength[cellid][stackid] = l;
95 }

◆ initXYCentAbs()

void LArStraightAbsorbers::initXYCentAbs ( const PhysicalVolumeAccessor theAbsorbers,
int  stackid,
int  cellid 
)
private

Definition at line 37 of file LArStraightAbsorbers.cxx.

38 {
39  const int id=cellid+stackid*10000;
40  const G4VPhysicalVolume *pv=theAbsorbers.GetPhysicalVolume(id);
41  if (!pv) {
42  m_xcent[cellid][stackid] = 0;
43  m_ycent[cellid][stackid] = 0;
44  return;
45  }
46  const G4ThreeVector& tv=pv->GetTranslation();
47  const G4VPhysicalVolume *pv2=theAbsorbers.GetPhysicalVolume(1000000+id);
48  if (!pv2) {
49  m_xcent[cellid][stackid] = tv.x();
50  m_ycent[cellid][stackid] = tv.y();
51  }
52  else {
53  const G4ThreeVector& tv2=pv2->GetTranslation();
54  const G4LogicalVolume* lv = pv->GetLogicalVolume();
55  const G4Trap* trap = (G4Trap*) lv->GetSolid();
56  const G4LogicalVolume* lv2 = pv2->GetLogicalVolume();
57  const G4Trap* trap2 = (G4Trap*) lv2->GetSolid();
58  const double xl1=trap->GetYHalfLength1();
59  const double xl2=trap2->GetYHalfLength1();
60  m_xcent[cellid][stackid] = (tv.x()*xl1+tv2.x()*xl2)/(xl1+xl2);
61  m_ycent[cellid][stackid] = (tv.y()*xl1+tv2.y()*xl2)/(xl1+xl2);
62  }
63 }

◆ Sinu()

double LArStraightAbsorbers::Sinu ( int  stackid,
int  cellid 
) const
inline

Definition at line 29 of file LArStraightAbsorbers.h.

29 { return m_sinu[cellid][stackid]; }

◆ SlantAbs()

double LArStraightAbsorbers::SlantAbs ( const PhysicalVolumeAccessor theAbsorbers,
int  stackid,
int  cellid 
) const
private

Definition at line 65 of file LArStraightAbsorbers.cxx.

66 {
67  // both stackid and cellid start from 0 in the following code
68  const int id=cellid+stackid*10000;
69  const G4VPhysicalVolume *pv=theAbsorbers.GetPhysicalVolume(id);
70  if (!pv) return 0.;
71  const G4RotationMatrix *rm=pv->GetRotation();
72  double Slant = (stackid%2 ==m_parity) ? 180*CLHEP::deg-(rm->thetaY()):(rm->thetaY())-180*CLHEP::deg;
73  if((stackid%2 == m_parity) && (rm->phiY() > 0)) Slant = 360.*CLHEP::deg - Slant;
74  if((stackid%2 == (1-m_parity)) && (rm->phiY() < 0)) Slant = - Slant;
75  return Slant;
76 }

◆ XCentAbs()

double LArStraightAbsorbers::XCentAbs ( int  stackid,
int  cellid 
) const
inline

Definition at line 25 of file LArStraightAbsorbers.h.

25 { return m_xcent[cellid][stackid]; }

◆ YCentAbs()

double LArStraightAbsorbers::YCentAbs ( int  stackid,
int  cellid 
) const
inline

Definition at line 26 of file LArStraightAbsorbers.h.

26 { return m_ycent[cellid][stackid]; }

Member Data Documentation

◆ m_cosu

double LArStraightAbsorbers::m_cosu[1024][14] {}
private

Definition at line 19 of file LArStraightAbsorbers.h.

◆ m_halflength

double LArStraightAbsorbers::m_halflength[1024][14] {}
private

Definition at line 21 of file LArStraightAbsorbers.h.

◆ m_parity

int LArStraightAbsorbers::m_parity
private

Definition at line 22 of file LArStraightAbsorbers.h.

◆ m_sinu

double LArStraightAbsorbers::m_sinu[1024][14] {}
private

Definition at line 20 of file LArStraightAbsorbers.h.

◆ m_xcent

double LArStraightAbsorbers::m_xcent[1024][14] {}
private

Definition at line 17 of file LArStraightAbsorbers.h.

◆ m_ycent

double LArStraightAbsorbers::m_ycent[1024][14] {}
private

Definition at line 18 of file LArStraightAbsorbers.h.


The documentation for this class was generated from the following files:
LArStraightAbsorbers::m_halflength
double m_halflength[1024][14]
Definition: LArStraightAbsorbers.h:21
LArGeo::VDetectorParameters
Definition: VDetectorParameters.h:29
deg
#define deg
Definition: SbPolyhedron.cxx:17
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
LArStraightAbsorbers::m_parity
int m_parity
Definition: LArStraightAbsorbers.h:22
LArStraightAbsorbers::m_xcent
double m_xcent[1024][14]
Definition: LArStraightAbsorbers.h:17
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
LArStraightAbsorbers
Definition: LArStraightAbsorbers.h:11
PhysicalVolumeAccessor
Definition: PhysicalVolumeAccessor.h:18
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
LArStraightAbsorbers::initXYCentAbs
void initXYCentAbs(const PhysicalVolumeAccessor &theAbsorbers, int stackid, int cellid)
Definition: LArStraightAbsorbers.cxx:37
LArStraightAbsorbers::m_sinu
double m_sinu[1024][14]
Definition: LArStraightAbsorbers.h:20
PhysicalVolumeAccessor::GetPhysicalVolume
const G4VPhysicalVolume * GetPhysicalVolume(int) const
Definition: PhysicalVolumeAccessor.cxx:42
LArStraightAbsorbers::m_cosu
double m_cosu[1024][14]
Definition: LArStraightAbsorbers.h:19
python.changerun.pv
pv
Definition: changerun.py:81
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
LArStraightAbsorbers::SlantAbs
double SlantAbs(const PhysicalVolumeAccessor &theAbsorbers, int stackid, int cellid) const
Definition: LArStraightAbsorbers.cxx:65
LArStraightAbsorbers::m_ycent
double m_ycent[1024][14]
Definition: LArStraightAbsorbers.h:18
LArGeo::VDetectorParameters::GetInstance
static const VDetectorParameters * GetInstance()
Definition: VDetectorParameters.cxx:29
LArStraightAbsorbers::initHalfLength
void initHalfLength(const PhysicalVolumeAccessor &theAbsorbers, int stackid, int cellid)
Definition: LArStraightAbsorbers.cxx:78