AraEvent/AtriSensorHkData.cxx
00001 00002 00003 00004 00005 00006 00007 00008 00009 #include "AtriSensorHkData.h" 00010 #include "TMath.h" 00011 #include <iostream> 00012 #include <fstream> 00013 #include <cstring> 00014 ClassImp(AtriSensorHkData); 00015 00016 AtriSensorHkData::AtriSensorHkData() 00017 { 00018 //Default Constructor 00019 } 00020 00021 AtriSensorHkData::~AtriSensorHkData() { 00022 //Default Destructor 00023 } 00024 00025 00026 AtriSensorHkData::AtriSensorHkData(AraSensorHk_t *theHk) 00027 :RawAraGenericHeader(&(theHk->gHdr)) 00028 { 00029 00030 unixTime=theHk->unixTime; 00031 unixTimeUs=theHk->unixTimeUs; 00032 00033 atriVoltage=theHk->atriVoltage; 00034 atriCurrent=theHk->atriCurrent; 00035 memcpy(ddaTemp,theHk->ddaTemp,sizeof(UShort_t)*DDA_PER_ATRI); 00036 memcpy(tdaTemp,theHk->tdaTemp,sizeof(UShort_t)*TDA_PER_ATRI); 00037 memcpy(ddaVoltageCurrent,theHk->ddaVoltageCurrent,sizeof(UInt_t)*DDA_PER_ATRI); 00038 memcpy(tdaVoltageCurrent,theHk->tdaVoltageCurrent,sizeof(UInt_t)*DDA_PER_ATRI); 00039 00040 } 00041 00042 00043 Double_t AtriSensorHkData::getDdaVoltage(Int_t dda){ 00044 if(dda >= DDA_PER_ATRI || dda < 0) return -1; 00045 // UInt_t ddaVoltageADC = (ddaVoltageCurrent[dda] & 0xff0000) >> 12; 00046 // // printf("ddaVoltageADC %u\n", ddaVoltageADC); 00047 // ddaVoltageADC = ddaVoltageADC | ((ddaVoltageCurrent[dda] & 0x0000f0) >> 4); 00048 // // printf("ddaVoltageADC %u\n", ddaVoltageADC); 00049 // Double_t ddaVoltageVolts = ddaVoltageADC * (6.65/4096); 00050 // return ddaVoltageVolts; 00051 return 1.*(ddaVoltageCurrent[dda]>>16); 00052 00053 00054 } 00055 Double_t AtriSensorHkData::getDdaCurrent(Int_t dda){ 00056 if(dda >= DDA_PER_ATRI) return -1; 00057 UInt_t ddaCurrentADC = (ddaVoltageCurrent[dda] & 0x00ff00) >> 4; 00058 ddaCurrentADC = ddaCurrentADC | (ddaVoltageCurrent[dda] & 0x0000ff) ; 00059 Double_t ddaCurrentAmps = ddaCurrentADC * (0.10584/4096) / 0.1; 00060 return ddaCurrentAmps; 00061 00062 }
Generated on Mon Mar 18 16:00:44 2013 for ARA ROOT v3.4 Software by
