ATLAS Offline Software
Loading...
Searching...
No Matches
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 12 of file TGCConnectionASDToPP.h.

Constructor & Destructor Documentation

◆ TGCConnectionASDToPP() [1/2]

◆ ~TGCConnectionASDToPP()

LVL1TGCTrigger::TGCConnectionASDToPP::~TGCConnectionASDToPP ( )

Definition at line 236 of file TGCConnectionASDToPP.cxx.

237{
238 if(m_layerId!=0) delete [] m_layerId;
239 m_layerId=0;
240 if(m_chamberId!=0) delete [] m_chamberId;
241 m_chamberId=0;
242 if(m_lineId!=0) delete [] m_lineId;
243 m_lineId=0;
244 if(m_PPId!=0) delete [] m_PPId;
245 m_PPId=0;
246 if(m_connectorId!=0) delete [] m_connectorId;
248 if(m_channelId!=0) delete [] m_channelId;
249 m_channelId=0;
250}

◆ TGCConnectionASDToPP() [2/2]

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

Definition at line 161 of file TGCConnectionASDToPP.cxx.

162{
163 m_totalNumberOfChannel = right.m_totalNumberOfChannel;
164 m_type = right.m_type;
165 m_forwardBackward = right.m_forwardBackward;
166 m_layerId = 0;
167 m_chamberId = 0;
168 m_lineId = 0;
169 m_PPId = 0;
170 m_connectorId = 0;
171 m_channelId = 0;
172
177 m_PPId = new int [m_totalNumberOfChannel];
180
181 for( int i=0; i<m_totalNumberOfChannel; i+=1){
182 m_layerId[i]=right.m_layerId[i];
183 m_chamberId[i]=right.m_chamberId[i];
184 m_lineId[i]=right.m_lineId[i];
185 m_PPId[i]=right.m_PPId[i];
186 m_connectorId[i]=right.m_connectorId[i];
187 m_channelId[i]=right.m_channelId[i];
188 }
189 }
190}

Member Function Documentation

◆ dump()

void LVL1TGCTrigger::TGCConnectionASDToPP::dump ( ) const

Definition at line 41 of file TGCConnectionASDToPP.cxx.

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

◆ 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 21 of file TGCConnectionASDToPP.cxx.

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

◆ operator=()

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

Definition at line 193 of file TGCConnectionASDToPP.cxx.

194{
195 if(this != &right) {
196 m_type = right.m_type;
197 m_forwardBackward = right.m_forwardBackward;
198
199 m_totalNumberOfChannel = right.m_totalNumberOfChannel;
200 if(m_layerId!=0) {
201 delete [] m_layerId;
202 delete [] m_chamberId;
203 delete [] m_lineId;
204 delete [] m_PPId;
205 delete [] m_connectorId;
206 delete [] m_channelId;
207 }
212 m_PPId = new int [m_totalNumberOfChannel];
215 for( int i=0; i<m_totalNumberOfChannel; i+=1){
216 m_layerId[i]=right.m_layerId[i];
217 m_chamberId[i]=right.m_chamberId[i];
218 m_lineId[i]=right.m_lineId[i];
219 m_PPId[i]=right.m_PPId[i];
220 m_connectorId[i]=right.m_connectorId[i];
221 m_channelId[i]=right.m_channelId[i];
222 }
223 }
224 }
225 return *this;
226}

◆ readData()

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

Definition at line 53 of file TGCConnectionASDToPP.cxx.

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

Member Data Documentation

◆ m_chamberId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_chamberId
private

Definition at line 31 of file TGCConnectionASDToPP.h.

◆ m_channelId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_channelId
private

Definition at line 36 of file TGCConnectionASDToPP.h.

◆ m_connectorId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_connectorId
private

Definition at line 35 of file TGCConnectionASDToPP.h.

◆ m_forwardBackward

TGCForwardBackwardType LVL1TGCTrigger::TGCConnectionASDToPP::m_forwardBackward
private

Definition at line 28 of file TGCConnectionASDToPP.h.

◆ m_layerId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_layerId
private

Definition at line 30 of file TGCConnectionASDToPP.h.

◆ m_lineId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_lineId
private

Definition at line 32 of file TGCConnectionASDToPP.h.

◆ m_PPId

int* LVL1TGCTrigger::TGCConnectionASDToPP::m_PPId
private

Definition at line 34 of file TGCConnectionASDToPP.h.

◆ m_totalNumberOfChannel

int LVL1TGCTrigger::TGCConnectionASDToPP::m_totalNumberOfChannel
private

Definition at line 26 of file TGCConnectionASDToPP.h.

◆ m_type

int LVL1TGCTrigger::TGCConnectionASDToPP::m_type
private

Definition at line 27 of file TGCConnectionASDToPP.h.

◆ s_forwardLayer

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

Definition at line 39 of file TGCConnectionASDToPP.h.

39{2, 1, 0, 4, 3, 6, 5, 8, 7};

The documentation for this class was generated from the following files: