EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
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
43
const
erhic::ParticleMC
*
EicRcParticle::GetGeneratorTrack
()
const
44
{
45
EicRootManager
*io =
EicRootManager::Instance
();
46
47
return
io ? io->
GetGenMcTrack
(
mGeneratorEventIndex
) : 0;
48
}
// EicRcParticle::GetGeneratorTrack()
49
50
// ---------------------------------------------------------------------------------------
51
52
const
PndMCTrack
*
EicRcParticle::GetPndMcTrack
()
const
53
{
54
EicRootManager
*io =
EicRootManager::Instance
();
55
if
( !io || !io->
GetPndMcTracks
() ||
mPndMCTrackIndex
== -1)
return
0;
56
57
io->
SynchronizeBranch
(io->
GetPndMcBranch
());
58
59
return
mPndMCTrackIndex
< io->
GetPndMcTracks
()->GetEntriesFast() ?
60
(
PndMCTrack
*)io->
GetPndMcTracks
()->At(
mPndMCTrackIndex
) : 0;
61
}
// EicRcParticle::GetPndMCTrack()
62
63
// ---------------------------------------------------------------------------------------
64
65
const
PndPidCandidate
*
EicRcParticle::GetPndPidCandidate
()
const
66
{
67
EicRootManager
*io =
EicRootManager::Instance
();
68
if
( !io || !io->
GetPndPidCandidates
() ||
mPndPidChargedCandIndex
== -1)
return
0;
69
70
io->
SynchronizeBranch
(io->
GetPndPidBranch
());
71
72
return
mPndPidChargedCandIndex
< io->
GetPndPidCandidates
()->GetEntriesFast() ?
73
(
PndPidCandidate
*)io->
GetPndPidCandidates
()->At(
mPndPidChargedCandIndex
) : 0;
74
}
// EicRcParticle::GetPndPidCandidate()
75
76
// ---------------------------------------------------------------------------------------
77
78
ClassImp
(
EicRcParticle
)
79
ClassImp
(
EicRcCalorimeterHit
)
80
EicRoot
blob
master
eic
event
EicRcParticle.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:35
using
1.8.2 with
EIC GitHub integration