Geant4_10
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 
50 #include <G4VDigitizerModule.hh>
53 #include "CexmcException.hh"
54 #include "CexmcCommon.hh"
55 
56 class G4String;
58 
59 
61 {
62  public:
63  explicit CexmcEnergyDepositDigitizer( const G4String & name );
64 
66 
67  public:
68  void Digitize( void );
69 
70  public:
71  G4double GetMonitorED( void ) const;
72 
73  G4double GetVetoCounterEDLeft( void ) const;
74 
75  G4double GetVetoCounterEDRight( void ) const;
76 
77  G4double GetCalorimeterEDLeft( void ) const;
78 
79  G4double GetCalorimeterEDRight( void ) const;
80 
81  G4int GetCalorimeterEDLeftMaxX( void ) const;
82 
83  G4int GetCalorimeterEDLeftMaxY( void ) const;
84 
85  G4int GetCalorimeterEDRightMaxX( void ) const;
86 
87  G4int GetCalorimeterEDRightMaxY( void ) const;
88 
90  GetCalorimeterEDLeftCollection( void ) const;
91 
93  GetCalorimeterEDRightCollection( void ) const;
94 
95  public:
96  G4bool MonitorHasTriggered( void ) const;
97 
98  G4bool HasTriggered( void ) const;
99 
100  public:
102  G4bool fromMessenger = true );
103 
105  G4bool fromMessenger = true );
106 
108  G4bool fromMessenger = true );
109 
110  void SetVetoCountersThreshold( G4double value );
111 
113  G4bool fromMessenger = true );
114 
116  G4bool fromMessenger = true );
117 
118  void SetCalorimetersThreshold( G4double value );
119 
122  G4bool fromMessenger = true );
123 
126  G4bool fromMessenger = true );
127 
129  G4bool fromMessenger = true );
130 
132  G4bool fromMessenger = true );
133 
134  void AddCrystalResolutionRange( G4double bottom, G4double top,
135  G4double value,
136  G4bool fromMessenger = true );
137 
138  void ClearCrystalResolutionData( G4bool fromMessenger = true );
139 
142 
143  G4double GetMonitorThreshold( void ) const;
144 
146 
148 
150 
152 
154  GetCalorimeterTriggerAlgorithm( void ) const;
155 
157  GetOuterCrystalsVetoAlgorithm( void ) const;
158 
160 
162 
164  GetCrystalResolutionData( void ) const;
165 
166  public:
167  G4bool IsOuterCrystal( G4int column, G4int row ) const;
168 
169  private:
170  void InitializeData( void );
171 
172  private:
173  G4double monitorED;
174 
175  G4double vetoCounterEDLeft;
176 
177  G4double vetoCounterEDRight;
178 
179  CexmcEnergyDepositCalorimeterCollection calorimeterEDLeftCollection;
180 
181  CexmcEnergyDepositCalorimeterCollection calorimeterEDRightCollection;
182 
183  G4double calorimeterEDLeft;
184 
185  G4double calorimeterEDRight;
186 
187  G4int calorimeterEDLeftMaxX;
188 
189  G4int calorimeterEDLeftMaxY;
190 
191  G4int calorimeterEDRightMaxX;
192 
193  G4int calorimeterEDRightMaxY;
194 
195  G4bool monitorHasTriggered;
196 
197  G4bool hasTriggered;
198 
199  private:
200  G4double monitorEDThreshold;
201 
202  G4double vetoCounterEDLeftThreshold;
203 
204  G4double vetoCounterEDRightThreshold;
205 
206  G4double calorimeterEDLeftThreshold;
207 
208  G4double calorimeterEDRightThreshold;
209 
210  CexmcCalorimeterTriggerAlgorithm calorimeterTriggerAlgorithm;
211 
212  CexmcOuterCrystalsVetoAlgorithm outerCrystalsVetoAlgorithm;
213 
214  G4double outerCrystalsVetoFraction;
215 
216  G4double monitorEDThresholdRef;
217 
218  G4double vetoCounterEDLeftThresholdRef;
219 
220  G4double vetoCounterEDRightThresholdRef;
221 
222  G4double calorimeterEDLeftThresholdRef;
223 
224  G4double calorimeterEDRightThresholdRef;
225 
226  CexmcCalorimeterTriggerAlgorithm calorimeterTriggerAlgorithmRef;
227 
228  CexmcOuterCrystalsVetoAlgorithm outerCrystalsVetoAlgorithmRef;
229 
230  G4double outerCrystalsVetoFractionRef;
231 
232  private:
233  G4int nCrystalsInColumn;
234 
235  G4int nCrystalsInRow;
236 
237  private:
238  G4bool applyFiniteCrystalResolution;
239 
240  CexmcEnergyRangeWithDoubleValueList crystalResolutionData;
241 
242  private:
244 };
245 
246 
248 {
249  return monitorED;
250 }
251 
252 
254 {
255  return vetoCounterEDLeft;
256 }
257 
258 
260  const
261 {
262  return vetoCounterEDRight;
263 }
264 
265 
267 {
268  return calorimeterEDLeft;
269 }
270 
271 
273  const
274 {
275  return calorimeterEDRight;
276 }
277 
278 
280  const
281 {
282  return calorimeterEDLeftMaxX;
283 }
284 
285 
287  const
288 {
289  return calorimeterEDLeftMaxY;
290 }
291 
292 
294  const
295 {
296  return calorimeterEDRightMaxX;
297 }
298 
299 
301  const
302 {
303  return calorimeterEDRightMaxY;
304 }
305 
306 
309 {
310  return calorimeterEDLeftCollection;
311 }
312 
313 
316 {
317  return calorimeterEDRightCollection;
318 }
319 
320 
322 {
323  return monitorHasTriggered;
324 }
325 
326 
328 {
329  return hasTriggered;
330 }
331 
332 
334  G4double value, G4bool fromMessenger )
335 {
336  if ( fromMessenger )
338  value < monitorEDThresholdRef );
339  else
340  monitorEDThresholdRef = value;
341 
342  monitorEDThreshold = value;
343 }
344 
345 
347  G4double value, G4bool fromMessenger )
348 {
349  if ( fromMessenger )
351  value > vetoCounterEDLeftThresholdRef );
352  else
353  vetoCounterEDLeftThresholdRef = value;
354 
355  vetoCounterEDLeftThreshold = value;
356 }
357 
358 
360  G4double value, G4bool fromMessenger )
361 {
362  if ( fromMessenger )
364  value > vetoCounterEDRightThresholdRef );
365  else
366  vetoCounterEDRightThresholdRef = value;
367 
368  vetoCounterEDRightThreshold = value;
369 }
370 
371 
373  G4double value )
374 {
376  value > vetoCounterEDLeftThresholdRef ||
377  value > vetoCounterEDRightThresholdRef );
378 
379  vetoCounterEDLeftThreshold = value;
380  vetoCounterEDRightThreshold = value;
381 }
382 
383 
385  G4double value, G4bool fromMessenger )
386 {
387  if ( fromMessenger )
389  value < calorimeterEDLeftThresholdRef );
390  else
391  calorimeterEDLeftThresholdRef = value;
392 
393  calorimeterEDLeftThreshold = value;
394 }
395 
396 
398  G4double value, G4bool fromMessenger )
399 {
400  if ( fromMessenger )
402  value < calorimeterEDRightThresholdRef );
403  else
404  calorimeterEDRightThresholdRef = value;
405 
406  calorimeterEDRightThreshold = value;
407 }
408 
409 
411  G4double value )
412 {
414  value < calorimeterEDLeftThresholdRef ||
415  value < calorimeterEDRightThresholdRef );
416 
417  calorimeterEDLeftThreshold = value;
418  calorimeterEDRightThreshold = value;
419 }
420 
421 
424 {
425  if ( fromMessenger )
427  ! ( calorimeterTriggerAlgorithmRef ==
429  value == calorimeterTriggerAlgorithmRef ) );
430  else
431  calorimeterTriggerAlgorithmRef = value;
432 
433  calorimeterTriggerAlgorithm = value;
434 }
435 
436 
439 {
440  if ( fromMessenger )
442  ! ( outerCrystalsVetoAlgorithmRef == CexmcNoOuterCrystalsVeto ||
443  value == outerCrystalsVetoAlgorithmRef ) );
444  else
445  outerCrystalsVetoAlgorithmRef = value;
446 
447  outerCrystalsVetoAlgorithm = value;
448 }
449 
450 
452  G4double value, G4bool fromMessenger )
453 {
454  if ( fromMessenger )
456  value > outerCrystalsVetoFractionRef );
457  else
458  outerCrystalsVetoFractionRef = value;
459 
460  outerCrystalsVetoFraction = value;
461 }
462 
463 
465  G4bool value, G4bool fromMessenger )
466 {
467  if ( fromMessenger )
469 
470  applyFiniteCrystalResolution = value;
471 }
472 
473 
475  G4double bottom, G4double top,
476  G4double value, G4bool fromMessenger )
477 {
478  if ( fromMessenger )
480 
481  /* range boundaries are given in GeV */
482  crystalResolutionData.push_back( CexmcEnergyRangeWithDoubleValue(
483  bottom * CLHEP::GeV, top * CLHEP::GeV, value ) );
484 }
485 
486 
488  G4bool fromMessenger )
489 {
490  if ( fromMessenger )
492 
493  crystalResolutionData.clear();
494 }
495 
496 
499 {
501  crystalResolutionData = data;
502 }
503 
504 
506  G4int row ) const
507 {
508  return column == 0 || column == nCrystalsInRow - 1 ||
509  row == 0 || row == nCrystalsInColumn - 1;
510 }
511 
512 
514 {
515  return monitorEDThreshold;
516 }
517 
518 
520  void ) const
521 {
522  return vetoCounterEDLeftThreshold;
523 }
524 
525 
527  void ) const
528 {
529  return vetoCounterEDRightThreshold;
530 }
531 
532 
534  void ) const
535 {
536  return calorimeterEDLeftThreshold;
537 }
538 
539 
541  void ) const
542 {
543  return calorimeterEDRightThreshold;
544 }
545 
546 
549  void ) const
550 {
551  return calorimeterTriggerAlgorithm;
552 }
553 
554 
557  void ) const
558 {
559  return outerCrystalsVetoAlgorithm;
560 }
561 
562 
564  void ) const
565 {
566  return outerCrystalsVetoFraction;
567 }
568 
569 
571  void ) const
572 {
573  return applyFiniteCrystalResolution;
574 }
575 
576 
579 {
580  return crystalResolutionData;
581 }
582 
583 
584 std::ostream & operator<<( std::ostream & out,
585  const CexmcEnergyDepositCalorimeterCollection & edCollection );
586 
587 
588 #endif
589 
void SetOuterCrystalsVetoFraction(G4double value, G4bool fromMessenger=true)
void SetCalorimeterLeftThreshold(G4double value, G4bool fromMessenger=true)
CexmcEnergyDepositDigitizer(const G4String &name)
const XML_Char * name
Definition: expat.h:151
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
G4bool IsFiniteCrystalResolutionApplied(void) const
std::vector< CexmcEnergyDepositCrystalRowCollection > CexmcEnergyDepositCalorimeterCollection
Definition: CexmcCommon.hh:58
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 > &)
void ApplyFiniteCrystalResolution(G4bool value, G4bool fromMessenger=true)
const CexmcEnergyDepositCalorimeterCollection & GetCalorimeterEDRightCollection(void) const
CexmcOuterCrystalsVetoAlgorithm
Definition: CexmcCommon.hh:138
const XML_Char int const XML_Char * value
Definition: expat.h:331
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:146
const XML_Char const XML_Char * data
Definition: expat.h:268
std::vector< CexmcEnergyRangeWithDoubleValue > CexmcEnergyRangeWithDoubleValueList
G4double GetVetoCounterRightThreshold(void) const