42 std::vector<const Muon::MuonSegment*> sortedSegments[2][4];
45 std::vector<const Muon::MuonSegment*> DQdisqualifiedSegments[2][4];
46 std::vector<const Muon::MuonSegment*> MATCHdisqualifiedSegments[2][4];
49 std::vector<SegmTrack> matchedSegments[2];
60 for(
int jMDT=0;jMDT<4;jMDT++){
61 MATCHdisqualifiedSegments[i][jMDT] = DQdisqualifiedSegments[i][jMDT];
69 MatchMDTSegments(sortedSegments, MATCHdisqualifiedSegments, matchedSegments);
86 int TGCStationNames[8]={41, 42, 43, 44, 45, 46, 47, 48};
89 for(
int stationNameIndex=0; stationNameIndex<8; stationNameIndex++){
90 int stationName = TGCStationNames[stationNameIndex];
91 for(
int stationEta=-8; stationEta<=8; stationEta++){
92 int tgcAC(stationEta<0);
93 int absStationEta = std::abs(stationEta);
94 for(
int stationPhi=0; stationPhi<=48; stationPhi++){
97 m_TREarray[stationNameIndex][0][absStationEta][stationPhi]=
nullptr;
98 m_TREarray[stationNameIndex][1][absStationEta][stationPhi]=
nullptr;
101 m_TREarray[stationNameIndex][tgcAC][absStationEta][stationPhi]=
nullptr;
102 if(stationPhi==0)
continue;
105 if(stationNameIndex==6){
106 if(std::abs(stationEta)>1)
continue;
107 if(stationPhi>24)
continue;
109 else if(stationNameIndex==7){
110 if(std::abs(stationEta)>1)
continue;
111 if(stationPhi>21)
continue;
113 else if((stationNameIndex==0)||
114 (stationNameIndex==2)||
115 (stationNameIndex==4)){
116 if(std::abs(stationEta)>1)
continue;
117 if(stationPhi>24)
continue;
120 if(std::abs(stationEta)>5)
continue;
121 if((stationNameIndex==1)&&
122 (std::abs(stationEta)>4))
continue;
132 if(
m_TREarray[stationNameIndex][tgcAC][absStationEta][stationPhi]==
nullptr){
133 ATH_MSG_WARNING(
"prepareTREarray: TgcReadoutElement==0 passed checks" );
145 int beff, bdenom, berror;
147 for(
int i=0;i<2;i++){
149 for(
int k=0;k<2;k++){
151 for(
int e=1;e<3;e++){
158 const int nhtypes = 3;
163 for(
int h=0;
h<nhtypes;
h++){
165 histarray[
h][0]->Divide(histarray[
h][1], histarray[
h][2]);
168 int nX=histarray[
h][3]->GetNbinsX();
169 int nY=histarray[
h][3]->GetNbinsY();
170 for(
int x=1;
x<=nX;
x++){
171 for(
int y=1;
y<=nY;
y++){
172 beff =histarray[
h][0]->GetBin(
x,
y);
173 bdenom=histarray[
h][2]->GetBin(
x,
y);
174 berror=histarray[
h][3]->GetBin(
x,
y);
176 feff =histarray[
h][0]->GetBinContent(beff);
177 fdenom=histarray[
h][2]->GetBinContent(bdenom);
181 result=sqrt(feff*(1-feff)/fdenom);
183 histarray[
h][3]->SetBinContent(berror,result);
201 if(stationName==41||stationName==42){
203 ATH_MSG_WARNING(
"TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName <<
" g=" << g );
206 }
else if(stationName==43||stationName==44){
208 ATH_MSG_WARNING(
"TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName <<
" g=" << g );
212 }
else if(stationName==45||stationName==46){
214 ATH_MSG_WARNING(
"TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName <<
" g=" << g );
218 }
else if(stationName==47||stationName==48){
220 ATH_MSG_WARNING(
"TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName <<
" g=" << g );
225 ATH_MSG_WARNING(
"TGCgetlayer passed invalid stationName n=" << stationName );
234 if(l==0||l==1||l==2)
return 0;
235 else if(l==3||l==4)
return 1;
236 else if(l==5||l==6)
return 2;
237 else if(l==7||l==8)
return 3;
239 ATH_MSG_WARNING(
"TGClayer2Station passed invalid layer number:" << l );
246 if(stationName==41||stationName==42)
return 0;
247 else if(stationName==43||stationName==44)
return 1;
248 else if(stationName==45||stationName==46)
return 2;
249 else if(stationName==47||stationName==48)
return 3;
251 ATH_MSG_WARNING(
"TGCstationname2stationindex passed invalid stationName n=" << stationName );
260 if((stationFE!=0)&&(stationFE!=1))
ATH_MSG_WARNING(
"getStationMapIndex passed invalid stationFE=" << stationFE );
261 if((l<0)||(l>8))
ATH_MSG_WARNING(
"getStationMapIndex passed invalid layer index l=" << l );
262 if(stationEta<1)
ATH_MSG_WARNING(
"getStationMapIndex passed invalid stationEta=" << stationEta );
263 if(stationPhi<1)
ATH_MSG_WARNING(
"getStationMapIndex passed invalid stationPhi=" << stationPhi );
267 if(l==0||l==1||l==2){
268 if(stationEta>4)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" stationEta=" << stationEta );
269 if(stationFE==0)
index=32+l;
276 if(stationEta>5)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" stationEta=" << stationEta );
277 if(stationFE==0)
index=32+l;
281 if(stationEta==1)
index=25+l;
285 if(stationEta>5)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" stationEta=" << stationEta );
286 if(stationFE==0)
index=32+l;
290 if(stationEta==1)
index=25+l;
294 if(stationEta>1)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" stationEta=" << stationEta );
297 else if(l==8){
index=42;}
300 else if(l==8){
index=40;}
307 if(stationPhi>24)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" FE=" << stationFE <<
" stationPhi=" << stationPhi );
308 index=(stationPhi-1)*2;
311 if(stationPhi>24)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" FE=" << stationFE <<
" stationPhi=" << stationPhi );
312 index=(stationPhi-1)*2;
317 if(stationPhi>21)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" FE=" << stationFE <<
" stationPhi=" << stationPhi );
318 index=(stationPhi-1);
325 if(stationPhi>48)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" FE=" << stationFE <<
" stationPhi=" << stationPhi );
bool isValid() const
Test to see if the link can be dereferenced.
#define ATH_MSG_WARNING(x)
Header file for AthHistogramAlgorithm.
int TGCgetlayer(int stationName, int g)
void prepareTREarray(const MuonGM::MuonDetectorManager *MuonDetMgrDS)
void SortMDTSegments(const xAOD::MuonSegmentContainer *m_newsegment, std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4])
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
void tgceffcalcfinalize()
TH2 * m_eff_stationmap[2][2][4]
void MatchMDTSegments(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], std::vector< SegmTrack >(&matchedSegments)[2])
TH2 * m_eff_stationmapbase[2][2][4]
void tgceffcalc(const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
int TGClayer2stationindex(int l)
void CheckTGConTrack(std::vector< SegmTrack >(&matchedSegments)[2], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void MidstationOnlyCheck(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void DQCheckMDTSegments(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4])
TH2 * m_eff_stationmapmid[2][2][4]
int getStationMapIndex(int x, int l, int stationFE, int stationEta, int stationPhi)
const MuonGM::TgcReadoutElement * m_TREarray[8][2][9][49]
int TGCstationname2stationindex(int stationName)
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
MuonPrepDataContainerT< TgcPrepData > TgcPrepDataContainer
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".