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 13 of file TGCConnectionASDToPP.h.

Constructor & Destructor Documentation

◆ TGCConnectionASDToPP() [1/2]

◆ ~TGCConnectionASDToPP()

LVL1TGCTrigger::TGCConnectionASDToPP::~TGCConnectionASDToPP ( )

Definition at line 234 of file TGCConnectionASDToPP.cxx.

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

◆ TGCConnectionASDToPP() [2/2]

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

Definition at line 159 of file TGCConnectionASDToPP.cxx.

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

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];
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 191 of file TGCConnectionASDToPP.cxx.

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

◆ 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 //coverity[TAINTED_SCALAR]
90 //coverity[TAINTED_SCALAR]
92 //coverity[TAINTED_SCALAR]
94 //coverity[TAINTED_SCALAR]
96 //coverity[TAINTED_SCALAR]
98 //coverity[TAINTED_SCALAR]
100
101
102 //******************************************************
103 // ChamberID in kmura's def. start from 1 in T1 station.
104 int chamberIdBase=0;
105 if (region == TGCRegionType::ENDCAP && (PPType=="EWT"||PPType=="EST")) chamberIdBase=1;
106 //******************************************************
107 int lineIdBase=0;
108 // initialize array
109 //coverity[TAINTED_SCALAR]
110 for(int i=0; i<m_totalNumberOfChannel; i+=1){
111 m_layerId[i] = 0;
112 m_chamberId[i] = 0;
113 m_lineId[i] = 0;
114 m_PPId[i] = 0;
115 m_connectorId[i] = 0;
116 m_channelId[i] = 0;
117 }
118 // read lines
119 for(int i=0; i<m_totalNumberOfChannel; i+=1){
120 file.getline(buf,BufferSize);
121 std::istringstream line(buf);
122 line >> m_layerId[i] >> m_chamberId[i] >> m_lineId[i]
123 >> m_PPId[i] >> m_connectorId[i] >> m_channelId[i];
124
125 // DB is Backward
126 if(PPType=="FST"||PPType=="FSD"||PPType=="EST"||PPType=="ESD"||PPType=="FSI"||PPType=="ESI"){
127 if(forwardBackward==ForwardSector){
128 //coverity[TAINTED_SCALAR]
130 }
131 }
132
133
134 //******************************************************
135 // ChamberID in kmura's def. start from 1 in T1 station.
136 m_chamberId[i]+=chamberIdBase;
137 //******************************************************
138 //******************************************************
139 // hitID assign for each Module in kmura's def.,
140 // not for each chamber like in hasuko's def.
142 if((i!=0)&&(m_chamberId[i]!=m_chamberId[i-1])){
143 if(m_layerId[i]==m_layerId[i-1])
144 lineIdBase=m_lineId[i-1]+1;
145 else
146 lineIdBase=0;
147 }
148 m_lineId[i]+=lineIdBase;
149 }
150 //******************************************************
151 }
152 break;
153 }
154 }
155 }
156 return true;
157}
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 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

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

Definition at line 40 of file TGCConnectionASDToPP.h.

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

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