9 #ifndef CBM_KRES_FUNCTIONS
10 #define CBM_KRES_FUNCTIONS
17 #include "TLorentzVector.h"
19 #include "TMatrixTSym.h"
22 #define M2E 2.6112004954086e-7
23 #define M2Pion 0.0194798351452
31 TMatrixFSym* covMat =
new TMatrixFSym(3);
34 FairTrackParam neu_track;
39 neu_track.Momentum(momentum);
51 TMatrixFSym* covMat =
new TMatrixFSym(3);
54 FairTrackParam neu_track;
73 TMatrixFSym* covMat =
new TMatrixFSym(3);
76 FairTrackParam neu_track;
83 neu_track.Momentum(momentum);
94 TLorentzVector lorVec1;
97 TLorentzVector lorVec2;
101 sum = lorVec1 + lorVec2;
108 const TVector3 part2) {
109 Double_t energy1 = TMath::Sqrt(part1.Mag2() +
M2E);
110 TLorentzVector lorVec1(part1, energy1);
112 Double_t energy2 = TMath::Sqrt(part2.Mag2() +
M2E);
113 TLorentzVector lorVec2(part2, energy2);
116 sum = lorVec1 + lorVec2;
126 TLorentzVector lorVec1;
129 TLorentzVector lorVec2;
132 TLorentzVector lorVec3;
135 TLorentzVector lorVec4;
139 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
146 const TVector3 part2,
147 const TVector3 part3,
148 const TVector3 part4) {
149 Double_t energy1 = TMath::Sqrt(part1.Mag2() +
M2E);
150 TLorentzVector lorVec1(part1, energy1);
152 Double_t energy2 = TMath::Sqrt(part2.Mag2() +
M2E);
153 TLorentzVector lorVec2(part2, energy2);
155 Double_t energy3 = TMath::Sqrt(part3.Mag2() +
M2E);
156 TLorentzVector lorVec3(part3, energy3);
158 Double_t energy4 = TMath::Sqrt(part4.Mag2() +
M2E);
159 TLorentzVector lorVec4(part4, energy4);
162 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
169 int nofDaughters = 0;
170 for (
size_t i = 0;
i < MC.size();
i++) {
171 int motherId_temp = MC.at(
i)->GetMotherId();
172 if (motherId == motherId_temp) nofDaughters++;
181 const TVector3 electron2) {
184 Double_t energyP = TMath::Sqrt(electron1.Mag2() +
M2E);
185 TLorentzVector lorVecP(electron1, energyP);
187 Double_t energyM = TMath::Sqrt(electron2.Mag2() +
M2E);
188 TLorentzVector lorVecM(electron2, energyM);
190 TVector3 momPair = electron1 + electron2;
191 Double_t energyPair = energyP + energyM;
192 Double_t ptPair = momPair.Perp();
193 Double_t pzPair = momPair.Pz();
195 0.5 * TMath::Log((energyPair + pzPair) / (energyPair - pzPair));
196 Double_t anglePair = lorVecM.Angle(lorVecP.Vect());
197 Double_t theta = 180. * anglePair /
TMath::Pi();
198 Double_t minv = 2. * TMath::Sin(anglePair / 2.)
199 * TMath::Sqrt(electron1.Mag() * electron2.Mag());
213 const TVector3 part2,
214 const TVector3 part3,
215 const TVector3 part4) {
218 Double_t energy1 = TMath::Sqrt(part1.Mag2() +
M2E);
219 TLorentzVector lorVec1(part1, energy1);
221 Double_t energy2 = TMath::Sqrt(part2.Mag2() +
M2E);
222 TLorentzVector lorVec2(part2, energy2);
224 Double_t energy3 = TMath::Sqrt(part3.Mag2() +
M2E);
225 TLorentzVector lorVec3(part3, energy3);
227 Double_t energy4 = TMath::Sqrt(part4.Mag2() +
M2E);
228 TLorentzVector lorVec4(part4, energy4);
231 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
233 TVector3 momPair = part1 + part2 + part3 + part4;
234 Double_t energyPair = energy1 + energy2 + energy3 + energy4;
235 Double_t ptPair = momPair.Perp();
236 Double_t pzPair = momPair.Pz();
238 0.5 * TMath::Log((energyPair + pzPair) / (energyPair - pzPair));
239 Double_t minv = sum.Mag();
252 TVector3 electron2) {
253 Double_t energyP = TMath::Sqrt(electron1.Mag2() +
M2E);
254 TLorentzVector lorVecP(electron1, energyP);
256 Double_t energyM = TMath::Sqrt(electron2.Mag2() +
M2E);
257 TLorentzVector lorVecM(electron2, energyM);
259 Double_t anglePair = lorVecM.Angle(lorVecP.Vect());
260 Double_t theta = 180. * anglePair /
TMath::Pi();
271 Double_t energyP = TMath::Sqrt(electron1.Mag2() +
M2E);
272 TLorentzVector lorVecP(electron1, energyP);
276 Double_t energyM = TMath::Sqrt(electron2.Mag2() +
M2E);
277 TLorentzVector lorVecM(electron2, energyM);
279 Double_t anglePair = lorVecM.Angle(lorVecP.Vect());
280 Double_t theta = 180. * anglePair /
TMath::Pi();
290 TVector3 electron4) {
291 Double_t energy1 = TMath::Sqrt(electron1.Mag2() +
M2E);
292 TLorentzVector lorVec1(electron1, energy1);
294 Double_t energy2 = TMath::Sqrt(electron2.Mag2() +
M2E);
295 TLorentzVector lorVec2(electron2, energy2);
297 Double_t energy3 = TMath::Sqrt(electron3.Mag2() +
M2E);
298 TLorentzVector lorVec3(electron3, energy3);
300 Double_t energy4 = TMath::Sqrt(electron4.Mag2() +
M2E);
301 TLorentzVector lorVec4(electron4, energy4);
303 TLorentzVector lorPhoton1 = lorVec1 + lorVec2;
304 TLorentzVector lorPhoton2 = lorVec3 + lorVec4;
306 Double_t angleBetweenPhotons = lorPhoton1.Angle(lorPhoton2.Vect());
307 Double_t theta = 180. * angleBetweenPhotons /
TMath::Pi();
315 const TVector3 part2El,
316 const TVector3 part3Pion,
317 const TVector3 part4Pion) {
318 Double_t energy1 = TMath::Sqrt(part1El.Mag2() +
M2E);
319 TLorentzVector lorVec1(part1El, energy1);
321 Double_t energy2 = TMath::Sqrt(part2El.Mag2() +
M2E);
322 TLorentzVector lorVec2(part2El, energy2);
324 Double_t energy3 = TMath::Sqrt(part3Pion.Mag2() +
M2Pion);
325 TLorentzVector lorVec3(part3Pion, energy3);
327 Double_t energy4 = TMath::Sqrt(part4Pion.Mag2() +
M2Pion);
328 TLorentzVector lorVec4(part4Pion, energy4);
331 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
344 TLorentzVector lorVec1;
347 TLorentzVector lorVec2;
350 TLorentzVector lorVec3;
353 TLorentzVector lorVec4;
356 TLorentzVector lorVec5;
359 TLorentzVector lorVec6;
363 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4 + lorVec5 + lorVec6;
370 const TVector3 part2El,
371 const TVector3 part3El,
372 const TVector3 part4El,
373 const TVector3 part5Pion,
374 const TVector3 part6Pion) {
375 Double_t energy1 = TMath::Sqrt(part1El.Mag2() +
M2E);
376 TLorentzVector lorVec1(part1El, energy1);
378 Double_t energy2 = TMath::Sqrt(part2El.Mag2() +
M2E);
379 TLorentzVector lorVec2(part2El, energy2);
381 Double_t energy3 = TMath::Sqrt(part3El.Mag2() +
M2E);
382 TLorentzVector lorVec3(part3El, energy3);
384 Double_t energy4 = TMath::Sqrt(part4El.Mag2() +
M2E);
385 TLorentzVector lorVec4(part4El, energy4);
387 Double_t energy5 = TMath::Sqrt(part5Pion.Mag2() +
M2Pion);
388 TLorentzVector lorVec5(part5Pion, energy5);
390 Double_t energy6 = TMath::Sqrt(part6Pion.Mag2() +
M2Pion);
391 TLorentzVector lorVec6(part6Pion, energy6);
394 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4 + lorVec5 + lorVec6;
402 TVector3 electron2) {
403 Double_t energyP = TMath::Sqrt(electron1.Mag2() +
M2Pion);
404 TLorentzVector lorVecP(electron1, energyP);
406 Double_t energyM = TMath::Sqrt(electron2.Mag2() +
M2Pion);
407 TLorentzVector lorVecM(electron2, energyM);
409 Double_t anglePair = lorVecM.Angle(lorVecP.Vect());
410 Double_t theta = 180. * anglePair /
TMath::Pi();
421 Double_t energyP = TMath::Sqrt(electron1.Mag2() +
M2Pion);
422 TLorentzVector lorVecP(electron1, energyP);
426 Double_t energyM = TMath::Sqrt(electron2.Mag2() +
M2Pion);
427 TLorentzVector lorVecM(electron2, energyM);
429 Double_t anglePair = lorVecM.Angle(lorVecP.Vect());
430 Double_t theta = 180. * anglePair /
TMath::Pi();
439 const TVector3 part2,
440 const TVector3 part3,
441 const TVector3 part4) {
444 Double_t energy1 = TMath::Sqrt(part1.Mag2() +
M2E);
445 TLorentzVector lorVec1(part1, energy1);
447 Double_t energy2 = TMath::Sqrt(part2.Mag2() +
M2E);
448 TLorentzVector lorVec2(part2, energy2);
450 Double_t energy3 = TMath::Sqrt(part3.Mag2() +
M2Pion);
451 TLorentzVector lorVec3(part3, energy3);
453 Double_t energy4 = TMath::Sqrt(part4.Mag2() +
M2Pion);
454 TLorentzVector lorVec4(part4, energy4);
457 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
459 TVector3 momPair = part1 + part2 + part3 + part4;
460 Double_t energyPair = energy1 + energy2 + energy3 + energy4;
461 Double_t ptPair = momPair.Perp();
462 Double_t pzPair = momPair.Pz();
464 0.5 * TMath::Log((energyPair + pzPair) / (energyPair - pzPair));
465 Double_t minv = sum.Mag();