ATLAS Offline Software
MultiplicityCustom.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  * MultiplicityCustom.cpp
6  * Created by Joerg Stelzer on 11/16/12.
7  * Modified by V SOrin 2014
8  *
9  * algo that just apply et cut and then multiplicity of remaining TOBs
10  * @param NumberLeading
11 **********************************/
12 
13 #include <cmath>
14 
16 #include "L1TopoCommon/Exception.h"
18 
19 REGISTER_ALG_TCS(MultiplicityCustom)
20 
21 
23 {
24  defineParameter("InputWidth", 3);
25  defineParameter("NumResultBits", 1);
26  defineParameter("MinET",1);
27  defineParameter("MinEta",0);
28  defineParameter("MaxEta",49);
29  defineParameter("MinMultiplicity",1);
30 
31  setNumberOutputBits(1);
32 }
33 
35 
36 
39  p_NumberLeading1 = parameter("InputWidth").value();
40  p_MinET = parameter("MinET").value();
41  p_Multiplicity = parameter("MinMultiplicity").value();
42 
43  p_EtaMin = parameter("MinEta").value();
44  p_EtaMax = parameter("MaxEta").value();
45 
46  TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1); // note that the reading of generic parameters doesn't work yet
47  TRG_MSG_INFO("MinET : " << p_MinET);
48  TRG_MSG_INFO("Multiplicity : " << p_Multiplicity);
49  TRG_MSG_INFO("MinETa : " << p_EtaMin);
50  TRG_MSG_INFO("MaxETa : " << p_EtaMax);
51 
52  TRG_MSG_INFO("number output : " << numberOutputBits());
53 
54  return StatusCode::SUCCESS;
55 }
56 
57 
59 TCS::MultiplicityCustom::processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
60  const std::vector<TCS::TOBArray *> & output,
61  Decision & decision )
62 
63 {
64  return process(input,output,decision);
65 }
66 
67 
69 TCS::MultiplicityCustom::process( const std::vector<TCS::TOBArray const *> & input,
70  const std::vector<TCS::TOBArray *> & output,
71  Decision & decision )
72 {
73 
74  if(input.size() == 1) {
75 
76  // loop over jets
77  unsigned int nLeading = p_NumberLeading1;
78 
79  // counter
80  unsigned int nmult = 0;
81  // vector of tobs passing cuts
82  std::vector<TCS::GenericTOB*> TOBvector;
83 
84  for( TOBArray::const_iterator tob1 = input[0]->begin();
85  tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading;
86  ++tob1)
87  {
88  if (parType_t(std::abs((*tob1)-> eta())) < p_EtaMin) continue;
89  if (parType_t(std::abs((*tob1)-> eta())) > p_EtaMax) continue;
90 
91  if( parType_t((*tob1)->Et()) <= p_MinET ) continue; // E_T cut
92  //
93  TRG_MSG_DEBUG("Jet : ET = " << parType_t((*tob1)->Et()));
94  ++nmult;
95  // keep a list of all TOB that contributed
96  TOBvector.push_back( *tob1 );
97 
98  }
99  //
100 
101  bool accept = nmult >= p_Multiplicity;
102 
103  decision.setBit( 0, accept );
104 
105  if(accept) output[0]->push_back(TCS::CompositeTOB(TOBvector));
106  TRG_MSG_DEBUG("Decision : " << (accept?"pass":"fail") << " Mult = " << nmult);
107 
108 
109  } else {
110 
111  TCS_EXCEPTION("MultiplicityCustom alg must have 1 input, but got " << input.size());
112 
113  }
115 }
TCS::MultiplicityCustom::process
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition: MultiplicityCustom.cxx:69
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
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
MultiplicityCustom.h
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
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::MultiplicityCustom::initialize
virtual StatusCode initialize()
Definition: MultiplicityCustom.cxx:38
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::MultiplicityCustom
Definition: MultiplicityCustom.h:16
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TCS::MultiplicityCustom::processBitCorrect
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition: MultiplicityCustom.cxx:59
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::MultiplicityCustom::~MultiplicityCustom
virtual ~MultiplicityCustom()
Definition: MultiplicityCustom.cxx:34
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
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