CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 #ifndef CSCTriggerPrimitives_CSCAnodeLCTProcessor_h
00002 #define CSCTriggerPrimitives_CSCAnodeLCTProcessor_h
00003 
00021 #include <vector>
00022 #include <FWCore/ParameterSet/interface/ParameterSet.h>
00023 #include <DataFormats/CSCDigi/interface/CSCWireDigiCollection.h>
00024 #include <DataFormats/CSCDigi/interface/CSCALCTDigi.h>
00025 #include <CondFormats/CSCObjects/interface/CSCDBL1TPParameters.h>
00026 #include <L1Trigger/CSCCommonTrigger/interface/CSCConstants.h>
00027 
00028 class CSCAnodeLCTProcessor
00029 {
00030  public:
00032   CSCAnodeLCTProcessor(unsigned endcap, unsigned station, unsigned sector,
00033                        unsigned subsector, unsigned chamber,
00034                        const edm::ParameterSet& conf,
00035                        const edm::ParameterSet& comm);
00036 
00038   CSCAnodeLCTProcessor();
00039 
00041   void setConfigParameters(const CSCDBL1TPParameters* conf);
00042 
00044   void clear();
00045 
00048   std::vector<CSCALCTDigi> run(const CSCWireDigiCollection* wiredc);
00049 
00052   void run(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]);
00053 
00055   bool getDigis(const CSCWireDigiCollection* wiredc);
00056   void getDigis(const CSCWireDigiCollection* wiredc, const CSCDetId& id);
00057 
00059   enum {MAX_ALCT_BINS = 16};
00060 
00066   CSCALCTDigi bestALCT[MAX_ALCT_BINS];
00067 
00069   CSCALCTDigi secondALCT[MAX_ALCT_BINS];
00070 
00072   std::vector<CSCALCTDigi> readoutALCTs();
00073 
00075   std::vector<CSCALCTDigi> getALCTs();
00076 
00078   enum {NUM_PATTERN_WIRES = 14};
00079   static const int pattern_envelope[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES];
00080   static const int pattern_mask_slim[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES];
00081   static const int pattern_mask_open[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES];
00082 
00083  private:
00088   int infoV;
00089 
00091   const unsigned theEndcap;
00092   const unsigned theStation;
00093   const unsigned theSector;
00094   const unsigned theSubsector;
00095   const unsigned theTrigChamber;
00096 
00097   int numWireGroups;
00098   int MESelection;
00099 
00100   int first_bx[CSCConstants::MAX_NUM_WIRES];
00101   int quality[CSCConstants::MAX_NUM_WIRES][3];
00102   std::vector<CSCWireDigi> digiV[CSCConstants::NUM_LAYERS];
00103   unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES];
00104 
00106   bool isMTCC;
00107 
00109   bool isTMB07;
00110 
00112   unsigned int fifo_tbins, fifo_pretrig, drift_delay;
00113   unsigned int nplanes_hit_pretrig, nplanes_hit_accel_pretrig;
00114   unsigned int nplanes_hit_pattern, nplanes_hit_accel_pattern;
00115   unsigned int trig_mode, accel_mode, l1a_window_width;
00116 
00118   static const unsigned int def_fifo_tbins, def_fifo_pretrig;
00119   static const unsigned int def_drift_delay;
00120   static const unsigned int def_nplanes_hit_pretrig, def_nplanes_hit_pattern;
00121   static const unsigned int def_nplanes_hit_accel_pretrig;
00122   static const unsigned int def_nplanes_hit_accel_pattern;
00123   static const unsigned int def_trig_mode, def_accel_mode;
00124   static const unsigned int def_l1a_window_width;
00125 
00127   int pattern_mask[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES];
00128 
00130   void setDefaultConfigParameters();
00131 
00133   void checkConfigParameters();
00134 
00136   void clear(const int wire, const int pattern);
00137 
00139   void readWireDigis(std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]);
00140   bool pulseExtension(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]);
00141   bool preTrigger(const int key_wire, const int start_bx);
00142   bool patternDetection(const int key_wire);
00143   void ghostCancellationLogic();
00144   void lctSearch();
00145   void trigMode(const int key_wire);
00146   void accelMode(const int key_wire);
00147 
00148   std::vector<CSCALCTDigi>
00149     bestTrackSelector(const std::vector<CSCALCTDigi>& all_alcts);
00150   bool isBetterALCT(const CSCALCTDigi& lhsALCT, const CSCALCTDigi& rhsALCT);
00151 
00153   void dumpConfigParams() const;
00154 
00156   void dumpDigis(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]) const;
00157 
00158   void showPatterns(const int key_wire);
00159 };
00160 
00161 #endif