Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-06 02:54:08

0001 /*
0002  * AlgoMuonBase.h
0003  *
0004  *  Created on: Mar 1, 2019
0005  *      Author: Karol Bunkowski kbunkow@cern.ch
0006  */
0007 
0008 #ifndef L1T_OmtfP1_ALGOMUONBASE_H_
0009 #define L1T_OmtfP1_ALGOMUONBASE_H_
0010 
0011 #include "L1Trigger/L1TMuonOverlapPhase1/interface/ProcConfigurationBase.h"
0012 #include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h"
0013 #include "L1Trigger/L1TMuonOverlapPhase1/interface/StubResult.h"
0014 #include "boost/dynamic_bitset.hpp"
0015 
0016 class AlgoMuonBase {
0017 public:
0018   AlgoMuonBase(){};
0019 
0020   AlgoMuonBase(const ProcConfigurationBase* config);
0021   virtual ~AlgoMuonBase();
0022 
0023   virtual int getEtaHw() const = 0;
0024 
0025   virtual bool isValid() const = 0;
0026 
0027   virtual unsigned int getFiredLayerCnt() const {
0028     unsigned int count = 0;
0029     for (auto& firedLayerBits : firedLayerBitsInBx) {
0030       count += firedLayerBits.count();
0031     }
0032     return count;
0033   }
0034 
0035   virtual unsigned int getFiredLayerCnt(int bx) const { return firedLayerBitsInBx.at(bx).count(); }
0036 
0037   boost::dynamic_bitset<> getFiredLayerBits()
0038       const {  //TODO make it virtual, and change the return type in in the AlgoMuon to dynamic_bitset<>
0039     boost::dynamic_bitset<> firedLayerBitsSum(firedLayerBitsInBx[0].size());
0040     for (auto& firedLayerBits : firedLayerBitsInBx) {
0041       firedLayerBitsSum |= firedLayerBits;
0042     }
0043     return firedLayerBitsSum;
0044   }
0045 
0046   virtual bool isLayerFired(unsigned int iLayer, unsigned int bx) const { return firedLayerBitsInBx.at(bx)[iLayer]; }
0047 
0048   virtual double getPdfSum() const = 0;
0049 
0050   virtual const StubResult& getStubResult(unsigned int iLayer) const = 0;
0051 
0052   virtual const StubResults& getStubResults() const = 0;
0053 
0054 protected:
0055   ///bits representing fired logicLayers (including bending layers),
0056   std::vector<boost::dynamic_bitset<> > firedLayerBitsInBx;
0057 };
0058 
0059 #endif /* L1T_OmtfP1_ALGOMUONBASE_H_ */