Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TPCRateData.m File Reference

Go to the source code of this file.

Functions

add data DataLoadBCO (start_time_bin:(start_time_bin+trigger_window_in_BCO))
 
trigger if (trig_event(i)==1) current_trigger_window
 
 TriggerLoadBCO (start_time_bin:(start_time_bin+trigger_window_in_BCO))
 
end fprintf ('Throttled event/total=%.3f;Throttled data/total=%.3f;Triggered event/total=%.3f;Triggered data/total==%.3f\n',...%n_recorded/n, recorded_data/n, n_triggered./n, triggered_data/n)
 
 fprintf ('------------\n')
 
 fprintf ('full_rate=%.0f kHz;trig_rate=%.0f kHz;trigger_window=%.1f us;\n',...full_rate/1e3, trig_rate/1e3, trigger_window *1e6)
 
 fprintf ('Trigger rate *drift window=%.2f;Full rate *drift window=%.2f;Trigger rate/full rate=%.2f;\n',...trig_rate *trigger_window, full_rate *trigger_window, trig_rate/full_rate)
 
 fprintf ('throttled data/total=%.3f;Triggered data/total=%.3f;throttled/trigger=%.3f\n',...sum((TriggerLoadBCO >0).*DataLoadBCO)/sum(DataLoadBCO), sum(TriggerLoadBCO.*DataLoadBCO)/sum(DataLoadBCO),...sum((TriggerLoadBCO >0).*DataLoadBCO/sum(TriggerLoadBCO.*DataLoadBCO)))
 
 fprintf ('throttled data rate=%.0f Gbps;Triggered data rate=%.0f\n',...sum((TriggerLoadBCO >0).*DataLoadBCO)/sum(DataLoadBCO)*full_rate *DataRateBeforeTriggerPerkHz,...sum(TriggerLoadBCO.*DataLoadBCO)/sum(DataLoadBCO)*full_rate *DataRateBeforeTriggerPerkHz)
 
 fprintf ('throttled event/total=%.3f;Triggered event/total==%.3f;throttled/trigger=%.3f\n',...%recorded_data/n, triggered_data/n, recorded_data/triggered_data)
 
end readout if (current_trigger_window >0)%%n_recorded
 
 if (current_trigger_window >=trigger_window)%%if(recorded_window >
 
 elseif (recorded_window >=0)%recorded_data = recorded_data + (current_trigger_window - recorded_window)/trigger_window
 

Variables

close all clear all n = 1000
 
 full_rate = 100e3
 
 trig_rate = 15e3
 
 trigger_window = 18e-6
 
 BCO = 10e6
 
Active region readout only trigger_window_in_BCO = int64(trigger_window * BCO)
 
 event_time_gap
 
 DataLoadBCO = zeros(int64(n/full_rate*BCO*1.1), 1)
 
 TriggerLoadBCO = zeros(int64(n/full_rate*BCO*1.1), 1)
 
 trig_event = binornd(1,trig_rate./full_rate, n, 1)
 
 DataRateBeforeTriggerPerkHz = (1/100e3)* 966. *.5*.6
 
 recorded_data = 0
 
 triggered_data = 0
 
 n_recorded = 0
 
 n_triggered = 0
 
 current_time = 0
 
for i
 
 current_trigger_window = -1
 
 recorded_window = -1
 

Function Documentation

add data DataLoadBCO ( start_time_bin:  start_time_bin+trigger_window_in_BCO)
end fprintf ( 'Throttled event total = %.3f;Throttled data/total=%.3f;Triggered event/total=%.3f;Triggered data/total==%.3f\n',
...%n_recorded n,
recorded_data n,
n_triggered./  n,
triggered_data n 
)
fprintf ( '------------\n )
fprintf ( full_rate = %.0f kHz;trig_rate=%.0f kHz;trigger_window=%.1f us;\n',
...full_rate 1e3,
trig_rate 1e3,
trigger_window 1e6 
)
fprintf ( 'Trigger rate *drift  window = %.2f;Full rate *drift window=%.2f;Trigger rate/full rate=%.2f;\n',
...trig_rate trigger_window,
full_rate trigger_window,
trig_rate full_rate 
)
fprintf ( 'throttled data total = %.3f;Triggered data/total=%.3f;throttled/trigger=%.3f\n',
  sum(TriggerLoadBCO >0).*DataLoadBCO)/sum(DataLoadBCO,
sum(TriggerLoadBCO.*DataLoadBCO)/sum(DataLoadBCO ,
  sum(TriggerLoadBCO >0).*DataLoadBCO/sum(TriggerLoadBCO.*DataLoadBCO) 
)
fprintf ( 'throttled data  rate = %.0f Gbps;Triggered data rate=%.0f\n',
...sum((TriggerLoadBCO >0).*DataLoadBCO)/sum(DataLoadBCO)*full_rate DataRateBeforeTriggerPerkHz,
...sum(TriggerLoadBCO.*DataLoadBCO)/sum(DataLoadBCO)*full_rate DataRateBeforeTriggerPerkHz 
)
fprintf ( 'throttled event total = %.3f;Triggered event/total==%.3f;throttled/trigger=%.3f\n',
...%recorded_data n,
triggered_data n,
recorded_data triggered_data 
)
trigger if ( trig_event(i = =1)
end readout if ( current_trigger_window  ,
 
)
end end if ( current_trigger_window >=  trigger_window)
TriggerLoadBCO ( start_time_bin:  start_time_bin+trigger_window_in_BCO)

Variable Documentation

BCO = 10e6

Definition at line 21 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 21 of file TPCRateData.m

Referenced by oncsSub_idinttv0::intt_decode_hitlist(), intt_pool::intt_decode_hitlist(), TPCEventDisplay(), TPCEventDisplay_Updated(), and TPCEventDisplay_Updated_BCO().

end time elaps current_time = 0

Definition at line 46 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 46 of file TPCRateData.m

Referenced by caen_correction::caen_time(), caen_correction::init(), and mg_http_send_file2().

current_trigger_window = -1

Definition at line 103 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 103 of file TPCRateData.m

DataLoadBCO = zeros(int64(n/full_rate*BCO*1.1), 1)

Definition at line 31 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 31 of file TPCRateData.m

DataRateBeforeTriggerPerkHz = (1/100e3)* 966. *.5*.6

Definition at line 36 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 36 of file TPCRateData.m

event_time_gap
Initial value:
= ...
exprnd(1/full_rate,n,1)

Definition at line 28 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 28 of file TPCRateData.m

full_rate = 100e3

Definition at line 8 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 8 of file TPCRateData.m

for i
Initial value:
= 1:n
start_time_bin = int64(current_time*BCO)+1

Definition at line 48 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 48 of file TPCRateData.m

n = 1000

Definition at line 7 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 7 of file TPCRateData.m

n_recorded = 0

Definition at line 44 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 44 of file TPCRateData.m

n_triggered = 0

Definition at line 45 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 45 of file TPCRateData.m

else recorded_data = 0

Definition at line 41 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 41 of file TPCRateData.m

recorded_window = -1

Definition at line 104 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 104 of file TPCRateData.m

trig_event = binornd(1,trig_rate./full_rate, n, 1)

Definition at line 34 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 34 of file TPCRateData.m

trig_rate = 15e3

Definition at line 9 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 9 of file TPCRateData.m

Referenced by BbcMonDraw::Draw().

trigger_window = 18e-6

Definition at line 10 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 10 of file TPCRateData.m

Active region readout only trigger_window_in_BCO = int64(trigger_window * BCO)

Definition at line 27 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 27 of file TPCRateData.m

triggered_data = 0

Definition at line 42 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 42 of file TPCRateData.m

TriggerLoadBCO = zeros(int64(n/full_rate*BCO*1.1), 1)

Definition at line 32 of file TPCRateData.m.

View newest version in sPHENIX GitHub at line 32 of file TPCRateData.m