12 #include <JANA/JApplication.h>
13 #include <JANA/JFactory.h>
24 #include <TDirectory.h>
28 #include <TProfile2D.h>
75 printf(
"JEventProcessor_DAQ_online::init()\n");
79 daqdir = maindir->mkdir(
"DAQ");
90 daq_hits_per_event =
new TProfile(
"daq_hits_per_event",
"Hits/event vs. rocid", 100, 0.5, 100.5);
91 daq_words_per_event =
new TProfile(
"daq_words_per_event",
"words/event vs. rocid", 100, 0.5, 100.5);
92 daq_event_size =
new TH1D(
"daq_event_size",
"Event size in kB", 1000, 0.0, 1.0
E3);
93 daq_event_tdiff =
new TH1D(
"daq_event_tdiff",
"Time between events", 10000, 0.0, 1.0E2);
94 daq_words_by_type =
new TH1D(
"daq_words_by_type",
"Number of words in EVIO file by type", kNEVIOWordTypes, 0, (
double)kNEVIOWordTypes);
103 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kEVIOHeader,
"EVIO len. & header");
104 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kEVIOEventNumber,
"Event Number Word");
109 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250BlockHeader,
"f250 Block Header");
110 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250BlockTrailer,
"f250 Block Trailer");
111 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250EventHeader,
"f250 Event Header");
112 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250TriggerTime,
"f250 Trigger Time");
113 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250WindowRawData,
"f250 Window Raw Data");
114 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250WindowSum,
"f250 Window Sum");
115 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250PulseRawData,
"f250 Pulse Raw Data");
116 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250PulseIntegral,
"f250 Pulse Integral");
117 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250PulseTime,
"f250 Pulse Time");
118 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250PulsePedestal,
"f250 Pulse Pedestal");
119 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250EventTrailer,
"f250 Event Trailer");
120 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf250DataNotValid,
"f250 Data Not Valid");
123 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125BlockHeader,
"f125 Block Header");
124 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125BlockTrailer,
"f125 Block Trailer");
125 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125EventHeader,
"f125 Event Header");
126 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125TriggerTime,
"f125 Trigger Time");
127 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125WindowRawData,
"f125 Window Raw Data");
129 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125FDCPulse6,
"f125 FDC Pulse (integral)");
130 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125FDCPulse9,
"f125 FDC Pulse (peak)");
131 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125PulseIntegral,
"f125 Pulse Integral");
132 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125PulseTime,
"f125 Pulse Time");
133 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125PulsePedestal,
"f125 Pulse Pedestal");
134 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125EventTrailer,
"f125 Event Trailer");
135 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kf125DataNotValid,
"f125 Data Not Valid");
138 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v2BlockHeader,
"F1v2 Block Header");
139 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v2BLockTrailer,
"F1v2 Block Trailer");
140 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v2EventHeader,
"F1v2 Event Header");
141 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v2TriggerTime,
"F1v2 Trigger Time");
142 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v2ChipHeader,
"F1v2 Chip Header");
145 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v2BreakWord,
"F1v2 Break Word");
147 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v3BlockHeader,
"F1v3 Block Header");
148 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v3BLockTrailer,
"F1v3 Block Trailer");
149 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v3EventHeader,
"F1v3 Event Header");
150 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v3TriggerTime,
"F1v3 Trigger Time");
151 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v3ChipHeader,
"F1v3 Chip Header");
154 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kF1v3BreakWord,
"F1v3 Break Word");
156 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kCAEN1190GlobalHeader,
"CAEN1190 GLobal Header");
157 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kCAEN1190GlobalTrailer,
"CAEN1190 Global Trailer");
158 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kCAEN1190GlobalTriggerTime,
"CAEN1190 Trigger Time");
159 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kCAEN1190TDCHeader,
"CAEN1190 TDC Header");
160 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kCAEN1190TDCData,
"CAEN1190 TDC Data");
161 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kCAEN1190TDCError,
"CAEN1190 TDC Error");
162 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kCAEN1190TDCTrailer,
"CAEN1190 TDC Trailer");
163 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kCAEN1190Filler,
"CAEN1190 Filler");
169 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kConfigCAEN1190,
"DAQ Config CAEN1190");
177 daq_words_by_type->GetXaxis()->SetBinLabel(1 + kTotWords,
"Total words in all events");
197 loop->GetSingle(ttab);
200 for(uint32_t rocid=2; rocid<99; rocid++){
203 bool found_chan =
false;
206 for(uint32_t slot=2; slot<24; slot++){
207 for(uint32_t channel=0; channel<3; channel++){
215 }
catch(JException &
e){
219 if(found_chan)
break;
244 vector<const DF1TDCHit*> f1tdchits;
245 vector<const Df250PulseData*> f250PDs;
246 vector<const Df250PulseIntegral*> f250PIs;
247 vector<const Df125PulseIntegral*> f125PIs;
248 vector<const Df125CDCPulse*> f125CDCs;
249 vector<const Df125FDCPulse*> f125FDCs;
250 vector<const DCAEN1290TDCHit*> caen1290hits;
252 loop->Get(f1tdchits);
258 loop->Get(caen1290hits);
260 ParseEventSize(loop->GetJEvent());
265 AddROCIDLabels(loop);
269 uint32_t Nhits_rocid[101];
270 for(uint32_t rocid=0; rocid<101; rocid++) Nhits_rocid[rocid] = 0;
273 japp->RootWriteLock();
275 if (daqdir!=NULL) daqdir->cd();
279 for(
unsigned int i=0; i<f1tdchits.size(); i++) {
281 int rocid = hit->
rocid;
282 int slot = hit->
slot;
286 if(rocid>=0 && rocid<=100) Nhits_rocid[rocid]++;
289 printf(
"JEventProcessor_DAQ_online::evnt creating occupancy histogram for crate %i\n",rocid);
290 char cratename[255],title[255];
291 sprintf(cratename,
"daq_occ_crate%i",rocid);
292 sprintf(title,
"Crate %i occupancy (TDC);Slot;Channel",rocid);
293 daq_occ_crates[rocid] =
new TH2I(cratename,title,21,0.5,21.5,32,-0.5,31.5);
295 sprintf(cratename,
"daq_TDClocked_crate%i",rocid);
296 sprintf(title,
"Crate %i TDC lock status (TDC);Slot;Channel",rocid);
299 sprintf(cratename,
"daq_TDCovr_crate%i",rocid);
300 sprintf(title,
"Crate %i TDC overflow status (TDC);Slot;Channel",rocid);
301 daq_TDCovr_crates[rocid] =
new TProfile2D(cratename,title,21,0.5,21.5,32,-0.5,31.5);
312 for(
unsigned int i=0; i<f250PIs.size(); i++) {
314 int rocid = hit->
rocid;
315 int slot = hit->
slot;
318 if(rocid>=0 && rocid<=100) {
319 Nhits_rocid[rocid]++;
322 printf(
"JEventProcessor_DAQ_online::evnt creating occupancy histogram for crate %i\n",rocid);
323 char cratename[255],title[255];
324 sprintf(cratename,
"daq_occ_crate%i",rocid);
325 sprintf(title,
"Crate %i occupancy (F250);Slot;Channel",rocid);
326 daq_occ_crates[rocid] =
new TH2I(cratename,title,21,0.5,21.5,16,-0.5,15.5);
332 printf(
"JEventProcessor_DAQ_online::evnt creating pedestal histogram for crate %i\n",rocid);
333 char cratename[255],title[255];
334 sprintf(cratename,
"daq_ped_crate%i",rocid);
335 sprintf(title,
"Crate %i Average Pedestal (F250);Slot;Channel",rocid);
336 daq_ped_crates[rocid] =
new TProfile2D(cratename,title,21,0.5,21.5,16,-0.5,15.5);
346 for(
unsigned int i=0; i<f250PDs.size(); i++) {
348 int rocid = hit->
rocid;
349 int slot = hit->
slot;
352 if(rocid>=0 && rocid<=100) {
353 Nhits_rocid[rocid]++;
356 printf(
"JEventProcessor_DAQ_online::evnt creating occupancy histogram for crate %i\n",rocid);
357 char cratename[255],title[255];
358 sprintf(cratename,
"daq_occ_crate%i",rocid);
359 sprintf(title,
"Crate %i occupancy (F250);Slot;Channel",rocid);
360 daq_occ_crates[rocid] =
new TH2I(cratename,title,21,0.5,21.5,16,-0.5,15.5);
366 printf(
"JEventProcessor_DAQ_online::evnt creating pedestal histogram for crate %i\n",rocid);
367 char cratename[255],title[255];
368 sprintf(cratename,
"daq_ped_crate%i",rocid);
369 sprintf(title,
"Crate %i Average Pedestal (F250);Slot;Channel",rocid);
370 daq_ped_crates[rocid] =
new TProfile2D(cratename,title,21,0.5,21.5,16,-0.5,15.5);
380 for(
unsigned int i=0; i<f125PIs.size(); i++) {
382 int rocid = hit->
rocid;
383 int slot = hit->
slot;
388 if(rocid>=0 && rocid<=100) {
389 Nhits_rocid[rocid]++;
392 printf(
"JEventProcessor_DAQ_online::evnt creating occupancy histogram for crate %i\n",rocid);
393 char cratename[255],title[255];
394 sprintf(cratename,
"daq_occ_crate%i",rocid);
395 sprintf(title,
"Crate %i occupancy (F125);Slot;Channel",rocid);
396 daq_occ_crates[rocid] =
new TH2I(cratename,title,21,0.5,21.5,16,-0.5,15.5);
402 printf(
"JEventProcessor_DAQ_online::evnt creating pedestal histogram for crate %i\n",rocid);
403 char cratename[255],title[255];
404 sprintf(cratename,
"daq_ped_crate%i",rocid);
405 sprintf(title,
"Crate %i Average Pedestal (F125);Slot;Channel",rocid);
406 daq_ped_crates[rocid] =
new TProfile2D(cratename,title,21,0.5,21.5,16,-0.5,15.5);
416 for(
unsigned int i=0; i<f125CDCs.size(); i++) {
418 int rocid = hit->
rocid;
419 int slot = hit->
slot;
422 if(rocid>=0 && rocid<=100) {
423 Nhits_rocid[rocid]++;
426 printf(
"JEventProcessor_DAQ_online::evnt creating occupancy histogram for crate %i\n",rocid);
427 char cratename[255],title[255];
428 sprintf(cratename,
"daq_occ_crate%i",rocid);
429 sprintf(title,
"Crate %i occupancy (F125);Slot;Channel",rocid);
430 daq_occ_crates[rocid] =
new TH2I(cratename,title,21,0.5,21.5,16,-0.5,15.5);
436 printf(
"JEventProcessor_DAQ_online::evnt creating pedestal histogram for crate %i\n",rocid);
437 char cratename[255],title[255];
438 sprintf(cratename,
"daq_ped_crate%i",rocid);
439 sprintf(title,
"Crate %i Average Pedestal (F125);Slot;Channel",rocid);
440 daq_ped_crates[rocid] =
new TProfile2D(cratename,title,21,0.5,21.5,16,-0.5,15.5);
450 for(
unsigned int i=0; i<f125FDCs.size(); i++) {
452 int rocid = hit->
rocid;
453 int slot = hit->
slot;
456 if(rocid>=0 && rocid<=100) {
457 Nhits_rocid[rocid]++;
460 printf(
"JEventProcessor_DAQ_online::evnt creating occupancy histogram for crate %i\n",rocid);
461 char cratename[255],title[255];
462 sprintf(cratename,
"daq_occ_crate%i",rocid);
463 sprintf(title,
"Crate %i occupancy (F125);Slot;Channel",rocid);
464 daq_occ_crates[rocid] =
new TH2I(cratename,title,21,0.5,21.5,16,-0.5,15.5);
470 printf(
"JEventProcessor_DAQ_online::evnt creating pedestal histogram for crate %i\n",rocid);
471 char cratename[255],title[255];
472 sprintf(cratename,
"daq_ped_crate%i",rocid);
473 sprintf(title,
"Crate %i Average Pedestal (F125);Slot;Channel",rocid);
474 daq_ped_crates[rocid] =
new TProfile2D(cratename,title,21,0.5,21.5,16,-0.5,15.5);
484 for(
unsigned int i=0; i<caen1290hits.size(); i++) {
486 int rocid = hit->
rocid;
490 if(rocid>=0 && rocid<=100) Nhits_rocid[rocid]++;
494 for(uint32_t rocid=0; rocid<101; rocid++)
daq_hits_per_event->Fill(rocid, Nhits_rocid[rocid]);
511 if(event.GetJEventSource()->className() !=
string(
"JEventSource_EVIO")){
512 static bool warned =
false;
514 cout <<
"WARNING: This is not an event source of type JEventSource_EVIO!" << endl;
515 cout <<
" Event size statistics filling unavailable!" << endl;
521 void *ref =
event.GetRef();
525 uint32_t evio_buffwords = evio_buffsize/
sizeof(uint32_t);
526 uint32_t *iend = &istart[evio_buffwords];
528 if( istart==NULL )
return;
529 if( (evio_buffwords>=10) && (istart[7]==0xc0da0100) ){
532 evio_buffsize -= 8*
sizeof(uint32_t);
537 if( evio_buffwords >= 4 ){
538 uint32_t mask = (0x70<<16) | (0x01);
539 if( (istart[1]&mask) == mask ){
543 japp->RootFillLock(
this);
545 japp->RootFillUnLock(
this);
551 if( evio_buffwords >= 4 ){
552 if( istart[1] == (0x60<<16) + (0xD<<8) + (0x1<<0) ){
553 if( istart[2] == (0x61<<24) + (0x1<<16) + (0x1<<0) ){
557 japp->RootFillLock(
this);
560 japp->RootFillUnLock(
this);
566 if( evio_buffwords < 4 ){
567 cout <<
"Too few words in event (" << evio_buffwords <<
") skipping..." << endl;
572 uint32_t physics_event_len = istart[0];
573 if( (istart[1] & 0xFF001000) != 0xFF001000 )
return;
574 if( physics_event_len+1 > evio_buffwords ){
575 cout <<
"Too many words in physics event: " << physics_event_len+1 <<
" > " << evio_buffwords << endl;
580 uint32_t trigger_bank_len = istart[2];
581 if( (istart[3] & 0xFF202000) != 0xFF202000 )
return;
582 uint64_t tlo = istart[2+5];
583 uint64_t thi = istart[2+6];
584 uint64_t timestamp = (thi<<32) + (tlo<<0);
585 if( trigger_bank_len+2 > evio_buffwords ){
586 cout <<
"Too many words in trigger bank " << trigger_bank_len <<
" > " << evio_buffwords-2 << endl;
591 uint32_t Nwords[100];
592 uint32_t word_stats[kNEVIOWordTypes];
593 for(uint32_t rocid=0; rocid<100; rocid++) Nwords[rocid] = 0;
594 for(uint32_t i=0; i<kNEVIOWordTypes; i++) word_stats[i] = 0;
596 word_stats[kNevents]++;
597 word_stats[kTotWords] += evio_buffwords;
599 word_stats[kEVIOHeader] += 4;
602 uint32_t *iptr = &istart[3+trigger_bank_len];
605 uint32_t len = *iptr;
606 uint32_t rocid = (iptr[1]>>16) & 0XFF;
608 if(rocid<100) Nwords[rocid] += len+1;
610 word_stats[kEVIOHeader] += 2;
612 uint32_t *imyend = &iptr[len+1];
613 if(imyend > iend) imyend = iend;
615 uint64_t Nwords = ((uint64_t)imyend - (uint64_t)iptr)/
sizeof(uint32_t);
617 static int Nwarnings = 0;
619 cout <<
"Nwords<2 (?)" << endl;
620 cout <<
" evio_buffwords = " << evio_buffwords << endl;
621 cout <<
" physics_event_len = " << physics_event_len << endl;
622 cout <<
" trigger_bank_len = " << trigger_bank_len << endl;
624 if(++Nwarnings == 10) cout <<
"Last warning!" << endl;
629 DataWordStats(iptr, imyend, word_stats);
631 iptr = &iptr[len +1];
636 japp->RootFillLock(
this);
644 uint32_t
event_num =
event.GetEventNumber();
645 static uint32_t recent_event_nums[128];
646 static uint64_t recent_timestamps[128];
647 static uint32_t
ievent = 0;
648 for(uint32_t i=0; i<
ievent; i++){
650 if(recent_event_nums[i] == (event_num-1)){
651 double tdiff = (double)(timestamp - recent_timestamps[i])/250.0E6;
658 uint32_t idx = ievent%128;
660 recent_timestamps[idx] = timestamp;
664 double physics_event_len_kB = (double)((physics_event_len+1)*
sizeof(uint32_t))/1024.0;
666 uint32_t TotalWords = 0;
667 for(uint32_t rocid=0; rocid<100; rocid++){
669 TotalWords += Nwords[rocid];
675 for(uint32_t i=0; i<kNEVIOWordTypes; i++){
679 japp->RootFillUnLock(
this);
692 uint32_t rocid = (*iptr++)>>16 & 0x0FFF;
694 uint32_t data_block_bank_len = *iptr++;
695 uint32_t *iendbank = &iptr[data_block_bank_len];
696 uint32_t det_id = ((*iptr) >> 16) & 0x0FFF;
698 if(iendbank > iend) iendbank = iend;
700 word_stats[kEVIOHeader] += 2;
704 uint32_t Ntoprocess = data_block_bank_len - 1;
706 #if 0 // I don't know if these words are actually implmented ??
707 word_stats[kEVIOEventNumber]++;
708 word_stats[kEVIOTimestamp] += 2;
714 uint32_t *irawdata = iptr;
723 ParseJLabModuleData(rocid, iptr, iendbank, word_stats);
727 ParseCAEN1190(rocid, iptr, iendbank, word_stats);
731 ParseModuleConfiguration(rocid, iptr, iendbank, word_stats);
738 uint32_t Nprocessed = (uint32_t)((uint64_t)iptr - (uint64_t)irawdata)/
sizeof(uint32_t);
739 if(Nprocessed < Ntoprocess) word_stats[kUnknown] += Ntoprocess - Nprocessed;
752 if(*iptr != 0xf800fafa)
break;
753 word_stats[kF800FAFA]++;
757 uint32_t mod_id = ((*iptr) >> 18) & 0x000F;
775 if(((*iptr>>31) & 0x1) == 0) { word_stats[kUnknown]++ ; iptr++;
continue;}
777 uint32_t window_width;
778 uint32_t window_words;
779 uint32_t data_type = (*iptr>>27) & 0x0F;
781 case 0: word_stats[kf250BlockHeader]++; iptr++;
break;
782 case 1: word_stats[kf250BlockTrailer]++; iptr++;
break;
783 case 2: word_stats[kf250EventHeader]++; iptr++;
break;
785 word_stats[kf250TriggerTime]++;
787 if(((*iptr>>31) & 0x1) == 0){ word_stats[kf250TriggerTime]++; iptr++; }
790 window_width = (*iptr>>0) & 0x0FFF;
791 window_words = 1 + ((window_width+1)/2);
792 word_stats[kf250WindowRawData] += window_words;
793 iptr = &iptr[window_words];
795 case 7: word_stats[kf250PulseIntegral]++; iptr++;
break;
796 case 8: word_stats[kf250PulseTime]++; iptr++;
break;
797 case 10: word_stats[kf250PulsePedestal]++; iptr++;
break;
798 case 13: word_stats[kf250EventTrailer]++; iptr++;
break;
799 case 14: word_stats[kf250DataNotValid]++; iptr++;
break;
800 case 15: word_stats[kf250Filler]++; iptr++;
break;
802 default: word_stats[kUnknown]++; iptr++;
break;
814 if(((*iptr>>31) & 0x1) == 0) { word_stats[kUnknown]++ ; iptr++;
continue;}
816 uint32_t window_width;
817 uint32_t window_words;
818 uint32_t data_type = (*iptr>>27) & 0x0F;
820 case 0: word_stats[kf125BlockHeader]++; iptr++;
break;
821 case 1: word_stats[kf125BlockTrailer]++; iptr++;
break;
822 case 2: word_stats[kf125EventHeader]++; iptr++;
break;
824 word_stats[kf125TriggerTime]++;
826 if(((*iptr>>31) & 0x1) == 0){ word_stats[kf125TriggerTime]++; iptr++; }
829 window_width = (*iptr>>0) & 0x0FFF;
830 window_words = 1 + ((window_width+1)/2);
831 word_stats[kf125WindowRawData] += window_words;
832 iptr = &iptr[window_words];
834 case 5: word_stats[kf125CDCPulse]++;
836 if(((*iptr>>31) & 0x1) == 0){ word_stats[kf125CDCPulse]++; iptr++; }
838 case 6: word_stats[kf125FDCPulse6]++;
840 if(((*iptr>>31) & 0x1) == 0){ word_stats[kf125FDCPulse6]++; iptr++; }
842 case 7: word_stats[kf125PulseIntegral]++; iptr++;
break;
843 case 8: word_stats[kf125PulseTime]++; iptr++;
break;
844 case 9: word_stats[kf125FDCPulse9]++;
846 if(((*iptr>>31) & 0x1) == 0){ word_stats[kf125FDCPulse9]++; iptr++; }
848 case 10: word_stats[kf125PulsePedestal]++; iptr++;
break;
849 case 13: word_stats[kf125EventTrailer]++; iptr++;
break;
850 case 14: word_stats[kf125DataNotValid]++; iptr++;
break;
851 case 15: word_stats[kf125Filler]++; iptr++;
break;
853 default: word_stats[kUnknown]++; iptr++;
break;
864 switch( (*iptr++) & 0xF8000000 ){
865 case 0xC0000000: word_stats[kF1v2ChipHeader]++;
break;
866 case 0xB8000000: word_stats[kF1v2Data]++;
break;
867 case 0xF8000000: word_stats[kF1v2Filler]++;
break;
868 case 0x80000000: word_stats[kF1v2BlockHeader]++;
break;
869 case 0x88000000: word_stats[kF1v2BLockTrailer]++;
break;
870 case 0x90000000: word_stats[kF1v2EventHeader]++;
break;
871 case 0x98000000: word_stats[kF1v2TriggerTime]++;
break;
872 case 0xF0000000: word_stats[kF1v2BreakWord]++;
break;
873 default: word_stats[kUnknown]++;
break;
884 switch( (*iptr++) & 0xF8000000 ){
885 case 0xC0000000: word_stats[kF1v3ChipHeader]++;
break;
886 case 0xB8000000: word_stats[kF1v3Data]++;
break;
887 case 0xF8000000: word_stats[kF1v3Filler]++;
break;
888 case 0x80000000: word_stats[kF1v3BlockHeader]++;
break;
889 case 0x88000000: word_stats[kF1v3BLockTrailer]++;
break;
890 case 0x90000000: word_stats[kF1v3EventHeader]++;
break;
891 case 0x98000000: word_stats[kF1v3TriggerTime]++;
break;
892 case 0xF0000000: word_stats[kF1v3BreakWord]++;
break;
893 default: word_stats[kUnknown]++;
break;
907 if(*iptr == 0xd00dd00d) {
908 word_stats[kD00DD00D]++;
913 uint32_t type = (*iptr++) >> 27;
915 case 0b01000: word_stats[kCAEN1190GlobalHeader]++;
break;
916 case 0b10000: word_stats[kCAEN1190GlobalTrailer]++;
break;
917 case 0b10001: word_stats[kCAEN1190GlobalTriggerTime]++;
break;
918 case 0b00001: word_stats[kCAEN1190TDCHeader]++;
break;
919 case 0b00000: word_stats[kCAEN1190TDCData]++;
break;
920 case 0b00100: word_stats[kCAEN1190TDCError]++;
break;
921 case 0b00011: word_stats[kCAEN1190TDCTrailer]++;
break;
922 case 0b11000: word_stats[kCAEN1190Filler]++;
break;
923 default: word_stats[kUnknown]++;
break;
935 word_stats[kConfig]++;
936 uint32_t Nvals = ((*iptr++) >> 24) & 0xFF;
939 for(uint32_t i=0; i< Nvals; i++){
941 switch((*iptr++)>>24){
942 case 0x05: word_stats[kConfigf250]++;
break;
943 case 0x0F: word_stats[kConfigf125]++;
break;
944 case 0x06: word_stats[kConfigF1]++;
break;
945 case 0x10: word_stats[kConfigCAEN1190]++;
break;
946 default: word_stats[kConfig]++;
break;
963 japp->RootFillLock(
this);
980 japp->RootFillUnLock(
this);
uint32_t pedestal
from Pulse Integral Data word (future)
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
JEventProcessor_DAQ_online()
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
sprintf(text,"Post KinFit Cut")
void ParseModuleConfiguration(uint32_t rocid, uint32_t *&iptr, uint32_t *iend, uint32_t *word_stats)
uint32_t pedestal
from second word
void ParseF1v2TDCBank(uint32_t rocid, uint32_t *&iptr, uint32_t *iend, uint32_t *word_stats)
static TProfile * daq_hits_per_event
void ParseEventSize(jana::JEvent &event)
void DataWordStats(uint32_t *iptr, uint32_t *iend, uint32_t *word_stats)
static uint32_t GetEVIOBufferSizeFromRef(void *ref)
static TProfile2D * daq_TDClocked_crates[highcratenum]
void AddROCIDLabels(jana::JEventLoop *loop)
static TH2I * daq_occ_crates[highcratenum]
void ParseF1v3TDCBank(uint32_t rocid, uint32_t *&iptr, uint32_t *iend, uint32_t *word_stats)
bool emulated
true if made from Window Raw Data
static TProfile * daq_words_per_event
const DChannelInfo & GetDetectorIndex(const csc_t &in_daq_index) const
void ParseCAEN1190(uint32_t rocid, uint32_t *&iptr, uint32_t *iend, uint32_t *word_stats)
jerror_t init(void)
Called once at program start.
~JEventProcessor_DAQ_online()
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
void ParseJLabModuleData(uint32_t rocid, uint32_t *&iptr, uint32_t *iend, uint32_t *word_stats)
static TH1D * daq_event_size
static TProfile2D * daq_ped_crates[highcratenum]
uint32_t pedestal
from Pulse Integral Data word (future)
uint32_t pedestal
from second word
void Parsef250Bank(uint32_t rocid, uint32_t *&iptr, uint32_t *iend, uint32_t *word_stats)
jerror_t fini(void)
Called after last event of last event source has been processed.
void Parsef125Bank(uint32_t rocid, uint32_t *&iptr, uint32_t *iend, uint32_t *word_stats)
static uint32_t * GetEVIOBufferFromRef(void *ref)
printf("string=%s", string)
static TH1D * daq_event_tdiff
static bool ttab_labels_set
static const int highcratenum
static string DetectorName(Detector_t type)
static TProfile2D * daq_TDCovr_crates[highcratenum]