4040#include " L1Trigger/DTTriggerPhase2/interface/MPSLFilter.h"
4141#include " L1Trigger/DTTriggerPhase2/interface/MPCorFilter.h"
4242#include " L1Trigger/DTTriggerPhase2/interface/MPCoincidenceFilter.h"
43+ #include " L1Trigger/DTTriggerPhase2/interface/MPThetaMatching.h"
4344#include " L1Trigger/DTTriggerPhase2/interface/MPQualityEnhancerFilter.h"
4445#include " L1Trigger/DTTriggerPhase2/interface/MPRedundantFilter.h"
4546#include " L1Trigger/DTTriggerPhase2/interface/MPCleanHitsFilter.h"
@@ -138,6 +139,8 @@ class DTTrigPhase2Prod : public edm::stream::EDProducer<> {
138139 int df_extended_;
139140 int co_option_; // coincidence
140141 int co_quality_;
142+ int th_option_; // theta matching
143+ int th_quality_;
141144 int max_index_;
142145
143146 bool output_mixer_;
@@ -166,6 +169,7 @@ class DTTrigPhase2Prod : public edm::stream::EDProducer<> {
166169 std::unique_ptr<MuonPathConfirmator> mpathconfirmator_;
167170 std::unique_ptr<MPFilter> mpathcorfilter_;
168171 std::unique_ptr<MPFilter> mpathcoifilter_;
172+ std::unique_ptr<MPFilter> mpaththetamatching_;
169173 std::shared_ptr<GlobalCoordsObtainer> globalcoordsobtainer_;
170174
171175 // Buffering
@@ -210,6 +214,8 @@ DTTrigPhase2Prod::DTTrigPhase2Prod(const ParameterSet& pset)
210214 df_extended_ = pset.getParameter <int >(" df_extended" );
211215 co_option_ = pset.getParameter <int >(" co_option" );
212216 co_quality_ = pset.getParameter <int >(" co_quality" );
217+ th_option_ = pset.getParameter <int >(" th_option" );
218+ th_quality_ = pset.getParameter <int >(" th_quality" );
213219 max_index_ = pset.getParameter <int >(" max_primitives" ) - 1 ;
214220
215221 dtDigisToken_ = consumes<DTDigiCollection>(pset.getParameter <edm::InputTag>(" digiTag" ));
@@ -268,6 +274,7 @@ DTTrigPhase2Prod::DTTrigPhase2Prod(const ParameterSet& pset)
268274 mpathassociator_ = std::make_unique<MuonPathCorFitter>(pset, consumesColl, globalcoordsobtainer_);
269275 mpathcorfilter_ = std::make_unique<MPCorFilter>(pset);
270276 mpathcoifilter_ = std::make_unique<MPCoincidenceFilter>(pset);
277+ mpaththetamatching_ = std::make_unique<MPThetaMatching>(pset);
271278 rpc_integrator_ = std::make_unique<RPCIntegrator>(pset, consumesColl);
272279
273280 dtGeomH = esConsumes<DTGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
@@ -293,6 +300,7 @@ void DTTrigPhase2Prod::beginRun(edm::Run const& iRun, const edm::EventSetup& iEv
293300 mpathassociator_->initialise (iEventSetup); // Associator object initialisation
294301 mpathcorfilter_->initialise (iEventSetup);
295302 mpathcoifilter_->initialise (iEventSetup);
303+ mpaththetamatching_->initialise (iEventSetup);
296304
297305 if (auto geom = iEventSetup.getHandle (dtGeomH)) {
298306 dtGeo_ = &(*geom);
@@ -854,6 +862,23 @@ void DTTrigPhase2Prod::produce(Event& iEvent, const EventSetup& iEventSetup) {
854862
855863 allMetaPrimitives.clear ();
856864
865+ // Theta (th) matching filter
866+ std::map<int , std::vector<metaPrimitive>> thMatchedMetaPrimitives;
867+ if (algo_ == Standard) {
868+ for (auto & ch_filtcoMetaPrimitives : coMetaPrimitives) {
869+ if (!skip_processing_)
870+ mpaththetamatching_->run (iEvent,
871+ iEventSetup,
872+ coMetaPrimitives[ch_filtcoMetaPrimitives.first ],
873+ thMatchedMetaPrimitives[ch_filtcoMetaPrimitives.first ]);
874+ else {
875+ for (auto & mp : ch_filtcoMetaPrimitives.second ) {
876+ thMatchedMetaPrimitives[ch_filtcoMetaPrimitives.first ].push_back (mp);
877+ }
878+ }
879+ }
880+ }
881+
857882 // ///////////
858883
859884 double shift_back = 0 ;
@@ -868,8 +893,8 @@ void DTTrigPhase2Prod::produce(Event& iEvent, const EventSetup& iEventSetup) {
868893 if (useRPC_) {
869894 rpc_integrator_->initialise (iEventSetup, shift_back);
870895 rpc_integrator_->prepareMetaPrimitives (rpcRecHits);
871- for (auto & ch_correlatedMetaPrimitives : coMetaPrimitives ) {
872- rpc_integrator_->matchWithDTAndUseRPCTime (ch_correlatedMetaPrimitives .second ); // Probably this is a FIXME
896+ for (auto & ch_thMatchedMetaPrimitives : thMatchedMetaPrimitives ) {
897+ rpc_integrator_->matchWithDTAndUseRPCTime (ch_thMatchedMetaPrimitives .second ); // Probably this is a FIXME
873898 }
874899 rpc_integrator_->makeRPCOnlySegments ();
875900 rpc_integrator_->storeRPCSingleHits ();
@@ -884,12 +909,12 @@ void DTTrigPhase2Prod::produce(Event& iEvent, const EventSetup& iEventSetup) {
884909
885910 // Assigning index value
886911 if (!skip_processing_)
887- for (auto & ch_correlatedMetaPrimitives : coMetaPrimitives ) {
888- assignIndex (ch_correlatedMetaPrimitives .second );
912+ for (auto & ch_thMatchedMetaPrimitives : thMatchedMetaPrimitives ) {
913+ assignIndex (ch_thMatchedMetaPrimitives .second );
889914 }
890915
891- for (auto & ch_correlatedMetaPrimitives : coMetaPrimitives ) {
892- for (const auto & metaPrimitiveIt : ch_correlatedMetaPrimitives .second ) {
916+ for (auto & ch_thMatchedMetaPrimitives : thMatchedMetaPrimitives ) {
917+ for (const auto & metaPrimitiveIt : ch_thMatchedMetaPrimitives .second ) {
893918 DTChamberId chId (metaPrimitiveIt.rawId );
894919 DTSuperLayerId slId (metaPrimitiveIt.rawId );
895920 if (debug_)
@@ -1293,6 +1318,8 @@ void DTTrigPhase2Prod::fillDescriptions(edm::ConfigurationDescriptions& descript
12931318 desc.add <int >(" df_extended" , 0 );
12941319 desc.add <int >(" co_option" , 0 );
12951320 desc.add <int >(" co_quality" , 0 );
1321+ desc.add <int >(" th_option" , 0 );
1322+ desc.add <int >(" th_quality" , 0 );
12961323 desc.add <int >(" max_primitives" , 999 );
12971324 desc.add <bool >(" output_mixer" , false );
12981325 desc.add <bool >(" output_latpredictor" , false );
0 commit comments