BDUniquify.cxx File Reference

#include "BDUniquify.h"
#include "BDEarliest.h"
#include <RawData/RawBeamData.h>
#include <RawData/RawBeamMonBlock.h>
#include <RawData/RawBeamMonHeaderBlock.h>
#include <RawData/RawRecord.h>
#include <MinosObjectMap/MomNavigator.h>
#include <Validity/VldTimeStamp.h>
#include <TIterator.h>
#include <algorithm>
#include <list>
#include <cmath>

Go to the source code of this file.

Functions

static size_t count_good (const BDUniquify::BlockPair &p)
bool block_pair_less (const BDUniquify::BlockPair &a, const BDUniquify::BlockPair &b)

Function Documentation

bool block_pair_less ( const BDUniquify::BlockPair a,
const BDUniquify::BlockPair b 
)

Definition at line 40 of file BDUniquify.cxx.

References count_good().

Referenced by BDUniquify::GetUniqueBlocks().

00042 {
00043 
00044 
00045     size_t sa = count_good(a);
00046     size_t sb = count_good(b);
00047 
00048     if (sa == sb) 
00049         return a.first->GetSpillCountNum() > b.first->GetSpillCountNum();
00050 
00051     return sa > sb;
00052 }

static size_t count_good ( const BDUniquify::BlockPair p  )  [static]

Definition at line 23 of file BDUniquify.cxx.

References RawBeamData::GetMsecs(), and RawBeamData::GetSeconds().

Referenced by block_pair_less().

00024 {
00025     vector<string> names = p.second->GetNames();
00026     size_t siz = names.size();
00027     VldTimeStamp vts = (*p.first).GetTimeStamp();
00028     int bad = 0;
00029     for (size_t ind=0; ind<siz; ++ind) {
00030         const RawBeamData* rbd = (*p.second)[names[ind]];
00031         if (!rbd) continue;
00032 
00033         VldTimeStamp tmp(rbd->GetSeconds(),rbd->GetMsecs()*1000000);
00034         if (fabs(vts - tmp) > 0.5) ++bad;
00035     }
00036     return siz-bad;
00037 }


Generated on 15 Jul 2018 for loon by  doxygen 1.6.1