Skip to content

Commit

Permalink
Merge pull request #26918 from cms-sw/code-format-l1-45a2b9
Browse files Browse the repository at this point in the history
Running code-format for l1
  • Loading branch information
cmsbuild committed May 24, 2019
2 parents 4e0cefc + b92574a commit e8ee23e
Show file tree
Hide file tree
Showing 207 changed files with 17,104 additions and 18,098 deletions.
20 changes: 10 additions & 10 deletions L1Trigger/CSCTriggerPrimitives/interface/CSCAnodeLCTProcessor.h
Expand Up @@ -41,12 +41,14 @@

#include <vector>

class CSCAnodeLCTProcessor : public CSCBaseboard
{
public:
class CSCAnodeLCTProcessor : public CSCBaseboard {
public:
/** Normal constructor. */
CSCAnodeLCTProcessor(unsigned endcap, unsigned station, unsigned sector,
unsigned subsector, unsigned chamber,
CSCAnodeLCTProcessor(unsigned endcap,
unsigned station,
unsigned sector,
unsigned subsector,
unsigned chamber,
const edm::ParameterSet& conf);

/** Default constructor. Used for testing. */
Expand Down Expand Up @@ -89,7 +91,7 @@ class CSCAnodeLCTProcessor : public CSCBaseboard
/** Second best LCTs in this chamber, as found by the processor. */
CSCALCTDigi secondALCT[CSCConstants::MAX_ALCT_TBINS];

protected:
protected:
/** Access routines to wire digis. */
bool getDigis(const CSCWireDigiCollection* wiredc);
void getDigis(const CSCWireDigiCollection* wiredc, const CSCDetId& id);
Expand Down Expand Up @@ -133,7 +135,6 @@ class CSCAnodeLCTProcessor : public CSCBaseboard
/** SLHC: whether to use narrow pattern mask for the rings close to the beam */
bool narrow_mask_r1;


/** Default values of configuration parameters. */
static const unsigned int def_fifo_tbins, def_fifo_pretrig;
static const unsigned int def_drift_delay;
Expand Down Expand Up @@ -186,7 +187,7 @@ class CSCAnodeLCTProcessor : public CSCBaseboard
cancellation is done separately for collision and accelerator patterns. */
virtual void ghostCancellationLogic();

virtual void ghostCancellationLogicOneWire(const int key_wire, int *ghost_cleared);
virtual void ghostCancellationLogicOneWire(const int key_wire, int* ghost_cleared);

virtual int getTempALCTQuality(int temp_quality) const;

Expand All @@ -202,8 +203,7 @@ class CSCAnodeLCTProcessor : public CSCBaseboard

/* Selects two collision and two accelerator ALCTs per time bin with
the best quality. */
std::vector<CSCALCTDigi>
bestTrackSelector(const std::vector<CSCALCTDigi>& all_alcts);
std::vector<CSCALCTDigi> bestTrackSelector(const std::vector<CSCALCTDigi>& all_alcts);

/* This method should have been an overloaded > operator, but we
have to keep it here since need to check values in quality[][]
Expand Down
18 changes: 10 additions & 8 deletions L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h
Expand Up @@ -10,12 +10,14 @@
#include "L1Trigger/CSCTriggerPrimitives/interface/CSCUpgradeMotherboardLUT.h"
#include "L1Trigger/CSCTriggerPrimitives/interface/CSCUpgradeMotherboardLUTGenerator.h"

class CSCBaseboard
{
public:
class CSCBaseboard {
public:
/** Normal constructor. */
CSCBaseboard(unsigned endcap, unsigned station, unsigned sector,
unsigned subsector, unsigned chamber,
CSCBaseboard(unsigned endcap,
unsigned station,
unsigned sector,
unsigned subsector,
unsigned chamber,
const edm::ParameterSet& conf);

/** Constructor for use during testing. */
Expand All @@ -24,11 +26,11 @@ class CSCBaseboard
/** Default destructor. */
virtual ~CSCBaseboard() = default;

void setCSCGeometry(const CSCGeometry *g);
void setCSCGeometry(const CSCGeometry* g);

std::string getCSCName() const {return theCSCName_;}
std::string getCSCName() const { return theCSCName_; }

protected:
protected:
/** Chamber id (trigger-type labels). */
const unsigned theEndcap;
const unsigned theStation;
Expand Down
62 changes: 33 additions & 29 deletions L1Trigger/CSCTriggerPrimitives/interface/CSCCathodeLCTProcessor.h
Expand Up @@ -38,12 +38,14 @@

#include <vector>

class CSCCathodeLCTProcessor : public CSCBaseboard
{
public:
class CSCCathodeLCTProcessor : public CSCBaseboard {
public:
/** Normal constructor. */
CSCCathodeLCTProcessor(unsigned endcap, unsigned station, unsigned sector,
unsigned subsector, unsigned chamber,
CSCCathodeLCTProcessor(unsigned endcap,
unsigned station,
unsigned sector,
unsigned subsector,
unsigned chamber,
const edm::ParameterSet& conf);

/** Default constructor. Used for testing. */
Expand Down Expand Up @@ -71,10 +73,10 @@ class CSCCathodeLCTProcessor : public CSCBaseboard
/** Returns vector of all found CLCTs, if any. */
std::vector<CSCCLCTDigi> getCLCTs() const;

std::vector<int> preTriggerBXs() const {return thePreTriggerBXs;}
std::vector<int> preTriggerBXs() const { return thePreTriggerBXs; }

/** read out CLCTs in ME1a , ME1b */
std::vector<CSCCLCTPreTriggerDigi> preTriggerDigis() const {return thePreTriggerDigis; }
std::vector<CSCCLCTPreTriggerDigi> preTriggerDigis() const { return thePreTriggerDigis; }
std::vector<CSCCLCTPreTriggerDigi> preTriggerDigisME1a() const;
std::vector<CSCCLCTPreTriggerDigi> preTriggerDigisME1b() const;

Expand All @@ -84,8 +86,7 @@ class CSCCathodeLCTProcessor : public CSCBaseboard
/** Second best LCT in this chamber, as found by the processor. */
CSCCLCTDigi secondCLCT[CSCConstants::MAX_CLCT_TBINS];

protected:

protected:
/** Access routines to comparator digis. */
bool getDigis(const CSCComparatorDigiCollection* compdc);
void getDigis(const CSCComparatorDigiCollection* compdc, const CSCDetId& id);
Expand All @@ -106,19 +107,21 @@ class CSCCathodeLCTProcessor : public CSCBaseboard
unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]);

//--------------- Functions for post-2007 version of the firmware -----------
virtual std::vector<CSCCLCTDigi> findLCTs(const std::vector<int> halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]);
virtual std::vector<CSCCLCTDigi> findLCTs(
const std::vector<int> halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]);

/* Check all half-strip pattern envelopes simultaneously, on every clock cycle, for a matching pattern */
virtual bool preTrigger(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const int start_bx, int& first_bx);
const int start_bx,
int& first_bx);

/* For a given clock cycle, check each half-strip if a pattern matches */
bool patternFinding(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const int nStrips, const unsigned int bx_time);
const int nStrips,
const unsigned int bx_time);

/* Mark the half-strips around the best half-strip as busy */
void markBusyKeys(const int best_hstrip, const int best_patid,
int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS]);
void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS]);

//--------------------------- Auxiliary methods -----------------------------
/** Dump CLCT configuration parameters. */
Expand All @@ -141,28 +144,29 @@ class CSCCathodeLCTProcessor : public CSCBaseboard
/* does a given half-strip have a pre-trigger? */
bool ispretrig[CSCConstants::NUM_HALF_STRIPS_7CFEBS];


public:
public:
/** Pre-defined patterns. */
// New set of halfstrip patterns for 2007 version of the algorithm.
// For the given pattern, set the unused parts of the pattern to 999.
// Pattern[i][CSCConstants::MAX_HALFSTRIPS_IN_PATTERN] contains bend direction.
// Bend of 0 is right/straight and bend of 1 is left.
// Pattern[i][CSCConstants::MAX_HALFSTRIPS_IN_PATTERN+1] contains pattern maximum width
static const int pattern2007_offset[CSCConstants::MAX_HALFSTRIPS_IN_PATTERN];
static const int pattern2007[CSCConstants::NUM_CLCT_PATTERNS][CSCConstants::MAX_HALFSTRIPS_IN_PATTERN+2];
static const int pattern2007[CSCConstants::NUM_CLCT_PATTERNS][CSCConstants::MAX_HALFSTRIPS_IN_PATTERN + 2];

protected:
protected:
// we use these next ones to address the various bits inside the array that's
// used to make the cathode LCTs.
enum CLCT_INDICES {CLCT_PATTERN,
CLCT_BEND,
CLCT_STRIP,
CLCT_BX,
CLCT_STRIP_TYPE,
CLCT_QUALITY,
CLCT_CFEB,
CLCT_NUM_QUANTITIES= 7};
enum CLCT_INDICES {
CLCT_PATTERN,
CLCT_BEND,
CLCT_STRIP,
CLCT_BX,
CLCT_STRIP_TYPE,
CLCT_QUALITY,
CLCT_CFEB,
CLCT_NUM_QUANTITIES = 7
};

/* number of strips used in this processor */
int numStrips;
Expand All @@ -175,10 +179,10 @@ class CSCCathodeLCTProcessor : public CSCBaseboard
std::vector<CSCCLCTPreTriggerDigi> thePreTriggerDigis;

/** Configuration parameters. */
unsigned int fifo_tbins, fifo_pretrig; // only for test beam mode.
unsigned int fifo_tbins, fifo_pretrig; // only for test beam mode.
unsigned int hit_persist, drift_delay;
unsigned int nplanes_hit_pretrig, nplanes_hit_pattern;
unsigned int pid_thresh_pretrig, min_separation;
unsigned int pid_thresh_pretrig, min_separation;
unsigned int tmb_l1a_window_size;

/** VK: some quick and dirty fix to reduce CLCT deadtime */
Expand All @@ -191,7 +195,7 @@ class CSCCathodeLCTProcessor : public CSCBaseboard
bool readout_earliest_2;

/** Default values of configuration parameters. */
static const unsigned int def_fifo_tbins, def_fifo_pretrig;
static const unsigned int def_fifo_tbins, def_fifo_pretrig;
static const unsigned int def_hit_persist, def_drift_delay;
static const unsigned int def_nplanes_hit_pretrig;
static const unsigned int def_nplanes_hit_pattern;
Expand Down
38 changes: 18 additions & 20 deletions L1Trigger/CSCTriggerPrimitives/interface/CSCComparatorDigiFitter.h
Expand Up @@ -35,39 +35,37 @@
typedef std::vector<CSCComparatorDigi> CSCComparatorDigiContainer;
typedef std::vector<std::pair<CSCDetId, CSCComparatorDigiContainer> > CSCComparatorDigiContainerIds;

class CSCComparatorDigiFitter
{
public:

class CSCComparatorDigiFitter {
public:
CSCComparatorDigiFitter() {}
~CSCComparatorDigiFitter() {}

/* CSC trigger geometry */
void setGeometry(const CSCGeometry* csc_g) {cscGeometry_= csc_g;}
void setGeometry(const CSCGeometry* csc_g) { cscGeometry_ = csc_g; }

/* option to discretize the fitted stub phi */
void setStripBits(int bits) {nStripBits_ = bits;}
void setStripBits(int bits) { nStripBits_ = bits; }

/* use key layer radius */
void useKeyRadius(bool useKeyRadius) {useKeyRadius_ = useKeyRadius;}
void useKeyRadius(bool useKeyRadius) { useKeyRadius_ = useKeyRadius; }

/* fit a straight line to the digis */
void fit(const CSCDetId& ch_id, const CSCCorrelatedLCTDigi&,
const CSCComparatorDigiCollection&,
std::vector<float>& fit_phi_layers,
std::vector<float>& fit_z_layers, float& keyRadius);

private:

void fit(const CSCDetId& ch_id,
const CSCCorrelatedLCTDigi&,
const CSCComparatorDigiCollection&,
std::vector<float>& fit_phi_layers,
std::vector<float>& fit_z_layers,
float& keyRadius);

private:
/* collect the comparator digis that match the LCT pattern
from the comparator digi collection */
void matchingComparatorDigisLCT(const CSCDetId& ch_id,
const CSCCorrelatedLCTDigi&,
const CSCComparatorDigiCollection&);
const CSCCorrelatedLCTDigi&,
const CSCComparatorDigiCollection&);

/* collect the coordinates of comparators */
void getComparatorDigiCoordinates(const CSCDetId& ch_id,
const CSCCorrelatedLCTDigi& stub);
void getComparatorDigiCoordinates(const CSCDetId& ch_id, const CSCCorrelatedLCTDigi& stub);

/* is this comparator in the LCT pattern? */
bool comparatorInLCTPattern(int keyStrip, int pattern, int layer, int halfStrip) const;
Expand Down Expand Up @@ -96,8 +94,8 @@ class CSCComparatorDigiFitter

// number of strips and chamber width for each chamber type
// ME1a ME1b ME12 ME13 ME21 ME22 ME31 ME32 ME41 ME42
const std::vector<int> strips_ = {48,64,80,64, 80,80,80,80,80,80};
const std::vector<float> degrees_ = {10.,10.,10.,10.,20.,10.,20.,10.,20.,10.};
const std::vector<int> strips_ = {48, 64, 80, 64, 80, 80, 80, 80, 80, 80};
const std::vector<float> degrees_ = {10., 10., 10., 10., 20., 10., 20., 10., 20., 10.};
};

#endif

0 comments on commit e8ee23e

Please sign in to comment.