ATLAS Offline Software
gLJetMultiplicity.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 /*********************************
5  * gLJetMultiplicity
6  *
7  * @brief algorithm that computes the multiplicity for a specified list and ET threshold
8  * line 1: 0 or 1, line 1 and 2 : 2 or more, uses 2 bits
9  *
10  * @param NumberLeading largeR jets, MinET
11 **********************************/
12 
13 #include <cmath>
14 
16 #include "L1TopoCommon/Exception.h"
17 #include "L1TopoInterfaces/Count.h"
18 
19 #include "L1TopoEvent/TOBArray.h"
21 
22 REGISTER_ALG_TCS(gLJetMultiplicity)
23 
24 using namespace std;
25 
26 
28 {
29 
30 
31  setNumberOutputBits(12); //To-Do: Make this flexible to addapt to the menu. Each counting requires more than one bit
32 
33 }
34 
36 
37 
40 
41  m_threshold = getThreshold();
42 
43  // book histograms
44  std::string hname_accept = "gLJetMultiplicity_accept_EtaPt_"+m_threshold->name();
45  bookHistMult(m_histAccept, hname_accept, "Mult_"+m_threshold->name(), "#eta#times40", "E_{t} [GeV]", 200, -200, 200, 600, 0, 600);
46 
47  hname_accept = "gLJetMultiplicity_accept_counts_"+m_threshold->name();
48  bookHistMult(m_histAccept, hname_accept, "Mult_"+m_threshold->name(), "counts", 15, 0, 15);
49 
50  return StatusCode::SUCCESS;
51 
52 }
53 
54 
57  Count & count)
58 
59 {
60  return process(input, count);
61 }
62 
65  Count & count )
66 {
67 
68  // Grab the threshold and cast it into the right type
69  const auto& gLJThr = dynamic_cast<const TrigConf::L1Threshold_gLJ &>(*m_threshold);
70 
71  // Grab inputs
72  const gLJetTOBArray & gjets = dynamic_cast<const gLJetTOBArray&>(input);
73 
74  int counting = 0;
75 
76  // loop over input TOBs
77  for(gLJetTOBArray::const_iterator gjet = gjets.begin();
78  gjet != gjets.end();
79  ++gjet ) {
80 
81  // Dividing by 4 standing for converting eta from 0.025 to 0.1 granularity as it is defined in the menu as 0.1 gran.
82  bool passed = (*gjet)->Et() > gLJThr.thrValue100MeV((*gjet)->eta()/4);
83 
84  if (passed) {
85  counting++;
86  fillHist2D( m_histAccept[0], (*gjet)->eta(), (*gjet)->EtDouble() );
87  }
88 
89  }
90 
91  fillHist1D( m_histAccept[1], counting);
92 
93  // Pass counting to TCS::Count object - output bits are composed there
94  count.setSizeCount(counting);
95 
97 
98 }
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
TCS::DataArrayImpl< gLJetTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
SUSY_SimplifiedModel_PostInclude.process
string process
Definition: SUSY_SimplifiedModel_PostInclude.py:42
TCS::DataArrayImpl::end
iterator end()
Definition: DataArrayImpl.h:43
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
TCS::CountingAlg::setNumberOutputBits
void setNumberOutputBits(unsigned int numberOutputBits)
Definition: CountingAlg.h:41
gLJetTOBArray.h
TCS::gLJetMultiplicity::process
virtual StatusCode process(const TCS::InputTOBArray &input, Count &count) override final
Definition: gLJetMultiplicity.cxx:64
Count.h
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TCS::gLJetMultiplicity::~gLJetMultiplicity
virtual ~gLJetMultiplicity()
Definition: gLJetMultiplicity.cxx:35
TOBArray.h
TCS::gLJetMultiplicity::processBitCorrect
virtual StatusCode processBitCorrect(const TCS::InputTOBArray &input, Count &count) override final
Definition: gLJetMultiplicity.cxx:56
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
TCS::gLJetMultiplicity::gLJetMultiplicity
gLJetMultiplicity(const std::string &name)
Definition: gLJetMultiplicity.cxx:27
TCS::gLJetMultiplicity::initialize
virtual StatusCode initialize() override
Definition: gLJetMultiplicity.cxx:39
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TCS::DataArrayImpl::begin
iterator begin()
Definition: DataArrayImpl.h:40
TCS::Count
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:20
getThreshold
CP::CorrectionCode getThreshold(Int_t &threshold, const std::string &trigger)
Definition: MuonTriggerSFRootCoreTest.cxx:48
TCS::gLJetTOBArray
Definition: gLJetTOBArray.h:19
gLJetMultiplicity.h
Exception.h
TCS::CountingAlg
Definition: CountingAlg.h:25
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TrigConf::L1Threshold_gLJ
Definition: L1Threshold.h:320