--- PamCut/CaloCuts/CaloNotIntCut/CaloNotIntCut.cpp 2009/05/27 13:30:09 1.1 +++ PamCut/CaloCuts/CaloNotIntCut/CaloNotIntCut.cpp 2009/11/24 14:42:31 1.4 @@ -10,26 +10,38 @@ int CaloNotIntCut::Check(PamLevel2 *event) { - if ( (!(_xCaloAxis) || !(_yCaloAxis)) && !(_trkTrack) ) { // check that one of the two possible initializations has been correctly done + if ( (!(_xCaloAxis) || !(_yCaloAxis)) && !(_pamTrack) ) { // check that one of the two possible initializations has been correctly done return 0; } - if (!(_trkTrack)) { // CALO track + 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; + } + } } - if (_trkTrack) { // TRK track - - return 2; // temporary - // Implement here the check using the tracker track. + if (_pamTrack) { // PAMELA track + + Double_t qtot = event->GetCaloLevel2()->qtot; + if ( qtot>0 ) { + + Double_t qratio = ( (*_pamTrack)->GetCaloTrack()->qtrack ) / qtot; + + if (! (qratio > _qRatioMin) ) { + return 2; + } + + } }