ATLAS Offline Software
Loading...
Searching...
No Matches
TCS::eTauSort Class Reference

#include <eTauSort.h>

Inheritance diagram for TCS::eTauSort:
Collaboration diagram for TCS::eTauSort:

Public Member Functions

 eTauSort (const std::string &name)
virtual ~eTauSort ()
virtual TCS::StatusCode initialize () override
virtual TCS::StatusCode sort (const InputTOBArray &input, TOBArray &output) override final
virtual TCS::StatusCode sortBitCorrect (const InputTOBArray &input, TOBArray &output)
bool overflow () const
 whether an overlflow occurred
SortingAlgsetOverflow (const bool v)
 setter, to propagate bit from input event
void setClassName (const std::string &className)
void setLegacyMode (bool isLegacyTopo)
const std::string & name () const
const std::string & className () const
std::string fullname () const
unsigned int algoId () const
StatusCode reset ()
bool isSortingAlg () const
bool isDecisionAlg () const
bool isCountingAlg () const
bool isLegacyTopo () const
unsigned int calcDeltaPhiBW (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
unsigned int calcDeltaEtaBW (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
unsigned int calcInvMassBW (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
unsigned int calcTMassBW (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
unsigned int calcDeltaR2BW (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
unsigned long quadraticSumBW (int i1, int i2)
unsigned int calcDeltaPhi (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
unsigned int calcDeltaEta (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
unsigned int calcInvMass (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
unsigned int calcTMass (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
unsigned int calcDeltaR2 (const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
const Parameterparameter (const std::string &parameterName) const
const Parameterparameter (const std::string &parameterName, unsigned int selection) const
const ParameterSpaceparameters () const
void setParameters (const ParameterSpace &)
void setAlgoId (unsigned int algoId)
void setL1TopoHistSvc (std::shared_ptr< IL1TopoHistSvc >)
 sets the external hist service
void bookHistMult (std::vector< std::string > &regName, const std::string &name, const std::string &title, const std::string &xtitle, const int binx, const int xmin, const int xmax)
void bookHistMult (std::vector< std::string > &regName, const std::string &name, const std::string &title, const std::string &xtitle, const std::string &ytitle, const int binx, const int xmin, const int xmax, const int biny, const int ymin, const int ymax)
void bookHist (std::vector< std::string > &regName, const std::string &name, const std::string &title, const int binx, const int xmin, const int xmax)
void bookHist (std::vector< std::string > &regName, const std::string &name, const std::string &title, const int binx, const int xmin, const int xmax, const int biny, const int ymin, const int ymax)
bool msgLvl (const MSGTC::Level lvl) const
 Test the output level.
MsgStreamTC & msg () const
 The standard message stream.
MsgStreamTC & msg (const MSGTC::Level lvl) const
 The standard message stream.
const std::string & getName () const
 name accessor

Protected Types

enum  AlgType { NONE , SORT , DECISION , COUNT }

Protected Member Functions

virtual StatusCode doReset ()
void defineParameter (const std::string &name, TCS::parType_t value)
void defineParameter (const std::string &name, TCS::parType_t value, unsigned int selection)
void registerHist (TH1 *)
void registerHist (TH2 *)
void fillHist1D (const std::string &histName, double x)
void fillHist2D (const std::string &histName, double x, double y)
bool isocut (const std::string &threshold, const unsigned int bit) const
bool isocut (const unsigned int threshold, const unsigned int bit) const

Protected Attributes

bool m_overflow
 whether an overflow occurred during the current execution.

Private Member Functions

void defineParameter (const Parameter &)
std::string ToString (const int val)

Private Attributes

parType_t m_numberOfeTaus = { 0 }
parType_t m_minRCore = { 0 }
parType_t m_minRHad = { 0 }
std::unique_ptr< ConfigurableAlgImplm_impl
std::string m_name {""}
std::string m_className {""}
unsigned int m_algoId {0}
ParameterSpace m_parameters {""}
AlgType m_algType
bool m_isLegacyTopo
boost::thread_specific_ptr< MsgStreamTC > m_msg_tls
 MsgStreamTC instance (a std::cout like with print-out levels)

Detailed Description

Definition at line 18 of file eTauSort.h.

Member Enumeration Documentation

◆ AlgType

enum TCS::ConfigurableAlg::AlgType
protectedinherited
Enumerator
NONE 
SORT 
DECISION 
COUNT 

Definition at line 32 of file ConfigurableAlg.h.

Constructor & Destructor Documentation

◆ eTauSort()

TCS::eTauSort::eTauSort ( const std::string & name)

Definition at line 23 of file eTauSort.cxx.

23 : SortingAlg(name) {
24 defineParameter( "InputWidth", 120 ); // for FW
25 defineParameter( "InputWidth1stStage", 30 ); // for FW
26 defineParameter( "OutputWidth", 6 );
27 defineParameter( "RCoreMin", 0 );
28 defineParameter( "RHadMin", 0 );
29 defineParameter( "MinEta", 0 );
30 defineParameter( "MaxEta", 196 );
31}
const std::string & name() const
void defineParameter(const std::string &name, TCS::parType_t value)
SortingAlg(const std::string &name)
Definition SortingAlg.h:21

◆ ~eTauSort()

TCS::eTauSort::~eTauSort ( )
virtual

Definition at line 35 of file eTauSort.cxx.

35{}

Member Function Documentation

◆ algoId()

unsigned int TCS::ConfigurableAlg::algoId ( ) const
inlineinherited

Definition at line 53 of file ConfigurableAlg.h.

53{ return m_algoId; }

◆ bookHist() [1/2]

void ConfigurableAlg::bookHist ( std::vector< std::string > & regName,
const std::string & name,
const std::string & title,
const int binx,
const int xmin,
const int xmax )
inherited

Definition at line 270 of file ConfigurableAlg.cxx.

270 {
271 std::string xmin_str = ToString(xmin);
272 std::string xmax_str = ToString(xmax);
273 std::string newTitle = title;
274 std::string newName = name;
275
276 newTitle = xmin_str+title+xmax_str;
277 newName = name+"_"+xmin_str+title+xmax_str;
278 std::replace( newName.begin(), newName.end(), '-', 'n');
279 std::replace( newName.begin(), newName.end(), ' ', '_');
280
281 regName.push_back(m_name+"/"+newName);
282
283 // Add units to axis labels
284 std::string xTitle = title;
285 if (m_isLegacyTopo) {
286 if (title == "ETA" || title == "DETA" || title == "PHI" || title == "DPHI" || title == "DR") { xTitle = title+"#times10"; }
287 if (title == "PT" || title == "ET" || title == "HT" || title == "INVM" || title == "MT") { xTitle = title+" [GeV]"; }
288 }
289 else {
290 if (title == "ETA" || title == "DETA" || title == "DR") { xTitle = title+"#times40"; }
291 if (title == "PHI" || title == "DPHI") { xTitle = title+"#times20"; }
292 if (title == "PT" || title == "ET" || title == "HT" || title == "INVM" || title == "MT") { xTitle = title+" [100 MeV]"; }
293 }
294
295 int xmin_new,xmax_new,binx_new=binx;
296 if ( xmin > 0.0)
297 { xmin_new=0.0; }
298 else
299 { xmin_new=1.5*xmin; }
300
301 // if the maximum inv. mass cut defined by the menu over 4000 MeV,
302 // set x-axis range maximum to 4000 MeV. This is only for legacy triggers,
303 // phase1 does not exceed this limit- asonay 08/2022
304 if (xmax > 4000 && m_isLegacyTopo) {
305 xmax_new = 4000;
306 binx_new = 200;
307 }
308 else {xmax_new = 1.5*xmax;}
309
310 // if angular kinematics, use fixed range
311 int eta_max = 50;
312 int phi_max = 64;
313 int dr_max = 30;
314 if (not m_isLegacyTopo) {
315 eta_max *= 4;
316 phi_max *= 2;
317 dr_max *= 4;
318 }
319
320 if ( title.find("ETA") != std::string::npos ){
321 xmin_new=-eta_max;
322 xmax_new=eta_max;
323 }
324 if ( title.find("PHI") != std::string::npos || title.find("DPHI") != std::string::npos ){
325 xmin_new=0;
326 xmax_new=phi_max;
327 }
328 if ( title.find("DETA") != std::string::npos || title.find("DR") != std::string::npos ){
329 xmin_new=0;
330 xmax_new=dr_max;
331 }
332
333 TH1 *h = new TH1F(newName.c_str(), newTitle.c_str(), binx_new, xmin_new, xmax_new);
334 h->GetXaxis()->SetTitle(xTitle.c_str());
335 m_impl->registerHist(h);
336}
std::string ToString(const int val)
std::unique_ptr< ConfigurableAlgImpl > m_impl
double xmax
Definition listroot.cxx:61
double xmin
Definition listroot.cxx:60
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)

◆ bookHist() [2/2]

void ConfigurableAlg::bookHist ( std::vector< std::string > & regName,
const std::string & name,
const std::string & title,
const int binx,
const int xmin,
const int xmax,
const int biny,
const int ymin,
const int ymax )
inherited

Definition at line 347 of file ConfigurableAlg.cxx.

347 {
348 auto usPos = title.find(" vs ");
349 std::string xName = title.substr(0,usPos);
350 std::string yName = title.substr(usPos+4);
351 std::string xmin_str = ToString(xmin);
352 std::string xmax_str = ToString(xmax);
353 std::string ymin_str = ToString(ymin);
354 std::string ymax_str = ToString(ymax);
355 std::string newTitle = title;
356 std::string newName = name;
357
358 newTitle = xmin_str+xName+xmax_str+" vs "+ymin_str+yName+ymax_str;
359 newName = name+"_"+xmin_str+xName+xmax_str+"_"+ymin_str+yName+ymax_str;
360 std::replace( newName.begin(), newName.end(), '-', 'n');
361 std::replace( newName.begin(), newName.end(), ' ', '_');
362
363 regName.push_back(m_name+"/"+newName);
364
365 // Add units to axis labels
366 std::string xTitle = xName;
367 std::string yTitle = yName;
368 if (m_isLegacyTopo) {
369 if (xName == "ETA" || xName == "DETA" || xName == "PHI" || xName == "DPHI" || xName == "DR") { xTitle = xName+"#times10"; }
370 if (xName == "PT" || xName == "ET" || xName == "HT" || xName == "INVM" || xName == "MT") { xTitle = xName+" [GeV]"; }
371
372 if (yName == "ETA" || yName == "DETA" || yName == "PHI" || yName == "DPHI" || yName == "DR") { yTitle = yName+"#times10"; }
373 if (yName == "PT" || yName == "ET" || yName == "HT" || yName == "INVM" || yName == "MT") { yTitle = yName+" [GeV]"; }
374 }
375 else {
376 if (xName == "ETA" || xName == "DETA" || xName == "DR") { xTitle = xName+"#times40"; }
377 if (xName == "PHI" || xName == "DPHI") { xTitle = xName+"#times20"; }
378 if (xName == "PT" || xName == "ET" || xName == "HT" || xName == "INVM" || xName == "MT") { xTitle = xName+" [100 MeV]"; }
379
380 if (yName == "ETA" || yName == "DETA" || yName == "DR") { yTitle = yName+"#times40"; }
381 if (yName == "PHI" || yName == "DPHI") { yTitle = yName+"#times20"; }
382 if (yName == "PT" || yName == "ET" || yName == "HT" || yName == "INVM" || yName == "MT") { yTitle = yName+" [100 MeV]"; }
383 }
384
385 int xmin_new,xmax_new,binx_new=binx;
386 if ( xmin > 0.0)
387 { xmin_new=0.0; }
388 else
389 { xmin_new=1.5*xmin; }
390
391 // if the maximum inv. mass cut defined by the menu over 4000 MeV,
392 // set x-axis range maximum to 4000 MeV. This is only for legacy triggers,
393 // phase1 does not exceed this limit- asonay 08/2022
394 if (xmax > 4000 && m_isLegacyTopo) {
395 xmax_new = 4000;
396 binx_new = 200;
397 }
398 else {xmax_new = 1.5*xmax;}
399
400 int ymin_new,ymax_new,biny_new=biny;
401 if ( ymin > 0.0)
402 { ymin_new=0.0; }
403 else
404 { ymin_new=1.5*ymin; }
405
406 // if the maximum inv. mass cut defined by the menu over 4000 MeV,
407 // set y-axis range maximum to 4000 MeV. This is only for legacy triggers,
408 // phase1 does not exceed this limit- asonay 08/2022
409 if (ymax > 4000 && m_isLegacyTopo) {
410 ymax_new = 4000;
411 biny_new = 200;
412 }
413 else {ymax_new = 1.5*ymax;}
414
415
416 // if angular kinematics, use fixed range
417 int eta_max = 50;
418 int phi_max = 64;
419 int dr_max = 30;
420 if (not m_isLegacyTopo) {
421 eta_max *= 4;
422 phi_max *= 2;
423 dr_max *= 4;
424 }
425
426 if ( xName.find("ETA") != std::string::npos ){
427 xmin_new=-eta_max;
428 xmax_new=eta_max;
429 }
430 if ( yName.find("ETA") != std::string::npos ){
431 ymin_new=-eta_max;
432 ymax_new=eta_max;
433 }
434 if ( xName.find("PHI") != std::string::npos || xName.find("DPHI") != std::string::npos ){
435 xmin_new=0;
436 xmax_new=phi_max;
437 }
438 if ( yName.find("PHI") != std::string::npos || yName.find("DPHI") != std::string::npos ){
439 ymin_new=0;
440 ymax_new=phi_max;
441 }
442 if ( xName.find("DETA") != std::string::npos || xName.find("DR") != std::string::npos ){
443 xmin_new=0;
444 xmax_new=dr_max;
445 }
446 if ( yName.find("DETA") != std::string::npos || yName.find("DR") != std::string::npos ){
447 ymin_new=0;
448 ymax_new=dr_max;
449 }
450
451 TH2 *h = new TH2F(newName.c_str(), newTitle.c_str(), binx_new, xmin_new, xmax_new, biny_new, ymin_new, ymax_new);
452 h->GetXaxis()->SetTitle(xTitle.c_str());
453 h->GetYaxis()->SetTitle(yTitle.c_str());
454 m_impl->registerHist(h);
455}
double ymin
Definition listroot.cxx:63
double ymax
Definition listroot.cxx:64
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)

◆ bookHistMult() [1/2]

void ConfigurableAlg::bookHistMult ( std::vector< std::string > & regName,
const std::string & name,
const std::string & title,
const std::string & xtitle,
const int binx,
const int xmin,
const int xmax )
inherited

Definition at line 338 of file ConfigurableAlg.cxx.

338 {
339
340 regName.push_back(m_name+"/"+name);
341
342 TH1 *h = new TH1F(name.c_str(), title.c_str(), binx, xmin, xmax);
343 h->GetXaxis()->SetTitle(xtitle.c_str());
344 m_impl->registerHist(h);
345}

◆ bookHistMult() [2/2]

void ConfigurableAlg::bookHistMult ( std::vector< std::string > & regName,
const std::string & name,
const std::string & title,
const std::string & xtitle,
const std::string & ytitle,
const int binx,
const int xmin,
const int xmax,
const int biny,
const int ymin,
const int ymax )
inherited

Definition at line 457 of file ConfigurableAlg.cxx.

457 {
458
459 regName.push_back(m_name+"/"+name);
460
461 TH2 *h = new TH2F(name.c_str(), title.c_str(), binx, xmin, xmax, biny, ymin, ymax);
462 h->GetXaxis()->SetTitle(xtitle.c_str());
463 h->GetYaxis()->SetTitle(ytitle.c_str());
464 m_impl->registerHist(h);
465}

◆ calcDeltaEta()

unsigned int ConfigurableAlg::calcDeltaEta ( const TCS::GenericTOB * tob1,
const TCS::GenericTOB * tob2 )
inherited

Definition at line 173 of file ConfigurableAlg.cxx.

173 {
174 if (m_isLegacyTopo)
175 {return TSU::Kinematics::calcDeltaEtaLegacy(tob1,tob2);}
176 else
177 {return TSU::Kinematics::calcDeltaEta(tob1,tob2);}
178}
static unsigned int calcDeltaEta(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
static unsigned int calcDeltaEtaLegacy(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)

◆ calcDeltaEtaBW()

unsigned int ConfigurableAlg::calcDeltaEtaBW ( const TCS::GenericTOB * tob1,
const TCS::GenericTOB * tob2 )
inherited

Definition at line 128 of file ConfigurableAlg.cxx.

128 {
129 if (m_isLegacyTopo)
130 {return TSU::Kinematics::calcDeltaEtaBWLegacy(tob1,tob2);}
131 else
132 {return TSU::Kinematics::calcDeltaEtaBW(tob1,tob2);}
133}
static unsigned int calcDeltaEtaBWLegacy(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
static unsigned int calcDeltaEtaBW(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)

◆ calcDeltaPhi()

unsigned int ConfigurableAlg::calcDeltaPhi ( const TCS::GenericTOB * tob1,
const TCS::GenericTOB * tob2 )
inherited

Definition at line 165 of file ConfigurableAlg.cxx.

165 {
166 if (m_isLegacyTopo)
167 {return TSU::Kinematics::calcDeltaPhiLegacy(tob1,tob2);}
168 else
169 {return TSU::Kinematics::calcDeltaPhi(tob1,tob2);}
170}
static unsigned int calcDeltaPhi(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
static unsigned int calcDeltaPhiLegacy(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)

◆ calcDeltaPhiBW()

unsigned int ConfigurableAlg::calcDeltaPhiBW ( const TCS::GenericTOB * tob1,
const TCS::GenericTOB * tob2 )
inherited

Definition at line 120 of file ConfigurableAlg.cxx.

120 {
121 if (m_isLegacyTopo)
122 {return TSU::Kinematics::calcDeltaPhiBWLegacy(tob1,tob2);}
123 else
124 {return TSU::Kinematics::calcDeltaPhiBW(tob1,tob2);}
125}
static unsigned int calcDeltaPhiBWLegacy(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
static unsigned int calcDeltaPhiBW(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)

◆ calcDeltaR2()

unsigned int ConfigurableAlg::calcDeltaR2 ( const TCS::GenericTOB * tob1,
const TCS::GenericTOB * tob2 )
inherited

Definition at line 191 of file ConfigurableAlg.cxx.

191 {
192 if (m_isLegacyTopo)
193 {return TSU::Kinematics::calcDeltaR2Legacy(tob1,tob2);}
194 else
195 {return TSU::Kinematics::calcDeltaR2(tob1,tob2);}
196}
static unsigned int calcDeltaR2Legacy(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
static unsigned int calcDeltaR2(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)

◆ calcDeltaR2BW()

unsigned int ConfigurableAlg::calcDeltaR2BW ( const TCS::GenericTOB * tob1,
const TCS::GenericTOB * tob2 )
inherited

Definition at line 152 of file ConfigurableAlg.cxx.

152 {
153 if (m_isLegacyTopo)
154 {return TSU::Kinematics::calcDeltaR2BWLegacy(tob1,tob2);}
155 else
156 {return TSU::Kinematics::calcDeltaR2BW(tob1,tob2);}
157}
static unsigned int calcDeltaR2BW(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
static unsigned int calcDeltaR2BWLegacy(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)

◆ calcInvMass()

unsigned int ConfigurableAlg::calcInvMass ( const TCS::GenericTOB * tob1,
const TCS::GenericTOB * tob2 )
inherited

Definition at line 181 of file ConfigurableAlg.cxx.

181 {
182 return TSU::Kinematics::calcInvMass(tob1,tob2);
183}
static unsigned int calcInvMass(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)

◆ calcInvMassBW()

unsigned int ConfigurableAlg::calcInvMassBW ( const TCS::GenericTOB * tob1,
const TCS::GenericTOB * tob2 )
inherited

Definition at line 136 of file ConfigurableAlg.cxx.

136 {
137 if (m_isLegacyTopo)
138 {return TSU::Kinematics::calcInvMassBWLegacy(tob1,tob2);}
139 else
140 {return TSU::Kinematics::calcInvMassBW(tob1,tob2);}
141}
static unsigned int calcInvMassBW(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
static unsigned int calcInvMassBWLegacy(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)

◆ calcTMass()

unsigned int ConfigurableAlg::calcTMass ( const TCS::GenericTOB * tob1,
const TCS::GenericTOB * tob2 )
inherited

Definition at line 186 of file ConfigurableAlg.cxx.

186 {
187 return TSU::Kinematics::calcTMass(tob1,tob2);
188}
static unsigned int calcTMass(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)

◆ calcTMassBW()

unsigned int ConfigurableAlg::calcTMassBW ( const TCS::GenericTOB * tob1,
const TCS::GenericTOB * tob2 )
inherited

Definition at line 144 of file ConfigurableAlg.cxx.

144 {
145 if (m_isLegacyTopo)
146 {return TSU::Kinematics::calcTMassBWLegacy(tob1,tob2);}
147 else
148 {return TSU::Kinematics::calcTMassBW(tob1,tob2);}
149}
static unsigned int calcTMassBWLegacy(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
static unsigned int calcTMassBW(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)

◆ className()

const std::string & TCS::ConfigurableAlg::className ( ) const
inlineinherited

Definition at line 49 of file ConfigurableAlg.h.

49{ return m_className; }

◆ defineParameter() [1/3]

void ConfigurableAlg::defineParameter ( const Parameter & parameter)
privateinherited

Definition at line 213 of file ConfigurableAlg.cxx.

213 {
214 if( parameters().contains( parameter.name(), parameter.selection() ) ) {
215 TCS_EXCEPTION("Duplicate parameter definition '" << parameter.name() << "' for algorithm '" << name() << "'");
216 }
217 m_parameters.addParameter(parameter);
218}
const ParameterSpace & parameters() const
const Parameter & parameter(const std::string &parameterName) const
ParameterSpace m_parameters
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114

◆ defineParameter() [2/3]

void ConfigurableAlg::defineParameter ( const std::string & name,
TCS::parType_t value )
protectedinherited

Definition at line 201 of file ConfigurableAlg.cxx.

201 {
202 defineParameter( Parameter(name, value) );
203}

◆ defineParameter() [3/3]

void ConfigurableAlg::defineParameter ( const std::string & name,
TCS::parType_t value,
unsigned int selection )
protectedinherited

Definition at line 207 of file ConfigurableAlg.cxx.

207 {
208 defineParameter( Parameter(name, value, selection) );
209}
const std::string selection

◆ doReset()

TCS::StatusCode TCS::SortingAlg::doReset ( )
protectedvirtualinherited

Implements TCS::ConfigurableAlg.

Definition at line 12 of file SortingAlg.cxx.

12 {
13 m_overflow = false;
15}
bool m_overflow
whether an overflow occurred during the current execution.
Definition SortingAlg.h:42

◆ fillHist1D()

void ConfigurableAlg::fillHist1D ( const std::string & histName,
double x )
protectedinherited

Definition at line 467 of file ConfigurableAlg.cxx.

467 {
468 m_impl->fillHist1D(histName,x);
469}
#define x

◆ fillHist2D()

void ConfigurableAlg::fillHist2D ( const std::string & histName,
double x,
double y )
protectedinherited

Definition at line 471 of file ConfigurableAlg.cxx.

471 {
472 m_impl->fillHist2D(histName,x,y);
473}
#define y

◆ fullname()

std::string TCS::ConfigurableAlg::fullname ( ) const
inlineinherited

Definition at line 50 of file ConfigurableAlg.h.

50{ return m_className + "/" + m_name; }

◆ getName()

const std::string & TrigConf::TrigConfMessaging::getName ( ) const
inlineinherited

name accessor

Returns
the name

Definition at line 101 of file TrigConfMessaging.h.

101 {
102 return m_name;
103 }

◆ initialize()

TCS::StatusCode TCS::eTauSort::initialize ( )
overridevirtual

Reimplemented from TCS::ConfigurableAlg.

Definition at line 39 of file eTauSort.cxx.

39 {
40 m_numberOfeTaus = parameter("OutputWidth").value();
41 m_minRCore = parameter("RCoreMin").value();
42 m_minRHad = parameter("RHadMin").value();
44}
parType_t value() const
Definition Parameter.h:35
parType_t m_minRCore
Definition eTauSort.h:32
parType_t m_minRHad
Definition eTauSort.h:33
parType_t m_numberOfeTaus
Definition eTauSort.h:31

◆ isCountingAlg()

bool TCS::ConfigurableAlg::isCountingAlg ( ) const
inlineinherited

Definition at line 64 of file ConfigurableAlg.h.

64{ return m_algType == COUNT; }

◆ isDecisionAlg()

bool TCS::ConfigurableAlg::isDecisionAlg ( ) const
inlineinherited

Definition at line 62 of file ConfigurableAlg.h.

62{ return m_algType == DECISION; }

◆ isLegacyTopo()

bool TCS::ConfigurableAlg::isLegacyTopo ( ) const
inlineinherited

Definition at line 66 of file ConfigurableAlg.h.

66{ return m_isLegacyTopo; }

◆ isocut() [1/2]

bool ConfigurableAlg::isocut ( const std::string & threshold,
const unsigned int bit ) const
protectedinherited

Definition at line 484 of file ConfigurableAlg.cxx.

484 {
485 unsigned int value = 0;
486 if (threshold == "None") {value = 0;}
487 else if (threshold == "Loose") {value = 1;}
488 else if (threshold == "Medium") {value = 2;}
489 else if (threshold == "HadMedium") {value = 2;}
490 else if (threshold == "Tight") {value = 3;}
491 else {
492 TRG_MSG_WARNING("No isolation defined as " << threshold);
493 }
494
495 if (bit >= value) {return true;}
496 else {return false;}
497}

◆ isocut() [2/2]

bool ConfigurableAlg::isocut ( const unsigned int threshold,
const unsigned int bit ) const
protectedinherited

Definition at line 500 of file ConfigurableAlg.cxx.

500 {
501 if (bit >= threshold) {return true;}
502 else {return false;}
503}

◆ isSortingAlg()

bool TCS::ConfigurableAlg::isSortingAlg ( ) const
inlineinherited

Definition at line 60 of file ConfigurableAlg.h.

60{ return m_algType == SORT; }

◆ msg() [1/2]

MsgStreamTC & TrigConf::TrigConfMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 86 of file TrigConfMessaging.h.

87 {
88 MsgStreamTC* ms = m_msg_tls.get();
89 if (!ms) {
90 ms = new MsgStreamTC(m_name);
91 m_msg_tls.reset(ms);
92 }
93 return *ms;
94 }
boost::thread_specific_ptr< MsgStreamTC > m_msg_tls
MsgStreamTC instance (a std::cout like with print-out levels)

◆ msg() [2/2]

MsgStreamTC & TrigConf::TrigConfMessaging::msg ( const MSGTC::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 96 of file TrigConfMessaging.h.

97 {
98 return msg() << lvl;
99 }
MsgStreamTC & msg() const
The standard message stream.

◆ msgLvl()

bool TrigConf::TrigConfMessaging::msgLvl ( const MSGTC::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 75 of file TrigConfMessaging.h.

76 {
77 if (msg().level() <= lvl) {
78 msg() << lvl;
79 return true;
80 }
81 else {
82 return false;
83 }
84 }

◆ name()

const std::string & TCS::ConfigurableAlg::name ( ) const
inlineinherited

Definition at line 48 of file ConfigurableAlg.h.

48{ return m_name; }

◆ overflow()

bool TCS::SortingAlg::overflow ( ) const
inlineinherited

whether an overlflow occurred

In practice propagate the overflow bits from the input collections

Definition at line 35 of file SortingAlg.h.

35{ return m_overflow; }

◆ parameter() [1/2]

const TCS::Parameter & ConfigurableAlg::parameter ( const std::string & parameterName) const
inherited

Definition at line 243 of file ConfigurableAlg.cxx.

243 {
244 return parameters().parameter(parameterName);
245}
const Parameter & parameter(const std::string &parameterName) const

◆ parameter() [2/2]

const TCS::Parameter & ConfigurableAlg::parameter ( const std::string & parameterName,
unsigned int selection ) const
inherited

Definition at line 249 of file ConfigurableAlg.cxx.

249 {
250 return parameters().parameter(parameterName, selection);
251}

◆ parameters()

const ParameterSpace & TCS::ConfigurableAlg::parameters ( ) const
inlineinherited

Definition at line 87 of file ConfigurableAlg.h.

87{ return m_parameters; }

◆ quadraticSumBW()

unsigned long ConfigurableAlg::quadraticSumBW ( int i1,
int i2 )
inherited

Definition at line 160 of file ConfigurableAlg.cxx.

160 {
161 return TSU::Kinematics::quadraticSumBW(i1, i2);
162}
static unsigned long quadraticSumBW(int i1, int i2)
compute the sum in quadrature of two ints

◆ registerHist() [1/2]

void ConfigurableAlg::registerHist ( TH1 * h)
protectedinherited

Definition at line 262 of file ConfigurableAlg.cxx.

262 {
263 m_impl->registerHist(h);
264}

◆ registerHist() [2/2]

void ConfigurableAlg::registerHist ( TH2 * h)
protectedinherited

Definition at line 266 of file ConfigurableAlg.cxx.

266 {
267 m_impl->registerHist(h);
268}

◆ reset()

StatusCode TCS::ConfigurableAlg::reset ( )
inlineinherited

Definition at line 58 of file ConfigurableAlg.h.

58{ return doReset(); }
virtual StatusCode doReset()=0

◆ setAlgoId()

void TCS::ConfigurableAlg::setAlgoId ( unsigned int algoId)
inlineinherited

Definition at line 93 of file ConfigurableAlg.h.

93{ m_algoId = algoId; }
unsigned int algoId() const

◆ setClassName()

void TCS::ConfigurableAlg::setClassName ( const std::string & className)
inlineinherited

Definition at line 43 of file ConfigurableAlg.h.

const std::string & className() const

◆ setL1TopoHistSvc()

void ConfigurableAlg::setL1TopoHistSvc ( std::shared_ptr< IL1TopoHistSvc > histSvc)
inherited

sets the external hist service

forwarding public interface

Definition at line 258 of file ConfigurableAlg.cxx.

258 {
259 m_impl->setL1TopoHistSvc(std::move(histSvc));
260}

◆ setLegacyMode()

void TCS::ConfigurableAlg::setLegacyMode ( bool isLegacyTopo)
inlineinherited

Definition at line 45 of file ConfigurableAlg.h.

◆ setOverflow()

SortingAlg & TCS::SortingAlg::setOverflow ( const bool v)
inlineinherited

setter, to propagate bit from input event

Definition at line 37 of file SortingAlg.h.

37{ m_overflow = v; return *this; }

◆ setParameters()

void ConfigurableAlg::setParameters ( const ParameterSpace & parameters)
inherited

Definition at line 222 of file ConfigurableAlg.cxx.

222 {
223
224 // check if parameterspace is for this algorithm
225 if(name() != parameters.algName()) {
226 TCS_EXCEPTION("Name of parameter set (" << parameters.algName() << ") do not match configurable name (" << name() << ")" );
227 }
228
229 // copy parameters
230 for(const Parameter & p : parameters) {
231 try {
232 m_parameters.setParameter(p);
233 }
234 catch(const TCS::Exception& e) {
235 TCS_EXCEPTION("Algorithm configuration failed for " << name() << "! Caught exception: " << e.what());
236 }
237 }
238}

◆ sort()

TCS::StatusCode TCS::eTauSort::sort ( const InputTOBArray & input,
TOBArray & output )
finaloverridevirtual

Implements TCS::SortingAlg.

Definition at line 48 of file eTauSort.cxx.

48 {
49
50 const eTauTOBArray & clusters = dynamic_cast<const eTauTOBArray&>(input);
51
52 // fill output array with GenericTOB buildt from clusters
53 for(eTauTOBArray::const_iterator etau = clusters.begin(); etau!= clusters.end(); ++etau ) {
54
55 // Isolation cut
56 if ( !isocut(m_minRCore, (*etau)-> rCore()) ) {continue;}
57 if ( !isocut(m_minRHad, (*etau)-> rHad()) ) {continue;}
58
59 const GenericTOB gtob(**etau);
60 output.push_back( gtob );
61 }
62
63 // sort
65
66
67 // keep only max number of clusters
68 int par = m_numberOfeTaus;
69 unsigned int maxNumberOfeTaus = std::clamp(par, 0, std::abs(par));
70 if(maxNumberOfeTaus>0) {
71 while( output.size()> maxNumberOfeTaus ) {
72 if (output.size() == (maxNumberOfeTaus+1)) {
73 bool isAmbiguous = output[maxNumberOfeTaus-1].EtDouble() == output[maxNumberOfeTaus].EtDouble();
74 if (isAmbiguous) { output.setAmbiguityFlag(true); }
75 }
76 output.pop_back();
77 }
78 }
80}
bool isocut(const std::string &threshold, const unsigned int bit) const
data_t::const_iterator const_iterator
bool SortByEtLargesteTau(TCS::GenericTOB *tob1, TCS::GenericTOB *tob2)
Definition eTauSort.cxx:16
output
Definition merge.py:16

◆ sortBitCorrect()

TCS::StatusCode TCS::SortingAlg::sortBitCorrect ( const InputTOBArray & input,
TOBArray & output )
virtualinherited

Reimplemented in TCS::jXESort, and TCS::MetSort.

Definition at line 17 of file SortingAlg.cxx.

18{
19 return sort(input, output);
20}
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)=0

◆ ToString()

std::string ConfigurableAlg::ToString ( const int val)
privateinherited

Definition at line 475 of file ConfigurableAlg.cxx.

476{
477 const int val_int = static_cast<int>(val);
478 std::ostringstream temp;
479 temp << val_int;
480 return temp.str();
481}

Member Data Documentation

◆ m_algoId

unsigned int TCS::ConfigurableAlg::m_algoId {0}
privateinherited

Definition at line 138 of file ConfigurableAlg.h.

138{0};

◆ m_algType

AlgType TCS::ConfigurableAlg::m_algType
privateinherited

Definition at line 142 of file ConfigurableAlg.h.

◆ m_className

std::string TCS::ConfigurableAlg::m_className {""}
privateinherited

Definition at line 135 of file ConfigurableAlg.h.

135{""};

◆ m_impl

std::unique_ptr<ConfigurableAlgImpl> TCS::ConfigurableAlg::m_impl
privateinherited

Definition at line 129 of file ConfigurableAlg.h.

◆ m_isLegacyTopo

bool TCS::ConfigurableAlg::m_isLegacyTopo
privateinherited

Definition at line 144 of file ConfigurableAlg.h.

◆ m_minRCore

parType_t TCS::eTauSort::m_minRCore = { 0 }
private

Definition at line 32 of file eTauSort.h.

32{ 0 };

◆ m_minRHad

parType_t TCS::eTauSort::m_minRHad = { 0 }
private

Definition at line 33 of file eTauSort.h.

33{ 0 };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStreamTC> TrigConf::TrigConfMessaging::m_msg_tls
mutableprivateinherited

MsgStreamTC instance (a std::cout like with print-out levels)

Definition at line 71 of file TrigConfMessaging.h.

◆ m_name

std::string TCS::ConfigurableAlg::m_name {""}
privateinherited

Definition at line 134 of file ConfigurableAlg.h.

134{""};

◆ m_numberOfeTaus

parType_t TCS::eTauSort::m_numberOfeTaus = { 0 }
private

Definition at line 31 of file eTauSort.h.

31{ 0 };

◆ m_overflow

bool TCS::SortingAlg::m_overflow
protectedinherited

whether an overflow occurred during the current execution.

Definition at line 42 of file SortingAlg.h.

◆ m_parameters

ParameterSpace TCS::ConfigurableAlg::m_parameters {""}
privateinherited

Definition at line 140 of file ConfigurableAlg.h.

140{""};

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