]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnVATProcessInfo.cxx
fixed warnings
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnVATProcessInfo.cxx
CommitLineData
5eb970a4 1//
2// *** Class AliRsnVATProcessInfo ***
3//
4// TODO
4fbb2459 5// TODO
5eb970a4 6//
7// authors: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
8// M. Vala (email: martin.vala@cern.ch)
9//
10
11#include <TList.h>
12#include <TH1.h>
13
14#include "AliLog.h"
15
16#include "AliRsnVATProcessInfo.h"
17
18ClassImp(AliRsnVATProcessInfo)
19
20//_____________________________________________________________________________
4fbb2459 21AliRsnVATProcessInfo::AliRsnVATProcessInfo(const char *name) :
22 TNamed(name,name),
23 fHistUsedEvents(0x0),
24 fEventUsed(kFALSE),
25 fPrintInfoNumber(1000)
5eb970a4 26{
4fbb2459 27//
28// Constructor.
29//
30
31 AliDebug(AliLog::kDebug+2,"<-");
32 AliDebug(AliLog::kDebug+2,"->");
5eb970a4 33}
34
35//_____________________________________________________________________________
4fbb2459 36AliRsnVATProcessInfo::AliRsnVATProcessInfo(const AliRsnVATProcessInfo& copy) :
37 TNamed(copy),
38 fHistUsedEvents(copy.fHistUsedEvents),
39 fEventUsed(copy.fEventUsed),
40 fPrintInfoNumber(copy.fPrintInfoNumber)
5eb970a4 41{
4fbb2459 42//
43// Copy constructor.
44//
45
46 AliDebug(AliLog::kDebug+2,"<-");
47 AliDebug(AliLog::kDebug+2,"->");
5eb970a4 48}
49
50//_____________________________________________________________________________
51AliRsnVATProcessInfo::~AliRsnVATProcessInfo()
52{
4fbb2459 53//
54// Destructor.
55//
56
57 AliDebug(AliLog::kDebug+2,"<-");
58 AliDebug(AliLog::kDebug+2,"->");
5eb970a4 59}
60
4fbb2459 61//_____________________________________________________________________________
62void AliRsnVATProcessInfo::GenerateInfoList(TList *list)
63{
64//
65// Creates a TList containing all objects created in this class.
66// This list will be passe to the AnalysisTask object and will generate
67// a separate directory in the output file, with these informations.
68// This TList will have the same name of this object and will own its content.
69//
70
71 AliDebug(AliLog::kDebug+2,"<-");
5eb970a4 72
4fbb2459 73 // create list
74 AliDebug(AliLog::kWarning,"Doing new TList(), so make sure you delete this list ... ");
75// TList* list = new TList();
76// list->SetName(GetName());
77// list->SetOwner();
5eb970a4 78
4fbb2459 79 // initialize contained objects
80 fHistUsedEvents = new TH1I(GetEventHistogramName(), "Skipped/used events", 2, 0, 2);
5eb970a4 81
4fbb2459 82 // ad objects to list
83 list->Add(fHistUsedEvents);
5eb970a4 84
4fbb2459 85 AliDebug(AliLog::kDebug+2,"->");
5eb970a4 86}
87
4fbb2459 88//_____________________________________________________________________________
89void AliRsnVATProcessInfo::FillInfo()
90{
91//
92// This method defines how the information histograms must be filled.
93// The structure of this class is auto-consistend, but in case of inheritance
94// this method must be modified accordingly.
95// Current implementation uses the 'fEventUsed' flag to choose if the event
96// has been used or not, and increments the corrisponding bin in the related
97// histogram (bin '0' = skipped, bin '1' = used).
98//
99
100 if (fEventUsed)
101 fHistUsedEvents->Fill(1);
102 else
103 fHistUsedEvents->Fill(0);
104}
105
106//_____________________________________________________________________________
107void AliRsnVATProcessInfo::PrintInfo(const Long64_t &num)
108{
109//
110// This method is used in some cases
111// to inform about number of events processed
112//
113
2467e7c3 114 if ((num+1) % fPrintInfoNumber == 0) AliInfo(Form("Events processed %d", (Int_t)num+1));
5eb970a4 115}
116
e79f56bd 117
4fbb2459 118Long64_t AliRsnVATProcessInfo::GetNumerOfEventsProcessed()
119{
120//
121// returns number of events from histogram
122//
123 if (fHistUsedEvents)
124 return fHistUsedEvents->Integral();
125 return 0;
5eb970a4 126}
127