CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.h

Go to the documentation of this file.
00001 #ifndef CSCTriggerPrimitives_CSCAnodeLCTProcessor_h
00002 #define CSCTriggerPrimitives_CSCAnodeLCTProcessor_h
00003 
00020 #include <vector>
00021 #include <FWCore/ParameterSet/interface/ParameterSet.h>
00022 #include <DataFormats/CSCDigi/interface/CSCWireDigiCollection.h>
00023 #include <DataFormats/CSCDigi/interface/CSCALCTDigi.h>
00024 #include <CondFormats/CSCObjects/interface/CSCDBL1TPParameters.h>
00025 #include <L1Trigger/CSCCommonTrigger/interface/CSCConstants.h>
00026 
00027 class CSCAnodeLCTProcessor
00028 {
00029  public:
00031   CSCAnodeLCTProcessor(unsigned endcap, unsigned station, unsigned sector,
00032                        unsigned subsector, unsigned chamber,
00033                        const edm::ParameterSet& conf,
00034                        const edm::ParameterSet& comm);
00035 
00037   CSCAnodeLCTProcessor();
00038 
00040   void setConfigParameters(const CSCDBL1TPParameters* conf);
00041 
00043   void clear();
00044 
00047   std::vector<CSCALCTDigi> run(const CSCWireDigiCollection* wiredc);
00048 
00051   void run(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]);
00052 
00054   bool getDigis(const CSCWireDigiCollection* wiredc);
00055   void getDigis(const CSCWireDigiCollection* wiredc, const CSCDetId& id);
00056 
00058   enum {MAX_ALCT_BINS = 16};
00059 
00065   CSCALCTDigi bestALCT[MAX_ALCT_BINS];
00066 
00068   CSCALCTDigi secondALCT[MAX_ALCT_BINS];
00069 
00071   std::vector<CSCALCTDigi> readoutALCTs();
00072 
00074   std::vector<CSCALCTDigi> getALCTs();
00075 
00077   void setRing(unsigned r) {theRing = r;}
00078 
00080   enum {NUM_PATTERN_WIRES = 14};
00081   static const int pattern_envelope[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES];
00082   static const int pattern_mask_slim[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES];
00083   static const int pattern_mask_open[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES];
00084   static const int pattern_mask_r1[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES];
00085   static const int time_weights[NUM_PATTERN_WIRES];
00086 
00087  private:
00092   int infoV;
00093 
00095   const unsigned theEndcap;
00096   const unsigned theStation;
00097   const unsigned theSector;
00098   const unsigned theSubsector;
00099   const unsigned theTrigChamber;
00100 
00102   unsigned theRing;
00103 
00104   unsigned theChamber;
00105 
00106   bool isME11;
00107 
00108   int numWireGroups;
00109   int MESelection;
00110 
00111   int first_bx[CSCConstants::MAX_NUM_WIRES];
00112   int first_bx_corrected[CSCConstants::MAX_NUM_WIRES];
00113   int quality[CSCConstants::MAX_NUM_WIRES][3];
00114   std::vector<CSCWireDigi> digiV[CSCConstants::NUM_LAYERS];
00115   unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES];
00116 
00118   bool isMTCC;
00119 
00121   bool isTMB07;
00122 
00124   bool isSLHC;
00125 
00127   unsigned int fifo_tbins, fifo_pretrig, drift_delay;
00128   unsigned int nplanes_hit_pretrig, nplanes_hit_accel_pretrig;
00129   unsigned int nplanes_hit_pattern, nplanes_hit_accel_pattern;
00130   unsigned int trig_mode, accel_mode, l1a_window_width;
00131 
00133   unsigned int hit_persist;
00134 
00136   bool disableME1a;
00137 
00139   int early_tbins;
00140 
00142   int ghost_cancellation_bx_depth;
00143 
00146   bool ghost_cancellation_side_quality;
00147 
00149   unsigned int pretrig_extra_deadtime;
00150 
00152   bool use_corrected_bx;
00153 
00155   bool narrow_mask_r1;
00156 
00158   static const unsigned int def_fifo_tbins, def_fifo_pretrig;
00159   static const unsigned int def_drift_delay;
00160   static const unsigned int def_nplanes_hit_pretrig, def_nplanes_hit_pattern;
00161   static const unsigned int def_nplanes_hit_accel_pretrig;
00162   static const unsigned int def_nplanes_hit_accel_pattern;
00163   static const unsigned int def_trig_mode, def_accel_mode;
00164   static const unsigned int def_l1a_window_width;
00165 
00167   int pattern_mask[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES];
00168 
00170   void loadPatternMask();
00171 
00173   void setDefaultConfigParameters();
00174 
00176   void checkConfigParameters();
00177 
00179   void clear(const int wire, const int pattern);
00180 
00182   void readWireDigis(std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]);
00183   bool pulseExtension(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]);
00184   bool preTrigger(const int key_wire, const int start_bx);
00185   bool patternDetection(const int key_wire);
00186   void ghostCancellationLogic();
00187   void ghostCancellationLogicSLHC();
00188   void lctSearch();
00189   void trigMode(const int key_wire);
00190   void accelMode(const int key_wire);
00191 
00192   std::vector<CSCALCTDigi>
00193     bestTrackSelector(const std::vector<CSCALCTDigi>& all_alcts);
00194   bool isBetterALCT(const CSCALCTDigi& lhsALCT, const CSCALCTDigi& rhsALCT);
00195 
00197   void dumpConfigParams() const;
00198 
00200   void dumpDigis(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]) const;
00201 
00202   void showPatterns(const int key_wire);
00203 };
00204 
00205 #endif