CMS 3D CMS Logo

DTCollector.cc
Go to the documentation of this file.
5 
10 
11 using namespace L1TMuon;
12 
14  : SubsystemCollector(ps), bx_min(ps.getParameter<int>("BX_min")), bx_max(ps.getParameter<int>("BX_max")) {
15  if (ps.getParameter<bool>("runBunchCrossingCleaner")) {
16  const edm::ParameterSet& bxccfg = ps.getParameterSet("bxCleanerCfg");
17  _bxc.reset(new DTBunchCrossingCleaner(bxccfg));
18  } else {
19  _bxc.reset(nullptr);
20  }
21 }
22 
24  const edm::EventSetup& es,
26  TriggerPrimitiveCollection cleaned, temp, chamb_list;
29  ev.getByLabel(_src, phiDigis);
30  ev.getByLabel(_src, thetaDigis);
31  for (int wheel = -2; wheel <= 2; ++wheel) {
32  for (int station = 1; station <= 4; ++station) {
33  for (int sector = 0; sector <= 11; ++sector) {
34  chamb_list.clear();
35  for (int bx = bx_min; bx <= bx_max; ++bx) {
36  std::unique_ptr<const L1MuDTChambPhDigi> phi_segm_1(phiDigis->chPhiSegm1(wheel, station, sector, bx));
37  std::unique_ptr<const L1MuDTChambPhDigi> phi_segm_2(phiDigis->chPhiSegm2(wheel, station, sector, bx));
38  std::unique_ptr<const L1MuDTChambThDigi> theta_segm(thetaDigis->chThetaSegm(wheel, station, sector, bx));
39 
40  int bti_group_1 = -1, bti_group_2 = -1;
41 
42  if (theta_segm) {
43  bti_group_1 = findBTIGroupForThetaDigi(*theta_segm, 1);
44  bti_group_2 = findBTIGroupForThetaDigi(*theta_segm, 2);
45  }
46 
47  if (phi_segm_1 && bti_group_1 != -1) {
48  chamb_list.push_back(processDigis(*phi_segm_1, *theta_segm, bti_group_1));
49  } else if (phi_segm_1 && bti_group_1 == -1) {
50  chamb_list.push_back(processDigis(*phi_segm_1, 1));
51  } else if (!phi_segm_1 && bti_group_1 != -1) {
52  chamb_list.push_back(processDigis(*theta_segm, bti_group_1));
53  }
54 
55  if (phi_segm_2 && bti_group_2 != -1) {
56  chamb_list.push_back(processDigis(*phi_segm_2, *theta_segm, bti_group_2));
57  } else if (phi_segm_2 && bti_group_2 == -1) {
58  chamb_list.push_back(processDigis(*phi_segm_2, 2));
59  } else if (!phi_segm_2 && bti_group_2 != -1) {
60  chamb_list.push_back(processDigis(*phi_segm_2, bti_group_2));
61  }
62 
63  phi_segm_1.release();
64  phi_segm_2.release();
65  theta_segm.release();
66  }
67  if (_bxc) {
68  temp = _bxc->clean(chamb_list);
69  cleaned.insert(cleaned.end(), temp.begin(), temp.end());
70  } else {
71  cleaned.insert(cleaned.end(), chamb_list.begin(), chamb_list.end());
72  }
73  }
74  }
75  }
76  out.insert(out.end(), cleaned.begin(), cleaned.end());
77 }
78 
79 TriggerPrimitive DTCollector::processDigis(const L1MuDTChambPhDigi& digi, const int& segment_number) const {
80  DTChamberId detid(digi.whNum(), digi.stNum(), digi.scNum() + 1);
81  return TriggerPrimitive(detid, digi, segment_number);
82 }
83 
84 TriggerPrimitive DTCollector::processDigis(const L1MuDTChambThDigi& digi_th, const int bti_group) const {
85  DTChamberId detid(digi_th.whNum(), digi_th.stNum(), digi_th.scNum() + 1);
86  return TriggerPrimitive(detid, digi_th, bti_group);
87 }
88 
90  const L1MuDTChambThDigi& digi_theta,
91  const int bti_group) const {
92  DTChamberId detid(digi_phi.whNum(), digi_phi.stNum(), digi_phi.scNum() + 1);
93  return TriggerPrimitive(detid, digi_phi, digi_theta, bti_group);
94 }
95 
96 int DTCollector::findBTIGroupForThetaDigi(const L1MuDTChambThDigi& digi, const int pos) const {
97  //if( digi.stNum() == 4 ) return -1; // there is no theta layer there
98  int result = -1;
99  for (int i = 0; i < 7; ++i) {
100  if (digi.position(i) == pos)
101  result = i;
102  }
103  return result;
104 }
105 
Handle.h
mps_fire.i
i
Definition: mps_fire.py:355
L1MuDTChambThDigi::position
int position(const int i) const
Definition: L1MuDTChambThDigi.cc:90
L1MuDTChambPhDigi::stNum
int stNum() const
Definition: L1MuDTChambPhDigi.cc:72
L1TMuon::SubsystemCollector
Definition: SubsystemCollector.h:23
L1MuDTChambPhContainer::chPhiSegm1
L1MuDTChambPhDigi const * chPhiSegm1(int wheel, int stat, int sect, int bx) const
Definition: L1MuDTChambPhContainer.cc:67
relativeConstraints.station
station
Definition: relativeConstraints.py:67
pos
Definition: PixelAliasList.h:18
L1MuDTChambPhDigi::whNum
int whNum() const
Definition: L1MuDTChambPhDigi.cc:70
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1MuDTChambThDigi::whNum
int whNum() const
Definition: L1MuDTChambThDigi.cc:79
L1MuDTChambThContainer.h
edm::Handle< L1MuDTChambPhContainer >
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
L1TMuon::TriggerPrimitiveCollection
std::vector< TriggerPrimitive > TriggerPrimitiveCollection
Definition: MuonTriggerPrimitiveFwd.h:10
TriggerPrimitive
L1TMuon::TriggerPrimitive TriggerPrimitive
Definition: Common.h:31
L1MuDTChambThDigi::scNum
int scNum() const
Definition: L1MuDTChambThDigi.cc:80
L1TMuon::TriggerPrimitive
Definition: MuonTriggerPrimitive.h:56
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
DTChamberId.h
SubsystemCollectorFactory.h
L1TMuon::DTCollector
Definition: DTCollector.h:22
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
L1MuDTChambPhContainer::chPhiSegm2
L1MuDTChambPhDigi const * chPhiSegm2(int wheel, int stat, int sect, int bx) const
Definition: L1MuDTChambPhContainer.cc:78
edmplugin::PluginFactory
Definition: PluginFactory.h:34
L1TMuon::DTCollector::extractPrimitives
void extractPrimitives(const edm::Event &, const edm::EventSetup &, std::vector< TriggerPrimitive > &) const override
Definition: DTCollector.cc:23
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
createfilelist.int
int
Definition: createfilelist.py:10
edm::EventSetup
Definition: EventSetup.h:57
L1MuDTChambPhDigi::scNum
int scNum() const
Definition: L1MuDTChambPhDigi.cc:71
L1TMuon::DTBunchCrossingCleaner
Definition: DTBunchCrossingCleaner.h:22
L1MuDTChambPhContainer.h
L1TMuon
Definition: CSCCollector.h:15
L1MuDTChambThContainer::chThetaSegm
L1MuDTChambThDigi const * chThetaSegm(int wheel, int stat, int sect, int bx) const
Definition: L1MuDTChambThContainer.cc:65
L1TMuon::DTCollector::findBTIGroupForThetaDigi
int findBTIGroupForThetaDigi(const L1MuDTChambThDigi &, const int position) const
Definition: DTCollector.cc:96
L1MuDTChambThDigi::stNum
int stNum() const
Definition: L1MuDTChambThDigi.cc:81
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
DTCollector.h
L1TMuon::DTCollector::DTCollector
DTCollector(const edm::ParameterSet &)
Definition: DTCollector.cc:13
L1TMuon::SubsystemCollector::_src
edm::InputTag _src
Definition: SubsystemCollector.h:31
L1TMuon::DTCollector::bx_max
const int bx_max
Definition: DTCollector.h:34
L1MuDTChambThDigi
Definition: L1MuDTChambThDigi.h:33
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
L1TMuon::DTCollector::bx_min
const int bx_min
Definition: DTCollector.h:34
EventSetup.h
L1TMuon::DTCollector::_bxc
std::unique_ptr< DTBunchCrossingCleaner > _bxc
Definition: DTCollector.h:35
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
mps_fire.result
result
Definition: mps_fire.py:303
DTChamberId
Definition: DTChamberId.h:14
ParameterSet.h
edm::Event
Definition: Event.h:73
L1TMuon::DTCollector::processDigis
TriggerPrimitive processDigis(const L1MuDTChambPhDigi &, const int &segment_number) const
Definition: DTCollector.cc:79
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2121
L1MuDTChambPhDigi
Definition: L1MuDTChambPhDigi.h:31