test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonTriggerPrimitive.h
Go to the documentation of this file.
1 #ifndef __L1TMUON_TRIGGERPRIMITIVE_H__
2 #define __L1TMUON_TRIGGERPRIMITIVE_H__
3 //
4 // Class: l1t::MuonTriggerPrimitive
5 //
6 // Info: This class implements a unifying layer between DT, CSC and RPC
7 // trigger primitives (TPs) such that TPs from different subsystems
8 // can be queried for their position and orientation information
9 // in a consistent way amongst all subsystems.
10 //
11 // Note: Not all input data types are persistable, so we make local
12 // copies of all data from various digi types.
13 //
14 // At the end of the day this should represent the output of some
15 // common sector receiver module.
16 //
17 // Author: L. Gray (FNAL)
18 //
19 
20 #include <boost/cstdint.hpp>
21 #include <vector>
22 #include <iostream>
23 
24 //DetId
26 
27 // DT digi types
28 class DTChamberId;
29 class L1MuDTChambPhDigi;
30 class L1MuDTChambThDigi;
31 
32 // CSC digi types
34 class CSCDetId;
35 
36 // RPC digi types
37 class RPCDigiL1Link;
38 class RPCDetId;
39 
40 
41 #include <map>
44 
45 namespace l1t {
46 
48 
49  typedef std::vector<MuonTriggerPrimitive> MuonTriggerPrimitiveCollection;
51  typedef std::vector<MuonTriggerPrimitiveRef> MuonTriggerPrimitiveList;
53  typedef std::map<unsigned,MuonTriggerPrimitiveList> MuonTriggerPrimitiveStationMap;
54 
55 
56 
57 
58 
60  public:
61  // define the subsystems that we have available
63 
64  // define the data we save locally from each subsystem type
65  // variables in these structs keep their colloquial meaning
66  // within a subsystem
67  // for RPCs you have to unroll the digi-link and raw det-id
68  struct RPCData {
69  RPCData() : strip(0), layer(0), bx(0) {}
70  unsigned strip;
71  unsigned layer;
72  uint16_t bx;
73  };
74 
75  struct CSCData {
76  CSCData() : trknmb(0), valid(0), quality(0), keywire(0), strip(0),
77  pattern(0), bend(0), bx(0), mpclink(0), bx0(0), syncErr(0),
78  cscID(0) {}
79  uint16_t trknmb;
80  uint16_t valid;
81  uint16_t quality;
82  uint16_t keywire;
83  uint16_t strip;
84  uint16_t pattern;
85  uint16_t bend;
86  uint16_t bx;
87  uint16_t mpclink;
88  uint16_t bx0;
89  uint16_t syncErr;
90  uint16_t cscID;
91  };
92 
93  struct DTData {
94  DTData() : bx(0), wheel(0), sector(0), station(0), radialAngle(0),
97  theta_quality(0) {}
98  // from ChambPhDigi (corresponds to a TRACO)
99  // this gives us directly the phi
100  int bx; // relative? bx number
101  int wheel; // wheel number -3,-2,-1,1,2,3
102  int sector; // 1-12 in DT speak (these correspond to CSC sub-sectors)
103  int station; // 1-4 radially outwards
104  int radialAngle; // packed phi in a sector
105  int bendingAngle; // angle of segment relative to chamber
106  int qualityCode; // need to decode
107  int Ts2TagCode; // ??
108  int BxCntCode; // ????
109  // from ChambThDigi (corresponds to a BTI)
110  // we have to root out the eta manually
111  // theta super layer == SL 1
112  // station four has no theta super-layer
113  // bti_idx == -1 means there was no theta trigger for this segment
115  int segment_number; // position(i)
118  };
119 
120  //Persistency
122 
123  //DT
125  const L1MuDTChambPhDigi&,
126  const int segment_number);
128  const L1MuDTChambThDigi&,
129  const int segment_number);
131  const L1MuDTChambPhDigi&,
132  const L1MuDTChambThDigi&,
133  const int theta_bti_group);
134  //CSC
136  const CSCCorrelatedLCTDigi&);
137  //RPC
139  const unsigned strip,
140  const unsigned layer,
141  const uint16_t bx);
142 
143  //copy
145 
147  bool operator==(const MuonTriggerPrimitive& tp) const;
148 
149  // return the subsystem we belong to
150  const subsystem_type subsystem() const { return _subsystem; }
151 
152  const double getCMSGlobalEta() const { return _eta; }
153  void setCMSGlobalEta(const double eta) { _eta = eta; }
154  const double getCMSGlobalPhi() const { return _phi; }
155  void setCMSGlobalPhi(const double phi) { _phi = phi; }
156 
157  // this is the relative bending angle with respect to the
158  // current phi position.
159  // The total angle of the track is phi + bendAngle
160  void setThetaBend(const double theta) { _theta = theta; }
161  double getThetaBend() const { return _theta; }
162 
163  template<typename IDType>
164  IDType detId() const { return IDType(_id); }
165 
166  // accessors to raw subsystem data
167  const DTData getDTData() const { return _dt; }
168  const CSCData getCSCData() const { return _csc; }
169  const RPCData getRPCData() const { return _rpc; }
170 
171  // consistent accessors to common information
172  const int getBX() const;
173  const int getStrip() const;
174  const int getWire() const;
175  const int getPattern() const;
176  const DetId rawId() const {return _id;};
177  const int Id() const;
178 
179  const unsigned getGlobalSector() const { return _globalsector; }
180  const unsigned getSubSector() const { return _subsector; }
181 
182  void print(std::ostream&) const;
183 
184  private:
185  // Translate to 'global' position information at the level of 60
186  // degree sectors. Use CSC sectors as a template
187  void calculateDTGlobalSector(const DTChamberId& chid,
188  unsigned& global_sector,
189  unsigned& subsector );
190  void calculateCSCGlobalSector(const CSCDetId& chid,
191  unsigned& global_sector,
192  unsigned& subsector );
193  void calculateRPCGlobalSector(const RPCDetId& chid,
194  unsigned& global_sector,
195  unsigned& subsector );
196 
200 
202 
204 
205  unsigned _globalsector; // [1,6] in 60 degree sectors
206  unsigned _subsector; // [1,2] in 30 degree partitions of a sector
207  double _eta,_phi; // global pseudorapidity, phi
208  double _theta; // bend angle with respect to ray from (0,0,0)
209  };
210 
211 }
212 
213 #endif
214 
std::vector< MuonTriggerPrimitive > MuonTriggerPrimitiveCollection
const DTData getDTData() const
const unsigned getSubSector() const
void calculateRPCGlobalSector(const RPCDetId &chid, unsigned &global_sector, unsigned &subsector)
Geom::Theta< T > theta() const
void setCMSGlobalPhi(const double phi)
std::map< unsigned, MuonTriggerPrimitiveList > MuonTriggerPrimitiveStationMap
const double getCMSGlobalPhi() const
edm::Ref< MuonTriggerPrimitiveCollection > MuonTriggerPrimitiveRef
edm::Ptr< MuonTriggerPrimitive > MuonTriggerPrimitivePtr
void setCMSGlobalEta(const double eta)
const unsigned getGlobalSector() const
const RPCData getRPCData() const
void calculateDTGlobalSector(const DTChamberId &chid, unsigned &global_sector, unsigned &subsector)
Definition: DetId.h:18
MuonTriggerPrimitive & operator=(const MuonTriggerPrimitive &tp)
const subsystem_type subsystem() const
bool operator==(const MuonTriggerPrimitive &tp) const
const CSCData getCSCData() const
const double getCMSGlobalEta() const
std::vector< MuonTriggerPrimitiveRef > MuonTriggerPrimitiveList
void print(std::ostream &) const
void setThetaBend(const double theta)
void calculateCSCGlobalSector(const CSCDetId &chid, unsigned &global_sector, unsigned &subsector)