From 2dd55fbc7599c7357721257061daed287e42e055 Mon Sep 17 00:00:00 2001
From: David Emschermann <d.emschermann@gsi.de>
Date: Tue, 28 Apr 2020 17:18:39 +0200
Subject: [PATCH] Add electron and update hadron setup files for long STS, refs
 #1649

---
 setup/setup_sis100_electron_sts_long.C | 85 ++++++++++++++++++++++++++
 setup/setup_sis100_hadron_sts_long.C   |  2 +-
 2 files changed, 86 insertions(+), 1 deletion(-)
 create mode 100644 setup/setup_sis100_electron_sts_long.C

diff --git a/setup/setup_sis100_electron_sts_long.C b/setup/setup_sis100_electron_sts_long.C
new file mode 100644
index 0000000..70a4aa8
--- /dev/null
+++ b/setup/setup_sis100_electron_sts_long.C
@@ -0,0 +1,85 @@
+/** ROOT macro to define the CBM setup sis_100_electron
+ **
+ ** @author Volker Friese <v.friese@gsi.de>
+ ** @author David Emschermann <d.emschermann@gsi.de>
+ ** @date   5 February 2016
+ **
+ **/
+
+// 2020-04-28 - DE - Test setup for STS with 105mm pitch
+// 2020-04-23 - FU - Use exported TOF geometry v16d (same as v16c but
+//                   different file format
+// 2017-11-24 - VF - New default v16g for STS (unit-based)
+// 2017-11-20 - DE - use TRD v17n as new default
+// 2017-05-22 - DE - use TRD v17c as new default
+// 2016-06-27 - DE - use STS v16x as new default, see issue #647
+// 2016-05-19 - VF - Add platform module
+// 2016-02-25 - DE - use STS v16c as new default
+// 2016-02-05 - VF - Replaces former sis100_electron_setup.C,
+//                   now using the CbmSetup class.
+// 2016-01-29 - AL - Use RICH v16a_1e as new default
+// 2015-12-11 - DE - use STS v15c as new default
+// 2015-07-20 - FU - magnet v15a is v12b with correct keeping volume material
+// 2015-07-20 - FU - add material budget files
+// 2015-03-13 - DE - use STS v13y with correct ladder orientation as new default
+// 2015-01-28 - DE - use STS v13x fitting with with PIPE v14l
+// 2015-01-22 - DE - use MVD v14b with PIPE v14l as default
+// 2015-01-19 - DE - use TRD v15a as new default
+// 2014-07-05 - DE - use PIPE v14x as interim solution
+// 2014-07-01 - DE - use PIPE v14f -> overlap with STS
+// 2014-06-30 - DE - use PIPE v14d together with RICH v14a
+// 2014-06-30 - DE - make RICH v14a the new default
+// 2014-06-30 - DE - make TRD v14a the new default
+// 2014-06-25 - DE - define digi files through tags for STS, TRD and TOF
+// 2013-11-05 - DE - switch to trd_v13p geometry
+// 2013-10-11 - DE - add empty string defining the platform
+// 2013-10-07 - DE - pipe_v13d.geo fixes overlap with TOF
+// 2013-10-07 - DE - rich_v13a is not at nominal position 1800mm, but at 1600mm
+// 2013-11-04 - VF - make STS v15b the new default
+//
+
+
+void setup_sis100_electron_sts_long.C()
+{
+
+  // -----  Geometry Tags  --------------------------------------------------
+  TString magnetGeoTag    = "v18a";
+  TString pipeGeoTag      = "v16d_1e"; // "v16b_1e";
+  TString mvdGeoTag       = "v17b_tr"; // "v17a_tr";
+  TString stsGeoTag       = "v19i";    // "v19a";
+  TString richGeoTag      = "v17a_1e";
+  TString trdGeoTag       = "v17n_1e";
+  TString tofGeoTag       = "v16d_1e";
+  TString psdGeoTag       = "v18e";
+  TString platGeoTag      = "v13a";
+  // ------------------------------------------------------------------------
+
+
+  // -----  Magnetic field  -------------------------------------------------
+  TString fieldTag      = "v18a";
+  Double_t fieldZ       = 40.;            // field centre z position
+  Double_t fieldScale   =  1.;            // field scaling factor
+  // ------------------------------------------------------------------------
+
+
+  // -----  Create setup  ---------------------------------------------------
+  CbmSetup* setup = CbmSetup::Instance();
+  if ( ! setup->IsEmpty() ) {
+  	std::cout << "-W- setup_sis100_electron: overwriting existing setup"
+  			      << setup->GetTitle() << std::endl;
+  	setup->Clear();
+  }
+  setup->SetTitle("SIS100 - Electron Setup");
+  setup->SetModule(ECbmModuleId::kMagnet, magnetGeoTag);
+  setup->SetModule(ECbmModuleId::kPipe, pipeGeoTag);
+  setup->SetModule(ECbmModuleId::kMvd, mvdGeoTag);
+  setup->SetModule(ECbmModuleId::kSts, stsGeoTag);
+  setup->SetModule(ECbmModuleId::kRich, richGeoTag);
+  setup->SetModule(ECbmModuleId::kTrd, trdGeoTag);
+  setup->SetModule(ECbmModuleId::kTof, tofGeoTag);
+  setup->SetModule(ECbmModuleId::kPsd, psdGeoTag);
+  setup->SetModule(ECbmModuleId::kPlatform, platGeoTag);
+  setup->SetField(fieldTag, fieldScale, 0., 0., fieldZ);
+  // ------------------------------------------------------------------------
+
+}
diff --git a/setup/setup_sis100_hadron_sts_long.C b/setup/setup_sis100_hadron_sts_long.C
index 972d56b..deb92f8 100644
--- a/setup/setup_sis100_hadron_sts_long.C
+++ b/setup/setup_sis100_hadron_sts_long.C
@@ -40,7 +40,7 @@ void setup_sis100_hadron_sts_long()
   TString mvdGeoTag       = "v17b_tr"; // "v17a_tr";
   TString stsGeoTag       = "v19i";    // "v19a";
   TString trdGeoTag       = "v17n_1h";
-  TString tofGeoTag       = "v16c_1h";
+  TString tofGeoTag       = "v16d_1h";
   TString psdGeoTag       = "v18e";
   TString platGeoTag      = "v13a";
   // ------------------------------------------------------------------------
-- 
GitLab