Public Member Functions | |
| LoopRunLimitHelper (int runLimit, int eventTot, const NCEventInfo *eventInfo) | |
| ~LoopRunLimitHelper () | |
| bool | AreDone (int i, const NCEventInfo *eventInfo) |
| You must call this function in every iteration of the loop. | |
| int | GetRunCounter () |
Protected Attributes | |
| TStopwatch | fStopwatch |
| For progress reporting. Starts when class created. | |
| int | fEventTot |
| Total number of events in the chain. | |
| int | fRunLimit |
| Number of (sub)runs allowed. | |
| int | fPrevSubRun |
| Subrun of the previous event. | |
| int | fPrevRun |
| Run of the previous event. | |
| int | fRunCounter |
| Number of (sub)runs seen so far. | |
Definition at line 165 of file NCEventAdder.cxx.
|
||||||||||||||||
|
Definition at line 172 of file NCEventAdder.cxx. References NCEventInfo::header, MSG, ANtpHeaderInfo::run, and ANtpHeaderInfo::subRun. 00173 : fEventTot(eventTot), fRunLimit(runLimit), fRunCounter(0) 00174 { 00175 fPrevSubRun = eventInfo->header->subRun; 00176 fPrevRun = eventInfo->header->run; 00177 00178 if(fRunLimit != INT_MAX){ 00179 MSG("RunLimitHelper", Msg::kInfo) 00180 << fEventTot << " total events " 00181 << "limited to " << fRunLimit << " (sub)runs" << endl; 00182 } 00183 else{ 00184 MSG("RunLimitHelper", Msg::kInfo) 00185 << fEventTot << " total events, no (sub)run limit" << endl; 00186 } 00187 }
|
|
|
Definition at line 189 of file NCEventAdder.cxx. References MSG, and NC::Utility::ReportProgress(). 00190 {
00191 NC::Utility::ReportProgress(1, fStopwatch);
00192 MSG("RunLimitHelper", Msg::kInfo) << endl;
00193 }
|
|
||||||||||||
|
You must call this function in every iteration of the loop.
Definition at line 203 of file NCEventAdder.cxx. References NCEventInfo::header, NC::Utility::ReportProgress(), ANtpHeaderInfo::run, and ANtpHeaderInfo::subRun. Referenced by NC::MockDataAdder::AddEventsToExtrapolations(), NC::RealDataAdder::AddEventsToExtrapolations(), NC::SplitFakeDataAdder::AddEventsToExtrapolations(), and NC::FakeDataAdder::AddEventsToExtrapolations(). 00204 {
00205 const int thisSubRun = eventInfo->header->subRun;
00206 const int thisRun = eventInfo->header->run;
00207
00208 if(thisRun != fPrevRun || thisSubRun != fPrevSubRun){
00209 fPrevRun = thisRun;
00210 fPrevSubRun = thisSubRun;
00211 ++fRunCounter;
00212 }
00213
00214 // Don't do it on the very first few, other people want to print
00215 if(i % 1000 == 10)
00216 NC::Utility::ReportProgress(std::max(float(i)/fEventTot,
00217 float(fRunCounter)/fRunLimit),
00218 fStopwatch);
00219
00220 return (fRunCounter > fRunLimit || i >= fEventTot);
00221 }
|
|
|
Definition at line 223 of file NCEventAdder.cxx. Referenced by NC::SplitFakeDataAdder::AddEventsToExtrapolations(). 00223 {return fRunCounter;}
|
|
|
Total number of events in the chain.
Definition at line 228 of file NCEventAdder.cxx. |
|
|
Run of the previous event.
Definition at line 231 of file NCEventAdder.cxx. |
|
|
Subrun of the previous event.
Definition at line 230 of file NCEventAdder.cxx. |
|
|
Number of (sub)runs seen so far.
Definition at line 232 of file NCEventAdder.cxx. |
|
|
Number of (sub)runs allowed.
Definition at line 229 of file NCEventAdder.cxx. |
|
|
For progress reporting. Starts when class created.
Definition at line 226 of file NCEventAdder.cxx. |
1.3.9.1