CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/L1Trigger/DTTraco/interface/DTTracoChip.h

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00014 //
00015 //--------------------------------------------------
00016 #ifndef DT_TRACO_CHIP_H
00017 #define DT_TRACO_CHIP_H
00018 
00019 //-------------------
00020 // Constants file  --
00021 //-------------------
00022 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfig.h"
00023 #include "L1Trigger/DTBti/interface/DTBtiTrigData.h" 
00024 #include "L1Trigger/DTTraco/interface/Lut.h"
00025 
00026 //------------------------------------
00027 // Collaborating Class Declarations --
00028 //------------------------------------
00029 class DTTracoCard;
00030 class DTBtiTrigData;
00031 class DTTracoCand;
00032 class DTTracoTrig;
00033 class DTTracoTrigData;
00034 
00035 //----------------------
00036 // Base Class Headers --
00037 //----------------------
00038 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00039 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00040 #include "DataFormats/MuonDetId/interface/DTTracoId.h"
00041 #include "L1Trigger/DTTraco/interface/DTTracoLUTs.h"
00042 #include "L1Trigger/DTUtilities/interface/DTTrigGeom.h"
00043 #include "L1TriggerConfig/DTTPGConfig/interface/BitArray.h"
00044 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigTraco.h"
00045 
00046 //---------------
00047 // C++ Headers --
00048 //---------------
00049 #include <vector>
00050 
00051 //              ---------------------
00052 //              -- Class Interface --
00053 //              ---------------------
00054 
00055 class DTTracoChip {
00056 
00057   public:
00058 
00060     //DTTracoChip(DTTracoCard* card, int n);
00061 
00063     DTTracoChip(DTTracoCard* card, int n, DTConfigTraco* config);
00064 
00066     DTTracoChip(const DTTracoChip& traco);
00067   
00069     ~DTTracoChip();
00070 
00072     DTTracoChip& operator=(const DTTracoChip& traco);
00073 
00075     void add_btiT(int step, int pos, const DTBtiTrigData* btitrig);
00076 
00078     void addTrig(int step, DTTracoTrig*);
00079 
00081     void setPV(int step, int ntrk, int code, int K);
00082 
00084     void calculateAngles(DTTracoTrig*);
00085 
00087     void run();
00088 
00090     void clear();
00091 
00093     inline int number() const { return _id.traco(); }
00094 
00096     void raiseOverlap(int step);
00097 
00099     inline DTTrigGeom* geom() const { return _geom; }
00100 
00102     inline DTTracoId id() const { return _id; }
00103 
00105     inline int wheel() const { return _geom->wheel(); }
00106 
00108     inline int station() const { return _geom->station(); }
00109 
00111     inline int sector() const { return _geom->sector(); }
00112 
00114     //inline DTConfig* config() const { return _geom->config(); }
00115 
00117     inline DTConfigTraco* config() const { return _config; }
00118 
00120     float psiRad(int sl=0) const;
00121 
00123     int KRad() const;
00124     //int KRad(int sl=0) const;
00125 
00127     int BTIC() const { return _btic; }
00128   
00130     int IBTIOFF() const { return _ibtioff; }
00131 
00133     int DD() const { return _dd; }
00134 
00136     int nTrig(int step) const;
00137 
00139     DTTracoTrig* trigger(int step, unsigned n) const;
00140 
00142     DTTracoTrigData triggerData(int step, unsigned n) const;
00143 
00145     int useSecondTrack(int step) const;
00146 
00148     int edgeBTI(int step, int io, int lr) const;
00149 
00151     LocalPoint localPosition() const { return _geom->localPosition(_id); }
00152 
00154     GlobalPoint CMSPosition() const { return _geom->CMSPosition(_id); }
00155 
00157     void setFlag(int step,int ext=0);
00158 
00160     inline int ovlFlag(int step) {
00161       return _flag[step-DTConfigTraco::NSTEPF].element(1);}
00162 
00163   private:
00164 
00166     DTTracoCand* bestCand(int itk, std::vector<DTTracoCand> & tclist);
00167 
00169     DTTracoTrig* setPV(int itk, DTTracoCand* inner, DTTracoCand* outer);
00170 
00172     void DoAdjBtiLts(DTTracoCand* candidate, std::vector<DTTracoCand> & tclist);
00173 
00175     int AdjBtiLTSuppressed(DTTracoCand* candidate);
00176 
00178     int storeCorr(DTTracoTrig* tctrig, DTTracoCand* inner, DTTracoCand* outer, int tkn);
00179 
00181     int storeUncorr(DTTracoTrig* tctrig, DTTracoCand* inner, DTTracoCand* outer, int tkn);
00182 
00184     int insideAngWindow(DTTracoTrig* ) const;
00185 
00187     void setTracoAcceptances();
00188 
00189   private:
00190     // identification
00191     DTTrigGeom* _geom;
00192     DTTracoId _id;
00193     // parent card
00194     DTTracoCard* _card;
00195     //config
00196     DTConfigTraco* _config;
00197 
00198     int _krad;
00199     int _btic;
00200     int _ibtioff;
00201     int _dd;
00202 
00203     // input data
00204     std::vector<DTTracoCand> _innerCand[DTConfigTraco::NSTEPL-DTConfigTraco::NSTEPF+1];
00205     std::vector<DTTracoCand> _outerCand[DTConfigTraco::NSTEPL-DTConfigTraco::NSTEPF+1];
00206 
00207     // output data
00208     std::vector<DTTracoTrig*> _tracotrig[DTConfigTraco::NSTEPL-DTConfigTraco::NSTEPF+1];
00209 
00210     // internal use variables: SV 11V04 lts suppression if to bx+1, bx=array index
00211     BitArray<DTConfigTraco::NSTEPL+2> _bxlts;
00212     // *** FOR TESTBEAM DATA  *** SV from input data instead from card! 
00213     // 1: overlap with II track from bx-1)
00214     // 2: II track rej.
00215     // 3...8: IL,IR,OL,OR,th,th
00216     // 9: H present in traco at bx
00217     BitArray<32> _flag[DTConfigTraco::NSTEPL-DTConfigTraco::NSTEPF+1]; 
00218 
00219     // psi acceptance of correlator MT ports
00220     int _PSIMIN[4*DTConfig::NBTITC];
00221     int _PSIMAX[4*DTConfig::NBTITC];
00222 
00223     // LUT file class
00224     DTTracoLUTs* _luts;
00225     
00226     Lut* _lutsCCB;
00227 
00228 };
00229 
00230 #endif