ATLAS Offline Software
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 
16 #include "L1TopoAlgorithms/EtCut.h"
17 #include "L1TopoCommon/Exception.h"
19 
20 REGISTER_ALG_TCS(EtCut)
21 
22 
23 TCS::EtCut::EtCut(const std::string & name) : DecisionAlg(name)
24 {
25  defineParameter("InputWidth", 3);
26  defineParameter("MaxTob", 0);
27  defineParameter("NumResultBits", 1);
28  defineParameter("MinET",1);
29  setNumberOutputBits(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 
45  return StatusCode::SUCCESS;
46 }
47 
49 TCS::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 
61 TCS::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 }
TCS::EtCut::processBitCorrect
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition: EtCut.cxx:49
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::parType_t
uint32_t parType_t
Definition: Parameter.h:22
TCS::DataArrayImpl< GenericTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
EtCut.h
TCS::EtCut::~EtCut
virtual ~EtCut()
Definition: EtCut.cxx:32
TCS::EtCut
Definition: EtCut.h:16
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
athena.value
value
Definition: athena.py:124
Decision.h
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
SUSY_SimplifiedModel_PostInclude.process
string process
Definition: SUSY_SimplifiedModel_PostInclude.py:42
TCS::DecisionAlg
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:22
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TCS::Decision::setBit
void setBit(unsigned int index, bool value)
Definition: L1Topo/L1TopoInterfaces/Root/Decision.cxx:12
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::EtCut::process
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition: EtCut.cxx:61
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
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
Exception.h
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
TCS::EtCut::initialize
virtual StatusCode initialize()
Definition: EtCut.cxx:36
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