NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
IceRawTWR.cxx
Go to the documentation of this file.
1
17
19
93
94#include "IceRawTWR.h"
95#include "Riostream.h"
96
97ClassImp(IceRawTWR); // Class implementation to enable ROOT I/O
98
99IceRawTWR::IceRawTWR(const char* name,const char* title) : NcJob(name,title)
100{
107
108 fSplit=0;
109 fBsize=32000;
110 fMaxevt=-1;
111 fPrintfreq=1;
112 fInfiles=0;
113 fOutfile=0;
114}
115
117{
123
124 if (fInfiles)
125 {
126 delete fInfiles;
127 fInfiles=0;
128 }
129}
130
132{
140
141 fMaxevt=n;
142}
143
145{
152
153 if (f>=0) fPrintfreq=f;
154}
155
157{
164
165 if (split>=0) fSplit=split;
166}
167
169{
176
177 if (bsize>=0) fBsize=bsize;
178}
179
180void IceRawTWR::AddInputFile(TString name)
181{
187
188 if (!fInfiles)
189 {
190 fInfiles=new TObjArray();
191 fInfiles->SetOwner();
192 }
193
194 TObjString* s=new TObjString();
195 s->SetString(name);
196 fInfiles->Add(s);
197}
198
199void IceRawTWR::SetOutputFile(TFile* ofile)
200{
206
207 if (fOutfile) delete fOutfile;
208 fOutfile=ofile;
209}
210
211void IceRawTWR::SetOutputFile(TString name)
212{
218
219 if (fOutfile) delete fOutfile;
220 fOutfile=new TFile(name.Data(),"RECREATE","TWR raw data in IceEvent structure");
221}
222
224{
230
231 return fOutfile;
232}
233
234void IceRawTWR::Exec(Option_t* opt)
235{
256
257 if (!fInfiles)
258 {
259 cout << " *IceRawTWR Exec* No data input file(s) specified." << endl;
260 return;
261 }
262
263 Int_t ninfiles=fInfiles->GetEntries();
264 if (!ninfiles)
265 {
266 cout << " *IceRawTWR Exec* No data input file(s) specified." << endl;
267 return;
268 }
269
270 TTree* otree=0;
271 if (fOutfile)
272 {
273 otree=new TTree("T","TWR raw data converted to IceEvent structures");
274 otree->SetDirectory(fOutfile);
275 }
276
277 IceEvent* evt=new IceEvent();
278 evt->SetTrackCopy(1);
279 evt->SetDevCopy(1);
280
281 // Branch in the tree for the event structure
282 if (otree) otree->Branch("IceEvent","IceEvent",&evt,fBsize,fSplit);
283
284 // Initialise the job working environment
285 SetMainObject(evt);
286 if (fOutfile)
287 {
289 AddObject(otree);
290 }
291
292 TString inputfile;
293
294 cout << " ***" << endl;
295 cout << " *** Start processing of job " << GetName() << " ***" << endl;
296 cout << " ***" << endl;
297 for (Int_t i=0; i<ninfiles; i++)
298 {
299 TObjString* sx=(TObjString*)fInfiles->At(i);
300 if (!sx) continue;
301 inputfile=sx->GetString();
302 cout << " TWR raw data input file : " << inputfile.Data() << endl;
303 }
304 cout << " Maximum number of events to be processed : " << fMaxevt << endl;
305 cout << " Print frequency : " << fPrintfreq << endl;
306 if (fOutfile)
307 {
308 cout << " ROOT output file : " << fOutfile->GetName() << endl;
309 cout << " Output characteristics : splitlevel = " << fSplit << " buffersize = " << fBsize << endl;
310 }
311
313
314 // Storage of the used parameters in the IceRawTWR device
315 NcDevice params;
316 params.SetNameTitle("IceRawTWR","IceRawTWR processor parameters");
317 params.SetSlotName("Nchannels",1);
318 params.SetSlotName("Ntriggers",2);
319 params.SetSlotName("BaselineOffset",3);
320 params.SetSlotName("NanosecsPerTWRbin",4);
321 params.SetSignal(float(N_OF_CHANNELS),1);
322 params.SetSignal(float(N_OF_TRIGGERS),2);
323 params.SetSignal(float(BASELINE_MEAN_MAGIC),3);
324 params.SetSignal(float(NSECS_PER_TWR_BIN),4);
325
326 // Set DAQ device info
327 NcDevice daq;
328 daq.SetName("Daq");
329 daq.SetSlotName("TWR",1);
330 daq.SetSignal(1,1);
331
332 twr_raw_data_file_t twr_file;
333 Int_t year,runnum,evtnum;
334
335 Int_t error;
336 UInt_t nhead;
337
338 GPS_t gps;
339 UInt_t gpslow,gpshigh,gpssecs; // The GPS time information
340 Int_t seconds,nsecs; // Seconds and nanoseconds since start of the UT year
341
342 Int_t nevt=0;
343 fHeader=0;
344 Int_t evtsel=0;
345 for (Int_t ifile=0; ifile<ninfiles; ifile++)
346 {
347 TObjString* sx=(TObjString*)fInfiles->At(ifile);
348 if (!sx) continue;
349
350 inputfile=sx->GetString();
351 if (inputfile=="") continue;
352
353 // Open the TWR raw data input file in binary mode
354 fInput=fopen(inputfile.Data(),"rb");
355
356 if (!fInput)
357 {
358 cout << " *IceRawTWR Exec* No input file found with name : " << inputfile.Data() << endl;
359 continue;
360 }
361
362 // Extract info like run number, file number etc... from filename
363 extract_info_from_filename((char*)inputfile.Data(),&twr_file);
364
365 year=twr_file.year;
366 runnum=twr_file.run_no;
367
368 // Initialise the event structure
370
371 // Read the file header information
372 error=read_header_from_file(fInput,&fHeader,&nhead);
373
374 if (error || !nhead)
375 {
376 cout << " *IceRawTWR Exec* Error in header for input file : " << inputfile.Data() << endl;
377 continue;
378 }
379
380 // Correct the mapping
381 update_system(fHeader,runnum);
382
383 // Retrieve the actual readout system, threshold and external stop of each OM for these data
384 fReadout.Set(681);
385 fThreshold.Set(681);
386 fExtstop.Set(681);
387 Int_t ncrates=fHeader->n_crates;
388 Int_t ntwrs=0;
389 Int_t omid,readout,thresh,extstop;
390 for (Int_t icr=0; icr<ncrates; icr++)
391 {
392 ntwrs=fHeader->crate[icr]->n_twr;
393 for (Int_t i_twr=0; i_twr<ntwrs; i_twr++)
394 {
395 extstop=fHeader->crate[icr]->twr[i_twr]->ext_stop;
396 for (Int_t ich=0; ich<CHANNELS_PER_TWR; ich++)
397 {
398 omid=fHeader->crate[icr]->twr[i_twr]->om_no[ich];
399 thresh=fHeader->crate[icr]->twr[i_twr]->threshold[ich];
400 readout=1+fHeader->crate[icr]->twr[i_twr]->om_is_optical[ich];
401 if (omid>=0 && omid<=681)
402 {
403 fReadout.AddAt(readout,omid-1);
404 fThreshold.AddAt(thresh,omid-1);
405 fExtstop.AddAt(extstop,omid-1);
406 }
407 }
408 }
409 }
410
412 {
413 if (fMaxevt>-1 && nevt>=fMaxevt) break;
414
415 evtnum=fEvent.eventcounter;
416
417 // The GPS telegram info
418 gps=fEvent.gps;
419 gpslow=gps.seconds & 0x00FFFFFF; // The low 24 bits of the seconds count
420 gpshigh=gps.info.bits.seconds; // The high 8 bits of the seconds count
421 gpssecs=gpshigh<<24;
422 gpssecs+=gpslow;
423
424 // Seconds and nanoseconds since the start of the UT year
425 seconds=gpssecs;
426 nsecs=100*gps.count_10MHz;
427
428 // Correction for GPS telegram interpretation in the TWR Daq
429 if (year<2007) seconds-=24*3600;
430
431 // Reset the complete Event structure
432 evt->Reset();
433
434 evt->SetRunNumber(runnum);
435 evt->SetEventNumber(evtnum);
436 evt->SetUT(year,0,seconds,nsecs);
437
438 evt->AddDevice(params);
439 evt->AddDevice(daq);
440
441 PutTrigger(year);
442
443 PutWaveforms(year);
444
445 // Invoke all available sub-tasks (if any)
446 CleanTasks();
447 ExecuteTasks(opt);
448
449 if (fPrintfreq)
450 {
451 if (!(nevt%fPrintfreq)) evt->HeaderData();
452 }
453
454 // Write the complete structure to the output Tree for accepted events
455 evtsel=1;
456 NcDevice* seldev=(NcDevice*)evt->GetDevice("NcEventSelector");
457 if (seldev)
458 {
459 if (seldev->GetSignal("Select") < 0.1) evtsel=-1;
460 }
461 if (otree && evtsel==1) otree->Fill();
462
463 // Update event counter
464 nevt++;
465
466 // Reset the raw event structure
468 } // End of event reading loop
469
470 // Delete the file header structure
472
473 if (fMaxevt>-1 && nevt>=fMaxevt) break;
474
475 } // End of input file loop
476
477 // Flush possible memory resident data to the output file
478 if (fOutfile) fOutfile->Write();
479
480 // Remove the IceEvent object from the environment
481 // and delete it as well
482 if (evt)
483 {
484 RemoveObject(evt);
485 delete evt;
486 }
487}
488
490{
496
498 if (!evt) return;
499
500 // Get trigger time for TWR time reference
501 Float_t trigtime=0;
502 NcDevice* trig=(NcDevice*)evt->GetDevice("Trigger");
503 if (trig)
504 {
505 NcSignal* sx=trig->GetHit("main");
506 if (sx) trigtime=sx->GetSignal("trig_pulse_le");
507 }
508
509 // Loop over all the waveforms and add the histo(s) to the corresponding OM's
510 TH1F histo;
511 Int_t nbins=0;
512 Float_t xlow=0;
513 Float_t xup=0;
514 TString hname;
515 IceAOM om;
516 IceAOM* omx=0;
517 Int_t omid;
518 Int_t omidmax=680;
519 Int_t error;
520 Float_t baseline;
521 Int_t nfrags;
522 Int_t firstbin,lastbin;
523 Int_t extstop;
524 for (Int_t i=0; i<N_OF_CHANNELS; i++)
525 {
526 if (!fEvent.wfm_filled[i]) continue;
527
528 omid=i;
529 if (omid<=0 || omid>omidmax) continue; // Skip trigger channels
530
531 // Get corresponding device from the current event structure
532 omx=(IceAOM*)evt->GetIdDevice(omid);
533 if (!omx)
534 {
535 om.Reset(1);
536 om.SetUniqueID(omid);
537 evt->AddDevice(om);
538 omx=(IceAOM*)evt->GetIdDevice(omid);
539 }
540
541 if (!omx) continue;
542
543 extstop=fExtstop.At(omid-1);
544
545 // Update readout type and threshold for this OM
546 omx->AddNamedSlot("READOUT");
547 omx->SetSignal(float(fReadout.At(omid-1)),"READOUT");
548 omx->AddNamedSlot("THRESH");
549 omx->SetSignal(float(fThreshold.At(omid-1)),"THRESH");
550 omx->AddNamedSlot("EXTSTOP");
551 omx->SetSignal(float(extstop),"EXTSTOP");
552
554 error=restore_waveform(fEvent.wfm[i],&fWform,year);
555
556 if (error) continue;
557
558 nfrags=fWform.n_frag;
559
560 for (Int_t ifrag=0; ifrag<nfrags; ifrag++)
561 {
562 baseline=fWform.frag_mean[ifrag];
563
564 hname="BASELINE-WF";
565 hname+=omx->GetNwaveforms()+1;
566 omx->AddNamedSlot(hname);
567 omx->SetSignal(baseline,hname);
568
569 // Fill the waveform histogram with this fragment
570 hname="OM";
571 hname+=omid;
572 hname+="-WF";
573 hname+=omx->GetNwaveforms()+1;
574
575 histo.Reset();
576 histo.SetName(hname.Data());
577 nbins=fWform.frag_n_points[ifrag];
578 firstbin=fWform.frag_begin[ifrag];
579 lastbin=fWform.frag_end[ifrag];
580
581 xlow=fWform.wfm_x[firstbin];
582 xup=fWform.wfm_x[lastbin];
583
584 // Synchronise waveform times with external stop and trigger time
585 xlow=xlow-float(NSECS_PER_TWR_BIN)*(1024-extstop)+trigtime;
586 xup=xup-float(NSECS_PER_TWR_BIN)*(1024-extstop)+trigtime;
587
588 histo.SetBins(nbins,xlow,xup);
589
590 for (Int_t jbin=1; jbin<=nbins; jbin++)
591 {
592 histo.SetBinContent(jbin,baseline-fWform.wfm_y[firstbin+jbin-1]);
593 }
594
595 omx->SetWaveform(&histo,omx->GetNwaveforms()+1);
596 } // End of loop over fragments of this OM
597 } // End of loop over channels
598}
599
600void IceRawTWR::PutTrigger(Int_t year)
601{
620
621 // Fill the trigger structure
622 Int_t error=retrigger(&fEvent,&fTrigger);
623 if (error) return;
624
626 if (!evt) return;
627
628 NcDevice trig;
629 trig.SetNameTitle("Trigger","Amanda/IceCube event triggers");
630 NcSignal s;
631 Float_t trigtime=0;
632
633 if (year !=2005 && year != 2006)
634 {
635 s.SetName("main");
636 s.SetTitle("First trigger for TWR time reference");
637 s.SetUniqueID(0);
638 s.SetSlotName("trig_pulse_le",1);
639 s.SetSignal(trigtime,1);
640 trig.AddHit(s);
641 // Store the trigger data into the IceEvent structure
642 evt->AddDevice(trig);
643 return;
644 }
645
646 // Trigger settings for 2005 and 2006
647 if (!fTrigger.n_software_trigger && !fTrigger.n_hardware_trigger) return;
648
649 TString trignames[N_OF_TRIGGERS]={"m24","m18","string","spase","cal-t0","cal-la","m12",
650 "main-logic","main-or","random","m20-frag","volume"};
651 Int_t imain=0;
652 for (Int_t i=0; i<N_OF_TRIGGERS; i++)
653 {
654 if (!fTrigger.trigger_active[i]) continue;
655
656 s.Reset(1);
657 s.SetName(trignames[i]);
658 s.SetUniqueID(i);
659 trigtime=0;
660 if (fTrigger.trigger_has_pulse[i]) trigtime=float(fTrigger.trigger_time[i]*NSECS_PER_TWR_BIN);
661 s.SetSlotName("trig_pulse_le",1);
662 s.SetSignal(trigtime,1);
663 trig.AddHit(s);
664 // Set flag to indicate creation of artificial "main" trigger
665 if (i!=4 && i!=5 && i!=9) imain=1;
666 }
667
668 // Set the artificial "main" trigger to indicate the first trigger signal
669 if (imain)
670 {
671 s.Reset(1);
672 s.SetName("main");
673 s.SetTitle("First trigger for TWR time reference");
674 s.SetUniqueID(N_OF_TRIGGERS);
675 s.SetSlotName("trig_pulse_le",1);
676 trigtime=0;
677 if (fTrigger.first_trigger>=0) trigtime=float(fTrigger.first_trigger_time*NSECS_PER_TWR_BIN);
678 s.SetSignal(trigtime,1);
679 trig.AddHit(s);
680 }
681
682 // Store the trigger data into the IceEvent structure
683 evt->AddDevice(trig);
684}
685
686Int_t IceRawTWR::extract_info_from_filename(char* fname,twr_raw_data_file_t* twr_file)
687{
688 char start_str[20],year_str[20],day_str[20],run_no_str[20],
689 file_no_str[20],begin_str[20],end_str[20];
690 char* filename;
691
692 filename = strstr(fname, "twr");
693 if(filename == NULL)
694 if(strncmp("twr_", start_str, 4))
695 {
696 printf("%s\n", filename);
697 return(ERROR_NOT_VALID_FILENAME);
698 }
699
700 strncpy(start_str, filename, 4);
701 if(strncmp("twr_", start_str, 4))
702 {
703 printf("%s %s\n", filename, start_str);
704 return(ERROR_NOT_VALID_FILENAME);
705 }
706 strncpy(year_str, &filename[4], 4);
707 twr_file->year = strtol(year_str, 0, 10);
708
709 if(twr_file->year==2003)
710 {
711 strncpy(day_str, &filename[9], 3);
712 day_str[3] = '\0';
713 twr_file->day = strtol(day_str, 0, 10);
714
715 strncpy(run_no_str, &filename[13], 4);
716 run_no_str[4] = '\0';
717 twr_file->run_no = strtol(run_no_str, 0, 10);
718
719 strncpy(file_no_str, &filename[18], 4);
720 file_no_str[4] = '\0';
721 twr_file->file_no = strtol(file_no_str, 0, 10);
722 }
723
724 if(twr_file->year==2004)
725 {
726 strncpy(day_str, &filename[9], 3);
727 day_str[3] = '\0';
728 twr_file->day = strtol(day_str, 0, 10);
729
730 strncpy(run_no_str, &filename[13], 4);
731 run_no_str[4] = '\0';
732 twr_file->run_no = strtol(run_no_str, 0, 10);
733
734 strncpy(file_no_str, &filename[18], 4);
735 file_no_str[4] = '\0';
736 twr_file->file_no = strtol(file_no_str, 0, 10);
737
738 strncpy(begin_str, &filename[23], 5);
739 begin_str[5] = '\0';
740 twr_file->begin = strtol(begin_str, 0, 10);
741
742 strncpy(end_str, &filename[29], 5);
743 end_str[5] = '\0';
744 twr_file->end = strtol(end_str, 0, 10);
745 }
746
747 if(twr_file->year > 2004)
748 {
749 strncpy(day_str, &filename[9], 3);
750 day_str[3] = '\0';
751 twr_file->day = strtol(day_str, 0, 10);
752
753 strncpy(run_no_str, &filename[13], 6);
754 run_no_str[6] = '\0';
755 twr_file->run_no = strtol(run_no_str, 0, 10);
756
757 strncpy(file_no_str, &filename[20], 4);
758 file_no_str[4] = '\0';
759 twr_file->file_no = strtol(file_no_str, 0, 10);
760
761 strncpy(begin_str, &filename[25], 5);
762 begin_str[5] = '\0';
763 twr_file->begin = strtol(begin_str, 0, 10);
764
765 strncpy(end_str, &filename[31], 5);
766 end_str[5] = '\0';
767 twr_file->end = strtol(end_str, 0, 10);
768 }
769 return(0);
770}
771
772Int_t IceRawTWR::clear_system(sys_config_t* sys)
773{
779
780 if (!sys) return 0;
781
782 for(Int_t icrate=0; icrate < int(sys->n_crates); icrate++)
783 {
784 if (!sys->crate[icrate]) continue;
785 for(Int_t itwr=0; itwr < int(sys->crate[icrate]->n_twr); itwr++)
786 {
787 if (sys->crate[icrate]->twr[itwr]) delete sys->crate[icrate]->twr[itwr];
788 }
789 delete sys->crate[icrate];
790 }
791 delete sys;
792 sys=0;
793 return 0;
794}
795
796Int_t IceRawTWR::clear_event(event_t* event_ptr)
797{
798 Int_t i_value;
799 Int_t *int_ptr = (int*) event_ptr;
800
801 for(i_value=0; i_value < int(sizeof(event_t)/sizeof(Int_t)); i_value++)
802 {
803 *int_ptr++ = 0;
804 }
805 return(0);
806}
807
808Int_t IceRawTWR::read_header_from_file(FILE* fin,sys_config_t** system_ptr,UInt_t* header_length)
809{
810 Int_t i_crate, i_twr, i_channel;
811 UInt_t count_twr_in_system = 0;
812 UInt_t dummy;
813
814 sys_config_t *sys;
815
816 // allocating memory for sys_config structure
817 sys = (sys_config_t*) malloc( sizeof(sys_config_t) );
818
819 fread(&dummy,sizeof(UInt_t),1,fin); // Header Begin Mark
820
821 fread(header_length,sizeof(UInt_t),1,fin); // Length of header
822 fread(&sys->clockdiv,sizeof(UInt_t),1,fin);
823 fread(&sys->n_crates,sizeof(UInt_t),1,fin);
824
825 if( (sys->n_crates > MAX_N_CRATES) || (sys->n_crates < 0) )
826 return(ERROR_TOO_MANY_CRATES);
827
828 for(i_crate=0; i_crate < int(sys->n_crates); i_crate++)
829 {
830 sys->crate[i_crate] =
831 (crate_config_t*) malloc( sizeof(crate_config_t) );
832
833 fread(&sys->crate[i_crate]->vme_base_bridge,sizeof(UInt_t),1,fin);
834 fread(&sys->crate[i_crate]->vme_base_100MHz,sizeof(UInt_t),1,fin);
835 fread(&sys->crate[i_crate]->base_gps,sizeof(UInt_t),1,fin);
836 fread(&sys->crate[i_crate]->n_twr,sizeof(UInt_t),1,fin);
837
838 if( (sys->crate[i_crate]->n_twr > MAX_N_TWR_PER_CRATE)
839 || (sys->crate[i_crate]->n_twr < 0) )
840 return(ERROR_TOO_MANY_TWRS);
841
842 for(i_twr=0; i_twr < int(sys->crate[i_crate]->n_twr); i_twr++)
843 {
844 sys->crate[i_crate]->twr[i_twr] =
845 (twr_config_t*) malloc( sizeof(twr_config_t) );
846 count_twr_in_system++;
847 fread(&sys->crate[i_crate]->twr[i_twr]->base,
848 sizeof(UInt_t),1,fin);
849 fread(&sys->crate[i_crate]->twr[i_twr]->id,
850 sizeof(UInt_t),1,fin);
851
852 sys->crate[i_crate]->twr[i_twr]->id
853 = sys->crate[i_crate]->twr[i_twr]->id - 0x10; /* Correct */
854
855
856 fread(&dummy,sizeof(UInt_t),1,fin); /* stat_reg */
857 fread(&sys->crate[i_crate]->twr[i_twr]->mod_id,
858 sizeof(UInt_t),1,fin);
859 fread(&dummy,sizeof(UInt_t),1,fin); /* acq_ctrl */
860 fread(&sys->crate[i_crate]->twr[i_twr]->ext_start,
861 sizeof(UInt_t),1,fin);
862 fread(&sys->crate[i_crate]->twr[i_twr]->ext_stop,
863 sizeof(UInt_t),1,fin);
864 fread(&dummy,sizeof(UInt_t),1,fin); /* evtconfig */
865
866 for(i_channel = 0; i_channel < CHANNELS_PER_TWR; i_channel++)
867 {
868 fread(&sys->crate[i_crate]->twr[i_twr]->om_no[i_channel],
869 sizeof(UInt_t),1,fin);
870 }
871
872 for(i_channel = 0; i_channel < CHANNELS_PER_TWR; i_channel++)
873 {
874 fread(&sys->crate[i_crate]->twr[i_twr]->om_is_optical[i_channel],
875 sizeof(UInt_t),1,fin);
876 }
877
878 for(i_channel = 0; i_channel < CHANNELS_PER_TWR; i_channel++)
879 {
880 fread(&sys->crate[i_crate]->twr[i_twr]->baseline[i_channel],
881 sizeof(UInt_t),1,fin);
882 }
883
884 for(i_channel = 0; i_channel < CHANNELS_PER_TWR; i_channel++)
885 {
886 fread(&sys->crate[i_crate]->twr[i_twr]->threshold[i_channel],
887 sizeof(UInt_t),1,fin);
888 }
889
890 sys->twr_field[(i_crate * 0x10) + i_twr]
891 = sys->crate[i_crate]->twr[i_twr];
892
893 /* Bug fix needed */
894 for(i_channel=0; i_channel < 8; i_channel++)
895 {
896 if( sys->crate[i_crate]->twr[i_twr]->om_no[i_channel] == 9000 )
897 sys->crate[i_crate]->twr[i_twr]->om_no[i_channel]
898 = N_OF_CHANNELS - 1;
899 }
900 }
901 }
902
903 // Set number of TWRs in system
904 sys->n_twr = count_twr_in_system;
905
906 *system_ptr = sys;
907 return(0);
908}
909
910Int_t IceRawTWR::update_system(sys_config_t* sys,Int_t run_number)
911{
912 Int_t i_crate, i_twr, i_channel;
913
914 // Data for bug fix 1 by Andreas
915 UInt_t om_no_r1[CHANNELS_PER_TWR]
916 = {111, 112, 113, 114, 115, 116, 39, 118};
917 UInt_t om_is_optical_r1[CHANNELS_PER_TWR]
918 = {0, 0, 0, 0, 0, 0, 0, 0};
919 UInt_t threshold_r1[CHANNELS_PER_TWR]
920 = {50, 50, 50, 50, 50, 50, 80, 50};
921
922 // Data for bugfix 2 by Timo
923 UInt_t om_no_r2[CHANNELS_PER_TWR]
924 = {473, 484, 485, 486, 487, 475, 490, 491};
925 UInt_t om_is_optical_r2[CHANNELS_PER_TWR]
926 = {1, 1, 1, 1, 1, 1, 1, 1};
927 UInt_t threshold_r2[CHANNELS_PER_TWR]
928 = {15, 50, 55, 40, 15, 23, 15, 15};
929
930 // Data for bugfix 3 by Wolfgang
931 // Old (=incorrect) OM config : {183, 184, 185, 38, 187, 188, 189, 190}
932 UInt_t om_no_r3[CHANNELS_PER_TWR]={345, 184, 185, 38, 187, 188, 189, 190};
933 UInt_t om_is_optical_r3[CHANNELS_PER_TWR]={1, 0, 0, 0, 0, 0, 0, 0};
934 UInt_t threshold_r3[CHANNELS_PER_TWR]={20, 50, 50, 80, 50, 50, 50, 50};
935
936 // Old (=incorrect) OM config : {345, 346, 454, 450, 635, 10000, 10000, 10000}
937 UInt_t om_no_r4[CHANNELS_PER_TWR]={183, 346, 454, 450, 635, 10000, 10000, 10000};
938 UInt_t om_is_optical_r4[CHANNELS_PER_TWR]={0, 1, 1, 1, 1, 1, 1, 1};
939 UInt_t threshold_r4[CHANNELS_PER_TWR]={50, 20, 20, 20, 20, 500, 500, 500};
940
941 // Bugfix 1 Andreas Bug
942
943 // By accident this TWR was counted twice in TWR.cnf
944 // as Crate 0 TWR 7 and Crate 4 TWR 7
945 // from run 9153 up to run 9841 (incl.)
946 // TWR_OM 639 642 1 9 10 11 12 30
947 // OPTICAL 0 0 0 0 0 0 0 0
948 // TWR_BASELINE 110 120 110 140 150 160 170 180
949 // TWR_THRESHOLD 50 50 80 80 80 80 80 80
950
951 // Crate 4 TWR 7 should be replaced with this TWR
952 // TWR_OM 111 112 113 114 115 116 39 118
953 // OPTICAL 0 0 0 0 0 0 0 0
954 // TWR_BASELINE 110 120 130 140 150 160 170 180
955 // TWR_THRESHOLD 50 50 50 50 50 50 80 50
956
957 // Begin season 2005 13-feb-2005
958 // Timo corrected TWR.cnf on 05-apr-2006 after run 9841
959 if (run_number>=9153 && run_number<=9841)
960 {
961 i_crate = 4;
962 i_twr = 7;
963 for(i_channel = 0; i_channel < CHANNELS_PER_TWR; i_channel++)
964 {
965 sys->crate[i_crate]->twr[i_twr]->om_no[i_channel]=om_no_r1[i_channel];
966 sys->crate[i_crate]->twr[i_twr]->om_is_optical[i_channel]=om_is_optical_r1[i_channel];
967 sys->crate[i_crate]->twr[i_twr]->threshold[i_channel]=threshold_r1[i_channel];
968 }
969 }
970
971 // Bugfix 2 Timos Bug
972
973 // By accident this TWR was counted twice in TWR.cnf
974 // as Crate 0 TWR 1 and Crate 5 TWR b
975 // from run 9153 up to run 9188 (incl.)
976
977 // TWR_OM 492 493 495 496 497 499 500 501
978 // OPTICAL 1 1 1 1 1 1 1 1
979 // TWR_BASELINE 110 120 130 140 150 160 170 180
980 // TWR_THRESHOLD 16 45 25 42 35 46 15 15
981
982 // Crate 5 TWR b should be corrected to
983 // TWR_OM 473 484 485 486 487 475 490 491
984 // OPTICAL 1 1 1 1 1 1 1 1
985 // TWR_BASELINE 4000 120 130 140 150 4000 170 180
986 // TWR_THRESHOLD 15 50 55 40 15 23 15 15
987
988 // Begin season 2005 : 13-feb-2005
989 // Timo corrected TWR.cnf on 15-mar-2005 (= day 74) after run 9188
990 if (run_number>=9153 && run_number<=9188)
991 {
992 i_crate = 5;
993 i_twr = 0xb;
994 for(i_channel=0; i_channel<CHANNELS_PER_TWR; i_channel++)
995 {
996 sys->crate[i_crate]->twr[i_twr]->om_no[i_channel]=om_no_r2[i_channel];
997 sys->crate[i_crate]->twr[i_twr]->om_is_optical[i_channel]=om_is_optical_r2[i_channel];
998 sys->crate[i_crate]->twr[i_twr]->threshold[i_channel]=threshold_r2[i_channel];
999 }
1000 }
1001
1002 // Bugfix 3 by Wolfgang Wagner : Mismatch of OM 345 and 183
1003 // Begin season 2005 : 13-feb-2005
1004 // Wolfgang corrected TWR.cnf on 15-aug-2005 after run 9988
1005 if (run_number>=9153 && run_number<=9988)
1006 {
1007 i_crate=5;
1008 i_twr=4;
1009 for(i_channel=0; i_channel<CHANNELS_PER_TWR; i_channel++)
1010 {
1011 sys->crate[i_crate]->twr[i_twr]->om_no[i_channel]=om_no_r3[i_channel];
1012 sys->crate[i_crate]->twr[i_twr]->om_is_optical[i_channel]=om_is_optical_r3[i_channel];
1013 sys->crate[i_crate]->twr[i_twr]->threshold[i_channel]=threshold_r3[i_channel];
1014 }
1015
1016 i_twr=5;
1017 for(i_channel=0; i_channel<CHANNELS_PER_TWR; i_channel++)
1018 {
1019 sys->crate[i_crate]->twr[i_twr]->om_no[i_channel]=om_no_r4[i_channel];
1020 sys->crate[i_crate]->twr[i_twr]->om_is_optical[i_channel]=om_is_optical_r4[i_channel];
1021 sys->crate[i_crate]->twr[i_twr]->threshold[i_channel]=threshold_r4[i_channel];
1022 }
1023 }
1024
1025 return(0);
1026}
1027
1028Int_t IceRawTWR::read_event(FILE* fin,sys_config_t* sys,event_t* event_ptr)
1029{
1030 Int_t i_wfm;
1031 UInt_t length_of_event_block;
1032
1033 Int_t n_twr, n_of_waveforms_in_event, read_number;
1034 UInt_t length_wfm[CHANNELS_PER_TWR];
1035 UInt_t dummy, channel_no, om_no, twr_no;
1036
1037 // Reset waveform filled register
1038 memset(&event_ptr->wfm_filled[0], 0, sizeof(UInt_t) * N_OF_CHANNELS);
1039
1040 if( !fread(&dummy,sizeof(UInt_t),1,fin) ) return(1);
1041
1042 if(dummy != 0xbbbbbbbb)
1043 {
1044 printf("Wrong event begin mark %x\n", dummy);
1045 while( (dummy !=0xbbbbbbbb)
1046 && (fread(&dummy,sizeof(UInt_t),1,fin) != 0) )
1047 {;//printf("dummy:%x\n", dummy);
1048 }
1049 }
1050 if( !fread(&length_of_event_block,sizeof(UInt_t),1,fin) ) return(1);
1051 if( !fread(&event_ptr->eventcounter,sizeof(UInt_t),1,fin) ) return(1);
1052 if( !fread(&event_ptr->which_trigger,sizeof(UInt_t),1,fin) ) return(1);
1053 if( !fread(&event_ptr->gps,sizeof(GPS_t),1,fin) ) return(1);
1054
1055 // --reading waveforms from TWR blocks
1056 n_twr = 0;
1057 while(n_twr < int(sys->n_twr))
1058 {
1059 // --read TWR header
1060 if( !fread(&dummy,sizeof(UInt_t),1,fin) ) return(1);
1061 if(dummy != 0xffffffff)
1062 {printf("Wrong twr begin mark %x\n", dummy); return(2);}
1063 if( !fread(&twr_no,sizeof(UInt_t),1,fin) ) return(1);
1064
1065 // nur voruebergehend !!
1066 twr_no -= 0x10;
1067
1068 if( !fread(&event_ptr->twr[twr_no].timestamp,sizeof(UInt_t),1,fin) )
1069 return(1);
1070 if( !fread(&n_of_waveforms_in_event,sizeof(UInt_t),1,fin) )
1071 return(1);
1072 event_ptr->twr[twr_no].n_wfm = n_of_waveforms_in_event;
1073
1074 for(i_wfm=0; i_wfm < n_of_waveforms_in_event; i_wfm++)
1075 {
1076 if( !fread(&length_wfm[i_wfm],sizeof(UInt_t),1,fin) ) return(1);
1077 }
1078
1079 // read waveforms
1080 for(i_wfm=0; i_wfm < n_of_waveforms_in_event; i_wfm++)
1081 {
1082 if(length_wfm[i_wfm] != 0)
1083 {
1084 if( !fread(&channel_no,sizeof(UInt_t),1,fin) ) return(1);
1085 if(sys->twr_field[twr_no]->om_no[channel_no]
1086 < N_OF_CHANNELS)
1087 om_no = sys->twr_field[twr_no]->om_no[channel_no];
1088 else
1089 om_no = N_OF_CHANNELS-1;
1090
1091 /* Fix needed */
1092
1093 event_ptr->twr_id_of_om[om_no] = twr_no;
1094
1095 read_number = fread(&event_ptr->wfm[om_no],
1096 length_wfm[i_wfm]-sizeof(UInt_t),1,fin);
1097 event_ptr->wfm_filled[om_no] = 1;
1098 if( !read_number ) return(1);
1099
1100 // read_number correction for usage of fread() instead of read()
1101 read_number*=length_wfm[i_wfm]-sizeof(UInt_t);
1102
1103 if( read_number != int(length_wfm[i_wfm]-sizeof(UInt_t)) )
1104 {
1105 cout << " read_number : " << read_number
1106 << " length_wfm["<<i_wfm<<"] : " << length_wfm[i_wfm]
1107 << " sizeof(UInt_t) : " << sizeof(UInt_t) << endl;
1108 return(2);
1109 }
1110 }
1111 }
1112 n_twr++;
1113 } // end while n_twr
1114 return(0);
1115}
1116
1117Int_t IceRawTWR::retrigger(event_t* ev,trigger_hits_t* trig)
1118{
1124
1125 // Initialise the trigger_hits_t structure with zeroes
1126 memset(trig, 0, sizeof(trigger_hits_t) );
1127
1128 // Obtain the software trigger info
1129 trig->n_software_trigger=0;
1130 for(Int_t itrigger=0; itrigger<N_OF_TRIGGERS; itrigger++)
1131 {
1132 if(ev->which_trigger & trigger_bits[itrigger])
1133 {
1134 //printf("SetTrigger %i\n", i_trigger);
1135 trig->trigger_active[itrigger]=1;
1136 trig->n_software_trigger++;
1137 }
1138 else
1139 {
1140 trig->trigger_active[itrigger]=0;
1141 }
1142 }
1143
1144 // Obtain the hardware trigger info
1145 trig->n_hardware_trigger=0;
1146 trig->first_trigger_time=10000000;
1147 trig->first_trigger=-1;
1148
1149 for(Int_t jtrigger=0; jtrigger<N_OF_TRIGGERS; jtrigger++)
1150 {
1151 if(!trigger_channel[jtrigger]) continue;
1152
1153 if(ev->wfm_filled[trigger_channel[jtrigger]])
1154 {
1155 trig->trigger_active[jtrigger]=1;
1156 trig->trigger_time[jtrigger]=(ev->wfm[trigger_channel[jtrigger]].value[2] & 0xfff);
1157 trig->trigger_has_pulse[jtrigger]=1;
1158 if (trig->trigger_time[jtrigger] < trig->first_trigger_time)
1159 {
1160 trig->first_trigger_time=trig->trigger_time[jtrigger];
1161 trig->first_trigger=jtrigger;
1162 }
1163 trig->n_hardware_trigger++;
1164 }
1165 }
1166 return 0;
1167}
1168
1169Int_t IceRawTWR::clear_waveform_analysis(waveform_analyse_t* wfm_om)
1170{
1171 Int_t i_value, i_frag, i_edge, i_peak;
1172
1173 if(wfm_om == 0) return(1);
1174
1175 // output from analysis
1176 wfm_om->n_frag = 0;
1177 for(i_frag=0; i_frag < MAX_N_OF_FRAGS; i_frag++)
1178 {
1179 wfm_om->frag_n_points[i_frag] = 0;
1180 wfm_om->frag_begin[i_frag] = 0;
1181 wfm_om->frag_end[i_frag] = 0;
1182 wfm_om->frag_mean[i_frag] = 0;
1183 wfm_om->frag_begin_time[i_frag] = 0;
1184 }
1185
1186 wfm_om->n_peak = 0;
1187 for(i_peak=0; i_peak < MAX_N_OF_PEAKS; i_peak++)
1188 {
1189 wfm_om->peak_begin[i_peak] = 0;
1190 wfm_om->peak_end[i_peak] = 0;
1191 wfm_om->peak_max[i_peak] = 0;
1192 wfm_om->peak_TDC_edge[i_peak] = 0;
1193 wfm_om->peak_local_minimum[i_peak] = 0;
1194 wfm_om->crosstalk_charge_n_value[i_peak] = 0;
1195 wfm_om->peak_in_fragment[i_peak] = 0;
1196
1197 wfm_om->peak_mean[i_peak] = 0.0;
1198
1199 wfm_om->peak_m[i_peak] = 0.0;
1200 wfm_om->peak_b[i_peak] = 0.0;
1201 wfm_om->peak_t0[i_peak] = 0.0;
1202 wfm_om->peak_begin_time[i_peak] = 0.0;
1203 wfm_om->peak_charge[i_peak] = 0.0;
1204 wfm_om->peak_height[i_peak] = 0.0;
1205 wfm_om->fitted_amplitude[i_peak] = 0.0;
1206 wfm_om->fitted_TOT[i_peak] = 0.0;
1207 wfm_om->crosstalk_charge[i_peak] = 0.0;
1208 wfm_om->crosstalk_slope[i_peak] = 0.0;
1209 }
1210
1211 wfm_om->n_point = 0;
1212 wfm_om->wfm_min = 4095;
1213 wfm_om->wfm_max = 0;
1214 wfm_om->b_out_of_range = 0;
1215
1216 for(i_value=0; i_value < 1024; i_value++)
1217 {
1218 wfm_om->wfm_x[i_value] = 0;
1219 wfm_om->wfm_y[i_value] = 0;
1220 }
1221
1222 wfm_om->n_tdc_edges = 0;
1223 for(i_edge=0; i_edge < MAX_N_OF_TDC_EDGES; i_edge++)
1224 {
1225 wfm_om->leading_edge[i_edge] = 0.0;
1226 wfm_om->falling_edge[i_edge] = 0.0;
1227 wfm_om->identified_twr_hit[i_edge] = -1;
1228 }
1229
1230 return(0);
1231}
1232
1233Int_t IceRawTWR::restore_waveform(waveform_t f_wfm,waveform_analyse_t* wfm_om,Int_t year)
1234{
1235 UShort_t wfm_length, mean;
1236 static UShort_t tmp_wf[2000];
1237
1238 Int_t debug = 0;
1239 Int_t fragment_start = 0;
1240 Int_t frag_count = 0; // position in current fragment
1241 Int_t n_position = 0; // position in displayed waveform
1242 UInt_t n_word = 2; // position in featured waveform
1243 Int_t n_fragment = 0; // actual fragment
1244 Int_t b_wrong_value = 0;
1245
1246 UShort_t assumed_frag_begin, last_value; /* bug in eventbuilder */
1247
1248 wfm_om->wfm_min = 4095.0;
1249 wfm_om->wfm_max = 0.0;
1250
1251 if( (f_wfm.value[0] & 0xf000) != 0xf000 ) return(1);
1252 wfm_length = (f_wfm.value[0] & 0xfff)/2;
1253
1254 mean = f_wfm.value[1] + BASELINE_MEAN_MAGIC;
1255 while( ((f_wfm.value[n_word] & 0xf000) == 0x4000) &&
1256 (n_word < wfm_length) &&
1257 (n_fragment < MAX_N_OF_FRAGS) )
1258 {
1259 fragment_start = f_wfm.value[n_word] & 0xfff;
1260 n_word++;
1261 wfm_om->frag_begin_time[n_fragment]
1262 = fragment_start * NSECS_PER_TWR_BIN;
1263 wfm_om->frag_begin[n_fragment] = n_position;
1264 wfm_om->frag_mean[n_fragment] = mean;
1265
1266 b_wrong_value = 0;
1267 frag_count = 0;
1268
1269 while( ((f_wfm.value[n_word] & 0xf000) != 0x2000) &&
1270 ((f_wfm.value[n_word] & 0xf000) != 0x4000) &&/*Reconstructable*/
1271 !b_wrong_value && /* Buggy */
1272 (n_word < wfm_length) )
1273 {
1274 if(year > 2004)
1275 {
1276 /* 2005 2006 data */
1277 if(frag_count == 0)
1278 {
1279 tmp_wf[n_word] = f_wfm.value[n_word] + mean;
1280 wfm_om->wfm_y[n_position] = (float) tmp_wf[n_word];
1281 wfm_om->wfm_x[n_position] = (float)
1282 wfm_om->frag_begin_time[n_fragment]
1283 + (frag_count * NSECS_PER_TWR_BIN);
1284 }
1285 else if(frag_count == 1)
1286 {
1287 tmp_wf[n_word] = f_wfm.value[n_word] + tmp_wf[n_word-1];
1288 wfm_om->wfm_y[n_position] = (float) tmp_wf[n_word];
1289 wfm_om->wfm_x[n_position] = (float)
1290 wfm_om->frag_begin_time[n_fragment]
1291 + (frag_count * NSECS_PER_TWR_BIN);
1292 }
1293 else
1294 {
1295 tmp_wf[n_word] =
1296 2*tmp_wf[n_word-1] + f_wfm.value[n_word];
1297 tmp_wf[n_word] -= tmp_wf[n_word-2];
1298
1299 wfm_om->wfm_y[n_position] = (float) tmp_wf[n_word];
1300 wfm_om->wfm_x[n_position] = (float)
1301 wfm_om->frag_begin_time[n_fragment]
1302 + (frag_count * NSECS_PER_TWR_BIN);
1303 }
1304
1305
1306 /*
1307 Hack for wrongly merged overlapping fragments
1308 */
1309 if(tmp_wf[n_word] > 0x1fff)
1310 {
1311 /* BUG FIXXXX */
1312 /* assume that fragment merge in eventbuilder caused */
1313 /* problem two fragments overlap in EXACTLY ONE point */
1314 /* and are merged first point of the added part of */
1315 /* the fragment is encoded using the former fragment */
1316 /* start as a data point */
1317
1318 last_value = tmp_wf[n_word-1];
1319 assumed_frag_begin = 0x4000 + fragment_start + frag_count;
1320 tmp_wf[n_word] = f_wfm.value[n_word] + 2 * last_value;
1321 tmp_wf[n_word] -= assumed_frag_begin;
1322 wfm_om->wfm_y[n_position] = (float) tmp_wf[n_word];
1323
1324 /* Look if value is still buggy */
1325 if(tmp_wf[n_word] > 0x1fff) b_wrong_value = 1;
1326
1327 debug = ERROR_MISS_FRAG_STOP;
1328 }
1329 } /* end year >= 2005 */
1330 else
1331 {
1332 /* 2003 2004 data */
1333 wfm_om->wfm_y[n_position] = (float) f_wfm.value[n_word];
1334 wfm_om->wfm_x[n_position] = (float)
1335 wfm_om->frag_begin_time[n_fragment]
1336 + (frag_count * NSECS_PER_TWR_BIN);
1337 } /* end year 2003 2004 */
1338
1339 /* Set min and max Y */
1340
1341 if(wfm_om->wfm_y[n_position] > wfm_om->wfm_max)
1342 wfm_om->wfm_max = wfm_om->wfm_y[n_position];
1343 if(wfm_om->wfm_y[n_position] < wfm_om->wfm_min)
1344 wfm_om->wfm_min = wfm_om->wfm_y[n_position];
1345
1346 n_position++;
1347 n_word++;
1348 frag_count++;
1349 }
1350
1351 if((f_wfm.value[n_word] & 0xf000) == 0x2000) /* Normal wavf */
1352 {
1353
1354 wfm_om->frag_end[n_fragment] = n_position - 1;
1355 wfm_om->frag_n_points[n_fragment] =
1356 wfm_om->frag_end[n_fragment]
1357 - wfm_om->frag_begin[n_fragment] + 1;
1358 wfm_om->n_point += wfm_om->frag_n_points[n_fragment];
1359 n_word++;
1360 }
1361 else
1362 return(ERROR_CORRUPTED_WF);
1363
1364 n_fragment++;
1365 } /* end while fragment */
1366
1367
1368 wfm_om->n_frag = n_fragment;
1369 if( !(n_word & 0x1) ) n_word++;
1370
1371 if(n_fragment >= MAX_N_OF_FRAGS) return(ERROR_MAX_N_FRAGMENTS_EXCEEDED);
1372
1373
1374 // Hack to get rid of last value of waveform always set to 0
1375 if (wfm_om->wfm_y[wfm_om->n_point] == 0.0)
1376 {
1377 // erase last point of waveform
1378 wfm_om->n_point--;
1379
1380 // Shorten last pulse if necessary
1381 // if( wfm_om.peak_end[wfm_om.n_peak-1]
1382 // == wfm_om.frag_end[wfm_om.n_frag-1] )
1383 // wfm_om.peak_end[wfm_om.n_peak-1]--;
1384
1385 // Shorten last fragment
1386 wfm_om->frag_n_points[wfm_om->n_frag-1]--;
1387 wfm_om->frag_end[wfm_om->n_frag-1]--;
1388
1389 wfm_om->wfm_min = 4095.0;
1390 wfm_om->wfm_max = 0.0;
1391 for (Int_t i_value=0; i_value < wfm_om->n_point; i_value++)
1392 {
1393 if (wfm_om->wfm_y[i_value] > wfm_om->wfm_max) wfm_om->wfm_max=wfm_om->wfm_y[i_value];
1394 if (wfm_om->wfm_y[i_value] < wfm_om->wfm_min) wfm_om->wfm_min=wfm_om->wfm_y[i_value];
1395 }
1396 }
1397
1398 return(debug);
1399}
1400
ClassImp(IceRawTWR)
Signal (Hit) handling of a generic Amanda Optical Module (AOM).
Definition IceAOM.h:12
Handling of IceCube event data.
Definition IceEvent.h:20
virtual void Reset()
Definition IceEvent.cxx:326
Job for conversion of TWR raw data into IceEvent data structures.
Definition IceRawTWR.h:25
virtual void Exec(Option_t *opt)
Int_t fMaxevt
Definition IceRawTWR.h:42
void PutTrigger(Int_t year)
Int_t clear_event(event_t *event_ptr)
Int_t fPrintfreq
Definition IceRawTWR.h:43
void SetPrintFreq(Int_t f)
Int_t restore_waveform(waveform_t f_wfm, waveform_analyse_t *wfm_om, Int_t year)
void SetOutputFile(TFile *ofile)
Int_t extract_info_from_filename(char *fname, twr_raw_data_file_t *twr_file)
Int_t read_event(FILE *fin, sys_config_t *sys, event_t *event_ptr)
TFile * fOutfile
Definition IceRawTWR.h:45
void SetBufferSize(Int_t bsize)
TFile * GetOutputFile()
waveform_analyse_t fWform
! Waveform info for a certain OM from (merged) fragment(s)
Definition IceRawTWR.h:56
TArrayI fReadout
Definition IceRawTWR.h:46
IceRawTWR(const char *name="IceRawTWR", const char *title="")
Definition IceRawTWR.cxx:99
void PutWaveforms(Int_t year)
Int_t fSplit
Definition IceRawTWR.h:40
FILE * fInput
! Pointer to the TWR raw data input file
Definition IceRawTWR.h:52
Int_t read_header_from_file(FILE *fin, sys_config_t **system_ptr, UInt_t *header_length)
trigger_hits_t fTrigger
! Structure holding the event trigger info
Definition IceRawTWR.h:55
virtual ~IceRawTWR()
TArrayI fThreshold
Definition IceRawTWR.h:47
TObjArray * fInfiles
Definition IceRawTWR.h:44
void SetMaxEvents(Int_t n)
void AddInputFile(TString name)
event_t fEvent
! Structure holding the actual raw event data
Definition IceRawTWR.h:54
void SetSplitLevel(Int_t split)
Int_t clear_system(sys_config_t *sys)
Int_t retrigger(event_t *ev, trigger_hits_t *trig)
sys_config_t * fHeader
! Structure holding the raw configuration header info
Definition IceRawTWR.h:53
Int_t fBsize
Definition IceRawTWR.h:41
TArrayI fExtstop
Definition IceRawTWR.h:48
Int_t update_system(sys_config_t *sys, Int_t run_number)
Int_t clear_waveform_analysis(waveform_analyse_t *wfm_om)
void AddNamedSlot(TString s)
void SetSlotName(TString s, Int_t j=1)
Signal (Hit) handling of a generic device.
Definition NcDevice.h:14
void AddHit(NcSignal &s)
Definition NcDevice.cxx:336
NcSignal * GetHit(Int_t j) const
Definition NcDevice.cxx:489
virtual void Reset(Int_t mode=0)
Definition NcDevice.cxx:222
NcDevice * GetIdDevice(Int_t id, TObjArray *devs=0) const
Definition NcEvent.cxx:1451
void AddDevice(NcDevice &d)
Definition NcEvent.cxx:1210
void SetEventNumber(Int_t evt)
Definition NcEvent.cxx:573
virtual void HeaderData()
Definition NcEvent.cxx:996
void SetDevCopy(Int_t j)
Definition NcEvent.cxx:1313
NcDevice * GetDevice(Int_t i) const
Definition NcEvent.cxx:1380
void SetRunNumber(Int_t run)
Definition NcEvent.cxx:562
void SetTrackCopy(Int_t j)
Definition NcJet.cxx:1413
TObject * GetMainObject() const
Definition NcJob.cxx:294
void SetMainObject(TObject *obj)
Definition NcJob.cxx:305
void AddObject(TObject *obj)
Definition NcJob.cxx:320
void RemoveObject(TObject *obj)
Definition NcJob.cxx:384
NcJob(const char *name="NcJob", const char *title="")
Definition NcJob.cxx:139
void ListEnvironment()
Definition NcJob.cxx:205
Generic handling of (extrapolated) detector signals.
Definition NcSignal.h:23
Int_t GetNwaveforms() const
virtual void Reset(Int_t mode=0)
Definition NcSignal.cxx:334
virtual void SetSignal(Double_t sig, Int_t j=1)
Definition NcSignal.cxx:516
void SetWaveform(TH1F *waveform, Int_t j=1)
virtual Float_t GetSignal(Int_t j=1, Int_t mode=0) const
Definition NcSignal.cxx:651
void SetUT(Int_t y, Int_t m, Int_t d, Int_t hh, Int_t mm, Int_t ss, Int_t ns=0, Int_t ps=0, TString utc="A", Int_t leap=0, Double_t dut=0)