Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
a4ff6ac2
Commit
a4ff6ac2
authored
4 years ago
by
Volker Friese
Committed by
Florian Uhlig
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Removed fatal error from CbmMCTrack if PDG code not found in TDatabasePDG. Refs #1826.
parent
8f20a3bc
No related branches found
No related tags found
1 merge request
!347
Removed fatal error from CbmMCTrack if PDG code not found in TDatabasePDG. Refs #1826.
Pipeline
#9904
passed
4 years ago
Stage: documentation
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/data/CbmMCTrack.cxx
+48
-55
48 additions, 55 deletions
core/data/CbmMCTrack.cxx
with
48 additions
and
55 deletions
core/data/CbmMCTrack.cxx
+
48
−
55
View file @
a4ff6ac2
...
...
@@ -33,21 +33,15 @@ CbmMCTrack::CbmMCTrack()
,
fStartY
(
0.
)
,
fStartZ
(
0.
)
,
fStartT
(
0.
)
,
fNPoints
(
0
)
{}
,
fNPoints
(
0
)
{
}
// -------------------------------------------------------------------------
// ----- Standard constructor ------------------------------------------
CbmMCTrack
::
CbmMCTrack
(
Int_t
pdgCode
,
Int_t
motherId
,
Double_t
px
,
Double_t
py
,
Double_t
pz
,
Double_t
x
,
Double_t
y
,
Double_t
z
,
Double_t
t
,
Int_t
nPoints
=
0
)
CbmMCTrack
::
CbmMCTrack
(
Int_t
pdgCode
,
Int_t
motherId
,
Double_t
px
,
Double_t
py
,
Double_t
pz
,
Double_t
x
,
Double_t
y
,
Double_t
z
,
Double_t
t
,
Int_t
nPoints
=
0
)
:
TObject
()
,
fProcessId
(
kPNoProcess
)
,
fPdgCode
(
pdgCode
)
...
...
@@ -60,7 +54,8 @@ CbmMCTrack::CbmMCTrack(Int_t pdgCode,
,
fStartY
(
y
)
,
fStartZ
(
z
)
,
fStartT
(
t
)
,
fNPoints
(
0
)
{
,
fNPoints
(
0
)
{
if
(
nPoints
>=
0
)
fNPoints
=
nPoints
;
// else fNPoints = 0;
}
...
...
@@ -81,7 +76,8 @@ CbmMCTrack::CbmMCTrack(const CbmMCTrack& track)
,
fStartY
(
track
.
fStartY
)
,
fStartZ
(
track
.
fStartZ
)
,
fStartT
(
track
.
fStartT
)
,
fNPoints
(
track
.
fNPoints
)
{
,
fNPoints
(
track
.
fNPoints
)
{
// *this = track;
}
// -------------------------------------------------------------------------
...
...
@@ -101,7 +97,9 @@ CbmMCTrack::CbmMCTrack(TParticle* part)
,
fStartY
(
part
->
Vy
())
,
fStartZ
(
part
->
Vz
())
,
fStartT
(
part
->
T
()
*
1e09
)
,
fNPoints
(
0
)
{}
,
fNPoints
(
0
)
{
}
// -------------------------------------------------------------------------
...
...
@@ -111,7 +109,8 @@ CbmMCTrack::~CbmMCTrack() {}
// ----- Public method GetMass -----------------------------------------
Double_t
CbmMCTrack
::
GetMass
()
const
{
Double_t
CbmMCTrack
::
GetMass
()
const
{
if
(
TDatabasePDG
::
Instance
())
{
TParticlePDG
*
particle
=
TDatabasePDG
::
Instance
()
->
GetParticle
(
fPdgCode
);
...
...
@@ -132,8 +131,10 @@ Double_t CbmMCTrack::GetMass() const {
return
0.
;
// Unknown particle type
else
LOG
(
fatal
)
<<
"CbmMCTrack: Unknown PDG code "
<<
fPdgCode
;
else
{
LOG
(
error
)
<<
"CbmMCTrack: Unknown PDG code "
<<
fPdgCode
;
return
0.
;
}
}
//? Instance of TDatabasePDG
LOG
(
fatal
)
<<
"CbmMCTrack: No TDatabasePDG"
;
...
...
@@ -143,7 +144,8 @@ Double_t CbmMCTrack::GetMass() const {
// ----- Public method GetCharge ---------------------------------------
Double_t
CbmMCTrack
::
GetCharge
()
const
{
Double_t
CbmMCTrack
::
GetCharge
()
const
{
if
(
TDatabasePDG
::
Instance
())
{
TParticlePDG
*
particle
=
TDatabasePDG
::
Instance
()
->
GetParticle
(
fPdgCode
);
...
...
@@ -163,8 +165,10 @@ Double_t CbmMCTrack::GetCharge() const {
return
0.
;
// Unknown particle type
else
LOG
(
fatal
)
<<
"CbmMCTrack: Unknown PDG code "
<<
fPdgCode
;
else
{
LOG
(
error
)
<<
"CbmMCTrack: Unknown PDG code "
<<
fPdgCode
;
return
0.
;
}
}
//? Instance of TDatabasePDG
LOG
(
fatal
)
<<
"CbmMCTrack: No TDatabasePDG"
;
...
...
@@ -174,7 +178,8 @@ Double_t CbmMCTrack::GetCharge() const {
// ----- Public method GetRapidity -------------------------------------
Double_t
CbmMCTrack
::
GetRapidity
()
const
{
Double_t
CbmMCTrack
::
GetRapidity
()
const
{
Double_t
e
=
GetEnergy
();
Double_t
y
=
0.5
*
TMath
::
Log
((
e
+
fPz
)
/
(
e
-
fPz
));
return
y
;
...
...
@@ -183,9 +188,9 @@ Double_t CbmMCTrack::GetRapidity() const {
// ----- Public method GetNPoints --------------------------------------
Int_t
CbmMCTrack
::
GetNPoints
(
ECbmModuleId
detId
)
const
{
if
(
detId
==
ECbmModuleId
::
kRef
)
return
(
fNPoints
&
1
);
Int_t
CbmMCTrack
::
GetNPoints
(
ECbmModuleId
detId
)
const
{
if
(
detId
==
ECbmModuleId
::
kRef
)
return
(
fNPoints
&
1
);
else
if
(
detId
==
ECbmModuleId
::
kMvd
)
return
((
fNPoints
&
(
7
<<
1
))
>>
1
);
else
if
(
detId
==
ECbmModuleId
::
kSts
)
...
...
@@ -211,75 +216,67 @@ Int_t CbmMCTrack::GetNPoints(ECbmModuleId detId) const {
// ----- Public method SetNPoints --------------------------------------
void
CbmMCTrack
::
SetNPoints
(
ECbmModuleId
iDet
,
Int_t
nPoints
)
{
void
CbmMCTrack
::
SetNPoints
(
ECbmModuleId
iDet
,
Int_t
nPoints
)
{
if
(
iDet
==
ECbmModuleId
::
kRef
)
{
if
(
nPoints
<
0
)
nPoints
=
0
;
if
(
nPoints
<
0
)
nPoints
=
0
;
else
if
(
nPoints
>
1
)
nPoints
=
1
;
fNPoints
=
(
fNPoints
&
(
~
1
))
|
nPoints
;
}
else
if
(
iDet
==
ECbmModuleId
::
kMvd
)
{
if
(
nPoints
<
0
)
nPoints
=
0
;
if
(
nPoints
<
0
)
nPoints
=
0
;
else
if
(
nPoints
>
7
)
nPoints
=
7
;
fNPoints
=
(
fNPoints
&
(
~
(
7
<<
1
)))
|
(
nPoints
<<
1
);
}
else
if
(
iDet
==
ECbmModuleId
::
kSts
)
{
if
(
nPoints
<
0
)
nPoints
=
0
;
if
(
nPoints
<
0
)
nPoints
=
0
;
else
if
(
nPoints
>
31
)
nPoints
=
31
;
fNPoints
=
(
fNPoints
&
(
~
(
31
<<
4
)))
|
(
nPoints
<<
4
);
}
else
if
(
iDet
==
ECbmModuleId
::
kRich
)
{
if
(
nPoints
<
0
)
nPoints
=
0
;
if
(
nPoints
<
0
)
nPoints
=
0
;
else
if
(
nPoints
>
1
)
nPoints
=
1
;
fNPoints
=
(
fNPoints
&
(
~
(
1
<<
9
)))
|
(
nPoints
<<
9
);
}
else
if
(
iDet
==
ECbmModuleId
::
kMuch
)
{
if
(
nPoints
<
0
)
nPoints
=
0
;
if
(
nPoints
<
0
)
nPoints
=
0
;
else
if
(
nPoints
>
31
)
nPoints
=
31
;
fNPoints
=
(
fNPoints
&
(
~
(
31
<<
10
)))
|
(
nPoints
<<
10
);
}
else
if
(
iDet
==
ECbmModuleId
::
kTrd
)
{
if
(
nPoints
<
0
)
nPoints
=
0
;
if
(
nPoints
<
0
)
nPoints
=
0
;
else
if
(
nPoints
>
31
)
nPoints
=
31
;
fNPoints
=
(
fNPoints
&
(
~
(
31
<<
15
)))
|
(
nPoints
<<
15
);
}
else
if
(
iDet
==
ECbmModuleId
::
kTof
)
{
if
(
nPoints
<
0
)
nPoints
=
0
;
if
(
nPoints
<
0
)
nPoints
=
0
;
else
if
(
nPoints
>
15
)
nPoints
=
15
;
fNPoints
=
(
fNPoints
&
(
~
(
15
<<
20
)))
|
(
nPoints
<<
20
);
}
else
if
(
iDet
==
ECbmModuleId
::
kEcal
)
{
if
(
nPoints
<
0
)
nPoints
=
0
;
if
(
nPoints
<
0
)
nPoints
=
0
;
else
if
(
nPoints
>
1
)
nPoints
=
1
;
fNPoints
=
(
fNPoints
&
(
~
(
1
<<
24
)))
|
(
nPoints
<<
24
);
}
else
if
(
iDet
==
ECbmModuleId
::
kPsd
)
{
if
(
nPoints
<
0
)
nPoints
=
0
;
if
(
nPoints
<
0
)
nPoints
=
0
;
else
if
(
nPoints
>
1
)
nPoints
=
1
;
fNPoints
=
(
fNPoints
&
(
~
(
1
<<
25
)))
|
(
nPoints
<<
25
);
...
...
@@ -292,19 +289,15 @@ void CbmMCTrack::SetNPoints(ECbmModuleId iDet, Int_t nPoints) {
// ----- String output -------------------------------------------------
std
::
string
CbmMCTrack
::
ToString
()
const
{
std
::
string
CbmMCTrack
::
ToString
()
const
{
stringstream
ss
;
ss
<<
"MCTrack: mother "
<<
fMotherId
<<
", GeantProcess "
<<
TMCProcessName
[
fProcessId
]
<<
", Type "
<<
fPdgCode
<<
", momentum ("
<<
fPx
<<
", "
<<
fPy
<<
", "
<<
fPz
<<
") GeV"
<<
std
::
endl
;
ss
<<
" Ref "
<<
GetNPoints
(
ECbmModuleId
::
kRef
)
<<
", MVD "
<<
GetNPoints
(
ECbmModuleId
::
kMvd
)
<<
", STS "
<<
GetNPoints
(
ECbmModuleId
::
kSts
)
<<
", RICH "
<<
GetNPoints
(
ECbmModuleId
::
kRich
)
<<
", MUCH "
<<
GetNPoints
(
ECbmModuleId
::
kMuch
)
<<
", TRD "
<<
GetNPoints
(
ECbmModuleId
::
kTrd
)
<<
", TOF "
<<
GetNPoints
(
ECbmModuleId
::
kTof
)
<<
", ECAL "
<<
GetNPoints
(
ECbmModuleId
::
kEcal
)
<<
", PSD "
ss
<<
"MCTrack: mother "
<<
fMotherId
<<
", GeantProcess "
<<
TMCProcessName
[
fProcessId
]
<<
", Type "
<<
fPdgCode
<<
", momentum ("
<<
fPx
<<
", "
<<
fPy
<<
", "
<<
fPz
<<
") GeV"
<<
std
::
endl
;
ss
<<
" Ref "
<<
GetNPoints
(
ECbmModuleId
::
kRef
)
<<
", MVD "
<<
GetNPoints
(
ECbmModuleId
::
kMvd
)
<<
", STS "
<<
GetNPoints
(
ECbmModuleId
::
kSts
)
<<
", RICH "
<<
GetNPoints
(
ECbmModuleId
::
kRich
)
<<
", MUCH "
<<
GetNPoints
(
ECbmModuleId
::
kMuch
)
<<
", TRD "
<<
GetNPoints
(
ECbmModuleId
::
kTrd
)
<<
", TOF "
<<
GetNPoints
(
ECbmModuleId
::
kTof
)
<<
", ECAL "
<<
GetNPoints
(
ECbmModuleId
::
kEcal
)
<<
", PSD "
<<
GetNPoints
(
ECbmModuleId
::
kPsd
)
<<
std
::
endl
;
return
ss
.
str
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment