Project

General

Profile

Support #1089 » SciFiEventTestPart.cc

Dobbs, Adam, 05 August 2012 02:48

 
1
TEST_F(SciFiEventTestDS, test_copy_constructor) {
2
  SciFiEvent* evt1 = new SciFiEvent();
3

    
4
  int spill = 1;
5
  int event = 2;
6
  int tracker = 1;
7
  int station = 2;
8
  int plane = 0;
9
  int channel = 106;
10
  double npe = 3.2;
11
  double time = 12.2;
12

    
13
  SciFiHit *hit = new SciFiHit();
14
  SciFiDigit *digit = new SciFiDigit(spill, event, tracker, station, plane, channel, npe, time);
15
  SciFiCluster *cluster = new SciFiCluster();
16
  SciFiSpacePoint *spoint = new SciFiSpacePoint();
17
  SciFiSpacePoint *seed = new SciFiSpacePoint();
18
  SciFiStraightPRTrack strk;
19
  SciFiHelicalPRTrack htrk;
20

    
21
  evt1->add_hit(hit);
22
  evt1->add_digit(digit);
23
  evt1->add_cluster(cluster);
24
  evt1->add_spacepoint(spoint);
25
  evt1->add_seeds(seed);
26
  evt1->add_straightprtrack(strk);
27
  evt1->add_helicalprtrack(htrk);
28

    
29
  SciFiEvent evt2(*evt1);
30
  delete evt1;
31

    
32
  ASSERT_EQ(evt2.hits().size(), 1);
33
  // EXPECT_EQ(evt2.hits()[0]->GetChannelId()->GetFiberNumber(), 0);
34

    
35
  ASSERT_EQ(evt2.digits().size(), 1);
36
  EXPECT_EQ(evt2.digits()[0]->get_spill(), spill);
37
  EXPECT_EQ(evt2.digits()[0]->get_event(), event);
38
  EXPECT_EQ(evt2.digits()[0]->get_tracker(), tracker);
39
  EXPECT_EQ(evt2.digits()[0]->get_station(), station);
40
  EXPECT_EQ(evt2.digits()[0]->get_plane(), plane);
41
  EXPECT_EQ(evt2.digits()[0]->get_channel(), channel);
42
  EXPECT_EQ(evt2.digits()[0]->get_npe(), npe);
43
  EXPECT_EQ(evt2.digits()[0]->get_time(), time);
44
  EXPECT_FALSE(evt2.digits()[0]->is_used());
45

    
46
  ASSERT_EQ(evt2.clusters().size(), 1);
47
  EXPECT_EQ(evt2.clusters()[0]->get_tracker(), 0);
48

    
49
  ASSERT_EQ(evt2.spacepoints().size(), 1);
50
  EXPECT_EQ(evt2.spacepoints()[0]->get_tracker(), 0);
51

    
52
  ASSERT_EQ(evt2.seeds().size(), 1);
53
  EXPECT_EQ(evt2.seeds()[0]->get_tracker(), 0);
54

    
55
  ASSERT_EQ(evt2.straightprtracks().size(), 1);
56
  EXPECT_EQ(evt2.straightprtracks()[0].get_tracker(), -1);
57

    
58
  ASSERT_EQ(evt2.helicalprtracks().size(), 1);
59
  EXPECT_EQ(evt2.helicalprtracks()[0].get_tracker(), -1);
60
}
(1-1/3)