Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-06 01:53:44

0001 /** \class CSCCathodeLCTAnalyzer
0002  *
0003  * Class for Monte Carlo studies of cathode LCTs.  Returns a vector of up
0004  * to six (one per layer) CSCCathodeLayerInfo objects for a given CLCT.
0005  * They contain the list of comparator digis used to build a given CLCT, and
0006  * the list of associated (closest) SimHits.
0007  *
0008  * \author Slava Valuev  26 May 2004.
0009  * Porting from ORCA by S. Valuev in September 2006.
0010  *
0011  *
0012  */
0013 
0014 #ifndef L1Trigger_CSCTriggerPrimitives_CSCCathodeLCTAnalyzer_H
0015 #define L1Trigger_CSCTriggerPrimitives_CSCCathodeLCTAnalyzer_H
0016 
0017 #include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h"
0018 #include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h"
0019 #include "DataFormats/CSCDigi/interface/CSCConstants.h"
0020 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0021 #include "L1Trigger/CSCTriggerPrimitives/interface/CSCLayerInfo.h"
0022 #include "L1Trigger/CSCTriggerPrimitives/interface/CSCPatternBank.h"
0023 
0024 typedef CSCLayerInfo<CSCComparatorDigi> CSCCathodeLayerInfo;
0025 
0026 class CSCCathodeLCTAnalyzer {
0027 public:
0028   /** Default constructor. */
0029   CSCCathodeLCTAnalyzer(){};
0030 
0031   /** Constructs vector of CSCCathodeLayerInfo objects for CLCT. */
0032   std::vector<CSCCathodeLayerInfo> getSimInfo(const CSCCLCTDigi& clct,
0033                                               const CSCDetId& clctId,
0034                                               const CSCComparatorDigiCollection* compdc,
0035                                               const edm::PSimHitContainer* allSimHits);
0036 
0037   /** Finds half-strip, phi and eta of the nearest SimHit for comparison
0038       to the reconstructed values. */
0039   int nearestHS(const std::vector<CSCCathodeLayerInfo>& allLayerInfo, double& closestPhi, double& closestEta);
0040 
0041   /** Cache pointer to geometry for current event. */
0042   void setGeometry(const CSCGeometry* geom);
0043 
0044   /** Returns phi position of a given strip. */
0045   double getStripPhi(const CSCDetId& layerId, const float strip);
0046 
0047   /** Turns on the debug flag for this class. */
0048   static void setDebug() { debug = true; }
0049 
0050   /** Turns off the debug flag for this class (default). */
0051   static void setNoDebug() { debug = false; }
0052 
0053 private:
0054   static bool debug;
0055 
0056   /** Flag to decide whether to analyze stubs in ME1/A or not. */
0057   static bool doME1A;
0058 
0059   /* Cache geometry for current event. */
0060   const CSCGeometry* geom_;
0061 
0062   /* Find the list of ComparatorDigis belonging to this CLCT. */
0063   std::vector<CSCCathodeLayerInfo> lctDigis(const CSCCLCTDigi& clct,
0064                                             const CSCDetId& clctId,
0065                                             const CSCComparatorDigiCollection* compdc);
0066   int preselectDigis(const int clct_bx,
0067                      const CSCDetId& layerId,
0068                      const CSCComparatorDigiCollection* compdc,
0069                      std::vector<CSCComparatorDigi>& digiMap,
0070                      int hfstripDigis[CSCConstants::MAX_NUM_HALF_STRIPS_RUN1_TRIGGER],
0071                      int time[CSCConstants::MAX_NUM_STRIPS_RUN1],
0072                      int comp[CSCConstants::MAX_NUM_STRIPS_RUN1],
0073                      int digiNum[CSCConstants::MAX_NUM_STRIPS_RUN1]);
0074 
0075   /* Find SimHits closest to each ComparatorDigi on CLCT. */
0076   void digiSimHitAssociator(CSCCathodeLayerInfo& info, const edm::PSimHitContainer* allSimHits);
0077 };
0078 #endif