/* * DataQualCut.cpp * * Created on: 10-mar-2009 * Author: S. Ricciarini */ /*! @file DataQualCut.cpp The DataQualCut class implementation file */ #include "DataQualCut.h" int DataQualCut::Check(PamLevel2 *event){ // ++++++++++ TRK ++++++++++ if ((_cutMask & TRK) == TRK) { if (event->GetTrkLevel2()) { for (Int_t i=0; i<12; i++) { // check done for each DSP if (!event->GetTrkLevel2()->StatusCheck(i,0x12)) { // decode error OR CRC error //cout << "TRK" << endl; return TRK; } } } else { //cout << "TRK" << endl; return TRK; } } // ++++++++++ CALO LEVEL 2++++++++++ if ((_cutMask & CALO) == CALO) { if (event->GetCaloLevel2()) { if (!event->GetCaloLevel2()->IsGood(true)) { //cout << "CALO good" << endl; return CALO; } } else { //cout << "CALO get" << endl; return CALO; } } // ++++++++++ CALO LEVEL 1++++++++++ if ((_cutMask & CALO_L1) == CALO_L1) { if (! (event->GetCaloLevel1() ) ) { //cout << "CALO_L1" << endl; return CALO; } } // ++++++++++ TOF ++++++++++ if ((_cutMask & TOF) == TOF) { if (event->GetToFLevel2()) { if (event->GetToFLevel2()->unpackError) { // "unpackerror" here means "unpackerror !=0" //cout << "TOF" << endl; return TOF; } } else { //cout << "TOF" << endl; return TOF; } } // ++++++++++ ANT ++++++++++ if ((_cutMask & ANT) == ANT) { if (event->GetAcLevel2()) { if (event->GetAcLevel2()->unpackError || ((event->GetAcLevel2()->status[0] >> 2) & 1) || ((event->GetAcLevel2()->status[1] >> 2) & 1)) { //cout << "ANT" << endl; return ANT; } } else { //cout << "ANT" << endl; return ANT; } } // ++++++++++ TRG ++++++++++ if ((_cutMask & TRG) == TRG) { if (event->GetTrigLevel2()) { if (event->GetTrigLevel2()->unpackError) { //cout << "TRG" << endl; return TRG; } } else { //cout << "TRG" << endl; return TRG; } } // ++++++++++ ND ++++++++++ if ((_cutMask & ND) == ND) { if (event->GetNDLevel2()) { if (event->GetNDLevel2()->unpackError) { //cout << "ND" << endl; return ND; } } else { //cout << "ND" << endl; return ND; } } // ++++++++++ ORB ++++++++++ if ((_cutMask & ORB) == ORB) { if (!event->GetOrbitalInfo()) { //cout << "ORB" << endl; return ORB; } } return CUTOK; }