コード例 #1
0
ファイル: test_merger.py プロジェクト: GaelTouquet/heppy
 def test_merge_pair_away(self):
     clusters = [ Cluster(20, TVector3(1,0,0), 0.04, 'hcal_in'),
                  Cluster(20, TVector3(1,1.1,0.0), 0.04, 'hcal_in')]
     merge_clusters(clusters, 'hcal_in')
     self.assertEqual( len(clusters), 2 )
     self.assertEqual( len(clusters[0].subclusters), 1)
     self.assertEqual( len(clusters[1].subclusters), 1)
コード例 #2
0
 def test_merge_different_layers(self):
     clusters = [
         Cluster(20, TVector3(1, 0, 0), 0.04, 'ecal_in'),
         Cluster(20, TVector3(1, 0, 0), 0.04, 'hcal_in')
     ]
     merge_clusters(clusters, 'hcal_in')
     self.assertEqual(len(clusters), 2)
コード例 #3
0
ファイル: sequence.py プロジェクト: GaelTouquet/heppy_fcc
 def reconstruct(self, simptcs, detector):
     self.pfinput = PFInput(simptcs)
     elements = self.pfinput.element_list()
     elements = merge_clusters(elements, 'hcal_in')
     elements = merge_clusters(elements, 'ecal_in')
     self.links = Links(elements, distance)
     self.pfreco = PFReconstructor( self.links, detector, self.logger)
コード例 #4
0
ファイル: sequence.py プロジェクト: dcarogancia/heppy_fcc
 def reconstruct(self, simptcs, detector):
     self.pfinput = PFInput(simptcs)
     elements = self.pfinput.element_list()
     elements = merge_clusters(elements, 'hcal_in')
     elements = merge_clusters(elements, 'ecal_in')
     self.links = Links(elements, distance)
     self.pfreco = PFReconstructor(self.links, detector, self.logger)
コード例 #5
0
    def test_merge_pair_away(self):

        clusters = [ Cluster(20, TVector3(1,0,0), 0.04, 'hcal_in'),
                     Cluster(20, TVector3(1,1.1,0.0), 0.04, 'hcal_in')]
        merge_clusters(clusters, 'hcal_in')
        self.assertEqual( len(clusters), 2 )
        self.assertEqual( len(clusters[0].subclusters), 1)
        self.assertEqual( len(clusters[1].subclusters), 1)
コード例 #6
0
ファイル: sequence.py プロジェクト: GaelTouquet/heppy
 def reconstruct(self, simptcs, detector):
     self.pfinput = PFInput(simptcs)
     elements = self.pfinput.element_list()
     elements = merge_clusters(elements, 'hcal_in')
     elements = merge_clusters(elements, 'ecal_in')
     self.links = Links(elements, distance)
     
     self.elements=elements #alice added this is so that the new reconstruction algorithms can start with 
                             # the merged cluster
     self.pfreco = PFReconstructor( self.links, detector, self.logger)
コード例 #7
0
ファイル: test_merger.py プロジェクト: GaelTouquet/heppy
 def test_merge_pair(self):
     clusters = [ Cluster(20, TVector3(1, 0, 0), 0.1, 'hcal_in'),
                  Cluster(20, TVector3(1.,0.05,0.), 0.1, 'hcal_in')]
     merged_clusters = merge_clusters(clusters, 'hcal_in')
     self.assertEqual( len(merged_clusters), 1 )
     self.assertEqual( merged_clusters[0].energy,
                       clusters[0].energy + clusters[1].energy)
     self.assertEqual( merged_clusters[0].position.X(),
                       (clusters[0].position.X() + clusters[1].position.X())/2.)
     self.assertEqual( len(merged_clusters[0].subclusters), 2)
     self.assertEqual( merged_clusters[0].subclusters[0], clusters[0])
     self.assertEqual( merged_clusters[0].subclusters[1], clusters[1])
コード例 #8
0
ファイル: test_merger.py プロジェクト: GaelTouquet/heppy
 def test_inside(self):
     clusters = [ Cluster(20, TVector3(1, 0, 0), 0.055, 'hcal_in'),
                  Cluster(20, TVector3(1.,0.1, 0.0), 0.055, 'hcal_in')]
     merged_clusters = merge_clusters(clusters, 'hcal_in')
     self.assertEqual( len(merged_clusters), 1 )
     cluster = merged_clusters[0]
     self.assertEqual( (True, 0.), cluster.is_inside(TVector3(1, 0 , 0)) )
     self.assertEqual( (True, 0.), cluster.is_inside(TVector3(1, 0.1, 0)) )
     in_the_middle = cluster.is_inside(TVector3(1, 0.06, 0))
     self.assertTrue(in_the_middle[0])
     self.assertAlmostEqual(in_the_middle[1], 0.04000)
     self.assertFalse( cluster.is_inside(TVector3(1, 0.156, 0))[0]  )
コード例 #9
0
 def test_merge_pair(self):
     clusters = [ Cluster(20, TVector3(1, 0, 0), 0.1, 'hcal_in'),
                  Cluster(20, TVector3(1.,0.05,0.), 0.1, 'hcal_in')]
     merged_clusters = merge_clusters(clusters, 'hcal_in')
     self.assertEqual( len(merged_clusters), 1 )
     self.assertEqual( merged_clusters[0].energy,
                       clusters[0].energy + clusters[1].energy)
     self.assertEqual( merged_clusters[0].position.X(),
                       (clusters[0].position.X() + clusters[1].position.X())/2.)
     self.assertEqual( len(merged_clusters[0].subclusters), 2)
     self.assertEqual( merged_clusters[0].subclusters[0], clusters[0])
     self.assertEqual( merged_clusters[0].subclusters[1], clusters[1])
コード例 #10
0
 def test_inside(self):
     clusters = [ Cluster(20, TVector3(1, 0, 0), 0.055, 'hcal_in'),
                  Cluster(20, TVector3(1.,0.1, 0.0), 0.055, 'hcal_in')]
     merged_clusters = merge_clusters(clusters, 'hcal_in')
     self.assertEqual( len(merged_clusters), 1 )
     cluster = merged_clusters[0]
     self.assertEqual( (True, 0.), cluster.is_inside(TVector3(1, 0 , 0)) )
     self.assertEqual( (True, 0.), cluster.is_inside(TVector3(1, 0.1, 0)) )
     in_the_middle = cluster.is_inside(TVector3(1, 0.06, 0))
     self.assertTrue(in_the_middle[0])
     self.assertAlmostEqual(in_the_middle[1], 0.04000)
     self.assertFalse( cluster.is_inside(TVector3(1, 0.156, 0))[0]  )
コード例 #11
0
ファイル: test_merger.py プロジェクト: GaelTouquet/heppy
 def test_merge_different_layers(self):
     clusters = [ Cluster(20, TVector3(1,0,0), 0.04, 'ecal_in'),
                  Cluster(20, TVector3(1,0,0), 0.04, 'hcal_in')]
     merge_clusters(clusters, 'hcal_in')
     self.assertEqual( len(clusters), 2)