Bool_t TempVsTime::Process(Long64_t entry) { // The Process() function is called for each entry in the tree (or possibly // keyed object in the case of PROOF) to be processed. The entry argument // specifies which entry in the currently loaded tree is to be processed. // It can be passed to either TempVsTime::GetEntry() or TBranch::GetEntry() // to read either all or the required parts of the data. When processing // keyed objects with PROOF, the object is already loaded and is available // via the fObject pointer. // // This function should contain the "body" of the analysis. It can contain // simple or elaborate selection criteria, run algorithms on the data // of the event and typically fill histograms. // // The processing can be stopped by calling Abort(). // // Use fStatus to set the return value of TTree::Process(). // // The return value is currently not used. GetEntry(entry); static bool firstEntry = true; if (firstEntry) { minUTime = uTime; lastCurrent = current1; lastWorkingTemperature = workingTemperature; firstEntry = false; } uTime -= minUTime; maxUTime = uTime; temperature0 -= cal[0]; temperature1 -= cal[1]; temperature2 -= cal[2]; temperature3 -= cal[3]; temperature4 -= cal[4]; temperature5 -= cal[5]; temperature6 -= cal[6]; temperature7 -= cal[7]; checkTemperature(temperature0); checkTemperature(temperature1); checkTemperature(temperature2); checkTemperature(temperature3); checkTemperature(temperature4); checkTemperature(temperature5); checkTemperature(temperature6); checkTemperature(temperature7); T1 = temperature0; T2 = temperature1; T3 = temperature2; T4 = temperature3; T5 = temperature4; Ttop = temperature5; Tbottom = temperature6; Tambient = temperature7; if (checkTemperature2(T1)) pushPoint(grT[1], uTime, T1); if (checkTemperature2(T2)) pushPoint(grT[2], uTime, T2); if (checkTemperature2(T3)) pushPoint(grT[3], uTime, T3); if (checkTemperature2(T4)) pushPoint(grT[4], uTime, T4); if (checkTemperature2(T5)) pushPoint(grT[5], uTime, T5); if (checkTemperature2(Ttop)) pushPoint(grTtop, uTime, Ttop); if (checkTemperature2(Tbottom)) pushPoint(grTbottom, uTime, Tbottom); if (checkTemperature2(Tambient)) pushPoint(grTambient, uTime, Tambient); pushPoint(grCurrent, uTime, current1); pushPoint(grVoltage, uTime, voltage1); if (current1!=lastCurrent) { std::cout << "current changed to " << current1 << " A (" << voltage1 << " V) @ " << uTime << std::endl; } lastCurrent = current1; pushPoint(grBath, uTime, bathTemperature); if (workingTemperature!=lastWorkingTemperature) { std::cout << "working temperature changed to " << workingTemperature << " degC @ " << uTime << std::endl; } lastWorkingTemperature = workingTemperature; return kTRUE; }
void PulseOximeter::update() { checkSample(); checkCurrentBias(); checkTemperature(); }