Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RawDcsEnvMonitorBlock.cxx

Go to the documentation of this file.
00001 
00002 // $Id: RawDcsEnvMonitorBlock.cxx,v 1.23 2009/02/28 21:46:16 gmieg Exp $
00003 // 
00004 // RawDcsEnvMonitorBlock 
00005 // 
00006 // RawDcsEnvMonitorBlock is a Dcs Environment Monitor Block
00007 //
00008 // Author:  R. Hatcher 2003.02.26
00009 //
00011 #include <cstring>
00012 
00013 #include "RawData/RawDcsEnvMonitorBlock.h"
00014 
00015 UInt_t RawDcsEnvMonitorBlock::fgDebugFlags = 0;
00016 
00017 #include "MessageService/MsgService.h"
00018 CVSID("$Id: RawDcsEnvMonitorBlock.cxx,v 1.23 2009/02/28 21:46:16 gmieg Exp $");
00019 #include "MessageService/MsgFormat.h"
00020 
00021 #include "RawData/RawBlockRegistry.h"
00022 REGISTERRAWBLOCK(RawDcsEnvMonitorBlock,kMdBlockDcsEnvMonitor,kMdBlockSourceDcs);
00023 
00024 ClassImp(RawDcsEnvMonitorBlock)
00025 
00026 enum EDcsEnvMonitorBlkPos {
00027    indx_size      = 0,
00028    indx_checksum  = 1,
00029    indx_blockid   = 2,
00030    zzzz_last      = 3
00031 };
00032 
00033 //_____________________________________________________________________________
00034 RawDcsEnvMonitorBlock::RawDcsEnvMonitorBlock()
00035   : EnvArray(0)
00036 {
00037    // Default constructor
00038 }
00039 
00040 //_____________________________________________________________________________
00041 RawDcsEnvMonitorBlock::RawDcsEnvMonitorBlock(const Int_t *block)
00042   : RawDataBlock(block), EnvArray(0)
00043 {
00044    //  stored block format is:
00045    //---------------------
00046    //  0   # words in block
00047    //  1   checksum
00048    //  2   Block Id
00049    //-----
00050    /*
00051     *  The data has the following repeating structure from here
00052     *  Int_t n = ((i-3)/8) = num blocks (test modulo for errors);
00053     *  Int_t d[n*8];  d = block+3;
00054     *  Int_t indx;
00055     *  d[(indx*8)+0] = timestamp (long sec)
00056     *  d[(indx*8)+1] = temp1
00057     *  d[(indx*8)+2] = hum1
00058     *  d[(indx*8)+3] = radon1
00059     *  d[(indx*8)+4] = pres     all these are floats
00060     *  d[(indx*8)+5] = temp2
00061     *  d[(indx*8)+6] = hum2
00062     *  d[(indx*8)+7] = radon2
00063     *  indx++;(test if indx is greater than n, if so, finito)
00064     */
00065 }
00066 
00067 //_____________________________________________________________________________
00068 RawDcsEnvMonitorBlock::~RawDcsEnvMonitorBlock()
00069 {
00070    // dtor
00071 }
00072 
00073 //_____________________________________________________________________________
00074 std::ostream& RawDcsEnvMonitorBlock::FormatToOStream(ostream& os, 
00075                                                      Option_t *option) const
00076 {
00077         RawDataBlock::FormatToOStream(os,option);
00078         if (option[0] == 'X') return os;
00079 
00080         MsgFormat ffmt("%9.2f");
00081         Int_t numEntries=GetNumEntries();
00082         os << " Number of Entries " << numEntries
00083         << " Number of Events " << GetNumEvents() << endl;
00084         if (GetEnvDetector()==Detector::kNear)
00085         {
00086                 Int_t iArray[56];
00087                 Float_t fArray[56];
00088                 for(Int_t i = 0; i < numEntries; i++)
00089                 {
00090                   os << "Timestamp " << GetTimeStamp(i).AsString("c") << setw(5) 
00091                   << " Temperature " << ffmt(GetNearTemperature(i)) << " Humidity " 
00092                   << ffmt(GetNearHumid(i)) << " Radon  " << ffmt(GetNearRadonCounts(i)); 
00093                   os << " Pressure " << ffmt(GetNearPressure(i));
00094                   GetNearEnvThermArray(i,iArray);
00095                   for(Int_t k=0;k<56;k++)
00096                   {
00097                                 fArray[k] = 0;
00098                                 memcpy(&fArray[k],&iArray[k],4);
00099                   }
00100                   for(Int_t j = 0; j < 56; j++)
00101                   {
00102                                 os << " Thermocouple " << j+1 << " "
00103                                 << ffmt(fArray[j]);
00104                   }
00105 
00106                 }
00107         }
00108         if (GetEnvDetector()==Detector::kFar)
00109         {
00110                 for(Int_t i = 0; i < numEntries; i++)
00111                 {
00112                   os << "Timestamp " << GetTimeStamp(i).AsString("c") << setw(5) 
00113                   << " Temperature 1 " << ffmt(GetFarTemperature1(i)) << " Humidity 1" 
00114                   << ffmt(GetFarHumid1(i)) << " Radon 1 " << ffmt(GetFarRadon1(i)) 
00115                   << " Pressure 1 " << ffmt(GetFarPressure1(i)) << " Temperature 2 " 
00116                   << ffmt(GetFarTemperature2(i)) << " Humidity 2 " << ffmt(GetFarHumid2(i) )
00117                   << " Radon 2 " << ffmt(GetFarRadon2(i));
00118                   if (GetMinorId()>=2)
00119                         os << " Pressure 2 " << ffmt(GetFarPressure2(i));
00120                   os << " Radon factor 1 " << ffmt(GetFarRadonFactor1(i)) << " radon factor 2 " << ffmt(GetFarRadonFactor2(i)) << endl;
00121                 }
00122         }
00123         if(GetEnvDetector()==Detector::kCalDet)
00124         {
00125                 Int_t iArray[32];
00126                 Float_t fArray[32];
00127                 for(Int_t i = 0; i < numEntries; i++)
00128                 {
00129                         os << "Timestamp " << GetTimeStamp(i).AsString("c") << setw(5)
00130                         << " Temperature " << ffmt(GetCalTemperature(i)) << " Humidity "
00131                         << ffmt(GetCalHumid(i)) << " Pressure " << ffmt(GetCalPressure(i));
00132                         if(GetCalEnvIsTriggerEvent(i))
00133                         {
00134                                 os << " Triggered event. Rate " << GetCalEnvTriggerRate(i);
00135                         }
00136                         GetCalEnvThermArray(i,iArray);
00137                         for(Int_t k=0;k<32;k++)
00138                         {
00139                                 fArray[k] = 0;
00140                                 memcpy(&fArray[k],&iArray[k],4);
00141                         }
00142                         for(Int_t j = 0; j < 32; j++)
00143                         {
00144                                 os << " Thermocouple " << j+1 << " "
00145                                 << ffmt(fArray[j]);
00146                         }
00147                         if (GetMinorId()>1)
00148                         {
00149                                 os << " Cerenkov Pressure 1 " << ffmt(GetCalCerPressure1(i))
00150                                 << " Cerenkov Pressure 2 " << ffmt(GetCalCerPressure2(i))
00151                                 << " Cerenkov Pressure 3 " << ffmt(GetCalCerPressure1(i))
00152                                 << " Cerenkov Pressure 4 " << ffmt(GetCalCerPressure1(i))
00153                                 << " Cerenkov Pressure 5 " << ffmt(GetCalCerPressure1(i));
00154                         }
00155                         os << endl;
00156                 }
00157         }
00158         return os;
00159 }
00160 
00161 VldTimeStamp RawDcsEnvMonitorBlock::GetTimeStamp(Int_t indx) const
00162 {
00163         FillEnvArray();
00164         if(GetEnvDetector()==Detector::kCalDet)
00165         {
00166                 if (GetMinorId()==1)
00167                         return VldTimeStamp(EnvArray[indx*38],0);
00168                 if (GetMinorId()==2)
00169                         return VldTimeStamp(EnvArray[indx*43],0);
00170                 if (GetMinorId()==3)
00171                         return VldTimeStamp(EnvArray[indx*51],0);
00172         }
00173         if (GetEnvDetector()==Detector::kFar)
00174         {
00175                 if(GetMinorId()==1)
00176                         return VldTimeStamp(EnvArray[indx*8],0);
00177                 if(GetMinorId()==2)
00178                         return VldTimeStamp(EnvArray[indx*9],0);
00179                 if(GetMinorId()==3)
00180                         return VldTimeStamp(EnvArray[indx*11],0);
00181         }
00182         if (GetEnvDetector()==Detector::kNear)
00183         {
00184                 return VldTimeStamp(EnvArray[indx*61],0);
00185         }
00186         return VldTimeStamp(EnvArray[0],0);
00187 }
00188 
00189 void RawDcsEnvMonitorBlock::FillEnvArray() const
00190 {
00191         //off by 3 since the first three are 1:num words, 2: checksum
00192         // and 3:block ID
00193         EnvArray = 3 + GetData();
00194 }
00195 
00196 Int_t RawDcsEnvMonitorBlock::GetEnvDetector() const
00197 {
00198         RawBlockId rbid = GetBlockId();
00199         return rbid.GetDetector();
00200 }
00201 
00202 Int_t RawDcsEnvMonitorBlock::GetNumEntries() const
00203 {
00204         // remember, all versions
00205         // have offset of 3 due to first 3 longs)
00206         if (GetEnvDetector()==Detector::kCalDet)
00207         {
00208                 if (GetMinorId()==1)
00209                 {
00210                         if ((fSize-3)%38)
00211                         {
00212                                 MSG("RawData",Msg::kError)
00213                                 << " Size of Env Block screwed up.  Have: "
00214                                 << (fSize-3)%38 << " left over from modulo 38. "
00215                                 << endl;
00216                                 return -1;
00217                         }
00218                         return ((fSize-3)/38);
00219                 }
00220                 if (GetMinorId()==2)
00221                 {
00222                         if ((fSize-3)%43)
00223                         {
00224                                 MSG("RawData",Msg::kError)
00225                                 << " Size of Env Block screwed up.  Have: "
00226                                 << (fSize-3)%43 << " left over from modulo 43. "
00227                                 << endl;
00228                                 return -1;
00229                         }
00230                         return ((fSize-3)/43);
00231                 }
00232                 if (GetMinorId()==3)
00233                 {
00234                         if ((fSize-3)%51)
00235                         {
00236                                 MSG("RawData",Msg::kError)
00237                                 << " Size of Env Block screwed up.  Have: "
00238                                 << (fSize-3)%43 << " left over from modulo 43. "
00239                                 << endl;
00240                                 return -1;
00241                         }
00242                         return ((fSize-3)/51);
00243                 }
00244         }
00245         if (GetEnvDetector()==Detector::kFar)
00246         {
00247                 if (GetMinorId()==1)
00248                 {
00249                         if((fSize-3)%8)
00250                         {
00251                                 MSG("RawData",Msg::kError)
00252                                 << " Size of Env Block screwed up.  Have: "
00253                                 << (fSize-3)%8 << " left over from modulo 8. "
00254                                 << endl;
00255                                 return -1;
00256                         }
00257                         return ((fSize-3)/8);
00258                 }
00259                 if (GetMinorId()==2)
00260                 {
00261                         if((fSize-3)%9)
00262                         {
00263                                 MSG("RawData",Msg::kError)
00264                                 << " Size of Env Block screwed up.  Have: "
00265                                 << (fSize-3)%9 << " left over from modulo 9. "
00266                                 << endl;
00267                                 return -1;
00268                         }
00269                         return ((fSize-3)/9);
00270                 }
00271                 if (GetMinorId()==3)
00272                 {
00273                         if((fSize-3)%11)
00274                         {
00275                                 MSG("RawData",Msg::kError)
00276                                 << " Size of Env Block screwed up.  Have: "
00277                                 << (fSize-3)%11 << " left over from modulo 11. "
00278                                 << endl;
00279                                 return -1;
00280                         }
00281                         return ((fSize-3)/11);
00282                 }
00283         }
00284         if (GetEnvDetector()==Detector::kNear)
00285         {
00286                 if((fSize-3)%61)
00287                 {
00288                         MSG("RawData",Msg::kError)
00289                         << " Size of Env Block screwed up.  Have: "
00290                         << (fSize-3)%61 << " left over from modulo 61. "
00291                         << endl;
00292                         return -1;                        
00293                 }
00294                 return ((fSize-3)/61);
00295         }
00296         MSG("RawData",Msg::kError)
00297         << " Version number wrong/not implemented." << endl;
00298         return -1;
00299 }
00300 
00301 Int_t RawDcsEnvMonitorBlock::GetNumEvents() const
00302 {
00303         return GetNumEntries();
00304 }
00305 
00306 VldContext RawDcsEnvMonitorBlock::GetVldContext() const
00307 {
00308                    // build validity context
00309         RawBlockId rbid = GetBlockId();
00310         return VldContext(rbid.GetDetector(),rbid.GetSimFlag(),GetTimeStamp(0));
00311 }
00312 
00313 //_____________________________________________________________________________
00314 
00315 Float_t RawDcsEnvMonitorBlock::GetFarTemperature1(Int_t indx) const
00316 {
00317         FillEnvArray();
00318         Float_t fValue=0.0;
00319         if (GetEnvDetector()==Detector::kCalDet)
00320         {
00321                 if (GetMinorId()==1)
00322                         memcpy(&fValue,&EnvArray[(indx*38)+3],4);
00323                 if (GetMinorId()==2)
00324                         memcpy(&fValue,&EnvArray[(indx*43)+3],4);
00325                 if (GetMinorId()==3)
00326                         memcpy(&fValue, &EnvArray[(indx*51)+3],4);
00327                 return fValue;
00328         }
00329         if (GetEnvDetector()==Detector::kFar)
00330         {
00331                 if (GetMinorId()==1)
00332                         memcpy(&fValue,&EnvArray[(indx*8)+1],4);
00333                 if (GetMinorId()==2)
00334                         memcpy(&fValue,&EnvArray[(indx*9)+1],4);
00335                 if (GetMinorId()==3)
00336                         memcpy(&fValue,&EnvArray[(indx*11)+1],4);
00337                 return fValue;
00338         }
00339         return 0;
00340 }
00341 
00342 Float_t RawDcsEnvMonitorBlock::GetCalTemperature(Int_t indx) const
00343 {
00344         return GetFarTemperature1(indx);
00345 }
00346 
00347 Float_t RawDcsEnvMonitorBlock::GetFarHumid1(Int_t indx) const
00348 {
00349         FillEnvArray();
00350         Float_t fValue=0.0;
00351         if (GetEnvDetector()==Detector::kCalDet)
00352         {
00353                 if (GetMinorId()==1)
00354                         memcpy(&fValue,&EnvArray[(indx*38)+4],4);
00355                 if (GetMinorId()==2)
00356                         memcpy(&fValue,&EnvArray[(indx*43)+4],4);
00357                 if (GetMinorId()==3)
00358                         memcpy(&fValue, &EnvArray[(indx*51)+4],4);
00359                 return fValue;
00360         }
00361         if (GetEnvDetector()==Detector::kFar)
00362         {
00363                 if (GetMinorId()==1)
00364                         memcpy(&fValue,&EnvArray[(indx*8)+2],4);
00365                 if (GetMinorId()==2)
00366                         memcpy(&fValue,&EnvArray[(indx*9)+2],4);
00367                 if (GetMinorId()==3)
00368                         memcpy(&fValue,&EnvArray[(indx*11)+2],4);
00369                 return fValue;
00370         }
00371         return 0;
00372 }
00373 
00374 Float_t RawDcsEnvMonitorBlock::GetCalHumid(Int_t indx) const
00375 {
00376         return GetFarHumid1(indx);
00377 }
00378 
00379 Float_t RawDcsEnvMonitorBlock::GetFarRadon1(Int_t indx) const
00380 {
00381         FillEnvArray();
00382         Float_t fValue=0.0;
00383         if (GetEnvDetector()==Detector::kCalDet)
00384         {
00385                 return fValue;
00386         }
00387         if (GetEnvDetector()==Detector::kFar)
00388         {
00389                 if (GetMinorId()==1)
00390                         memcpy(&fValue,&EnvArray[(indx*8)+3],4);
00391                 if (GetMinorId()==2)
00392                         memcpy(&fValue,&EnvArray[(indx*9)+3],4);
00393                 if (GetMinorId()==3)
00394                         memcpy(&fValue,&EnvArray[(indx*11)+3],4);
00395         }
00396         return fValue;
00397 }
00398 
00399 Float_t RawDcsEnvMonitorBlock::GetFarPressure1(Int_t indx) const
00400 {
00401         FillEnvArray();
00402         Float_t fValue=0.0;
00403         if (GetEnvDetector()==Detector::kCalDet)
00404         {
00405                 if (GetMinorId()==1)
00406                         memcpy(&fValue,&EnvArray[(indx*38)+5],4);
00407                 if (GetMinorId()==2)
00408                         memcpy(&fValue,&EnvArray[(indx*43)+5],4);
00409                 if (GetMinorId()==3)
00410                         memcpy(&fValue, &EnvArray[(indx*51)+5],4);
00411                 return fValue;
00412         }
00413         if (GetEnvDetector()==Detector::kFar)
00414         {
00415                 if (GetMinorId()==1)
00416                         memcpy(&fValue,&EnvArray[(indx*8)+4],4);
00417                 if (GetMinorId()==2)
00418                         memcpy(&fValue,&EnvArray[(indx*9)+4],4);
00419                 if (GetMinorId()==3)
00420                         memcpy(&fValue,&EnvArray[(indx*11)+4],4);
00421                 return fValue;
00422         }
00423         return fValue;
00424 }
00425 
00426 Float_t RawDcsEnvMonitorBlock::GetCalPressure(Int_t indx) const
00427 {
00428         return GetFarPressure1(indx);
00429 }
00430 
00431 Float_t RawDcsEnvMonitorBlock::GetFarTemperature2(Int_t indx) const
00432 {
00433         FillEnvArray();
00434         Float_t fValue=0.0;
00435         if (GetEnvDetector()==Detector::kCalDet)
00436         {
00437                 return fValue;
00438         }
00439         if (GetEnvDetector()==Detector::kFar)
00440         {
00441                 if (GetMinorId()==1)
00442                         memcpy(&fValue,&EnvArray[(indx*8)+5],4);
00443                 if (GetMinorId()==2)
00444                         memcpy(&fValue,&EnvArray[(indx*9)+5],4);
00445                 if (GetMinorId()==3)
00446                         memcpy(&fValue,&EnvArray[(indx*11)+5],4);
00447         }
00448         return fValue;
00449 }
00450 
00451 Float_t RawDcsEnvMonitorBlock::GetFarHumid2(Int_t indx) const
00452 {
00453         FillEnvArray();
00454         Float_t fValue=0.0;
00455         if (GetEnvDetector()==Detector::kCalDet)
00456         {
00457                 return fValue;
00458         }
00459         if (GetEnvDetector()==Detector::kFar)
00460         {
00461                 if (GetMinorId()==1)
00462                         memcpy(&fValue,&EnvArray[(indx*8)+6],4);
00463                 if (GetMinorId()==2)
00464                         memcpy(&fValue,&EnvArray[(indx*9)+6],4);
00465                 if (GetMinorId()==3)
00466                         memcpy(&fValue,&EnvArray[(indx*11)+6],4);
00467         }
00468         return fValue;
00469 }
00470 
00471 Float_t RawDcsEnvMonitorBlock::GetFarRadon2(Int_t indx) const
00472 {
00473         FillEnvArray();
00474         Float_t fValue=0.0;
00475         if (GetEnvDetector()==Detector::kCalDet)
00476         {
00477                 return fValue;
00478         }
00479         if (GetEnvDetector()==Detector::kFar)
00480         {
00481                 if (GetMinorId()==1)
00482                         memcpy(&fValue,&EnvArray[(indx*8)+7],4);
00483                 if (GetMinorId()==2)
00484                         memcpy(&fValue,&EnvArray[(indx*9)+7],4);
00485                 if (GetMinorId()==3)
00486                         memcpy(&fValue,&EnvArray[(indx*11)+7],4);
00487         }
00488         return fValue;
00489 }
00490 
00491 Float_t RawDcsEnvMonitorBlock::GetFarPressure2(Int_t indx) const
00492 {
00493         if ( (GetMinorId()==1) || (GetEnvDetector()==Detector::kCalDet) )
00494                 return 0.0;
00495         FillEnvArray();
00496         Float_t fValue=0.0;
00497         if (GetEnvDetector()==Detector::kFar)
00498                 memcpy(&fValue,&EnvArray[(indx*9)+8],4);
00499         if (GetMinorId()==3)
00500                 memcpy(&fValue,&EnvArray[(indx*11)+8],4);
00501         return fValue;
00502 }
00503 
00504 Float_t RawDcsEnvMonitorBlock::GetFarRadonFactor1(Int_t indx) const
00505 {
00506         if ( (GetMinorId()<3) || (GetEnvDetector()==Detector::kCalDet) )
00507                 return 0.0;
00508         FillEnvArray();
00509         Float_t fValue=0.0;
00510         memcpy(&fValue,&EnvArray[(indx*11)+9],4);
00511         return fValue;
00512 }
00513 
00514 Float_t RawDcsEnvMonitorBlock::GetFarRadonFactor2(Int_t indx) const
00515 {
00516         if ( (GetMinorId()<3) || (GetEnvDetector()==Detector::kCalDet) )
00517                 return 0.0;
00518         FillEnvArray();
00519         Float_t fValue=0.0;
00520         memcpy(&fValue,&EnvArray[(indx*11)+10],4);
00521         return fValue;
00522 }
00523 
00524 void RawDcsEnvMonitorBlock::GetCalEnvThermArray(Int_t indx, Int_t iArray[30]) const
00525 {
00526         FillEnvArray();
00527         if (GetEnvDetector()!=Detector::kCalDet)
00528                 return;
00529         if (GetMinorId()==1)
00530         {
00531                 for (Int_t i=0; i < 32; i++)
00532                 {
00533                         iArray[i] = EnvArray[(indx*38)+i+6];
00534                 }
00535         }
00536         if (GetMinorId()==2)
00537         {
00538                 for (Int_t i=0; i < 32; i++)
00539                 {
00540                         iArray[i] = EnvArray[(indx*43)+i+6];
00541                 }
00542         }
00543         if (GetMinorId()==3)
00544         {
00545                 for (Int_t i=0;i<32;i++)
00546                 {
00547                         iArray[i]=EnvArray[(indx*51)+i+6];
00548                 }
00549         }
00550 }
00551 
00552 Int_t RawDcsEnvMonitorBlock::GetCalEnvTriggerRate(Int_t indx) const
00553 {
00554         if (GetEnvDetector()!=Detector::kCalDet)
00555                 return 0;
00556         FillEnvArray();
00557         if (GetMinorId()==1)
00558                 return EnvArray[(indx*38)+1];
00559         if (GetMinorId()==2)
00560                 return EnvArray[(indx*43)+1];
00561         if (GetMinorId()==3)
00562                 return EnvArray[(indx*51)+1];
00563         return 0;
00564 }
00565 
00566 Int_t RawDcsEnvMonitorBlock::GetCalEnvIsTriggerEvent(Int_t indx) const
00567 {
00568         if (GetEnvDetector()!=Detector::kCalDet)
00569                 return 0;
00570         FillEnvArray();
00571         if (GetMinorId()==1)
00572                 return EnvArray[(indx*38)+2];
00573         if (GetMinorId()==2)
00574                 return EnvArray[(indx*43)+2];
00575         if (GetMinorId()==3)
00576                 return EnvArray[(indx*51)+2];
00577         return 0;
00578 }
00579 
00580 Float_t RawDcsEnvMonitorBlock::GetCalCerPressure1(Int_t indx) const
00581 {
00582         if (GetEnvDetector()!=Detector::kCalDet)
00583                 return 0.0;
00584         FillEnvArray();
00585         Float_t fValue=0.0;
00586         if (GetMinorId()==1)
00587                 return fValue;
00588         if (GetMinorId()==2)
00589                 memcpy(&fValue,&EnvArray[(indx*43)+38],4);
00590         if (GetMinorId()==3)
00591                 memcpy(&fValue,&EnvArray[(indx*51)+38],4);
00592         return fValue;;
00593 }
00594 
00595 Float_t RawDcsEnvMonitorBlock::GetCalCerPressure2(Int_t indx) const
00596 {
00597         if (GetEnvDetector()!=Detector::kCalDet)
00598                 return 0.0;
00599         FillEnvArray();
00600         Float_t fValue=0.0;
00601         if (GetMinorId()==1)
00602                 return 0.0;
00603         if (GetMinorId()==2)
00604                 memcpy(&fValue,&EnvArray[(indx*43)+39],4);
00605         if (GetMinorId()==3)
00606                 memcpy(&fValue,&EnvArray[(indx*51)+39],4);
00607         return fValue;
00608 }
00609 
00610 Float_t RawDcsEnvMonitorBlock::GetCalCerPressure3(Int_t indx) const
00611 {
00612         if (GetEnvDetector()!=Detector::kCalDet)
00613                 return 0;
00614         FillEnvArray();
00615         Float_t fValue=0.0;
00616         if (GetMinorId()==1)
00617                 return 0;
00618         if (GetMinorId()==2)
00619                 memcpy(&fValue,&EnvArray[(indx*43)+40],4);
00620         if (GetMinorId()==3)
00621                 memcpy(&fValue,&EnvArray[(indx*51)+40],4);
00622         return fValue;
00623 }
00624 
00625 Float_t RawDcsEnvMonitorBlock::GetCalCerPressure4(Int_t indx) const
00626 {
00627         if (GetEnvDetector()!=Detector::kCalDet)
00628                 return 0;
00629         FillEnvArray();
00630         Float_t fValue=0.0;
00631         if (GetMinorId()==1)
00632                 return 0;
00633         if (GetMinorId()==2)
00634                 memcpy(&fValue,&EnvArray[(indx*43)+41],4);
00635         if (GetMinorId()==3)
00636                 memcpy(&fValue,&EnvArray[(indx*51)+41],4);
00637         return fValue;
00638 }
00639 
00640 Float_t RawDcsEnvMonitorBlock::GetCalCerPressure5(Int_t indx) const
00641 {
00642         if (GetEnvDetector()!=Detector::kCalDet)
00643                 return 0;
00644         FillEnvArray();
00645         Float_t fValue=0.0;
00646         if (GetMinorId()==1)
00647                 return 0;
00648         if (GetMinorId()==2)
00649                 memcpy(&fValue,&EnvArray[(indx*43)+42],4);
00650         if (GetMinorId()==3)
00651                 memcpy(&fValue,&EnvArray[(indx*51)+42],4);
00652         return fValue;
00653 }
00654 
00655 Int_t RawDcsEnvMonitorBlock::GetCalCounter1(Int_t indx) const
00656 {
00657         if (GetEnvDetector()!=Detector::kCalDet)
00658                 return 0;
00659         FillEnvArray();
00660         if (GetMinorId()<3)
00661                 return 0;
00662         return EnvArray[(indx*51)+43];
00663 }
00664 
00665 Int_t RawDcsEnvMonitorBlock::GetCalCounter2(Int_t indx) const
00666 {
00667         if (GetEnvDetector()!=Detector::kCalDet)
00668                 return 0;
00669         FillEnvArray();
00670         if (GetMinorId()<3)
00671                 return 0;
00672         return EnvArray[(indx*51)+44];
00673 }
00674 
00675 Int_t RawDcsEnvMonitorBlock::GetCalCounter3(Int_t indx) const
00676 {
00677         if (GetEnvDetector()!=Detector::kCalDet)
00678                 return 0;
00679         FillEnvArray();
00680         if (GetMinorId()<3)
00681                 return 0;
00682         return EnvArray[(indx*51)+45];
00683 }
00684 
00685 Int_t RawDcsEnvMonitorBlock::GetCalCounter4(Int_t indx) const
00686 {
00687         if (GetEnvDetector()!=Detector::kCalDet)
00688                 return 0;
00689         FillEnvArray();
00690         if (GetMinorId()<3)
00691                 return 0;
00692         return EnvArray[(indx*51)+46];
00693 }
00694 
00695 Int_t RawDcsEnvMonitorBlock::GetCalCounter5(Int_t indx) const
00696 {
00697         if (GetEnvDetector()!=Detector::kCalDet)
00698                 return 0;
00699         FillEnvArray();
00700         if (GetMinorId()<3)
00701                 return 0;
00702         return EnvArray[(indx*51)+47];
00703 }
00704 
00705 Int_t RawDcsEnvMonitorBlock::GetCalCounter6(Int_t indx) const
00706 {
00707         if (GetEnvDetector()!=Detector::kCalDet)
00708                 return 0;
00709         FillEnvArray();
00710         if (GetMinorId()<3)
00711                 return 0;
00712         return EnvArray[(indx*51)+48];
00713 }
00714 
00715 Int_t RawDcsEnvMonitorBlock::GetCalCounter7(Int_t indx) const
00716 {
00717         if (GetEnvDetector()!=Detector::kCalDet)
00718                 return 0;
00719         FillEnvArray();
00720         if (GetMinorId()<3)
00721                 return 0;
00722         return EnvArray[(indx*51)+49];
00723 }
00724 
00725 Int_t RawDcsEnvMonitorBlock::GetCalCounter8(Int_t indx) const
00726 {
00727         if (GetEnvDetector()!=Detector::kCalDet)
00728                 return 0;
00729         FillEnvArray();
00730         if (GetMinorId()<3)
00731                 return 0;
00732         return EnvArray[(indx*51)+50];
00733 }
00734 
00735 Float_t RawDcsEnvMonitorBlock::GetNearTemperature(Int_t indx) const
00736 {
00737         FillEnvArray();
00738         if (GetEnvDetector()!=Detector::kNear)
00739                 return 0.0;
00740         Float_t fValue=0.0;
00741         memcpy(&fValue,&EnvArray[(indx*61)+1],4);
00742         return fValue;
00743 }
00744 
00745 Float_t RawDcsEnvMonitorBlock::GetNearHumid(Int_t indx) const
00746 {
00747         FillEnvArray();
00748         if (GetEnvDetector()!=Detector::kNear)
00749                 return 0.0;
00750         Float_t fValue=0.0;
00751         memcpy(&fValue,&EnvArray[(indx*61)+2],4);
00752         return fValue;
00753 }
00754 
00755 Float_t RawDcsEnvMonitorBlock::GetNearPressure(Int_t indx) const
00756 {
00757         FillEnvArray();
00758         if (GetEnvDetector()!=Detector::kNear)
00759                 return 0.0;
00760         Float_t fValue=0.0;
00761         memcpy(&fValue,&EnvArray[(indx*61)+3],4);
00762         return fValue;
00763 }
00764 
00765 Int_t RawDcsEnvMonitorBlock::GetNearRadonCounts(Int_t indx) const
00766 {
00767         FillEnvArray();
00768         if (GetEnvDetector()!=Detector::kNear)
00769                 return 0;
00770         return EnvArray[(indx*61)+4];
00771 }
00772 
00773 void RawDcsEnvMonitorBlock::GetNearEnvThermArray(Int_t indx, Int_t iArray[56]) const
00774 {
00775         FillEnvArray();
00776         if (GetEnvDetector()!=Detector::kNear)
00777                 return;
00778         for (Int_t i=0;i<56;i++)
00779         {
00780                 iArray[i]=EnvArray[(indx*61)+i+5];
00781         }
00782 }

Generated on Mon Feb 15 11:07:28 2010 for loon by  doxygen 1.3.9.1