#include <Sequence.h>
Inheritance diagram for jobc::Sequence:

Public Member Functions | |
| Sequence () | |
| Sequence (const char *name) | |
| Sequence (const Sequence &s) | |
| ~Sequence () | |
| Node * | GetNode (const char *name) |
| bool | Exec (edm::EventHandle &evt) |
| void | NewFile (const char *filename) |
| void | EndFile (const char *filename) |
| void | NewRun (int run, int subrun) |
| void | EndRun (int run, int subrun) |
| void | NewSubrun (int run, int subrun) |
| void | EndSubrun (int run, int subrun) |
| void | Print (const char *indent=0) |
| void | ResourceReport (bool printheader=false) const |
| Node * | PushFront (const Node &n) |
| Node * | PushBack (const Node &n) |
| Sequence * | PushFront (const Sequence &s) |
| Sequence * | PushBack (const Sequence &s) |
| Sequence & | operator= (const Sequence &rhs) |
Static Public Member Functions | |
| void | PrintCurrentNode () |
Private Types | |
| typedef std::list< Node * > | NodeList |
Private Member Functions | |
| void | Clear () |
Private Attributes | |
| NodeList | fNodeList |
| List of nodes in this sequence. | |
Static Private Attributes | |
| std::string | fsCurrentNode = "" |
| Node currently being processed. | |
| int | fsCurrentEvent = 0 |
| Event number being processed. | |
For example, the list of modules that perform cluster finding, merging, and fitting might be group into a sequence called "TrackReco"
Definition at line 22 of file Sequence.h.
|
|
Definition at line 54 of file Sequence.h. |
|
|
Definition at line 24 of file Sequence.cxx. Referenced by PushBack(), and PushFront().
00024 : Node("*","*",true) { } |
|
|
Definition at line 36 of file Sequence.cxx.
00036 : 00037 Node(name,"*",true) 00038 { } |
|
|
Definition at line 28 of file Sequence.cxx.
00028 : 00029 Node("*","*",true) 00030 { 00031 *this = s; 00032 } |
|
|
Definition at line 42 of file Sequence.cxx. References Clear().
00043 {
00044 this->Clear();
00045 }
|
|
|
Definition at line 49 of file Sequence.cxx. References fNodeList. Referenced by operator=(), and ~Sequence().
|
|
|
Definition at line 153 of file Sequence.cxx. References jobc::Module::EndFile(), fNodeList, jobc::Node::GetModule(), jobc::Node::IsSequence(), jobc::Node::StepInToFolder(), and jobc::Node::StepOutOfFolder(). Referenced by jobc::Job::CheckStatus().
00154 {
00155 NodeList::iterator itr ( fNodeList.begin() );
00156 NodeList::iterator itrEnd( fNodeList.end() );
00157 for (; itr!=itrEnd; ++itr) {
00158 Node* n = *itr;
00159 Sequence* s = static_cast<Sequence*>(n);
00160 if (n->IsSequence()) {
00161 s->EndFile(filename);
00162 }
00163 else {
00164 this->StepInToFolder();
00165 n->GetModule()->EndFile(filename);
00166 this->StepOutOfFolder();
00167 }
00168 }
00169 }
|
|
||||||||||||
|
Definition at line 193 of file Sequence.cxx. References jobc::Module::EndRun(), fNodeList, jobc::Node::GetModule(), jobc::Node::IsSequence(), jobc::Node::StepInToFolder(), and jobc::Node::StepOutOfFolder(). Referenced by jobc::Job::CheckStatus().
00194 {
00195 NodeList::const_iterator itr ( fNodeList.begin() );
00196 NodeList::const_iterator itrEnd( fNodeList.end() );
00197 for (; itr!=itrEnd; ++itr) {
00198 Node* n = *itr;
00199 Sequence* s = static_cast<Sequence*>(n);
00200 if (n->IsSequence()) {
00201 s->EndRun(run, subrun);
00202 }
00203 else {
00204 n->StepInToFolder();
00205 n->GetModule()->EndRun(run, subrun);
00206 n->StepOutOfFolder();
00207 }
00208 }
00209 }
|
|
||||||||||||
|
Definition at line 233 of file Sequence.cxx. References jobc::Module::EndSubrun(), fNodeList, jobc::Node::GetModule(), jobc::Node::IsSequence(), jobc::Node::StepInToFolder(), and jobc::Node::StepOutOfFolder(). Referenced by jobc::Job::CheckStatus().
00234 {
00235 NodeList::const_iterator itr ( fNodeList.begin() );
00236 NodeList::const_iterator itrEnd( fNodeList.end() );
00237 for (; itr!=itrEnd; ++itr) {
00238 Node* n = *itr;
00239 Sequence* s = static_cast<Sequence*>(n);
00240 if (n->IsSequence()) {
00241 s->EndSubrun(run, subrun);
00242 }
00243 else {
00244 n->StepInToFolder();
00245 n->GetModule()->EndSubrun(run, subrun);
00246 n->StepOutOfFolder();
00247 }
00248 }
00249 }
|
|
|
Reimplemented from jobc::Node. Definition at line 99 of file Sequence.cxx. References jobc::Resource::Difference(), fNodeList, fsCurrentEvent, fsCurrentNode, edm::EventHandle::Header(), and jobc::Resource::Log(). Referenced by jobc::Job::Run().
00100 {
00101 Resource r1;
00102 Resource r2;
00103
00104 fsCurrentEvent = evt.Header().Event();
00105
00106 bool passed = true;
00107 NodeList::iterator itr (fNodeList.begin());
00108 NodeList::iterator itrEnd(fNodeList.end());
00109 r1.Log();
00110 for (; itr!=itrEnd; ++itr) {
00111 fsCurrentNode = (*itr)->Name();
00112 passed = (*itr)->Exec(evt);
00113 if (passed == false) break;
00114 }
00115 r2.Log();
00116 r2.Difference(r1);
00117 Node::fResourceAna.Sum(r2);
00118
00119 if (passed) ++Node::fNpassReco;
00120 else ++Node::fNfailReco;
00121
00122 // No filters set, pass all events
00123 if (Node::fFilterActive==false) return true;
00124
00125 // Filter reversed: flip pass/fail
00126 if (Node::fFilterReversed) return !passed;
00127
00128 return passed;
00129 }
|
|
|
Reimplemented from jobc::Node. Definition at line 84 of file Sequence.cxx. References fNodeList, and jobc::Node::Name().
00085 {
00086 NodeList::iterator itr (fNodeList.begin());
00087 NodeList::iterator itrEnd(fNodeList.end());
00088 for (; itr!=itrEnd; ++itr) if ((*itr)->Name() == name) return *itr;
00089
00090 std::cerr
00091 << "JobCSequence:" << __LINE__
00092 << " Node '" << name << "' not found in sequence '" << this->Name()
00093 << "'" << std::endl;
00094 abort();
00095 }
|
|
|
Definition at line 133 of file Sequence.cxx. References fNodeList, jobc::Node::GetModule(), jobc::Node::IsSequence(), jobc::Module::NewFile(), jobc::Node::StepInToFolder(), and jobc::Node::StepOutOfFolder(). Referenced by jobc::Job::CheckStatus().
00134 {
00135 NodeList::iterator itr ( fNodeList.begin() );
00136 NodeList::iterator itrEnd( fNodeList.end() );
00137 for (; itr!=itrEnd; ++itr) {
00138 Node* n = *itr;
00139 Sequence* s = static_cast<Sequence*>(n);
00140 if (n->IsSequence()) {
00141 s->NewFile(filename);
00142 }
00143 else {
00144 this->StepInToFolder();
00145 n->GetModule()->NewFile(filename);
00146 this->StepOutOfFolder();
00147 }
00148 }
00149 }
|
|
||||||||||||
|
Definition at line 173 of file Sequence.cxx. References fNodeList, jobc::Node::GetModule(), jobc::Node::IsSequence(), jobc::Module::NewRun(), jobc::Node::StepInToFolder(), and jobc::Node::StepOutOfFolder(). Referenced by jobc::Job::CheckStatus().
00174 {
00175 NodeList::const_iterator itr ( fNodeList.begin() );
00176 NodeList::const_iterator itrEnd( fNodeList.end() );
00177 for (; itr!=itrEnd; ++itr) {
00178 Node* n = *itr;
00179 Sequence* s = static_cast<Sequence*>(n);
00180 if (n->IsSequence()) {
00181 s->NewRun(run, subrun);
00182 }
00183 else {
00184 n->StepInToFolder();
00185 n->GetModule()->NewRun(run, subrun);
00186 n->StepOutOfFolder();
00187 }
00188 }
00189 }
|
|
||||||||||||
|
Definition at line 213 of file Sequence.cxx. References fNodeList, jobc::Node::GetModule(), jobc::Node::IsSequence(), jobc::Module::NewSubrun(), jobc::Node::StepInToFolder(), and jobc::Node::StepOutOfFolder(). Referenced by jobc::Job::CheckStatus().
00214 {
00215 NodeList::const_iterator itr ( fNodeList.begin() );
00216 NodeList::const_iterator itrEnd( fNodeList.end() );
00217 for (; itr!=itrEnd; ++itr) {
00218 Node* n = *itr;
00219 Sequence* s = static_cast<Sequence*>(n);
00220 if (n->IsSequence()) {
00221 s->NewSubrun(run, subrun);
00222 }
00223 else {
00224 n->StepInToFolder();
00225 n->GetModule()->NewSubrun(run, subrun);
00226 n->StepOutOfFolder();
00227 }
00228 }
00229 }
|
|
|
Definition at line 64 of file Sequence.cxx. References Clear(), fNodeList, jobc::Node::IsSequence(), and PushBack().
00065 {
00066 // Base class copy
00067 this->Node::operator=(rhs);
00068
00069 // Create copy of rhs's list of nodes
00070 this->Clear();
00071 NodeList::const_iterator itr ( rhs.fNodeList.begin() );
00072 NodeList::const_iterator itrEnd( rhs.fNodeList.end() );
00073 for (; itr!=itrEnd; ++itr) {
00074 const Node* n = *itr;
00075 const Sequence* s = static_cast<const Sequence*>(n);
00076 if (n->IsSequence()) { this->PushBack(*s); }
00077 else { this->PushBack(*n); }
00078 }
00079 return *this;
00080 }
|
|
|
Definition at line 269 of file Sequence.cxx. References jobc::Node::AnaTime(), fNodeList, jobc::Node::IsSequence(), jobc::Node::Name(), jobc::Node::Print(), and jobc::Node::RecoTime(). Referenced by jobc::Job::Run().
00270 {
00271 TH1F* histoR = 0;
00272 TH1F* histoA = 0;
00273 TH1F* histoTot = 0;
00274
00275 if (indent) std::cout << indent;
00276 else {
00277 HistoFile::StepIn(0);
00278 char name[64], title[64];
00279 int n = fNodeList.size();
00280 sprintf(name, "recoTime_%s", Name());
00281 sprintf(title, "Time spent by %s in Reco(); ;Clock ticks", Name());
00282 histoR = new TH1F(name, title, n, 0, n);
00283 sprintf(name, "anaTime_%s", Name());
00284 sprintf(title, "Time spent by %s in Ana(); ;Clock ticks", Name());
00285 histoA = new TH1F(name, title, n, 0, n);
00286 sprintf(name, "totTime_%s", Name());
00287 sprintf(title, "Total Time Taken by %s; ;Clock Ticks", Name());
00288 histoTot = new TH1F(name, title, n, 0, n);
00289 }
00290 if (Node::fFilterActive) {
00291 if (Node::fFilterReversed) std::cout << "!-";
00292 else std::cout << "+-";
00293 }
00294 else std::cout << "|-";
00295 std::cout << this->Name() << " sequence ("
00296 << Node::fNpassReco << "/"
00297 << Node::fNfailReco << "/"
00298 << Node::fNpassReco+fNfailReco
00299 << " events "
00300 << Node::fResourceAna.utime << "u/"
00301 << Node::fResourceAna.stime << "s seconds)"
00302 << std::endl;
00303
00304 std::string ind2;
00305 if (indent) { ind2 = indent; ind2 += " "; }
00306 else { ind2 = " "; }
00307
00308 NodeList::iterator itr (fNodeList.begin());
00309 NodeList::iterator itrEnd(fNodeList.end());
00310 for (unsigned int i = 0; itr != itrEnd; ++i, ++itr) {
00311 Node* n = (*itr);
00312 if (histoR) {
00313 histoA->GetXaxis()->SetBinLabel(i + 1, n->Name());
00314 histoA->Fill(i, n->AnaTime());
00315 histoR->GetXaxis()->SetBinLabel(i + 1, n->Name());
00316 histoR->Fill(i, n->RecoTime());
00317 histoTot->GetXaxis()->SetBinLabel(i + 1, n->Name());
00318 histoTot->Fill(i, n->AnaTime() + n->RecoTime());
00319 }
00320 Sequence* s = static_cast<Sequence*>(n);
00321 if (n->IsSequence()) s->Print(ind2.c_str());
00322 else n->Print(ind2.c_str());
00323 }
00324 if (histoR) {
00325 HistoFile::StepIn(0);
00326 histoR->Write();
00327 histoA->Write();
00328 histoTot->Write();
00329 delete histoR;
00330 delete histoA;
00331 delete histoTot;
00332 HistoFile::StepOut();
00333 }
00334 }
|
|
|
Definition at line 386 of file Sequence.cxx. References fsCurrentEvent, and fsCurrentNode. Referenced by gsSIGHUPhandler().
00387 {
00388 std::cout << "Processing " << fsCurrentNode << ", event "
00389 << fsCurrentEvent << std::endl;
00390 }
|
|
|
Definition at line 374 of file Sequence.cxx. References fNodeList, and Sequence().
|
|
|
Definition at line 350 of file Sequence.cxx. References fNodeList, and jobc::Node::Node(). Referenced by operator=().
|
|
|
Definition at line 362 of file Sequence.cxx. References fNodeList, and Sequence().
|
|
|
Definition at line 338 of file Sequence.cxx. References fNodeList, and jobc::Node::Node(). Referenced by jobc::sequenceBuilder::Build(), and jobc::jobBuilder::Build().
|
|
|
Reimplemented from jobc::Node. Definition at line 253 of file Sequence.cxx. References fNodeList, jobc::Node::IsSequence(), and jobc::Node::ResourceReport(). Referenced by jobc::Job::Run().
00254 {
00255 bool doheader = printheader;
00256 NodeList::const_iterator itr (fNodeList.begin());
00257 NodeList::const_iterator itrEnd(fNodeList.end());
00258 for (; itr!=itrEnd; ++itr) {
00259 const Node* n = (*itr);
00260 const Sequence* s = static_cast<const Sequence*>(n);
00261 if (n->IsSequence()) s->ResourceReport(doheader);
00262 else n->ResourceReport(doheader);
00263 doheader = false;
00264 }
00265 }
|
|
|
List of nodes in this sequence.
Definition at line 56 of file Sequence.h. Referenced by Clear(), EndFile(), EndRun(), EndSubrun(), Exec(), GetNode(), NewFile(), NewRun(), NewSubrun(), operator=(), Print(), PushBack(), PushFront(), and ResourceReport(). |
|
|
Event number being processed.
Definition at line 20 of file Sequence.cxx. Referenced by Exec(), and PrintCurrentNode(). |
|
|
Node currently being processed.
Definition at line 19 of file Sequence.cxx. Referenced by Exec(), and PrintCurrentNode(). |
1.3.5