Classes | Namespaces | Macros | Functions
HitAnaAlg_test.cc File Reference
#include "boost/test/unit_test.hpp"
#include "larreco/HitFinder/HitAnaAlg.h"

Go to the source code of this file.

Classes

class  hit::HitAnaAlgTest
 
struct  HitAnaAlgFixture
 

Namespaces

 hit
 Detector simulation of raw signals on wires.
 

Macros

#define BOOST_TEST_MODULE   ( HitAnaAlg_test )
 

Functions

 BOOST_AUTO_TEST_CASE (checkConstructor)
 
 BOOST_AUTO_TEST_CASE (LoadHitAssocPair_FirstTime)
 
 BOOST_AUTO_TEST_CASE (LoadHitAssocPair_MultipleHitModules)
 
 BOOST_AUTO_TEST_CASE (LoadHitAssocPair_VectorSizesOff)
 
 BOOST_AUTO_TEST_CASE (InitWireData_OneModule)
 
 BOOST_AUTO_TEST_CASE (InitWireData_NoModules)
 
 BOOST_AUTO_TEST_CASE (ClearWireDataHitInfo_NoModules)
 
 BOOST_AUTO_TEST_CASE (ClearWireDataHitInfo_OneModule)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   ( HitAnaAlg_test )

Definition at line 1 of file HitAnaAlg_test.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( checkConstructor  )

Definition at line 42 of file HitAnaAlg_test.cc.

43 {
44 
45  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().NHitModules == 0 );
46  BOOST_TEST( myHitAnaAlgTest.GetHitModuleLabels().size() == 0U );
47  BOOST_TEST( myHitAnaAlgTest.GetHitProcessingQueue().size() == 0U );
48 
49 }
BOOST_AUTO_TEST_CASE ( LoadHitAssocPair_FirstTime  )

Definition at line 51 of file HitAnaAlg_test.cc.

52 {
53  size_t nHits = 10;
54  size_t nWires = 10;
55 
56  std::vector<recob::Hit> HitVector(nHits);
57 
58  std::vector< std::vector<int> > AssocVector(nWires);
59  for(size_t iter=0; iter<nWires; iter++)
60  AssocVector[iter].push_back(iter);
61 
62  std::string HitModuleLabel = "hit";
63 
64  myHitAnaAlgTest.LoadHitAssocPair(HitVector,AssocVector,HitModuleLabel);
65  BOOST_TEST( myHitAnaAlgTest.GetHitModuleLabels().size() == 1U );
66  BOOST_TEST( myHitAnaAlgTest.GetHitProcessingQueue().size() == 1U );
67 
68 }
std::string string
Definition: nybbler.cc:12
fInnerVessel push_back(Point(-578.400000, 0.000000, 0.000000))
std::vector< reco::ClusterHit2D * > HitVector
What follows are several highly useful typedefs which we want to expose to the outside world...
BOOST_AUTO_TEST_CASE ( LoadHitAssocPair_MultipleHitModules  )

Definition at line 70 of file HitAnaAlg_test.cc.

71 {
72  size_t nHits1 = 10;
73  size_t nHits2 = 10;
74  size_t nWires = 10;
75 
76  std::vector<recob::Hit> HitVector1(nHits1);
77  std::vector<recob::Hit> HitVector2(nHits2);
78 
79  std::vector< std::vector<int> > AssocVector1(nWires);
80  std::vector< std::vector<int> > AssocVector2(nWires);
81  for(size_t iter=0; iter<nWires; iter++){
82  AssocVector1[iter].push_back(iter);
83  AssocVector2[iter].push_back(nWires-iter-1);
84  }
85  std::string HitModuleLabel1 = "hit1";
86  std::string HitModuleLabel2 = "hit2";
87 
88  myHitAnaAlgTest.LoadHitAssocPair(HitVector1,AssocVector1,HitModuleLabel1);
89  myHitAnaAlgTest.LoadHitAssocPair(HitVector2,AssocVector2,HitModuleLabel2);
90 
91  BOOST_TEST( myHitAnaAlgTest.GetHitModuleLabels().size() == 2U );
92  BOOST_TEST( myHitAnaAlgTest.GetHitModuleLabels()[0].compare(HitModuleLabel1) == 0 );
93  BOOST_TEST( myHitAnaAlgTest.GetHitModuleLabels()[1].compare(HitModuleLabel2) == 0 );
94 
95  BOOST_TEST( myHitAnaAlgTest.GetHitProcessingQueue().size() == 2U );
96  BOOST_TEST( myHitAnaAlgTest.GetHitProcessingQueue()[0].second.size() == nWires );
97  BOOST_TEST( myHitAnaAlgTest.GetHitProcessingQueue()[0].second[0].size() == 1U );
98  BOOST_TEST( myHitAnaAlgTest.GetHitProcessingQueue()[0].second[0][0] == 0 );
99  BOOST_TEST( myHitAnaAlgTest.GetHitProcessingQueue()[1].second.size() == nWires );
100  BOOST_TEST( myHitAnaAlgTest.GetHitProcessingQueue()[1].second[0].size() == 1U );
101  BOOST_TEST( myHitAnaAlgTest.GetHitProcessingQueue()[1].second[0][0] == (int)(nWires-1) );
102 
103 }
std::string string
Definition: nybbler.cc:12
BOOST_AUTO_TEST_CASE ( LoadHitAssocPair_VectorSizesOff  )

Definition at line 105 of file HitAnaAlg_test.cc.

106 {
107  std::string str = "test";
108  myHitAnaAlgTest.AddHitModuleLabel(str);
109  BOOST_TEST( myHitAnaAlgTest.GetHitModuleLabels().size() == 1U );
110 
111  size_t nHits = 10;
112  size_t nWires = 10;
113 
114  std::vector<recob::Hit> HitVector(nHits);
115 
116  std::vector< std::vector<int> > AssocVector(nWires);
117  for(size_t iter=0; iter<nWires; iter++)
118  AssocVector[iter].push_back(iter);
119 
120  std::string HitModuleLabel = "hit";
121 
122  BOOST_CHECK_THROW(myHitAnaAlgTest.LoadHitAssocPair(HitVector,AssocVector,HitModuleLabel),hit::HitAnaAlgException);
123 
124 }
std::string string
Definition: nybbler.cc:12
fInnerVessel push_back(Point(-578.400000, 0.000000, 0.000000))
std::vector< reco::ClusterHit2D * > HitVector
What follows are several highly useful typedefs which we want to expose to the outside world...
static QCString str
BOOST_AUTO_TEST_CASE ( InitWireData_OneModule  )

Definition at line 126 of file HitAnaAlg_test.cc.

127 {
128  size_t nHits = 10;
129  size_t nWires = 10;
130 
131  std::vector<recob::Hit> HitVector(nHits);
132 
133  std::vector< std::vector<int> > AssocVector(nWires);
134  for(size_t iter=0; iter<nWires; iter++)
135  AssocVector[iter].push_back(iter);
136 
137  std::string HitModuleLabel = "hit";
138 
139  myHitAnaAlgTest.LoadHitAssocPair(HitVector,AssocVector,HitModuleLabel);
140 
141  unsigned int event = 50;
142  unsigned int run =200;
143 
144  myHitAnaAlgTest.InitWireData(event,run);
145 
146  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().event == event );
147  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().run == run );
148  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().NHitModules == 1 );
149  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().HitModuleLabels.size() == 1U );
150  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().HitModuleLabels[0] == HitModuleLabel );
151 
152 }
std::string string
Definition: nybbler.cc:12
fInnerVessel push_back(Point(-578.400000, 0.000000, 0.000000))
std::vector< reco::ClusterHit2D * > HitVector
What follows are several highly useful typedefs which we want to expose to the outside world...
Event finding and building.
BOOST_AUTO_TEST_CASE ( InitWireData_NoModules  )

Definition at line 154 of file HitAnaAlg_test.cc.

155 {
156  unsigned int event = 50;
157  unsigned int run =200;
158 
159  myHitAnaAlgTest.InitWireData(event,run);
160 
161  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().event == event );
162  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().run == run );
163  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().NHitModules == 0 );
164  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().HitModuleLabels.size() == 0U );
165 
166 }
Event finding and building.
BOOST_AUTO_TEST_CASE ( ClearWireDataHitInfo_NoModules  )

Definition at line 168 of file HitAnaAlg_test.cc.

169 {
170  unsigned int event = 50;
171  unsigned int run =200;
172 
173  myHitAnaAlgTest.InitWireData(event,run);
174  myHitAnaAlgTest.ClearWireDataHitInfo();
175 
176  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().event == event );
177  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().run == run );
178  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().NHitModules == 0 );
179  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().NHits.size() == 0U );
180  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().Hits_IntegratedCharge.size() == 0U );
181  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().Hits.size() == 0U );
182 
183 }
Event finding and building.
BOOST_AUTO_TEST_CASE ( ClearWireDataHitInfo_OneModule  )

Definition at line 185 of file HitAnaAlg_test.cc.

186 {
187  size_t nHits = 10;
188  size_t nWires = 10;
189 
190  std::vector<recob::Hit> HitVector(nHits);
191 
192  std::vector< std::vector<int> > AssocVector(nWires);
193  for(size_t iter=0; iter<nWires; iter++)
194  AssocVector[iter].push_back(iter);
195 
196  std::string HitModuleLabel = "hit";
197 
198  myHitAnaAlgTest.LoadHitAssocPair(HitVector,AssocVector,HitModuleLabel);
199 
200  unsigned int event = 50;
201  unsigned int run =200;
202 
203  myHitAnaAlgTest.InitWireData(event,run);
204  myHitAnaAlgTest.ClearWireDataHitInfo();
205 
206  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().event == event );
207  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().run == run );
208  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().NHitModules == 1 );
209  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().NHits.size() == 1U );
210  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().NHits[0] == 0 );
211  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().Hits_IntegratedCharge.size() == 1U );
212  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().Hits_IntegratedCharge[0] == 0 );
213  BOOST_TEST( myHitAnaAlgTest.GetWireDataStruct().Hits.size() == 1U );
214 
215 }
std::string string
Definition: nybbler.cc:12
fInnerVessel push_back(Point(-578.400000, 0.000000, 0.000000))
std::vector< reco::ClusterHit2D * > HitVector
What follows are several highly useful typedefs which we want to expose to the outside world...
Event finding and building.