ATLAS Offline Software
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 
12 using namespace std;
13 using namespace LVL1;
14 
15 JetInputProvider::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 
25 {}
26 
29 
30  CHECK(m_jetLocation.initialize());
31 
32  if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
33 
34  return StatusCode::SUCCESS;
35 }
36 
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 }
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
LVL1::JetInputProvider::m_jetLocation
SG::ReadHandleKey< DataVector< JetCMXTopoData > > m_jetLocation
Jet ROIs SG key.
Definition: JetInputProvider.h:31
LVL1::JetInputProvider::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: JetInputProvider.h:29
LVL1::JetInputProvider::initialize
virtual StatusCode initialize()
Definition: JetInputProvider.cxx:28
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
JetInputProvider.h
LVL1::JetInputProvider::~JetInputProvider
virtual ~JetInputProvider()
Definition: JetInputProvider.cxx:24
TopoInputEvent.h
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TCS::TopoInputEvent
Definition: TopoInputEvent.h:42
LVL1::JetTopoTOB
Jet TOB data for L1Topo.
Definition: JetTopoTOB.h:19
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TrigConf::name
Definition: HLTChainList.h:35
LVL1::JetInputProvider::fillTopoInputEvent
virtual StatusCode fillTopoInputEvent(TCS::TopoInputEvent &) const
Definition: JetInputProvider.cxx:38
LVL1::JetCMXTopoData
Definition: JetCMXTopoData.h:22
ClusterTOB.h
LVL1::TrigT1CaloDefs
Definition: TrigT1CaloDefs.h:24
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TCS::JetTOB
Definition: JetTOB.h:18
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
JetROI_ClassDEF.h
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
TCS::TopoInputEvent::addJet
StatusCode addJet(const JetTOB &jet)
Definition: TopoInputEvent.cxx:82
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TCS::TopoInputEvent::setOverflowFromJetInput
void setOverflowFromJetInput(bool v)
Definition: TopoInputEvent.cxx:228