128 if (level<0 || level>2)
130 cout <<
" *" << ClassName() <<
"::SetPrintFreq* Unsupported input : level=" << level <<
" --> Print level set to 0." << endl;
148 if (split>=0)
fSplit=split;
160 if (bsize>=0)
fBsize=bsize;
186 file=gSystem->ExpandPathName(file.Data());
188 if (type!=
"hdr" && type!=
"ds" && type!=
"wf" && type!=
"combined" && type!=
"pedestal")
190 printf(
" *%-s::AddInputFile* Unsupported type : %-s. File %-s not added. \n",ClassName(),type.Data(),file.Data());
195 if (type==
"hdr") chain=
fHdr;
196 if (type==
"ds") chain=
fDs;
197 if (type==
"wf") chain=
fWf;
198 if (type==
"combined") chain=
fComb;
199 if (type==
"pedestal") chain=
fPed;
203 if (type!=
"pedestal")
205 chain=
new TChain(type.Data());
211 if (type==
"hdr")
fHdr=chain;
212 if (type==
"ds")
fDs=chain;
213 if (type==
"wf")
fWf=chain;
214 if (type==
"combined")
fComb=chain;
215 if (type==
"pedestal")
fPed=chain;
218 chain->Add(file.Data());
220 printf(
" *%-s::AddInputFile* Added RNO-G %-s data input file : %-s \n",ClassName(),type.Data(),file.Data());
247 name=gSystem->ExpandPathName(name.Data());
250 fOutfile=
new TFile(name.Data(),
"RECREATE",
"RNO-G data in RnoEvent structure");
315 printf(
"\n *%-s::ListInput* No input file of type %-s has been attached. \n",ClassName(),type.Data());
320 if (s==
"") s=
"Default";
325 printf(
"\n *%-s::ListInput* Overview of all the stored input data with option : %-s \n",ClassName(),s.Data());
336 if (type==
"hdr") chain=
fHdr;
337 if (type==
"ds") chain=
fDs;
338 if (type==
"wf") chain=
fWf;
339 if (type==
"combined") chain=
fComb;
340 if (type==
"pedestal") chain=
fPed;
344 printf(
"\n *%-s::ListInput* Overview of the %-s input data with option : %-s \n",ClassName(),type.Data(),s.Data());
349 printf(
"\n *%-s::ListInput* No input file of type %-s has been attached. \n",ClassName(),type.Data());
382 fData=
new TChain(
"Data");
391 fData=
new TChain(
"Data");
405 fData=
new TChain(
"Data");
419 fData=
new TChain(
"Data");
433 fData=
new TChain(
"Data");
447 fData=
new TChain(
"Data");
486 cout <<
" *" << ClassName() <<
"::Exec* No data input file(s) specified." << endl;
494 otree=
new TTree(
"T",
"RNO-G data converted to RnoEvent structures");
506 if (otree) otree->Branch(
"Events",
"RnoEvent",&evt,
fBsize,
fSplit);
513 cout <<
" *" << ClassName() <<
"::Exec* Overview of scheduled processing." << endl;
514 cout <<
" ***" << endl;
515 cout <<
" *** Start processing of job " << GetName() <<
" ***" << endl;
516 cout <<
" ***" << endl;
517 cout <<
" Maximum number of events to be processed : " <<
fMaxevt <<
" (<0 means all events)" << endl;
518 cout <<
" Print frequency : " <<
fPrintfreq <<
" (<=0 means no printout)" << endl;
522 cout <<
" RnoEvent output file : " <<
fOutfile->GetName() << endl;
523 cout <<
" Output characteristics : splitlevel = " <<
fSplit <<
" buffersize = " <<
fBsize << endl;
531 Int_t nen=
fData->GetEntries();
553 NcTagger trigger(
"Trigger",
"Trigger tags");
557 NcSample signal(
"Signals",
"Radiant signals");
562 NcSample pedestal(
"Pedestals",
"Pedestal values");
589 for (Int_t ient=0; ient<nen; ient++)
595 fData->GetEntry(ient);
607 TIterator* iter=
fData->GetIteratorOnAllLeaves();
608 while((lx=(TLeaf*)iter->Next()))
613 if (!run && name==
"run_number") run=lx->GetValue();
614 if (!event && name==
"event_number")
event=lx->GetValue();
615 if (!station && name==
"station_number") station=lx->GetValue();
616 if (!trigtime && name==
"trigger_time") trigtime=lx->GetValue();
617 if (!trigtime && name==
"when") trigtime=lx->GetValue();
618 if (!nsamples && name==
"buffer_length") nsamples=lx->GetValue();
621 if (name.Contains(
"trigger_info"))
623 name.ReplaceAll(
"trigger_info.",
"");
624 value=lx->GetValue();
625 ivalue=TMath::Nint(value);
631 if (name.Contains(
"lt_info.window")) namex1=
"lt-window";
632 if (name.Contains(
"lt_info.num_coinc")) namex1=
"lt-ncoinc";
642 if (name.Contains(
"radiant_info.RF_window"))
644 namex1=
"LPDA-up-window";
645 namex2=
"LPDA-down-window";
646 value=lx->GetValue(0);
649 value=lx->GetValue(1);
654 if (name.Contains(
"radiant_info.RF_ncoinc"))
656 namex1=
"LPDA-up-ncoinc";
657 namex2=
"LPDA-down-ncoinc";
658 value=lx->GetValue(0);
661 value=lx->GetValue(1);
668 if (name.Contains(
"_trigger"))
671 if (name.Contains(
"which_radiant"))
673 namex1=
"LPDA-up_trigger";
674 namex2=
"LPDA-down_trigger";
675 namex3=
"radiant-unknown_trigger";
678 trigger.
SetPass(namex1,kFALSE);
679 trigger.
SetPass(namex2,kFALSE);
680 trigger.
SetPass(namex3,kFALSE);
684 trigger.
SetPass(namex1,kFALSE);
685 trigger.
SetPass(namex2,kFALSE);
691 trigger.
SetPass(namex2,kFALSE);
692 trigger.
SetPass(namex3,kFALSE);
696 trigger.
SetPass(namex1,kFALSE);
698 trigger.
SetPass(namex3,kFALSE);
704 if (ivalue) flag=kTRUE;
711 if (name==
"radiant_data") lradiant=lx;
712 if (name==
"pedestals") lpedestal=lx;
726 if (run<571) iradiant=1;
727 if (run<474) iradiant=0;
728 if (run>=571) iradiant=2;
732 if (run<753) iradiant=1;
733 if (run<646) iradiant=0;
737 if (run<656) iradiant=1;
738 if (run<574) iradiant=0;
741 daq.
SetSignal(iradiant,
"RADIANT-update");
750 if (!nsamples) nsamples=2048;
756 for (Int_t i=0; i<24; i++)
767 for (Int_t j=0; j<nsamples; j++)
770 value=lx->GetValue(idx);
785 for (Int_t i=0; i<24; i++)
796 for (Int_t j=0; j<nsamples; j++)
799 value=lx->GetValue(idx);
800 pedestal.
Enter(value);
813 UInt_t
id=station+100*run;
814 evt->SetUniqueID(
id);
818 ExecuteTasks(GetName());
825 perc=100*(ient+1)/nen;
828 cout <<
" *** Processed input entry : " << ient <<
" run : " << run <<
" event : " <<
event <<
" (" << perc <<
"%)" << endl;
843 if (otree) otree->Fill();
852 cout <<
" *" << ClassName() <<
"::Exec* Number of (selected) events written to output : " << nwritten << endl;
void AddNamedSlot(TString s)
NcDevice * GetDevice(Int_t i) const
void AddDevice(NcDevice &d)
virtual void Reset(Int_t mode=0)
Signal (Hit) handling of a generic device.
virtual void Reset(Int_t mode=0)
void SetEventNumber(Int_t evt)
virtual void HeaderData()
Int_t GetSelectLevel() const
void SetDetector(NcDetector d)
virtual void SetOwner(Bool_t own=kTRUE)
void SetRunNumber(Int_t run)
void SetMainObject(TObject *obj)
void RemoveObject(TObject *obj)
NcJob(const char *name="NcJob", const char *title="")
Sampling and statistics tools for various multi-dimensional data samples.
void SetNames(TString name1="X", TString name2="Y", TString name3="Z", TString name4="T")
void SetStoreMode(Int_t mode=1, Int_t nmax=0, Int_t i=0)
virtual void SetSignal(Double_t sig, Int_t j=1)
void SetSample(NcSample *sample, Int_t j=1)
Handling of generic event classification tags.
void SetPass(TString name, Bool_t flag)
Int_t SetUnixTime(Double_t sec, TString utc="A", Int_t leap=0, Double_t dut=0)
Job for conversion of RNO-G Root data into RnoEvent data structures.
Int_t GetMaxSelectLevel() const
Int_t GetMinSelectLevel() const
void AddInputFile(TString file, TString type)
void SetPrintFreq(Int_t m, Int_t level=0)
void SetSelectLevels(Int_t min, Int_t max)
RnoConvert(const char *name="RnoConvert", const char *title="")
void ListInput(TString type="*", Option_t *opt="")
virtual void Exec(Option_t *opt)
void SetSplitLevel(Int_t split)
void SetOutputFile(TFile *ofile)
void SetMaxEvents(Int_t n)
void SetBufferSize(Int_t bsize)
Handling of RNO-G detector data.
RnoStation * GetStation(Int_t id, Bool_t create)
Handling of RNO-G event data.
Handling of RNO-G event data.