--- PamCut/CaloCuts/CaloNotIntCut/CaloNotIntCut.cpp 2009/10/27 18:20:18 1.2 +++ PamCut/CaloCuts/CaloNotIntCut/CaloNotIntCut.cpp 2010/07/08 14:00:29 1.5 @@ -10,28 +10,45 @@ int CaloNotIntCut::Check(PamLevel2 *event) { +#ifndef NO_CALOAXIS if ( (!(_xCaloAxis) || !(_yCaloAxis)) && !(_pamTrack) ) { // check that one of the two possible initializations has been correctly done return 0; } - +#else + if ( !(_pamTrack) ) { // check that the initialization has been correctly done + return 0; + } +#endif /* NO_CALOAXIS */ + +#ifndef NO_CALOAXIS if (!(_pamTrack)) { // CALOAXIS track // energy released along the event axis in the calo / total energy release in the calo - float qratio = ( _xCaloAxis->GetQaxis() + _yCaloAxis->GetQaxis() ) / event->GetCaloLevel2()->qtot; + Double_t qtot = event->GetCaloLevel2()->qtot; + if ( qtot>0 ) { + + Double_t qratio = ( _xCaloAxis->GetQaxis() + _yCaloAxis->GetQaxis() ) / qtot; - if (! (qratio > _qRatioMin) ) { - return 1; - } + if (! (qratio > _qRatioMin) ) { + return 1; + } + } } +#endif /* NO_CALOAXIS */ if (_pamTrack) { // PAMELA track - float qratio = ( _pamTrack->GetCaloTrack()->qtrack ) / event->GetCaloLevel2()->qtot; + Double_t qtot = event->GetCaloLevel2()->qtot; + if ( qtot>0 ) { + + Double_t qratio = ( (*_pamTrack)->GetCaloTrack()->qtrack ) / qtot; - if (! (qratio > _qRatioMin) ) { - return 2; + if (! (qratio > _qRatioMin) ) { + return 2; + } + } }