CbmRoot
Loading...
Searching...
No Matches
CbmKresConversionCorrectedPhotons.cxx
Go to the documentation of this file.
1/* Copyright (C) 2018-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Ievgenii Kres, Florian Uhlig [committer] */
4
22
23#include "CbmGlobalTrack.h"
25#include "CbmKresConversionBG.h"
26#include "CbmKresFunctions.h"
27#include "CbmMCTrack.h"
28#include "CbmMvdHit.h"
29#include "CbmRichHit.h"
30#include "CbmRichRing.h"
31#include "CbmRichRingLight.h"
32#include "CbmRichUtil.h"
33#include "CbmStsHit.h"
34#include "CbmStsTrack.h"
35#include "CbmTrackMatchNew.h"
36
37#include "FairRootManager.h"
38
39#include <iostream>
40
41#include "KFParticle.h"
42
43using namespace std;
44
46 : fTrainPhotons(nullptr)
47 , AnnTrainPhotons(0)
48 , fAnnPhotonsSelection(nullptr)
49 , UseAnnPhotons(0)
50 , fGammaCorrection(nullptr)
51 , UseCorrection(0)
52 , corr_all()
53 , corr_two()
54 , corr_onetwo()
55 , thresholdweight(0.)
56 , fMcTracks(nullptr)
57 , fGlobalTracks(nullptr)
58 , fStsTracks(nullptr)
59 , fStsTrackMatches(nullptr)
60 , fRichProjections(nullptr)
61 , fRichRings(nullptr)
62 , fRichRingMatches(nullptr)
63 , fRichHits(nullptr)
64 , fArrayMvdHit(nullptr)
65 , fArrayStsHit(nullptr)
66 , fPrimVertex(nullptr)
67 , fKFVertex()
68 , fTauFit(nullptr)
69 , VStsTrack_minus_Outside()
70 , VMCtracks_minus_Outside()
71 , VRings_minus_Outside()
72 , VStsIndex_minus_Outside()
73 , VRichRing_minus_Outside()
74 , VStsTrack_plus_Outside()
75 , VMCtracks_plus_Outside()
76 , VRings_plus_Outside()
77 , VStsIndex_plus_Outside()
78 , VRichRing_plus_Outside()
79 , VMCtracks_minus_Target()
80 , VStsTrack_minus_Target()
81 , VMomenta_minus_Target()
82 , VRings_minus_Target()
83 , VStsIndex_minus_Target()
84 , VRichRing_minus_Target()
85 , VMCtracks_plus_Target()
86 , VStsTrack_plus_Target()
87 , VMomenta_plus_Target()
88 , VRings_plus_Target()
89 , VStsIndex_plus_Target()
90 , VRichRing_plus_Target()
91 , CDP_LK_EMT_momenta_minus_Target()
92 , CDP_LK_EMT_NofRings_minus_Target()
93 , CDP_LK_EMT_STS_minus_Target()
94 , CDP_LK_EMT_STS_minus_index_Target()
95 , CDP_LK_EMT_momenta_plus_Target()
96 , CDP_LK_EMT_NofRings_plus_Target()
97 , CDP_LK_EMT_STS_plus_Target()
98 , CDP_LK_EMT_STS_plus_index_Target()
99 , CDP_LK_EMT_NofRings_minus_Outside()
100 , CDP_LK_EMT_STS_minus_Outside()
101 , CDP_LK_EMT_STS_minus_index_Outside()
102 , CDP_LK_EMT_NofRings_plus_Outside()
103 , CDP_LK_EMT_STS_plus_Outside()
104 , CDP_LK_EMT_STS_plus_index_Outside()
105 , CDP_EMT_Event_minus_Target()
106 , CDP_EMT_momenta_minus_Target()
107 , CDP_EMT_NofRings_minus_Target()
108 , CDP_EMT_Hits_minus_Target()
109 , CDP_EMT_Event_plus_Target()
110 , CDP_EMT_momenta_plus_Target()
111 , CDP_EMT_NofRings_plus_Target()
112 , CDP_EMT_Hits_plus_Target()
113 , CDP_EMT_Event_minus_Outside()
114 , CDP_EMT_momenta_minus_Outside()
115 , CDP_EMT_KFTrack_minus_Outside()
116 , CDP_EMT_NofRings_minus_Outside()
117 , CDP_EMT_Hits_minus_Outside()
118 , CDP_EMT_Event_plus_Outside()
119 , CDP_EMT_momenta_plus_Outside()
120 , CDP_EMT_KFTrack_plus_Outside()
121 , CDP_EMT_NofRings_plus_Outside()
122 , CDP_EMT_Hits_plus_Outside()
123 , fHistoList_dp_Target()
124 , CMother_PDG_Target(nullptr)
125 , CGrandMother_PDG_Target(nullptr)
126 , fHistoList_dp_Outside()
127 , CMother_PDG_Outside(nullptr)
128 , CGrandMother_PDG_Outside(nullptr)
129 , fHistoList_dp_Both()
130 , CPdg_vs_Distance_for_dp(nullptr)
131 , CP_vs_Distance_for_dp(nullptr)
132 , CDP_AnnTruePairs(nullptr)
133 , CDP_AnnFalsePairs(nullptr)
134 , CDP_AnnTruePairs_AfterCuts(nullptr)
135 , CDP_AnnFalsePairs_AfterCuts(nullptr)
136 , fHistoList_dp_cuts_Both()
137 , CDP_candidates_InvMass_vs_OA_Both(nullptr)
138 , CDP_InvMass_vs_OA_Both(nullptr)
139 , CDP_candidates_InvMass_Both(nullptr)
140 , CDP_InvMass_Both(nullptr)
141 , CDP_candidates_OA_Both(nullptr)
142 , CDP_OA_Both(nullptr)
143 , CDP_candidates_PlaneAngles_last_Both(nullptr)
144 , CDP_PlaneAngles_last_Both(nullptr)
145 , CDP_candidates_PlaneAngles_first_Both(nullptr)
146 , CDP_PlaneAngles_first_Both(nullptr)
147 , fHistoList_dp_cuts_Target()
148 , CDP_candidates_InvMass_vs_OA_Target(nullptr)
149 , CDP_InvMass_vs_OA_Target(nullptr)
150 , CDP_candidates_InvMass_Target(nullptr)
151 , CDP_InvMass_Target(nullptr)
152 , CDP_candidates_OA_Target(nullptr)
153 , CDP_OA_Target(nullptr)
154 , CDP_candidates_PlaneAngles_last_Target(nullptr)
155 , CDP_PlaneAngles_last_Target(nullptr)
156 , CDP_candidates_PlaneAngles_first_Target(nullptr)
157 , CDP_PlaneAngles_first_Target(nullptr)
158 , fHistoList_dp_cuts_Outside()
159 , CDP_candidates_InvMass_vs_OA_Outside(nullptr)
160 , CDP_InvMass_vs_OA_Outside(nullptr)
161 , CDP_candidates_InvMass_Outside(nullptr)
162 , CDP_InvMass_Outside(nullptr)
163 , CDP_candidates_OA_Outside(nullptr)
164 , CDP_OA_Outside(nullptr)
165 , CDP_candidates_PlaneAngles_last_Outside(nullptr)
166 , CDP_PlaneAngles_last_Outside(nullptr)
167 , CDP_candidates_PlaneAngles_first_Outside(nullptr)
168 , CDP_PlaneAngles_first_Outside(nullptr)
169 , fHistoList_dp_all_Target()
170 , CDP_InvMassReco_all_Target(nullptr)
171 , CDP_OpeningAngleReco_all_Target(nullptr)
172 , CDP_Pdg_all_Target(nullptr)
173 , CDP_P_reco_all_Target(nullptr)
174 , CDP_Pt_reco_all_Target(nullptr)
175 , CPh_fromTarget_Pt_reco_all_Target(nullptr)
176 , CPh_fromPions_Pt_reco_all_Target(nullptr)
177 , CPh_fromEtas_Pt_reco_all_Target(nullptr)
178 , CPh_fromDalitz_Pt_reco_all_Target(nullptr)
179 , CPh_fromXi_Pt_reco_all_Target(nullptr)
180 , CPh_fromOther_Pt_reco_all_Target(nullptr)
181 , CPh_twoFromTarget_Pt_reco_all_Target(nullptr)
182 , CPh_fromCombinatorial_Pt_reco_all_Target(nullptr)
183 , CPh_fromConversion_Pt_reco_all_Target(nullptr)
184 , CPh_pt_vs_rap_est_all_Target(nullptr)
185 , CPh_pt_vs_rap_est_corr_all_Target(nullptr)
186 , fHistoList_dp_two_Target()
187 , CDP_InvMassReco_two_Target(nullptr)
188 , CDP_OpeningAngleReco_two_Target(nullptr)
189 , CDP_Pdg_two_Target(nullptr)
190 , CDP_P_reco_two_Target(nullptr)
191 , CDP_Pt_reco_two_Target(nullptr)
192 , CPh_fromTarget_Pt_reco_two_Target(nullptr)
193 , CPh_fromPions_Pt_reco_two_Target(nullptr)
194 , CPh_fromEtas_Pt_reco_two_Target(nullptr)
195 , CPh_fromDalitz_Pt_reco_two_Target(nullptr)
196 , CPh_fromXi_Pt_reco_two_Target(nullptr)
197 , CPh_fromOther_Pt_reco_two_Target(nullptr)
198 , CPh_twoFromTarget_Pt_reco_two_Target(nullptr)
199 , CPh_fromCombinatorial_Pt_reco_two_Target(nullptr)
200 , CPh_fromConversion_Pt_reco_two_Target(nullptr)
201 , CPh_pt_vs_rap_est_two_Target(nullptr)
202 , CPh_pt_vs_rap_est_corr_two_Target(nullptr)
203 , fHistoList_dp_onetwo_Target()
204 , CDP_InvMassReco_onetwo_Target(nullptr)
205 , CDP_OpeningAngleReco_onetwo_Target(nullptr)
206 , CDP_Pdg_onetwo_Target(nullptr)
207 , CDP_P_reco_onetwo_Target(nullptr)
208 , CDP_Pt_reco_onetwo_Target(nullptr)
209 , CPh_fromTarget_Pt_reco_onetwo_Target(nullptr)
210 , CPh_fromPions_Pt_reco_onetwo_Target(nullptr)
211 , CPh_fromEtas_Pt_reco_onetwo_Target(nullptr)
212 , CPh_fromDalitz_Pt_reco_onetwo_Target(nullptr)
213 , CPh_fromXi_Pt_reco_onetwo_Target(nullptr)
214 , CPh_fromOther_Pt_reco_onetwo_Target(nullptr)
215 , CPh_twoFromTarget_Pt_reco_onetwo_Target(nullptr)
216 , CPh_fromCombinatorial_Pt_reco_onetwo_Target(nullptr)
217 , CPh_fromConversion_Pt_reco_onetwo_Target(nullptr)
218 , CPh_pt_vs_rap_est_onetwo_Target(nullptr)
219 , CPh_pt_vs_rap_est_corr_onetwo_Target(nullptr)
220 , fHistoList_dp_all_Outside()
221 , CDP_InvMassReco_all_Outside(nullptr)
222 , CDP_OpeningAngleReco_all_Outside(nullptr)
223 , CDP_Pdg_all_Outside(nullptr)
224 , CDP_P_reco_all_Outside(nullptr)
225 , CDP_Pt_reco_all_Outside(nullptr)
226 , CPh_fromTarget_Pt_reco_all_Outside(nullptr)
227 , CPh_fromPions_Pt_reco_all_Outside(nullptr)
228 , CPh_fromEtas_Pt_reco_all_Outside(nullptr)
229 , CPh_fromDalitz_Pt_reco_all_Outside(nullptr)
230 , CPh_fromXi_Pt_reco_all_Outside(nullptr)
231 , CPh_fromOther_Pt_reco_all_Outside(nullptr)
232 , CPh_twoFromTarget_Pt_reco_all_Outside(nullptr)
233 , CPh_fromCombinatorial_Pt_reco_all_Outside(nullptr)
234 , CPh_fromConversion_Pt_reco_all_Outside(nullptr)
235 , CPh_pt_vs_rap_est_all_Outside(nullptr)
236 , CPh_pt_vs_rap_est_corr_all_Outside(nullptr)
237 , fHistoList_dp_two_Outside()
238 , CDP_InvMassReco_two_Outside(nullptr)
239 , CDP_OpeningAngleReco_two_Outside(nullptr)
240 , CDP_Pdg_two_Outside(nullptr)
241 , CDP_P_reco_two_Outside(nullptr)
242 , CDP_Pt_reco_two_Outside(nullptr)
243 , CPh_fromTarget_Pt_reco_two_Outside(nullptr)
244 , CPh_fromPions_Pt_reco_two_Outside(nullptr)
245 , CPh_fromEtas_Pt_reco_two_Outside(nullptr)
246 , CPh_fromDalitz_Pt_reco_two_Outside(nullptr)
247 , CPh_fromXi_Pt_reco_two_Outside(nullptr)
248 , CPh_fromOther_Pt_reco_two_Outside(nullptr)
249 , CPh_twoFromTarget_Pt_reco_two_Outside(nullptr)
250 , CPh_fromCombinatorial_Pt_reco_two_Outside(nullptr)
251 , CPh_fromConversion_Pt_reco_two_Outside(nullptr)
252 , CPh_pt_vs_rap_est_two_Outside(nullptr)
253 , CPh_pt_vs_rap_est_corr_two_Outside(nullptr)
254 , fHistoList_dp_onetwo_Outside()
255 , CDP_InvMassReco_onetwo_Outside(nullptr)
256 , CDP_OpeningAngleReco_onetwo_Outside(nullptr)
257 , CDP_Pdg_onetwo_Outside(nullptr)
258 , CDP_P_reco_onetwo_Outside(nullptr)
259 , CDP_Pt_reco_onetwo_Outside(nullptr)
260 , CPh_fromTarget_Pt_reco_onetwo_Outside(nullptr)
261 , CPh_fromPions_Pt_reco_onetwo_Outside(nullptr)
262 , CPh_fromEtas_Pt_reco_onetwo_Outside(nullptr)
263 , CPh_fromDalitz_Pt_reco_onetwo_Outside(nullptr)
264 , CPh_fromXi_Pt_reco_onetwo_Outside(nullptr)
265 , CPh_fromOther_Pt_reco_onetwo_Outside(nullptr)
266 , CPh_twoFromTarget_Pt_reco_onetwo_Outside(nullptr)
267 , CPh_fromCombinatorial_Pt_reco_onetwo_Outside(nullptr)
268 , CPh_fromConversion_Pt_reco_onetwo_Outside(nullptr)
269 , CPh_pt_vs_rap_est_onetwo_Outside(nullptr)
270 , CPh_pt_vs_rap_est_corr_onetwo_Outside(nullptr)
271 , fHistoList_dp_all_Both()
272 , CDP_InvMassReco_all_Both(nullptr)
273 , CDP_OpeningAngleReco_all_Both(nullptr)
274 , CDP_Pdg_all_Both(nullptr)
275 , CDP_P_reco_all_Both(nullptr)
276 , CDP_Pt_reco_all_Both(nullptr)
277 , CPh_fromTarget_Pt_reco_all_Both(nullptr)
278 , CPh_fromPions_Pt_reco_all_Both(nullptr)
279 , CPh_fromEtas_Pt_reco_all_Both(nullptr)
280 , CPh_fromDalitz_Pt_reco_all_Both(nullptr)
281 , CPh_fromXi_Pt_reco_all_Both(nullptr)
282 , CPh_fromOther_Pt_reco_all_Both(nullptr)
283 , CPh_twoFromTarget_Pt_reco_all_Both(nullptr)
284 , CPh_fromCombinatorial_Pt_reco_all_Both(nullptr)
285 , CPh_fromConversion_Pt_reco_all_Both(nullptr)
286 , CPh_pt_vs_rap_est_all_Both(nullptr)
287 , CPh_pt_vs_rap_est_corr_all_Both(nullptr)
288 , fHistoList_dp_two_Both()
289 , CDP_InvMassReco_two_Both(nullptr)
290 , CDP_OpeningAngleReco_two_Both(nullptr)
291 , CDP_Pdg_two_Both(nullptr)
292 , CDP_P_reco_two_Both(nullptr)
293 , CDP_Pt_reco_two_Both(nullptr)
294 , CPh_fromTarget_Pt_reco_two_Both(nullptr)
295 , CPh_fromPions_Pt_reco_two_Both(nullptr)
296 , CPh_fromEtas_Pt_reco_two_Both(nullptr)
297 , CPh_fromDalitz_Pt_reco_two_Both(nullptr)
298 , CPh_fromXi_Pt_reco_two_Both(nullptr)
299 , CPh_fromOther_Pt_reco_two_Both(nullptr)
300 , CPh_twoFromTarget_Pt_reco_two_Both(nullptr)
301 , CPh_fromCombinatorial_Pt_reco_two_Both(nullptr)
302 , CPh_fromConversion_Pt_reco_two_Both(nullptr)
303 , CPh_pt_vs_rap_est_two_Both(nullptr)
304 , CPh_pt_vs_rap_est_corr_two_Both(nullptr)
305 , fHistoList_dp_onetwo_Both()
306 , CDP_InvMassReco_onetwo_Both(nullptr)
307 , CDP_OpeningAngleReco_onetwo_Both(nullptr)
308 , CDP_Pdg_onetwo_Both(nullptr)
309 , CDP_P_reco_onetwo_Both(nullptr)
310 , CDP_Pt_reco_onetwo_Both(nullptr)
311 , CPh_fromTarget_Pt_reco_onetwo_Both(nullptr)
312 , CPh_fromPions_Pt_reco_onetwo_Both(nullptr)
313 , CPh_fromEtas_Pt_reco_onetwo_Both(nullptr)
314 , CPh_fromDalitz_Pt_reco_onetwo_Both(nullptr)
315 , CPh_fromXi_Pt_reco_onetwo_Both(nullptr)
316 , CPh_fromOther_Pt_reco_onetwo_Both(nullptr)
317 , CPh_twoFromTarget_Pt_reco_onetwo_Both(nullptr)
318 , CPh_fromCombinatorial_Pt_reco_onetwo_Both(nullptr)
319 , CPh_fromConversion_Pt_reco_onetwo_Both(nullptr)
320 , CPh_pt_vs_rap_est_onetwo_Both(nullptr)
321 , CPh_pt_vs_rap_est_corr_onetwo_Both(nullptr)
322 , CDP_EMT_Pt_all_Target(nullptr)
323 , CDP_EMT_Pt_two_Target(nullptr)
324 , CDP_EMT_Pt_onetwo_Target(nullptr)
325 , CDP_EMT_Pt_all_Outside(nullptr)
326 , CDP_EMT_Pt_two_Outside(nullptr)
327 , CDP_EMT_Pt_onetwo_Outside(nullptr)
328 , CDP_EMT_Pt_all_Both(nullptr)
329 , CDP_EMT_Pt_two_Both(nullptr)
330 , CDP_EMT_Pt_onetwo_Both(nullptr)
331 , CDP_LK_EMT_Pt_all_Target(nullptr)
332 , CDP_LK_EMT_Pt_two_Target(nullptr)
333 , CDP_LK_EMT_Pt_onetwo_Target(nullptr)
334 , CDP_LK_EMT_Pt_all_Outside(nullptr)
335 , CDP_LK_EMT_Pt_two_Outside(nullptr)
336 , CDP_LK_EMT_Pt_onetwo_Outside(nullptr)
337 , CDP_LK_EMT_Pt_all_Both(nullptr)
338 , CDP_LK_EMT_Pt_two_Both(nullptr)
339 , CDP_LK_EMT_Pt_onetwo_Both(nullptr)
340{
341}
342
344
346{
347 FairRootManager* ioman = FairRootManager::Instance();
348 if (nullptr == ioman) { Fatal("CbmKresConversionCorrectedPhotons::Init", "RootManager not instantised!"); }
349
350 fMcTracks = (TClonesArray*) ioman->GetObject("MCTrack");
351 if (nullptr == fMcTracks) { Fatal("CbmKresConversionCorrectedPhotons::Init", "No MCTrack array!"); }
352
353 fPrimVertex = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex."));
354 if (nullptr == fPrimVertex) { fPrimVertex = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex")); }
355 if (nullptr == fPrimVertex) { LOG(fatal) << "CbmKresConversionCorrectedPhotons::Init No PrimaryVertex array!"; }
356
357 fGlobalTracks = (TClonesArray*) ioman->GetObject("GlobalTrack");
358 if (nullptr == fGlobalTracks) { Fatal("CbmKresConversionCorrectedPhotons::Init", "No GlobalTrack array!"); }
359
360 fStsTracks = (TClonesArray*) ioman->GetObject("StsTrack");
361 if (nullptr == fStsTracks) { Fatal("CbmKresConversionCorrectedPhotons::Init", "No StsTrack array!"); }
362
363 fStsTrackMatches = (TClonesArray*) ioman->GetObject("StsTrackMatch");
364 if (nullptr == fStsTrackMatches) { Fatal("CbmKresConversionCorrectedPhotons::Init", "No StsTrackMatch array!"); }
365
366 fRichProjections = (TClonesArray*) ioman->GetObject("RichProjection");
367 if (nullptr == fRichProjections) { Fatal("CbmKresConversionCorrectedPhotons::Init", "No RichProjection array!"); }
368
369 fRichRings = (TClonesArray*) ioman->GetObject("RichRing");
370 if (nullptr == fRichRings) { Fatal("CbmKresConversionCorrectedPhotons::Init", "No RichRing array!"); }
371
372 fRichRingMatches = (TClonesArray*) ioman->GetObject("RichRingMatch");
373 if (nullptr == fRichRingMatches) { Fatal("CbmKresConversionCorrectedPhotons::Init", "No RichRingMatch array!"); }
374
375 fRichHits = (TClonesArray*) ioman->GetObject("RichHit");
376 if (nullptr == fRichHits) { Fatal("CbmKresConversionCorrectedPhotons::Init", "No RichHit array!"); }
377
378 fArrayMvdHit = (TClonesArray*) ioman->GetObject("MvdHit");
379 if (nullptr == fArrayMvdHit) { Fatal("CbmKresConversionCorrectedPhotons::Init", "No MvdHit array!"); }
380
381 fArrayStsHit = (TClonesArray*) ioman->GetObject("StsHit");
382 if (nullptr == fArrayStsHit) { Fatal("CbmKresConversionCorrectedPhotons::Init", "No StsHit array!"); }
383
384
386
388
389 thresholdweight = 500;
390
391 UseCorrection = 1;
392 AnnTrainPhotons = 0;
393
395
396 if (AnnTrainPhotons == 1) {
399 cout << endl;
400 cout << "\t *** CbmKresTrainAnnDirectPhotons ==> is "
401 "activated"
402 << endl;
403 }
404
405
406 if (UseAnnPhotons == 1) {
409 cout << endl;
410 cout << "\t *** CbmKresSelectAnnPhotons ==> is "
411 "activated"
412 << endl;
413 }
414
415 if (UseCorrection == 1) {
418 cout << endl;
419 cout << "\t *** CbmKresGammaCorrection ==> is "
420 "activated"
421 << endl;
422 }
423}
424
425
426void CbmKresConversionCorrectedPhotons::Exec(int fEventNumDP, double OpeningAngleCut, double GammaInvMassCut,
427 int RealPID)
428{
429 cout << "CbmKresConversionCorrectedPhotons, event No. " << fEventNumDP << endl;
430
431 if (fPrimVertex != nullptr) { fKFVertex = CbmKFVertex(*fPrimVertex); }
432 else {
433 Fatal("CbmKresConversionCorrectedPhotons::Exec", "No PrimaryVertex array!");
434 }
435
438 VRings_minus_Outside.clear();
443 VRings_plus_Outside.clear();
446
448 VMomenta_minus_Target.clear();
450 VRings_minus_Target.clear();
453 VMCtracks_plus_Target.clear();
454 VStsTrack_plus_Target.clear();
455 VMomenta_plus_Target.clear();
456 VRings_plus_Target.clear();
457 VStsIndex_plus_Target.clear();
458 VRichRing_plus_Target.clear();
459
460
461 Int_t ngTracks = fGlobalTracks->GetEntriesFast();
462 for (Int_t i = 0; i < ngTracks; i++) {
463 CbmGlobalTrack* gTrack = (CbmGlobalTrack*) fGlobalTracks->At(i);
464 if (nullptr == gTrack) continue;
465 Int_t stsInd = gTrack->GetStsTrackIndex();
466 Int_t richInd = gTrack->GetRichRingIndex();
467
468 if (stsInd < 0) continue;
469 CbmStsTrack* stsTrack = (CbmStsTrack*) fStsTracks->At(stsInd);
470 if (stsTrack == nullptr) continue;
471 CbmTrackMatchNew* stsMatch = (CbmTrackMatchNew*) fStsTrackMatches->At(stsInd);
472 if (stsMatch == nullptr) continue;
473 if (stsMatch->GetNofLinks() <= 0) continue;
474 Int_t stsMcTrackId = stsMatch->GetMatchedLink().GetIndex();
475 if (stsMcTrackId < 0) continue;
476 CbmMCTrack* mcTrack = (CbmMCTrack*) fMcTracks->At(stsMcTrackId);
477 if (mcTrack == nullptr) continue;
478
479
480 FairTrackParam* proj = (FairTrackParam*) fRichProjections->At(i);
481 if (richInd < 0 && proj->GetX() > -115 && proj->GetX() < 115
482 && ((proj->GetY() < -120 && proj->GetY() > -200) || (proj->GetY() > 120 && proj->GetY() < 200)))
483 continue;
484 CbmRichRing* Ring = nullptr;
485 if (richInd > -1) {
486 Ring = static_cast<CbmRichRing*>(fRichRings->At(richInd));
488 if (TMath::Abs(mcTrack->GetPdgCode()) == 11)
490 }
491
492 // Doing fit with Fit To primary Vertex and calculate chi2 to primary vertex
493 double chi2 = 0;
495 fKFVertex.GetRefZ(), chi2);
496 const FairTrackParam* track_par = stsTrack->GetParamFirst();
497 double charge = track_par->GetQp();
498
499
500 if (chi2 != chi2) continue;
501 if (chi2 == 0) continue;
502
503 if (chi2 > 3) { SaveOutsideTracks(mcTrack, stsTrack, charge, stsInd, richInd, stsMcTrackId, Ring); }
504 if (chi2 > 3) continue;
505
506 SaveTargetTracks(mcTrack, stsTrack, Momentum, charge, stsInd, richInd, stsMcTrackId, Ring);
507 }
508
509
510 FindGammasTarget(fEventNumDP, OpeningAngleCut, GammaInvMassCut, RealPID, VMCtracks_minus_Target,
514
515 FindGammasOutside(fEventNumDP, OpeningAngleCut, GammaInvMassCut, RealPID, VMCtracks_minus_Outside,
519
520
521 if (UseAnnPhotons == 1) {
522 int numformix = 1000;
523 if (fEventNumDP % numformix == 0) {
524 CDP_Mixing_Target(OpeningAngleCut, GammaInvMassCut);
529
534 }
535
536 if (fEventNumDP % numformix == 0) {
537 CDP_Mixing_Outside(OpeningAngleCut, GammaInvMassCut);
543
549 }
550
551 // CDP_LK_EMT Target
552 CDP_likesign_Mixing_Target(OpeningAngleCut, GammaInvMassCut);
561
562 // CDP_LK_EMT Outside
563 CDP_likesign_Mixing_Outside(OpeningAngleCut, GammaInvMassCut);
570 }
571}
572
573
575 int stsInd, int richInd, int stsMcTrackId, CbmRichRing* RING)
576{
577 int InRich = FindInRich(richInd, stsMcTrackId);
578 if (charge < 0) {
579 VMCtracks_minus_Outside.push_back(mcTrack1);
580 VStsTrack_minus_Outside.push_back(stsTrack);
581 VRings_minus_Outside.push_back(InRich);
582 VStsIndex_minus_Outside.push_back(stsInd);
583 VRichRing_minus_Outside.push_back(RING);
584 }
585 if (charge > 0) {
586 VMCtracks_plus_Outside.push_back(mcTrack1);
587 VStsTrack_plus_Outside.push_back(stsTrack);
588 VRings_plus_Outside.push_back(InRich);
589 VStsIndex_plus_Outside.push_back(stsInd);
590 VRichRing_plus_Outside.push_back(RING);
591 }
592}
593
595 double charge, int stsInd, int richInd, int stsMcTrackId,
596 CbmRichRing* RING)
597{
598 int InRich = FindInRich(richInd, stsMcTrackId);
599 if (charge < 0) {
600 VMCtracks_minus_Target.push_back(mcTrack1);
601 VStsTrack_minus_Target.push_back(stsTrack);
602 VMomenta_minus_Target.push_back(refmom);
603 VRings_minus_Target.push_back(InRich);
604 VStsIndex_minus_Target.push_back(stsInd);
605 VRichRing_minus_Target.push_back(RING);
606 }
607 if (charge > 0) {
608 VMCtracks_plus_Target.push_back(mcTrack1);
609 VStsTrack_plus_Target.push_back(stsTrack);
610 VMomenta_plus_Target.push_back(refmom);
611 VRings_plus_Target.push_back(InRich);
612 VStsIndex_plus_Target.push_back(stsInd);
613 VRichRing_plus_Target.push_back(RING);
614 }
615}
616
617
619 int EventNumMan, double AngleCut, double InvMassCut, int RealPID, vector<CbmMCTrack*> MCtracks_minus,
620 vector<CbmMCTrack*> MCtracks_plus, vector<CbmStsTrack*> StsTrack_minus, vector<CbmStsTrack*> StsTrack_plus,
621 vector<TVector3> Momenta_minus, vector<TVector3> Momenta_plus, std::vector<int> Rings_minus,
622 std::vector<int> Rings_plus, std::vector<int> stsIndex_minus, std::vector<int> stsIndex_plus,
623 vector<CbmRichRing*> richRing_minus, vector<CbmRichRing*> richRing_plus)
624{
625 for (size_t i = 0; i < Momenta_minus.size(); i++) {
626 for (size_t j = 0; j < Momenta_plus.size(); j++) {
627
628 CbmStsTrack* sts1 = StsTrack_minus.at(i);
629 CbmStsTrack* sts2 = StsTrack_plus.at(j);
630
631 TVector3 part1 = Momenta_minus[i];
632 TVector3 part2 = Momenta_plus[j];
633 CbmMCTrack* part1MC = MCtracks_minus[i];
634 CbmMCTrack* part2MC = MCtracks_plus[j];
635 int sts1_index = stsIndex_minus[i];
636 int sts2_index = stsIndex_plus[j];
637
638 int richcheck_0 = 0;
639 int richcheck_1 = 0;
640 if (RealPID == 1) {
641 // Real PID
642 richcheck_0 = CheckIfElectron(richRing_minus[i], Momenta_minus[i].Mag());
643 richcheck_1 = CheckIfElectron(richRing_plus[j], Momenta_plus[j].Mag());
644 }
645 else {
646 // MC PID
647 richcheck_0 = Rings_minus[i];
648 richcheck_1 = Rings_plus[j];
649 }
650 int richcheck = richcheck_0 + richcheck_1;
651
652 Double_t InvmassReco = CbmKresFunctions::Invmass_2particles_RECO(part1, part2);
653 Double_t OpeningAngle = CbmKresFunctions::CalculateOpeningAngle_Reco(part1, part2);
655
656 if (params.fRapidity != params.fRapidity) continue;
657 if (params.fPt != params.fPt) continue;
658 if (params.fRapidity >= 4) continue;
659 if (params.fPt >= 3) continue;
660
661 double rap_step = 0.4;
662 double pt_step = 0.1;
663 int rap_coef = params.fRapidity / rap_step;
664 int pt_coef = params.fPt / pt_step;
665
666 CDP_candidates_InvMass_vs_OA_Target->Fill(InvmassReco, OpeningAngle);
667 CDP_candidates_InvMass_vs_OA_Both->Fill(InvmassReco, OpeningAngle);
668 CDP_candidates_InvMass_Target->Fill(InvmassReco);
669 CDP_candidates_InvMass_Both->Fill(InvmassReco);
670 CDP_candidates_OA_Target->Fill(OpeningAngle);
671 CDP_candidates_OA_Both->Fill(OpeningAngle);
672
673 double PlaneAngle_last = CalculatePlaneAngle_last(sts1, sts2);
674 double PlaneAngle_first = CalculatePlaneAngle_first(sts1, sts2);
675
676 int IdForANN = 0; // 0 - means wrong pair combination; 1 - means correct pair
677 if (part1MC->GetMotherId() == part2MC->GetMotherId() && part1MC->GetMotherId() != -1) {
678 CbmMCTrack* mcTrackmama = (CbmMCTrack*) fMcTracks->At(part1MC->GetMotherId());
679 if (mcTrackmama->GetMotherId() == -1 && mcTrackmama->GetPdgCode() == 22) {
680 IdForANN = 1;
681 CDP_InvMass_Target->Fill(InvmassReco);
682 CDP_InvMass_Both->Fill(InvmassReco);
683 CDP_OA_Target->Fill(OpeningAngle);
684 CDP_OA_Both->Fill(OpeningAngle);
685 CDP_InvMass_vs_OA_Target->Fill(InvmassReco, OpeningAngle);
686 CDP_InvMass_vs_OA_Both->Fill(InvmassReco, OpeningAngle);
687 CDP_PlaneAngles_last_Target->Fill(PlaneAngle_last);
688 CDP_PlaneAngles_last_Both->Fill(PlaneAngle_last);
689 CDP_PlaneAngles_first_Target->Fill(PlaneAngle_first);
690 CDP_PlaneAngles_first_Both->Fill(PlaneAngle_first);
691 }
692 }
693
694 // run ANN
695 if (AnnTrainPhotons == 1) {
696 fTrainPhotons->Exec(EventNumMan, IdForANN, InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(),
697 part1, part2);
698 continue;
699 }
700
701 double AnnValue = 999;
702 if (UseAnnPhotons == 1) {
703 AnnValue =
704 fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(), part1, part2);
705 if (IdForANN == 1) CDP_AnnTruePairs->Fill(AnnValue);
706 if (IdForANN == 0) CDP_AnnFalsePairs->Fill(AnnValue);
707 }
708
709
710 CDP_candidates_PlaneAngles_last_Target->Fill(PlaneAngle_last);
711 CDP_candidates_PlaneAngles_last_Both->Fill(PlaneAngle_last);
712 CDP_candidates_PlaneAngles_first_Target->Fill(PlaneAngle_first);
713 CDP_candidates_PlaneAngles_first_Both->Fill(PlaneAngle_first);
714
715
716 // cuts
717 if (TMath::Abs(OpeningAngle) > AngleCut) continue;
718 if (TMath::Abs(InvmassReco) > InvMassCut) continue;
719 // if (AnnValue < 0.9 || AnnValue > 1.1) continue;
720
721 int fromPions = 0;
722 int fromEta = 0;
723 int fromFireball = 0;
724 int fromDalitz = 0;
725 int fromXi = 0;
726 int fromOther = 0;
727 int fromCombinatorial = 0;
728 int fromConversion = 0;
729 int twoFromTarget = 0;
730 if (part1MC->GetMotherId() == part2MC->GetMotherId() && part1MC->GetMotherId() != -1) {
731 CbmMCTrack* mcTrackmama = (CbmMCTrack*) fMcTracks->At(part1MC->GetMotherId());
732 if (mcTrackmama->GetPdgCode() == 22) {
733 if (mcTrackmama->GetMotherId() == -1) { fromFireball = 1; }
734 else {
735 CbmMCTrack* mcTrackGrmama = (CbmMCTrack*) fMcTracks->At(mcTrackmama->GetMotherId());
736 if (mcTrackGrmama->GetPdgCode() == 111) fromPions = 1;
737 if (mcTrackGrmama->GetPdgCode() == 221) fromEta = 1;
738 if (mcTrackGrmama->GetPdgCode() == 3212) fromXi = 1;
739 fromConversion = 1;
740 }
741 }
742 else {
743 if (mcTrackmama->GetPdgCode() == 111) fromDalitz = 1;
744 if (mcTrackmama->GetPdgCode() != 111) fromOther = 1;
745 }
746 }
747 else if (part1MC->GetMotherId() == part2MC->GetMotherId() && part1MC->GetMotherId() == -1) {
748 twoFromTarget = 1;
749 }
750 else {
751 fromCombinatorial = 1;
752 }
753
754
755 if (part1MC->GetMotherId() == part2MC->GetMotherId() && part1MC->GetMotherId() != -1) {
756 CbmMCTrack* mcTrackmama = (CbmMCTrack*) fMcTracks->At(part1MC->GetMotherId());
757 CMother_PDG_Target->Fill(mcTrackmama->GetPdgCode());
758 if (mcTrackmama->GetPdgCode() == 22) {
759 if (mcTrackmama->GetMotherId() == -1) { CGrandMother_PDG_Target->Fill(mcTrackmama->GetMotherId()); }
760 else {
761 CbmMCTrack* mcTrackGrmama = (CbmMCTrack*) fMcTracks->At(mcTrackmama->GetMotherId());
762 CGrandMother_PDG_Target->Fill(TMath::Abs(mcTrackGrmama->GetPdgCode()));
763 }
764 }
765 }
766
767
768 if (IdForANN == 1) CDP_AnnTruePairs_AfterCuts->Fill(AnnValue);
769 if (IdForANN == 0) CDP_AnnFalsePairs_AfterCuts->Fill(AnnValue);
770
771
772 // for event mixing CDP
773 std::vector<TVector3> minusTrack = SaveAllHits(sts1);
774 std::vector<TVector3> plusTrack = SaveAllHits(sts2);
775
776 CDP_EMT_Event_minus_Target.push_back(EventNumMan);
777 CDP_EMT_momenta_minus_Target.push_back(part1);
778 CDP_EMT_NofRings_minus_Target.push_back(richcheck_0);
779 CDP_EMT_Hits_minus_Target.push_back(minusTrack);
780
781 CDP_EMT_Event_plus_Target.push_back(EventNumMan);
782 CDP_EMT_momenta_plus_Target.push_back(part2);
783 CDP_EMT_NofRings_plus_Target.push_back(richcheck_1);
784 CDP_EMT_Hits_plus_Target.push_back(plusTrack);
785
786 // CDP_LK_EMT
787 CDP_LK_EMT_momenta_minus_Target.push_back(part1);
788 CDP_LK_EMT_NofRings_minus_Target.push_back(richcheck_0);
789 CDP_LK_EMT_STS_minus_Target.push_back(sts1);
790 CDP_LK_EMT_STS_minus_index_Target.push_back(sts1_index);
791
792 CDP_LK_EMT_momenta_plus_Target.push_back(part2);
793 CDP_LK_EMT_NofRings_plus_Target.push_back(richcheck_1);
794 CDP_LK_EMT_STS_plus_Target.push_back(sts2);
795 CDP_LK_EMT_STS_plus_index_Target.push_back(sts2_index);
796
797
798 // everything (RICH == 0, RICH == 1, RICH == 2) together
799 if (richcheck == 0 || richcheck == 1 || richcheck == 2) {
800 double weight_all = 0;
801 if (corr_all[rap_coef][pt_coef] != 0) weight_all = 1 / corr_all[rap_coef][pt_coef];
802 if (weight_all > thresholdweight) weight_all = 0;
803 CDP_InvMassReco_all_Target->Fill(InvmassReco, weight_all);
804 CDP_OpeningAngleReco_all_Target->Fill(OpeningAngle, weight_all);
805 CDP_Pdg_all_Target->Fill(TMath::Abs(part1MC->GetPdgCode()));
806 CDP_Pdg_all_Target->Fill(TMath::Abs(part2MC->GetPdgCode()));
807 CDP_P_reco_all_Target->Fill(params.fMomentumMag, weight_all);
808 CDP_Pt_reco_all_Target->Fill(params.fPt, weight_all);
809 CDP_InvMassReco_all_Both->Fill(InvmassReco, weight_all);
810 CDP_OpeningAngleReco_all_Both->Fill(OpeningAngle, weight_all);
811 CDP_Pdg_all_Both->Fill(TMath::Abs(part1MC->GetPdgCode()));
812 CDP_Pdg_all_Both->Fill(TMath::Abs(part2MC->GetPdgCode()));
813 CDP_P_reco_all_Both->Fill(params.fMomentumMag, weight_all);
814 CDP_Pt_reco_all_Both->Fill(params.fPt, weight_all);
815 if (fromFireball == 1) {
816 CPh_fromTarget_Pt_reco_all_Target->Fill(params.fPt, weight_all);
817 CPh_fromTarget_Pt_reco_all_Both->Fill(params.fPt, weight_all);
818 CPh_pt_vs_rap_est_all_Target->Fill(params.fRapidity, params.fPt);
819 CPh_pt_vs_rap_est_all_Both->Fill(params.fRapidity, params.fPt);
820 CPh_pt_vs_rap_est_corr_all_Target->Fill(params.fRapidity, params.fPt, weight_all);
821 CPh_pt_vs_rap_est_corr_all_Both->Fill(params.fRapidity, params.fPt, weight_all);
822 }
823 if (fromPions == 1) {
824 CPh_fromPions_Pt_reco_all_Target->Fill(params.fPt, weight_all);
825 CPh_fromPions_Pt_reco_all_Both->Fill(params.fPt, weight_all);
826 }
827 if (fromEta == 1) {
828 CPh_fromEtas_Pt_reco_all_Target->Fill(params.fPt, weight_all);
829 CPh_fromEtas_Pt_reco_all_Both->Fill(params.fPt, weight_all);
830 }
831 if (fromDalitz == 1) {
832 CPh_fromDalitz_Pt_reco_all_Target->Fill(params.fPt, weight_all);
833 CPh_fromDalitz_Pt_reco_all_Both->Fill(params.fPt, weight_all);
834 }
835 if (fromXi == 1) {
836 CPh_fromXi_Pt_reco_all_Target->Fill(params.fPt, weight_all);
837 CPh_fromXi_Pt_reco_all_Both->Fill(params.fPt, weight_all);
838 }
839 if (fromOther == 1) {
840 CPh_fromOther_Pt_reco_all_Target->Fill(params.fPt, weight_all);
841 CPh_fromOther_Pt_reco_all_Both->Fill(params.fPt, weight_all);
842 }
843 if (fromCombinatorial == 1) {
844 CPh_fromCombinatorial_Pt_reco_all_Target->Fill(params.fPt, weight_all);
845 CPh_fromCombinatorial_Pt_reco_all_Both->Fill(params.fPt, weight_all);
846 }
847 if (fromConversion == 1) {
848 CPh_fromConversion_Pt_reco_all_Target->Fill(params.fPt, weight_all);
849 CPh_fromConversion_Pt_reco_all_Both->Fill(params.fPt, weight_all);
850 }
851 if (twoFromTarget == 1) {
852 CPh_twoFromTarget_Pt_reco_all_Target->Fill(params.fPt, weight_all);
853 CPh_twoFromTarget_Pt_reco_all_Both->Fill(params.fPt, weight_all);
854 }
855 }
856
857 // only cases, when RICH == 2
858 if (richcheck == 2) {
859 double weight_two = 0;
860 if (corr_two[rap_coef][pt_coef] != 0) weight_two = 1 / corr_two[rap_coef][pt_coef];
861 if (weight_two > thresholdweight) weight_two = 0;
862 CDP_InvMassReco_two_Target->Fill(InvmassReco, weight_two);
863 CDP_OpeningAngleReco_two_Target->Fill(OpeningAngle, weight_two);
864 CDP_Pdg_two_Target->Fill(TMath::Abs(part1MC->GetPdgCode()));
865 CDP_Pdg_two_Target->Fill(TMath::Abs(part2MC->GetPdgCode()));
866 CDP_P_reco_two_Target->Fill(params.fMomentumMag, weight_two);
867 CDP_Pt_reco_two_Target->Fill(params.fPt, weight_two);
868 CDP_InvMassReco_two_Both->Fill(InvmassReco, weight_two);
869 CDP_OpeningAngleReco_two_Both->Fill(OpeningAngle, weight_two);
870 CDP_Pdg_two_Both->Fill(TMath::Abs(part1MC->GetPdgCode()));
871 CDP_Pdg_two_Both->Fill(TMath::Abs(part2MC->GetPdgCode()));
872 CDP_P_reco_two_Both->Fill(params.fMomentumMag, weight_two);
873 CDP_Pt_reco_two_Both->Fill(params.fPt, weight_two);
874 if (fromFireball == 1) {
875 CPh_fromTarget_Pt_reco_two_Target->Fill(params.fPt, weight_two);
876 CPh_fromTarget_Pt_reco_two_Both->Fill(params.fPt, weight_two);
877 CPh_pt_vs_rap_est_two_Target->Fill(params.fRapidity, params.fPt);
878 CPh_pt_vs_rap_est_two_Both->Fill(params.fRapidity, params.fPt);
879 CPh_pt_vs_rap_est_corr_two_Target->Fill(params.fRapidity, params.fPt, weight_two);
880 CPh_pt_vs_rap_est_corr_two_Both->Fill(params.fRapidity, params.fPt, weight_two);
881 }
882 if (fromPions == 1) {
883 CPh_fromPions_Pt_reco_two_Target->Fill(params.fPt, weight_two);
884 CPh_fromPions_Pt_reco_two_Both->Fill(params.fPt, weight_two);
885 }
886 if (fromEta == 1) {
887 CPh_fromEtas_Pt_reco_two_Target->Fill(params.fPt, weight_two);
888 CPh_fromEtas_Pt_reco_two_Both->Fill(params.fPt, weight_two);
889 }
890 if (fromDalitz == 1) {
891 CPh_fromDalitz_Pt_reco_two_Target->Fill(params.fPt, weight_two);
892 CPh_fromDalitz_Pt_reco_two_Both->Fill(params.fPt, weight_two);
893 }
894 if (fromXi == 1) {
895 CPh_fromXi_Pt_reco_two_Target->Fill(params.fPt, weight_two);
896 CPh_fromXi_Pt_reco_two_Both->Fill(params.fPt, weight_two);
897 }
898 if (fromOther == 1) {
899 CPh_fromOther_Pt_reco_two_Target->Fill(params.fPt, weight_two);
900 CPh_fromOther_Pt_reco_two_Both->Fill(params.fPt, weight_two);
901 }
902 if (fromCombinatorial == 1) {
903 CPh_fromCombinatorial_Pt_reco_two_Target->Fill(params.fPt, weight_two);
904 CPh_fromCombinatorial_Pt_reco_two_Both->Fill(params.fPt, weight_two);
905 }
906 if (fromConversion == 1) {
907 CPh_fromConversion_Pt_reco_two_Target->Fill(params.fPt, weight_two);
908 CPh_fromConversion_Pt_reco_two_Both->Fill(params.fPt, weight_two);
909 }
910 if (twoFromTarget == 1) {
911 CPh_twoFromTarget_Pt_reco_two_Target->Fill(params.fPt, weight_two);
912 CPh_twoFromTarget_Pt_reco_two_Both->Fill(params.fPt, weight_two);
913 }
914 }
915
916 // cases, when RICH == 1 or RICH == 2 together
917 if (richcheck == 1 || richcheck == 2) {
918 double weight_onetwo = 0;
919 if (corr_onetwo[rap_coef][pt_coef] != 0) weight_onetwo = 1 / corr_onetwo[rap_coef][pt_coef];
920 if (weight_onetwo > thresholdweight) weight_onetwo = 0;
921 // cout << "Rapidity = " << params.fRapidity << "; Pt = " << params.fPt << endl;
922 // cout << "rap_coef = " << rap_coef << "; pt_coef = " << pt_coef << "; correction factor is " << corr_onetwo[rap_coef][pt_coef] << endl;
923 CDP_InvMassReco_onetwo_Target->Fill(InvmassReco, weight_onetwo);
924 CDP_OpeningAngleReco_onetwo_Target->Fill(OpeningAngle, weight_onetwo);
925 CDP_Pdg_onetwo_Target->Fill(TMath::Abs(part1MC->GetPdgCode()));
926 CDP_Pdg_onetwo_Target->Fill(TMath::Abs(part2MC->GetPdgCode()));
927 CDP_P_reco_onetwo_Target->Fill(params.fMomentumMag, weight_onetwo);
928 CDP_Pt_reco_onetwo_Target->Fill(params.fPt, weight_onetwo);
929 CDP_InvMassReco_onetwo_Both->Fill(InvmassReco, weight_onetwo);
930 CDP_OpeningAngleReco_onetwo_Both->Fill(OpeningAngle, weight_onetwo);
931 CDP_Pdg_onetwo_Both->Fill(TMath::Abs(part1MC->GetPdgCode()));
932 CDP_Pdg_onetwo_Both->Fill(TMath::Abs(part2MC->GetPdgCode()));
933 CDP_P_reco_onetwo_Both->Fill(params.fMomentumMag, weight_onetwo);
934 CDP_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
935 if (fromFireball == 1) {
936 CPh_fromTarget_Pt_reco_onetwo_Target->Fill(params.fPt, weight_onetwo);
937 CPh_fromTarget_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
938 CPh_pt_vs_rap_est_onetwo_Target->Fill(params.fRapidity, params.fPt);
939 CPh_pt_vs_rap_est_onetwo_Both->Fill(params.fRapidity, params.fPt);
940 CPh_pt_vs_rap_est_corr_onetwo_Target->Fill(params.fRapidity, params.fPt, weight_onetwo);
941 CPh_pt_vs_rap_est_corr_onetwo_Both->Fill(params.fRapidity, params.fPt, weight_onetwo);
942 }
943 if (fromPions == 1) {
944 CPh_fromPions_Pt_reco_onetwo_Target->Fill(params.fPt, weight_onetwo);
945 CPh_fromPions_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
946 }
947 if (fromEta == 1) {
948 CPh_fromEtas_Pt_reco_onetwo_Target->Fill(params.fPt, weight_onetwo);
949 CPh_fromEtas_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
950 }
951 if (fromDalitz == 1) {
952 CPh_fromDalitz_Pt_reco_onetwo_Target->Fill(params.fPt, weight_onetwo);
953 CPh_fromDalitz_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
954 }
955 if (fromXi == 1) {
956 CPh_fromXi_Pt_reco_onetwo_Target->Fill(params.fPt, weight_onetwo);
957 CPh_fromXi_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
958 }
959 if (fromOther == 1) {
960 CPh_fromOther_Pt_reco_onetwo_Target->Fill(params.fPt, weight_onetwo);
961 CPh_fromOther_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
962 }
963 if (fromCombinatorial == 1) {
964 CPh_fromCombinatorial_Pt_reco_onetwo_Target->Fill(params.fPt, weight_onetwo);
965 CPh_fromCombinatorial_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
966 }
967 if (fromConversion == 1) {
968 CPh_fromConversion_Pt_reco_onetwo_Target->Fill(params.fPt, weight_onetwo);
969 CPh_fromConversion_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
970 }
971 if (twoFromTarget == 1) {
972 CPh_twoFromTarget_Pt_reco_onetwo_Target->Fill(params.fPt, weight_onetwo);
973 CPh_twoFromTarget_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
974 }
975 }
976 }
977 }
978}
979
980
982 int EventNumMan, double AngleCut, double InvMassCut, int RealPID, vector<CbmMCTrack*> MCtracks_minus_Outside,
983 vector<CbmMCTrack*> MCtracks_plus_Outside, vector<CbmStsTrack*> StsTrack_minus_Outside,
984 vector<CbmStsTrack*> StsTrack_plus_Outside, std::vector<int> Rings_minus_Outside, std::vector<int> Rings_plus_Outside,
985 std::vector<int> stsIndex_minus_Outside, std::vector<int> /*stsIndex_plus_Outside*/,
986 vector<CbmRichRing*> richRing_minus_Outside, vector<CbmRichRing*> richRing_plus_Outside)
987{
988 for (size_t i = 0; i < StsTrack_minus_Outside.size(); i++) {
989 for (size_t j = 0; j < StsTrack_plus_Outside.size(); j++) {
990
991 CbmStsTrack* part1STS = StsTrack_minus_Outside[i];
992 CbmStsTrack* part2STS = StsTrack_plus_Outside[j];
993 CbmMCTrack* part1MC = MCtracks_minus_Outside[i];
994 CbmMCTrack* part2MC = MCtracks_plus_Outside[j];
995 int sts1_index = stsIndex_minus_Outside[i];
996 // int sts2_index = stsIndex_plus_Outside[j];
997
998 KFParticle electron;
1000 KFParticle positron;
1001 CbmKFParticleInterface::SetKFParticleFromStsTrack(part2STS, &positron, -11);
1002 const KFParticle* daughters[2] = {&electron, &positron};
1003 KFParticle intersection;
1004 intersection.Construct(daughters, 2);
1005
1006 if (intersection.GetZ() > 75 || intersection.GetZ() < -5) continue; // kick weird intersections
1007
1008 // fit to the vertex fitter
1009 TVector3 part1 =
1010 CbmKresFunctions::FitToVertex(part1STS, intersection.GetX(), intersection.GetY(), intersection.GetZ());
1011 TVector3 part2 =
1012 CbmKresFunctions::FitToVertex(part2STS, intersection.GetX(), intersection.GetY(), intersection.GetZ());
1013
1014 // TVector3 part1(electron.KFParticleBase::Px(), electron.KFParticleBase::Py(), electron.KFParticleBase::Pz());
1015 // TVector3 part2(positron.KFParticleBase::Px(), positron.KFParticleBase::Py(), positron.KFParticleBase::Pz());
1016
1017 int richcheck = 0;
1018 int richcheck_0 = 0;
1019 int richcheck_1 = 0;
1020 if (RealPID == 1) {
1021 // Real PID
1022 richcheck_0 = CheckIfElectron(richRing_minus_Outside[i], part1.Mag());
1023 richcheck_1 = CheckIfElectron(richRing_plus_Outside[j], part2.Mag());
1024 richcheck = richcheck_0 + richcheck_1;
1025 }
1026 else {
1027 // MC PID
1028 richcheck = Rings_minus_Outside[i] + Rings_plus_Outside[j];
1029 }
1030
1031
1032 Double_t InvmassReco = CbmKresFunctions::Invmass_2particles_RECO(part1, part2);
1033 Double_t OpeningAngle = CbmKresFunctions::CalculateOpeningAngle_Reco(part1, part2);
1035
1036 if (params.fRapidity != params.fRapidity) continue;
1037 if (params.fPt != params.fPt) continue;
1038 if (params.fRapidity >= 4) continue;
1039 if (params.fPt >= 3) continue;
1040
1041 double rap_step = 0.4;
1042 double pt_step = 0.1;
1043 int rap_coef = params.fRapidity / rap_step;
1044 int pt_coef = params.fPt / pt_step;
1045
1046 CDP_candidates_InvMass_vs_OA_Outside->Fill(InvmassReco, OpeningAngle);
1047 CDP_candidates_InvMass_vs_OA_Both->Fill(InvmassReco, OpeningAngle);
1048 CDP_candidates_InvMass_Outside->Fill(InvmassReco);
1049 CDP_candidates_InvMass_Both->Fill(InvmassReco);
1050 CDP_candidates_OA_Outside->Fill(OpeningAngle);
1051 CDP_candidates_OA_Both->Fill(OpeningAngle);
1052
1053 double PlaneAngle_last = CalculatePlaneAngle_last(part1STS, part2STS);
1054 double PlaneAngle_first = CalculatePlaneAngle_first(part1STS, part2STS);
1055
1056 int IdForANN = 0; // 0 - means wrong pair combination; 1 - means correct pair
1057 if (part1MC->GetMotherId() == part2MC->GetMotherId() && part1MC->GetMotherId() != -1) {
1058 CbmMCTrack* mcTrackmama = (CbmMCTrack*) fMcTracks->At(part1MC->GetMotherId());
1059 if (mcTrackmama->GetMotherId() == -1 && mcTrackmama->GetPdgCode() == 22) {
1060 IdForANN = 1;
1061 CDP_InvMass_Outside->Fill(InvmassReco);
1062 CDP_InvMass_Both->Fill(InvmassReco);
1063 CDP_OA_Outside->Fill(OpeningAngle);
1064 CDP_OA_Both->Fill(OpeningAngle);
1065 CDP_InvMass_vs_OA_Outside->Fill(InvmassReco, OpeningAngle);
1066 CDP_InvMass_vs_OA_Both->Fill(InvmassReco, OpeningAngle);
1067 CDP_PlaneAngles_last_Outside->Fill(PlaneAngle_last);
1068 CDP_PlaneAngles_last_Both->Fill(PlaneAngle_last);
1069 CDP_PlaneAngles_first_Outside->Fill(PlaneAngle_first);
1070 CDP_PlaneAngles_first_Both->Fill(PlaneAngle_first);
1071 }
1072 }
1073
1074 // run ANN
1075 if (AnnTrainPhotons == 1) {
1076 fTrainPhotons->Exec(EventNumMan, IdForANN, InvmassReco, OpeningAngle, PlaneAngle_last, intersection.GetZ(),
1077 part1, part2);
1078 continue;
1079 }
1080
1081 double AnnValue = 999;
1082 if (UseAnnPhotons == 1) {
1083 AnnValue =
1084 fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, intersection.GetZ(), part1, part2);
1085 if (IdForANN == 1) CDP_AnnTruePairs->Fill(AnnValue);
1086 if (IdForANN == 0) CDP_AnnFalsePairs->Fill(AnnValue);
1087 }
1088
1089 CDP_candidates_PlaneAngles_last_Outside->Fill(PlaneAngle_last);
1090 CDP_candidates_PlaneAngles_last_Both->Fill(PlaneAngle_last);
1091 CDP_candidates_PlaneAngles_first_Outside->Fill(PlaneAngle_first);
1092 CDP_candidates_PlaneAngles_first_Both->Fill(PlaneAngle_first);
1093
1094 // cuts
1095 if (TMath::Abs(OpeningAngle) > AngleCut) continue;
1096 if (TMath::Abs(InvmassReco) > InvMassCut) continue;
1097 // if (AnnValue < 0.9 || AnnValue > 1.1) continue;
1098
1099
1100 int fromPions = 0;
1101 int fromEta = 0;
1102 int fromFireball = 0;
1103 int fromDalitz = 0;
1104 int fromXi = 0;
1105 int fromOther = 0;
1106 int fromCombinatorial = 0;
1107 int fromConversion = 0;
1108 int twoFromTarget = 0;
1109 if (part1MC->GetMotherId() == part2MC->GetMotherId() && part1MC->GetMotherId() != -1) {
1110 CbmMCTrack* mcTrackmama = (CbmMCTrack*) fMcTracks->At(part1MC->GetMotherId());
1111 if (mcTrackmama->GetPdgCode() == 22) {
1112 if (mcTrackmama->GetMotherId() == -1) { fromFireball = 1; }
1113 else {
1114 CbmMCTrack* mcTrackGrmama = (CbmMCTrack*) fMcTracks->At(mcTrackmama->GetMotherId());
1115 if (mcTrackGrmama->GetPdgCode() == 111) fromPions = 1;
1116 if (mcTrackGrmama->GetPdgCode() == 221) fromEta = 1;
1117 if (mcTrackGrmama->GetPdgCode() == 3212) fromXi = 1;
1118 fromConversion = 1;
1119 }
1120 }
1121 else {
1122 if (mcTrackmama->GetPdgCode() == 111) fromDalitz = 1;
1123 if (mcTrackmama->GetPdgCode() != 111) fromOther = 1;
1124 }
1125 }
1126 else if (part1MC->GetMotherId() == part2MC->GetMotherId() && part1MC->GetMotherId() == -1) {
1127 twoFromTarget = 1;
1128 }
1129 else {
1130 fromCombinatorial = 1;
1131 }
1132
1133
1134 if (part1MC->GetMotherId() == part2MC->GetMotherId() && part1MC->GetMotherId() != -1) {
1135 CbmMCTrack* mcTrackmama = (CbmMCTrack*) fMcTracks->At(part1MC->GetMotherId());
1136 if (mcTrackmama->GetPdgCode() == 22) {
1137 if (mcTrackmama->GetMotherId() == -1) { CGrandMother_PDG_Outside->Fill(mcTrackmama->GetMotherId()); }
1138 else {
1139 CbmMCTrack* mcTrackGrmama = (CbmMCTrack*) fMcTracks->At(mcTrackmama->GetMotherId());
1140 CGrandMother_PDG_Outside->Fill(TMath::Abs(mcTrackGrmama->GetPdgCode()));
1141 }
1142 }
1143 else {
1144 CMother_PDG_Outside->Fill(TMath::Abs(mcTrackmama->GetPdgCode()));
1145 }
1146 }
1147
1148 if (IdForANN == 1) CDP_AnnTruePairs_AfterCuts->Fill(AnnValue);
1149 if (IdForANN == 0) CDP_AnnFalsePairs_AfterCuts->Fill(AnnValue);
1150
1151
1152 // for event mixing CDP
1153 std::vector<TVector3> minusTrack = SaveAllHits(part1STS);
1154 std::vector<TVector3> plusTrack = SaveAllHits(part2STS);
1155
1156 CDP_EMT_Event_minus_Outside.push_back(EventNumMan);
1157 CDP_EMT_momenta_minus_Outside.push_back(part1STS);
1158 CDP_EMT_KFTrack_minus_Outside.push_back(electron);
1159 CDP_EMT_NofRings_minus_Outside.push_back(richcheck_0);
1160 CDP_EMT_Hits_minus_Outside.push_back(minusTrack);
1161
1162 CDP_EMT_Event_plus_Outside.push_back(EventNumMan);
1163 CDP_EMT_momenta_plus_Outside.push_back(part2STS);
1164 CDP_EMT_KFTrack_plus_Outside.push_back(positron);
1165 CDP_EMT_NofRings_plus_Outside.push_back(richcheck_1);
1166 CDP_EMT_Hits_plus_Outside.push_back(plusTrack);
1167
1168
1169 // CDP_LK_EMT
1170 CDP_LK_EMT_NofRings_minus_Outside.push_back(richcheck_0);
1171 CDP_LK_EMT_STS_minus_Outside.push_back(part1STS);
1172 CDP_LK_EMT_STS_minus_index_Outside.push_back(sts1_index);
1173
1174 CDP_LK_EMT_NofRings_plus_Outside.push_back(richcheck_1);
1175 CDP_LK_EMT_STS_plus_Outside.push_back(part2STS);
1176 CDP_LK_EMT_STS_plus_index_Outside.push_back(sts1_index);
1177
1178
1179 // everything (RICH == 0, RICH == 1, RICH == 2) together
1180 if (richcheck == 0 || richcheck == 1 || richcheck == 2) {
1181 double weight_all = 0;
1182 // cout << "Rapidity = " << params.fRapidity << "; Pt = " << params.fPt << endl;
1183 // cout << "rap_coef = " << rap_coef << "; pt_coef = " << pt_coef << "; correction factor is " << corr_all[rap_coef][pt_coef] << endl;
1184 if (corr_all[rap_coef][pt_coef] != 0) weight_all = 1 / corr_all[rap_coef][pt_coef];
1185 if (weight_all > thresholdweight) weight_all = 0;
1186 CDP_InvMassReco_all_Outside->Fill(InvmassReco, weight_all);
1187 CDP_OpeningAngleReco_all_Outside->Fill(OpeningAngle, weight_all);
1188 CDP_Pdg_all_Outside->Fill(TMath::Abs(part1MC->GetPdgCode()));
1189 CDP_Pdg_all_Outside->Fill(TMath::Abs(part2MC->GetPdgCode()));
1190 CDP_P_reco_all_Outside->Fill(params.fMomentumMag, weight_all);
1191 CDP_Pt_reco_all_Outside->Fill(params.fPt, weight_all);
1192 CDP_InvMassReco_all_Both->Fill(InvmassReco, weight_all);
1193 CDP_OpeningAngleReco_all_Both->Fill(OpeningAngle, weight_all);
1194 CDP_Pdg_all_Both->Fill(TMath::Abs(part1MC->GetPdgCode()));
1195 CDP_Pdg_all_Both->Fill(TMath::Abs(part2MC->GetPdgCode()));
1196 CDP_P_reco_all_Both->Fill(params.fMomentumMag, weight_all);
1197 CDP_Pt_reco_all_Both->Fill(params.fPt, weight_all);
1198 if (fromFireball == 1) {
1199 CPh_fromTarget_Pt_reco_all_Outside->Fill(params.fPt, weight_all);
1200 CPh_fromTarget_Pt_reco_all_Both->Fill(params.fPt, weight_all);
1201 CPh_pt_vs_rap_est_all_Outside->Fill(params.fRapidity, params.fPt);
1202 CPh_pt_vs_rap_est_all_Both->Fill(params.fRapidity, params.fPt);
1203 CPh_pt_vs_rap_est_corr_all_Outside->Fill(params.fRapidity, params.fPt, weight_all);
1204 CPh_pt_vs_rap_est_corr_all_Both->Fill(params.fRapidity, params.fPt, weight_all);
1205 }
1206 if (fromPions == 1) {
1207 CPh_fromPions_Pt_reco_all_Outside->Fill(params.fPt, weight_all);
1208 CPh_fromPions_Pt_reco_all_Both->Fill(params.fPt, weight_all);
1209 }
1210 if (fromEta == 1) {
1211 CPh_fromEtas_Pt_reco_all_Outside->Fill(params.fPt, weight_all);
1212 CPh_fromEtas_Pt_reco_all_Both->Fill(params.fPt, weight_all);
1213 }
1214 if (fromDalitz == 1) {
1215 CPh_fromDalitz_Pt_reco_all_Outside->Fill(params.fPt, weight_all);
1216 CPh_fromDalitz_Pt_reco_all_Both->Fill(params.fPt, weight_all);
1217 }
1218 if (fromXi == 1) {
1219 CPh_fromXi_Pt_reco_all_Outside->Fill(params.fPt, weight_all);
1220 CPh_fromXi_Pt_reco_all_Both->Fill(params.fPt, weight_all);
1221 }
1222 if (fromOther == 1) {
1223 CPh_fromOther_Pt_reco_all_Outside->Fill(params.fPt, weight_all);
1224 CPh_fromOther_Pt_reco_all_Both->Fill(params.fPt, weight_all);
1225 }
1226 if (fromCombinatorial == 1) {
1227 CPh_fromCombinatorial_Pt_reco_all_Outside->Fill(params.fPt, weight_all);
1228 CPh_fromCombinatorial_Pt_reco_all_Both->Fill(params.fPt, weight_all);
1229 }
1230 if (fromConversion == 1) {
1231 CPh_fromConversion_Pt_reco_all_Outside->Fill(params.fPt, weight_all);
1232 CPh_fromConversion_Pt_reco_all_Both->Fill(params.fPt, weight_all);
1233 }
1234 if (twoFromTarget == 1) {
1235 CPh_twoFromTarget_Pt_reco_all_Outside->Fill(params.fPt, weight_all);
1236 CPh_twoFromTarget_Pt_reco_all_Both->Fill(params.fPt, weight_all);
1237 }
1238 }
1239
1240 // only cases, when RICH == 2
1241 if (richcheck == 2) {
1242 double weight_two = 0;
1243 if (corr_two[rap_coef][pt_coef] != 0) weight_two = 1 / corr_two[rap_coef][pt_coef];
1244 if (weight_two > thresholdweight) weight_two = 0;
1245 CDP_InvMassReco_two_Outside->Fill(InvmassReco, weight_two);
1246 CDP_OpeningAngleReco_two_Outside->Fill(OpeningAngle, weight_two);
1247 CDP_Pdg_two_Outside->Fill(TMath::Abs(part1MC->GetPdgCode()));
1248 CDP_Pdg_two_Outside->Fill(TMath::Abs(part2MC->GetPdgCode()));
1249 CDP_P_reco_two_Outside->Fill(params.fMomentumMag, weight_two);
1250 CDP_Pt_reco_two_Outside->Fill(params.fPt, weight_two);
1251 CDP_InvMassReco_two_Both->Fill(InvmassReco, weight_two);
1252 CDP_OpeningAngleReco_two_Both->Fill(OpeningAngle, weight_two);
1253 CDP_Pdg_two_Both->Fill(TMath::Abs(part1MC->GetPdgCode()));
1254 CDP_Pdg_two_Both->Fill(TMath::Abs(part2MC->GetPdgCode()));
1255 CDP_P_reco_two_Both->Fill(params.fMomentumMag, weight_two);
1256 CDP_Pt_reco_two_Both->Fill(params.fPt, weight_two);
1257 if (fromFireball == 1) {
1258 CPh_fromTarget_Pt_reco_two_Outside->Fill(params.fPt, weight_two);
1259 CPh_fromTarget_Pt_reco_two_Both->Fill(params.fPt, weight_two);
1260 CPh_pt_vs_rap_est_two_Outside->Fill(params.fRapidity, params.fPt);
1261 CPh_pt_vs_rap_est_two_Both->Fill(params.fRapidity, params.fPt);
1262 CPh_pt_vs_rap_est_corr_two_Outside->Fill(params.fRapidity, params.fPt, weight_two);
1263 CPh_pt_vs_rap_est_corr_two_Both->Fill(params.fRapidity, params.fPt, weight_two);
1264 }
1265 if (fromPions == 1) {
1266 CPh_fromPions_Pt_reco_two_Outside->Fill(params.fPt, weight_two);
1267 CPh_fromPions_Pt_reco_two_Both->Fill(params.fPt, weight_two);
1268 }
1269 if (fromEta == 1) {
1270 CPh_fromEtas_Pt_reco_two_Outside->Fill(params.fPt, weight_two);
1271 CPh_fromEtas_Pt_reco_two_Both->Fill(params.fPt, weight_two);
1272 }
1273 if (fromDalitz == 1) {
1274 CPh_fromDalitz_Pt_reco_two_Outside->Fill(params.fPt, weight_two);
1275 CPh_fromDalitz_Pt_reco_two_Both->Fill(params.fPt, weight_two);
1276 }
1277 if (fromXi == 1) {
1278 CPh_fromXi_Pt_reco_two_Outside->Fill(params.fPt, weight_two);
1279 CPh_fromXi_Pt_reco_two_Both->Fill(params.fPt, weight_two);
1280 }
1281 if (fromOther == 1) {
1282 CPh_fromOther_Pt_reco_two_Outside->Fill(params.fPt, weight_two);
1283 CPh_fromOther_Pt_reco_two_Both->Fill(params.fPt, weight_two);
1284 }
1285 if (fromCombinatorial == 1) {
1286 CPh_fromCombinatorial_Pt_reco_two_Outside->Fill(params.fPt, weight_two);
1287 CPh_fromCombinatorial_Pt_reco_two_Both->Fill(params.fPt, weight_two);
1288 }
1289 if (fromConversion == 1) {
1290 CPh_fromConversion_Pt_reco_two_Outside->Fill(params.fPt, weight_two);
1291 CPh_fromConversion_Pt_reco_two_Both->Fill(params.fPt, weight_two);
1292 }
1293 if (twoFromTarget == 1) {
1294 CPh_twoFromTarget_Pt_reco_two_Outside->Fill(params.fPt, weight_two);
1295 CPh_twoFromTarget_Pt_reco_two_Both->Fill(params.fPt, weight_two);
1296 }
1297 }
1298
1299 // cases, when RICH == 1 or RICH == 2 together
1300 if (richcheck == 1 || richcheck == 2) {
1301 double weight_onetwo = 0;
1302 if (corr_onetwo[rap_coef][pt_coef] != 0) weight_onetwo = 1 / corr_onetwo[rap_coef][pt_coef];
1303 if (weight_onetwo > thresholdweight) weight_onetwo = 0;
1304 CDP_InvMassReco_onetwo_Outside->Fill(InvmassReco, weight_onetwo);
1305 CDP_OpeningAngleReco_onetwo_Outside->Fill(OpeningAngle, weight_onetwo);
1306 CDP_Pdg_onetwo_Outside->Fill(TMath::Abs(part1MC->GetPdgCode()));
1307 CDP_Pdg_onetwo_Outside->Fill(TMath::Abs(part2MC->GetPdgCode()));
1308 CDP_P_reco_onetwo_Outside->Fill(params.fMomentumMag, weight_onetwo);
1309 CDP_Pt_reco_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1310 CDP_InvMassReco_onetwo_Both->Fill(InvmassReco, weight_onetwo);
1311 CDP_OpeningAngleReco_onetwo_Both->Fill(OpeningAngle, weight_onetwo);
1312 CDP_Pdg_onetwo_Both->Fill(TMath::Abs(part1MC->GetPdgCode()));
1313 CDP_Pdg_onetwo_Both->Fill(TMath::Abs(part2MC->GetPdgCode()));
1314 CDP_P_reco_onetwo_Both->Fill(params.fMomentumMag, weight_onetwo);
1315 CDP_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
1316 if (fromFireball == 1) {
1317 CPh_fromTarget_Pt_reco_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1318 CPh_fromTarget_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
1319 CPh_pt_vs_rap_est_onetwo_Outside->Fill(params.fRapidity, params.fPt);
1320 CPh_pt_vs_rap_est_onetwo_Both->Fill(params.fRapidity, params.fPt);
1321 CPh_pt_vs_rap_est_corr_onetwo_Outside->Fill(params.fRapidity, params.fPt, weight_onetwo);
1322 CPh_pt_vs_rap_est_corr_onetwo_Both->Fill(params.fRapidity, params.fPt, weight_onetwo);
1323 }
1324 if (fromPions == 1) {
1325 CPh_fromPions_Pt_reco_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1326 CPh_fromPions_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
1327 }
1328 if (fromEta == 1) {
1329 CPh_fromEtas_Pt_reco_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1330 CPh_fromEtas_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
1331 }
1332 if (fromDalitz == 1) {
1333 CPh_fromDalitz_Pt_reco_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1334 CPh_fromDalitz_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
1335 }
1336 if (fromXi == 1) {
1337 CPh_fromXi_Pt_reco_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1338 CPh_fromXi_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
1339 }
1340 if (fromOther == 1) {
1341 CPh_fromOther_Pt_reco_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1342 CPh_fromOther_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
1343 }
1344 if (fromCombinatorial == 1) {
1345 CPh_fromCombinatorial_Pt_reco_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1346 CPh_fromCombinatorial_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
1347 }
1348 if (fromConversion == 1) {
1349 CPh_fromConversion_Pt_reco_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1350 CPh_fromConversion_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
1351 }
1352 if (twoFromTarget == 1) {
1353 CPh_twoFromTarget_Pt_reco_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1354 CPh_twoFromTarget_Pt_reco_onetwo_Both->Fill(params.fPt, weight_onetwo);
1355 }
1356 }
1357 }
1358 }
1359}
1360
1361
1362int CbmKresConversionCorrectedPhotons::FindInRich(int richInd, int stsMcTrackId)
1363{
1364 int RingsInRich = 0;
1365 if (richInd > -1) {
1366 CbmTrackMatchNew* richMatch = (CbmTrackMatchNew*) fRichRingMatches->At(richInd);
1367 if (richMatch != nullptr && richMatch->GetNofLinks() > 0) {
1368 int richMcTrackId = richMatch->GetMatchedLink().GetIndex();
1369 if (richMcTrackId > 0) {
1370 if (stsMcTrackId == richMcTrackId) { // check that global track was matched correctly for STS and RICH together
1371 CbmMCTrack* mcTrack2 = (CbmMCTrack*) fMcTracks->At(richMcTrackId);
1372 if (mcTrack2 != nullptr) {
1373 int pdgRICH = mcTrack2->GetPdgCode();
1374 if (TMath::Abs(pdgRICH) == 11) RingsInRich++;
1375 }
1376 }
1377 }
1378 }
1379 }
1380 return RingsInRich;
1381}
1382
1383
1385{
1386 int identified = 0;
1387
1388 if (nullptr != ring) {
1389 CbmRichRingLight ringHit;
1390 int nofHits = ring->GetNofHits();
1391 for (int i = 0; i < nofHits; i++) {
1392 int hitInd = ring->GetHit(i);
1393 CbmRichHit* hit = (CbmRichHit*) fRichHits->At(hitInd);
1394 if (nullptr == hit) continue;
1395 CbmRichHitLight hl(hit->GetX(), hit->GetY());
1396 ringHit.AddHit(hl);
1397 }
1398 fTauFit->DoFit(&ringHit);
1399 if (ringHit.GetAaxis() > 4 && ringHit.GetAaxis() < 6 && ringHit.GetBaxis() > 4 && ringHit.GetBaxis() < 6
1400 && momentum > 0.2 && momentum < 4.)
1401 identified++;
1402 //if (ring->GetDistance() < 2 && ringHit.GetAaxis() > 4 && ringHit.GetAaxis() < 6 && ringHit.GetBaxis() > 4 && ringHit.GetBaxis() < 6 && momentum > 0.2 && momentum < 4.) identified ++;
1403 }
1404
1405 return identified;
1406}
1407
1409{
1410 std::vector<TVector3> AllHitsOfTrack;
1411 AllHitsOfTrack.clear();
1412
1413 Int_t hitsMVD = track->GetNofMvdHits();
1414 Int_t hitsSTS = track->GetNofStsHits();
1415
1416 for (int i = 0; i < hitsMVD; i++) {
1417 Int_t mvdHitIndex = track->GetMvdHitIndex(i);
1418 CbmMvdHit* mvdHit = (CbmMvdHit*) fArrayMvdHit->At(mvdHitIndex);
1419 TVector3 position;
1420 mvdHit->Position(position);
1421 AllHitsOfTrack.push_back(position);
1422 }
1423 for (int i = 0; i < hitsSTS; i++) {
1424 Int_t stsHitIndex = track->GetStsHitIndex(i);
1425 CbmStsHit* stsHit = (CbmStsHit*) fArrayStsHit->At(stsHitIndex);
1426 TVector3 position;
1427 stsHit->Position(position);
1428 AllHitsOfTrack.push_back(position);
1429 }
1430
1431 return AllHitsOfTrack;
1432}
1433
1435 std::vector<TVector3> track_2)
1436{
1437 double FinalAngle = 400;
1438
1439 int hits_1 = track_1.size();
1440 int hits_2 = track_2.size();
1441
1442 double Xpart1 = 0;
1443 double Ypart1 = 0;
1444 double Zpart1 = 0;
1445 double Xpart2 = 0;
1446 double Ypart2 = 0;
1447 double Zpart2 = 0;
1448
1449 TVector3 last1 = track_1[hits_1 - 1];
1450 TVector3 last2 = track_2[hits_2 - 1];
1451
1452 // // check difference in 2 cm, because of two slices of every STS and Mvd stations
1453 if (TMath::Abs(last1.Z() - last2.Z()) > 2
1454 && last1.Z() > last2.Z()) { // if last hits are in different stations --> try to find the latest common station
1455 for (int i = hits_1 - 2; i > -1; i--) { // start from second last station
1456 if (TMath::Abs(last1.Z() - last2.Z()) < 2) continue;
1457 last1 = track_1[i];
1458 Xpart1 = last1.X();
1459 Ypart1 = last1.Y();
1460 Zpart1 = last1.Z();
1461 }
1462 }
1463
1464 if (TMath::Abs(last1.Z() - last2.Z()) > 2
1465 && last1.Z() < last2.Z()) { // if last hits are in different stations --> try to find the latest common station
1466 for (int i = hits_2 - 2; i > -1; i--) { // start from second last station
1467 if (TMath::Abs(last1.Z() - last2.Z()) < 2) continue;
1468 last2 = track_2[i];
1469 Xpart2 = last2.X();
1470 Ypart2 = last2.Y();
1471 Zpart2 = last2.Z();
1472 }
1473 }
1474
1475 // calculate angle if we have found common station
1476 if (TMath::Abs(Zpart1 - Zpart2) < 2 && Zpart1 != 0 && Zpart2 != 0) {
1477 FinalAngle = TMath::ATan2(Ypart1 - Ypart2, Xpart1 - Xpart2) * (180 / TMath::Pi());
1478 }
1479
1480 return TMath::Abs(TMath::Abs(FinalAngle) - 180);
1481}
1482
1483
1485{
1486 double FinalAngle = 400;
1487 Int_t hits1sts = Sts_1->GetNofStsHits();
1488 Int_t hits2sts = Sts_2->GetNofStsHits();
1489 Int_t hits1mvd = Sts_1->GetNofMvdHits();
1490 Int_t hits2mvd = Sts_2->GetNofMvdHits();
1491
1492 double Xpart1 = 0;
1493 double Ypart1 = 0;
1494 double Zpart1 = 0;
1495 double Xpart2 = 0;
1496 double Ypart2 = 0;
1497 double Zpart2 = 0;
1498 if (hits1sts > 0) {
1499 Int_t stsHitIndex1 = Sts_1->GetStsHitIndex(hits1sts - 1);
1500 CbmStsHit* stsHit1 = (CbmStsHit*) fArrayStsHit->At(stsHitIndex1);
1501 Xpart1 = stsHit1->GetX();
1502 Ypart1 = stsHit1->GetY();
1503 Zpart1 = stsHit1->GetZ();
1504 }
1505 else {
1506 Int_t mvdHitIndex1 = Sts_1->GetMvdHitIndex(hits1mvd - 1);
1507 CbmMvdHit* mvdHit1 = (CbmMvdHit*) fArrayMvdHit->At(mvdHitIndex1);
1508 Xpart1 = mvdHit1->GetX();
1509 Ypart1 = mvdHit1->GetY();
1510 Zpart1 = mvdHit1->GetZ();
1511 }
1512
1513 if (hits2sts > 0) {
1514 Int_t stsHitIndex2 = Sts_2->GetStsHitIndex(hits2sts - 1);
1515 CbmStsHit* stsHit2 = (CbmStsHit*) fArrayStsHit->At(stsHitIndex2);
1516 Xpart2 = stsHit2->GetX();
1517 Ypart2 = stsHit2->GetY();
1518 Zpart2 = stsHit2->GetZ();
1519 }
1520 else {
1521 Int_t mvdHitIndex2 = Sts_2->GetMvdHitIndex(hits2mvd - 1);
1522 CbmMvdHit* mvdHit2 = (CbmMvdHit*) fArrayMvdHit->At(mvdHitIndex2);
1523 Xpart2 = mvdHit2->GetX();
1524 Ypart2 = mvdHit2->GetY();
1525 Zpart2 = mvdHit2->GetZ();
1526 }
1527
1528 // check difference in 2 cm, because of two slices of every STS and Mvd stations
1529 if (TMath::Abs(Zpart1 - Zpart2) > 2
1530 && Zpart1 > Zpart2) { // if last hits are in different stations --> try to find the latest common station
1531 for (int i = hits1sts - 2; i > -1; i--) { // start from second last station
1532 if (TMath::Abs(Zpart1 - Zpart2) < 2) continue;
1533 Int_t stsHitIndex = Sts_1->GetStsHitIndex(i);
1534 CbmStsHit* stsHit = (CbmStsHit*) fArrayStsHit->At(stsHitIndex);
1535 Xpart1 = stsHit->GetX();
1536 Ypart1 = stsHit->GetY();
1537 Zpart1 = stsHit->GetZ();
1538 }
1539 if (TMath::Abs(Zpart1 - Zpart2) > 2 && Zpart1 > Zpart2) {
1540 for (int i = hits1mvd - 2; i > -1; i--) {
1541 if (TMath::Abs(Zpart1 - Zpart2) < 2) continue;
1542 Int_t mvdHitIndex = Sts_1->GetMvdHitIndex(i);
1543 CbmMvdHit* mvdHit = (CbmMvdHit*) fArrayMvdHit->At(mvdHitIndex);
1544 Xpart1 = mvdHit->GetX();
1545 Ypart1 = mvdHit->GetY();
1546 Zpart1 = mvdHit->GetZ();
1547 }
1548 }
1549 }
1550
1551 if (TMath::Abs(Zpart1 - Zpart2) > 2
1552 && Zpart1 < Zpart2) { // if last hits are in different stations --> try to find the latest common station
1553 for (int i = hits2sts - 2; i > -1; i--) { // start from second last station
1554 if (TMath::Abs(Zpart1 - Zpart2) < 2) continue;
1555 Int_t stsHitIndex = Sts_2->GetStsHitIndex(i);
1556 CbmStsHit* stsHit = (CbmStsHit*) fArrayStsHit->At(stsHitIndex);
1557 Xpart2 = stsHit->GetX();
1558 Ypart2 = stsHit->GetY();
1559 Zpart2 = stsHit->GetZ();
1560 }
1561 if (TMath::Abs(Zpart1 - Zpart2) > 2 && Zpart1 < Zpart2) {
1562 for (int i = hits2mvd - 2; i > -1; i--) {
1563 if (TMath::Abs(Zpart1 - Zpart2) < 2) continue;
1564 Int_t mvdHitIndex = Sts_2->GetMvdHitIndex(i);
1565 CbmMvdHit* mvdHit = (CbmMvdHit*) fArrayMvdHit->At(mvdHitIndex);
1566 Xpart2 = mvdHit->GetX();
1567 Ypart2 = mvdHit->GetY();
1568 Zpart2 = mvdHit->GetZ();
1569 }
1570 }
1571 }
1572
1573 // calculate angle if we found common station
1574 if (TMath::Abs(Zpart1 - Zpart2) < 2 && Zpart1 != 0 && Zpart2 != 0) {
1575 FinalAngle = TMath::ATan2(Ypart1 - Ypart2, Xpart1 - Xpart2) * (180 / TMath::Pi());
1576 }
1577
1578 return TMath::Abs(TMath::Abs(FinalAngle) - 180);
1579}
1580
1582{
1583 double FinalAngle = 400;
1584 Int_t hits1sts = Sts_1->GetNofStsHits();
1585 Int_t hits2sts = Sts_2->GetNofStsHits();
1586 Int_t hits1mvd = Sts_1->GetNofMvdHits();
1587 Int_t hits2mvd = Sts_2->GetNofMvdHits();
1588
1589 double Xpart1 = 0;
1590 double Ypart1 = 0;
1591 double Zpart1 = 0;
1592 double Xpart2 = 0;
1593 double Ypart2 = 0;
1594 double Zpart2 = 0;
1595 if (hits1mvd > 0) {
1596 Int_t mvdHitIndex1 = Sts_1->GetMvdHitIndex(0);
1597 CbmMvdHit* mvdHit1 = (CbmMvdHit*) fArrayMvdHit->At(mvdHitIndex1);
1598 Xpart1 = mvdHit1->GetX();
1599 Ypart1 = mvdHit1->GetY();
1600 Zpart1 = mvdHit1->GetZ();
1601 }
1602 else {
1603 Int_t stsHitIndex1 = Sts_1->GetStsHitIndex(0);
1604 CbmStsHit* stsHit1 = (CbmStsHit*) fArrayStsHit->At(stsHitIndex1);
1605 Xpart1 = stsHit1->GetX();
1606 Ypart1 = stsHit1->GetY();
1607 Zpart1 = stsHit1->GetZ();
1608 }
1609
1610 if (hits2mvd > 0) {
1611 Int_t mvdHitIndex2 = Sts_2->GetMvdHitIndex(0);
1612 CbmMvdHit* mvdHit2 = (CbmMvdHit*) fArrayMvdHit->At(mvdHitIndex2);
1613 Xpart2 = mvdHit2->GetX();
1614 Ypart2 = mvdHit2->GetY();
1615 Zpart2 = mvdHit2->GetZ();
1616 }
1617 else {
1618 Int_t stsHitIndex2 = Sts_2->GetStsHitIndex(0);
1619 CbmStsHit* stsHit2 = (CbmStsHit*) fArrayStsHit->At(stsHitIndex2);
1620 Xpart2 = stsHit2->GetX();
1621 Ypart2 = stsHit2->GetY();
1622 Zpart2 = stsHit2->GetZ();
1623 }
1624
1625 // check difference in 2 cm, because of two slices of every STS and Mvd stations
1626 if (TMath::Abs(Zpart1 - Zpart2) > 2
1627 && Zpart1 < Zpart2) { // if first hits are in different stations --> try to find the earliest common station
1628 for (int i = 1; i < hits1mvd; i++) { // start from second hit
1629 if (TMath::Abs(Zpart1 - Zpart2) < 2) continue;
1630 Int_t mvdHitIndex = Sts_1->GetMvdHitIndex(i);
1631 CbmMvdHit* mvdHit = (CbmMvdHit*) fArrayMvdHit->At(mvdHitIndex);
1632 Xpart1 = mvdHit->GetX();
1633 Ypart1 = mvdHit->GetY();
1634 Zpart1 = mvdHit->GetZ();
1635 }
1636 if (TMath::Abs(Zpart1 - Zpart2) > 2 && Zpart1 < Zpart2) {
1637 for (int i = 0; i < hits1sts; i++) {
1638 if (TMath::Abs(Zpart1 - Zpart2) < 2) continue;
1639 Int_t stsHitIndex = Sts_1->GetStsHitIndex(i);
1640 CbmStsHit* stsHit = (CbmStsHit*) fArrayStsHit->At(stsHitIndex);
1641 Xpart1 = stsHit->GetX();
1642 Ypart1 = stsHit->GetY();
1643 Zpart1 = stsHit->GetZ();
1644 }
1645 }
1646 }
1647
1648 if (TMath::Abs(Zpart1 - Zpart2) > 2
1649 && Zpart1 > Zpart2) { // if first hits are in different stations --> try to find the earliest common station
1650 for (int i = 1; i < hits2mvd; i++) { // start from second hit
1651 if (TMath::Abs(Zpart1 - Zpart2) < 2) continue;
1652 Int_t mvdHitIndex = Sts_2->GetMvdHitIndex(i);
1653 CbmMvdHit* mvdHit = (CbmMvdHit*) fArrayMvdHit->At(mvdHitIndex);
1654 Xpart2 = mvdHit->GetX();
1655 Ypart2 = mvdHit->GetY();
1656 Zpart2 = mvdHit->GetZ();
1657 }
1658 if (TMath::Abs(Zpart1 - Zpart2) > 2 && Zpart1 > Zpart2) {
1659 for (int i = 0; i < hits2sts; i++) {
1660 if (TMath::Abs(Zpart1 - Zpart2) < 2) continue;
1661 Int_t stsHitIndex = Sts_2->GetStsHitIndex(i);
1662 CbmStsHit* stsHit = (CbmStsHit*) fArrayStsHit->At(stsHitIndex);
1663 Xpart2 = stsHit->GetX();
1664 Ypart2 = stsHit->GetY();
1665 Zpart2 = stsHit->GetZ();
1666 }
1667 }
1668 }
1669
1670 // calculate angle if we found common station
1671 if (TMath::Abs(Zpart1 - Zpart2) < 2 && Zpart1 != 0 && Zpart2 != 0) {
1672 FinalAngle = TMath::ATan2(Ypart1 - Ypart2, Xpart1 - Xpart2) * (180 / TMath::Pi());
1673 }
1674
1675 return TMath::Abs(TMath::Abs(FinalAngle) - 180);
1676}
1677
1679// mix particles with the same charge TARGET
1680{
1681 int nof_minus = CDP_LK_EMT_momenta_minus_Target.size();
1682 for (int a = 0; a < nof_minus - 1; a++) {
1683 for (int b = a + 1; b < nof_minus; b++) {
1685 TVector3 e1 = CDP_LK_EMT_momenta_minus_Target[a];
1686 TVector3 e2 = CDP_LK_EMT_momenta_minus_Target[b];
1689
1690 double InvmassReco = CbmKresFunctions::Invmass_2particles_RECO(e1, e2);
1691 double OpeningAngle = CbmKresFunctions::CalculateOpeningAngle_Reco(e1, e2);
1692 double PlaneAngle_last = CalculatePlaneAngle_last(sts1, sts2);
1693
1694 // double AnnValue = fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(), e1, e2);
1695 fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(), e1, e2);
1696
1697 // cuts
1698 if (TMath::Abs(OpeningAngle) > AngleCut) continue;
1699 if (TMath::Abs(InvmassReco) > InvMassCut) continue;
1700 // if (AnnValue < 0.9 || AnnValue > 1.1) continue;
1701
1703
1704 if (params.fRapidity != params.fRapidity) continue;
1705 if (params.fPt != params.fPt) continue;
1706 if (params.fRapidity >= 4) continue;
1707 if (params.fPt >= 3) continue;
1708
1709 double rap_step = 0.4;
1710 double pt_step = 0.1;
1711 int rap_coef = params.fRapidity / rap_step;
1712 int pt_coef = params.fPt / pt_step;
1713 double weight_all = 0;
1714 double weight_two = 0;
1715 double weight_onetwo = 0;
1716 if (corr_all[rap_coef][pt_coef] != 0) weight_all = 1 / corr_all[rap_coef][pt_coef];
1717 if (corr_two[rap_coef][pt_coef] != 0) weight_two = 1 / corr_two[rap_coef][pt_coef];
1718 if (corr_onetwo[rap_coef][pt_coef] != 0) weight_onetwo = 1 / corr_onetwo[rap_coef][pt_coef];
1719
1720 if (weight_all > thresholdweight) weight_all = 0;
1721 if (weight_two > thresholdweight) weight_two = 0;
1722 if (weight_onetwo > thresholdweight) weight_onetwo = 0;
1723
1725
1726 CDP_LK_EMT_Pt_all_Target->Fill(params.fPt, weight_all);
1727 if (rings_amount == 2) CDP_LK_EMT_Pt_two_Target->Fill(params.fPt, weight_two);
1728 if ((rings_amount == 1 || rings_amount == 2)) CDP_LK_EMT_Pt_onetwo_Target->Fill(params.fPt, weight_onetwo);
1729 CDP_LK_EMT_Pt_all_Both->Fill(params.fPt, weight_all);
1730 if (rings_amount == 2) CDP_LK_EMT_Pt_two_Both->Fill(params.fPt, weight_two);
1731 if ((rings_amount == 1 || rings_amount == 2)) CDP_LK_EMT_Pt_onetwo_Both->Fill(params.fPt, weight_onetwo);
1732 }
1733 }
1734
1735
1736 int nof_plus = CDP_LK_EMT_momenta_plus_Target.size();
1737 for (int a = 0; a < nof_plus - 1; a++) {
1738 for (int b = a + 1; b < nof_plus; b++) {
1740 TVector3 e1 = CDP_LK_EMT_momenta_plus_Target[a];
1741 TVector3 e2 = CDP_LK_EMT_momenta_plus_Target[b];
1744
1745 double InvmassReco = CbmKresFunctions::Invmass_2particles_RECO(e1, e2);
1746 double OpeningAngle = CbmKresFunctions::CalculateOpeningAngle_Reco(e1, e2);
1747 double PlaneAngle_last = CalculatePlaneAngle_last(sts1, sts2);
1748
1749 // double AnnValue = fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(), e1, e2);
1750 fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(), e1, e2);
1751
1752 // cuts
1753 if (TMath::Abs(OpeningAngle) > AngleCut) continue;
1754 if (TMath::Abs(InvmassReco) > InvMassCut) continue;
1755 // if (AnnValue < 0.9 || AnnValue > 1.1) continue;
1756
1758
1759 if (params.fRapidity != params.fRapidity) continue;
1760 if (params.fPt != params.fPt) continue;
1761 if (params.fRapidity >= 4) continue;
1762 if (params.fPt >= 3) continue;
1763
1764 double rap_step = 0.4;
1765 double pt_step = 0.1;
1766 int rap_coef = params.fRapidity / rap_step;
1767 int pt_coef = params.fPt / pt_step;
1768 double weight_all = 0;
1769 double weight_two = 0;
1770 double weight_onetwo = 0;
1771 if (corr_all[rap_coef][pt_coef] != 0) weight_all = 1 / corr_all[rap_coef][pt_coef];
1772 if (corr_two[rap_coef][pt_coef] != 0) weight_two = 1 / corr_two[rap_coef][pt_coef];
1773 if (corr_onetwo[rap_coef][pt_coef] != 0) weight_onetwo = 1 / corr_onetwo[rap_coef][pt_coef];
1774
1775 if (weight_all > thresholdweight) weight_all = 0;
1776 if (weight_two > thresholdweight) weight_two = 0;
1777 if (weight_onetwo > thresholdweight) weight_onetwo = 0;
1778
1780
1781 CDP_LK_EMT_Pt_all_Target->Fill(params.fPt, weight_all);
1782 if (rings_amount == 2) CDP_LK_EMT_Pt_two_Target->Fill(params.fPt, weight_two);
1783 if ((rings_amount == 1 || rings_amount == 2)) CDP_LK_EMT_Pt_onetwo_Target->Fill(params.fPt, weight_onetwo);
1784 CDP_LK_EMT_Pt_all_Both->Fill(params.fPt, weight_all);
1785 if (rings_amount == 2) CDP_LK_EMT_Pt_two_Both->Fill(params.fPt, weight_two);
1786 if ((rings_amount == 1 || rings_amount == 2)) CDP_LK_EMT_Pt_onetwo_Both->Fill(params.fPt, weight_onetwo);
1787 }
1788 }
1789}
1790
1792// mix particles with the same charge OUTSIDE
1793{
1794 int nof_minus = CDP_LK_EMT_NofRings_minus_Outside.size();
1795 for (int a = 0; a < nof_minus - 1; a++) {
1796 for (int b = a + 1; b < nof_minus; b++) {
1800
1801 KFParticle electron;
1803 KFParticle positron;
1805 const KFParticle* daughters[2] = {&electron, &positron};
1806 KFParticle intersection;
1807 intersection.Construct(daughters, 2);
1808
1809 if (intersection.GetZ() > 75 || intersection.GetZ() < -5) continue; // kick weird intersections
1810
1811 TVector3 e1 = CbmKresFunctions::FitToVertex(sts1, intersection.GetX(), intersection.GetY(), intersection.GetZ());
1812 TVector3 e2 = CbmKresFunctions::FitToVertex(sts2, intersection.GetX(), intersection.GetY(), intersection.GetZ());
1813
1814 double InvmassReco = CbmKresFunctions::Invmass_2particles_RECO(e1, e2);
1815 double OpeningAngle = CbmKresFunctions::CalculateOpeningAngle_Reco(e1, e2);
1816 double PlaneAngle_last = CalculatePlaneAngle_last(sts1, sts2);
1817
1818 // double AnnValue = fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(), e1, e2);
1819 fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(), e1, e2);
1820
1821 // cuts
1822 if (TMath::Abs(OpeningAngle) > AngleCut) continue;
1823 if (TMath::Abs(InvmassReco) > InvMassCut) continue;
1824 // if (AnnValue < 0.9 || AnnValue > 1.1) continue;
1825
1827
1828 if (params.fRapidity != params.fRapidity) continue;
1829 if (params.fPt != params.fPt) continue;
1830 if (params.fRapidity >= 4) continue;
1831 if (params.fPt >= 3) continue;
1832
1833 double rap_step = 0.4;
1834 double pt_step = 0.1;
1835 int rap_coef = params.fRapidity / rap_step;
1836 int pt_coef = params.fPt / pt_step;
1837 double weight_all = 0;
1838 double weight_two = 0;
1839 double weight_onetwo = 0;
1840 if (corr_all[rap_coef][pt_coef] != 0) weight_all = 1 / corr_all[rap_coef][pt_coef];
1841 if (corr_two[rap_coef][pt_coef] != 0) weight_two = 1 / corr_two[rap_coef][pt_coef];
1842 if (corr_onetwo[rap_coef][pt_coef] != 0) weight_onetwo = 1 / corr_onetwo[rap_coef][pt_coef];
1843
1844 if (weight_all > thresholdweight) weight_all = 0;
1845 if (weight_two > thresholdweight) weight_two = 0;
1846 if (weight_onetwo > thresholdweight) weight_onetwo = 0;
1847
1849
1850 CDP_LK_EMT_Pt_all_Outside->Fill(params.fPt, weight_all);
1851 if (rings_amount == 2) CDP_LK_EMT_Pt_two_Outside->Fill(params.fPt, weight_two);
1852 if ((rings_amount == 1 || rings_amount == 2)) CDP_LK_EMT_Pt_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1853 CDP_LK_EMT_Pt_all_Both->Fill(params.fPt, weight_all);
1854 if (rings_amount == 2) CDP_LK_EMT_Pt_two_Both->Fill(params.fPt, weight_two);
1855 if ((rings_amount == 1 || rings_amount == 2)) CDP_LK_EMT_Pt_onetwo_Both->Fill(params.fPt, weight_onetwo);
1856 }
1857 }
1858
1859
1860 int nof_plus = CDP_LK_EMT_NofRings_plus_Outside.size();
1861 for (int a = 0; a < nof_plus - 1; a++) {
1862 for (int b = a + 1; b < nof_plus; b++) {
1866
1867 KFParticle electron;
1869 KFParticle positron;
1871 const KFParticle* daughters[2] = {&electron, &positron};
1872 KFParticle intersection;
1873 intersection.Construct(daughters, 2);
1874
1875 if (intersection.GetZ() > 75 || intersection.GetZ() < -5) continue; // kick weird intersections
1876
1877 TVector3 e1 = CbmKresFunctions::FitToVertex(sts1, intersection.GetX(), intersection.GetY(), intersection.GetZ());
1878 TVector3 e2 = CbmKresFunctions::FitToVertex(sts2, intersection.GetX(), intersection.GetY(), intersection.GetZ());
1879
1880 double InvmassReco = CbmKresFunctions::Invmass_2particles_RECO(e1, e2);
1881 double OpeningAngle = CbmKresFunctions::CalculateOpeningAngle_Reco(e1, e2);
1882 double PlaneAngle_last = CalculatePlaneAngle_last(sts1, sts2);
1883
1884 // double AnnValue = fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(), e1, e2);
1885 fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(), e1, e2);
1886
1887 // cuts
1888 if (TMath::Abs(OpeningAngle) > AngleCut) continue;
1889 if (TMath::Abs(InvmassReco) > InvMassCut) continue;
1890 // if (AnnValue < 0.9 || AnnValue > 1.1) continue;
1891
1893
1894 if (params.fRapidity != params.fRapidity) continue;
1895 if (params.fPt != params.fPt) continue;
1896 if (params.fRapidity >= 4) continue;
1897 if (params.fPt >= 3) continue;
1898
1899 double rap_step = 0.4;
1900 double pt_step = 0.1;
1901 int rap_coef = params.fRapidity / rap_step;
1902 int pt_coef = params.fPt / pt_step;
1903 double weight_all = 0;
1904 double weight_two = 0;
1905 double weight_onetwo = 0;
1906 if (corr_all[rap_coef][pt_coef] != 0) weight_all = 1 / corr_all[rap_coef][pt_coef];
1907 if (corr_two[rap_coef][pt_coef] != 0) weight_two = 1 / corr_two[rap_coef][pt_coef];
1908 if (corr_onetwo[rap_coef][pt_coef] != 0) weight_onetwo = 1 / corr_onetwo[rap_coef][pt_coef];
1909
1910 if (weight_all > thresholdweight) weight_all = 0;
1911 if (weight_two > thresholdweight) weight_two = 0;
1912 if (weight_onetwo > thresholdweight) weight_onetwo = 0;
1913
1915
1916 CDP_LK_EMT_Pt_all_Outside->Fill(params.fPt, weight_all);
1917 if (rings_amount == 2) CDP_LK_EMT_Pt_two_Outside->Fill(params.fPt, weight_two);
1918 if ((rings_amount == 1 || rings_amount == 2)) CDP_LK_EMT_Pt_onetwo_Outside->Fill(params.fPt, weight_onetwo);
1919 CDP_LK_EMT_Pt_all_Both->Fill(params.fPt, weight_all);
1920 if (rings_amount == 2) CDP_LK_EMT_Pt_two_Both->Fill(params.fPt, weight_two);
1921 if ((rings_amount == 1 || rings_amount == 2)) CDP_LK_EMT_Pt_onetwo_Both->Fill(params.fPt, weight_onetwo);
1922 }
1923 }
1924}
1925
1926
1927void CbmKresConversionCorrectedPhotons::CDP_Mixing_Target(double AngleCut, double InvMassCut)
1928// TARGET
1929{
1930 int nof_Target = CDP_EMT_Event_minus_Target.size();
1931 cout << "Mixing for corrected direct photons in Target - nof entries " << nof_Target << endl;
1932
1933 for (size_t a = 0; a < CDP_EMT_Event_minus_Target.size(); a++) {
1934 for (size_t b = 0; b < CDP_EMT_Event_plus_Target.size(); b++) {
1936 continue; // to make sure that two particles are from two different events
1937 TVector3 e1 = CDP_EMT_momenta_minus_Target[a];
1938 TVector3 e2 = CDP_EMT_momenta_plus_Target[b];
1939 std::vector<TVector3> hits1 = CDP_EMT_Hits_minus_Target[a];
1940 std::vector<TVector3> hits2 = CDP_EMT_Hits_plus_Target[b];
1941
1942 double InvmassReco = CbmKresFunctions::Invmass_2particles_RECO(e1, e2);
1943 double OpeningAngle = CbmKresFunctions::CalculateOpeningAngle_Reco(e1, e2);
1944 double PlaneAngle_last = CalculatePlaneAngle_last_fromHits(hits1, hits2);
1945
1946 // double AnnValue = fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(), e1, e2);
1947 fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, fKFVertex.GetRefZ(), e1, e2);
1948
1949 // cuts
1950 if (TMath::Abs(OpeningAngle) > AngleCut) continue;
1951 if (TMath::Abs(InvmassReco) > InvMassCut) continue;
1952 // if (AnnValue < 0.9 || AnnValue > 1.1) continue;
1953
1955
1956 if (params.fRapidity != params.fRapidity) continue;
1957 if (params.fPt != params.fPt) continue;
1958 if (params.fRapidity >= 4) continue;
1959 if (params.fPt >= 3) continue;
1960
1961 double rap_step = 0.4;
1962 double pt_step = 0.1;
1963 int rap_coef = params.fRapidity / rap_step;
1964 int pt_coef = params.fPt / pt_step;
1965 double weight_all = 0;
1966 double weight_two = 0;
1967 double weight_onetwo = 0;
1968 if (corr_all[rap_coef][pt_coef] != 0) weight_all = 1 / corr_all[rap_coef][pt_coef];
1969 if (corr_two[rap_coef][pt_coef] != 0) weight_two = 1 / corr_two[rap_coef][pt_coef];
1970 if (corr_onetwo[rap_coef][pt_coef] != 0) weight_onetwo = 1 / corr_onetwo[rap_coef][pt_coef];
1971
1972 if (weight_all > thresholdweight) weight_all = 0;
1973 if (weight_two > thresholdweight) weight_two = 0;
1974 if (weight_onetwo > thresholdweight) weight_onetwo = 0;
1975
1977
1978 CDP_EMT_Pt_all_Target->Fill(params.fPt, weight_all);
1979 CDP_EMT_Pt_all_Both->Fill(params.fPt, weight_all);
1980 if (rings_amount == 2) {
1981 CDP_EMT_Pt_two_Target->Fill(params.fPt, weight_two);
1982 CDP_EMT_Pt_two_Both->Fill(params.fPt, weight_two);
1983 }
1984 if ((rings_amount == 1 || rings_amount == 2)) {
1985 CDP_EMT_Pt_onetwo_Target->Fill(params.fPt, weight_two);
1986 CDP_EMT_Pt_onetwo_Both->Fill(params.fPt, weight_two);
1987 }
1988 }
1989 }
1990}
1991
1992
1993void CbmKresConversionCorrectedPhotons::CDP_Mixing_Outside(double AngleCut, double InvMassCut)
1994// OUTSIDE
1995{
1996 int nof_Outside = CDP_EMT_Event_minus_Outside.size();
1997 cout << "Mixing for corrected direct photons in Outside - nof entries " << nof_Outside << endl;
1998
1999 for (size_t a = 0; a < CDP_EMT_Event_minus_Outside.size(); a++) {
2000 for (size_t b = 0; b < CDP_EMT_Event_plus_Outside.size(); b++) {
2002 continue; // to make sure that two particles are from two different events
2003
2004 KFParticle electron = CDP_EMT_KFTrack_minus_Outside[a];
2005 KFParticle positron = CDP_EMT_KFTrack_plus_Outside[b];
2006
2007 const KFParticle* daughters[2] = {&electron, &positron};
2008 KFParticle intersection;
2009 intersection.Construct(daughters, 2);
2010
2011 if (intersection.GetZ() > 75 || intersection.GetZ() < -5) continue; // kick weird intersections
2012
2013 TVector3 e1(electron.KFParticleBase::Px(), electron.KFParticleBase::Py(), electron.KFParticleBase::Pz());
2014 TVector3 e2(positron.KFParticleBase::Px(), positron.KFParticleBase::Py(), positron.KFParticleBase::Pz());
2015
2016 std::vector<TVector3> hits1 = CDP_EMT_Hits_minus_Outside[a];
2017 std::vector<TVector3> hits2 = CDP_EMT_Hits_plus_Outside[b];
2018
2019 double InvmassReco = CbmKresFunctions::Invmass_2particles_RECO(e1, e2);
2020 double OpeningAngle = CbmKresFunctions::CalculateOpeningAngle_Reco(e1, e2);
2021 double PlaneAngle_last = CalculatePlaneAngle_last_fromHits(hits1, hits2);
2022
2023 // double AnnValue = fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, intersection.GetZ(), e1, e2);
2024 fAnnPhotonsSelection->DoSelect(InvmassReco, OpeningAngle, PlaneAngle_last, intersection.GetZ(), e1, e2);
2025
2026 // cuts
2027 if (TMath::Abs(OpeningAngle) > AngleCut) continue;
2028 if (TMath::Abs(InvmassReco) > InvMassCut) continue;
2029 // if (AnnValue < 0.9 || AnnValue > 1.1) continue;
2030
2032
2033 if (params.fRapidity != params.fRapidity) continue;
2034 if (params.fPt != params.fPt) continue;
2035 if (params.fRapidity >= 4) continue;
2036 if (params.fPt >= 3) continue;
2037
2038 double rap_step = 0.4;
2039 double pt_step = 0.1;
2040 int rap_coef = params.fRapidity / rap_step;
2041 int pt_coef = params.fPt / pt_step;
2042 double weight_all = 0;
2043 double weight_two = 0;
2044 double weight_onetwo = 0;
2045 if (corr_all[rap_coef][pt_coef] != 0) weight_all = 1 / corr_all[rap_coef][pt_coef];
2046 if (corr_two[rap_coef][pt_coef] != 0) weight_two = 1 / corr_two[rap_coef][pt_coef];
2047 if (corr_onetwo[rap_coef][pt_coef] != 0) weight_onetwo = 1 / corr_onetwo[rap_coef][pt_coef];
2048
2049 if (weight_all > thresholdweight) weight_all = 0;
2050 if (weight_two > thresholdweight) weight_two = 0;
2051 if (weight_onetwo > thresholdweight) weight_onetwo = 0;
2052
2054
2055 CDP_EMT_Pt_all_Outside->Fill(params.fPt, weight_all);
2056 CDP_EMT_Pt_all_Both->Fill(params.fPt, weight_all);
2057 if (rings_amount == 2) {
2058 CDP_EMT_Pt_two_Outside->Fill(params.fPt, weight_two);
2059 CDP_EMT_Pt_two_Both->Fill(params.fPt, weight_two);
2060 }
2061 if ((rings_amount == 1 || rings_amount == 2)) {
2062 CDP_EMT_Pt_onetwo_Outside->Fill(params.fPt, weight_two);
2063 CDP_EMT_Pt_onetwo_Both->Fill(params.fPt, weight_two);
2064 }
2065 }
2066 }
2067}
2068
2069
2071{
2072 gDirectory->mkdir("corrected photons");
2073 gDirectory->cd("corrected photons");
2074
2076
2077 gDirectory->mkdir("Target");
2078 gDirectory->cd("Target");
2079 gDirectory->mkdir("CheckCuts_Target");
2080 gDirectory->cd("CheckCuts_Target");
2081 for (UInt_t i = 0; i < fHistoList_dp_cuts_Target.size(); i++) {
2082 fHistoList_dp_cuts_Target[i]->Write();
2083 }
2084 gDirectory->cd("..");
2085 gDirectory->mkdir("all");
2086 gDirectory->cd("all");
2087 for (UInt_t i = 0; i < fHistoList_dp_all_Target.size(); i++) {
2088 fHistoList_dp_all_Target[i]->Write();
2089 }
2090 gDirectory->cd("..");
2091 gDirectory->mkdir("two");
2092 gDirectory->cd("two");
2093 for (UInt_t i = 0; i < fHistoList_dp_two_Target.size(); i++) {
2094 fHistoList_dp_two_Target[i]->Write();
2095 }
2096 gDirectory->cd("..");
2097 gDirectory->mkdir("onetwo");
2098 gDirectory->cd("onetwo");
2099 for (UInt_t i = 0; i < fHistoList_dp_onetwo_Target.size(); i++) {
2100 fHistoList_dp_onetwo_Target[i]->Write();
2101 }
2102 gDirectory->cd("..");
2103 for (UInt_t i = 0; i < fHistoList_dp_Target.size(); i++) {
2104 fHistoList_dp_Target[i]->Write();
2105 }
2106 gDirectory->cd("..");
2107
2108
2109 gDirectory->mkdir("Outside");
2110 gDirectory->cd("Outside");
2111 gDirectory->mkdir("CheckCuts_Outside");
2112 gDirectory->cd("CheckCuts_Outside");
2113 for (UInt_t i = 0; i < fHistoList_dp_cuts_Outside.size(); i++) {
2114 fHistoList_dp_cuts_Outside[i]->Write();
2115 }
2116 gDirectory->cd("..");
2117 gDirectory->mkdir("all");
2118 gDirectory->cd("all");
2119 for (UInt_t i = 0; i < fHistoList_dp_all_Outside.size(); i++) {
2120 fHistoList_dp_all_Outside[i]->Write();
2121 }
2122 gDirectory->cd("..");
2123 gDirectory->mkdir("two");
2124 gDirectory->cd("two");
2125 for (UInt_t i = 0; i < fHistoList_dp_two_Outside.size(); i++) {
2126 fHistoList_dp_two_Outside[i]->Write();
2127 }
2128 gDirectory->cd("..");
2129 gDirectory->mkdir("onetwo");
2130 gDirectory->cd("onetwo");
2131 for (UInt_t i = 0; i < fHistoList_dp_onetwo_Outside.size(); i++) {
2132 fHistoList_dp_onetwo_Outside[i]->Write();
2133 }
2134 gDirectory->cd("..");
2135 for (UInt_t i = 0; i < fHistoList_dp_Outside.size(); i++) {
2136 fHistoList_dp_Outside[i]->Write();
2137 }
2138 gDirectory->cd("..");
2139
2140
2141 gDirectory->mkdir("Both");
2142 gDirectory->cd("Both");
2143 gDirectory->mkdir("CheckCuts_Both");
2144 gDirectory->cd("CheckCuts_Both");
2145 for (UInt_t i = 0; i < fHistoList_dp_cuts_Both.size(); i++) {
2146 fHistoList_dp_cuts_Both[i]->Write();
2147 }
2148 gDirectory->cd("..");
2149 gDirectory->mkdir("all");
2150 gDirectory->cd("all");
2151 for (UInt_t i = 0; i < fHistoList_dp_all_Both.size(); i++) {
2152 fHistoList_dp_all_Both[i]->Write();
2153 }
2154 gDirectory->cd("..");
2155 gDirectory->mkdir("two");
2156 gDirectory->cd("two");
2157 for (UInt_t i = 0; i < fHistoList_dp_two_Both.size(); i++) {
2158 fHistoList_dp_two_Both[i]->Write();
2159 }
2160 gDirectory->cd("..");
2161 gDirectory->mkdir("onetwo");
2162 gDirectory->cd("onetwo");
2163 for (UInt_t i = 0; i < fHistoList_dp_onetwo_Both.size(); i++) {
2164 fHistoList_dp_onetwo_Both[i]->Write();
2165 }
2166 gDirectory->cd("..");
2167 for (UInt_t i = 0; i < fHistoList_dp_Both.size(); i++) {
2168 fHistoList_dp_Both[i]->Write();
2169 }
2170 gDirectory->cd("..");
2171
2172
2173 gDirectory->cd("..");
2174}
2175
2176
2178{
2179 // Target
2180 CMother_PDG_Target = new TH1D("CMother_PDG_Target", "CMother_PDG_Target; Id;#", 1000, -10, 490);
2182 CGrandMother_PDG_Target = new TH1D("CGrandMother_PDG_Target", "CGrandMother_PDG_Target; Id;#", 1000, -10, 490);
2184
2185 // Outside
2186 CMother_PDG_Outside = new TH1D("CMother_PDG_Outside", "CMother_PDG_Outside; Id;#", 1000, -10, 490);
2188 CGrandMother_PDG_Outside = new TH1D("CGrandMother_PDG_Outside", "CGrandMother_PDG_Outside; Id;#", 1000, -10, 490);
2190
2191 // Both
2193 new TH2D("CPdg_vs_Distance_for_dp", "CPdg_vs_Distance_for_dp; pdg; distance in cm", 2500, 0, 2499, 500, 0, 50);
2195 CP_vs_Distance_for_dp = new TH2D("CP_vs_Distance_for_dp",
2196 "CDistance between projected track and center of the ring (for e+ "
2197 "and e-); P in GeV/c^{2}; distance in cm",
2198 300, 0, 3, 300, 0, 15);
2200 CDP_AnnTruePairs = new TH1D("CDP_AnnTruePairs", "CDP_AnnTruePairs; Ann value ;#", 100, -1.2, 1.2);
2202 CDP_AnnFalsePairs = new TH1D("CDP_AnnFalsePairs", "CDP_AnnFalsePairs; Ann value ;#", 100, -1.2, 1.2);
2205 new TH1D("CDP_AnnTruePairs_AfterCuts", "CDP_AnnTruePairs_AfterCuts; Ann value ;#", 100, -1.2, 1.2);
2208 new TH1D("CDP_AnnFalsePairs_AfterCuts", "CDP_AnnFalsePairs_AfterCuts; Ann value ;#", 100, -1.2, 1.2);
2210
2211
2214 CDP_candidates_InvMass_vs_OA_Both = new TH2D("CDP_candidates_InvMass_vs_OA_Both",
2215 "CDP_candidates_InvMass_vs_OA_Both; invariant mass in GeV/c^{2}; "
2216 "opening angle in degree",
2217 500, 0, 0.5, 500, 0, 50);
2219 CDP_InvMass_vs_OA_Both = new TH2D("CDP_InvMass_vs_OA_Both",
2220 "CDP_InvMass_vs_OA_Both; invariant mass in "
2221 "GeV/c^{2}; opening angle in degree",
2222 500, 0, 0.5, 500, 0, 50);
2224 CDP_candidates_InvMass_Both = new TH1D("CDP_candidates_InvMass_Both",
2225 "CDP_candidates_InvMass_Both; invariant mass in GeV/c^{2};#", 510, -0.01, 0.5);
2227 CDP_InvMass_Both = new TH1D("CDP_InvMass_Both", "CDP_InvMass_Both; invariant mass in GeV/c^{2};#", 510, -0.01, 0.5);
2230 new TH1D("CDP_candidates_OA_Both", "CDP_candidates_OA_Both; opening angle in degree;#", 300, -0.1, 29.9);
2232 CDP_OA_Both = new TH1D("CDP_OA_Both", "CDP_OA_Both; opening angle in degree;#", 300, -0.1, 29.9);
2235 new TH1D("CDP_candidates_PlaneAngles_last_Both", "CDP_candidates_PlaneAngles_last_Both; #theta angle in degree;#",
2236 720, -1., 179.);
2239 new TH1D("CDP_PlaneAngles_last_Both", "CDP_PlaneAngles_last_Both; #theta angle in degree;#", 720, -1., 179.);
2242 new TH1D("CDP_candidates_PlaneAngles_first_Both", "CDP_candidates_PlaneAngles_first_Both; #theta angle in degree;#",
2243 720, -1., 179.);
2246 new TH1D("CDP_PlaneAngles_first_Both", "CDP_PlaneAngles_first_Both; #theta angle in degree;#", 720, -1., 179.);
2248
2250 CDP_candidates_InvMass_vs_OA_Target = new TH2D("CDP_candidates_InvMass_vs_OA_Target",
2251 "CDP_candidates_InvMass_vs_OA_Target; invariant mass in "
2252 "GeV/c^{2}; opening angle in degree",
2253 500, 0, 0.5, 500, 0, 50);
2255 CDP_InvMass_vs_OA_Target = new TH2D("CDP_InvMass_vs_OA_Target",
2256 "CDP_InvMass_vs_OA_Target; invariant mass in GeV/c^{2}; opening "
2257 "angle in degree",
2258 500, 0, 0.5, 500, 0, 50);
2261 "CDP_candidates_InvMass_Target", "CDP_candidates_InvMass_Target; invariant mass in GeV/c^{2};#", 510, -0.01, 0.5);
2264 new TH1D("CDP_InvMass_Target", "CDP_InvMass_Target; invariant mass in GeV/c^{2};#", 510, -0.01, 0.5);
2267 new TH1D("CDP_candidates_OA_Target", "CDP_candidates_OA_Target; opening angle in degree;#", 300, -0.1, 29.9);
2269 CDP_OA_Target = new TH1D("CDP_OA_Target", "CDP_OA_Target; opening angle in degree;#", 300, -0.1, 29.9);
2272 new TH1D("CDP_candidates_PlaneAngles_last_Target",
2273 "CDP_candidates_PlaneAngles_last_Target; #theta angle in degree;#", 720, -1., 179.);
2276 new TH1D("CDP_PlaneAngles_last_Target", "CDP_PlaneAngles_last_Target; #theta angle in degree;#", 720, -1., 179.);
2279 new TH1D("CDP_candidates_PlaneAngles_first_Target",
2280 "CDP_candidates_PlaneAngles_first_Target; #theta angle in degree;#", 720, -1., 179.);
2283 new TH1D("CDP_PlaneAngles_first_Target", "CDP_PlaneAngles_first_Target; #theta angle in degree;#", 720, -1., 179.);
2285
2287 CDP_candidates_InvMass_vs_OA_Outside = new TH2D("CDP_candidates_InvMass_vs_OA_Outside",
2288 "CDP_candidates_InvMass_vs_OA_Outside; invariant mass in "
2289 "GeV/c^{2}; opening angle in degree",
2290 500, 0, 0.5, 500, 0, 50);
2292 CDP_InvMass_vs_OA_Outside = new TH2D("CDP_InvMass_vs_OA_Outside",
2293 "CDP_InvMass_vs_OA_Outside; invariant mass in GeV/c^{2}; opening "
2294 "angle in degree",
2295 500, 0, 0.5, 500, 0, 50);
2298 "CDP_candidates_InvMass_Outside", "CDP_candidates_InvMass_Outside; invariant mass in GeV/c^{2};#", 510, -0.01, 0.5);
2301 new TH1D("CDP_InvMass_Outside", "CDP_InvMass_Outside; invariant mass in GeV/c^{2};#", 510, -0.01, 0.5);
2304 new TH1D("CDP_candidates_OA_Outside", "CDP_candidates_OA_Outside; opening angle in degree;#", 300, -0.1, 29.9);
2306 CDP_OA_Outside = new TH1D("CDP_OA_Outside", "CDP_OA_Outside; opening angle in degree;#", 300, -0.1, 29.9);
2309 new TH1D("CDP_candidates_PlaneAngles_last_Outside",
2310 "CDP_candidates_PlaneAngles_last_Outside; #theta angle in degree;#", 720, -1., 179.);
2313 new TH1D("CDP_PlaneAngles_last_Outside", "CDP_PlaneAngles_last_Outside; #theta angle in degree;#", 720, -1., 179.);
2316 new TH1D("CDP_candidates_PlaneAngles_first_Outside",
2317 "CDP_candidates_PlaneAngles_first_Outside; #theta angle in degree;#", 720, -1., 179.);
2319 CDP_PlaneAngles_first_Outside = new TH1D("CDP_PlaneAngles_first_Outside",
2320 "CDP_PlaneAngles_first_Outside; #theta angle in degree;#", 720, -1., 179.);
2322
2323
2324 // Target => all
2325 CDP_InvMassReco_all_Target = new TH1D("CDP_InvMassReco_all_Target",
2326 "CDP_InvMassReco_all_Target; invariant mass in GeV/c^{2};#", 50, -0.005, 0.045);
2329 new TH1D("CDP_OpeningAngleReco_all_Target", "CDP_OpeningAngleReco_all_Target; angle [deg];#", 45, -0.5, 4.);
2331 CDP_Pdg_all_Target = new TH1D("CDP_Pdg_all_Target", "CDP_Pdg_all_Target; Id;#", 1000, -10, 490);
2333 CDP_P_reco_all_Target = new TH1D("CDP_P_reco_all_Target", "CDP_P_reco_all_Target; P in GeV/c^{2};#", 200, 0, 10);
2335 CDP_Pt_reco_all_Target = new TH1D("CDP_Pt_reco_all_Target", "CDP_Pt_reco_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2338 new TH1D("CPh_fromTarget_Pt_reco_all_Target", "CPh_fromTarget_Pt_reco_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2341 new TH1D("CPh_fromPions_Pt_reco_all_Target", "CPh_fromPions_Pt_reco_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2344 new TH1D("CPh_fromEtas_Pt_reco_all_Target", "CPh_fromEtas_Pt_reco_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2347 new TH1D("CPh_fromDalitz_Pt_reco_all_Target", "CPh_fromDalitz_Pt_reco_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2350 new TH1D("CPh_fromXi_Pt_reco_all_Target", "CPh_fromXi_Pt_reco_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2353 new TH1D("CPh_fromOther_Pt_reco_all_Target", "CPh_fromOther_Pt_reco_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2356 "CPh_twoFromTarget_Pt_reco_all_Target", "CPh_twoFromTarget_Pt_reco_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2359 new TH1D("CPh_fromCombinatorial_Pt_reco_all_Target",
2360 "CPh_fromCombinatorial_Pt_reco_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2363 "CPh_fromConversion_Pt_reco_all_Target", "CPh_fromConversion_Pt_reco_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2366 new TH2D("CPh_pt_vs_rap_est_all_Target", "CPh_pt_vs_rap_est_all_Target; rapidity y; p_{t} in GeV/c ", 10, 0., 4.,
2367 40, 0., 4.);
2370 new TH2D("CPh_pt_vs_rap_est_corr_all_Target", "CPh_pt_vs_rap_est_corr_all_Target; rapidity y; p_{t} in GeV/c ", 10,
2371 0., 4., 40, 0., 4.);
2373
2374 // Target => two
2375 CDP_InvMassReco_two_Target = new TH1D("CDP_InvMassReco_two_Target",
2376 "CDP_InvMassReco_two_Target; invariant mass in GeV/c^{2};#", 50, -0.005, 0.045);
2379 new TH1D("CDP_OpeningAngleReco_two_Target", "CDP_OpeningAngleReco_two_Target; angle [deg];#", 45, -0.5, 4.);
2381 CDP_Pdg_two_Target = new TH1D("CDP_Pdg_two_Target", "CDP_Pdg_two_Target; Id;#", 1000, -10, 490);
2383 CDP_P_reco_two_Target = new TH1D("CDP_P_reco_two_Target", "CDP_P_reco_two_Target; P in GeV/c^{2};#", 200, 0, 10);
2385 CDP_Pt_reco_two_Target = new TH1D("CDP_Pt_reco_two_Target", "CDP_Pt_reco_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2388 new TH1D("CPh_fromTarget_Pt_reco_two_Target", "CPh_fromTarget_Pt_reco_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2391 new TH1D("CPh_fromPions_Pt_reco_two_Target", "CPh_fromPions_Pt_reco_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2394 new TH1D("CPh_fromEtas_Pt_reco_two_Target", "CPh_fromEtas_Pt_reco_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2397 new TH1D("CPh_fromDalitz_Pt_reco_two_Target", "CPh_fromDalitz_Pt_reco_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2400 new TH1D("CPh_fromXi_Pt_reco_two_Target", "CPh_fromXi_Pt_reco_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2403 new TH1D("CPh_fromOther_Pt_reco_two_Target", "CPh_fromOther_Pt_reco_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2406 "CPh_twoFromTarget_Pt_reco_two_Target", "CPh_twoFromTarget_Pt_reco_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2409 new TH1D("CPh_fromCombinatorial_Pt_reco_two_Target",
2410 "CPh_fromCombinatorial_Pt_reco_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2413 "CPh_fromConversion_Pt_reco_two_Target", "CPh_fromConversion_Pt_reco_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2416 new TH2D("CPh_pt_vs_rap_est_two_Target", "CPh_pt_vs_rap_est_two_Target; rapidity y; p_{t} in GeV/c ", 10, 0., 4.,
2417 40, 0., 4.);
2420 new TH2D("CPh_pt_vs_rap_est_corr_two_Target", "CPh_pt_vs_rap_est_corr_two_Target; rapidity y; p_{t} in GeV/c ", 10,
2421 0., 4., 40, 0., 4.);
2423
2424 // Target => onetwo
2426 "CDP_InvMassReco_onetwo_Target", "CDP_InvMassReco_onetwo_Target; invariant mass in GeV/c^{2};#", 50, -0.005, 0.045);
2429 new TH1D("CDP_OpeningAngleReco_onetwo_Target", "CDP_OpeningAngleReco_onetwo_Target; angle [deg];#", 45, -0.5, 4.);
2431 CDP_Pdg_onetwo_Target = new TH1D("CDP_Pdg_onetwo_Target", "CDP_Pdg_onetwo_Target; Id;#", 1000, -10, 490);
2434 new TH1D("CDP_P_reco_onetwo_Target", "CDP_P_reco_onetwo_Target; P in GeV/c^{2};#", 200, 0, 10);
2437 new TH1D("CDP_Pt_reco_onetwo_Target", "CDP_Pt_reco_onetwo_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2440 "CPh_fromTarget_Pt_reco_onetwo_Target", "CPh_fromTarget_Pt_reco_onetwo_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2442 CPh_fromPions_Pt_reco_onetwo_Target = new TH1D("CPh_fromPions_Pt_reco_onetwo_Target",
2443 "CPh_fromPions_Pt_reco_onetwo_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2445 CPh_fromEtas_Pt_reco_onetwo_Target = new TH1D("CPh_fromEtas_Pt_reco_onetwo_Target",
2446 "CPh_fromEtas_Pt_reco_onetwo_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2449 "CPh_fromDalitz_Pt_reco_onetwo_Target", "CPh_fromDalitz_Pt_reco_onetwo_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2452 new TH1D("CPh_fromXi_Pt_reco_onetwo_Target", "CPh_fromXi_Pt_reco_onetwo_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2454 CPh_fromOther_Pt_reco_onetwo_Target = new TH1D("CPh_fromOther_Pt_reco_onetwo_Target",
2455 "CPh_fromOther_Pt_reco_onetwo_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2458 new TH1D("CPh_twoFromTarget_Pt_reco_onetwo_Target", "CPh_twoFromTarget_Pt_reco_onetwo_Target; P_{t} in GeV/c^{2};#",
2459 30, 0, 3);
2462 new TH1D("CPh_fromCombinatorial_Pt_reco_onetwo_Target",
2463 "CPh_fromCombinatorial_Pt_reco_onetwo_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2466 new TH1D("CPh_fromConversion_Pt_reco_onetwo_Target",
2467 "CPh_fromConversion_Pt_reco_onetwo_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2470 new TH2D("CPh_pt_vs_rap_est_onetwo_Target", "CPh_pt_vs_rap_est_onetwo_Target; rapidity y; p_{t} in GeV/c ", 10, 0.,
2471 4., 40, 0., 4.);
2474 new TH2D("CPh_pt_vs_rap_est_corr_onetwo_Target",
2475 "CPh_pt_vs_rap_est_corr_onetwo_Target; rapidity y; p_{t} in GeV/c ", 10, 0., 4., 40, 0., 4.);
2477
2478
2479 // Outside => all
2480 CDP_InvMassReco_all_Outside = new TH1D(
2481 "CDP_InvMassReco_all_Outside", "CDP_InvMassReco_all_Outside; invariant mass in GeV/c^{2};#", 50, -0.005, 0.045);
2484 new TH1D("CDP_OpeningAngleReco_all_Outside", "CDP_OpeningAngleReco_all_Outside; angle [deg];#", 45, -0.5, 4.);
2486 CDP_Pdg_all_Outside = new TH1D("CDP_Pdg_all_Outside", "CDP_Pdg_all_Outside; Id;#", 1000, -10, 490);
2488 CDP_P_reco_all_Outside = new TH1D("CDP_P_reco_all_Outside", "CDP_P_reco_all_Outside; P in GeV/c^{2};#", 200, 0, 10);
2491 new TH1D("CDP_Pt_reco_all_Outside", "CDP_Pt_reco_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2493 CPh_fromTarget_Pt_reco_all_Outside = new TH1D("CPh_fromTarget_Pt_reco_all_Outside",
2494 "CPh_fromTarget_Pt_reco_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2497 new TH1D("CPh_fromPions_Pt_reco_all_Outside", "CPh_fromPions_Pt_reco_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2500 new TH1D("CPh_fromEtas_Pt_reco_all_Outside", "CPh_fromEtas_Pt_reco_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2502 CPh_fromDalitz_Pt_reco_all_Outside = new TH1D("CPh_fromDalitz_Pt_reco_all_Outside",
2503 "CPh_fromDalitz_Pt_reco_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2506 new TH1D("CPh_fromXi_Pt_reco_all_Outside", "CPh_fromXi_Pt_reco_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2509 new TH1D("CPh_fromOther_Pt_reco_all_Outside", "CPh_fromOther_Pt_reco_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2512 "CPh_twoFromTarget_Pt_reco_all_Outside", "CPh_twoFromTarget_Pt_reco_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2515 new TH1D("CPh_fromCombinatorial_Pt_reco_all_Outside",
2516 "CPh_fromCombinatorial_Pt_reco_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2519 "CPh_fromConversion_Pt_reco_all_Outside", "CPh_fromConversion_Pt_reco_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2522 new TH2D("CPh_pt_vs_rap_est_all_Outside", "CPh_pt_vs_rap_est_all_Outside; rapidity y; p_{t} in GeV/c ", 10, 0., 4.,
2523 40, 0., 4.);
2526 new TH2D("CPh_pt_vs_rap_est_corr_all_Outside", "CPh_pt_vs_rap_est_corr_all_Outside; rapidity y; p_{t} in GeV/c ",
2527 10, 0., 4., 40, 0., 4.);
2529
2530 // Outside => two
2531 CDP_InvMassReco_two_Outside = new TH1D(
2532 "CDP_InvMassReco_two_Outside", "CDP_InvMassReco_two_Outside; invariant mass in GeV/c^{2};#", 50, -0.005, 0.045);
2535 new TH1D("CDP_OpeningAngleReco_two_Outside", "CDP_OpeningAngleReco_two_Outside; angle [deg];#", 45, -0.5, 4.);
2537 CDP_Pdg_two_Outside = new TH1D("CDP_Pdg_two_Outside", "CDP_Pdg_two_Outside; Id;#", 1000, -10, 490);
2539 CDP_P_reco_two_Outside = new TH1D("CDP_P_reco_two_Outside", "CDP_P_reco_two_Outside; P in GeV/c^{2};#", 200, 0, 10);
2542 new TH1D("CDP_Pt_reco_two_Outside", "CDP_Pt_reco_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2544 CPh_fromTarget_Pt_reco_two_Outside = new TH1D("CPh_fromTarget_Pt_reco_two_Outside",
2545 "CPh_fromTarget_Pt_reco_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2548 new TH1D("CPh_fromPions_Pt_reco_two_Outside", "CPh_fromPions_Pt_reco_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2551 new TH1D("CPh_fromEtas_Pt_reco_two_Outside", "CPh_fromEtas_Pt_reco_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2553 CPh_fromDalitz_Pt_reco_two_Outside = new TH1D("CPh_fromDalitz_Pt_reco_two_Outside",
2554 "CPh_fromDalitz_Pt_reco_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2557 new TH1D("CPh_fromXi_Pt_reco_two_Outside", "CPh_fromXi_Pt_reco_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2560 new TH1D("CPh_fromOther_Pt_reco_two_Outside", "CPh_fromOther_Pt_reco_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2563 "CPh_twoFromTarget_Pt_reco_two_Outside", "CPh_twoFromTarget_Pt_reco_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2566 new TH1D("CPh_fromCombinatorial_Pt_reco_two_Outside",
2567 "CPh_fromCombinatorial_Pt_reco_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2570 "CPh_fromConversion_Pt_reco_two_Outside", "CPh_fromConversion_Pt_reco_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2573 new TH2D("CPh_pt_vs_rap_est_two_Outside", "CPh_pt_vs_rap_est_two_Outside; rapidity y; p_{t} in GeV/c ", 10, 0., 4.,
2574 40, 0., 4.);
2577 new TH2D("CPh_pt_vs_rap_est_corr_two_Outside", "CPh_pt_vs_rap_est_corr_two_Outside; rapidity y; p_{t} in GeV/c ",
2578 10, 0., 4., 40, 0., 4.);
2580
2581 // Outside => onetwo
2583 new TH1D("CDP_InvMassReco_onetwo_Outside", "CDP_InvMassReco_onetwo_Outside; invariant mass in GeV/c^{2};#", 50,
2584 -0.005, 0.045);
2587 new TH1D("CDP_OpeningAngleReco_onetwo_Outside", "CDP_OpeningAngleReco_onetwo_Outside; angle [deg];#", 45, -0.5, 4.);
2589 CDP_Pdg_onetwo_Outside = new TH1D("CDP_Pdg_onetwo_Outside", "CDP_Pdg_onetwo_Outside; Id;#", 1000, -10, 490);
2592 new TH1D("CDP_P_reco_onetwo_Outside", "CDP_P_reco_onetwo_Outside; P in GeV/c^{2};#", 200, 0, 10);
2595 new TH1D("CDP_Pt_reco_onetwo_Outside", "CDP_Pt_reco_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2598 "CPh_fromTarget_Pt_reco_onetwo_Outside", "CPh_fromTarget_Pt_reco_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2601 "CPh_fromPions_Pt_reco_onetwo_Outside", "CPh_fromPions_Pt_reco_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2603 CPh_fromEtas_Pt_reco_onetwo_Outside = new TH1D("CPh_fromEtas_Pt_reco_onetwo_Outside",
2604 "CPh_fromEtas_Pt_reco_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2607 "CPh_fromDalitz_Pt_reco_onetwo_Outside", "CPh_fromDalitz_Pt_reco_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2610 new TH1D("CPh_fromXi_Pt_reco_onetwo_Outside", "CPh_fromXi_Pt_reco_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2613 "CPh_fromOther_Pt_reco_onetwo_Outside", "CPh_fromOther_Pt_reco_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2616 new TH1D("CPh_twoFromTarget_Pt_reco_onetwo_Outside",
2617 "CPh_twoFromTarget_Pt_reco_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2620 new TH1D("CPh_fromCombinatorial_Pt_reco_onetwo_Outside",
2621 "CPh_fromCombinatorial_Pt_reco_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2624 new TH1D("CPh_fromConversion_Pt_reco_onetwo_Outside",
2625 "CPh_fromConversion_Pt_reco_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2628 new TH2D("CPh_pt_vs_rap_est_onetwo_Outside", "CPh_pt_vs_rap_est_onetwo_Outside; rapidity y; p_{t} in GeV/c ", 10,
2629 0., 4., 40, 0., 4.);
2632 new TH2D("CPh_pt_vs_rap_est_corr_onetwo_Outside",
2633 "CPh_pt_vs_rap_est_corr_onetwo_Outside; rapidity y; p_{t} in GeV/c ", 10, 0., 4., 40, 0., 4.);
2635
2636
2637 // Both => all
2639 new TH1D("CDP_InvMassReco_all_Both", "CDP_InvMassReco_all_Both; invariant mass in GeV/c^{2};#", 50, -0.005, 0.045);
2642 new TH1D("CDP_OpeningAngleReco_all_Both", "CDP_OpeningAngleReco_all_Both; angle [deg];#", 45, -0.5, 4.);
2644 CDP_Pdg_all_Both = new TH1D("CDP_Pdg_all_Both", "CDP_Pdg_all_Both; Id;#", 1000, -10, 490);
2646 CDP_P_reco_all_Both = new TH1D("CDP_P_reco_all_Both", "CDP_P_reco_all_Both; P in GeV/c^{2};#", 200, 0, 10);
2648 CDP_Pt_reco_all_Both = new TH1D("CDP_Pt_reco_all_Both", "CDP_Pt_reco_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2651 new TH1D("CPh_fromTarget_Pt_reco_all_Both", "CPh_fromTarget_Pt_reco_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2654 new TH1D("CPh_fromPions_Pt_reco_all_Both", "CPh_fromPions_Pt_reco_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2657 new TH1D("CPh_fromEtas_Pt_reco_all_Both", "CPh_fromEtas_Pt_reco_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2660 new TH1D("CPh_fromDalitz_Pt_reco_all_Both", "CPh_fromDalitz_Pt_reco_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2663 new TH1D("CPh_fromXi_Pt_reco_all_Both", "CPh_fromXi_Pt_reco_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2666 new TH1D("CPh_fromOther_Pt_reco_all_Both", "CPh_fromOther_Pt_reco_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2668 CPh_twoFromTarget_Pt_reco_all_Both = new TH1D("CPh_twoFromTarget_Pt_reco_all_Both",
2669 "CPh_twoFromTarget_Pt_reco_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2672 "CPh_fromCombinatorial_Pt_reco_all_Both", "CPh_fromCombinatorial_Pt_reco_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2674 CPh_fromConversion_Pt_reco_all_Both = new TH1D("CPh_fromConversion_Pt_reco_all_Both",
2675 "CPh_fromConversion_Pt_reco_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2677 CPh_pt_vs_rap_est_all_Both = new TH2D(
2678 "CPh_pt_vs_rap_est_all_Both", "CPh_pt_vs_rap_est_all_Both; rapidity y; p_{t} in GeV/c ", 10, 0., 4., 40, 0., 4.);
2681 new TH2D("CPh_pt_vs_rap_est_corr_all_Both", "CPh_pt_vs_rap_est_corr_all_Both; rapidity y; p_{t} in GeV/c ", 10, 0.,
2682 4., 40, 0., 4.);
2684
2685 // Both => two
2687 new TH1D("CDP_InvMassReco_two_Both", "CDP_InvMassReco_two_Both; invariant mass in GeV/c^{2};#", 50, -0.005, 0.045);
2690 new TH1D("CDP_OpeningAngleReco_two_Both", "CDP_OpeningAngleReco_two_Both; angle [deg];#", 45, -0.5, 4.);
2692 CDP_Pdg_two_Both = new TH1D("CDP_Pdg_two_Both", "CDP_Pdg_two_Both; Id;#", 1000, -10, 490);
2694 CDP_P_reco_two_Both = new TH1D("CDP_P_reco_two_Both", "CDP_P_reco_two_Both; P in GeV/c^{2};#", 200, 0, 10);
2696 CDP_Pt_reco_two_Both = new TH1D("CDP_Pt_reco_two_Both", "CDP_Pt_reco_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2699 new TH1D("CPh_fromTarget_Pt_reco_two_Both", "CPh_fromTarget_Pt_reco_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2702 new TH1D("CPh_fromPions_Pt_reco_two_Both", "CPh_fromPions_Pt_reco_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2705 new TH1D("CPh_fromEtas_Pt_reco_two_Both", "CPh_fromEtas_Pt_reco_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2708 new TH1D("CPh_fromDalitz_Pt_reco_two_Both", "CPh_fromDalitz_Pt_reco_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2711 new TH1D("CPh_fromXi_Pt_reco_two_Both", "CPh_fromXi_Pt_reco_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2714 new TH1D("CPh_fromOther_Pt_reco_two_Both", "CPh_fromOther_Pt_reco_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2716 CPh_twoFromTarget_Pt_reco_two_Both = new TH1D("CPh_twoFromTarget_Pt_reco_two_Both",
2717 "CPh_twoFromTarget_Pt_reco_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2720 "CPh_fromCombinatorial_Pt_reco_two_Both", "CPh_fromCombinatorial_Pt_reco_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2722 CPh_fromConversion_Pt_reco_two_Both = new TH1D("CPh_fromConversion_Pt_reco_two_Both",
2723 "CPh_fromConversion_Pt_reco_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2725 CPh_pt_vs_rap_est_two_Both = new TH2D(
2726 "CPh_pt_vs_rap_est_two_Both", "CPh_pt_vs_rap_est_two_Both; rapidity y; p_{t} in GeV/c ", 10, 0., 4., 40, 0., 4.);
2729 new TH2D("CPh_pt_vs_rap_est_corr_two_Both", "CPh_pt_vs_rap_est_corr_two_Both; rapidity y; p_{t} in GeV/c ", 10, 0.,
2730 4., 40, 0., 4.);
2732
2733 // Both => onetwo
2734 CDP_InvMassReco_onetwo_Both = new TH1D(
2735 "CDP_InvMassReco_onetwo_Both", "CDP_InvMassReco_onetwo_Both; invariant mass in GeV/c^{2};#", 50, -0.005, 0.045);
2738 new TH1D("CDP_OpeningAngleReco_onetwo_Both", "CDP_OpeningAngleReco_onetwo_Both; angle [deg];#", 45, -0.5, 4.);
2740 CDP_Pdg_onetwo_Both = new TH1D("CDP_Pdg_onetwo_Both", "CDP_Pdg_onetwo_Both; Id;#", 1000, -10, 490);
2742 CDP_P_reco_onetwo_Both = new TH1D("CDP_P_reco_onetwo_Both", "CDP_P_reco_onetwo_Both; P in GeV/c^{2};#", 200, 0, 10);
2745 new TH1D("CDP_Pt_reco_onetwo_Both", "CDP_Pt_reco_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2747 CPh_fromTarget_Pt_reco_onetwo_Both = new TH1D("CPh_fromTarget_Pt_reco_onetwo_Both",
2748 "CPh_fromTarget_Pt_reco_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2751 new TH1D("CPh_fromPions_Pt_reco_onetwo_Both", "CPh_fromPions_Pt_reco_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2754 new TH1D("CPh_fromEtas_Pt_reco_onetwo_Both", "CPh_fromEtas_Pt_reco_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2756 CPh_fromDalitz_Pt_reco_onetwo_Both = new TH1D("CPh_fromDalitz_Pt_reco_onetwo_Both",
2757 "CPh_fromDalitz_Pt_reco_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2760 new TH1D("CPh_fromXi_Pt_reco_onetwo_Both", "CPh_fromXi_Pt_reco_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2763 new TH1D("CPh_fromOther_Pt_reco_onetwo_Both", "CPh_fromOther_Pt_reco_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2766 "CPh_twoFromTarget_Pt_reco_onetwo_Both", "CPh_twoFromTarget_Pt_reco_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2769 new TH1D("CPh_fromCombinatorial_Pt_reco_onetwo_Both",
2770 "CPh_fromCombinatorial_Pt_reco_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2773 "CPh_fromConversion_Pt_reco_onetwo_Both", "CPh_fromConversion_Pt_reco_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2776 new TH2D("CPh_pt_vs_rap_est_onetwo_Both", "CPh_pt_vs_rap_est_onetwo_Both; rapidity y; p_{t} in GeV/c ", 10, 0., 4.,
2777 40, 0., 4.);
2780 new TH2D("CPh_pt_vs_rap_est_corr_onetwo_Both", "CPh_pt_vs_rap_est_corr_onetwo_Both; rapidity y; p_{t} in GeV/c ",
2781 10, 0., 4., 40, 0., 4.);
2783
2784 // EMT Target
2785 CDP_EMT_Pt_all_Target = new TH1D("CDP_EMT_Pt_all_Target", "CDP_EMT_Pt_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2787 CDP_EMT_Pt_two_Target = new TH1D("CDP_EMT_Pt_two_Target", "CDP_EMT_Pt_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2790 new TH1D("CDP_EMT_Pt_onetwo_Target", "CDP_EMT_Pt_onetwo_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2792
2793 // EMT Outside
2794 CDP_EMT_Pt_all_Outside = new TH1D("CDP_EMT_Pt_all_Outside", "CDP_EMT_Pt_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2796 CDP_EMT_Pt_two_Outside = new TH1D("CDP_EMT_Pt_two_Outside", "CDP_EMT_Pt_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2799 new TH1D("CDP_EMT_Pt_onetwo_Outside", "CDP_EMT_Pt_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2801
2802 // EMT Both
2803 CDP_EMT_Pt_all_Both = new TH1D("CDP_EMT_Pt_all_Both", "CDP_EMT_Pt_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2805 CDP_EMT_Pt_two_Both = new TH1D("CDP_EMT_Pt_two_Both", "CDP_EMT_Pt_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2807 CDP_EMT_Pt_onetwo_Both = new TH1D("CDP_EMT_Pt_onetwo_Both", "CDP_EMT_Pt_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2809
2810
2811 // CDP_LK_EMT Target
2813 new TH1D("CDP_LK_EMT_Pt_all_Target", "CDP_LK_EMT_Pt_all_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2816 new TH1D("CDP_LK_EMT_Pt_two_Target", "CDP_LK_EMT_Pt_two_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2819 new TH1D("CDP_LK_EMT_Pt_onetwo_Target", "CDP_LK_EMT_Pt_onetwo_Target; P_{t} in GeV/c^{2};#", 30, 0, 3);
2821
2822
2823 // CDP_LK_EMT Outside
2825 new TH1D("CDP_LK_EMT_Pt_all_Outside", "CDP_LK_EMT_Pt_all_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2828 new TH1D("CDP_LK_EMT_Pt_two_Outside", "CDP_LK_EMT_Pt_two_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2831 new TH1D("CDP_LK_EMT_Pt_onetwo_Outside", "CDP_LK_EMT_Pt_onetwo_Outside; P_{t} in GeV/c^{2};#", 30, 0, 3);
2833
2834
2835 // CDP_LK_EMT Both
2836 CDP_LK_EMT_Pt_all_Both = new TH1D("CDP_LK_EMT_Pt_all_Both", "CDP_LK_EMT_Pt_all_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2838 CDP_LK_EMT_Pt_two_Both = new TH1D("CDP_LK_EMT_Pt_two_Both", "CDP_LK_EMT_Pt_two_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2841 new TH1D("CDP_LK_EMT_Pt_onetwo_Both", "CDP_LK_EMT_Pt_onetwo_Both; P_{t} in GeV/c^{2};#", 30, 0, 3);
2843}
Data class for a reconstructed hit in the STS.
Data class for STS tracks.
int32_t GetStsTrackIndex() const
int32_t GetRichRingIndex() const
double GetZ() const
Definition CbmHit.h:71
static void SetKFParticleFromStsTrack(CbmStsTrack *track, KFParticle *particle, Int_t pdg=211, Bool_t firstPoint=kTRUE)
Double_t & GetRefZ()
Definition CbmKFVertex.h:27
Double_t & GetRefX()
Definition CbmKFVertex.h:25
Double_t & GetRefY()
Definition CbmKFVertex.h:26
std::vector< CbmStsTrack * > CDP_LK_EMT_STS_minus_Outside
std::vector< std::vector< TVector3 > > CDP_EMT_Hits_plus_Target
void Exec(int fEventNumDP, double OpeningAngleCut, double GammaInvMassCut, int RealPID)
void SaveTargetTracks(CbmMCTrack *mcTrack1, CbmStsTrack *stsTrack, TVector3 refmom, double charge, int stsInd, int richInd, int stsMcTrackId, CbmRichRing *RING)
std::vector< TVector3 > SaveAllHits(CbmStsTrack *track)
void CDP_likesign_Mixing_Outside(double AngleCut, double InvMassCut)
void CDP_likesign_Mixing_Target(double AngleCut, double InvMassCut)
int CheckIfElectron(CbmRichRing *ring, double momentum)
std::vector< std::vector< double > > corr_two
void CDP_Mixing_Target(double AngleCut, double InvMassCut)
std::vector< CbmStsTrack * > CDP_EMT_momenta_plus_Outside
std::vector< CbmStsTrack * > CDP_EMT_momenta_minus_Outside
double CalculatePlaneAngle_last(CbmStsTrack *Sts_1, CbmStsTrack *Sts_2)
std::vector< std::vector< TVector3 > > CDP_EMT_Hits_minus_Outside
void SaveOutsideTracks(CbmMCTrack *mcTrack1, CbmStsTrack *stsTrack, double charge, int stsInd, int richInd, int stsMcTrackId, CbmRichRing *RING)
void CDP_Mixing_Outside(double AngleCut, double InvMassCut)
double CalculatePlaneAngle_first(CbmStsTrack *Sts_1, CbmStsTrack *Sts_2)
void FindGammasTarget(int EventNumMan, double AngleCut, double InvMassCut, int RealPID, vector< CbmMCTrack * > MCtracks_minus, vector< CbmMCTrack * > MCtracks_plus, vector< CbmStsTrack * > StsTrack_minus, vector< CbmStsTrack * > StsTrack_plus, vector< TVector3 > Momenta_minus, vector< TVector3 > Momenta_plus, std::vector< int > Rings_minus, std::vector< int > Rings_plus, std::vector< int > stsIndex_minus, std::vector< int > stsIndex_plus, vector< CbmRichRing * > richRing_minus, vector< CbmRichRing * > richRing_plus)
std::vector< std::vector< double > > corr_all
std::vector< std::vector< TVector3 > > CDP_EMT_Hits_minus_Target
std::vector< std::vector< double > > corr_onetwo
std::vector< std::vector< TVector3 > > CDP_EMT_Hits_plus_Outside
double CalculatePlaneAngle_last_fromHits(std::vector< TVector3 > track_1, std::vector< TVector3 > track_2)
void FindGammasOutside(int EventNumMan, double AngleCut, double InvMassCut, int RealPID, vector< CbmMCTrack * > MCtracks_minus_Outside, vector< CbmMCTrack * > MCtracks_plus_Outside, vector< CbmStsTrack * > StsTrack_minus_Outside, vector< CbmStsTrack * > StsTrack_plus_Outside, std::vector< int > Rings_minus_Outside, std::vector< int > Rings_plus_Outside, std::vector< int > stsIndex_minus_Outside, std::vector< int > stsIndex_plus_Outside, vector< CbmRichRing * > richRing_minus_Outside, vector< CbmRichRing * > richRing_plus_Outside)
static TVector3 FitToVertexAndGetChi(CbmStsTrack *stsTrack, double x, double y, double z, double &chi)
static Double_t CalculateOpeningAngle_Reco(TVector3 electron1, TVector3 electron2)
static double Invmass_2particles_RECO(const TVector3 part1, const TVector3 part2)
static TVector3 FitToVertex(CbmStsTrack *stsTrack, double x, double y, double z)
static LmvmKinePar CalculateKinematicParamsReco(const TVector3 electron1, const TVector3 electron2)
void Init(std::vector< std::vector< double > > &vect_all, std::vector< std::vector< double > > &vect_two, std::vector< std::vector< double > > &vect_onetwo, double OA, double IM)
double DoSelect(double InvariantMass, double OpeningAngle, double PlaneAngle_last, double ZPos, TVector3 Momentum1, TVector3 Momentum2)
void Exec(int event, int IdForANN, double InvariantMass, double OpeningAngle, double PlaneAngle_last, double ZPos, TVector3 Momentum1, TVector3 Momentum2)
double GetP() const
Definition CbmMCTrack.h:98
int32_t GetMotherId() const
Definition CbmMCTrack.h:69
int32_t GetPdgCode() const
Definition CbmMCTrack.h:68
int32_t GetNofLinks() const
Definition CbmMatch.h:42
const CbmLink & GetMatchedLink() const
Definition CbmMatch.h:41
void Position(TVector3 &pos) const
Copies hit position to pos.
double GetY() const
Definition CbmPixelHit.h:74
double GetX() const
Definition CbmPixelHit.h:73
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
virtual void DoFit(CbmRichRingLight *ring)
Inherited from CbmRichRingFitterBase.
float GetAaxis() const
float GetBaxis() const
void AddHit(CbmRichHitLight hit)
Add new hit to the ring.
uint32_t GetHit(int32_t i) const
Definition CbmRichRing.h:39
int32_t GetNofHits() const
Definition CbmRichRing.h:37
static double GetRingTrackDistance(int globalTrackId)
data class for a reconstructed 3-d hit in the STS
Definition CbmStsHit.h:35
int32_t GetNofMvdHits() const
Definition CbmStsTrack.h:87
int32_t GetMvdHitIndex(int32_t iHit) const
Definition CbmStsTrack.h:75
int32_t GetStsHitIndex(int32_t iHit) const
int32_t GetNofStsHits() const
Definition CbmStsTrack.h:93
const FairTrackParam * GetParamFirst() const
Definition CbmTrack.h:68
Double_t fPt
Definition LmvmKinePar.h:20
Double_t fMomentumMag
Definition LmvmKinePar.h:19
Double_t fRapidity
Definition LmvmKinePar.h:21
Hash for CbmL1LinkKey.