6 #include "GaudiKernel/MsgStream.h"
53 {0., 0.5e-3, 1
e-3, 1.5e-3},
54 {0., 1
e-3, 2
e-3, 3
e-3}} );
57 declareInterface<ITrackGradeFactory>(
this );
68 std::vector<TrackGrade> myGrades;
74 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"0HitBLayer")));
79 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"Shared")));
84 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"BlaShared")));
86 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"PixShared")));
88 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"SctShared")));
95 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"0HitIn0HitNInExp2")));
97 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"0HitIn0HitNInExpIn")));
99 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"0HitIn0HitNInExpNIn")));
101 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"0HitIn0HitNIn")));
103 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"0HitInExp")));
105 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"0HitIn")));
107 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"0HitNInExp")));
109 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"0HitNIn")));
113 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"InANDNInShared")));
115 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"PixShared")));
117 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"SctShared")));
121 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"InANDNInSplit")));
123 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"PixSplit")));
132 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A01")) );
134 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A02")) );
136 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A03")) );
138 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A04")) );
140 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A05")) );
142 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A06")) );
144 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A07")) );
146 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A08")) );
148 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A14_1")) );
150 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A14_2")) );
152 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A14_3")) );
154 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"A14_4")) );
159 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B01")) );
161 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B02")) );
163 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B03")) );
165 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B04")) );
167 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B05")) );
169 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B06")) );
171 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B07")) );
173 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B08")) );
175 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B14_1")) );
177 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B14_2")) );
179 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B14_3")) );
181 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"B14_4")) );
186 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"C01")) );
188 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"C02030405")) );
190 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"C06")) );
192 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"C07")) );
194 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"C08")) );
196 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"C14_1")) );
198 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"C14_2")) );
200 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"C14_3")) );
202 myGrades.push_back(
TrackGrade(nbGrades, std::string(
"C14_4")) );
208 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"PtFrac")));
217 if (ptGradeNumber==0) {
218 ATH_MSG_ERROR(
"Vector with pt categories has 0 size!!! You need at least 1 lower cut...");
221 if (etaGradeNumber==0) {
222 ATH_MSG_ERROR(
"Vector with eta categories has 0 size!!! You need at least 1 lower cut...");
225 for (
int i=0;
i<ptGradeNumber;
i++){
226 for (
int j=0;j<etaGradeNumber;j++){
227 std::string nameGrade(
"Good");
230 if (
i<ptGradeNumber-1) {
237 if (j<etaGradeNumber-1) {
245 ATH_MSG_DEBUG(
"Adding cat. pt "<<
i<<
" eta "<<j<<
" name of Grade: "<<nameGrade);
247 myGrades.push_back(
TrackGrade(nbGrades,nameGrade));
252 myGrades.push_back(
TrackGrade(nbGrades,std::string(
"Good")));
257 return StatusCode::SUCCESS;
272 bool nohitBLayer(
false);
273 bool nohitInnermostLayer(
false);
274 bool nohitNextToInnermostLayer(
false);
275 bool exphitInnermostLayer(
false);
276 bool exphitNextToInnermostLayer(
false);
278 bool sharedClass(
false);
279 bool blasharedClass(
false);
280 bool innermostsharedClass(
false);
281 bool nexttoinnermostsharedClass(
false);
282 bool pixsharedClass(
false);
283 bool sctsharedClass(
false);
285 bool innermostsplitClass(
false);
286 bool nexttoinnermostsplitClass(
false);
287 bool pixsplitClass(
false);
289 bool pixoutlierClass(
false);
290 bool pixspoiltClass(
false);
296 int gamma_region = -1;
304 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfInnermostPixelLayerHits for TrackGrade!");
306 if (nbs==0) nohitBLayer =
true;
311 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfInnermostPixelLayerHits for TrackGrade!");
313 if (nih==0) nohitInnermostLayer =
true;
316 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerHits for TrackGrade!");
318 if (nnih==0) nohitNextToInnermostLayer =
true;
323 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve expectInnermostPixelLayerHit for TrackGrade!");
325 if (Enih>0) exphitInnermostLayer=
true;
328 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve expectNextToInnermostPixelLayerHit for TrackGrade!");
330 if (Ennih>0) exphitNextToInnermostLayer=
true;
339 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfBLayerSharedHists for TrackGrade!");
343 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfPixelSharedHists for TrackGrade!");
347 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfSCTSharedHists for TrackGrade!");
352 blasharedClass =
true;
356 pixsharedClass =
true;
360 sctsharedClass =
true;
368 uint8_t nips=0, nnips=0, nps=0, nss=0;
370 ATH_MSG_FATAL(
"#BTAG# Cannot retrieve numberOfInnermostPixelLayerSharedHits for TrackGrade!");
374 ATH_MSG_FATAL(
"#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerSharedHits for TrackGrade!");
378 ATH_MSG_FATAL(
"#BTAG# Cannot retrieve numberOfPixelSharedHits for TrackGrade!");
382 ATH_MSG_FATAL(
"#BTAG# Cannot retrieve numberOfSCTSharedHits for TrackGrade!");
390 innermostsharedClass =
true;
394 nexttoinnermostsharedClass =
true;
398 pixsharedClass =
true;
402 sctsharedClass =
true;
414 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfInnermostPixelLayerSplitHits for TrackGrade!");
418 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerSplitHits for TrackGrade!");
422 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfPixelSplitHits for TrackGrade!");
427 innermostsplitClass =
true;
431 nexttoinnermostsplitClass =
true;
435 pixsplitClass =
true;
440 double ptTrack =
track.pt();
441 double etaTrack = fabs(
track.eta());
445 double ptJet = jetMomentum.Pt();
449 std::string ptEtaCategoryName;
458 for (
int i=0;
i<ptGradeNumber;
i++){
460 if (
i<ptGradeNumber-1) {
474 for (
int i=0;
i<etaGradeNumber;
i++){
476 if (
i<etaGradeNumber-1) {
490 std::string nameGrade(
"Good");
493 if (ptBin<ptGradeNumber-1) {
500 if (
etaBin<etaGradeNumber-1) {
509 ptEtaCategoryName=nameGrade;
518 else if (sharedClass) {
553 if ( nohitInnermostLayer && nohitNextToInnermostLayer ) {
558 }
else if ( nohitInnermostLayer && !nohitNextToInnermostLayer ) {
561 }
else if ( !nohitInnermostLayer && nohitNextToInnermostLayer ) {
586 uint8_t nih, nnih, nieh, nnieh;
589 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfInnermostPixelLayerHits for TrackGrade!");
592 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfInnermostPixelLayerEndcapHits for TrackGrade!");
594 if ((nih+nieh)==0) nohitInnermostLayer =
true;
597 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerHits for TrackGrade!");
600 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerEndcapHits for TrackGrade!");
602 if ((nnih+nnieh)==0) nohitNextToInnermostLayer =
true;
608 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve expectInnermostPixelLayerHit for TrackGrade!");
610 if (Enih>0) exphitInnermostLayer=
true;
613 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve expectNextToInnermostPixelLayerHit for TrackGrade!");
615 if (Ennih>0) exphitNextToInnermostLayer=
true;
621 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfPixelSharedHists for TrackGrade!");
624 ATH_MSG_ERROR(
"#BTAG# Cannot retrieve numberOfSCTSharedHists for TrackGrade!");
630 ATH_MSG_FATAL(
"#BTAG# Cannot retrieve numberOfInnermostPixelLayerSharedHits for TrackGrade!");
633 ATH_MSG_FATAL(
"#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerSharedHits for TrackGrade!");
638 ATH_MSG_FATAL(
"#BTAG# Cannot retrieve numberOfInnermostPixelLayerOutliers for TrackGrade!");
641 ATH_MSG_FATAL(
"#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerOutliers for TrackGrade!");
643 int notot = nipo + nnipo;
647 ATH_MSG_FATAL(
"#BTAG# Cannot retrieve numberOfPixelSpoiltHits for TrackGrade!");
652 innermostsharedClass =
true;
656 nexttoinnermostsharedClass =
true;
660 pixsharedClass =
true;
664 sctsharedClass =
true;
670 pixoutlierClass =
true;
673 pixspoiltClass =
true;
677 double etaTrack = fabs(
track.eta());
678 double ptTrack =
track.pt();
679 double thetaTrack=
track.theta();
680 if (etaTrack<=1) eta_region = 0;
681 else if (etaTrack>1 && etaTrack<=2) eta_region = 1;
682 else if (etaTrack>2) eta_region = 2;
684 double gamma =1./(ptTrack*sqrt(
sin(thetaTrack)));
695 else if ( nohitInnermostLayer && !nohitNextToInnermostLayer ){
700 else if (!nohitInnermostLayer && nohitNextToInnermostLayer){
716 else if(eta_region==1){
720 else if ( nohitInnermostLayer && !nohitNextToInnermostLayer ){
725 else if (!nohitInnermostLayer && nohitNextToInnermostLayer){
741 else if(eta_region==2){
761 if (gradeToReturn==0) {
775 if (gradeToReturn==0) {