CMS 3D CMS Logo

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