MIDAS
Loading...
Searching...
No Matches
Scaler Struct Reference
Inheritance diagram for Scaler:
Collaboration diagram for Scaler:

Public Member Functions

 Scaler (TARunInfo *runinfo)
 
 ~Scaler ()
 
void BeginRun (TARunInfo *runinfo)
 
void EndRun (TARunInfo *runinfo)
 
TAFlowEventAnalyze (TARunInfo *runinfo, TMEvent *event, TAFlags *flags, TAFlowEvent *flow)
 

Public Attributes

double fScaler [32]
 

Detailed Description

Definition at line 105 of file scaler_module.cxx.

Constructor & Destructor Documentation

◆ Scaler()

Scaler::Scaler ( TARunInfo runinfo)
inline

Definition at line 109 of file scaler_module.cxx.

110 : TARunObject(runinfo)
111 {
112 printf("Scaler::ctor!\n");
113
114 memset(fScaler, 0, sizeof(fScaler));
115 }
RUNINFO runinfo
Definition analyzer.cxx:49
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
double fScaler[32]
Here is the call graph for this function:

◆ ~Scaler()

Scaler::~Scaler ( )
inline

Definition at line 117 of file scaler_module.cxx.

118 {
119 printf("Scaler::dtor!\n");
120 }
Here is the call graph for this function:

Member Function Documentation

◆ Analyze()

TAFlowEvent * Scaler::Analyze ( TARunInfo runinfo,
TMEvent event,
TAFlags flags,
TAFlowEvent flow 
)
inline

Definition at line 134 of file scaler_module.cxx.

135 {
136 printf("Analyze, run %d, event serno %d, id 0x%04x, data size %d\n", runinfo->fRunNo, event->serial_number, (int)event->event_id, event->data_size);
137
138 TMBank* bsclr = event->FindBank("SCLR");
139 if (!bsclr)
140 return flow;
141
142 uint32_t* psclr = (uint32_t*)event->GetBankData(bsclr);
143 if (!psclr)
144 return flow;
145
146 int n = bsclr->data_size / sizeof(uint32_t);
147 if (n == 0)
148 return flow;
149
150 assert(n == 32); // original scaler.cxx has a bug, there is no check for correct size of SCLR bank. K.O.
151
152 double acum[32];
153
154 /* accumulate scalers */
155 for (int i = 0; i < n; i++) {
156 fScaler[i] += psclr[i];
157 acum[i] = fScaler[i];
158 }
159
160 /* create acummulated scaler bank */
161 event->AddBank("ACUM", TID_DOUBLE, (char*)&acum, sizeof(acum));
162
163 return flow;
164 }
#define TID_DOUBLE
Definition midas.h:343
DWORD n[4]
Definition mana.cxx:247
INT i
Definition mdump.cxx:32
Here is the call graph for this function:

◆ BeginRun()

void Scaler::BeginRun ( TARunInfo runinfo)
inline

Definition at line 122 of file scaler_module.cxx.

123 {
124 printf("BeginRun, run %d, file %s\n", runinfo->fRunNo, runinfo->fFileName.c_str());
125
126 memset(fScaler, 0, sizeof(fScaler));
127 }
Here is the call graph for this function:

◆ EndRun()

void Scaler::EndRun ( TARunInfo runinfo)
inline

Definition at line 129 of file scaler_module.cxx.

130 {
131 printf("EndRun, run %d\n", runinfo->fRunNo);
132 }
Here is the call graph for this function:

Member Data Documentation

◆ fScaler

double Scaler::fScaler[32]

Definition at line 107 of file scaler_module.cxx.


The documentation for this struct was generated from the following file: