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

#include <LArStraightElectrodes.h>

Collaboration diagram for LArStraightElectrodes:

Public Member Functions

double XCentEle (int stackid, int cellid) const
 
double YCentEle (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 LArStraightElectrodesGetInstance (const std::string &strDetector="")
 

Private Member Functions

 LArStraightElectrodes (const std::string &strDetector="")
 
void initXYCentEle (const PhysicalVolumeAccessor &theElectrodes, int stackid, int cellid)
 
void initHalfLength (const PhysicalVolumeAccessor &theElectrodes, int stackid, int cellid)
 
double SlantEle (const PhysicalVolumeAccessor &theElectrodes, 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 LArStraightElectrodes.h.

Constructor & Destructor Documentation

◆ LArStraightElectrodes()

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

Definition at line 19 of file LArStraightElectrodes.cxx.

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

Member Function Documentation

◆ Cosu()

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

Definition at line 29 of file LArStraightElectrodes.h.

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

◆ GetInstance()

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

Definition at line 12 of file LArStraightElectrodes.cxx.

13 {
14  static const LArStraightElectrodes instance(strDetector);
15  return &instance;
16 }

◆ HalfLength()

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

Definition at line 28 of file LArStraightElectrodes.h.

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

◆ initHalfLength()

void LArStraightElectrodes::initHalfLength ( const PhysicalVolumeAccessor theElectrodes,
int  stackid,
int  cellid 
)
private

Definition at line 83 of file LArStraightElectrodes.cxx.

84 {
85  double l = 0.;
86  const int id=cellid+stackid*10000;
87  const G4VPhysicalVolume *pv=theElectrodes.GetPhysicalVolume(id);
88  if (!pv){
89  l = 0.;
90  } else {
91  const G4LogicalVolume* lv = pv->GetLogicalVolume();
92  const G4Trap* trap = (G4Trap*) lv->GetSolid();
93  const G4VPhysicalVolume *pv2=theElectrodes.GetPhysicalVolume(1000000+id);
94  if (!pv2){
95  l = trap->GetYHalfLength1();
96  } else {
97  const G4LogicalVolume* lv2 = pv2->GetLogicalVolume();
98  const G4Trap* trap2 = (G4Trap*) lv2->GetSolid();
99  l = trap->GetYHalfLength1()+trap2->GetYHalfLength1();
100  }
101  }
102  m_halflength[cellid][stackid] = l;
103 }

◆ initXYCentEle()

void LArStraightElectrodes::initXYCentEle ( const PhysicalVolumeAccessor theElectrodes,
int  stackid,
int  cellid 
)
private

Definition at line 40 of file LArStraightElectrodes.cxx.

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

◆ Sinu()

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

Definition at line 30 of file LArStraightElectrodes.h.

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

◆ SlantEle()

double LArStraightElectrodes::SlantEle ( const PhysicalVolumeAccessor theElectrodes,
int  stackid,
int  cellid 
) const
private

Definition at line 70 of file LArStraightElectrodes.cxx.

71 {
72  const int id=cellid+stackid*10000;
73  const G4VPhysicalVolume *pv=theElectrodes.GetPhysicalVolume(id);
74  if (!pv) return 0.;
75  const G4RotationMatrix *rm=pv->GetRotation();
76  double Slant = (stackid%2 ==m_parity) ? 180*CLHEP::deg-(rm->thetaY()):(rm->thetaY())-180*CLHEP::deg;
77  if((stackid%2 == m_parity) && (rm->phiY() > 0)) Slant = 360.*CLHEP::deg - Slant;
78  if((stackid%2 == (1-m_parity)) && (rm->phiY() < 0)) Slant = - Slant;
79  return Slant;
80 }

◆ XCentEle()

double LArStraightElectrodes::XCentEle ( int  stackid,
int  cellid 
) const
inline

Definition at line 26 of file LArStraightElectrodes.h.

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

◆ YCentEle()

double LArStraightElectrodes::YCentEle ( int  stackid,
int  cellid 
) const
inline

Definition at line 27 of file LArStraightElectrodes.h.

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

Member Data Documentation

◆ m_cosu

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

Definition at line 19 of file LArStraightElectrodes.h.

◆ m_halflength

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

Definition at line 21 of file LArStraightElectrodes.h.

◆ m_parity

int LArStraightElectrodes::m_parity
private

Definition at line 22 of file LArStraightElectrodes.h.

◆ m_sinu

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

Definition at line 20 of file LArStraightElectrodes.h.

◆ m_xcent

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

Definition at line 17 of file LArStraightElectrodes.h.

◆ m_ycent

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

Definition at line 18 of file LArStraightElectrodes.h.


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