ATLAS Offline Software
Loading...
Searching...
No Matches
jLJetMultiplicity.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 * jLJetMultiplicity
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
18
22
23REGISTER_ALG_TCS(jLJetMultiplicity)
24
25using namespace std;
26
27
29{
30
31
32 setNumberOutputBits(12); //To-Do: Make this flexible to addapt to the menu. Each counting requires more than one bit
33
34}
35
37
38
41
43
44 // book histograms
45 std::string hname_accept = "jLJetMultiplicity_accept_EtaPt_"+m_threshold->name();
46 bookHistMult(m_histAccept, hname_accept, "Mult_"+m_threshold->name(), "#eta#times40", "E_{t} [GeV]", 200, -200, 200, 600, 0, 600);
47
48 hname_accept = "jLJetMultiplicity_accept_counts_"+m_threshold->name();
49 bookHistMult(m_histAccept, hname_accept, "Mult_"+m_threshold->name(), "counts", 15, 0, 15);
50
52
53}
54
55
58 Count & count)
59
60{
61 return process(input, count);
62}
63
66 Count & count )
67{
68
69 // Grab the threshold and cast it into the right type
70 const auto& jLJThr = dynamic_cast<const TrigConf::L1Threshold_jLJ &>(*m_threshold);
71
72 // Grab inputs
73 const jLJetTOBArray & jLjets = dynamic_cast<const jLJetTOBArray&>(input);
74
75 int counting = 0;
76
77 // loop over input TOBs
78 for(jLJetTOBArray::const_iterator jLjet = jLjets.begin();
79 jLjet != jLjets.end();
80 ++jLjet ) {
81
82 const GenericTOB gtob(**jLjet);
83
84 // 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.
85 bool passed = gtob.Et() > jLJThr.thrValue100MeV(gtob.eta()/4);
86
87 if (passed) {
88 counting++;
89 fillHist2D( m_histAccept[0], gtob.eta(), gtob.EtDouble() );
90 }
91
92 }
93
94 fillHist1D( m_histAccept[1], counting);
95
96 // Pass counting to TCS::Count object - output bits are composed there
97 count.setSizeCount(counting);
98
100
101}
#define REGISTER_ALG_TCS(CLASS)
Definition AlgFactory.h:62
bool passed(DecisionID id, const DecisionIDContainer &)
checks if required decision ID is in the set of IDs in the container
CP::CorrectionCode getThreshold(Int_t &threshold, const std::string &trigger)
const std::string & name() const
void fillHist1D(const std::string &histName, double x)
void bookHistMult(std::vector< std::string > &regName, const std::string &name, const std::string &title, const std::string &xtitle, const int binx, const int xmin, const int xmax)
void fillHist2D(const std::string &histName, double x, double y)
std::vector< std::string > m_histAccept
Definition CountingAlg.h:51
CountingAlg(const std::string &name)
Definition CountingAlg.h:28
void setNumberOutputBits(unsigned int numberOutputBits)
Definition CountingAlg.h:41
data_t::const_iterator const_iterator
unsigned int Et() const
Definition GenericTOB.h:113
int eta() const
Definition GenericTOB.h:124
double EtDouble() const
Definition GenericTOB.h:134
TrigConf::L1Threshold const * m_threshold
jLJetMultiplicity(const std::string &name)
virtual StatusCode processBitCorrect(const TCS::InputTOBArray &input, Count &count) override final
virtual StatusCode process(const TCS::InputTOBArray &input, Count &count) override final
virtual StatusCode initialize() override
const std::string process
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
STL namespace.