ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CexmcReconstructorMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CexmcReconstructorMessenger.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 /*
27  * ============================================================================
28  *
29  * Filename: CexmcReconstructorMessenger.cc
30  *
31  * Description: reconstructor messenger
32  *
33  * Version: 1.0
34  * Created: 02.12.2009 15:38:30
35  * Revision: none
36  * Compiler: gcc
37  *
38  * Author: Alexey Radkov (),
39  * Company: PNPI
40  *
41  * ============================================================================
42  */
43 
44 #include <G4UIcmdWithABool.hh>
45 #include <G4UIcmdWithAString.hh>
48 #include "CexmcReconstructor.hh"
49 #include "CexmcMessenger.hh"
50 #include "CexmcCommon.hh"
51 
52 
54  CexmcReconstructor * reconstructor_ ) :
55  reconstructor( reconstructor_ ),
56  setCalorimeterEntryPointDefinitionAlgorithm( NULL ),
57  setCrystalSelectionAlgorithm( NULL ), useInnerRefCrystal( NULL ),
58  setCalorimeterEntryPointDepth( NULL )
59 {
61  ( CexmcMessenger::reconstructorDirName + "entryPointDefinitionAlgo" ).
62  c_str(), this );
64  "\n Algorithm to reconstruct entry point of output particle"
65  "\n decay products in calorimeter"
66  "\n (none of the following algorithms reconstruct directions)\n"
67  " center - entry points defined in the center of the\n"
68  " calorimeters,\n"
69  " simple - entry points defined in the center of the crystal\n"
70  " that has maximum energy deposit value,\n"
71  " linear - entry points defined by linear weights of energy\n"
72  " deposit in crystals,\n"
73  " sqrt - entry points defined by square root weights of\n"
74  " energy deposit in crystals" );
76  "EntryPointDefinitionAlgo", false );
78  "center simple linear sqrt" );
82 
85  "entryPointDepthDefinitionAlgo" ).c_str(), this );
87  "\n Algorithm to reconstruct entry point depth of output\n"
88  " particle decay products in calorimeter\n"
89  " (value is defined by 'entryPointDepth' parameter)\n"
90  " plain - depth is a constant\n"
91  " sphere - depth depends on X and Y of calorimeter entry\n"
92  " points and locates on surface of a sphere\n"
93  " with origin in the center of the target;\n"
94  " radius of the sphere is sum of distance to\n"
95  " the calorimeter and 'entryPointDepth' value" );
97  "EntryPointDepthDefinitionAlgo", false );
99  "plain sphere" );
101  "plain" );
104 
106  ( CexmcMessenger::reconstructorDirName + "crystalSelectionAlgo" ).
107  c_str(), this );
109  "\n Choose crystals to be selected in weighted entry point\n"
110  " reconstruction algorithms\n"
111  " all - all,\n"
112  " adjacent - crystal with maximum energy deposit and\n"
113  " adjacent crystals" );
114  setCrystalSelectionAlgorithm->SetParameterName( "CrystalSelAlgo", false );
115  setCrystalSelectionAlgorithm->SetCandidates( "all adjacent" );
118  G4State_Idle );
119 
121  ( CexmcMessenger::reconstructorDirName + "useInnerRefCrystal" ).
122  c_str(), this );
124  "\n Defines that if the crystal with maximum energy deposit in\n"
125  " calorimeter is an outer crystal then the closest inner crystal\n"
126  " will be chosen as the reference for adjacent crystal selection\n"
127  " algorithm and simple entry point definition algorithm. It also\n"
128  " affects energy deposit collection if adjacent crystals\n"
129  " algorithm was chosen for that. If not set then the reference\n"
130  " crystal will be found from all crystals in calorimeter" );
131  useInnerRefCrystal->SetParameterName( "UseInnerRefCrystal", true );
134 
136  ( CexmcMessenger::reconstructorDirName + "entryPointDepth" ).c_str(),
137  this );
139  "\n Depth of entry point used in reconstruction of angle\n"
140  " between output particle decay products" );
141  setCalorimeterEntryPointDepth->SetParameterName( "EntryPointDepth", false );
146  G4State_Idle );
147 }
148 
149 
151 {
155  delete useInnerRefCrystal;
157 }
158 
159 
161  G4String value )
162 {
163  do
164  {
166  {
168  epDefinitionAlgorithm( CexmcEntryPointInTheCenter );
169  do
170  {
171  if ( value == "simple" )
172  {
173  epDefinitionAlgorithm =
175  break;
176  }
177  if ( value == "linear" )
178  {
179  epDefinitionAlgorithm = CexmcEntryPointByLinearEDWeights;
180  break;
181  }
182  if ( value == "sqrt" )
183  {
184  epDefinitionAlgorithm = CexmcEntryPointBySqrtEDWeights;
185  break;
186  }
187  } while ( false );
189  epDefinitionAlgorithm );
190  break;
191  }
193  {
195  epDepthDefinitionAlgorithm( CexmcEntryPointDepthPlain );
196  do
197  {
198  if ( value == "sphere" )
199  {
200  epDepthDefinitionAlgorithm = CexmcEntryPointDepthSphere;
201  break;
202  }
203  } while ( false );
205  epDepthDefinitionAlgorithm );
206  break;
207  }
208  if ( cmd == setCrystalSelectionAlgorithm )
209  {
211  csAlgorithm( CexmcSelectAllCrystals );
212  do
213  {
214  if ( value == "adjacent" )
215  {
216  csAlgorithm = CexmcSelectAdjacentCrystals;
217  break;
218  }
219  } while ( false );
221  break;
222  }
223  if ( cmd == useInnerRefCrystal )
224  {
227  break;
228  }
229  if ( cmd == setCalorimeterEntryPointDepth )
230  {
233  break;
234  }
235  } while ( false );
236 }
237