Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CEPCSW
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Li Zhihao
CEPCSW
Commits
2e589041
Commit
2e589041
authored
5 years ago
by
lintao@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
WIP: add collections for Ecal Barrel/Endcaps/EndcapRing.
parent
ae9c1882
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp
+21
-3
21 additions, 3 deletions
Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp
Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.h
+17
-0
17 additions, 0 deletions
Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.h
with
38 additions
and
3 deletions
Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp
+
21
−
3
View file @
2e589041
...
...
@@ -49,6 +49,13 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) {
auto
tpccols
=
m_TPCCol
.
createAndPut
();
auto
setcols
=
m_SETCol
.
createAndPut
();
auto
ecalbarrelcol
=
m_EcalBarrelCol
.
createAndPut
();
auto
ecalbarrelcontribcols
=
m_EcalBarrelContributionCol
.
createAndPut
();
auto
ecalendcapscol
=
m_EcalEndcapsCol
.
createAndPut
();
auto
ecalendcapscontribcols
=
m_EcalEndcapsContributionCol
.
createAndPut
();
auto
ecalendcapringcol
=
m_EcalEndcapRingCol
.
createAndPut
();
auto
ecalendcapringcontribcol
=
m_EcalEndcapRingContributionCol
.
createAndPut
();
// readout defined in DD4hep
auto
lcdd
=
&
(
dd4hep
::
Detector
::
getInstance
());
auto
allReadouts
=
lcdd
->
readouts
();
...
...
@@ -82,6 +89,7 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) {
edm4hep
::
SimTrackerHitCollection
*
tracker_col_ptr
=
nullptr
;
edm4hep
::
SimCalorimeterHitCollection
*
calo_col_ptr
=
nullptr
;
edm4hep
::
CaloHitContributionCollection
*
calo_contrib_col_ptr
=
nullptr
;
// the mapping between hit collection and the data handler
if
(
collect
->
GetName
()
==
"VXDCollection"
)
{
...
...
@@ -98,10 +106,20 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) {
tracker_col_ptr
=
setcols
;
}
else
if
(
collect
->
GetName
()
==
"CaloHitsCollection"
)
{
calo_col_ptr
=
calorimetercols
;
calo_contrib_col_ptr
=
calocontribcols
;
}
else
if
(
collect
->
GetName
()
==
"EcalBarrelCollection"
)
{
calo_col_ptr
=
ecalbarrelcol
;
calo_contrib_col_ptr
=
ecalbarrelcontribcols
;
}
else
if
(
collect
->
GetName
()
==
"EcalEndcapsCollection"
)
{
calo_col_ptr
=
ecalendcapscol
;
calo_contrib_col_ptr
=
ecalendcapscontribcols
;
}
else
if
(
collect
->
GetName
()
==
"EcalEndcapRingCollection"
)
{
calo_col_ptr
=
ecalendcapringcol
;
calo_contrib_col_ptr
=
ecalendcapringcontribcol
;
}
else
{
warning
()
<<
"Unknown collection name: "
<<
collect
->
GetName
()
<<
".
The SimTrackerCol will be used
. "
<<
endmsg
;
tracker_col_ptr
=
trackercols
;
<<
".
Please register in Edm4hepWriterAnaElemTool
. "
<<
endmsg
;
continue
;
}
...
...
@@ -191,7 +209,7 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) {
const
Contribution
&
c
=
*
j
;
// The legacy Hit object does not contains positions of contributions.
// float contrib_pos[] = {float(c.x/mm), float(c.y/mm), float(c.z/mm)};
auto
edm_calo_contrib
=
calocontribcol
s
->
create
();
auto
edm_calo_contrib
=
calo
_
contrib
_
col
_ptr
->
create
();
edm_calo_contrib
.
setPDG
(
c
.
pdgID
);
edm_calo_contrib
.
setEnergy
(
c
.
deposit
/
CLHEP
::
GeV
);
edm_calo_contrib
.
setTime
(
c
.
time
/
CLHEP
::
ns
);
...
...
This diff is collapsed.
Click to expand it.
Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.h
+
17
−
0
View file @
2e589041
...
...
@@ -64,6 +64,23 @@ private:
DataHandle
<
edm4hep
::
SimTrackerHitCollection
>
m_SETCol
{
"SETCollection"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
// Ecal
DataHandle
<
edm4hep
::
SimCalorimeterHitCollection
>
m_EcalBarrelCol
{
"EcalBarrelCollection"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
DataHandle
<
edm4hep
::
CaloHitContributionCollection
>
m_EcalBarrelContributionCol
{
"EcalBarrelContributionCollection"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
DataHandle
<
edm4hep
::
SimCalorimeterHitCollection
>
m_EcalEndcapsCol
{
"EcalEndcapsCollection"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
DataHandle
<
edm4hep
::
CaloHitContributionCollection
>
m_EcalEndcapsContributionCol
{
"EcalEndcapsContributionCollection"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
DataHandle
<
edm4hep
::
SimCalorimeterHitCollection
>
m_EcalEndcapRingCol
{
"EcalEndcapRingCollection"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
DataHandle
<
edm4hep
::
CaloHitContributionCollection
>
m_EcalEndcapRingContributionCol
{
"EcalEndcapRingContributionCollection"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
private
:
// in order to associate the hit contribution with the primary track,
// we have a bookkeeping of every track.
...
...
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