ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
LVL1::EMTauInputProvider Class Reference

#include <EMTauInputProvider.h>

Inheritance diagram for LVL1::EMTauInputProvider:
Collaboration diagram for LVL1::EMTauInputProvider:

Public Member Functions

 EMTauInputProvider (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~EMTauInputProvider ()
 
virtual StatusCode initialize ()
 
virtual StatusCode fillTopoInputEvent (TCS::TopoInputEvent &) const
 

Private Member Functions

void CalculateCoordinates (int32_t roiWord, double &eta, double &phi) const
 calculates eta and phi from roiWord More...
 

Private Attributes

ToolHandle< GenericMonitoringToolm_monTool {this, "MonTool", "", "Monitoring tool to create online histograms"}
 
SG::ReadHandleKey< DataVector< LVL1::CPCMXTopoData > > m_emTauLocation
 EMTAU ROI SG key. More...
 

Detailed Description

Definition at line 16 of file EMTauInputProvider.h.

Constructor & Destructor Documentation

◆ EMTauInputProvider()

EMTauInputProvider::EMTauInputProvider ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 19 of file EMTauInputProvider.cxx.

20  :
21  base_class(type, name, parent),
23 {
24  declareInterface<LVL1::IInputTOBConverter>( this );
25  declareProperty( "EmTauROILocation", m_emTauLocation, "Storegate key for the EMTAU info from CMX" );
26 }

◆ ~EMTauInputProvider()

EMTauInputProvider::~EMTauInputProvider ( )
virtual

Definition at line 28 of file EMTauInputProvider.cxx.

29 {}

Member Function Documentation

◆ CalculateCoordinates()

void EMTauInputProvider::CalculateCoordinates ( int32_t  roiWord,
double &  eta,
double &  phi 
) const
private

calculates eta and phi from roiWord

Definition at line 104 of file EMTauInputProvider.cxx.

104  {
106  constexpr double TwoPI = 2 * M_PI;
107  CoordinateRange coordRange = get.coordinate( roiWord );
108 
109  eta = coordRange.eta();
110  phi = coordRange.phi();
111  if( phi > M_PI ) phi -= TwoPI;
112 }

◆ fillTopoInputEvent()

StatusCode EMTauInputProvider::fillTopoInputEvent ( TCS::TopoInputEvent inputEvent) const
virtual

this will be the new format https://indico.cern.ch/conferenceDisplay.py?confId=284687 Electron ROI: | 0 0 1 0 | 2b Crate | 4b CPM Num | 3b CPChip | 3b Local coords | 0 0 0 | 5b electron isolation/veto | 8b electron energy | Tau ROI: | 0 0 1 1 | 2b Crate | 4b CPM Num | 3b CPChip | 3b Local coords | 0 0 0 | 5b tau isolation/veto | 8b tau energy |

Definition at line 42 of file EMTauInputProvider.cxx.

42  {
43 
52  // Retrieve EMTAU RoIs (they are built by EMTAUTrigger)
53 
55  if( !emtau.isValid() ) {
56  ATH_MSG_WARNING("No CPCMXTopoDataCollection with SG key '" << m_emTauLocation.key() << "' found in the event. No EM or TAU input for the L1Topo simulation.");
57  return StatusCode::RECOVERABLE;
58  }
59 
60  ATH_MSG_DEBUG("Filling the input event. Number of emtau topo data objects: " << emtau->size());
61  // topoData is read in in reverse in order to obtain the same crate order as in the hardware (3->0, not 0->3)
62  for(auto iTopoData = emtau->rbegin(); iTopoData != emtau->rend(); ++iTopoData) {
63  const CPCMXTopoData *topoData = *iTopoData;
64 
65  // fill the vector of TOBs
66  std::vector< CPTopoTOB > tobs;
67  topoData->tobs(tobs);
68  ATH_MSG_DEBUG("Emtau topo data object has # TOBs: " << tobs.size());
69  for(const CPTopoTOB & tob : tobs ) {
70  ATH_MSG_DEBUG( "EMTAU TOB with cmx = " << tob.cmx() << "[" << (tob.cmx()==0?"EM":"TAU") << "]"
71  << " : e = " << setw(3) << tob.et() << ", isolation " << tob.isolation()
72  << ", eta = " << setw(2) << tob.eta() << ", phi = " << tob.phi()
73  << ", ieta = " << setw(2) << tob.ieta() << ", iphi = " << tob.iphi()
74  << ", word = " << hex << tob.roiWord() << dec
75  );
76 
77  TCS::ClusterTOB cl(tob.et(), tob.isolation(), tob.ieta(), tob.iphi(), tob.cmx()==0 ? TCS::CLUSTER : TCS::TAU, tob.roiWord() );
78  cl.setEtaDouble( tob.eta() );
79  cl.setPhiDouble( tob.phi() );
80 
81  if(tob.cmx()==0) {
82  inputEvent.addCluster( cl );
83  auto mon_hEMEt = Monitored::Scalar("EMTOBEt", cl.Et());
84  auto mon_hEMPhi = Monitored::Scalar("EMTOBPhi", cl.phi());
85  auto mon_hEMEta = Monitored::Scalar("EMTOBEta", cl.eta());
86  Monitored::Group(m_monTool, mon_hEMEt, mon_hEMPhi, mon_hEMEta);
87  } else {
88  inputEvent.addTau( cl );
89  auto mon_hTauEt = Monitored::Scalar("TauTOBEt", cl.Et());
90  auto mon_hTauPhi = Monitored::Scalar("TauTOBPhi", cl.phi());
91  auto mon_hTauEta = Monitored::Scalar("TauTOBEta", cl.eta());
92  Monitored::Group(m_monTool, mon_hTauEt, mon_hTauPhi, mon_hTauEta);
93  }
94  }
95  if(topoData->overflow()){
96  inputEvent.setOverflowFromEmtauInput(true);
97  ATH_MSG_DEBUG("setOverflowFromEmtauInput : true");
98  }
99  }
100  return StatusCode::SUCCESS;
101 }

◆ initialize()

StatusCode EMTauInputProvider::initialize ( )
virtual

Definition at line 32 of file EMTauInputProvider.cxx.

32  {
33 
35 
36  if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
37 
38  return StatusCode::SUCCESS;
39 }

Member Data Documentation

◆ m_emTauLocation

SG::ReadHandleKey<DataVector<LVL1::CPCMXTopoData> > LVL1::EMTauInputProvider::m_emTauLocation
private

EMTAU ROI SG key.

Definition at line 34 of file EMTauInputProvider.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> LVL1::EMTauInputProvider::m_monTool {this, "MonTool", "", "Monitoring tool to create online histograms"}
private

Definition at line 32 of file EMTauInputProvider.h.


The documentation for this class was generated from the following files:
LVL1::EMTauInputProvider::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: EMTauInputProvider.h:32
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
LVL1::Coordinate::phi
double phi() const
return phi
Definition: Coordinate.cxx:50
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
TCS::CLUSTER
@ CLUSTER
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:11
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TCS::TopoInputEvent::setOverflowFromEmtauInput
void setOverflowFromEmtauInput(bool v)
Definition: TopoInputEvent.cxx:223
TCS::TopoInputEvent::addCluster
StatusCode addCluster(const ClusterTOB &cluster)
Definition: TopoInputEvent.cxx:46
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::EMTauInputProvider::m_emTauLocation
SG::ReadHandleKey< DataVector< LVL1::CPCMXTopoData > > m_emTauLocation
EMTAU ROI SG key.
Definition: EMTauInputProvider.h:34
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
TCS::TAU
@ TAU
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:18
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
TCS::TopoInputEvent::addTau
StatusCode addTau(const ClusterTOB &tau)
Definition: TopoInputEvent.cxx:77
LVL1::CPTopoTOB
CP TOB data for L1Topo.
Definition: CPTopoTOB.h:19
LVL1::CoordinateRange
CoordinateRange class declaration.
Definition: CoordinateRange.h:36
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TrigConf::name
Definition: HLTChainList.h:35
LVL1::CPCMXTopoData::overflow
bool overflow() const
Return overflow flag.
Definition: CPCMXTopoData.cxx:130
LVL1::Coordinate::eta
double eta() const
return eta
Definition: Coordinate.cxx:45
LVL1::CPRoIDecoder
A level 1 calorimeter trigger conversion service: returns the Coordinate represented by a RoI word.
Definition: CPRoIDecoder.h:37
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1::TrigT1CaloDefs::EmTauTopoTobLocation
static const std::string EmTauTopoTobLocation
Definition: TrigT1CaloDefs.h:85
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
LVL1::CPCMXTopoData::tobs
void tobs(std::vector< CPTopoTOB > &tobs) const
Fill a vector of TOBs.
Definition: CPCMXTopoData.cxx:143
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TCS::ClusterTOB
Definition: ClusterTOB.h:13
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
LVL1::CPCMXTopoData
Definition: CPCMXTopoData.h:22