BeamData.cc File Reference

#include "BeamData.h"
#include <OnlineUtil/rawBlockIds.h>
#include <OnlineUtil/rdChecksum.h>
#include <OnlineUtil/rototalk.h>
#include <OnlineUtil/rawBeamDataBlockLayout.h>
#include <map>
#include <string>
#include <vector>
#include <cassert>
#include <iostream>
#include <cstdio>
#include <unistd.h>
#include <cstring>

Go to the source code of this file.

Classes

struct  Header
struct  HeaderBlock
class  BeamDataImp
struct  BeamDataImp::DeviceData

Functions

int32_t make_block_id (int32_t majorid, int32_t minorid=0)
string secnsec2filename (int32_t sec, int32_t nsec)

Function Documentation

int32_t make_block_id ( int32_t  majorid,
int32_t  minorid = 0 
)

Definition at line 29 of file BeamData.cc.

Referenced by BeamDataImp::create_block().

00030 {
00031     int32_t cfns=(1<<1) + (1<<0);
00032     int32_t csf = 0;
00033     return (csf << 28) + (cfns<<24) + (majorid<<8) + (minorid<<0);
00034 }

string secnsec2filename ( int32_t  sec,
int32_t  nsec 
)

Definition at line 186 of file BeamData.cc.

References fname.

00187 {
00188     const int32_t nspersec = 1000000000;
00189     while (nsec<0) {
00190         nsec += nspersec;
00191         sec -= 1;
00192     }
00193     while (nsec >= nspersec) {
00194         nsec -= nspersec;
00195         sec -= 1;
00196     }
00197 
00198     time_t atime = sec;
00199     struct tm *ptm = gmtime(&atime);
00200     int32_t dat = (1900+ptm->tm_year)*10000+(1+ptm->tm_mon)*100+ptm->tm_mday;
00201     if (dat>19700000) dat %= 1000000;
00202     int32_t tim = ptm->tm_hour*10000 + ptm->tm_min*100 + ptm->tm_sec;
00203 
00204     char buf[80];
00205     snprintf(buf,80,"B%6.6d_%6.6d.mbeam.root",dat,tim);
00206     string fname = buf;
00207     return fname;
00208 }


Generated on 15 Jul 2018 for loon by  doxygen 1.6.1