ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
LVL1CTP::ThresholdMap Class Reference

Access to TrigConf::CTPTriggerThreshold by name. More...

#include <ThresholdMap.h>

Collaboration diagram for LVL1CTP::ThresholdMap:

Public Member Functions

 ThresholdMap ()=delete
 
 ThresholdMap (const TrigConf::L1Menu *l1menu)
 
 ThresholdMap (const std::vector< TrigConf::TriggerThreshold * > &threshold_vector)
 
 ThresholdMap (const std::vector< TrigConf::TriggerThreshold * > &threshold_vector, const std::vector< TrigConf::PIT * > &pit_vector)
 
 ThresholdMap (const std::vector< TrigConf::TriggerThreshold * > &threshold_vector, const std::vector< TrigConf::TIP * > &pit_vector)
 
 ~ThresholdMap ()
 default destructor More...
 
std::vector< std::string > getThresholdNames () const
 
const CTPTriggerThresholdgetCTPThreshold (const std::string &thrName) const
 

Private Attributes

std::map< std::string, const CTPTriggerThreshold * > m_mapByName
 map storing the accosiation between threshold name and CTPTriggerThreshold More...
 

Detailed Description

Access to TrigConf::CTPTriggerThreshold by name.

Definition at line 25 of file ThresholdMap.h.

Constructor & Destructor Documentation

◆ ThresholdMap() [1/5]

LVL1CTP::ThresholdMap::ThresholdMap ( )
delete

◆ ThresholdMap() [2/5]

LVL1CTP::ThresholdMap::ThresholdMap ( const TrigConf::L1Menu l1menu)

Definition at line 10 of file ThresholdMap.cxx.

11 {
12  //unsigned int start = 0;
13  for ( auto & thr : l1menu->thresholds() ) {
14  CTPTriggerThreshold * ctpThr = new CTPTriggerThreshold(thr->name());
15  /*
16  defining the start and stop bit is much more complex now, as
17  the CTP has many more inputs and the precise mapping of the
18  inputs to the TIP vector has to be worked out
19  */
20  m_mapByName[ctpThr->name()] = ctpThr;
21  }
22 }

◆ ThresholdMap() [3/5]

LVL1CTP::ThresholdMap::ThresholdMap ( const std::vector< TrigConf::TriggerThreshold * > &  threshold_vector)

Definition at line 25 of file ThresholdMap.cxx.

26 {
27  unsigned int start = 0;
28  for ( TrigConf::TriggerThreshold* thr : threshold_vector ) {
29  CTPTriggerThreshold * ctpThr = new CTPTriggerThreshold(thr->name());
30  unsigned int end = start + abs( thr->cableStart() - thr->cableEnd() );
31  ctpThr->setStartBit( start );
32  ctpThr->setEndBit( end );
33  start = end + 1;
34  m_mapByName[thr->name()] = ctpThr;
35  }
36 }

◆ ThresholdMap() [4/5]

LVL1CTP::ThresholdMap::ThresholdMap ( const std::vector< TrigConf::TriggerThreshold * > &  threshold_vector,
const std::vector< TrigConf::PIT * > &  pit_vector 
)

Definition at line 38 of file ThresholdMap.cxx.

40 {
41  for ( TrigConf::TriggerThreshold* thr : threshold_vector ) {
42  CTPTriggerThreshold * ctpThr = new CTPTriggerThreshold(thr->name());
43  //default pit values: used if threshold doesn't have a corresponding pit bit
44  int pit_start=999;
45  int pit_end=-999;
46  for( TrigConf::PIT* pit : pit_vector ) {
47  if( pit->thresholdName() != thr->name() )
48  continue;
49  if( pit->pitNumber() < pit_start )
50  pit_start = pit->pitNumber();
51  if( pit->pitNumber() > pit_end )
52  pit_end = pit->pitNumber();
53  }
54  ctpThr->setStartBit( pit_start );
55  ctpThr->setEndBit( pit_end );
56  m_mapByName[thr->name()] = ctpThr;
57  }
58 }

◆ ThresholdMap() [5/5]

LVL1CTP::ThresholdMap::ThresholdMap ( const std::vector< TrigConf::TriggerThreshold * > &  threshold_vector,
const std::vector< TrigConf::TIP * > &  pit_vector 
)

Definition at line 61 of file ThresholdMap.cxx.

63 {
64  for ( TrigConf::TriggerThreshold* thr : threshold_vector ) {
65  CTPTriggerThreshold * ctpThr = new CTPTriggerThreshold(thr->name());
66  //default pit values: used if threshold doesn't have a corresponding pit bit
67  int tip_start=999;
68  int tip_end=-999;
69  for( TrigConf::TIP* tip : tip_vector){
70  if( tip->thresholdName() != thr->name() )
71  continue;
72  if( tip->tipNumber() < tip_start)
73  tip_start = tip->tipNumber();
74  if( tip->tipNumber() > tip_end )
75  tip_end = tip->tipNumber();
76  }
77  ctpThr->setStartBit( tip_start );
78  ctpThr->setEndBit( tip_end );
79  m_mapByName[thr->name()] = ctpThr;
80  }
81 }

◆ ~ThresholdMap()

LVL1CTP::ThresholdMap::~ThresholdMap ( )

default destructor

Definition at line 83 of file ThresholdMap.cxx.

83  {
84  for ( auto & entry : m_mapByName ) {
85  delete entry.second;
86  }
87 }

Member Function Documentation

◆ getCTPThreshold()

const LVL1CTP::CTPTriggerThreshold & LVL1CTP::ThresholdMap::getCTPThreshold ( const std::string &  thrName) const

Definition at line 100 of file ThresholdMap.cxx.

100  {
101  try {
102  return * m_mapByName.at( thrName );
103  }
104  catch(std::exception&) {
105  throw std::runtime_error("Threshold " + thrName + " not present in CTPSimulation's internal threshold map");
106  }
107 }

◆ getThresholdNames()

std::vector< std::string > LVL1CTP::ThresholdMap::getThresholdNames ( ) const

Definition at line 90 of file ThresholdMap.cxx.

90  {
91  std::vector<std::string> thrNames;
92  thrNames.reserve(m_mapByName.size());
93  for( auto & entry : m_mapByName ) {
94  thrNames.emplace_back(entry.first);
95  }
96  return thrNames;
97 }

Member Data Documentation

◆ m_mapByName

std::map< std::string, const CTPTriggerThreshold* > LVL1CTP::ThresholdMap::m_mapByName
private

map storing the accosiation between threshold name and CTPTriggerThreshold

Definition at line 53 of file ThresholdMap.h.


The documentation for this class was generated from the following files:
TrigConf::PIT
Definition: PIT.h:13
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
TrigConf::TIP
Definition: TIP.h:13
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
calibdata.exception
exception
Definition: calibdata.py:496
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
LVL1CTP::ThresholdMap::m_mapByName
std::map< std::string, const CTPTriggerThreshold * > m_mapByName
map storing the accosiation between threshold name and CTPTriggerThreshold
Definition: ThresholdMap.h:53
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
TrigConf::TriggerThreshold
Definition: TriggerThreshold.h:20