Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
TimeCorrectionModule.cxx
Go to the documentation of this file.
1//*-- Author : Ole Hansen 18-Oct-19
2
4//
5// HallA::TimeCorrectionModule
6//
7// Calculates a time correction for the VDC based on a generic formula.
8//
10
12#include "THaAnalyzer.h"
13
14using namespace std;
15
16namespace Podd {
17
18//_____________________________________________________________________________
20 const char* description,
21 Int_t stage )
22 : InterStageModule(name, description, stage),
23 fGlOffset(0.0), fEvtTime(0.0)
24{
25 // Constructor
26}
27
28//_____________________________________________________________________________
35
36//_____________________________________________________________________________
42
43//_____________________________________________________________________________
45{
46 // Define/delete event-by-event global variables
47
48 Int_t ret = InterStageModule::DefineVariables(mode);// exports fDataValid etc.
49 if( ret )
50 return ret;
51
52 RVarDef vars[] = {
53 { "evtime", "Time offset for event", "fEvtTime" },
54 { nullptr }
55 };
56
57 return DefineVarsFromList( vars, mode );
58}
59
60//_____________________________________________________________________________
62{
63 // Read this detector's parameters from the database.
64
65// const char* const here = "ReadDatabase";
66
67 FILE* file = OpenFile( date );
68
69 fGlOffset = 0.0;
70 if( !file ) {
71 // Missing file OK -- all keys are optional
72 fIsInit = true;
73 return kOK;
74 }
75
76 // Read configuration parameters
77 fIsInit = false;
78 DBRequest config_request[] = {
79 { "glob_off", &fGlOffset, kDouble, 0, true },
80 { nullptr }
81 };
82 Int_t err = LoadDB( file, date, config_request );
83 fclose(file);
84 if( err )
85 return err;
86
87 fIsInit = true;
88 return kOK;
89}
90
91//_____________________________________________________________________________
92
93} // namespace HallA
94
96
int Int_t
const char Option_t
Option_t Option_t TPoint TPoint const char mode
char name[80]
virtual void Clear(Option_t *opt="")
virtual Int_t DefineVariables(EMode mode=kDefine)
virtual Int_t DefineVariables(EMode mode=kDefine)
virtual void Clear(Option_t *opt="")
TimeCorrectionModule(const char *name, const char *description, Int_t stage)
virtual Int_t ReadDatabase(const TDatime &date)
static Int_t LoadDB(FILE *file, const TDatime &date, const DBRequest *request, const char *prefix, Int_t search=0, const char *here="THaAnalysisObject::LoadDB")
static Int_t DefineVarsFromList(const void *list, EType type, EMode mode, const char *def_prefix, const TObject *obj, const char *prefix, const char *here, const char *comment_subst="")
virtual FILE * OpenFile(const TDatime &date)
STL namespace.
ClassImp(TPyArg)