ATLAS Offline Software
Loading...
Searching...
No Matches
TauMatching.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4// TauMatching.cxx
5// TopoCore
6// Algorithm to select the abbreviated list of cTaus , no order is applied
7//
12#include <algorithm> //std::clamp
13#include <iostream> //std::cout used
14
15REGISTER_ALG_TCS(TauMatching)
16
17// constructor
19 defineParameter( "InputWidth", 120 ); // for fw
20 defineParameter( "InputWidth1stStage", 30 ); // for fw
21 defineParameter( "OutputWidth", 6 );
22 defineParameter( "MinET", 0 );
23 defineParameter( "RCore", 0);
24 defineParameter( "RHad", 0);
25 defineParameter( "MinEta", 0 );
26 defineParameter( "MaxEta", 63);
27}
28
29
30// destructor
32
35 m_numberOfcTaus = parameter("OutputWidth").value();
36 m_et = parameter("MinET").value();
37 m_rCore = parameter("RCore").value();
38 m_rHad = parameter("RHad").value();
39 m_minEta = parameter("MinEta").value();
40 m_maxEta = parameter("MaxEta").value();
42}
43
46
47 const cTauTOBArray & ctaus = dynamic_cast<const cTauTOBArray&>(input);
48
49 // fill output array with GenericTOB buildt from ctaus
50 for(cTauTOBArray::const_iterator ctau = ctaus.begin(); ctau!= ctaus.end(); ++ctau ) {
51 const GenericTOB gtob(**ctau);
52
53 if ((*ctau)->tobType() == TCS::ETAU)
54 {std::cout << "I am eTau" << std::endl;}//Do something with eTau
55 if ((*ctau)->tobType() == TCS::JTAU)
56 {std::cout << "I am jTau" << std::endl;}//Do something with jTau
57
58 //Currently do nothing!
59 continue;
60 }
61
62
63 // keep only max number of ctaus
64 int par = m_numberOfcTaus ;
65 unsigned int maxNumberOfcTaus = std::clamp(par, 0, std::abs(par));
66 if(maxNumberOfcTaus>0) {
67 while( output.size()> maxNumberOfcTaus ) {
68 output.pop_back();
69 }
70 }
72}
73
#define REGISTER_ALG_TCS(CLASS)
Definition AlgFactory.h:62
const Parameter & parameter(const std::string &parameterName) const
const std::string & name() const
void defineParameter(const std::string &name, TCS::parType_t value)
data_t::const_iterator const_iterator
SortingAlg(const std::string &name)
Definition SortingAlg.h:21
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
parType_t m_numberOfcTaus
Definition TauMatching.h:31
parType_t m_maxEta
Definition TauMatching.h:33
parType_t m_minEta
Definition TauMatching.h:32
virtual TCS::StatusCode initialize()
TauMatching(const std::string &name)
parType_t m_rCore
Definition TauMatching.h:35
virtual ~TauMatching()
parType_t m_rHad
Definition TauMatching.h:36
STL namespace.