Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
VP1LightRun Class Reference

#include <VP1LightRun.h>

Collaboration diagram for VP1LightRun:

Public Member Functions

 VP1LightRun (const std::string &name)
 
 ~VP1LightRun ()
 
bool initialize ()
 
bool execute ()
 
bool finalize ()
 
void handle ()
 

Private Attributes

VP1Guim_vp1gui
 
std::vector< std::string > m_initialvp1files
 
std::string m_initialCruiseMode
 
unsigned m_initialCruiseSeconds {0}
 
bool m_noGui
 
bool m_mfOn {false}
 
std::string m_mfSourceDir
 
std::string m_mfLocalCopyDir
 
int m_mfLimit {0}
 
std::vector< std::string > m_mfAvailableLocalInputDirectories
 

Detailed Description

Definition at line 25 of file VP1LightRun.h.

Constructor & Destructor Documentation

◆ VP1LightRun()

VP1LightRun::VP1LightRun ( const std::string &  name)

Definition at line 30 of file VP1LightRun.cxx.

30  :
31  m_vp1gui(0)
32 {
33  std::cout << "VP1LightRun - name: " << name << std::endl;
34  m_noGui=false;
35 
36  // Pick up patched Coin
37  ::setenv("LCGPATCH_COINMULTISELECT","1",1);
38 }

◆ ~VP1LightRun()

VP1LightRun::~VP1LightRun ( )

Definition at line 41 of file VP1LightRun.cxx.

42 {
43 }

Member Function Documentation

◆ execute()

bool VP1LightRun::execute ( )

Definition at line 87 of file VP1LightRun.cxx.

88 {
89  // msg(MSG::DEBUG) <<" in execute() " << endreq;
90  std::cout <<"VP1LightRun:: in execute() " << std::endl;
91 
92  // std::cout << "m_vp1gui: " << m_vp1gui << " - m_noGui: " << m_noGui << " - m_vp1gui->hasBeenInitialised(): " << m_vp1gui->hasBeenInitialised() << std::endl;
93  if (!m_vp1gui) {
94  std::cout << "no vp1gui. Returning..." << std::endl;
95  return false; //StatusCode::FAILURE;
96  }
97 
98  if ( !m_noGui && !m_vp1gui->hasBeenInitialised() ) {
99  std::cout << "Launching VP1...!!" << std::endl;
100  m_vp1gui->init();//Launch!
101  }
102 
103  if(true) {
104  // Get run/event number:
105  const uint64_t eventNumber = 0; //evt->event_ID()->event_number();
106  int runNumber = 0; //evt->event_ID()->run_number();
107  // msg(MSG::DEBUG) << " Got run number = " << runNumber << ", event number = " << eventNumber << endreq;
108  std::cout << " Got run number = " << runNumber << ", event number = " << eventNumber << std::endl;
109 
110  // Get time stamp:
111  // unsigned time = evt->event_ID()->time_stamp();//0 means no info.
112  std::chrono::time_point<std::chrono::system_clock> now;
114  unsigned time = std::chrono::duration_cast<std::chrono::seconds>( now.time_since_epoch() ).count();
115  std::cout << " Got timestamp = " << time << std::endl;
116 
117  // Get L1 trigger type
118  unsigned int trigType = 0; //_trig ? _trig->level1TriggerType() : 0;
119 
121  return true; //StatusCode::SUCCESS;
122  } else {
123  // msg(MSG::INFO) << " Ending application gracefully." << endreq;
124  std::cout << " Ending application gracefully." << std::endl;
125  return false; //StatusCode::FAILURE;
126  }
127  };
128 
129  std::cout << "VP1LightRun::execute() returns TRUE..." << std::endl;
130  return true; //StatusCode::SUCCESS;
131 
132 }

◆ finalize()

bool VP1LightRun::finalize ( )

Definition at line 135 of file VP1LightRun.cxx.

136 {
137  // msg(MSG::DEBUG) <<" in finalize() " << endreq;
138  std::cout << " in finalize() " << std::endl;
139 
140  if (!m_vp1gui)
141  return false; //StatusCode::FAILURE;
142 
143  if (!m_noGui)
144  m_vp1gui->cleanup();
145  delete m_vp1gui;
146 
147  return true; // StatusCode::SUCCESS;
148 }

◆ handle()

void VP1LightRun::handle ( )

Definition at line 151 of file VP1LightRun.cxx.

152 {
153  std::cout << " in handle() " << std::endl;
154 
155  // msg(MSG::INFO) << "Handling incident '" << inc.type() << "'" << endreq;
156 
157  if (!m_vp1gui) {
158  // msg(MSG::INFO) << "Aborting due to null VP1Gui pointer." << endreq;
159  std::cout << "Aborting due to null VP1Gui pointer." << std::endl;
160  return;
161  }
162 
163  std::vector<std::string> vect;
164  // StringArrayProperty inputCollections("InputCollections", vect);
165  //
166  // sc = propertyServer->getProperty(&inputCollections);
167  // if(!sc.isSuccess()) {
168  // msg(MSG::INFO) << "Could not get InputCollections property" << endreq;
169  // return;
170  // }
171  // else
172  // msg(MSG::DEBUG) << " Got InputCollections property" << endreq;
173  //
174  // std::vector<std::string>::const_iterator iter = inputCollections.value().begin();
175  // std::vector<std::string>::const_iterator last = inputCollections.value().end();
176  // for(; iter != last; iter++) {
177  // if(*iter != fileInc->fileName())
178  // vect.push_back(*iter);
179  // }
180 
181  if(m_mfOn) {
182  std::string strNewFileName = m_vp1gui->nextRequestedEventFile();
183 
184  if (strNewFileName.empty())
185  return;
186  if (!VP1FileUtilities::fileExistsAndReadable(strNewFileName)) {
187  // msg(MSG::WARNING) << " File requested by VP1 does not exists or is not readable: "<<strNewFileName<<". Ending." << endreq;
188  cout << " File requested by VP1 does not exists or is not readable: "<<strNewFileName<<". Ending." << endl;
189  return;
190  }
191 
192  vect.push_back(strNewFileName);
193  // msg(MSG::INFO) << " Setting next event file: " << strNewFileName<< endreq;
194  cout << " Setting next event file: " << strNewFileName<< endl;
195  }
196  else {
197  std::vector<std::string> strNewFileNames = m_vp1gui->userRequestedFiles();
198  for(unsigned i=0; i<strNewFileNames.size(); ++i) {
199  const std::string& strNewFileName = strNewFileNames[i];
200  if (strNewFileName.empty())
201  continue;
202  if (!VP1FileUtilities::fileExistsAndReadable(strNewFileName)) {
203  // msg(MSG::WARNING) << " File requested by VP1 does not exists or is not readable: " << strNewFileName << endreq;
204  cout << " File requested by VP1 does not exists or is not readable: " << strNewFileName << endl;
205  continue;
206  }
207  vect.push_back(strNewFileName);
208  // msg(MSG::INFO) << " Setting next event file: " << strNewFileName<< endreq;
209  cout << " Setting next event file: " << strNewFileName<< endl;
210  }
211  }
212 
213  // StringArrayProperty newInputCollections("InputCollections", vect);
214  //
215  // if(propertyServer->setProperty(newInputCollections)!=StatusCode::SUCCESS)
216  // msg(MSG::WARNING) << "Could not set new InputCollections property" << endreq;
217  // else
218  // msg(MSG::DEBUG) << " InputCollections property set" << endreq;
219 }

◆ initialize()

bool VP1LightRun::initialize ( )

Definition at line 46 of file VP1LightRun.cxx.

47 {
48  // msg(MSG::DEBUG) << " in initialize() " << endreq;
49  std::cout << " in initialize() " << std::endl;
50 
51 
52 
53 
55  for (it = m_initialvp1files.begin();it!=itE;++it) {
56  }
57 
58  // dummy objects
59  StoreGateSvc* evtStore = nullptr;
60  StoreGateSvc* detStore = nullptr;
61  ISvcLocator* serviceLocator = nullptr;
62  IToolSvc* toolSvc = nullptr;
63 
64  // create VP1 GUI!
65  m_vp1gui = new VP1Gui( evtStore, detStore, serviceLocator, toolSvc,
68  (m_mfOn ? m_mfSourceDir : ""),
69  (m_mfOn ? m_mfLocalCopyDir : ""),
70  m_mfLimit,
71  ( m_mfOn ? m_mfAvailableLocalInputDirectories : std::vector<std::string>() ) );
72 
73 #ifdef JFBCOMMENTOUT
74  if (!m_vp1gui->argumentsAreValid()) {
75  std::cout << "arguments not valid..." << std::endl;
76  delete m_vp1gui;
77  m_vp1gui = 0;
78  exit(1);//Should we do this? It is kind of nice to not have to dig through the logfile to find the failure.
79  return false; // StatusCode::FAILURE;
80  }
81  std::cout << "OK! Returning TRUE..." << std::endl;
82 #endif
83  return true; //StatusCode::SUCCESS;
84 }

Member Data Documentation

◆ m_initialCruiseMode

std::string VP1LightRun::m_initialCruiseMode
private

Definition at line 44 of file VP1LightRun.h.

◆ m_initialCruiseSeconds

unsigned VP1LightRun::m_initialCruiseSeconds {0}
private

Definition at line 45 of file VP1LightRun.h.

◆ m_initialvp1files

std::vector<std::string> VP1LightRun::m_initialvp1files
private

Definition at line 43 of file VP1LightRun.h.

◆ m_mfAvailableLocalInputDirectories

std::vector<std::string> VP1LightRun::m_mfAvailableLocalInputDirectories
private

Definition at line 54 of file VP1LightRun.h.

◆ m_mfLimit

int VP1LightRun::m_mfLimit {0}
private

Definition at line 53 of file VP1LightRun.h.

◆ m_mfLocalCopyDir

std::string VP1LightRun::m_mfLocalCopyDir
private

Definition at line 52 of file VP1LightRun.h.

◆ m_mfOn

bool VP1LightRun::m_mfOn {false}
private

Definition at line 50 of file VP1LightRun.h.

◆ m_mfSourceDir

std::string VP1LightRun::m_mfSourceDir
private

Definition at line 51 of file VP1LightRun.h.

◆ m_noGui

bool VP1LightRun::m_noGui
private

Definition at line 47 of file VP1LightRun.h.

◆ m_vp1gui

VP1Gui* VP1LightRun::m_vp1gui
private

Definition at line 41 of file VP1LightRun.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
VP1LightRun::m_mfAvailableLocalInputDirectories
std::vector< std::string > m_mfAvailableLocalInputDirectories
Definition: VP1LightRun.h:54
VP1FileUtilities::fileExistsAndReadable
static bool fileExistsAndReadable(const std::string &)
Definition: VP1FileUtilities.cxx:211
VP1LightRun::m_mfLocalCopyDir
std::string m_mfLocalCopyDir
Definition: VP1LightRun.h:52
VP1Gui
Definition: VP1Gui.h:28
VP1LightRun::m_vp1gui
VP1Gui * m_vp1gui
Definition: VP1LightRun.h:41
VP1Gui::cleanup
void cleanup()
Definition: VP1Gui.cxx:205
VP1Gui::init
void init()
Definition: VP1Gui.cxx:181
skel.it
it
Definition: skel.GENtoEVGEN.py:407
VP1LightRun::m_initialvp1files
std::vector< std::string > m_initialvp1files
Definition: VP1LightRun.h:43
VP1Gui::executeNewEvent
bool executeNewEvent(const int &run, const uint64_t &event, const unsigned &triggerType=0, const unsigned &time=0)
Definition: VP1Gui.cxx:212
TruthTest.itE
itE
Definition: TruthTest.py:25
python.handimod.now
now
Definition: handimod.py:675
lumiFormat.i
int i
Definition: lumiFormat.py:85
VP1LightRun::m_initialCruiseMode
std::string m_initialCruiseMode
Definition: VP1LightRun.h:44
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
VP1Gui::hasBeenInitialised
bool hasBeenInitialised()
Definition: VP1Gui.cxx:175
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
calibdata.exit
exit
Definition: calibdata.py:236
VP1LightRun::m_mfSourceDir
std::string m_mfSourceDir
Definition: VP1LightRun.h:51
VP1LightRun::m_noGui
bool m_noGui
Definition: VP1LightRun.h:47
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
VP1Gui::userRequestedFiles
std::vector< std::string > userRequestedFiles()
Definition: VP1Gui.cxx:237
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
hydjet.StoreGateSvc
StoreGateSvc
Definition: hydjet.minbias.pbpb5520.r12345.job.py:40
VP1LightRun::m_mfLimit
int m_mfLimit
Definition: VP1LightRun.h:53
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
VP1Gui::argumentsAreValid
bool argumentsAreValid() const
Definition: VP1Gui.cxx:92
VP1Gui::nextRequestedEventFile
std::string nextRequestedEventFile() const
Definition: VP1Gui.cxx:231
VP1LightRun::m_initialCruiseSeconds
unsigned m_initialCruiseSeconds
Definition: VP1LightRun.h:45
VP1LightRun::m_mfOn
bool m_mfOn
Definition: VP1LightRun.h:50