Jpp
JTreeScanner.hh
Go to the documentation of this file.
1 #ifndef __JSUPPORT__JTREESCANNER__
2 #define __JSUPPORT__JTREESCANNER__
3 
4 #include <vector>
5 #include <string>
6 #include <ostream>
7 #include <iomanip>
8 #include <algorithm>
9 
10 #include "JLang/JNullType.hh"
11 #include "JLang/JPointer.hh"
12 #include "JLang/JConversion.hh"
13 #include "JROOT/JChainReader.hh"
14 #include "JROOT/JCounter.hh"
15 #include "JROOT/JRootSupportkit.hh"
16 #include "Jeep/JMessage.hh"
20 
21 
22 /**
23  * \author mdejong
24  */
25 
26 namespace JSUPPORT {}
27 namespace JPP { using namespace JSUPPORT; }
28 
29 namespace JSUPPORT {
30 
31  using JLANG::JPointer;
32  using JLANG::JNullType;
34  using JROOT::JChainReader;
35  using JROOT::counter_type;
36  using JEEP::JMessage;
37 
38 
39  /**
40  * Pattern match for names of sub-branches that will not be read when ordering elements in a TTree.
41  */
42  static const char* const BRANCH_PATTERN = "vector";
43 
44 
45  /**
46  * Base class for JTreeScanner.
47  *
48  * Following ROOT memory management, a JChainReader object is created
49  * at construction and not deleted at destruction of this object.
50  */
51  template<class JClass_t>
53  public JPointer< JChainReader<JClass_t> >
54  {
55  public:
56  /**
57  * Type conversion.
58  *
59  * \return file list
60  */
61  operator JMultipleFileScanner_t() const
62  {
63  if (this->is_valid())
64  return JMultipleFileScanner_t(*this->get());
65  else
66  return JMultipleFileScanner_t();
67  }
68 
69  protected:
70  /**
71  * Default constructor.
72  */
74  JPointer< JChainReader<JClass_t> >(new JChainReader<JClass_t>())
75  {
76  gErrorIgnoreLevel = kError;
77  }
78  };
79 
80 
81  /**
82  * Template definition for direct access of elements in ROOT TChain.
83  *
84  * The optional second template argument is used to the determine the value of an element
85  * which defines the apparent order the elements in the TChain.
86  * It can also provide for a method to find a corresponding entry in the TTree at O(1) look-up time.
87  *
88  * This class implements the JSUPPORT::JTreeScannerInterface interface.
89  */
90  template<class JClass_t = JNullType, class JEvaluator_t = JNullType>
91  class JTreeScanner;
92 
93 
94  /**
95  * Auxiliary base class for reporting messages.
96  */
97  template<>
99  public JMessage< JTreeScanner<> >
100  {
102  };
103 
104 
105  /**
106  * Specialiation of class JTreeScanner for unordered direct access of elements in ROOT TChain.
107  *
108  * The method JROOT::actionAtFileOpen is called at opening of the first file.
109  *
110  * The iteration of elements in the TChain will be in order of appearance.
111  */
112  template<class JDerived_t, class JBase_t>
113  class JTreeScanner<JAssertConversion<JDerived_t, JBase_t>, JNullType> :
114  public virtual JTreeScannerInterface<JBase_t>, // interface
115  public JTreeScanner_t<JDerived_t>, // data source
116  public JTreeScanner<> // messaging
117  {
118  public:
119 
120  typedef JBase_t data_type;
122 
124 
125 
126  /**
127  * Default constructor.
128  */
130  counter(0)
131  {}
132 
133 
134  /**
135  * Constructor.
136  *
137  * \param file_list file list
138  * \param limit limit
139  */
140  JTreeScanner(const JMultipleFileScanner_t& file_list, const JLimit& limit = JLimit()) :
141  counter(0)
142  {
143  this->configure(file_list, limit);
144  }
145 
146 
147  /**
148  * Copy constructor.
149  *
150  * \param input TTree scanner
151  */
153  {
154  this->configure(input, JLimit());
155  }
156 
157 
158  /**
159  * Rewind.
160  */
161  virtual void rewind()
162  {
163  counter = 0;
164  }
165 
166 
167  /**
168  * Check availability of next element.
169  *
170  * \return true if the iteration has more elements.
171  */
172  virtual bool hasNext()
173  {
174  if (counter < this->getLowerLimit()) {
175  skip(this->getLowerLimit() - counter);
176  }
177 
178  return (counter < this->getEntries() &&
179  counter < this->getUpperLimit());
180  }
181 
182 
183  /**
184  * Get next element.
185  *
186  * \return pointer to element.
187  */
188  virtual const pointer_type& next()
189  {
190  if (this->hasNext()) {
191 
192  this->get()->GetEvent(counter++);
193 
194  ps.reset(this->get()->getAddress());
195 
196  } else {
197 
198  ps.reset(NULL);
199  }
200 
201  return ps;
202  }
203 
204 
205  /**
206  * Skip items.
207  *
208  * \param ns number of items to skip
209  * \return number of items skipped
210  */
211  virtual skip_type skip(const skip_type ns)
212  {
213  return JROOT::advance(counter, ns, this->getEntries());
214  }
215 
216 
217  /**
218  * Configure.
219  *
220  * \param file_list file list
221  * \param limit limit
222  */
223  virtual void configure(const JMultipleFileScanner_t& file_list, const JLimit& limit)
224  {
225  using namespace JROOT;
226 
227  this->setLimit(limit);
228 
229  this->rewind();
230 
231  this->get()->Reset();
232 
233  for (JMultipleFileScanner<>::const_iterator i = file_list.begin(); i != file_list.end(); ++i) {
234 
235  TFile* file = TFile::Open(i->c_str());
236 
237  if (file != NULL && file->GetListOfKeys()->Contains(this->get()->getTreeName())) {
238  this->get()->Add(i->c_str());
239  }
240 
241  delete file;
242  }
243 
244  this->getEntries(); // load TTree to set internal file
245 
246  actionAtFileOpen<JDerived_t>(this->get()->GetCurrentFile());
247  actionAtFileOpen<JBase_t> (this->get()->GetCurrentFile());
248  }
249 
250 
251  /**
252  * Get number of entries.
253  *
254  * \return number of entries
255  */
256  virtual Long64_t getEntries() const
257  {
258  return this->get()->GetEntries();
259  }
260 
261 
262  /**
263  * Get entry at given index.
264  *
265  * \param index index
266  * \return pointer to object (may be NULL)
267  */
268  virtual data_type* getEntry(Long64_t index)
269  {
270  if (index >= 0 && index < this->getEntries()) {
271 
272  this->get()->GetEvent(index);
273 
274  return this->get()->getAddress();
275  }
276 
277  return NULL;
278  }
279 
280 
281  /**
282  * Get internal counter.
283  *
284  * \return counter
285  */
286  virtual counter_type getCounter() const
287  {
288  return counter;
289  }
290 
291 
292  /**
293  * Get actual class name.
294  *
295  * \return class name
296  */
297  virtual const char* getClassName() const
298  {
299  return JDerived_t::Class_Name();
300  }
301 
302  protected:
304  private:
306  };
307 
308 
309  /**
310  * Specialiation of class JTreeScanner for unordered direct access of elements in ROOT TChain.
311  *
312  * The iteration of elements in the TChain will be in order of appearance.
313  */
314  template<class JClass_t>
315  struct JTreeScanner<JClass_t, JNullType> :
316  public JTreeScanner<JAssertConversion<JClass_t, JClass_t>, JNullType>
317  {
318  /**
319  * Default constructor.
320  */
322  {}
323 
324 
325  /**
326  * Constructor.
327  *
328  * \param file_list file list
329  * \param limit limit
330  */
331  JTreeScanner(const JMultipleFileScanner_t& file_list, const JLimit& limit = JLimit()) :
332  JTreeScanner<JAssertConversion<JClass_t, JClass_t>, JNullType>(file_list, limit)
333  {}
334 
335 
336  /**
337  * Copy constructor.
338  *
339  * \param input TTree scanner
340  */
341  JTreeScanner(const JTreeScanner& input) :
342  JTreeScanner<JAssertConversion<JClass_t, JClass_t>, JNullType>(input)
343  {}
344  };
345 
346 
347  /**
348  * Specialiation of class JTreeScanner for ordered direct access of elements in ROOT TChain.
349  *
350  * The optional second template argument is used to the determine the value of an element.
351  * The elements in the TChain are then ordered according these values (from low to high).
352  * To this end, the evaluator class should provide for the following operator:
353  * <pre>
354  * double operator()(const JBase_t& element) const;
355  * </pre>
356  * As a result, the iteration of elements in the TChain will then be in the specified order.
357  * It also provides for a method to find a corresponding entry at O(1) look up time.
358  */
359  template<class JDerived_t, class JBase_t, class JEvaluator_t>
360  class JTreeScanner<JAssertConversion<JDerived_t, JBase_t>, JEvaluator_t> :
361  public JTreeScannerInterface<JBase_t, JEvaluator_t>,
362  public JTreeScanner<JAssertConversion<JDerived_t, JBase_t>, JNullType>
363  {
364  /**
365  * Auxiliary data structure for sorting of objects in TChain.
366  */
367  struct JEntry_t {
368  /**
369  * Default constructor.
370  */
372  index(-1),
373  value(0.0)
374  {}
375 
376 
377  /**
378  * Constructor.
379  *
380  * \param __index index
381  * \param __value value
382  */
383  JEntry_t(const Long64_t __index,
384  const double __value) :
385  index(__index),
386  value(__value)
387  {}
388 
389 
390  /**
391  * Comparison between two TChain entries.
392  *
393  * \param first first entry
394  * \param second second entry
395  * \return true if first value less than second; else false
396  */
397  friend inline bool operator<(const JEntry_t& first, const JEntry_t& second)
398  {
399  return first.value < second.value;
400  }
401 
402 
403  /**
404  * Comparison between TChain entry and value.
405  *
406  * \param entry entry
407  * \param value value
408  * \return true if given entry has less value; else false
409  */
410  friend inline bool operator<(const JEntry_t& entry, const double value)
411  {
412  return entry.value < value;
413  }
414 
415 
416  Long64_t index; //!< index in TChain
417  double value; //!< corresponding value
418  };
419 
420 
421  /**
422  * Type definition of internal queue for ordering the elements in the TChain.
423  */
425 
426 
427  public:
428 
429  typedef JBase_t data_type;
431 
435  using JTreeScanner<>::debug;
436 
437 
438  /**
439  * Default constructor.
440  */
442  JTreeScannerInterface<JBase_t, JEvaluator_t>()
443  {}
444 
445 
446  /**
447  * Constructor.
448  *
449  * \param file_list file list
450  * \param evaluator evaluator
451  */
453  const JEvaluator_t& evaluator = JEvaluator_t()) :
454  JTreeScannerInterface<JBase_t, JEvaluator_t>(evaluator)
455  {
456  this->configure(file_list);
457  }
458 
459 
460  /**
461  * Constructor.
462  *
463  * \param file_list file list
464  * \param limit limit
465  * \param evaluator evaluator
466  */
468  const JLimit& limit,
469  const JEvaluator_t& evaluator = JEvaluator_t()) :
470  JTreeScannerInterface<JBase_t, JEvaluator_t>(evaluator)
471  {
472  this->configure(file_list, limit);
473  }
474 
475 
476  /**
477  * Get next element.
478  *
479  * \return pointer to element.
480  */
481  virtual const pointer_type& next()
482  {
483  if (this->hasNext()) {
484 
485  this->get()->GetEvent(queue[this->counter++].index);
486 
487  ps.reset(this->get()->getAddress());
488 
489  } else {
490 
491  ps.reset(NULL);
492  }
493 
494  return ps;
495  }
496 
497 
498  /**
499  * Configure.
500  *
501  * \param file_list file list
502  * \param limit limit
503  */
504  virtual void configure(const JMultipleFileScanner_t& file_list, const JLimit& limit)
505  {
506  using namespace std;
507 
509 
510  setBranchStatus(this->get()->GetBranch(this->get()->getBranchName()), BRANCH_PATTERN, false);
511 
512  queue.resize(this->getEntries());
513 
514  typename queue_type::iterator out = queue.begin();
515 
516  for (Long64_t i = 0; i != this->getEntries(); ++i, ++out) {
517 
518  STATUS(left << setw(24) << this->get()->GetName() << right << ' ' << setw(3) << (100 * (i + 1)) / this->getEntries() << "%\r"); DEBUG(endl);
519 
520  this->get()->GetEvent(i);
521 
522  const data_type* p = this->get()->getAddress();
523 
524  *out = JEntry_t(i, this->JTreeScannerInterface<JBase_t, JEvaluator_t>::getValue(*p));
525  }
526  STATUS(endl);
527 
528  this->get()->SetBranchStatus("*", 1);
529 
530  sort(queue.begin(), queue.end());
531  }
532 
533 
534  /**
535  * Get entry at given index.
536  *
537  * Note that the internal index is set to the given value
538  * so that the subsequent iteration continues from there.
539  *
540  * \param index index
541  * \return pointer to object (may be NULL)
542  */
543  virtual data_type* getEntry(Long64_t index)
544  {
545  if (index >= 0 && index < (Long64_t) queue.size()) {
546 
547  this->get()->GetEvent(queue[index].index);
548 
549  return this->get()->getAddress();
550  }
551 
552  return NULL;
553  }
554 
555 
556  /**
557  * Find index of element that is closest in value to given value.
558  *
559  * A subsequent call to method getEntry() will point to the corresponding object.
560  *
561  * \param value value
562  * \return index (-1 in case of error)
563  */
564  virtual Long64_t find(const double value) const
565  {
566  using namespace std;
567 
568  if (!queue.empty()) {
569 
570  typename queue_type::const_iterator p = lower_bound(queue.begin(), queue.end(), value);
571 
572  if (p == queue.end()) {
573 
574  return queue.size() - 1;
575 
576  } else if (p == queue.begin()) {
577 
578  return 0;
579 
580  } else {
581 
582  typename queue_type::const_iterator q = p--;
583 
584  if (value - p->value < q->value - value)
585  return distance(queue.begin(), p);
586  else
587  return distance(queue.begin(), q);
588  }
589  }
590 
591  return -1;
592  }
593 
594  protected:
595  /**
596  * Set status of branch.
597  *
598  * Note that the status of the branch and all sub-branches with names including given pattern will recursively be set.
599  *
600  * \param branch pointer to branch
601  * \param pattern pattern
602  * \param status status
603  */
604  static void setBranchStatus(TBranch* branch, const char* pattern, const bool status)
605  {
606  using namespace std;
607 
608  if (branch != NULL) {
609 
610  TObjArray* array = branch->GetListOfBranches();
611 
612  for (Int_t i = 0; i != array->GetEntries(); ++i) {
613 
614  TBranch* p = (TBranch*) array->At(i);
615 
616  if (p != NULL && string(p->GetName()).find(pattern) != string::npos) {
617 
618  if (p->GetSplitLevel() == 0) {
619 
620  NOTICE("Set status of branch " << p->GetName() << " to " << status << endl);
621 
622  p->SetStatus(status);
623  }
624  } else {
625 
626  setBranchStatus(p, pattern, status);
627  }
628  }
629  }
630  }
631 
632 
634 
635  private:
637  };
638 
639 
640  /**
641  * Specialiation of class JTreeScanner for ordered direct access of elements in ROOT TChain.
642  */
643  template<class JClass_t, class JEvaluator_t>
644  struct JTreeScanner :
645  public JTreeScanner<JAssertConversion<JClass_t, JClass_t>, JEvaluator_t>
646  {
647  /**
648  * Default constructor.
649  */
651  {}
652 
653 
654  /**
655  * Constructor.
656  *
657  * \param file_list file list
658  * \param evaluator evaluator
659  */
661  const JEvaluator_t& evaluator = JEvaluator_t()) :
662  JTreeScanner<JAssertConversion<JClass_t, JClass_t>, JEvaluator_t>(file_list, evaluator)
663  {}
664 
665 
666  /**
667  * Constructor.
668  *
669  * \param file_list file list
670  * \param limit limit
671  * \param evaluator evaluator
672  */
674  const JLimit& limit,
675  const JEvaluator_t& evaluator = JEvaluator_t()) :
676  JTreeScanner<JAssertConversion<JClass_t, JClass_t>, JEvaluator_t>(file_list, limit, evaluator)
677  {}
678  };
679 }
680 
681 #endif
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::getEntry
virtual data_type * getEntry(Long64_t index)
Get entry at given index.
Definition: JTreeScanner.hh:543
JSUPPORT::JTreeScanner::JTreeScanner
JTreeScanner(const JMultipleFileScanner_t &file_list, const JEvaluator_t &evaluator=JEvaluator_t())
Constructor.
Definition: JTreeScanner.hh:660
JLANG::skip_type
unsigned int skip_type
Type definition for number of objects to skip.
Definition: JObjectIterator.hh:25
JSingleFileScanner.hh
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::JTreeScanner
JTreeScanner(const JMultipleFileScanner_t &file_list, const JEvaluator_t &evaluator=JEvaluator_t())
Constructor.
Definition: JTreeScanner.hh:452
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::next
virtual const pointer_type & next()
Get next element.
Definition: JTreeScanner.hh:481
JTreeScannerInterface.hh
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::JEntry_t::JEntry_t
JEntry_t(const Long64_t __index, const double __value)
Constructor.
Definition: JTreeScanner.hh:383
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::data_type
JBase_t data_type
Definition: JTreeScanner.hh:120
JLANG::JPointer::get
virtual JClass_t * get() const
Get pointer.
Definition: JPointer.hh:64
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
JSUPPORT::JMultipleFileScanner_t
Auxiliary base class for list of file names.
Definition: JMultipleFileScanner.hh:44
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::data_type
JBase_t data_type
Definition: JTreeScanner.hh:429
JROOT
Auxiliary classes and methods for ROOT I/O.
Definition: JAbstractStreamer.hh:13
JCounter.hh
JMessage.hh
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::pointer_type
JTreeScannerInterface< JBase_t, JEvaluator_t >::pointer_type pointer_type
Definition: JTreeScanner.hh:430
JROOT::advance
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
Definition: JCounter.hh:35
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::JEntry_t::operator<
friend bool operator<(const JEntry_t &entry, const double value)
Comparison between TChain entry and value.
Definition: JTreeScanner.hh:410
rewind
std::ostream & rewind(std::ostream &out)
Rewind character.
Definition: JPrint.hh:258
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::ps
pointer_type ps
Definition: JTreeScanner.hh:305
JROOT::JChainReader
Auxiliary class for template TChain reading.
Definition: JChainReader.hh:24
JSUPPORT::JTreeScanner< JClass_t, JNullType >::JTreeScanner
JTreeScanner(const JMultipleFileScanner_t &file_list, const JLimit &limit=JLimit())
Constructor.
Definition: JTreeScanner.hh:331
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::JTreeScanner
JTreeScanner(const JMultipleFileScanner_t &file_list, const JLimit &limit, const JEvaluator_t &evaluator=JEvaluator_t())
Constructor.
Definition: JTreeScanner.hh:467
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::skip
virtual skip_type skip(const skip_type ns)
Skip items.
Definition: JTreeScanner.hh:211
JLANG::JNullType
Auxiliary class for no type definition.
Definition: JNullType.hh:19
std::vector< JEntry_t >
JSUPPORT::JTreeScanner< JClass_t, JNullType >::JTreeScanner
JTreeScanner()
Default constructor.
Definition: JTreeScanner.hh:321
JSUPPORT::JTreeScanner::JTreeScanner
JTreeScanner(const JMultipleFileScanner_t &file_list, const JLimit &limit, const JEvaluator_t &evaluator=JEvaluator_t())
Constructor.
Definition: JTreeScanner.hh:673
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::JEntry_t::index
Long64_t index
index in TChain
Definition: JTreeScanner.hh:416
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::queue
queue_type queue
Definition: JTreeScanner.hh:633
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::JEntry_t::operator<
friend bool operator<(const JEntry_t &first, const JEntry_t &second)
Comparison between two TChain entries.
Definition: JTreeScanner.hh:397
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::JTreeScanner
JTreeScanner()
Default constructor.
Definition: JTreeScanner.hh:441
distance
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Definition: PhysicsEvent.hh:434
NOTICE
#define NOTICE(A)
Definition: JMessage.hh:64
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JSUPPORT::JTreeScanner< JClass_t, JNullType >::JTreeScanner
JTreeScanner(const JTreeScanner &input)
Copy constructor.
Definition: JTreeScanner.hh:341
JLANG::JPointer
Template implementation of class that holds pointer to object(s).
Definition: JPointer.hh:22
debug
int debug
debug level
Definition: JSirene.cc:59
JSUPPORT::JTreeScanner
Template definition for direct access of elements in ROOT TChain.
Definition: JTreeScanner.hh:91
JLANG::JAssertConversion
Auxialiary class to assert type conversion.
Definition: JConversion.hh:66
JSUPPORT::JTreeScannerInterface
Auxiliary interface for direct access of elements in ROOT TChain.
Definition: JTreeScannerInterface.hh:34
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::queue_type
std::vector< JEntry_t > queue_type
Type definition of internal queue for ordering the elements in the TChain.
Definition: JTreeScanner.hh:424
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::ps
pointer_type ps
Definition: JTreeScanner.hh:636
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::setBranchStatus
static void setBranchStatus(TBranch *branch, const char *pattern, const bool status)
Set status of branch.
Definition: JTreeScanner.hh:604
JMultipleFileScanner.hh
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::JEntry_t::value
double value
corresponding value
Definition: JTreeScanner.hh:417
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::getEntry
virtual data_type * getEntry(Long64_t index)
Get entry at given index.
Definition: JTreeScanner.hh:268
STATUS
#define STATUS(A)
Definition: JMessage.hh:63
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::JTreeScanner
JTreeScanner(const JMultipleFileScanner_t &file_list, const JLimit &limit=JLimit())
Constructor.
Definition: JTreeScanner.hh:140
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::configure
virtual void configure(const JMultipleFileScanner_t &file_list, const JLimit &limit)
Configure.
Definition: JTreeScanner.hh:223
JSUPPORT::JTreeScanner_t::JTreeScanner_t
JTreeScanner_t()
Default constructor.
Definition: JTreeScanner.hh:73
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::configure
virtual void configure(const JMultipleFileScanner_t &file_list, const JLimit &limit)
Configure.
Definition: JTreeScanner.hh:504
JSUPPORT::JTreeScanner::JTreeScanner
JTreeScanner()
Default constructor.
Definition: JTreeScanner.hh:650
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::getEntries
virtual Long64_t getEntries() const
Get number of entries.
Definition: JTreeScanner.hh:256
JSUPPORT::JTreeScanner_t
Base class for JTreeScanner.
Definition: JTreeScanner.hh:52
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::hasNext
virtual bool hasNext()
Check availability of next element.
Definition: JTreeScanner.hh:172
JConversion.hh
JSUPPORT::JMultipleFileScanner
General purpose class for object reading from a list of file names.
Definition: JMultipleFileScanner.hh:167
DEBUG
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
std
Definition: jaanetDictionary.h:36
JSUPPORT
Support classes and methods for experiment specific I/O.
Definition: JDataWriter.cc:38
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::JTreeScanner
JTreeScanner()
Default constructor.
Definition: JTreeScanner.hh:129
JNullType.hh
JAANET::get
T get(const JHead &header)
Get object from header.
Definition: JHeadToolkit.hh:295
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::getClassName
virtual const char * getClassName() const
Get actual class name.
Definition: JTreeScanner.hh:297
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::find
virtual Long64_t find(const double value) const
Find index of element that is closest in value to given value.
Definition: JTreeScanner.hh:564
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::pointer_type
JTreeScannerInterface< JBase_t >::pointer_type pointer_type
Definition: JTreeScanner.hh:121
JRootSupportkit.hh
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::counter
counter_type counter
Definition: JTreeScanner.hh:303
JROOT::counter_type
Long64_t counter_type
Type definition for counter.
Definition: JCounter.hh:24
JPointer.hh
JSUPPORT::BRANCH_PATTERN
static const char *const BRANCH_PATTERN
Pattern match for names of sub-branches that will not be read when ordering elements in a TTree.
Definition: JTreeScanner.hh:42
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::getCounter
virtual counter_type getCounter() const
Get internal counter.
Definition: JTreeScanner.hh:286
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::rewind
virtual void rewind()
Rewind.
Definition: JTreeScanner.hh:161
JTOOLS::configure
void configure(const T &value, const JAbstractCollection< JAbscissa_t > &bounds, JBool< false > option)
Configuration of value.
Definition: JToolsToolkit.hh:285
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JEvaluator_t >::JEntry_t::JEntry_t
JEntry_t()
Default constructor.
Definition: JTreeScanner.hh:371
JEEP::JMessage
Auxiliary class for handling debug parameter within a class.
Definition: JMessage.hh:44
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::next
virtual const pointer_type & next()
Get next element.
Definition: JTreeScanner.hh:188
JLANG::JAbstractPointer::is_valid
bool is_valid() const
Check validity of pointer.
Definition: JAbstractPointer.hh:83
JSUPPORT::JTreeScanner< JAssertConversion< JDerived_t, JBase_t >, JNullType >::JTreeScanner
JTreeScanner(const JTreeScanner &input)
Copy constructor.
Definition: JTreeScanner.hh:152
JChainReader.hh