3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
8 * for The ALICE HLT Project. *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
19 /** @file AliHLTRunStatistics.cxx
20 @author Jochen Thaeder
22 @brief Base class for run statistics, for all detectors
25 // see header file for class documentation
27 // refer to README to build package
29 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
35 #include "AliHLTRunStatistics.h"
39 ClassImp(AliHLTRunStatistics)
41 AliHLTRunStatistics::AliHLTRunStatistics()
42 : TNamed("HLT", "HLT Run Statistics")
46 // see header file for class documentation
48 // refer to README to build package
50 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
53 AliHLTRunStatistics::AliHLTRunStatistics (const AliHLTRunStatistics& src)
55 , fNEvents(src.fNEvents)
58 // see header file for class documentation
59 for (int i=0; i<src.fMyObjects.GetEntriesFast(); i++) {
60 fMyObjects.Add(src.fMyObjects.Clone());
62 fMyObjects.SetOwner(kTRUE);
65 AliHLTRunStatistics& AliHLTRunStatistics::operator= (const AliHLTRunStatistics& src)
67 // see header file for class documentation
68 this->~AliHLTRunStatistics();
69 new (this) AliHLTRunStatistics(src);
73 AliHLTRunStatistics::~AliHLTRunStatistics()
75 // see header file for class documentation
79 void AliHLTRunStatistics::Print(Option_t* option) const
81 // see header file for class documentation
82 cout << "============ " << GetTitle() << " ============" << endl;
83 cout << "\t" << GetNEvents() << " event(s)" << endl;
84 for (int i=0; i<fMyObjects.GetEntriesFast(); i++) {
85 fMyObjects.Print(option);
87 cout << "==============================================" << endl;
90 void AliHLTRunStatistics::Copy(TObject &object) const
92 // copy this to the specified object
94 AliHLTRunStatistics* pStatistics=dynamic_cast<AliHLTRunStatistics*>(&object);
96 // copy members if target is a AliHLTTriggerDecision
100 // copy the base class
101 TObject::Copy(object);
104 TObject *AliHLTRunStatistics::Clone(const char */*newname*/) const
106 // create a new clone, classname is ignored
108 return new AliHLTRunStatistics(*this);
111 void AliHLTRunStatistics::Clear(Option_t * /*option*/)
118 int AliHLTRunStatistics::Add(const TObject* pObject)
120 // Add clone of object
122 if (!pObject) return -EINVAL;
123 fMyObjects.Add(pObject->Clone());