ATLAS Offline Software
Loading...
Searching...
No Matches
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

Private Attributes

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

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}
SG::ReadHandleKey< DataVector< LVL1::CPCMXTopoData > > m_emTauLocation
EMTAU ROI SG key.
static const std::string EmTauTopoTobLocation

◆ ~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 {
105 CPRoIDecoder get;
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}
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
double phi() const
return phi
double eta() const
return eta
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130

◆ 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
51
52 // Retrieve EMTAU RoIs (they are built by EMTAUTrigger)
53
54 SG::ReadHandle<DataVector < CPCMXTopoData> > emtau(m_emTauLocation);
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}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
bool overflow() const
Return overflow flag.
void tobs(std::vector< CPTopoTOB > &tobs) const
Fill a vector of TOBs.
ToolHandle< GenericMonitoringTool > m_monTool
StatusCode addTau(const ClusterTOB &tau)
StatusCode addCluster(const ClusterTOB &cluster)
void setOverflowFromEmtauInput(bool v)
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]

◆ initialize()

StatusCode EMTauInputProvider::initialize ( )
virtual

Definition at line 32 of file EMTauInputProvider.cxx.

32 {
33
34 CHECK(m_emTauLocation.initialize());
35
36 if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
37
38 return StatusCode::SUCCESS;
39}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.

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.

32{this, "MonTool", "", "Monitoring tool to create online histograms"};

The documentation for this class was generated from the following files: