Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef OMTF_OMTFProcessor_H
0002 #define OMTF_OMTFProcessor_H
0003 
0004 #include <map>
0005 
0006 #include "L1Trigger/L1TMuonOverlap/interface/GoldenPattern.h"
0007 #include "L1Trigger/L1TMuonOverlap/interface/OMTFResult.h"
0008 #include "L1Trigger/L1TMuonOverlap/interface/OMTFConfiguration.h"
0009 
0010 class L1TMuonOverlapParams;
0011 class OMTFinput;
0012 
0013 class SimTrack;
0014 
0015 namespace edm {
0016   class ParameterSet;
0017 }
0018 
0019 class OMTFProcessor {
0020 public:
0021   typedef std::map<Key, OMTFResult> resultsMap;
0022 
0023   OMTFProcessor(){};
0024 
0025   ~OMTFProcessor();
0026 
0027   ///Fill GP map with patterns from CondFormats object
0028   bool configure(const OMTFConfiguration *omtfParams, const L1TMuonOverlapParams *omtfPatterns);
0029 
0030   ///Process input data from a single event
0031   ///Input data is represented by hits in logic layers expressed in local coordinates
0032   ///Vector index: logic region number
0033   ///Map key: GoldenPattern key
0034   const std::vector<OMTFProcessor::resultsMap> &processInput(unsigned int iProcessor, const OMTFinput &aInput);
0035 
0036   ///Return map of GoldenPatterns
0037   const std::map<Key, GoldenPattern *> &getPatterns() const;
0038 
0039   ///Fill counts for a GoldenPattern of this
0040   ///processor unit. Pattern key is selcted according
0041   ///to the SimTrack parameters.
0042   void fillCounts(unsigned int iProcessor, const OMTFinput &aInput, const SimTrack *aSimMuon);
0043 
0044   ///Average patterns. Use same meanDistPhi for two
0045   ///patterns neighboring in pt code.
0046   ///Averaging is made saparately fo each charge
0047   void averagePatterns(int charge);
0048 
0049 private:
0050   ///Reset all configuration parameters
0051   void resetConfiguration();
0052 
0053   ///Add GoldenPattern to pattern map.
0054   ///If GP key already exists in map, a new entry is ignored
0055   bool addGP(GoldenPattern *aGP);
0056 
0057   ///Shift pdf indexes by differecne between averaged and
0058   ///original meanDistPhi
0059   void shiftGP(GoldenPattern *aGP,
0060                const GoldenPattern::vector2D &meanDistPhiNew,
0061                const GoldenPattern::vector2D &meanDistPhiOld);
0062 
0063   ///Fill map of used inputs.
0064   ///FIXME: using hack from OMTFConfiguration
0065   void fillInputRange(unsigned int iProcessor, unsigned int iCone, const OMTFinput &aInput);
0066 
0067   void fillInputRange(unsigned int iProcessor, unsigned int iCone, unsigned int iRefLayer, unsigned int iHit);
0068 
0069   ///Remove hits whis are outside input range
0070   ///for given processor and cone
0071   OMTFinput::vector1D restrictInput(unsigned int iProcessor,
0072                                     unsigned int iCone,
0073                                     unsigned int iLayer,
0074                                     const OMTFinput::vector1D &layerHits);
0075 
0076   ///Map holding Golden Patterns
0077   std::map<Key, GoldenPattern *> theGPs;
0078 
0079   ///Map holding results on current event data
0080   ///for each GP.
0081   ///Reference hit number is isued as a vector index.
0082   std::vector<OMTFProcessor::resultsMap> myResults;
0083 
0084   ///Configuration of the algorithm. This object
0085   ///does not contain the patterns data.
0086   const OMTFConfiguration *myOmtfConfig;
0087 };
0088 
0089 #endif