Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes

base::SysCoreProc Class Reference

#include <SysCoreProc.h>

Inheritance diagram for base::SysCoreProc:
Inheritance graph
[legend]
Collaboration diagram for base::SysCoreProc:
Collaboration graph
[legend]

Public Member Functions

 SysCoreProc (const char *name, unsigned brdid)
virtual ~SysCoreProc ()
unsigned GetBoardId () const
void SetSyncSource (unsigned id)
void SetNoSyncSource ()
void SetTriggerSignal (unsigned id)
void SetNoTriggerSignal ()
void SetPrint (int nummsg, double left=-1., double right=-1.)
ProcMgrmgr () const
const std::string GetProcName () const
void SetTimeSorting (bool on)
bool IsTimeSorting () const
void SetTriggerWindow (double left, double right)
bool IsSynchronisationRequired () const
virtual bool AddNextBuffer (const Buffer &buf)
virtual bool ScanNewBuffers ()
virtual bool ScanNewBuffersTm ()
virtual void SkipAllData ()
virtual bool SkipBuffers (unsigned cnt)
virtual bool FirstBufferScan (const base::Buffer &buf)
virtual bool SecondBufferScan (const base::Buffer &buf)
unsigned numSyncs () const
SyncMarkergetSync (unsigned n)
SyncMarkerlastSync ()
bool eraseSyncAt (unsigned indx)
virtual bool CollectTriggers (GlobalTriggerMarksQueue &queue)
virtual bool DistributeTriggers (const GlobalTriggerMarksQueue &queue)
virtual bool ScanDataForNewTriggers ()
unsigned NumReadySubevents () const
virtual bool AppendSubevent (base::Event *evt)

Static Public Member Functions

static void SetMaxBrdId (unsigned max)

Protected Types

typedef std::vector< base::BufferBuffersQueue
typedef std::vector
< base::SyncMarker
SyncMarksQueue
typedef std::vector
< base::LocalTriggerMarker
LocalTriggerMarksQueue

Protected Member Functions

virtual bool doTriggerSelection () const
 maximum allowed board id, used for histogramming
void CreateBasicHistograms ()
void FillMsgPerBrdHist (unsigned cnt)
void SetSubPrefix (const char *subname="", int indx=-1, const char *subname2="", int indx2=-1)
H1handle MakeH1 (const char *name, const char *title, int nbins, double left, double right, const char *xtitle=0)
void FillH1 (H1handle h1, double x, double weight=1.)
H2handle MakeH2 (const char *name, const char *title, int nbins1, double left1, double right1, int nbins2, double left2, double right2, const char *options=0)
void FillH2 (H1handle h2, double x, double y, double weight=1.)
C1handle MakeC1 (const char *name, double left, double right, H1handle h1=0)
void ChangeC1 (C1handle c1, double left, double right)
int TestC1 (C1handle c1, double value, double *dist=0)
double GetC1Limit (C1handle c1, bool isleft=true)
void AddSyncMarker (SyncMarker &marker)
void AddTriggerMarker (LocalTriggerMarker &marker)
double local_time_dist (GlobalTime_t tm1, GlobalTime_t tm2)
GlobalTime_t LocalToGlobalTime (GlobalTime_t localtm, unsigned *lastindx=0)
virtual GlobalTime_t ProvidePotentialFlushTime (GlobalTime_t last_marker)
bool VerifyFlushTime (const base::GlobalTime_t &flush_time)
virtual double MaximumDisorderTm () const
unsigned TestHitTime (const base::GlobalTime_t &hittime, bool normal_hit)
virtual unsigned GetTriggerMultipl (unsigned indx)
virtual void SortDataInSubEvent (base::SubEvent *)

Protected Attributes

unsigned fBrdId
unsigned fSyncSource
 board id, which will be used for the filling
unsigned fTriggerSignal
int fNumPrintMessages
double fPrintLeft
 number of messages to be printed
double fPrintRight
 left border to start printing
bool fAnyPrinted
 right border to stop printing
base::H1handle fMsgPerBrd
 true when any message was printed
base::H1handle fALLt
 common histogram for all boards with similar prefix
base::H1handle fAUXt [4]
 histogram for all messages times
base::H1handle fSYNCt [2]
 histogram for AUX times
std::string fName
ProcMgrfMgr
 processor name, used for event naming
BuffersQueue fQueue
unsigned fQueueScanIndex
 index of next buffer which should be scanned
unsigned fQueueScanIndexTm
 index of buffer to scan and set correct times of the buffer head
bool fIsSynchronisationRequired
 true if sync is required
SyncMarksQueue fSyncs
 list of sync markers
unsigned fSyncScanIndex
 sync scan index, use to adjust syncs over many processors
bool fSyncFlag
 boolean, used in sync adjustment procedure
LocalTriggerMarksQueue fLocalTrig
 list of local triggers
GlobalTriggerMarksQueue fGlobalTrig
 list of global triggers in work
unsigned fGlobalTrigScanIndex
 index with first trigger which is not yet ready
unsigned fGlobalTrigRightIndex
 temporary value, used during second buffers scan
bool fTimeSorting
 defines if time sorting should be used for the messages
std::string fPrefix
 prefix, used for histogram names
std::string fSubPrefixD
 sub-prefix for histogram directory
std::string fSubPrefixN
 sub-prefix for histogram names
base::H1handle fTriggerTm
base::H1handle fMultipl
 histogram with time relative to the trigger
base::C1handle triggerWindow
 histogram of event multiplicity

Static Protected Attributes

static unsigned fMaxBrdId = 16
 histogram for SYNC times

Detailed Description

SysCoreProc is base class for many processors of data, provided by SysCore2/3 boards. Main idea is to collect common settings/methods for SysCore variants like: nXYTER, GET4, Spadic1 and probably STS-XYTER Main common part is 250 MHz clock and SYNC/AUX messages which could be used for time synchronization.

Definition at line 15 of file SysCoreProc.h.


Member Typedef Documentation

typedef std::vector<base::Buffer> base::StreamProc::BuffersQueue [protected, inherited]

Definition at line 83 of file StreamProc.h.

typedef std::vector<base::LocalTriggerMarker> base::StreamProc::LocalTriggerMarksQueue [protected, inherited]

Definition at line 87 of file StreamProc.h.

typedef std::vector<base::SyncMarker> base::StreamProc::SyncMarksQueue [protected, inherited]

Definition at line 85 of file StreamProc.h.


Constructor & Destructor Documentation

base::SysCoreProc::SysCoreProc ( const char *  name,
unsigned  brdid 
)

Definition at line 7 of file SysCoreProc.cxx.

References fMaxBrdId, fMsgPerBrd, base::ProcMgr::MakeH1(), and base::StreamProc::mgr().

base::SysCoreProc::~SysCoreProc (  )  [virtual]

Definition at line 24 of file SysCoreProc.cxx.


Member Function Documentation

bool base::StreamProc::AddNextBuffer ( const Buffer buf  )  [virtual, inherited]

Provide next port of data to the processor

Definition at line 273 of file StreamProc.cxx.

References base::StreamProc::fQueue.

void base::StreamProc::AddSyncMarker ( base::SyncMarker marker  )  [protected, inherited]
void base::StreamProc::AddTriggerMarker ( LocalTriggerMarker marker  )  [protected, inherited]
bool base::StreamProc::AppendSubevent ( base::Event evt  )  [virtual, inherited]
void base::StreamProc::ChangeC1 ( C1handle  c1,
double  left,
double  right 
) [protected, inherited]
bool base::StreamProc::CollectTriggers ( GlobalTriggerMarksQueue queue  )  [virtual, inherited]

Method to deliver detected triggers from processor to central manager

Definition at line 420 of file StreamProc.cxx.

References base::StreamProc::fLocalTrig, base::StreamProc::fQueueScanIndexTm, base::GlobalTriggerMarker::globaltm, and base::StreamProc::LocalToGlobalTime().

void base::SysCoreProc::CreateBasicHistograms (  )  [protected]

Definition at line 29 of file SysCoreProc.cxx.

References fALLt, fAUXt, fSYNCt, and base::StreamProc::MakeH1().

Referenced by nx::Processor::Processor(), and get4::Processor::Processor().

bool base::StreamProc::DistributeTriggers ( const GlobalTriggerMarksQueue queue  )  [virtual, inherited]

This is method to get back identified triggers from central manager

Definition at line 452 of file StreamProc.cxx.

References base::StreamProc::fGlobalTrig, base::StreamProc::GetC1Limit(), and base::StreamProc::triggerWindow.

virtual bool base::SysCoreProc::doTriggerSelection (  )  const [inline, protected, virtual]

maximum allowed board id, used for histogramming

Returns true when processor used to select trigger signal In subclass one could have alternative ways of trigger or ROI selections

Reimplemented from base::StreamProc.

Reimplemented in get4::Processor.

Definition at line 37 of file SysCoreProc.h.

References fTriggerSignal.

bool base::StreamProc::eraseSyncAt ( unsigned  indx  )  [inherited]

Removes sync at specified position

Definition at line 193 of file StreamProc.cxx.

References base::StreamProc::fSyncs, and base::StreamProc::fSyncScanIndex.

Referenced by base::ProcMgr::AnalyzeSyncMarkers().

void base::StreamProc::FillH1 ( H1handle  h1,
double  x,
double  weight = 1. 
) [protected, inherited]
void base::StreamProc::FillH2 ( H1handle  h2,
double  x,
double  y,
double  weight = 1. 
) [protected, inherited]

Definition at line 158 of file StreamProc.cxx.

References base::ProcMgr::FillH2(), and base::StreamProc::mgr().

Referenced by nx::Processor::FirstBufferScan().

void base::SysCoreProc::FillMsgPerBrdHist ( unsigned  cnt  )  [inline, protected]
virtual bool base::StreamProc::FirstBufferScan ( const base::Buffer buf  )  [inline, virtual, inherited]

Central method to scan new data in the queue This should include:

  • data indexing;
  • raw histogram filling;
  • search for special time markers;
  • multiplicity histogramming (if necessary)

Reimplemented in get4::Processor, and nx::Processor.

Definition at line 215 of file StreamProc.h.

Referenced by base::StreamProc::ScanNewBuffers().

unsigned base::SysCoreProc::GetBoardId (  )  const [inline]
double base::StreamProc::GetC1Limit ( C1handle  c1,
bool  isleft = true 
) [protected, inherited]
const std::string base::StreamProc::GetProcName (  )  const [inline, inherited]

Definition at line 174 of file StreamProc.h.

References base::StreamProc::fName.

Referenced by base::StreamProc::AppendSubevent(), and nx::Processor::~Processor().

SyncMarker& base::StreamProc::getSync ( unsigned  n  )  [inline, inherited]
virtual unsigned base::StreamProc::GetTriggerMultipl ( unsigned  indx  )  [inline, protected, virtual, inherited]

Reimplemented in get4::Processor, and nx::Processor.

Definition at line 163 of file StreamProc.h.

Referenced by base::StreamProc::AppendSubevent().

bool base::StreamProc::IsSynchronisationRequired (  )  const [inline, inherited]

Method indicate if any kind of time-synchronization technique should be applied for the processor. If true, sync messages must be produced by processor and will be used. If false, local time stamps could be immediately used (with any necessary conversion)

Definition at line 191 of file StreamProc.h.

References base::StreamProc::fIsSynchronisationRequired.

Referenced by base::StreamProc::AddSyncMarker(), base::ProcMgr::AnalyzeSyncMarkers(), and base::StreamProc::LocalToGlobalTime().

bool base::StreamProc::IsTimeSorting (  )  const [inline, inherited]

Definition at line 178 of file StreamProc.h.

References base::StreamProc::fTimeSorting.

Referenced by base::StreamProc::AppendSubevent().

SyncMarker& base::StreamProc::lastSync (  )  [inline, inherited]

Definition at line 224 of file StreamProc.h.

References base::StreamProc::fSyncs.

double base::StreamProc::local_time_dist ( GlobalTime_t  tm1,
GlobalTime_t  tm2 
) [inline, protected, inherited]

Definition at line 142 of file StreamProc.h.

Referenced by base::StreamProc::LocalToGlobalTime().

base::GlobalTime_t base::StreamProc::LocalToGlobalTime ( base::GlobalTime_t  localtm,
unsigned *  lastindx = 0 
) [protected, inherited]
base::C1handle base::StreamProc::MakeC1 ( const char *  name,
double  left,
double  right,
H1handle  h1 = 0 
) [protected, inherited]
base::H1handle base::StreamProc::MakeH1 ( const char *  name,
const char *  title,
int  nbins,
double  left,
double  right,
const char *  xtitle = 0 
) [protected, inherited]
base::H2handle base::StreamProc::MakeH2 ( const char *  name,
const char *  title,
int  nbins1,
double  left1,
double  right1,
int  nbins2,
double  left2,
double  right2,
const char *  options = 0 
) [protected, inherited]
virtual double base::StreamProc::MaximumDisorderTm (  )  const [inline, protected, virtual, inherited]

Time constant, defines how far disorder of messages can go

Reimplemented in get4::Processor, and nx::Processor.

Definition at line 158 of file StreamProc.h.

Referenced by base::StreamProc::ScanDataForNewTriggers(), and base::StreamProc::TestHitTime().

ProcMgr* base::StreamProc::mgr (  )  const [inline, inherited]
unsigned base::StreamProc::NumReadySubevents (  )  const [inline, inherited]

Returns number of already build events

Definition at line 238 of file StreamProc.h.

References base::StreamProc::fGlobalTrigScanIndex.

unsigned base::StreamProc::numSyncs (  )  const [inline, inherited]

Returns total number of sync markers

Definition at line 222 of file StreamProc.h.

References base::StreamProc::fSyncs.

Referenced by base::ProcMgr::AnalyzeSyncMarkers(), and base::StreamProc::LocalToGlobalTime().

base::GlobalTime_t base::StreamProc::ProvidePotentialFlushTime ( GlobalTime_t  last_marker  )  [protected, virtual, inherited]

Method should return time, which could be flushed from the processor

Definition at line 325 of file StreamProc.cxx.

References base::StreamProc::fQueue, and base::StreamProc::fQueueScanIndexTm.

bool base::StreamProc::ScanDataForNewTriggers (  )  [virtual, inherited]
bool base::StreamProc::ScanNewBuffers (  )  [virtual, inherited]

Scanning all new buffers in the queue

Definition at line 280 of file StreamProc.cxx.

References base::StreamProc::FirstBufferScan(), base::StreamProc::fQueue, and base::StreamProc::fQueueScanIndex.

bool base::StreamProc::ScanNewBuffersTm (  )  [virtual, inherited]

With new calibration set (where possible) time of buffers

Definition at line 306 of file StreamProc.cxx.

References base::StreamProc::fQueue, base::StreamProc::fQueueScanIndexTm, base::StreamProc::fSyncs, base::StreamProc::fSyncScanIndex, and base::StreamProc::LocalToGlobalTime().

virtual bool base::StreamProc::SecondBufferScan ( const base::Buffer buf  )  [inline, virtual, inherited]

Second generic scan of buffer Here selection of data for region-of-interest should be performed

Reimplemented in get4::Processor, and nx::Processor.

Definition at line 219 of file StreamProc.h.

Referenced by base::StreamProc::ScanDataForNewTriggers().

static void base::SysCoreProc::SetMaxBrdId ( unsigned  max  )  [inline, static]

Set maximum board number, used for histograming

Definition at line 86 of file SysCoreProc.h.

References fMaxBrdId.

void base::SysCoreProc::SetNoSyncSource (  )  [inline]

This declares that local time stamp will be used. Should work with single ROC setup or with optical-based readout, where all time counters are synchronized

Definition at line 63 of file SysCoreProc.h.

References SetSyncSource().

Referenced by get4::Processor::Processor().

void base::SysCoreProc::SetNoTriggerSignal (  )  [inline]

Disable any trigger generation

Definition at line 71 of file SysCoreProc.h.

References fTriggerSignal.

Referenced by nx::Processor::Processor(), and get4::Processor::Processor().

void base::SysCoreProc::SetPrint ( int  nummsg,
double  left = -1.,
double  right = -1. 
) [inline]

Set number of messages to be printed Optionally, one could specify time window where messages should be taken Time is same as time on histogram like AUX0t or SYNC1 (truncated to 1000 s)

Definition at line 77 of file SysCoreProc.h.

References fAnyPrinted, fNumPrintMessages, fPrintLeft, and fPrintRight.

void base::StreamProc::SetSubPrefix ( const char *  subname = "",
int  indx = -1,
const char *  subname2 = "",
int  indx2 = -1 
) [protected, inherited]

Set subprefix for histograms and conditions

Definition at line 84 of file StreamProc.cxx.

References base::StreamProc::fSubPrefixD, and base::StreamProc::fSubPrefixN.

Referenced by nx::Processor::Processor(), get4::Processor::Processor(), and get4::Processor::setRefChannel().

void base::SysCoreProc::SetSyncSource ( unsigned  id  )  [inline]

Set signal id, used for time synchronization One could use SYNC0 (id=0) or SYNC1 (id=1) for synchronization with other components if other id specified, local time stamp will be used and no any sync will be used

Definition at line 54 of file SysCoreProc.h.

References base::StreamProc::fIsSynchronisationRequired, and fSyncSource.

Referenced by nx::Processor::Processor(), and SetNoSyncSource().

void base::StreamProc::SetTimeSorting ( bool  on  )  [inline, inherited]

Enable/disable time sorting of data in output event

Definition at line 177 of file StreamProc.h.

References base::StreamProc::fTimeSorting.

void base::SysCoreProc::SetTriggerSignal ( unsigned  id  )  [inline]

Set signal kind which should be used for data selection Values 0..3 are for AUX0 - AUX3 Values 10,11 are for SYNC0, SYNC1

Definition at line 68 of file SysCoreProc.h.

References fTriggerSignal.

void base::StreamProc::SetTriggerWindow ( double  left,
double  right 
) [inline, inherited]

Definition at line 181 of file StreamProc.h.

References base::StreamProc::ChangeC1(), and base::StreamProc::triggerWindow.

void base::StreamProc::SkipAllData (  )  [virtual, inherited]
bool base::StreamProc::SkipBuffers ( unsigned  cnt  )  [virtual, inherited]
virtual void base::StreamProc::SortDataInSubEvent ( base::SubEvent  )  [inline, protected, virtual, inherited]

Reimplemented in get4::Processor, and nx::Processor.

Definition at line 165 of file StreamProc.h.

Referenced by base::StreamProc::AppendSubevent().

int base::StreamProc::TestC1 ( C1handle  c1,
double  value,
double *  dist = 0 
) [protected, inherited]

Definition at line 182 of file StreamProc.cxx.

References base::StreamProc::mgr(), and base::ProcMgr::TestC1().

unsigned base::StreamProc::TestHitTime ( const base::GlobalTime_t hittime,
bool  normal_hit 
) [protected, inherited]
bool base::StreamProc::VerifyFlushTime ( const base::GlobalTime_t flush_time  )  [protected, inherited]

Method must ensure that processor scanned such time and can really skip this data

Definition at line 338 of file StreamProc.cxx.

References base::StreamProc::fQueue, and base::StreamProc::fQueueScanIndexTm.


Field Documentation

common histogram for all boards with similar prefix

Definition at line 29 of file SysCoreProc.h.

Referenced by CreateBasicHistograms(), nx::Processor::FirstBufferScan(), and get4::Processor::FirstBufferScan().

right border to stop printing

Definition at line 26 of file SysCoreProc.h.

Referenced by nx::Processor::FirstBufferScan(), and SetPrint().

histogram for all messages times

Definition at line 30 of file SysCoreProc.h.

Referenced by CreateBasicHistograms(), nx::Processor::FirstBufferScan(), and get4::Processor::FirstBufferScan().

unsigned base::SysCoreProc::fBrdId [protected]

Definition at line 18 of file SysCoreProc.h.

Referenced by GetBoardId().

unsigned base::StreamProc::fGlobalTrigRightIndex [protected, inherited]

temporary value, used during second buffers scan

Definition at line 108 of file StreamProc.h.

Referenced by base::StreamProc::ScanDataForNewTriggers(), and base::StreamProc::TestHitTime().

unsigned base::StreamProc::fGlobalTrigScanIndex [protected, inherited]
bool base::StreamProc::fIsSynchronisationRequired [protected, inherited]

true if sync is required

Definition at line 98 of file StreamProc.h.

Referenced by base::StreamProc::IsSynchronisationRequired(), and SetSyncSource().

unsigned base::SysCoreProc::fMaxBrdId = 16 [static, protected]

histogram for SYNC times

Definition at line 33 of file SysCoreProc.h.

Referenced by SetMaxBrdId(), and SysCoreProc().

ProcMgr* base::StreamProc::fMgr [protected, inherited]

processor name, used for event naming

Definition at line 91 of file StreamProc.h.

Referenced by base::StreamProc::mgr(), and base::StreamProc::StreamProc().

true when any message was printed

Definition at line 28 of file SysCoreProc.h.

Referenced by FillMsgPerBrdHist(), and SysCoreProc().

histogram with time relative to the trigger

Definition at line 117 of file StreamProc.h.

Referenced by base::StreamProc::AppendSubevent(), and base::StreamProc::StreamProc().

std::string base::StreamProc::fName [protected, inherited]

Definition at line 23 of file SysCoreProc.h.

Referenced by nx::Processor::FirstBufferScan(), and SetPrint().

std::string base::StreamProc::fPrefix [protected, inherited]

prefix, used for histogram names

Definition at line 112 of file StreamProc.h.

Referenced by base::StreamProc::MakeC1(), base::StreamProc::MakeH1(), base::StreamProc::MakeH2(), and base::StreamProc::StreamProc().

double base::SysCoreProc::fPrintLeft [protected]

number of messages to be printed

Definition at line 24 of file SysCoreProc.h.

Referenced by nx::Processor::FirstBufferScan(), and SetPrint().

double base::SysCoreProc::fPrintRight [protected]

left border to start printing

Definition at line 25 of file SysCoreProc.h.

Referenced by nx::Processor::FirstBufferScan(), and SetPrint().

BuffersQueue base::StreamProc::fQueue [protected, inherited]
unsigned base::StreamProc::fQueueScanIndex [protected, inherited]

index of next buffer which should be scanned

Definition at line 95 of file StreamProc.h.

Referenced by base::StreamProc::AddSyncMarker(), base::StreamProc::AddTriggerMarker(), base::StreamProc::ScanNewBuffers(), and base::StreamProc::SkipBuffers().

unsigned base::StreamProc::fQueueScanIndexTm [protected, inherited]
std::string base::StreamProc::fSubPrefixD [protected, inherited]

sub-prefix for histogram directory

Definition at line 113 of file StreamProc.h.

Referenced by base::StreamProc::MakeC1(), base::StreamProc::MakeH1(), base::StreamProc::MakeH2(), and base::StreamProc::SetSubPrefix().

std::string base::StreamProc::fSubPrefixN [protected, inherited]

sub-prefix for histogram names

Definition at line 114 of file StreamProc.h.

Referenced by base::StreamProc::MakeC1(), base::StreamProc::MakeH1(), base::StreamProc::MakeH2(), and base::StreamProc::SetSubPrefix().

bool base::StreamProc::fSyncFlag [protected, inherited]

boolean, used in sync adjustment procedure

Definition at line 101 of file StreamProc.h.

Referenced by base::ProcMgr::AnalyzeSyncMarkers().

SyncMarksQueue base::StreamProc::fSyncs [protected, inherited]
unsigned base::StreamProc::fSyncScanIndex [protected, inherited]
unsigned base::SysCoreProc::fSyncSource [protected]

board id, which will be used for the filling

Definition at line 20 of file SysCoreProc.h.

Referenced by nx::Processor::FirstBufferScan(), get4::Processor::FirstBufferScan(), and SetSyncSource().

histogram for AUX times

Definition at line 31 of file SysCoreProc.h.

Referenced by CreateBasicHistograms(), nx::Processor::FirstBufferScan(), and get4::Processor::FirstBufferScan().

bool base::StreamProc::fTimeSorting [protected, inherited]

defines if time sorting should be used for the messages

Definition at line 110 of file StreamProc.h.

Referenced by base::StreamProc::IsTimeSorting(), and base::StreamProc::SetTimeSorting().

unsigned base::SysCoreProc::fTriggerSignal [protected]

Definition at line 116 of file StreamProc.h.

Referenced by base::StreamProc::StreamProc(), and base::StreamProc::TestHitTime().

histogram of event multiplicity

window used for data selection

Definition at line 119 of file StreamProc.h.

Referenced by base::StreamProc::DistributeTriggers(), base::StreamProc::ScanDataForNewTriggers(), base::StreamProc::SetTriggerWindow(), and base::StreamProc::StreamProc().


The documentation for this class was generated from the following files: