]>
Commit | Line | Data |
---|---|---|
973a91f8 | 1 | //////////////////////////////////////////////////////////////////////////////// |
2 | // // | |
3 | // AliFemtoCutMonitorCollections - the cut monitor for particles to study // | |
4 | // the difference between reconstructed and true momentum // | |
5 | // // | |
6 | //////////////////////////////////////////////////////////////////////////////// | |
7 | #include "AliFemtoCutMonitorCollections.h" | |
8 | #include "AliFemtoModelHiddenInfo.h" | |
9 | #include "AliFemtoEvent.h" | |
10 | #include <TH1D.h> | |
11 | #include <TH2D.h> | |
12 | #include <TList.h> | |
13 | ||
14 | AliFemtoCutMonitorCollections::AliFemtoCutMonitorCollections(): | |
15 | fCollection1Mult(0), | |
16 | fCollection2Mult(0) | |
17 | { | |
18 | // Default constructor | |
19 | fCollection1Mult = new TH1D("Coll1Mult", "Collection 1 Multiplicity", 5001, -0.5, 5000.5); | |
20 | fCollection2Mult = new TH1D("Coll2Mult","Collection 2 Multiplicity",5001,-0.5,5000.5); | |
21 | } | |
22 | ||
23 | AliFemtoCutMonitorCollections::AliFemtoCutMonitorCollections(const char *aName): | |
24 | fCollection1Mult(0), | |
25 | fCollection2Mult(0) | |
26 | { | |
27 | // Normal constructor | |
28 | char name[200]; | |
29 | snprintf(name, 200, "Coll1Mult%s", aName); | |
30 | fCollection1Mult = new TH1D(name, "Collection 1 Multiplicity", 5001, -0.5, 5000.5); | |
31 | ||
32 | snprintf(name, 200, "Coll2Mult%s", aName); | |
33 | fCollection2Mult = new TH1D(name, "Collection 2 Multiplicity", 5001, -0.5, 5000.5); | |
34 | } | |
35 | ||
36 | AliFemtoCutMonitorCollections::AliFemtoCutMonitorCollections(const AliFemtoCutMonitorCollections &aCut): | |
37 | fCollection1Mult(0), | |
38 | fCollection2Mult(0) | |
39 | { | |
40 | // copy constructor | |
41 | if (fCollection1Mult) delete fCollection1Mult; | |
42 | fCollection1Mult = new TH1D(*aCut.fCollection1Mult); | |
43 | ||
44 | if (fCollection2Mult) delete fCollection2Mult; | |
45 | fCollection2Mult = new TH1D(*aCut.fCollection2Mult); | |
46 | } | |
47 | ||
48 | AliFemtoCutMonitorCollections::~AliFemtoCutMonitorCollections() | |
49 | { | |
50 | // Destructor | |
51 | delete fCollection1Mult; | |
52 | delete fCollection2Mult; | |
53 | } | |
54 | ||
55 | AliFemtoCutMonitorCollections& AliFemtoCutMonitorCollections::operator=(const AliFemtoCutMonitorCollections& aCut) | |
56 | { | |
57 | // assignment operator | |
58 | if (this == &aCut) | |
59 | return *this; | |
60 | ||
61 | if (fCollection1Mult) delete fCollection1Mult; | |
62 | fCollection1Mult = new TH1D(*aCut.fCollection1Mult); | |
63 | ||
64 | if (fCollection2Mult) delete fCollection2Mult; | |
65 | fCollection2Mult = new TH1D(*aCut.fCollection2Mult); | |
66 | ||
67 | return *this; | |
68 | } | |
69 | ||
70 | AliFemtoString AliFemtoCutMonitorCollections::Report(){ | |
71 | // Prepare report from the execution | |
72 | string stemp = "*** AliFemtoCutMonitorCollections report"; | |
73 | AliFemtoString returnThis = stemp; | |
74 | return returnThis; | |
75 | } | |
76 | ||
77 | void AliFemtoCutMonitorCollections::Fill(const AliFemtoParticleCollection* aCollection1,const AliFemtoParticleCollection* aCollection2) | |
78 | { | |
79 | // Fill in the monitor histograms with the values from the current event | |
80 | //cout<<"Monitor collection sizes: "<<aCollection1->size()<<" "<<aCollection2->size()<<endl; | |
81 | fCollection1Mult->Fill(aCollection1->size()); | |
82 | fCollection2Mult->Fill(aCollection2->size()); | |
83 | ||
84 | ||
85 | } | |
86 | ||
87 | void AliFemtoCutMonitorCollections::Write() | |
88 | { | |
89 | // Write out the relevant histograms | |
90 | fCollection1Mult->Write(); | |
91 | fCollection2Mult->Write(); | |
92 | ||
93 | } | |
94 | ||
95 | TList *AliFemtoCutMonitorCollections::GetOutputList() | |
96 | { | |
97 | TList *tOutputList = new TList(); | |
98 | tOutputList->Add(fCollection1Mult); | |
99 | tOutputList->Add(fCollection2Mult); | |
100 | ||
101 | return tOutputList; | |
102 | } | |
103 | ||
104 |