  | 
  
    ATLAS Offline Software
    
   | 
 
 
 
 
Go to the documentation of this file.
   13 #include <sys/types.h> 
   19 ThresholdConfig::ThresholdConfig() :
 
   36 const vector<TriggerThreshold*>& 
 
   38    thrVecMap_t::const_iterator 
res = m_thresholdVectors.find(
type);
 
   39    if(
res == m_thresholdVectors.end()) {
 
   41       throw std::runtime_error(
"Unknown triggertype in ThresholdConfig::getThresholdVector encountered" );
 
   46 const std::vector<TrigConf::TriggerThreshold*>&
 
   48    return getThresholdVector(
type);
 
   57    if(
pos >= thrVec.size()) thrVec.resize(
pos+1, 0);
 
   59    if(thrVec[
pos] != 0) {
 
   60       cerr << 
"ThresholdConfig::insertInPosition: position " << 
pos 
   61            << 
" already filled for type " << 
thr->type() << 
" [" << 
thr->ttype() << 
"]" << 
", abort!!" << endl;
 
   62       cerr << endl << 
"Existing threshold" << endl;
 
   63       thrVec[
pos]->print(
"",5);
 
   64       cerr << endl << 
"New threshold" << endl;
 
   66       throw runtime_error(
"ThresholdConfig::insertInPosition position already filled" );
 
   78    m_TriggerThresholdVector.push_back(
thr);
 
   83    const auto& 
res = m_thresholdVectors.find(ttype);
 
   84    if(
res == m_thresholdVectors.end()) {
 
   85      cerr << 
"Unknown triggertype '" << 
L1DataDef::typeAsString(ttype) << 
"' in ThresholdConfig::getThresholdVector encountered" << endl;
 
   86      throw runtime_error(
"Unknown triggertype in ThresholdConfig::getThresholdVector encountered" );
 
   88    vector<TriggerThreshold*>& thrVec = 
res->second;
 
   92    if(
thr->mapping()>0 && (
unsigned int)
thr->mapping() >= max_thr) {
 
   93       cerr << 
"ThresholdConfig::addTriggerThreshold: threshold mapping " << 
thr->mapping()
 
   94            << 
" exceeds maximum for type '" << 
thr->type() << 
"' , abort!" << endl;
 
   95       throw runtime_error( 
"ThresholdConfig::addTriggerThreshold: threshold mapping exceeds limit" );
 
   98    thr->setThresholdNumber(
thr->mapping());
 
   99    insertInPosition(thrVec, 
thr, 
thr->mapping() );
 
  114          insertInPosition( m_ClusterThresholdVector, 
thr, 
thr->mapping() );
 
  118          unsigned int max_tau = 0; 
 
  119          unsigned int pos = max_em + max_tau - 
thr->mapping() - 1; 
 
  120          insertInPosition( m_ClusterThresholdVector, 
thr, 
pos );
 
  131    return thr?
thr->type():
"EM";
 
  161    return getThresholdVector(
type)[thresholdnumber]->triggerThresholdValue(
eta,
phi)->window();
 
  182    return getThresholdVector(
type)[thresholdnumber]->triggerThresholdValue(
eta,
phi)->ptcut();
 
  249       if ( 
p->mapping()>=8 )
 
  250          p->setThresholdNumber(max_em - 1 - (
p->mapping()-8) );
 
  256          p->setThresholdNumber(
p->mapping() + 8);
 
  266       if(
thr->id()==
id) 
return thr;
 
  273    cout << 
indent << 
"=========================================" << endl
 
  274         << 
indent << 
" The " << 
name << 
": " << 
vec.size() << 
" elements" << endl
 
  275         << 
indent << 
"=========================================" << endl;
 
  278       else cout << 
indent << 
" " << 0 << endl;
 
  284       cout << 
indent << 
"Threshold configuration: " << getThresholdVector().size() << 
" thresholds" << endl;
 
  287               << getThresholdVector(
tt).size() << 
" thresholds" << endl;
 
  289       cout << 
"Threshold configuration: " << getThresholdVector().size() << 
" thresholds" << endl;
 
  292       cout << 
indent << 
"=========================================" << endl
 
  293            << 
indent << 
"== ThresholdConfig for MT_id = " << lvl1MasterTableId()  << endl
 
  294            << 
indent << 
"=========================================" << endl;
 
  319    cout << 
"#=========================================" << endl
 
  320         << 
"# " << 
name << 
":" << endl
 
  321         << 
"#=========================================" << endl;
 
  327    printTtvSummary(getThresholdVector(
L1DataDef::EM),   
"EM threshold values");
 
  328    printTtvSummary(getThresholdVector(
L1DataDef::TAU),  
"Tau threshold values");
 
  329    printTtvSummary(m_ClusterThresholdVector,            
"Cluster threshold values (EM + Tau)");
 
  330    printTtvSummary(getThresholdVector(
L1DataDef::JET),  
"JetThreshold values");
 
  331    printTtvSummary(getThresholdVector(
L1DataDef::FJET), 
"FJetThreshold values");
 
  332    printTtvSummary(getThresholdVector(
L1DataDef::TE),   
"TotEt values");
 
  333    printTtvSummary(getThresholdVector(
L1DataDef::JE),   
"JetEt values");
 
  334    printTtvSummary(getThresholdVector(
L1DataDef::XE),   
"MissEt values");
 
  335    printTtvSummary(getThresholdVector(
L1DataDef::MUON), 
"MuonThreshold values");
 
  336    printTtvSummary(getThresholdVector(
L1DataDef::NIM),  
"NimThreshold values");
 
  343    cout << 
"#---------------------------------------------------------" << endl
 
  344         << 
"# TTV(type,name)         eta   phi :    pt  window emIsol hadIsol hadVeto" << endl
 
  345         << 
"# Number of theshold values: " << 
thr->thresholdValueVector().size() << endl
 
  346         << 
"#---------------------------------------------------------" << endl;
 
  347    for (
int ieta = -49; ieta <= 49; ++ieta) {
 
  348       for (
int iphi = 0; iphi < 64; ++iphi) {
 
  350          float emiso(-1), hadiso(-1), hadveto(-1);
 
  357          sprintf(
line, 
"TTV(%-4s,%-10s) eta[%2d] phi[%2d]: %3f %6u %6f %6f %6f", 
 
  358                  thr->type().c_str(), 
thr->name().c_str(), ieta, iphi, 
 
  359                  ttv->
ptcut(), ttv->
window(), emiso, hadiso, hadveto);
 
  360          cout << 
line << endl;
 
  366 vector<TrigConf::TriggerThreshold*>
 
  368    vector<TriggerThreshold*> 
v;
 
  378    m_TriggerThresholdVector.clear();
 
  380    for(thrVecMap_t::value_type & 
p: m_thresholdVectors)
 
  
std::vector< TriggerThreshold * > thrVec_t
 
static TriggerTypeConfig & typeConfig(TriggerType tt)
 
float getTotEtThreshold(int eta, int phi, int thresholdnumber) const
 
Scalar phi() const
phi method
 
float getThreshold(L1DataDef::TriggerType type, int eta, int phi, int thresholdnumber) const
 
float getJfThreshold(int eta, int phi, int thresholdnumber) const
 
int getJbWindow(int eta, int phi, int thresholdnumber) const
 
int getWindow(L1DataDef::TriggerType type, int eta, int phi, int thresholdnumber) const
 
Scalar eta() const
pseudorapidity method
 
void printTtvSummary(const thrVec_t &vec, const std::string &name) const
 
float getClusterHadIsolation(int eta, int phi, int thresholdnumber) const
 
thrVecMap_t m_thresholdVectors
 
thrVec_t m_TriggerThresholdVector
 
std::vector< size_t > vec
 
std::string getClusterThresholdType(int thresholdnumber) const
 
static const TypeConfigMap_t & typeConfigs()
 
float getClusterHadVeto(int eta, int phi, int thresholdnumber) const
 
int getJetWindow(int eta, int phi, int thresholdnumber) const
 
Forward iterator to traverse the main components of the trigger configuration.
 
float hadIsolation() const
 
void printTriggerThresholdVector(const std::string &indent="") const
 
std::pair< std::vector< unsigned int >, bool > res
 
int getJfWindow(int eta, int phi, int thresholdnumber) const
 
std::vector< TriggerThreshold * > getNimThresholdVectorByType(const std::string &type) const
 
virtual ~ThresholdConfig() override
 
TriggerThreshold * findTriggerThreshold(unsigned int id)
 
const std::vector< TriggerThreshold * > & thresholdVector() const
 
float getClusterThreshold(int eta, int phi, int thresholdnumber) const
 
float getMissEtSigThreshold(int eta, int phi, int thresholdnumber) const
 
static std::string & typeAsString(TriggerType tt)
 
void attributeThresholdNumbers()
 
float getJetThreshold(int eta, int phi, int thresholdnumber) const
 
static const std::vector< TriggerType > & types()
 
const std::vector< TriggerThreshold * > & getThresholdVector() const
 
float getMuonThreshold(int eta, int phi, int thresholdnumber) const
 
bool insertInPosition(std::vector< TriggerThreshold * > &thrVec, TriggerThreshold *tt, unsigned int pos)
 
float getJbThreshold(int eta, int phi, int thresholdnumber) const
 
float getClusterEmIsolation(int eta, int phi, int thresholdnumber) const
 
virtual void print(const std::string &indent="", unsigned int detail=1) const override
 
bool addTriggerThreshold(TriggerThreshold *value)
 
CP::CorrectionCode getThreshold(Int_t &threshold, const std::string &trigger)
 
void printTtvMap(const TriggerThreshold *thr) const
 
void printThresholdValueMap() const
 
void printVectorSummary(const TrigConf::ThresholdConfig::thrVec_t &vec, const string &name, const string &indent, unsigned int detail)
 
float getMissEtThreshold(int eta, int phi, int thresholdnumber) const
 
float emIsolation() const
 
unsigned int window() const
 
float getJetEtThreshold(int eta, int phi, int thresholdnumber) const