DataQualityLookup Class Reference

#include <DataQualityLookup.h>

List of all members.

Public Member Functions

 DataQualityLookup ()
 DataQualityLookup (const DataQualityLookup &rhs)
 ~DataQualityLookup ()
Int_t GetCoilStatus (VldContext vldc)
Int_t GetHvStatus (VldContext vldc)

Private Member Functions

Int_t GetFarDetCoilStatus (VldContext vldc, Int_t supermodule)
Int_t GetFarDetHvStatus (VldContext vldc, Int_t supermodule)

Private Attributes

Int_t * myBegVldCxtCoilSM1
Int_t * myEndVldCxtCoilSM1
Int_t * myCoilStatusSM1
Int_t * myBegVldCxtCoilSM2
Int_t * myEndVldCxtCoilSM2
Int_t * myCoilStatusSM2
Int_t * myBegVldCxtHvSM1
Int_t * myEndVldCxtHvSM1
Int_t * myHvStatusSM1
Int_t * myBegVldCxtHvSM2
Int_t * myEndVldCxtHvSM2
Int_t * myHvStatusSM2


Detailed Description

Definition at line 7 of file DataQualityLookup.h.


Constructor & Destructor Documentation

DataQualityLookup::DataQualityLookup (  ) 

Definition at line 19 of file DataQualityLookup.cxx.

References gSystem(), Msg::kVerbose, and MSG.

00020 {
00021   Int_t bin,ctr;
00022   Int_t begcxt,endcxt;
00023   Int_t status;
00024 
00025   myBegVldCxtCoilSM1 = new Int_t[1000];
00026   myEndVldCxtCoilSM1 = new Int_t[1000];
00027   myCoilStatusSM1 = new Int_t[1000];
00028 
00029   myBegVldCxtCoilSM2 = new Int_t[1000];
00030   myEndVldCxtCoilSM2 = new Int_t[1000];
00031   myCoilStatusSM2 = new Int_t[1000];
00032 
00033   myBegVldCxtHvSM1 = new Int_t[1000];
00034   myEndVldCxtHvSM1 = new Int_t[1000];
00035   myHvStatusSM1 = new Int_t[1000];
00036 
00037   myBegVldCxtHvSM2 = new Int_t[1000];
00038   myEndVldCxtHvSM2 = new Int_t[1000];
00039   myHvStatusSM2 = new Int_t[1000];
00040 
00041   for(bin=0;bin<1000;bin++){
00042     myBegVldCxtCoilSM1[bin]=-1;
00043     myEndVldCxtCoilSM1[bin]=-1;
00044     myCoilStatusSM1[bin]=-1;
00045 
00046     myBegVldCxtCoilSM2[bin]=-1;
00047     myEndVldCxtCoilSM2[bin]=-1;
00048     myCoilStatusSM2[bin]=-1;
00049 
00050     myBegVldCxtHvSM1[bin]=-1;
00051     myEndVldCxtHvSM1[bin]=-1;
00052     myHvStatusSM1[bin]=-1;
00053 
00054     myBegVldCxtHvSM2[bin]=-1;
00055     myEndVldCxtHvSM2[bin]=-1;
00056     myHvStatusSM2[bin]=-1;
00057   }
00058 
00059   MSG("DataQualityFilter",Msg::kVerbose) << " ... Initializing Data Quality Lookup Table " << endl;
00060 
00061   ctr=0;
00062   TString fCoilStatusCalSM1 = gSystem->ExpandPathName("$DCSPATH/my_coilstatus_SM1.dat");
00063   ifstream mycoilcalSM1(fCoilStatusCalSM1.Data(),ios::in);
00064   if( mycoilcalSM1 ){
00065     MSG("DataQualityFilter",Msg::kVerbose) << "     FOUND SM1 COIL STATUS TABLE " << endl;
00066     while( !mycoilcalSM1.eof() ){
00067       begcxt=-1; endcxt=-1; status=-1;
00068       mycoilcalSM1 >> begcxt >> endcxt >> status;
00069       if(ctr<10) MSG("DataQualityFilter",Msg::kVerbose) << "      " << begcxt << "->" << endcxt << "  " << status << endl;
00070       bin=ctr;
00071       if(begcxt>-1){
00072         if(bin<1000){
00073           myBegVldCxtCoilSM1[bin]=begcxt;
00074           myEndVldCxtCoilSM1[bin]=endcxt;
00075           myCoilStatusSM1[bin]=status;
00076         }
00077         else{
00078           MSG("DataQualityFilter",Msg::kVerbose) << "     WARNING: OVERFLOW IN SM1 COIL STATUS TABLES " << endl;
00079         }
00080       }
00081       ctr++;
00082     }
00083   }
00084   else{
00085     MSG("DataQualityFilter",Msg::kVerbose) << "     FAILED TO FIND SM1 COIL STATUS TABLE " << endl;
00086   }
00087   mycoilcalSM1.close();
00088 
00089   ctr=0;
00090   TString fCoilStatusCalSM2 = gSystem->ExpandPathName("$DCSPATH/my_coilstatus_SM2.dat");
00091   ifstream mycoilcalSM2(fCoilStatusCalSM2.Data(),ios::in);
00092   if( mycoilcalSM2 ){
00093     MSG("DataQualityFilter",Msg::kVerbose) << "     FOUND SM2 COIL STATUS TABLE " << endl;
00094     while( !mycoilcalSM2.eof() ){
00095       begcxt=-1; endcxt=-1; status=-1;
00096       mycoilcalSM2 >> begcxt >> endcxt >> status;    
00097       if(ctr<10) MSG("DataQualityFilter",Msg::kVerbose) << "      " << begcxt << "->" << endcxt << "  " << status << endl;
00098       bin=ctr;
00099       if(begcxt>-1){
00100         if(bin<1000){
00101           myBegVldCxtCoilSM2[bin]=begcxt;
00102           myEndVldCxtCoilSM2[bin]=endcxt;
00103           myCoilStatusSM2[bin]=status;
00104         }
00105         else{
00106           MSG("DataQualityFilter",Msg::kVerbose) << "     WARNING: OVERFLOW IN SM2 COIL STATUS TABLES " << endl;
00107         }
00108       }
00109       ctr++;
00110     }
00111   }
00112   else{
00113     MSG("DataQualityFilter",Msg::kVerbose) << "     FAILED TO FIND SM2 COIL STATUS TABLE " << endl;
00114   }
00115   mycoilcalSM2.close();
00116 
00117   ctr=0;
00118   TString fHvStatusCalSM1 = gSystem->ExpandPathName("$DCSPATH/my_hvstatus_SM1.dat");
00119   ifstream myhvcalSM1(fHvStatusCalSM1.Data(),ios::in);
00120   if( myhvcalSM1 ){
00121     MSG("DataQualityFilter",Msg::kVerbose) << "     FOUND SM1 HV STATUS TABLE " << endl;
00122     while( !myhvcalSM1.eof() ){
00123       begcxt=-1; endcxt=-1; status=-1;
00124       myhvcalSM1 >> begcxt >> endcxt >> status; 
00125       if(ctr<10) MSG("DataQualityFilter",Msg::kVerbose) << "      " << begcxt << "->" << endcxt << "  " << status << endl;
00126       bin=ctr;
00127       if(begcxt>-1){
00128         if(bin<1000){
00129           myBegVldCxtHvSM1[bin]=begcxt;
00130           myEndVldCxtHvSM1[bin]=endcxt;
00131           myHvStatusSM1[bin]=status;
00132         }
00133         else{
00134           MSG("DataQualityFilter",Msg::kVerbose) << "     WARNING: OVERFLOW IN SM1 HV STATUS TABLE " << endl;
00135         }
00136       }
00137       ctr++;
00138     }
00139   }
00140   else{
00141     MSG("DataQualityFilter",Msg::kVerbose) << "     FAILED TO FIND SM1 HV STATUS TABLE " << endl;
00142   }
00143   myhvcalSM1.close();
00144 
00145   ctr=0;
00146   TString fHvStatusCalSM2 = gSystem->ExpandPathName("$DCSPATH/my_hvstatus_SM2.dat");
00147   ifstream myhvcalSM2(fHvStatusCalSM2.Data(),ios::in);
00148   if( myhvcalSM2 ){
00149     MSG("DataQualityFilter",Msg::kVerbose) << "     FOUND SM2 HV STATUS TABLE " << endl;
00150     while( !myhvcalSM2.eof() ){
00151       begcxt=-1; endcxt=-1; status=-1;
00152       myhvcalSM2 >> begcxt >> endcxt >> status;
00153       if(ctr<10) MSG("DataQualityFilter",Msg::kVerbose) << "      " << begcxt << "->" << endcxt << "  " << status << endl; 
00154       bin=ctr;
00155       if(begcxt>-1){
00156         if(bin<1000){
00157           myBegVldCxtHvSM2[bin]=begcxt;
00158           myEndVldCxtHvSM2[bin]=endcxt;
00159           myHvStatusSM2[bin]=status;
00160         }
00161         else{
00162           MSG("DataQualityFilter",Msg::kVerbose) << "     WARNING: OVERFLOW IN SM2 HV STATUS TABLE " << endl;
00163         }
00164       }
00165       ctr++;
00166     }
00167   }
00168   else{
00169     MSG("DataQualityFilter",Msg::kVerbose) << "     FAILED TO FIND SM2 HV STATUS TABLE " << endl;
00170   }
00171   myhvcalSM2.close();
00172 
00173   MSG("DataQualityFilter",Msg::kVerbose) << " ... Data Quality Lookup Table Initialized " << endl;
00174 }

DataQualityLookup::DataQualityLookup ( const DataQualityLookup rhs  ) 

Definition at line 176 of file DataQualityLookup.cxx.

00176                                                                  :
00177   TObject(rhs)
00178 {
00179   
00180 }
  

DataQualityLookup::~DataQualityLookup (  ) 

Definition at line 182 of file DataQualityLookup.cxx.

References myBegVldCxtCoilSM1, myBegVldCxtCoilSM2, myBegVldCxtHvSM1, myBegVldCxtHvSM2, myCoilStatusSM1, myCoilStatusSM2, myEndVldCxtCoilSM1, myEndVldCxtCoilSM2, myEndVldCxtHvSM1, myEndVldCxtHvSM2, myHvStatusSM1, and myHvStatusSM2.

00183 {
00184   delete [] myBegVldCxtCoilSM1;
00185   delete [] myEndVldCxtCoilSM1;
00186   delete [] myCoilStatusSM1;
00187 
00188   delete [] myBegVldCxtCoilSM2;
00189   delete [] myEndVldCxtCoilSM2;
00190   delete [] myCoilStatusSM2;
00191 
00192   delete [] myBegVldCxtHvSM1;
00193   delete [] myEndVldCxtHvSM1;
00194   delete [] myHvStatusSM1;
00195 
00196   delete [] myBegVldCxtHvSM2;
00197   delete [] myEndVldCxtHvSM2;
00198   delete [] myHvStatusSM2;
00199 }


Member Function Documentation

Int_t DataQualityLookup::GetCoilStatus ( VldContext  vldc  ) 

Definition at line 201 of file DataQualityLookup.cxx.

References VldContext::GetDetector(), GetFarDetCoilStatus(), Detector::kFar, Detector::kNear, Msg::kVerbose, and MSG.

Referenced by DataQualityInterface::ProcessDetectorStatus().

00202 {
00203   Int_t mystatus=-1; 
00204   Int_t mystatus1=-1,mystatus2=-1;
00205  
00206   if( vldc.GetDetector()==Detector::kFar ){
00207     mystatus1=this->GetFarDetCoilStatus(vldc,1);
00208     mystatus2=this->GetFarDetCoilStatus(vldc,2);
00209     if( mystatus1==0 || mystatus2==0 ) mystatus=0;
00210     if( mystatus1==1 && mystatus2==1 ) mystatus=1;
00211   }
00212 
00213   if( vldc.GetDetector()==Detector::kNear ){
00214 
00215   }
00216 
00217   MSG("DataQualityFilter",Msg::kVerbose) << " (Lookup)Coil=" << mystatus << endl;
00218 
00219 
00220   return mystatus;
00221 }

Int_t DataQualityLookup::GetFarDetCoilStatus ( VldContext  vldc,
Int_t  supermodule 
) [private]

Definition at line 244 of file DataQualityLookup.cxx.

References VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), Msg::kVerbose, MSG, myBegVldCxtCoilSM1, myBegVldCxtCoilSM2, myCoilStatusSM1, myCoilStatusSM2, myEndVldCxtCoilSM1, and myEndVldCxtCoilSM2.

Referenced by GetCoilStatus().

00245 {
00246   Int_t k;
00247   Int_t mystatus=-1;
00248   Int_t begvldcxt=-1,endvldcxt=-1;
00249   Int_t vldcxt=vldc.GetTimeStamp().GetSec();
00250 
00251   if( supermodule==1 ){
00252     for(k=0;k<1000;k++){
00253       if( myBegVldCxtCoilSM1[k]>=0 && vldcxt>=myBegVldCxtCoilSM1[k] && vldcxt<myEndVldCxtCoilSM1[k] ){
00254         begvldcxt = myBegVldCxtCoilSM1[k];
00255         endvldcxt = myEndVldCxtCoilSM1[k];
00256         mystatus = myCoilStatusSM1[k];
00257       }
00258     }
00259   }
00260 
00261   if( supermodule==2 ){
00262     for(k=0;k<1000;k++){
00263       if( myBegVldCxtCoilSM2[k]>=0 && vldcxt>=myBegVldCxtCoilSM2[k] && vldcxt<myEndVldCxtCoilSM2[k] ){
00264         begvldcxt = myBegVldCxtCoilSM2[k];
00265         endvldcxt = myEndVldCxtCoilSM2[k];
00266         mystatus = myCoilStatusSM2[k];
00267       }
00268     }
00269   }
00270 
00271   MSG("DataQualityFilter",Msg::kVerbose) << " LOOKUP FARDET COIL STATUS [time=" << vldcxt << ", SM=" << supermodule << ", status=" << mystatus << ", vldcxt=" << begvldcxt << "->" << endvldcxt << "]" << endl;
00272 
00273   return mystatus;
00274 }

Int_t DataQualityLookup::GetFarDetHvStatus ( VldContext  vldc,
Int_t  supermodule 
) [private]

Definition at line 276 of file DataQualityLookup.cxx.

References VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), Msg::kVerbose, MSG, myBegVldCxtHvSM1, myBegVldCxtHvSM2, myEndVldCxtHvSM1, myEndVldCxtHvSM2, myHvStatusSM1, and myHvStatusSM2.

Referenced by GetHvStatus().

00277 {
00278   Int_t k;
00279   Int_t mystatus=-1;
00280   Int_t begvldcxt=-1,endvldcxt=-1;
00281   Int_t vldcxt=vldc.GetTimeStamp().GetSec();
00282 
00283   if( supermodule==1 ){
00284     for(k=0;k<1000;k++){
00285       if( myBegVldCxtHvSM1[k]>=0 && vldcxt>=myBegVldCxtHvSM1[k] && vldcxt<myEndVldCxtHvSM1[k] ){
00286         begvldcxt = myBegVldCxtHvSM1[k];
00287         endvldcxt = myEndVldCxtHvSM1[k];
00288         mystatus = myHvStatusSM1[k];
00289       }
00290     }
00291   }
00292 
00293   if( supermodule==2 ){
00294     for(k=0;k<1000;k++){
00295       if( myBegVldCxtHvSM2[k]>=0 && vldcxt>=myBegVldCxtHvSM2[k] && vldcxt<myEndVldCxtHvSM2[k] ){
00296         begvldcxt = myBegVldCxtHvSM2[k];
00297         endvldcxt = myEndVldCxtHvSM2[k];
00298         mystatus = myHvStatusSM2[k];
00299       }
00300     }        
00301   }
00302 
00303   MSG("DataQualityFilter",Msg::kVerbose) << " LOOKUP FARDET HV STATUS [time=" << vldcxt << ", SM=" << supermodule << ", status=" << mystatus << ", vldcxt=" << begvldcxt << "->" << endvldcxt << "]" << endl;
00304 
00305   return mystatus;
00306 }

Int_t DataQualityLookup::GetHvStatus ( VldContext  vldc  ) 

Definition at line 223 of file DataQualityLookup.cxx.

References VldContext::GetDetector(), GetFarDetHvStatus(), Detector::kFar, Detector::kNear, Msg::kVerbose, and MSG.

Referenced by DataQualityInterface::ProcessDetectorStatus().

00224 {
00225   Int_t mystatus=-1; 
00226   Int_t mystatus1=-1,mystatus2=-1;
00227  
00228   if( vldc.GetDetector()==Detector::kFar ){
00229     mystatus1=this->GetFarDetHvStatus(vldc,1);
00230     mystatus2=this->GetFarDetHvStatus(vldc,2);
00231     if( mystatus1==0 || mystatus2==0 ) mystatus=0;
00232     if( mystatus1==1 && mystatus2==1 ) mystatus=1;
00233   }
00234 
00235   if( vldc.GetDetector()==Detector::kNear ){
00236 
00237   }
00238 
00239   MSG("DataQualityFilter",Msg::kVerbose) << " (Lookup)HV=" << mystatus << endl;
00240 
00241   return mystatus;
00242 }


Member Data Documentation

Int_t* DataQualityLookup::myBegVldCxtCoilSM1 [private]

Definition at line 23 of file DataQualityLookup.h.

Referenced by GetFarDetCoilStatus(), and ~DataQualityLookup().

Int_t* DataQualityLookup::myBegVldCxtCoilSM2 [private]

Definition at line 27 of file DataQualityLookup.h.

Referenced by GetFarDetCoilStatus(), and ~DataQualityLookup().

Int_t* DataQualityLookup::myBegVldCxtHvSM1 [private]

Definition at line 31 of file DataQualityLookup.h.

Referenced by GetFarDetHvStatus(), and ~DataQualityLookup().

Int_t* DataQualityLookup::myBegVldCxtHvSM2 [private]

Definition at line 35 of file DataQualityLookup.h.

Referenced by GetFarDetHvStatus(), and ~DataQualityLookup().

Int_t* DataQualityLookup::myCoilStatusSM1 [private]

Definition at line 25 of file DataQualityLookup.h.

Referenced by GetFarDetCoilStatus(), and ~DataQualityLookup().

Int_t* DataQualityLookup::myCoilStatusSM2 [private]

Definition at line 29 of file DataQualityLookup.h.

Referenced by GetFarDetCoilStatus(), and ~DataQualityLookup().

Int_t* DataQualityLookup::myEndVldCxtCoilSM1 [private]

Definition at line 24 of file DataQualityLookup.h.

Referenced by GetFarDetCoilStatus(), and ~DataQualityLookup().

Int_t* DataQualityLookup::myEndVldCxtCoilSM2 [private]

Definition at line 28 of file DataQualityLookup.h.

Referenced by GetFarDetCoilStatus(), and ~DataQualityLookup().

Int_t* DataQualityLookup::myEndVldCxtHvSM1 [private]

Definition at line 32 of file DataQualityLookup.h.

Referenced by GetFarDetHvStatus(), and ~DataQualityLookup().

Int_t* DataQualityLookup::myEndVldCxtHvSM2 [private]

Definition at line 36 of file DataQualityLookup.h.

Referenced by GetFarDetHvStatus(), and ~DataQualityLookup().

Int_t* DataQualityLookup::myHvStatusSM1 [private]

Definition at line 33 of file DataQualityLookup.h.

Referenced by GetFarDetHvStatus(), and ~DataQualityLookup().

Int_t* DataQualityLookup::myHvStatusSM2 [private]

Definition at line 37 of file DataQualityLookup.h.

Referenced by GetFarDetHvStatus(), and ~DataQualityLookup().


The documentation for this class was generated from the following files:
Generated on Thu Apr 10 23:02:28 2014 for loon by  doxygen 1.4.7