Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
atlas
athena
Commits
5cb73353
Commit
5cb73353
authored
Sep 20, 2021
by
Carlos Moreno Martinez
Committed by
Edward Moyse
Sep 20, 2021
Browse files
Add new multiplicity algorithms to L1Topo simulation
parent
c7b26496
Changes
10
Hide whitespace changes
Inline
Side-by-side
Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/
EM
Multiplicity.h
→
Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/
eEm
Multiplicity.h
View file @
5cb73353
...
...
@@ -5,8 +5,8 @@
// TopoCore
// Created by Carlos Moreno on 05/05/20.
#ifndef __TopoCore__
EM
Multiplicity__
#define __TopoCore__
EM
Multiplicity__
#ifndef __TopoCore__
eEm
Multiplicity__
#define __TopoCore__
eEm
Multiplicity__
#include
<iostream>
#include
<vector>
...
...
@@ -19,10 +19,10 @@ class TH2;
namespace
TCS
{
class
EM
Multiplicity
:
public
CountingAlg
{
class
eEm
Multiplicity
:
public
CountingAlg
{
public:
EM
Multiplicity
(
const
std
::
string
&
name
);
virtual
~
EM
Multiplicity
();
eEm
Multiplicity
(
const
std
::
string
&
name
);
virtual
~
eEm
Multiplicity
();
virtual
StatusCode
initialize
()
override
;
...
...
Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/eTauMultiplicity.h
0 → 100644
View file @
5cb73353
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// EmMultiplicity.h
// TopoCore
// Created by Carlos Moreno on 17/09/21.
#ifndef __TopoCore__eTauMultiplicity__
#define __TopoCore__eTauMultiplicity__
#include
<iostream>
#include
<vector>
#include
"L1TopoInterfaces/CountingAlg.h"
#include
"L1TopoEvent/TOBArray.h"
#include
"TrigConfData/L1Threshold.h"
class
TH2
;
namespace
TCS
{
class
eTauMultiplicity
:
public
CountingAlg
{
public:
eTauMultiplicity
(
const
std
::
string
&
name
);
virtual
~
eTauMultiplicity
();
virtual
StatusCode
initialize
()
override
;
virtual
StatusCode
processBitCorrect
(
const
TCS
::
InputTOBArray
&
input
,
Count
&
count
)
override
final
;
virtual
StatusCode
process
(
const
TCS
::
InputTOBArray
&
input
,
Count
&
count
)
override
final
;
private:
TrigConf
::
L1Threshold
const
*
m_threshold
{
nullptr
};
};
}
#endif
Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/jJetMultiplicity.h
0 → 100644
View file @
5cb73353
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// EmMultiplicity.h
// TopoCore
// Created by Carlos Moreno on 17/09/21.
#ifndef __TopoCore__jJetMultiplicity__
#define __TopoCore__jJetMultiplicity__
#include
<iostream>
#include
<vector>
#include
"L1TopoInterfaces/CountingAlg.h"
#include
"L1TopoEvent/TOBArray.h"
#include
"TrigConfData/L1Threshold.h"
class
TH2
;
namespace
TCS
{
class
jJetMultiplicity
:
public
CountingAlg
{
public:
jJetMultiplicity
(
const
std
::
string
&
name
);
virtual
~
jJetMultiplicity
();
virtual
StatusCode
initialize
()
override
;
virtual
StatusCode
processBitCorrect
(
const
TCS
::
InputTOBArray
&
input
,
Count
&
count
)
override
final
;
virtual
StatusCode
process
(
const
TCS
::
InputTOBArray
&
input
,
Count
&
count
)
override
final
;
private:
TrigConf
::
L1Threshold
const
*
m_threshold
{
nullptr
};
};
}
#endif
Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/
EM
Multiplicity.cxx
→
Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/
eEm
Multiplicity.cxx
View file @
5cb73353
...
...
@@ -2,7 +2,7 @@
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/*********************************
*
EM
Multiplicity.cpp
*
eEm
Multiplicity.cpp
* Created by Carlos Moreno on 05/06/20.
*
* @brief algorithm that computes the multiplicity for a specified list and ET threshold
...
...
@@ -14,7 +14,7 @@
#include
<cmath>
#include
"L1TopoAlgorithms/
EM
Multiplicity.h"
#include
"L1TopoAlgorithms/
eEm
Multiplicity.h"
#include
"L1TopoCommon/Exception.h"
#include
"L1TopoInterfaces/Count.h"
...
...
@@ -22,12 +22,12 @@
#include
"L1TopoEvent/eEmTOBArray.h"
#include
"L1TopoEvent/GenericTOB.h"
REGISTER_ALG_TCS
(
EM
Multiplicity
)
REGISTER_ALG_TCS
(
eEm
Multiplicity
)
using
namespace
std
;
TCS
::
EM
Multiplicity
::
EM
Multiplicity
(
const
std
::
string
&
name
)
:
CountingAlg
(
name
)
TCS
::
eEm
Multiplicity
::
eEm
Multiplicity
(
const
std
::
string
&
name
)
:
CountingAlg
(
name
)
{
...
...
@@ -35,19 +35,19 @@ TCS::EMMultiplicity::EMMultiplicity(const std::string & name) : CountingAlg(name
}
TCS
::
EM
Multiplicity
::~
EM
Multiplicity
(){}
TCS
::
eEm
Multiplicity
::~
eEm
Multiplicity
(){}
TCS
::
StatusCode
TCS
::
EM
Multiplicity
::
initialize
()
{
TCS
::
eEm
Multiplicity
::
initialize
()
{
m_threshold
=
getThreshold
();
// book histograms
std
::
string
hname_accept
=
"h
EM
Multiplicity_accept_"
+
m_threshold
->
name
();
std
::
string
hname_accept
=
"h
eEm
Multiplicity_accept_"
+
m_threshold
->
name
();
bookHist
(
m_histAccept
,
hname_accept
,
"eta vs pT"
,
150
,
-
100
,
100
,
30
,
0.
,
20.
);
hname_accept
=
"h
EM
Multiplicity_accept_counts_"
+
m_threshold
->
name
();
hname_accept
=
"h
eEm
Multiplicity_accept_counts_"
+
m_threshold
->
name
();
bookHist
(
m_histAccept
,
hname_accept
,
"Counts"
,
15
,
0.
,
10.
);
return
StatusCode
::
SUCCESS
;
...
...
@@ -56,7 +56,7 @@ TCS::EMMultiplicity::initialize() {
TCS
::
StatusCode
TCS
::
EM
Multiplicity
::
processBitCorrect
(
const
TCS
::
InputTOBArray
&
input
,
TCS
::
eEm
Multiplicity
::
processBitCorrect
(
const
TCS
::
InputTOBArray
&
input
,
Count
&
count
)
{
...
...
@@ -64,7 +64,7 @@ TCS::EMMultiplicity::processBitCorrect( const TCS::InputTOBArray & input,
}
TCS
::
StatusCode
TCS
::
EM
Multiplicity
::
process
(
const
TCS
::
InputTOBArray
&
input
,
TCS
::
eEm
Multiplicity
::
process
(
const
TCS
::
InputTOBArray
&
input
,
Count
&
count
)
{
...
...
Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/eTauMultiplicity.cxx
0 → 100644
View file @
5cb73353
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/*********************************
* eTauMultiplicity.cpp
* Created by Carlos Moreno on 05/06/20.
*
* @brief algorithm that computes the multiplicity for a specified list and ET threshold
* line 1: 0 or 1, line 1 and 2 : 2 or more, uses 2 bits
*
* @param NumberLeading MinET
**********************************/
#include
<cmath>
#include
"L1TopoAlgorithms/eTauMultiplicity.h"
#include
"L1TopoCommon/Exception.h"
#include
"L1TopoInterfaces/Count.h"
#include
"L1TopoEvent/TOBArray.h"
#include
"L1TopoEvent/eTauTOBArray.h"
#include
"L1TopoEvent/GenericTOB.h"
REGISTER_ALG_TCS
(
eTauMultiplicity
)
using
namespace
std
;
TCS
::
eTauMultiplicity
::
eTauMultiplicity
(
const
std
::
string
&
name
)
:
CountingAlg
(
name
)
{
setNumberOutputBits
(
12
);
//To-Do: Make this flexible to addapt to the menu. Each counting requires more than one bit
}
TCS
::
eTauMultiplicity
::~
eTauMultiplicity
(){}
TCS
::
StatusCode
TCS
::
eTauMultiplicity
::
initialize
()
{
m_threshold
=
getThreshold
();
// book histograms
std
::
string
hname_accept
=
"heTauMultiplicity_accept_"
+
m_threshold
->
name
();
bookHist
(
m_histAccept
,
hname_accept
,
"eta vs pT"
,
150
,
-
100
,
100
,
30
,
0.
,
20.
);
hname_accept
=
"heTauMultiplicity_accept_counts_"
+
m_threshold
->
name
();
bookHist
(
m_histAccept
,
hname_accept
,
"Counts"
,
15
,
0.
,
10.
);
return
StatusCode
::
SUCCESS
;
}
TCS
::
StatusCode
TCS
::
eTauMultiplicity
::
processBitCorrect
(
const
TCS
::
InputTOBArray
&
input
,
Count
&
count
)
{
return
process
(
input
,
count
);
}
TCS
::
StatusCode
TCS
::
eTauMultiplicity
::
process
(
const
TCS
::
InputTOBArray
&
input
,
Count
&
count
)
{
// Grab the threshold and cast it into the right type
auto
eTAUThr
=
dynamic_cast
<
const
TrigConf
::
L1Threshold_eTAU
&>
(
*
m_threshold
);
// Grab inputs
const
eTauTOBArray
&
etaus
=
dynamic_cast
<
const
eTauTOBArray
&>
(
input
);
int
counting
=
0
;
// loop over input TOBs
for
(
eTauTOBArray
::
const_iterator
etau
=
etaus
.
begin
();
etau
!=
etaus
.
end
();
++
etau
)
{
const
GenericTOB
gtob
(
**
etau
);
// Dividing by 4 standing for converting eta from 0.025 to 0.1 granularity as it is defined in the menu as 0.1 gran.
bool
passed
=
gtob
.
Et
()
>=
eTAUThr
.
thrValueCounts
(
gtob
.
eta
()
/
4
);
if
(
passed
)
{
counting
++
;
fillHist2D
(
m_histAccept
[
0
],
gtob
.
eta
(),
gtob
.
EtDouble
()
);
}
}
fillHist1D
(
m_histAccept
[
1
],
counting
);
// Pass counting to TCS::Count object - output bits are composed there
count
.
setSizeCount
(
counting
);
return
TCS
::
StatusCode
::
SUCCESS
;
}
Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/jJetMultiplicity.cxx
0 → 100644
View file @
5cb73353
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/*********************************
* jJetMultiplicity.cpp
* Created by Carlos Moreno on 17/09/21.
*
* @brief algorithm that computes the multiplicity for a specified list and ET threshold
* line 1: 0 or 1, line 1 and 2 : 2 or more, uses 2 bits
*
* @param NumberLeading MinET
**********************************/
#include
<cmath>
#include
"L1TopoAlgorithms/jJetMultiplicity.h"
#include
"L1TopoCommon/Exception.h"
#include
"L1TopoInterfaces/Count.h"
#include
"L1TopoEvent/TOBArray.h"
#include
"L1TopoEvent/jJetTOBArray.h"
#include
"L1TopoEvent/GenericTOB.h"
REGISTER_ALG_TCS
(
jJetMultiplicity
)
using
namespace
std
;
TCS
::
jJetMultiplicity
::
jJetMultiplicity
(
const
std
::
string
&
name
)
:
CountingAlg
(
name
)
{
setNumberOutputBits
(
12
);
//To-Do: Make this flexible to addapt to the menu. Each counting requires more than one bit
}
TCS
::
jJetMultiplicity
::~
jJetMultiplicity
(){}
TCS
::
StatusCode
TCS
::
jJetMultiplicity
::
initialize
()
{
m_threshold
=
getThreshold
();
// book histograms
std
::
string
hname_accept
=
"hjJetMultiplicity_accept_"
+
m_threshold
->
name
();
bookHist
(
m_histAccept
,
hname_accept
,
"eta vs pT"
,
150
,
-
100
,
100
,
30
,
0.
,
20.
);
hname_accept
=
"hjJetMultiplicity_accept_counts_"
+
m_threshold
->
name
();
bookHist
(
m_histAccept
,
hname_accept
,
"Counts"
,
15
,
0.
,
10.
);
return
StatusCode
::
SUCCESS
;
}
TCS
::
StatusCode
TCS
::
jJetMultiplicity
::
processBitCorrect
(
const
TCS
::
InputTOBArray
&
input
,
Count
&
count
)
{
return
process
(
input
,
count
);
}
TCS
::
StatusCode
TCS
::
jJetMultiplicity
::
process
(
const
TCS
::
InputTOBArray
&
input
,
Count
&
count
)
{
cout
<<
"CARLOS: processing threshold "
<<
m_threshold
->
name
()
<<
endl
;
// Grab the threshold and cast it into the right type
auto
jJThr
=
dynamic_cast
<
const
TrigConf
::
L1Threshold_jJ
&>
(
*
m_threshold
);
// Grab inputs
const
jJetTOBArray
&
jjets
=
dynamic_cast
<
const
jJetTOBArray
&>
(
input
);
int
counting
=
0
;
// loop over input TOBs
for
(
jJetTOBArray
::
const_iterator
jjet
=
jjets
.
begin
();
jjet
!=
jjets
.
end
();
++
jjet
)
{
const
GenericTOB
gtob
(
**
jjet
);
// Dividing by 4 standing for converting eta from 0.025 to 0.1 granularity as it is defined in the menu as 0.1 gran.
bool
passed
=
gtob
.
Et
()
>=
jJThr
.
thrValueCounts
(
gtob
.
eta
()
/
4
);
if
(
passed
)
{
counting
++
;
fillHist2D
(
m_histAccept
[
0
],
gtob
.
eta
(),
gtob
.
EtDouble
()
);
}
}
fillHist1D
(
m_histAccept
[
1
],
counting
);
// Pass counting to TCS::Count object - output bits are composed there
count
.
setSizeCount
(
counting
);
return
TCS
::
StatusCode
::
SUCCESS
;
}
Trigger/TrigT1/L1Topo/L1TopoCommon/Root/Types.cxx
View file @
5cb73353
...
...
@@ -35,7 +35,7 @@ TCS::inputType(const std::string& input) {
if
(
input
==
"jEM"
||
input
==
"jEMTobArray"
||
input
==
"jEmTobs"
)
return
TCS
::
CLUSTER
;
if
(
input
==
"eT
au
"
||
input
==
"eTauTobArray"
||
input
==
"eTauTobs"
)
if
(
input
==
"eT
AU
"
||
input
==
"eTauTobArray"
||
input
==
"eTauTobs"
)
return
TCS
::
ETAU
;
if
(
input
==
"jTau"
||
input
==
"jTauTobArray"
||
input
==
"jTauTobs"
)
...
...
@@ -44,7 +44,7 @@ TCS::inputType(const std::string& input) {
if
(
input
==
"Jets"
||
input
==
"JetTobArray"
)
return
TCS
::
JET
;
if
(
input
==
"jJ
et
"
||
input
==
"jJetTobArray"
||
input
==
"jJetTobs"
)
if
(
input
==
"jJ"
||
input
==
"jJetTobArray"
||
input
==
"jJetTobs"
)
return
TCS
::
JJET
;
if
(
input
==
"jLargeRJet"
||
input
==
"jLargeRJetTobArray"
||
input
==
"jLargeRJetTobs"
)
...
...
Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteeringStructure.cxx
View file @
5cb73353
...
...
@@ -222,37 +222,37 @@ TCS::TopoSteeringStructure::setupFromMenu(const TrigConf::L1Menu& l1menu, bool l
for
(
auto
&
tl
:
l1conn
.
triggerLines
(
0
,
0
)
)
{
const
string
&
tlName
=
tl
.
name
();
auto
&
algo
=
l1menu
.
algorithmFromTriggerline
(
tlName
);
const
string
&
tlName
=
tl
.
name
();
auto
&
algo
=
l1menu
.
algorithmFromTriggerline
(
tlName
);
if
(
algo
.
klass
()
!=
"
EM
Multiplicity"
)
continue
;
// Only multiplicity
for EMs are defined in the menu
if
(
(
algo
.
klass
()
!=
"eEmMultiplicity"
)
&&
(
algo
.
klass
()
!=
"
eTau
Multiplicity"
)
)
continue
;
// Only
available
multiplicity
algorithms so far
auto
it
=
find
(
storedConn
.
begin
(),
storedConn
.
end
(),
algo
.
name
());
if
(
it
==
storedConn
.
end
())
{
// Algorithm/Connector does not exist: create and store it
storedConn
.
push_back
(
algo
.
name
());
if
(
debug
)
cout
<<
"L1TopoSteering: Multiplicity algo( "
<<
algo
.
name
()
<<
" ) has as input "
<<
algo
.
inputs
().
at
(
0
)
<<
endl
;
CountingConnector
*
conn
=
new
CountingConnector
(
algo
.
name
(),
algo
.
inputs
().
at
(
0
),
algo
.
klass
()
+
"/"
+
algo
.
name
(),
algo
.
outputs
().
at
(
0
));
conn
->
m_count
.
setNBits
(
tl
.
nbits
()
);
conn
->
m_count
.
setFirstBit
(
tl
.
startbit
()
);
if
(
tl
.
name
()
!=
"UNDEF"
)
conn
->
m_triggers
.
push_back
(
tl
);
if
(
debug
)
cout
<<
"Adding count connector "
<<
"["
<<
*
conn
<<
"]"
<<
endl
;
addCountingConnector
(
conn
);
confMultAlgorithms
.
push_back
(
algo
.
name
()
);
}
}
// Trigger Line
}
// Optical connectors - multiplicities
}
// Connector in l1board
auto
it
=
find
(
storedConn
.
begin
(),
storedConn
.
end
(),
algo
.
name
());
if
(
it
==
storedConn
.
end
())
{
// Algorithm/Connector does not exist: create and store it
storedConn
.
push_back
(
algo
.
name
());
if
(
debug
)
cout
<<
"L1TopoSteering: Multiplicity algo( "
<<
algo
.
name
()
<<
" ) has as input "
<<
algo
.
inputs
().
at
(
0
)
<<
endl
;
CountingConnector
*
conn
=
new
CountingConnector
(
algo
.
name
(),
algo
.
inputs
().
at
(
0
),
algo
.
klass
()
+
"/"
+
algo
.
name
(),
algo
.
outputs
().
at
(
0
));
conn
->
m_count
.
setNBits
(
tl
.
nbits
()
);
conn
->
m_count
.
setFirstBit
(
tl
.
startbit
()
);
if
(
tl
.
name
()
!=
"UNDEF"
)
conn
->
m_triggers
.
push_back
(
tl
);
if
(
debug
)
cout
<<
"Adding count connector "
<<
"["
<<
*
conn
<<
"]"
<<
endl
;
addCountingConnector
(
conn
);
confMultAlgorithms
.
push_back
(
algo
.
name
()
);
}
}
// Trigger Line
}
// Optical connectors - multiplicities
}
// Connector in l1board
}
// Board in l1menu
...
...
@@ -357,7 +357,7 @@ TCS::TopoSteeringStructure::setupFromMenu(const TrigConf::L1Menu& l1menu, bool l
auto
&
l1algo
=
l1menu
.
algorithm
(
multAlgo
,
"MULTTOPO"
);
if
(
l1algo
.
klass
()
!=
"
EM
Multiplicity"
)
continue
;
//
Look at eEM
multiplicities for now
, missing inputs in the menu for the other types of thresholds
if
(
(
l1algo
.
klass
()
!=
"
eEmMultiplicity"
)
&&
(
l1algo
.
klass
()
!=
"eTau
Multiplicity"
)
)
continue
;
//
Only available
multiplicities for now
ConfigurableAlg
*
alg
=
AlgFactory
::
instance
().
algorithm
(
l1algo
.
name
());
...
...
Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py
View file @
5cb73353
...
...
@@ -284,9 +284,9 @@ class MultiplicityAlgo(TopoAlgo):
return
confObj
class
EM
MultiplicityAlgo
(
MultiplicityAlgo
):
class
eEm
MultiplicityAlgo
(
MultiplicityAlgo
):
def
__init__
(
self
,
name
,
algoId
,
threshold
,
nbits
,
classtype
):
super
(
EM
MultiplicityAlgo
,
self
).
__init__
(
classtype
=
classtype
,
name
=
name
,
super
(
eEm
MultiplicityAlgo
,
self
).
__init__
(
classtype
=
classtype
,
name
=
name
,
algoId
=
algoId
,
threshold
=
threshold
,
input
=
None
,
output
=
"%s"
%
threshold
,
...
...
Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py
View file @
5cb73353
...
...
@@ -3,7 +3,7 @@
from
AthenaCommon.Logging
import
logging
log
=
logging
.
getLogger
(
__name__
)
from
..Base.TopoAlgos
import
EM
MultiplicityAlgo
,
TauMultiplicityAlgo
,
JetMultiplicityAlgo
,
XEMultiplicityAlgo
from
..Base.TopoAlgos
import
eEm
MultiplicityAlgo
,
TauMultiplicityAlgo
,
JetMultiplicityAlgo
,
XEMultiplicityAlgo
class
TopoAlgoDefMultiplicity
(
object
):
"""
...
...
@@ -23,16 +23,16 @@ class TopoAlgoDefMultiplicity(object):
]
for
em
in
emThresholds_3bits
:
alg
=
EM
MultiplicityAlgo
(
name
=
em
,
alg
=
eEm
MultiplicityAlgo
(
name
=
em
,
algoId
=
currentAlgoId
,
threshold
=
em
,
nbits
=
3
,
classtype
=
'
EM
Multiplicity'
)
nbits
=
3
,
classtype
=
'
eEm
Multiplicity'
)
tm
.
registerTopoAlgo
(
alg
)
for
em
in
emThresholds_2bits
:
alg
=
EM
MultiplicityAlgo
(
name
=
em
,
alg
=
eEm
MultiplicityAlgo
(
name
=
em
,
algoId
=
currentAlgoId
,
threshold
=
em
,
nbits
=
2
,
classtype
=
'
EM
Multiplicity'
)
nbits
=
2
,
classtype
=
'
eEm
Multiplicity'
)
tm
.
registerTopoAlgo
(
alg
)
etauThresholds_3bits
=
[
'eTAU8'
,
'eTAU12'
,
]
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment