All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
icarus::crt::CRTRawTree Class Reference

#include <CRTRawTree.h>

Public Member Functions

 CRTRawTree (TTree *tr)
 
size_t GetNEntries () const
 
uint64_t GetAbsTime (size_t ientry) const
 
uint8_t GetMac (size_t ientry) const
 
uint16_t GetADC (size_t ientry, uint8_t chan) const
 
float GetInstRate (size_t ientry_prev, size_t ientry_next) const
 
float GetPollRate (size_t ientry) const
 
uint64_t GetInterval (size_t ientry1, size_t ientry2) const
 

Private Member Functions

void Init ()
 

Private Attributes

TTree * fTree
 
uint8_t fMac5
 
uint16_t fFlags
 
uint16_t fLostcpu
 
uint16_t fLostfpga
 
uint32_t fTs0
 
uint32_t fTs1
 
uint16_t fAdc [32]
 
uint32_t fCoinc
 
ULong64_t fRun_start_time
 
ULong64_t fThis_poll_start
 
ULong64_t fThis_poll_end
 
ULong64_t fLast_poll_start
 
ULong64_t fLast_poll_end
 
int32_t fSystem_clock_deviation
 
uint32_t fFeb_in_poll
 
uint32_t fFeb_event_number
 
uint32_t fSequence_id
 
ULong64_t fFragment_timestamp
 
TBranch * b_Mac5
 
TBranch * b_Flags
 
TBranch * b_Lostcpu
 
TBranch * b_Lostfpga
 
TBranch * b_Ts0
 
TBranch * b_Ts1
 
TBranch * b_Adc
 
TBranch * b_Coinc
 
TBranch * b_Run_start_time
 
TBranch * b_This_poll_start
 
TBranch * b_This_poll_end
 
TBranch * b_Last_poll_start
 
TBranch * b_Last_poll_end
 
TBranch * b_System_clock_deviation
 
TBranch * b_Feb_in_poll
 
TBranch * b_Feb_event_number
 
TBranch * b_Sequence_id
 
TBranch * b_Fragment_timestamp
 

Detailed Description

Definition at line 17 of file CRTRawTree.h.

Constructor & Destructor Documentation

CRTRawTree::CRTRawTree ( TTree *  tr)
explicit

Definition at line 8 of file CRTRawTree.cc.

8  {
9 
10  fTree = tr;
11  //fTree->SetMaxVirtualSize(16e9);
12  fTree->LoadBaskets(16e9);
13  Init();
14 }

Member Function Documentation

uint64_t CRTRawTree::GetAbsTime ( size_t  ientry) const

Definition at line 44 of file CRTRawTree.cc.

44  {
45  if(ientry >= GetNEntries()) {
46  std::cout << "ERROR in CRTRawTree::GetAbsTime: entry out of range" << std::endl;
47  return UINT64_MAX;
48  }
49 
50  fTree->GetEntry(ientry);
51  return (uint64_t)fFragment_timestamp;
52 }
ULong64_t fFragment_timestamp
Definition: CRTRawTree.h:48
size_t GetNEntries() const
Definition: CRTRawTree.cc:40
BEGIN_PROLOG could also be cout
uint16_t CRTRawTree::GetADC ( size_t  ientry,
uint8_t  chan 
) const

Definition at line 64 of file CRTRawTree.cc.

64  {
65  if(ientry >= GetNEntries()) {
66  std::cout << "ERROR in CRTRawTree::GetADC: entry out of range" << std::endl;
67  return UINT16_MAX;
68  }
69 
70  fTree->GetEntry(ientry);
71  return fAdc[chan];
72 }
size_t GetNEntries() const
Definition: CRTRawTree.cc:40
BEGIN_PROLOG could also be cout
float CRTRawTree::GetInstRate ( size_t  ientry_prev,
size_t  ientry_next 
) const

Definition at line 74 of file CRTRawTree.cc.

74  {
75 
76 
77  return 1.0/GetInterval(ientry_prev, ientry_next);
78 }
uint64_t GetInterval(size_t ientry1, size_t ientry2) const
Definition: CRTRawTree.cc:90
uint64_t CRTRawTree::GetInterval ( size_t  ientry1,
size_t  ientry2 
) const

Definition at line 90 of file CRTRawTree.cc.

90  {
91  if(ientry1 >= GetNEntries() || ientry2 >= GetNEntries()) {
92  std::cout << "ERROR in CRTRawTree::GetInterval: entry out of range" << std::endl;
93  return UINT64_MAX;
94  }
95 
96  uint64_t tprev, tnext;
97  fTree->GetEntry(ientry1);
98  tprev = fFragment_timestamp;
99 
100  fTree->GetEntry(ientry2);
101  tnext = fFragment_timestamp;
102 
103  if(tnext < tprev){
104  std::cout << "ERROR in CRTRawTree::GetInterval: reverse ordered!" << std::endl;
105  return UINT64_MAX;
106  }
107 
108  return tnext - tprev;
109 }
ULong64_t fFragment_timestamp
Definition: CRTRawTree.h:48
size_t GetNEntries() const
Definition: CRTRawTree.cc:40
BEGIN_PROLOG could also be cout
uint8_t CRTRawTree::GetMac ( size_t  ientry) const

Definition at line 54 of file CRTRawTree.cc.

54  {
55  if(ientry >= GetNEntries()) {
56  std::cout << "ERROR in CRTRawTree::GetMac: entry out of range" << std::endl;
57  return UINT8_MAX;
58  }
59 
60  fTree->GetEntry(ientry);
61  return fMac5;
62 }
size_t GetNEntries() const
Definition: CRTRawTree.cc:40
BEGIN_PROLOG could also be cout
size_t CRTRawTree::GetNEntries ( ) const

Definition at line 40 of file CRTRawTree.cc.

40  {
41  return (size_t)fTree->GetEntriesFast();
42 }
float CRTRawTree::GetPollRate ( size_t  ientry) const

Definition at line 80 of file CRTRawTree.cc.

80  {
81  if(ientry >= GetNEntries()) {
82  std::cout << "ERROR in CRTRawTree::GetPollRate: entry out of range" << std::endl;
83  return FLT_MAX;
84  }
85 
86  fTree->GetEntry(ientry);
88 }
size_t GetNEntries() const
Definition: CRTRawTree.cc:40
ULong64_t fThis_poll_start
Definition: CRTRawTree.h:40
ULong64_t fLast_poll_start
Definition: CRTRawTree.h:42
BEGIN_PROLOG could also be cout
void CRTRawTree::Init ( )
private

Definition at line 16 of file CRTRawTree.cc.

16  {
17 
18  fTree->SetBranchAddress("mac5", &fMac5, &b_Mac5);
19  fTree->SetBranchAddress("flags", &fFlags, &b_Flags);
20  fTree->SetBranchAddress("lostcpu", &fLostcpu, &b_Lostcpu);
21  fTree->SetBranchAddress("lostfpga", &fLostfpga, &b_Lostfpga);
22  fTree->SetBranchAddress("ts0", &fTs0, &b_Ts0);
23  fTree->SetBranchAddress("ts1", &fTs1, &b_Ts1);
24  fTree->SetBranchAddress("adc", &fAdc, &b_Adc);
25  fTree->SetBranchAddress("coinc", &fCoinc, &b_Coinc);
26  fTree->SetBranchAddress("run_start_time", &fRun_start_time, &b_Run_start_time);
27  fTree->SetBranchAddress("this_poll_start", &fThis_poll_start, &b_This_poll_start);
28  fTree->SetBranchAddress("this_poll_end", &fThis_poll_end, &b_This_poll_end);
29  fTree->SetBranchAddress("last_poll_start", &fLast_poll_start, &b_Last_poll_start);
30  fTree->SetBranchAddress("last_poll_end", &fLast_poll_end, &b_Last_poll_end);
31  fTree->SetBranchAddress("system_clock_deviation", &fSystem_clock_deviation, &b_System_clock_deviation);
32  fTree->SetBranchAddress("feb_in_poll", &fFeb_in_poll, &b_Feb_in_poll);
33  fTree->SetBranchAddress("feb_event_number", &fFeb_event_number, &b_Feb_event_number);
34  fTree->SetBranchAddress("sequence_id", &fSequence_id, &b_Sequence_id);
35  fTree->SetBranchAddress("fragment_timestamp", &fFragment_timestamp, &b_Fragment_timestamp);
36 
37 
38 }
ULong64_t fFragment_timestamp
Definition: CRTRawTree.h:48
TBranch * b_Run_start_time
Definition: CRTRawTree.h:58
TBranch * b_This_poll_end
Definition: CRTRawTree.h:60
TBranch * b_This_poll_start
Definition: CRTRawTree.h:59
TBranch * b_Last_poll_end
Definition: CRTRawTree.h:62
TBranch * b_Last_poll_start
Definition: CRTRawTree.h:61
TBranch * b_System_clock_deviation
Definition: CRTRawTree.h:63
int32_t fSystem_clock_deviation
Definition: CRTRawTree.h:44
ULong64_t fRun_start_time
Definition: CRTRawTree.h:39
ULong64_t fThis_poll_start
Definition: CRTRawTree.h:40
TBranch * b_Fragment_timestamp
Definition: CRTRawTree.h:67
uint32_t fFeb_event_number
Definition: CRTRawTree.h:46
ULong64_t fThis_poll_end
Definition: CRTRawTree.h:41
ULong64_t fLast_poll_start
Definition: CRTRawTree.h:42
TBranch * b_Feb_event_number
Definition: CRTRawTree.h:65
ULong64_t fLast_poll_end
Definition: CRTRawTree.h:43

Member Data Documentation

TBranch* icarus::crt::CRTRawTree::b_Adc
private

Definition at line 56 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Coinc
private

Definition at line 57 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Feb_event_number
private

Definition at line 65 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Feb_in_poll
private

Definition at line 64 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Flags
private

Definition at line 51 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Fragment_timestamp
private

Definition at line 67 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Last_poll_end
private

Definition at line 62 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Last_poll_start
private

Definition at line 61 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Lostcpu
private

Definition at line 52 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Lostfpga
private

Definition at line 53 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Mac5
private

Definition at line 50 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Run_start_time
private

Definition at line 58 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Sequence_id
private

Definition at line 66 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_System_clock_deviation
private

Definition at line 63 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_This_poll_end
private

Definition at line 60 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_This_poll_start
private

Definition at line 59 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Ts0
private

Definition at line 54 of file CRTRawTree.h.

TBranch* icarus::crt::CRTRawTree::b_Ts1
private

Definition at line 55 of file CRTRawTree.h.

uint16_t icarus::crt::CRTRawTree::fAdc[32]
private

Definition at line 37 of file CRTRawTree.h.

uint32_t icarus::crt::CRTRawTree::fCoinc
private

Definition at line 38 of file CRTRawTree.h.

uint32_t icarus::crt::CRTRawTree::fFeb_event_number
private

Definition at line 46 of file CRTRawTree.h.

uint32_t icarus::crt::CRTRawTree::fFeb_in_poll
private

Definition at line 45 of file CRTRawTree.h.

uint16_t icarus::crt::CRTRawTree::fFlags
private

Definition at line 32 of file CRTRawTree.h.

ULong64_t icarus::crt::CRTRawTree::fFragment_timestamp
private

Definition at line 48 of file CRTRawTree.h.

ULong64_t icarus::crt::CRTRawTree::fLast_poll_end
private

Definition at line 43 of file CRTRawTree.h.

ULong64_t icarus::crt::CRTRawTree::fLast_poll_start
private

Definition at line 42 of file CRTRawTree.h.

uint16_t icarus::crt::CRTRawTree::fLostcpu
private

Definition at line 33 of file CRTRawTree.h.

uint16_t icarus::crt::CRTRawTree::fLostfpga
private

Definition at line 34 of file CRTRawTree.h.

uint8_t icarus::crt::CRTRawTree::fMac5
private

Definition at line 31 of file CRTRawTree.h.

ULong64_t icarus::crt::CRTRawTree::fRun_start_time
private

Definition at line 39 of file CRTRawTree.h.

uint32_t icarus::crt::CRTRawTree::fSequence_id
private

Definition at line 47 of file CRTRawTree.h.

int32_t icarus::crt::CRTRawTree::fSystem_clock_deviation
private

Definition at line 44 of file CRTRawTree.h.

ULong64_t icarus::crt::CRTRawTree::fThis_poll_end
private

Definition at line 41 of file CRTRawTree.h.

ULong64_t icarus::crt::CRTRawTree::fThis_poll_start
private

Definition at line 40 of file CRTRawTree.h.

TTree* icarus::crt::CRTRawTree::fTree
private

Definition at line 30 of file CRTRawTree.h.

uint32_t icarus::crt::CRTRawTree::fTs0
private

Definition at line 35 of file CRTRawTree.h.

uint32_t icarus::crt::CRTRawTree::fTs1
private

Definition at line 36 of file CRTRawTree.h.


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