Belle II Software  release-08-01-10
ECLTrig.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <ecl/dataobjects/ECLTrig.h>
10 #include <framework/datastore/StoreArray.h>
11 #include <ecl/mapper/ECLChannelMapper.h>
12 
13 using namespace Belle2;
14 
16 {
17  static StoreArray<ECLTrig> ecl_trig_arr;
18  static auto mapper = ECL::ECLChannelMapper::getInstance();
19  int crate = mapper->getCrateID(cid);
20 
21  if (crate < 1 || crate > 52) {
22  B2FATAL("Could not determine crate ID for cid " << cid);
23  }
24 
25  for (auto& ecl_trig : ecl_trig_arr) {
26  if (ecl_trig.getTrigId() == crate) return &ecl_trig;
27  }
28 
29  return nullptr;
30 }
31 
Class to store ECLTrig, still need to be study relation to ECLHit filled in ecl/modules/eclDigitizer/...
Definition: ECLTrig.h:25
static ECLTrig * getByCellID(int cid)
Find ECLTrig by Cell ID using linear search.
Definition: ECLTrig.cc:15
static ECLChannelMapper * getInstance(bool use_db=true)
Return main instance of ECLChannelMapper.
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Abstract base class for different kinds of events.