#include <JobCInput.h>
Inheritance diagram for JobCInput:

Public Member Functions | |
| JobCInput () | |
| virtual | ~JobCInput () |
| JobCResult | Get () |
| JobCResult | Next (int n=1) |
| JobCResult | Prev (int n=1) |
| JobCResult | GoTo (int runNumber, int snarlNumber, int searchDir=0) |
| JobCResult | GoTo (const VldContext &vld) |
| Int_t | GetCurrentRun () const |
| Int_t | GetLastRun () const |
| const char * | GetCurrentFile (const char *streamname="*") const |
| const char * | GetLastFile (const char *streamname="*") const |
| Int_t | GetCurrentSnarl () const |
| void | List (const char *streamlist="*") const |
| void | AddFile (const char *filename, const char *streamlist="*", int at=-1) |
| void | RemoveFile (const char *filename, const char *streamlist="*") |
| void | DefineStream (const char *stream, const char *tree) |
| void | Select (const char *stream, const char *cut, bool isrequired=false) |
| void | SetSequenceMode (const char *stream, Per::ESequenceMode seqmode=Per::kKey) |
| void | SetTestMode (const char *stream, bool testmode) |
| void | SetPerOwnedDisabled (const char *stream, bool perowneddisabled=true) |
| void | SetWindow (const char *stream, double lower, double upper) |
| void | SetMaxFileRepeat (const char *stream, int numRepeat) |
| void | SetMeanMom (const char *stream, double mean) |
| void | SetPushRandom (const char *stream, bool setRandom) |
| void | SetRandomSeed (int rSeed) |
| JobCResult | NextFile (int n=1, const char *streamlist="*") |
| JobCResult | PrevFile (int n=1, const char *streamlist="*") |
| JobCResult | GoToFile (int i=0, const char *streamlist="*") |
| JobCResult | GoToFile (const char *filename, const char *streamlist="*") |
| void | Use (const char *name) |
| void | BeginJob () |
| void | EndJob () |
| void | BeginFile () |
| void | EndFile () |
| void | BeginRun () |
| void | EndRun () |
| const Registry & | DefaultConfig () const |
| void | Config (const Registry &r) |
| Registry & | GetConfig () |
| void | Cmd (const char *command) |
| void | HandleCommand (JobCommand *command) |
| void | Help () |
| void | Report () |
| void | Reset () |
Public Attributes | |
| SigC::Signal0PlaceHolder | SigGet |
| SigC::Signal0PlaceHolder | SigNext |
| SigC::Signal0PlaceHolder | SigPrev |
| SigC::Signal0PlaceHolder | SigGoTo |
Private Member Functions | |
| int | CheckImpl () const |
| virtual JobCResult | Get (MomNavigator *) |
Private Attributes | |
| JobCInputModule * | fImpl |
|
|
Definition at line 23 of file JobCInput.cxx. 00023 : fImpl(0) { }
|
|
|
Definition at line 27 of file JobCInput.cxx. References JobCModule::EndJob(), and fImpl.
|
|
||||||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 160 of file JobCInput.cxx. References JobCInputModule::AddFile(), CheckImpl(), and fImpl. Referenced by main(), merge_configure(), PageDisplay::OpenFile(), and SetupInput().
|
|
|
Implement for notification of begin of file. See GetCurrentFile(). Reimplemented from JobCModule. Definition at line 359 of file JobCInput.cxx. References BeginFile(), and IMP. Referenced by BeginFile(). 00359 { IMP(BeginFile) }
|
|
|
Implement for notification of begin of job Reimplemented from JobCModule. Definition at line 357 of file JobCInput.cxx. References BeginJob(), and IMP. Referenced by BeginJob(). 00357 { IMP(BeginJob) }
|
|
|
Implement for notification of begin of run (meaningful for Daq data only). See GetCurrentRun(). Reimplemented from JobCModule. Definition at line 361 of file JobCInput.cxx. References BeginRun(), and IMP. Referenced by BeginRun(). 00361 { IMP(BeginRun) }
|
|
|
Definition at line 381 of file JobCInput.cxx. Referenced by AddFile(), DefaultConfig(), DefineStream(), Get(), GetConfig(), GetCurrentFile(), GetCurrentRun(), GetCurrentSnarl(), GetLastFile(), GetLastRun(), GoTo(), GoToFile(), List(), Next(), NextFile(), Prev(), PrevFile(), RemoveFile(), Select(), SetMaxFileRepeat(), SetMeanMom(), SetPerOwnedDisabled(), SetPushRandom(), SetRandomSeed(), SetSequenceMode(), SetTestMode(), and SetWindow(). 00382 {
00383 //======================================================================
00384 // Check if we have a valid pointer to an input module
00385 //======================================================================
00386 if (fImpl==0) {
00387 MSG("JobC",Msg::kWarning) <<
00388 "No implementation provided for Input module. Try this:"
00389 " Input.Use(\"Input\")" << std::endl;
00390 return 0;
00391 }
00392 return 1;
00393 }
|
|
|
Implement to handle a command Reimplemented from JobCModule. Definition at line 373 of file JobCInput.cxx. Referenced by Cmd(). 00373 { IMP(Cmd,c) }
|
|
|
Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables. Reimplemented from JobCModule. Definition at line 372 of file JobCInput.cxx. Referenced by Config(). 00372 { IMP(Config,r) }
|
|
|
Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like: const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; } Reimplemented from JobCModule. Definition at line 323 of file JobCInput.cxx. References CheckImpl(), JobCModule::DefaultConfig(), fImpl, and MSG. 00324 {
00325 MSG("JobC",Msg::kDebug) << "JobCInput::DefaultConfig()\n";
00326
00327 if (this->CheckImpl()) return fImpl->DefaultConfig();
00328
00329 MSG("JobC",Msg::kDebug) << "Using dummy config!\n";
00330 static Registry r; // A dummy config...
00331 return r;
00332 }
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 237 of file JobCInput.cxx. References CheckImpl(), JobCInputModule::DefineStream(), and fImpl. Referenced by merge_configure(). 00238 {
00239 if (this->CheckImpl()) fImpl->DefineStream(stream,tree);
00240 }
|
|
|
Implement for notification of end of file. See GetLastFile(). Reimplemented from JobCModule. Definition at line 360 of file JobCInput.cxx. References EndFile(), and IMP. Referenced by EndFile(). 00360 { IMP(EndFile) }
|
|
|
Implement for notification of end of job Reimplemented from JobCModule. Definition at line 358 of file JobCInput.cxx. Referenced by EndJob(). 00358 { IMP(EndJob) }
|
|
|
Implement for notification of end of run (meaningful for Daq data only). See GetLastRun(). Reimplemented from JobCModule. Definition at line 362 of file JobCInput.cxx. Referenced by EndRun(). 00362 { IMP(EndRun) }
|
|
|
Implement if your module needs to read data from some external source and fill mom Reimplemented from JobCInputModule. Definition at line 168 of file JobCInput.h. 00168 { assert(0); return JobCResult::kFatal; }
|
|
|
Reimplemented from JobCInputModule. Definition at line 37 of file JobCInput.cxx. References CheckImpl(), fImpl, JobCInputModule::Get(), and SigGet. 00038 {
00039 if (this->CheckImpl()) {
00040 JobCResult r = fImpl->Get();
00041 #ifdef SITE_HAS_SIGC
00042 this->SigGet();
00043 #endif
00044 return r;
00045 }
00046 return JobCResult::kEndOfInputStream;
00047 }
|
|
|
Reimplemented from JobCModule. Definition at line 336 of file JobCInput.cxx. References CheckImpl(), fImpl, JobCModule::GetConfig(), and MSG. 00337 {
00338 //======================================================================
00339 // To make the JobCInput fit transparently over the module that
00340 // actually implements the input module we don't ever want to talk to
00341 // JobCInput::fConfig we want to talk to fImpl->fConfig. JobCModule
00342 // has been written very carefully to never reference fConfig directly
00343 // but only through this method...
00344 //======================================================================
00345 if (this->CheckImpl()) return fImpl->GetConfig();
00346
00347 MSG("JobC",Msg::kDebug) << "Returning dummy config!\n";
00348 static Registry r; // A dummy config...
00349 return r;
00350 }
|
|
|
Return the currently opened input file. This should not be overridden. Use this in BeginFile(). Reimplemented from JobCInputModule. Definition at line 112 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::GetCurrentFile(). 00113 {
00114 if (this->CheckImpl())
00115 return fImpl->GetCurrentFile(streamname);
00116 return 0;
00117 }
|
|
|
Return the current run #. This should not be overridden. Use this in BeginRun(). Reimplemented from JobCInputModule. Definition at line 94 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::GetCurrentRun(). 00095 {
00096 if (this->CheckImpl())
00097 return fImpl->GetCurrentRun();
00098 return -1;
00099 }
|
|
|
Reimplemented from JobCInputModule. Definition at line 130 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::GetCurrentSnarl(). 00131 {
00132 if (this->CheckImpl())
00133 return fImpl->GetCurrentSnarl();
00134 return -1;
00135 }
|
|
|
Return the previously opened input file. This should not be overridden. Use this in EndFile(). Reimplemented from JobCInputModule. Definition at line 121 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::GetLastFile(). 00122 {
00123 if (this->CheckImpl())
00124 return fImpl->GetLastFile(streamname);
00125 return 0;
00126 }
|
|
|
Return the previous run #. This should not be overridden. Use this in EndRun(). Reimplemented from JobCInputModule. Definition at line 103 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::GetLastRun(). 00104 {
00105 if (this->CheckImpl())
00106 return fImpl->GetLastRun();
00107 return -1;
00108 }
|
|
|
Reimplemented from JobCInputModule. Definition at line 139 of file JobCInput.cxx. References CheckImpl(), fImpl, JobCInputModule::GoTo(), and SigGoTo. 00140 {
00141 if (this->CheckImpl()) {
00142 JobCResult r = fImpl->GoTo(vld);
00143 #ifdef SITE_HAS_SIGC
00144 this->SigGoTo();
00145 #endif
00146 return r;
00147 }
00148 return JobCResult::kError;
00149 }
|
|
||||||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 79 of file JobCInput.cxx. References CheckImpl(), fImpl, JobCInputModule::GoTo(), s(), and SigGoTo. Referenced by MoqBase::GetEntry(), and Jint::GoTo(). 00080 {
00081 if (this->CheckImpl()) {
00082 JobCResult re = fImpl->GoTo(r,s,d);
00083 #ifdef SITE_HAS_SIGC
00084 this->SigGoTo();
00085 #endif
00086 return re;
00087 }
00088 return JobCResult::kError;
00089 }
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 268 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::GoToFile(). 00269 {
00270 if (this->CheckImpl()) return fImpl->GoToFile(filename, streamlist);
00271 return JobCResult::kError;
00272 }
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 260 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::GoToFile(). 00261 {
00262 if (this->CheckImpl()) return fImpl->GoToFile(i, streamlist);
00263 return JobCResult::kError;
00264 }
|
|
|
Implement to handle a JobCommand Reimplemented from JobCModule. Definition at line 374 of file JobCInput.cxx. References HandleCommand(), and IMP. Referenced by HandleCommand(). 00374 { IMP(HandleCommand,c) }
|
|
|
Implement to spew some useful help to cout Reimplemented from JobCModule. Definition at line 363 of file JobCInput.cxx. Referenced by Help(). 00363 { IMP(Help) }
|
|
|
Reimplemented from JobCInputModule. Definition at line 153 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::List().
|
|
|
Reimplemented from JobCInputModule. Definition at line 51 of file JobCInput.cxx. References CheckImpl(), fImpl, JobCInputModule::Next(), and SigNext. Referenced by Jint::Next(), and run(). 00052 {
00053 if (this->CheckImpl()) {
00054 JobCResult r = fImpl->Next(n);
00055 #ifdef SITE_HAS_SIGC
00056 this->SigNext();
00057 #endif
00058 return r;
00059 }
00060 return JobCResult::kError;
00061 }
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 244 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::NextFile(). 00245 {
00246 if (this->CheckImpl()) return fImpl->NextFile(n,streamlist);
00247 return JobCResult::kError;
00248 }
|
|
|
Reimplemented from JobCInputModule. Definition at line 65 of file JobCInput.cxx. References CheckImpl(), fImpl, JobCInputModule::Prev(), and SigPrev. Referenced by MadBase::GetEntry(), and Jint::Prev(). 00066 {
00067 if (this->CheckImpl()){
00068 JobCResult r = fImpl->Prev(n);
00069 #ifdef SITE_HAS_SIGC
00070 this->SigPrev();
00071 #endif
00072 return r;
00073 }
00074 return JobCResult::kError;
00075 }
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 252 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::PrevFile(). 00253 {
00254 if (this->CheckImpl()) return fImpl->PrevFile(n, streamlist);
00255 return JobCResult::kError;
00256 }
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 167 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::RemoveFile(). 00168 {
00169 if (this->CheckImpl()) fImpl->RemoveFile(filename,streamlist);
00170 }
|
|
|
Implement to spew end of running report Reimplemented from JobCModule. Definition at line 364 of file JobCInput.cxx. Referenced by Report(). 00364 { IMP(Report) }
|
|
|
Implement to reset oneself Reimplemented from JobCModule. Definition at line 365 of file JobCInput.cxx. Referenced by Reset(). 00365 { IMP(Reset) }
|
|
||||||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 174 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::Select().
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 209 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::SetMaxFileRepeat(). Referenced by merge_configure(). 00210 {
00211 if (this->CheckImpl()) fImpl->SetMaxFileRepeat(stream,numRepeat);
00212 }
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 216 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::SetMeanMom(). Referenced by merge_configure(). 00217 {
00218 if (this->CheckImpl()) fImpl->SetMeanMom(stream,mean);
00219 }
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 188 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::SetPerOwnedDisabled(). 00189 {
00190 if (this->CheckImpl()) fImpl->SetPerOwnedDisabled(stream,perowneddisabled);
00191 }
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 223 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::SetPushRandom(). Referenced by merge_configure(). 00224 {
00225 if (this->CheckImpl()) fImpl->SetPushRandom(stream,setRandom);
00226 }
|
|
|
Reimplemented from JobCInputModule. Definition at line 230 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::SetRandomSeed(). 00231 {
00232 if (this->CheckImpl()) fImpl->SetRandomSeed(rSeed);
00233 }
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 181 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::SetSequenceMode(). Referenced by merge_configure(). 00182 {
00183 if (this->CheckImpl()) fImpl->SetSequenceMode(stream,seqmode);
00184 }
|
|
||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 195 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::SetTestMode(). 00196 {
00197 if (this->CheckImpl()) fImpl->SetTestMode(stream,testmode);
00198 }
|
|
||||||||||||||||
|
Reimplemented from JobCInputModule. Definition at line 202 of file JobCInput.cxx. References CheckImpl(), fImpl, and JobCInputModule::SetWindow().
|
|
|
Definition at line 276 of file JobCInput.cxx. References JobCModule::BeginJob(), JobCModuleProxy::CreateModule(), JobCModule::EndJob(), fImpl, JobCModuleProxy::GetName(), JobCModuleRegistry::Instance(), JobCModuleRegistry::LookUp(), MSG, and JobCInputModule::SetMom(). Referenced by JobC::Init(), and SetupInput(). 00277 {
00278 //======================================================================
00279 // Set the input module to implement this class
00280 //======================================================================
00281
00282 // Use the name to lookup the proxy
00283 JobCModuleProxy* jmp = JobCModuleRegistry::Instance().LookUp(name);
00284 if (jmp==0) {
00285 MSG("JobC",Msg::kWarning) <<
00286 "No module '"<< name <<"' has been linked in." << std::endl;
00287 return;
00288 }
00289
00290 // Use the proxy to instantiate a module
00291 JobCModule* m = jmp->CreateModule();
00292 if (m==0) {
00293 MSG("JobC",Msg::kWarning) <<
00294 "CreateModule(" << jmp->GetName() << ")" << std::endl;
00295 return;
00296 }
00297
00298 // Try to cast the module as an input module
00299 JobCInputModule* inmod = dynamic_cast<JobCInputModule*>(m);
00300 if (inmod==0) {
00301 MSG("JobC",Msg::kError) <<
00302 "Module '" << jmp->GetName() <<
00303 "' cannot be used as an input module." << std::endl;
00304 delete m; m = 0;
00305 return;
00306 }
00307
00308 // Switch to the new implementation
00309 if (fImpl) {
00310 fImpl->EndJob();
00311 delete fImpl; fImpl = 0;
00312 }
00313 fImpl = inmod;
00314
00315 // Set up the new module
00316 assert(this->GetMom());
00317 fImpl->SetMom(this->GetMom());
00318 fImpl->BeginJob();
00319 }
|
|
|
Definition at line 165 of file JobCInput.h. Referenced by AddFile(), CheckImpl(), DefaultConfig(), DefineStream(), Get(), GetConfig(), GetCurrentFile(), GetCurrentRun(), GetCurrentSnarl(), GetLastFile(), GetLastRun(), GoTo(), GoToFile(), List(), Next(), NextFile(), Prev(), PrevFile(), RemoveFile(), Select(), SetMaxFileRepeat(), SetMeanMom(), SetPerOwnedDisabled(), SetPushRandom(), SetRandomSeed(), SetSequenceMode(), SetTestMode(), SetWindow(), Use(), and ~JobCInput(). |
|
|
Definition at line 155 of file JobCInput.h. Referenced by Get(), and Jint::Jint(). |
|
|
Definition at line 158 of file JobCInput.h. Referenced by GoTo(), and Jint::Jint(). |
|
|
Definition at line 156 of file JobCInput.h. Referenced by Jint::Jint(), and Next(). |
|
|
Definition at line 157 of file JobCInput.h. Referenced by Jint::Jint(), and Prev(). |
1.3.9.1