ATLAS Offline Software
Loading...
Searching...
No Matches
JetInputProvider.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include <math.h>
6
7#include "JetInputProvider.h"
11
12using namespace std;
13using namespace LVL1;
14
15JetInputProvider::JetInputProvider(const std::string& type, const std::string& name,
16 const IInterface* parent) :
17 base_class(type, name, parent),
18 m_jetLocation(TrigT1CaloDefs::JetTopoTobLocation)
19{
20 declareInterface<LVL1::IInputTOBConverter>( this );
21 declareProperty( "JetROILocation", m_jetLocation, "Storegate key for the Jet ROIs" );
22}
23
26
27StatusCode
29
30 CHECK(m_jetLocation.initialize());
31
32 if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
33
34 return StatusCode::SUCCESS;
35}
36
37StatusCode
39 // https://indico.cern.ch/conferenceDisplay.py?confId=284687
40
41
42
44
45 if(!jettobdata.isValid()){
46 ATH_MSG_WARNING("No DataVector<JetCMXTopoData> with SG key '" << m_jetLocation.key() << "' found in the event. No JET input for the L1Topo simulation.");
47 return StatusCode::RECOVERABLE;
48 }
49
50
51 ATH_MSG_DEBUG("Filling the input event. Number of jet topo data objects: " << jettobdata->size());
52 for(const JetCMXTopoData * topoData : * jettobdata) {
53
54 // fill the vector of TOBs
55 std::vector< JetTopoTOB > tobs;
56 topoData->tobs(tobs);
57
58 ATH_MSG_DEBUG("Jet topo data object has # TOBs: " << tobs.size());
59 for(const JetTopoTOB & tob: tobs) {
60
61 ATH_MSG_DEBUG( "JET TOB with : et large = " << setw(4) << tob.etLarge() << ", et small " << tob.etSmall()
62 << ", eta = " << setw(2) << tob.eta() << ", phi = " << tob.phi()
63 << ", ieta = " << setw(2) << tob.ieta() << ", iphi = " << tob.iphi()
64 << ", word = " << hex << tob.roiWord() << dec
65 );
66
67 TCS::JetTOB jet( tob.etLarge(), tob.etSmall(), tob.ieta(), tob.iphi(), tob.roiWord() );
68 jet.setEtaDouble( tob.eta() );
69 jet.setPhiDouble( tob.phi() );
70 inputEvent.addJet( jet );
71 auto mon_hPt1 = Monitored::Scalar("TOBPt1", jet.Et1());
72 auto mon_hPt2 = Monitored::Scalar("TOBPt2", jet.Et2());
73 auto mon_hPhi = Monitored::Scalar("TOBPhi", jet.phi());
74 auto mon_hEta = Monitored::Scalar("TOBEta", jet.eta());
75 Monitored::Group(m_monTool, mon_hPt1, mon_hPt2, mon_hPhi, mon_hEta);
76 }
77 if(topoData->overflow()){
78 inputEvent.setOverflowFromJetInput(true);
79 ATH_MSG_DEBUG("setOverflowFromJetInput : true");
80 }
81 }
82 return StatusCode::SUCCESS;
83}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
JetInputProvider(const std::string &type, const std::string &name, const IInterface *parent)
SG::ReadHandleKey< DataVector< JetCMXTopoData > > m_jetLocation
Jet ROIs SG key.
ToolHandle< GenericMonitoringTool > m_monTool
virtual StatusCode initialize()
virtual StatusCode fillTopoInputEvent(TCS::TopoInputEvent &) const
Jet TOB data for L1Topo.
Definition JetTopoTOB.h:19
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode addJet(const JetTOB &jet)
void setOverflowFromJetInput(bool v)
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
STL namespace.