Belle II Software  release-05-01-25
FarBeamLineGeo.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Luka Santelj *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <framework/gearbox/GearDir.h>
12 #include <ir/dbobjects/FarBeamLineGeo.h>
13 
14 using namespace std;
15 using namespace Belle2;
16 
17 void FarBeamLineGeo::initialize(const GearDir& content)
18 {
19  //------------------------------
20  // Get FarBeamLine geometry parameters from the gearbox
21  //------------------------------
22 
23  addParameter("LimitStepLength", content.getInt("LimitStepLength"));
24 
25  std::vector<std::string> names = {"TubeR", "TubeL", "GateShield", "PolyShieldR", "PolyShieldL", "ConcreteShieldR", "ConcreteShieldL"};
26 
27  for (auto name : names) {
28  GearDir sect(content, name + "/");
29  addParameters(sect, name);
30  }
31 
32  std::string straightSections;
33  for (const GearDir& straight : content.getNodes("Straight")) {
34  std::string name = straight.getString("@name");
35  addParameters(straight, name);
36  if (!straightSections.empty()) straightSections += " ";
37  straightSections += name;
38  }
39  addParameter("Straight", straightSections);
40 
41  std::string bendingSections;
42  for (const GearDir& bend : content.getNodes("Bending")) {
43  std::string name = bend.getString("@name");
44  addParameters(bend, name);
45  if (!bendingSections.empty()) bendingSections += " ";
46  bendingSections += name;
47  }
48  addParameter("Bending", bendingSections);
49 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::GearDir
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:41