36const vector<TriggerThreshold*>&
41 throw std::runtime_error(
"Unknown triggertype in ThresholdConfig::getThresholdVector encountered" );
46const std::vector<TrigConf::TriggerThreshold*>&
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" );
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());
118 unsigned int max_tau = 0;
119 unsigned int pos = max_em + max_tau - thr->mapping() - 1;
131 return thr?thr->type():
"EM";
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;
272 const string&
name,
const string& indent,
unsigned int detail) {
273 cout << indent <<
"=========================================" << endl
274 << indent <<
" The " <<
name <<
": " <<
vec.size() <<
" elements" << endl
275 << indent <<
"=========================================" << endl;
277 if(thr) thr->print(indent +
" ",
detail);
278 else cout << indent <<
" " << 0 << endl;
289 cout <<
"Threshold configuration: " <<
getThresholdVector().size() <<
" thresholds" << endl;
292 cout <<
indent <<
"=========================================" << endl
294 <<
indent <<
"=========================================" << endl;
319 cout <<
"#=========================================" << endl
320 <<
"# " <<
name <<
":" << endl
321 <<
"#=========================================" << endl;
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;
366vector<TrigConf::TriggerThreshold*>
368 vector<TriggerThreshold*> v;
370 if ( thr->type() ==
type ) v.push_back(thr);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
std::vector< size_t > vec
std::pair< std::vector< unsigned int >, bool > res
CP::CorrectionCode getThreshold(Int_t &threshold, const std::string &trigger)
void printVectorSummary(const TrigConf::ThresholdConfig::thrVec_t &vec, const string &name, const string &indent, unsigned int detail)
float emIsolation() const
float hadIsolation() const
unsigned int lvl1MasterTableId() const
static const TypeConfigMap_t & typeConfigs()
static TriggerTypeConfig & typeConfig(TriggerType tt)
static const std::vector< TriggerType > & types()
static std::string & typeAsString(TriggerType tt)
unsigned int m_ctpVersion
void printTtvMap(const TriggerThreshold *thr) const
thrVec_t m_ClusterThresholdVector
int getWindow(L1DataDef::TriggerType type, int eta, int phi, int thresholdnumber) const
float getClusterHadIsolation(int eta, int phi, int thresholdnumber) const
const std::vector< TriggerThreshold * > & getThresholdVector(L1DataDef::TriggerType) const
int getJfWindow(int eta, int phi, int thresholdnumber) const
void printTtvSummary(const thrVec_t &vec, const std::string &name) const
float getTotEtThreshold(int eta, int phi, int thresholdnumber) const
float getJetThreshold(int eta, int phi, int thresholdnumber) const
void printTriggerThresholdVector(const std::string &indent="") const
int getJetWindow(int eta, int phi, int thresholdnumber) const
float getThreshold(L1DataDef::TriggerType type, int eta, int phi, int thresholdnumber) const
float getMissEtThreshold(int eta, int phi, int thresholdnumber) const
thrVec_t m_TriggerThresholdVector
thrVecMap_t m_thresholdVectors
const std::vector< TriggerThreshold * > & thresholdVector() const
TriggerThreshold * findTriggerThreshold(unsigned int id)
std::vector< TriggerThreshold * > getNimThresholdVectorByType(const std::string &type) const
bool addTriggerThreshold(TriggerThreshold *value)
float getMuonThreshold(int eta, int phi, int thresholdnumber) const
int getJbWindow(int eta, int phi, int thresholdnumber) const
virtual ~ThresholdConfig() override
float getMissEtSigThreshold(int eta, int phi, int thresholdnumber) const
std::string getClusterThresholdType(int thresholdnumber) const
virtual void print(const std::string &indent="", unsigned int detail=1) const override
bool insertInPosition(std::vector< TriggerThreshold * > &thrVec, TriggerThreshold *tt, unsigned int pos)
float getJetEtThreshold(int eta, int phi, int thresholdnumber) const
float getJfThreshold(int eta, int phi, int thresholdnumber) const
float getClusterThreshold(int eta, int phi, int thresholdnumber) const
std::vector< TriggerThreshold * > thrVec_t
const std::vector< TriggerThreshold * > & getThresholdVector() const
const std::vector< TriggerThreshold * > & thresholdVector(L1DataDef::TriggerType) const
void printThresholdValueMap() const
unsigned int l1Version() const
void attributeThresholdNumbers()
float getClusterEmIsolation(int eta, int phi, int thresholdnumber) const
float getJbThreshold(int eta, int phi, int thresholdnumber) const
float getClusterHadVeto(int eta, int phi, int thresholdnumber) const
std::ostream & indent(std::ostream &o, int lvl, int size) const
unsigned int window() const
Forward iterator to traverse the main components of the trigger configuration.