ATLAS Offline Software
Loading...
Searching...
No Matches
LAr.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("PhiMin", 0);
29 defineParameter("PhiMax", 63);
30 defineParameter("EtaMin", 0);
31 defineParameter("EtaMax", 5);
32 defineParameter("MinET",1);
34}
35
37
38
41 p_NumberLeading1 = parameter("InputWidth").value();
42 if(parameter("MaxTob").value() > 0) p_NumberLeading1 = parameter("MaxTob").value();
43 p_PhiMin = parameter("PhiMin").value();
44 p_PhiMax = parameter("PhiMax").value();
45 p_EtaMin = parameter("EtaMin").value();
46 p_EtaMax = parameter("EtaMax").value();
47 p_MinET = parameter("MinET").value();
48
49 TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1); // note that the reading of generic parameters doesn't work yet
50 TRG_MSG_INFO("PhiMin : " << p_PhiMin);
51 TRG_MSG_INFO("PhiMax : " << p_PhiMax);
52 TRG_MSG_INFO("EtaMin : " << p_EtaMin);
53 TRG_MSG_INFO("EtaMax : " << p_EtaMax);
54 TRG_MSG_INFO("MinET : " << p_MinET);
55 TRG_MSG_INFO("nummber output : " << numberOutputBits());
56
58}
59
61TCS::LAr::processBitCorrect( 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 if( parType_t((*tob1)->eta()) <= p_EtaMin ) continue; // ETa cut
80 if( parType_t((*tob1)->eta()) >= p_EtaMax ) continue; // ETa cut
81 if( parType_t(abs((*tob1)->phi())) <= p_PhiMin ) continue; // phi cut
82 if( parType_t(abs((*tob1)->phi())) >= p_PhiMax ) continue; // phi cut
83
84
85
86 accept = true;
87
88 output[0]->push_back(TCS::CompositeTOB(*tob1));
89
90 TRG_MSG_DEBUG("TOB " << distance(input[0]->begin(), tob1) << " ET = " << (*tob1)->Et() << " ETa = " << (*tob1)->eta() << " phi = " << (*tob1)->phi() );
91 }
92
93 decision.setBit( 0, accept );
94
95
96
97 } else {
98
99 TCS_EXCEPTION("LAr alg must have 1 input, but got " << input.size());
100
101 }
103}
104
105
107TCS::LAr::process( const std::vector<TCS::TOBArray const *> & input,
108 const std::vector<TCS::TOBArray *> & output,
109 Decision & decision )
110{
111
112 if(input.size() == 1) {
113
114 TRG_MSG_DEBUG("input size : " << input[0]->size());
115
116 unsigned int nLeading = p_NumberLeading1;
117 bool accept{false};
118
119 for( TOBArray::const_iterator tob1 = input[0]->begin();
120 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading;
121 ++tob1)
122 {
123
124 if( parType_t((*tob1)->Et()) <= p_MinET ) continue; // ET cut
125 if( parType_t((*tob1)->eta()) <= p_EtaMin ) continue; // ETa cut
126 if( parType_t((*tob1)->eta()) >= p_EtaMax ) continue; // ETa cut
127 if( parType_t(abs((*tob1)->phi())) <= p_PhiMin ) continue; // phi cut
128 if( parType_t(abs((*tob1)->phi())) >= p_PhiMax ) continue; // phi cut
129
130
131
132 accept = true;
133
134 output[0]->push_back(TCS::CompositeTOB(*tob1));
135
136 TRG_MSG_DEBUG("TOB " << distance(input[0]->begin(), tob1) << " ET = " << (*tob1)->Et() << " ETa = " << (*tob1)->eta() << " phi = " << (*tob1)->phi() );
137 }
138
139 decision.setBit( 0, accept );
140
141
142
143 } else {
144
145 TCS_EXCEPTION("LAr alg must have 1 input, but got " << input.size());
146
147 }
149}
#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
parType_t p_NumberLeading1
Definition LAr.h:34
virtual ~LAr()
Definition LAr.cxx:36
parType_t p_EtaMax
Definition LAr.h:37
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition LAr.cxx:61
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition LAr.cxx:107
parType_t p_EtaMin
Definition LAr.h:36
parType_t p_PhiMin
Definition LAr.h:39
parType_t p_MinET
Definition LAr.h:35
virtual StatusCode initialize()
Definition LAr.cxx:40
parType_t p_PhiMax
Definition LAr.h:38
uint32_t parType_t
Definition Parameter.h:22
STL namespace.