ATLAS Offline Software
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
LVL1TGCTrigger::TGCConnectionASDToPP Class Reference

#include <TGCConnectionASDToPP.h>

Collaboration diagram for LVL1TGCTrigger::TGCConnectionASDToPP:

Public Member Functions

int getConnection (const int sideId, const int layer, const int chamber, const int line, int *pp, int *connector, int *channel) const
 
bool readData (TGCRegionType region, int type, TGCForwardBackwardType forward)
 
void dump () const
 
 TGCConnectionASDToPP ()
 
 ~TGCConnectionASDToPP ()
 
 TGCConnectionASDToPP (const TGCConnectionASDToPP &right)
 
TGCConnectionASDToPPoperator= (const TGCConnectionASDToPP &right)
 

Private Attributes

int m_totalNumberOfChannel
 
int m_type
 
TGCForwardBackwardType m_forwardBackward
 
int * m_layerId
 
int * m_chamberId
 
int * m_lineId
 
int * m_PPId
 
int * m_connectorId
 
int * m_channelId
 

Static Private Attributes

static constexpr int s_forwardLayer [] = {2, 1, 0, 4, 3, 6, 5, 8, 7}
 

Detailed Description

Definition at line 13 of file TGCConnectionASDToPP.h.

Constructor & Destructor Documentation

◆ TGCConnectionASDToPP() [1/2]

LVL1TGCTrigger::TGCConnectionASDToPP::TGCConnectionASDToPP ( )

Definition at line 219 of file TGCConnectionASDToPP.cxx.

219  :
221  m_layerId(0),m_chamberId(0),m_lineId(0),
223 {
224 }

◆ ~TGCConnectionASDToPP()

LVL1TGCTrigger::TGCConnectionASDToPP::~TGCConnectionASDToPP ( )

Definition at line 227 of file TGCConnectionASDToPP.cxx.

228 {
229  if(m_layerId!=0) delete [] m_layerId;
230  m_layerId=0;
231  if(m_chamberId!=0) delete [] m_chamberId;
232  m_chamberId=0;
233  if(m_lineId!=0) delete [] m_lineId;
234  m_lineId=0;
235  if(m_PPId!=0) delete [] m_PPId;
236  m_PPId=0;
237  if(m_connectorId!=0) delete [] m_connectorId;
238  m_connectorId=0;
239  if(m_channelId!=0) delete [] m_channelId;
240  m_channelId=0;
241 }

◆ TGCConnectionASDToPP() [2/2]

LVL1TGCTrigger::TGCConnectionASDToPP::TGCConnectionASDToPP ( const TGCConnectionASDToPP right)

Definition at line 152 of file TGCConnectionASDToPP.cxx.

153 {
154  m_totalNumberOfChannel = right.m_totalNumberOfChannel;
155  m_type = right.m_type;
156  m_forwardBackward = right.m_forwardBackward;
157  m_layerId = 0;
158  m_chamberId = 0;
159  m_lineId = 0;
160  m_PPId = 0;
161  m_connectorId = 0;
162  m_channelId = 0;
163 
164  if(m_totalNumberOfChannel!=0){
165  m_layerId = new int [m_totalNumberOfChannel];
167  m_lineId = new int [m_totalNumberOfChannel];
168  m_PPId = new int [m_totalNumberOfChannel];
171 
172  for( int i=0; i<m_totalNumberOfChannel; i+=1){
173  m_layerId[i]=right.m_layerId[i];
174  m_chamberId[i]=right.m_chamberId[i];
175  m_lineId[i]=right.m_lineId[i];
176  m_PPId[i]=right.m_PPId[i];
177  m_connectorId[i]=right.m_connectorId[i];
178  m_channelId[i]=right.m_channelId[i];
179  }
180  }
181 }

Member Function Documentation

◆ dump()

void LVL1TGCTrigger::TGCConnectionASDToPP::dump ( ) const

Definition at line 40 of file TGCConnectionASDToPP.cxx.

41 {
42 #ifdef TGCCOUT
43  int i;
44  std::cout << "TGCConnectionASDToPP::dump "<<m_totalNumberOfChannel<< std::endl;
45  std::cout << "layerId chamberID line(WIRE) PPID ConnectorID" << std::endl;
46  for( i=0; i<m_totalNumberOfChannel; i+=1)
47  std::cout<<m_layerId[i]<<" "<<m_chamberId[i]<<" "<<m_lineId[i]<<" "<<m_PPId[i]<<" "<<m_connectorId[i]<<" "<<m_channelId[i]<< std::endl;
48 #endif
49 }

◆ getConnection()

int LVL1TGCTrigger::TGCConnectionASDToPP::getConnection ( const int  sideId,
const int  layer,
const int  chamber,
const int  line,
int *  pp,
int *  connector,
int *  channel 
) const

Definition at line 20 of file TGCConnectionASDToPP.cxx.

22 {
23  int i;
24  for( i=0; i<m_totalNumberOfChannel; i+=1){
25  // wiregroupID assign in ASDOut and ASD2PP.db are different.
26  if((m_layerId[i]==layer)&&(m_chamberId[i]==chamber)&&(m_lineId[i]==line)){
27  // if((m_layerId[i]==layer)&&(m_lineId[i]==line)){
28  *pp = m_PPId[i];
29  *connector = m_connectorId[i];
30  *channel = m_channelId[i];
31  return 0;
32  }
33  }
34  *pp=-2;
35  *connector=-2;
36  *channel=-2;
37  return -1;
38 }

◆ operator=()

TGCConnectionASDToPP & LVL1TGCTrigger::TGCConnectionASDToPP::operator= ( const TGCConnectionASDToPP right)

Definition at line 184 of file TGCConnectionASDToPP.cxx.

185 {
186  if(this != &right) {
187  m_type = right.m_type;
188  m_forwardBackward = right.m_forwardBackward;
189 
190  m_totalNumberOfChannel = right.m_totalNumberOfChannel;
191  if(m_layerId!=0) {
192  delete [] m_layerId;
193  delete [] m_chamberId;
194  delete [] m_lineId;
195  delete [] m_PPId;
196  delete [] m_connectorId;
197  delete [] m_channelId;
198  }
199  if(m_totalNumberOfChannel!=0){
200  m_layerId = new int [m_totalNumberOfChannel];
202  m_lineId = new int [m_totalNumberOfChannel];
203  m_PPId = new int [m_totalNumberOfChannel];
206  for( int i=0; i<m_totalNumberOfChannel; i+=1){
207  m_layerId[i]=right.m_layerId[i];
208  m_chamberId[i]=right.m_chamberId[i];
209  m_lineId[i]=right.m_lineId[i];
210  m_PPId[i]=right.m_PPId[i];
211  m_connectorId[i]=right.m_connectorId[i];
212  m_channelId[i]=right.m_channelId[i];
213  }
214  }
215  }
216  return *this;
217 }

◆ readData()

bool LVL1TGCTrigger::TGCConnectionASDToPP::readData ( TGCRegionType  region,
int  type,
TGCForwardBackwardType  forward 
)

Definition at line 52 of file TGCConnectionASDToPP.cxx.

54 {
55  this->m_type = type;
56  this->m_forwardBackward = forwardBackward;
57 
58  enum { BufferSize = 1024 };
59  char buf[BufferSize];
60 
61  std::string fn, fullName ;
62 // fn = "ASD2PP.db" ;
64 
66  if( fullName.length() == 0 )
67  fullName = PathResolver::find_file(fn, "DATAPATH");
68  std::ifstream file(fullName.c_str() ,std::ios::in);
69  if (!file) return false;
70 
71  std::string PPType;
72  while(file.getline(buf,BufferSize)){
73  if((buf[0]=='E')||(buf[0]=='F')){
74 
75  std::istringstream line(buf);
76  int nChannel;
77  line >> PPType >> nChannel;
78  // find a entry matches in region and Patch Panel m_type.
79  if(((region == TGCRegionType::ENDCAP) &&
80  ( (PPType=="EWT"&&m_type==TGCSector::WTPP)||(PPType=="EWD"&&m_type==TGCSector::WDPP)
81  ||(PPType=="EST"&&m_type==TGCSector::STPP)||(PPType=="ESD"&&m_type==TGCSector::SDPP)
82  ||(PPType=="EWI"&&m_type==TGCSector::WIPP)||(PPType=="ESI"&&m_type==TGCSector::SIPP) ) )||
83  ((region == TGCRegionType::FORWARD) &&
84  ( (PPType=="FWT"&&m_type==TGCSector::WTPP)||(PPType=="FWD"&&m_type==TGCSector::WDPP)
85  ||(PPType=="FST"&&m_type==TGCSector::STPP)||(PPType=="FSD"&&m_type==TGCSector::SDPP)
86  ||(PPType=="FWI"&&m_type==TGCSector::WIPP)||(PPType=="FSI"&&m_type==TGCSector::SIPP) ) ) ){
88 
89  m_layerId = new int [m_totalNumberOfChannel];
91  m_lineId = new int [m_totalNumberOfChannel];
92  m_PPId = new int [m_totalNumberOfChannel];
95 
96 
97  //******************************************************
98  // ChamberID in kmura's def. start from 1 in T1 station.
99  int chamberIdBase=0;
100  if (region == TGCRegionType::ENDCAP && (PPType=="EWT"||PPType=="EST")) chamberIdBase=1;
101  //******************************************************
102  int lineIdBase=0;
103  // initialize array
104  for(int i=0; i<m_totalNumberOfChannel; i+=1){
105  m_layerId[i] = 0;
106  m_chamberId[i] = 0;
107  m_lineId[i] = 0;
108  m_PPId[i] = 0;
109  m_connectorId[i] = 0;
110  m_channelId[i] = 0;
111  }
112  // read lines
113  for(int i=0; i<m_totalNumberOfChannel; i+=1){
114  file.getline(buf,BufferSize);
115  std::istringstream line(buf);
116  line >> m_layerId[i] >> m_chamberId[i] >> m_lineId[i]
117  >> m_PPId[i] >> m_connectorId[i] >> m_channelId[i];
118 
119  // DB is Backward
120  if(PPType=="FST"||PPType=="FSD"||PPType=="EST"||PPType=="ESD"||PPType=="FSI"||PPType=="ESI"){
121  if(forwardBackward==ForwardSector){
123  }
124  }
125 
126 
127  //******************************************************
128  // ChamberID in kmura's def. start from 1 in T1 station.
129  m_chamberId[i]+=chamberIdBase;
130  //******************************************************
131  //******************************************************
132  // hitID assign for each Module in kmura's def.,
133  // not for each chamber like in hasuko's def.
135  if((i!=0)&&(m_chamberId[i]!=m_chamberId[i-1])){
136  if(m_layerId[i]==m_layerId[i-1])
137  lineIdBase=m_lineId[i-1]+1;
138  else
139  lineIdBase=0;
140  }
141  m_lineId[i]+=lineIdBase;
142  }
143  //******************************************************
144  }
145  break;
146  }
147  }
148  }
149  return true;
150 }

Member Data Documentation

◆ m_chamberId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_chamberId
private

Definition at line 32 of file TGCConnectionASDToPP.h.

◆ m_channelId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_channelId
private

Definition at line 37 of file TGCConnectionASDToPP.h.

◆ m_connectorId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_connectorId
private

Definition at line 36 of file TGCConnectionASDToPP.h.

◆ m_forwardBackward

TGCForwardBackwardType LVL1TGCTrigger::TGCConnectionASDToPP::m_forwardBackward
private

Definition at line 29 of file TGCConnectionASDToPP.h.

◆ m_layerId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_layerId
private

Definition at line 31 of file TGCConnectionASDToPP.h.

◆ m_lineId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_lineId
private

Definition at line 33 of file TGCConnectionASDToPP.h.

◆ m_PPId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_PPId
private

Definition at line 35 of file TGCConnectionASDToPP.h.

◆ m_totalNumberOfChannel

int LVL1TGCTrigger::TGCConnectionASDToPP::m_totalNumberOfChannel
private

Definition at line 27 of file TGCConnectionASDToPP.h.

◆ m_type

int LVL1TGCTrigger::TGCConnectionASDToPP::m_type
private

Definition at line 28 of file TGCConnectionASDToPP.h.

◆ s_forwardLayer

constexpr int LVL1TGCTrigger::TGCConnectionASDToPP::s_forwardLayer[] = {2, 1, 0, 4, 3, 6, 5, 8, 7}
staticconstexprprivate

Definition at line 40 of file TGCConnectionASDToPP.h.


The documentation for this class was generated from the following files:
LVL1TGCTrigger::TGCRegionType::ENDCAP
@ ENDCAP
LVL1TGCTrigger::TGCSector::STPP
@ STPP
Definition: TGCSector.h:36
checkFileSG.line
line
Definition: checkFileSG.py:75
StateLessPT_NewConfig.BufferSize
BufferSize
Definition: StateLessPT_NewConfig.py:370
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
LVL1TGCTrigger::TGCConnectionASDToPP::m_lineId
int * m_lineId
Definition: TGCConnectionASDToPP.h:33
calibdata.chamber
chamber
Definition: calibdata.py:32
WriteCellNoiseToCool.fullName
fullName
Definition: WriteCellNoiseToCool.py:461
LVL1TGCTrigger::TGCSector::WTPP
@ WTPP
Definition: TGCSector.h:36
CaloCondBlobAlgs_fillNoiseFromASCII.nChannel
nChannel
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:91
LVL1TGCTrigger::TGCConnectionASDToPP::m_channelId
int * m_channelId
Definition: TGCConnectionASDToPP.h:37
LVL1TGCTrigger::TGCRegionType::FORWARD
@ FORWARD
LVL1TGCTrigger::TGCConnectionASDToPP::m_type
int m_type
Definition: TGCConnectionASDToPP.h:28
LVL1TGCTrigger::TGCConnectionASDToPP::m_forwardBackward
TGCForwardBackwardType m_forwardBackward
Definition: TGCConnectionASDToPP.h:29
LVL1TGCTrigger::TGCSector::WDPP
@ WDPP
Definition: TGCSector.h:36
LVL1TGCTrigger::TGCConnectionASDToPP::m_connectorId
int * m_connectorId
Definition: TGCConnectionASDToPP.h:36
LVL1TGCTrigger::TGCSector::SIPP
@ SIPP
Definition: TGCSector.h:36
LVL1TGCTrigger::TGCDatabaseManager::getFilename
static std::string getFilename(int type)
Definition: TGCDatabaseManager.cxx:239
python.getCurrentFolderTag.fn
fn
Definition: getCurrentFolderTag.py:65
LVL1TGCTrigger::TGCConnectionASDToPP::m_chamberId
int * m_chamberId
Definition: TGCConnectionASDToPP.h:32
lumiFormat.i
int i
Definition: lumiFormat.py:85
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
file
TFile * file
Definition: tile_monitor.h:29
LVL1TGCTrigger::TGCSector::WIPP
@ WIPP
Definition: TGCSector.h:36
LVL1TGCTrigger::TGCConnectionASDToPP::s_forwardLayer
static constexpr int s_forwardLayer[]
Definition: TGCConnectionASDToPP.h:40
LVL1TGCTrigger::TGCSector::SDPP
@ SDPP
Definition: TGCSector.h:36
LVL1TGCTrigger::TGCConnectionASDToPP::m_layerId
int * m_layerId
Definition: TGCConnectionASDToPP.h:31
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1TGCTrigger::TGCConnectionASDToPP::m_PPId
int * m_PPId
Definition: TGCConnectionASDToPP.h:35
LVL1TGCTrigger::TGCConnectionASDToPP::m_totalNumberOfChannel
int m_totalNumberOfChannel
Definition: TGCConnectionASDToPP.h:27
LVL1TGCTrigger::ForwardSector
@ ForwardSector
Definition: TGCNumbering.h:59