Commit d1c6538f authored by Anil Sonay's avatar Anil Sonay Committed by Vakhtang Tsulaia
Browse files

Adding eTau TOB and including eEm isolation to L1Topo

parent 153da9b6
......@@ -35,9 +35,8 @@ namespace TCS {
private:
TrigConf::L1Threshold const * m_threshold{nullptr};
};
}
......
......@@ -27,13 +27,14 @@ namespace TCS {
virtual TCS::StatusCode sort(const InputTOBArray & input, TOBArray & output);
private:
parType_t m_numberOfeEms = { 0 };
parType_t m_minEta = { 0 };
parType_t m_maxEta = { 0 };
parType_t m_et = { 0 };
parType_t m_iso = { 0 };
parType_t m_doIsoCut = { 0 };
parType_t m_minREta = { 0 };
parType_t m_minRHad = { 0 };
parType_t m_minWsTot = { 0 };
};
......
......@@ -27,12 +27,13 @@ namespace TCS {
virtual TCS::StatusCode sort(const InputTOBArray & input, TOBArray & output);
private:
parType_t m_numberOfeEms = { 0 };
parType_t m_minEta = { 0 };
parType_t m_maxEta = { 0 };
parType_t m_iso = { 0 };
parType_t m_doIsoCut = { 0 };
parType_t m_minREta = { 0 };
parType_t m_minRHad = { 0 };
parType_t m_minWsTot = { 0 };
};
} // end of namespace TCS
......
......@@ -28,7 +28,7 @@ namespace TCS {
private:
parType_t m_numberOfClusters = { 0 };
parType_t m_numberOfeTaus = { 0 };
parType_t m_minEta = { 0 };
parType_t m_maxEta = { 0 };
parType_t m_et = { 0 };
......
......@@ -28,7 +28,7 @@ namespace TCS {
private:
parType_t m_numberOfClusters = { 0 };
parType_t m_numberOfeTaus = { 0 };
parType_t m_minEta = { 0 };
parType_t m_maxEta = { 0 };
parType_t m_iso = { 0 };
......
......@@ -60,7 +60,7 @@ TCS::EMMultiplicity::processBitCorrect( const TCS::InputTOBArray & input,
Count & count)
{
return process(input, count);
return process(input, count);
}
TCS::StatusCode
......@@ -71,11 +71,6 @@ TCS::EMMultiplicity::process( const TCS::InputTOBArray & input,
// Grab the threshold and cast it into the right type
auto eEMThr = dynamic_cast<const TrigConf::L1Threshold_eEM &>(*m_threshold);
// TO-DO: Add isolation cuts - need to be implemented in the L1Calo EDM first
//cout << "reta: " << TrigConf::Selection::wpToString(eEMThr.reta()) << endl;
//cout << "rhad: " << TrigConf::Selection::wpToString(eEMThr.rhad()) << endl;
//cout << "wstot: " << TrigConf::Selection::wpToString(eEMThr.wstot()) << endl;
// Grab inputs
const eEmTOBArray & eems = dynamic_cast<const eEmTOBArray&>(input);
......@@ -88,10 +83,13 @@ TCS::EMMultiplicity::process( const TCS::InputTOBArray & input,
const GenericTOB gtob(**eem);
bool passed = false;
for(auto & rv : eEMThr.thrValues())
if ( (gtob.eta() < rv.etaMax()) && (gtob.eta() >= rv.etaMin()) && (gtob.EtDouble()> static_cast<unsigned int>(rv.value())) ) passed = true;
// 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.
bool passed = gtob.Et() >= eEMThr.thrValueCounts(gtob.eta()/4);
if ( !isocut(TrigConf::Selection::wpToString(eEMThr.reta()), gtob.Reta()) ) {continue;}
if ( !isocut(TrigConf::Selection::wpToString(eEMThr.rhad()), gtob.Rhad()) ) {continue;}
if ( !isocut(TrigConf::Selection::wpToString(eEMThr.wstot()), gtob.Wstot()) ) {continue;}
if (passed) {
counting++;
fillHist2D( m_histAccept[0], gtob.eta(), gtob.EtDouble() );
......
......@@ -19,10 +19,11 @@ TCS::eEmSelect::eEmSelect(const std::string & name) : SortingAlg(name) {
defineParameter( "InputWidth1stStage", 30 ); // for fw
defineParameter( "OutputWidth", 6 );
defineParameter( "MinET", 0 );
defineParameter( "IsoMask", 0);
defineParameter( "REtaMin", 0);
defineParameter( "RHadMin", 0);
defineParameter( "WsTotMin", 0);
defineParameter( "MinEta", 0 );
defineParameter( "MaxEta", 63);
defineParameter( "DoIsoCut", 1);
}
......@@ -33,10 +34,12 @@ TCS::StatusCode
TCS::eEmSelect::initialize() {
m_numberOfeEms = parameter("OutputWidth").value();
m_et = parameter("MinET").value();
m_iso = parameter("IsoMask").value();
m_minEta = parameter("MinEta").value();
m_maxEta = parameter("MaxEta").value();
m_doIsoCut = parameter("DoIsoCut").value();
m_maxEta = parameter("MaxEta").value();
m_minREta = parameter("REtaMin").value();
m_minRHad = parameter("RHadMin").value();
m_minWsTot = parameter("WsTotMin").value();
return TCS::StatusCode::SUCCESS;
}
......@@ -51,9 +54,10 @@ TCS::eEmSelect::sort(const InputTOBArray & input, TOBArray & output) {
if( parType_t((*eem)->Et()) <= m_et ) continue; // ET cut
// isolation cut
if (m_doIsoCut && (m_iso != 0 )) {
if((parType_t((*eem)->isolation()) & m_iso) != m_iso ) continue;
}
if ( !isocut(m_minREta, gtob.Reta()) ) {continue;}
if ( !isocut(m_minRHad, gtob.Rhad()) ) {continue;}
if ( !isocut(m_minWsTot, gtob.Wstot()) ) {continue;}
// eta cut
if (parType_t(std::abs((*eem)-> eta())) < m_minEta) continue;
if (parType_t(std::abs((*eem)-> eta())) > m_maxEta) continue;
......
......@@ -23,10 +23,11 @@ TCS::eEmSort::eEmSort(const std::string & name) : SortingAlg(name) {
defineParameter( "InputWidth", 120 ); // for FW
defineParameter( "InputWidth1stStage", 30 ); // for FW
defineParameter( "OutputWidth", 6);
defineParameter( "IsoMask", 0);
defineParameter( "REtaMin", 0);
defineParameter( "RHadMin", 0);
defineParameter( "WsTotMin", 0);
defineParameter( "MinEta", 0);
defineParameter( "MaxEta", 63);
defineParameter( "DoIsoCut", 1);
}
......@@ -37,10 +38,11 @@ TCS::eEmSort::~eEmSort() {}
TCS::StatusCode
TCS::eEmSort::initialize() {
m_numberOfeEms = parameter("OutputWidth").value();
m_iso = parameter("IsoMask").value();
m_minEta = parameter("MinEta").value();
m_maxEta = parameter("MaxEta").value();
m_doIsoCut = parameter( "DoIsoCut").value();
m_minREta = parameter("REtaMin").value();
m_minRHad = parameter("RHadMin").value();
m_minWsTot = parameter("WsTotMin").value();
return TCS::StatusCode::SUCCESS;
}
......@@ -56,11 +58,11 @@ TCS::eEmSort::sort(const InputTOBArray & input, TOBArray & output) {
if (parType_t(std::abs((*eem)-> eta())) < m_minEta) continue;
if (parType_t(std::abs((*eem)-> eta())) > m_maxEta) continue;
// isolation cut
if (m_iso != 0 ) {
unsigned int isobit(0x1 << (m_iso-1));
if(m_doIsoCut && ((parType_t((*eem)->isolation()) & isobit) != isobit)) continue;
}
if ( !isocut(m_minREta, gtob.Reta()) ) {continue;}
if ( !isocut(m_minRHad, gtob.Rhad()) ) {continue;}
if ( !isocut(m_minWsTot, gtob.Wstot()) ) {continue;}
output.push_back( gtob );
}
......
......@@ -7,7 +7,7 @@
//
#include "L1TopoAlgorithms/eTauSelect.h"
#include "L1TopoEvent/TOBArray.h"
#include "L1TopoEvent/ClusterTOBArray.h"
#include "L1TopoEvent/eTauTOBArray.h"
#include "L1TopoEvent/GenericTOB.h"
#include <algorithm>
......@@ -31,7 +31,7 @@ TCS::eTauSelect::~eTauSelect() {}
TCS::StatusCode
TCS::eTauSelect::initialize() {
m_numberOfClusters = parameter("OutputWidth").value();
m_numberOfeTaus = parameter("OutputWidth").value();
m_et = parameter("MinET").value();
m_iso = parameter("IsoMask").value();
m_minEta = parameter("MinEta").value();
......@@ -43,10 +43,10 @@ TCS::eTauSelect::initialize() {
TCS::StatusCode
TCS::eTauSelect::sort(const InputTOBArray & input, TOBArray & output) {
const ClusterTOBArray & clusters = dynamic_cast<const ClusterTOBArray&>(input);
const eTauTOBArray & clusters = dynamic_cast<const eTauTOBArray&>(input);
// fill output array with GenericTOB buildt from clusters
for(ClusterTOBArray::const_iterator cl = clusters.begin(); cl!= clusters.end(); ++cl ) {
for(eTauTOBArray::const_iterator cl = clusters.begin(); cl!= clusters.end(); ++cl ) {
const GenericTOB gtob(**cl);
if( parType_t((*cl)->Et()) <= m_et ) continue; // ET cut
......@@ -63,10 +63,10 @@ TCS::eTauSelect::sort(const InputTOBArray & input, TOBArray & output) {
// keep only max number of clusters
int par = m_numberOfClusters ;
unsigned int maxNumberOfClusters = (unsigned int)(par<0?0:par);
if(maxNumberOfClusters>0) {
while( output.size()> maxNumberOfClusters ) {
int par = m_numberOfeTaus ;
unsigned int maxNumberOfeTaus = (unsigned int)(par<0?0:par);
if(maxNumberOfeTaus>0) {
while( output.size()> maxNumberOfeTaus ) {
output.pop_back();
}
}
......
......@@ -7,7 +7,7 @@
//
#include "L1TopoAlgorithms/eTauSort.h"
#include "L1TopoEvent/TOBArray.h"
#include "L1TopoEvent/ClusterTOBArray.h"
#include "L1TopoEvent/eTauTOBArray.h"
#include "L1TopoEvent/GenericTOB.h"
#include <algorithm>
......@@ -37,7 +37,7 @@ TCS::eTauSort::~eTauSort() {}
TCS::StatusCode
TCS::eTauSort::initialize() {
m_numberOfClusters = parameter("OutputWidth").value();
m_numberOfeTaus = parameter("OutputWidth").value();
m_iso = parameter("IsoMask").value();
m_minEta = parameter("MinEta").value();
m_maxEta = parameter("MaxEta").value();
......@@ -49,10 +49,10 @@ TCS::eTauSort::initialize() {
TCS::StatusCode
TCS::eTauSort::sort(const InputTOBArray & input, TOBArray & output) {
const ClusterTOBArray & clusters = dynamic_cast<const ClusterTOBArray&>(input);
const eTauTOBArray & clusters = dynamic_cast<const eTauTOBArray&>(input);
// fill output array with GenericTOB buildt from clusters
for(ClusterTOBArray::const_iterator cl = clusters.begin(); cl!= clusters.end(); ++cl ) {
for(eTauTOBArray::const_iterator cl = clusters.begin(); cl!= clusters.end(); ++cl ) {
const GenericTOB gtob(**cl);
if (parType_t(std::abs((*cl)-> eta())) < m_minEta) continue;
......@@ -71,10 +71,10 @@ TCS::eTauSort::sort(const InputTOBArray & input, TOBArray & output) {
// keep only max number of clusters
int par = m_numberOfClusters;
unsigned int maxNumberOfClusters = (unsigned int)(par<0?0:par);
if(maxNumberOfClusters>0) {
while( output.size()> maxNumberOfClusters ) {
int par = m_numberOfeTaus;
unsigned int maxNumberOfeTaus = (unsigned int)(par<0?0:par);
if(maxNumberOfeTaus>0) {
while( output.size()> maxNumberOfeTaus ) {
output.pop_back();
}
}
......
......@@ -18,7 +18,9 @@ namespace TCS {
TAU=7,
LATEMUON=8,
MUONNEXTBC=9,
EEM=10 };
EEM=10,
ETAU=11
};
std::string inputTypeAsString(inputTOBType_t type);
......
......@@ -36,7 +36,7 @@ TCS::inputType(const std::string& input) {
return TCS::CLUSTER;
if ( input == "eTau" || input == "eTauTobArray" || input == "eTauTobs" )
return TCS::CLUSTER;
return TCS::ETAU;
if ( input == "jTau" || input == "jTauTobArray" || input == "jTauTobs" )
return TCS::JTAU;
......
......@@ -13,6 +13,7 @@
#include "L1TopoEvent/jJetTOB.h"
#include "L1TopoEvent/ClusterTOB.h"
#include "L1TopoEvent/eEmTOB.h"
#include "L1TopoEvent/eTauTOB.h"
#include "L1TopoEvent/MuonTOB.h"
#include "L1TopoEvent/LateMuonTOB.h"
#include "L1TopoEvent/MuonNextBCTOB.h"
......@@ -53,6 +54,9 @@ namespace TCS {
// constructor from eEm
GenericTOB(const eEmTOB & eem);
// constructor from eTau
GenericTOB(const eTauTOB & etau);
// constructor from muon
GenericTOB(const MuonTOB & muon);
......@@ -84,6 +88,10 @@ namespace TCS {
int eta() const { return m_eta; }
int phi() const { return m_phi; }
unsigned int Reta() const { return m_reta; }
unsigned int Rhad() const { return m_rhad; }
unsigned int Wstot() const { return m_wstot; }
// See definitions at TrigT1Interfaces/MuCTPIL1TopoCandidate.h
int bw2or3() const { return m_bw2or3; }
int innerCoin() const { return m_innerCoin; }
......@@ -121,6 +129,10 @@ namespace TCS {
double m_EtDouble { 0 };
double m_etaDouble { 0 };
double m_phiDouble { 0 };
unsigned int m_reta {0};
unsigned int m_rhad {0};
unsigned int m_wstot {0};
inputTOBType_t m_tobType { NONE };
......
......@@ -8,6 +8,7 @@
#include "L1TopoEvent/ClusterTOBArray.h"
#include "L1TopoEvent/eEmTOBArray.h"
#include "L1TopoEvent/eTauTOBArray.h"
#include "L1TopoEvent/JetTOBArray.h"
#include "L1TopoEvent/jTauTOBArray.h"
#include "L1TopoEvent/jLargeRJetTOBArray.h"
......@@ -37,6 +38,7 @@ namespace TCS {
const ClusterTOBArray & clusters() const { return m_clusters; }
const eEmTOBArray & eems() const { return m_eems; }
const eTauTOBArray & etaus() const { return m_etaus; }
const ClusterTOBArray & taus() const { return m_taus; }
const MuonTOBArray & muons() const { return m_muons; }
const LateMuonTOBArray & lateMuons() const { return m_lateMuons; }
......@@ -64,6 +66,7 @@ namespace TCS {
/** @} */ // end of groupOverflowGetters
StatusCode addCluster(const ClusterTOB & cluster);
StatusCode addeEm(const eEmTOB & eem);
StatusCode addeTau(const eTauTOB & etau);
StatusCode addTau(const ClusterTOB & tau);
StatusCode addMuon(const MuonTOB & muon);
StatusCode addLateMuon(const LateMuonTOB & muon);
......@@ -111,6 +114,7 @@ namespace TCS {
// data is owned by the TopoInputEvent
ClusterTOBArray m_clusters;
eEmTOBArray m_eems;
eTauTOBArray m_etaus;
ClusterTOBArray m_taus;
JetTOBArray m_jets;
jTauTOBArray m_jTaus;
......
......@@ -40,6 +40,10 @@ namespace TCS {
double etaDouble() const { return m_etaDouble; } // float eta with granularity 0.025
double phiDouble() const { return m_phiDouble; } // float phi with granularity 0.05
unsigned int Reta() const { return m_reta; }
unsigned int Rhad() const { return m_rhad; }
unsigned int Wstot() const { return m_wstot; }
// setters
void setEt(unsigned int et) { m_Et = sizeCheck(et, nBitsEt()); }
void setIsolation(unsigned int et) { m_isolation = sizeCheck(et, nBitsIsolation()); }
......@@ -49,6 +53,10 @@ namespace TCS {
void setEtDouble(double et) { m_EtDouble = et; }
void setEtaDouble(double eta) { m_etaDouble = eta; }
void setPhiDouble(double phi) { m_phiDouble = phi; }
void setReta(unsigned int th) { m_reta = th; }
void setRhad(unsigned int th) { m_rhad = th; }
void setWstot(unsigned int th) { m_wstot = th; }
// memory management
static eEmTOB* createOnHeap(const eEmTOB& eem);
......@@ -76,6 +84,10 @@ namespace TCS {
double m_etaDouble {0};
double m_phiDouble {0};
unsigned int m_reta {0};
unsigned int m_rhad {0};
unsigned int m_wstot {0};
inputTOBType_t m_tobType { NONE };
static thread_local Heap<TCS::eEmTOB> fg_heap;
......
// Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
#ifndef L1TopoEvent_eTauTOB
#define L1TopoEvent_eTauTOB
#include "L1TopoEvent/Heap.h"
#include "L1TopoEvent/BaseTOB.h"
#include <iostream>
namespace TCS {
class eTauTOB : public BaseTOB {
public:
static unsigned int nBitsEt() { return g_nBitsEt; }
static unsigned int nBitsIsolation() { return g_nBitsIsolation; }
static unsigned int nBitsEta() { return g_nBitsEta; }
static unsigned int nBitsPhi() { return g_nBitsPhi; }
// default constructor
eTauTOB(uint32_t roiWord = 0, const std::string& tobName = "eTauTOB");
// constructor with individual values
eTauTOB(unsigned int et, unsigned int isolation, int eta, unsigned int phi, inputTOBType_t tobType = NONE, uint32_t roiWord = 0, const std::string& tobName = "eTauTOB");
// constructor with initial values
eTauTOB(const eTauTOB & eem);
// destructor
virtual ~eTauTOB();
// accessors
unsigned int Et() const { return m_Et; } // Et in units of 100 MeV
unsigned int isolation() const { return m_isolation; }
int eta() const { return m_eta; } // eta in units of 0.025
unsigned int phi() const { return m_phi; } // phi in units of 0.05
double EtDouble() const { return m_EtDouble; } // float Et in units of GeV
double etaDouble() const { return m_etaDouble; } // float eta with granularity 0.025
double phiDouble() const { return m_phiDouble; } // float phi with granularity 0.05
unsigned int Reta() const { return m_reta; }
unsigned int Rhad() const { return m_rhad; }
unsigned int Wstot() const { return m_wstot; }
// setters
void setEt(unsigned int et) { m_Et = sizeCheck(et, nBitsEt()); }
void setIsolation(unsigned int et) { m_isolation = sizeCheck(et, nBitsIsolation()); }
void setEta(int eta) { m_eta = sizeCheck(eta, nBitsEta()); }
void setPhi(unsigned int phi) { m_phi = sizeCheck(phi, nBitsPhi()); }
void setEtDouble(double et) { m_EtDouble = et; }
void setEtaDouble(double eta) { m_etaDouble = eta; }
void setPhiDouble(double phi) { m_phiDouble = phi; }
void setReta(unsigned int th) { m_reta = th; }
void setRhad(unsigned int th) { m_rhad = th; }
void setWstot(unsigned int th) { m_wstot = th; }
// memory management
static eTauTOB* createOnHeap(const eTauTOB& eem);
static void clearHeap();
static const Heap<TCS::eTauTOB>& heap() { return fg_heap; }
virtual void print(std::ostream &o) const;
void setTobType(inputTOBType_t tobType) { m_tobType = tobType; }
inputTOBType_t tobType() const { return m_tobType; }
private:
static const unsigned int g_nBitsEt;
static const unsigned int g_nBitsIsolation;
static const unsigned int g_nBitsEta;
static const unsigned int g_nBitsPhi;
unsigned int m_Et {0};
unsigned int m_isolation {0};
int m_eta {0};
unsigned int m_phi {0};
double m_EtDouble {0};
double m_etaDouble {0};
double m_phiDouble {0};
unsigned int m_reta {0};
unsigned int m_rhad {0};
unsigned int m_wstot {0};
inputTOBType_t m_tobType { NONE };
static thread_local Heap<TCS::eTauTOB> fg_heap;
};
}
#endif
// Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
#ifndef ETAUTOBARRAY_H
#define ETAUTOBARRAY_H
#include <iostream>
#include "L1TopoEvent/InputTOBArray.h"
#include "L1TopoEvent/DataArrayImpl.h"
#include "L1TopoEvent/eTauTOB.h"
#include <vector>
namespace TCS {
class eTauTOBArray : public InputTOBArray, public DataArrayImpl<eTauTOB> {
public:
// default constructor
eTauTOBArray(const std::string & name, unsigned int reserve);
virtual unsigned int size() const { return DataArrayImpl<eTauTOB>::size(); }
private:
virtual void print(std::ostream&) const;
};
}
#endif
......@@ -96,9 +96,27 @@ TCS::GenericTOB::GenericTOB(const eEmTOB & eem) :
, m_EtDouble(eem.EtDouble())
, m_etaDouble(eem.etaDouble())
, m_phiDouble(eem.phiDouble())
, m_reta(eem.Reta())
, m_rhad(eem.Rhad())
, m_wstot(eem.Wstot())
, m_tobType(eem.tobType())
{}
// constructor from eTau
TCS::GenericTOB::GenericTOB(const eTauTOB & etau) :
BaseTOB(etau)
, m_Et(etau.Et())
, m_eta(etau.eta())
, m_phi(etau.phi())
, m_EtDouble(etau.EtDouble())
, m_etaDouble(etau.etaDouble())
, m_phiDouble(etau.phiDouble())
, m_reta(etau.Reta())
, m_rhad(etau.Rhad())
, m_wstot(etau.Wstot())
, m_tobType(etau.tobType())
{}
// constructor from muon
TCS::GenericTOB::GenericTOB(const MuonTOB & muon) :
BaseTOB(muon)
......
......@@ -10,6 +10,7 @@ TopoInputEvent::TopoInputEvent() :
TrigConfMessaging("TopoInputEvent"),
m_clusters("InputClusters",120),
m_eems("InputeEms",120),
m_etaus("InputeTaus",120),
m_taus("InputTaus",120),
m_jets("InputJets",60),
m_jTaus("InputjTaus",60),
......@@ -35,6 +36,11 @@ StatusCode TopoInputEvent::addeEm(const TCS::eEmTOB & eem) {
return StatusCode::SUCCESS;
}
StatusCode TopoInputEvent::addeTau(const TCS::eTauTOB & etau) {
m_etaus.push_back(etau);
return StatusCode::SUCCESS;
}
StatusCode TopoInputEvent::addTau(const TCS::ClusterTOB & tau) {