EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EicRcParticle.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EicRcParticle.cxx
1 //
2 // AYK (ayk@bnl.gov), 2014/07/08
3 //
4 // EIC reconstructed particle class; interface to eic-smear,
5 // PANDA classes (like MCTrack and PidChargedCand) is conveniently
6 // hidden from end user;
7 //
8 
9 #include <TClonesArray.h>
10 
11 #include <EicEventAssembler.h>
12 #include <EicRootManager.h>
13 #include <EicRcParticle.h>
14 
15 // ---------------------------------------------------------------------------------------
16 
17 //
18 // Follow the logic of ParticleMCS::GetEta() & ParticleMCS::GetRapidity(); in particular
19 // use 19. as a default value in both cases;
20 //
21 
22 #define _DEFAULT_RAPIDITY_ (19.)
23 
24 Double_t EicRcParticle::GetEta() const
25 {
26  // Well, this can not fail for a valid 3D TVector3, or?;
27  double theta = GetTheta();
28 
29  return (theta > 0.0 && theta < TMath::Pi() ? -log(tan(theta/2.)) : _DEFAULT_RAPIDITY_);
30 } // EicRcParticle::GetEta()
31 
32 Double_t EicRcParticle::GetRapidity() const
33 {
34  // Yes, prefer to hide behind these methods, whatever GetE() is;
35  double E = GetE(), Pz = GetPz();
36 
37  // In the present scheme "E>Pz" is always true; well, keep the check anyway;
38  return (E > Pz ? 0.5 * log((E + Pz) / (E - Pz)) : _DEFAULT_RAPIDITY_);
39 } // EicRcParticle::GetRapidity()
40 
41 // ---------------------------------------------------------------------------------------
42 
44 {
46 
47  return io ? io->GetGenMcTrack(mGeneratorEventIndex) : 0;
48 } // EicRcParticle::GetGeneratorTrack()
49 
50 // ---------------------------------------------------------------------------------------
51 
53 {
55  if ( !io || !io->GetPndMcTracks() || mPndMCTrackIndex == -1) return 0;
56 
58 
59  return mPndMCTrackIndex < io->GetPndMcTracks()->GetEntriesFast() ?
61 } // EicRcParticle::GetPndMCTrack()
62 
63 // ---------------------------------------------------------------------------------------
64 
66 {
68  if ( !io || !io->GetPndPidCandidates() || mPndPidChargedCandIndex == -1) return 0;
69 
71 
72  return mPndPidChargedCandIndex < io->GetPndPidCandidates()->GetEntriesFast() ?
74 } // EicRcParticle::GetPndPidCandidate()
75 
76 // ---------------------------------------------------------------------------------------
77 
80