CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTCollector.cc
Go to the documentation of this file.
5 
10 
11 using namespace L1TMuon;
12 
15  bx_min(ps.getParameter<int>("BX_min")),
16  bx_max(ps.getParameter<int>("BX_max")) {
17  if( ps.getParameter<bool>("runBunchCrossingCleaner") ) {
18  edm::ParameterSet bxccfg = ps.getParameterSet("bxCleanerCfg");
19  _bxc.reset(new DTBunchCrossingCleaner(bxccfg));
20  } else {
21  _bxc.reset(NULL);
22  }
23 }
24 
26  const edm::EventSetup& es,
28  TriggerPrimitiveCollection cleaned, temp, chamb_list;
31  ev.getByLabel(_src,phiDigis);
32  ev.getByLabel(_src,thetaDigis);
33  for( int wheel = -2; wheel <= 2 ; ++wheel ) {
34  for( int station = 1; station <= 4; ++station ) {
35  for( int sector = 0; sector <= 11; ++sector ) {
36  chamb_list.clear();
37  for( int bx = bx_min; bx <= bx_max; ++bx) {
38  std::unique_ptr<const L1MuDTChambPhDigi> phi_segm_1(
39  phiDigis->chPhiSegm1(wheel,station,sector,bx)
40  );
41  std::unique_ptr<const L1MuDTChambPhDigi> phi_segm_2(
42  phiDigis->chPhiSegm2(wheel,station,sector,bx)
43  );
44  std::unique_ptr<const L1MuDTChambThDigi> theta_segm(
45  thetaDigis->chThetaSegm(wheel,station,sector,bx)
46  );
47 
48  int bti_group_1=-1, bti_group_2=-1;
49 
50  if( theta_segm ) {
51  bti_group_1 = findBTIGroupForThetaDigi(*theta_segm,1);
52  bti_group_2 = findBTIGroupForThetaDigi(*theta_segm,2);
53  }
54 
55  if( phi_segm_1 && bti_group_1 != -1 ) {
56  chamb_list.push_back(processDigis(*phi_segm_1,
57  *theta_segm,
58  bti_group_1));
59  } else if ( phi_segm_1 && bti_group_1 == -1 ) {
60  chamb_list.push_back(processDigis(*phi_segm_1,1));
61  } else if ( !phi_segm_1 && bti_group_1 != -1 ) {
62  chamb_list.push_back(processDigis(*theta_segm,
63  bti_group_1));
64  }
65 
66  if( phi_segm_2 && bti_group_2 != -1) {
67  chamb_list.push_back(processDigis(*phi_segm_2,
68  *theta_segm,
69  bti_group_2));
70  } else if ( phi_segm_2 && bti_group_2 == -1 ) {
71  chamb_list.push_back(processDigis(*phi_segm_2,2));
72  } else if ( !phi_segm_2 && bti_group_2 != -1 ) {
73  chamb_list.push_back(processDigis(*phi_segm_2,bti_group_2));
74  }
75 
76  phi_segm_1.release();
77  phi_segm_2.release();
78  theta_segm.release();
79  }
80  if( _bxc ) {
81  temp = _bxc->clean(chamb_list);
82  cleaned.insert(cleaned.end(),temp.begin(),temp.end());
83  } else {
84  cleaned.insert(cleaned.end(),chamb_list.begin(),chamb_list.end());
85  }
86  }
87  }
88  }
89  out.insert(out.end(),cleaned.begin(),cleaned.end());
90 }
91 
93  const int &segment_number) const {
94  DTChamberId detid(digi.whNum(),digi.stNum(),digi.scNum()+1);
95  return TriggerPrimitive(detid,digi,segment_number);
96 }
97 
99  const int bti_group) const {
100  DTChamberId detid(digi_th.whNum(),digi_th.stNum(),digi_th.scNum()+1);
101  return TriggerPrimitive(detid,digi_th,bti_group);
102 }
103 
105  const L1MuDTChambThDigi& digi_theta,
106  const int bti_group) const {
107  DTChamberId detid(digi_phi.whNum(),digi_phi.stNum(),digi_phi.scNum()+1);
108  return TriggerPrimitive(detid,digi_phi,digi_theta,bti_group);
109 }
110 
111 int DTCollector::
113  const int pos) const {
114  //if( digi.stNum() == 4 ) return -1; // there is no theta layer there
115  int result = -1;
116  for( int i = 0; i < 7; ++i ) {
117  if( digi.position(i) == pos ) result = i;
118  }
119  return result;
120 }
121 
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
DTCollector(const edm::ParameterSet &)
Definition: DTCollector.cc:13
#define NULL
Definition: scimark2.h:8
bool ev
std::unique_ptr< DTBunchCrossingCleaner > _bxc
Definition: DTCollector.h:40
int findBTIGroupForThetaDigi(const L1MuDTChambThDigi &, const int position) const
Definition: DTCollector.cc:112
tuple result
Definition: mps_fire.py:83
TriggerPrimitive processDigis(const L1MuDTChambPhDigi &, const int &segment_number) const
Definition: DTCollector.cc:92
int position(const int i) const
std::vector< TriggerPrimitive > TriggerPrimitiveCollection
virtual void extractPrimitives(const edm::Event &, const edm::EventSetup &, std::vector< TriggerPrimitive > &) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
ParameterSet const & getParameterSet(std::string const &) const
#define DEFINE_EDM_PLUGIN(factory, type, name)