Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:06

0001 /*
0002  * ProcessorBase.h
0003  *
0004  *  Created on: Jul 28, 2017
0005  *      Author: kbunkow
0006  */
0007 
0008 #ifndef L1T_OmtfP1_PROCESSORBASE_H_
0009 #define L1T_OmtfP1_PROCESSORBASE_H_
0010 
0011 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPatternBase.h"
0012 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFConfiguration.h"
0013 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFinput.h"
0014 
0015 #include <memory>
0016 
0017 class L1TMuonOverlapParams;
0018 class SimTrack;
0019 
0020 template <class GoldenPatternType>
0021 class ProcessorBase {
0022 public:
0023   ProcessorBase(OMTFConfiguration* omtfConfig, const L1TMuonOverlapParams* omtfPatterns) : myOmtfConfig(omtfConfig) {
0024     configure(omtfConfig, omtfPatterns);
0025   };
0026 
0027   ///omtfConfig is not const, because the omtfConfig->setPatternPtRange is called inside the constructor
0028   ///takes the ownership of the gps (uses move)
0029   ProcessorBase(OMTFConfiguration* omtfConfig, GoldenPatternVec<GoldenPatternType>&& gps);
0030 
0031   virtual ~ProcessorBase() {}
0032 
0033   ///Return vector of GoldenPatterns
0034   virtual GoldenPatternVec<GoldenPatternType>& getPatterns() { return theGPs; };
0035 
0036   ///Fill GP vec with patterns from CondFormats object
0037   virtual bool configure(OMTFConfiguration* omtfParams, const L1TMuonOverlapParams* omtfPatterns);
0038 
0039   ///Add GoldenPattern to pattern vec.
0040   virtual void addGP(GoldenPatternType* aGP);
0041 
0042   ///Reset all configuration parameters
0043   virtual void resetConfiguration();
0044 
0045   virtual void initPatternPtRange(bool firstPatFrom0);
0046 
0047   const std::vector<OMTFConfiguration::PatternPt>& getPatternPtRange() const { return patternPts; }
0048 
0049   virtual void printInfo() const;
0050 
0051 protected:
0052   ///Configuration of the algorithm. This object
0053   ///does not contain the patterns data.
0054   const OMTFConfiguration* myOmtfConfig;
0055 
0056   ///vector holding Golden Patterns
0057   GoldenPatternVec<GoldenPatternType> theGPs;
0058 
0059   ///Remove hits whis are outside input range
0060   ///for given processor and cone
0061   virtual MuonStubPtrs1D restrictInput(unsigned int iProcessor,
0062                                        unsigned int iCone,
0063                                        unsigned int iLayer,
0064                                        const OMTFinput& input);
0065 
0066   std::vector<OMTFConfiguration::PatternPt> patternPts;
0067 };
0068 
0069 #endif /* L1T_OmtfP1_PROCESSORBASE_H_ */