예제 #1
0
            #convert simulated protons to strips
            Strips, meanXY = hf.GetTrackerStripCoOrds(XY, mXmY, pitch,
                                                      TrackerAngles[module],
                                                      TrackerZ[module])

            #keep track of maximum number of strips in each module
            MaxNStrips.append(len(max(Strips, key=len)))

            #find overlap of strips and return hit objects of form (XCoord,YCoord,[stripX,stripU,stripV],[radial distance to intersections])
            Hits = hf.FindOverlaps(Strips, pitch, TrackerAngles[module],
                                   stripTolerance[0], useHalfStrips)
            TrackerHits.append(Hits)
            nTrackerHits[module].append(len(Hits))

            #calculate efficiency for finding correct hits by checking there is always a reco hit within tolerance of true hit
            eff = hf.GetEfficiency(Hits, meanXY, pitch, stripTolerance[0])
            trackerEffs[module].append(100 * eff)
            nFakeHits = len(Hits) - (nProton * eff)

            #calculate ambiguity
            if len(Hits) > 0:
                ambiguity[module].append(100 * (float)(len(Hits) - nProton) /
                                         len(Hits))
                correctedAmbiguity[module].append(100 * nFakeHits / len(Hits))

            if saveStripMaps:
                hf.PlotHitMap("Tracker" + (str)(module) + "Hits",
                              TrackerHits[module], XY, Strips, pitch, size, i,
                              TrackerAngles[module])

        #reconstruct tracks
예제 #2
0
            #print XY

            #convert points into a strip number for each layer
            Strips = hf.GetStripCoOrds(XY, pitch, angles)
            #print Strips

            #cycle through all strip combinations, find intersections of pairs of planes, see if they are within tolerance of each other
            #returns hit objects of form (XCoord,YCoord,[stripX,stripU,stripV],[radial distance to intersections])
            allHits = hf.FindOverlaps(Strips, pitch, angles, tolerance,
                                      useHalfStrips)
            nRawHits += len(allHits)
            hRawHits.Fill(len(allHits))
            for hit in allHits:
                myHitMap.Fill(hit[0], hit[1])

            rawEff = hf.GetEfficiency(allHits, XY, pitch, tolerance)
            hRawEfficiency.Fill(100.0 * rawEff)
            nProton_RawEffCorrected += nProton * rawEff

            if saveStripMaps:
                hf.PlotHitMap("RawHits", allHits, XY, Strips, pitch, size, i,
                              angles)

            #for hit in allHits:
            #        area=hf.GetPixelArea(hit,angles,pitch)
            #        if area>1.0:
            #                print "Area=",area,hit

            #remove duplicate hits (separated by < tolerance)
            #refinedHits=hf.RemoveAdjacentHits(allHits,tolerance,pitch)
            refinedHits = hf.MergeAdjacentHits(allHits, effTolerance, pitch)