Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:01

0001 //-------------------------------------------------
0002 //
0003 //   Class: DTTracoCand
0004 //
0005 //   Description: Implementation of L1MuDTTracoChip
0006 //                candidate
0007 //
0008 //
0009 //   Author List:
0010 //   C. Grandi
0011 //   Modifications:
0012 //   SV BTIC parameter from config
0013 //   SV bti Trig pointer stored insted of trigdata
0014 //   22/VI/04 SV: last trigger code update
0015 //   04/XI/04 SV: bug fixed for wrong MB1 superlayer offset!
0016 //   III/05   SV: NEWGEO update
0017 //----------------------------------------------------------
0018 
0019 //-----------------------
0020 // This Class's Header --
0021 //-----------------------
0022 #include "L1Trigger/DTTraco/interface/DTTracoCand.h"
0023 
0024 //-------------------------------
0025 // Collaborating Class Headers --
0026 //-------------------------------
0027 #include "L1Trigger/DTBti/interface/DTBtiTrigData.h"
0028 #include "L1Trigger/DTTraco/interface/DTTracoChip.h"
0029 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigTraco.h"
0030 
0031 //---------------
0032 // C++ Headers --
0033 //---------------
0034 #include <iostream>
0035 
0036 //----------------
0037 // Constructors --
0038 //----------------
0039 DTTracoCand::DTTracoCand(DTTracoChip *tc, const DTBtiTrigData *btitr, int pos, int step)
0040     : _traco(tc), _btitr(btitr), _step(step), _position(pos), _usable(1) {
0041   if (pos < 1 || pos > 4 * DTConfigTraco::NBTITC) {
0042     std::cout << "DTTracoCand::DTTracoCand: wrong position: " << pos;
0043     std::cout << ", dummy coordinates set!" << std::endl;
0044     _tcX = 9999;
0045     _tcK = 9999;
0046     return;
0047   }
0048   // abs value of K in local TRACO frame (angle conversion):
0049   // for sorting the angle closest to normal of chamber
0050   // Ktr = Kbti - BTIC - KRAD
0051   _tcK = abs(btitr->K() - tc->KRad() - tc->BTIC());
0052 
0053   // X in local TRACO frame (position conversion): Xtr = Xbti + BTIC*(i+4 or
0054   // o-4)
0055   int lstep = tc->BTIC();
0056   _tcX = btitr->X() + lstep * ((pos <= DTConfigTraco::NBTITC) * (pos - 1 + DTConfigTraco::NBTITC) +  // inner
0057                                (pos > DTConfigTraco::NBTITC) * (pos - 1 - DTConfigTraco::NBTITC));   // outer
0058 
0059   // NEWGEO add phi sl offset to inner positions
0060   if (btitr->btiSL() == 1)
0061     _tcX += tc->IBTIOFF();
0062 
0063   /* DEBUG
0064     btitr->print();
0065     std::cout << "K in local " << tc->number() << " TRACO " << K() << std::endl;
0066     std::cout << "X in local " << tc->number() << " TRACO " << X() << " offset "
0067     << tc->IBTIOFF() << std::endl; print();
0068   */
0069 
0070   /*
0071     //OBSOLETE
0072     //ATTENTION!! This isn't the "real" MB-superlayer shift
0073     //because wires have been renamed/shifted in : DTTrigGeom::cellMapping(int
0074     sl, int lay, int tube)
0075     //this is a "patch" : to BE FIXED with NEW GEOMETRY!
0076 
0077     //MB1: half cell shift
0078     if(btitr->btiSL()==1 && tc->station()==1)
0079       _tcX += (int)(0.5*lstep);
0080     //MB2
0081     //  if(btitr->btiSL()==1   && tc->station()==2)
0082     //    _tcX += (int)(-lstep);
0083 
0084     //std::cout << "X in local TRACO frame = " << _tcX << std::endl;
0085     //print();
0086   */
0087 }
0088 
0089 DTTracoCand::DTTracoCand(const DTTracoCand &tccand)
0090     : _traco(tccand._traco),
0091       _btitr(tccand._btitr),
0092       _step(tccand._step),
0093       _position(tccand._position),
0094       _usable(tccand._usable),
0095       _tcX(tccand._tcX),
0096       _tcK(tccand._tcK) {}
0097 
0098 //--------------
0099 // Destructor --
0100 //--------------
0101 DTTracoCand::~DTTracoCand() {}
0102 
0103 //--------------
0104 // Operations --
0105 //--------------
0106 
0107 DTTracoCand &DTTracoCand::operator=(const DTTracoCand &tccand) {
0108   if (this != &tccand) {
0109     _traco = tccand._traco;
0110     _btitr = tccand._btitr;
0111     _position = tccand._position;
0112     _step = tccand._step;
0113     _usable = tccand._usable;
0114     _tcX = tccand._tcX;
0115     _tcK = tccand._tcK;
0116   }
0117   return *this;
0118 }
0119 
0120 void DTTracoCand::print() const {
0121   //  int sl = _btitr->btiSL();
0122   std::cout << " step " << _step;
0123   std::cout << " Position " << _position;
0124   std::cout << " Code = " << _btitr->code();
0125   std::cout << " SL = " << _btitr->btiSL();
0126   std::cout << " N = " << _btitr->btiNumber();
0127   std::cout << " X = " << _btitr->X();
0128   std::cout << " K = " << _btitr->K();
0129   std::cout << " Kr = " << _traco->KRad();
0130   std::cout << " |K-Kr| = " << _tcK << std::endl;
0131 }