Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /*
0002  * RpcClusterization.h
0003  *
0004  *  Created on: Jan 14, 2019
0005  *      Author: kbunkow
0006  */
0007 
0008 #ifndef L1T_OmtfP1_RPCCLUSTERIZATION_H_
0009 #define L1T_OmtfP1_RPCCLUSTERIZATION_H_
0010 
0011 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
0012 #include "DataFormats/RPCDigi/interface/RPCDigiCollection.h"
0013 
0014 #include <vector>
0015 
0016 class RpcCluster {
0017 public:
0018   int firstStrip = -1;
0019   int lastStrip = -1;
0020 
0021   int bx = 0;
0022 
0023   //sub-bx timing, should be already in scale common for all muon subsystems
0024   int timing = 0;
0025 
0026   RpcCluster(unsigned int firstStrip, unsigned int lastStrip) : firstStrip(firstStrip), lastStrip(lastStrip){};
0027 
0028   float halfStrip() { return (lastStrip + firstStrip) / 2.; }
0029 
0030   unsigned int size() const { return abs(firstStrip - lastStrip) + 1; }
0031 };
0032 
0033 class RpcClusterization {
0034 public:
0035   RpcClusterization(){};
0036 
0037   virtual ~RpcClusterization();
0038 
0039   void configure(int maxClusterSize, int maxClusterCnt, bool dropAllClustersIfMoreThanMax) {
0040     this->maxClusterSize = maxClusterSize;
0041     this->maxClusterCnt = maxClusterCnt;
0042     this->dropAllClustersIfMoreThanMax = dropAllClustersIfMoreThanMax;
0043   }
0044 
0045   ///N.B. digis are sorted inside the function
0046   virtual std::vector<RpcCluster> getClusters(const RPCDetId& roll, std::vector<RPCDigi>& digis) const;
0047 
0048   //converts float timing to the int timing in the scale common for the muon detectors
0049   virtual int convertTiming(double timing) const;
0050 
0051 private:
0052   unsigned int maxClusterSize = 3;
0053   unsigned int maxClusterCnt = 2;
0054 
0055   // if true no  cluster is return if there is more clusters then maxClusterCnt (counted regardless of the size)
0056   bool dropAllClustersIfMoreThanMax = true;
0057 };
0058 
0059 #endif /* L1T_OmtfP1_RPCCLUSTERIZATION_H_ */