예제 #1
0
                              TrackerHits[module], XY, Strips, pitch, size, i,
                              TrackerAngles[module])

        #reconstruct tracks
        MaxNTracks = max(MaxNStrips)
        RecoTracks = hf.ReconstructTracks(copy.deepcopy(TrackerHits),
                                          trackTolerance[0], pitch, MaxNTracks,
                                          restrictNTracks, TrackerZ[0:2],
                                          stripTolerance[0], beamSpread[0])

        #hf.WriteTracks(outfilename,RecoTracks,ZMeans,i)
        nTracks.append(len(RecoTracks))
        #                print TrackerHits,len(RecoTracks)

        #get track efficiency
        eff = hf.GetTrackEfficiency(stripTolerance[0] * pitch, XY, mXmY,
                                    RecoTracks, TrackerZ[0:2], pitch)
        trackEfficiency.append(100 * eff)

        #calculate track ambiguity rate
        nFakeTracks = len(RecoTracks) - (nProton * eff)
        if len(RecoTracks) > 0:
            trackAmbiguity.append(100 * (len(RecoTracks) - nProton) /
                                  len(RecoTracks))
            correctedTrackAmbiguity.append(100 * nFakeTracks / len(RecoTracks))

        if saveStripMaps:
            hf.DrawTrackMap("TrackMap", RecoTracks, XY, xmax)

        ################### REAR TRACKERS #######################################################

        phantomdepth = 30.0  #cm
예제 #2
0
        #reconstruct tracks
        MaxNTracks = max(MaxNStrips)
        if len(TrackerAngles) > 1:
            RecoTracks = hf.ReconstructTracks(copy.deepcopy(TrackerHits),
                                              trackTolerance, pitch,
                                              MaxNTracks, restrictNTracks,
                                              TrackerZ, stripTolerance,
                                              beamSpread)
            hf.WriteTracks(outfilename, RecoTracks, ZMeans, i)
        else:
            RecoTracks = TrackerHits[0]

        nTracks.append(len(RecoTracks))

        #get track efficiency
        eff = hf.GetTrackEfficiency(stripTolerance * pitch, XY, mXmY,
                                    RecoTracks, TrackerZ, pitch)
        trackEfficiency.append(100 * eff)

        #calculate track ambiguity rate
        nFakeTracks = len(RecoTracks) - (nProton * eff)
        if len(RecoTracks) > 0:
            trackAmbiguity.append(100 * (len(RecoTracks) - nProton) /
                                  len(RecoTracks))
            correctedTrackAmbiguity.append(100 * nFakeTracks / len(RecoTracks))

        if saveStripMaps and len(TrackerAngles) > 1:
            hf.DrawTrackMap("TrackMap", RecoTracks, XY, xmax)

    for module in range(len(TrackerAngles)):
        print "Module ", module, ": Hits= ", sum(
            nTrackerHits[module]), " Ambiguity= ", np.mean(