ATLAS Offline Software
TGCSSCControllerOut.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include <iostream>
7 
8 namespace LVL1TGCTrigger {
9 
10 const int TGCSSCControllerOut::s_chamber[NumberOfRegionType][LVL1TGC::kNMaxSSC]
11  = {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
12  { 0, 0, 0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4 }
13  };
14 
16  m_regionType(region)
17 {
18  for(int i=0; i<MaxNumberOfChamberInR; i++ ){
19  for(int j=0; j<MaxNumberOfPhiInSSC; j++) {
20  m_phi[i][j] =0;
21  m_dPhi[i][j] = 0;
22  m_ptPhi[i][j] =0;
23  m_hitPhi[i][j] = false;
24  }
25  }
26 
27  for (size_t i=0; i < LVL1TGC::kNMaxSSC; i++ ){
28  m_r[i] = 0;
29  m_dR[i] = 0;
30  m_ptR[i] = 0;
31  m_hitR[i] = false;
32  }
33 }
34 
35 bool TGCSSCControllerOut::hasHit(int ssc, bool ored) const
36 {
37  for(int phiposInSSC = 0; phiposInSSC < MaxNumberOfPhiInSSC; phiposInSSC++){
38  if(!ored){
39  if(m_hitR[ssc]&&m_hitPhi[getChamberNumber(ssc)][phiposInSSC]) return true;
40  } else if(hasChamberBoundary(ssc)){
41  int idx =getOredChamberNumber(ssc);
42  if( m_hitR[ssc] && (idx>=0) &&
43  m_hitPhi[idx][phiposInSSC]) return true;
44  }
45  }
46  return false;
47 }
48 
49 bool TGCSSCControllerOut::hasHit(int ssc, int phiposInSSC, bool ored) const
50 {
51  if(!ored){
52  if(m_hitR[ssc]&&m_hitPhi[getChamberNumber(ssc)][phiposInSSC]) return true;
53  } else if(hasChamberBoundary(ssc)){
54  int idx =getOredChamberNumber(ssc);
55  if( m_hitR[ssc] && (idx>=0) &&
56  m_hitPhi[idx][phiposInSSC]) return true;
57  }
58  return false;
59 }
60 
62 {
63 #ifdef TGCCOUT
64  int i,j,k;
65  std::cout<<std::endl;
66  std::cout<<"TGCSSCControllerOut::print() begin"<<std::endl;
67 
68  for( j=0; j<getNumberOfChamberInR(); j+=1)
69  for( k=0; k<MaxNumberOfPhiInSSC; k++)
70  if(m_hitPhi[j][k]) std::cout<<"#Chamber= "<< j << " Phi" << k
71  <<" phi= "<<m_phi[j][k]<<" dPhi= "<<m_dPhi[j][k]
72  <<" H/L= "<<m_ptPhi[j][k]<<std::endl;
73 
74  for( i=0; i<getNumberOfSubSectorCluster(); i+=1)
75  if(m_hitR[i]) std::cout<<"#SSC= "<<i
76  <<" r= "<<m_r[i]<<" dR= "<<m_dR[i]
77  <<" H/L= "<<m_ptR[i]<<std::endl;
78 
79  std::cout<<"TGCSSCControllerOut::print() end"<<std::endl;
80 #endif
81 }
82 
84 {
85  int i, j;
86  for( i=0; i<getNumberOfChamberInR(); i+=1)
87  for( j=0; j<MaxNumberOfPhiInSSC; j++)
88  m_hitPhi[i][j]=false;
89 
90  for( i=0; i<getNumberOfSubSectorCluster(); i+=1)
91  m_hitR[i]=false;
92 }
93 
94 
95 } //end of namespace bracket
LVL1TGCTrigger::TGCSSCControllerOut::print
void print() const
Definition: TGCSSCControllerOut.cxx:61
LVL1TGCTrigger::NumberOfRegionType
const int NumberOfRegionType
Definition: TGCNumbering.h:55
LVL1TGCTrigger::TGCSSCControllerOut::m_dR
int m_dR[LVL1TGC::kNMaxSSC]
Definition: TGCSSCControllerOut.h:65
LVL1TGCTrigger::TGCSSCControllerOut::hasHit
bool hasHit(int ssc, bool ored=false) const
Definition: TGCSSCControllerOut.cxx:35
TGCSSCControllerOut.h
LVL1TGCTrigger::TGCSSCControllerOut::m_ptR
int m_ptR[LVL1TGC::kNMaxSSC]
Definition: TGCSSCControllerOut.h:66
LVL1TGCTrigger::TGCSSCControllerOut::clear
void clear()
Definition: TGCSSCControllerOut.cxx:83
LVL1TGCTrigger::TGCSSCControllerOut::m_r
int m_r[LVL1TGC::kNMaxSSC]
Definition: TGCSSCControllerOut.h:64
LVL1TGCTrigger::TGCSSCControllerOut::hasChamberBoundary
bool hasChamberBoundary(int ssc) const
Definition: TGCSSCControllerOut.h:71
lumiFormat.i
int i
Definition: lumiFormat.py:85
LVL1TGCTrigger::TGCSSCControllerOut::m_hitPhi
bool m_hitPhi[MaxNumberOfChamberInR][MaxNumberOfPhiInSSC]
Definition: TGCSSCControllerOut.h:62
LVL1TGCTrigger::TGCSSCControllerOut::getNumberOfChamberInR
int getNumberOfChamberInR() const
Definition: TGCSSCControllerOut.h:112
LVL1TGCTrigger::TGCSSCControllerOut::getChamberNumber
int getChamberNumber(int ssc) const
Definition: TGCSSCControllerOut.h:106
LVL1TGCTrigger
Definition: LVL1TGCTrigger.cxx:47
LVL1TGCTrigger::TGCSSCControllerOut::TGCSSCControllerOut
TGCSSCControllerOut(TGCRegionType region=TGCRegionType::ENDCAP)
Definition: TGCSSCControllerOut.cxx:15
LVL1TGCTrigger::TGCSSCControllerOut::getNumberOfSubSectorCluster
int getNumberOfSubSectorCluster() const
Definition: TGCSSCControllerOut.h:118
LVL1TGCTrigger::TGCSSCControllerOut::s_chamber
static const int s_chamber[NumberOfRegionType][LVL1TGC::kNMaxSSC]
Definition: TGCSSCControllerOut.h:55
LVL1TGCTrigger::TGCSSCControllerOut::getOredChamberNumber
int getOredChamberNumber(int ssc) const
Definition: TGCSSCControllerOut.h:93
LVL1TGCTrigger::TGCSSCControllerOut::m_hitR
bool m_hitR[LVL1TGC::kNMaxSSC]
Definition: TGCSSCControllerOut.h:67
LVL1TGCTrigger::TGCRegionType
TGCRegionType
Definition: TGCNumbering.h:49
LVL1TGCTrigger::TGCSSCControllerOut::MaxNumberOfChamberInR
@ MaxNumberOfChamberInR
Definition: TGCSSCControllerOut.h:16
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
LVL1TGCTrigger::TGCSSCControllerOut::MaxNumberOfPhiInSSC
@ MaxNumberOfPhiInSSC
Definition: TGCSSCControllerOut.h:15
LVL1TGCTrigger::TGCSSCControllerOut::m_ptPhi
int m_ptPhi[MaxNumberOfChamberInR][MaxNumberOfPhiInSSC]
Definition: TGCSSCControllerOut.h:61
LVL1TGCTrigger::TGCSSCControllerOut::m_dPhi
int m_dPhi[MaxNumberOfChamberInR][MaxNumberOfPhiInSSC]
Definition: TGCSSCControllerOut.h:60
fitman.k
k
Definition: fitman.py:528
LVL1TGCTrigger::TGCSSCControllerOut::m_phi
int m_phi[MaxNumberOfChamberInR][MaxNumberOfPhiInSSC]
Definition: TGCSSCControllerOut.h:59