17#define BOOST_TEST_MODULE midTracking
18#define BOOST_TEST_DYN_LINK
19#include <boost/test/unit_test.hpp>
21#include <boost/test/data/monomorphic/generators/xrange.hpp>
22#include <boost/test/data/test_case.hpp>
74 for (
int ich = 0; ich < 4; ++ich) {
77 for (
auto& hit : hits) {
79 float xPos = hit.xCoor;
80 float yPos = hit.yCoor;
88 cl.
yCoor = area.getCenterY();
89 cl.
yErr = area.getHalfSizeY() / std::sqrt(3.);
92 cl.
xCoor = area.getCenterX();
93 cl.
xErr = area.getHalfSizeX() / std::sqrt(3.);
107 std::vector<TrackClusters> trackClusters;
109 for (
auto& track : tracks) {
112 return trackClusters;
117 std::stringstream ss;
118 ss << track <<
" clusters: ";
119 for (
int ich = 0; ich < 4; ++ich) {
129 for (
int ievt = 0; ievt < 1000; ++ievt) {
130 std::vector<TrackClusters> trackClusters =
getTrackClusters(nTracksPerEvent);
134 std::stringstream ss;
137 for (
auto& trCl : trackClusters) {
139 ss <<
"Track " << itr <<
": " << trCl.track <<
"\n";
140 for (
auto& cl : trCl.clusters) {
142 ss <<
" deId " << (
int)cl.deId <<
" pos: (" << cl.xCoor <<
", " << cl.yCoor <<
")";
151 ss <<
" Reconstructed tracks:\n";
159 for (
auto& trCl : trackClusters) {
162 for (
size_t ireco = 0; ireco < helper.
tracker.
getTracks().size(); ++ireco) {
168 bool isReconstructible = trCl.isReconstructible();
174 bool testTrack = (isReconstructible || nTracksPerEvent < 4);
176 BOOST_TEST(isReco == isReconstructible, ss.str() <<
" track " << itr <<
" reco " << isReco
177 <<
" != reconstructible " << isReconstructible);
179 if (isReconstructible) {
197 for (
int ievt = 0; ievt < 1000; ++ievt) {
198 std::vector<TrackClusters> trackClusters =
getTrackClusters(nTracksPerEvent);
200 for (
auto& trCl : trackClusters) {
212 for (
auto& track : helper.tracker.getTracks()) {
213 bool isCompatible =
false;
214 std::stringstream ss;
217 for (
auto& trackAll : helper.trackerAll.getTracks()) {
219 if (trackAll.isCompatible(track,
chi2Cut)) {
231 for (
int ievt = 0; ievt < 100; ++ievt) {
233 for (
auto& trCl : trackClusters) {
237 for (
auto& track : tracks) {
Utility to build the MID track hit maps.
Track reconstruction algorithm for MID.
Fast track generator for MID.
Class to find the impact point of a track on the chamber.
std::vector< Cluster > getLocalPositions(const Track &track, int chamber, bool withUncertainties=false) const
void buildTrackInfo(Track &track, gsl::span< const Cluster > clusters) const
MpStripIndex stripByPosition(double xPos, double yPos, int cathode, int deId, bool warn=true) const
MpArea stripByLocation(int strip, int cathode, int line, int column, int deId, bool warn=true) const
Class to generate tracks for MID.
std::vector< Track > generate()
This class defines the MID track.
int getClusterMatched(int chamber) const
Tracking algorithm for MID.
bool init(bool keepAll=false)
void process(gsl::span< const Cluster > clusters, bool accumulate=false)
float getSigmaCut() const
Gets number of sigmas for cuts.
const std::vector< Track > & getTracks()
Gets the array of reconstructes tracks.
BOOST_TEST_MESSAGE("Fraction of fake tracks: "<<(double) nTotFakes/(double) nTotReconstructible)
unsigned long int nReconstructible
BOOST_DATA_TEST_CASE(MID_DigitMerger, boost::unit_test::data::make(getDEList()), deId)
TrackClusters getTrackClusters(const Track &track)
BOOST_TEST(clusters.size()==clusterizer.getClusters().size())
std::string getTrackInfo(const Track &track)
GeometryTransformer createDefaultTransformer()
std::vector< Cluster > clusters
BOOST_AUTO_TEST_CASE(mask)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
cluster structure for MID
float yErr
Cluster resolution along y.
void setBothFired()
Sets a flag specifying that both BP and NBP were fired.
float xErr
Cluster resolution along x.
uint8_t deId
Detection element ID.
HitMapBuilder hitMapBuilder
GeometryTransformer geoTrans
Indexes required to define a strip in the detection element.
int strip
Line of the local board in the column.
bool isValid()
Check if Strip is Valid.
int line
Column in the DE.
std::vector< Cluster > clusters