ATLAS Offline Software
Loading...
Searching...
No Matches
EtCut.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4/*********************************
5 * LAr.cpp
6 * Created by Joerg Stelzer on 11/16/12.
7 * Modified by V SOrin 2014
8 *
9 * @brief algorithm calculates the phi-distance between one lists and applies delta-phi criteria
10 *
11 * @param NumberLeading
12**********************************/
13
14#include <cmath>
15
19
21
22
24{
25 defineParameter("InputWidth", 3);
26 defineParameter("MaxTob", 0);
27 defineParameter("NumResultBits", 1);
28 defineParameter("MinET",1);
30}
31
33
34
37 p_NumberLeading1 = parameter("InputWidth").value();
38 if(parameter("MaxTob").value() > 0) p_NumberLeading1 = parameter("MaxTob").value();
39 p_MinET = parameter("MinET").value();
40
41 TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1); // note that the reading of generic parameters doesn't work yet
42 TRG_MSG_INFO("MinET : " << p_MinET);
43 TRG_MSG_INFO("nummber output : " << numberOutputBits());
44
46}
47
49TCS::EtCut::processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
50 const std::vector<TCS::TOBArray *> & output,
51 Decision & decision )
52
53{
54 //Bitwise implementation should be fully identical
55 //to the non-bitwise one due to its nature as a simple ET cut
56 return process(input,output,decision);
57}
58
59
61TCS::EtCut::process( const std::vector<TCS::TOBArray const *> & input,
62 const std::vector<TCS::TOBArray *> & output,
63 Decision & decision )
64{
65
66 if(input.size() == 1) {
67
68 TRG_MSG_DEBUG("input size : " << input[0]->size());
69
70 unsigned int nLeading = p_NumberLeading1;
71 bool accept{false};
72
73 for( TOBArray::const_iterator tob1 = input[0]->begin();
74 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading;
75 ++tob1)
76 {
77
78 if( parType_t((*tob1)->Et()) <= p_MinET ) continue; // ET cut
79
80 accept = true;
81
82 output[0]->push_back(TCS::CompositeTOB(*tob1));
83
84 TRG_MSG_DEBUG("TOB " << distance(input[0]->begin(), tob1) << " ET = " << (*tob1)->Et() );
85 }
86
87 decision.setBit( 0, accept );
88
89
90
91 } else {
92
93 TCS_EXCEPTION("EtCut alg must have 1 input, but got " << input.size());
94
95 }
97}
#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
void setNumberOutputBits(unsigned int numberOutputBits)
Definition DecisionAlg.h:40
DecisionAlg(const std::string &name)
Definition DecisionAlg.h:25
unsigned int numberOutputBits() const
Definition DecisionAlg.h:39
void setBit(unsigned int index, bool value)
Definition Decision.cxx:12
virtual StatusCode initialize()
Definition EtCut.cxx:36
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition EtCut.cxx:49
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition EtCut.cxx:61
EtCut(const std::string &name)
Definition EtCut.cxx:23
parType_t p_MinET
Definition EtCut.h:35
virtual ~EtCut()
Definition EtCut.cxx:32
parType_t p_NumberLeading1
Definition EtCut.h:34
const std::string process
uint32_t parType_t
Definition Parameter.h:22
STL namespace.