00001
00002
00003
00004
00005
00006
00007
00010 #include "DataQualCut.h"
00011
00012 int DataQualCut::Check(PamLevel2 *event){
00013
00014
00015
00016
00017 if ((_cutMask & TRK) == TRK) {
00018 if (event->GetTrkLevel2()) {
00019 for (Int_t i=0; i<12; i++) {
00020 if (!event->GetTrkLevel2()->StatusCheck(i,0x12)) {
00021 return TRK;
00022 }
00023 }
00024 }
00025 else {
00026 return TRK;
00027 }
00028 }
00029
00030
00031
00032 if ((_cutMask & CALO) == CALO) {
00033 if (event->GetCaloLevel2()) {
00034 if (!event->GetCaloLevel2()->IsGood(true)) {
00035 return CALO;
00036 }
00037 }
00038 else {
00039 return CALO;
00040 }
00041 }
00042
00043
00044
00045 if ((_cutMask & CALO_L1) == CALO_L1) {
00046 if (! (event->GetCaloLevel1() ) ) {
00047 return CALO;
00048 }
00049 }
00050
00051
00052 if ((_cutMask & TOF) == TOF) {
00053 if (event->GetToFLevel2()) {
00054 if (event->GetToFLevel2()->unpackError) {
00055 return TOF;
00056 }
00057 }
00058 else {
00059 return TOF;
00060 }
00061 }
00062
00063
00064
00065 if ((_cutMask & AC) == AC) {
00066 if (event->GetAcLevel2()) {
00067 if (event->GetAcLevel2()->unpackError || ((event->GetAcLevel2()->status[0] >> 2) & 1)
00068 || ((event->GetAcLevel2()->status[1] >> 2) & 1)) {
00069 return AC;
00070 }
00071 }
00072 else {
00073 return AC;
00074 }
00075 }
00076
00077
00078
00079 if ((_cutMask & TRIG) == TRIG) {
00080 if (event->GetTrigLevel2()) {
00081 if (event->GetTrigLevel2()->unpackError) {
00082 return TRIG;
00083 }
00084 }
00085 else {
00086 return TRIG;
00087 }
00088 }
00089
00090
00091
00092
00093 if ((_cutMask & ORB) == ORB) {
00094 if (!event->GetOrbitalInfo()) {
00095 return ORB;
00096 }
00097 }
00098
00099
00100
00101 return CUTOK;
00102 }