Skip to content

Commit

Permalink
using unique_ptr for the GoldenPatternVec and many other changes
Browse files Browse the repository at this point in the history
combination of 4 commits:
1) GoldenPatternVec = std::vector<std::unique_ptr<GoldenPatternType> >

OMTFReconstruction::beginRun modified to adapted to the GoldenPatternVec
and other changes

added calss EmulationObserverBase
PatternOptimizerBase::observeProcesorEmulation and findSimMuon moved
there

DataROOTDumper2 inherits from EmulationObserverBase, removing
omtfGpResultsPdfSum and omtfGpResultsFiredLayers from OmtfEvent,
removing gpResultsToPt

removing DataROOTDumper

EventCapture - goldenPatterns is pointer now

removed OMTFSorterWithThreshold

removed PatternsPtAssignment

ProcessorBase<GoldenPatternType>::setGPs removed, code moved to
constructor
2) added L1T_OmtfP1_ prefix in the include guards in header files

3) using ESWatcher<L1TMuonOverlapParamsRcd> in the OMTFReconstruction

to prevent the patterns re-creation every run start (if the patterns are
created from the EventSetup, and not directly from the xml)

4) L1TMuonOverlapPhase1TrackProducer inherits from  edm::one::EDProducer

with edm::one::WatchRuns customization
  • Loading branch information
Karol Bunkowski committed Sep 2, 2021
1 parent 70ff9c2 commit 6623bc0
Show file tree
Hide file tree
Showing 64 changed files with 484 additions and 957 deletions.
6 changes: 3 additions & 3 deletions L1Trigger/L1TMuonOverlapPhase1/interface/AlgoMuonBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Author: Karol Bunkowski [email protected]
*/

#ifndef INTERFACE_ALGOMUONBASE_H_
#define INTERFACE_ALGOMUONBASE_H_
#ifndef L1T_OmtfP1_ALGOMUONBASE_H_
#define L1T_OmtfP1_ALGOMUONBASE_H_

#include "L1Trigger/L1TMuonOverlapPhase1/interface/ProcConfigurationBase.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h"
Expand Down Expand Up @@ -79,4 +79,4 @@ class AlgoMuonBase {
std::vector<boost::dynamic_bitset<> > firedLayerBitsInBx;
};

#endif /* INTERFACE_ALGOMUONBASE_H_ */
#endif /* L1T_OmtfP1_ALGOMUONBASE_H_ */
4 changes: 2 additions & 2 deletions L1Trigger/L1TMuonOverlapPhase1/interface/AngleConverterBase.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef ANGLECONVERTER_H
#define ANGLECONVERTER_H
#ifndef L1T_OmtfP1_ANGLECONVERTER_H
#define L1T_OmtfP1_ANGLECONVERTER_H

#include "L1Trigger/L1TMuonOverlapPhase1/interface/ProcConfigurationBase.h"

Expand Down
6 changes: 3 additions & 3 deletions L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* MuonStub - data structure for algorithm input
*/

#ifndef MUONOVERLAP_MUONSTUB_H_
#define MUONOVERLAP_MUONSTUB_H_
#ifndef L1T_OmtfP1_MUONSTUB_H_
#define L1T_OmtfP1_MUONSTUB_H_

#include <vector>
#include <memory>
Expand Down Expand Up @@ -87,4 +87,4 @@ typedef std::shared_ptr<const MuonStub> MuonStubPtr;
typedef std::vector<MuonStubPtr> MuonStubPtrs1D;
typedef std::vector<MuonStubPtrs1D> MuonStubPtrs2D;

#endif /* MUONOVERLAP_MUONSTUB_H_ */
#endif /* L1T_OmtfP1_MUONSTUB_H_ */
4 changes: 2 additions & 2 deletions L1Trigger/L1TMuonOverlapPhase1/interface/MuonStubMakerBase.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef L1TMUONOVERLAP_MUONSTUBMAKERBASE_H
#define L1TMUONOVERLAP_MUONSTUBMAKERBASE_H
#ifndef L1T_OmtfP1_MUONSTUBMAKERBASE_H
#define L1T_OmtfP1_MUONSTUBMAKERBASE_H

#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
Expand Down
6 changes: 3 additions & 3 deletions L1Trigger/L1TMuonOverlapPhase1/interface/MuonStubsInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Author: Karol Bunkowski [email protected]
*/

#ifndef L1TMuonOverlapPhase1_MUONSTUBSINPUT_H_
#define L1TMuonOverlapPhase1_MUONSTUBSINPUT_H_
#ifndef L1T_OmtfP1_MUONSTUBSINPUT_H_
#define L1T_OmtfP1_MUONSTUBSINPUT_H_

#include "L1Trigger/L1TMuonOverlapPhase1/interface/ProcConfigurationBase.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h"
Expand Down Expand Up @@ -50,4 +50,4 @@ class MuonStubsInput {
MuonStubPtrs2D muonStubsInLayers;
};

#endif /* L1TMuonOverlapPhase1_MUONSTUBSINPUT_H_ */
#endif /* L1T_OmtfP1_MUONSTUBSINPUT_H_ */
6 changes: 3 additions & 3 deletions L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/AlgoMuon.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef AlgoMuon_H
#define AlgoMuon_H
#ifndef L1T_OmtfP1_AlgoMuon_H
#define L1T_OmtfP1_AlgoMuon_H

#include "L1Trigger/L1TMuonOverlapPhase1/interface/AlgoMuonBase.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPatternBase.h"
Expand Down Expand Up @@ -138,4 +138,4 @@ class AlgoMuon : public AlgoMuonBase {
typedef std::shared_ptr<AlgoMuon> AlgoMuonPtr;
typedef std::vector<AlgoMuonPtr> AlgoMuons;

#endif
#endif //L1T_OmtfP1_AlgoMuon_H
4 changes: 2 additions & 2 deletions L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GhostBuster.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OMTF_GhostBuster_H
#define OMTF_GhostBuster_H
#ifndef L1T_OmtfP1_GhostBuster_H
#define L1T_OmtfP1_GhostBuster_H

#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/AlgoMuon.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/IGhostBuster.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OMTF_GhostBusterPreferRefDt_H
#define OMTF_GhostBusterPreferRefDt_H
#ifndef L1T_OmtfP1_GhostBusterPreferRefDt_H
#define L1T_OmtfP1_GhostBusterPreferRefDt_H

#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/AlgoMuon.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/IGhostBuster.h"
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPattern.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OMTF_GoldenPattern_H
#define OMTF_GoldenPattern_H
#ifndef L1T_OmtfP1_GoldenPattern_H
#define L1T_OmtfP1_GoldenPattern_H

#include "boost/multi_array/base.hpp"
#include "boost/multi_array.hpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OMTF_GoldenPatternBase_H
#define OMTF_GoldenPatternBase_H
#ifndef L1T_OmtfP1_GoldenPatternBase_H
#define L1T_OmtfP1_GoldenPatternBase_H

#include "boost/multi_array.hpp"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h"
Expand Down Expand Up @@ -156,6 +156,9 @@ class GoldenPatternBase {
//second index: myOmtfConfig->nTestRefHits
resultsArrayType results;
};


template <class GoldenPatternType> using GoldenPatternVec = std::vector<std::unique_ptr<GoldenPatternType> > ;
//////////////////////////////////
//////////////////////////////////
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OMTF_GOLDENPATTERNRESULTS_H
#define OMTF_GOLDENPATTERNRESULTS_H
#ifndef L1T_OmtfP1_GOLDENPATTERNRESULTS_H
#define L1T_OmtfP1_GOLDENPATTERNRESULTS_H

#include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFConfiguration.h"
Expand Down Expand Up @@ -136,4 +136,4 @@ class GoldenPatternResult {
const OMTFConfiguration* omtfConfig = nullptr;
};

#endif //OMTF_GOLDENPATTERNRESULTS_H
#endif //L1T_OmtfP1_GOLDENPATTERNRESULTS_H
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OMTF_GoldenPatternWithStat_H
#define OMTF_GoldenPatternWithStat_H
#ifndef L1T_OmtfP1_GoldenPatternWithStat_H
#define L1T_OmtfP1_GoldenPatternWithStat_H

#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPattern.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFinput.h"
Expand Down
6 changes: 3 additions & 3 deletions L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/IGhostBuster.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Author: kbunkow
*/

#ifndef OMTF_IGHOSTBUSTER_H_
#define OMTF_IGHOSTBUSTER_H_
#ifndef L1T_OmtfP1_IGHOSTBUSTER_H_
#define L1T_OmtfP1_IGHOSTBUSTER_H_

#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/AlgoMuon.h"

Expand All @@ -17,4 +17,4 @@ class IGhostBuster {
virtual AlgoMuons select(AlgoMuons refHitCands, int charge = 0) = 0;
};

#endif /* OMTF_IGHOSTBUSTER_H_ */
#endif /* L1T_OmtfP1_IGHOSTBUSTER_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Author: kbunkow
*/

#ifndef OMTF_IOMTFRECONSTRUCTIONOBSERVER_H_
#define OMTF_IOMTFRECONSTRUCTIONOBSERVER_H_
#ifndef L1T_OmtfP1_IOMTFRECONSTRUCTIONOBSERVER_H_
#define L1T_OmtfP1_IOMTFRECONSTRUCTIONOBSERVER_H_

#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/AlgoMuon.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFinput.h"
Expand Down Expand Up @@ -43,4 +43,4 @@ class IOMTFEmulationObserver {
virtual void endJob() = 0;
};

#endif /* OMTF_IOMTFRECONSTRUCTIONOBSERVER_H_ */
#endif /* L1T_OmtfP1_IOMTFRECONSTRUCTIONOBSERVER_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Author: kbunkow
*/

#ifndef OMTF_IPROCESSOREMULATOR_H_
#define OMTF_IPROCESSOREMULATOR_H_
#ifndef L1T_OmtfP1_IPROCESSOREMULATOR_H_
#define L1T_OmtfP1_IPROCESSOREMULATOR_H_

#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GhostBuster.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPatternResult.h"
Expand Down Expand Up @@ -51,4 +51,4 @@ class IProcessorEmulator {
virtual void printInfo() const = 0;
};

#endif /* OMTF_IPROCESSOREMULATOR_H_ */
#endif /* L1T_OmtfP1_IPROCESSOREMULATOR_H_ */
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#ifndef OMTF_OMTFConfiguration_H
#define OMTF_OMTFConfiguration_H
#ifndef L1T_OmtfP1_OMTFConfiguration_H
#define L1T_OmtfP1_OMTFConfiguration_H

#include <map>
#include <set>
#include <vector>
#include <ostream>
#include <memory>

#undef BOOST_DISABLE_ASSERTS //TODO remove for production version
//#undef BOOST_DISABLE_ASSERTS //TODO remove for production version
#include "boost/multi_array.hpp"

#include "L1Trigger/L1TMuonOverlapPhase1/interface/ProcConfigurationBase.h"
Expand Down Expand Up @@ -204,10 +204,9 @@ class OMTFConfiguration : public ProcConfigurationBase {

static const unsigned int patternsInGroup = 4;

///and this based on the actual goldenPats
//takes the groups from the kye, it should be set during xml reading, or creating the goldenPats
//takes the groups from the key, it should be set during xml reading, or creating the goldenPats
template <class GoldenPatternType>
vector2D getPatternGroups(const std::vector<std::shared_ptr<GoldenPatternType> >& goldenPats) const {
vector2D getPatternGroups(const std::vector<std::unique_ptr<GoldenPatternType> >& goldenPats) const {
//unsigned int mergedCnt = 4;
vector2D mergedPatterns;
for (unsigned int iPat = 0; iPat < goldenPats.size(); iPat++) {
Expand Down
6 changes: 3 additions & 3 deletions L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFProcessor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OMTF_OMTFProcessor_H
#define OMTF_OMTFProcessor_H
#ifndef L1T_OmtfP1_OMTFProcessor_H
#define L1T_OmtfP1_OMTFProcessor_H

#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/AlgoMuon.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPattern.h"
Expand Down Expand Up @@ -46,7 +46,7 @@ class OMTFProcessor : public ProcessorBase<GoldenPatternType>, public IProcessor
OMTFProcessor(OMTFConfiguration* omtfConfig,
const edm::ParameterSet& edmCfg,
edm::EventSetup const& evSetup,
const typename ProcessorBase<GoldenPatternType>::GoldenPatternVec& gps);
GoldenPatternVec<GoldenPatternType>&& gps);

~OMTFProcessor() override;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OMTFReconstruction_H
#define OMTFReconstruction_H
#ifndef L1T_OmtfP1_OMTFReconstruction_H
#define L1T_OmtfP1_OMTFReconstruction_H

#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GhostBuster.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/IOMTFEmulationObserver.h"
Expand All @@ -18,6 +18,7 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "FWCore/Framework/interface/ESWatcher.h"

#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
Expand Down Expand Up @@ -76,6 +77,8 @@ class OMTFReconstruction {
OMTFConfigMaker* m_OMTFConfigMaker;

std::vector<std::unique_ptr<IOMTFEmulationObserver> > observers;

edm::ESWatcher<L1TMuonOverlapParamsRcd> omtfParamsRecordWatcher;
};

#endif
6 changes: 3 additions & 3 deletions L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFSorter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OMTF_OMTFSorter_H
#define OMTF_OMTFSorter_H
#ifndef L1T_OmtfP1_OMTFSorter_H
#define L1T_OmtfP1_OMTFSorter_H

#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/SorterBase.h"
#include <vector>
Expand All @@ -17,7 +17,7 @@ class OMTFSorter : public SorterBase<GoldenPatternType> {
///as we allow two candidates with opposite charge from single 10deg region
AlgoMuons::value_type sortRefHitResults(unsigned int procIndx,
unsigned int iRefHit,
const std::vector<std::shared_ptr<GoldenPatternType> >& gPatterns,
const GoldenPatternVec<GoldenPatternType>& gPatterns,
int charge = 0) override;

private:
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFinput.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OMTF_OMTFinput_H
#define OMTF_OMTFinput_H
#ifndef L1T_OmtfP1_OMTFinput_H
#define L1T_OmtfP1_OMTFinput_H

#include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStubsInput.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OMTFinputMaker_H
#define OMTFinputMaker_H
#ifndef L1T_OmtfP1_OMTFinputMaker_H
#define L1T_OmtfP1_OMTFinputMaker_H

#include "FWCore/Framework/interface/EventSetup.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Author: kbunkow
*/

#ifndef OMTF_OMTFANGLECONVERTER_H_
#define OMTF_OMTFANGLECONVERTER_H_
#ifndef L1T_OmtfP1_OMTFANGLECONVERTER_H_
#define L1T_OmtfP1_OMTFANGLECONVERTER_H_

#include "L1Trigger/L1TMuonOverlapPhase1/interface/AngleConverterBase.h"

Expand All @@ -27,4 +27,4 @@ class OmtfAngleConverter : public AngleConverterBase {
virtual int getGlobalEtaRpc(unsigned int rawid, const unsigned int &aDigi) const;
};

#endif /* INTERFACE_OMTF_OMTFANGLECONVERTER_H_ */
#endif /* L1T_OmtfP1_OMTFANGLECONVERTER_H_ */
4 changes: 2 additions & 2 deletions L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OmtfName.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef L1Trigger_L1TMuonOverlap_OmtfName_H
#define L1Trigger_L1TMuonOverlap_OmtfName_H
#ifndef L1Trigger_L1TMuonOverlapP1_OmtfName_H
#define L1Trigger_L1TMuonOverlapP1_OmtfName_H

#include <string>
#include <ostream>
Expand Down
Loading

0 comments on commit 6623bc0

Please sign in to comment.