CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AlgoMuonBase.h
Go to the documentation of this file.
1 /*
2  * AlgoMuonBase.h
3  *
4  * Created on: Mar 1, 2019
5  * Author: Karol Bunkowski kbunkow@cern.ch
6  */
7 
8 #ifndef L1T_OmtfP1_ALGOMUONBASE_H_
9 #define L1T_OmtfP1_ALGOMUONBASE_H_
10 
14 #include "boost/dynamic_bitset.hpp"
15 
16 class AlgoMuonBase {
17 public:
19 
21  virtual ~AlgoMuonBase();
22 
23  virtual int getEtaHw() const = 0;
24 
25  virtual bool isValid() const = 0;
26 
27  virtual unsigned int getFiredLayerCnt() const {
28  unsigned int count = 0;
29  for (auto& firedLayerBits : firedLayerBitsInBx) {
30  count += firedLayerBits.count();
31  }
32  return count;
33  }
34 
35  virtual unsigned int getFiredLayerCnt(int bx) const { return firedLayerBitsInBx.at(bx).count(); }
36 
37  boost::dynamic_bitset<> getFiredLayerBits()
38  const { //TODO make it virtual, and change the return type in in the AlgoMuon to dynamic_bitset<>
39  boost::dynamic_bitset<> firedLayerBitsSum(firedLayerBitsInBx[0].size());
40  for (auto& firedLayerBits : firedLayerBitsInBx) {
41  firedLayerBitsSum |= firedLayerBits;
42  }
43  return firedLayerBitsSum;
44  }
45 
46  virtual bool isLayerFired(unsigned int iLayer, unsigned int bx) const { return firedLayerBitsInBx.at(bx)[iLayer]; }
47 
48  virtual double getPdfSum() const = 0;
49 
50  virtual const StubResult& getStubResult(unsigned int iLayer) const = 0;
51 
52  virtual const StubResults& getStubResults() const = 0;
53 
54 protected:
56  std::vector<boost::dynamic_bitset<> > firedLayerBitsInBx;
57 };
58 
59 #endif /* L1T_OmtfP1_ALGOMUONBASE_H_ */
virtual const StubResults & getStubResults() const =0
virtual ~AlgoMuonBase()
Definition: AlgoMuonBase.cc:13
virtual bool isValid() const =0
virtual int getEtaHw() const =0
virtual unsigned int getFiredLayerCnt() const
Definition: AlgoMuonBase.h:27
boost::dynamic_bitset getFiredLayerBits() const
Definition: AlgoMuonBase.h:37
virtual bool isLayerFired(unsigned int iLayer, unsigned int bx) const
Definition: AlgoMuonBase.h:46
std::vector< boost::dynamic_bitset<> > firedLayerBitsInBx
bits representing fired logicLayers (including bending layers),
Definition: AlgoMuonBase.h:56
std::vector< StubResult > StubResults
Definition: StubResult.h:54
tuple config
parse the configuration file
virtual unsigned int getFiredLayerCnt(int bx) const
Definition: AlgoMuonBase.h:35
virtual const StubResult & getStubResult(unsigned int iLayer) const =0
tuple size
Write out results.
virtual double getPdfSum() const =0