Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /*
0002  * PatternOptimizerBase.h
0003  *
0004  *  Created on: Oct 17, 2018
0005  *      Author: kbunkow
0006  */
0007 
0008 #ifndef L1T_OmtfP1_PATTERNOPTIMIZERBASE_H_
0009 #define L1T_OmtfP1_PATTERNOPTIMIZERBASE_H_
0010 
0011 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Tools/EmulationObserverBase.h"
0012 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPatternWithStat.h"
0013 
0014 #include "FWCore/Framework/interface/Event.h"
0015 #include "FWCore/Framework/interface/EventSetup.h"
0016 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0017 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0018 
0019 #include "TH1I.h"
0020 #include "TH2I.h"
0021 #include "TFile.h"
0022 
0023 #include <functional>
0024 
0025 class PatternOptimizerBase : public EmulationObserverBase {
0026 public:
0027   static double vxMuRate(double pt_GeV);
0028   static double vxIntegMuRate(double pt_GeV, double dpt, double etaFrom, double etaTo);
0029 
0030   PatternOptimizerBase(const edm::ParameterSet& edmCfg,
0031                        const OMTFConfiguration* omtfConfig,
0032                        GoldenPatternVec<GoldenPatternWithStat>& gps);
0033 
0034   ~PatternOptimizerBase() override;
0035 
0036   void observeEventEnd(const edm::Event& iEvent,
0037                        std::unique_ptr<l1t::RegionalMuonCandBxCollection>& finalCandidates) override;
0038 
0039   void endJob() override;
0040 
0041 protected:
0042   void savePatternsInRoot(std::string rootFileName);
0043 
0044   void printPatterns();
0045 
0046   virtual double getEventRateWeight(double pt) { return 1; }
0047 
0048   virtual void saveHists(TFile& outfile){};
0049 
0050   GoldenPatternVec<GoldenPatternWithStat>& goldenPatterns;
0051 
0052   TH1I* simMuPt;
0053   TH1I* simMuFoundByOmtfPt;
0054 
0055   TH1F* simMuPtSpectrum;
0056 
0057   bool writeLayerStat = false;
0058 };
0059 
0060 #endif /* L1T_OmtfP1_PATTERNOPTIMIZERBASE_H_ */