SpillFunctions.cxx File Reference

#include "SpillFunctions.h"
#include "RawData/RawDaqHeader.h"
#include <iostream>
#include <cmath>
#include "TString.h"

Go to the source code of this file.

Functions

const char * SpillWindowSelectionString (bool useTrigger, double window)
bool CloseToSpillAtFar (int sec1000, int sec, int nsec1000, int nsec, double window)

Function Documentation

bool CloseToSpillAtFar ( int  sec1000,
int  sec,
int  nsec1000,
int  nsec,
double  window 
)

Definition at line 20 of file SpillFunctions.cxx.

References SpillTimeFinder::GetTimeToNearestSpill(), SpillTimeFinder::Instance(), SimFlag::kData, and Detector::kFar.

00022 {
00023   sec += sec1000*1000;
00024   nsec += nsec1000*1000;
00025   VldContext cx(Detector::kFar,SimFlag::kData,VldTimeStamp(sec,nsec));
00026   double dt = SpillTimeFinder::Instance().GetTimeToNearestSpill(cx);
00027   //std::cout << "CloseToSpill: " << sec << "\t" << nsec << "\t" << dt*1e6 << "us" << std::endl;    
00028   if(fabs(dt)<window) return true;
00029   return false;
00030 }

const char* SpillWindowSelectionString ( bool  useTrigger,
double  window 
)

Definition at line 8 of file SpillFunctions.cxx.

References Form().

00009 {
00010   const char* trigstr = (useTrigger) ? 
00011     "(((RawDaqSnarlHeader*)fHeader)->GetTrigSrc()>65000)&&" : "";
00012   const char* timeargstr =
00013     "fHeader->GetVldContext().GetTimeStamp().GetSec()/1000,"
00014     "fHeader->GetVldContext().GetTimeStamp().GetSec()%1000,"
00015     "fHeader->GetVldContext().GetTimeStamp().GetNanoSec()/1000,"
00016     "fHeader->GetVldContext().GetTimeStamp().GetNanoSec()%1000";
00017   return Form("%sCloseToSpillAtFar(%s,%f)",trigstr,timeargstr,window);
00018 }


Generated on 8 Jul 2019 for loon by  doxygen 1.6.1