-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from DUNE-DAQ/asztuc/txmakers_v5_port
Porting triggeralgs from v4 to v5
- Loading branch information
Showing
49 changed files
with
1,451 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* @file TAMakerBundleNAlgorithm.hpp | ||
* | ||
* This is part of the DUNE DAQ Application Framework, copyright 2020. | ||
* Licensing/copyright details are in the COPYING file that you should have | ||
* received with this code. | ||
*/ | ||
|
||
#ifndef TRIGGERALGS_BUNDLEN_TRIGGERACTIVITYMAKERBUNDLEN_HPP_ | ||
#define TRIGGERALGS_BUNDLEN_TRIGGERACTIVITYMAKERBUNDLEN_HPP_ | ||
|
||
#include "triggeralgs/TriggerActivityFactory.hpp" | ||
|
||
#include <vector> | ||
|
||
namespace triggeralgs { | ||
|
||
class TAMakerBundleNAlgorithm : public TriggerActivityMaker | ||
{ | ||
public: | ||
void process(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_tas); | ||
void configure(const nlohmann::json& config); | ||
bool bundle_condition(); | ||
|
||
private: | ||
uint64_t m_bundle_size = 1; | ||
TriggerActivity m_current_ta; | ||
void set_ta_attributes(); | ||
}; | ||
|
||
} // namespace triggeralgs | ||
|
||
#endif // TRIGGERALGS_BUNDLEN_TRIGGERACTIVITYMAKERBUNDLEN_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* @file TCMakerBundleNAlgorithm.hpp | ||
* | ||
* This is part of the DUNE DAQ Application Framework, copyright 2020. | ||
* Licensing/copyright details are in the COPYING file that you should have | ||
* received with this code. | ||
*/ | ||
|
||
#ifndef TRIGGERALGS_BUNDLEN_TRIGGERCANDIDATEMAKERBUNDLEN_HPP_ | ||
#define TRIGGERALGS_BUNDLEN_TRIGGERCANDIDATEMAKERBUNDLEN_HPP_ | ||
|
||
#include "triggeralgs/TriggerCandidateFactory.hpp" | ||
|
||
#include <vector> | ||
|
||
namespace triggeralgs { | ||
|
||
class TCMakerBundleNAlgorithm: public TriggerCandidateMaker | ||
{ | ||
public: | ||
void process(const TriggerActivity& input_ta, std::vector<TriggerCandidate>& output_tcs); | ||
void configure(const nlohmann::json& config); | ||
bool bundle_condition(); | ||
|
||
private: | ||
uint64_t m_bundle_size = 1; | ||
TriggerCandidate m_current_tc; | ||
void set_tc_attributes(); | ||
}; | ||
|
||
} // namespace triggeralgs | ||
|
||
#endif // TRIGGERALGS_BUNDLEN_TRIGGERCANDIDATEMAKERBUNDLEN_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The ChannelAdjacency algorithm is a refined version of the HorizontalMuon algorithm (only the TA maker part for the moment). TA logic changes: in a given TP window (of default 8000 ticks), when TAs are constructed, they only contain the TPs which form an activity/track (and are not the outliers). More than one TAs per window are allowed but they should not be overlapping! | ||
|
||
More details can be found here https://indico.fnal.gov/event/63863/ (Horizontal Muon refinement by SS Chhibra) |
42 changes: 42 additions & 0 deletions
42
include/triggeralgs/ChannelAdjacency/TAMakerChannelAdjacencyAlgorithm.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* @file TAMakerChannelAdjacencyAlgorithm.hpp | ||
* | ||
* This is part of the DUNE DAQ Application Framework, copyright 2021. | ||
* Licensing/copyright details are in the COPYING file that you should have | ||
* received with this code. | ||
*/ | ||
|
||
#ifndef TRIGGERALGS_CHANNELADJACENCY_TRIGGERACTIVITYMAKERCHANNELADJACENCY_HPP_ | ||
#define TRIGGERALGS_CHANNELADJACENCY_TRIGGERACTIVITYMAKERCHANNELADJACENCY_HPP_ | ||
|
||
#include "triggeralgs/TPWindow.hpp" | ||
#include "triggeralgs/TriggerActivityFactory.hpp" | ||
#include <fstream> | ||
#include <vector> | ||
|
||
namespace triggeralgs { | ||
class TAMakerChannelAdjacencyAlgorithm : public TriggerActivityMaker | ||
{ | ||
public: | ||
void process(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta); | ||
void configure(const nlohmann::json& config); | ||
|
||
private: | ||
TriggerActivity construct_ta(TPWindow) const; | ||
|
||
TPWindow check_adjacency(); | ||
|
||
TPWindow m_current_window; | ||
|
||
// Configurable parameters. | ||
bool m_print_tp_info = false; // Prints out some information on every TP received | ||
uint16_t m_adjacency_threshold = 15; // Default is 15 wire track for testing | ||
uint16_t m_adj_tolerance = 3; // Adjacency tolerance - default is 3 from coldbox testing. | ||
timestamp_t m_window_length = 8000; // Shouldn't exceed the max drift which is ~9375 62.5 MHz ticks for VDCB | ||
|
||
// For debugging and performance study purposes. | ||
void add_window_to_record(TPWindow window); | ||
std::vector<TPWindow> m_window_record; | ||
}; | ||
} // namespace triggeralgs | ||
#endif // TRIGGERALGS_CHANNELADJACENCY_TRIGGERACTIVITYMAKERCHANNELADJACENCY_HPP_ |
46 changes: 46 additions & 0 deletions
46
include/triggeralgs/ChannelAdjacency/TCMakerChannelAdjacencyAlgorithm.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* @file TCMakerChannelAdjacencyAlgorithm.hpp | ||
* | ||
* This is part of the DUNE DAQ Application Framework, copyright 2021. | ||
* Licensing/copyright details are in the COPYING file that you should have | ||
* received with this code. | ||
*/ | ||
|
||
#ifndef TRIGGERALGS_CHANNELADJACENCY_TRIGGERCANDIDATEMAKERCHANNELADJACENCY_HPP_ | ||
#define TRIGGERALGS_CHANNELADJACENCY_TRIGGERCANDIDATEMAKERCHANNELADJACENCY_HPP_ | ||
|
||
#include "triggeralgs/TriggerCandidateFactory.hpp" | ||
#include "triggeralgs/TAWindow.hpp" | ||
|
||
#include <fstream> | ||
#include <vector> | ||
|
||
namespace triggeralgs { | ||
class TCMakerChannelAdjacencyAlgorithm : public TriggerCandidateMaker | ||
{ | ||
|
||
public: | ||
// The function that gets called when there is a new activity | ||
void process(const TriggerActivity&, std::vector<TriggerCandidate>&); | ||
void configure(const nlohmann::json& config); | ||
|
||
private: | ||
|
||
TriggerCandidate construct_tc() const; | ||
|
||
TAWindow m_current_window; | ||
uint64_t m_activity_count = 0; // NOLINT(build/unsigned) | ||
|
||
// Configurable parameters. | ||
bool m_trigger_on_adc = false; | ||
bool m_trigger_on_n_channels = false; | ||
uint32_t m_adc_threshold = 1200000; | ||
uint16_t m_n_channels_threshold = 600; // 80ish for frames, O(200 - 600) for tpslink | ||
timestamp_t m_window_length = 80000; | ||
|
||
// For debugging purposes. | ||
void add_window_to_record(TAWindow window); | ||
std::vector<TAWindow> m_window_record; | ||
}; | ||
} // namespace triggeralgs | ||
#endif // TRIGGERALGS_CHANNELADJACENCY_TRIGGERCANDIDATEMAKERCHANNELADJACENCY_HPP_ |
35 changes: 35 additions & 0 deletions
35
include/triggeralgs/ChannelDistance/TAMakerChannelDistanceAlgorithm.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* @file TAMakerChannelDistanceAlgorithm.hpp | ||
* | ||
* This is part of the DUNE DAQ Application Framework, copyright 2021. | ||
* Licensing/copyright details are in the COPYING file that you should have | ||
* received with this code. | ||
*/ | ||
|
||
#ifndef TRIGGERALGS_CHANNELDISTANCE_TRIGGERACTIVITYMAKERCHANNELDISTANCE_HPP_ | ||
#define TRIGGERALGS_CHANNELDISTANCE_TRIGGERACTIVITYMAKERCHANNELDISTANCE_HPP_ | ||
|
||
#include "triggeralgs/TriggerActivityFactory.hpp" | ||
#include <algorithm> | ||
|
||
namespace triggeralgs { | ||
|
||
class TAMakerChannelDistanceAlgorithm : public TriggerActivityMaker { | ||
public: | ||
void process(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_tas); | ||
void configure(const nlohmann::json& config); | ||
void set_ta_attributes(); | ||
|
||
private: | ||
void set_new_ta(const TriggerPrimitive& input_tp); | ||
TriggerActivity m_current_ta; | ||
uint32_t m_max_channel_distance = 50; | ||
uint64_t m_window_length = 8000; | ||
uint16_t m_min_tps = 20; // AEO: Type is arbitrary. Surprised even asking for 2^8 TPs. | ||
uint32_t m_current_lower_bound; | ||
uint32_t m_current_upper_bound; | ||
}; | ||
|
||
} // namespace triggeralgs | ||
|
||
#endif // TRIGGERALGS_CHANNELDISTANCE_TRIGGERACTIVITYMAKERCHANNELDISTANCE_HPP_ |
32 changes: 32 additions & 0 deletions
32
include/triggeralgs/ChannelDistance/TCMakerChannelDistanceAlgorithm.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* @file TCMakerChannelDistanceAlgorithm.hpp | ||
* | ||
* This is part of the DUNE DAQ Application Framework, copyright 2021. | ||
* Licensing/copyright details are in the COPYING file that you should have | ||
* received with this code. | ||
*/ | ||
|
||
#ifndef TRIGGERALGS_CHANNELDISTANCE_TRIGGERCANDIDATEMAKERCHANNELDISTANCE_HPP_ | ||
#define TRIGGERALGS_CHANNELDISTANCE_TRIGGERCANDIDATEMAKERCHANNELDISTANCE_HPP_ | ||
|
||
#include "triggeralgs/TriggerCandidateFactory.hpp" | ||
#include <algorithm> | ||
|
||
namespace triggeralgs { | ||
|
||
class TCMakerChannelDistanceAlgorithm : public TriggerCandidateMaker { | ||
public: | ||
void process(const TriggerActivity& input_ta, std::vector<TriggerCandidate>& output_tcs); | ||
void configure(const nlohmann::json& config); | ||
void set_tc_attributes(); | ||
|
||
private: | ||
void set_new_tc(const TriggerActivity& input_ta); | ||
TriggerCandidate m_current_tc; | ||
uint16_t m_current_tp_count; | ||
uint16_t m_max_tp_count = 1000; // Produce a TC when this count is exceeded. AEO: Arbitrary choice of 1000. | ||
}; | ||
|
||
} // namespace triggeralgs | ||
|
||
#endif // TRIGGERALGS_CHANNELDISTANCE_TRIGGERCANDIDATEMAKERCHANNELDISTANCE_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* @file Issues.hpp | ||
* | ||
* This is part of the DUNE DAQ Application Framework, copyright 2020. | ||
* Licensing/copyright details are in the COPYING file that you should have | ||
* received with this code. | ||
*/ | ||
|
||
#ifndef TRIGGERALGS_INCLUDE_TRIGGERALGS_ISSUES_HPP_ | ||
#define TRIGGERALGS_INCLUDE_TRIGGERALGS_ISSUES_HPP_ | ||
|
||
#include "ers/Issue.hpp" | ||
|
||
#include <string> | ||
|
||
ERS_DECLARE_ISSUE(triggeralgs, | ||
FactoryOverwrite, | ||
"Attempted to overwrite a creator in factory with " << alg_name, | ||
((std::string)alg_name)) | ||
|
||
ERS_DECLARE_ISSUE(triggeralgs, | ||
FactoryNotFound, | ||
"Factory couldn't find: " << alg_name, | ||
((std::string)alg_name)) | ||
|
||
ERS_DECLARE_ISSUE(triggeralgs, | ||
BadConfiguration, | ||
"Bad configuration in " << alg_name, | ||
((std::string)alg_name)) | ||
|
||
#endif // TRIGGERALGS_INCLUDE_TRIGGERALGS_ISSUES_HPP_ |
Oops, something went wrong.