CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/L1Trigger/DTTraco/src/DTTracoCand.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: DTTracoCand
00004 //
00005 //   Description: Implementation of L1MuDTTracoChip 
00006 //                candidate
00007 //
00008 //
00009 //   Author List:
00010 //   C. Grandi
00011 //   Modifications: 
00012 //   SV BTIC parameter from config
00013 //   SV bti Trig pointer stored insted of trigdata
00014 //   22/VI/04 SV: last trigger code update
00015 //   04/XI/04 SV: bug fixed for wrong MB1 superlayer offset! 
00016 //   III/05   SV: NEWGEO update
00017 //----------------------------------------------------------
00018 
00019 //-----------------------
00020 // This Class's Header --
00021 //-----------------------
00022 #include "L1Trigger/DTTraco/interface/DTTracoCand.h"
00023 
00024 //-------------------------------
00025 // Collaborating Class Headers --
00026 //-------------------------------
00027 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigTraco.h"
00028 #include "L1Trigger/DTTraco/interface/DTTracoChip.h"
00029 #include "L1Trigger/DTBti/interface/DTBtiTrigData.h"
00030 
00031 //---------------
00032 // C++ Headers --
00033 //---------------
00034 #include <iostream>
00035 
00036 //----------------
00037 // Constructors --
00038 //----------------
00039 DTTracoCand::DTTracoCand(DTTracoChip* tc, 
00040                                  const DTBtiTrigData* btitr,
00041                                  int pos, int step) : 
00042   _traco(tc), _btitr(btitr), _step(step), _position(pos), _usable(1) {
00043   
00044   if(pos<1 || pos>4*DTConfigTraco::NBTITC) {
00045     std::cout << "DTTracoCand::DTTracoCand: wrong position: " << pos;
00046     std::cout << ", dummy coordinates set!" << std::endl;
00047     _tcX = 9999;
00048     _tcK = 9999;
00049     return;
00050   }
00051   // abs value of K in local TRACO frame (angle conversion): 
00052   // for sorting the angle closest to normal of chamber
00053   // Ktr = Kbti - BTIC - KRAD
00054   _tcK = abs( btitr->K() - tc->KRad() - tc->BTIC() );
00055   
00056  
00057   // X in local TRACO frame (position conversion): Xtr = Xbti + BTIC*(i+4 or o-4)
00058   int lstep = tc->BTIC();
00059   _tcX = btitr->X() + lstep * (
00060          (pos<=DTConfigTraco::NBTITC)*(pos-1 + DTConfigTraco::NBTITC) +  // inner
00061          (pos> DTConfigTraco::NBTITC)*(pos-1 - DTConfigTraco::NBTITC) ); // outer
00062 
00063   //NEWGEO add phi sl offset to inner positions
00064   if(btitr->btiSL()==1)
00065     _tcX += tc->IBTIOFF();
00066   
00067 /* DEBUG  
00068   btitr->print();
00069   std::cout << "K in local " << tc->number() << " TRACO " << K() << std::endl;
00070   std::cout << "X in local " << tc->number() << " TRACO " << X() << " offset " << tc->IBTIOFF() << std::endl;
00071   print();
00072 */
00073 
00074 /*
00075   //OBSOLETE
00076   //ATTENTION!! This isn't the "real" MB-superlayer shift
00077   //because wires have been renamed/shifted in : DTTrigGeom::cellMapping(int sl, int lay, int tube)
00078   //this is a "patch" : to BE FIXED with NEW GEOMETRY! 
00079 
00080   //MB1: half cell shift
00081   if(btitr->btiSL()==1 && tc->station()==1)
00082     _tcX += (int)(0.5*lstep);
00083   //MB2 
00084   //  if(btitr->btiSL()==1   && tc->station()==2)
00085   //    _tcX += (int)(-lstep);
00086 
00087   //std::cout << "X in local TRACO frame = " << _tcX << std::endl;
00088   //print();
00089 */  
00090 }
00091 
00092 DTTracoCand::DTTracoCand(const DTTracoCand& tccand) : 
00093   _traco(tccand._traco), _btitr(tccand._btitr), 
00094   _step(tccand._step), _position(tccand._position), _usable(tccand._usable), 
00095   _tcX(tccand._tcX), _tcK(tccand._tcK) {}
00096 
00097 //--------------
00098 // Destructor --
00099 //--------------
00100 DTTracoCand::~DTTracoCand(){
00101 }
00102 
00103 //--------------
00104 // Operations --
00105 //--------------
00106 
00107 DTTracoCand& 
00108 DTTracoCand::operator=(const DTTracoCand& tccand){
00109   if(this != &tccand){
00110     _traco = tccand._traco;
00111     _btitr = tccand._btitr;
00112     _position = tccand._position;
00113     _step = tccand._step;
00114     _usable = tccand._usable;
00115     _tcX = tccand._tcX;
00116     _tcK = tccand._tcK;
00117   }
00118   return *this;
00119 }
00120 
00121 void
00122 DTTracoCand::print() const {
00123 //  int sl = _btitr->btiSL();
00124   std::cout << " step " << _step;
00125   std::cout << " Position " << _position;
00126   std::cout << " Code = " <<  _btitr->code();
00127   std::cout << " SL = " << _btitr->btiSL();
00128   std::cout << " N = " << _btitr->btiNumber();
00129   std::cout << " X = " << _btitr->X();
00130   std::cout << " K = " << _btitr->K();
00131   std::cout << " Kr = " << _traco->KRad();
00132   std::cout << " |K-Kr| = " << _tcK << std::endl;
00133 }
00134