61 produces< std::vector<novaddt::TriggerDecision> >();
62 produces< art::Assns<novaddt::TriggerDecision, novaddt::HitList> >();
79 std::unique_ptr<std::vector<novaddt::TriggerDecision>> td(
new std::vector<novaddt::TriggerDecision>);
82 std::map<unsigned short, std::set<unsigned short>> planesAndCells;
86 for(
size_t t = 0;
t < th->size(); ++
t){
88 planesAndCells.clear();
92 for(
auto const&
i : *hl){
93 planesAndCells[
i.Plane().val].insert(
i.Cell().val);
95 LOG_DEBUG(
"TriCellTrigger") <<
"plane: " <<
i.Plane().val
96 <<
" cell: " <<
i.Cell().val;
106 float totalCells = 0.;
107 float goodCells = 0.;
109 for(
auto const& pcitr : planesAndCells){
112 std::set<unsigned short> cellSet = pcitr.second;
115 auto citr = cellSet.cbegin();
123 while( citr != cellSet.cend() ){
124 if( cellSet.find(*citr - 1) != cellSet.end() &&
125 cellSet.find(*citr + 1) != cellSet.end() ){
140 td->emplace_back(hl->front().TDC().val,
141 hl->back().TDC().val - hl->front().TDC().val,
147 LOG_DEBUG(
"TriCellTrigger") <<
"make the trigger decision " 148 << td->back().start()
149 <<
" " << td->back().duration()
152 <<
" " << hl->size();
159 bool goodTrigger = (td->size() > 0);
161 e.
put(std::move(td));
162 e.
put(std::move(assn));
#define LOG_DEBUG(stream)
virtual bool filter(art::Event &e)
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
DEFINE_ART_MODULE(TestTMapFile)
std::string _trackInstanceLabel
instance label making the HitList
ProductID put(std::unique_ptr< PROD > &&product)
unsigned _prescale
holds prescaling variable from fcl file
TriCellTrigger(fhicl::ParameterSet const &p)
std::string _trackModuleLabel
label of module making the HitList
unsigned _event_prescale
holds event prescaling variable from fcl file
virtual ~TriCellTrigger()
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
unsigned _triggerCounts
prescaling variable
unsigned int _minPlanesCrossed
minimum planes crossed in a slice to be used