95 enableDTMeasurement,enableCSCMeasurement,
false);
128 std::vector<TrajectorySeed> rawSeeds;
129 std::vector<float> etaOfSeed;
130 std::vector<float> phiOfSeed;
131 std::vector<int> nSegOnSeed;
156 std::cout <<
"*** Number of DT segments is: " << DTlist4.size()+DTlist3.size()+DTlist2.size()+DTlist1.size() << std::endl;
157 std::cout <<
"In MB1: " << DTlist1.size() << std::endl;
158 std::cout <<
"In MB2: " << DTlist2.size() << std::endl;
159 std::cout <<
"In MB3: " << DTlist3.size() << std::endl;
160 std::cout <<
"In MB4: " << DTlist4.size() << std::endl;
193 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;
194 std::cout <<
"In ME11: " << CSClist0F.size()+CSClist0B.size() << std::endl;
195 std::cout <<
"In ME12: " << CSClist1F.size()+CSClist1B.size() << std::endl;
196 std::cout <<
"In ME2 : " << CSClist2F.size()+CSClist2B.size() << std::endl;
197 std::cout <<
"In ME3 : " << CSClist3F.size()+CSClist3B.size() << std::endl;
198 std::cout <<
"In ME4 : " << CSClist4F.size()+CSClist4B.size() << std::endl;
211 for (SegmentContainer::iterator it = DTlist1.begin(); it != DTlist1.end(); ++it ){
215 if (usedDTlist1[index] ==
true)
continue;
217 if ((*it)->dimension() != 4)
continue;
224 float eta_temp = gp.
eta();
225 float phi_temp = gp.
phi();
226 bool showeringBefore =
false;
230 if ( showeringBefore ) {
236 protoTrack.push_back(*it);
239 layers.push_back(-1);
242 if (
foundMatchingSegment(3, protoTrack, DTlist2, usedDTlist2, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-2);
243 if ( showeringBefore ) NShowers++ ;
244 if (
foundMatchingSegment(3, protoTrack, DTlist3, usedDTlist3, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-3);
245 if ( showeringBefore ) NShowers++ ;
246 if (
foundMatchingSegment(3, protoTrack, DTlist4, usedDTlist4, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-4);
247 if ( showeringBefore ) NShowers++ ;
250 if (eta_temp > 0.8) {
251 if (
foundMatchingSegment(2, protoTrack, CSClist1F, usedCSClist1F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
252 if ( showeringBefore ) NShowers++ ;
253 if (
foundMatchingSegment(2, protoTrack, CSClist2F, usedCSClist2F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
254 if ( showeringBefore ) NShowers++ ;
255 if (
foundMatchingSegment(2, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
256 if ( showeringBefore ) NShowers++ ;
258 else if (eta_temp < -0.8) {
259 if (
foundMatchingSegment(2, protoTrack, CSClist1B, usedCSClist1B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
260 if ( showeringBefore ) NShowers++ ;
261 if (
foundMatchingSegment(2, protoTrack, CSClist2B, usedCSClist2B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
262 if ( showeringBefore ) NShowers++ ;
263 if (
foundMatchingSegment(2, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
264 if ( showeringBefore ) NShowers++ ;
288 if ( layers.size() < 2 ) {
291 if ( layers[ layers.size()-1] > 0 ) {
298 rawSeeds.push_back(thisSeed);
299 etaOfSeed.push_back(eta_temp);
300 phiOfSeed.push_back(phi_temp);
301 nSegOnSeed.push_back( protoTrack.size() );
304 usedDTlist1[
index] =
true;
310 for (SegmentContainer::iterator it = DTlist2.begin(); it != DTlist2.end(); ++it ){
314 if (usedDTlist2[index] ==
true)
continue;
316 if ((*it)->dimension() != 4)
continue;
323 float eta_temp = gp.
eta();
324 float phi_temp = gp.
phi();
325 bool showeringBefore =
false;
329 if ( showeringBefore ) {
335 protoTrack.push_back(*it);
338 layers.push_back(-2);
342 if (
foundMatchingSegment(3, protoTrack, DTlist3, usedDTlist3, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-3);
343 if ( showeringBefore ) NShowers++ ;
344 if (
foundMatchingSegment(3, protoTrack, DTlist4, usedDTlist4, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-4);
345 if ( showeringBefore ) NShowers++ ;
348 if (eta_temp > 0.8) {
349 if (
foundMatchingSegment(2, protoTrack, CSClist1F, usedCSClist1F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
350 if ( showeringBefore ) NShowers++ ;
351 if (
foundMatchingSegment(2, protoTrack, CSClist2F, usedCSClist2F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
352 if ( showeringBefore ) NShowers++ ;
353 if (
foundMatchingSegment(2, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
354 if ( showeringBefore ) NShowers++ ;
356 else if (eta_temp < -0.8) {
357 if (
foundMatchingSegment(2, protoTrack, CSClist1B, usedCSClist1B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
358 if ( showeringBefore ) NShowers++ ;
359 if (
foundMatchingSegment(2, protoTrack, CSClist2B, usedCSClist2B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
360 if ( showeringBefore ) NShowers++ ;
361 if (
foundMatchingSegment(2, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
362 if ( showeringBefore ) NShowers++ ;
386 if ( layers.size() < 2 ) {
389 if ( layers[ layers.size()-1] > 0 ) {
396 rawSeeds.push_back(thisSeed);
397 etaOfSeed.push_back(eta_temp);
398 phiOfSeed.push_back(phi_temp);
399 nSegOnSeed.push_back( protoTrack.size() );
402 usedDTlist2[
index] =
true;
408 for (SegmentContainer::iterator it = DTlist3.begin(); it != DTlist3.end(); ++it ){
412 if (usedDTlist3[index] ==
true)
continue;
414 if ((*it)->dimension() != 4)
continue;
421 float eta_temp = gp.
eta();
422 float phi_temp = gp.
phi();
423 bool showeringBefore =
false;
427 if ( showeringBefore ) {
433 protoTrack.push_back(*it);
436 layers.push_back(-3);
439 if (
foundMatchingSegment(3, protoTrack, DTlist4, usedDTlist4, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(-4);
440 if ( showeringBefore ) NShowers++ ;
443 if (eta_temp > 0.8) {
444 if (
foundMatchingSegment(2, protoTrack, CSClist1F, usedCSClist1F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
445 if ( showeringBefore ) NShowers++ ;
446 if (
foundMatchingSegment(2, protoTrack, CSClist2F, usedCSClist2F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
447 if ( showeringBefore ) NShowers++ ;
448 if (
foundMatchingSegment(2, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
449 if ( showeringBefore ) NShowers++ ;
451 else if (eta_temp < -0.8) {
452 if (
foundMatchingSegment(2, protoTrack, CSClist1B, usedCSClist1B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
453 if ( showeringBefore ) NShowers++ ;
454 if (
foundMatchingSegment(2, protoTrack, CSClist2B, usedCSClist2B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
455 if ( showeringBefore ) NShowers++ ;
456 if (
foundMatchingSegment(2, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
457 if ( showeringBefore ) NShowers++ ;
480 if ( layers.size() < 2 ) {
483 if ( layers[ layers.size()-1] > 0 ) {
491 rawSeeds.push_back(thisSeed);
492 etaOfSeed.push_back(eta_temp);
493 phiOfSeed.push_back(phi_temp);
494 nSegOnSeed.push_back( protoTrack.size() );
497 usedDTlist3[
index] =
true;
509 for (SegmentContainer::iterator it = CSClist0B.begin(); it != CSClist0B.end(); ++it ){
513 if (usedCSClist0B[index] ==
true)
continue;
521 float eta_temp = gp.
eta();
522 float phi_temp = gp.
phi();
523 bool showeringBefore =
false;
527 if ( showeringBefore ) {
533 protoTrack.push_back(*it);
539 if (
foundMatchingSegment(1, protoTrack, CSClist1B, usedCSClist1B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
540 if ( showeringBefore ) NShowers++ ;
541 if (
foundMatchingSegment(1, protoTrack, CSClist2B, usedCSClist2B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
542 if ( showeringBefore ) NShowers++ ;
543 if (
foundMatchingSegment(1, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
544 if ( showeringBefore ) NShowers++ ;
545 if (
foundMatchingSegment(1, protoTrack, CSClist4B, usedCSClist4B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
546 if ( showeringBefore ) NShowers++ ;
562 if ( layers.size() < 2 ) {
565 if ( fabs( gp.
eta() ) > 1.7 ) {
573 rawSeeds.push_back(thisSeed);
574 etaOfSeed.push_back(eta_temp);
575 phiOfSeed.push_back(phi_temp);
576 nSegOnSeed.push_back( protoTrack.size() );
579 usedCSClist0B[
index] =
true;
585 for (SegmentContainer::iterator it = CSClist1B.begin(); it != CSClist1B.end(); ++it ){
589 if (usedCSClist1B[index] ==
true)
continue;
597 float eta_temp = gp.
eta();
598 float phi_temp = gp.
phi();
599 bool showeringBefore =
false;
603 if ( showeringBefore ) {
609 protoTrack.push_back(*it);
615 if (
foundMatchingSegment(1, protoTrack, CSClist2B, usedCSClist2B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
616 if ( showeringBefore ) NShowers++ ;
617 if (
foundMatchingSegment(1, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
618 if ( showeringBefore ) NShowers++ ;
619 if (
foundMatchingSegment(1, protoTrack, CSClist4B, usedCSClist4B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
620 if ( showeringBefore ) NShowers++ ;
634 if ( layers.size() < 2 ) {
640 rawSeeds.push_back(thisSeed);
641 etaOfSeed.push_back(eta_temp);
642 phiOfSeed.push_back(phi_temp);
643 nSegOnSeed.push_back( protoTrack.size() );
646 usedCSClist1B[
index] =
true;
653 for (SegmentContainer::iterator it = CSClist2B.begin(); it != CSClist2B.end(); ++it ){
657 if (usedCSClist2B[index] ==
true)
continue;
660 double dof =
static_cast<double>( (*it)->degreesOfFreedom() ) ;
661 if ( ((*it)->chi2()/dof) > 20000.0 )
continue;
665 float eta_temp = gp.
eta();
666 float phi_temp = gp.
phi();
667 bool showeringBefore =
false;
671 if ( showeringBefore ) {
677 protoTrack.push_back(*it);
683 if (
foundMatchingSegment(1, protoTrack, CSClist3B, usedCSClist3B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
684 if ( showeringBefore ) NShowers++ ;
685 if (
foundMatchingSegment(1, protoTrack, CSClist4B, usedCSClist4B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
686 if ( showeringBefore ) NShowers++ ;
701 if ( layers.size() < 2) {
708 rawSeeds.push_back(thisSeed);
709 etaOfSeed.push_back(eta_temp);
710 phiOfSeed.push_back(phi_temp);
711 nSegOnSeed.push_back( protoTrack.size() );
713 usedCSClist2B[
index] =
true;
718 for (SegmentContainer::iterator it = CSClist3B.begin(); it != CSClist3B.end(); ++it ){
722 if (usedCSClist3B[index] ==
true)
continue;
725 double dof =
static_cast<double>( (*it)->degreesOfFreedom() ) ;
726 if ( ((*it)->chi2()/dof) > 20000.0 )
continue;
730 float eta_temp = gp.
eta();
731 float phi_temp = gp.
phi();
732 bool showeringBefore =
false;
736 if ( showeringBefore ) {
742 protoTrack.push_back(*it);
748 if (
foundMatchingSegment(1, protoTrack, CSClist4B, usedCSClist4B, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
749 if ( showeringBefore ) NShowers++ ;
764 usedCSClist3B[
index] =
true;
766 if ( layers.size() < 2 )
continue;
770 rawSeeds.push_back(thisSeed);
771 etaOfSeed.push_back(eta_temp);
772 phiOfSeed.push_back(phi_temp);
773 nSegOnSeed.push_back( protoTrack.size() );
785 for (SegmentContainer::iterator it = CSClist0F.begin(); it != CSClist0F.end(); ++it ){
789 if (usedCSClist0F[index] ==
true)
continue;
797 float eta_temp = gp.
eta();
798 float phi_temp = gp.
phi();
799 bool showeringBefore =
false;
803 if ( showeringBefore ) {
809 protoTrack.push_back(*it);
815 if (
foundMatchingSegment(1, protoTrack, CSClist1F, usedCSClist1F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(1);
816 if ( showeringBefore ) NShowers++ ;
817 if (
foundMatchingSegment(1, protoTrack, CSClist2F, usedCSClist2F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
818 if ( showeringBefore ) NShowers++ ;
819 if (
foundMatchingSegment(1, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
820 if ( showeringBefore ) NShowers++ ;
821 if (
foundMatchingSegment(1, protoTrack, CSClist4F, usedCSClist4F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
822 if ( showeringBefore ) NShowers++ ;
838 if ( layers.size() < 2 ) {
841 if ( fabs( gp.
eta() ) > 1.7 ) {
848 rawSeeds.push_back(thisSeed);
849 etaOfSeed.push_back(eta_temp);
850 phiOfSeed.push_back(phi_temp);
851 nSegOnSeed.push_back( protoTrack.size() );
854 usedCSClist0F[
index] =
true;
860 for (SegmentContainer::iterator it = CSClist1F.begin(); it != CSClist1F.end(); ++it ){
864 if (usedCSClist1F[index] ==
true)
continue;
872 float eta_temp = gp.
eta();
873 float phi_temp = gp.
phi();
874 bool showeringBefore =
false;
878 if ( showeringBefore ) {
884 protoTrack.push_back(*it);
890 if (
foundMatchingSegment(1, protoTrack, CSClist2F, usedCSClist2F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(2);
891 if ( showeringBefore ) NShowers++ ;
892 if (
foundMatchingSegment(1, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
893 if ( showeringBefore ) NShowers++ ;
894 if (
foundMatchingSegment(1, protoTrack, CSClist4F, usedCSClist4F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
895 if ( showeringBefore ) NShowers++ ;
911 if ( layers.size() < 2) {
918 rawSeeds.push_back(thisSeed);
919 etaOfSeed.push_back(eta_temp);
920 phiOfSeed.push_back(phi_temp);
921 nSegOnSeed.push_back( protoTrack.size() );
924 usedCSClist1F[
index] =
true;
930 for (SegmentContainer::iterator it = CSClist2F.begin(); it != CSClist2F.end(); ++it ){
934 if (usedCSClist2F[index] ==
true)
continue;
937 double dof =
static_cast<double>( (*it)->degreesOfFreedom() ) ;
938 if ( ((*it)->chi2()/dof) > 20000.0 )
continue;
942 float eta_temp = gp.
eta();
943 float phi_temp = gp.
phi();
944 bool showeringBefore =
false;
948 if ( showeringBefore ) {
954 protoTrack.push_back(*it);
960 if (
foundMatchingSegment(1, protoTrack, CSClist3F, usedCSClist3F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(3);
961 if ( showeringBefore ) NShowers++ ;
962 if (
foundMatchingSegment(1, protoTrack, CSClist4F, usedCSClist4F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
963 if ( showeringBefore ) NShowers++ ;
978 if ( layers.size() < 2) {
985 rawSeeds.push_back(thisSeed);
986 etaOfSeed.push_back(eta_temp);
987 phiOfSeed.push_back(phi_temp);
988 nSegOnSeed.push_back( protoTrack.size() );
991 usedCSClist2F[
index] =
true;
996 for (SegmentContainer::iterator it = CSClist3F.begin(); it != CSClist3F.end(); ++it ){
1000 if (usedCSClist3F[index] ==
true)
continue;
1003 double dof =
static_cast<double>( (*it)->degreesOfFreedom() ) ;
1004 if ( ((*it)->chi2()/dof) > 20000.0 )
continue;
1008 float eta_temp = gp.
eta();
1009 float phi_temp = gp.
phi();
1010 bool showeringBefore =
false;
1014 if ( showeringBefore ) {
1020 protoTrack.push_back(*it);
1023 layers.push_back(2);
1026 if (
foundMatchingSegment(1, protoTrack, CSClist4F, usedCSClist4F, eta_temp, phi_temp, layers[layers.size()-1], showeringBefore )) layers.push_back(4);
1027 if ( showeringBefore ) NShowers++ ;
1042 usedCSClist3F[
index] =
true;
1044 if ( layers.size() < 2 )
continue;
1049 rawSeeds.push_back(thisSeed);
1050 etaOfSeed.push_back(eta_temp);
1051 phiOfSeed.push_back(phi_temp);
1052 nSegOnSeed.push_back( protoTrack.size() );
1062 if (
debug)
std::cout <<
"Number of seeds BEFORE " << rawSeeds.size() << std::endl;
1068 goodSeeds = theSeeds.size();
1073 if (
debug)
std::cout <<
"Number of seeds AFTER " << goodSeeds << std::endl;
1091 BoolContainer& usedSeg,
float& eta_last,
float& phi_last,
int& lastLayer,
bool& showeringBefore ) {
1094 int scanlayer = (lastLayer < 0 ) ? (lastLayer-1) : (lastLayer+1) ;
1097 showeringBefore =
true;
1108 if ( lastLayer == 0 || lastLayer == 1 ) {
1110 else { maxdPhi = 0.06; }
1115 }
else if ( type == 2 ) {
1125 else if ( lastLayer == -2 ) { maxdPhi = 0.8*
maxDeltaPhiDT; }
1131 if ( showeringBefore && maxdPhi > 0.03 ) maxdPhi = 0.03;
1133 showeringBefore =
false ;
1136 float eta_temp = eta_last;
1137 float phi_temp = phi_last;
1141 int best_match =
index;
1142 float best_R =
sqrt( (maxdEta*maxdEta) + (maxdPhi*maxdPhi) );
1143 float best_chi2 = 200;
1144 int best_dimension = 2;
1148 for (SegmentContainer::iterator it=segs.begin(); it!=segs.end(); ++it){
1155 double dh = fabs( gp2.
eta() - eta_temp );
1156 double df = fabs( gp2.
phi() - phi_temp );
1157 double dR =
sqrt( (dh*dh) + (df*df) );
1160 bool case1 = ( dh < maxdEta && df < maxdPhi ) ?
true:
false ;
1162 bool case2 = ( ((*it)->dimension()!= 4) && (dh< 0.5) && (df < maxdPhi) ) ?
true:
false ;
1163 if ( !case1 && !case2 )
continue;
1167 if ( NRechits < best_nhits )
continue;
1168 best_nhits = NRechits ;
1171 if ( (*it)->dimension() < best_dimension )
continue;
1172 best_dimension = (*it)->dimension();
1175 if ( dR > best_R )
continue;
1178 double dof =
static_cast<double>( (*it)->degreesOfFreedom() ) ;
1180 if ( (*it)->chi2()/dof < 0.001 && NRechits < 6 && type == 1)
continue;
1181 if ( (*it)->chi2()/dof > best_chi2 )
continue;
1182 best_chi2 = (*it)->chi2()/dof ;
1185 if ((*it)->dimension() != 4 ) {
1191 phi_last = gp2.
phi();
1192 eta_last = gp2.
eta();
1196 if (best_match < 0)
return ok;
1200 for (SegmentContainer::iterator it=segs.begin(); it!=segs.end(); ++it){
1202 if (index != best_match)
continue;
1203 protoTrack.push_back(*it);
1204 usedSeg[best_match] =
true;
1213 bool showering =
false ;
1217 double nChi2 = 9999. ;
1219 std::vector<int> badtag;
1221 double aveEta = 0.0;
1222 for (SegmentContainer::iterator it = segs.begin(); it != segs.end(); ++it){
1226 double dh = gp.
eta() - eta_last ;
1227 double df = gp.
phi() - phi_last ;
1228 double dR =
sqrt( (dh*dh) + (df*df) ) ;
1230 double dof =
static_cast<double>( (*it)->degreesOfFreedom() );
1231 double nX2 = (*it)->chi2() / dof ;
1234 DetId geoId = (*it)->geographicalId();
1239 badtag.push_back( index ) ;
1240 aveEta += fabs( gp.
eta() ) ;
1243 if (rh < 6 && !isDT)
continue;
1244 if (rh < 12 && isDT)
continue;
1245 if ( rh > nRhits ) {
1247 if ( nX2 > nChi2 ) continue ;
1248 if (layer != 0 && layer != 1 && layer != -1 ) {
1255 aveEta = aveEta/
static_cast<double>(nSeg) ;
1256 bool isME11A = (aveEta >= 2.1 && layer == 0) ?
true :
false ;
1257 bool isME12 = (aveEta > 1.2 && aveEta <= 1.65 && layer == 1) ?
true :
false ;
1258 bool isME11 = (aveEta > 1.65 && aveEta <= 2.1 && layer == 0) ?
true :
false ;
1259 bool is1stLayer = (layer == -1 || layer == 0 || isME12 || isME11 || isME11A) ?
true :
false ;
1261 NShoweringSegments += nSeg;
1263 if ( nSeg > 3 && !isME11A ) showering =
true ;
1264 if ( nSeg > 6 && isME11A ) showering =
true ;
1268 if (showering && !is1stLayer ) {
1269 for (std::vector<int>::iterator it = badtag.begin(); it != badtag.end(); ++it ) {
1270 usedSeg[*it] =
true;
1271 if ( (*it) != theOrigin )
continue;
1282 double dHdTheta = 0.0;
1283 double dThetadR = 0.0;
1284 double etaErr = 1.0;
1286 if (gp.
perp() != 0) {
1288 dHdTheta = ( gp.
mag()+gp.
z() )/gp.
perp();
1289 dThetadR = gp.
z() / gp.
perp2() ;
1290 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)
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
MuonTransientTrackingRecHit::MuonRecHitContainer SegmentContainer
SegmentContainer ShoweringSegments
float maxPhiResolutionCSC
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.
MuonDetLayerMeasurements * muonMeasurements
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< const DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
const std::vector< const DetLayer * > & forwardCSCLayers() const
return the forward (+Z) CSC DetLayers, inside-out
float maxEtaResolutionCSC
MuonSeedBuilder(const edm::ParameterSet &, edm::ConsumesCollector &)
Constructor.
MuonServiceProxy * theService
~MuonSeedBuilder()
Destructor.
std::vector< TrajectorySeed > seedCleaner(const edm::EventSetup &eventSetup, std::vector< TrajectorySeed > &seeds)
Cache pointer to geometry.
const std::vector< const DetLayer * > & backwardCSCLayers() const
return the backward (-Z) CSC DetLayers, inside-out
MuonSeedCreator * muonSeedCreate_
Create seed according to region (CSC, DT, Overlap)
const MuonDetLayerGeometry * muonLayers
volatile std::atomic< bool > shutdown_flag false