/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
*
* MAUS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MAUS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MAUS. If not, see .
*
*/
#include
#include "gtest/gtest.h"
#include "src/common_cpp/DataStructure/Hit.hh"
#include "src/common_cpp/DataStructure/SciFiChannelId.hh"
#include "src/common_cpp/DataStructure/Track.hh"
#include "src/common_cpp/Plotting/SciFi/SciFiAnalysisTools.hh"
namespace MAUS {
class SciFiAnalysisToolsTest : public ::testing::Test {
protected:
SciFiAnalysisToolsTest() {}
virtual ~SciFiAnalysisToolsTest() {}
};
TEST_F(SciFiAnalysisToolsTest, test_find_n_valid_mc_track) {
// Set up, with the track causing hits in all 5 tracker stations in both trackers
int track_id = 1;
int n_stations = 5;
std::vector* hits = new std::vector();
for (int i = 0; i < n_stations; ++i) {
SciFiHit hit;
hit.SetTrackId(track_id);
hit.SetChannelId(new SciFiChannelId());
hit.GetChannelId()->SetStationNumber(i+1);
hit.GetChannelId()->SetTrackerNumber(0);
hits->push_back(hit);
}
for (int i = 0; i < n_stations; ++i) {
SciFiHit hit;
hit.SetTrackId(track_id);
hit.SetChannelId(new SciFiChannelId());
hit.GetChannelId()->SetStationNumber(i+1);
hit.GetChannelId()->SetTrackerNumber(1);
hits->push_back(hit);
}
// Set up the MC track
Track mc_trk;
mc_trk.SetTrackId(track_id);
std::vector