ATLAS Offline Software
Loading...
Searching...
No Matches
TauMatching.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 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>
13
14REGISTER_ALG_TCS(TauMatching)
15
16// constructor
18 defineParameter( "InputWidth", 120 ); // for fw
19 defineParameter( "InputWidth1stStage", 30 ); // for fw
20 defineParameter( "OutputWidth", 6 );
21 defineParameter( "MinET", 0 );
22 defineParameter( "RCore", 0);
23 defineParameter( "RHad", 0);
24 defineParameter( "MinEta", 0 );
25 defineParameter( "MaxEta", 63);
26}
27
28
29// destructor
31
34 m_numberOfcTaus = parameter("OutputWidth").value();
35 m_et = parameter("MinET").value();
36 m_rCore = parameter("RCore").value();
37 m_rHad = parameter("RHad").value();
38 m_minEta = parameter("MinEta").value();
39 m_maxEta = parameter("MaxEta").value();
41}
42
45
46 const cTauTOBArray & ctaus = dynamic_cast<const cTauTOBArray&>(input);
47
48 // fill output array with GenericTOB buildt from ctaus
49 for(cTauTOBArray::const_iterator ctau = ctaus.begin(); ctau!= ctaus.end(); ++ctau ) {
50 const GenericTOB gtob(**ctau);
51
52 if ((*ctau)->tobType() == TCS::ETAU)
53 {std::cout << "I am eTau" << std::endl;}//Do something with eTau
54 if ((*ctau)->tobType() == TCS::JTAU)
55 {std::cout << "I am jTau" << std::endl;}//Do something with jTau
56
57 //Currently do nothing!
58 continue;
59
60 output.push_back( gtob );
61 }
62
63
64 // keep only max number of ctaus
65 int par = m_numberOfcTaus ;
66 unsigned int maxNumberOfcTaus = std::clamp(par, 0, std::abs(par));
67 if(maxNumberOfcTaus>0) {
68 while( output.size()> maxNumberOfcTaus ) {
69 output.pop_back();
70 }
71 }
73}
74
#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.