43 std::vector<const Muon::MuonSegment*> sortedSegments[2][4];
46 std::vector<const Muon::MuonSegment*> DQdisqualifiedSegments[2][4];
47 std::vector<const Muon::MuonSegment*> MATCHdisqualifiedSegments[2][4];
50 std::vector<SegmTrack> matchedSegments[2];
61 for(
int jMDT=0;jMDT<4;jMDT++){
62 MATCHdisqualifiedSegments[i][jMDT] = DQdisqualifiedSegments[i][jMDT];
70 MatchMDTSegments(sortedSegments, MATCHdisqualifiedSegments, matchedSegments);
87 int TGCStationNames[8]={41, 42, 43, 44, 45, 46, 47, 48};
90 for(
int stationNameIndex=0; stationNameIndex<8; stationNameIndex++){
91 int stationName = TGCStationNames[stationNameIndex];
92 for(
int stationEta=-8; stationEta<=8; stationEta++){
93 int tgcAC(stationEta<0);
94 int absStationEta = std::abs(stationEta);
95 for(
int stationPhi=0; stationPhi<=48; stationPhi++){
98 m_TREarray[stationNameIndex][0][absStationEta][stationPhi]=
nullptr;
99 m_TREarray[stationNameIndex][1][absStationEta][stationPhi]=
nullptr;
102 m_TREarray[stationNameIndex][tgcAC][absStationEta][stationPhi]=
nullptr;
103 if(stationPhi==0)
continue;
106 if(stationNameIndex==6){
107 if(std::abs(stationEta)>1)
continue;
108 if(stationPhi>24)
continue;
110 else if(stationNameIndex==7){
111 if(std::abs(stationEta)>1)
continue;
112 if(stationPhi>21)
continue;
114 else if((stationNameIndex==0)||
115 (stationNameIndex==2)||
116 (stationNameIndex==4)){
117 if(std::abs(stationEta)>1)
continue;
118 if(stationPhi>24)
continue;
121 if(std::abs(stationEta)>5)
continue;
122 if((stationNameIndex==1)&&
123 (std::abs(stationEta)>4))
continue;
133 if(
m_TREarray[stationNameIndex][tgcAC][absStationEta][stationPhi]==
nullptr){
134 ATH_MSG_WARNING(
"prepareTREarray: TgcReadoutElement==0 passed checks" );
146 int beff, bdenom, berror;
148 for(
int i=0;i<2;i++){
150 for(
int k=0;k<2;k++){
152 for(
int e=1;e<3;e++){
159 const int nhtypes = 3;
164 for(
int h=0;
h<nhtypes;
h++){
166 histarray[
h][0]->Divide(histarray[
h][1], histarray[
h][2]);
169 int nX=histarray[
h][3]->GetNbinsX();
170 int nY=histarray[
h][3]->GetNbinsY();
171 for(
int x=1;
x<=nX;
x++){
172 for(
int y=1;
y<=nY;
y++){
173 beff =histarray[
h][0]->GetBin(
x,
y);
174 bdenom=histarray[
h][2]->GetBin(
x,
y);
175 berror=histarray[
h][3]->GetBin(
x,
y);
177 feff =histarray[
h][0]->GetBinContent(beff);
178 fdenom=histarray[
h][2]->GetBinContent(bdenom);
182 result=sqrt(feff*(1-feff)/fdenom);
184 histarray[
h][3]->SetBinContent(berror,
result);
202 if(stationName==41||stationName==42){
204 ATH_MSG_WARNING(
"TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName <<
" g=" << g );
207 }
else if(stationName==43||stationName==44){
209 ATH_MSG_WARNING(
"TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName <<
" g=" << g );
213 }
else if(stationName==45||stationName==46){
215 ATH_MSG_WARNING(
"TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName <<
" g=" << g );
219 }
else if(stationName==47||stationName==48){
221 ATH_MSG_WARNING(
"TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName <<
" g=" << g );
226 ATH_MSG_WARNING(
"TGCgetlayer passed invalid stationName n=" << stationName );
235 if(l==0||l==1||l==2)
return 0;
236 else if(l==3||l==4)
return 1;
237 else if(l==5||l==6)
return 2;
238 else if(l==7||l==8)
return 3;
240 ATH_MSG_WARNING(
"TGClayer2Station passed invalid layer number:" << l );
247 if(stationName==41||stationName==42)
return 0;
248 else if(stationName==43||stationName==44)
return 1;
249 else if(stationName==45||stationName==46)
return 2;
250 else if(stationName==47||stationName==48)
return 3;
252 ATH_MSG_WARNING(
"TGCstationname2stationindex passed invalid stationName n=" << stationName );
261 if((stationFE!=0)&&(stationFE!=1))
ATH_MSG_WARNING(
"getStationMapIndex passed invalid stationFE=" << stationFE );
262 if((l<0)||(l>8))
ATH_MSG_WARNING(
"getStationMapIndex passed invalid layer index l=" << l );
263 if(stationEta<1)
ATH_MSG_WARNING(
"getStationMapIndex passed invalid stationEta=" << stationEta );
264 if(stationPhi<1)
ATH_MSG_WARNING(
"getStationMapIndex passed invalid stationPhi=" << stationPhi );
268 if(l==0||l==1||l==2){
269 if(stationEta>4)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" stationEta=" << stationEta );
270 if(stationFE==0)
index=32+l;
277 if(stationEta>5)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" stationEta=" << stationEta );
278 if(stationFE==0)
index=32+l;
282 if(stationEta==1)
index=25+l;
286 if(stationEta>5)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" stationEta=" << stationEta );
287 if(stationFE==0)
index=32+l;
291 if(stationEta==1)
index=25+l;
295 if(stationEta>1)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" stationEta=" << stationEta );
298 else if(l==8){
index=42;}
301 else if(l==8){
index=40;}
308 if(stationPhi>24)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" FE=" << stationFE <<
" stationPhi=" << stationPhi );
309 index=(stationPhi-1)*2;
312 if(stationPhi>24)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" FE=" << stationFE <<
" stationPhi=" << stationPhi );
313 index=(stationPhi-1)*2;
318 if(stationPhi>21)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" FE=" << stationFE <<
" stationPhi=" << stationPhi );
319 index=(stationPhi-1);
326 if(stationPhi>48)
ATH_MSG_WARNING(
"getStationMapIndex(" <<
x <<
") passed invalid l=" << l <<
" FE=" << stationFE <<
" stationPhi=" << stationPhi );
#define ATH_MSG_WARNING(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
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".