ATLAS Offline Software
eEmMultiplicity.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  * eEmMultiplicity.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 
24 REGISTER_ALG_TCS(eEmMultiplicity)
25 
26 using 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 
43  m_threshold = getThreshold();
44 
45  // book histograms
46  std::string hname_accept = "eEmMultiplicity_accept_EtaPt_"+m_threshold->name();
47  bookHistMult(m_histAccept, hname_accept, "Mult_"+m_threshold->name(), "#eta#times40", "E_{t} [GeV]", 200, -200, 200, 100, 0, 100);
48 
49  hname_accept = "eEmMultiplicity_accept_counts_"+m_threshold->name();
50  bookHistMult(m_histAccept, hname_accept, "Mult_"+m_threshold->name(), "counts", 15, 0, 15);
51 
52  return StatusCode::SUCCESS;
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& eEMThr = dynamic_cast<const TrigConf::L1Threshold_eEM &>(*m_threshold);
72 
73  // Grab inputs
74  const eEmTOBArray & eems = dynamic_cast<const eEmTOBArray&>(input);
75 
76  int counting = 0;
77 
78  // loop over input TOBs
79  for(eEmTOBArray::const_iterator eem = eems.begin();
80  eem != eems.end();
81  ++eem ) {
82 
83  // Menu threshold uses 0.1 eta granularity but eFex objects have 0.025 eta granularity
84  // eFex eta is calculated as 4*eta_tower (0.1 gran.) + seed (0.025 gran.), eta from -25 to 24
85  int eta_thr;
86  if ( (*eem)->eta()%4 >= 0 ) { eta_thr = (*eem)->eta() - (*eem)->eta()%4; }
87  else { eta_thr = (*eem)->eta() - (*eem)->eta()%4 - 4; }
88 
89  bool passed = (*eem)->Et() > eEMThr.thrValue100MeV(eta_thr/4); // Convert eta_thr to units of 0.1 to pass as an argument
90 
91  if ( !isocut(TrigConf::Selection::wpToString(eEMThr.reta()), (*eem)->Reta()) ) {continue;}
92  if ( !isocut(TrigConf::Selection::wpToString(eEMThr.rhad()), (*eem)->Rhad()) ) {continue;}
93  if ( !isocut(TrigConf::Selection::wpToString(eEMThr.wstot()), (*eem)->Wstot()) ) {continue;}
94 
95  if (passed) {
96  counting++;
97  fillHist2D( m_histAccept[0], (*eem)->eta(), (*eem)->EtDouble() );
98  }
99 
100  }
101 
102  fillHist1D( m_histAccept[1], counting);
103 
104  // Pass counting to TCS::Count object - output bits are composed there
105  count.setSizeCount(counting);
106 
108 
109 }
TCS::eEmMultiplicity::process
virtual StatusCode process(const TCS::InputTOBArray &input, Count &count) override final
Definition: eEmMultiplicity.cxx:66
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::eEmMultiplicity::processBitCorrect
virtual StatusCode processBitCorrect(const TCS::InputTOBArray &input, Count &count) override final
Definition: eEmMultiplicity.cxx:58
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< eEmTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
TrigConf::Selection::wpToString
static std::string wpToString(WP)
Definition: L1ThresholdBase.cxx:347
TCS::eEmMultiplicity::eEmMultiplicity
eEmMultiplicity(const std::string &name)
Definition: eEmMultiplicity.cxx:29
TCS::eEmMultiplicity::~eEmMultiplicity
virtual ~eEmMultiplicity()
Definition: eEmMultiplicity.cxx:37
TCS::eEmTOBArray
Definition: L1Topo/L1TopoEvent/L1TopoEvent/eEmTOBArray.h:14
TrigConf::L1Threshold_eEM
Definition: L1Threshold.h:166
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
eEmMultiplicity.h
Count.h
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TOBArray.h
eEmTOBArray.h
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TCS::DataArrayImpl::begin
iterator begin()
Definition: DataArrayImpl.h:40
TCS::Count
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:20
TCS::eEmMultiplicity::initialize
virtual StatusCode initialize() override
Definition: eEmMultiplicity.cxx:41
getThreshold
CP::CorrectionCode getThreshold(Int_t &threshold, const std::string &trigger)
Definition: MuonTriggerSFRootCoreTest.cxx:48
Exception.h
GlobalSim::isocut
bool isocut(const std::string &threshold, const unsigned int bit)
Definition: isocut.cxx:10
TCS::CountingAlg
Definition: CountingAlg.h:25
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15