ATLAS Offline Software
Loading...
Searching...
No Matches
jTauMultiplicity.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 * jTauMultiplicity.cpp
6 * Created by Carlos Moreno on 05/06/20.
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
25
26REGISTER_ALG_TCS(jTauMultiplicity)
27
28using namespace std;
29
30
32{
33 setNumberOutputBits(12); //To-Do: Make this flexible to addapt to the menu. Each counting requires more than one bit
34}
35
37
38
41 m_threshold = dynamic_cast<const TrigConf::L1Threshold_jTAU*>(getThreshold());
42 m_extraInfo = m_threshold->getExtraInfo();
43
44 // book histograms
45 std::string hname_accept = "jTauMultiplicity_accept_EtaPt_"+m_threshold->name();
46 bookHistMult(m_histAccept, hname_accept, "Mult_"+m_threshold->name(), "#eta#times40", "E_{t} [GeV]", 200, -200, 200, 100, 0, 100);
47
48 hname_accept = "jTauMultiplicity_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 // Grab inputs
69 const jTauTOBArray & jtaus = dynamic_cast<const jTauTOBArray&>(input);
70
71 int counting = 0;
72
73 // loop over input TOBs
74 for(jTauTOBArray::const_iterator jtau = jtaus.begin();
75 jtau != jtaus.end();
76 ++jtau ) {
77
78 // 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.
79 bool passed = (*jtau)->Et() > m_threshold->thrValue100MeV((*jtau)->eta()/4);
80
81 if (!checkIsolation(*jtau)) continue;
82
83 if (passed) {
84 counting++;
85 fillHist2D( m_histAccept[0], (*jtau)->eta(), (*jtau)->EtDouble() );
86 }
87
88 }
89
90 fillHist1D( m_histAccept[1], counting);
91
92 // Pass counting to TCS::Count object - output bits are composed there
93 count.setSizeCount(counting);
94
96
97}
98
99bool
101 if(m_threshold->isolation() == WP::NONE) return true;
102 auto iso_wp = m_extraInfo->isolation(m_threshold->isolation(), jtau->etaDouble());
103 return jtau->EtIso()*1024 < jtau->Et()*iso_wp.isolation_fw();
104}
105
#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
virtual StatusCode process(const TCS::InputTOBArray &input, Count &count) override final
TrigConf::L1Threshold_jTAU const * m_threshold
std::shared_ptr< TrigConf::L1ThrExtraInfo_jTAU > m_extraInfo
virtual StatusCode initialize() override
jTauMultiplicity(const std::string &name)
bool checkIsolation(const TCS::jTauTOB *jtau) const
virtual StatusCode processBitCorrect(const TCS::InputTOBArray &input, Count &count) override final
double etaDouble() const
Definition jTauTOB.h:37
unsigned int EtIso() const
Definition jTauTOB.h:40
unsigned int Et() const
Definition jTauTOB.h:32
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.