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
CbmMCMatchSelectorTask.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file CbmMCMatchSelectorTask.cxx
1
// -------------------------------------------------------------------------
2
// ----- CbmMCMatchSelectorTask source file -----
3
// ----- Created 18/07/08 by T.Stockmanns -----
4
// -------------------------------------------------------------------------
5
#include "
CbmMCMatchSelectorTask.h
"
6
7
#include "
CbmMCMatch.h
"
8
9
// framework includes
10
#include "
FairRootManager.h
"
11
12
// libc includes
13
#include <iostream>
14
using
std::cout;
15
using
std::endl;
16
17
// ----- Default constructor -------------------------------------------
18
CbmMCMatchSelectorTask::CbmMCMatchSelectorTask
()
19
:
FairTask
(
"Creates CbmMCMatch"
),
20
fMCMatch(NULL),
21
fStart(
kUnknown
),
22
fStop(
kUnknown
),
23
fStageWeights(),
24
fCommonWeight(0.)
25
{
26
}
27
// -------------------------------------------------------------------------
28
29
CbmMCMatchSelectorTask::CbmMCMatchSelectorTask
(
DataType
start
,
DataType
stop)
30
:
FairTask
(
"Creates CbmMCMatch"
),
31
fMCMatch(NULL),
32
fStart(start),
33
fStop(stop),
34
fStageWeights(),
35
fCommonWeight(0.)
36
{
37
}
38
39
// ----- Destructor ----------------------------------------------------
40
CbmMCMatchSelectorTask::~CbmMCMatchSelectorTask
()
41
{
42
}
43
44
// ----- Public method Init --------------------------------------------
45
InitStatus
CbmMCMatchSelectorTask::Init
()
46
{
47
48
49
// fMCMatch->InitStage(kMCTrack, "", "MCTrack");
50
51
52
53
FairRootManager
* ioman =
FairRootManager::Instance
();
54
if
(!ioman) {
55
cout <<
"-E- CbmMCMatchSelectorTask::Init: "
56
<<
"RootManager not instantiated!"
<< endl;
57
return
kFATAL
;
58
}
59
60
fMCMatch
= (
CbmMCMatch
*)ioman->
GetObject
(
"MCMatch"
);
61
62
cout <<
"-I- CbmMCMatchSelectorTask::Init: Initialization successfull"
<< endl;
63
64
65
return
kSUCCESS
;
66
}
67
68
69
// -------------------------------------------------------------------------
70
void
CbmMCMatchSelectorTask::SetParContainers
()
71
{
72
// Get Base Container
73
// FairRun* ana = FairRun::Instance();
74
// FairRuntimeDb* rtdb=ana->GetRuntimeDb();
75
76
}
77
78
79
// ----- Public method Exec --------------------------------------------
80
void
CbmMCMatchSelectorTask::Exec
(Option_t* opt)
81
{
82
cout <<
"Output Selector: "
<< endl;
83
SetWeights
();
84
cout <<
fMCMatch
->
GetMCInfo
(
fStart
,
fStop
);
85
}
86
87
void
CbmMCMatchSelectorTask::SetWeights
()
88
{
89
// cout << "SetWeights: CommonWeight " << fCommonWeight << " NStageWeights " << fStageWeights.size() << endl;
90
fMCMatch
->
SetCommonWeightStages
(
fCommonWeight
);
91
for
(
int
i = 0; i <
fStageWeights
.size();i++){
92
fMCMatch
->
GetMCStageType
(
fStageWeights
[i].first)->
SetWeight
(
fStageWeights
[i].second);
93
}
94
}
95
96
void
CbmMCMatchSelectorTask::Finish
()
97
{
98
}
99
100
101
ClassImp
(
CbmMCMatchSelectorTask
);
EicRoot
blob
master
cbmbase
CbmMCMatchSelectorTask.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:33
using
1.8.2 with
EIC GitHub integration