ATLAS Offline Software
Loading...
Searching...
No Matches
LArCoudes.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "LArCoudes.h"
6
7
8const PhysicalVolumeAccessor& LArCoudes::theCoudes(const std::string& strDetector)
9{
10 static const PhysicalVolumeAccessor pva = [&]() {
11 const std::string prefix = strDetector.empty() ? "" : strDetector+"::";
12 PhysicalVolumeAccessor pva(prefix+"LAr::EMB::STAC",
13 prefix+"LAr::EMB::Electrode::CornerDownFold");
14 pva.SetPhysicalVolumeList(prefix+"LAr::EMB::Electrode::CornerUpFold");
15 return pva;
16 }();
17
18 return pva;
19}
20
21
22LArCoudes::LArCoudes(const std::string& strDetector)
23{
24 // initialize singleton
25 theCoudes(strDetector);
26}
27
28double LArCoudes::XCentCoude(int stackid, int cellid) const
29{
30 const int id=cellid+stackid*10000;
31 const G4VPhysicalVolume *pv=theCoudes().GetPhysicalVolume(id);
32 if (!pv) std::abort();
33 const G4ThreeVector& tv=pv->GetTranslation();
34 return tv.x();
35}
36double LArCoudes::YCentCoude(int stackid, int cellid) const
37{
38 const int id=cellid+stackid*10000;
39 const G4VPhysicalVolume *pv=theCoudes().GetPhysicalVolume(id);
40 if (!pv) std::abort();
41 const G4ThreeVector& tv=pv->GetTranslation();
42 return tv.y();
43}
LArCoudes(const std::string &strDetector="")
Definition LArCoudes.cxx:22
static const PhysicalVolumeAccessor & theCoudes(const std::string &strDetector="")
Definition LArCoudes.cxx:8
double YCentCoude(int stackid, int cellid) const
Definition LArCoudes.cxx:36
double XCentCoude(int stackid, int cellid) const
Definition LArCoudes.cxx:28
void SetPhysicalVolumeList(const std::string &)
const G4VPhysicalVolume * GetPhysicalVolume(int) const