]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RAW/AliStats.cxx
Remove useless flags...
[u/mrichter/AliRoot.git] / RAW / AliStats.cxx
1 // @(#)alimdc:$Name$:$Id$
2 // Author: Fons Rademakers  26/11/99
3
4 /**************************************************************************
5  * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
6  *                                                                        *
7  * Author: The ALICE Off-line Project.                                    *
8  * Contributors are mentioned in the code where appropriate.              *
9  *                                                                        *
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  **************************************************************************/
18
19 //////////////////////////////////////////////////////////////////////////
20 //                                                                      //
21 // AliStats                                                             //
22 //                                                                      //
23 //////////////////////////////////////////////////////////////////////////
24
25 #include <TH1.h>
26 #include <TFile.h>
27
28 #include "AliRawEvent.h"
29 #include "AliRawEventHeader.h"
30
31 #include "AliStats.h"
32
33
34 ClassImp(AliStats)
35
36
37 //______________________________________________________________________________
38 AliStats::AliStats(const char *filename, Int_t compmode, Bool_t filter)
39 {
40    // Create statistics object.
41
42    fEvents     = 0;
43    fFirstRun   = 0;
44    fFirstEvent = 0;
45    fLastRun    = 0;
46    fLastEvent  = 0;
47    fChunk      = -0.5;
48    fFileName   = filename;
49    fCompMode   = compmode;
50    fFilter     = filter;
51    fRTHist     = 0;
52 }
53
54 //______________________________________________________________________________
55 AliStats::AliStats(const AliStats &rhs): TObject(rhs)
56 {
57    // AliStats copy constructor.
58
59    operator=(rhs);
60 }
61
62 //______________________________________________________________________________
63 AliStats::~AliStats()
64 {
65    // Cleanup stats object.
66
67    delete fRTHist;
68 }
69
70 //______________________________________________________________________________
71 AliStats &AliStats::operator=(const AliStats &rhs)
72 {
73    // AliStats assignment operator.
74
75    if (this != &rhs) {
76       TObject::operator=(rhs);
77       fEvents     = rhs.fEvents;
78       fFirstRun   = rhs.fFirstRun;
79       fFirstEvent = rhs.fFirstEvent;
80       fLastRun    = rhs.fLastRun;
81       fLastEvent  = rhs.fLastEvent;
82       fBegin      = rhs.fBegin;
83       fEnd        = rhs.fEnd;
84       fFileName   = rhs.fFileName;
85       fFileSize   = rhs.fFileSize;
86       fCompFactor = rhs.fCompFactor;
87       fCompMode   = rhs.fCompMode;
88       fFilter     = rhs.fFilter;
89       fRTHist     = rhs.fRTHist ? (TH1F*) rhs.fRTHist->Clone() : 0;
90       fChunk      = rhs.fChunk;
91    }
92    return *this;
93 }
94
95 //______________________________________________________________________________
96 void AliStats::Fill(Float_t time)
97 {
98    // Fill histogram. This histogram shows the (hopefully constant) time
99    // it takes to fill the ROOT DB.
100    // Expects to be called 100 times for each file.
101
102    if (!fRTHist) {
103       fRTHist = new TH1F("rtime","Real-time to write data chunk", 100, 0, 100);
104       fRTHist->SetDirectory(0);
105    }
106
107    fRTHist->Fill(fChunk, time);
108    fChunk += 1.0;
109 }