test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
triggerCscIdSector.h File Reference

Go to the source code of this file.

Functions

Int_t triggerCscId (Int_t station, Int_t ring, Int_t chamber) const
 
Int_t triggerSector (Int_t station, Int_t ring, Int_t chamber) const
 

Function Documentation

Int_t triggerCscId ( Int_t  station,
Int_t  ring,
Int_t  chamber 
) const

Definition at line 21 of file triggerCscIdSector.h.

References mps_fire::result.

22 {
23  // taken from /CMSSW/DataFormats/MuonDetId/src/CSCDetId.cc on July 23, 2008
24  // and modified
25 
26  Int_t result;
27 
28  if( station == 1 ) {
29  result = (chamber) % 3 + 1; // 1,2,3
30  switch (ring) {
31  case 1:
32  break;
33  case 2:
34  result += 3; // 4,5,6
35  break;
36  case 3:
37  result += 6; // 7,8,9
38  break;
39  }
40  }
41  else {
42  if( ring == 1 ) {
43  result = (chamber+1) % 3 + 1; // 1,2,3
44  }
45  else {
46  result = (chamber+3) % 6 + 4; // 4,5,6,7,8,9
47  }
48  }
49  return result;
50 }
tuple result
Definition: mps_fire.py:84
Int_t triggerSector ( Int_t  station,
Int_t  ring,
Int_t  chamber 
) const

Definition at line 3 of file triggerCscIdSector.h.

References mps_fire::result.

Referenced by L1TMuonEndCapTrackProducer::produce().

4 {
5  // taken from /CMSSW/DataFormats/MuonDetId/src/CSCDetId.cc on July 23, 2008
6  // and modified
7 
8  Int_t result;
9 
10  if(station > 1 && ring > 1 ) {
11  result = ((static_cast<unsigned>(chamber-3) & 0x7f) / 6) + 1; // ch 3-8->1, 9-14->2, ... 1,2 -> 6
12  }
13  else {
14  result = (station != 1) ? ((static_cast<unsigned>(chamber-2) & 0x1f) / 3) + 1 : // ch 2-4-> 1, 5-7->2, ...
15  ((static_cast<unsigned>(chamber-3) & 0x7f) / 6) + 1;
16  }
17 
18  return (result <= 6) ? result : 6; // max sector is 6, some calculations give a value greater than six but this is expected.
19 }
tuple result
Definition: mps_fire.py:84