Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrack.h"
00022
00023
00024
00025
00026
00027 #include <iostream>
00028 #include <iomanip>
00029
00030
00031
00032
00033
00034 #include "L1Trigger/DTTrackFinder/src/L1MuDTSecProcId.h"
00035 #include "L1Trigger/DTTrackFinder/src/L1MuDTTrackSegPhi.h"
00036 #include "L1Trigger/DTTrackFinder/src/L1MuDTTrackSegEta.h"
00037 #include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h"
00038 #include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h"
00039 #include "CondFormats/L1TObjects/interface/L1MuPacking.h"
00040
00041 using namespace std;
00042
00043
00044
00045
00046
00047
00048
00049
00050 L1MuDTTrack::L1MuDTTrack() :
00051 L1MuRegionalCand(0,0),
00052 m_spid(L1MuDTSecProcId()), m_name("L1MuDTTrack"), m_empty(true),
00053 m_tc(UNDEF),
00054 m_addArray(), m_tsphiList(), m_tsetaList() {
00055
00056 m_tsphiList.reserve(4);
00057 m_tsetaList.reserve(3);
00058
00059 setType(0);
00060 setChargeValid(true);
00061
00062 }
00063
00064
00065 L1MuDTTrack::L1MuDTTrack(const L1MuDTSecProcId& spid) :
00066 L1MuRegionalCand(0,0),
00067 m_spid(spid), m_name("L1MuDTTrack"), m_empty(true),
00068 m_tc(UNDEF),
00069 m_addArray(), m_tsphiList(), m_tsetaList() {
00070
00071 m_tsphiList.reserve(4);
00072 m_tsetaList.reserve(3);
00073
00074 setType(0);
00075 setChargeValid(true);
00076
00077 }
00078
00079
00080 L1MuDTTrack::L1MuDTTrack(const L1MuDTTrack& id) :
00081 L1MuRegionalCand(id),
00082 m_spid(id.m_spid), m_name(id.m_name), m_empty(id.m_empty),
00083 m_tc(id.m_tc),
00084 m_addArray(id.m_addArray),
00085 m_tsphiList(id.m_tsphiList), m_tsetaList(id.m_tsetaList) {}
00086
00087
00088
00089
00090
00091 L1MuDTTrack::~L1MuDTTrack() {}
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 void L1MuDTTrack::reset() {
00102
00103 L1MuRegionalCand::reset();
00104 m_empty = true;
00105 m_tc = UNDEF;
00106 m_addArray.reset();
00107 m_tsphiList.clear();
00108 m_tsetaList.clear();
00109
00110 }
00111
00112
00113
00114
00115
00116 void L1MuDTTrack::setEta(int eta) {
00117
00118
00119
00120
00121 L1MuSignedPacking<6> pEta;
00122 setEtaPacked(pEta.packedFromIdx(eta));
00123
00124 }
00125
00126
00127
00128
00129
00130 const L1MuDTTrackSegPhi& L1MuDTTrack::getStartTSphi() const {
00131
00132 return m_tsphiList.front();
00133
00134 }
00135
00136
00137
00138
00139
00140 const L1MuDTTrackSegPhi& L1MuDTTrack::getEndTSphi() const {
00141
00142 return m_tsphiList.back();
00143
00144 }
00145
00146
00147
00148
00149
00150 const L1MuDTTrackSegEta& L1MuDTTrack::getStartTSeta() const {
00151
00152 return m_tsetaList.front();
00153
00154 }
00155
00156
00157
00158
00159
00160 const L1MuDTTrackSegEta& L1MuDTTrack::getEndTSeta() const {
00161
00162 return m_tsetaList.back();
00163
00164 }
00165
00166
00167
00168
00169
00170 void L1MuDTTrack::setTSphi(const vector<const L1MuDTTrackSegPhi*>& tsList) {
00171
00172 if ( !tsList.empty() ) {
00173 vector<const L1MuDTTrackSegPhi*>::const_iterator iter;
00174 for ( iter = tsList.begin(); iter != tsList.end(); iter++ ) {
00175 if ( *iter ) m_tsphiList.push_back(**iter);
00176 }
00177 }
00178
00179 }
00180
00181
00182
00183
00184
00185 void L1MuDTTrack::setTSeta(const vector<const L1MuDTTrackSegEta*>& tsList) {
00186
00187 if ( !tsList.empty() ) {
00188 vector<const L1MuDTTrackSegEta*>::const_iterator iter;
00189 for ( iter = tsList.begin(); iter != tsList.end(); iter++ ) {
00190 if ( *iter ) m_tsetaList.push_back(**iter);
00191 }
00192 }
00193
00194 }
00195
00196
00197
00198
00199
00200 unsigned int L1MuDTTrack::triggerScale(float value, const edm::EventSetup& c) const {
00201
00202 const float eps = 1.e-5;
00203
00204 edm::ESHandle< L1MuTriggerPtScale > theTriggerScales;
00205 c.get< L1MuTriggerPtScaleRcd >().get( theTriggerScales );
00206 unsigned int t_Scale = theTriggerScales->getPtScale()->getPacked( value + eps );
00207
00208 return t_Scale;
00209 }
00210
00211
00212
00213
00214
00215 L1MuDTTrack& L1MuDTTrack::operator=(const L1MuDTTrack& track) {
00216
00217 if ( this != &track ) {
00218 this->setBx(track.bx());
00219 this->setDataWord(track.getDataWord());
00220 m_spid = track.m_spid;
00221 m_empty = track.m_empty;
00222 m_name = track.m_name;
00223 m_tc = track.m_tc;
00224 m_addArray = track.m_addArray;
00225 m_tsphiList = track.m_tsphiList;
00226 m_tsetaList = track.m_tsetaList;
00227 }
00228 return *this;
00229
00230 }
00231
00232
00233
00234
00235
00236 bool L1MuDTTrack::operator==(const L1MuDTTrack& track) const {
00237
00238 if ( m_spid != track.m_spid ) return false;
00239 if ( m_empty != track.m_empty ) return false;
00240 if ( m_tc != track.m_tc ) return false;
00241 if ( bx() != track.bx() ) return false;
00242 if ( phi() != track.phi() ) return false;
00243 if ( eta() != track.eta() ) return false;
00244 if ( fineEtaBit() != track.fineEtaBit() ) return false;
00245 if ( pt() != track.pt() ) return false;
00246 if ( charge() != track.charge() ) return false;
00247 if ( quality() != track.quality() ) return false;
00248 if ( m_addArray != track.m_addArray ) return false;
00249 return true;
00250
00251 }
00252
00253
00254
00255
00256
00257 bool L1MuDTTrack::operator!=(const L1MuDTTrack& track) const {
00258
00259 if ( m_spid != track.m_spid ) return true;
00260 if ( m_empty != track.m_empty ) return true;
00261 if ( m_tc != track.m_tc ) return true;
00262 if ( bx() != track.bx() ) return true;
00263 if ( phi() != track.phi() ) return true;
00264 if ( eta() != track.eta() ) return true;
00265 if ( fineEtaBit() != track.fineEtaBit() ) return true;
00266 if ( pt() != track.pt() ) return true;
00267 if ( charge() != track.charge() ) return true;
00268 if ( quality() != track.quality() ) return true;
00269 if ( m_addArray != track.m_addArray ) return true;
00270 return false;
00271
00272 }
00273
00274
00275
00276
00277
00278 void L1MuDTTrack::print() const {
00279
00280 if ( !empty() ) {
00281 cout.setf(ios::showpoint);
00282 cout.setf(ios::right,ios::adjustfield);
00283 cout << setiosflags(ios::showpoint | ios::fixed);
00284 cout << "MUON : "
00285 << "pt = " << setw(2) << pt_packed() << " "
00286 << "charge = " << setw(2) << charge_packed() << " "
00287 << "eta = " << setw(2) << eta_packed()
00288 << " (" << setw(1) << finehalo_packed() << ") "
00289 << "phi = " << setw(3) << phi_packed() << " "
00290 << "quality = " << setw(1) << quality_packed() << '\t'
00291 << "class = " << tc() << " "
00292 << "bx = " << setw(2) << bx() << endl;
00293 cout << " found in " << m_spid << " with phi track segments :" << endl;
00294 vector<L1MuDTTrackSegPhi>::const_iterator iter;
00295 for ( iter = m_tsphiList.begin(); iter != m_tsphiList.end(); iter++ ) {
00296 cout << " " << (*iter) << endl;
00297 }
00298 }
00299
00300 }
00301
00302
00303
00304
00305
00306 ostream& operator<<(ostream& s, const L1MuDTTrack& id) {
00307
00308 if ( !id.empty() ) {
00309 s << setiosflags(ios::showpoint | ios::fixed)
00310 << "pt = " << setw(2) << id.pt_packed() << " "
00311 << "charge = " << setw(2) << id.charge_packed() << " "
00312 << "eta = " << setw(2) << id.eta_packed()
00313 << " (" << setw(1) << id.finehalo_packed() << ") "
00314 << "phi = " << setw(3) << id.phi_packed() << " "
00315 << "quality = " << setw(1) << id.quality_packed() << '\t'
00316 << "bx = " << setw(2) << id.bx();
00317 }
00318 return s;
00319
00320 }