NearReadout Class Reference

#include <NearReadout.h>

List of all members.

Public Types

enum  Status_t { kUnconnected = 0, kConnected = 1, kLI = 2, kError = 3 }

Public Member Functions

 NearReadout ()
 ~NearReadout ()
Status_t ConnectedMinder (Int_t, Int_t, Int_t)
Status_t ConnectedMenu (Int_t, Int_t, Int_t, Int_t)
Int_t ConnectedMinders (Int_t crate)
Int_t ConnectedMenus (Int_t crate)

Public Attributes

std::vector< std::string > status_str

Private Attributes

int stp_num
Status_t kReadout
Status_t CrateSetup0 [16][8]
Status_t CrateSetup1 [16][8]
Status_t CrateSetup2 [16][8]
Status_t CrateSetup3 [16][8]
Status_t CrateMenuSetup0 [16][8][16]
Int_t fNumConnectedMinders [8]
Int_t fNumConnectedMenus [8]

Detailed Description

Definition at line 9 of file NearReadout.h.


Member Enumeration Documentation

Enumerator:
kUnconnected 
kConnected 
kLI 
kError 

Definition at line 17 of file NearReadout.h.

00017                 {
00018     kUnconnected = 0,
00019     kConnected = 1,
00020     kLI = 2,
00021     kError=3
00022   };


Constructor & Destructor Documentation

NearReadout::NearReadout (  ) 

Definition at line 8 of file NearReadout.cxx.

References DDS::kError.

00009 {
00010   stp_num=1;
00011   kReadout=kError;
00012   status_str.push_back("Unconnected");
00013   status_str.push_back("Connected");
00014   status_str.push_back("Light Injection");
00015   status_str.push_back("Error");
00016 
00017         for(int i = 0; i < 8; ++i)
00018         {
00019                 fNumConnectedMinders[i] = -1;
00020     fNumConnectedMenus[i] = -1;
00021         }
00022  
00023   Status_t tmpCrateSetup0[16][8] = 
00024            {{kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00025                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00026                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00027                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00028                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00029                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00030                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00031                                     {kUnconnected,kLI         ,kLI         ,kLI         ,kLI         ,kLI         ,kLI         ,kUnconnected},
00032                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected},
00033                                     {kConnected  ,kConnected  ,kConnected  ,kUnconnected,kConnected  ,kConnected  ,kConnected  ,kUnconnected},
00034                                     {kConnected  ,kConnected  ,kConnected  ,kUnconnected,kConnected  ,kConnected  ,kConnected  ,kUnconnected},
00035                                     {kConnected  ,kConnected  ,kConnected  ,kUnconnected,kConnected  ,kConnected  ,kConnected  ,kUnconnected},
00036                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00037                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00038                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00039                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected}};
00040   
00041   for(int i=0;i<16;i++){
00042     for(int j=0;j<8;j++){
00043       
00044       CrateSetup0[i][j] = tmpCrateSetup0[i][j];
00045       
00046     }
00047   }
00048 
00049 
00050 
00051   
00052   Status_t tmpCrateSetup1[16][8] = 
00053            {{kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00054                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00055                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00056                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00057                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00058                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00059                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00060                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00061                                     {kConnected  ,kConnected  ,kConnected  ,kUnconnected,kConnected  ,kConnected  ,kConnected  ,kUnconnected},
00062                                     {kConnected  ,kConnected  ,kConnected  ,kUnconnected,kConnected  ,kConnected  ,kConnected  ,kUnconnected},
00063                                     {kConnected  ,kConnected  ,kConnected  ,kUnconnected,kConnected  ,kConnected  ,kConnected  ,kUnconnected},
00064                                     {kConnected  ,kConnected  ,kConnected  ,kUnconnected,kConnected  ,kConnected  ,kConnected  ,kUnconnected},
00065                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00066                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00067                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00068                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected}};
00069   
00070   for(int i=0;i<16;i++){
00071     for(int j=0;j<8;j++){
00072       
00073       CrateSetup1[i][j] = tmpCrateSetup1[i][j];
00074       
00075     }
00076   }
00077 
00078  
00079   Status_t tmpCrateSetup2[16][8] = 
00080            {{kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00081                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00082                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kUnconnected,kUnconnected},
00083                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00084                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00085                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kUnconnected,kUnconnected},
00086                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00087                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00088                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kUnconnected,kUnconnected},
00089                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00090                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00091                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kUnconnected,kUnconnected},
00092                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00093                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00094                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00095                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected}};
00096 
00097   for(int i=0;i<16;i++){
00098     for(int j=0;j<8;j++){
00099 
00100       CrateSetup2[i][j] = tmpCrateSetup2[i][j];
00101     }
00102   }
00103 
00104   
00105   Status_t tmpCrateSetup3[16][8] = 
00106            {{kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00107                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kUnconnected,kUnconnected},
00108                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00109                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00110                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kUnconnected,kUnconnected},
00111                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00112                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00113                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kUnconnected,kUnconnected},
00114                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00115                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00116                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kUnconnected,kUnconnected},
00117                                     {kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected  ,kConnected}  ,
00118                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00119                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00120                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected},
00121                                     {kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected,kUnconnected}};
00122 
00123   for(int i=0;i<16;i++){
00124     for(int j=0;j<8;j++){
00125       
00126       CrateSetup3[i][j] = tmpCrateSetup3[i][j];
00127     }
00128   }
00129 
00130   // Now the individual menus for crate 0.  First copy the minder setup
00131   Status_t tmpCrateMenuSetup0[16][8][16];
00132   for(int i=0; i<16;i++){
00133     for(int j=0; j<8;j++){
00134       for(int k=0;k<16;k++){
00135         tmpCrateMenuSetup0[i][j][k]=CrateSetup0[i][j];
00136       }
00137     }
00138   }
00139 
00140   // Some individual channels in 0-17-7-XX are not connected
00141   Int_t crateOffset = 9;  // Crates start numbering from 9
00142   tmpCrateMenuSetup0[17-crateOffset][7][1]  = kUnconnected;
00143   tmpCrateMenuSetup0[17-crateOffset][7][3]  = kUnconnected;
00144   tmpCrateMenuSetup0[17-crateOffset][7][4]  = kUnconnected;
00145   tmpCrateMenuSetup0[17-crateOffset][7][6]  = kUnconnected;
00146   tmpCrateMenuSetup0[17-crateOffset][7][9]  = kUnconnected;
00147   tmpCrateMenuSetup0[17-crateOffset][7][11] = kUnconnected;
00148   tmpCrateMenuSetup0[17-crateOffset][7][12] = kUnconnected;
00149   tmpCrateMenuSetup0[17-crateOffset][7][14] = kUnconnected;
00150 
00151   for(int i=0; i<16;i++){
00152     for(int j=0; j<8;j++){
00153       for(int k=0;k<16;k++){
00154         CrateMenuSetup0[i][j][k] = tmpCrateMenuSetup0[i][j][k];
00155       }
00156     }
00157   }
00158   
00159 }

NearReadout::~NearReadout (  ) 

Definition at line 161 of file NearReadout.cxx.

00162 {
00163 
00164 }


Member Function Documentation

NearReadout::Status_t NearReadout::ConnectedMenu ( Int_t  crate,
Int_t  master,
Int_t  minder,
Int_t  menu 
)

Definition at line 181 of file NearReadout.cxx.

References ConnectedMinder(), CrateMenuSetup0, and kReadout.

Referenced by FillBadChannelDB::FindBadChannels(), and FillBadChannelDB::ProcessBlock().

00181                                                                                                  {
00182   if( crate==0) kReadout = CrateMenuSetup0[master-9][minder][menu];
00183   else kReadout = this->ConnectedMinder(crate, master, minder);
00184 
00185   return kReadout;
00186 }

Int_t NearReadout::ConnectedMenus ( Int_t  crate  ) 

Definition at line 245 of file NearReadout.cxx.

References ConnectedMinders(), CrateMenuSetup0, fNumConnectedMenus, and kConnected.

Referenced by FillBadChannelDB::FindBadChannels().

00245                                             {
00246         
00247   // Don't recalculate this if we already have it
00248         if( fNumConnectedMenus[crate] != -1 ) return fNumConnectedMenus[crate];
00249   Int_t nConnected=0;
00250   
00251   if(crate==0){
00252         for(Int_t iMaster = 9; iMaster < 25; ++iMaster){
00253                 for(Int_t iMinder = 0; iMinder < 8; ++iMinder){
00254         for(Int_t iMenu = 0; iMenu < 16; ++iMenu){
00255                           if( CrateMenuSetup0[iMaster-9][iMinder][iMenu] == NearReadout::kConnected ) nConnected++;
00256         }
00257                 }
00258         }
00259     fNumConnectedMenus[crate] = nConnected;
00260   }
00261   else fNumConnectedMenus[crate] = 16*this->ConnectedMinders(crate);   
00262   return fNumConnectedMenus[crate];
00263 }

NearReadout::Status_t NearReadout::ConnectedMinder ( Int_t  crate,
Int_t  master,
Int_t  minder 
)

Definition at line 166 of file NearReadout.cxx.

References CrateSetup0, CrateSetup1, CrateSetup2, CrateSetup3, kReadout, and kUnconnected.

Referenced by ConnectedMenu(), FillBadChannelDB::FindBadChannels(), and FillNearRunQuality::ProcessBlock().

00166                                                                                      {
00167 
00168   if( crate<0  || crate>7 )   return kUnconnected;
00169   if( master<9 || master>24 ) return kUnconnected;
00170   if( minder<0 || minder>7 )  return kUnconnected;
00171 
00172   if(crate==0) kReadout = CrateSetup0[master - 9][minder];
00173   if(crate==1) kReadout = CrateSetup1[master - 9][minder];
00174   if(crate>=2 && (crate%2)==0) kReadout = CrateSetup2[master - 9][minder];  //even
00175   if(crate>=2 && (crate%2)==1) kReadout = CrateSetup3[master - 9][minder];  //odd
00176 
00177   return kReadout;
00178 
00179 }

Int_t NearReadout::ConnectedMinders ( Int_t  crate  ) 

Definition at line 188 of file NearReadout.cxx.

References CrateSetup0, CrateSetup1, CrateSetup2, CrateSetup3, fNumConnectedMinders, and kConnected.

Referenced by ConnectedMenus().

00189 {
00190         // Don't recalculate this if we already have it
00191         if( fNumConnectedMinders[crate] != -1 ) return fNumConnectedMinders[crate];
00192 
00193         // Otherwise count the connected minders for that crate
00194         else
00195         {
00196         if( crate<0  || crate>7 )   return 0;
00197                 Int_t nConnected=0;
00198                 
00199         if(crate==0)
00200                 {
00201                         for(Int_t iMaster = 9; iMaster < 25; ++iMaster)
00202                         {
00203                                 for(Int_t iMinder = 0; iMinder < 8; ++iMinder)
00204                                 {
00205                                         if( CrateSetup0[iMaster-9][iMinder] == NearReadout::kConnected ) nConnected++;
00206                                 }
00207                         }
00208                 }
00209         if(crate==1)
00210                 {
00211                         for(Int_t iMaster = 9; iMaster < 25; ++iMaster)
00212                         {
00213                                 for(Int_t iMinder = 0; iMinder < 8; ++iMinder)
00214                                 {
00215                                         if( CrateSetup1[iMaster-9][iMinder] == NearReadout::kConnected ) nConnected++;
00216                                 }
00217                         }
00218                 }
00219         if(crate>=2 && (crate%2)==0)
00220                 {
00221                         for(Int_t iMaster = 9; iMaster < 25; ++iMaster)
00222                         {
00223                                 for(Int_t iMinder = 0; iMinder < 8; ++iMinder)
00224                                 {
00225                                         if( CrateSetup2[iMaster-9][iMinder] == NearReadout::kConnected ) nConnected++;
00226                                 }
00227                         }
00228                 }
00229         if(crate>=2 && (crate%2)==1)
00230                 {
00231                         for(Int_t iMaster = 9; iMaster < 25; ++iMaster)
00232                         {
00233                                 for(Int_t iMinder = 0; iMinder < 8; ++iMinder)
00234                                 {
00235                                         if( CrateSetup3[iMaster-9][iMinder] == NearReadout::kConnected ) nConnected++;
00236                                 }
00237                         }
00238                 }
00239         fNumConnectedMinders[crate] = nConnected;
00240         }
00241 
00242         return fNumConnectedMinders[crate];
00243 }


Member Data Documentation

Status_t NearReadout::CrateMenuSetup0[16][8][16] [private]

Definition at line 40 of file NearReadout.h.

Referenced by ConnectedMenu(), and ConnectedMenus().

Definition at line 35 of file NearReadout.h.

Referenced by ConnectedMinder(), and ConnectedMinders().

Definition at line 36 of file NearReadout.h.

Referenced by ConnectedMinder(), and ConnectedMinders().

Definition at line 37 of file NearReadout.h.

Referenced by ConnectedMinder(), and ConnectedMinders().

Definition at line 38 of file NearReadout.h.

Referenced by ConnectedMinder(), and ConnectedMinders().

Int_t NearReadout::fNumConnectedMenus[8] [private]

Definition at line 43 of file NearReadout.h.

Referenced by ConnectedMenus().

Definition at line 42 of file NearReadout.h.

Referenced by ConnectedMinders().

Definition at line 33 of file NearReadout.h.

Referenced by ConnectedMenu(), and ConnectedMinder().

std::vector<std::string> NearReadout::status_str

Definition at line 24 of file NearReadout.h.

int NearReadout::stp_num [private]

Definition at line 32 of file NearReadout.h.


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1