Skip to content

Commit 3491457

Browse files
committed
Debugged version with Theta selection q=3
1 parent 57ac712 commit 3491457

File tree

4 files changed

+240
-135
lines changed

4 files changed

+240
-135
lines changed

L1Trigger/DTTriggerPhase2/interface/MPThetaMatching.h

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
// Class declarations
1515
// ===============================================================================
1616

17-
1817
class MPThetaMatching : public MPFilter {
1918
public:
2019
// Constructors and destructor
@@ -27,6 +26,11 @@ class MPThetaMatching : public MPFilter {
2726
const edm::EventSetup &iEventSetup,
2827
std::vector<cmsdt::metaPrimitive> &inMPaths,
2928
std::vector<cmsdt::metaPrimitive> &outMPaths) override;
29+
void run(edm::Event &iEvent,
30+
const edm::EventSetup &iEventSetup,
31+
std::vector<cmsdt::metaPrimitive> &allMPaths,
32+
std::vector<cmsdt::metaPrimitive> &inMPaths,
33+
std::vector<cmsdt::metaPrimitive> &outMPaths) override{};
3034
void run(edm::Event &iEvent,
3135
const edm::EventSetup &iEventSetup,
3236
MuonPathPtrs &inMPath,
@@ -38,33 +42,34 @@ class MPThetaMatching : public MPFilter {
3842

3943
// Public attributes
4044

41-
float vwire = 24.4 ; // cm/ns
42-
// float zFE[5] = {-654., -389., 123., 389., 654.}; //cm
43-
// float xFE[3] = {199/2., 245/2., 303/2.};//cm
44-
float zFE[5] = {-658.9, -393.3, 126.4, 393.3, 658.9}; //cm
45-
float xFE[3] = {218/2., 266.8/2., 315/2.};//cm
46-
float ZRES_CONV = 65536. / 1500;
45+
float vwire = 24.4; // cm/ns
46+
// float zFE[5] = {-654., -389., 123., 389., 654.}; //cm
47+
// float xFE[3] = {199/2., 245/2., 303/2.};//cm
48+
float zFE[5] = {-658.9, -393.3, 126.4, 393.3, 658.9}; //cm
49+
float xFE[3] = {218 / 2., 266.8 / 2., 315 / 2.}; //cm
50+
float ZRES_CONV = 65536. / 1500;
4751

4852
private:
4953
// Private methods
5054
std::vector<cmsdt::metaPrimitive> filter(std::vector<cmsdt::metaPrimitive> inMPs,
51-
int th_option,
52-
int th_quality,
53-
double shift_back);
55+
int th_option,
56+
int th_quality,
57+
double shift_back);
58+
59+
bool isThereThetaMPInChamber(int sector, int wheel, int station, std::vector<cmsdt::metaPrimitive> thetaMPs);
60+
std::vector<cmsdt::metaPrimitive> getBestThetaMPInChamber(std::vector<cmsdt::metaPrimitive> thetaMPs);
5461

55-
bool isThereThetaMPInChamber(int sector,int wheel,int station,std::vector<cmsdt::metaPrimitive> thetaMPs);
56-
// Lambda function to compare pairs based on the float value, ascending order
57-
static bool compare(const std::pair<cmsdt::metaPrimitive, float>& a, const std::pair<cmsdt::metaPrimitive, float>& b) {
58-
return a.second < b.second;
59-
};
62+
// Function to compare pairs based on the float value, ascending order
63+
static bool compare(const std::pair<cmsdt::metaPrimitive, float> &a,
64+
const std::pair<cmsdt::metaPrimitive, float> &b) {
65+
return a.second < b.second;
66+
};
6067

6168
// Private attributes
6269
const bool debug_;
6370
int th_option_;
64-
int th_quality_;
71+
int th_quality_;
6572
int scenario_;
66-
67-
6873
};
6974

7075
#endif

L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2Prod.cc

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
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);

L1Trigger/DTTriggerPhase2/python/dtTriggerPhase2PrimitiveDigis_cfi.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
df_extended = cms.int32(0), # DF: 0 for standard, 1 for extended, 2 for both
2626
co_option = cms.int32(1), # coincidence w.r.t. : -1 = off, 0 = co all, 1 = co phi, 2 = co theta
2727
co_quality = cms.int32(1), # quality cut (>X) for coincidence TP
28+
th_option = cms.int32(1), # save 1st, 2nd, 3rd,... closest phi TP to theta TP. 0 disables filtering, i.e. saves all
29+
th_quality = cms.int32(5), # quality cut (>X) for Theta matching: Phi TPs above this quality are not filtered
2830
max_primitives = cms.int32(999),
2931

3032
output_mixer = cms.bool(False),

0 commit comments

Comments
 (0)