CMS 3D CMS Logo

L1TMuonBarrelKalmanStubProducer.cc
Go to the documentation of this file.
1 #include <memory>
4 
7 
10 
15 
17 
18 //For masks
19 
25 
26 //
27 // class declaration
28 //
29 
31 public:
34 
35  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
36 
37 private:
38  void beginStream(edm::StreamID) override;
39  void produce(edm::Event&, const edm::EventSetup&) override;
40  void endStream() override;
44  int verbose_;
46 };
47 
48 //
49 // constants, enums and typedefs
50 //
51 
52 //
53 // static data member definitions
54 //
55 
56 //
57 // constructors and destructor
58 //
60  : srcPhi_(consumes<L1MuDTChambPhContainer>(iConfig.getParameter<edm::InputTag>("srcPhi"))),
61  srcTheta_(consumes<L1MuDTChambThContainer>(iConfig.getParameter<edm::InputTag>("srcTheta"))),
62  proc_(new L1TMuonBarrelKalmanStubProcessor(iConfig)),
63  verbose_(iConfig.getParameter<int>("verbose")) {
64  produces<L1MuKBMTCombinedStubCollection>();
65 }
66 
68  // do anything here that needs to be done at destruction time
69  // (e.g. close files, deallocate resources etc.)
70  if (proc_ != nullptr)
71  delete proc_;
72 }
73 
74 //
75 // member functions
76 //
77 
78 // ------------ method called to produce the data ------------
80  using namespace edm;
82  iEvent.getByToken(srcPhi_, phiIn);
83 
85  iEvent.getByToken(srcTheta_, thetaIn);
86 
87  //Get parameters
88 
89  const L1TMuonBarrelParamsRcd& bmtfParamsRcd = iSetup.get<L1TMuonBarrelParamsRcd>();
90  bmtfParamsRcd.get(bmtfParamsHandle_);
91  const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle_.product();
92 
93  L1MuKBMTCombinedStubCollection stubs = proc_->makeStubs(phiIn.product(), thetaIn.product(), bmtfParams);
94  if (verbose_ == 1)
95  for (const auto& stub : stubs) {
96  printf("Stub: wheel=%d sector=%d station =%d tag=%d eta1=%d qeta1=%d eta2=%d qeta2=%d\n",
97  stub.whNum(),
98  stub.scNum(),
99  stub.stNum(),
100  stub.tag(),
101  stub.eta1(),
102  stub.qeta1(),
103  stub.eta2(),
104  stub.qeta2());
105  }
106 
107  if (verbose_ == 2) {
108  std::cout << "NEW" << std::endl;
109  for (uint sector = 0; sector < 12; ++sector)
110  proc_->makeInputPattern(phiIn.product(), thetaIn.product(), sector);
111  }
112 
113  iEvent.put(std::make_unique<L1MuKBMTCombinedStubCollection>(stubs));
114 }
115 
116 // ------------ method called once each stream before processing any runs, lumis or events ------------
118 
119 // ------------ method called once each stream after processing all runs, lumis and events ------------
121 
123  //The following says we do not know what parameters are allowed so do no validation
124  // Please change this to state exactly what you do use, even if it is no parameters
126  desc.setUnknown();
127  descriptions.addDefault(desc);
128 }
129 
130 //define this as a plug-in
L1TMuonBarrelKalmanStubProducer::endStream
void endStream() override
Definition: L1TMuonBarrelKalmanStubProducer.cc:120
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::StreamID
Definition: StreamID.h:30
L1TMuonBarrelKalmanStubProcessor::makeInputPattern
void makeInputPattern(const L1MuDTChambPhContainer *phiContainer, const L1MuDTChambThContainer *etaContainer, int sector)
Definition: L1TMuonBarrelKalmanStubProcessor.cc:212
L1TMuonBarrelKalmanStubProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: L1TMuonBarrelKalmanStubProducer.cc:79
L1MuDTChambThDigi.h
L1MuDTChambPhDigi.h
edm::Handle::product
T const * product() const
Definition: Handle.h:70
L1TMuonBarrelKalmanStubProducer::~L1TMuonBarrelKalmanStubProducer
~L1TMuonBarrelKalmanStubProducer() override
Definition: L1TMuonBarrelKalmanStubProducer.cc:67
edm::EDGetTokenT< L1MuDTChambPhContainer >
L1TMuonBarrelKalmanStubProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: L1TMuonBarrelKalmanStubProducer.cc:122
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1TMuonBarrelParams.h
L1MuKBMTCombinedStubCollection
std::vector< L1MuKBMTCombinedStub > L1MuKBMTCombinedStubCollection
Definition: L1MuKBMTCombinedStub.h:39
L1TMuonBarrelKalmanStubProducer::bmtfParamsHandle_
edm::ESHandle< L1TMuonBarrelParams > bmtfParamsHandle_
Definition: L1TMuonBarrelKalmanStubProducer.cc:45
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
L1TMuonBarrelKalmanStubProducer::srcTheta_
edm::EDGetTokenT< L1MuDTChambThContainer > srcTheta_
Definition: L1TMuonBarrelKalmanStubProducer.cc:42
EDProducer.h
L1MuDTChambThContainer.h
edm::Handle< L1MuDTChambPhContainer >
parallelization.uint
uint
Definition: parallelization.py:124
L1MuDTChambPhContainer
Definition: L1MuDTChambPhContainer.h:33
L1TMuonBarrelKalmanStubProcessor
Definition: L1TMuonBarrelKalmanStubProcessor.h:15
MakerMacros.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
L1TMuonBarrelKalmanStubProcessor.h
edm::ESHandle< L1TMuonBarrelParams >
L1TMuonBarrelParamsRcd.h
L1TMuonBarrelKalmanStubProducer::verbose_
int verbose_
Definition: L1TMuonBarrelKalmanStubProducer.cc:44
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
L1MuDTTFMasks.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
L1TMuonBarrelKalmanStubProcessor::makeStubs
L1MuKBMTCombinedStubCollection makeStubs(const L1MuDTChambPhContainer *, const L1MuDTChambThContainer *, const L1TMuonBarrelParams &)
Definition: L1TMuonBarrelKalmanStubProcessor.cc:94
L1MuDTChambPhContainer.h
L1TMuonBarrelKalmanStubProducer::proc_
L1TMuonBarrelKalmanStubProcessor * proc_
Definition: L1TMuonBarrelKalmanStubProducer.cc:43
L1TMuonBarrelKalmanStubProducer::beginStream
void beginStream(edm::StreamID) override
Definition: L1TMuonBarrelKalmanStubProducer.cc:117
L1TMuonBarrelKalmanStubProducer::L1TMuonBarrelKalmanStubProducer
L1TMuonBarrelKalmanStubProducer(const edm::ParameterSet &)
Definition: L1TMuonBarrelKalmanStubProducer.cc:59
L1TMuonBarrelKalmanStubProducer::srcPhi_
edm::EDGetTokenT< L1MuDTChambPhContainer > srcPhi_
Definition: L1TMuonBarrelKalmanStubProducer.cc:41
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
Frameworkfwd.h
edm::eventsetup::EventSetupRecordImplementation::get
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: EventSetupRecordImplementation.h:74
L1TMuonBarrelParams
Definition: L1TMuonBarrelParams.h:23
L1MuDTTFMasksRcd.h
ParameterSet.h
edm::Event
Definition: Event.h:73
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
L1MuDTChambThContainer
Definition: L1MuDTChambThContainer.h:33
StreamID.h
L1TMuonBarrelParamsRcd
Definition: L1TMuonBarrelParamsRcd.h:13
L1TMuonBarrelKalmanStubProducer
Definition: L1TMuonBarrelKalmanStubProducer.cc:30