EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BuildByName.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BuildByName.cxx
1 #include "eicsmeardetectors.hh"
2 
3 Smear::Detector BuildByName (std::string dname){
4  // transform to upper case
5  for (auto & c: dname) c = toupper(static_cast<unsigned char>(c));
6 
7  // -- Online, OFFICIAL, matrix from https://physdiv.jlab.org/DetectorMatrix
8  // From November 21, 2020
9  if ( dname == "MATRIXDETECTOR_0_2_B1_5T" ||
10  dname == "MATRIX_0_2_B1_5T" ||
11  dname == "MATRIX02B15" ) return BuildMatrixDetector_0_2_B1_5T();
12 
13  if ( dname == "MATRIXDETECTOR_0_2_B3T" ||
14  dname == "MATRIX_0_2_B3T" ||
15  dname == "MATRIX02B3" ) return BuildMatrixDetector_0_2_B3T();
16 
17  // -- Online, OFFICIAL, original matrix from https://physdiv.jlab.org/DetectorMatrix
18  // From June 16 2020
19  if ( dname == "MATRIXDETECTOR_0_1" ||
20  dname == "MATRIX_0_1" ||
21  dname == "MATRIX01" ) return BuildMatrixDetector_0_1();
22 
23  // -- Handbook matrix from http://www.eicug.org/web/sites/default/files/EIC_HANDBOOK_v1.2.pdf
24  if ( dname == "HANDBOOK_1_2" ||
25  dname == "HANDBOOK" ) return BuildHandBook_1_2();
26 
27  // -- Perfect detection and PID in |eta|<15
28  if ( dname == "PERFECTDETECTOR" ||
29  dname == "PERFECT" ) return BuildPerfectDetector();
30 
31  // EXPERIMENTAL
32  // if ( dname == "MATRIXTOF" ) return BuildMatrixDetector_0_1_TOF();
33 
34  if ( dname == "CORE_0_1_B3" ||
35  dname == "COREB3" ) return BuildCore_0_1_B3T();
36 
37  if ( dname == "TRACKINGPREVIEW_0_2_B1_5T" ||
38  dname == "TRACKING_0_2_B1_5T" ||
39  dname == "TRACKING02B15" ) return BuildTrackingPreview_0_2_B1_5T();
40 
41  if ( dname == "TRACKINGPREVIEW_0_2_B3T" ||
42  dname == "TRACKING_0_2_B3" ||
43  dname == "TRACKING02B3" ) return BuildTrackingPreview_0_2_B3T();
44 
45 
46 
47  // -- Inofficial detector scripts
48  // ---- BeAST
49  if ( dname == "BEAST_0_1" ||
50  dname == "BEAST" ) return BuildBeAST_0_1();
51  // ---- Jleic
52  if ( dname == "JLEIC_0_1" ||
53  dname == "JLEIC" ) return BuildJLEIC_0_1();
54  // -- Older legacy detector scripts; may require adding
55  // det.SetLegacyMode(true);
56  // ---- BeAST
57  if ( dname == "BEAST_0_0" ||
58  dname == "BEAST" ) return BuildBeAST_0_1();
59  // ---- ZEUS
60  if ( dname == "ZEUS_0_0" ||
61  dname == "ZEUS" ) return BuildZEUS_0_0();
62  // eSTAR
63  if ( dname == "ESTAR_0_0" ||
64  dname == "ESTAR" ) return BuildeSTAR_0_0();
65  // STAR
66  if ( dname == "STAR_0_0" ||
67  dname == "STAR" ) return BuildSTAR_0_0();
68 
69  // Note that BuildePHENIX(bool) appears again below
70  if ( dname == "EPHENIX_0_0" ||
71  dname == "EPHENIX" ) return BuildePHENIX_0_0();
72 
73  std::cerr << "Detector sepcified as " << dname
74  << " not recognized or empty." << std::endl;
75  throw;
76  return Smear::Detector();
77 };
78 
82 Smear::Detector BuildByName ( std::string dname, const int i){
83  // transform to upper case
84  for (auto & c: dname) c = toupper(static_cast<unsigned char>(c));
85 
86 
87  std::cerr << "Detector sepcified as " << dname
88  << " not recognized or empty." << std::endl;
89  throw;
90  return Smear::Detector();
91 };
92 
96 Smear::Detector BuildByName ( std::string dname, const double d){
97  // transform to upper case
98  for (auto & c: dname) c = toupper(static_cast<unsigned char>(c));
99 
100  // -- d is the B field for tracking
101  if ( dname == "CORE_0_1" ||
102  dname == "CORE" ) return BuildCore_0_1( d );
103 
104  // -- UNOFFICIAL addition of far forward detectors to the matrix
105  // integer i is beam_mom_nn
106  if ( dname == "MATRIXDETECTOR_0_1_FF" ||
107  dname == "MATRIX_0_1_FF" ||
108  dname == "MATRIXFF" ) return BuildMatrixDetector_0_1_FF( int(d) );
109 
110  // b is a boolean for multipleScattering
111  if ( dname == "EPHENIX_0_0" ||
112  dname == "EPHENIX" ) return BuildePHENIX_0_0( bool(d) );
113 
114  std::cerr << "Detector sepcified as " << dname
115  << " not recognized or empty." << std::endl;
116 
117  throw;
118  return Smear::Detector();
119 };
120 
121 
122