ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CexmcChargeExchangeReconstructorMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CexmcChargeExchangeReconstructorMessenger.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: CexmcChargeExchangeReconstructorMessenger.cc
30  *
31  * Description: charge exchange reconstructor messenger
32  *
33  * Version: 1.0
34  * Created: 14.12.2009 17:53:33
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>
49 #include "CexmcMessenger.hh"
50 
51 
54  CexmcChargeExchangeReconstructor * reconstructor_ ) :
55  reconstructor( reconstructor_ ), useTableMass( NULL ),
56  useMassCut( NULL ), mCutOPCenter( NULL ), mCutNOPCenter( NULL ),
57  mCutOPWidth( NULL ), mCutNOPWidth( NULL ), mCutAngle( NULL ),
58  useAbsorbedEnergyCut( NULL ), aeCutCLCenter( NULL ),
59  aeCutCRCenter( NULL ), aeCutCLWidth( NULL ), aeCutCRWidth( NULL ),
60  aeCutAngle( NULL ), setExpectedMomentumAmp( NULL ),
61  setExpectedMomentumAmpDiff( NULL ), setEDCollectionAlgorithm( NULL )
62 {
64  ( CexmcMessenger::reconstructorDirName + "useTableMass" ).c_str(),
65  this );
66  useTableMass->SetGuidance( "\n If true then reconstructor will use "
67  "table mass of output\n particle when building output particle "
68  "energy,\n otherwise reconstructed mass will be used" );
69  useTableMass->SetParameterName( "UseTableMass", true );
72 
74  ( CexmcMessenger::reconstructorDirName + "useMassCut" ).c_str(), this );
75  useMassCut->SetGuidance( "\n Use elliptical cut for masses of output "
76  "particle\n and nucleus output particle" );
77  useMassCut->SetParameterName( "UseMassCut", true );
78  useMassCut->SetDefaultValue( true );
80 
82  ( CexmcMessenger::reconstructorDirName + "mCutOPCenter" ).c_str(),
83  this );
84  mCutOPCenter->SetGuidance( "\n Center of the ellipse in output particle "
85  "mass coordinate" );
86  mCutOPCenter->SetParameterName( "MCutOPCenter", false );
88  outputParticle->GetPDGMass() );
89  mCutOPCenter->SetUnitCandidates( "eV keV MeV GeV" );
90  mCutOPCenter->SetDefaultUnit( "MeV" );
92 
94  ( CexmcMessenger::reconstructorDirName + "mCutNOPCenter" ).c_str(),
95  this );
96  mCutNOPCenter->SetGuidance( "\n Center of the ellipse in nucleus output "
97  "particle mass\n coordinate" );
98  mCutNOPCenter->SetParameterName( "MCutNOPCenter", false );
100  nucleusOutputParticle->GetPDGMass() );
101  mCutNOPCenter->SetUnitCandidates( "eV keV MeV GeV" );
102  mCutNOPCenter->SetDefaultUnit( "MeV" );
104 
106  ( CexmcMessenger::reconstructorDirName + "mCutOPWidth" ).c_str(),
107  this );
108  mCutOPWidth->SetGuidance( "\n Width of the ellipse in output particle "
109  "mass coordinate" );
110  mCutOPWidth->SetParameterName( "MCutOPWidth", false );
112  outputParticle->GetPDGMass() * 0.1 );
113  mCutOPWidth->SetUnitCandidates( "eV keV MeV GeV" );
114  mCutOPWidth->SetDefaultUnit( "MeV" );
116 
118  ( CexmcMessenger::reconstructorDirName + "mCutNOPWidth" ).c_str(),
119  this );
120  mCutNOPWidth->SetGuidance( "\n Width of the ellipse in nucleus output "
121  "particle mass\n coordinate" );
122  mCutNOPWidth->SetParameterName( "MCutNOPWidth", false );
124  nucleusOutputParticle->GetPDGMass() * 0.1 );
125  mCutNOPWidth->SetUnitCandidates( "eV keV MeV GeV" );
126  mCutNOPWidth->SetDefaultUnit( "MeV" );
128 
130  ( CexmcMessenger::reconstructorDirName + "mCutAngle" ).c_str(),
131  this );
132  mCutAngle->SetGuidance( "\n Angle of the ellipse" );
133  mCutAngle->SetParameterName( "MCutAngle", false );
135  mCutAngle->SetUnitCandidates( "deg rad" );
136  mCutAngle->SetDefaultUnit( "deg" );
138 
140  ( CexmcMessenger::reconstructorDirName + "useAbsorbedEnergyCut" ).
141  c_str(), this );
142  useAbsorbedEnergyCut->SetGuidance( "\n Use elliptical cut for absorbed "
143  "energies in\n calorimeters" );
144  useAbsorbedEnergyCut->SetParameterName( "UseAbsorbedEnergyCut", true );
147 
149  ( CexmcMessenger::reconstructorDirName + "aeCutCLCenter" ).c_str(),
150  this );
151  aeCutCLCenter->SetGuidance( "\n Center of the ellipse in left "
152  "calorimeter\n absorbed energy coordinate" );
153  aeCutCLCenter->SetParameterName( "AECutCLCenter", false );
155  aeCutCLCenter->SetUnitCandidates( "eV keV MeV GeV" );
156  aeCutCLCenter->SetDefaultUnit( "MeV" );
158 
160  ( CexmcMessenger::reconstructorDirName + "aeCutCRCenter" ).c_str(),
161  this );
162  aeCutCRCenter->SetGuidance( "\n Center of the ellipse in right "
163  "calorimeter\n absorbed energy coordinate" );
164  aeCutCRCenter->SetParameterName( "AECutCRCenter", false );
166  aeCutCRCenter->SetUnitCandidates( "eV keV MeV GeV" );
167  aeCutCRCenter->SetDefaultUnit( "MeV" );
169 
171  ( CexmcMessenger::reconstructorDirName + "aeCutCLWidth" ).c_str(),
172  this );
173  aeCutCLWidth->SetGuidance( "\n Width of the ellipse in left calorimeter"
174  "\n absorbed energy coordinate" );
175  aeCutCLWidth->SetParameterName( "AECutCLWidth", false );
177  aeCutCLWidth->SetUnitCandidates( "eV keV MeV GeV" );
178  aeCutCLWidth->SetDefaultUnit( "MeV" );
180 
182  ( CexmcMessenger::reconstructorDirName + "aeCutCRWidth" ).c_str(),
183  this );
184  aeCutCRWidth->SetGuidance( "\n Width of the ellipse in right calorimeter"
185  "\n absorbed energy coordinate" );
186  aeCutCRWidth->SetParameterName( "AECutCRWidth", false );
188  aeCutCRWidth->SetUnitCandidates( "eV keV MeV GeV" );
189  aeCutCRWidth->SetDefaultUnit( "MeV" );
191 
193  ( CexmcMessenger::reconstructorDirName + "aeCutAngle" ).c_str(),
194  this );
195  aeCutAngle->SetGuidance( "\n Angle of the ellipse" );
196  aeCutAngle->SetParameterName( "AECutAngle", false );
198  aeCutAngle->SetUnitCandidates( "deg rad" );
199  aeCutAngle->SetDefaultUnit( "deg" );
201 
203  ( CexmcMessenger::reconstructorDirName + "momentumAmp" ).c_str(),
204  this );
205  setExpectedMomentumAmp->SetGuidance( "\n Momentum of a beam particle "
206  "expected in the target;\n this value may differ from original "
207  "momentum\n of the beam as far as profile data of the beam refer\n"
208  " to the place where it starts. This parameter is used only\n"
209  " in reconstruction procedure");
210  setExpectedMomentumAmp->SetParameterName( "RecMomentumAmp", false );
211  setExpectedMomentumAmp->SetRange( "RecMomentumAmp > 0" );
212  setExpectedMomentumAmp->SetUnitCandidates( "eV keV MeV GeV" );
215 
217  ( CexmcMessenger::reconstructorDirName + "momentumAmpDiff" ).c_str(),
218  this );
219  setExpectedMomentumAmpDiff->SetGuidance( "\n Expected difference "
220  "between momenta of the beam\n on its start and in the target. This "
221  "parameter can\n be used to automatically calculate value of the\n"
222  " previous parameter 'momentumAmp'" );
223  setExpectedMomentumAmpDiff->SetParameterName( "RecMomentumAmpDiff", false );
225  setExpectedMomentumAmpDiff->SetUnitCandidates( "eV keV MeV GeV" );
228  G4State_Idle );
229 
231  ( CexmcMessenger::reconstructorDirName + "edCollectionAlgo" ).c_str(),
232  this );
234  "\n Choose crystals to be selected when energy deposit collected\n"
235  " all - all,\n"
236  " adjacent - crystal with maximum energy deposit and\n"
237  " adjacent crystals" );
238  setEDCollectionAlgorithm->SetParameterName( "EDCollectionAlgo", false );
239  setEDCollectionAlgorithm->SetCandidates( "all adjacent" );
242  G4State_Idle );
243 }
244 
245 
248 {
249  delete useTableMass;
250  delete useMassCut;
251  delete mCutOPCenter;
252  delete mCutNOPCenter;
253  delete mCutOPWidth;
254  delete mCutNOPWidth;
255  delete mCutAngle;
256  delete useAbsorbedEnergyCut;
257  delete aeCutCLCenter;
258  delete aeCutCRCenter;
259  delete aeCutCLWidth;
260  delete aeCutCRWidth;
261  delete aeCutAngle;
262  delete setExpectedMomentumAmp;
265 }
266 
267 
269  G4UIcommand * cmd, G4String value )
270 {
271  do
272  {
273  if ( cmd == useTableMass )
274  {
277  break;
278  }
279  if ( cmd == useMassCut )
280  {
283  break;
284  }
285  if ( cmd == mCutOPCenter )
286  {
289  break;
290  }
291  if ( cmd == mCutNOPCenter )
292  {
295  break;
296  }
297  if ( cmd == mCutOPWidth )
298  {
301  break;
302  }
303  if ( cmd == mCutNOPWidth )
304  {
307  break;
308  }
309  if ( cmd == mCutAngle )
310  {
313  break;
314  }
315  if ( cmd == useAbsorbedEnergyCut )
316  {
319  break;
320  }
321  if ( cmd == aeCutCLCenter )
322  {
325  break;
326  }
327  if ( cmd == aeCutCRCenter )
328  {
331  break;
332  }
333  if ( cmd == aeCutCLWidth )
334  {
337  break;
338  }
339  if ( cmd == aeCutCRWidth )
340  {
343  break;
344  }
345  if ( cmd == aeCutAngle )
346  {
349  break;
350  }
351  if ( cmd == setExpectedMomentumAmp )
352  {
355  break;
356  }
357  if ( cmd == setExpectedMomentumAmpDiff )
358  {
361  break;
362  }
363  if ( cmd == setEDCollectionAlgorithm )
364  {
366  edCollectionAlgorithm( CexmcCollectEDInAllCrystals );
367  do
368  {
369  if ( value == "adjacent" )
370  {
371  edCollectionAlgorithm = CexmcCollectEDInAdjacentCrystals;
372  break;
373  }
374  } while ( false );
375  reconstructor->SetEDCollectionAlgorithm( edCollectionAlgorithm );
376  break;
377  }
378  } while ( false );
379 }
380