Skip to content

Commit

Permalink
Merge pull request #30102 from dildick/from-CMSSW_11_2_X_2020-06-03-1…
Browse files Browse the repository at this point in the history
…100-ALCT-wire-container

WireDigi container in ALCT
  • Loading branch information
cmsbuild authored Jun 6, 2020
2 parents c0b2df4 + 593f253 commit d032aea
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
10 changes: 10 additions & 0 deletions DataFormats/CSCDigi/interface/CSCALCTDigi.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
#include <cstdint>
#include <iosfwd>
#include <limits>
#include <vector>

class CSCALCTDigi {
public:
enum class Version { Legacy = 0, Run3 };

typedef std::vector<std::vector<uint16_t>> WireContainer;

/// Constructors
CSCALCTDigi(const uint16_t valid,
const uint16_t quality,
Expand Down Expand Up @@ -111,6 +114,11 @@ class CSCALCTDigi {

void setRun3(const bool isRun3);

// wire hits in this ALCT
WireContainer getHits() const { return hits_; }

void setHits(const WireContainer& hits) { hits_ = hits; }

private:
uint16_t valid_;
uint16_t quality_;
Expand All @@ -126,6 +134,8 @@ class CSCALCTDigi {
uint16_t hmt_;

Version version_;
// which hits are in this ALCT?
WireContainer hits_;
};

std::ostream& operator<<(std::ostream& o, const CSCALCTDigi& digi);
Expand Down
13 changes: 12 additions & 1 deletion DataFormats/CSCDigi/src/CSCALCTDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <iomanip>
#include <iostream>

enum Pattern_Info { NUM_LAYERS = 6, ALCT_PATTERN_WIDTH = 5 };

using namespace std;

/// Constructors
Expand All @@ -31,7 +33,12 @@ CSCALCTDigi::CSCALCTDigi(const uint16_t valid,
bx_(bx),
trknmb_(trknmb),
hmt_(hmt),
version_(version) {}
version_(version) {
hits_.resize(NUM_LAYERS);
for (auto& p : hits_) {
p.resize(ALCT_PATTERN_WIDTH);
}
}

/// Default
CSCALCTDigi::CSCALCTDigi() {
Expand All @@ -50,6 +57,10 @@ void CSCALCTDigi::clear() {
trknmb_ = 0;
fullbx_ = 0;
hmt_ = 0;
hits_.resize(NUM_LAYERS);
for (auto& p : hits_) {
p.resize(ALCT_PATTERN_WIDTH);
}
}

uint16_t CSCALCTDigi::getHMT() const { return (isRun3() ? hmt_ : std::numeric_limits<uint16_t>::max()); }
Expand Down
3 changes: 2 additions & 1 deletion DataFormats/CSCDigi/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
<class name="CSCCLCTPreTriggerDigi" ClassVersion="10">
<version ClassVersion="10" checksum="1207676078"/>
</class>
<class name="CSCALCTDigi" ClassVersion="11">
<class name="CSCALCTDigi" ClassVersion="12">
<version ClassVersion="12" checksum="2762007033"/>
<version ClassVersion="11" checksum="4162193785"/>
<version ClassVersion="10" checksum="817473300"/>
</class>
Expand Down

0 comments on commit d032aea

Please sign in to comment.