ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
BIS78_triggerSimulation Class Reference

#include <BIS78_triggerSimulation.h>

Collaboration diagram for BIS78_triggerSimulation:

Public Member Functions

 BIS78_triggerSimulation ()=default
 
 ~BIS78_triggerSimulation ()=default
 
void build_trigRawData (Muon::RpcBis78_TrigRawDataContainer *trgContainer, uint8_t dstrip_phi, uint8_t dstrip_eta, uint16_t bcid) const
 
unsigned int AddStrip (int sectoreta, int sectorphi, int igap, int mphi, int strip)
 

Private Attributes

std::vector< int > m_strip_eta [2][8][3]
 
std::vector< int > m_strip_phi [2][8][3]
 

Detailed Description

Definition at line 22 of file BIS78_triggerSimulation.h.

Constructor & Destructor Documentation

◆ BIS78_triggerSimulation()

BIS78_triggerSimulation::BIS78_triggerSimulation ( )
default

◆ ~BIS78_triggerSimulation()

BIS78_triggerSimulation::~BIS78_triggerSimulation ( )
default

Member Function Documentation

◆ AddStrip()

unsigned int BIS78_triggerSimulation::AddStrip ( int  sectoreta,
int  sectorphi,
int  igap,
int  mphi,
int  strip 
)

Definition at line 15 of file BIS78_triggerSimulation.cxx.

15  {
16  if (igap<1||igap>3) return false;
17  int side = 0;
18  if (sectoreta>0) side=1;
19  if (mphi==1){
20  m_strip_phi[side][sectorphi-1][igap-1].push_back(strip);
21  } else {
22  m_strip_eta[side][sectorphi-1][igap-1].push_back(strip);
23  }
24 
25  return 0;
26 }

◆ build_trigRawData()

void BIS78_triggerSimulation::build_trigRawData ( Muon::RpcBis78_TrigRawDataContainer trgContainer,
uint8_t  dstrip_phi,
uint8_t  dstrip_eta,
uint16_t  bcid 
) const

Definition at line 29 of file BIS78_triggerSimulation.cxx.

31 {
32 
33  uint8_t delta_strip_phi=dstrip_phi;
34  uint8_t delta_strip_eta=dstrip_eta;
35 
36  for (int i=0; i<2; i++){ // i = side (0,1)
37  for (int j=0; j<8; j++){ // j = sector-1 (0,7)
38 
39  uint16_t side=i;
40  uint16_t sector=j;
41  auto trgRawData=std::make_unique< Muon::RpcBis78_TrigRawData>(sector, side, bcid);
42 
43 
44  uint32_t trigword = 0;
45  unsigned int majority_eta=0; uint8_t position_eta=0;
46  unsigned int majority_phi=0; uint8_t position_phi=0;
47 
48  // use middle gas gap as pilot
49  // SEARCH OF PHI COINCIDENCES
50  for (unsigned int istrip1=0; istrip1<m_strip_phi[i][j][1].size(); istrip1++){
51  unsigned int majority=0;
52  for (unsigned int istrip0=0; istrip0<m_strip_phi[i][j][0].size(); istrip0++){
53  if (std::abs(m_strip_phi[i][j][1].at(istrip1)-m_strip_phi[i][j][0].at(istrip0))<=delta_strip_phi) {
54  majority=1;
55  }
56  }
57  for (unsigned int istrip2=0; istrip2<m_strip_phi[i][j][2].size(); istrip2++){
58  if (std::abs(m_strip_phi[i][j][1].at(istrip1)-m_strip_phi[i][j][2].at(istrip2))<=delta_strip_phi) {
59  if (majority>0) {
60  majority=2;
61  } else {
62  majority=1;
63  }
64  }
65  }
66  if (majority > majority_phi) {
67  majority_phi=majority;
68  position_phi=m_strip_phi[i][j][1].at(istrip1);
69  }
70  }
71  if (majority_phi==0) { // try also combination first-last
72  for (unsigned int istrip0=0; istrip0<m_strip_phi[i][j][0].size(); istrip0++){
73  for (unsigned int istrip2=0; istrip2<m_strip_phi[i][j][2].size(); istrip2++){
74  if (std::abs(m_strip_phi[i][j][2].at(istrip2)-m_strip_phi[i][j][0].at(istrip0))<=delta_strip_phi) {
75  position_phi=m_strip_phi[i][j][0].at(istrip0);
76  majority_phi=1;
77  }
78  }
79  }
80  } // end of phi loop
81  // SEARCH OF ETA COINCIDENCES
82  for (unsigned int istrip1=0; istrip1<m_strip_eta[i][j][1].size(); istrip1++){
83  unsigned int majority=0;
84  for (unsigned int istrip0=0; istrip0<m_strip_eta[i][j][0].size(); istrip0++){
85  if (std::abs(m_strip_eta[i][j][1].at(istrip1)-m_strip_eta[i][j][0].at(istrip0))<=delta_strip_eta) {
86  majority=1;
87  }
88  }
89  for (unsigned int istrip2=0; istrip2<m_strip_eta[i][j][2].size(); istrip2++){
90  if (std::abs(m_strip_eta[i][j][1].at(istrip1)-m_strip_eta[i][j][2].at(istrip2))<=delta_strip_eta) {
91  if (majority>0) {
92  majority=2;
93  } else {
94  majority=1;
95  }
96  }
97  }
98  if (majority > majority_eta) {
99  majority_eta=majority;
100  position_eta=m_strip_eta[i][j][1].at(istrip1);
101  }
102  }
103  if (majority_eta==0) { // try also combination first-last
104  for (unsigned int istrip0=0; istrip0<m_strip_eta[i][j][0].size(); istrip0++){
105  for (unsigned int istrip2=0; istrip2<m_strip_eta[i][j][2].size(); istrip2++){
106  if (std::abs(m_strip_eta[i][j][2].at(istrip2)-m_strip_eta[i][j][0].at(istrip0))<=delta_strip_eta) {
107  position_eta=m_strip_eta[i][j][0].at(istrip0);
108  majority_eta=1;
109  }
110  }
111  }
112  } // end of eta loop
113 
114 
115  // Here one has to compute the trigword for each sector
116  // Content of the 24 bits word:
117  // - eta strip index -> 6 bits
118  // - phi strip index -> 6 bits
119  // - eta strip coincidence window -> 3 bits (NOT IMPLEMENTED YET: TO BE CHECKED WITH FIRMWARE)
120  // - phi strip coincidence window -> 3 bits (NOT IMPLEMENTED YET: TO BE CHECKED WITH FIRMWARE)
121  // - 3 over 3 gaps coincidence flag for eta/phi-> 2 bits
122  // - reserved -> 4 bits
123 
124 
125  uint8_t flag3o3_eta=0;
126  uint8_t flag3o3_phi=0;
127  if (majority_eta>0&&majority_phi>0){
128  if (majority_eta>1) flag3o3_eta=1;
129  if (majority_phi>1) flag3o3_phi=1;
130 
131  // set the trigger word
132  trigword = ((position_eta & 0x3f) << 18)
133  + ((position_phi & 0x3f) << 12 )
134  + ((flag3o3_eta & 0x1) << 5 )
135  + ((flag3o3_phi & 0x1) << 4 );
136 
137  auto bis_segment= std::make_unique<Muon::RpcBis78_TrigRawDataSegment>(position_eta,position_phi,
138  delta_strip_eta,delta_strip_phi,
139  flag3o3_eta,flag3o3_phi,trigword );
140 
141  trgRawData->push_back(std::move(bis_segment));
142  trgContainer->push_back(std::move(trgRawData));
143  }
144 
145 
146  }
147  }
148 
149 }

Member Data Documentation

◆ m_strip_eta

std::vector<int> BIS78_triggerSimulation::m_strip_eta[2][8][3]
private

Definition at line 36 of file BIS78_triggerSimulation.h.

◆ m_strip_phi

std::vector<int> BIS78_triggerSimulation::m_strip_phi[2][8][3]
private

Definition at line 37 of file BIS78_triggerSimulation.h.


The documentation for this class was generated from the following files:
BIS78_triggerSimulation::m_strip_eta
std::vector< int > m_strip_eta[2][8][3]
Definition: BIS78_triggerSimulation.h:36
SiliconTech::strip
@ strip
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:558
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TRT::Hit::side
@ side
Definition: HitInfo.h:83
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
BIS78_triggerSimulation::m_strip_phi
std::vector< int > m_strip_phi[2][8][3]
Definition: BIS78_triggerSimulation.h:37