| 1 |
/* |
| 2 |
* CaloNucleiZCut.cpp |
| 3 |
* |
| 4 |
* Created on: 30-apr-2009 |
| 5 |
* Author: Nicola Mori |
| 6 |
*/ |
| 7 |
|
| 8 |
/*! @file CaloNucleiZCut.cpp The CaloNucleiZCut class implementation file */ |
| 9 |
|
| 10 |
#ifndef NO_CALONUCLEI |
| 11 |
|
| 12 |
#include "CaloNucleiZCut.h" |
| 13 |
|
| 14 |
const float CaloNucleiZCut::_sigmaZ[] = { 0.11, 0.14, 0.21, 0.28, 0.28, 0.31, 0.32, 0.32 }; // the charge-width in a layer for Z=1..8 |
| 15 |
|
| 16 |
int CaloNucleiZCut::Check(PamLevel2 *event) { |
| 17 |
|
| 18 |
if (_Z < 1 || _Z > 8) |
| 19 |
return CALONUCLEIZ_ILLEGALZ; |
| 20 |
|
| 21 |
// Check if CaloNuclei has already been initialized |
| 22 |
if (_caloNuclei == NULL) |
| 23 |
_caloNuclei = new CaloNuclei(event); |
| 24 |
|
| 25 |
// Obtain charge |
| 26 |
Float_t charge = 0.; |
| 27 |
switch (_method) { |
| 28 |
case CALONUCLEIZ_SIEGEN: |
| 29 |
charge = _caloNuclei->Get_charge_siegen1(); |
| 30 |
break; |
| 31 |
case CALONUCLEIZ_DEDXBETA: |
| 32 |
charge = _caloNuclei->Get_ZCalo_dedx_b(); |
| 33 |
break; |
| 34 |
case CALONUCLEIZ_DEDXDEFL: |
| 35 |
charge = _caloNuclei->Get_ZCalo_dedx_defl(); |
| 36 |
break; |
| 37 |
} |
| 38 |
|
| 39 |
// Check |
| 40 |
if ((charge > _Z + _upperLimit * _sigmaZ[_Z - 1]) || (charge < _Z - _lowerLimit * _sigmaZ[_Z - 1])) { |
| 41 |
return CALONUCLEIZ_OUTOFBOUNDS; |
| 42 |
} |
| 43 |
|
| 44 |
return CUTOK; |
| 45 |
|
| 46 |
} |
| 47 |
|
| 48 |
#endif /* NO_CALONUCLEI */ |