ATLAS Offline Software
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 
18 #include "L1TopoCommon/Exception.h"
19 #include "L1TopoInterfaces/Count.h"
20 
21 #include "L1TopoEvent/TOBArray.h"
23 
25 
26 REGISTER_ALG_TCS(jTauMultiplicity)
27 
28 using 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 
51  return StatusCode::SUCCESS;
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 
99 bool
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 
NONE
@ NONE
Definition: sTGCenumeration.h:13
TCS::jTauMultiplicity::~jTauMultiplicity
virtual ~jTauMultiplicity()
Definition: jTauMultiplicity.cxx:36
TCS::jTauTOBArray
Definition: jTauTOBArray.h:19
TCS::jTauMultiplicity::process
virtual StatusCode process(const TCS::InputTOBArray &input, Count &count) override final
Definition: jTauMultiplicity.cxx:65
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< jTauTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
TrigConf::L1Threshold_jTAU
Definition: L1Threshold.h:234
TCS::jTauMultiplicity::processBitCorrect
virtual StatusCode processBitCorrect(const TCS::InputTOBArray &input, Count &count) override final
Definition: jTauMultiplicity.cxx:57
TCS::jTauTOB::EtIso
unsigned int EtIso() const
Definition: jTauTOB.h:40
TCS::jTauTOB::Et
unsigned int Et() const
Definition: jTauTOB.h:32
TCS::jTauMultiplicity::checkIsolation
bool checkIsolation(const TCS::jTauTOB *jtau) const
Definition: jTauMultiplicity.cxx:100
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
jTauMultiplicity.h
Count.h
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TCS::jTauTOB
Definition: jTauTOB.h:16
TOBArray.h
TCS::jTauMultiplicity::jTauMultiplicity
jTauMultiplicity(const std::string &name)
Definition: jTauMultiplicity.cxx:31
TCS::jTauTOB::etaDouble
double etaDouble() const
Definition: jTauTOB.h:37
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
TrigConf::L1Threshold_jTAU::getExtraInfo
const std::shared_ptr< L1ThrExtraInfo_jTAU > getExtraInfo() const
Definition: L1Threshold.cxx:172
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TCS::DataArrayImpl::begin
iterator begin()
Definition: DataArrayImpl.h:40
TCS::Count
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:20
TCS::jTauMultiplicity::initialize
virtual StatusCode initialize() override
Definition: jTauMultiplicity.cxx:40
getThreshold
CP::CorrectionCode getThreshold(Int_t &threshold, const std::string &trigger)
Definition: MuonTriggerSFRootCoreTest.cxx:48
Exception.h
jTauTOBArray.h
TCS::CountingAlg
Definition: CountingAlg.h:25
L1ThrExtraInfo.h
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15