168 if (f!=
"-")
fVarFunc=
new TF1(
"VarFunc",f);
196 if (f!=
"-")
fVarFunc=
new TF1(
"VarFunc",f);
228 if (mode!=
"Mean" && mode!=
"Median" && mode!=
"RMS" && mode!=
"SpreadMean" && mode!=
"SpreadMedian" && mode!=
"RMSdeviation")
230 cout <<
" *" << ClassName() <<
"::DefineStatistic* Unknown mode : " << mode << endl;
231 cout <<
" Will continue with current mode : " <<
fAvMode << endl;
283 if (mode<0 || mode>3 || n<1 || nrms<0 || fpr<0)
285 cout <<
" *" << ClassName() <<
"::SetBaselineMode* Inconsistent input." << endl;
286 cout <<
" mode:" << mode <<
" n:" << n <<
" nrms:" << nrms <<
" fpr:" << fpr << endl;
287 cout <<
" Will continue with current settings : mode=" << mode <<
" n=" << n <<
" nrms=" << nrms <<
" fpr=" << fpr << endl;
296 if (!mode || mode==3) n=-1;
351 Int_t arrsize=freqs.GetSize();
361 Int_t oddsize=arrsize%2;
362 Int_t nbands=arrsize/2;
363 if (nbands<1 || n<1 || oddsize)
365 printf(
" *%-s::SetBandFilters* Invalid input array size=%-i nbands=%-i n=%-i \n",ClassName(),arrsize,nbands,n);
373 for (Int_t i=0; i<arrsize; i++)
391 cout <<
" *" << ClassName() <<
"::SetNbins24* Inconsistent input : " << n << endl;
392 cout <<
" Will continue with current value : " <<
fNbins24 << endl;
412 NcJob* parent=(
NcJob*)(gROOT->GetListOfTasks()->FindObject(name.Data()));
420 Int_t select=
fEvt->GetSelectLevel();
421 if (select<0)
return;
426 if (daq) fsample=daq->
GetSignal(
"Sampling-rate");
427 fDSP.SetSamplingFrequency(fsample);
437 TString sxname=
"none";
438 TString varname=
"none";
439 TString monval=
"none";
453 Float_t bsize=24.*60./float(
fNbins24);
456 ndevs=devs->GetEntries();
458 for (Int_t idev=0; idev<ndevs; idev++)
468 if (
fSta>=0 && ista!=
fSta)
continue;
476 sxname=sx->GetName();
487 monval+=
fVarFunc->GetExpFormula(
"p");
488 monval.ReplaceAll(
"x",varname);
492 Int_t ndata=sx->
GetN();
494 if (!ndata)
continue;
498 for (Int_t j=0; j<ndata; j++)
506 fGin=
fEvt->GetSamplingGraph(ista,ichan);
519 if (!ndata)
continue;
523 for (Int_t j=0; j<ndata; j++)
525 fGout.GetPoint(j,x,data[j]);
530 Int_t narr=
fBands.GetSize();
536 for (Int_t j=0; j<narr; j++)
538 bands[j]=
fBands[j]*1.e6/fsample;
540 TH1F* hkern=(TH1F*)
fHistos.FindObject(
"hFilterKernel");
544 hkern->SetName(
"hFilterKernel");
550 TArrayD temp=
fDSP.FilterMultiBand(bands,
fNkernel,0,0,0,&i1,&i2);
553 if (ndata<1)
continue;
558 for (Int_t j=i1; j<=i2; j++)
560 if (index>=ndata)
break;
568 for (Int_t j=0; j<ndata; j++)
590 hut24=(TH1F*)
fHistos.FindObject(str);
591 hnut24=(TH1I*)
fHistos.FindObject(str2);
595 hnut24=
new TH1I(str2,
"UT24 bin entry counts;Universal Time (hours);Number of entries",
fNbins24,0,24);
597 hut24=
new TH1F(str,
"UT daily monitoring",
fNbins24,0,24);
599 str.Form(
"Daily monitoring (%-.3g min. periods) of Station%-i ",bsize,ista);
600 str+=antx->GetName();
602 str2+=
";Universal Time (hours);";
606 hut24->SetTitle(str2);
618 hlt24=(TH1F*)
fHistos.FindObject(str);
619 hnlt24=(TH1I*)
fHistos.FindObject(str2);
623 hnlt24=
new TH1I(str2,
"LT24 bin entry counts;Summit Local Time (hours);Number of entries",
fNbins24,0,24);
625 hlt24=
new TH1F(str,
"LT daily monitoring",
fNbins24,0,24);
627 str.Form(
"Daily monitoring (%-.3g min. periods) of Station%-i ",bsize,ista);
628 str+=antx->GetName();
630 str2+=
";Summit Local Time (hours);";
634 hlt24->SetTitle(str2);
646 hlmst24=(TH1F*)
fHistos.FindObject(str);
647 hnlmst24=(TH1I*)
fHistos.FindObject(str2);
651 hnlmst24=
new TH1I(str2,
"LMST24 bin entry counts;Summit Mean Siderial Time (hours);Number of entries",
fNbins24,0,24);
653 hlmst24=
new TH1F(str,
"LMST daily monitoring",
fNbins24,0,24);
655 str.Form(
"Daily monitoring (%-.3g min. periods) of Station%-i ",bsize,ista);
656 str+=antx->GetName();
658 str2+=
";Summit Mean Siderial Time (hours);";
662 hlmst24->SetTitle(str2);
667 hut24->Fill(time,val);
671 hlt24->Fill(time,val);
675 hlmst24->Fill(time,val);
676 hnlmst24->Fill(time);
681 TString sbase=
"None";
682 if (
fBasemode==1) sbase=
"Mean of consecutive samples per block";
683 if (
fBasemode==2) sbase=
"Median of consecutive samples per block";
684 if (
fBasemode==3) sbase=
"Bayesian Blocks";
686 printf(
" *%-s::Exec* Processor parameter settings. \n",ClassName());
687 printf(
" Processor name ............ : %-s \n",GetName());
688 printf(
" Processor title ........... : %-s \n",GetTitle());
689 printf(
" Device class .............. : %-s \n",
fDevClass.Data());
690 printf(
" Station number ............ : %-i (<0 means all stations) \n",
fSta);
691 printf(
" Channel number ............ : %-i (<0 means all channels) \n",
fChan);
692 printf(
" Device sample ............. : Index=%-i Name=%-s \n",
fDevSample,sxname.Data());
693 printf(
" Sample variable ........... : Index=%-i Name=%-s \n",
fVarIndex,varname.Data());
694 printf(
" Monitor value ............. : %-s \n",monval.Data());
695 printf(
" Baseline correction mode .. : %-i (%-s) \n",
fBasemode,sbase.Data());
698 printf(
" Baseline block size ....... : %-i samples \n",
fBlocksize);
702 printf(
" Bayesian Block nrms ....... : %-g \n",
fNrms);
703 printf(
" Bayesian Block FPR ........ : %-g \n",
fFPR);
705 printf(
" Band Filter kernel size ... : %-i \n",
fNkernel);
706 printf(
" Number of bins for 24 hours : %-i \n",
fNbins24);
721 cout <<
" === The following " << nh <<
" histograms have been generated for DeviceClass : " <<
fDevClass << endl;
722 for (Int_t ih=0; ih<nh; ih++)
726 cout <<
" " << hx->GetName() <<
" : " << hx->GetTitle() << endl;
728 cout <<
" ===============================================================================" << endl;
741 TTree Parameters(
"Parameters",
"Parameter settings");
742 Parameters.Branch(
"BaseMode",&
fBasemode,
"BaseMode/I Baseline");
743 Parameters.Branch(
"Blocksize",&
fBlocksize,
"Blocksize/I # samples");
744 Parameters.Branch(
"Nrms",&
fNrms,
"Nrms/D # RMS deviations");
745 Parameters.Branch(
"FPR",&
fFPR,
"FPR/D False Positive Rate");
749 TFile fout(filename,
"RECREATE",
"RnoMonitor results");
767 for (Int_t ih=0; ih<nh; ih++)
775 TH1* hn=(TH1*)
fHistos.FindObject(name);
780 nbins=hx->GetNbinsX();
781 nen=hx->GetEntries();
783 TArrayD* arrw2=hx->GetSumw2();
784 for (Int_t ibin=1; ibin<=nbins; ibin++)
786 nk=hn->GetBinContent(ibin);
789 mu=hx->GetBinContent(ibin)/double(nk);
791 if (arrw2) sumw2=arrw2->At(ibin);
792 msq=sumw2/double(nk);
800 if (var>=0) s=sqrt(var);
802 hx->SetBinContent(ibin,cval);
805 hx->SetBinError(ibin,s/sqrt(nk));
817 cout <<
" *" << ClassName() <<
"::WriteHistograms* All generated histograms have been written to file : " << filename << endl;
Virtual lab to provide (astro)physical parameters, treat data and relate observations with astrophysi...
Double_t GetLabTimeOffset() const
void SetExperiment(TString name, Int_t id=0)
Signal (Hit) handling of a generic device.
Base class for top level job in a task based procedure.
TObject * GetObject(const char *classname) const
Sampling and statistics tools for various multi-dimensional data samples.
Int_t GetIndex(TString name) const
TString GetVariableName(Int_t i) const
Double_t GetEntry(Int_t i, Int_t j, Int_t mode=0, Int_t k=0)
NcSample * GetSample(Int_t j=1) const
virtual Float_t GetSignal(Int_t j=1, Int_t mode=0) const
Handling of RNO-G event data.
Signal (Hit) handling of an RNO-G Generic Antenna (GANT).
Int_t GetNumber(Int_t id=0) const
Int_t GetStation(Int_t id=0) const
TTask derived class to monitor RNO-G data over certain time periods.
void SetBaselineMode(Int_t mode, Int_t n=128, Double_t nrms=1.2, Double_t fpr=0.1)
virtual void Exec(Option_t *opt)
void SetDeviceSample(Int_t j)
void SetDevices(TString devclass, Int_t ista=-1, Int_t ichan=-1)
void SetSampleVariable(Int_t i, TString f="-")
void SetBandFilters(TArray &freqs, Int_t n)
void ListHistograms() const
void WriteHistograms(TString filename)
RnoMonitor(const char *name="RnoMonitor", const char *title="RNO-G data monitoring")
void DefineStatistic(TString mode)