ATLAS Offline Software
JetMatch.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  * JetMatch.cpp
6  * Created by V.Sorin, Joerg Stelzer on 11/16/12.
7  *
8  * @brief algorithm calculates mult of jets passing cuts on 8x8 and 4x4 sizes, cut on mult of jets
9  *
10  * @param NumberLeading
11 **********************************/
12 
13 #include <cmath>
14 
16 #include "L1TopoCommon/Exception.h"
18 
19 
20 REGISTER_ALG_TCS(JetMatch)
21 
22 
23 // not the best solution but we will move to athena where this comes for free
24 #define LOG std::cout << name() << ": "
25 
26 
28 {
29  defineParameter("InputWidth", 3);
30  defineParameter("MaxTob", 0);
31  defineParameter("NumResultBits", 1);
32  defineParameter("MinET1",0);
33  defineParameter("MinET2",0);
34  defineParameter("EtaMin",0);
35  defineParameter("EtaMax",49);
37 }
38 
40 {}
41 
42 
45  p_NumberLeading1 = parameter("InputWidth").value();
46  if(parameter("MaxTob").value() > 0) p_NumberLeading1 = parameter("MaxTob").value();
47  p_MinET1 = parameter("MinET1").value();
48  p_MinET2 = parameter("MinET2").value();
49  p_EtaMin = parameter("EtaMin").value();
50  p_EtaMax = parameter("EtaMax").value();
51 
52  TRG_MSG_INFO("MaxTob : " << p_NumberLeading1);
53  TRG_MSG_INFO("MinET1 : " << p_MinET1);
54  TRG_MSG_INFO("MinET2 : " << p_MinET2);
55  TRG_MSG_INFO("EtaMin : " << p_EtaMin);
56  TRG_MSG_INFO("EtaMax : " << p_EtaMax);
57  TRG_MSG_INFO("number output : " << numberOutputBits());
58  return StatusCode::SUCCESS;
59 }
60 
62 TCS::JetMatch::processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
63  const std::vector<TCS::TOBArray *> & output,
64  Decision & decision )
65 
66 {
67  return process(input,output,decision);
68 }
69 
70 
72 TCS::JetMatch::process( const std::vector<TCS::TOBArray const *> & input,
73  const std::vector<TCS::TOBArray *> & output,
74  Decision & decision )
75 {
76 
77  if(input.size()!=1) {
78  TCS_EXCEPTION("JetMatch alg must have exactly 1 input list, but got " << input.size());
79  }
80 
81  // vector of passing tob
82  std::vector<TCS::GenericTOB*> TOBvector;
83 
84  // loop over all jets
85  unsigned int objC(0);
86  for( TCS::GenericTOB * tob : *input[0]) {
87  ++objC;
88 
89  if( parType_t(std::abs(tob->eta())) > p_EtaMax ) continue; // Eta cut
90  if( parType_t(std::abs(tob->eta())) < p_EtaMin ) continue; // Eta cut
91  if( tob->EtWide() <= p_MinET1 ) continue; // E_T cut
92 
93  if( tob->EtNarrow() <= p_MinET2 ) continue; // E_T cut
94 
95  TRG_MSG_DEBUG("Jet " << objC-1 << ": ETWide = " << tob->EtWide() << ", ETNarrow = " << tob->EtNarrow());
96 
97  // keep a list of all TOB that contributed
98  TOBvector.push_back( tob );
99 
100  }
101 
102  for(unsigned int i=0; i<numberOutputBits(); ++i) {
103 
104  bool accept = TOBvector.size() >= p_NumberLeading1 ;
105 
106  decision.setBit( i, accept );
107 
108  if(accept)
109  output[i]->push_back( TCS::CompositeTOB(TOBvector));
110 
111  TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " Njets = " << TOBvector.size());
112 
113  }
114 
116 }
TCS::JetMatch::initialize
virtual StatusCode initialize()
Definition: JetMatch.cxx:44
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::JetMatch::~JetMatch
virtual ~JetMatch()
Definition: JetMatch.cxx:39
TCS::parType_t
uint32_t parType_t
Definition: Parameter.h:22
TCS::JetMatch::processBitCorrect
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition: JetMatch.cxx:62
TCS::JetMatch::process
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition: JetMatch.cxx:72
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
athena.value
value
Definition: athena.py:124
Decision.h
SUSY_SimplifiedModel_PostInclude.process
string process
Definition: SUSY_SimplifiedModel_PostInclude.py:42
TCS::JetMatch::JetMatch
JetMatch(const std::string &name)
Definition: JetMatch.cxx:27
TCS::DecisionAlg
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:22
TCS::Decision::setBit
void setBit(unsigned int index, bool value)
Definition: L1Topo/L1TopoInterfaces/Root/Decision.cxx:12
lumiFormat.i
int i
Definition: lumiFormat.py:85
TCS::ConfigurableAlg::defineParameter
void defineParameter(const std::string &name, TCS::parType_t value)
Definition: ConfigurableAlg.cxx:201
TCS::CompositeTOB
Definition: CompositeTOB.h:16
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:14
TCS::Decision
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:19
TRG_MSG_INFO
#define TRG_MSG_INFO(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:27
merge.output
output
Definition: merge.py:17
TCS::GenericTOB
Definition: GenericTOB.h:35
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TCS::DecisionAlg::setNumberOutputBits
void setNumberOutputBits(unsigned int numberOutputBits)
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:40
JetMatch.h
Exception.h
TRG_MSG_DEBUG
#define TRG_MSG_DEBUG(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:25
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15