]>
Commit | Line | Data |
---|---|---|
766aafea | 1 | //-*- Mode: C++ -*- |
2 | /************************************************************************** | |
3 | * This file is property of and copyright by the ALICE HLT Project * | |
4 | * All rights reserved. * | |
5 | * * | |
ce063697 | 6 | * Primary Authors: Svein Lindal * |
766aafea | 7 | * * |
8 | * Permission to use, copy, modify and distribute this software and its * | |
9 | * documentation strictly for non-commercial purposes is hereby granted * | |
10 | * without fee, provided that the above copyright notice appears in all * | |
11 | * copies and that both the copyright notice and this permission notice * | |
12 | * appear in the supporting documentation. The authors make no claims * | |
13 | * about the suitability of this software for any purpose. It is * | |
14 | * provided "as is" without express or implied warranty. * | |
15 | **************************************************************************/ | |
16 | ||
17 | /** | |
18 | * @file AliHLTCaloHistoInvMass | |
ce063697 | 19 | * @author Svein Lindal <slindal@fys.uio.no> |
766aafea | 20 | * @date |
5f9dec50 | 21 | * @brief Produces plots of invariant mass of two clusters. |
766aafea | 22 | */ |
23 | ||
24 | // see header file for class documentation | |
25 | // or | |
26 | // refer to README to build package | |
27 | // or | |
28 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
29 | ||
30 | #include "AliHLTCaloHistoInvMass.h" | |
ce063697 | 31 | #include "AliHLTCaloClusterDataStruct.h" |
766aafea | 32 | #include "TObjArray.h" |
33 | #include "AliESDEvent.h" | |
766aafea | 34 | #include "TRefArray.h" |
35 | #include "TH1F.h" | |
36 | #include "TString.h" | |
ce063697 | 37 | #include "AliESDCaloCluster.h" |
1a530a79 | 38 | #include "TVector3.h" |
39 | #include "TLorentzVector.h" | |
766aafea | 40 | |
41 | AliHLTCaloHistoInvMass::AliHLTCaloHistoInvMass(TString det) : | |
f00fcfff | 42 | fHistTwoClusterInvMass0(NULL), |
43 | fHistTwoClusterInvMass1(NULL), | |
44 | fHistTwoClusterInvMass2(NULL), | |
45 | fHistTwoClusterInvMass3(NULL), | |
46 | fHistTwoClusterInvMass4(NULL) | |
766aafea | 47 | { |
48 | // See header file for documentation | |
15c22d47 | 49 | fHistTwoClusterInvMass0 = new TH1F(Form("%s fHistTwoClusterInvMass0", det.Data()), Form("Invariant mass of two clusters in %s, 1.5 GeV < p_{T} < 2.0", det.Data()), 200, 0, 1); |
f00fcfff | 50 | fHistTwoClusterInvMass0->GetXaxis()->SetTitle("m_{#gamma#gamma} GeV"); |
51 | fHistTwoClusterInvMass0->GetYaxis()->SetTitle("Counts"); | |
52 | fHistTwoClusterInvMass0->SetMarkerStyle(21); | |
53 | fHistArray->AddLast(fHistTwoClusterInvMass0); | |
54 | ||
15c22d47 | 55 | fHistTwoClusterInvMass1 = new TH1F(Form("%s fHistTwoClusterInvMass1", det.Data()), Form("Invariant mass of two clusters in %s, 2.0 GeV < p_{T} < 2.5", det.Data()), 200, 0, 1); |
f00fcfff | 56 | fHistTwoClusterInvMass1->GetXaxis()->SetTitle("m_{#gamma#gamma} GeV"); |
57 | fHistTwoClusterInvMass1->GetYaxis()->SetTitle("Counts"); | |
58 | fHistTwoClusterInvMass1->SetMarkerStyle(21); | |
59 | fHistArray->AddLast(fHistTwoClusterInvMass1); | |
60 | ||
15c22d47 | 61 | fHistTwoClusterInvMass2 = new TH1F(Form("%s fHistTwoClusterInvMass2", det.Data()), Form("Invariant mass of two clusters in %s, 2.5 GeV < p_{T} < 3.0", det.Data()), 200, 0, 1); |
6a6e8a01 | 62 | fHistTwoClusterInvMass2->GetXaxis()->SetTitle("m_{#gamma#gamma} GeV"); |
63 | fHistTwoClusterInvMass2->GetYaxis()->SetTitle("Counts"); | |
64 | fHistTwoClusterInvMass2->SetMarkerStyle(21); | |
65 | fHistArray->AddLast(fHistTwoClusterInvMass2); | |
66 | ||
15c22d47 | 67 | fHistTwoClusterInvMass3 = new TH1F(Form("%s fHistTwoClusterInvMass3", det.Data()), Form("Invariant mass of two clusters in %s, 3.0 GeV < p_{T} < 5.0", det.Data()), 200, 0, 1); |
f00fcfff | 68 | fHistTwoClusterInvMass3->GetXaxis()->SetTitle("m_{#gamma#gamma} GeV"); |
69 | fHistTwoClusterInvMass3->GetYaxis()->SetTitle("Counts"); | |
70 | fHistTwoClusterInvMass3->SetMarkerStyle(21); | |
71 | fHistArray->AddLast(fHistTwoClusterInvMass3); | |
72 | ||
15c22d47 | 73 | fHistTwoClusterInvMass4 = new TH1F(Form("%s fHistTwoClusterInvMass4", det.Data()), Form("Invariant mass of two clusters in %s p_{T} > 5.0 GeV", det.Data()), 200, 0, 1); |
f00fcfff | 74 | fHistTwoClusterInvMass4->GetXaxis()->SetTitle("m_{#gamma#gamma} GeV"); |
75 | fHistTwoClusterInvMass4->GetYaxis()->SetTitle("Counts"); | |
76 | fHistTwoClusterInvMass4->SetMarkerStyle(21); | |
77 | fHistArray->AddLast(fHistTwoClusterInvMass4); | |
78 | ||
6a6e8a01 | 79 | |
766aafea | 80 | } |
81 | ||
82 | AliHLTCaloHistoInvMass::~AliHLTCaloHistoInvMass() | |
83 | { | |
6a6e8a01 | 84 | |
f00fcfff | 85 | if(fHistTwoClusterInvMass0) |
86 | delete fHistTwoClusterInvMass0; | |
87 | fHistTwoClusterInvMass0 = NULL; | |
88 | ||
89 | if(fHistTwoClusterInvMass1) | |
90 | delete fHistTwoClusterInvMass1; | |
91 | fHistTwoClusterInvMass1 = NULL; | |
6a6e8a01 | 92 | |
93 | if(fHistTwoClusterInvMass2) | |
94 | delete fHistTwoClusterInvMass2; | |
95 | fHistTwoClusterInvMass2 = NULL; | |
96 | ||
f00fcfff | 97 | if(fHistTwoClusterInvMass3) |
98 | delete fHistTwoClusterInvMass3; | |
99 | fHistTwoClusterInvMass3 = NULL; | |
100 | ||
101 | if(fHistTwoClusterInvMass4) | |
102 | delete fHistTwoClusterInvMass4; | |
103 | fHistTwoClusterInvMass4 = NULL; | |
104 | ||
6a6e8a01 | 105 | |
ce063697 | 106 | } |
766aafea | 107 | |
ce063697 | 108 | |
109 | Int_t AliHLTCaloHistoInvMass::FillHistograms(Int_t nc, vector<AliHLTCaloClusterDataStruct*> &cVec) { | |
110 | //See header file for documentation | |
111 | ||
112 | Float_t cPos[nc][3]; | |
113 | Float_t cEnergy[nc]; | |
114 | ||
115 | for(int ic = 0; ic < nc; ic++) { | |
116 | AliHLTCaloClusterDataStruct * cluster = cVec.at(ic); | |
117 | cluster->GetPosition(cPos[ic]); | |
118 | cEnergy[ic] = cluster->E(); | |
119 | } | |
120 | ||
6a6e8a01 | 121 | return FillInvariantMassHistograms(nc, cPos, cEnergy); |
766aafea | 122 | } |
123 | ||
6a6e8a01 | 124 | |
125 | ||
ce063697 | 126 | Int_t AliHLTCaloHistoInvMass::FillHistograms(Int_t nc, TRefArray * clusterArray) { |
127 | //See header file for documentation | |
128 | ||
129 | Float_t cPos[nc][3]; | |
130 | Float_t cEnergy[nc]; | |
131 | ||
132 | for(int ic = 0; ic < nc; ic++) { | |
133 | AliESDCaloCluster * cluster = static_cast<AliESDCaloCluster*>(clusterArray->At(ic)); | |
134 | cluster->GetPosition(cPos[ic]); | |
135 | cEnergy[ic] = cluster->E(); | |
136 | } | |
137 | ||
6a6e8a01 | 138 | return FillInvariantMassHistograms(nc, cPos, cEnergy); |
139 | ||
140 | } | |
141 | ||
142 | ||
143 | Int_t AliHLTCaloHistoInvMass::FillInvariantMassHistograms(Int_t nc, Float_t cPos[][3], Float_t cEnergy[]){ | |
144 | ||
145 | Int_t iResult = 0; | |
146 | ||
1a530a79 | 147 | for(Int_t ic = 0; ic<(nc-1); ic++) { |
6a6e8a01 | 148 | |
149 | //BALLE hardcoded variable | |
b54ade95 | 150 | if(cEnergy[ic] < 0.5) |
6a6e8a01 | 151 | continue; |
4ec58661 | 152 | |
153 | //Get momentum vector | |
1a530a79 | 154 | TVector3 iVec(cPos[ic]); |
1a530a79 | 155 | iVec = iVec.Unit(); |
1a530a79 | 156 | iVec = cEnergy[ic] * iVec; |
6a6e8a01 | 157 | |
1a530a79 | 158 | |
159 | for(Int_t jc = ic+1; jc<nc; jc++) { | |
6a6e8a01 | 160 | |
161 | //BALLE hardcoded variable | |
b54ade95 | 162 | if(cEnergy[jc] < 0.5) |
6a6e8a01 | 163 | continue; |
1a530a79 | 164 | |
f00fcfff | 165 | |
6a6e8a01 | 166 | |
167 | ||
4ec58661 | 168 | //Get second momentum vector |
169 | TVector3 jVec(cPos[jc]); | |
1a530a79 | 170 | jVec = jVec.Unit(); |
1a530a79 | 171 | jVec = cEnergy[jc] * jVec; |
6a6e8a01 | 172 | |
4ec58661 | 173 | //Calculate inv mass |
1a530a79 | 174 | Double_t m = TMath::Sqrt( 2 *(cEnergy[ic]* cEnergy[jc] - iVec.Dot(jVec) ) ); |
6a6e8a01 | 175 | |
f00fcfff | 176 | //Fill histograms |
6a6e8a01 | 177 | |
f00fcfff | 178 | Float_t sum = cEnergy[ic]+cEnergy[ic]; |
b54ade95 | 179 | if(sum > 1.5) |
f00fcfff | 180 | { |
b54ade95 | 181 | if(sum > 2.0) |
f00fcfff | 182 | { |
b54ade95 | 183 | if(sum > 2.5) |
f00fcfff | 184 | { |
b54ade95 | 185 | if(sum > 3.0) |
f00fcfff | 186 | { |
b54ade95 | 187 | if(sum > 5.0) |
188 | { | |
189 | fHistTwoClusterInvMass4->Fill(m); | |
190 | } | |
191 | else | |
192 | { | |
193 | fHistTwoClusterInvMass3->Fill(m); | |
194 | } | |
f00fcfff | 195 | } |
196 | else | |
197 | { | |
b54ade95 | 198 | fHistTwoClusterInvMass2->Fill(m); |
f00fcfff | 199 | } |
200 | } | |
201 | else | |
202 | { | |
b54ade95 | 203 | fHistTwoClusterInvMass1->Fill(m); |
f00fcfff | 204 | } |
205 | } | |
206 | else | |
207 | { | |
b54ade95 | 208 | fHistTwoClusterInvMass0->Fill(m); |
f00fcfff | 209 | } |
210 | } | |
ce063697 | 211 | } |
212 | } | |
213 | ||
6a6e8a01 | 214 | return iResult; |
7b5c97a1 | 215 | |
766aafea | 216 | } |
6a6e8a01 | 217 | |
218 | // template <class T> | |
219 | // Int_t AliHLTCaloHistoInvMass::FillHistograms(Int_t nc, vector<T*> clusterVec ) { | |
220 | // Float_t cPos[nc][3]; | |
221 | // Float_t cEnergy[nc]; | |
222 | ||
223 | // for(int ic = 0; ic < nc; ic++) { | |
224 | // T * cluster = cVec.at(ic); | |
225 | // cluster->GetPosition(cPos[ic]); | |
226 | // cEnergy[ic] = cluster->E(); | |
227 | // } | |
228 | ||
229 | ||
230 | // for(Int_t ic = 0; ic<(nc-1); ic++) { | |
231 | ||
232 | // //Get momentum vector | |
233 | // TVector3 iVec(cPos[ic]); | |
234 | // iVec = iVec.Unit(); | |
235 | // iVec = cEnergy[ic] * iVec; | |
236 | ||
237 | ||
238 | // for(Int_t jc = ic+1; jc<nc; jc++) { | |
239 | ||
240 | // //Get second momentum vector | |
241 | // TVector3 jVec(cPos[jc]); | |
242 | // jVec = jVec.Unit(); | |
243 | // jVec = cEnergy[jc] * jVec; | |
244 | ||
245 | // //Calculate inv mass | |
246 | // Double_t m = TMath::Sqrt( 2 *(cEnergy[ic]* cEnergy[jc] - iVec.Dot(jVec) ) ); | |
247 | ||
248 | // //Fill histogram | |
249 | // fHistTwoClusterInvMass->Fill(m); | |
250 | // } | |
251 | // } | |
252 | // } |