|
ATLAS Offline Software
|
Go to the documentation of this file.
39 static const double GeV = 1000.0;
52 ATH_MSG_INFO(
"Inputs from LVL1 Calo systems switched off" );
55 ATH_MSG_INFO(
"Inputs from LVL1 Muon systems switched off" );
94 return StatusCode::SUCCESS;
104 if (!roibResult.isValid()) {
106 return StatusCode::FAILURE;
121 return StatusCode::SUCCESS;
125 const EventContext& ctx )
const {
131 auto emtau_xaod = std::make_unique< xAOD::EmTauRoIContainer >();
132 auto emtau_aux = std::make_unique< xAOD::EmTauRoIAuxContainer >();
133 emtau_xaod->setStore( emtau_aux.get() );
136 std::map< int, std::string > emThresholdNames;
137 std::map< int, std::string > tauThresholdNames;
141 float caloTrigScale =
static_cast<float>(
l1menu->thrExtraInfo().EM().resolutionMeV());
142 for(
const auto& thr :
l1menu->thresholds(
"EM")) {
143 emThresholdNames[ thr->mapping() ] = thr->name();
145 for(
const auto& thr :
l1menu->thresholds(
"TAU")) {
146 tauThresholdNames[ thr->mapping() ] = thr->name();
154 if (cpmTower.isValid()) {
155 m_emTauTool->mapTowers( cpmTower.cptr(), &cpmtowers );
166 uint32_t roIWord = emtRoI.roIWord();
168 << std::setw( 8 ) << roIWord << MSG::dec );
179 emtau_xaod->push_back( roi );
185 std::unique_ptr< std::vector< unsigned int > > thrV( recRoI.
thresholdsPassed() );
186 for(
unsigned int thr : *thrV ) {
189 auto emNameItr = emThresholdNames.find( thr );
190 auto tauNameItr = tauThresholdNames.find( thr );
191 std::string thrName =
"NameNotFound";
193 ( emNameItr != emThresholdNames.end() ) ) {
194 thrName = emNameItr->second;
197 ( tauNameItr != tauThresholdNames.end() ) ) {
198 thrName = tauNameItr->second;
203 ATH_MSG_DEBUG(
"EmTau Thr : " << thr <<
", name = " << thrName
222 ATH_CHECK( emtauRoI.record( std::move( emtau_xaod ),
223 std::move( emtau_aux ) ) );
226 return StatusCode::SUCCESS;
231 const EventContext& ctx )
const {
236 auto jet_xaod = std::make_unique< xAOD::JetRoIContainer >();
237 auto jet_aux = std::make_unique< xAOD::JetRoIAuxContainer >();
238 jet_xaod->setStore( jet_aux.get() );
240 auto esum_xaod = std::make_unique< xAOD::EnergySumRoI >();
241 auto esum_aux = std::make_unique< xAOD::EnergySumRoIAuxInfo >();
242 esum_xaod->setStore( esum_aux.get() );
244 auto jetet_xaod = std::make_unique< xAOD::JetEtRoI >();
245 auto jetet_aux = std::make_unique< xAOD::JetEtRoIAuxInfo >();
246 jetet_xaod->setStore( jetet_aux.get() );
252 float caloTrigScale =
static_cast<float>(
l1menu->thrExtraInfo().JET().resolutionMeV());
256 std::map<int, std::string> jetNames;
257 std::map<int, std::string> jfNames;
258 std::map<int, std::string> jbNames;
259 std::map<int, std::string> xeNames;
260 std::map<int, std::string> teNames;
261 std::map<int, std::string> xsNames;
262 std::map<int, std::string> jeNames;
263 for(
const auto& thr :
l1menu->thresholds(
"JET")) {
264 jetNames[ thr->mapping() ] = thr->name();
266 for(
const auto& thr :
l1menu->thresholds(
"XE")) {
267 xeNames[ thr->mapping() ] = thr->name();
269 for(
const auto& thr :
l1menu->thresholds(
"TE")) {
270 teNames[ thr->mapping() ] = thr->name();
272 for(
const auto& thr :
l1menu->thresholds(
"XS")) {
273 xsNames[ thr->mapping() ] = thr->name();
278 std::map< int, LVL1::JetInput* > jetInputs;
281 if (jetElement.isValid()) {
282 m_jetTool->mapJetInputs( jetElement.cptr(), &jetInputs );
287 std::vector< std::unique_ptr< LVL1::JetInput > > jetInputsHolder;
288 for(
auto pair : jetInputs ) {
289 jetInputsHolder.emplace_back( pair.second );
294 auto itJET = jeteResult.roIVec().begin();
295 auto endJET = jeteResult.roIVec().end();
296 for( ; itJET != endJET; ++itJET ) {
298 const uint32_t roIWord = itJET->roIWord();
300 ATH_MSG_DEBUG(
"Jet RoI, RoIWord = " << MSG::hex << std::setw( 8 )
301 << roIWord << MSG::dec );
305 const int roiType =
conv.roiType( roIWord );
318 jet_xaod->push_back( roi );
327 auto jetNameItr = jetNames.find( thr );
328 auto jfNameItr = jfNames.find( thr );
329 auto jbNameItr = jbNames.find( thr );
330 std::string thrName =
"NameNotFound";
332 if( jetNameItr != jetNames.end() ) {
333 thrName = jetNameItr->second;
336 else if( recRoI.
eta() > 0 ) {
337 if( jfNameItr != jfNames.end() ) {
338 thrName = jfNameItr->second;
342 if( jbNameItr != jbNames.end() ) {
343 thrName = jbNameItr->second;
366 jetet_xaod->setRoIWord( roIWord );
369 for(
unsigned int i = 0;
371 if( ( roIWord >>
i ) & 0
x1 ) {
372 std::string thrName =
"NameNotFound";
373 if (jeNames.find(
i) != jeNames.end()) thrName = jeNames[
i];
374 jetet_xaod->addThreshold( thrName );
385 ATH_MSG_DEBUG(
"ET RoIWord 0 : " << MSG::hex << std::setw( 8 )
386 << roiWord0 << MSG::dec );
389 ATH_MSG_DEBUG(
"ET RoIWord 1 : " << MSG::hex << std::setw( 8 )
392 const uint32_t roiWord2 = itJET->roIWord();
393 ATH_MSG_DEBUG(
"ET RoIWord 2 : " << MSG::hex << std::setw( 8 )
394 << roiWord2 << MSG::dec );
400 esum_xaod->initialize( roiWord0,
roiWord1, roiWord2,
401 recRoI.
energyX() * caloTrigScale,
402 recRoI.
energyY() * caloTrigScale,
403 recRoI.
energyT() * caloTrigScale );
407 auto xeNameItr = xeNames.find( thr - 1 );
408 const std::string thrName = ( xeNameItr != xeNames.end() ?
411 esum_xaod->addThreshold( thrName );
417 auto teNameItr = teNames.find( thr - 1 );
418 const std::string thrName = ( teNameItr != teNames.end() ?
421 esum_xaod->addThreshold( thrName );
427 auto xsNameItr = xsNames.find( thr - 1 );
428 const std::string thrName = ( xsNameItr != xsNames.end() ?
431 esum_xaod->addThreshold( thrName );
440 ATH_CHECK( jetRoI.record( std::move( jet_xaod ), std::move( jet_aux ) ) );
443 ATH_CHECK( jetetRoI.record( std::move( jetet_xaod ),
444 std::move( jetet_aux ) ) );
447 ATH_CHECK( energysumRoI.record( std::move( esum_xaod ),
448 std::move( esum_aux ) ) );
451 return StatusCode::SUCCESS;
455 const EventContext& ctx )
const {
463 auto mu_xaod = std::make_unique< xAOD::MuonRoIContainer >();
464 auto mu_aux = std::make_unique< xAOD::MuonRoIAuxContainer >();
465 mu_xaod->setStore( mu_aux.get() );
468 std::vector< TrigConf::TriggerThreshold* > muonThresholds;
469 std::map< int, std::string > thresholdNames;
470 for(
const auto& thr :
l1menu->thresholds(
"MU")) {
471 thresholdNames[ thr->mapping() ] = thr->name();
475 const std::vector< ROIB::MuCTPIRoI >& muonRoIV =
476 result.muCTPIResult().roIVec();
491 auto thrNameItr = thresholdNames.find(
index );
492 const std::string thrName = ( thrNameItr != thresholdNames.end() ?
497 mu_xaod->push_back( xaod_roi );
506 ATH_CHECK( muonRoI.record( std::move( mu_xaod ), std::move( mu_aux ) ) );
509 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
void setThrPattern(uint32_t value)
Set the threshold pattern.
ToolHandle< LVL1::ITrigT1MuonRecRoiTool > m_recTGCRoiTool
The TGC RoI reconstruction service.
unsigned int triggerThreshold(unsigned int thresh) const
returns the value of the trigger threshold for the threshold passed.
void initialize(uint32_t roiword, float eta, float phi, const std::string &thrname, float thrvalue, uint32_t extraword=0u)
Initialise the object with all its properties.
StatusCode createJetEnergyRoI(const ROIB::RoIBResult &roib, const EventContext &ctx) const
Create the JetEnergy RoI object.
int CoreET()
Additional information for reconstruction & performance studies.
SG::ReadHandleKey< xAOD::JetElementContainer > m_jetElementKey
Read key for the xAOD::JetElementContainer object.
unsigned int thresholdPattern() const
returns bitmask of passed thresholds
constexpr float roiPhi(const AnyRoIPointer &roi)
This class defines the reconstructed em/tau hadron ROI.
int ET6x6()
Returns 6x6 TT cluster ET.
Class holding the LVL1 RoIB result build by the RoIBuilder.
int energyX() const
returns the (signed) Ex energy projection.
A level 1 calorimeter trigger conversion service: returns the Coordinate represented by a RoI word.
int energyT() const
returns the total ET.
SG::ReadHandleKey< xAOD::CPMTowerContainer > m_cpmTowerKey
Read key for the xAOD::CPMTowerContainer object.
std::vector< unsigned int > thresholdsPassed() const
returns a vector of thresholds passed.
int EMClusET()
Returns EM cluster ET, limited to 8 bits.
This is an internal class, used in the EM/Tau trigger.
int ET4x4()
Returns 4x4 TT cluster ET.
Class for storing the 32-bit muon RoI word.
int TauClusET()
Returns Tau cluster ET, limited to 8 bits.
StatusCode createMuonRoI(const ROIB::RoIBResult &roib, const EventContext &ctx) const
Create the Muon RoI objects.
const std::string & key() const
Return the StoreGate ID for the referenced object.
void initialize(uint32_t roiword, float eta, float phi)
Initialise the object with its most important properties.
void initialize(uint32_t roiword, float eta, float phi)
Initialise the object with its most important properties.
void addThreshold(const std::string &name, float value)
Add a new threshold that was passed by the RoI.
static const unsigned int numOfJetEtSumThresholds
virtual double eta() const
returns eta coord of ROI
Gaudi::Property< bool > m_doCalo
unsigned int getThresholdNumber() const
returns the Threshold Number (1 to 6) associated with this RecRoI
This class defines the reconstructed EnergySum ROI.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
An algorithm that can be simultaneously executed in multiple threads.
ToolHandle< LVL1::IL1JEMJetTools > m_jetTool
Tool for calculation of Jet cluster sums per RoI.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
std::vector< unsigned int > mEtSigThresholdsPassed() const
returns a vector of thresholds passed.
int HadCoreET()
Returns Had core ET (inner isolation sum)
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
void setEmIsol(float value)
Set the EM calorimeter isolation (outer ring of EM towers)
Handle class for recording to StoreGate.
StatusCode createEmTauRoI(const ROIB::RoIBResult &roib, const EventContext &ctx) const
Create the EmTau RoI objects.
void setEmClus(float value)
Set the deposited ET from the "EM cluster".
This class defines the reconstructed Muon ROI.
unsigned int getThresholdValue() const
returns the Threshold Value (in GeV) associated with this RecRoI
This is an internal class, used in the jet trigger.
std::vector< unsigned int > etMissThresholdsPassed() const
returns a vector of thresholds passed.
Class describing a LVL1 em/tau region of interest.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< bool > m_doMuon
Use inputs from the Muon system.
unsigned int triggerThreshold(unsigned int thresh) const
returns the value of the trigger threshold for the threshold passed.
std::vector< unsigned int > sumEtThresholdsPassed() const
returns a vector of thresholds passed.
void setEt8x8(float value)
Set the energy deposited in a 0.8x0.8 area around the RoI.
Class describing a LVL1 muon region of interest.
std::map< int, const CPMTower * > CPMTowerMap_t
int HadIsolET()
Returns Had isolation ET.
This class defines the reconstructed em/tau hadron ROI.
void setHadIsol(float value)
Set the hadron calorimeter isolation (outer ring of had towers)
void setTauClus(float value)
Set the deposited ET from the "tau cluster".
SG::ReadHandleKey< ROIB::RoIBResult > m_roibResultKey
Read key for the ROIB::RoIBResult object.
void setHadCore(float value)
Set the ET deposited in the inner hadronic isolation region.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void setThrPattern(uint32_t value)
Set the threshold pattern.
SG::WriteHandleKey< xAOD::JetEtRoI > m_jetetRoIKey
Write key for the xAOD::JetEtRoI object.
ToolHandle< LVL1::IL1CPMTools > m_emTauTool
Tool for calculation of EmTau trigger sums per RoI.
SG::WriteHandleKey< xAOD::EmTauRoIContainer > m_emtauRoIKey
Write key for the xAOD::EmTauRoIContainer object.
std::vector< unsigned int > * thresholdsPassed() const
returns a vector of thresholds passed.
virtual double phi() const
returns phi coord of ROI
virtual double phi() const
returns phi coord of ROI
bool isForwardJet() const
returns true if the RoI is a forward jet RoI.
SG::WriteHandleKey< xAOD::EnergySumRoI > m_energysumRoIKey
Write key for the xAOD::EnergySumRoI object.
virtual StatusCode initialize() override
Function initialising the algorithm.
int ET8x8()
Returns 8x8 TT cluster ET.
void setEtScale(float value)
Set the ET scale for RoI digits.
TrigT1CaloDefs::ClusterAlgorithm thresholdType(unsigned int thresh) const
returns the type of the threshold, which is either EMAlg or TauAlg.
SG::WriteHandleKey< xAOD::MuonRoIContainer > m_muonRoIKey
Write key for the xAOD::MuonRoIContainer object.
Class describing a LVL1 jet region of interest.
SG::WriteHandleKey< xAOD::JetRoIContainer > m_jetRoIKey
Write key for the xAOD::JetRoIContainer object.
int energyY() const
returns the (signed) Ey energy projection.
void setEt6x6(float value)
Set the energy deposited in a 0.6x0.6 area around the RoI.
void setEtScale(float v)
Set the ET scale.
int EMIsolET()
Returns EM isolation ET.
ToolHandle< LVL1::ITrigT1MuonRecRoiTool > m_recRPCRoiTool
The RPC RoI reconstruction tool.
void addThreshold(const std::string &name, float value)
Add a new threshold that was passed by the RoI.
void setEt4x4(float value)
Set the energy deposited in a 0.4x0.4 area around the RoI.
virtual double eta() const
returns eta coord of ROI
Handle class for reading from StoreGate.
void setCore(float value)
Set the ET of the RoI Core cluster (2x2 towers, EM+Had)
virtual double eta() const
returns eta coord of ROI
unsigned int thresholdPattern() const
returns bitmask of passed thresholds
RoIBResultToxAOD(const std::string &name, ISvcLocator *svcLoc)
Algorithm constructor.
virtual double phi() const
returns phi coord of ROI