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
CbmMCMatch.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file CbmMCMatch.h
1
/*
2
* CbmMCMatch.h
3
*
4
* Created on: Nov 23, 2009
5
* Author: stockman
6
*/
7
8
#ifndef CBMMCMATCH_H_
9
#define CBMMCMATCH_H_
10
11
12
#include "
CbmDetectorList.h
"
13
#include "
CbmMCStage.h
"
14
#include "
CbmMCResult.h
"
15
#include "
CbmMCEntry.h
"
16
17
#include "
FairLink.h
"
18
#include "
FairMultiLinkedData.h
"
19
20
#include "TNamed.h"
21
22
#include <map>
23
24
class
FairMultiLinkedData
;
25
26
typedef
std::map<DataType, CbmMCStage*>::iterator
TListIterator
;
27
typedef
std::map<DataType, CbmMCStage*>::const_iterator
TListIteratorConst
;
28
29
class
CbmMCMatch
:
public
TNamed {
30
public
:
31
CbmMCMatch
();
32
CbmMCMatch
(
const
char
*
name
,
const
char
*
title
)
33
:TNamed(name, title),
fUltimateStage
(
kMCTrack
),
34
fList
(),
fFinalStageML
() {};
35
virtual
~CbmMCMatch
();
36
37
void
AddElement
(
DataType
type,
int
index,
FairLink
link);
38
void
AddElement
(
DataType
sourceType,
int
index,
DataType
targetType,
int
link);
39
void
SetElements
(
DataType
sourceType,
int
index,
FairMultiLinkedData
* links);
40
void
InitStage
(
DataType
type, std::string fileName, std::string branchName);
41
void
RemoveStage
(
DataType
type);
42
void
LoadInMCLists
(TClonesArray* myLinkArray);
43
void
ClearMCList
();
44
45
void
SetCommonWeightStages
(Float_t weight);
46
47
CbmMCEntry
GetEntry
(
DataType
type,
int
index);
48
CbmMCEntry
GetEntry
(
FairLink
link);
49
50
CbmMCResult
GetMCInfo
(
DataType
start
,
DataType
stop);
51
CbmMCEntry
GetMCInfoSingle
(
FairLink
aLink,
DataType
stop);
52
53
int
GetNMCStages
()
const
{
return
fList
.size();}
54
55
CbmMCStage
*
GetMCStage
(
int
index)
const
{
56
TListIteratorConst
iter =
fList
.begin();
57
for
(
int
i = 0; i < index; i++)
58
iter++;
59
return
(iter->second);
60
}
61
62
CbmMCStage
*
GetMCStageType
(
DataType
type){
63
return
fList
[type];
64
}
65
66
void
CreateArtificialStage
(
DataType
stage, std::string fileName =
""
, std::string branchName =
""
);
67
68
FairMultiLinkedData
FindLinksToStage
(
DataType
stage);
69
70
bool
IsTypeInList
(
DataType
type);
71
72
void
Print
(std::ostream& out = std::cout){out << *
this
;}
73
74
friend
std::ostream&
operator<<
(std::ostream& out,
const
CbmMCMatch
& match){
75
for
(
int
i = 0; i < match.
GetNMCStages
(); i++){
76
if
(match.
GetMCStage
(i)->
GetLoaded
() == kTRUE){
77
match.
GetMCStage
(i)->
Print
(out);
78
out << std::endl;
79
}
80
}
81
return
out;
82
}
83
84
private
:
85
DataType
fUltimateStage
;
86
std::map<DataType, CbmMCStage*>
fList
;
87
FairMultiLinkedData
fFinalStageML
;
88
89
void
FindStagesPointingToLinks
(
FairMultiLinkedData
links,
DataType
stop);
90
FairMultiLinkedData
FindStagesPointingToLink
(
FairLink
link);
91
92
CbmMCResult
GetMCInfoForward
(
DataType
start
,
DataType
stop);
93
CbmMCResult
GetMCInfoBackward
(
DataType
start
,
DataType
stop);
94
CbmMCEntry
GetMCInfoForwardSingle
(
FairLink
link,
DataType
stop);
95
CbmMCEntry
GetMCInfoBackwardSingle
(
FairLink
link,
DataType
stop, Double_t weight = 1.);
96
97
void
GetNextStage
(
FairMultiLinkedData
& startEntry,
DataType
stopStage);
98
void
AddToFinalStage
(
FairLink
link, Float_t mult);
99
void
ClearFinalStage
();
100
ClassDef
(
CbmMCMatch
, 1);
101
};
102
103
#endif
/* PNDMCMATCH_H_ */
EicRoot
blob
master
cbmbase
CbmMCMatch.h
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:32
using
1.8.2 with
EIC GitHub integration