Skip to content

Commit 5c0ff13

Browse files
authored
Merge pull request #47693 from jfernan2/AMv2.2
[L1T] DT Trigger Phase-2 Analytical Method (AM) v2.2
2 parents ba77e8a + b36e41a commit 5c0ff13

30 files changed

+1596
-10
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
//-------------------------------------------------
2+
//
3+
// Class L1Phase2MuDTShower
4+
//
5+
// Description: shower primitive data for the
6+
// muon barrel Phase2 trigger
7+
//
8+
//
9+
// Author List:
10+
// Federica Primavera Bologna INFN
11+
// Carlos Vico Oviedo Spain,
12+
// Daniel Estrada Acevedo Oviedo Spain.
13+
//
14+
//
15+
//--------------------------------------------------
16+
#ifndef L1Phase2MuDTShower_H
17+
#define L1Phase2MuDTShower_H
18+
19+
//---------------
20+
// C++ Headers --
21+
//---------------
22+
#include <vector>
23+
24+
// ---------------------
25+
// -- Class Interface --
26+
// ---------------------
27+
28+
class L1Phase2MuDTShower {
29+
public:
30+
// Constructors
31+
32+
L1Phase2MuDTShower();
33+
34+
L1Phase2MuDTShower(int wh, // Wheel
35+
int sc, // Sector
36+
int st, // Station
37+
int sl, // Superlayer
38+
int ndigis, // Number of digis within shower
39+
int bx, // BX estimation
40+
int min_wire, // Minimum wire
41+
int max_wire, // Maximum wire
42+
float avg_pos, // Averaged position of the shower
43+
float avg_time, // Averaged time of the shower
44+
const std::vector<int> wires_profile // Wires profile
45+
);
46+
47+
// Operations
48+
49+
int whNum() const;
50+
int scNum() const;
51+
int stNum() const;
52+
int slNum() const;
53+
int ndigis() const;
54+
int bxNum() const;
55+
int minWire() const;
56+
int maxWire() const;
57+
float avg_time() const;
58+
float avg_pos() const;
59+
std::vector<int> wiresProfile() const;
60+
61+
private:
62+
int m_wheel;
63+
int m_sector;
64+
int m_station;
65+
int m_superlayer;
66+
int m_ndigis;
67+
int m_bx;
68+
int m_min_wire;
69+
int m_max_wire;
70+
float m_avg_pos;
71+
float m_avg_time;
72+
std::vector<int> m_wires_profile;
73+
};
74+
75+
#endif
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//-------------------------------------------------
2+
//
3+
// Class L1Phase2MuDTShowerContainer
4+
//
5+
// Description: trigger primtive data for the
6+
// muon barrel Phase2 trigger shower
7+
//
8+
//
9+
// Author List: Daniel Estrada Acevedo Oviedo Spain
10+
//
11+
//
12+
//--------------------------------------------------
13+
#ifndef L1Phase2MuDTShowerContainer_H
14+
#define L1Phase2MuDTShowerContainer_H
15+
16+
//------------------------------------
17+
// Collaborating Class Declarations --
18+
//------------------------------------
19+
#include "DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTShower.h"
20+
21+
//----------------------
22+
// Base Class Headers --
23+
//----------------------
24+
#include <vector>
25+
26+
// ---------------------
27+
// -- Class Interface --
28+
// ---------------------
29+
30+
class L1Phase2MuDTShowerContainer {
31+
public:
32+
typedef std::vector<L1Phase2MuDTShower> Shower_Container;
33+
typedef Shower_Container::const_iterator Shower_iterator;
34+
35+
// Constructor
36+
L1Phase2MuDTShowerContainer();
37+
38+
void setContainer(const Shower_Container& inputShowers);
39+
40+
Shower_Container const* getContainer() const;
41+
42+
private:
43+
Shower_Container m_showers;
44+
};
45+
46+
#endif
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
//-------------------------------------------------
2+
//
3+
// Class L1Phase2MuDTShower
4+
//
5+
// Description: trigger primitive data for the
6+
// muon barrel Phase2 trigger showers
7+
//
8+
//
9+
// Author List:
10+
// Carlos Vico Oviedo Spain,
11+
// Daniel Estrada Acevedo Oviedo Spain.
12+
//
13+
//
14+
//--------------------------------------------------
15+
16+
//-----------------------
17+
// This Class's Header --
18+
//-----------------------
19+
#include "DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTShower.h"
20+
21+
//----------------
22+
// Constructors --
23+
//----------------
24+
L1Phase2MuDTShower::L1Phase2MuDTShower()
25+
: m_wheel(0),
26+
m_sector(0),
27+
m_station(0),
28+
m_superlayer(0),
29+
m_ndigis(0),
30+
m_bx(-100),
31+
m_min_wire(0),
32+
m_max_wire(0),
33+
m_avg_pos(0),
34+
m_avg_time(0) {
35+
m_wires_profile.resize(96, 0);
36+
}
37+
38+
L1Phase2MuDTShower::L1Phase2MuDTShower(int wh,
39+
int sc,
40+
int st,
41+
int sl,
42+
int ndigis,
43+
int bx,
44+
int min_wire,
45+
int max_wire,
46+
float avg_pos,
47+
float avg_time,
48+
const std::vector<int> wires_profile)
49+
: m_wheel(wh),
50+
m_sector(sc),
51+
m_station(st),
52+
m_superlayer(sl),
53+
m_ndigis(ndigis),
54+
m_bx(bx),
55+
m_min_wire(min_wire),
56+
m_max_wire(max_wire),
57+
m_avg_pos(avg_pos),
58+
m_avg_time(avg_time),
59+
m_wires_profile(wires_profile) {}
60+
61+
//--------------
62+
// Operations --
63+
//--------------
64+
65+
int L1Phase2MuDTShower::whNum() const { return m_wheel; }
66+
67+
int L1Phase2MuDTShower::scNum() const { return m_sector; }
68+
69+
int L1Phase2MuDTShower::stNum() const { return m_station; }
70+
71+
int L1Phase2MuDTShower::slNum() const { return m_superlayer; }
72+
73+
int L1Phase2MuDTShower::ndigis() const { return m_ndigis; }
74+
75+
int L1Phase2MuDTShower::bxNum() const { return m_bx; }
76+
77+
int L1Phase2MuDTShower::minWire() const { return m_min_wire; }
78+
79+
int L1Phase2MuDTShower::maxWire() const { return m_max_wire; }
80+
81+
float L1Phase2MuDTShower::avg_time() const { return m_avg_time; }
82+
83+
float L1Phase2MuDTShower::avg_pos() const { return m_avg_pos; }
84+
85+
std::vector<int> L1Phase2MuDTShower::wiresProfile() const { return m_wires_profile; }
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//-------------------------------------------------
2+
//
3+
// Class L1Phase2MuDTShowerContainer
4+
//
5+
// Description: trigger primitive data for the
6+
// muon barrel Phase2 trigger shower
7+
//
8+
//
9+
// Author List: Daniel Estrada Acevedo Oviedo Spain.
10+
//
11+
//
12+
//--------------------------------------------------
13+
14+
//-----------------------
15+
// This Class's Header --
16+
//-----------------------
17+
#include "DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTShowerContainer.h"
18+
19+
//----------------
20+
// Constructors --
21+
//----------------
22+
L1Phase2MuDTShowerContainer::L1Phase2MuDTShowerContainer() {}
23+
24+
//--------------
25+
// Operations --
26+
//--------------
27+
void L1Phase2MuDTShowerContainer::setContainer(const Shower_Container& inputShowers) { m_showers = inputShowers; }
28+
29+
L1Phase2MuDTShowerContainer::Shower_Container const* L1Phase2MuDTShowerContainer::getContainer() const {
30+
return &m_showers;
31+
}

DataFormats/L1DTTrackFinder/src/classes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
#include <DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h>
66
#include <DataFormats/L1DTTrackFinder/interface/L1MuDTTrackContainer.h>
77
#include <DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTPhDigi.h>
8+
#include <DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTShower.h>
89
#include <DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTPhContainer.h>
910
#include <DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTThDigi.h>
1011
#include <DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTThContainer.h>
1112
#include <DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTExtPhDigi.h>
1213
#include <DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTExtPhContainer.h>
1314
#include <DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTExtThDigi.h>
1415
#include <DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTExtThContainer.h>
16+
#include <DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTShowerContainer.h>
1517
#include <DataFormats/Common/interface/Wrapper.h>

DataFormats/L1DTTrackFinder/src/classes_def.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
<class name="L1Phase2MuDTPhDigi" ClassVersion="3">
1717
<version ClassVersion="3" checksum="1236020577"/>
1818
</class>
19+
20+
<class name="L1Phase2MuDTShower" ClassVersion="3">
21+
<version ClassVersion="3" checksum="448482846"/>
22+
</class>
23+
1924
<class name="L1Phase2MuDTExtPhDigi"/>
2025
<class name="L1Phase2MuDTThDigi"/>
2126
<class name="L1Phase2MuDTExtThDigi"/>
@@ -28,6 +33,7 @@
2833
<class name="std::vector<L1Phase2MuDTThDigi>"/>
2934
<class name="std::vector<L1Phase2MuDTExtPhDigi>"/>
3035
<class name="std::vector<L1Phase2MuDTExtThDigi>"/>
36+
<class name="std::vector<L1Phase2MuDTShower>"/>
3137

3238
<class name="L1MuDTChambPhContainer" ClassVersion="10">
3339
<version ClassVersion="10" checksum="407874824"/>
@@ -42,6 +48,11 @@
4248
<class name="L1Phase2MuDTPhContainer" ClassVersion="3">
4349
<version ClassVersion="3" checksum="2858706077"/>
4450
</class>
51+
52+
<class name="L1Phase2MuDTShowerContainer" ClassVersion="3">
53+
<version ClassVersion="3" checksum="9565899"/>
54+
</class>
55+
4556
<class name="L1Phase2MuDTThContainer"/>
4657
<class name="L1Phase2MuDTExtPhContainer"/>
4758
<class name="L1Phase2MuDTExtThContainer"/>
@@ -55,5 +66,11 @@
5566
<class name="edm::Wrapper<L1Phase2MuDTThContainer>" splitLevel="0"/>
5667
<class name="edm::Wrapper<L1Phase2MuDTExtPhContainer>" splitLevel="0"/>
5768
<class name="edm::Wrapper<L1Phase2MuDTExtThContainer>" splitLevel="0"/>
69+
<class name="edm::Wrapper<L1Phase2MuDTShowerContainer>" splitLevel="0"/>
70+
71+
<class name="edm::Wrapper<std::vector<L1Phase2MuDTPhDigi> >" />
72+
<class name="edm::Wrapper<std::vector<L1Phase2MuDTThDigi> >" />
73+
<class name="edm::Wrapper<std::vector<L1Phase2MuDTExtPhDigi> >" />
74+
<class name="edm::Wrapper<std::vector<L1Phase2MuDTExtThDigi> >" />
5875

5976
</lcgdict>

L1Trigger/Configuration/python/SimL1Emulator_cff.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
_phase2_siml1emulator.add(CalibratedDigis)
7878
from L1Trigger.DTTriggerPhase2.dtTriggerPhase2PrimitiveDigis_cfi import *
7979
_phase2_siml1emulator.add(dtTriggerPhase2PrimitiveDigis)
80+
from L1Trigger.DTTriggerPhase2.dtTriggerPhase2Showers_cfi import *
81+
_phase2_siml1emulator.add(dtTriggerPhase2Shower)
8082

8183
# HGCAL TP
8284
# ########################################################################

L1Trigger/DTTriggerPhase2/interface/MPCoincidenceFilter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,14 @@ class MPCoincidenceFilter : public MPFilter {
7272
std::vector<cmsdt::metaPrimitive> allMPs,
7373
int co_option,
7474
int co_quality,
75+
int co_wh2option,
7576
double shift_back);
7677

7778
// Private attributes
7879
const bool debug_;
7980
int co_option_;
8081
int co_quality_;
82+
int co_wh2option_;
8183
int scenario_;
8284
};
8385

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#ifndef Phase2L1Trigger_DTTrigger_MPThetaMatching_h
2+
#define Phase2L1Trigger_DTTrigger_MPThetaMatching_h
3+
4+
#include "L1Trigger/DTTriggerPhase2/interface/MPFilter.h"
5+
6+
#include <iostream>
7+
#include <fstream>
8+
9+
// ===============================================================================
10+
// Previous definitions and declarations
11+
// ===============================================================================
12+
13+
// ===============================================================================
14+
// Class declarations
15+
// ===============================================================================
16+
17+
class MPThetaMatching : public MPFilter {
18+
public:
19+
// Constructors and destructor
20+
MPThetaMatching(const edm::ParameterSet &pset);
21+
~MPThetaMatching() override; // = default;
22+
23+
// Main methods
24+
void initialise(const edm::EventSetup &iEventSetup) override;
25+
void run(edm::Event &iEvent,
26+
const edm::EventSetup &iEventSetup,
27+
std::vector<cmsdt::metaPrimitive> &inMPaths,
28+
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 {};
34+
void run(edm::Event &iEvent,
35+
const edm::EventSetup &iEventSetup,
36+
MuonPathPtrs &inMPath,
37+
MuonPathPtrs &outMPath) override {};
38+
39+
void finish() override;
40+
41+
// Public attributes
42+
43+
private:
44+
// Private methods
45+
std::vector<cmsdt::metaPrimitive> filter(std::vector<cmsdt::metaPrimitive> inMPs, double shift_back);
46+
47+
bool isThereThetaMPInChamber(int sector, int wheel, int station, std::vector<cmsdt::metaPrimitive> thetaMPs);
48+
std::vector<cmsdt::metaPrimitive> getBestThetaMPInChamber(std::vector<cmsdt::metaPrimitive> thetaMPs);
49+
50+
// Function to compare pairs based on the float value, ascending order
51+
static bool comparePairs(const std::tuple<cmsdt::metaPrimitive, cmsdt::metaPrimitive, float> &a,
52+
const std::tuple<cmsdt::metaPrimitive, cmsdt::metaPrimitive, float> &b) {
53+
return std::get<2>(a) < std::get<2>(b);
54+
};
55+
void orderAndSave(std::vector<std::tuple<cmsdt::metaPrimitive, cmsdt::metaPrimitive, float>> deltaTimePosPhiCands,
56+
std::vector<cmsdt::metaPrimitive> *outMPaths,
57+
std::vector<cmsdt::metaPrimitive> *savedThetas);
58+
59+
// Private attributes
60+
const bool debug_;
61+
int th_option_;
62+
int th_quality_;
63+
int scenario_;
64+
};
65+
66+
#endif

0 commit comments

Comments
 (0)