45 std::vector<QString> headerID(3), barrelID, endcapID, generalID,
46 barrelData, endcapData, generalData;
49 headerID[0]=QString(
"Barrel");
50 headerID[1]=QString(
"Endcap");
51 headerID[2]=QString(
"General");
58 std::vector<const MuonFeatureDetails*>::const_iterator itMfd;
62 int id = (*itMfd)->id();
66 int systemID = (*itMfd)->roi_system();
69 bool isL1hitThere =
false;
70 bool isL1emuOkForTriggerPlane =
false;
72 int nRPC = (*itMfd)->pad_hit_onlineId().size();
74 int nTGCMidRho = (*itMfd)->tgc_Mid_rho_N();
75 int nTGCMidPhi = (*itMfd)->tgc_Mid_phi_N();
77 float TGCMidRhoChi2 = (*itMfd)->tgc_Mid_rho_chi2();
78 float TGCMidPhiChi2 = (*itMfd)->tgc_Mid_phi_chi2();
82 float rpc1_z = (*itMfd)->rpc1_z();
83 float rpc2_z = (*itMfd)->rpc2_z();
84 const float NO_VALUE = 99999;
85 if(nRPC!=0) isL1hitThere =
true;
87 isL1emuOkForTriggerPlane =
true;
91 barrelID.push_back(
"RPC-1: Z");
94 barrelID.push_back(
"RPC-2: Z");
97 barrelID.push_back(
"RPC: nHits");
100 const float NO_VALUE = -99999;
101 if(nTGCMidRho!=0 && nTGCMidPhi!=0) isL1hitThere =
true;
102 if(fabs(TGCMidRhoChi2 - NO_VALUE) >
ZERO_LIMIT && fabs(TGCMidPhiChi2 - NO_VALUE) >
ZERO_LIMIT) isL1emuOkForTriggerPlane =
true;
105 endcapID.push_back(
"TGC Mid nHits: Rho");
108 endcapID.push_back(
"TGC Mid nHits: Phi");
111 endcapID.push_back(
"TGC Mid Chi2: Rho");
114 endcapID.push_back(
"TGC Mid Chi2: Phi");
119 std::vector<float> mdt_tube_residual = (*itMfd)->mdt_tube_residual();
120 std::vector<float> mdt_tube_r = (*itMfd)->mdt_tube_r();
121 std::vector<float> mdt_tube_z = (*itMfd)->mdt_tube_z();
124 int n_mdt_hits_inner = 0;
125 int n_mdt_hits_middle = 0;
126 int n_mdt_hits_outer = 0;
130 for(
int i_tube=0; i_tube<(
int)mdt_tube_residual.size(); i_tube++) {
132 float res = mdt_tube_residual[i_tube];
133 float r = mdt_tube_r[i_tube];
137 if (
r<650) { imr=0; }
138 else if(
r<850) { imr=1; }
144 barrelID.push_back(QString(
"muFast_MDT_Inn_residual_barrel Tube No-")+
tube);
156 barrelID.push_back(QString(
"muFast_MDT_Mid_residual_barrel Tube No-")+
tube);
168 barrelID.push_back(QString(
"muFast_MDT_Out_residual_barrel tube No-")+
tube);
180 for(
int i_tube=0; i_tube<(
int)mdt_tube_residual.size(); i_tube++) {
182 float z = mdt_tube_z[i_tube];
185 if ( fabs(
z) < 10000 ) { imr=0; }
186 else if( fabs(
z) < 15000 ) { imr=1; }
192 endcapID.push_back(QString(
"muFast_MDT_Inn_residual_endcap Tube No-")+
tube);
204 endcapID.push_back(QString(
"muFast_MDT_Mid_residual_endcap Tube No-")+
tube);
212 }
else if(imr == 2) {
215 endcapID.push_back(QString(
"muFast_MDT_Out_residual_endcap Tube No-" )+
tube);
228 bool isMDThitThereForTriggerPlane =
false;
229 bool isMDTFitOkForTriggerPlane =
false;
230 bool isMDTFitOkFor2Plane =
false;
232 int nMDT = (*itMfd)->mdt_onlineId().size();
234 float MDTInnChi2 = (*itMfd)->mdt_Inner_fit_chi();
235 float MDTMidChi2 = (*itMfd)->mdt_Middle_fit_chi();
236 float MDTOutChi2 = (*itMfd)->mdt_Outer_fit_chi();
238 const float MDT_CHI2_NO_VALUE = -99999;
240 if(n_mdt_hits_middle != 0) isMDThitThereForTriggerPlane =
true;
241 if(fabs(MDTMidChi2-MDT_CHI2_NO_VALUE) >
ZERO_LIMIT) isMDTFitOkForTriggerPlane =
true;
242 if(isMDTFitOkForTriggerPlane && (fabs(MDTInnChi2 - MDT_CHI2_NO_VALUE) >
ZERO_LIMIT || fabs(MDTOutChi2 - MDT_CHI2_NO_VALUE) >
ZERO_LIMIT) ) {
243 isMDTFitOkFor2Plane =
true;
247 int isL1hitTheret, isL1emuOkForTriggerPlanet, isMDThitTheret, isMDTFitOkForTriggerPlanet, isMDTFitOkFor2Planet;
249 if(isL1hitThere==
true) isL1hitTheret=1;
250 else isL1hitTheret=0;
252 if(isL1emuOkForTriggerPlane==
true) isL1emuOkForTriggerPlanet=1;
253 else isL1emuOkForTriggerPlanet=0;
255 if(isMDThitThereForTriggerPlane==
true) isMDThitTheret=1;
256 else isMDThitTheret=0;
258 if(isMDTFitOkForTriggerPlane==
true) isMDTFitOkForTriggerPlanet=1;
259 else isMDTFitOkForTriggerPlanet=0;
261 if(isMDTFitOkFor2Plane==
true) isMDTFitOkFor2Planet=1;
262 else isMDTFitOkFor2Planet=0;
265 generalID.push_back(
"isL1hitThere");
268 generalID.push_back(
"L1emuOkForTriggerPlane");
271 generalID.push_back(
"isMDThitThere");
274 generalID.push_back(
"FitOkForTriggerPlane");
277 generalID.push_back(
"FitOkFor2Plane");
282 barrelID.push_back(
"muFast_RPC_Pad_N" );
285 barrelID.push_back(
"muFast_MDT_Inn_fit_chi2_barrel");
288 barrelID.push_back(
"muFast_MDT_Mid_fit_chi2_barrel");
291 barrelID.push_back(
"muFast_MDT_Out_fit_chi2_barrel");
295 endcapID.push_back(
"muFast_TGC_Mid_rho_chi2");
298 endcapID.push_back(
"muFast_TGC_Mid_phi_chi2" );
301 endcapID.push_back(
"muFast_MDT_Inn_fit_chi2_endcap");
304 endcapID.push_back(
"FitOkFor2Plane");
307 endcapID.push_back(
"muFast_MDT_Out_fit_chi2_endcap");
310 endcapID.push_back(
"muFast_MDT_N_endcap");
317 if(
int(headerID.size())==3) {
318 if(
int(barrelID.size())==
int(barrelData.size()) &&
int(endcapID.size())==
int(endcapData.size()) &&
int(generalID.size())==
int(generalData.size())) {
319 if(
int(barrelData.size())!=0 ||
int(endcapData.size())!=0 ||
int(generalData.size())) {
333 log_warning(
"processitem(): No Barrel, Endcap or General data found.");
336 log_error(
"processitem(): ID-Data size matching failed!");
339 log_error(
"processitem(): incorrect headerID size!");
350 bool status = processitem();
354 m_qtrigData =
new QTreeWidgetItem(0);
355 QTreeWidgetItem* dataL2item;
356 int x_id=0, x_data=0,
diff=0, avail=0;
361 if(
int(m_trigData.size())>1 &&
int(m_trigData[0].size())!=0 &&
int(m_trigData.size())==(
int(m_trigData[0].size())*2)+1) {
364 for(
int x=1;
x<=
int(m_trigData[0].
size()); ++
x) {
367 if((x_data<
int(m_trigData.size())) && (
int(m_trigData[x_id].
size())==
int(m_trigData[x_data].
size())) && (
int(m_trigData[x_data].
size())>0)) {
369 dataL2item =
new QTreeWidgetItem(m_qtrigData);
372 dataL2item->setText(0, m_trigData[0][
x-1]);
375 QList<QTreeWidgetItem *> dataList;
376 for(
int i=0;
i<
int(m_trigData[x_id].
size()); ++
i)
377 dataList.append(
new QTreeWidgetItem((QTreeWidget*)0, QStringList(m_trigData[x_id][
i]+
sep+m_trigData[x_data][
i])));
378 dataL2item->insertChildren(0, dataList);
385 if(avail>0) m_qtrigstatus=
true;
386 else m_qtrigstatus=
false;
389 log_error(
"processQTrigItem(): L2 data not available!");
396 return m_qtrigstatus;
405 bool status = processitem();
412 return m_vtrigstatus;