ATLAS Offline Software
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 35 of file VP1LightRun.cxx.

35  :
36  m_vp1gui(0)
37 {
38  std::cout << "VP1LightRun - name: " << name << std::endl;
39  m_noGui=false;
40 
41  // Pick up patched Coin
42  ::setenv("LCGPATCH_COINMULTISELECT","1",1);
43 }

◆ ~VP1LightRun()

VP1LightRun::~VP1LightRun ( )

Definition at line 46 of file VP1LightRun.cxx.

47 {
48 }

Member Function Documentation

◆ execute()

bool VP1LightRun::execute ( )

Definition at line 92 of file VP1LightRun.cxx.

93 {
94  // msg(MSG::DEBUG) <<" in execute() " << endreq;
95  std::cout <<"VP1LightRun:: in execute() " << std::endl;
96 
97  // std::cout << "m_vp1gui: " << m_vp1gui << " - m_noGui: " << m_noGui << " - m_vp1gui->hasBeenInitialised(): " << m_vp1gui->hasBeenInitialised() << std::endl;
98  if (!m_vp1gui) {
99  std::cout << "no vp1gui. Returning..." << std::endl;
100  return false; //StatusCode::FAILURE;
101  }
102 
103  if ( !m_noGui && !m_vp1gui->hasBeenInitialised() ) {
104  std::cout << "Launching VP1...!!" << std::endl;
105  m_vp1gui->init();//Launch!
106  }
107 
108  // const EventInfo* evt;
109  // StatusCode status = evtStore()->retrieve(evt);
110  // if(status.isSuccess()) {
111  if(true) {
112  // Get run/event number:
113  const uint64_t eventNumber = 0; //evt->event_ID()->event_number();
114  int runNumber = 0; //evt->event_ID()->run_number();
115  // msg(MSG::DEBUG) << " Got run number = " << runNumber << ", event number = " << eventNumber << endreq;
116  std::cout << " Got run number = " << runNumber << ", event number = " << eventNumber << std::endl;
117 
118  // Get time stamp:
119  // unsigned time = evt->event_ID()->time_stamp();//0 means no info.
120  std::chrono::time_point<std::chrono::system_clock> now;
122  unsigned time = std::chrono::duration_cast<std::chrono::seconds>( now.time_since_epoch() ).count();
123  std::cout << " Got timestamp = " << time << std::endl;
124 
125  // Get L1 trigger type
126  // TriggerInfo* _trig = evt->trigger_info();
127  // unsigned int trigType = _trig ? _trig->level1TriggerType() : 0;
128  unsigned int trigType = 0; //_trig ? _trig->level1TriggerType() : 0;
129 
131  return true; //StatusCode::SUCCESS;
132  } else {
133  // msg(MSG::INFO) << " Ending application gracefully." << endreq;
134  std::cout << " Ending application gracefully." << std::endl;
135  return false; //StatusCode::FAILURE;
136  }
137  };
138 
139  // msg(MSG::WARNING) << " Unable to retrieve EventInfo from StoreGate. Skipping" << endreq;
140 
141  std::cout << "VP1LightRun::execute() returns TRUE..." << std::endl;
142  return true; //StatusCode::SUCCESS;
143 
144 }

◆ finalize()

bool VP1LightRun::finalize ( )

Definition at line 147 of file VP1LightRun.cxx.

148 {
149  // msg(MSG::DEBUG) <<" in finalize() " << endreq;
150  std::cout << " in finalize() " << std::endl;
151 
152  if (!m_vp1gui)
153  return false; //StatusCode::FAILURE;
154 
155  if (!m_noGui)
156  m_vp1gui->cleanup();
157  delete m_vp1gui;
158 
159  return true; // StatusCode::SUCCESS;
160 }

◆ handle()

void VP1LightRun::handle ( )

Definition at line 163 of file VP1LightRun.cxx.

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

◆ initialize()

bool VP1LightRun::initialize ( )

Definition at line 51 of file VP1LightRun.cxx.

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

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:396
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:228
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