ATLAS Offline Software
Loading...
Searching...
No Matches
jEmMultiplicity.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 * jEmMultiplicity.cpp
6 * Created by Carlos Moreno on 17/09/21.
7 *
8 * @brief algorithm that computes the multiplicity for a specified list and ET threshold
9 * line 1: 0 or 1, line 1 and 2 : 2 or more, uses 2 bits
10 *
11 * @param NumberLeading MinET
12
13**********************************/
14
15#include <cmath>
16
20
23
24REGISTER_ALG_TCS(jEmMultiplicity)
25
26using namespace std;
27
28
30{
31
32
33 setNumberOutputBits(12); //To-Do: Make this flexible to addapt to the menu. Each counting requires more than one bit
34
35}
36
38
39
42
44
45 // book histograms
46 std::string hname_accept = "jEmMultiplicity_accept_EtaPt"+m_threshold->name();
47 bookHistMult(m_histAccept, hname_accept, "Mult_"+m_threshold->name(), "#eta#times40", "E_{t} [GeV]", 200, -200, 200, 600, 0, 600);
48
49 hname_accept = "jEmMultiplicity_accept_counts_"+m_threshold->name();
50 bookHistMult(m_histAccept, hname_accept, "Mult_"+m_threshold->name(), "counts", 15, 0, 15);
51
53
54}
55
56
59 Count & count)
60
61{
62 return process(input, count);
63}
64
67 Count & count )
68{
69
70 // Grab the threshold and cast it into the right type
71 const auto& jEMThr = dynamic_cast<const TrigConf::L1Threshold_jEM &>(*m_threshold);
72
73 // Grab inputs
74 const jEmTOBArray & jems = dynamic_cast<const jEmTOBArray&>(input);
75
76 int counting = 0;
77
78 // loop over input TOBs
79 for(jEmTOBArray::const_iterator jem = jems.begin();
80 jem != jems.end();
81 ++jem ) {
82
83 // 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.
84 bool passed = (*jem)->Et() > jEMThr.thrValue100MeV((*jem)->eta()/4);
85
86 if ( !isocut(TrigConf::Selection::wpToString(jEMThr.iso()), (*jem)->isolation()) ) {continue;}
87 if ( !isocut(TrigConf::Selection::wpToString(jEMThr.frac()), (*jem)->frac1()) ) {continue;}
88 if ( !isocut(TrigConf::Selection::wpToString(jEMThr.frac2()), (*jem)->frac2()) ) {continue;}
89
90 if (passed) {
91 counting++;
92 fillHist2D( m_histAccept[0], (*jem)->eta(), (*jem)->EtDouble() );
93 }
94
95 }
96
97 fillHist1D( m_histAccept[1], counting);
98
99 // Pass counting to TCS::Count object - output bits are composed there
100 count.setSizeCount(counting);
101
103
104}
#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
bool isocut(const std::string &threshold, const unsigned int bit) 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
virtual StatusCode process(const TCS::InputTOBArray &input, Count &count) override final
virtual StatusCode initialize() override
TrigConf::L1Threshold const * m_threshold
virtual StatusCode processBitCorrect(const TCS::InputTOBArray &input, Count &count) override final
jEmMultiplicity(const std::string &name)
static std::string wpToString(WP)
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.