Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Dildick committed Jun 19, 2020
1 parent c06e899 commit 316ff47
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,12 @@ class CSCAnodeLCTProcessor : public CSCBaseboard {
// enum used in the wire hit assignment
enum ALCT_WireInfo { INVALID_WIRE = 65535 };

// remove the invalid wires from the container
void cleanWireContainer(CSCALCTDigi::WireContainer& wireHits) const;

// set the wire hit container
void setWireContainer(CSCALCTDigi&, CSCALCTDigi::WireContainer& wireHits) const;

/* This function looks for LCTs on the previous and next wires. If one
exists and it has a better quality and a bx_time up to 4 clocks earlier
than the present, then the present LCT is cancelled. The present LCT
Expand Down
29 changes: 13 additions & 16 deletions L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,8 @@ void CSCAnodeLCTProcessor::run(const std::vector<int> wire[CSCConstants::NUM_LAY
int valid = (ghost_cleared[0] == 0) ? 1 : 0; //cancelled, valid=0, otherwise it is 1
CSCALCTDigi newALCT(valid, quality[i_wire][0], 1, 0, i_wire, bx);

// get the comparator hits for this pattern
auto wireHits = hits_in_patterns[i_wire][0];

// purge the wire digi collection
cleanWireContainer(wireHits);

// set the hit collection
newALCT.setHits(wireHits);
// set the wire digis for this pattern
setWireContainer(newALCT, hits_in_patterns[i_wire][0]);

lct_list.push_back(newALCT);
ALCTContainer_[bx][ALCTIndex_[bx]] = newALCT;
Expand All @@ -349,14 +343,8 @@ void CSCAnodeLCTProcessor::run(const std::vector<int> wire[CSCConstants::NUM_LAY

CSCALCTDigi newALCT(valid, quality[i_wire][1], 0, quality[i_wire][2], i_wire, bx);

// get the comparator hits for this pattern
auto wireHits = hits_in_patterns[i_wire][1];

// purge the wire digi collection
cleanWireContainer(wireHits);

// set the hit collection
newALCT.setHits(wireHits);
// set the wire digis for this pattern
setWireContainer(newALCT, hits_in_patterns[i_wire][1]);

lct_list.push_back(newALCT);
ALCTContainer_[bx][ALCTIndex_[bx]] = newALCT;
Expand Down Expand Up @@ -638,6 +626,7 @@ bool CSCAnodeLCTProcessor::patternDetection(

// clear a single pattern!
CSCALCTDigi::WireContainer hits_single_pattern;
hits_single_pattern.clear();
hits_single_pattern.resize(CSCConstants::NUM_LAYERS);
for (auto& p : hits_single_pattern) {
p.resize(CSCConstants::ALCT_PATTERN_WIDTH, INVALID_WIRE);
Expand Down Expand Up @@ -1404,3 +1393,11 @@ void CSCAnodeLCTProcessor::cleanWireContainer(CSCALCTDigi::WireContainer& wireHi
p.end());
}
}

void CSCAnodeLCTProcessor::setWireContainer(CSCALCTDigi& alct, CSCALCTDigi::WireContainer& wireHits) const {
// clean the wire digi container
cleanWireContainer(wireHits);

// set the hit container
alct.setHits(wireHits);
}

0 comments on commit 316ff47

Please sign in to comment.