Public Member Functions | Private Member Functions | Private Attributes | List of all members
mcdatadaq::GlobalTriggerSimulator Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-05-05/MockDataDAQ/include/GlobalTriggerSimulator.h"

Public Member Functions

 GlobalTriggerSimulator ()
 
 ~GlobalTriggerSimulator ()
 
daqdataformats::RawTriggergetTrigger ()
 Gets the current trigger. More...
 
daqdataformats::RawTriggergetNewTrigger ()
 Generates a new trigger. More...
 

Private Member Functions

bool writeTrigger ()
 Write Trigger Object into output file. More...
 

Private Attributes

FILE * fOutputTriggerFile
 File for Triggers. More...
 
daqdataformats::RawTrigger fTrigger
 Instance of a Trigger. More...
 

Detailed Description

Definition at line 20 of file GlobalTriggerSimulator.h.

Constructor & Destructor Documentation

mcdatadaq::GlobalTriggerSimulator::GlobalTriggerSimulator ( )

Now we need to write DAQ Simulation version in the beginning of the file

Definition at line 28 of file GlobalTriggerSimulator.cpp.

References daqdataformats::CLOCKSRC_DUMMY, fOutputTriggerFile, fTrigger, mcdatadaq::Configuration::getFullFileName(), mcdatadaq::Configuration::getInstance(), string, TRIGGER_KEYWORD_IN_FILE_NAME, daqdataformats::TRIGSRC_SIMULATED, and mcdatadaq::Configuration::writeDAQSimulatorVersionIntoFile().

28  :fOutputTriggerFile(0) {
29  // Setup the pointer to the Trigger inside the fRawEvent
30  fTrigger.getTriggerHeader()->setSource(daqdataformats::TRIGSRC_SIMULATED);
31 
32  fTrigger.getTriggerTime()->setClockSource(daqdataformats::CLOCKSRC_DUMMY);
33 
34 
35  fTrigger.getTriggerRange()->setTriggerLength(4000); //500 microseconds
36  //fTrigger.getTriggerRange()->setTriggerCont(0); //Not infinity
37 
38  fTrigger.getTriggerMask()->setMonteCarloFlag(1);
39  fTrigger.getTriggerMask()->setTrigMod(0);// who know what this is
40  fTrigger.getTriggerMask()->setPrescale(1); //?
41 
43  const std::string final_file_name_trigger = config->getFullFileName(TRIGGER_KEYWORD_IN_FILE_NAME);
44  fOutputTriggerFile = fopen (final_file_name_trigger.c_str(),"wb");
45 
46  /// Now we need to write DAQ Simulation version in the beginning of the file
47  config->writeDAQSimulatorVersionIntoFile(fOutputTriggerFile);
48 
49 }
Definition: config.py:1
#define TRIGGER_KEYWORD_IN_FILE_NAME
Keyword in the file name for Trigger's file.
static Configuration * getInstance()
Method to obtain the class instance.
daqdataformats::RawTrigger fTrigger
Instance of a Trigger.
FILE * fOutputTriggerFile
File for Triggers.
enum BeamMode string
mcdatadaq::GlobalTriggerSimulator::~GlobalTriggerSimulator ( )

Close output files

Definition at line 52 of file GlobalTriggerSimulator.cpp.

References fclose(), and fOutputTriggerFile.

52  {
53 
54  /// Close output files
55  if(fOutputTriggerFile) {
57  }
58 
59 }
fclose(fg1)
FILE * fOutputTriggerFile
File for Triggers.

Member Function Documentation

daqdataformats::RawTrigger * mcdatadaq::GlobalTriggerSimulator::getNewTrigger ( )

Generates a new trigger.

Write the Trigger into the output triggerblocks file

Definition at line 62 of file GlobalTriggerSimulator.cpp.

References fTrigger, mcdatadaq::GlobalEventTime::getGlobalEventTime(), mcdatadaq::GlobalEventTime::getInstance(), getTrigger(), and writeTrigger().

Referenced by mcdatadaq::DAQSimulator::processEvent().

62  {
63 
64  const GlobalEventTime* global_event_time = GlobalEventTime::getInstance();
65 
66  fTrigger.getTriggerTime()->setTriggerTimeStamp(global_event_time->getGlobalEventTime());
67  fTrigger.getTriggerHeader()->setTriggerNumber(fTrigger.getTriggerHeader()->getTriggerNumber() + 1);
68 
69  /// Write the Trigger into the output triggerblocks file
70  writeTrigger();
71 
72  return getTrigger();
73 }
daqdataformats::RawTrigger fTrigger
Instance of a Trigger.
daqdataformats::RawTrigger * getTrigger()
Gets the current trigger.
static GlobalEventTime * getInstance()
Method to obtain the class instance.
bool writeTrigger()
Write Trigger Object into output file.
daqdataformats::RawTrigger * mcdatadaq::GlobalTriggerSimulator::getTrigger ( )

Gets the current trigger.

Gets current trigger.

Definition at line 77 of file GlobalTriggerSimulator.cpp.

References fTrigger.

Referenced by getNewTrigger().

77 { return &fTrigger;}
daqdataformats::RawTrigger fTrigger
Instance of a Trigger.
bool mcdatadaq::GlobalTriggerSimulator::writeTrigger ( )
private

Write Trigger Object into output file.

Definition at line 80 of file GlobalTriggerSimulator.cpp.

References fOutputTriggerFile, fTrigger, mcdatadaq::Configuration::getInstance(), and mcdatadaq::Configuration::writeToFile().

Referenced by getNewTrigger().

80  {
82  return config->writeToFile(fOutputTriggerFile, fTrigger);
83 }
Definition: config.py:1
static Configuration * getInstance()
Method to obtain the class instance.
daqdataformats::RawTrigger fTrigger
Instance of a Trigger.
FILE * fOutputTriggerFile
File for Triggers.

Member Data Documentation

FILE* mcdatadaq::GlobalTriggerSimulator::fOutputTriggerFile
private

File for Triggers.

Definition at line 38 of file GlobalTriggerSimulator.h.

Referenced by GlobalTriggerSimulator(), writeTrigger(), and ~GlobalTriggerSimulator().

daqdataformats::RawTrigger mcdatadaq::GlobalTriggerSimulator::fTrigger
private

Instance of a Trigger.

Definition at line 40 of file GlobalTriggerSimulator.h.

Referenced by getNewTrigger(), getTrigger(), GlobalTriggerSimulator(), and writeTrigger().


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