CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
L1TwinMux::PrimitiveCombiner Class Reference

#include <PrimitiveCombiner.h>

Classes

struct  resolutions
 a struct useful for resulution info sharing More...
 
struct  results
 a struct for internal usage: store results More...
 

Public Member Functions

void addDt (const L1TMuon::TriggerPrimitive &prim)
 feed the combiner with the available primitives More...
 
void addDtHI (const L1TMuon::TriggerPrimitive &prim)
 
void addDtHO (const L1TMuon::TriggerPrimitive &prim)
 
void addRpcIn (const L1TMuon::TriggerPrimitive &prim)
 
void addRpcOut (const L1TMuon::TriggerPrimitive &prim)
 
int bendingAngle () const
 
int bendingResol () const
 
int bx () const
 output result variables More...
 
void combine ()
 do combine the primitives More...
 
int getUncorrelatedQuality16 () const
 
int getUncorrelatedQuality7 () const
 FIXME END. More...
 
bool isValid () const
 valid if we have at least: 1 rpc; 1 dt + 1 any More...
 
float phiBCombined (const float &xDt, const float &zDt, const float &xRpc, const float &zRpc)
 FIXME : Calculates new phiBending, check how to use. More...
 
float phiBCombinedResol (const float &resol_xDt, const float &resol_xRpc, const float &zDt, const float &zRpc)
 FIXME END. More...
 
 PrimitiveCombiner (const resolutions &res, edm::ESHandle< DTGeometry > &muonGeom)
 
int radialAngle () const
 

Private Member Functions

results combineDt (const L1TMuon::TriggerPrimitive *dt, const L1TMuon::TriggerPrimitive *rpc)
 Calculates new phiBending, check how to use weights. More...
 
results combineDtRpc (const L1TMuon::TriggerPrimitive *dt, const L1TMuon::TriggerPrimitive *rpc)
 Calculates new phiBending, check how to use weights. More...
 
results combineRpcRpc (const L1TMuon::TriggerPrimitive *rpc1, const L1TMuon::TriggerPrimitive *rpc2)
 Calculates new phiBending, check how to use weights. More...
 
results dummyCombineDt (const L1TMuon::TriggerPrimitive *dt)
 
int radialAngleFromGlobalPhi (const L1TMuon::TriggerPrimitive *rpc)
 

Private Attributes

int _bendingAngle
 
int _bendingResol
 
int _bx
 
const L1TMuon::TriggerPrimitive_dtHI
 
const L1TMuon::TriggerPrimitive_dtHO
 
edm::ESHandle< DTGeometry_muonGeom
 
int _radialAngle
 
resolutions _resol
 
const L1TMuon::TriggerPrimitive_rpcIn
 
const L1TMuon::TriggerPrimitive_rpcOut
 

Detailed Description

Definition at line 25 of file PrimitiveCombiner.h.

Constructor & Destructor Documentation

PrimitiveCombiner::PrimitiveCombiner ( const resolutions res,
edm::ESHandle< DTGeometry > &  muonGeom 
)
explicit

Definition at line 19 of file PrimitivesCombiner.cc.

Referenced by L1TwinMux::PrimitiveCombiner::resolutions::resolutions().

21  : _resol(res), _muonGeom(muonGeom),
22  _bx(-3), _radialAngle(4096), _bendingAngle(-520), _bendingResol(520),
23  _dtHI(0), _dtHO(0), _rpcIn(0), _rpcOut(0)
24 {}
const L1TMuon::TriggerPrimitive * _dtHO
const L1TMuon::TriggerPrimitive * _rpcIn
Definition: Electron.h:4
const L1TMuon::TriggerPrimitive * _dtHI
const L1TMuon::TriggerPrimitive * _rpcOut
edm::ESHandle< DTGeometry > _muonGeom

Member Function Documentation

void PrimitiveCombiner::addDt ( const L1TMuon::TriggerPrimitive prim)

feed the combiner with the available primitives

Definition at line 28 of file PrimitivesCombiner.cc.

References addDtHI(), addDtHO(), Exception, L1TMuon::TriggerPrimitive::getDTData(), and L1TMuon::TriggerPrimitive::DTData::qualityCode.

Referenced by L1ITMuonBarrelPrimitiveProducer::produce(), and L1TwinMux::PrimitiveCombiner::resolutions::resolutions().

29 {
30  int qualityCode = dt.getDTData().qualityCode;
31  switch ( qualityCode ) {
32  case 2 : addDtHO( dt ); break;
33  case 3 : addDtHI( dt ); break;
34  default :
35  throw cms::Exception("Invalid DT Quality")
36  << "This module can combine only HI to HO (quality2/3), provided : "
37  << qualityCode << std::endl;
38  }
39 
40 }
float dt
Definition: AMPTWrapper.h:126
void addDtHO(const L1TMuon::TriggerPrimitive &prim)
void addDtHI(const L1TMuon::TriggerPrimitive &prim)
void PrimitiveCombiner::addDtHI ( const L1TMuon::TriggerPrimitive prim)

Definition at line 43 of file PrimitivesCombiner.cc.

References _dtHI, and Exception.

Referenced by addDt(), and L1TwinMux::PrimitiveCombiner::resolutions::resolutions().

44 {
45  if ( _dtHI )
46  throw cms::Exception("Invalid DT Quality")
47  << "DT primitive with quality HI already provided"
48  << std::endl;
49 
50  _dtHI = &prim;
51 }
const L1TMuon::TriggerPrimitive * _dtHI
void PrimitiveCombiner::addDtHO ( const L1TMuon::TriggerPrimitive prim)

Definition at line 54 of file PrimitivesCombiner.cc.

References _dtHO, and Exception.

Referenced by addDt(), and L1TwinMux::PrimitiveCombiner::resolutions::resolutions().

55 {
56  if ( _dtHO )
57  throw cms::Exception("Invalid DT Quality")
58  << "DT primitive with quality HO already provided"
59  << std::endl;
60 
61  _dtHO = &prim;
62 }
const L1TMuon::TriggerPrimitive * _dtHO
void PrimitiveCombiner::addRpcIn ( const L1TMuon::TriggerPrimitive prim)

Definition at line 65 of file PrimitivesCombiner.cc.

References _rpcIn.

Referenced by L1ITMuonBarrelPrimitiveProducer::produce(), and L1TwinMux::PrimitiveCombiner::resolutions::resolutions().

66 {
67  _rpcIn = &prim;
68 }
const L1TMuon::TriggerPrimitive * _rpcIn
void PrimitiveCombiner::addRpcOut ( const L1TMuon::TriggerPrimitive prim)

Definition at line 71 of file PrimitivesCombiner.cc.

References _rpcOut.

Referenced by L1ITMuonBarrelPrimitiveProducer::produce(), and L1TwinMux::PrimitiveCombiner::resolutions::resolutions().

72 {
73  _rpcOut = &prim;
74 }
const L1TMuon::TriggerPrimitive * _rpcOut
int L1TwinMux::PrimitiveCombiner::bendingAngle ( ) const
inline

Definition at line 56 of file PrimitiveCombiner.h.

References _bendingAngle.

Referenced by L1ITMuonBarrelPrimitiveProducer::produce().

int L1TwinMux::PrimitiveCombiner::bendingResol ( ) const
inline

Definition at line 57 of file PrimitiveCombiner.h.

References _bendingResol.

int L1TwinMux::PrimitiveCombiner::bx ( ) const
inline

output result variables

Definition at line 54 of file PrimitiveCombiner.h.

References _bx.

Referenced by L1ITMuonBarrelPrimitiveProducer::produce().

void PrimitiveCombiner::combine ( )

do combine the primitives

Definition at line 78 of file PrimitivesCombiner.cc.

References _bendingAngle, _bendingResol, _dtHI, _dtHO, _radialAngle, _rpcIn, _rpcOut, combineDt(), combineDtRpc(), combineRpcRpc(), L1TMuon::TriggerPrimitive::getDTData(), isValid(), DTRecHitQuality_cfi::local, L1TMuon::TriggerPrimitive::DTData::radialAngle, L1TwinMux::PrimitiveCombiner::results::radialAngle, radialAngleFromGlobalPhi(), and mathSSE::sqrt().

Referenced by L1ITMuonBarrelPrimitiveProducer::produce(), and L1TwinMux::PrimitiveCombiner::resolutions::resolutions().

79 {
80  if ( !isValid() ) return;
81 
82  typedef PrimitiveCombiner::results localResult;
83  std::vector<localResult> localResults;
84 
85  _radialAngle = 0;
86  // inner and outer DT
87  if ( _dtHI && _dtHO ) {
88  localResults.push_back( combineDt( _dtHI, _dtHO ) );
89  _radialAngle = localResults.back().radialAngle;
90  }
91  // inner DT
92  else if ( _dtHI ) {
93  // if (!_dtHO) localResults.push_back(dummyCombineDt(_dtHI));
94  if ( _rpcIn ) {
95  localResults.push_back( combineDtRpc( _dtHI, _rpcIn ) );
97  }
98  if ( _rpcOut ) {
99  localResults.push_back( combineDtRpc( _dtHI, _rpcOut ) );
101  }
102  }
103  //outer DT
104  else if ( _dtHO ) {
105  // if (!_dtHI) localResults.push_back(dummyCombineDt(_dtHO));
106  if ( _rpcIn ) {
107  localResults.push_back( combineDtRpc( _dtHO, _rpcIn ) );
109  }
110  if ( _rpcOut ) {
111  localResults.push_back( combineDtRpc( _dtHO, _rpcOut ) );
113  }
114  }
115  // no DT
116  else if ( !_dtHI && !_dtHO ) {
117  if ( _rpcIn && _rpcOut ) {
119  localResults.push_back( local );
120  _radialAngle = local.radialAngle;
121  //std::cout<<"Entered RPC-IN-OUT thing..."<<std::endl;
122  } else if ( _rpcIn ) {
123  //std::cout<<"Entered RPC-IN-ONLY thing..."<<std::endl;
125  _bendingAngle = -666;
126  return;
127  } else if ( _rpcOut ) {
128  //std::cout<<"Entered RPC-OUT-only thing..."<<std::endl;
130  _bendingAngle = -666;
131  return;
132  }
133  }
134  double weightSum = 0;
135  _bendingResol = 0;
136  _bendingAngle = 0;
137 
138  std::vector<localResult>::const_iterator it = localResults.begin();
139  std::vector<localResult>::const_iterator itend = localResults.end();
140  int kcount=0;
141  for ( ; it != itend; ++it ) {
142  //weightSum += it->bendingResol;
143  //_bendingAngle += it->bendingResol * it->bendingAngle;
144  kcount++;
145  //std::cout<<"combining result "<<kcount<<" with resolution "<<it->bendingResol<<std::endl;
146  weightSum += 1.0/(( it->bendingResol)*(it->bendingResol));
147  _bendingAngle += double(it->bendingAngle)/((it->bendingResol) * (it->bendingResol));
148  _bendingResol += it->bendingResol * it->bendingResol;
149  }
150 
151  _bendingAngle /= weightSum;
153 
154 }
const L1TMuon::TriggerPrimitive * _dtHO
const DTData getDTData() const
const L1TMuon::TriggerPrimitive * _rpcIn
bool isValid() const
valid if we have at least: 1 rpc; 1 dt + 1 any
results combineRpcRpc(const L1TMuon::TriggerPrimitive *rpc1, const L1TMuon::TriggerPrimitive *rpc2)
Calculates new phiBending, check how to use weights.
const L1TMuon::TriggerPrimitive * _dtHI
a struct for internal usage: store results
T sqrt(T t)
Definition: SSEVec.h:18
results combineDt(const L1TMuon::TriggerPrimitive *dt, const L1TMuon::TriggerPrimitive *rpc)
Calculates new phiBending, check how to use weights.
int radialAngleFromGlobalPhi(const L1TMuon::TriggerPrimitive *rpc)
const L1TMuon::TriggerPrimitive * _rpcOut
results combineDtRpc(const L1TMuon::TriggerPrimitive *dt, const L1TMuon::TriggerPrimitive *rpc)
Calculates new phiBending, check how to use weights.
PrimitiveCombiner::results PrimitiveCombiner::combineDt ( const L1TMuon::TriggerPrimitive dt,
const L1TMuon::TriggerPrimitive rpc 
)
private

Calculates new phiBending, check how to use weights.

PhiB calculation : atan( (x2-x1)/(z2-z1) is the bending angle needs to be corrected w.r.t.the direction phi (4096 scale) and ported to 512 scale

positive chambers

Definition at line 173 of file PrimitivesCombiner.cc.

References _muonGeom, _resol, L1TwinMux::PrimitiveCombiner::results::bendingAngle, L1TwinMux::PrimitiveCombiner::results::bendingResol, DTGeometry::chamber(), L1TMuon::TriggerPrimitive::detId(), L1TMuon::TriggerPrimitive::getCMSGlobalPoint(), L1TMuon::TriggerPrimitive::getDTData(), phiBCombined(), phiBCombinedResol(), L1TMuon::TriggerPrimitive::DTData::radialAngle, L1TwinMux::PrimitiveCombiner::results::radialAngle, L1TMuon::TriggerPrimitive::DTData::sector, GeomDet::toLocal(), L1TMuon::TriggerPrimitive::DTData::wheel, PV3DBase< T, PVType, FrameType >::x(), L1TwinMux::PrimitiveCombiner::resolutions::xDt, and PV3DBase< T, PVType, FrameType >::z().

Referenced by combine(), and L1TwinMux::PrimitiveCombiner::results::results().

175 {
176 
177  const DTChamber* chamb1 = _muonGeom->chamber( dt1->detId<DTChamberId>() );
178  LocalPoint point1 = chamb1->toLocal( dt1->getCMSGlobalPoint() );
179 
180  const DTChamber* chamb2 = _muonGeom->chamber( dt2->detId<DTChamberId>() );
181  LocalPoint point2 = chamb2->toLocal( dt2->getCMSGlobalPoint() );
182 
183  results localResult;
184  localResult.radialAngle = 0.5 * ( dt1->getDTData().radialAngle + dt2->getDTData().radialAngle );
185 
190  if ( ( dt1->getDTData().wheel > 0 ) ||
191  ( ( dt1->getDTData().wheel == 0 ) &&
192  !( dt1->getDTData().sector == 0 || dt1->getDTData().sector == 3
193  || dt1->getDTData().sector == 4 || dt1->getDTData().sector == 7
194  || dt1->getDTData().sector == 8 || dt1->getDTData().sector == 11 ) )
195  ) {
197  localResult.bendingAngle = ( atan ( phiBCombined( point1.x(), point1.z(),
198  point2.x(), point2.z() )
199  )
200  - ( localResult.radialAngle/4096.0 )
201  ) * 512;
202  } else {
203  // negative chambers
204  localResult.bendingAngle = ( atan ( -phiBCombined( point1.x(), point1.z(),
205  point2.x(), point2.z() )
206  )
207  - ( localResult.radialAngle/4096.0)
208  ) * 512;
209  }
210  localResult.bendingResol = phiBCombinedResol( _resol.xDt, _resol.xDt,
211  point1.z(), point2.z() );
212 
213  //std::cout<<" == === COMBINING DT-DT === == "<<std::endl;
214  //std::cout << "dt-dt radial : " << dt1->getDTData().radialAngle << " * " << dt2->getDTData().radialAngle << " = " << localResult.radialAngle << '\n';
215  //std::cout << " " << point1.x() << " " << point1.z() << " " << dt1->getDTData().qualityCode << '\n';
216  //std::cout << " " << point2.x() << " " << point2.z() << " " << dt2->getDTData().qualityCode << '\n';
217  //std::cout << "dt-dt bending : " << dt1->getDTData().bendingAngle << " * " << dt2->getDTData().bendingAngle << " = "
218  // << localResult.bendingAngle << '\n';
219  //std::cout<<" --- this was sector "<<dt1->getDTData().sector<<" and wheel "<<dt1->getDTData().wheel<<std::endl;
220 
221  return localResult;
222 
223 }
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:99
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
float phiBCombined(const float &xDt, const float &zDt, const float &xRpc, const float &zRpc)
FIXME : Calculates new phiBending, check how to use.
T z() const
Definition: PV3DBase.h:64
float phiBCombinedResol(const float &resol_xDt, const float &resol_xRpc, const float &zDt, const float &zRpc)
FIXME END.
T x() const
Definition: PV3DBase.h:62
edm::ESHandle< DTGeometry > _muonGeom
PrimitiveCombiner::results PrimitiveCombiner::combineDtRpc ( const L1TMuon::TriggerPrimitive dt,
const L1TMuon::TriggerPrimitive rpc 
)
private

Calculates new phiBending, check how to use weights.

Definition at line 226 of file PrimitivesCombiner.cc.

References _muonGeom, _resol, L1TwinMux::PrimitiveCombiner::results::bendingAngle, L1TwinMux::PrimitiveCombiner::results::bendingResol, DTGeometry::chamber(), L1TMuon::TriggerPrimitive::detId(), L1TMuon::TriggerPrimitive::getCMSGlobalPoint(), L1TMuon::TriggerPrimitive::getDTData(), phiBCombined(), phiBCombinedResol(), L1TMuon::TriggerPrimitive::DTData::radialAngle, L1TwinMux::PrimitiveCombiner::results::radialAngle, relativeConstraints::ring, L1TMuon::TriggerPrimitive::DTData::sector, relativeConstraints::station, GeomDet::toLocal(), L1TMuon::TriggerPrimitive::DTData::wheel, makeMuonMisalignmentScenario::wheel, PV3DBase< T, PVType, FrameType >::x(), L1TwinMux::PrimitiveCombiner::resolutions::xDt, L1TwinMux::PrimitiveCombiner::resolutions::xRpc, and PV3DBase< T, PVType, FrameType >::z().

Referenced by combine(), and L1TwinMux::PrimitiveCombiner::results::results().

228 {
229 
230  results localResult;
231  localResult.radialAngle = dt->getDTData().radialAngle;
232 
233  const DTChamber* chamb1 = _muonGeom->chamber( dt->detId<DTChamberId>() );
234  LocalPoint point1 = chamb1->toLocal( dt->getCMSGlobalPoint() );
235  int station = rpc->detId<RPCDetId>().station();
236  int sector = rpc->detId<RPCDetId>().sector();
237  int wheel = rpc->detId<RPCDetId>().ring();
238  const DTChamber* chamb2 = _muonGeom->chamber( DTChamberId( wheel, station, sector ) );
239  LocalPoint point2 = chamb2->toLocal( rpc->getCMSGlobalPoint() );
240 
241  if ( ( dt->getDTData().wheel > 0 ) ||
242  ( ( dt->getDTData().wheel == 0 ) &&
243  !( dt->getDTData().sector == 0 || dt->getDTData().sector==3
244  || dt->getDTData().sector==4 || dt->getDTData().sector==7
245  || dt->getDTData().sector==8 || dt->getDTData().sector==11 ) )
246  ) {
247  // positive wheels
248  localResult.bendingAngle = ( atan( phiBCombined( point1.x(), point1.z(),
249  point2.x(), point2.z() )
250  )
251  - ( localResult.radialAngle/4096.0 )
252  ) * 512;
253  } else {
254  // negative wheels
255  localResult.bendingAngle = ( atan( -phiBCombined( point1.x(), point1.z(),
256  point2.x(), point2.z() )
257  )
258  - ( localResult.radialAngle/4096.0 )
259  ) * 512;
260  }
261  localResult.bendingResol = phiBCombinedResol( _resol.xDt, _resol.xRpc,
262  point1.z(), point2.z() );
263 
264  return localResult;
265 
266 }
const DTData getDTData() const
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:99
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
float phiBCombined(const float &xDt, const float &zDt, const float &xRpc, const float &zRpc)
FIXME : Calculates new phiBending, check how to use.
T z() const
Definition: PV3DBase.h:64
const GlobalPoint getCMSGlobalPoint() const
float phiBCombinedResol(const float &resol_xDt, const float &resol_xRpc, const float &zDt, const float &zRpc)
FIXME END.
T x() const
Definition: PV3DBase.h:62
edm::ESHandle< DTGeometry > _muonGeom
PrimitiveCombiner::results PrimitiveCombiner::combineRpcRpc ( const L1TMuon::TriggerPrimitive rpc1,
const L1TMuon::TriggerPrimitive rpc2 
)
private

Calculates new phiBending, check how to use weights.

Definition at line 297 of file PrimitivesCombiner.cc.

References _muonGeom, _resol, L1TwinMux::PrimitiveCombiner::results::bendingAngle, L1TwinMux::PrimitiveCombiner::results::bendingResol, DTGeometry::chamber(), L1TMuon::TriggerPrimitive::detId(), L1TMuon::TriggerPrimitive::getCMSGlobalPoint(), phiBCombined(), phiBCombinedResol(), L1TwinMux::PrimitiveCombiner::results::radialAngle, radialAngleFromGlobalPhi(), relativeConstraints::ring, relativeConstraints::station, GeomDet::toLocal(), makeMuonMisalignmentScenario::wheel, PV3DBase< T, PVType, FrameType >::x(), L1TwinMux::PrimitiveCombiner::resolutions::xRpc, and PV3DBase< T, PVType, FrameType >::z().

Referenced by combine(), and L1TwinMux::PrimitiveCombiner::results::results().

299 {
300  int station = rpc1->detId<RPCDetId>().station();
301  int sector = rpc1->detId<RPCDetId>().sector();
302  int wheel = rpc1->detId<RPCDetId>().ring();
303  const DTChamber* chamb1 = _muonGeom->chamber( DTChamberId( wheel, station, sector ) );
304  LocalPoint point1 = chamb1->toLocal( rpc1->getCMSGlobalPoint() );
305 
306 
307  station = rpc2->detId<RPCDetId>().station();
308  sector = rpc2->detId<RPCDetId>().sector();
309  wheel = rpc2->detId<RPCDetId>().ring();
310  const DTChamber* chamb2 = _muonGeom->chamber( DTChamberId( wheel, station, sector ) );
311  LocalPoint point2 = chamb2->toLocal( rpc2->getCMSGlobalPoint() );
312 
313 
314  results localResult;
315  localResult.radialAngle = 0.5*(radialAngleFromGlobalPhi( rpc1 )+radialAngleFromGlobalPhi( rpc2 )) ;
316 
317  if ( ( wheel>0 ) ||
318  ( ( wheel==0 ) &&
319  !( sector==0 || sector==3 || sector==4 || sector==7 || sector==8 || sector==11 ) ) )
320  localResult.bendingAngle = ( atan ( phiBCombined( point1.x(),
321  point1.z(),
322  point2.x(),
323  point2.z() )
324  - ( localResult.radialAngle / 4096.0 )
325  ) ) * 512;
326  else
327  localResult.bendingAngle = ( atan (-phiBCombined( point1.x(),
328  point1.z(),
329  point2.x(),
330  point2.z() )
331  - ( localResult.radialAngle/4096.0 )
332  ) ) * 512;
333  localResult.bendingResol = phiBCombinedResol( _resol.xRpc, _resol.xRpc, point1.z(), point2.z());
334 
335 
336  return localResult;
337 
338 }
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:99
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
float phiBCombined(const float &xDt, const float &zDt, const float &xRpc, const float &zRpc)
FIXME : Calculates new phiBending, check how to use.
T z() const
Definition: PV3DBase.h:64
int radialAngleFromGlobalPhi(const L1TMuon::TriggerPrimitive *rpc)
const GlobalPoint getCMSGlobalPoint() const
float phiBCombinedResol(const float &resol_xDt, const float &resol_xRpc, const float &zDt, const float &zRpc)
FIXME END.
T x() const
Definition: PV3DBase.h:62
edm::ESHandle< DTGeometry > _muonGeom
PrimitiveCombiner::results PrimitiveCombiner::dummyCombineDt ( const L1TMuon::TriggerPrimitive dt)
private

Definition at line 157 of file PrimitivesCombiner.cc.

References _resol, L1TMuon::TriggerPrimitive::DTData::bendingAngle, L1TwinMux::PrimitiveCombiner::results::bendingAngle, L1TwinMux::PrimitiveCombiner::results::bendingResol, L1TMuon::TriggerPrimitive::getDTData(), L1TwinMux::PrimitiveCombiner::resolutions::phibDtUnCorr, L1TMuon::TriggerPrimitive::DTData::radialAngle, and L1TwinMux::PrimitiveCombiner::results::radialAngle.

Referenced by L1TwinMux::PrimitiveCombiner::results::results().

158 {
159 
160  // i want to combine also the DT data alone
161  results localResult;
162  localResult.radialAngle = dt->getDTData().radialAngle;
163  //std::cout<<" HEY!!! I am adding a DT benfing as a combination result! "<<std::endl;
164  localResult.bendingAngle=dt->getDTData().bendingAngle;
165  localResult.bendingResol=_resol.phibDtUnCorr;
166  return localResult;
167 }
const DTData getDTData() const
int L1TwinMux::PrimitiveCombiner::getUncorrelatedQuality16 ( ) const
inline

Definition at line 111 of file PrimitiveCombiner.h.

References _dtHI, _dtHO, _rpcIn, and _rpcOut.

Referenced by L1ITMuonBarrelPrimitiveProducer::produce().

111  {
112 
113  int qualityCode = 0;
114  if ( _dtHI && _dtHO ) {
115  if ( _rpcIn && _rpcOut ) qualityCode = 12;
116  else qualityCode = 11;
117  } else if ( _dtHO ) {// HO quality == 3
118  if ( _rpcIn && _rpcOut ) qualityCode = 10;
119  else if ( _rpcOut ) qualityCode = 8;
120  else if ( _rpcIn ) qualityCode = 6;
121  else qualityCode = 4;
122  } else if ( _dtHI ) {// HI, quality == 2
123  if ( _rpcIn && _rpcOut ) qualityCode = 9;
124  else if ( _rpcOut ) qualityCode = 7;
125  else if ( _rpcIn ) qualityCode = 5;
126  else qualityCode = 3;
127  } else {
128  if ( _rpcIn && _rpcOut ) qualityCode = 2;
129  else if ( _rpcOut ) qualityCode = 1;
130  else if ( _rpcIn ) qualityCode = 0;
131  }
132  return qualityCode;
133  }
const L1TMuon::TriggerPrimitive * _dtHO
const L1TMuon::TriggerPrimitive * _rpcIn
const L1TMuon::TriggerPrimitive * _dtHI
const L1TMuon::TriggerPrimitive * _rpcOut
int L1TwinMux::PrimitiveCombiner::getUncorrelatedQuality7 ( ) const
inline

FIXME END.

Definition at line 87 of file PrimitiveCombiner.h.

References _dtHI, _dtHO, _rpcIn, and _rpcOut.

Referenced by L1ITMuonBarrelPrimitiveProducer::produce().

87  {
88 
89  int qualityCode = 0;
90  if ( _dtHI && _dtHO ) {
91  if ( _rpcIn && _rpcOut ) qualityCode = 5;
92  else qualityCode = 5;
93  } else if ( _dtHO ) {// HO quality == 3
94  if ( _rpcIn && _rpcOut ) qualityCode = 4;
95  else if ( _rpcOut ) qualityCode = 4;
96  else if ( _rpcIn ) qualityCode = 4;
97  else qualityCode = 2;
98  } else if ( _dtHI ) {// HI, quality == 2
99  if ( _rpcIn && _rpcOut ) qualityCode = 3;
100  else if ( _rpcOut ) qualityCode = 3;
101  else if ( _rpcIn ) qualityCode = 3;
102  else qualityCode = 1;
103  } else {
104  if ( _rpcIn && _rpcOut ) qualityCode = 0;
105  else if ( _rpcOut ) qualityCode = -1;
106  else if ( _rpcIn ) qualityCode = -1;
107  }
108  return qualityCode;
109  }
const L1TMuon::TriggerPrimitive * _dtHO
const L1TMuon::TriggerPrimitive * _rpcIn
const L1TMuon::TriggerPrimitive * _dtHI
const L1TMuon::TriggerPrimitive * _rpcOut
bool L1TwinMux::PrimitiveCombiner::isValid ( void  ) const
inline

valid if we have at least: 1 rpc; 1 dt + 1 any

Definition at line 60 of file PrimitiveCombiner.h.

References _dtHI, _dtHO, _rpcIn, and _rpcOut.

Referenced by ntupleDataFormat._Object::_checkIsValid(), combine(), L1ITMuonBarrelPrimitiveProducer::produce(), and core.AutoHandle.AutoHandle::ReallyLoad().

60  {
61  int ret = _dtHI ? 1 : 0;
62  ret += _dtHO ? 1 : 0;
63  ret += _rpcIn ? 2 : 0;
64  ret += _rpcOut ? 2 : 0;
65  return ret > 1 ;
66  };
const L1TMuon::TriggerPrimitive * _dtHO
const L1TMuon::TriggerPrimitive * _rpcIn
const L1TMuon::TriggerPrimitive * _dtHI
const L1TMuon::TriggerPrimitive * _rpcOut
float L1TwinMux::PrimitiveCombiner::phiBCombined ( const float &  xDt,
const float &  zDt,
const float &  xRpc,
const float &  zRpc 
)
inline

FIXME : Calculates new phiBending, check how to use.

Definition at line 69 of file PrimitiveCombiner.h.

Referenced by combineDt(), combineDtRpc(), and combineRpcRpc().

71  {
72  return (xRpc - xDt) / (zRpc - zDt);
73  };
float L1TwinMux::PrimitiveCombiner::phiBCombinedResol ( const float &  resol_xDt,
const float &  resol_xRpc,
const float &  zDt,
const float &  zRpc 
)
inline

FIXME END.

FIXME : Calculates new phiBending resolution

Definition at line 77 of file PrimitiveCombiner.h.

References mathSSE::sqrt().

Referenced by combineDt(), combineDtRpc(), and combineRpcRpc().

82  {
83  return std::sqrt( resol_xRpc*resol_xRpc + resol_xDt*resol_xDt )/std::fabs(zDt-zRpc);
84  };
T sqrt(T t)
Definition: SSEVec.h:18
int L1TwinMux::PrimitiveCombiner::radialAngle ( ) const
inline
int PrimitiveCombiner::radialAngleFromGlobalPhi ( const L1TMuon::TriggerPrimitive rpc)
private

Definition at line 274 of file PrimitivesCombiner.cc.

References L1TMuon::TriggerPrimitive::detId(), L1TMuon::TriggerPrimitive::getCMSGlobalPhi(), createfilelist::int, Geom::pi(), and radialAngle().

Referenced by combine(), combineRpcRpc(), and L1TwinMux::PrimitiveCombiner::results::results().

275 {
276  int radialAngle = 0;
277  int radialAngle2 = 0;
278  int sector = rpc->detId<RPCDetId>().sector();
279  float phiGlobal = rpc->getCMSGlobalPhi();
280  // int wheel = rpc->detId<RPCDetId>().ring();
281  // from phiGlobal to radialAngle of the primitive in sector sec in [1..12]
282  if ( sector == 1) radialAngle = int( phiGlobal*4096 );
283  else {
284  if ( phiGlobal >= 0) radialAngle = int( (phiGlobal-(sector-1)*Geom::pi()/6)*4096 );
285  else radialAngle = int( (phiGlobal+(13-sector)*Geom::pi()/6)*4096 );
286  }
287  //if ( ( wheel>0 ) ||
288  // ( ( wheel==0 ) &&
289  // ( sector==0 || sector==3 || sector==4 || sector==7 || sector==8 || sector==11 ) ) )
290  radialAngle2 = radialAngle;
291  //else
292  // radialAngle2 = -radialAngle;
293  return radialAngle2;
294 }
const double getCMSGlobalPhi() const
constexpr double pi()
Definition: Pi.h:31

Member Data Documentation

int L1TwinMux::PrimitiveCombiner::_bendingAngle
private

Definition at line 169 of file PrimitiveCombiner.h.

Referenced by bendingAngle(), and combine().

int L1TwinMux::PrimitiveCombiner::_bendingResol
private

Definition at line 170 of file PrimitiveCombiner.h.

Referenced by bendingResol(), and combine().

int L1TwinMux::PrimitiveCombiner::_bx
private

Definition at line 167 of file PrimitiveCombiner.h.

Referenced by bx().

const L1TMuon::TriggerPrimitive* L1TwinMux::PrimitiveCombiner::_dtHI
private
const L1TMuon::TriggerPrimitive* L1TwinMux::PrimitiveCombiner::_dtHO
private
edm::ESHandle<DTGeometry> L1TwinMux::PrimitiveCombiner::_muonGeom
private

Definition at line 165 of file PrimitiveCombiner.h.

Referenced by combineDt(), combineDtRpc(), and combineRpcRpc().

int L1TwinMux::PrimitiveCombiner::_radialAngle
private

Definition at line 168 of file PrimitiveCombiner.h.

Referenced by combine(), and radialAngle().

resolutions L1TwinMux::PrimitiveCombiner::_resol
private

Definition at line 164 of file PrimitiveCombiner.h.

Referenced by combineDt(), combineDtRpc(), combineRpcRpc(), and dummyCombineDt().

const L1TMuon::TriggerPrimitive* L1TwinMux::PrimitiveCombiner::_rpcIn
private
const L1TMuon::TriggerPrimitive* L1TwinMux::PrimitiveCombiner::_rpcOut
private