Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CEPCSW_OTE_development
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
yudian2002@sjtu.edu.cn
CEPCSW_OTE_development
Commits
790d7f41
Commit
790d7f41
authored
4 years ago
by
lintao@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
WIP: migrate the ECAL/HCAL collections.
parent
195fbd3b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Analysis/TotalInvMass/src/TotalInvMass.cc
+56
-63
56 additions, 63 deletions
Analysis/TotalInvMass/src/TotalInvMass.cc
with
56 additions
and
63 deletions
Analysis/TotalInvMass/src/TotalInvMass.cc
+
56
−
63
View file @
790d7f41
...
@@ -244,6 +244,16 @@ StatusCode TotalInvMass::execute()
...
@@ -244,6 +244,16 @@ StatusCode TotalInvMass::execute()
_J1CosTheta
=
-
2
;
_J1CosTheta
=
-
2
;
_J2CosTheta
=
-
2
;
_J2CosTheta
=
-
2
;
std
::
vector
<
CaloHitColHandler
*>
hdl_EcalHitColl
{
&
m_ecalbarrelhitcol
,
&
m_ecalendcaphitcol
};
std
::
vector
<
CaloHitColHandler
*>
hdl_HcalHitColl
{
&
m_hcalbarrelhitcol
,
&
m_hcalendcaphitcol
,
&
m_hcalotherhitcol
};
std
::
vector
<
std
::
string
>
EcalHitColl
;
std
::
vector
<
std
::
string
>
EcalHitColl
;
std
::
vector
<
std
::
string
>
HcalHitColl
;
std
::
vector
<
std
::
string
>
HcalHitColl
;
EcalHitColl
.
push_back
(
"ECALBarrel"
);
EcalHitColl
.
push_back
(
"ECALBarrel"
);
...
@@ -257,71 +267,54 @@ StatusCode TotalInvMass::execute()
...
@@ -257,71 +267,54 @@ StatusCode TotalInvMass::execute()
try
{
try
{
for
(
int
t
=
0
;
t
<
int
(
EcalHitColl
.
size
());
t
++
)
for
(
int
t
=
0
;
t
<
int
(
hdl_EcalHitColl
.
size
());
t
++
)
{
{
const
edm4hep
::
CalorimeterHitCollection
*
ecalcoll
=
hdl_EcalHitColl
[
t
]
->
get
();
EVENT
::
LCCollection
*
aecalcoll
=
evtP
->
getCollection
(
EcalHitColl
[
t
].
c_str
());
for
(
auto
hit
:
*
ecalcoll
)
{
for
(
int
s
=
0
;
s
<
aecalcoll
->
getNumberOfElements
();
s
++
)
// TODO
{
int
NLayer
=
0
;
EVENT
::
CalorimeterHit
*
a_hit
=
dynamic_cast
<
EVENT
::
CalorimeterHit
*>
(
aecalcoll
->
getElementAt
(
s
));
_EcalTotalE
+=
hit
.
getEnergy
();
_EcalTotalE
+=
a_hit
->
getEnergy
();
// UTIL::CellIDDecoder<EVENT::CalorimeterHit> idDecoder(ECALCellIDDecoder);
UTIL
::
CellIDDecoder
<
EVENT
::
CalorimeterHit
>
idDecoder
(
ECALCellIDDecoder
);
// int NLayer = idDecoder(a_hit)["K-1"];
int
NLayer
=
idDecoder
(
a_hit
)[
"K-1"
];
//h_hit->Fill(NLayer,a_hit->getEnergy());
//h_hit->Fill(NLayer,a_hit->getEnergy());
if
(
NLayer
<
6
)
{
if
(
NLayer
<
6
)
_EcalEn1
+=
hit
.
getEnergy
();
{
}
else
if
(
NLayer
<
12
)
{
_EcalEn1
+=
a_hit
->
getEnergy
();
_EcalEn2
+=
hit
.
getEnergy
();
}
}
else
if
(
NLayer
<
18
)
{
else
if
(
NLayer
<
12
)
_EcalEn3
+=
hit
.
getEnergy
();
{
}
else
if
(
NLayer
<
24
)
{
_EcalEn2
+=
a_hit
->
getEnergy
();
_EcalEn4
+=
hit
.
getEnergy
();
}
}
else
{
else
if
(
NLayer
<
18
)
_EcalEn5
+=
hit
.
getEnergy
();
{
}
_EcalEn3
+=
a_hit
->
getEnergy
();
}
else
if
(
NLayer
<
24
)
{
_EcalEn4
+=
a_hit
->
getEnergy
();
}
else
{
_EcalEn5
+=
a_hit
->
getEnergy
();
}
}
}
}
}
for
(
int
t2
=
0
;
t2
<
int
(
HcalHitColl
.
size
());
t2
++
)
{
for
(
int
t2
=
0
;
t2
<
int
(
hdl_HcalHitColl
.
size
());
t2
++
)
{
EVENT
::
LCCollection
*
ahcalcoll
=
evtP
->
getCollection
(
HcalHitColl
[
t2
].
c_str
());
const
edm4hep
::
CalorimeterHitCollection
*
hcalcoll
=
hdl_HcalHitColl
[
t2
]
->
get
();
for
(
int
s
=
0
;
s
<
ahcalcoll
->
getNumberOfElements
();
s
++
)
for
(
auto
hit
:
*
hcalcoll
)
{
{
// TODO
EVENT
::
CalorimeterHit
*
a_hit
=
dynamic_cast
<
EVENT
::
CalorimeterHit
*>
(
ahcalcoll
->
getElementAt
(
s
));
int
NLayer
=
0
;
UTIL
::
CellIDDecoder
<
EVENT
::
CalorimeterHit
>
idDecoder
(
ECALCellIDDecoder
);
int
HLayer
=
NLayer
+
30
;
int
NLayer
=
idDecoder
(
a_hit
)[
"K-1"
];
// UTIL::CellIDDecoder<EVENT::CalorimeterHit> idDecoder(ECALCellIDDecoder);
int
HLayer
=
NLayer
+
30
;
// int NLayer = idDecoder(a_hit)["K-1"];
//h_hit->Fill(HLayer,a_hit->getEnergy());
_HcalTotalE
+=
a_hit
->
getEnergy
();
//h_hit->Fill(HLayer,a_hit->getEnergy());
if
(
NLayer
<
10
)
_HcalTotalE
+=
hit
.
getEnergy
();
{
if
(
NLayer
<
10
)
{
_HcalEn1
+=
a_hit
->
getEnergy
();
_HcalEn1
+=
hit
.
getEnergy
();
}
}
else
if
(
NLayer
<
20
)
{
else
if
(
NLayer
<
20
)
_HcalEn2
+=
hit
.
getEnergy
();
{
}
else
if
(
NLayer
<
30
)
{
_HcalEn2
+=
a_hit
->
getEnergy
();
_HcalEn3
+=
hit
.
getEnergy
();
}
}
else
if
(
NLayer
<
40
)
{
else
if
(
NLayer
<
30
)
_HcalEn4
+=
hit
.
getEnergy
();
{
}
else
{
_HcalEn3
+=
a_hit
->
getEnergy
();
_HcalEn5
+=
hit
.
getEnergy
();
}
}
else
if
(
NLayer
<
40
)
{
_HcalEn4
+=
a_hit
->
getEnergy
();
}
else
{
_HcalEn5
+=
a_hit
->
getEnergy
();
}
}
}
}
}
}
catch
(
lcio
::
DataNotAvailableException
err
)
{
}
}
catch
(
lcio
::
DataNotAvailableException
err
)
{
}
...
...
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