ATLAS Offline Software
jJetMultiplicity.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  * jJetMultiplicity.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 
18 #include "L1TopoCommon/Exception.h"
19 #include "L1TopoInterfaces/Count.h"
20 
21 #include "L1TopoEvent/TOBArray.h"
23 #include "L1TopoEvent/GenericTOB.h"
24 
25 REGISTER_ALG_TCS(jJetMultiplicity)
26 
27 using namespace std;
28 
29 
31 {
32 
33 
34  setNumberOutputBits(12); //To-Do: Make this flexible to addapt to the menu. Each counting requires more than one bit
35 
36 }
37 
39 
40 
43 
44  m_threshold = getThreshold();
45 
46  // book histograms
47  std::string hname_accept = "jJetMultiplicity_accept_EtaPt"+m_threshold->name();
48  bookHistMult(m_histAccept, hname_accept, "Mult_"+m_threshold->name(), "#eta#times40", "E_{t} [GeV]", 200, -200, 200, 600, 0, 600);
49 
50  hname_accept = "jJetMultiplicity_accept_counts_"+m_threshold->name();
51  bookHistMult(m_histAccept, hname_accept, "Mult_"+m_threshold->name(), "counts", 15, 0, 15);
52 
53  return StatusCode::SUCCESS;
54 
55 }
56 
57 
60  Count & count)
61 
62 {
63  return process(input, count);
64 }
65 
68  Count & count )
69 {
70 
71  // Grab the threshold and cast it into the right type
72  const auto& jJThr = dynamic_cast<const TrigConf::L1Threshold_jJ &>(*m_threshold);
73 
74  // Grab inputs
75  const jJetTOBArray & jjets = dynamic_cast<const jJetTOBArray&>(input);
76 
77  int counting = 0;
78 
79  // loop over input TOBs
80  for(jJetTOBArray::const_iterator jjet = jjets.begin();
81  jjet != jjets.end();
82  ++jjet ) {
83 
84  const GenericTOB gtob(**jjet);
85 
86  // 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.
87  // Using abs eta here as L1ThresholdBase is not symmetric under eta -> -eta (even if configured in a seemingly symmetric way due to "min <= value < max" requirement)
88  // The corresponding FW algorithm, however, explicitly supports only ranges defined w.r.t. abs(eta) and is therefore symmetric
89  bool passed = gtob.Et() > jJThr.thrValue100MeV(abs(gtob.eta()/4));
90 
91  if (passed) {
92  counting++;
93  fillHist2D( m_histAccept[0], gtob.eta(), gtob.EtDouble() );
94  }
95 
96  }
97 
98  fillHist1D( m_histAccept[1], counting);
99 
100  // Pass counting to TCS::Count object - output bits are composed there
101  count.setSizeCount(counting);
102 
104 
105 }
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< jJetTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
jJetTOBArray.h
TCS::GenericTOB::Et
unsigned int Et() const
Definition: GenericTOB.h:113
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
Count.h
TCS::jJetMultiplicity::jJetMultiplicity
jJetMultiplicity(const std::string &name)
Definition: jJetMultiplicity.cxx:30
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
jJetMultiplicity.h
TOBArray.h
TCS::jJetTOBArray
Definition: L1Topo/L1TopoEvent/L1TopoEvent/jJetTOBArray.h:19
TCS::GenericTOB
Definition: GenericTOB.h:35
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrigConf::L1Threshold_jJ
Definition: L1Threshold.h:275
GenericTOB.h
TCS::DataArrayImpl::begin
iterator begin()
Definition: DataArrayImpl.h:40
TCS::GenericTOB::EtDouble
double EtDouble() const
Definition: GenericTOB.h:132
TCS::Count
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:20
TCS::jJetMultiplicity::initialize
virtual StatusCode initialize() override
Definition: jJetMultiplicity.cxx:42
TCS::jJetMultiplicity::process
virtual StatusCode process(const TCS::InputTOBArray &input, Count &count) override final
Definition: jJetMultiplicity.cxx:67
TCS::GenericTOB::eta
int eta() const
Definition: GenericTOB.h:122
getThreshold
CP::CorrectionCode getThreshold(Int_t &threshold, const std::string &trigger)
Definition: MuonTriggerSFRootCoreTest.cxx:48
TCS::jJetMultiplicity::processBitCorrect
virtual StatusCode processBitCorrect(const TCS::InputTOBArray &input, Count &count) override final
Definition: jJetMultiplicity.cxx:59
Exception.h
TCS::CountingAlg
Definition: CountingAlg.h:25
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::jJetMultiplicity::~jJetMultiplicity
virtual ~jJetMultiplicity()
Definition: jJetMultiplicity.cxx:38