NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
RnoConvert Class Reference

Job for conversion of RNO-G Root data into RnoEvent data structures. More...

#include "RnoConvert.h"

Inheritance diagram for RnoConvert:
NcJob

Detailed Description

Job for conversion of RNO-G Root data into RnoEvent data structures.

Copyright(c) 2021, RNO-G Experiment at Summit Station. All rights reserved.
Author: The RNO-G NCFS-based Offline Project.
Contributors are mentioned in the code where appropriate.
Permission to use, copy, modify and distribute this software and its
documentation strictly for non-commercial purposes is hereby granted
without fee, provided that the above copyright notice appears in all
copies and that both the copyright notice and this permission notice
appear in the supporting documentation.
The authors make no claims about the suitability of this software for
any purpose. It is provided "as is" without express or implied warranty.
// Class RnoConvert
// Conversion of RNO-G Root data into RnoEvent data structures.
// This class is derived from NcJob providing a task-based processing
// structure on an event-by-event basis.
// The main object in the job environment is an RnoEvent* pointer.
// In case the user has provided sub-tasks, these will be executed
// on an event-by-event basis after the RnoEvent structure has been filled
// with the RNO-G data and before the final structures are written out.
// In case the sub-tasks contained event selection procedures, like for
// instance NcEventSelector, only the events that have a proper
// event selection level, see SetSelectLevels(), will be written out.
// Note that the data structures are only written out if an outputfile has
// been specified via the SetOutputFile memberfunction.
// In case no outputfile has been specified, this class provides a facility
// to investigate/analyse RNO-G data using the NCFS/RnoPack analysis tools.
//
// Please refer to /macros/convert.cc for a usage example.
//
//--- Author: Nick van Eijndhoven, IIHE-VUB, Brussel, July 9, 2021 10:09Z
//- Modified: Nick van Eijndhoven, IIHE-VUB, Brussel, September 26, 2025 09:48Z

Definition at line 22 of file RnoConvert.h.

Public Member Functions

 RnoConvert (const char *name="RnoConvert", const char *title="")
 
virtual ~RnoConvert ()
 
void AddInputFile (TString file, TString type)
 
virtual void Exec (Option_t *opt)
 
Int_t GetMaxSelectLevel () const
 
Int_t GetMinSelectLevel () const
 
TFile * GetOutputFile ()
 
void ListInput (TString type="*", Option_t *opt="")
 
void SetBufferSize (Int_t bsize)
 
void SetMaxEvents (Int_t n)
 
void SetOutputFile (TFile *ofile)
 
void SetOutputFile (TString name)
 
void SetPrintFreq (Int_t m, Int_t level=0)
 
void SetSelectLevels (Int_t min, Int_t max)
 
void SetSplitLevel (Int_t split)
 
- Public Member Functions inherited from NcJob
 NcJob (const char *name="NcJob", const char *title="")
 
virtual ~NcJob ()
 
void AddObject (TObject *obj)
 
void AddObjects (TObjArray *arr)
 
void ExecuteJob (Int_t mode=0)
 
TFolder * GetFolder () const
 
TObject * GetMainObject () const
 
TObject * GetObject (const char *classname) const
 
TObject * GetObject (Int_t j) const
 
TObjArray * GetObjects () const
 
TObjArray * GetObjects (const char *classname)
 
void ListEnvironment ()
 
void MakeFolder ()
 
void ProcessObject (TObject *obj)
 
void RemoveObject (TObject *obj)
 
void RemoveObjects (const char *classname)
 

Protected Member Functions

void CreateMainChain ()
 
- Protected Member Functions inherited from NcJob
void SetMainObject (TObject *obj)
 

Protected Attributes

Int_t fBsize
 
TChain * fComb
 
TChain * fData
 
TChain * fDs
 
TChain * fHdr
 
Int_t fMaxevt
 
Int_t fMaxSelectLevel
 
Int_t fMinSelectLevel
 
TFile * fOutfile
 
TChain * fPed
 
Int_t fPrintfreq
 
Int_t fPrintlevel
 
Int_t fSplit
 
TChain * fWf
 
- Protected Attributes inherited from NcJob
TFolder * fFolder
 
TObject * fMainObject
 
Int_t fMakefolder
 
TObjArray * fObjects
 
TObjArray * fSelect
 ! Temp. array of pointers to user-selected stored objects
 

Constructor & Destructor Documentation

◆ RnoConvert()

RnoConvert::RnoConvert ( const char * name = "RnoConvert",
const char * title = "" )
// Default constructor.
// By default maxevent=-1, split=0, bsize=32000, printfreq=1 and select=[0,-1].

Definition at line 51 of file RnoConvert.cxx.

◆ ~RnoConvert()

RnoConvert::~RnoConvert ( )
virtual
// Default destructor.

Definition at line 76 of file RnoConvert.cxx.

Member Function Documentation

◆ AddInputFile()

void RnoConvert::AddInputFile ( TString file,
TString type )
// Add the RNO-G input file to the data chain.
//
// file : Name of the input file to be added (wildcards are allowed)
// type : The type of data that is contained in the file
//
// The supported options for "type" are the following :
// ----------------------------------------------------
// hdr : To indicate a file that contains event header data
// ds : To indicate a file that contains the DAQ status for each event
// wf : To indicate a file that contains the recorded waveform for each channel in the event
// combined : To indicate a file that contains for each event a combination of the above
// pedestal : To indicate a file that contains pedestal data for each channel
//
// Environment variables may be used as $(...) in the filenname for convenience.
// For example "$(HOME)/my-data/station11/combined.root".

Definition at line 163 of file RnoConvert.cxx.

◆ CreateMainChain()

void RnoConvert::CreateMainChain ( )
protected
// Internal member function to create the main input data chain for processing.

Definition at line 365 of file RnoConvert.cxx.

◆ Exec()

void RnoConvert::Exec ( Option_t * opt)
virtual
// Job to loop over the specified number of events and convert the
// RNO-G Root data into the RnoEvent structure.
// If maxevents<0 (default) all the entries of the input file
// will be processed.
// Every "printfreq" events a short event summary will be printed.
// The default value is printfreq=1.
// The output will be written on a standard output tree named "T".
//
// Notes :
// -------
// 1) This class is derived from NcJob, allowing a task based processing.
// After the conversion of an RNO-G Root data event into an RnoEvent structure,
// the processing of all available sub-tasks (if any) is invoked.
// This provides an event-by-event (sub)task processing before the
// final data structures are written out.
// 2) The main object in this job environment is an RnoEvent* pointer.

Definition at line 458 of file RnoConvert.cxx.

◆ GetMaxSelectLevel()

Int_t RnoConvert::GetMaxSelectLevel ( ) const
// Provide the maximum required event selection level for events to be written out.

Definition at line 281 of file RnoConvert.cxx.

◆ GetMinSelectLevel()

Int_t RnoConvert::GetMinSelectLevel ( ) const
// Provide the minimum required event selection level for events to be written out.

Definition at line 270 of file RnoConvert.cxx.

◆ GetOutputFile()

TFile * RnoConvert::GetOutputFile ( )
// Provide pointer to the RnoEvent output file.

Definition at line 354 of file RnoConvert.cxx.

◆ ListInput()

void RnoConvert::ListInput ( TString type = "*",
Option_t * opt = "" )
// Provide an overview listing of the input data chain selected via "type".
//
// The supported options for "type" are the following :
// ----------------------------------------------------
// hdr : Data chain that contains event header data
// ds : Data chain that contains the DAQ status for each event
// wf : Data chain that contains the recorded waveform for each channel in the event
// combined : Data chain that contains for each event a combination of the above
// pedestal : Data chain that contains pedestal data for each channel
// * : List all stored data chains
//
// The input argument "opt" has the same meaning as for the ROOT TTree::Print().
//
// The default values are type="*" and opt="".

Definition at line 292 of file RnoConvert.cxx.

◆ SetBufferSize()

void RnoConvert::SetBufferSize ( Int_t bsize)
// Set the buffer size for the ROOT data file.
// bsize=32000 is the default initialisation in the constructor.

Definition at line 151 of file RnoConvert.cxx.

◆ SetMaxEvents()

void RnoConvert::SetMaxEvents ( Int_t n)
// Set the maximum number of events to be processed.
// n=-1 implies processing of the complete input file, which is the default
// initialisation in the constructor.

Definition at line 97 of file RnoConvert.cxx.

◆ SetOutputFile() [1/2]

void RnoConvert::SetOutputFile ( TFile * ofile)
// Set the output file for the RnoEvent data.

Definition at line 223 of file RnoConvert.cxx.

◆ SetOutputFile() [2/2]

void RnoConvert::SetOutputFile ( TString name)
// Create the output file for the RnoEvent data.
//
// Environment variables may be used as $(...) in the filenname for convenience.
// For example "$(HOME)/my-data/sample.rnopack".

Definition at line 235 of file RnoConvert.cxx.

◆ SetPrintFreq()

void RnoConvert::SetPrintFreq ( Int_t m,
Int_t level = 0 )
// Set the printfrequency to produce info every "m" events.
// No printout is produced for m<=0.
//
// level=0 --> Only a progress output line is printed
// 1 --> Only the event header info is printed
// 2 --> Both a progress output line and the event header info are printed
//
// Note : Unsupported input for "level" results in level=0.
//
// At invokation of this memberfunction the default value is level=0.
// The default constructor has initialized m=0 and level=0.

Definition at line 110 of file RnoConvert.cxx.

◆ SetSelectLevels()

void RnoConvert::SetSelectLevels ( Int_t min,
Int_t max )
// Set the required event selection level interval [min,max] for events to be written out.
// The generic (NcEvent) convention is <0:reject 0:undecided >0:accept.
//
// Note : If max<min there will be no check on the maximum value.
//
// min=0 and max=-1 are the default initialisations in the constructor.

Definition at line 253 of file RnoConvert.cxx.

◆ SetSplitLevel()

void RnoConvert::SetSplitLevel ( Int_t split)
// Set the split level for the ROOT data file.
// split=99 is the default initialisation in the constructor.

Definition at line 139 of file RnoConvert.cxx.

Member Data Documentation

◆ fBsize

Int_t RnoConvert::fBsize
protected

Definition at line 43 of file RnoConvert.h.

◆ fComb

TChain* RnoConvert::fComb
protected

Definition at line 51 of file RnoConvert.h.

◆ fData

TChain* RnoConvert::fData
protected

Definition at line 53 of file RnoConvert.h.

◆ fDs

TChain* RnoConvert::fDs
protected

Definition at line 49 of file RnoConvert.h.

◆ fHdr

TChain* RnoConvert::fHdr
protected

Definition at line 48 of file RnoConvert.h.

◆ fMaxevt

Int_t RnoConvert::fMaxevt
protected

Definition at line 44 of file RnoConvert.h.

◆ fMaxSelectLevel

Int_t RnoConvert::fMaxSelectLevel
protected

Definition at line 55 of file RnoConvert.h.

◆ fMinSelectLevel

Int_t RnoConvert::fMinSelectLevel
protected

Definition at line 54 of file RnoConvert.h.

◆ fOutfile

TFile* RnoConvert::fOutfile
protected

Definition at line 47 of file RnoConvert.h.

◆ fPed

TChain* RnoConvert::fPed
protected

Definition at line 52 of file RnoConvert.h.

◆ fPrintfreq

Int_t RnoConvert::fPrintfreq
protected

Definition at line 45 of file RnoConvert.h.

◆ fPrintlevel

Int_t RnoConvert::fPrintlevel
protected

Definition at line 46 of file RnoConvert.h.

◆ fSplit

Int_t RnoConvert::fSplit
protected

Definition at line 42 of file RnoConvert.h.

◆ fWf

TChain* RnoConvert::fWf
protected

Definition at line 50 of file RnoConvert.h.


The documentation for this class was generated from the following files: