6 #ifndef CBM_ANA_CONVERSION_GLOBAL_FUNCTIONS
7 #define CBM_ANA_CONVERSION_GLOBAL_FUNCTIONS
14 #include "FairRootManager.h"
16 #include "TClonesArray.h"
17 #include "TLorentzVector.h"
20 #define M2E 2.6112004954086e-7
28 FairRootManager* ioman = FairRootManager::Instance();
29 if (NULL == ioman)
return -2;
30 TClonesArray* fGlobalTracks =
31 (TClonesArray*) ioman->GetObject(
"GlobalTrack");
32 if (NULL == fGlobalTracks)
return -2;
33 TClonesArray* fRichRings = (TClonesArray*) ioman->GetObject(
"RichRing");
34 if (NULL == fRichRings)
return -2;
39 static_cast<const CbmGlobalTrack*
>(fGlobalTracks->At(globalTrackIndex));
41 if (richId < 0)
return -2;
43 if (NULL == ring)
return -2;
46 globalTrackIndex, momentum);
56 FairRootManager* ioman = FairRootManager::Instance();
57 if (NULL == ioman)
return -2;
58 TClonesArray* fGlobalTracks =
59 (TClonesArray*) ioman->GetObject(
"GlobalTrack");
60 if (NULL == fGlobalTracks)
return -2;
61 TClonesArray* fRichRings = (TClonesArray*) ioman->GetObject(
"RichRing");
62 if (NULL == fRichRings)
return -2;
68 static_cast<const CbmGlobalTrack*
>(fGlobalTracks->At(globalTrackIndex));
70 if (richId < 0)
return -2;
72 if (NULL == ring)
return -2;
75 globalTrackIndex, momentum);
84 const TVector3 part12,
85 const TVector3 part21,
86 const TVector3 part22) {
87 Double_t openingAngle = 0;
89 Double_t energy11 = TMath::Sqrt(part11.Mag2() +
M2E);
90 TLorentzVector lorVec11(part11, energy11);
92 Double_t energy12 = TMath::Sqrt(part12.Mag2() +
M2E);
93 TLorentzVector lorVec12(part12, energy12);
95 Double_t energy21 = TMath::Sqrt(part21.Mag2() +
M2E);
96 TLorentzVector lorVec21(part21, energy21);
98 Double_t energy22 = TMath::Sqrt(part22.Mag2() +
M2E);
99 TLorentzVector lorVec22(part22, energy22);
101 TLorentzVector gamma1 = lorVec11 + lorVec12;
102 TLorentzVector gamma2 = lorVec21 + lorVec22;
104 Double_t angle = gamma1.Angle(gamma2.Vect());
105 openingAngle = 180. * angle /
TMath::Pi();