ATLAS Offline Software
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 
8 const 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 
22 LArCoudes::LArCoudes(const std::string& strDetector)
23 {
24  // initialize singleton
25  theCoudes(strDetector);
26 }
27 
28 double 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 }
36 double 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.h
PhysicalVolumeAccessor
Definition: PhysicalVolumeAccessor.h:18
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
LArCoudes::YCentCoude
double YCentCoude(int stackid, int cellid) const
Definition: LArCoudes.cxx:36
PhysicalVolumeAccessor::SetPhysicalVolumeList
void SetPhysicalVolumeList(const std::string &)
Definition: PhysicalVolumeAccessor.cxx:53
PhysicalVolumeAccessor::GetPhysicalVolume
const G4VPhysicalVolume * GetPhysicalVolume(int) const
Definition: PhysicalVolumeAccessor.cxx:42
LArCoudes::XCentCoude
double XCentCoude(int stackid, int cellid) const
Definition: LArCoudes.cxx:28
python.changerun.pv
pv
Definition: changerun.py:81
LArCoudes::theCoudes
static const PhysicalVolumeAccessor & theCoudes(const std::string &strDetector="")
Definition: LArCoudes.cxx:8
LArCoudes::LArCoudes
LArCoudes(const std::string &strDetector="")
Definition: LArCoudes.cxx:22