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

Initial version of the stgc pad trigger logic. More...

#include <L1TdrStgcTriggerLogic.h>

Inheritance diagram for NSWL1::L1TdrStgcTriggerLogic:
Collaboration diagram for NSWL1::L1TdrStgcTriggerLogic:

Public Member Functions

 L1TdrStgcTriggerLogic ()
 
std::vector< SectorTriggerCandidatebuildSectorTriggers (const std::vector< std::shared_ptr< PadOfflineData >> &pads, const std::pair< double, double > &Zratio) const
 main function to compute trigger candidates More...
 
std::vector< size_t > removeRandomPadIndices (const std::vector< size_t > &padIndices) const
 simulate efficiency by dropping random pads (their indices) More...
 
std::array< std::string_view, 10 > sTGC_triggerPatternsEtaUp () const
 trigger patterns that will be stored in the lookup table More...
 
std::array< std::string_view, 10 > sTGC_triggerPatternsEtaDown () const
 
std::array< std::string_view, 16 > sTGC_triggerPatternsPhiUp () const
 
std::array< std::string_view, 16 > sTGC_triggerPatternsPhiDown () const
 
std::array< std::string_view, 10 > sTGC_triggerPatternsPhiDownUp () const
 
std::array< std::string_view, 10 > sTGC_triggerPatternsPhiUpDown () const
 
bool hitPattern (const std::shared_ptr< PadOfflineData > &firstPad, const std::shared_ptr< PadOfflineData > &otherPad, std::string &pattern) const
 
bool hitPattern (const int iEta0, const int iPhi0, const int iEta1, const int iPhi1, std::string &pattern) const
 
std::vector< SingleWedgePadTriggerbuildSingleWedgeTriggers (const std::vector< std::shared_ptr< PadOfflineData >> &pads, const std::vector< size_t > &padIndicesLayer0, const std::vector< size_t > &padIndicesLayer1, const std::vector< size_t > &padIndicesLayer2, const std::vector< size_t > &padIndicesLayer3, bool isLayer1, bool isLayer2, bool isLayer3, bool isLayer4) const
 
std::vector< SingleWedgePadTriggerbuild34swt (const std::vector< std::shared_ptr< PadOfflineData >> &pads, const std::vector< size_t > &padIndicesLayer0, const std::vector< size_t > &padIndicesLayer1, const std::vector< size_t > &padIndicesLayer2, const std::vector< size_t > &padIndicesLayer3) const
 
std::vector< SingleWedgePadTriggerbuild44swt (const std::vector< std::shared_ptr< PadOfflineData >> &pads, const std::vector< size_t > &padIndicesLayer0, const std::vector< size_t > &padIndicesLayer1, const std::vector< size_t > &padIndicesLayer2, const std::vector< size_t > &padIndicesLayer3) const
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Member Functions

std::vector< size_t > filterByLayer (const std::vector< std::shared_ptr< PadOfflineData >> &pads, const std::vector< size_t > &padSelectedIndices, int layer) const
 
std::vector< size_t > filterByMultiplet (const std::vector< std::shared_ptr< PadOfflineData >> &pads, const std::vector< size_t > &padSelectedIndices, int multiplet) const
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Initial version of the stgc pad trigger logic.

This class contains the trigger logic for the stgc pads as implemented for the NSW TDR (CERN-LHCC-2013-006, https://cds.cern.ch/record/1552862). In particular, the naming convention and the trigger logic are described in ATL-MUON-INT-2014-003 https://cds.cern.ch/record/1694727.

This class requires the input data to be formatted as a vector<PadOfflineData>, and it provides as output a vector<SectorTriggerCandidate>.

Imported from svn+ssh://svn.cern.ch/reps/atlasusr/ataffard/UpgradeNSW/NSWAna/NSWNtuple/trunk , this class is in TrigT1NSWSimTools mainly meant to provide a reference. Note that all the 'legacy' code from the TDR study is in the 'nsw' namespace. (newer 'official' code is in the 'NSWL1' namespace).

Todo:
add unit test

Based on the original implementation by Shikma, sTGCTriggerLogic.

david.nosp@m.e.ge.nosp@m.rbaud.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om April 2013

Updates for release 22 processing: franc.nosp@m.esco.nosp@m..gius.nosp@m.eppe.nosp@m..grav.nosp@m.ili@.nosp@m.cern..nosp@m.ch

Definition at line 47 of file L1TdrStgcTriggerLogic.h.

Constructor & Destructor Documentation

◆ L1TdrStgcTriggerLogic()

NSWL1::L1TdrStgcTriggerLogic::L1TdrStgcTriggerLogic ( )

Definition at line 23 of file L1TdrStgcTriggerLogic.cxx.

23  :
24  AthMessaging(Athena::getMessageSvc(), "L1TdrStgcTriggerLogic") {}

Member Function Documentation

◆ build34swt()

std::vector< SingleWedgePadTrigger > NSWL1::L1TdrStgcTriggerLogic::build34swt ( const std::vector< std::shared_ptr< PadOfflineData >> &  pads,
const std::vector< size_t > &  padIndicesLayer0,
const std::vector< size_t > &  padIndicesLayer1,
const std::vector< size_t > &  padIndicesLayer2,
const std::vector< size_t > &  padIndicesLayer3 
) const

Definition at line 289 of file L1TdrStgcTriggerLogic.cxx.

293  {
294 
295  std::vector< SingleWedgePadTrigger > trigNoL0(buildSingleWedgeTriggers(pads, iL0, iL1, iL2, iL3, false,true, true, true));
296  std::vector< SingleWedgePadTrigger > trigNoL1(buildSingleWedgeTriggers(pads, iL0, iL1, iL2, iL3, true,false, true, true));
297  std::vector< SingleWedgePadTrigger > trigNoL2(buildSingleWedgeTriggers(pads, iL0, iL1, iL2, iL3, true,true, false, true));
298  std::vector< SingleWedgePadTrigger > trigNoL3(buildSingleWedgeTriggers(pads, iL0, iL1, iL2, iL3, true,true, true, false));
299  std::vector< SingleWedgePadTrigger > triggers;
300  triggers.insert(triggers.end(), trigNoL0.begin(), trigNoL0.end());
301  triggers.insert(triggers.end(), trigNoL1.begin(), trigNoL1.end());
302  triggers.insert(triggers.end(), trigNoL2.begin(), trigNoL2.end());
303  triggers.insert(triggers.end(), trigNoL3.begin(), trigNoL3.end());
304  return triggers;
305  }

◆ build44swt()

std::vector< SingleWedgePadTrigger > NSWL1::L1TdrStgcTriggerLogic::build44swt ( const std::vector< std::shared_ptr< PadOfflineData >> &  pads,
const std::vector< size_t > &  padIndicesLayer0,
const std::vector< size_t > &  padIndicesLayer1,
const std::vector< size_t > &  padIndicesLayer2,
const std::vector< size_t > &  padIndicesLayer3 
) const

Definition at line 306 of file L1TdrStgcTriggerLogic.cxx.

310  {
311  return buildSingleWedgeTriggers(pads, iL0, iL1, iL2, iL3, true, true, true,true);
312  }

◆ buildSectorTriggers()

std::vector< SectorTriggerCandidate > NSWL1::L1TdrStgcTriggerLogic::buildSectorTriggers ( const std::vector< std::shared_ptr< PadOfflineData >> &  pads,
const std::pair< double, double > &  Zratio 
) const

main function to compute trigger candidates

  • pads all active pads in this event
  • padIndicesThisSector indices of pads that should be considered to compute the triggers for this sector (i.e. after filtering by side+sector and eventually applying the efficiency)

Definition at line 342 of file L1TdrStgcTriggerLogic.cxx.

342  {
343 
344  std::vector<SectorTriggerCandidate> secTrigCand;
345 
346  std::vector< size_t > indicesSecN(pads.size());
347  std::iota(indicesSecN.begin(),indicesSecN.end(),0);
348  const int innerMultiplet(1), outerMultiplet(2);
349  std::vector< size_t > indicesInner = filterByMultiplet(pads, indicesSecN, innerMultiplet);
350  std::vector< size_t > indicesOuter = filterByMultiplet(pads, indicesSecN, outerMultiplet);
351  std::vector< size_t > idxesI1(filterByLayer(pads, indicesInner, STGC_LAYER_1));
352  std::vector< size_t > idxesI2(filterByLayer(pads, indicesInner, STGC_LAYER_2));
353  std::vector< size_t > idxesI3(filterByLayer(pads, indicesInner, STGC_LAYER_3));
354  std::vector< size_t > idxesI4(filterByLayer(pads, indicesInner, STGC_LAYER_4));
355  std::vector< size_t > idxesO1(filterByLayer(pads, indicesOuter, STGC_LAYER_1));
356  std::vector< size_t > idxesO2(filterByLayer(pads, indicesOuter, STGC_LAYER_2));
357  std::vector< size_t > idxesO3(filterByLayer(pads, indicesOuter, STGC_LAYER_3));
358  std::vector< size_t > idxesO4(filterByLayer(pads, indicesOuter, STGC_LAYER_4));
359  std::vector< SingleWedgePadTrigger > i4of4trig(build44swt(pads, idxesI1, idxesI2, idxesI3, idxesI4));
360  std::vector< SingleWedgePadTrigger > i3of4trig(build34swt(pads, idxesI1, idxesI2, idxesI3, idxesI4));
361  std::vector< SingleWedgePadTrigger > o4of4trig(build44swt(pads, idxesO1, idxesO2, idxesO3, idxesO4));
362  std::vector< SingleWedgePadTrigger > o3of4trig(build34swt(pads, idxesO1, idxesO2, idxesO3, idxesO4));
363 
364  remove3of4Redundant4of4(i4of4trig, i3of4trig);
365  remove3of4Redundant4of4(o4of4trig, o3of4trig);
366 
367  ATH_MSG_DEBUG("SingleWedge triggers :"
368  << " inner : " << i3of4trig.size() << "(3/4) " << i4of4trig.size()
369  << "(4/4)"
370  << " outer : " << o3of4trig.size() << "(3/4) " << o4of4trig.size()
371  << "(4/4)" );
372 
373  std::vector< SingleWedgePadTrigger > innerTrigs, outerTrigs; // merge 4/4 and 3/4
374  innerTrigs.insert(innerTrigs.end(), i3of4trig.begin(), i3of4trig.end());
375  innerTrigs.insert(innerTrigs.end(), i4of4trig.begin(), i4of4trig.end());
376  outerTrigs.insert(outerTrigs.end(), o3of4trig.begin(), o3of4trig.end());
377  outerTrigs.insert(outerTrigs.end(), o4of4trig.begin(), o4of4trig.end());
378  bool acceptSingleWedgeInTransition = true;
379 
380  for (auto& it : innerTrigs) {
381  for (auto& ot: outerTrigs) {
382  // Inner-Outer matching based on area
385 
386  float Z1=ot.pads().at(0)->m_cornerXyz[1][2];
387  float Z0=it.pads().at(0)->m_cornerXyz[1][2];
388 
389  Polygon inoutovl=largestIntersection(innerArea,Project(outerArea,Z1,Z0));
390 
391  float overlap=area(inoutovl);
392 
393  if (overlap >0) {
394  ATH_MSG_DEBUG("OVERLAP "<<overlap<<" Inner "<<area(innerArea)<<" Outer "<<area(outerArea));
395  secTrigCand.emplace_back(it.setCombined(), ot.setCombined());
396  }
397  } // end for(ot)
398  } // end for(it)
399  //***** Transition Region *****
400 
401  if (acceptSingleWedgeInTransition) {
402  for ( auto& it : innerTrigs){
403  if (it.alreadyCombined()){
404  ATH_MSG_DEBUG("Inner SingleWedge trigger already combined, skipping");
405  continue;
406  }
407  else if ((it.is4outOf4Layers()||it.is3outOf4Layers()) && it.isInTransitionRegion(Zratio)){
408  secTrigCand.emplace_back(it.setCombined());
409  }
410  }
411  for ( auto& ot : outerTrigs) {
412  if (ot.alreadyCombined()){
413  ATH_MSG_DEBUG("Outer SingleWedge trigger already combined, skipping");
414  continue;
415  }
416  else if ((ot.is4outOf4Layers()||ot.is3outOf4Layers()) && ot.isInTransitionRegion(Zratio)){
417  secTrigCand.emplace_back(ot.setCombined());
418  }
419  }
420  } // end if(acceptSingleWedgeInTransition)
421 
422  if (msgLvl(MSG::DEBUG)) {
423  ATH_MSG_DEBUG("found " << secTrigCand.size() << " triggerCandidates from "<< pads.size() << " pads");
424  for (const auto& tc : secTrigCand) ATH_MSG_DEBUG("trigger region area : " << area(tc.triggerRegion3()));
425  }
426  return secTrigCand;
427  }

◆ buildSingleWedgeTriggers()

std::vector< SingleWedgePadTrigger > NSWL1::L1TdrStgcTriggerLogic::buildSingleWedgeTriggers ( const std::vector< std::shared_ptr< PadOfflineData >> &  pads,
const std::vector< size_t > &  padIndicesLayer0,
const std::vector< size_t > &  padIndicesLayer1,
const std::vector< size_t > &  padIndicesLayer2,
const std::vector< size_t > &  padIndicesLayer3,
bool  isLayer1,
bool  isLayer2,
bool  isLayer3,
bool  isLayer4 
) const

Definition at line 57 of file L1TdrStgcTriggerLogic.cxx.

61  {
62 
63  std::vector< SingleWedgePadTrigger > triggers;
64  size_t nHL1 = (isLayer1 ? padIndicesLayer0.size() : 1);
65  size_t nHL2 = (isLayer2 ? padIndicesLayer1.size() : 1);
66  size_t nHL3 = (isLayer3 ? padIndicesLayer2.size() : 1);
67  size_t nHL4 = (isLayer4 ? padIndicesLayer3.size() : 1);
68 
69  if (isLayer1 && nHL1 == 0)
70  return triggers;
71  if (isLayer2 && nHL2 == 0)
72  return triggers;
73  if (isLayer3 && nHL3 == 0)
74  return triggers;
75  if (isLayer4 && nHL4 == 0)
76  return triggers;
77 
78  const std::array<std::string_view, 10> PatternsEtaUp = sTGC_triggerPatternsEtaUp();
79  const std::array<std::string_view, 10> PatternsEtaDown = sTGC_triggerPatternsEtaDown();
80  const std::array<std::string_view, 16> PatternsPhiUp = sTGC_triggerPatternsPhiUp();
81  const std::array<std::string_view, 16> PatternsPhiDown = sTGC_triggerPatternsPhiDown();
82  const std::array<std::string_view, 10> PatternsPhiDownUp = sTGC_triggerPatternsPhiDownUp();
83  const std::array<std::string_view, 10> PatternsPhiUpDown = sTGC_triggerPatternsPhiUpDown();
84 
85  int iL1st = -1;
86  for (size_t il1 = 0; il1 < nHL1; il1++) {
87  int l1Idx = -1;
88  std::string sl1("33");
89  if (isLayer1) {
90  l1Idx = padIndicesLayer0.at(il1);
91  sl1 = "11";
92  iL1st = l1Idx;
93  }
94  for (size_t il2 = 0; il2 < nHL2; il2++) {
95  int l2Idx = -1;
96  std::string sl2("33");
97  if (isLayer2) {
98  l2Idx = padIndicesLayer1.at(il2);
99  if (iL1st == -1) {
100  sl2 = "11";
101  iL1st = l2Idx;
102  } // l1 was not considered, l2 gets the first indices
103  else if (!hitPattern(pads.at(iL1st), pads.at(l2Idx), sl2))
104  continue;
105  }
106 
107  for (size_t il3 = 0; il3 < nHL3; il3++) {
108  int l3Idx = -1;
109  std::string sl3("33");
110  if (isLayer3) {
111  l3Idx = padIndicesLayer2.at(il3);
112  if (!hitPattern(pads.at(iL1st), pads.at(l3Idx), sl3))
113  continue;
114  }
115  for (size_t il4 = 0; il4 < nHL4; il4++) {
116  int l4Idx = -1;
117  std::string sl4("33");
118  if (isLayer4) {
119  l4Idx = padIndicesLayer3.at(il4);
120  if (!hitPattern(pads.at(iL1st), pads.at(l4Idx), sl4))
121  continue;
122  }
123 
124  std::string pattern(sl4 + sl3 + sl2 + sl1);
125  // the above line is replaced by a normal order l1,l2,l3,l4 and
126  // separated in phi and eta but it remains the same for later usage in
127  // the trigger selection
128  // Hence the following is only for internal ease of calculation. The
129  // pattern to be passed is the "pattern" not "patternPhi" or
130  // "patternEta"
131  std::string patternPhi;
132  patternPhi.push_back(sl1.at(1));
133  patternPhi.push_back(sl2.at(1));
134  patternPhi.push_back(sl3.at(1));
135  patternPhi.push_back(sl4.at(1));
136 
137  std::string patternEta;
138  patternEta.push_back(sl1.at(0));
139  patternEta.push_back(sl2.at(0));
140  patternEta.push_back(sl3.at(0));
141  patternEta.push_back(sl4.at(0));
142 
143  int multipletid=-999;
144  int moduleid=-999;
145  int sectortype=-999;
146  //Please mind the indentation
147  if (sl1 == "11") {
148  multipletid = pads.at(l1Idx)->multipletId() ;
149  moduleid = pads.at(l1Idx)->moduleId();
150  sectortype = pads.at(l1Idx)->sectorType();
151  }
152  else if (sl2 == "11") {
153  multipletid = pads.at(l2Idx)->multipletId() ;
154  moduleid = pads.at(l2Idx)->moduleId();
155  sectortype = pads.at(l2Idx)->sectorType();
156  }
157  else continue;
158  std::string etamove, phimove;
159  if (sectortype == 1) {
160  if (multipletid == 1) {
161  etamove = "D";
162  phimove = "U";
163  if (moduleid == 2) {
164  etamove = "U";
165  phimove = "U";
166  }
167  }
168  else{ // multiplet = 2 15-7-18 YR - Confirm new geometry
169  etamove = "U";
170  phimove = "DU";
171  }
172  }
173 
174  if (sectortype == 0) {
175  if (multipletid == 1) { // 15-7-18 YR - Confirm new geometry
176  if (moduleid == 1) {
177  etamove = "U";
178  phimove = "DU";
179  }
180  if (moduleid == 2) {
181  etamove = "D";
182  phimove = "UD";
183  }
184  if (moduleid == 3) {
185  etamove = "U";
186  phimove = "UD";
187  }
188  }
189  else { // multiplet = 2
190  if (moduleid == 1) {
191  etamove = "U";
192  phimove = "D";
193  }
194  else{
195  etamove = "U";
196  phimove = "U";
197  }
198  }
199  }
200 
201  if (etamove == "D") {
202  if (find(PatternsEtaDown.begin(), PatternsEtaDown.end(),
203  patternEta) == PatternsEtaDown.end()) {
204  continue;
205  }
206  }
207 
208  if (etamove == "U") {
209  if (find(PatternsEtaUp.begin(), PatternsEtaUp.end(),
210  patternEta) == PatternsEtaUp.end()) {
211  continue;
212  }
213  }
214 
215  if (phimove == "U") {
216  if (find(PatternsPhiUp.begin(), PatternsPhiUp.end(),
217  patternPhi) == PatternsPhiUp.end()) {
218  continue;
219  }
220  }
221 
222  if (phimove == "D") {
223  if (find(PatternsPhiDown.begin(), PatternsPhiDown.end(),
224  patternPhi) == PatternsPhiDown.end()) {
225  continue;
226  }
227  }
228 
229  if (phimove == "UD") {
230  if (find(PatternsPhiUpDown.begin(), PatternsPhiUpDown.end(),
231  patternPhi) == PatternsPhiUpDown.end()) {
232  continue;
233  }
234  }
235 
236  if (phimove == "DU") {
237  if (find(PatternsPhiDownUp.begin(), PatternsPhiDownUp.end(),
238  patternPhi) == PatternsPhiDownUp.end()) {
239  continue;
240  }
241  }
242 
243  std::vector< size_t > padIndices;
244 
245  if (isLayer1) {
246  assert(l1Idx > -1);
247  padIndices.push_back(l1Idx);
248  }
249  if (isLayer2) {
250  assert(l2Idx > -1);
251  padIndices.push_back(l2Idx);
252  }
253 
254  if (isLayer3) {
255  assert(l3Idx > -1);
256  padIndices.push_back(l3Idx);
257  }
258 
259  if (isLayer4) {
260  assert(l4Idx > -1);
261  padIndices.push_back(l4Idx);
262  }
263 
264  triggers.push_back(SingleWedgePadTrigger(pattern, pads, padIndices));
265 
266  if (triggers.size() > 4) {
267  return triggers;
268  }
269  }
270  }
271  }
272  }
273 
274  return triggers;
275  }

◆ filterByLayer()

std::vector< size_t > NSWL1::L1TdrStgcTriggerLogic::filterByLayer ( const std::vector< std::shared_ptr< PadOfflineData >> &  pads,
const std::vector< size_t > &  padSelectedIndices,
int  layer 
) const
private

Definition at line 470 of file L1TdrStgcTriggerLogic.cxx.

473  {
474  std::vector<size_t> indices;
475  for(size_t i=0; i<padSelectedIndices.size(); i++){
476  const size_t idx=padSelectedIndices[i];
477  if(layer==pads[idx]->gasGapId()) indices.push_back(idx);
478  }
479  return indices;
480  }

◆ filterByMultiplet()

std::vector< size_t > NSWL1::L1TdrStgcTriggerLogic::filterByMultiplet ( const std::vector< std::shared_ptr< PadOfflineData >> &  pads,
const std::vector< size_t > &  padSelectedIndices,
int  multiplet 
) const
private

Definition at line 482 of file L1TdrStgcTriggerLogic.cxx.

485  {
486  std::vector<size_t> indices;
487  for(size_t i=0; i<padSelectedIndices.size(); i++){
488  const size_t idx=padSelectedIndices[i];
489  if(multiplet==pads[idx]->multipletId()) indices.push_back(idx);
490  }
491  return indices;
492  }

◆ hitPattern() [1/2]

bool NSWL1::L1TdrStgcTriggerLogic::hitPattern ( const int  iEta0,
const int  iPhi0,
const int  iEta1,
const int  iPhi1,
std::string &  pattern 
) const

Definition at line 32 of file L1TdrStgcTriggerLogic.cxx.

32  {
33  pattern = "33";
34  if (iEta1 >= iEta0 + 2 || iEta1 <= iEta0 - 2)
35  return false;
36  if (iPhi1 >= iPhi0 + 2 || iPhi1 <= iPhi0 - 2)
37  return false;
38  // DeltaEta
39  if (iEta1 == iEta0 - 1)
40  pattern = "0";
41  else if (iEta1 == iEta0)
42  pattern = "1";
43  else if (iEta1 == iEta0 + 1)
44  pattern = "2";
45  // DeltaPhi
46  if (iPhi1 == iPhi0 - 1)
47  pattern.append("0");
48  else if (iPhi1 == iPhi0)
49  pattern.append("1");
50  else if (iPhi1 == iPhi0 + 1)
51  pattern.append("2");
52 
53  return true;
54  }

◆ hitPattern() [2/2]

bool NSWL1::L1TdrStgcTriggerLogic::hitPattern ( const std::shared_ptr< PadOfflineData > &  firstPad,
const std::shared_ptr< PadOfflineData > &  otherPad,
std::string &  pattern 
) const

Definition at line 27 of file L1TdrStgcTriggerLogic.cxx.

28  {
29  return L1TdrStgcTriggerLogic::hitPattern(firstPad->padEtaId(), firstPad->padPhiId(), otherPad->padEtaId(), otherPad->padPhiId(), pattern);
30  }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ removeRandomPadIndices()

std::vector< size_t > NSWL1::L1TdrStgcTriggerLogic::removeRandomPadIndices ( const std::vector< size_t > &  padIndices) const

simulate efficiency by dropping random pads (their indices)

Definition at line 278 of file L1TdrStgcTriggerLogic.cxx.

278  {
279  std::vector< size_t > out;
280  TRandom rand;
281  out.reserve(padIndices.size());
282  for (size_t i = 0; i < padIndices.size(); ++i) {
283  if (rand.Uniform(1) < padTimingEfficiency)
284  out.push_back(padIndices.at(i));
285  }
286  return out;
287  }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ sTGC_triggerPatternsEtaDown()

std::array< std::string_view, 10 > NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsEtaDown ( ) const

Definition at line 441 of file L1TdrStgcTriggerLogic.cxx.

441  {
442  constexpr static std::array<std::string_view, 10> patterns = {"1111", "1100", "3111", "3100", "1311", "1300", "1131", "1130", "1113", "1103"};
443  return patterns;
444  }

◆ sTGC_triggerPatternsEtaUp()

std::array< std::string_view, 10 > NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsEtaUp ( ) const

trigger patterns that will be stored in the lookup table

The trigger 3 out of 4 masks using the following translation from Daniel ....

These are the original patterns we got in 2013 from D.Lellouch. They are probably obsolete and they should be updated

Todo:
update trigger patterns

feaaa8 R: .+-+ -+-+ Phi: .–+ -+-+ Best R/Phi: 2/1 (out of 4) 2013/02/10 now calculating per wedge

Definition at line 436 of file L1TdrStgcTriggerLogic.cxx.

436  {
437  constexpr static std::array<std::string_view, 10> patterns = {"1111", "1122", "3111", "3122", "1311", "1322", "1131", "1132", "1113", "1123"};
438  return patterns;
439  }

◆ sTGC_triggerPatternsPhiDown()

std::array< std::string_view, 16 > NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsPhiDown ( ) const

Definition at line 452 of file L1TdrStgcTriggerLogic.cxx.

452  {
453  constexpr static std::array<std::string_view, 16> patterns = {"1111", "1110", "1100", "1000", "1113", "1103", "1003", "1131", "1130", "1230",
454  "1311", "1310", "1300", "3111", "3110", "3100"};
455  return patterns;
456  }

◆ sTGC_triggerPatternsPhiDownUp()

std::array< std::string_view, 10 > NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsPhiDownUp ( ) const

Definition at line 463 of file L1TdrStgcTriggerLogic.cxx.

463  {
464  constexpr static std::array<std::string_view, 10> patterns = {"1111", "1010", "1113", "1013", "1131", "1030", "1311", "1310", "3111", "3121"};
465  return patterns;
466  }

◆ sTGC_triggerPatternsPhiUp()

std::array< std::string_view, 16 > NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsPhiUp ( ) const

Definition at line 446 of file L1TdrStgcTriggerLogic.cxx.

446  {
447  constexpr static std::array<std::string_view, 16> patterns = {"1111", "1112", "1122", "1222", "1113", "1123", "1223", "1131", "1132", "1232",
448  "1311", "1312", "1322", "3111", "3112", "3122"};
449  return patterns;
450  }

◆ sTGC_triggerPatternsPhiUpDown()

std::array< std::string_view, 10 > NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsPhiUpDown ( ) const

Definition at line 458 of file L1TdrStgcTriggerLogic.cxx.

458  {
459  constexpr static std::array<std::string_view, 10> patterns = {"1111", "1212", "1113", "1213", "1131", "1232", "1311", "1312", "3111", "3101"};
460  return patterns;
461  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.


The documentation for this class was generated from the following files:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
NSWL1::L1TdrStgcTriggerLogic::build44swt
std::vector< SingleWedgePadTrigger > build44swt(const std::vector< std::shared_ptr< PadOfflineData >> &pads, const std::vector< size_t > &padIndicesLayer0, const std::vector< size_t > &padIndicesLayer1, const std::vector< size_t > &padIndicesLayer2, const std::vector< size_t > &padIndicesLayer3) const
Definition: L1TdrStgcTriggerLogic.cxx:306
NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsPhiUp
std::array< std::string_view, 16 > sTGC_triggerPatternsPhiUp() const
Definition: L1TdrStgcTriggerLogic.cxx:446
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
NSWL1::L1TdrStgcTriggerLogic::buildSingleWedgeTriggers
std::vector< SingleWedgePadTrigger > buildSingleWedgeTriggers(const std::vector< std::shared_ptr< PadOfflineData >> &pads, const std::vector< size_t > &padIndicesLayer0, const std::vector< size_t > &padIndicesLayer1, const std::vector< size_t > &padIndicesLayer2, const std::vector< size_t > &padIndicesLayer3, bool isLayer1, bool isLayer2, bool isLayer3, bool isLayer4) const
Definition: L1TdrStgcTriggerLogic.cxx:57
patterns
std::vector< std::string > patterns
Definition: listroot.cxx:187
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
NSWL1::STGC_LAYER_3
const int STGC_LAYER_3
Definition: tdr_compat_enum.h:14
ReadFromCoolCompare.ot
ot
Definition: ReadFromCoolCompare.py:229
NSWL1::Polygon
boost::geometry::model::polygon< Vertex > Polygon
Definition: GeoUtils.h:18
skel.it
it
Definition: skel.GENtoEVGEN.py:396
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsPhiDown
std::array< std::string_view, 16 > sTGC_triggerPatternsPhiDown() const
Definition: L1TdrStgcTriggerLogic.cxx:452
NSWL1::largestIntersection
Polygon largestIntersection(const Polygon &p1, const Polygon &p2)
Definition: GeoUtils.cxx:80
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
NSWL1::L1TdrStgcTriggerLogic::build34swt
std::vector< SingleWedgePadTrigger > build34swt(const std::vector< std::shared_ptr< PadOfflineData >> &pads, const std::vector< size_t > &padIndicesLayer0, const std::vector< size_t > &padIndicesLayer1, const std::vector< size_t > &padIndicesLayer2, const std::vector< size_t > &padIndicesLayer3) const
Definition: L1TdrStgcTriggerLogic.cxx:289
NSWL1::Project
Polygon Project(const Polygon &p, float Zinit, float Zfin)
Definition: GeoUtils.cxx:19
Trk::Z0
@ Z0
Definition: ParameterType.h:18
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsPhiDownUp
std::array< std::string_view, 10 > sTGC_triggerPatternsPhiDownUp() const
Definition: L1TdrStgcTriggerLogic.cxx:463
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
NSWL1::area
float area(const Polygon &p)
Definition: GeoUtils.cxx:55
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
AthMessaging::msgLvl
bool msgLvl(const MSG::Level lvl) const
Test the output level.
Definition: AthMessaging.h:151
LArG4FSStartPointFilter.rand
rand
Definition: LArG4FSStartPointFilter.py:80
lumiFormat.i
int i
Definition: lumiFormat.py:85
NSWL1::STGC_LAYER_4
const int STGC_LAYER_4
Definition: tdr_compat_enum.h:14
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsEtaUp
std::array< std::string_view, 10 > sTGC_triggerPatternsEtaUp() const
trigger patterns that will be stored in the lookup table
Definition: L1TdrStgcTriggerLogic.cxx:436
NSWL1::remove3of4Redundant4of4
void remove3of4Redundant4of4(const std::vector< SingleWedgePadTrigger > &trigs4of4, std::vector< SingleWedgePadTrigger > &trigs3of4)
Definition: L1TdrStgcTriggerLogic.cxx:336
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
NSWL1::L1TdrStgcTriggerLogic::hitPattern
bool hitPattern(const std::shared_ptr< PadOfflineData > &firstPad, const std::shared_ptr< PadOfflineData > &otherPad, std::string &pattern) const
Definition: L1TdrStgcTriggerLogic.cxx:27
NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsEtaDown
std::array< std::string_view, 10 > sTGC_triggerPatternsEtaDown() const
Definition: L1TdrStgcTriggerLogic.cxx:441
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
DEBUG
#define DEBUG
Definition: page_access.h:11
NSWL1::L1TdrStgcTriggerLogic::filterByMultiplet
std::vector< size_t > filterByMultiplet(const std::vector< std::shared_ptr< PadOfflineData >> &pads, const std::vector< size_t > &padSelectedIndices, int multiplet) const
Definition: L1TdrStgcTriggerLogic.cxx:482
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
NSWL1::STGC_LAYER_2
const int STGC_LAYER_2
Definition: tdr_compat_enum.h:14
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
NSWL1::SingleWedgePadTrigger::padOverlap3
static Polygon padOverlap3(const std::vector< std::shared_ptr< PadOfflineData >> &pads)
area that is overlapping between the pads that cause the trigger (pads are staggered)
Definition: SingleWedgePadTrigger.cxx:113
NSWL1::L1TdrStgcTriggerLogic::sTGC_triggerPatternsPhiUpDown
std::array< std::string_view, 10 > sTGC_triggerPatternsPhiUpDown() const
Definition: L1TdrStgcTriggerLogic.cxx:458
NSWL1::STGC_LAYER_1
const int STGC_LAYER_1
Definition: tdr_compat_enum.h:14
NSWL1::L1TdrStgcTriggerLogic::filterByLayer
std::vector< size_t > filterByLayer(const std::vector< std::shared_ptr< PadOfflineData >> &pads, const std::vector< size_t > &padSelectedIndices, int layer) const
Definition: L1TdrStgcTriggerLogic.cxx:470