Skip to content
Snippets Groups Projects
Commit c9aa2ee9 authored by Tadej Novak's avatar Tadej Novak
Browse files

Merge branch 'sweep-2022-12-05' into 'master'

2022-12-05: Daily sweep of 22.0 into master

See merge request !59006
parents 1356045f d36e1c74
No related branches found
No related tags found
3 merge requests!59674InDetPerformanceMonitoring with LumiBlock selection,!59383cppcheck in trigger code: Prefer prefix ++/-- operators for non-primitive types.,!590062022-12-05: Daily sweep of 22.0 into master
......@@ -156,10 +156,13 @@ dir CT {
output = CentralTrigger/MuCTPI/Cand/Expert
hist candSLVsLBBA {
algorithm = check_MUCTPISLAnyHit
}
hist candSLVsLBEC {
algorithm = check_MUCTPISLAnyHit
}
hist candSLVsLBFW {
algorithm = check_MUCTPISLAnyHit
}
hist candVetoFlag_RoiVsSLBA {
}
......@@ -271,6 +274,12 @@ algorithm check_MUCTPISLTiming {
thresh = 0.4
}
algorithm check_MUCTPISLAnyHit {
libname = libdqm_algorithms.so
name = MUCTPISLAnyHit
thresh = 0.1
}
algorithm MUCTPI_Histogram_Not_Empty {
libname = libdqm_algorithms.so
name = Histogram_Not_Empty
......
......@@ -156,10 +156,13 @@ dir CT {
output = CentralTrigger/MuCTPI/Cand/Expert
hist candSLVsLBBA {
algorithm = check_MUCTPISLAnyHit
}
hist candSLVsLBEC {
algorithm = check_MUCTPISLAnyHit
}
hist candSLVsLBFW {
algorithm = check_MUCTPISLAnyHit
}
hist candVetoFlag_RoiVsSLBA {
}
......@@ -271,6 +274,12 @@ algorithm check_MUCTPISLTiming {
thresh = 0.4
}
algorithm check_MUCTPISLAnyHit {
libname = libdqm_algorithms.so
name = MUCTPISLAnyHit
thresh = 0.1
}
algorithm MUCTPI_Histogram_Not_Empty {
libname = libdqm_algorithms.so
name = Histogram_Not_Empty
......
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
#ifndef DQM_ALGORITHMS_MUCTPISLANYHIT_H
#define DQM_ALGORITHMS_MUCTPISLANYHIT_H
#include <string>
#include "TObject.h"
#include "dqm_core/Algorithm.h"
namespace dqm_algorithms {
class MUCTPISLAnyHit : public dqm_core::Algorithm {
public:
MUCTPISLAnyHit();
virtual ~MUCTPISLAnyHit() = default;
virtual dqm_core::Algorithm* clone();
virtual dqm_core::Result* execute( const std::string& name, const TObject& data, const dqm_core::AlgorithmConfig& config );
using dqm_core::Algorithm::printDescription;
virtual void printDescription(std::ostream& out);
private:
std::string m_name;
};
} //namespace dqm_algorithms
#endif // DQM_ALGORITHMS_MUCTPISLANYHIT_H
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
#include "dqm_algorithms/MUCTPISLAnyHit.h"
#include <cmath>
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <TClass.h>
#include <TH1.h>
#include <TH2.h>
#include "dqm_core/exceptions.h"
#include "dqm_core/AlgorithmConfig.h"
#include "dqm_core/AlgorithmManager.h"
#include "dqm_core/Result.h"
#include "dqm_algorithms/tools/AlgorithmHelper.h"
#include "ers/ers.h"
static dqm_algorithms::MUCTPISLAnyHit staticInstance;
namespace dqm_algorithms {
// *********************************************************************
// Public Methods
// *********************************************************************
MUCTPISLAnyHit::MUCTPISLAnyHit()
: m_name("MUCTPISLAnyHit")
{
dqm_core::AlgorithmManager::instance().registerAlgorithm( m_name, this );
}
dqm_core::Algorithm*
MUCTPISLAnyHit::clone()
{
return new MUCTPISLAnyHit(*this);
}
dqm_core::Result*
MUCTPISLAnyHit::execute( const std::string& name, const TObject& object, const dqm_core::AlgorithmConfig& config)
{
using namespace std;
const TH2 *hist;
//ensure that input histo is 2D
if( object.IsA()->InheritsFrom( "TH2" ) ) {
hist = dynamic_cast<const TH2 *>(&object);
if (hist->GetDimension() != 2 ){
throw dqm_core::BadConfig( ERS_HERE, name, "dimension != 2 " );
}
} else {
throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH2" );
}
//Get Parameters and Thresholds
double thresh=0.1;
try {
thresh = dqm_algorithms::tools::GetFirstFromMap("thresh", config.getParameters(), 0.1);
}
catch ( dqm_core::Exception & ex ) {
throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
}
//Algo
//project our 2D histogram to 1D (on the y-axis), thus summing up along x
TH1* projection = hist->ProjectionY();
dqm_core::Result* result = new dqm_core::Result();
std::map<std::string,double> tags; //defined in https://gitlab.cern.ch/atlas-tdaq-software/dqm_core/-/blob/master/dqm_core/Result.h
//assume all good, until find a bad one
result->status_ = dqm_core::Result::Green;
uint howmanybad=0;
for(int iBin=0;iBin<projection->GetNbinsX();iBin++)//foreach bin of the projection
{
if( projection->GetBinContent(iBin) < thresh ) //if bin content less than algorithm threshold => bad
{
result->status_ = dqm_core::Result::Yellow;
howmanybad++;
}
}
tags["howmanybad"] = howmanybad;
//set the result tags
result->tags_ = tags;
// Return the result
return result;
}
void
MUCTPISLAnyHit::printDescription(std::ostream& out){
std::string message;
message += "\n";
message += "Algorithm: \"" + m_name + "\"\n";
message += "Description: Makes the ProjectionY of the 2D input histo. If any bin content is below the given threshold => warning.\n";
message += "Optional Parameters: thresh = if any bin content in the ProjectionY is below this value => warning\n";
out << message;
}
} // namespace dqm_algorithms
......@@ -33,8 +33,9 @@ std::vector<TIDA::Vertex> TIDAVertexBuilder::select(
const std::vector< ElementLink< xAOD::TrackParticleContainer > >& xAODtracks = (*vtxitr)->trackParticleLinks();
for ( const auto& track : xAODtracks ) {
unsigned long id = getTrackId( *track );
trackIds.push_back( id );
unsigned long id = 0;
if (track.isValid()) id = getTrackId( *track );
trackIds.push_back( id );
}
vertex.selectTracks( *trackCollection, trackIds );
......
......@@ -58,7 +58,7 @@ namespace LVL1 {
int get_rho(const gTowersCentral &twrs);
int get_sigma(const gTowersCentral &twrs, const int rho);
int get_sigma(const gTowersCentral &twrs);
void rho_MET(const gTowersCentral &twrs, int & MET_x, int & MET_y, const int rho, const int sigma);
......
......@@ -78,8 +78,8 @@ void gFEXaltMetAlgo::altMetAlgo(const gTowersCentral &Atwr, const gTowersCentral
int A_rho{get_rho(Atwr)};
int B_rho{get_rho(Btwr)};
int A_sigma{3*get_sigma(Atwr, A_rho)};
int B_sigma{3*get_sigma(Btwr, B_rho)};
int A_sigma{3*get_sigma(Atwr)};
int B_sigma{3*get_sigma(Btwr)};
rho_MET(Atwr, A_MET_x_rms, A_MET_y_rms, A_rho, A_sigma);
rho_MET(Btwr, B_MET_x_rms, B_MET_y_rms, B_rho, B_sigma);
......@@ -179,7 +179,7 @@ int gFEXaltMetAlgo::get_rho(const gTowersCentral &twrs){
}
//Function calculates standard deviation of the gtowers
int gFEXaltMetAlgo::get_sigma(const gTowersCentral &twrs, const int rho) {
int gFEXaltMetAlgo::get_sigma(const gTowersCentral &twrs) {
int rows = twrs.size();
int cols = twrs[0].size();
......@@ -187,8 +187,8 @@ int gFEXaltMetAlgo::get_sigma(const gTowersCentral &twrs, const int rho) {
int sigma = 0;
for(int i = 0; i < rows; ++i) {
for(int j = 0; j < cols; ++j) {
const int diff{twrs[i][j]-rho};
sigma += twrs[i][j] < m_rhoPlusThr ? diff*diff: 0;
const int towers{twrs[i][j]};
sigma += twrs[i][j] < m_rhoPlusThr ? towers*towers: 0;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment