Belle II Software  release-08-01-10
MergeableNamed.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include <calibration/core/MergeableNamed.h>
9 
10 #include <TCollection.h>
11 
12 using namespace Belle2;
13 
14 Long64_t MergeableNamed::Merge(TCollection* hlist)
15 {
16  Long64_t nMerged = 0;
17  if (hlist) {
18  const MergeableNamed* xh = 0;
19  TIter nxh(hlist);
20  while ((xh = dynamic_cast<MergeableNamed*>(nxh()))) {
21  // Add xh to me
22  merge(xh);
23  ++nMerged;
24  }
25  }
26  return nMerged;
27 }
Abstract base class for objects that can be merged but also named.
virtual Long64_t Merge(TCollection *hlist)
Allow merging using TFileMerger if saved directly to a file.
virtual void merge(const MergeableNamed *other)=0
Merge object 'other' into this one.
Abstract base class for different kinds of events.