120 std::vector<TrajectorySeed> rawSeeds;
121 std::vector<float> etaOfSeed;
122 std::vector<float> phiOfSeed;
123 std::vector<int> nSegOnSeed;
151 std::cout <<
"*** Number of DT segments is: " << DTlist4.size()+DTlist3.size()+DTlist2.size()+DTlist1.size() << std::endl;
152 std::cout <<
"In MB1: " << DTlist1.size() << std::endl;
153 std::cout <<
"In MB2: " << DTlist2.size() << std::endl;
154 std::cout <<
"In MB3: " << DTlist3.size() << std::endl;
155 std::cout <<
"In MB4: " << DTlist4.size() << std::endl;
188 std::cout <<
"*** Number of CSC segments is " << CSClist4F.size()+CSClist3F.size()+CSClist2F.size()+CSClist1F.size()+CSClist0F.size()+CSClist4B.size()+CSClist3B.size()+CSClist2B.size()+CSClist1B.size()+CSClist0B.size()<< std::endl;
189 std::cout <<
"In ME11: " << CSClist0F.size()+CSClist0B.size() << std::endl;
190 std::cout <<
"In ME12: " << CSClist1F.size()+CSClist1B.size() << std::endl;
191 std::cout <<
"In ME2 : " << CSClist2F.size()+CSClist2B.size() << std::endl;
192 std::cout <<
"In ME3 : " << CSClist3F.size()+CSClist3B.size() << std::endl;
193 std::cout <<
"In ME4 : " << CSClist4F.size()+CSClist4B.size() << std::endl;
206 for (SegmentContainer::iterator it = DTlist1.begin(); it != DTlist1.end(); ++it ){
210 if (usedDTlist1[index] ==
true)
continue;
212 if ((*it)->dimension() != 4)
continue;
219 float eta_temp = gp.
eta();
220 float phi_temp = gp.
phi();
221 bool showeringBefore =
false;
225 if ( showeringBefore ) {
231 protoTrack.push_back(*it);
233 std::vector<int> layers;
234 layers.push_back(-1);
237 if (
foundMatchingSegment(3, protoTrack, DTlist2, usedDTlist2, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-2);
238 if ( showeringBefore ) NShowers++ ;
239 if (
foundMatchingSegment(3, protoTrack, DTlist3, usedDTlist3, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-3);
240 if ( showeringBefore ) NShowers++ ;
241 if (
foundMatchingSegment(3, protoTrack, DTlist4, usedDTlist4, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-4);
242 if ( showeringBefore ) NShowers++ ;
245 if (eta_temp > 0.8) {
246 if (
foundMatchingSegment(2, protoTrack, CSClist1F, usedCSClist1F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
247 if ( showeringBefore ) NShowers++ ;
248 if (
foundMatchingSegment(2, protoTrack, CSClist2F, usedCSClist2F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
249 if ( showeringBefore ) NShowers++ ;
250 if (
foundMatchingSegment(2, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
251 if ( showeringBefore ) NShowers++ ;
253 else if (eta_temp < -0.8) {
254 if (
foundMatchingSegment(2, protoTrack, CSClist1B, usedCSClist1B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
255 if ( showeringBefore ) NShowers++ ;
256 if (
foundMatchingSegment(2, protoTrack, CSClist2B, usedCSClist2B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
257 if ( showeringBefore ) NShowers++ ;
258 if (
foundMatchingSegment(2, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
259 if ( showeringBefore ) NShowers++ ;
283 if ( layers.size() < 2 ) {
286 if ( layers[ layers.size()-1] > 0 ) {
293 rawSeeds.push_back(thisSeed);
294 etaOfSeed.push_back(eta_temp);
295 phiOfSeed.push_back(phi_temp);
296 nSegOnSeed.push_back( protoTrack.size() );
299 usedDTlist1[
index] =
true;
305 for (SegmentContainer::iterator it = DTlist2.begin(); it != DTlist2.end(); ++it ){
309 if (usedDTlist2[index] ==
true)
continue;
311 if ((*it)->dimension() != 4)
continue;
318 float eta_temp = gp.
eta();
319 float phi_temp = gp.
phi();
320 bool showeringBefore =
false;
324 if ( showeringBefore ) {
330 protoTrack.push_back(*it);
332 std::vector<int> layers;
333 layers.push_back(-2);
337 if (
foundMatchingSegment(3, protoTrack, DTlist3, usedDTlist3, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-3);
338 if ( showeringBefore ) NShowers++ ;
339 if (
foundMatchingSegment(3, protoTrack, DTlist4, usedDTlist4, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-4);
340 if ( showeringBefore ) NShowers++ ;
343 if (eta_temp > 0.8) {
344 if (
foundMatchingSegment(2, protoTrack, CSClist1F, usedCSClist1F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
345 if ( showeringBefore ) NShowers++ ;
346 if (
foundMatchingSegment(2, protoTrack, CSClist2F, usedCSClist2F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
347 if ( showeringBefore ) NShowers++ ;
348 if (
foundMatchingSegment(2, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
349 if ( showeringBefore ) NShowers++ ;
351 else if (eta_temp < -0.8) {
352 if (
foundMatchingSegment(2, protoTrack, CSClist1B, usedCSClist1B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
353 if ( showeringBefore ) NShowers++ ;
354 if (
foundMatchingSegment(2, protoTrack, CSClist2B, usedCSClist2B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
355 if ( showeringBefore ) NShowers++ ;
356 if (
foundMatchingSegment(2, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
357 if ( showeringBefore ) NShowers++ ;
381 if ( layers.size() < 2 ) {
384 if ( layers[ layers.size()-1] > 0 ) {
391 rawSeeds.push_back(thisSeed);
392 etaOfSeed.push_back(eta_temp);
393 phiOfSeed.push_back(phi_temp);
394 nSegOnSeed.push_back( protoTrack.size() );
397 usedDTlist2[
index] =
true;
403 for (SegmentContainer::iterator it = DTlist3.begin(); it != DTlist3.end(); ++it ){
407 if (usedDTlist3[index] ==
true)
continue;
409 if ((*it)->dimension() != 4)
continue;
416 float eta_temp = gp.
eta();
417 float phi_temp = gp.
phi();
418 bool showeringBefore =
false;
422 if ( showeringBefore ) {
428 protoTrack.push_back(*it);
430 std::vector<int> layers;
431 layers.push_back(-3);
434 if (
foundMatchingSegment(3, protoTrack, DTlist4, usedDTlist4, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-4);
435 if ( showeringBefore ) NShowers++ ;
438 if (eta_temp > 0.8) {
439 if (
foundMatchingSegment(2, protoTrack, CSClist1F, usedCSClist1F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
440 if ( showeringBefore ) NShowers++ ;
441 if (
foundMatchingSegment(2, protoTrack, CSClist2F, usedCSClist2F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
442 if ( showeringBefore ) NShowers++ ;
443 if (
foundMatchingSegment(2, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
444 if ( showeringBefore ) NShowers++ ;
446 else if (eta_temp < -0.8) {
447 if (
foundMatchingSegment(2, protoTrack, CSClist1B, usedCSClist1B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
448 if ( showeringBefore ) NShowers++ ;
449 if (
foundMatchingSegment(2, protoTrack, CSClist2B, usedCSClist2B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
450 if ( showeringBefore ) NShowers++ ;
451 if (
foundMatchingSegment(2, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
452 if ( showeringBefore ) NShowers++ ;
475 if ( layers.size() < 2 ) {
478 if ( layers[ layers.size()-1] > 0 ) {
486 rawSeeds.push_back(thisSeed);
487 etaOfSeed.push_back(eta_temp);
488 phiOfSeed.push_back(phi_temp);
489 nSegOnSeed.push_back( protoTrack.size() );
492 usedDTlist3[
index] =
true;
504 for (SegmentContainer::iterator it = CSClist0B.begin(); it != CSClist0B.end(); ++it ){
508 if (usedCSClist0B[index] ==
true)
continue;
516 float eta_temp = gp.
eta();
517 float phi_temp = gp.
phi();
518 bool showeringBefore =
false;
522 if ( showeringBefore ) {
528 protoTrack.push_back(*it);
530 std::vector<int> layers;
534 if (
foundMatchingSegment(1, protoTrack, CSClist1B, usedCSClist1B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
535 if ( showeringBefore ) NShowers++ ;
536 if (
foundMatchingSegment(1, protoTrack, CSClist2B, usedCSClist2B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
537 if ( showeringBefore ) NShowers++ ;
538 if (
foundMatchingSegment(1, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
539 if ( showeringBefore ) NShowers++ ;
540 if (
foundMatchingSegment(1, protoTrack, CSClist4B, usedCSClist4B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
541 if ( showeringBefore ) NShowers++ ;
557 if ( layers.size() < 2 ) {
560 if ( fabs( gp.
eta() ) > 1.7 ) {
568 rawSeeds.push_back(thisSeed);
569 etaOfSeed.push_back(eta_temp);
570 phiOfSeed.push_back(phi_temp);
571 nSegOnSeed.push_back( protoTrack.size() );
574 usedCSClist0B[
index] =
true;
580 for (SegmentContainer::iterator it = CSClist1B.begin(); it != CSClist1B.end(); ++it ){
584 if (usedCSClist1B[index] ==
true)
continue;
592 float eta_temp = gp.
eta();
593 float phi_temp = gp.
phi();
594 bool showeringBefore =
false;
598 if ( showeringBefore ) {
604 protoTrack.push_back(*it);
606 std::vector<int> layers;
610 if (
foundMatchingSegment(1, protoTrack, CSClist2B, usedCSClist2B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
611 if ( showeringBefore ) NShowers++ ;
612 if (
foundMatchingSegment(1, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
613 if ( showeringBefore ) NShowers++ ;
614 if (
foundMatchingSegment(1, protoTrack, CSClist4B, usedCSClist4B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
615 if ( showeringBefore ) NShowers++ ;
629 if ( layers.size() < 2 ) {
635 rawSeeds.push_back(thisSeed);
636 etaOfSeed.push_back(eta_temp);
637 phiOfSeed.push_back(phi_temp);
638 nSegOnSeed.push_back( protoTrack.size() );
641 usedCSClist1B[
index] =
true;
648 for (SegmentContainer::iterator it = CSClist2B.begin(); it != CSClist2B.end(); ++it ){
652 if (usedCSClist2B[index] ==
true)
continue;
655 double dof =
static_cast<double>( (*it)->degreesOfFreedom() ) ;
656 if ( ((*it)->chi2()/dof) > 20000.0 )
continue;
660 float eta_temp = gp.
eta();
661 float phi_temp = gp.
phi();
662 bool showeringBefore =
false;
666 if ( showeringBefore ) {
672 protoTrack.push_back(*it);
674 std::vector<int> layers;
678 if (
foundMatchingSegment(1, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
679 if ( showeringBefore ) NShowers++ ;
680 if (
foundMatchingSegment(1, protoTrack, CSClist4B, usedCSClist4B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
681 if ( showeringBefore ) NShowers++ ;
696 if ( layers.size() < 2) {
703 rawSeeds.push_back(thisSeed);
704 etaOfSeed.push_back(eta_temp);
705 phiOfSeed.push_back(phi_temp);
706 nSegOnSeed.push_back( protoTrack.size() );
708 usedCSClist2B[
index] =
true;
713 for (SegmentContainer::iterator it = CSClist3B.begin(); it != CSClist3B.end(); ++it ){
717 if (usedCSClist3B[index] ==
true)
continue;
720 double dof =
static_cast<double>( (*it)->degreesOfFreedom() ) ;
721 if ( ((*it)->chi2()/dof) > 20000.0 )
continue;
725 float eta_temp = gp.
eta();
726 float phi_temp = gp.
phi();
727 bool showeringBefore =
false;
731 if ( showeringBefore ) {
737 protoTrack.push_back(*it);
739 std::vector<int> layers;
743 if (
foundMatchingSegment(1, protoTrack, CSClist4B, usedCSClist4B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
744 if ( showeringBefore ) NShowers++ ;
759 usedCSClist3B[
index] =
true;
761 if ( layers.size() < 2 )
continue;
765 rawSeeds.push_back(thisSeed);
766 etaOfSeed.push_back(eta_temp);
767 phiOfSeed.push_back(phi_temp);
768 nSegOnSeed.push_back( protoTrack.size() );
780 for (SegmentContainer::iterator it = CSClist0F.begin(); it != CSClist0F.end(); ++it ){
784 if (usedCSClist0F[index] ==
true)
continue;
792 float eta_temp = gp.
eta();
793 float phi_temp = gp.
phi();
794 bool showeringBefore =
false;
798 if ( showeringBefore ) {
804 protoTrack.push_back(*it);
806 std::vector<int> layers;
810 if (
foundMatchingSegment(1, protoTrack, CSClist1F, usedCSClist1F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
811 if ( showeringBefore ) NShowers++ ;
812 if (
foundMatchingSegment(1, protoTrack, CSClist2F, usedCSClist2F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
813 if ( showeringBefore ) NShowers++ ;
814 if (
foundMatchingSegment(1, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
815 if ( showeringBefore ) NShowers++ ;
816 if (
foundMatchingSegment(1, protoTrack, CSClist4F, usedCSClist4F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
817 if ( showeringBefore ) NShowers++ ;
833 if ( layers.size() < 2 ) {
836 if ( fabs( gp.
eta() ) > 1.7 ) {
843 rawSeeds.push_back(thisSeed);
844 etaOfSeed.push_back(eta_temp);
845 phiOfSeed.push_back(phi_temp);
846 nSegOnSeed.push_back( protoTrack.size() );
849 usedCSClist0F[
index] =
true;
855 for (SegmentContainer::iterator it = CSClist1F.begin(); it != CSClist1F.end(); ++it ){
859 if (usedCSClist1F[index] ==
true)
continue;
867 float eta_temp = gp.
eta();
868 float phi_temp = gp.
phi();
869 bool showeringBefore =
false;
873 if ( showeringBefore ) {
879 protoTrack.push_back(*it);
881 std::vector<int> layers;
885 if (
foundMatchingSegment(1, protoTrack, CSClist2F, usedCSClist2F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
886 if ( showeringBefore ) NShowers++ ;
887 if (
foundMatchingSegment(1, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
888 if ( showeringBefore ) NShowers++ ;
889 if (
foundMatchingSegment(1, protoTrack, CSClist4F, usedCSClist4F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
890 if ( showeringBefore ) NShowers++ ;
906 if ( layers.size() < 2) {
913 rawSeeds.push_back(thisSeed);
914 etaOfSeed.push_back(eta_temp);
915 phiOfSeed.push_back(phi_temp);
916 nSegOnSeed.push_back( protoTrack.size() );
919 usedCSClist1F[
index] =
true;
925 for (SegmentContainer::iterator it = CSClist2F.begin(); it != CSClist2F.end(); ++it ){
929 if (usedCSClist2F[index] ==
true)
continue;
932 double dof =
static_cast<double>( (*it)->degreesOfFreedom() ) ;
933 if ( ((*it)->chi2()/dof) > 20000.0 )
continue;
937 float eta_temp = gp.
eta();
938 float phi_temp = gp.
phi();
939 bool showeringBefore =
false;
943 if ( showeringBefore ) {
949 protoTrack.push_back(*it);
951 std::vector<int> layers;
955 if (
foundMatchingSegment(1, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
956 if ( showeringBefore ) NShowers++ ;
957 if (
foundMatchingSegment(1, protoTrack, CSClist4F, usedCSClist4F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
958 if ( showeringBefore ) NShowers++ ;
973 if ( layers.size() < 2) {
980 rawSeeds.push_back(thisSeed);
981 etaOfSeed.push_back(eta_temp);
982 phiOfSeed.push_back(phi_temp);
983 nSegOnSeed.push_back( protoTrack.size() );
986 usedCSClist2F[
index] =
true;
991 for (SegmentContainer::iterator it = CSClist3F.begin(); it != CSClist3F.end(); ++it ){
995 if (usedCSClist3F[index] ==
true)
continue;
998 double dof =
static_cast<double>( (*it)->degreesOfFreedom() ) ;
999 if ( ((*it)->chi2()/dof) > 20000.0 )
continue;
1003 float eta_temp = gp.
eta();
1004 float phi_temp = gp.
phi();
1005 bool showeringBefore =
false;
1009 if ( showeringBefore ) {
1015 protoTrack.push_back(*it);
1017 std::vector<int> layers;
1018 layers.push_back(2);
1021 if (
foundMatchingSegment(1, protoTrack, CSClist4F, usedCSClist4F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
1022 if ( showeringBefore ) NShowers++ ;
1037 usedCSClist3F[
index] =
true;
1039 if ( layers.size() < 2 )
continue;
1044 rawSeeds.push_back(thisSeed);
1045 etaOfSeed.push_back(eta_temp);
1046 phiOfSeed.push_back(phi_temp);
1047 nSegOnSeed.push_back( protoTrack.size() );
1057 if (
debug)
std::cout <<
"Number of seeds BEFORE " << rawSeeds.size() << std::endl;
1063 goodSeeds = theSeeds.size();
1068 if (
debug)
std::cout <<
"Number of seeds AFTER " << goodSeeds << std::endl;
1086 BoolContainer& usedSeg,
float& eta_last,
float& phi_last,
int& lastLayer,
bool& showeringBefore ) {
1089 int scanlayer = (lastLayer < 0 ) ? (lastLayer-1) : (lastLayer+1) ;
1092 showeringBefore =
true;
1103 if ( lastLayer == 0 || lastLayer == 1 ) {
1105 else { maxdPhi = 0.06; }
1110 }
else if ( type == 2 ) {
1120 else if ( lastLayer == -2 ) { maxdPhi = 0.8*
maxDeltaPhiDT; }
1126 if ( showeringBefore && maxdPhi > 0.03 ) maxdPhi = 0.03;
1128 showeringBefore =
false ;
1131 float eta_temp = eta_last;
1132 float phi_temp = phi_last;
1136 int best_match =
index;
1137 float best_R =
sqrt( (maxdEta*maxdEta) + (maxdPhi*maxdPhi) );
1138 float best_chi2 = 200;
1139 int best_dimension = 2;
1143 for (SegmentContainer::iterator it=segs.begin(); it!=segs.end(); ++it){
1150 double dh = fabs( gp2.
eta() - eta_temp );
1151 double df = fabs( gp2.
phi() - phi_temp );
1152 double dR =
sqrt( (dh*dh) + (df*df) );
1155 bool case1 = ( dh < maxdEta && df < maxdPhi ) ?
true:
false ;
1157 bool case2 = ( ((*it)->dimension()!= 4) && (dh< 0.5) && (df < maxdPhi) ) ?
true:
false ;
1158 if ( !case1 && !case2 )
continue;
1162 if ( NRechits < best_nhits )
continue;
1163 best_nhits = NRechits ;
1166 if ( (*it)->dimension() < best_dimension )
continue;
1167 best_dimension = (*it)->dimension();
1170 if ( dR > best_R )
continue;
1173 double dof =
static_cast<double>( (*it)->degreesOfFreedom() ) ;
1175 if ( (*it)->chi2()/dof < 0.001 && NRechits < 6 && type == 1)
continue;
1176 if ( (*it)->chi2()/dof > best_chi2 )
continue;
1177 best_chi2 = (*it)->chi2()/dof ;
1180 if ((*it)->dimension() != 4 ) {
1181 phi_last = phi_last;
1182 eta_last = eta_last;
1184 phi_last = gp2.
phi();
1185 eta_last = gp2.
eta();
1189 if (best_match < 0)
return ok;
1193 for (SegmentContainer::iterator it=segs.begin(); it!=segs.end(); ++it){
1195 if (index != best_match)
continue;
1196 protoTrack.push_back(*it);
1197 usedSeg[best_match] =
true;
1206 bool showering =
false ;
1210 double nChi2 = 9999. ;
1212 std::vector<int> badtag;
1214 double aveEta = 0.0;
1215 for (SegmentContainer::iterator it = segs.begin(); it != segs.end(); ++it){
1219 double dh = gp.
eta() - eta_last ;
1220 double df = gp.
phi() - phi_last ;
1221 double dR =
sqrt( (dh*dh) + (df*df) ) ;
1223 double dof =
static_cast<double>( (*it)->degreesOfFreedom() );
1224 double nX2 = (*it)->chi2() / dof ;
1227 DetId geoId = (*it)->geographicalId();
1232 badtag.push_back( index ) ;
1233 aveEta += fabs( gp.
eta() ) ;
1236 if (rh < 6 && !isDT)
continue;
1237 if (rh < 12 && isDT)
continue;
1238 if ( rh > nRhits ) {
1240 if ( nX2 > nChi2 ) continue ;
1241 if (layer != 0 && layer != 1 && layer != -1 ) {
1248 aveEta = aveEta/
static_cast<double>(nSeg) ;
1249 bool isME11A = (aveEta >= 2.1 && layer == 0) ?
true :
false ;
1250 bool isME12 = (aveEta > 1.2 && aveEta <= 1.65 && layer == 1) ?
true :
false ;
1251 bool isME11 = (aveEta > 1.65 && aveEta <= 2.1 && layer == 0) ?
true :
false ;
1252 bool is1stLayer = (layer == -1 || layer == 0 || isME12 || isME11 || isME11A) ?
true :
false ;
1254 NShoweringSegments += nSeg;
1256 if ( nSeg > 3 && !isME11A ) showering =
true ;
1257 if ( nSeg > 6 && isME11A ) showering =
true ;
1261 if (showering && !is1stLayer ) {
1262 for (std::vector<int>::iterator it = badtag.begin(); it != badtag.end(); ++it ) {
1263 usedSeg[*it] =
true;
1264 if ( (*it) != theOrigin )
continue;
1275 double dHdTheta = 0.0;
1276 double dThetadR = 0.0;
1277 double etaErr = 1.0;
1279 if (gp.
perp() != 0) {
1281 dHdTheta = ( gp.
mag()+gp.
z() )/gp.
perp();
1282 dThetadR = gp.
z() / gp.
perp2() ;
1283 etaErr = 0.25 * (dHdTheta * dThetadR) * (dHdTheta * dThetadR) * rErr ;
bool debug
group the seeds
T getParameter(std::string const &) const
double etaError(const GlobalPoint gp, double rErr)
calculate the eta error from global R error
#define case2(par1, par2)
MuonTransientTrackingRecHit::MuonRecHitContainer SegmentContainer
SegmentContainer ShoweringSegments
float maxPhiResolutionCSC
MuonSeedBuilder(const edm::ParameterSet &)
Constructor.
bool IdentifyShowering(SegmentContainer &segs, BoolContainer &usedSeg, float &eta_last, float &phi_last, int layer, int &NShoweringSegments)
identify the showering layer
int build(edm::Event &event, const edm::EventSetup &eventSetup, TrajectorySeedCollection &seeds)
Build seed collection.
bool foundMatchingSegment(int type, SegmentContainer &protoTrack, SegmentContainer &segments, BoolContainer &usedSeg, float &eta_temp, float &phi_temp, int &lastLayer, bool &showeringBefore)
Find segment which matches protoTrack for endcap only.
Geom::Phi< T > phi() const
TrajectorySeed createSeed(int type, const SegmentContainer &seg, const std::vector< int > &layers, int NShower, int NShowerSeg)
Create a seed from set of segments.
const std::vector< DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
MuonSeedCleaner * muonSeedClean_
const MagneticField * BField
edm::InputTag theCSCSegmentLabel
Name of the CSC segment collection.
std::deque< bool > BoolContainer
edm::InputTag theDTSegmentLabel
Name of the DT segment collection.
std::vector< int > ShoweringLayers
std::vector< TrajectorySeed > TrajectorySeedCollection
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
bool enableCSCMeasurement
void setBField(const MagneticField *theField)
Cache Magnetic Field for current event.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
int NRecHitsFromSegment(const TrackingRecHit &rhit)
const std::vector< DetLayer * > & backwardCSCLayers() const
return the backward (-Z) CSC DetLayers, inside-out
float maxEtaResolutionCSC
const std::vector< DetLayer * > & forwardCSCLayers() const
return the forward (+Z) CSC DetLayers, inside-out
MuonServiceProxy * theService
~MuonSeedBuilder()
Destructor.
std::vector< TrajectorySeed > seedCleaner(const edm::EventSetup &eventSetup, std::vector< TrajectorySeed > &seeds)
Cache pointer to geometry.
MuonSeedCreator * muonSeedCreate_
Create seed according to region (CSC, DT, Overlap)
const MuonDetLayerGeometry * muonLayers