49 return StatusCode::FAILURE;
73 std::vector<Monitored::Scalar<double>> jem_em_2d_eta_jetEl_HitMapSlice;
74 std::vector<Monitored::Scalar<double>> jem_em_2d_phi_jetEl_HitMapSlice;
75 std::vector<Monitored::Scalar<double>> jem_had_2d_eta_jetEl_HitMapSlice;
76 std::vector<Monitored::Scalar<double>> jem_had_2d_phi_jetEl_HitMapSlice;
77 std::stringstream buffer;
99 std::vector<int> overview(2);
109 for (; jeIterator != jeIteratorEnd; ++jeIterator)
114 const double eta = je->
eta();
115 const double phi = je->
phi();
116 const int slice_n = je->
peak();
123 <<
" and energies (Em,Had): " << emEnergy <<
", "
124 << hadEnergy <<
" HW Crate:" << crate
125 <<
" Module: " << module <<
" " << cord);
129 etJepJem_em = emEnergy;
131 em_weight = emEnergy;
139 etJepJem_had = hadEnergy;
141 had_weight = hadEnergy;
150 jem_1d_triggeredSlice_num = slice_n;
156 const int slicesEm = emEnergyVec.size();
157 const int slicesHad = hadEnergyVec.size();
159 if (i < slicesEm && emEnergyVec[i] > 0) {
162 if (i < slicesHad && hadEnergyVec[i] > 0) {
171 const int ypos = crate * 16 + module;
173 bool emParityError =
false;
174 bool hadParityError =
false;
175 bool emLinkDownError =
false;
176 bool hadLinkDownError =
false;
178 if (err.get(DataError::Parity)) {
179 emParityError =
true;
185 if (haderr.
get(DataError::Parity)) {
186 hadParityError =
true;
192 if (err.get(DataError::LinkDown)) {
193 emLinkDownError =
true;
196 overview[crate] |= (1 <<
EMLink);
199 if (haderr.
get(DataError::LinkDown)) {
200 hadLinkDownError =
true;
203 overview[crate] |= (1 <<
HadLink);
205 parityErrorJepJE_em = emParityError;
207 parityErrorJepJE_had = hadParityError;
209 linkDownErrorJepJE_em = emLinkDownError;
211 linkDownErrorJepJE_had = hadLinkDownError;
218 for (
int bit = 0; bit < 8; ++bit) {
219 if ((status >> bit) & 0x1) {
220 GLinkParityError = bit;
236 if (!JEMEtSums.isValid()) {
238 return StatusCode::FAILURE;
249 for (; sumsIterator != sumsIteratorEnd; ++sumsIterator) {
251 const int ex = sums->
ex();
252 const int ey = sums->
ey();
253 const int et = sums->
et();
264 <<
" Module: " << sums->
module()
278 return StatusCode::FAILURE;
295 std::vector<int> tobCount(vecSize);
296 for (; roiIterator != roiIteratorEnd; ++roiIterator) {
298 const int crate = roi->
crate();
299 const int module = roi->
jem();
304 const double eta = coordRange.
eta();
305 const double phi = coordRange.
phi();
308 jemRoiEnergyLg = energyLg;
310 jemRoiEnergyWeight = energyLg;
316 jemRoiEnergySm = energySm;
322 for (
int crate = 0; crate <
m_crates; ++crate) {
323 for (
int jem = 0; jem <
m_modules; ++jem) {
324 int val = tobCount[crate *
m_modules + jem];
327 jemRoiTOBsPerJEM = val;
333 return StatusCode::SUCCESS;
344 phiMonitoredScalar =
phi + halfBin;
346 phiMonitoredScalar =
phi - halfBin;
350 phiMonitoredScalar =
phi;
363 const double absEta = std::abs(
eta);
366 if (absEta > 3.2) offset = 4;
367 else if (absEta > 2.9) offset = 3;
368 else if (absEta > 2.7) offset = 2;
369 etaMod = 2.3 + 0.2 * offset;
370 if (
eta < 0.) etaMod = -etaMod;
372 etaMonitoredScalar = etaMod;
375 phiMod = std::floor(phiMod / 2) * 2. + 1.;
376 phiMonitoredScalar = phiMod + 0.5;
378 phiMonitoredScalar = phiMod - 0.5;
382 phiMonitoredScalar = phiMod;
394 const double absEta = std::abs(
eta);
397 if (absEta > 3.2) offset = 4;
398 else if (absEta > 2.9) offset = 3;
399 else if (absEta > 2.7) offset = 2;
400 etaMod = 2.3 + 0.2 * offset;
401 if (
eta < 0.) etaMod = -etaMod;
403 etaMonitoredScalar = etaMod;
406 phiMod = std::floor(phiMod / 2) * 2. + 1.;
407 phiMonitoredScalar = phiMod + 0.5;
409 phiMonitoredScalar = phiMod - 0.5;
413 phiMonitoredScalar = phiMod;
425 phiMonitoredScalar = phiMod;
427 const double absEta = std::abs(
eta);
430 if (absEta > 4.0) offset = 5;
431 else if (absEta > 3.05) offset = 4;
432 else if (absEta > 2.8) offset = 3;
433 else if (absEta > 2.55) offset = 2;
434 etaMod = 2.2 + 0.2 * offset;
435 if (
eta < 0.) etaMod = -etaMod;
437 const double etaShift = 0.1;
439 if (
eta > 3.8 &&
eta < 4.0) {
440 etaMonitoredScalar = 3.2 - etaShift;
443 etaMonitoredScalar = etaMod - etaShift;
453 phiMonitoredScalar = phiMod;
455 const double absEta = std::abs(
eta);
458 if (absEta > 4.0) offset = 5;
459 else if (absEta > 3.05) offset = 4;
460 else if (absEta > 2.8) offset = 3;
461 else if (absEta > 2.55) offset = 2;
462 etaMod = 2.2 + 0.2 * offset;
463 if (
eta < 0.) etaMod = -etaMod;
465 const double etaShift = 0.1;
467 if (
eta > 3.8 &&
eta < 4.0) {
468 etaMonitoredScalar = 3.2 - etaShift;
471 etaMonitoredScalar = etaMod - etaShift;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual StatusCode initialize() override
initialize
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
DataModel_detail::const_iterator< DataVector > const_iterator
SG::ReadHandleKey< xAOD::JEMTobRoIContainer > m_JEMRoILocation
JepJemMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
void fillJEMRoIEtaVsPhiMon(double eta, double phi, Monitored::Scalar< double > &etaMonitoredScalar, Monitored::Scalar< double > &phiMonitoredScalar, Monitored::Scalar< int > &weight) const
Gaudi::Property< int > m_tobsPerJEM
virtual StatusCode initialize() override
initialize
SG::ReadHandleKey< xAOD::JEMEtSumsContainer > m_JEMEtSumsLocation
StringProperty m_packageName
SG::ReadHandleKey< xAOD::JetElementContainer > m_JetElementLocation
Gaudi::Property< int > m_maxSlices
Gaudi::Property< int > m_crates
Gaudi::Property< int > m_modules
void fillJEMPhiMon(double eta, double phi, Monitored::Scalar< double > &phiMonitoredScalar) const
void fillJEMEtaVsPhiMon(double eta, double phi, Monitored::Scalar< double > &etaMonitoredScalar, Monitored::Scalar< double > &phiMonitoredScalar, Monitored::Scalar< int > &weight) const
returns the trigger hardware components associated with a given Coordinate
unsigned int jepModule(const Coordinate &coord)
returns ID of JEP module (i.e.
unsigned int jepCoordinateWord(const Coordinate &coord)
return JEP (Jet Energy Processing) hardware coordinate word for this coordinate.
unsigned int jepCrate(const Coordinate &Coord)
returns ID of JEP Crate that covers this coordinate
CoordinateRange class declaration.
Coordinate class declaration.
double phi() const
return phi
double eta() const
return eta
int get(ErrorBit bit) const
Return an error bit or data.
A level 1 calorimeter trigger conversion service: returns the Coordinate represented by a RoI word.
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
uint16_t et() const
get et for etVec[peak] - time slice that (hopefully) contains the collision
uint16_t ey() const
get ey for eyVec[peak] - time slice that (hopefully) contains the collision
uint8_t module() const
get module
uint16_t ex() const
get ex for exVec[peak] - time slice that (hopefully) contains the collision
uint8_t crate() const
get crate number
uint32_t roiWord() const
get roiWord
int energyLarge() const
Return energy large window size.
int crate() const
Return crate number (0-1)
int energySmall() const
Return energy small window size.
int jem() const
Return JEM number (0-15)
float phi() const
get phi (note that for L1Calo phi runs from 0 to 2pi)
const std::vector< uint16_t > & hadJetElementETVec() const
get hadJetElementETVec - hadJetElementET for all time slices
unsigned int hadJetElementET() const
get hadJetElementET for hadJetElementETVec[peak] - time slice that (hopefully) contains the collision
uint32_t emJetElementError() const
get emJetElementError for emJetElementErrorVec[peak] - time slice that (hopefully) contains the colli...
const std::vector< uint16_t > & emJetElementETVec() const
get emJetElementETVec - emJetElementET for all time slices
uint32_t hadJetElementError() const
get hadJetElementError for hadJetElementErrorVec[peak] - time slice that (hopefully) contains the col...
unsigned int emJetElementET() const
get emJetElementET for emJetElementETVec[peak] - time slice that (hopefully) contains the collision
uint8_t peak() const
get peak
JetElement_v2 JetElement
Define the latest version of the JetElement class.
JEMEtSums_v2 JEMEtSums
Define the latest version of the JEMEtSums class.
JEMTobRoI_v1 JEMTobRoI
Define the latest version of the JEMTobRoI class.
Extra patterns decribing particle interation process.
void fill(H5::Group &out_file, size_t iterations)