PamCut: CaloCuts/CaloNucleiZCut/CaloNucleiZCut.cpp Source File

- Main Page
- Classes
- Files

- File List
- File Members

# CaloCuts/CaloNucleiZCut/CaloNucleiZCut.cpp

Go to the documentation of this file.

    00001 /*
    00002  * CaloNucleiZCut.cpp
    00003  *
    00004  *  Created on: 30-apr-2009
    00005  *      Author: Nicola Mori
    00006  */
    00007
    00010 #ifndef NO_CALONUCLEI
    00011
    00012 #include "CaloNucleiZCut.h"
    00013
    00014 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
    00015
    00016 int CaloNucleiZCut::Check(PamLevel2 *event) {
    00017
    00018   if (_Z < 1 || _Z > 8)
    00019     return CALONUCLEIZ_ILLEGALZ;
    00020
    00021   // Check if CaloNuclei has already been initialized
    00022   if (_caloNuclei == NULL)
    00023     _caloNuclei = new CaloNuclei(event);
    00024
    00025   // Obtain charge
    00026   Float_t charge;
    00027   switch (_method) {
    00028   case CALONUCLEIZ_SIEGEN:
    00029     charge = _caloNuclei->Get_charge_siegen1();
    00030     break;
    00031   case CALONUCLEIZ_DEDXBETA:
    00032     charge = _caloNuclei->Get_ZCalo_dedx_b();
    00033     break;
    00034   case CALONUCLEIZ_DEDXDEFL:
    00035     charge = _caloNuclei->Get_ZCalo_dedx_defl();
    00036     break;
    00037   }
    00038
    00039   // Check
    00040   if ((charge > _Z + _upperLimit * _sigmaZ[_Z - 1]) || (charge < _Z - _lowerLimit * _sigmaZ[_Z - 1])) {
    00041     return CALONUCLEIZ_OUTOFBOUNDS;
    00042   }
    00043
    00044   return CUTOK;
    00045
    00046 }
    00047
    00048 #endif /* NO_CALONUCLEI */