Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CexmcEnergyDepositDigitizer.hh
Go to the documentation of this file.
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: CexmcEnergyDepositDigitizer.hh
30  *
31  * Description: digitizes of energy deposit in a single event
32  *
33  * Version: 1.0
34  * Created: 23.11.2009 14:14:47
35  * Revision: none
36  * Compiler: gcc
37  *
38  * Author: Alexey Radkov (),
39  * Company: PNPI
40  *
41  * =============================================================================
42  */
43 
44 #ifndef CEXMC_ENERGY_DEPOSIT_DIGITIZER_HH
45 #define CEXMC_ENERGY_DEPOSIT_DIGITIZER_HH
46 
47 #include <iosfwd>
48 #include <G4VDigitizerModule.hh>
49 #include <G4SystemOfUnits.hh>
52 #include "CexmcException.hh"
53 #include "CexmcCommon.hh"
54 
55 class G4String;
57 
58 
60 {
61  public:
62  explicit CexmcEnergyDepositDigitizer( const G4String & name );
63 
65 
66  public:
67  void Digitize( void );
68 
69  public:
70  G4double GetMonitorED( void ) const;
71 
72  G4double GetVetoCounterEDLeft( void ) const;
73 
74  G4double GetVetoCounterEDRight( void ) const;
75 
76  G4double GetCalorimeterEDLeft( void ) const;
77 
78  G4double GetCalorimeterEDRight( void ) const;
79 
80  G4int GetCalorimeterEDLeftMaxX( void ) const;
81 
82  G4int GetCalorimeterEDLeftMaxY( void ) const;
83 
84  G4int GetCalorimeterEDRightMaxX( void ) const;
85 
86  G4int GetCalorimeterEDRightMaxY( void ) const;
87 
89  GetCalorimeterEDLeftCollection( void ) const;
90 
92  GetCalorimeterEDRightCollection( void ) const;
93 
94  public:
95  G4bool MonitorHasTriggered( void ) const;
96 
97  G4bool HasTriggered( void ) const;
98 
99  public:
101  G4bool fromMessenger = true );
102 
104  G4bool fromMessenger = true );
105 
107  G4bool fromMessenger = true );
108 
109  void SetVetoCountersThreshold( G4double value );
110 
112  G4bool fromMessenger = true );
113 
115  G4bool fromMessenger = true );
116 
117  void SetCalorimetersThreshold( G4double value );
118 
121  G4bool fromMessenger = true );
122 
125  G4bool fromMessenger = true );
126 
128  G4bool fromMessenger = true );
129 
131  G4bool fromMessenger = true );
132 
133  void AddCrystalResolutionRange( G4double bottom, G4double top,
134  G4double value,
135  G4bool fromMessenger = true );
136 
137  void ClearCrystalResolutionData( G4bool fromMessenger = true );
138 
141 
142  G4double GetMonitorThreshold( void ) const;
143 
145 
147 
149 
151 
153  GetCalorimeterTriggerAlgorithm( void ) const;
154 
156  GetOuterCrystalsVetoAlgorithm( void ) const;
157 
159 
161 
163  GetCrystalResolutionData( void ) const;
164 
165  public:
166  G4bool IsOuterCrystal( G4int column, G4int row ) const;
167 
168  private:
169  void InitializeData( void );
170 
171  private:
172  G4double monitorED;
173 
174  G4double vetoCounterEDLeft;
175 
176  G4double vetoCounterEDRight;
177 
178  CexmcEnergyDepositCalorimeterCollection calorimeterEDLeftCollection;
179 
180  CexmcEnergyDepositCalorimeterCollection calorimeterEDRightCollection;
181 
182  G4double calorimeterEDLeft;
183 
184  G4double calorimeterEDRight;
185 
186  G4int calorimeterEDLeftMaxX;
187 
188  G4int calorimeterEDLeftMaxY;
189 
190  G4int calorimeterEDRightMaxX;
191 
192  G4int calorimeterEDRightMaxY;
193 
194  G4bool monitorHasTriggered;
195 
196  G4bool hasTriggered;
197 
198  private:
199  G4double monitorEDThreshold;
200 
201  G4double vetoCounterEDLeftThreshold;
202 
203  G4double vetoCounterEDRightThreshold;
204 
205  G4double calorimeterEDLeftThreshold;
206 
207  G4double calorimeterEDRightThreshold;
208 
209  CexmcCalorimeterTriggerAlgorithm calorimeterTriggerAlgorithm;
210 
211  CexmcOuterCrystalsVetoAlgorithm outerCrystalsVetoAlgorithm;
212 
213  G4double outerCrystalsVetoFraction;
214 
215  G4double monitorEDThresholdRef;
216 
217  G4double vetoCounterEDLeftThresholdRef;
218 
219  G4double vetoCounterEDRightThresholdRef;
220 
221  G4double calorimeterEDLeftThresholdRef;
222 
223  G4double calorimeterEDRightThresholdRef;
224 
225  CexmcCalorimeterTriggerAlgorithm calorimeterTriggerAlgorithmRef;
226 
227  CexmcOuterCrystalsVetoAlgorithm outerCrystalsVetoAlgorithmRef;
228 
229  G4double outerCrystalsVetoFractionRef;
230 
231  private:
232  G4int nCrystalsInColumn;
233 
234  G4int nCrystalsInRow;
235 
236  private:
237  G4bool applyFiniteCrystalResolution;
238 
239  CexmcEnergyRangeWithDoubleValueList crystalResolutionData;
240 
241  private:
243 };
244 
245 
247 {
248  return monitorED;
249 }
250 
251 
253 {
254  return vetoCounterEDLeft;
255 }
256 
257 
259  const
260 {
261  return vetoCounterEDRight;
262 }
263 
264 
266 {
267  return calorimeterEDLeft;
268 }
269 
270 
272  const
273 {
274  return calorimeterEDRight;
275 }
276 
277 
279  const
280 {
281  return calorimeterEDLeftMaxX;
282 }
283 
284 
286  const
287 {
288  return calorimeterEDLeftMaxY;
289 }
290 
291 
293  const
294 {
295  return calorimeterEDRightMaxX;
296 }
297 
298 
300  const
301 {
302  return calorimeterEDRightMaxY;
303 }
304 
305 
308 {
309  return calorimeterEDLeftCollection;
310 }
311 
312 
315 {
316  return calorimeterEDRightCollection;
317 }
318 
319 
321 {
322  return monitorHasTriggered;
323 }
324 
325 
327 {
328  return hasTriggered;
329 }
330 
331 
333  G4double value, G4bool fromMessenger )
334 {
335  if ( fromMessenger )
337  value < monitorEDThresholdRef );
338  else
339  monitorEDThresholdRef = value;
340 
341  monitorEDThreshold = value;
342 }
343 
344 
346  G4double value, G4bool fromMessenger )
347 {
348  if ( fromMessenger )
350  value > vetoCounterEDLeftThresholdRef );
351  else
352  vetoCounterEDLeftThresholdRef = value;
353 
354  vetoCounterEDLeftThreshold = value;
355 }
356 
357 
359  G4double value, G4bool fromMessenger )
360 {
361  if ( fromMessenger )
363  value > vetoCounterEDRightThresholdRef );
364  else
365  vetoCounterEDRightThresholdRef = value;
366 
367  vetoCounterEDRightThreshold = value;
368 }
369 
370 
372  G4double value )
373 {
375  value > vetoCounterEDLeftThresholdRef ||
376  value > vetoCounterEDRightThresholdRef );
377 
378  vetoCounterEDLeftThreshold = value;
379  vetoCounterEDRightThreshold = value;
380 }
381 
382 
384  G4double value, G4bool fromMessenger )
385 {
386  if ( fromMessenger )
388  value < calorimeterEDLeftThresholdRef );
389  else
390  calorimeterEDLeftThresholdRef = value;
391 
392  calorimeterEDLeftThreshold = value;
393 }
394 
395 
397  G4double value, G4bool fromMessenger )
398 {
399  if ( fromMessenger )
401  value < calorimeterEDRightThresholdRef );
402  else
403  calorimeterEDRightThresholdRef = value;
404 
405  calorimeterEDRightThreshold = value;
406 }
407 
408 
410  G4double value )
411 {
413  value < calorimeterEDLeftThresholdRef ||
414  value < calorimeterEDRightThresholdRef );
415 
416  calorimeterEDLeftThreshold = value;
417  calorimeterEDRightThreshold = value;
418 }
419 
420 
423 {
424  if ( fromMessenger )
426  ! ( calorimeterTriggerAlgorithmRef ==
428  value == calorimeterTriggerAlgorithmRef ) );
429  else
430  calorimeterTriggerAlgorithmRef = value;
431 
432  calorimeterTriggerAlgorithm = value;
433 }
434 
435 
438 {
439  if ( fromMessenger )
441  ! ( outerCrystalsVetoAlgorithmRef == CexmcNoOuterCrystalsVeto ||
442  value == outerCrystalsVetoAlgorithmRef ) );
443  else
444  outerCrystalsVetoAlgorithmRef = value;
445 
446  outerCrystalsVetoAlgorithm = value;
447 }
448 
449 
451  G4double value, G4bool fromMessenger )
452 {
453  if ( fromMessenger )
455  value > outerCrystalsVetoFractionRef );
456  else
457  outerCrystalsVetoFractionRef = value;
458 
459  outerCrystalsVetoFraction = value;
460 }
461 
462 
464  G4bool value, G4bool fromMessenger )
465 {
466  if ( fromMessenger )
468 
469  applyFiniteCrystalResolution = value;
470 }
471 
472 
474  G4double bottom, G4double top,
475  G4double value, G4bool fromMessenger )
476 {
477  if ( fromMessenger )
479 
480  /* range boundaries are given in GeV */
481  crystalResolutionData.push_back( CexmcEnergyRangeWithDoubleValue(
482  bottom * GeV, top * GeV, value ) );
483 }
484 
485 
487  G4bool fromMessenger )
488 {
489  if ( fromMessenger )
491 
492  crystalResolutionData.clear();
493 }
494 
495 
498 {
500  crystalResolutionData = data;
501 }
502 
503 
505  G4int row ) const
506 {
507  return column == 0 || column == nCrystalsInRow - 1 ||
508  row == 0 || row == nCrystalsInColumn - 1;
509 }
510 
511 
513 {
514  return monitorEDThreshold;
515 }
516 
517 
519  void ) const
520 {
521  return vetoCounterEDLeftThreshold;
522 }
523 
524 
526  void ) const
527 {
528  return vetoCounterEDRightThreshold;
529 }
530 
531 
533  void ) const
534 {
535  return calorimeterEDLeftThreshold;
536 }
537 
538 
540  void ) const
541 {
542  return calorimeterEDRightThreshold;
543 }
544 
545 
548  void ) const
549 {
550  return calorimeterTriggerAlgorithm;
551 }
552 
553 
556  void ) const
557 {
558  return outerCrystalsVetoAlgorithm;
559 }
560 
561 
563  void ) const
564 {
565  return outerCrystalsVetoFraction;
566 }
567 
568 
570  void ) const
571 {
572  return applyFiniteCrystalResolution;
573 }
574 
575 
578 {
579  return crystalResolutionData;
580 }
581 
582 
583 std::ostream & operator<<( std::ostream & out,
584  const CexmcEnergyDepositCalorimeterCollection & edCollection );
585 
586 
587 #endif
588 
const XML_Char * name
Definition: expat.h:151
void SetOuterCrystalsVetoFraction(G4double value, G4bool fromMessenger=true)
void SetCalorimeterLeftThreshold(G4double value, G4bool fromMessenger=true)
CexmcEnergyDepositDigitizer(const G4String &name)
void SetOuterCrystalsVetoAlgorithm(CexmcOuterCrystalsVetoAlgorithm value, G4bool fromMessenger=true)
CexmcSimpleRangeWithValue< CexmcEnergyValueCategory > CexmcEnergyRangeWithDoubleValue
void ClearCrystalResolutionData(G4bool fromMessenger=true)
void SetCalorimeterRightThreshold(G4double value, G4bool fromMessenger=true)
void SetVetoCounterRightThreshold(G4double value, G4bool fromMessenger=true)
int G4int
Definition: G4Types.hh:78
CexmcOuterCrystalsVetoAlgorithm GetOuterCrystalsVetoAlgorithm(void) const
G4bool IsOuterCrystal(G4int column, G4int row) const
const XML_Char const XML_Char * data
Definition: expat.h:268
G4bool IsFiniteCrystalResolutionApplied(void) const
std::vector< CexmcEnergyDepositCrystalRowCollection > CexmcEnergyDepositCalorimeterCollection
Definition: CexmcCommon.hh:58
const XML_Char int const XML_Char * value
Definition: expat.h:331
void AddCrystalResolutionRange(G4double bottom, G4double top, G4double value, G4bool fromMessenger=true)
bool G4bool
Definition: G4Types.hh:79
void SetCrystalResolutionData(const CexmcEnergyRangeWithDoubleValueList &data)
const CexmcEnergyRangeWithDoubleValueList & GetCrystalResolutionData(void) const
CexmcCalorimeterTriggerAlgorithm GetCalorimeterTriggerAlgorithm(void) const
G4double GetCalorimeterRightThreshold(void) const
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
static constexpr double GeV
Definition: G4SIunits.hh:217
void ApplyFiniteCrystalResolution(G4bool value, G4bool fromMessenger=true)
const CexmcEnergyDepositCalorimeterCollection & GetCalorimeterEDRightCollection(void) const
CexmcOuterCrystalsVetoAlgorithm
Definition: CexmcCommon.hh:139
void SetCalorimeterTriggerAlgorithm(CexmcCalorimeterTriggerAlgorithm value, G4bool fromMessenger=true)
void SetVetoCounterLeftThreshold(G4double value, G4bool fromMessenger=true)
void ThrowExceptionIfProjectIsRead(CexmcExceptionType type, G4bool extraCond=true)
const CexmcEnergyDepositCalorimeterCollection & GetCalorimeterEDLeftCollection(void) const
double G4double
Definition: G4Types.hh:76
G4double GetVetoCounterLeftThreshold(void) const
G4double GetOuterCrystalsVetoFraction(void) const
G4double GetCalorimeterLeftThreshold(void) const
void SetMonitorThreshold(G4double value, G4bool fromMessenger=true)
CexmcCalorimeterTriggerAlgorithm
Definition: CexmcCommon.hh:147
std::vector< CexmcEnergyRangeWithDoubleValue > CexmcEnergyRangeWithDoubleValueList
G4double GetVetoCounterRightThreshold(void) const