JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwEPICSEvent Class Reference

EPICS slow controls data management. More...

#include <QwEPICSEvent.h>

+ Collaboration diagram for QwEPICSEvent:

Data Structures

struct  EPICSCumulativeRecord
 
struct  EPICSVariableRecord
 

Public Types

enum  EQwEPICSDataType { kEPICSString , kEPICSFloat , kEPICSInt }
 EPICS data types. More...
 

Public Member Functions

 QwEPICSEvent ()
 Default constructor.
 
virtual ~QwEPICSEvent ()
 Virtual destructor.
 
void ProcessOptions (QwOptions &options)
 Process the configuration options.
 
Int_t AddEPICSTag (const string &tag, const string &table="", EQwEPICSDataType datatype=kEPICSFloat)
 
Int_t LoadChannelMap (TString mapfile)
 
std::vector< Double_t > ReportAutogains (std::vector< std::string > tag_list=fDefaultAutogainList)
 
void ExtractEPICSValues (const string &data, int event)
 
Int_t FindIndex (const string &tag) const
 Find the index of an EPICS variable, or return error.
 
Double_t GetDataValue (const string &tag) const
 
TString GetDataString (const string &tag) const
 
int SetDataValue (const string &tag, const double value, const int event)
 
int SetDataValue (const string &tag, const string &value, const int event)
 
int SetDataValue (int index, const double value, const int event)
 
int SetDataValue (int index, const string &value, const int event)
 
Bool_t HasDataLoaded () const
 
Int_t DetermineIHWPPolarity () const
 
EQwWienMode DetermineWienMode () const
 
void CalculateRunningValues ()
 
void PrintAverages () const
 
void PrintVariableList () const
 
void ReportEPICSData () const
 
void ResetCounters ()
 
void FillDB (QwParityDB *db)
 
void FillSlowControlsData (QwParityDB *db)
 
void FillSlowControlsStrings (QwParityDB *db)
 
void FillSlowControlsSettings (QwParityDB *db)
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values)
 Construct the branch and tree vector.
 
void FillTreeVector (QwRootTreeBranchVector &values) const
 Fill the tree vector.
 
void WriteEPICSStringValues ()
 

Static Public Member Functions

static void DefineOptions (QwOptions &options)
 Define the configuration options.
 
static std::vector< std::string > GetDefaultAutogainList ()
 
static void SetDefaultAutogainList (std::vector< std::string > &input_list)
 

Private Member Functions

void SetDataLoaded (Bool_t flag)
 
Bool_t IsNumber (const string &word)
 
TList * GetEPICSStringValues ()
 

Static Private Member Functions

static void InitDefaultAutogainList ()
 Initialize the default autogain list.
 

Private Attributes

size_t fTreeArrayIndex
 
size_t fTreeArrayNumEntries
 
Bool_t fIsDataLoaded
 
bool fDisableDatabase
 
std::vector< EPICSVariableRecordfEPICSDataEvent
 
std::vector< EPICSCumulativeRecordfEPICSCumulativeData
 
Int_t fNumberEPICSEvents
 
Int_t fNumberEPICSVariables
 
std::vector< std::string > fEPICSVariableList
 
std::vector< std::string > fEPICSTableList
 
std::vector< EQwEPICSDataTypefEPICSVariableType
 
std::map< std::string, Int_t > fEPICSVariableMap
 
Bool_t fBlinderReversalForRunTwo
 
Bool_t fPrecessionReversal
 
Double_t fNominalWienAngle
 
Int_t fExtraHelicityReversal
 

Static Private Attributes

static std::vector< std::string > fDefaultAutogainList
 Default autogain list.
 
static const int kDebug = 0
 
static const int kEPICS_Error = -1
 
static const int kEPICS_OK = 1
 
static const Double_t kInvalidEPICSData = -999999.0
 

Detailed Description

EPICS slow controls data management.

Handles EPICS slow controls data including beam parameters, magnet settings, and other experimental conditions. Provides storage, retrieval, and database interface for slow controls information.

Definition at line 41 of file QwEPICSEvent.h.

Member Enumeration Documentation

◆ EQwEPICSDataType

EPICS data types.

Enumerator
kEPICSString 
kEPICSFloat 
kEPICSInt 

Definition at line 46 of file QwEPICSEvent.h.

Constructor & Destructor Documentation

◆ QwEPICSEvent()

QwEPICSEvent::QwEPICSEvent ( )

Default constructor.

Definition at line 57 of file QwEPICSEvent.cc.

59 fPrecessionReversal(kFALSE),
61{
62 SetDataLoaded(kFALSE);
64 if (kDebug == 1) PrintVariableList();
65}
Double_t fNominalWienAngle
static const int kDebug
void SetDataLoaded(Bool_t flag)
static void InitDefaultAutogainList()
Initialize the default autogain list.
Int_t fNumberEPICSVariables
Bool_t fPrecessionReversal
void PrintVariableList() const
Bool_t fBlinderReversalForRunTwo

References fBlinderReversalForRunTwo, fNominalWienAngle, fNumberEPICSVariables, fPrecessionReversal, InitDefaultAutogainList(), kDebug, PrintVariableList(), and SetDataLoaded().

+ Here is the call graph for this function:

◆ ~QwEPICSEvent()

QwEPICSEvent::~QwEPICSEvent ( )
virtual

Virtual destructor.

Definition at line 68 of file QwEPICSEvent.cc.

69{
70}

Member Function Documentation

◆ AddEPICSTag()

Int_t QwEPICSEvent::AddEPICSTag ( const string & tag,
const string & table = "",
EQwEPICSDataType datatype = kEPICSFloat )

Definition at line 296 of file QwEPICSEvent.cc.

300{
301 fEPICSVariableList.push_back(tag);
302 fEPICSVariableMap[tag] = fEPICSVariableList.size() - 1;
303 fEPICSTableList.push_back(table);
304 fEPICSVariableType.push_back(datatype);
306 return 0;
307}
std::vector< std::string > fEPICSVariableList
std::vector< EQwEPICSDataType > fEPICSVariableType
std::map< std::string, Int_t > fEPICSVariableMap
std::vector< std::string > fEPICSTableList

References fEPICSTableList, fEPICSVariableList, fEPICSVariableMap, fEPICSVariableType, and fNumberEPICSVariables.

Referenced by LoadChannelMap().

+ Here is the caller graph for this function:

◆ CalculateRunningValues()

void QwEPICSEvent::CalculateRunningValues ( )

Definition at line 310 of file QwEPICSEvent.cc.

311{
312 if (kDebug == 1) std::cout <<"Here we are in 'CalculateRunningValues'!!"<<std::endl;
313 if (kDebug == 1) std::cout<<"fNumberEPICSVariables = "<<fNumberEPICSVariables<<std::endl<<std::endl;
314
315 Bool_t anyFilled = kFALSE;
316 for (size_t tagindex = 0; tagindex < fEPICSDataEvent.size(); tagindex++) {
317 anyFilled |= fEPICSDataEvent[tagindex].Filled;
318 }
319 if (! anyFilled) return;
320
321 for (size_t tagindex = 0; tagindex < fEPICSVariableType.size(); tagindex++) {
322 if (fEPICSVariableType[tagindex] == kEPICSFloat ||
323 fEPICSVariableType[tagindex] == kEPICSInt) {
324
325 if (fEPICSDataEvent[tagindex].Filled) {
326
327 if (! fEPICSCumulativeData[tagindex].Filled) {
328 fEPICSCumulativeData[tagindex].NumberRecords = 0;
329 fEPICSCumulativeData[tagindex].Sum = 0.0;
330 fEPICSCumulativeData[tagindex].SquaredSum = 0.0;
331 fEPICSCumulativeData[tagindex].Maximum =
332 fEPICSDataEvent[tagindex].Value;
333 fEPICSCumulativeData[tagindex].Minimum =
334 fEPICSDataEvent[tagindex].Value;
335 fEPICSCumulativeData[tagindex].Filled = kTRUE;
336 }
337 fEPICSCumulativeData[tagindex].NumberRecords++;
338 fEPICSCumulativeData[tagindex].Sum +=
339 fEPICSDataEvent[tagindex].Value;
340 fEPICSCumulativeData[tagindex].SquaredSum +=
341 (fEPICSDataEvent[tagindex].Value)*(fEPICSDataEvent[tagindex].Value);
342 if (fEPICSDataEvent[tagindex].Value
343 > fEPICSCumulativeData[tagindex].Maximum) {
344 fEPICSCumulativeData[tagindex].Maximum =
345 fEPICSDataEvent[tagindex].Value;
346 }
347 if (fEPICSDataEvent[tagindex].Value
348 < fEPICSCumulativeData[tagindex].Minimum) {
349 fEPICSCumulativeData[tagindex].Minimum =
350 fEPICSDataEvent[tagindex].Value;
351 }
352 if (kDebug == 1) std::cout << "This event has "<<fEPICSVariableList[tagindex]
353 << " equal to "<< fEPICSDataEvent[tagindex].Value
354 << " giving a running average of "
355 << fEPICSCumulativeData[tagindex].Sum /
356 fEPICSCumulativeData[tagindex].NumberRecords
357 << std::endl;
358 } else {
359 if (kDebug == 1) std::cout << fEPICSVariableList[tagindex]
360 << " seems to be not filled."<<std::endl;
361 }
362 }
363
364 ////////////////////////////////
365 else {
366 // This is a string value.
367 // Just check to see if the EPICS string has changed;
368 // if it is the same, increment the counter.
369
370 if (! fEPICSCumulativeData[tagindex].Filled) {
371 fEPICSCumulativeData[tagindex].NumberRecords = 0;
372 fEPICSCumulativeData[tagindex].SavedString =
373 fEPICSDataEvent[tagindex].StringValue;
374 fEPICSCumulativeData[tagindex].Filled = kTRUE;
375 }
376 if (fEPICSCumulativeData[tagindex].SavedString
377 == fEPICSDataEvent[tagindex].StringValue ) {
378 fEPICSCumulativeData[tagindex].NumberRecords++;
379 }
380 }
381 }
383 //////////////////////
384
385 if (kDebug == 1) std::cout << "fNumberEPICSEvents = " << fNumberEPICSEvents << std::endl;
386}
std::vector< EPICSVariableRecord > fEPICSDataEvent
std::vector< EPICSCumulativeRecord > fEPICSCumulativeData
Int_t fNumberEPICSEvents

References fEPICSCumulativeData, fEPICSDataEvent, fEPICSVariableList, fEPICSVariableType, fNumberEPICSEvents, fNumberEPICSVariables, kDebug, kEPICSFloat, and kEPICSInt.

Referenced by main().

+ Here is the caller graph for this function:

◆ ConstructBranchAndVector()

void QwEPICSEvent::ConstructBranchAndVector ( TTree * tree,
TString & prefix,
QwRootTreeBranchVector & values )

Construct the branch and tree vector.

Definition at line 176 of file QwEPICSEvent.cc.

177{
178 fTreeArrayIndex = values.size();
179 Int_t treeindex = fTreeArrayIndex;
180 for (size_t tagindex = 0; tagindex < fEPICSVariableType.size(); tagindex++) {
181 if (fEPICSVariableType[tagindex] == kEPICSString ||
182 fEPICSVariableType[tagindex] == kEPICSFloat ||
183 fEPICSVariableType[tagindex] == kEPICSInt) {
184
185 // Determine branch name
186 TString name = fEPICSVariableList[tagindex];
187 name.ReplaceAll(':','_'); // remove colons before creating branch
188
189 // Add element to vector
190 values.push_back(name.Data(), 'D');
191
192 // Create branch
193 tree->Branch(name, &(values[treeindex]), values.LeafList(treeindex).c_str());
194 treeindex++;
195
196 } else {
197
198 TString name = fEPICSVariableList[tagindex];
199 QwError << "Unrecognized type for EPICS variable " << name << QwLog::endl;
200
201 }
202 }
204}
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
size_t fTreeArrayIndex
size_t fTreeArrayNumEntries
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
size_type size() const noexcept
Definition QwRootFile.h:81
std::string LeafList(size_type start_index=0) const
Definition QwRootFile.h:228
void push_back(const std::string &name, const char type='D')
Definition QwRootFile.h:195

References QwLog::endl(), fEPICSVariableList, fEPICSVariableType, fTreeArrayIndex, fTreeArrayNumEntries, kEPICSFloat, kEPICSInt, kEPICSString, QwRootTreeBranchVector::LeafList(), QwRootTreeBranchVector::push_back(), QwError, and QwRootTreeBranchVector::size().

+ Here is the call graph for this function:

◆ DefineOptions()

void QwEPICSEvent::DefineOptions ( QwOptions & options)
static

Define the configuration options.

Defines configuration options using QwOptions functionality.

Parameters
optionsOptions object

Definition at line 81 of file QwEPICSEvent.cc.

82{
83#ifdef __USE_DATABASE__
84 // Option to disable EPICS database accesses
85 options.AddOptions("Default options")
86 ("disable-db-epics",
87 po::value<bool>()->default_bool_value(false),
88 "disable EPICS database access");
89#endif
90}
po::options_description_easy_init AddOptions(const std::string &blockname="Specialized options")
Add an option to a named block or create new block.
Definition QwOptions.h:170

References QwOptions::AddOptions().

Referenced by QwOptions::DefineOptions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DetermineIHWPPolarity()

Int_t QwEPICSEvent::DetermineIHWPPolarity ( ) const

Definition at line 1381 of file QwEPICSEvent.cc.

1381 {
1382 Int_t ihwppolarity = 0;
1383 if (GetDataString("IGL1I00OD16_16")=="OUT"
1384 || GetDataString("IGL1I00OD16_16")=="0"){
1385 ihwppolarity = 1;
1386 } else if (GetDataString("IGL1I00OD16_16")=="IN"
1387 || GetDataString("IGL1I00OD16_16")=="1"){
1388 ihwppolarity = -1;
1389 } else {
1390 QwWarning << "IHWP state is not well defined: '"
1391 << GetDataString("IGL1I00OD16_16") << "'"
1392 << QwLog::endl;
1393 if (GetDataString("IGL1I00DI24_24M")=="OUT"
1394 || GetDataString("IGL1I00DI24_24M")=="1"){
1395 ihwppolarity = 1;
1396 } else if (GetDataString("IGL1I00DI24_24M")=="IN"
1397 || GetDataString("IGL1I00DI24_24M")=="0"){
1398 ihwppolarity = -1;
1399 } else {
1400 QwWarning << "IHWP state is not well defined: '"
1401 << GetDataString("IGL1I00DI24_24M") << "'"
1402 << QwLog::endl;
1403 }
1404 }
1405 QwDebug << "QwEPICSEvent::DetermineIHWPPolarity: "
1406 << "raw IHWP polarity is: "
1407 << ihwppolarity << QwLog::endl;
1408 ihwppolarity = fExtraHelicityReversal * ihwppolarity;
1409 QwDebug << "QwEPICSEvent::DetermineIHWPPolarity: "
1410 << "IHWP polarity after extra reversal is: "
1411 << ihwppolarity << QwLog::endl;
1412 return ihwppolarity;
1413}
#define QwWarning
Predefined log drain for warnings.
Definition QwLog.h:44
#define QwDebug
Predefined log drain for debugging output.
Definition QwLog.h:59
Int_t fExtraHelicityReversal
TString GetDataString(const string &tag) const

References QwLog::endl(), fExtraHelicityReversal, GetDataString(), QwDebug, and QwWarning.

Referenced by QwBlinder::Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DetermineWienMode()

EQwWienMode QwEPICSEvent::DetermineWienMode ( ) const

Definition at line 1415 of file QwEPICSEvent.cc.

1415 {
1417
1418 Double_t launchangle = 0.0;
1419
1420 Double_t vwienangle = GetDataValue("VWienAngle");
1421 Double_t phiangle = GetDataValue("Phi_FG");
1422 Double_t hwienangle = GetDataValue("HWienAngle");
1423 Double_t hoffset = 0.0;
1424 if (fabs(vwienangle)<10.0 && fabs(phiangle)<10.0){
1425 hoffset = 0.0;
1426 } else if (fabs(vwienangle)>80.0 && fabs(phiangle)>80.0
1427 && fabs(vwienangle+phiangle)<10. ){
1428 hoffset = -90.0;
1429 } else if (fabs(vwienangle)>80.0 && fabs(phiangle)>80.0
1430 && fabs(vwienangle+phiangle)>170. ){
1431 hoffset = +90.0;
1432 } else if (fabs(vwienangle)>80.0 && fabs(phiangle)<10.0) {
1433 wienmode = kWienVertTrans;
1434 }
1435 if (wienmode == kWienIndeterminate){
1436 launchangle = hoffset+hwienangle;
1437 Double_t long_proj =
1438 cos((launchangle-fNominalWienAngle)*TMath::DegToRad());
1439 if (long_proj > 0.5){
1440 wienmode = kWienForward;
1441 } else if (long_proj < -0.5){
1442 wienmode = kWienBackward;
1443 } else if (fabs(long_proj)<0.25){
1444 wienmode = kWienHorizTrans;
1445 }
1446 }
1447 return wienmode;
1448}
EQwWienMode
Double Wien configuration.
Definition QwTypes.h:308
@ kWienIndeterminate
Definition QwTypes.h:309
@ kWienBackward
Definition QwTypes.h:311
@ kWienVertTrans
Definition QwTypes.h:312
@ kWienForward
Definition QwTypes.h:310
@ kWienHorizTrans
Definition QwTypes.h:313
Double_t GetDataValue(const string &tag) const

References fNominalWienAngle, GetDataValue(), kWienBackward, kWienForward, kWienHorizTrans, kWienIndeterminate, and kWienVertTrans.

Referenced by ExtractEPICSValues(), and QwBlinder::Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExtractEPICSValues()

void QwEPICSEvent::ExtractEPICSValues ( const string & data,
int event )

Definition at line 389 of file QwEPICSEvent.cc.

390{
391 /* This routine will decode the input string, which holds the *
392 * epics buffer and extract the EPICS values from it. */
393
394 if (kDebug == 1) std::cout <<"Here we are, entering 'ExtractEPICSValues'!!"<<std::endl;
395
396 for (size_t tagindex = 0; tagindex < fEPICSVariableList.size(); tagindex++) {
397 fEPICSDataEvent[tagindex].Filled = kFALSE;
398 }
399
400 // Convert the input stream into a stringstream so we can
401 // do manipulation on it just like reading a file
402 std::stringstream ss(data, std::stringstream::in | std::stringstream::out);
403 QwParameterFile file(ss);
404 while (file.ReadNextLine()) {
405 file.TrimWhitespace();
406 string varname, varvalue;
407 if (file.HasVariablePair(" \t\n", varname, varvalue)) {
408 Int_t tagindex = FindIndex(varname);
409 if (tagindex != kEPICS_Error) {
410 SetDataValue(tagindex, varvalue, event);
411 SetDataLoaded(kTRUE);
412 }
413 }
414 }
415 if (fIsDataLoaded) {
416 // Determine the WienMode and save it.
417 SetDataValue("WienMode",WienModeName(DetermineWienMode()),event);
418 }
419}
std::string WienModeName(EQwWienMode type)
Definition QwTypes.cc:150
Bool_t fIsDataLoaded
int SetDataValue(const string &tag, const double value, const int event)
EQwWienMode DetermineWienMode() const
Int_t FindIndex(const string &tag) const
Find the index of an EPICS variable, or return error.
static const int kEPICS_Error

References DetermineWienMode(), fEPICSDataEvent, fEPICSVariableList, FindIndex(), fIsDataLoaded, QwParameterFile::HasVariablePair(), kDebug, kEPICS_Error, QwParameterFile::ReadNextLine(), SetDataLoaded(), SetDataValue(), QwParameterFile::TrimWhitespace(), and WienModeName().

Referenced by QwEventBuffer::FillEPICSData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FillDB()

void QwEPICSEvent::FillDB ( QwParityDB * db)

Referenced by main().

+ Here is the caller graph for this function:

◆ FillSlowControlsData()

void QwEPICSEvent::FillSlowControlsData ( QwParityDB * db)

◆ FillSlowControlsSettings()

void QwEPICSEvent::FillSlowControlsSettings ( QwParityDB * db)

◆ FillSlowControlsStrings()

void QwEPICSEvent::FillSlowControlsStrings ( QwParityDB * db)

◆ FillTreeVector()

void QwEPICSEvent::FillTreeVector ( QwRootTreeBranchVector & values) const

Fill the tree vector.

Definition at line 207 of file QwEPICSEvent.cc.

208{
209 Int_t treeindex = fTreeArrayIndex;
210 for (size_t tagindex = 0; tagindex < fEPICSVariableType.size(); tagindex++) {
211 switch (fEPICSVariableType[tagindex]) {
212 case kEPICSFloat:
213 case kEPICSInt: {
214 // Add value to vector
215 values.SetValue(treeindex, fEPICSDataEvent[tagindex].Value);
216 treeindex++;
217 break;
218 }
219 case kEPICSString: {
220 // Add value to vector
221 values.SetValue(treeindex, static_cast<Double_t>(fEPICSDataEvent[tagindex].StringValue.Hash()));
222 treeindex++;
223 break;
224 }
225 default: {
226 TString name = fEPICSVariableList[tagindex];
227 QwError << "Unrecognized type for EPICS variable " << name << QwLog::endl;
228 break;
229 }
230 }
231 }
232}
void SetValue(size_type index, Double_t val)
Definition QwRootFile.h:108

References QwLog::endl(), fEPICSDataEvent, fEPICSVariableList, fEPICSVariableType, fTreeArrayIndex, kEPICSFloat, kEPICSInt, kEPICSString, QwError, and QwRootTreeBranchVector::SetValue().

+ Here is the call graph for this function:

◆ FindIndex()

Int_t QwEPICSEvent::FindIndex ( const string & tag) const

Find the index of an EPICS variable, or return error.

Definition at line 422 of file QwEPICSEvent.cc.

423{
424 // Find a match for the tag
425 std::map<std::string,Int_t>::const_iterator match = fEPICSVariableMap.find(tag);
426
427 if (match != fEPICSVariableMap.end())
428 // A match was found
429 return match->second;
430
431 else
432 // Otherwise return error
433 return kEPICS_Error;
434}

References fEPICSVariableMap, and kEPICS_Error.

Referenced by ExtractEPICSValues(), GetDataString(), GetDataValue(), SetDataValue(), and SetDataValue().

+ Here is the caller graph for this function:

◆ GetDataString()

TString QwEPICSEvent::GetDataString ( const string & tag) const

Definition at line 449 of file QwEPICSEvent.cc.

450{
451 Int_t tagindex = FindIndex(tag);
452 if (tagindex != kEPICS_Error) {
453 if (fEPICSVariableType[tagindex]==kEPICSString
454 && fEPICSDataEvent[tagindex].Filled) {
455 return(fEPICSDataEvent[tagindex].StringValue);
456 }
457 }
458 return TString("");
459}

References fEPICSDataEvent, fEPICSVariableType, FindIndex(), kEPICS_Error, and kEPICSString.

Referenced by DetermineIHWPPolarity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDataValue()

Double_t QwEPICSEvent::GetDataValue ( const string & tag) const

Definition at line 437 of file QwEPICSEvent.cc.

438{
439 Double_t data_value = kInvalidEPICSData;
440 Int_t tagindex = FindIndex(tag);
441 if (tagindex != kEPICS_Error) {
442 if (fEPICSDataEvent[tagindex].Filled) {
443 data_value = fEPICSDataEvent[tagindex].Value;
444 }
445 }
446 return data_value;
447}
static const Double_t kInvalidEPICSData

References fEPICSDataEvent, FindIndex(), kEPICS_Error, and kInvalidEPICSData.

Referenced by DetermineWienMode(), ReportAutogains(), and QwBlinder::Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDefaultAutogainList()

static std::vector< std::string > QwEPICSEvent::GetDefaultAutogainList ( )
inlinestatic

Definition at line 130 of file QwEPICSEvent.h.

130{ return fDefaultAutogainList; };
static std::vector< std::string > fDefaultAutogainList
Default autogain list.

References fDefaultAutogainList.

◆ GetEPICSStringValues()

TList * QwEPICSEvent::GetEPICSStringValues ( )
private

Definition at line 1280 of file QwEPICSEvent.cc.

1281{
1282 Bool_t local_debug = false;
1283
1284 TList *string_list = new TList;
1285 string_list->SetOwner(true);
1286
1287 std::size_t tagindex = 0;
1288
1289 for (tagindex=0; tagindex<fEPICSVariableList.size(); tagindex++)
1290 {
1291 if (fEPICSVariableType[tagindex] == kEPICSString) {
1292
1293 TString epics_string = fEPICSVariableList[tagindex];
1294 epics_string += "---";
1295
1296 if (fEPICSDataEvent[tagindex].Filled) {
1297 epics_string += fEPICSDataEvent[tagindex].StringValue;
1298 }
1299 else {
1300 epics_string += "empty";
1301 }
1302 if(local_debug) {
1303 std::cout << "QwEPICSEvent::GetEPICSStringValues() "
1304 << epics_string
1305 << std::endl;
1306 }
1307 string_list -> Add(new TObjString(epics_string));
1308 }
1309 }
1310
1311 return string_list;
1312}

References fEPICSDataEvent, fEPICSVariableList, fEPICSVariableType, and kEPICSString.

◆ HasDataLoaded()

Bool_t QwEPICSEvent::HasDataLoaded ( ) const
inline

Definition at line 83 of file QwEPICSEvent.h.

83{ return fIsDataLoaded; };

References fIsDataLoaded.

Referenced by main().

+ Here is the caller graph for this function:

◆ InitDefaultAutogainList()

void QwEPICSEvent::InitDefaultAutogainList ( )
staticprivate

Initialize the default autogain list.

Definition at line 461 of file QwEPICSEvent.cc.

462{
463 // Clear the vector first
464 fDefaultAutogainList.clear();
465
466 // Add default autogain channels
467 fDefaultAutogainList.push_back("IPM3C17.XIFG");
468 fDefaultAutogainList.push_back("IPM3C17.YIFG");
469 fDefaultAutogainList.push_back("IBC3C17.XIFG");
470 fDefaultAutogainList.push_back("IBC3C17.YIFG");
471 fDefaultAutogainList.push_back("IPM3C18.XIFG");
472 fDefaultAutogainList.push_back("IPM3C18.YIFG");
473 fDefaultAutogainList.push_back("IPM3C19.XIFG");
474 fDefaultAutogainList.push_back("IPM3C19.YIFG");
475 fDefaultAutogainList.push_back("IPM3C03.YIFG");
476 fDefaultAutogainList.push_back("IPM3P01.XIFG");
477 fDefaultAutogainList.push_back("IPM3P01.YIFG");
478 fDefaultAutogainList.push_back("IPM3P02A.XIFG");
479 fDefaultAutogainList.push_back("IPM3P02A.YIFG");
480 fDefaultAutogainList.push_back("IPM3P03A.XIFG");
481 fDefaultAutogainList.push_back("IPM3P03A.YIFG");
482 fDefaultAutogainList.push_back("IPM3P02B.XIFG");
483 fDefaultAutogainList.push_back("IPM3P02B.YIFG");
484 fDefaultAutogainList.push_back("IPM3C20.XIFG");
485 fDefaultAutogainList.push_back("IPM3C20.YIFG");
486 fDefaultAutogainList.push_back("IPM3C21.XIFG");
487 fDefaultAutogainList.push_back("IPM3C21.YIFG");
488 fDefaultAutogainList.push_back("IPM3H02.XIFG");
489 fDefaultAutogainList.push_back("IPM3H02.YIFG");
490 fDefaultAutogainList.push_back("IPM3H04.XIFG");
491 fDefaultAutogainList.push_back("IPM3H04.YIFG");
492 fDefaultAutogainList.push_back("IPM3H07A.XIFG");
493 fDefaultAutogainList.push_back("IPM3H07A.YIFG");
494 fDefaultAutogainList.push_back("IPM3H07B.XIFG");
495 fDefaultAutogainList.push_back("IPM3H07B.YIFG");
496 fDefaultAutogainList.push_back("IPM3H07C.XIFG");
497 fDefaultAutogainList.push_back("IPM3H07C.YIFG");
498 fDefaultAutogainList.push_back("IPM3H09.XIFG");
499 fDefaultAutogainList.push_back("IPM3H09.YIFG");
500 fDefaultAutogainList.push_back("IPM3H09B.XIFG");
501 fDefaultAutogainList.push_back("IPM3H09B.YIFG");
502}

References fDefaultAutogainList.

Referenced by QwEPICSEvent().

+ Here is the caller graph for this function:

◆ IsNumber()

Bool_t QwEPICSEvent::IsNumber ( const string & word)
inlineprivate

Definition at line 155 of file QwEPICSEvent.h.

155 {
156 size_t pos;
157 pos = word.find_first_not_of("0123456789.+-eE"); // white space not allowed
158 if (pos != std::string::npos) return kFALSE;
159 else return kTRUE;
160 }

Referenced by SetDataValue().

+ Here is the caller graph for this function:

◆ LoadChannelMap()

Int_t QwEPICSEvent::LoadChannelMap ( TString mapfile)

Definition at line 105 of file QwEPICSEvent.cc.

106{
107 Int_t lineread = 0;
108
110 fEPICSVariableList.clear();
111 fEPICSVariableType.clear();
112
115 fPrecessionReversal = kFALSE;
116
117 // Open the file
118 QwParameterFile mapstr(mapfile.Data());
119 std::string varname, varvalue;
120 while (mapstr.ReadNextLine()) {
121 lineread++;
122
123 mapstr.TrimComment(); // Remove everything after a '!' character.
124 mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
125 if (mapstr.LineIsEmpty()) continue;
126
127 if (mapstr.HasVariablePair("=",varname,varvalue)){
128 QwDebug << "QwEPICSEvent::LoadChannelMap: keyword,value pair:"
129 << varname << "," << varvalue << QwLog::endl;
130 if (varname == "NominalWienAngle"){
131 fNominalWienAngle = atof(varvalue.c_str());
132 } else if (varname == "BlinderReversalForRunTwo"){
136 }
137 } else if (varname == "PrecessionReversal"){
138 if (! fPrecessionReversal){
139 fPrecessionReversal = kTRUE;
141 }
142 } else {
143 QwError << "QwEPICSEvent::LoadChannelMap: "
144 << "Unknown keyword,variable pair: "
145 << varname << "," << varvalue << QwLog::endl;
146 exit(1);
147 }
148 continue;
149 }
150
151 varname = mapstr.GetTypedNextToken<std::string>();
152 std::string dbtable = mapstr.GetTypedNextToken<std::string>();
153 TString datatype = mapstr.GetTypedNextToken<TString>();
154 datatype.ToLower();
155
156 if (datatype == "") {
157 AddEPICSTag(varname,dbtable);
158 } else {
159 EQwEPICSDataType datatypeid = kEPICSString;
160 if (datatype == "string") datatypeid = kEPICSString;
161 if (datatype == "float") datatypeid = kEPICSFloat;
162 if (datatype == "int") datatypeid = kEPICSInt;
163 AddEPICSTag(varname,dbtable,datatypeid);
164 }
165 }
166 if (kDebug == 1) std::cout << "fNumberEPICSVariables = " << fNumberEPICSVariables << std::endl << std::endl;
167 if (kDebug == 1) std::cout << "line read in the parameter file =" << lineread << std::endl;
168
170 mapstr.Close(); // Close the file (ifstream)
171 return 0;
172}
Int_t AddEPICSTag(const string &tag, const string &table="", EQwEPICSDataType datatype=kEPICSFloat)
void ResetCounters()
EQwEPICSDataType
EPICS data types.

References AddEPICSTag(), QwParameterFile::Close(), QwLog::endl(), fBlinderReversalForRunTwo, fEPICSVariableList, fEPICSVariableType, fExtraHelicityReversal, fNominalWienAngle, fNumberEPICSVariables, fPrecessionReversal, QwParameterFile::GetTypedNextToken(), QwParameterFile::HasVariablePair(), kDebug, kEPICSFloat, kEPICSInt, kEPICSString, QwParameterFile::LineIsEmpty(), QwDebug, QwError, QwParameterFile::ReadNextLine(), ResetCounters(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintAverages()

void QwEPICSEvent::PrintAverages ( ) const

Definition at line 571 of file QwEPICSEvent.cc.

572{
573 Double_t mean = 0.0;
574 Double_t average_of_squares = 0.0;
575 Double_t variance = 0.0;
576 Double_t sigma = 0.0;
577
578 std::cout <<"##### EPICS Event Summary from PrintAverages() #####\n"
579 <<"Total number of EPICS events in this run == "
580 <<fNumberEPICSEvents <<".\n\n"
581 << std::setw(20) << std::setiosflags(std::ios::left) <<"Name"
582 <<"\tMean Sigma "
583 <<"Minimum Maximum"<<std::endl;
584 std::cout << "*****Non-string EPICS Variables*****" << std::endl;
585 for (size_t tagindex = 0; tagindex < fEPICSVariableList.size(); tagindex++) {
586 if (fEPICSVariableType[tagindex] == kEPICSFloat ||
587 fEPICSVariableType[tagindex] == kEPICSInt) {
588
589 mean = 0.0;
590 variance = 0.0;
591 sigma = 0.0;
592 if (fEPICSCumulativeData[tagindex].NumberRecords > 0){
593 mean = (fEPICSCumulativeData[tagindex].Sum)/
594 ((Double_t) fEPICSCumulativeData[tagindex].NumberRecords);
595 average_of_squares = (fEPICSCumulativeData[tagindex].SquaredSum)/
596 ((Double_t) fEPICSCumulativeData[tagindex].NumberRecords);
597 variance = average_of_squares - (mean * mean);
598 if (variance < 0.0){
599 sigma = sqrt(-1.0 * variance);
600 } else {
601 sigma = sqrt(variance);
602 }
603
604 std::cout << std::setw(20) << std::setiosflags(std::ios::left)
605 <<fEPICSVariableList[tagindex]<<"\t"
606 << std::setprecision(5) << std::setw(10)
607 <<mean<<" " << std::setw(10)<<sigma<<" " << std::setw(10)
608 <<fEPICSCumulativeData[tagindex].Minimum<<" " << std::setw(10)
609 <<fEPICSCumulativeData[tagindex].Maximum<<std::endl;
610 } else {
611 std::cout << std::setw(20) << std::setiosflags(std::ios::left)
612 <<fEPICSVariableList[tagindex]<<"\t"
613 << std::setprecision(5) << std::setw(10)
614 << "...No data..."
615 << std::endl;
616 }
617 }
618 }
619
620 std::cout << "*****String EPICS Variables are below, if any*****" << std::endl;
621 for (size_t tagindex = 0; tagindex < fEPICSVariableList.size(); tagindex++) {
622 if (fEPICSVariableType[tagindex] == kEPICSString) {
623 if (fEPICSDataEvent[tagindex].Filled) {
624 std::cout << std::setw(20) << std::setiosflags(std::ios::left)
625 <<"tagindex for variable "<< fEPICSVariableList[tagindex]<<"\t is "
626 <<tagindex<<"\tand status is\t\t"
627 <<fEPICSDataEvent[tagindex].StringValue;
628
629 if (fEPICSCumulativeData[tagindex].NumberRecords!= fNumberEPICSEvents){
630 std::cout << "\t*****\tThis variable changed during the run. Only "
631 << (Double_t(fEPICSCumulativeData[tagindex].NumberRecords)
632 *100.0 / Double_t(fNumberEPICSEvents))
633 << "% of the events has this value.";
634 }
635 std::cout <<std::endl;
636 } else {
637 std::cout << std::setw(20) << std::setiosflags(std::ios::left)
638 <<fEPICSVariableList[tagindex]<<"\t"
639 <<"No data..."<<std::endl;
640 }
641 }
642 }
643}

References fEPICSCumulativeData, fEPICSDataEvent, fEPICSVariableList, fEPICSVariableType, fNumberEPICSEvents, kEPICSFloat, kEPICSInt, and kEPICSString.

◆ PrintVariableList()

void QwEPICSEvent::PrintVariableList ( ) const

Definition at line 646 of file QwEPICSEvent.cc.

647{
648 // Prints all valid Epics variables on the terminal while creating a rootfile.
649 for (size_t tagindex = 0; tagindex < fEPICSVariableList.size(); tagindex++) {
650 QwMessage << "fEPICSVariableList[" << tagindex << "] == "
651 << fEPICSVariableList[tagindex] << QwLog::endl;
652 }
653}
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49

References QwLog::endl(), fEPICSVariableList, and QwMessage.

Referenced by QwEPICSEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessOptions()

void QwEPICSEvent::ProcessOptions ( QwOptions & options)

Process the configuration options.

Parse the configuration options and store in class fields

Parameters
optionsOptions object

Definition at line 97 of file QwEPICSEvent.cc.

98{
99#ifdef __USE_DATABASE__
100 // Option to disable EPICS database accesses
101 fDisableDatabase = options.GetValue<bool>("disable-db-epics");
102#endif
103}
bool fDisableDatabase
T GetValue(const std::string &key)
Get a templated value.
Definition QwOptions.h:236

References fDisableDatabase, and QwOptions::GetValue().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReportAutogains()

std::vector< Double_t > QwEPICSEvent::ReportAutogains ( std::vector< std::string > tag_list = fDefaultAutogainList)

Definition at line 656 of file QwEPICSEvent.cc.

657{
658 std::vector<Double_t> autogain_values;
659 std::vector<std::string>::iterator ptr_tag;
660
661 autogain_values.clear(); //clear the vector first
662
663 /* Iterate through the input vector of the variable names *
664 * and fill the output vector with the values. */
665 ptr_tag = tag_list.begin();
666 while (ptr_tag < tag_list.end()) {
667 autogain_values.push_back(GetDataValue(*ptr_tag));
668 ptr_tag++;
669 }
670
671 return autogain_values;
672}

References GetDataValue().

+ Here is the call graph for this function:

◆ ReportEPICSData()

void QwEPICSEvent::ReportEPICSData ( ) const

Definition at line 676 of file QwEPICSEvent.cc.

677{
678 Double_t mean = 0.0;
679 Double_t average_of_squares = 0.0;
680 Double_t variance = 0.0;
681 Double_t sigma = 0.0;
682
683
684 std::ofstream output;
685 TString theEPICSDataFile;
686 theEPICSDataFile = getenv("QW_TMP");
687 theEPICSDataFile += "/QwEPICSData.txt";// puts QwEPICSData.txt in QwAnalysis_DB_01.00.0000/scratch/tmp/ directory.
688 output.open(theEPICSDataFile,std::ofstream::out);
689
690 if (output.is_open()) {
691
692
693 output <<"##### EPICS Event Summary #####\n"
694 <<"Total number of EPICS events in this run == "
695 <<fNumberEPICSEvents <<".\n\n"
696 << std::setw(20) << std::setiosflags(std::ios::left) <<"Name"
697 <<"\tMean Sigma "
698 <<"Minimum Maximum"<<std::endl;
699 for (size_t tagindex = 0; tagindex < fEPICSVariableList.size(); tagindex++) {
700 if (fEPICSVariableType[tagindex] == kEPICSFloat ||
701 fEPICSVariableType[tagindex] == kEPICSInt) {
702 mean = 0.0;
703 variance = 0.0;
704 sigma = 0.0;
705 if (fEPICSCumulativeData[tagindex].NumberRecords > 0){
706 mean = (fEPICSCumulativeData[tagindex].Sum)/
707 ((Double_t) fEPICSCumulativeData[tagindex].NumberRecords);
708 average_of_squares = (fEPICSCumulativeData[tagindex].SquaredSum)/
709 ((Double_t) fEPICSCumulativeData[tagindex].NumberRecords);
710 variance = average_of_squares - (mean * mean);
711 if (variance < 0.0){
712 sigma = sqrt(-1.0 * variance);
713 } else {
714 sigma = sqrt(variance);
715 }
716
717 output << std::setw(20) << std::setiosflags(std::ios::left)
718 <<fEPICSVariableList[tagindex]<<"\t"
719 << std::setprecision(5) << std::setw(10)
720 <<mean<<" " << std::setw(10)<<sigma<<" " << std::setw(10)
721 <<fEPICSCumulativeData[tagindex].Minimum<<" " << std::setw(10)
722 <<fEPICSCumulativeData[tagindex].Maximum<<std::endl;
723 } else {
724 output << std::setw(20) << std::setiosflags(std::ios::left)
725 <<fEPICSVariableList[tagindex]<<"\t"
726 << std::setprecision(5) << std::setw(10)
727 << "-No data-"
728 << std::endl;
729 }
730 }
731
732 }
733 for (size_t tagindex = 0; tagindex < fEPICSVariableList.size(); tagindex++) {
734 if (fEPICSVariableType[tagindex] == kEPICSString) {
735 if (fEPICSDataEvent[tagindex].Filled) {
736 output << std::setw(20) << std::setiosflags(std::ios::left)
737 <<fEPICSVariableList[tagindex]<<"\t"
738 <<fEPICSDataEvent[tagindex].StringValue<<std::endl;
739 } else {
740 output << std::setw(20) << std::setiosflags(std::ios::left)
741 <<fEPICSVariableList[tagindex]<<"\t"
742 <<"No data..."<<std::endl;
743 }
744 }
745 }
746
747 } output.close();
748}

References fEPICSCumulativeData, fEPICSDataEvent, fEPICSVariableList, fEPICSVariableType, fNumberEPICSEvents, kEPICSFloat, kEPICSInt, and kEPICSString.

◆ ResetCounters()

void QwEPICSEvent::ResetCounters ( )

Definition at line 750 of file QwEPICSEvent.cc.

751{
752 fIsDataLoaded = kFALSE;
753 /* Verify that the variable list and variable type vectors
754 are the same size, and agree with fNumberEPICSVariables. */
755 Int_t listlength = fEPICSVariableList.size();
756 Int_t typelength = fEPICSVariableType.size();
757 if (typelength != fNumberEPICSVariables ||
758 listlength != fNumberEPICSVariables) {
759 std::cerr << "The EPICS variable label and type arrays are not the same size!\n"
760 << "EPICS readback may be corrupted!"<<std::endl;
761 }
762 /* Reset the sizes of the fEPICSDataEvent and
763 fEPICSCumulativeData vectors. */
766 for (size_t tagindex = 0; tagindex < fEPICSVariableList.size(); tagindex++) {
767 fEPICSDataEvent[tagindex].Filled = kFALSE;
768 fEPICSDataEvent[tagindex].EventNumber = 0;
769 fEPICSDataEvent[tagindex].Value = 0.0;
770 fEPICSDataEvent[tagindex].StringValue = "";
771 fEPICSCumulativeData[tagindex].Filled = kFALSE;
772 fEPICSCumulativeData[tagindex].NumberRecords = 0;
773 fEPICSCumulativeData[tagindex].Sum = 0.0;
774 fEPICSCumulativeData[tagindex].SquaredSum = 0.0;
775 fEPICSCumulativeData[tagindex].Minimum = 0.0;
776 fEPICSCumulativeData[tagindex].Maximum = 0.0;
777 }
779}

References fEPICSCumulativeData, fEPICSDataEvent, fEPICSVariableList, fEPICSVariableType, fIsDataLoaded, fNumberEPICSEvents, and fNumberEPICSVariables.

Referenced by LoadChannelMap(), and main().

+ Here is the caller graph for this function:

◆ SetDataLoaded()

void QwEPICSEvent::SetDataLoaded ( Bool_t flag)
inlineprivate

Definition at line 111 of file QwEPICSEvent.h.

111{ fIsDataLoaded = flag; };

References fIsDataLoaded.

Referenced by ExtractEPICSValues(), and QwEPICSEvent().

+ Here is the caller graph for this function:

◆ SetDataValue() [1/4]

int QwEPICSEvent::SetDataValue ( const string & tag,
const double value,
const int event )

Definition at line 511 of file QwEPICSEvent.cc.

512{
513 Int_t tagindex = FindIndex(tag);
514 return (SetDataValue(tagindex, value, event));
515}

References FindIndex(), and SetDataValue().

Referenced by ExtractEPICSValues(), SetDataValue(), SetDataValue(), and SetDataValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDataValue() [2/4]

int QwEPICSEvent::SetDataValue ( const string & tag,
const string & value,
const int event )

Definition at line 517 of file QwEPICSEvent.cc.

518{
519 Int_t tagindex = FindIndex(tag);
520 return (SetDataValue(tagindex, value, event));
521}

References FindIndex(), and SetDataValue().

+ Here is the call graph for this function:

◆ SetDataValue() [3/4]

int QwEPICSEvent::SetDataValue ( int index,
const double value,
const int event )

Definition at line 523 of file QwEPICSEvent.cc.

524{
525 if (index == kEPICS_Error) return kEPICS_Error;
526 if (index < 0) return kEPICS_Error;
527
528 if (value != kInvalidEPICSData) {
529 fEPICSDataEvent[index].EventNumber = event;
530 fEPICSDataEvent[index].Value = value;
531 fEPICSDataEvent[index].StringValue = "";
532 fEPICSDataEvent[index].Filled = kTRUE;
533 return 0;
534 }
535 return kEPICS_Error;
536}

References fEPICSDataEvent, kEPICS_Error, and kInvalidEPICSData.

◆ SetDataValue() [4/4]

int QwEPICSEvent::SetDataValue ( int index,
const string & value,
const int event )

Definition at line 538 of file QwEPICSEvent.cc.

539{
540 if (index == kEPICS_Error) return kEPICS_Error;
541 if (index < 0) return kEPICS_Error;
542
543 Double_t tmpvalue = kInvalidEPICSData;
544 switch (fEPICSVariableType[index]) {
545 case kEPICSString:
546 fEPICSDataEvent[index].EventNumber = event;
547 fEPICSDataEvent[index].Value = 0.0;
548 fEPICSDataEvent[index].StringValue = value;
549 fEPICSDataEvent[index].Filled = kTRUE;
550 return 0;
551 break;
552
553 case kEPICSFloat:
554 if (IsNumber(value)) {
555 tmpvalue = Double_t(atof(value.c_str()));
556 }
557 return SetDataValue(index, tmpvalue, event);
558 break;
559
560 case kEPICSInt:
561 if(IsNumber(value)) {
562 tmpvalue = Double_t(atol(value.c_str()));
563 }
564 return SetDataValue(index, tmpvalue, event);
565 break;
566 }
567
568 return kEPICS_Error;
569}
Bool_t IsNumber(const string &word)

References fEPICSDataEvent, fEPICSVariableType, IsNumber(), kEPICS_Error, kEPICSFloat, kEPICSInt, kEPICSString, kInvalidEPICSData, and SetDataValue().

+ Here is the call graph for this function:

◆ SetDefaultAutogainList()

void QwEPICSEvent::SetDefaultAutogainList ( std::vector< std::string > & input_list)
static

Definition at line 504 of file QwEPICSEvent.cc.

505{
506 fDefaultAutogainList.clear(); //clear the vector first
507 fDefaultAutogainList = input_list;
508}

References fDefaultAutogainList.

◆ WriteEPICSStringValues()

void QwEPICSEvent::WriteEPICSStringValues ( )

Definition at line 1314 of file QwEPICSEvent.cc.

1315{
1316 QwDebug << "Entering QwEPICSEvent::WriteEPICSStringValues()" << QwLog::endl;
1317
1318 Bool_t local_debug = false;
1319
1320 TSeqCollection *file_list = gROOT->GetListOfFiles();
1321
1322 if (file_list) {
1323
1324 Int_t size = file_list->GetSize();
1325 for (Int_t i=0; i<size; i++)
1326 {
1327 TFile *file = (TFile*) file_list->At(i);
1328
1329 if(local_debug) {
1330 std::cout << "QwEPICSEvent::WriteEPICSStringValue()"
1331 << file->GetName()
1332 << std::endl;
1333 }
1334
1335 TTree *slow_tree = (TTree*) file->Get("slow");
1336
1337 for (std::size_t tagindex=0; tagindex<fEPICSVariableList.size(); tagindex++)
1338 {
1339 // only String
1340 if (fEPICSVariableType[tagindex] == kEPICSString) {
1341
1342 TString name = fEPICSVariableList[tagindex];
1343 name.ReplaceAll(':','_'); // remove colons before creating branch
1344 TString name_type = name + "/C";\
1345
1346 Char_t epics_char[128];
1347 TString epics_string;
1348
1349 TBranch *new_branch = slow_tree->Branch(name, epics_char, name_type);
1350
1351 if (fEPICSDataEvent[tagindex].Filled) {
1352 epics_string = fEPICSDataEvent[tagindex].StringValue;
1353 }
1354 else {
1355 epics_string = "empty";
1356 }
1357
1358 if(local_debug) {
1359 std::cout << "QwEPICSEvent::WriteEPICSStringValue()\n";
1360 std::cout << name << " " << epics_string << std::endl;
1361 std::cout <<"\n";
1362 }
1363
1364 sprintf(epics_char, "%s", epics_string.Data());
1365 new_branch->Fill();
1366 }
1367
1368 }
1369
1370 file -> Write("", TObject::kOverwrite);
1371 }
1372 }
1373
1374 QwDebug << "Leaving QwEPICSEvent::WriteEPICSStringValues() normally" << QwLog::endl;
1375
1376 return;
1377
1378}

References QwLog::endl(), fEPICSDataEvent, fEPICSVariableList, fEPICSVariableType, kEPICSString, and QwDebug.

+ Here is the call graph for this function:

Field Documentation

◆ fBlinderReversalForRunTwo

Bool_t QwEPICSEvent::fBlinderReversalForRunTwo
private

Definition at line 195 of file QwEPICSEvent.h.

Referenced by LoadChannelMap(), and QwEPICSEvent().

◆ fDefaultAutogainList

std::vector< std::string > QwEPICSEvent::fDefaultAutogainList
staticprivate

Default autogain list.

Definition at line 138 of file QwEPICSEvent.h.

Referenced by GetDefaultAutogainList(), InitDefaultAutogainList(), and SetDefaultAutogainList().

◆ fDisableDatabase

bool QwEPICSEvent::fDisableDatabase
private

Definition at line 152 of file QwEPICSEvent.h.

Referenced by ProcessOptions().

◆ fEPICSCumulativeData

std::vector<EPICSCumulativeRecord> QwEPICSEvent::fEPICSCumulativeData
private

◆ fEPICSDataEvent

◆ fEPICSTableList

std::vector<std::string> QwEPICSEvent::fEPICSTableList
private

Definition at line 188 of file QwEPICSEvent.h.

Referenced by AddEPICSTag().

◆ fEPICSVariableList

◆ fEPICSVariableMap

std::map<std::string,Int_t> QwEPICSEvent::fEPICSVariableMap
private

Definition at line 191 of file QwEPICSEvent.h.

Referenced by AddEPICSTag(), and FindIndex().

◆ fEPICSVariableType

◆ fExtraHelicityReversal

Int_t QwEPICSEvent::fExtraHelicityReversal
private

Definition at line 199 of file QwEPICSEvent.h.

Referenced by DetermineIHWPPolarity(), and LoadChannelMap().

◆ fIsDataLoaded

Bool_t QwEPICSEvent::fIsDataLoaded
private

Definition at line 110 of file QwEPICSEvent.h.

Referenced by ExtractEPICSValues(), HasDataLoaded(), ResetCounters(), and SetDataLoaded().

◆ fNominalWienAngle

Double_t QwEPICSEvent::fNominalWienAngle
private

Definition at line 198 of file QwEPICSEvent.h.

Referenced by DetermineWienMode(), LoadChannelMap(), and QwEPICSEvent().

◆ fNumberEPICSEvents

Int_t QwEPICSEvent::fNumberEPICSEvents
private

◆ fNumberEPICSVariables

Int_t QwEPICSEvent::fNumberEPICSVariables
private

◆ fPrecessionReversal

Bool_t QwEPICSEvent::fPrecessionReversal
private

Definition at line 196 of file QwEPICSEvent.h.

Referenced by LoadChannelMap(), and QwEPICSEvent().

◆ fTreeArrayIndex

size_t QwEPICSEvent::fTreeArrayIndex
private

Definition at line 106 of file QwEPICSEvent.h.

Referenced by ConstructBranchAndVector(), and FillTreeVector().

◆ fTreeArrayNumEntries

size_t QwEPICSEvent::fTreeArrayNumEntries
private

Definition at line 107 of file QwEPICSEvent.h.

Referenced by ConstructBranchAndVector().

◆ kDebug

const int QwEPICSEvent::kDebug = 0
staticprivate

◆ kEPICS_Error

const int QwEPICSEvent::kEPICS_Error = -1
staticprivate

◆ kEPICS_OK

const int QwEPICSEvent::kEPICS_OK = 1
staticprivate

Definition at line 147 of file QwEPICSEvent.h.

◆ kInvalidEPICSData

const Double_t QwEPICSEvent::kInvalidEPICSData = -999999.0
staticprivate

Definition at line 148 of file QwEPICSEvent.h.

Referenced by GetDataValue(), SetDataValue(), and SetDataValue().


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