From e7bccfe24f984129d5f6b4a037225ab4c535980a Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 8 May 2020 01:01:25 -0500 Subject: [PATCH 01/12] Correct class name --- .../interface/CSCComparatorData.h | 94 +++++++++++++++++++ .../CSCRawToDigi/src/CSCComparatorData.cc | 0 2 files changed, 94 insertions(+) create mode 100644 EventFilter/CSCRawToDigi/interface/CSCComparatorData.h create mode 100644 EventFilter/CSCRawToDigi/src/CSCComparatorData.cc diff --git a/EventFilter/CSCRawToDigi/interface/CSCComparatorData.h b/EventFilter/CSCRawToDigi/interface/CSCComparatorData.h new file mode 100644 index 0000000000000..7fb91ccb31e44 --- /dev/null +++ b/EventFilter/CSCRawToDigi/interface/CSCComparatorData.h @@ -0,0 +1,94 @@ +#ifndef CSCComparatorData_h +#define CSCComparatorData_h +#include "DataFormats/CSCDigi/interface/CSCComparatorDigi.h" +#include "DataFormats/MuonDetId/interface/CSCDetId.h" +#include +#include + +#ifndef LOCAL_UNPACK +#include +#endif + +struct CSCComparatorDataWord { + CSCComparatorDataWord(unsigned cfeb, unsigned tbin, unsigned data) : data_(data), tbin_(tbin), cfeb_(cfeb) {} + bool value(int distrip) { return (data_ >> distrip) & 0x1; } + ///@@ not right! doesn't set zero + void set(int distrip, bool value) { data_ |= (value << distrip); } + unsigned short data_ : 8; + unsigned short tbin_ : 4; + unsigned short cfeb_ : 4; +}; + +class CSCTMBHeader; + +class CSCComparatorData { +public: + explicit CSCComparatorData(const CSCTMBHeader *tmbHeader); + CSCComparatorData(int ncfebs, int ntbins, int firmware_version = 2007); + CSCComparatorData(int ncfebs, int ntbins, const unsigned short *e0bbuf, int firmware_version = 2007); + + /** turns on/off debug flag for this class */ + static void setDebug(const bool value) { debug = value; }; + + /// layers count from one + std::vector comparatorDigis(int layer); + + /// layers count from one + std::vector comparatorDigis(uint32_t idlayer, unsigned icfeb); + + unsigned short *data() { return theData; } + /// in 16-bit words + int sizeInWords() const { return size_; } + int nlines() const { return ncfebs_ * ntbins_ * 6; } + + ///TODO for packing. Doesn't do flipping yet + void add(const CSCComparatorDigi &digi, int layer); + ///TODO for packing. Doesn't do flipping yet + void add(const CSCComparatorDigi &digi, const CSCDetId &id); + + CSCComparatorDataWord &dataWord(int iline) const { +#ifdef ASSERTS + assert(iline < nlines()); +#endif + union dataPtr { + const unsigned short *s; + CSCComparatorDataWord *d; + } mptr; + mptr.s = theData + iline; + return *(mptr.d); + } + + CSCComparatorDataWord &dataWord(int cfeb, int tbin, int layer) const { + int iline = (layer - 1) + tbin * 6 + cfeb * 6 * ntbins_; + return dataWord(iline); + } + + bool bitValue(int cfeb, int tbin, int layer, int distrip) { return dataWord(cfeb, tbin, layer).value(distrip); } + + // checks that the CFEB number and time bins are correct + bool check() const; + + // hex dump + void dump() const; + + // checks packing and unpacking + static void selfTest(); + +private: + // helper for constructors + void zero(); + +#ifdef LOCAL_UNPACK + static bool debug; +#else + static std::atomic debug; +#endif + + int ncfebs_; + int ntbins_; + int size_; + unsigned short theData[7 * 6 * 32]; + int theFirmwareVersion; +}; + +#endif diff --git a/EventFilter/CSCRawToDigi/src/CSCComparatorData.cc b/EventFilter/CSCRawToDigi/src/CSCComparatorData.cc new file mode 100644 index 0000000000000..e69de29bb2d1d From 7322103dd07904f185e965c4063f3b60583c81ea Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 8 May 2020 01:01:52 -0500 Subject: [PATCH 02/12] Delete redundant class --- .../interface/CSCComparatorDigiFitter.h | 101 ------- .../src/CSCComparatorDigiFitter.cc | 253 ------------------ 2 files changed, 354 deletions(-) delete mode 100644 L1Trigger/CSCTriggerPrimitives/interface/CSCComparatorDigiFitter.h delete mode 100644 L1Trigger/CSCTriggerPrimitives/src/CSCComparatorDigiFitter.cc diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCComparatorDigiFitter.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCComparatorDigiFitter.h deleted file mode 100644 index c809c36d3bce1..0000000000000 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCComparatorDigiFitter.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef L1Trigger_CSCTriggerPrimitives_CSCComparatorDigiFitter_h -#define L1Trigger_CSCTriggerPrimitives_CSCComparatorDigiFitter_h - -/* - * class CSCComparatorDigiFitter - * - * Fits a straight line to the comparator digis beloning to a stub - * - * This is a helper class, to be used in the first prototype - * implementation of the displaced muon trigger. In due time, - * the fitting procedure will be integrated in the - * CSCCathodeLCTProcessor. - * - * authors: Sven Dildick (TAMU), Tao Huang (TAMU) - */ - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/Utilities/interface/InputTag.h" - -#include "Geometry/CSCGeometry/interface/CSCGeometry.h" -#include "Geometry/CSCGeometry/interface/CSCLayerGeometry.h" - -#include "DataFormats/MuonDetId/interface/CSCDetId.h" -#include "DataFormats/GeometryVector/interface/GlobalPoint.h" -#include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h" -#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h" - -#include - -typedef std::vector CSCComparatorDigiContainer; -typedef std::vector > CSCComparatorDigiContainerIds; - -class CSCComparatorDigiFitter { -public: - CSCComparatorDigiFitter() {} - ~CSCComparatorDigiFitter() {} - - /* CSC trigger geometry */ - void setGeometry(const CSCGeometry* csc_g) { cscGeometry_ = csc_g; } - - /* option to discretize the fitted stub phi */ - void setStripBits(int bits) { nStripBits_ = bits; } - - /* use key layer radius */ - 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& fit_phi_layers, - std::vector& 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&); - - /* collect the coordinates of comparators */ - 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; - - // calculate slope and intercept of fit - void calculateSlopeIntercept(float& alpha, float& beta); - - /* width of the CSC half strips in this detId */ - float cscHalfStripWidth(const CSCDetId& id) const; - - /* pointer to the CSC geometry */ - const CSCGeometry* cscGeometry_; - - /* number of bits allocated to the strip number after fit */ - int nStripBits_; - - CSCComparatorDigiContainerIds compDigisIds_; - - /* coordinates of the comparators */ - std::vector phis_; - std::vector zs_; - std::vector ephis_; - std::vector ezs_; - float radius_; - bool useKeyRadius_; - - // number of strips and chamber width for each chamber type - // ME1a ME1b ME12 ME13 ME21 ME22 ME31 ME32 ME41 ME42 - const std::vector strips_ = {48, 64, 80, 64, 80, 80, 80, 80, 80, 80}; - const std::vector degrees_ = {10., 10., 10., 10., 20., 10., 20., 10., 20., 10.}; -}; - -#endif diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCComparatorDigiFitter.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCComparatorDigiFitter.cc deleted file mode 100644 index a9e0af32fe648..0000000000000 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCComparatorDigiFitter.cc +++ /dev/null @@ -1,253 +0,0 @@ -#include "L1Trigger/CSCTriggerPrimitives/interface/CSCComparatorDigiFitter.h" -#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h" -#include "DataFormats/Math/interface/normalizedPhi.h" - -namespace { - // CSC LCT patterns - // the number quotes the distance to the center - - // pid=0: no pattern found - const std::vector > pat0delta(CSCConstants::NUM_LAYERS); - - // pid=1: layer-OR trigger - const std::vector > pat1delta{{-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}, - {-2, -1, 0, 1, 2}, - {0}, - {-2, -1, 0, 1, 2}, - {-4, -3, -2, -1, 0, 1, 2, 3, 4}, - {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}}; - - // pid=2: right-bending (large) - const std::vector > pat2delta{{3, 4, 5}, {1, 2}, {0}, {-2, -1, 0}, {-4, -3, -2}, {-5, -4, -3}}; - - // pid=3: left-bending (large) - const std::vector > pat3delta{{-5, -4, -3}, {-2, -1}, {0}, {0, 1, 2}, {2, 3, 4}, {3, 4, 5}}; - - // pid=4: right-bending (medium) - const std::vector > pat4delta{{2, 3, 4}, {1, 2}, {0}, {-2, -1}, {-4, -3, -2}, {-4, -3, -2} - - }; - - // pid=5: left-bending (medium) - const std::vector > pat5delta{{-4, -3, -2}, {-2, -1}, {0}, {1, 2}, {2, 3, 4}, {2, 3, 4} - - }; - - // pid=6: right-bending (medium) - const std::vector > pat6delta{{1, 2, 3}, {0, 1}, {0}, {-1, 0}, {-2, -1}, {-3, -2, -1}}; - - // pid=7: left-bending (medium) - const std::vector > pat7delta{{-3, -2, -1}, {-1, 0}, {0}, {0, 1}, {1, 2}, {1, 2, 3}}; - - // pid=8: right-bending (small) - const std::vector > pat8delta{{0, 1, 2}, {0, 1}, {0}, {-1, 0}, {-2, -1, 0}, {-2, -1, 0}}; - - // pid=9: left-bending (small) - const std::vector > pat9delta{{-2, -1, 0}, {-1, 0}, {0}, {0, 1}, {0, 1, 2}, {0, 1, 2}}; - - // pid=A: straight-through - const std::vector > patAdelta{{-1, 0, 1}, {0}, {0}, {0}, {-1, 0, 1}, {-1, 0, 1}}; - - const std::vector > > patIndexToPatternDelta{pat0delta, - pat1delta, - pat2delta, - pat3delta, - pat4delta, - pat5delta, - pat6delta, - pat7delta, - pat8delta, - pat9delta, - patAdelta}; -} // namespace - -void CSCComparatorDigiFitter::matchingComparatorDigisLCT(const CSCDetId& ch_id, - const CSCCorrelatedLCTDigi& stub, - const CSCComparatorDigiCollection& hCSCComparators) { - // fetch the CSC comparator digis in this chamber - for (int iLayer = 1; iLayer <= CSCConstants::NUM_LAYERS; ++iLayer) { - const CSCDetId layerId(ch_id.endcap(), ch_id.station(), ch_id.ring(), ch_id.chamber(), iLayer); - - // get the digis per layer - const auto& compRange = hCSCComparators.get(layerId); - CSCComparatorDigiContainer compDigis; - - for (auto compDigiItr = compRange.first; compDigiItr != compRange.second; compDigiItr++) { - const auto& compDigi = *compDigiItr; - - //if (stub.getTimeBin() < 4 or stub.getTimeBin() > 8) continue; - const int stubHalfStrip(compDigi.getHalfStrip()); - - // these comparator digis never fit the pattern anyway! - if (std::abs(stubHalfStrip - stub.getStrip()) > 5) - continue; - - // check if this comparator digi fits the pattern - if (comparatorInLCTPattern(stub.getStrip(), stub.getPattern(), iLayer, stubHalfStrip)) { - compDigis.push_back(compDigi); - } - } - compDigisIds_.emplace_back(layerId, compDigis); - } -} - -void CSCComparatorDigiFitter::getComparatorDigiCoordinates(const CSCDetId& ch_id, const CSCCorrelatedLCTDigi& stub) { - const auto& cscChamber = cscGeometry_->chamber(ch_id); - - // get the z and phi positions of the comparator digis - float radius_ = 0.0; - - // loop on all matching digis - for (const auto& p : compDigisIds_) { - const auto& detId = p.first; - - float phi_tmp = 0.0; - float radius_tmp = 0.0; - float z_tmp = 0.0; - - // ignore layers with no digis - if (p.second.empty()) - continue; - - // loop on all matching digis in this layer - for (const auto& hit : p.second) { - const float fractional_strip = hit.getFractionalStrip(); - const auto& layer_geo = cscChamber->layer(detId.layer())->geometry(); - const float wire = layer_geo->middleWireOfGroup(stub.getKeyWG() + 1); - - // get the phi of each comparator digi - const LocalPoint& csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire); - const GlobalPoint& csc_gp = cscGeometry_->idToDet(detId)->surface().toGlobal(csc_intersect); - const float gpphi = csc_gp.phi(); - - // normalize phi values according to first one - if (!phis_.empty() and gpphi > 0 and phis_[0] < 0 and (gpphi - phis_[0]) > M_PI) - phi_tmp += (gpphi - 2 * M_PI); - else if (!phis_.empty() and gpphi < 0 and phis_[0] > 0 and (gpphi - phis_[0]) < -M_PI) - phi_tmp += (gpphi + 2 * M_PI); - else - phi_tmp += (csc_gp.phi()); - - z_tmp = csc_gp.z(); - radius_tmp += csc_gp.perp(); - } - - //in case there are more than one comparator digis in one layer - radius_tmp = radius_tmp / (p.second).size(); - radius_ += radius_tmp; - - zs_.push_back(z_tmp); - ezs_.push_back(0); - - phi_tmp = phi_tmp / (p.second).size(); - phis_.push_back(phi_tmp); - // assume that the charge is flat distributed across the half-strip - // this is only approximately valid, but good enough for now - ephis_.push_back(cscHalfStripWidth(detId) / sqrt(12)); - } -} - -void CSCComparatorDigiFitter::fit(const CSCDetId& ch_id, - const CSCCorrelatedLCTDigi& stub, - const CSCComparatorDigiCollection& hCSCComparators, - std::vector& fit_phi_layers, - std::vector& fit_z_layers, - float& keyRadius) { - // clear fit results - fit_phi_layers.clear(); - fit_z_layers.clear(); - keyRadius = 0; - - // first, match the comparator digis to the LCT - matchingComparatorDigisLCT(ch_id, stub, hCSCComparators); - - // second, get the coordinates - getComparatorDigiCoordinates(ch_id, stub); - - // get radius of the stub from key layer - const CSCDetId key_id(ch_id.endcap(), ch_id.station(), ch_id.ring(), ch_id.chamber(), CSCConstants::KEY_CLCT_LAYER); - const float fractional_strip = stub.getFractionalStrip(); - - const auto& cscChamber = cscGeometry_->chamber(ch_id); - const auto& layer_geo = cscChamber->layer(CSCConstants::KEY_CLCT_LAYER)->geometry(); - - // LCT::getKeyWG() also starts from 0 - const float wire = layer_geo->middleWireOfGroup(stub.getKeyWG() + 1); - const LocalPoint& csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire); - const GlobalPoint& csc_gp = cscGeometry_->idToDet(key_id)->surface().toGlobal(csc_intersect); - - // get radius from key layer - if (useKeyRadius_) - radius_ = radius_ / phis_.size(); - else - radius_ = csc_gp.perp(); - - float alpha = -99., beta = 0.; - // do a fit to the comparator digis - calculateSlopeIntercept(alpha, beta); - if (phis_.size() <= 2 or std::abs(alpha) >= 99) { - alpha = csc_gp.phi(); - beta = 0.0; - } - - // determine the pitch of the chamber - // option to discretize the pitch - float stripPhiPitch = layer_geo->stripPhiPitch(); - if (nStripBits_) - stripPhiPitch = stripPhiPitch / nStripBits_; - - // get the fit results - // option to discretize the fitted phi value - keyRadius = radius_; - - for (int i = 0; i < CSCConstants::NUM_LAYERS; i++) { - const float fit_z = cscChamber->layer(i + 1)->centerOfStrip(20).z(); - const float fit_phi = normalizedPhi(alpha + beta * fit_z); - fit_z_layers.push_back(fit_z); - fit_phi_layers.push_back(fit_phi); - if (nStripBits_) - fit_phi_layers.push_back((std::floor(fit_phi / stripPhiPitch) + 0.5) * stripPhiPitch); - } -} - -void CSCComparatorDigiFitter::calculateSlopeIntercept(float& alpha, float& beta) { - // if there are at least 3 hits in the chamber, do a linear fit to the - // comparator digi positions with the chi2 method - if (phis_.size() >= 3) { - float Sxx = 0, Sxy = 0, Sx = 0, Sy = 0, S = 0; - for (unsigned i = 0; i < phis_.size(); ++i) { - float sigma2_inv = 1. / ephis_[i] * ephis_[i]; - Sxx += zs_[i] * zs_[i] * sigma2_inv; - Sxy += zs_[i] * phis_[i] * sigma2_inv; - Sx += zs_[i] * zs_[i] * sigma2_inv; - Sy += phis_[i] * sigma2_inv; - S += sigma2_inv; - } - float delta = S * Sxx - Sx * Sx; - alpha = (Sxx * Sy - Sx * Sxy) / delta; - beta = (S * Sxy - Sx * Sy) / delta; - } else { - alpha = -99; - beta = 0.0; - } -} - -float CSCComparatorDigiFitter::cscHalfStripWidth(const CSCDetId& id) const { - // what is the chamber type? - int index = id.iChamberType() - 1; - - // calculate the half strip width of this chamber - return degrees_[index] * M_PI / 180. / (2. * strips_[index]); -} - -bool CSCComparatorDigiFitter::comparatorInLCTPattern(int keyStrip, int pattern, int layer, int halfStrip) const { - // get the (sub)pattern - const std::vector& subpat = patIndexToPatternDelta[pattern].at(layer - 1); - - // due to comparator digi time extension in the CLCT processor we need to - // search a bigger region around the key HS. +/-1, 0 should be sufficient - const int halfStripDelta = halfStrip - keyStrip; - return (std::find(subpat.begin(), subpat.end(), halfStripDelta + 1) != subpat.end() or - std::find(subpat.begin(), subpat.end(), halfStripDelta) != subpat.end() or - std::find(subpat.begin(), subpat.end(), halfStripDelta - 1) != subpat.end()); -} From fe59197e74506d4da07d9c5d97f959a57a03aef6 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sat, 9 May 2020 10:10:07 -0500 Subject: [PATCH 03/12] CMS code rules for CSC TPs --- .../CSCValidation/src/CSCValidation.cc | 30 +++++++++---------- .../MuonCSCDigis/src/CSCALCTDigiValidation.cc | 2 +- .../MuonCSCDigis/src/CSCCLCTDigiValidation.cc | 2 +- Validation/MuonCSCDigis/src/CSCStubMatcher.cc | 28 ++++++++--------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/RecoLocalMuon/CSCValidation/src/CSCValidation.cc b/RecoLocalMuon/CSCValidation/src/CSCValidation.cc index 8ac952aa932a8..1314687bfeb00 100644 --- a/RecoLocalMuon/CSCValidation/src/CSCValidation.cc +++ b/RecoLocalMuon/CSCValidation/src/CSCValidation.cc @@ -345,7 +345,7 @@ bool CSCValidation::filterEvents(edm::Handle recHits, return true; //if (saMuons->size() != 1) return false; /* - for(reco::TrackCollection::const_iterator muon = saMuons->begin(); muon != saMuons->end(); ++ muon ) { + for(reco::TrackCollection::const_iterator muon = saMuons->begin(); muon != saMuons->end(); ++ muon ) { double p = muon->p(); double reducedChisq = muon->normalizedChi2(); @@ -378,7 +378,7 @@ bool CSCValidation::filterEvents(edm::Handle recHits, && ( crudeLength > lengthMin ) && ( crudeLength < lengthMax ); - + goodSAMuon = goodSAMuon && ( fabs(deltaPhi) < deltaPhiMax ); goodSAMuon = goodSAMuon && ( @@ -391,13 +391,13 @@ bool CSCValidation::filterEvents(edm::Handle recHits, ( (M_PI-outerGlobalPolarAngle > polarMin) && (M_PI-outerGlobalPolarAngle < polarMax) ) ); - //goodSAMuon = goodSAMuon && (nCSCHits > nCSCHitsMin) && (nCSCHits < 13); + //goodSAMuon = goodSAMuon && (nCSCHits > nCSCHitsMin) && (nCSCHits < 13); //goodSAMuon = goodSAMuon && (nCSCHits > 13) && (nCSCHits < 19); //goodSAMuon = goodSAMuon && (nCSCHits > 19) && (nCSCHits < nCSCHitsMax); if (goodSAMuon) nGoodSAMuons++; - + } // end loop over stand-alone muon collection @@ -2704,7 +2704,7 @@ void CSCValidation::doGasGain(const CSCWireDigiCollection& wirecltn, /* std::cout< recHits, // Valid digi in the chamber (or in neighbouring chamber) if ((*digiIt).isValid()) { n_alcts++; - histos->fill1DHist((*digiIt).getBX(), "ALCT_getBX", "ALCT.getBX()", 11, -0.5, 10.5, "TimeMonitoring"); + histos->fill1DHist((*digiIt).bx(), "ALCT_bx", "ALCT.bx()", 11, -0.5, 10.5, "TimeMonitoring"); histos->fill1DHist( - (*digiIt).getFullBX(), "ALCT_getFullBX", "ALCT.getFullBX()", 3601, -0.5, 3600.5, "TimeMonitoring"); + (*digiIt).fullBX(), "ALCT_fullBX", "ALCT.fullBX()", 3601, -0.5, 3600.5, "TimeMonitoring"); //if we don't already have digi information stored for this chamber, then we fill it if (ALCT_KeyWG_map.find(idALCT.chamberId()) == ALCT_KeyWG_map.end()) { - ALCT_KeyWG_map[idALCT.chamberId()] = (*digiIt).getKeyWG(); + ALCT_KeyWG_map[idALCT.chamberId()] = (*digiIt).keyWireGroup(); //printf("I did fill ALCT info for Chamber %d %d %d %d \n",idALCT.chamberId().endcap(), idALCT.chamberId().station(), idALCT.chamberId().ring(), idALCT.chamberId().chamber()); } } @@ -3168,12 +3168,12 @@ void CSCValidation::doTimeMonitoring(edm::Handle recHits, // Valid digi in the chamber (or in neighbouring chamber) if ((*digiIt).isValid()) { n_clcts++; - histos->fill1DHist((*digiIt).getBX(), "CLCT_getBX", "CLCT.getBX()", 11, -0.5, 10.5, "TimeMonitoring"); + histos->fill1DHist((*digiIt).bx(), "CLCT_getBX", "CLCT.getBX()", 11, -0.5, 10.5, "TimeMonitoring"); histos->fill1DHist( - (*digiIt).getFullBX(), "CLCT_getFullBX", "CLCT.getFullBX()", 3601, -0.5, 3600.5, "TimeMonitoring"); + (*digiIt).fullBX(), "CLCT_fullBX", "CLCT.fullBX()", 3601, -0.5, 3600.5, "TimeMonitoring"); //if we don't already have digi information stored for this chamber, then we fill it if (CLCT_getFullBx_map.find(idCLCT.chamberId()) == CLCT_getFullBx_map.end()) { - CLCT_getFullBx_map[idCLCT.chamberId()] = (*digiIt).getFullBX(); + CLCT_getFullBx_map[idCLCT.chamberId()] = (*digiIt).fullBX(); //printf("I did fill CLCT info for Chamber %d %d %d %d \n",idCLCT.chamberId().endcap(), idCLCT.chamberId().station(), idCLCT.chamberId().ring(), idCLCT.chamberId().chamber()); } } @@ -3190,7 +3190,7 @@ void CSCValidation::doTimeMonitoring(edm::Handle recHits, if ((*digiIt).isValid()) { n_correlatedlcts++; histos->fill1DHist( - (*digiIt).getBX(), "CorrelatedLCTS_getBX", "CorrelatedLCT.getBX()", 11, -0.5, 10.5, "TimeMonitoring"); + (*digiIt).bx(), "CorrelatedLCTS_getBX", "CorrelatedLCT.bx()", 11, -0.5, 10.5, "TimeMonitoring"); } } } @@ -3424,7 +3424,7 @@ void CSCValidation::doTimeMonitoring(edm::Handle recHits, bool goodTMB = false; if (nclct && cscData[iCSC].tmbData()) { if (cscData[iCSC].tmbHeader()->check()) { - if (cscData[iCSC].clctData()->check()) + if (cscData[iCSC].comparatorData()->check()) goodTMB = true; } } diff --git a/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.cc b/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.cc index 7a1ab7fcedd2f..e9453435f6509 100644 --- a/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.cc +++ b/Validation/MuonCSCDigis/src/CSCALCTDigiValidation.cc @@ -43,7 +43,7 @@ void CSCALCTDigiValidation::analyze(const edm::Event &e, const edm::EventSetup & theNDigisPerLayerPlots[chamberType - 1]->Fill(nDigis); for (std::vector::const_iterator digiItr = beginDigi; digiItr != endDigi; ++digiItr) { - theTimeBinPlots[chamberType - 1]->Fill(digiItr->getBX()); + theTimeBinPlots[chamberType - 1]->Fill(digiItr->bx()); } } } diff --git a/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.cc b/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.cc index 6ccc970c70864..b9f66f28f3b5b 100644 --- a/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.cc +++ b/Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.cc @@ -45,7 +45,7 @@ void CSCCLCTDigiValidation::analyze(const edm::Event &e, const edm::EventSetup & theNDigisPerLayerPlots[chamberType - 1]->Fill(nDigis); for (std::vector::const_iterator digiItr = beginDigi; digiItr != endDigi; ++digiItr) { - theTimeBinPlots[chamberType - 1]->Fill(digiItr->getBX()); + theTimeBinPlots[chamberType - 1]->Fill(digiItr->bx()); } } } diff --git a/Validation/MuonCSCDigis/src/CSCStubMatcher.cc b/Validation/MuonCSCDigis/src/CSCStubMatcher.cc index f51c61b599943..987e73e0ad347 100644 --- a/Validation/MuonCSCDigis/src/CSCStubMatcher.cc +++ b/Validation/MuonCSCDigis/src/CSCStubMatcher.cc @@ -108,10 +108,10 @@ void CSCStubMatcher::matchCLCTsToSimTrack(const CSCCLCTDigiCollection& clcts) { continue; // check that the BX for this stub wasn't too early or too late - if (c->getBX() < minBXCLCT_ || c->getBX() > maxBXCLCT_) + if (c->bx() < minBXCLCT_ || c->bx() > maxBXCLCT_) continue; - int half_strip = c->getKeyStrip() + 1; // CLCT halfstrip numbers start from 0 + int half_strip = c->keyStrip() + 1; // CLCT halfstrip numbers start from 0 if (ch_id.ring() == 4 and ch_id.station() == 1 and half_strip > 128) half_strip = half_strip - 128; @@ -168,10 +168,10 @@ void CSCStubMatcher::matchALCTsToSimTrack(const CSCALCTDigiCollection& alcts) { cout << "alct " << ch_id << " " << *a << endl; // check that the BX for stub wasn't too early or too late - if (a->getBX() < minBXALCT_ || a->getBX() > maxBXALCT_) + if (a->bx() < minBXALCT_ || a->bx() > maxBXALCT_) continue; - int wg = a->getKeyWG() + 1; // as ALCT wiregroups numbers start from 0 + int wg = a->keyWireGroup() + 1; // as ALCT wiregroups numbers start from 0 // store all ALCTs in this chamber chamber_to_alcts_all_[id].push_back(*a); @@ -401,7 +401,7 @@ CSCCLCTDigi CSCStubMatcher::bestClctInChamber(unsigned int detid) const { int bestQ = 0; int index = -1; for (unsigned int i = 0; i < input.size(); ++i) { - int quality = input[i].getQuality(); + int quality = input[i].quality(); if (quality > bestQ) { bestQ = quality; index = i; @@ -418,7 +418,7 @@ CSCALCTDigi CSCStubMatcher::bestAlctInChamber(unsigned int detid) const { int bestQ = 0; int index = -1; for (unsigned int i = 0; i < input.size(); ++i) { - int quality = input[i].getQuality(); + int quality = input[i].quality(); if (quality > bestQ) { bestQ = quality; index = i; @@ -435,7 +435,7 @@ CSCCorrelatedLCTDigi CSCStubMatcher::bestLctInChamber(unsigned int detid) const int bestQ = 0; int index = -1; for (unsigned int i = 0; i < input.size(); ++i) { - int quality = input[i].getQuality(); + int quality = input[i].quality(); if (quality > bestQ) { bestQ = quality; index = i; @@ -461,7 +461,7 @@ int CSCStubMatcher::nChambersWithCLCT(int min_quality) const { for (const auto& clct : clcts) { if (!clct.isValid()) continue; - if (clct.getQuality() >= min_quality) { + if (clct.quality() >= min_quality) { nStubChamber++; } } @@ -481,7 +481,7 @@ int CSCStubMatcher::nChambersWithALCT(int min_quality) const { for (const auto& alct : alcts) { if (!alct.isValid()) continue; - if (alct.getQuality() >= min_quality) { + if (alct.quality() >= min_quality) { nStubChamber++; } } @@ -501,7 +501,7 @@ int CSCStubMatcher::nChambersWithLCT(int min_quality) const { for (const auto& lct : lcts) { if (!lct.isValid()) continue; - if (lct.getQuality() >= min_quality) { + if (lct.quality() >= min_quality) { nStubChamber++; } } @@ -521,7 +521,7 @@ int CSCStubMatcher::nChambersWithMPLCT(int min_quality) const { for (const auto& mplct : mplcts) { if (!mplct.isValid()) continue; - if (mplct.getQuality() >= min_quality) { + if (mplct.quality() >= min_quality) { nStubChamber++; } } @@ -544,10 +544,10 @@ GlobalPoint CSCStubMatcher::getGlobalPosition(unsigned int rawId, const CSCCorre CSCDetId cscId(rawId); CSCDetId key_id(cscId.endcap(), cscId.station(), cscId.ring(), cscId.chamber(), CSCConstants::KEY_CLCT_LAYER); const auto& chamber = cscGeometry_->chamber(cscId); - float fractional_strip = lct.getFractionalStrip(); + float fractional_strip = lct.fractionalStrip(); const auto& layer_geo = chamber->layer(CSCConstants::KEY_CLCT_LAYER)->geometry(); - // LCT::getKeyWG() also starts from 0 - float wire = layer_geo->middleWireOfGroup(lct.getKeyWG() + 1); + // LCT::keyWireGroup() also starts from 0 + float wire = layer_geo->middleWireOfGroup(lct.keyWireGroup() + 1); const LocalPoint& csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire); const GlobalPoint& csc_gp = cscGeometry_->idToDet(key_id)->surface().toGlobal(csc_intersect); return csc_gp; From cf57928b5fa6e3dae17080f07f9d9dd0186496d5 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sat, 9 May 2020 10:10:22 -0500 Subject: [PATCH 04/12] CMS code rules for CSC TPs --- EventFilter/CSCRawToDigi/doc/CSCRawToDigi.doc | 2 +- .../CSCRawToDigi/interface/CSCCLCTData.h | 94 ----- .../CSCRawToDigi/interface/CSCEventData.h | 4 +- .../CSCRawToDigi/interface/CSCTMBData.h | 6 +- .../CSCRawToDigi/plugins/CSCDCCUnpacker.cc | 8 +- .../CSCRawToDigi/plugins/CSCDigiToPattern.cc | 22 +- .../CSCRawToDigi/plugins/CSCDigiValidator.cc | 130 +++---- EventFilter/CSCRawToDigi/src/CSCALCTHeader.cc | 6 +- .../CSCRawToDigi/src/CSCALCTHeader2006.cc | 20 +- .../CSCRawToDigi/src/CSCALCTHeader2007.cc | 8 +- EventFilter/CSCRawToDigi/src/CSCCLCTData.cc | 361 ------------------ EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc | 50 +-- EventFilter/CSCRawToDigi/src/CSCEventData.cc | 10 +- EventFilter/CSCRawToDigi/src/CSCTMBData.cc | 26 +- EventFilter/CSCRawToDigi/src/CSCTMBHeader.cc | 8 +- .../CSCRawToDigi/src/CSCTMBHeader2006.cc | 72 ++-- .../CSCRawToDigi/src/CSCTMBHeader2007.cc | 70 ++-- .../src/CSCTMBHeader2007_rev0x50c3.cc | 66 ++-- .../CSCRawToDigi/src/CSCTMBHeader2013.cc | 66 ++-- .../CSCRawToDigi/test/cscRawToDigiTest.cpp | 2 +- .../CSCTFRawToDigi/plugins/CSCTFAnalyzer.cc | 24 +- .../CSCTFRawToDigi/plugins/CSCTFPacker.cc | 39 +- EventFilter/L1TRawToDigi/src/OmtfCscPacker.cc | 14 +- 23 files changed, 324 insertions(+), 784 deletions(-) delete mode 100644 EventFilter/CSCRawToDigi/interface/CSCCLCTData.h delete mode 100644 EventFilter/CSCRawToDigi/src/CSCCLCTData.cc diff --git a/EventFilter/CSCRawToDigi/doc/CSCRawToDigi.doc b/EventFilter/CSCRawToDigi/doc/CSCRawToDigi.doc index dad675a702401..adc5024350470 100644 --- a/EventFilter/CSCRawToDigi/doc/CSCRawToDigi.doc +++ b/EventFilter/CSCRawToDigi/doc/CSCRawToDigi.doc @@ -27,7 +27,7 @@ CSCBadCFEBWord CSCCFEBData CSCCFEBTimeSlice CSCChamberDataItr -CSCCLCTData +CSCComparatorDigi CSCDCCEventData CSCDCCExaminer CSCDCCHeader diff --git a/EventFilter/CSCRawToDigi/interface/CSCCLCTData.h b/EventFilter/CSCRawToDigi/interface/CSCCLCTData.h deleted file mode 100644 index 19b0edc2f6063..0000000000000 --- a/EventFilter/CSCRawToDigi/interface/CSCCLCTData.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef CSCCLCTData_h -#define CSCCLCTData_h -#include "DataFormats/CSCDigi/interface/CSCComparatorDigi.h" -#include "DataFormats/MuonDetId/interface/CSCDetId.h" -#include -#include - -#ifndef LOCAL_UNPACK -#include -#endif - -struct CSCCLCTDataWord { - CSCCLCTDataWord(unsigned cfeb, unsigned tbin, unsigned data) : data_(data), tbin_(tbin), cfeb_(cfeb) {} - bool value(int distrip) { return (data_ >> distrip) & 0x1; } - ///@@ not right! doesn't set zero - void set(int distrip, bool value) { data_ |= (value << distrip); } - unsigned short data_ : 8; - unsigned short tbin_ : 4; - unsigned short cfeb_ : 4; -}; - -class CSCTMBHeader; - -class CSCCLCTData { -public: - explicit CSCCLCTData(const CSCTMBHeader *tmbHeader); - CSCCLCTData(int ncfebs, int ntbins, int firmware_version = 2007); - CSCCLCTData(int ncfebs, int ntbins, const unsigned short *e0bbuf, int firmware_version = 2007); - - /** turns on/off debug flag for this class */ - static void setDebug(const bool value) { debug = value; }; - - /// layers count from one - std::vector comparatorDigis(int layer); - - /// layers count from one - std::vector comparatorDigis(uint32_t idlayer, unsigned icfeb); - - unsigned short *data() { return theData; } - /// in 16-bit words - int sizeInWords() const { return size_; } - int nlines() const { return ncfebs_ * ntbins_ * 6; } - - ///TODO for packing. Doesn't do flipping yet - void add(const CSCComparatorDigi &digi, int layer); - ///TODO for packing. Doesn't do flipping yet - void add(const CSCComparatorDigi &digi, const CSCDetId &id); - - CSCCLCTDataWord &dataWord(int iline) const { -#ifdef ASSERTS - assert(iline < nlines()); -#endif - union dataPtr { - const unsigned short *s; - CSCCLCTDataWord *d; - } mptr; - mptr.s = theData + iline; - return *(mptr.d); - } - - CSCCLCTDataWord &dataWord(int cfeb, int tbin, int layer) const { - int iline = (layer - 1) + tbin * 6 + cfeb * 6 * ntbins_; - return dataWord(iline); - } - - bool bitValue(int cfeb, int tbin, int layer, int distrip) { return dataWord(cfeb, tbin, layer).value(distrip); } - - // checks that the CFEB number and time bins are correct - bool check() const; - - // hex dump - void dump() const; - - // checks packing and unpacking - static void selfTest(); - -private: - // helper for constructors - void zero(); - -#ifdef LOCAL_UNPACK - static bool debug; -#else - static std::atomic debug; -#endif - - int ncfebs_; - int ntbins_; - int size_; - unsigned short theData[7 * 6 * 32]; - int theFirmwareVersion; -}; - -#endif diff --git a/EventFilter/CSCRawToDigi/interface/CSCEventData.h b/EventFilter/CSCRawToDigi/interface/CSCEventData.h index 771fdeb716cc6..85f7476cbcfa4 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCEventData.h +++ b/EventFilter/CSCRawToDigi/interface/CSCEventData.h @@ -3,7 +3,7 @@ class CSCCFEBData; class CSCTMBHeader; -class CSCCLCTData; +class CSCComparatorData; class CSCWireDigi; class CSCStripDigi; #include @@ -91,7 +91,7 @@ class CSCEventData { CSCTMBHeader *tmbHeader() const; /// user must check if nclct > 0 - CSCCLCTData *clctData() const; + CSCComparatorData *comparatorData() const; /// DMB trailer const CSCDMBTrailer *dmbTrailer() const { return &theDMBTrailer; } diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBData.h b/EventFilter/CSCRawToDigi/interface/CSCTMBData.h index 297b7a3aa929e..626e157424120 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBData.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBData.h @@ -9,7 +9,7 @@ #define CSCTMBData_h #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h" -#include "EventFilter/CSCRawToDigi/interface/CSCCLCTData.h" +#include "EventFilter/CSCRawToDigi/interface/CSCComparatorData.h" #include "EventFilter/CSCRawToDigi/interface/CSCTMBScope.h" #include "EventFilter/CSCRawToDigi/interface/CSCTMBMiniScope.h" #include "EventFilter/CSCRawToDigi/interface/CSCTMBBlockedCFEB.h" @@ -37,7 +37,7 @@ class CSCTMBData { const unsigned short size() const { return size_; } CSCTMBHeader* tmbHeader() { return &theTMBHeader; } - CSCCLCTData* clctData() { return &theCLCTData; } + CSCComparatorData* comparatorData() { return &theComparatorData; } /// check this before using TMB Scope bool hasTMBScope() const { return theTMBScopeIsPresent; } CSCTMBScope& tmbScope() const; @@ -74,7 +74,7 @@ class CSCTMBData { unsigned theE0FLine; CSCTMBHeader theTMBHeader; - CSCCLCTData theCLCTData; + CSCComparatorData theComparatorData; CSCRPCData theRPCData; /// The TMB scope is not present in most of data hence its dynamic bool theTMBScopeIsPresent; diff --git a/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc b/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc index 4f17fe8623f41..54b445d8c4be2 100644 --- a/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc +++ b/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc @@ -53,7 +53,7 @@ #include "EventFilter/CSCRawToDigi/interface/CSCCFEBData.h" #include "EventFilter/CSCRawToDigi/interface/CSCALCTHeader.h" #include "EventFilter/CSCRawToDigi/interface/CSCAnodeData.h" -#include "EventFilter/CSCRawToDigi/interface/CSCCLCTData.h" +#include "EventFilter/CSCRawToDigi/interface/CSCComparatorData.h" #include "EventFilter/CSCRawToDigi/interface/CSCDDUEventData.h" #include "EventFilter/CSCRawToDigi/interface/CSCTMBData.h" #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h" @@ -125,7 +125,7 @@ CSCDCCUnpacker::CSCDCCUnpacker(const edm::ParameterSet& pset) : numOfEvents(0) { } //CSCAnodeData::setDebug(debug); CSCALCTHeader::setDebug(debug); - CSCCLCTData::setDebug(debug); + CSCComparatorData::setDebug(debug); CSCEventData::setDebug(debug); CSCTMBData::setDebug(debug); CSCDCCEventData::setDebug(debug); @@ -454,7 +454,7 @@ void CSCDCCUnpacker::produce(edm::Event& e, const edm::EventSetup& c) { // if (nclct&&(cscData[iCSC].dataPresent>>5&0x1)==1) { if (nclct && cscData[iCSC].tmbData()) { if (cscData[iCSC].tmbHeader()->check()) { - if (cscData[iCSC].clctData()->check()) + if (cscData[iCSC].comparatorData()->check()) goodTMB = true; } else { LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "one of TMB checks failed! not storing TMB digis "; @@ -544,7 +544,7 @@ void CSCDCCUnpacker::produce(edm::Event& e, const edm::EventSetup& c) { for (icfeb = 0; icfeb < nCFEBs; ++icfeb) { layer = pcrate->detId(vmecrate, dmb, icfeb, ilayer); std::vector comparatorDigis = - cscData[iCSC].clctData()->comparatorDigis(layer.rawId(), icfeb); + cscData[iCSC].comparatorData()->comparatorDigis(layer.rawId(), icfeb); // Set cfeb=0, so that ME1/a and ME1/b comparators go to // ring 1. layer = pcrate->detId(vmecrate, dmb, 0, ilayer); diff --git a/EventFilter/CSCRawToDigi/plugins/CSCDigiToPattern.cc b/EventFilter/CSCRawToDigi/plugins/CSCDigiToPattern.cc index ef57cda5fbc7a..7d48675fbc7b9 100644 --- a/EventFilter/CSCRawToDigi/plugins/CSCDigiToPattern.cc +++ b/EventFilter/CSCRawToDigi/plugins/CSCDigiToPattern.cc @@ -20,22 +20,22 @@ void CSCDigiToPattern::analyze(edm::Event const& e, edm::EventSetup const& iSetu std::vector::const_iterator digiIt = (*j).second.first; std::vector::const_iterator last = (*j).second.second; for (; digiIt != last; ++digiIt) { - uint16_t wire = digiIt->getKeyWG(); // 7 bits - uint16_t pattern = digiIt->getPattern(); // 4 bits - uint16_t quality = digiIt->getQuality(); // 4 bits - uint16_t valid = digiIt->isValid(); // 1 bit - uint16_t strip = digiIt->getStrip(); // 8 bits - uint16_t bend = digiIt->getBend(); // 1 bit - uint16_t syncErr = digiIt->getSyncErr(); // 1 bit - uint16_t bx = digiIt->getBX(); // 1 bit - uint16_t bx0 = digiIt->getBX0(); // 1 bit - uint16_t cscId = digiIt->getCSCID(); // 4 bits + uint16_t wire = digiIt->keyWireGroup(); // 7 bits + uint16_t pattern = digiIt->pattern(); // 4 bits + uint16_t quality = digiIt->quality(); // 4 bits + uint16_t valid = digiIt->isValid(); // 1 bit + uint16_t strip = digiIt->strip(); // 8 bits + uint16_t bend = digiIt->bend(); // 1 bit + uint16_t syncErr = digiIt->syncErr(); // 1 bit + uint16_t bx = digiIt->bx(); // 1 bit + uint16_t bx0 = digiIt->bx0(); // 1 bit + uint16_t cscId = digiIt->cscID(); // 4 bits // __ // 32 bits in total long unsigned int mpc = ((cscId & 0xF) << 28) | ((bx0 & 0x1) << 27) | ((bx & 0x1) << 26) | ((syncErr & 0x1) << 25) | ((bend & 0x1) << 24) | ((strip & 0xFF) << 16) | ((valid & 0x1) << 15) | ((quality & 0xF) << 11) | ((pattern & 0xF) << 7) | (wire & 0x7F); - std::cout << "MPC" << digiIt->getTrknmb() << " " << std::hex << mpc << std::dec << std::endl; + std::cout << "MPC" << digiIt->trackNumber() << " " << std::hex << mpc << std::dec << std::endl; } } } diff --git a/EventFilter/CSCRawToDigi/plugins/CSCDigiValidator.cc b/EventFilter/CSCRawToDigi/plugins/CSCDigiValidator.cc index b0966af2958ae..d29ba677da8c9 100644 --- a/EventFilter/CSCRawToDigi/plugins/CSCDigiValidator.cc +++ b/EventFilter/CSCRawToDigi/plugins/CSCDigiValidator.cc @@ -471,51 +471,49 @@ bool CSCDigiValidator::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) std::vector cv = cl->second.first; std::vector sv = cl->second.second; for (int i = 0; i < max; ++i) { - if (cv[i].getKeyStrip() != sv[i].getKeyStrip()) { + if (cv[i].keyStrip() != sv[i].keyStrip()) { std::cout << "In detId: " << cl->first << std::endl; - std::cout << "CLCT key strips do not match: " << sv[i].getKeyStrip() << " != " << cv[i].getKeyStrip() - << std::endl; + std::cout << "CLCT key strips do not match: " << sv[i].keyStrip() << " != " << cv[i].keyStrip() << std::endl; } - if (cv[i].getStrip() != sv[i].getStrip()) { + if (cv[i].strip() != sv[i].strip()) { std::cout << "In detId: " << cl->first << std::endl; - std::cout << "CLCT strips do not match: " << sv[i].getStrip() << " != " << cv[i].getStrip() << std::endl; + std::cout << "CLCT strips do not match: " << sv[i].strip() << " != " << cv[i].strip() << std::endl; } if (cv[i].isValid() != sv[i].isValid()) { std::cout << "In detId: " << cl->first << std::endl; std::cout << "CLCT Valid bits do not match: " << sv[i].isValid() << " != " << cv[i].isValid() << std::endl; } - if (cv[i].getQuality() != sv[i].getQuality()) { + if (cv[i].quality() != sv[i].quality()) { std::cout << "In detId: " << cl->first << std::endl; - std::cout << "CLCT qualities do not match: " << sv[i].getQuality() << " != " << cv[i].getQuality() << std::endl; + std::cout << "CLCT qualities do not match: " << sv[i].quality() << " != " << cv[i].quality() << std::endl; } - if (cv[i].getPattern() != sv[i].getPattern()) { + if (cv[i].pattern() != sv[i].pattern()) { std::cout << "In detId: " << cl->first << std::endl; - std::cout << "CLCT patterns do not match: " << sv[i].getPattern() << " != " << cv[i].getPattern() << std::endl; + std::cout << "CLCT patterns do not match: " << sv[i].pattern() << " != " << cv[i].pattern() << std::endl; } - if (cv[i].getStripType() != sv[i].getStripType()) { + if (cv[i].stripType() != sv[i].stripType()) { std::cout << "In detId: " << cl->first << std::endl; - std::cout << "CLCT strip types do not match: " << sv[i].getStripType() << " != " << cv[i].getStripType() - << std::endl; + std::cout << "CLCT strip types do not match: " << sv[i].stripType() << " != " << cv[i].stripType() << std::endl; } - if (cv[i].getBend() != sv[i].getBend()) { + if (cv[i].bend() != sv[i].bend()) { std::cout << "In detId: " << cl->first << std::endl; - std::cout << "CLCT bends do not match: " << sv[i].getBend() << " != " << cv[i].getBend() << std::endl; + std::cout << "CLCT bends do not match: " << sv[i].bend() << " != " << cv[i].bend() << std::endl; } - if (cv[i].getCFEB() != sv[i].getCFEB()) { + if (cv[i].cfeb() != sv[i].cfeb()) { std::cout << "In detId: " << cl->first << std::endl; - std::cout << "CLCT CFEBs do not match: " << sv[i].getCFEB() << " != " << cv[i].getCFEB() << std::endl; + std::cout << "CLCT CFEBs do not match: " << sv[i].cfeb() << " != " << cv[i].cfeb() << std::endl; } - if (((short)cv[i].getBX()) != ((short)sv[i].getBX()) - 4) { + if (((short)cv[i].bx()) != ((short)sv[i].bx()) - 4) { std::cout << "In detId: " << cl->first << std::endl; - std::cout << "CLCT BX do not match: " << sv[i].getBX() - 4 << " != " << cv[i].getBX() << std::endl; + std::cout << "CLCT BX do not match: " << sv[i].bx() - 4 << " != " << cv[i].bx() << std::endl; } - if (cv[i].getFullBX() != sv[i].getFullBX()) { + if (cv[i].fullBX() != sv[i].fullBX()) { std::cout << "In detId: " << cl->first << std::endl; - std::cout << "CLCT Full BX do not match: " << sv[i].getFullBX() << " != " << cv[i].getFullBX() << std::endl; + std::cout << "CLCT Full BX do not match: " << sv[i].fullBX() << " != " << cv[i].fullBX() << std::endl; } - if (cv[i].getTrknmb() != sv[i].getTrknmb()) { + if (cv[i].trackNumber() != sv[i].trackNumber()) { std::cout << "In detId: " << cl->first << std::endl; - std::cout << "CLCT Track numbers do not match: " << sv[i].getTrknmb() << " != " << cv[i].getTrknmb() + std::cout << "CLCT Track numbers do not match: " << sv[i].trackNumber() << " != " << cv[i].trackNumber() << std::endl; } } @@ -539,36 +537,36 @@ bool CSCDigiValidator::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) std::vector cv = al->second.first; std::vector sv = al->second.second; for (int i = 0; i < max; ++i) { - if (cv[i].getKeyWG() != sv[i].getKeyWG()) { + if (cv[i].keyWireGroup() != sv[i].keyWireGroup()) { std::cout << "In detId: " << al->first << std::endl; - std::cout << "ALCT key wire groups do not match: " << sv[i].getKeyWG() << " != " << cv[i].getKeyWG() + std::cout << "ALCT key wire groups do not match: " << sv[i].keyWireGroup() << " != " << cv[i].keyWireGroup() << std::endl; } if (cv[i].isValid() != sv[i].isValid()) { std::cout << "In detId: " << al->first << std::endl; std::cout << "ALCT Valid bits do not match: " << sv[i].isValid() << " != " << cv[i].isValid() << std::endl; } - if (cv[i].getQuality() != sv[i].getQuality()) { + if (cv[i].quality() != sv[i].quality()) { std::cout << "In detId: " << al->first << std::endl; - std::cout << "ALCT qualities do not match: " << sv[i].getQuality() << " != " << cv[i].getQuality() << std::endl; + std::cout << "ALCT qualities do not match: " << sv[i].quality() << " != " << cv[i].quality() << std::endl; } - if (cv[i].getAccelerator() != sv[i].getAccelerator()) { + if (cv[i].accelerator() != sv[i].accelerator()) { std::cout << "In detId: " << al->first << std::endl; - std::cout << "ALCT accelerator bits do not match: " << sv[i].getAccelerator() - << " != " << cv[i].getAccelerator() << std::endl; + std::cout << "ALCT accelerator bits do not match: " << sv[i].accelerator() << " != " << cv[i].accelerator() + << std::endl; } - if (cv[i].getCollisionB() != sv[i].getCollisionB()) { + if (cv[i].collisionB() != sv[i].collisionB()) { std::cout << "In detId: " << al->first << std::endl; - std::cout << "ALCT CollisionB flags do not match: " << sv[i].getCollisionB() << " != " << cv[i].getCollisionB() + std::cout << "ALCT CollisionB flags do not match: " << sv[i].collisionB() << " != " << cv[i].collisionB() << std::endl; } - if ((cv[i].getBX()) != (sv[i].getBX())) { + if ((cv[i].bx()) != (sv[i].bx())) { std::cout << "In detId: " << al->first << std::endl; - std::cout << "ALCT BX do not match: " << sv[i].getBX() << " != " << cv[i].getBX() << std::endl; + std::cout << "ALCT BX do not match: " << sv[i].bx() << " != " << cv[i].bx() << std::endl; } - if (cv[i].getFullBX() != sv[i].getFullBX()) { + if (cv[i].fullBX() != sv[i].fullBX()) { std::cout << "In detId: " << cl->first << std::endl; - std::cout << "ALCT Full BX do not match: " << sv[i].getFullBX() << " != " << cv[i].getFullBX() << std::endl; + std::cout << "ALCT Full BX do not match: " << sv[i].fullBX() << " != " << cv[i].fullBX() << std::endl; } } } @@ -591,72 +589,70 @@ bool CSCDigiValidator::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) std::vector cv = lc->second.first; std::vector sv = lc->second.second; for (int i = 0; i < max; ++i) { - if (cv[i].getStrip() != sv[i].getStrip()) { + if (cv[i].strip() != sv[i].strip()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT strips do not match: " << sv[i].getStrip() << " != " << cv[i].getStrip() - << std::endl; + std::cout << "Correlated LCT strips do not match: " << sv[i].strip() << " != " << cv[i].strip() << std::endl; } - if (cv[i].getKeyWG() != sv[i].getKeyWG()) { + if (cv[i].keyWireGroup() != sv[i].keyWireGroup()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT key wire groups do not match: " << sv[i].getKeyWG() << " != " << cv[i].getKeyWG() - << std::endl; + std::cout << "Correlated LCT key wire groups do not match: " << sv[i].keyWireGroup() + << " != " << cv[i].keyWireGroup() << std::endl; } if (cv[i].isValid() != sv[i].isValid()) { std::cout << "In detId: " << lc->first << std::endl; std::cout << "Correlated LCT Valid bits do not match: " << sv[i].isValid() << " != " << cv[i].isValid() << std::endl; } - if (cv[i].getQuality() != sv[i].getQuality()) { + if (cv[i].quality() != sv[i].quality()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT qualities do not match: " << sv[i].getQuality() << " != " << cv[i].getQuality() + std::cout << "Correlated LCT qualities do not match: " << sv[i].quality() << " != " << cv[i].quality() << std::endl; } - if (cv[i].getPattern() != sv[i].getPattern()) { + if (cv[i].pattern() != sv[i].pattern()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT ALCT patterns do not match: " << sv[i].getPattern() << " != " << cv[i].getPattern() + std::cout << "Correlated LCT ALCT patterns do not match: " << sv[i].pattern() << " != " << cv[i].pattern() << std::endl; } - if (cv[i].getCLCTPattern() != sv[i].getCLCTPattern()) { + if (cv[i].clctPattern() != sv[i].clctPattern()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT CLCT patterns do not match: " << sv[i].getCLCTPattern() - << " != " << cv[i].getCLCTPattern() << std::endl; + std::cout << "Correlated LCT CLCT patterns do not match: " << sv[i].clctPattern() + << " != " << cv[i].clctPattern() << std::endl; } - if (cv[i].getStripType() != sv[i].getStripType()) { + if (cv[i].stripType() != sv[i].stripType()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT strip types do not match: " << sv[i].getStripType() - << " != " << cv[i].getStripType() << std::endl; + std::cout << "Correlated LCT strip types do not match: " << sv[i].stripType() << " != " << cv[i].stripType() + << std::endl; } - if (cv[i].getBend() != sv[i].getBend()) { + if (cv[i].bend() != sv[i].bend()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT bends do not match: " << sv[i].getBend() << " != " << cv[i].getBend() << std::endl; + std::cout << "Correlated LCT bends do not match: " << sv[i].bend() << " != " << cv[i].bend() << std::endl; } - if (cv[i].getMPCLink() != sv[i].getMPCLink()) { + if (cv[i].mpcLink() != sv[i].mpcLink()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT MPC Links do not match: " << sv[i].getMPCLink() << " != " << cv[i].getMPCLink() + std::cout << "Correlated LCT MPC Links do not match: " << sv[i].mpcLink() << " != " << cv[i].mpcLink() << std::endl; } - if ((cv[i].getBX()) != (sv[i].getBX() - 6)) { + if ((cv[i].bx()) != (sv[i].bx() - 6)) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT BX do not match: " << sv[i].getBX() - 6 << " != " << cv[i].getBX() << std::endl; + std::cout << "Correlated LCT BX do not match: " << sv[i].bx() - 6 << " != " << cv[i].bx() << std::endl; } - if (cv[i].getCSCID() != sv[i].getCSCID()) { + if (cv[i].cscID() != sv[i].cscID()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT CSCIDs do not match: " << sv[i].getCSCID() << " != " << cv[i].getCSCID() - << std::endl; + std::cout << "Correlated LCT CSCIDs do not match: " << sv[i].cscID() << " != " << cv[i].cscID() << std::endl; } - if (cv[i].getBX0() != sv[i].getBX0()) { + if (cv[i].bx0() != sv[i].bx0()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT BX0s do not match: " << sv[i].getBX0() << " != " << cv[i].getBX0() << std::endl; + std::cout << "Correlated LCT BX0s do not match: " << sv[i].bx0() << " != " << cv[i].bx0() << std::endl; } - if (cv[i].getSyncErr() != sv[i].getSyncErr()) { + if (cv[i].syncErr() != sv[i].syncErr()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT SyncErrs do not match: " << sv[i].getSyncErr() << " != " << cv[i].getSyncErr() + std::cout << "Correlated LCT SyncErrs do not match: " << sv[i].syncErr() << " != " << cv[i].syncErr() << std::endl; } - if (cv[i].getTrknmb() != sv[i].getTrknmb()) { + if (cv[i].trackNumber() != sv[i].trackNumber()) { std::cout << "In detId: " << lc->first << std::endl; - std::cout << "Correlated LCT Track numbers do not match: " << sv[i].getTrknmb() << " != " << cv[i].getTrknmb() - << std::endl; + std::cout << "Correlated LCT Track numbers do not match: " << sv[i].trackNumber() + << " != " << cv[i].trackNumber() << std::endl; } } } diff --git a/EventFilter/CSCRawToDigi/src/CSCALCTHeader.cc b/EventFilter/CSCRawToDigi/src/CSCALCTHeader.cc index 6df997db224a1..ddeb1b6adc99a 100644 --- a/EventFilter/CSCRawToDigi/src/CSCALCTHeader.cc +++ b/EventFilter/CSCRawToDigi/src/CSCALCTHeader.cc @@ -194,7 +194,7 @@ void CSCALCTHeader::add(const std::vector &digis) { theALCTs.resize(header2007.lctBins * 2); } for (std::vector::const_iterator digi = digis.begin(); digi != digis.end(); ++digi) { - int bx = digi->getBX(); + int bx = digi->bx(); if (bx < (int)header2007.lctBins) { // 2 ALCTs per bx int i = bx * 2; @@ -205,12 +205,12 @@ void CSCALCTHeader::add(const std::vector &digis) { theALCTs[i] = CSCALCT(*digi); } // new best LCT - else if (digi->getQuality() > q1) { + else if (digi->quality() > q1) { theALCTs[i + 1] = theALCTs[i]; theALCTs[i] = CSCALCT(*digi); } // new second best - else if (!theALCTs[i + 1].valid || (digi->getQuality() > q2)) { + else if (!theALCTs[i + 1].valid || (digi->quality() > q2)) { theALCTs[i + 1] = CSCALCT(*digi); } } diff --git a/EventFilter/CSCRawToDigi/src/CSCALCTHeader2006.cc b/EventFilter/CSCRawToDigi/src/CSCALCTHeader2006.cc index a36b12f1a9cb6..ce509016d76c2 100644 --- a/EventFilter/CSCRawToDigi/src/CSCALCTHeader2006.cc +++ b/EventFilter/CSCRawToDigi/src/CSCALCTHeader2006.cc @@ -64,20 +64,20 @@ void CSCALCTs2006::add(const std::vector& digis) { void CSCALCTs2006::addALCT0(const CSCALCTDigi& digi) { alct0_valid = digi.isValid(); - alct0_quality = digi.getQuality(); - alct0_accel = digi.getAccelerator(); - alct0_pattern = digi.getCollisionB(); - alct0_key_wire = digi.getKeyWG(); + alct0_quality = digi.quality(); + alct0_accel = digi.accelerator(); + alct0_pattern = digi.collisionB(); + alct0_key_wire = digi.keyWireGroup(); // probably not right - alct0_bxn_low = digi.getBX(); + alct0_bxn_low = digi.bx(); } void CSCALCTs2006::addALCT1(const CSCALCTDigi& digi) { alct1_valid = digi.isValid(); - alct1_quality = digi.getQuality(); - alct1_accel = digi.getAccelerator(); - alct1_pattern = digi.getCollisionB(); - alct1_key_wire = digi.getKeyWG(); + alct1_quality = digi.quality(); + alct1_accel = digi.accelerator(); + alct1_pattern = digi.collisionB(); + alct1_key_wire = digi.keyWireGroup(); // probably not right - alct1_bxn_low = digi.getBX(); + alct1_bxn_low = digi.bx(); } diff --git a/EventFilter/CSCRawToDigi/src/CSCALCTHeader2007.cc b/EventFilter/CSCRawToDigi/src/CSCALCTHeader2007.cc index 4e437d2412b85..6f0a9cda95d7c 100644 --- a/EventFilter/CSCRawToDigi/src/CSCALCTHeader2007.cc +++ b/EventFilter/CSCRawToDigi/src/CSCALCTHeader2007.cc @@ -7,10 +7,10 @@ CSCALCT::CSCALCT() { CSCALCT::CSCALCT(const CSCALCTDigi& alctDigi) : valid(alctDigi.isValid()), - quality(alctDigi.getQuality()), - accel(alctDigi.getAccelerator()), - pattern(alctDigi.getCollisionB()), - keyWire(alctDigi.getKeyWG()), + quality(alctDigi.quality()), + accel(alctDigi.accelerator()), + pattern(alctDigi.collisionB()), + keyWire(alctDigi.keyWireGroup()), reserved(0) {} #include diff --git a/EventFilter/CSCRawToDigi/src/CSCCLCTData.cc b/EventFilter/CSCRawToDigi/src/CSCCLCTData.cc deleted file mode 100644 index 46b5aac9e166b..0000000000000 --- a/EventFilter/CSCRawToDigi/src/CSCCLCTData.cc +++ /dev/null @@ -1,361 +0,0 @@ -#include "EventFilter/CSCRawToDigi/interface/CSCCLCTData.h" -#include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h" -#include "DataFormats/MuonDetId/interface/CSCDetId.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include -#include -#include - -#ifdef LOCAL_UNPACK -bool CSCCLCTData::debug = false; -#else -#include -std::atomic CSCCLCTData::debug{false}; -#endif - -CSCCLCTData::CSCCLCTData(const CSCTMBHeader* tmbHeader) : ncfebs_(tmbHeader->NCFEBs()), ntbins_(tmbHeader->NTBins()) { - if (tmbHeader != nullptr) - theFirmwareVersion = tmbHeader->FirmwareVersion(); - else - theFirmwareVersion = 2007; - size_ = nlines(); - zero(); -} - -CSCCLCTData::CSCCLCTData(int ncfebs, int ntbins, int firmware_version) - : ncfebs_(ncfebs), ntbins_(ntbins), theFirmwareVersion(firmware_version) { - size_ = nlines(); - zero(); -} - -CSCCLCTData::CSCCLCTData(int ncfebs, int ntbins, const unsigned short* buf, int firmware_version) - : ncfebs_(ncfebs), ntbins_(ntbins), theFirmwareVersion(firmware_version) { - // add two more for odd ntbins, plus one for the e0c - // Oct 2004 Rick: e0c line belongs to CSCTMBTrailer - size_ = (nlines() % 2 == 1) ? nlines() + 2 : nlines(); - - memcpy(theData, buf, size_ * 2); -} - -void CSCCLCTData::zero() { - for (int ifeb = 0; ifeb < ncfebs_; ++ifeb) { - for (int tbin = 0; tbin < ntbins_; ++tbin) { - for (int layer = 1; layer <= 6; ++layer) { - dataWord(ifeb, tbin, layer) = CSCCLCTDataWord(ifeb, tbin, 0); - } - } - } -} - -std::vector CSCCLCTData::comparatorDigis(uint32_t idlayer, unsigned cfeb) { - static const bool doStripSwapping = true; - bool me1a = (CSCDetId::station(idlayer) == 1) && (CSCDetId::ring(idlayer) == 4); - bool zplus = (CSCDetId::endcap(idlayer) == 1); - bool me1b = (CSCDetId::station(idlayer) == 1) && (CSCDetId::ring(idlayer) == 1); - // bool me11 = (CSCDetId::station(idlayer)==1) && ((CSCDetId::ring(idlayer)==1) || (CSCDetId::ring(idlayer)==4)); - unsigned layer = CSCDetId::layer(idlayer); - - //looking for comp output on layer - std::vector result; - assert(layer > 0 && layer <= 6); - // this is pretty sparse data, so I wish we could check the - // data word by word, not bit by bit, but I don't see how to - // do the time sequencing that way. - for (int distrip = 0; distrip < 8; ++distrip) { - uint16_t tbinbitsS0HS0 = 0; - uint16_t tbinbitsS0HS1 = 0; - uint16_t tbinbitsS1HS0 = 0; - uint16_t tbinbitsS1HS1 = 0; - for (int tbin = 0; tbin < ntbins_ - 2; ++tbin) { - if (bitValue(cfeb, tbin, layer, distrip)) { - /// first do some checks - CSCCLCTDataWord word = dataWord(cfeb, tbin, layer); - assert(word.tbin_ == tbin); - assert(word.cfeb_ == cfeb); - // we have a hit. The next two time samples - // are the other two bits in the triad - int bit2 = bitValue(cfeb, tbin + 1, layer, distrip); - int bit3 = bitValue(cfeb, tbin + 2, layer, distrip); - // should count from zero - int chamberDistrip = distrip + cfeb * 8; - int HalfStrip = 4 * chamberDistrip + bit2 * 2 + bit3; - int output = 4 + bit2 * 2 + bit3; - /* - * Handles distrip logic; comparator output is for pairs of strips: - * hit bin dec - * x--- 100 4 - * -x-- 101 5 - * --x- 110 6 - * ---x 111 7 - * - */ - - if (debug) - LogTrace("CSCCLCTData|CSCRawToDigi") - << "fillComparatorOutputs: layer = " << layer << " timebin = " << tbin << " cfeb = " << cfeb - << " distrip = " << chamberDistrip << " HalfStrip = " << HalfStrip << " Output " << output << std::endl; - ///what is actually stored in comparator digis are 0/1 for left/right halfstrip for each strip - - ///constructing four bitted words for tbits on - if (output == 4) - tbinbitsS0HS0 = tbinbitsS0HS0 + (1 << tbin); - if (output == 5) - tbinbitsS0HS1 = tbinbitsS0HS1 + (1 << tbin); - if (output == 6) - tbinbitsS1HS0 = tbinbitsS1HS0 + (1 << tbin); - if (output == 7) - tbinbitsS1HS1 = tbinbitsS1HS1 + (1 << tbin); - - tbin += 2; - } - } //end of loop over time bins - //we do not have to check over the last couple of time bins if there are no hits since - //comparators take 3 time bins - - // Store digis each of possible four halfstrips for given distrip: - if (tbinbitsS0HS0 || tbinbitsS0HS1 || tbinbitsS1HS0 || tbinbitsS1HS1) { - unsigned int cfeb_corr = cfeb; - unsigned int distrip_corr = distrip; - - if (doStripSwapping) { - // Fix ordering of strips and CFEBs in ME1/1. - // SV, 27/05/08: keep CFEB=4 for ME1/a until CLCT trigger logic - // stops combining it with the info from the other 4 CFEBs (ME1/b). - // - if (theFirmwareVersion >= 2013) { - if (me1a && zplus) { - distrip_corr = 7 - distrip; // 0-7 -> 7-0 - cfeb_corr = 10 - cfeb; - } - if (me1b && !zplus) { - distrip_corr = 7 - distrip; - cfeb_corr = 3 - cfeb; - } - } else { - // if ( me1a ) { cfeb_corr = 0; } // reset 4 to 0 - if (me1a && zplus) { - distrip_corr = 7 - distrip; // 0-7 -> 7-0 - } - if (me1b && !zplus) { - distrip_corr = 7 - distrip; - cfeb_corr = 3 - cfeb; - } - } - } - - int strip = 16 * cfeb_corr + 2 * distrip_corr + 1; - - if (debug) - LogTrace("CSCCLCTData|CSCRawToDigi") << "fillComparatorOutputs: cfeb_corr = " << cfeb_corr - << " distrip_corr = " << distrip_corr << " strip = " << strip; - - if (doStripSwapping && ((me1a && zplus) || (me1b && !zplus))) { - // Half-strips need to be flipped too. - if (tbinbitsS1HS1) - result.push_back(CSCComparatorDigi(strip, 0, tbinbitsS1HS1)); - if (tbinbitsS1HS0) - result.push_back(CSCComparatorDigi(strip, 1, tbinbitsS1HS0)); - if (tbinbitsS0HS1) - result.push_back(CSCComparatorDigi(strip + 1, 0, tbinbitsS0HS1)); - if (tbinbitsS0HS0) - result.push_back(CSCComparatorDigi(strip + 1, 1, tbinbitsS0HS0)); - } else { - if (tbinbitsS0HS0) - result.push_back(CSCComparatorDigi(strip, 0, tbinbitsS0HS0)); - if (tbinbitsS0HS1) - result.push_back(CSCComparatorDigi(strip, 1, tbinbitsS0HS1)); - if (tbinbitsS1HS0) - result.push_back(CSCComparatorDigi(strip + 1, 0, tbinbitsS1HS0)); - if (tbinbitsS1HS1) - result.push_back(CSCComparatorDigi(strip + 1, 1, tbinbitsS1HS1)); - } - //uh oh ugly ugly ugly! - } - } //end of loop over distrips - return result; -} - -std::vector CSCCLCTData::comparatorDigis(int layer) { - //returns comparators for one layer for all cfebs - std::vector result; - assert(layer > 0 && layer <= 6); - - for (int cfeb = 0; cfeb < ncfebs_; ++cfeb) { - std::vector oneCfebDigi = comparatorDigis(layer, cfeb); - result.insert(result.end(), oneCfebDigi.begin(), oneCfebDigi.end()); - } - - return result; -} - -void CSCCLCTData::add(const CSCComparatorDigi& digi, int layer) { - //FIXME do flipping - int strip = digi.getStrip(); - int halfStrip = (strip - 1) * 2 + digi.getComparator(); - int cfeb = (strip - 1) / 16; - int distrip = ((strip - 1) % 16) / 2; - - // assert(distrip < 8 && cfeb < 6 && halfStrip < 161); - ///!!! Do we need to introduce format version here to accomodate 7 CFEBs - assert(distrip < 8 && cfeb < 8 && halfStrip < 225); - - std::vector timeBinsOn = digi.getTimeBinsOn(); - for (std::vector::const_iterator tbinItr = timeBinsOn.begin(); tbinItr != timeBinsOn.end(); ++tbinItr) { - int tbin = *tbinItr; - if (tbin >= 0 && tbin < ntbins_ - 2) { - // First triad bit indicates the presence of the hit - dataWord(cfeb, tbin, layer).set(distrip, true); - // Second bit indicates which of the two strips contains the hit - if (strip % 2 == 0) - dataWord(cfeb, tbin + 1, layer).set(distrip, true); - // Third bit indicates whether the hit is located on the left or on the - // right side of the strip. - if (digi.getComparator()) - dataWord(cfeb, tbin + 2, layer).set(distrip, true); - } - } -} - -/*** - * Comparator packing version with ME11 strips swapping - ***/ -void CSCCLCTData::add(const CSCComparatorDigi& digi, const CSCDetId& cid) { - static const bool doStripSwapping = true; - bool me1a = (cid.station() == 1) && (cid.ring() == 4); - bool zplus = (cid.endcap() == 1); - bool me1b = (cid.station() == 1) && (cid.ring() == 1); - // bool me11 = (cid.station()==1) && ((cid.ring()==1) || (cid.ring()==4)); - - unsigned layer = cid.layer(); - - int strip = digi.getStrip(); - int halfstrip = (strip - 1) * 2 + digi.getComparator(); - int cfeb = (strip - 1) / 16; - int distrip = ((strip - 1) % 16) / 2; - int bit2 = (strip - 1) % 2; - int bit3 = digi.getComparator(); - - // assert(distrip < 8 && cfeb < 6 && halfStrip < 161); - ///!!! Do we need to introduce format version here to accomodate 7 CFEBs - if (theFirmwareVersion >= 2013) { - assert(distrip < 8 && cfeb < 8 && halfstrip < 225); - } else { - assert(distrip < 8 && cfeb < 6 && halfstrip < 161); - } - - // Lets try to do ME11 strip flipping - if (doStripSwapping) { - if (theFirmwareVersion >= 2013) { - if ((me1a || (me1b && (cfeb > 3))) && zplus) { - distrip = 7 - distrip; // 0-7 -> 7-0 - cfeb = 10 - cfeb; - bit2 = ((31 - (halfstrip % 32)) % 4) / 2; - bit3 = ((31 - (halfstrip % 32)) % 4) % 2; - } - if (me1b && !zplus && (cfeb < 4)) { - distrip = 7 - distrip; - cfeb = 3 - cfeb; - bit2 = ((31 - (halfstrip % 32)) % 4) / 2; - bit3 = ((31 - (halfstrip % 32)) % 4) % 2; - } - } else { - // if ( me1a ) { cfeb_corr = 0; } // reset 4 to 0 - if ((me1a || (me1b && (cfeb > 3))) && zplus) { - distrip = 7 - distrip; // 0-7 -> 7-0 - bit2 = ((31 - (halfstrip % 32)) % 4) / 2; - bit3 = ((31 - (halfstrip % 32)) % 4) % 2; - } - if (me1b && !zplus && (cfeb < 4)) { - distrip = 7 - distrip; - cfeb = 3 - cfeb; - bit2 = ((31 - (halfstrip % 32)) % 4) / 2; - bit3 = ((31 - (halfstrip % 32)) % 4) % 2; - } - } - } - - std::vector timeBinsOn = digi.getTimeBinsOn(); - for (std::vector::const_iterator tbinItr = timeBinsOn.begin(); tbinItr != timeBinsOn.end(); ++tbinItr) { - int tbin = *tbinItr; - if (tbin >= 0 && tbin < ntbins_ - 2) { - // First triad bit indicates the presence of the hit - dataWord(cfeb, tbin, layer).set(distrip, true); - // Second bit indicates which of the two strips contains the hit - // if (strip%2 == 0) - if (bit2) - dataWord(cfeb, tbin + 1, layer).set(distrip, true); - // Third bit indicates whether the hit is located on the left or on the - // right side of the strip. - // if (digi.getComparator()) - if (bit3) - dataWord(cfeb, tbin + 2, layer).set(distrip, true); - } - } -} - -bool CSCCLCTData::check() const { - bool result = true; - for (int cfeb = 0; cfeb < ncfebs_; ++cfeb) { - for (int tbin = 0; tbin < ntbins_; ++tbin) { - for (int layer = 1; layer <= 6; ++layer) { - /// first do some checks - const CSCCLCTDataWord& word = dataWord(cfeb, tbin, layer); - bool wordIsGood = (word.tbin_ == tbin) && (word.cfeb_ == cfeb); - result = result && wordIsGood; - if (!wordIsGood && debug) { - LogTrace("CSCCLCTData|CSCRawToDigi") - << "Bad CLCT data in layer " << layer << " expect CFEB " << cfeb << " tbin " << tbin; - LogTrace("CSCCLCTData|CSCRawToDigi") << " See " << word.cfeb_ << " " << word.tbin_; - } - } - } - } - if (!result) - LogTrace("CSCCLCTData|CSCRawToDigi") << "++ Bad CLCT Data ++ "; - return result; -} - -void CSCCLCTData::dump() const { - for (int i = 0; i < size_; i++) { - printf("%04x %04x %04x %04x\n", theData[i + 3], theData[i + 2], theData[i + 1], theData[i]); - i += 3; - } -} - -void CSCCLCTData::selfTest() { - CSCCLCTData clctData(5, 16); - // aim for output 4 in 5th time bin, = 0000000000010000 - CSCComparatorDigi comparatorDigi1(1, 0, 0x10); - // aim for output 5 in 6th time bin, = 0000 0000 0010 0000 - CSCComparatorDigi comparatorDigi2(39, 1, 0x20); - // aim for output 7 in 7th time bin, = 000 0000 0100 0000 - CSCComparatorDigi comparatorDigi3(80, 1, 0x40); - - clctData.add(comparatorDigi1, 1); - clctData.add(comparatorDigi2, 4); - clctData.add(comparatorDigi3, 6); - - CSCDetId layer1(1, 4, 1, 2, 1); - CSCDetId layer4(1, 4, 1, 2, 4); - CSCDetId layer6(1, 4, 1, 2, 6); - - std::vector digis1 = clctData.comparatorDigis(1); - std::vector digis2 = clctData.comparatorDigis(4); - std::vector digis3 = clctData.comparatorDigis(6); - - assert(digis1.size() == 1); - assert(digis2.size() == 1); - assert(digis3.size() == 1); - - assert(digis1[0].getStrip() == 1); - assert(digis1[0].getComparator() == 0); - assert(digis1[0].getTimeBin() == 4); - - assert(digis2[0].getStrip() == 39); - assert(digis2[0].getComparator() == 1); - assert(digis2[0].getTimeBin() == 5); - - assert(digis3[0].getStrip() == 80); - assert(digis3[0].getComparator() == 1); - assert(digis3[0].getTimeBin() == 6); -} diff --git a/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc b/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc index 987a7fb9e5399..903796cfdfceb 100644 --- a/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc +++ b/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc @@ -43,7 +43,7 @@ namespace cscd2r { typename LCTCollection::Range lctRange = lcts.get(chamberId); bool result = false; for (typename LCTCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { - int bx = lctItr->getBX() - nominalBX; + int bx = lctItr->bx() - nominalBX; if (bx >= bxMin && bx <= bxMax) { result = true; break; @@ -57,7 +57,7 @@ namespace cscd2r { CSCDetId me1aId = CSCDetId(chamberId.endcap(), chamberId.station(), 4, chamberId.chamber(), 0); lctRange = lcts.get(me1aId); for (typename LCTCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { - int bx = lctItr->getBX() - nominalBX; + int bx = lctItr->bx() - nominalBX; if (bx >= bxMin && bx <= bxMax) { result = true; break; @@ -68,7 +68,7 @@ namespace cscd2r { return result; } - // need to specialize for pretriggers, since they don't have a getBX() + // need to specialize for pretriggers, since they don't have a bx() template <> bool accept(const CSCDetId& cscId, const CSCCLCTPreTriggerCollection& lcts, int bxMin, int bxMax, bool me1abCheck) { if (bxMin == -999) @@ -270,17 +270,17 @@ void CSCDigiToRaw::add(const CSCCLCTDigiCollection& clctDigis, FindEventDataInfo if (me11a && fedInfo.formatVersion_ == 2013) { std::vector shiftedDigis((*j).second.first, (*j).second.second); for (std::vector::iterator iC = shiftedDigis.begin(); iC != shiftedDigis.end(); ++iC) { - if (iC->getCFEB() < 3) { //sanity check, mostly + if (iC->cfeb() < 3) { //sanity check, mostly (*iC) = CSCCLCTDigi(iC->isValid(), - iC->getQuality(), - iC->getPattern(), - iC->getStripType(), - iC->getBend(), - iC->getStrip(), - iC->getCFEB() + 4, - iC->getBX(), - iC->getTrknmb(), - iC->getFullBX()); + iC->quality(), + iC->pattern(), + iC->stripType(), + iC->bend(), + iC->strip(), + iC->cfeb() + 4, + iC->bx(), + iC->trackNumber(), + iC->fullBX()); } } cscData.add(shiftedDigis); @@ -302,19 +302,19 @@ void CSCDigiToRaw::add(const CSCCorrelatedLCTDigiCollection& corrLCTDigis, FindE if (me11a && fedInfo.formatVersion_ == 2013) { std::vector shiftedDigis((*j).second.first, (*j).second.second); for (std::vector::iterator iC = shiftedDigis.begin(); iC != shiftedDigis.end(); ++iC) { - if (iC->getStrip() < 96) { //sanity check, mostly - (*iC) = CSCCorrelatedLCTDigi(iC->getTrknmb(), + if (iC->strip() < 96) { //sanity check, mostly + (*iC) = CSCCorrelatedLCTDigi(iC->trackNumber(), iC->isValid(), - iC->getQuality(), - iC->getKeyWG(), - iC->getStrip() + 128, - iC->getPattern(), - iC->getBend(), - iC->getBX(), - iC->getMPCLink(), - iC->getBX0(), - iC->getSyncErr(), - iC->getCSCID()); + iC->quality(), + iC->keyWireGroup(), + iC->strip() + 128, + iC->pattern(), + iC->bend(), + iC->bx(), + iC->mpcLink(), + iC->bx0(), + iC->syncErr(), + iC->cscID()); } } cscData.add(shiftedDigis); diff --git a/EventFilter/CSCRawToDigi/src/CSCEventData.cc b/EventFilter/CSCRawToDigi/src/CSCEventData.cc index ffc2d8d161ce3..f122f24dbe7a0 100644 --- a/EventFilter/CSCRawToDigi/src/CSCEventData.cc +++ b/EventFilter/CSCRawToDigi/src/CSCEventData.cc @@ -396,10 +396,10 @@ CSCTMBHeader* CSCEventData::tmbHeader() const { return tmbData()->tmbHeader(); } -CSCCLCTData* CSCEventData::clctData() const { +CSCComparatorData* CSCEventData::comparatorData() const { if ((nclct() == 0) || (tmbData() == nullptr)) throw cms::Exception("No CLCT data for this chamber"); - return tmbData()->clctData(); + return tmbData()->comparatorData(); } void CSCEventData::setEventInformation(int bxnum, int lvl1num) { @@ -422,7 +422,7 @@ void CSCEventData::setEventInformation(int bxnum, int lvl1num) { } /* // Set number of CFEBs to 4 for ME13 chambers - if (theChamberType == 4) { + if (theChamberType == 4) { theTMBData->tmbHeader()->setNCFEBs(4); } */ @@ -489,12 +489,12 @@ void CSCEventData::add(const CSCWireDigi& digi, int layer) { void CSCEventData::add(const CSCComparatorDigi& digi, int layer) { checkTMBClasses(); - theTMBData->clctData()->add(digi, layer); + theTMBData->comparatorData()->add(digi, layer); } void CSCEventData::add(const CSCComparatorDigi& digi, const CSCDetId& cid) { checkTMBClasses(); - theTMBData->clctData()->add(digi, cid); + theTMBData->comparatorData()->add(digi, cid); } void CSCEventData::add(const std::vector& digis) { diff --git a/EventFilter/CSCRawToDigi/src/CSCTMBData.cc b/EventFilter/CSCRawToDigi/src/CSCTMBData.cc index d816f86ed07b6..1a74448cd9712 100644 --- a/EventFilter/CSCRawToDigi/src/CSCTMBData.cc +++ b/EventFilter/CSCRawToDigi/src/CSCTMBData.cc @@ -23,14 +23,14 @@ CSCTMBData::CSCTMBData() theB0CLine(0), theE0FLine(0), theTMBHeader(2007, 0x50c3), - theCLCTData(&theTMBHeader), + theComparatorData(&theTMBHeader), theTMBScopeIsPresent(false), theTMBScope(nullptr), theTMBMiniScopeIsPresent(false), theTMBMiniScope(nullptr), theBlockedCFEBIsPresent(false), theTMBBlockedCFEB(nullptr), - theTMBTrailer(theTMBHeader.sizeInWords() + theCLCTData.sizeInWords(), 2007), + theTMBTrailer(theTMBHeader.sizeInWords() + theComparatorData.sizeInWords(), 2007), size_(0), cWordCnt(0), theRPCDataIsPresent(false) {} @@ -40,33 +40,33 @@ CSCTMBData::CSCTMBData(int firmwareVersion, int firmwareRevision, int cfebs) theB0CLine(0), theE0FLine(0), theTMBHeader(firmwareVersion, firmwareRevision), - theCLCTData(&theTMBHeader), + theComparatorData(&theTMBHeader), theTMBScopeIsPresent(false), theTMBScope(nullptr), theTMBMiniScopeIsPresent(false), theTMBMiniScope(nullptr), theBlockedCFEBIsPresent(false), theTMBBlockedCFEB(nullptr), - theTMBTrailer(theTMBHeader.sizeInWords() + theCLCTData.sizeInWords(), firmwareVersion), + theTMBTrailer(theTMBHeader.sizeInWords() + theComparatorData.sizeInWords(), firmwareVersion), size_(0), cWordCnt(0), theRPCDataIsPresent(false) { theTMBHeader.setNCFEBs(cfebs); - theCLCTData = CSCCLCTData(&theTMBHeader); - theTMBTrailer = CSCTMBTrailer(theTMBHeader.sizeInWords() + theCLCTData.sizeInWords(), firmwareVersion); + theComparatorData = CSCComparatorData(&theTMBHeader); + theTMBTrailer = CSCTMBTrailer(theTMBHeader.sizeInWords() + theComparatorData.sizeInWords(), firmwareVersion); } CSCTMBData::CSCTMBData(const uint16_t* buf) : theOriginalBuffer(buf), theTMBHeader(2007, 0x50c3), - theCLCTData(&theTMBHeader), + theComparatorData(&theTMBHeader), theTMBScopeIsPresent(false), theTMBScope(nullptr), theTMBMiniScopeIsPresent(false), theTMBMiniScope(nullptr), theBlockedCFEBIsPresent(false), theTMBBlockedCFEB(nullptr), - theTMBTrailer(theTMBHeader.sizeInWords() + theCLCTData.sizeInWords(), 2007), + theTMBTrailer(theTMBHeader.sizeInWords() + theComparatorData.sizeInWords(), 2007), theRPCDataIsPresent(false) { size_ = UnpackTMB(buf); } @@ -78,7 +78,7 @@ CSCTMBData::CSCTMBData(const CSCTMBData& data) theB0CLine(data.theB0CLine), theE0FLine(data.theE0FLine), theTMBHeader(data.theTMBHeader), - theCLCTData(data.theCLCTData), + theComparatorData(data.theComparatorData), theRPCData(data.theRPCData), theTMBScopeIsPresent(data.theTMBScopeIsPresent), theTMBMiniScopeIsPresent(data.theTMBMiniScopeIsPresent), @@ -204,12 +204,12 @@ int CSCTMBData::UnpackTMB(const uint16_t* buf) { int currentPosition = theTMBHeader.sizeInWords(); int theFirmwareVersion = theTMBHeader.FirmwareVersion(); - theCLCTData = CSCCLCTData(theTMBHeader.NCFEBs(), theTMBHeader.NTBins(), buf + e0bLine + 1, theFirmwareVersion); + theComparatorData = CSCComparatorData(theTMBHeader.NCFEBs(), theTMBHeader.NTBins(), buf + e0bLine + 1, theFirmwareVersion); - if (!theCLCTData.check()) { + if (!theComparatorData.check()) { LogTrace("CSCTMBData|CSCRawToDigi") << "+++ CSCTMBData warning: Bad CLCT data"; } else { - currentPosition += theCLCTData.sizeInWords(); + currentPosition += theComparatorData.sizeInWords(); } //int i = currentPosition-1; @@ -395,7 +395,7 @@ boost::dynamic_bitset<> CSCTMBData::pack() { boost::dynamic_bitset<> result = bitset_utilities::ushortToBitset(theTMBHeader.sizeInWords() * 16, theTMBHeader.data()); boost::dynamic_bitset<> clctData = - bitset_utilities::ushortToBitset(theCLCTData.sizeInWords() * 16, theCLCTData.data()); + bitset_utilities::ushortToBitset(theComparatorData.sizeInWords() * 16, theComparatorData.data()); result = bitset_utilities::append(result, clctData); boost::dynamic_bitset<> newResult = result; // theTMBTrailer.setCRC(TMBCRCcalc()); diff --git a/EventFilter/CSCRawToDigi/src/CSCTMBHeader.cc b/EventFilter/CSCRawToDigi/src/CSCTMBHeader.cc index 0ac1148089cf7..7822ef3c82504 100644 --- a/EventFilter/CSCRawToDigi/src/CSCTMBHeader.cc +++ b/EventFilter/CSCRawToDigi/src/CSCTMBHeader.cc @@ -85,8 +85,8 @@ void CSCTMBHeader::swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2) (theChamberId.ring() == 1 || theChamberId.ring() == 4)); if (!me11) return; - int cfeb1 = digi1.getCFEB(); - int cfeb2 = digi2.getCFEB(); + int cfeb1 = digi1.cfeb(); + int cfeb2 = digi2.cfeb(); if (cfeb1 != cfeb2) return; bool me1a = (cfeb1 == 4); @@ -96,8 +96,8 @@ void CSCTMBHeader::swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2) if ( (me1a && zplus) || (me1b && !zplus)) { // Swap CLCTs if they have the same quality and pattern # (priority // has to be given to the lower key). - if (digi1.getQuality() == digi2.getQuality() && - digi1.getPattern() == digi2.getPattern()) { + if (digi1.quality() == digi2.quality() && + digi1.pattern() == digi2.pattern()) { CSCCLCTDigi temp = digi1; digi1 = digi2; digi2 = temp; diff --git a/EventFilter/CSCRawToDigi/src/CSCTMBHeader2006.cc b/EventFilter/CSCRawToDigi/src/CSCTMBHeader2006.cc index 5bad0f0a7ff3a..7e46c601a77fd 100644 --- a/EventFilter/CSCRawToDigi/src/CSCTMBHeader2006.cc +++ b/EventFilter/CSCRawToDigi/src/CSCTMBHeader2006.cc @@ -111,73 +111,73 @@ void CSCTMBHeader2006::addALCT1(const CSCALCTDigi& digi) { } void CSCTMBHeader2006::addCLCT0(const CSCCLCTDigi& digi) { - int strip = digi.getStrip(); - int cfeb = digi.getCFEB(); - int bend = digi.getBend(); - int pattern = digi.getPattern(); + int strip = digi.strip(); + int cfeb = digi.cfeb(); + int bend = digi.bend(); + int pattern = digi.pattern(); //hardwareStripNumbering(strip, cfeb, pattern, bend); bits.clct0_valid = digi.isValid(); - bits.clct0_quality = digi.getQuality(); + bits.clct0_quality = digi.quality(); bits.clct0_shape = pattern; - bits.clct0_strip_type = digi.getStripType(); + bits.clct0_strip_type = digi.stripType(); bits.clct0_bend = bend; bits.clct0_key = strip; bits.clct0_cfeb_low = (cfeb & 0x1); bits.clct0_cfeb_high = (cfeb >> 1); - bits.clct0_bxn = digi.getBX(); - bits.bxnPreTrigger = digi.getFullBX(); + bits.clct0_bxn = digi.bx(); + bits.bxnPreTrigger = digi.fullBX(); } void CSCTMBHeader2006::addCLCT1(const CSCCLCTDigi& digi) { - int strip = digi.getStrip(); - int cfeb = digi.getCFEB(); - int bend = digi.getBend(); - int pattern = digi.getPattern(); + int strip = digi.strip(); + int cfeb = digi.cfeb(); + int bend = digi.bend(); + int pattern = digi.pattern(); //hardwareStripNumbering(strip, cfeb, pattern, bend); bits.clct1_valid = digi.isValid(); - bits.clct1_quality = digi.getQuality(); + bits.clct1_quality = digi.quality(); bits.clct1_shape = pattern; - bits.clct1_strip_type = digi.getStripType(); + bits.clct1_strip_type = digi.stripType(); bits.clct1_bend = bend; bits.clct1_key = strip; bits.clct1_cfeb_low = (cfeb & 0x1); bits.clct1_cfeb_high = (cfeb >> 1); - bits.clct1_bxn = digi.getBX(); - bits.bxnPreTrigger = digi.getFullBX(); + bits.clct1_bxn = digi.bx(); + bits.bxnPreTrigger = digi.fullBX(); } void CSCTMBHeader2006::addCorrelatedLCT0(const CSCCorrelatedLCTDigi& digi) { - int halfStrip = digi.getStrip(); + int halfStrip = digi.strip(); //hardwareHalfStripNumbering(halfStrip); bits.MPC_Muon0_vpf_ = digi.isValid(); - bits.MPC_Muon0_wire_ = digi.getKeyWG(); - bits.MPC_Muon0_clct_pattern_ = digi.getPattern(); - bits.MPC_Muon0_quality_ = digi.getQuality(); + bits.MPC_Muon0_wire_ = digi.keyWireGroup(); + bits.MPC_Muon0_clct_pattern_ = digi.pattern(); + bits.MPC_Muon0_quality_ = digi.quality(); bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip; - bits.MPC_Muon0_bend_ = digi.getBend(); - bits.MPC_Muon0_SyncErr_ = digi.getSyncErr(); - bits.MPC_Muon0_bx_ = digi.getBX(); - bits.MPC_Muon0_bc0_ = digi.getBX0(); - bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7; - bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1; + bits.MPC_Muon0_bend_ = digi.bend(); + bits.MPC_Muon0_SyncErr_ = digi.syncErr(); + bits.MPC_Muon0_bx_ = digi.bx(); + bits.MPC_Muon0_bc0_ = digi.bx0(); + bits.MPC_Muon0_cscid_low = digi.cscID() & 0x7; + bits.MPC_Muon0_cscid_bit4 = (digi.cscID() >> 3) & 0x1; } void CSCTMBHeader2006::addCorrelatedLCT1(const CSCCorrelatedLCTDigi& digi) { - int halfStrip = digi.getStrip(); + int halfStrip = digi.strip(); //hardwareHalfStripNumbering(halfStrip); bits.MPC_Muon1_vpf_ = digi.isValid(); - bits.MPC_Muon1_wire_ = digi.getKeyWG(); - bits.MPC_Muon1_clct_pattern_ = digi.getPattern(); - bits.MPC_Muon1_quality_ = digi.getQuality(); + bits.MPC_Muon1_wire_ = digi.keyWireGroup(); + bits.MPC_Muon1_clct_pattern_ = digi.pattern(); + bits.MPC_Muon1_quality_ = digi.quality(); bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip; - bits.MPC_Muon1_bend_ = digi.getBend(); - bits.MPC_Muon1_SyncErr_ = digi.getSyncErr(); - bits.MPC_Muon1_bx_ = digi.getBX(); - bits.MPC_Muon1_bc0_ = digi.getBX0(); - bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7; - bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1; + bits.MPC_Muon1_bend_ = digi.bend(); + bits.MPC_Muon1_SyncErr_ = digi.syncErr(); + bits.MPC_Muon1_bx_ = digi.bx(); + bits.MPC_Muon1_bc0_ = digi.bx0(); + bits.MPC_Muon1_cscid_low = digi.cscID() & 0x7; + bits.MPC_Muon0_cscid_bit4 = (digi.cscID() >> 3) & 0x1; } void CSCTMBHeader2006::print(std::ostream& os) const { diff --git a/EventFilter/CSCRawToDigi/src/CSCTMBHeader2007.cc b/EventFilter/CSCRawToDigi/src/CSCTMBHeader2007.cc index 411abb217df71..7f0d2402b5e4c 100644 --- a/EventFilter/CSCRawToDigi/src/CSCTMBHeader2007.cc +++ b/EventFilter/CSCRawToDigi/src/CSCTMBHeader2007.cc @@ -95,72 +95,72 @@ void CSCTMBHeader2007::addALCT1(const CSCALCTDigi& digi) { } void CSCTMBHeader2007::addCLCT0(const CSCCLCTDigi& digi) { - int strip = digi.getStrip(); - int cfeb = digi.getCFEB(); - int bend = digi.getBend(); - int pattern = digi.getPattern(); + int strip = digi.strip(); + int cfeb = digi.cfeb(); + int bend = digi.bend(); + int pattern = digi.pattern(); //hardwareStripNumbering(strip, cfeb, pattern, bend); bits.clct0_valid = digi.isValid(); - bits.clct0_quality = digi.getQuality(); + bits.clct0_quality = digi.quality(); bits.clct0_shape = pattern; bits.clct0_bend = bend; bits.clct0_key = strip; bits.clct0_cfeb_low = (cfeb & 0x1); bits.clct0_cfeb_high = (cfeb >> 1); - bits.clct0_bxn = digi.getBX(); - bits.bxnPreTrigger = digi.getFullBX(); - bits.bxnCount = (digi.getFullBX() + 167) & 0xFFF; + bits.clct0_bxn = digi.bx(); + bits.bxnPreTrigger = digi.fullBX(); + bits.bxnCount = (digi.fullBX() + 167) & 0xFFF; } void CSCTMBHeader2007::addCLCT1(const CSCCLCTDigi& digi) { - int strip = digi.getStrip(); - int cfeb = digi.getCFEB(); - int bend = digi.getBend(); - int pattern = digi.getPattern(); + int strip = digi.strip(); + int cfeb = digi.cfeb(); + int bend = digi.bend(); + int pattern = digi.pattern(); //hardwareStripNumbering(strip, cfeb, pattern, bend); bits.clct1_valid = digi.isValid(); - bits.clct1_quality = digi.getQuality(); + bits.clct1_quality = digi.quality(); bits.clct1_shape = pattern; bits.clct1_bend = bend; bits.clct1_key = strip; bits.clct1_cfeb_low = (cfeb & 0x1); bits.clct1_cfeb_high = (cfeb >> 1); - bits.clct1_bxn = digi.getBX(); - bits.bxnPreTrigger = digi.getFullBX(); + bits.clct1_bxn = digi.bx(); + bits.bxnPreTrigger = digi.fullBX(); } void CSCTMBHeader2007::addCorrelatedLCT0(const CSCCorrelatedLCTDigi& digi) { - int halfStrip = digi.getStrip(); + int halfStrip = digi.strip(); //hardwareHalfStripNumbering(halfStrip); bits.MPC_Muon0_vpf_ = digi.isValid(); - bits.MPC_Muon0_wire_ = digi.getKeyWG(); - bits.MPC_Muon0_clct_pattern_ = digi.getPattern(); - bits.MPC_Muon0_quality_ = digi.getQuality(); + bits.MPC_Muon0_wire_ = digi.keyWireGroup(); + bits.MPC_Muon0_clct_pattern_ = digi.pattern(); + bits.MPC_Muon0_quality_ = digi.quality(); bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip; - bits.MPC_Muon0_bend_ = digi.getBend(); - bits.MPC_Muon0_SyncErr_ = digi.getSyncErr(); - bits.MPC_Muon0_bx_ = digi.getBX(); - bits.MPC_Muon0_bc0_ = digi.getBX0(); - bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7; - bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1; + bits.MPC_Muon0_bend_ = digi.bend(); + bits.MPC_Muon0_SyncErr_ = digi.syncErr(); + bits.MPC_Muon0_bx_ = digi.bx(); + bits.MPC_Muon0_bc0_ = digi.bx0(); + bits.MPC_Muon0_cscid_low = digi.cscID() & 0x7; + bits.MPC_Muon0_cscid_bit4 = (digi.cscID() >> 3) & 0x1; } void CSCTMBHeader2007::addCorrelatedLCT1(const CSCCorrelatedLCTDigi& digi) { - int halfStrip = digi.getStrip(); + int halfStrip = digi.strip(); //hardwareHalfStripNumbering(halfStrip); bits.MPC_Muon1_vpf_ = digi.isValid(); - bits.MPC_Muon1_wire_ = digi.getKeyWG(); - bits.MPC_Muon1_clct_pattern_ = digi.getPattern(); - bits.MPC_Muon1_quality_ = digi.getQuality(); + bits.MPC_Muon1_wire_ = digi.keyWireGroup(); + bits.MPC_Muon1_clct_pattern_ = digi.pattern(); + bits.MPC_Muon1_quality_ = digi.quality(); bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip; - bits.MPC_Muon1_bend_ = digi.getBend(); - bits.MPC_Muon1_SyncErr_ = digi.getSyncErr(); - bits.MPC_Muon1_bx_ = digi.getBX(); - bits.MPC_Muon1_bc0_ = digi.getBX0(); - bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7; - bits.MPC_Muon1_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1; + bits.MPC_Muon1_bend_ = digi.bend(); + bits.MPC_Muon1_SyncErr_ = digi.syncErr(); + bits.MPC_Muon1_bx_ = digi.bx(); + bits.MPC_Muon1_bc0_ = digi.bx0(); + bits.MPC_Muon1_cscid_low = digi.cscID() & 0x7; + bits.MPC_Muon1_cscid_bit4 = (digi.cscID() >> 3) & 0x1; } void CSCTMBHeader2007::print(std::ostream& os) const { diff --git a/EventFilter/CSCRawToDigi/src/CSCTMBHeader2007_rev0x50c3.cc b/EventFilter/CSCRawToDigi/src/CSCTMBHeader2007_rev0x50c3.cc index c0668a9f2ccf2..0a535baec8f01 100644 --- a/EventFilter/CSCRawToDigi/src/CSCTMBHeader2007_rev0x50c3.cc +++ b/EventFilter/CSCRawToDigi/src/CSCTMBHeader2007_rev0x50c3.cc @@ -98,28 +98,28 @@ void CSCTMBHeader2007_rev0x50c3::addALCT1(const CSCALCTDigi& digi) { } void CSCTMBHeader2007_rev0x50c3::addCLCT0(const CSCCLCTDigi& digi) { - int halfStrip = digi.getKeyStrip(); - int pattern = digi.getPattern(); - //int bend = digi.getBend(); + int halfStrip = digi.keyStrip(); + int pattern = digi.pattern(); + //int bend = digi.bend(); //hardwareStripNumbering(strip, cfeb, pattern, bend); bits.clct0_valid = digi.isValid(); - bits.clct0_quality = digi.getQuality(); + bits.clct0_quality = digi.quality(); bits.clct0_shape = pattern; // first 7 bits of halfstrip bits.clct0_key_low = halfStrip & (0x7F); // most-significant (8th) bit bits.clct0_key_high = (halfStrip >> 7) & (0x1); - bits.clct_bxn = digi.getBX(); - bits.bxnPreTrigger = digi.getFullBX(); + bits.clct_bxn = digi.bx(); + bits.bxnPreTrigger = digi.fullBX(); } void CSCTMBHeader2007_rev0x50c3::addCLCT1(const CSCCLCTDigi& digi) { - int halfStrip = digi.getKeyStrip(); - int pattern = digi.getPattern(); - //int bend = digi.getBend(); + int halfStrip = digi.keyStrip(); + int pattern = digi.pattern(); + //int bend = digi.bend(); //hardwareStripNumbering(strip, cfeb, pattern, bend); bits.clct1_valid = digi.isValid(); - bits.clct1_quality = digi.getQuality(); + bits.clct1_quality = digi.quality(); bits.clct1_shape = pattern; // first 7 bits of halfstrip bits.clct1_key_low = halfStrip & (0x7F); @@ -127,43 +127,43 @@ void CSCTMBHeader2007_rev0x50c3::addCLCT1(const CSCCLCTDigi& digi) { bits.clct1_key_high = (halfStrip >> 7) & (0x1); // There is just one BX field common for CLCT0 and CLCT1 (since both // are latched at the same BX); set it in addCLCT0(). - //bits.clct_bxn = digi.getBX(); - bits.bxnPreTrigger = digi.getFullBX(); - bits.bxnCount = (digi.getFullBX() + 167) & 0xFFF; + //bits.clct_bxn = digi.bx(); + bits.bxnPreTrigger = digi.fullBX(); + bits.bxnCount = (digi.fullBX() + 167) & 0xFFF; } void CSCTMBHeader2007_rev0x50c3::addCorrelatedLCT0(const CSCCorrelatedLCTDigi& digi) { - int halfStrip = digi.getStrip(); + int halfStrip = digi.strip(); //hardwareHalfStripNumbering(halfStrip); bits.MPC_Muon0_vpf_ = digi.isValid(); - bits.MPC_Muon0_wire_ = digi.getKeyWG(); - bits.MPC_Muon0_clct_pattern_ = digi.getPattern(); - bits.MPC_Muon0_quality_ = digi.getQuality(); + bits.MPC_Muon0_wire_ = digi.keyWireGroup(); + bits.MPC_Muon0_clct_pattern_ = digi.pattern(); + bits.MPC_Muon0_quality_ = digi.quality(); bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip; - bits.MPC_Muon0_bend_ = digi.getBend(); - bits.MPC_Muon0_SyncErr_ = digi.getSyncErr(); - bits.MPC_Muon0_bx_ = digi.getBX(); - bits.MPC_Muon0_bc0_ = digi.getBX0(); - bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7; - bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1; + bits.MPC_Muon0_bend_ = digi.bend(); + bits.MPC_Muon0_SyncErr_ = digi.syncErr(); + bits.MPC_Muon0_bx_ = digi.bx(); + bits.MPC_Muon0_bc0_ = digi.bx0(); + bits.MPC_Muon0_cscid_low = digi.cscID() & 0x7; + bits.MPC_Muon0_cscid_bit4 = (digi.cscID() >> 3) & 0x1; } void CSCTMBHeader2007_rev0x50c3::addCorrelatedLCT1(const CSCCorrelatedLCTDigi& digi) { - int halfStrip = digi.getStrip(); + int halfStrip = digi.strip(); //hardwareHalfStripNumbering(halfStrip); bits.MPC_Muon1_vpf_ = digi.isValid(); - bits.MPC_Muon1_wire_ = digi.getKeyWG(); - bits.MPC_Muon1_clct_pattern_ = digi.getPattern(); - bits.MPC_Muon1_quality_ = digi.getQuality(); + bits.MPC_Muon1_wire_ = digi.keyWireGroup(); + bits.MPC_Muon1_clct_pattern_ = digi.pattern(); + bits.MPC_Muon1_quality_ = digi.quality(); bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip; - bits.MPC_Muon1_bend_ = digi.getBend(); - bits.MPC_Muon1_SyncErr_ = digi.getSyncErr(); - bits.MPC_Muon1_bx_ = digi.getBX(); - bits.MPC_Muon1_bc0_ = digi.getBX0(); - bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7; - bits.MPC_Muon1_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1; + bits.MPC_Muon1_bend_ = digi.bend(); + bits.MPC_Muon1_SyncErr_ = digi.syncErr(); + bits.MPC_Muon1_bx_ = digi.bx(); + bits.MPC_Muon1_bc0_ = digi.bx0(); + bits.MPC_Muon1_cscid_low = digi.cscID() & 0x7; + bits.MPC_Muon1_cscid_bit4 = (digi.cscID() >> 3) & 0x1; } void CSCTMBHeader2007_rev0x50c3::print(std::ostream& os) const { diff --git a/EventFilter/CSCRawToDigi/src/CSCTMBHeader2013.cc b/EventFilter/CSCRawToDigi/src/CSCTMBHeader2013.cc index 1ab0a318628ec..ac1cb5132e7df 100644 --- a/EventFilter/CSCRawToDigi/src/CSCTMBHeader2013.cc +++ b/EventFilter/CSCRawToDigi/src/CSCTMBHeader2013.cc @@ -96,29 +96,29 @@ void CSCTMBHeader2013::addALCT1(const CSCALCTDigi& digi) { } void CSCTMBHeader2013::addCLCT0(const CSCCLCTDigi& digi) { - int halfStrip = digi.getKeyStrip(); - int pattern = digi.getPattern(); - //int bend = digi.getBend(); + int halfStrip = digi.keyStrip(); + int pattern = digi.pattern(); + //int bend = digi.bend(); //hardwareStripNumbering(strip, cfeb, pattern, bend); bits.clct0_valid = digi.isValid(); - bits.clct0_quality = digi.getQuality(); + bits.clct0_quality = digi.quality(); bits.clct0_shape = pattern; // first 7 bits of halfstrip bits.clct0_key_low = halfStrip & (0x7F); // most-significant (8th) bit bits.clct0_key_high = (halfStrip >> 7) & (0x1); - bits.clct_bxn = digi.getBX(); - bits.bxnPreTrigger = digi.getFullBX(); - bits.bxnCount = (digi.getFullBX() + 167) & 0xFFF; + bits.clct_bxn = digi.bx(); + bits.bxnPreTrigger = digi.fullBX(); + bits.bxnCount = (digi.fullBX() + 167) & 0xFFF; } void CSCTMBHeader2013::addCLCT1(const CSCCLCTDigi& digi) { - int halfStrip = digi.getKeyStrip(); - int pattern = digi.getPattern(); - //int bend = digi.getBend(); + int halfStrip = digi.keyStrip(); + int pattern = digi.pattern(); + //int bend = digi.bend(); //hardwareStripNumbering(strip, cfeb, pattern, bend); bits.clct1_valid = digi.isValid(); - bits.clct1_quality = digi.getQuality(); + bits.clct1_quality = digi.quality(); bits.clct1_shape = pattern; // first 7 bits of halfstrip bits.clct1_key_low = halfStrip & (0x7F); @@ -126,42 +126,42 @@ void CSCTMBHeader2013::addCLCT1(const CSCCLCTDigi& digi) { bits.clct1_key_high = (halfStrip >> 7) & (0x1); // There is just one BX field common for CLCT0 and CLCT1 (since both // are latched at the same BX); set it in addCLCT0(). - //bits.clct_bxn = digi.getBX(); - bits.bxnPreTrigger = digi.getFullBX(); + //bits.clct_bxn = digi.bx(); + bits.bxnPreTrigger = digi.fullBX(); } void CSCTMBHeader2013::addCorrelatedLCT0(const CSCCorrelatedLCTDigi& digi) { - int halfStrip = digi.getStrip(); + int halfStrip = digi.strip(); //hardwareHalfStripNumbering(halfStrip); bits.MPC_Muon0_vpf_ = digi.isValid(); - bits.MPC_Muon0_wire_ = digi.getKeyWG(); - bits.MPC_Muon0_clct_pattern_ = digi.getPattern(); - bits.MPC_Muon0_quality_ = digi.getQuality(); + bits.MPC_Muon0_wire_ = digi.keyWireGroup(); + bits.MPC_Muon0_clct_pattern_ = digi.pattern(); + bits.MPC_Muon0_quality_ = digi.quality(); bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip; - bits.MPC_Muon0_bend_ = digi.getBend(); - bits.MPC_Muon0_SyncErr_ = digi.getSyncErr(); - bits.MPC_Muon0_bx_ = digi.getBX(); - bits.MPC_Muon0_bc0_ = digi.getBX0(); - bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7; - bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1; + bits.MPC_Muon0_bend_ = digi.bend(); + bits.MPC_Muon0_SyncErr_ = digi.syncErr(); + bits.MPC_Muon0_bx_ = digi.bx(); + bits.MPC_Muon0_bc0_ = digi.bx0(); + bits.MPC_Muon0_cscid_low = digi.cscID() & 0x7; + bits.MPC_Muon0_cscid_bit4 = (digi.cscID() >> 3) & 0x1; } void CSCTMBHeader2013::addCorrelatedLCT1(const CSCCorrelatedLCTDigi& digi) { - int halfStrip = digi.getStrip(); + int halfStrip = digi.strip(); //hardwareHalfStripNumbering(halfStrip); bits.MPC_Muon1_vpf_ = digi.isValid(); - bits.MPC_Muon1_wire_ = digi.getKeyWG(); - bits.MPC_Muon1_clct_pattern_ = digi.getPattern(); - bits.MPC_Muon1_quality_ = digi.getQuality(); + bits.MPC_Muon1_wire_ = digi.keyWireGroup(); + bits.MPC_Muon1_clct_pattern_ = digi.pattern(); + bits.MPC_Muon1_quality_ = digi.quality(); bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip; - bits.MPC_Muon1_bend_ = digi.getBend(); - bits.MPC_Muon1_SyncErr_ = digi.getSyncErr(); - bits.MPC_Muon1_bx_ = digi.getBX(); - bits.MPC_Muon1_bc0_ = digi.getBX0(); - bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7; - bits.MPC_Muon1_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1; + bits.MPC_Muon1_bend_ = digi.bend(); + bits.MPC_Muon1_SyncErr_ = digi.syncErr(); + bits.MPC_Muon1_bx_ = digi.bx(); + bits.MPC_Muon1_bc0_ = digi.bx0(); + bits.MPC_Muon1_cscid_low = digi.cscID() & 0x7; + bits.MPC_Muon1_cscid_bit4 = (digi.cscID() >> 3) & 0x1; } void CSCTMBHeader2013::print(std::ostream& os) const { diff --git a/EventFilter/CSCRawToDigi/test/cscRawToDigiTest.cpp b/EventFilter/CSCRawToDigi/test/cscRawToDigiTest.cpp index 16c541d9f139d..7ef0a3279e3f2 100644 --- a/EventFilter/CSCRawToDigi/test/cscRawToDigiTest.cpp +++ b/EventFilter/CSCRawToDigi/test/cscRawToDigiTest.cpp @@ -12,7 +12,7 @@ int main() { CSCTMBData::selfTest(); CSCTMBTrailer::selfTest(); //CSCEventData::selfTest(); - CSCCLCTData::selfTest(); + CSCComparatorData::selfTest(); CSCAnodeData2006::selfTest(); CSCAnodeData2007::selfTest(); diff --git a/EventFilter/CSCTFRawToDigi/plugins/CSCTFAnalyzer.cc b/EventFilter/CSCTFRawToDigi/plugins/CSCTFAnalyzer.cc index 80ed4e9042564..75bf7bb38a864 100644 --- a/EventFilter/CSCTFRawToDigi/plugins/CSCTFAnalyzer.cc +++ b/EventFilter/CSCTFRawToDigi/plugins/CSCTFAnalyzer.cc @@ -92,7 +92,7 @@ void CSCTFAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { edm::LogInfo("CSCTFAnalyzer") << " DT data: tbin=" << stub->BX() << " CSC sector=" << stub->sector() << " CSC subsector=" << stub->subsector() << " station=" << stub->station() << " endcap=" << stub->endcap() << " phi=" << stub->phiPacked() - << " phiBend=" << stub->getBend() << " quality=" << stub->getQuality() + << " phiBend=" << stub->bend() << " quality=" << stub->quality() << " mb_bxn=" << stub->cscid(); } } else @@ -114,7 +114,7 @@ void CSCTFAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { int cscId = (*csc).first.triggerCscId() - 1; int sector = (*csc).first.triggerSector() - 1; // + ( (*csc).first.endcap()==1 ? 0 : 6 ); int subSector = CSCTriggerNumbering::triggerSubSectorFromLabels((*csc).first); - int tbin = lct->getBX(); + int tbin = lct->bx(); int fpga = (subSector ? subSector - 1 : station + 1); // If Det Id is within range if (sector < 0 || sector > 11 || station < 0 || station > 3 || cscId < 0 || cscId > 8 || lctId < 0 || @@ -126,9 +126,9 @@ void CSCTFAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { << " station: " << (station + 1) << " sector: " << (sector + 1) << " subSector: " << subSector << " tbin: " << tbin << " cscId: " << (cscId + 1) << " fpga: " << (fpga + 1) << " " - << "LCT(vp=" << lct->isValid() << ",qual=" << lct->getQuality() - << ",wg=" << lct->getKeyWG() << ",strip=" << lct->getStrip() - << ",link=" << lct->getMPCLink() << ")"; + << "LCT(vp=" << lct->isValid() << ",qual=" << lct->quality() + << ",wg=" << lct->keyWireGroup() << ",strip=" << lct->strip() + << ",link=" << lct->mpcLink() << ")"; } } } else @@ -163,7 +163,7 @@ void CSCTFAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { int cscId = (*csc).first.triggerCscId() - 1; int sector = (*csc).first.triggerSector() - 1; // + ( (*csc).first.endcap()==1 ? 0 : 6 ); int subSector = CSCTriggerNumbering::triggerSubSectorFromLabels((*csc).first); - int tbin = lct->getBX(); + int tbin = lct->bx(); int fpga = (subSector ? subSector - 1 : station + 1); // If Det Id is within range if (sector < 0 || sector > 11 || station < 0 || station > 3 || cscId < 0 || cscId > 8 || lctId < 0 || @@ -171,20 +171,20 @@ void CSCTFAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { edm::LogInfo("CSCTFAnalyzer: Digi are out of range: "); continue; } - if (lct->getQuality() < 100) + if (lct->quality() < 100) edm::LogInfo("CSCTFAnalyzer") << " Linked LCT: " << (*csc).first.endcap() << " station: " << (station + 1) << " sector: " << (sector + 1) << " subSector: " << subSector << " tbin: " << tbin << " cscId: " << (cscId + 1) << " fpga: " << (fpga + 1) << " LCT(vp=" << lct->isValid() - << ",qual=" << lct->getQuality() << ",wg=" << lct->getKeyWG() << ",strip=" << lct->getStrip() << ")"; + << ",qual=" << lct->quality() << ",wg=" << lct->keyWireGroup() << ",strip=" << lct->strip() << ")"; else edm::LogInfo("CSCTFAnalyzer") << " Linked MB stub: " << (*csc).first.endcap() << " sector: " << (sector + 1) << " subSector: " << subSector << " tbin: " << tbin << " MB(vp=" << lct->isValid() - << ",qual=" << (lct->getQuality() - 100) << ",cal=" << lct->getKeyWG() << ",flag=" << lct->getStrip() - << ",bc0=" << lct->getPattern() << ",phiBend=" << lct->getBend() << ",tbin=" << lct->getBX() - << ",id=" << lct->getMPCLink() << ",bx0=" << lct->getBX0() << ",se=" << lct->getSyncErr() - << ",bxn=" << lct->getCSCID() << ",phi=" << lct->getTrknmb() << ")"; + << ",qual=" << (lct->quality() - 100) << ",cal=" << lct->keyWireGroup() << ",flag=" << lct->strip() + << ",bc0=" << lct->pattern() << ",phiBend=" << lct->bend() << ",tbin=" << lct->bx() + << ",id=" << lct->mpcLink() << ",bx0=" << lct->bx0() << ",se=" << lct->syncErr() + << ",bxn=" << lct->cscID() << ",phi=" << lct->trackNumber() << ")"; } } } diff --git a/EventFilter/CSCTFRawToDigi/plugins/CSCTFPacker.cc b/EventFilter/CSCTFRawToDigi/plugins/CSCTFPacker.cc index b9ee603bc976a..458ee223f1df4 100644 --- a/EventFilter/CSCTFRawToDigi/plugins/CSCTFPacker.cc +++ b/EventFilter/CSCTFRawToDigi/plugins/CSCTFPacker.cc @@ -83,13 +83,12 @@ void CSCTFPacker::produce(edm::Event& e, const edm::EventSetup& c) { int cscId = (*csc).first.triggerCscId() - 1; int sector = (*csc).first.triggerSector() - 1 + ((*csc).first.endcap() == 1 ? 0 : 6); int subSector = CSCTriggerNumbering::triggerSubSectorFromLabels((*csc).first); - int tbin = lct->getBX() - (central_lct_bx - central_sp_bx); // Shift back to hardware BX window definition + int tbin = lct->bx() - (central_lct_bx - central_sp_bx); // Shift back to hardware BX window definition if (tbin > 6 || tbin < 0) { edm::LogError("CSCTFPacker|produce") << " LCT's BX=" << tbin << " is out of 0-6 window"; continue; } int fpga = (subSector ? subSector - 1 : station + 1); - ///std::cout<<"Front data station: "<getMPCLink() << " NOT IN RANGE [1,3]\n"; + << "SERIOUS ERROR: MPC LINK " << stubi->mpcLink() << " NOT IN RANGE [1,3]\n"; }; break; case 2: - switch (stubi->getMPCLink()) { + switch (stubi->mpcLink()) { case 1: io_[relative_bx + 1].me2aVp = stubi->isValid(); - io_[relative_bx + 1].me2aQp = stubi->getQuality(); + io_[relative_bx + 1].me2aQp = stubi->quality(); io_[relative_bx + 1].me2aEtap = stubi->etaPacked(); io_[relative_bx + 1].me2aPhip = stubi->phiPacked(); - io_[relative_bx + 1].me2aAmp = (stubi->getQuality() == 1 || stubi->getQuality() == 2); + io_[relative_bx + 1].me2aAmp = (stubi->quality() == 1 || stubi->quality() == 2); break; case 2: io_[relative_bx + 1].me2bVp = stubi->isValid(); - io_[relative_bx + 1].me2bQp = stubi->getQuality(); + io_[relative_bx + 1].me2bQp = stubi->quality(); io_[relative_bx + 1].me2bEtap = stubi->etaPacked(); io_[relative_bx + 1].me2bPhip = stubi->phiPacked(); - io_[relative_bx + 1].me2bAmp = (stubi->getQuality() == 1 || stubi->getQuality() == 2); + io_[relative_bx + 1].me2bAmp = (stubi->quality() == 1 || stubi->quality() == 2); break; case 3: io_[relative_bx + 1].me2cVp = stubi->isValid(); - io_[relative_bx + 1].me2cQp = stubi->getQuality(); + io_[relative_bx + 1].me2cQp = stubi->quality(); io_[relative_bx + 1].me2cEtap = stubi->etaPacked(); io_[relative_bx + 1].me2cPhip = stubi->phiPacked(); - io_[relative_bx + 1].me2cAmp = (stubi->getQuality() == 1 || stubi->getQuality() == 2); + io_[relative_bx + 1].me2cAmp = (stubi->quality() == 1 || stubi->quality() == 2); break; default: edm::LogWarning("CSCTFSPCoreLogic::loadData()") - << "SERIOUS ERROR: MPC LINK " << stubi->getMPCLink() << " NOT IN RANGE [1,3]\n"; + << "SERIOUS ERROR: MPC LINK " << stubi->mpcLink() << " NOT IN RANGE [1,3]\n"; }; break; case 3: - switch (stubi->getMPCLink()) { + switch (stubi->mpcLink()) { case 1: io_[relative_bx + 1].me3aVp = stubi->isValid(); - io_[relative_bx + 1].me3aQp = stubi->getQuality(); + io_[relative_bx + 1].me3aQp = stubi->quality(); io_[relative_bx + 1].me3aEtap = stubi->etaPacked(); io_[relative_bx + 1].me3aPhip = stubi->phiPacked(); - io_[relative_bx + 1].me3aAmp = (stubi->getQuality() == 1 || stubi->getQuality() == 2); + io_[relative_bx + 1].me3aAmp = (stubi->quality() == 1 || stubi->quality() == 2); break; case 2: io_[relative_bx + 1].me3bVp = stubi->isValid(); - io_[relative_bx + 1].me3bQp = stubi->getQuality(); + io_[relative_bx + 1].me3bQp = stubi->quality(); io_[relative_bx + 1].me3bEtap = stubi->etaPacked(); io_[relative_bx + 1].me3bPhip = stubi->phiPacked(); - io_[relative_bx + 1].me3bAmp = (stubi->getQuality() == 1 || stubi->getQuality() == 2); + io_[relative_bx + 1].me3bAmp = (stubi->quality() == 1 || stubi->quality() == 2); break; case 3: io_[relative_bx + 1].me3cVp = stubi->isValid(); - io_[relative_bx + 1].me3cQp = stubi->getQuality(); + io_[relative_bx + 1].me3cQp = stubi->quality(); io_[relative_bx + 1].me3cEtap = stubi->etaPacked(); io_[relative_bx + 1].me3cPhip = stubi->phiPacked(); - io_[relative_bx + 1].me3cAmp = (stubi->getQuality() == 1 || stubi->getQuality() == 2); + io_[relative_bx + 1].me3cAmp = (stubi->quality() == 1 || stubi->quality() == 2); break; default: edm::LogWarning("CSCTFSPCoreLogic::loadData()") - << "SERIOUS ERROR: MPC LINK " << stubi->getMPCLink() << " NOT IN RANGE [1,3]\n"; + << "SERIOUS ERROR: MPC LINK " << stubi->mpcLink() << " NOT IN RANGE [1,3]\n"; }; break; case 4: - switch (stubi->getMPCLink()) { + switch (stubi->mpcLink()) { case 1: io_[relative_bx + 1].me4aVp = stubi->isValid(); - io_[relative_bx + 1].me4aQp = stubi->getQuality(); + io_[relative_bx + 1].me4aQp = stubi->quality(); io_[relative_bx + 1].me4aEtap = stubi->etaPacked(); io_[relative_bx + 1].me4aPhip = stubi->phiPacked(); - io_[relative_bx + 1].me4aAmp = (stubi->getQuality() == 1 || stubi->getQuality() == 2); + io_[relative_bx + 1].me4aAmp = (stubi->quality() == 1 || stubi->quality() == 2); break; case 2: io_[relative_bx + 1].me4bVp = stubi->isValid(); - io_[relative_bx + 1].me4bQp = stubi->getQuality(); + io_[relative_bx + 1].me4bQp = stubi->quality(); io_[relative_bx + 1].me4bEtap = stubi->etaPacked(); io_[relative_bx + 1].me4bPhip = stubi->phiPacked(); - io_[relative_bx + 1].me4bAmp = (stubi->getQuality() == 1 || stubi->getQuality() == 2); + io_[relative_bx + 1].me4bAmp = (stubi->quality() == 1 || stubi->quality() == 2); break; case 3: io_[relative_bx + 1].me4cVp = stubi->isValid(); - io_[relative_bx + 1].me4cQp = stubi->getQuality(); + io_[relative_bx + 1].me4cQp = stubi->quality(); io_[relative_bx + 1].me4cEtap = stubi->etaPacked(); io_[relative_bx + 1].me4cPhip = stubi->phiPacked(); - io_[relative_bx + 1].me4cAmp = (stubi->getQuality() == 1 || stubi->getQuality() == 2); + io_[relative_bx + 1].me4cAmp = (stubi->quality() == 1 || stubi->quality() == 2); break; default: edm::LogWarning("CSCTFSPCoreLogic::loadData()") - << "SERIOUS ERROR: MPC LINK " << stubi->getMPCLink() << " NOT IN RANGE [1,3]\n"; + << "SERIOUS ERROR: MPC LINK " << stubi->mpcLink() << " NOT IN RANGE [1,3]\n"; }; break; case 5: // We need to put the DT stubs 1 BX ahead of the CSC ones for the TF firmware //std::cout << "DT Stub at bx: " << relative_bx << std::endl; - switch (stubi->getMPCLink()) { + switch (stubi->mpcLink()) { case 1: if (this->GetSPFirmwareVersion() < 20100629) { // introducing the bug which was causing only even DT qualities // to get accepted - if (stubi->getQuality() % 2 == 1) { + if (stubi->quality() % 2 == 1) { //io_[relative_bx].mb1aVp = stubi->isValid(); - io_[relative_bx].mb1aVp = stubi->getStrip(); - io_[relative_bx].mb1aQp = stubi->getQuality(); + io_[relative_bx].mb1aVp = stubi->strip(); + io_[relative_bx].mb1aQp = stubi->quality(); io_[relative_bx].mb1aPhip = stubi->phiPacked(); - io_[relative_bx].mb1aBendp = stubi->getBend(); + io_[relative_bx].mb1aBendp = stubi->bend(); } } else { - io_[relative_bx].mb1aVp = stubi->getStrip(); - io_[relative_bx].mb1aQp = stubi->getQuality(); + io_[relative_bx].mb1aVp = stubi->strip(); + io_[relative_bx].mb1aQp = stubi->quality(); io_[relative_bx].mb1aPhip = stubi->phiPacked(); - io_[relative_bx].mb1aBendp = stubi->getBend(); + io_[relative_bx].mb1aBendp = stubi->bend(); } break; case 2: if (this->GetSPFirmwareVersion() < 20100629) { // introducing the bug which was causing only even DT qualities // to get accepted - if (stubi->getQuality() % 2 == 1) { + if (stubi->quality() % 2 == 1) { //io_[relative_bx].mb1aVp = stubi->isValid(); - io_[relative_bx].mb1bVp = stubi->getStrip(); - io_[relative_bx].mb1bQp = stubi->getQuality(); + io_[relative_bx].mb1bVp = stubi->strip(); + io_[relative_bx].mb1bQp = stubi->quality(); io_[relative_bx].mb1bPhip = stubi->phiPacked(); - io_[relative_bx].mb1bBendp = stubi->getBend(); + io_[relative_bx].mb1bBendp = stubi->bend(); } } else { - io_[relative_bx].mb1bVp = stubi->getStrip(); - io_[relative_bx].mb1bQp = stubi->getQuality(); + io_[relative_bx].mb1bVp = stubi->strip(); + io_[relative_bx].mb1bQp = stubi->quality(); io_[relative_bx].mb1bPhip = stubi->phiPacked(); - io_[relative_bx].mb1bBendp = stubi->getBend(); + io_[relative_bx].mb1bBendp = stubi->bend(); } break; /*case 3: io_[relative_bx].mb1cVp = stubi->isValid(); - io_[relative_bx].mb1cQp = stubi->getQuality(); + io_[relative_bx].mb1cQp = stubi->quality(); io_[relative_bx].mb1cPhip = stubi->phiPacked(); break; case 4: io_[relative_bx].mb1dVp = stubi->isValid(); - io_[relative_bx].mb1dQp = stubi->getQuality(); + io_[relative_bx].mb1dQp = stubi->quality(); io_[relative_bx].mb1dPhip = stubi->phiPacked(); break;*/ default: edm::LogWarning("CSCTFSPCoreLogic::loadData()") - << "SERIOUS ERROR: DT LINK " << stubi->getMPCLink() << " NOT IN RANGE [1,4]\n"; + << "SERIOUS ERROR: DT LINK " << stubi->mpcLink() << " NOT IN RANGE [1,4]\n"; } break; default: diff --git a/L1Trigger/CSCTrackFinder/src/CSCTFSectorProcessor.cc b/L1Trigger/CSCTrackFinder/src/CSCTFSectorProcessor.cc index bbf456b74a341..ed74e0db801fd 100644 --- a/L1Trigger/CSCTrackFinder/src/CSCTFSectorProcessor.cc +++ b/L1Trigger/CSCTrackFinder/src/CSCTFSectorProcessor.cc @@ -706,92 +706,88 @@ int CSCTFSectorProcessor::run(const CSCTriggerContainer& stubs stub_vec_filtered.push_back(*itr); break; // DT stubs get filtered by the core controll register case 4: - switch (itr->getMPCLink()) { + switch (itr->mpcLink()) { case 3: - if ((kill_fiber & 0x4000) == 0 && QualityEnableME4c & (1 << itr->getQuality())) + if ((kill_fiber & 0x4000) == 0 && QualityEnableME4c & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; case 2: - if ((kill_fiber & 0x2000) == 0 && QualityEnableME4b & (1 << itr->getQuality())) + if ((kill_fiber & 0x2000) == 0 && QualityEnableME4b & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; case 1: - if ((kill_fiber & 0x1000) == 0 && QualityEnableME4a & (1 << itr->getQuality())) + if ((kill_fiber & 0x1000) == 0 && QualityEnableME4a & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; default: - edm::LogWarning("CSCTFSectorProcessor::run()") - << "No MPC sorting for LCT: link=" << itr->getMPCLink() << "\n"; + edm::LogWarning("CSCTFSectorProcessor::run()") << "No MPC sorting for LCT: link=" << itr->mpcLink() << "\n"; } break; case 3: - switch (itr->getMPCLink()) { + switch (itr->mpcLink()) { case 3: - if ((kill_fiber & 0x0800) == 0 && QualityEnableME3c & (1 << itr->getQuality())) + if ((kill_fiber & 0x0800) == 0 && QualityEnableME3c & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; case 2: - if ((kill_fiber & 0x0400) == 0 && QualityEnableME3b & (1 << itr->getQuality())) + if ((kill_fiber & 0x0400) == 0 && QualityEnableME3b & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; case 1: - if ((kill_fiber & 0x0200) == 0 && QualityEnableME3a & (1 << itr->getQuality())) + if ((kill_fiber & 0x0200) == 0 && QualityEnableME3a & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; default: - edm::LogWarning("CSCTFSectorProcessor::run()") - << "No MPC sorting for LCT: link=" << itr->getMPCLink() << "\n"; + edm::LogWarning("CSCTFSectorProcessor::run()") << "No MPC sorting for LCT: link=" << itr->mpcLink() << "\n"; } break; case 2: - switch (itr->getMPCLink()) { + switch (itr->mpcLink()) { case 3: - if ((kill_fiber & 0x0100) == 0 && QualityEnableME2c & (1 << itr->getQuality())) + if ((kill_fiber & 0x0100) == 0 && QualityEnableME2c & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; case 2: - if ((kill_fiber & 0x0080) == 0 && QualityEnableME2b & (1 << itr->getQuality())) + if ((kill_fiber & 0x0080) == 0 && QualityEnableME2b & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; case 1: - if ((kill_fiber & 0x0040) == 0 && QualityEnableME2a & (1 << itr->getQuality())) + if ((kill_fiber & 0x0040) == 0 && QualityEnableME2a & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; default: - edm::LogWarning("CSCTFSectorProcessor::run()") - << "No MPC sorting for LCT: link=" << itr->getMPCLink() << "\n"; + edm::LogWarning("CSCTFSectorProcessor::run()") << "No MPC sorting for LCT: link=" << itr->mpcLink() << "\n"; } break; case 1: - switch (itr->getMPCLink() + + switch (itr->mpcLink() + (3 * (CSCTriggerNumbering::triggerSubSectorFromLabels(CSCDetId(itr->getDetId().rawId())) - 1))) { case 6: - if ((kill_fiber & 0x0020) == 0 && QualityEnableME1f & (1 << itr->getQuality())) + if ((kill_fiber & 0x0020) == 0 && QualityEnableME1f & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; case 5: - if ((kill_fiber & 0x0010) == 0 && QualityEnableME1e & (1 << itr->getQuality())) + if ((kill_fiber & 0x0010) == 0 && QualityEnableME1e & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; case 4: - if ((kill_fiber & 0x0008) == 0 && QualityEnableME1d & (1 << itr->getQuality())) + if ((kill_fiber & 0x0008) == 0 && QualityEnableME1d & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; case 3: - if ((kill_fiber & 0x0004) == 0 && QualityEnableME1c & (1 << itr->getQuality())) + if ((kill_fiber & 0x0004) == 0 && QualityEnableME1c & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; case 2: - if ((kill_fiber & 0x0002) == 0 && QualityEnableME1b & (1 << itr->getQuality())) + if ((kill_fiber & 0x0002) == 0 && QualityEnableME1b & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; case 1: - if ((kill_fiber & 0x0001) == 0 && QualityEnableME1a & (1 << itr->getQuality())) + if ((kill_fiber & 0x0001) == 0 && QualityEnableME1a & (1 << itr->quality())) stub_vec_filtered.push_back(*itr); break; default: - edm::LogWarning("CSCTFSectorProcessor::run()") - << "No MPC sorting for LCT: link=" << itr->getMPCLink() << "\n"; + edm::LogWarning("CSCTFSectorProcessor::run()") << "No MPC sorting for LCT: link=" << itr->mpcLink() << "\n"; } break; default: @@ -813,13 +809,13 @@ int CSCTFSectorProcessor::run(const CSCTriggerContainer& stubs lclphidat lclPhi; try { - lclPhi = srLUTs_[FPGAs[fpga]]->localPhi( - itr->getStrip(), itr->getPattern(), itr->getQuality(), itr->getBend(), m_gangedME1a); + lclPhi = + srLUTs_[FPGAs[fpga]]->localPhi(itr->strip(), itr->pattern(), itr->quality(), itr->bend(), m_gangedME1a); } catch (cms::Exception& e) { bzero(&lclPhi, sizeof(lclPhi)); edm::LogWarning("CSCTFSectorProcessor:run()") - << "Exception from LocalPhi LUT in " << FPGAs[fpga] << "(strip=" << itr->getStrip() - << ",pattern=" << itr->getPattern() << ",quality=" << itr->getQuality() << ",bend=" << itr->getBend() << ")" + << "Exception from LocalPhi LUT in " << FPGAs[fpga] << "(strip=" << itr->strip() + << ",pattern=" << itr->pattern() << ",quality=" << itr->quality() << ",bend=" << itr->bend() << ")" << std::endl; } @@ -828,15 +824,15 @@ int CSCTFSectorProcessor::run(const CSCTriggerContainer& stubs unsigned csc_id = itr->cscid(); if (!m_gangedME1a) csc_id = itr->cscidSeparateME1a(); - //std::cout << "station="<& stubs if (!m_gangedME1a) csc_id = itr->cscidSeparateME1a(); gblEta = srLUTs_[FPGAs[fpga]]->globalEtaME( - lclPhi.phi_bend_local, lclPhi.phi_local, itr->getKeyWG(), csc_id, m_gangedME1a); - //gblEta = srLUTs_[FPGAs[fpga]]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, itr->getKeyWG(), itr->cscid()); + lclPhi.phi_bend_local, lclPhi.phi_local, itr->keyWireGroup(), csc_id, m_gangedME1a); + //gblEta = srLUTs_[FPGAs[fpga]]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, itr->keyWireGroup(), itr->cscid()); } catch (cms::Exception& e) { bzero(&gblEta, sizeof(gblEta)); edm::LogWarning("CSCTFSectorProcessor:run()") << "Exception from GlobalEta LUT in " << FPGAs[fpga] << "(phi_bend_local=" << lclPhi.phi_bend_local - << ",phi_local=" << lclPhi.phi_local << ",KeyWG=" << itr->getKeyWG() << ",csc=" << itr->cscid() << ")" + << ",phi_local=" << lclPhi.phi_local << ",KeyWG=" << itr->keyWireGroup() << ",csc=" << itr->cscid() << ")" << std::endl; } gblphidat gblPhiDT; try { - gblPhiDT = srLUTs_[FPGAs[fpga]]->globalPhiMB(lclPhi.phi_local, itr->getKeyWG(), itr->cscid(), m_gangedME1a); + gblPhiDT = srLUTs_[FPGAs[fpga]]->globalPhiMB(lclPhi.phi_local, itr->keyWireGroup(), itr->cscid(), m_gangedME1a); } catch (cms::Exception& e) { bzero(&gblPhiDT, sizeof(gblPhiDT)); edm::LogWarning("CSCTFSectorProcessor:run()") << "Exception from GlobalPhi DT LUT in " << FPGAs[fpga] << "(phi_local=" << lclPhi.phi_local - << ",KeyWG=" << itr->getKeyWG() << ",csc=" << itr->cscid() << ")" << std::endl; + << ",KeyWG=" << itr->keyWireGroup() << ",csc=" << itr->cscid() << ")" << std::endl; } itr->setEtaPacked(gblEta.global_eta); @@ -996,10 +992,10 @@ int CSCTFSectorProcessor::run(const CSCTriggerContainer& stubs if ((mpc == 0 && trigger_on_ME1a) || (mpc == 1 && trigger_on_ME1b) || (mpc == 2 && trigger_on_ME2) || (mpc == 3 && trigger_on_ME3) || (mpc == 4 && trigger_on_ME4) || (mpc == 5 && ((trigger_on_MB1a && subSector % 2 == 1) || (trigger_on_MB1d && subSector % 2 == 0)))) { - int bx = itr->getBX() - m_minBX; + int bx = itr->bx() - m_minBX; if (bx < 0 || bx >= 7) edm::LogWarning("CSCTFTrackBuilder::buildTracks()") - << " LCT BX is out of [" << m_minBX << "," << m_maxBX << ") range: " << itr->getBX(); + << " LCT BX is out of [" << m_minBX << "," << m_maxBX << ") range: " << itr->bx(); else if (itr->isValid()) myStubContainer[bx].push_back(*itr); } @@ -1039,19 +1035,18 @@ int CSCTFSectorProcessor::run(const CSCTriggerContainer& stubs int subSector = CSCTriggerNumbering::triggerSubSectorFromLabels(CSCDetId(st_iter->getDetId().rawId())); int mpc = (subSector ? subSector - 1 : station + 1); // Sort MB stubs first (priority: quality OR MB1a > MB1b for the same quality) - if (mpc == 5 && - (st_iter->getQuality() > qualityMB || (st_iter->getQuality() == qualityMB && subSector < MB))) { - qualityMB = st_iter->getQuality(); + if (mpc == 5 && (st_iter->quality() > qualityMB || (st_iter->quality() == qualityMB && subSector < MB))) { + qualityMB = st_iter->quality(); MB = subSector; if (ME > 4) bestStub = st_iter; // do not select this stub if ME already had any candidate } // Sort ME stubs (priority: quality OR ME1a > ME1b > ME2 > ME3 > ME4 for the same quality) - if (mpc < 5 && (st_iter->getQuality() > qualityME || (st_iter->getQuality() == qualityME && mpc < ME) || - (st_iter->getQuality() == qualityME && mpc == ME && st_iter->getMPCLink() < linkME))) { - qualityME = st_iter->getQuality(); + if (mpc < 5 && (st_iter->quality() > qualityME || (st_iter->quality() == qualityME && mpc < ME) || + (st_iter->quality() == qualityME && mpc == ME && st_iter->mpcLink() < linkME))) { + qualityME = st_iter->quality(); ME = mpc; - linkME = st_iter->getMPCLink(); + linkME = st_iter->mpcLink(); bestStub = st_iter; } } @@ -1071,19 +1066,19 @@ int CSCTFSectorProcessor::run(const CSCTriggerContainer& stubs track.setEtaPacked((bestStub->etaPacked() >> 2) & 0x1f); switch (bestStub->station()) { case 1: - track.setStationIds(bestStub->getMPCLink(), 0, 0, 0, 0); + track.setStationIds(bestStub->mpcLink(), 0, 0, 0, 0); break; case 2: - track.setStationIds(0, bestStub->getMPCLink(), 0, 0, 0); + track.setStationIds(0, bestStub->mpcLink(), 0, 0, 0); break; case 3: - track.setStationIds(0, 0, bestStub->getMPCLink(), 0, 0); + track.setStationIds(0, 0, bestStub->mpcLink(), 0, 0); break; case 4: - track.setStationIds(0, 0, 0, bestStub->getMPCLink(), 0); + track.setStationIds(0, 0, 0, bestStub->mpcLink(), 0); break; case 5: - track.setStationIds(0, 0, 0, 0, bestStub->getMPCLink()); + track.setStationIds(0, 0, 0, 0, bestStub->mpcLink()); break; default: edm::LogError("CSCTFSectorProcessor::run()") << "Illegal LCT link=" << bestStub->station() << "\n"; diff --git a/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.cc b/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.cc index 83c80bc1478e5..98b4dc95741bb 100644 --- a/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.cc +++ b/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.cc @@ -148,7 +148,7 @@ void CSCTFTrackBuilder::buildTracks( for (; tkstbs != possible_stubs.end(); tkstbs++) { switch (tkstbs->station()) { case 1: - if ((tkstbs->getMPCLink() + + if ((tkstbs->mpcLink() + (3 * (CSCTriggerNumbering::triggerSubSectorFromLabels(CSCDetId(tkstbs->getDetId().rawId())) - 1))) == me1ID && me1ID != 0 && me1Tbin == tkstbs->BX()) { @@ -156,22 +156,22 @@ void CSCTFTrackBuilder::buildTracks( } break; case 2: - if (tkstbs->getMPCLink() == me2ID && me2ID != 0 && me2Tbin == tkstbs->BX()) { + if (tkstbs->mpcLink() == me2ID && me2ID != 0 && me2Tbin == tkstbs->BX()) { tcitr->second.insertDigi(CSCDetId(tkstbs->getDetId().rawId()), *(tkstbs->getDigi())); } break; case 3: - if (tkstbs->getMPCLink() == me3ID && me3ID != 0 && me3Tbin == tkstbs->BX()) { + if (tkstbs->mpcLink() == me3ID && me3ID != 0 && me3Tbin == tkstbs->BX()) { tcitr->second.insertDigi(CSCDetId(tkstbs->getDetId().rawId()), *(tkstbs->getDigi())); } break; case 4: - if (tkstbs->getMPCLink() == me4ID && me4ID != 0 && me4Tbin == tkstbs->BX()) { + if (tkstbs->mpcLink() == me4ID && me4ID != 0 && me4Tbin == tkstbs->BX()) { tcitr->second.insertDigi(CSCDetId(tkstbs->getDetId().rawId()), *(tkstbs->getDigi())); } break; case 5: - if (tkstbs->getMPCLink() == mb1ID && mb1ID != 0 && mb1Tbin == tkstbs->BX()) { + if (tkstbs->mpcLink() == mb1ID && mb1ID != 0 && mb1Tbin == tkstbs->BX()) { /// Hmmm how should I implement this??? Maybe change the L1Track to use stubs not LCTs? } break; diff --git a/L1Trigger/CSCTrackFinder/test/analysis/CSCTFEfficiency.cc b/L1Trigger/CSCTrackFinder/test/analysis/CSCTFEfficiency.cc index fcee858bef122..5962450509424 100644 --- a/L1Trigger/CSCTrackFinder/test/analysis/CSCTFEfficiency.cc +++ b/L1Trigger/CSCTrackFinder/test/analysis/CSCTFEfficiency.cc @@ -2,7 +2,7 @@ // // Package: CSCTFEfficiency // Class: CSCTFEfficiency -// +// /**\class CSCTFEfficiency CSCTFEfficiency.cc jhugon/CSCTFEfficiency/src/CSCTFEfficiency.cc Description: [one line class summary] @@ -27,13 +27,12 @@ #include #include "TStyle.h" using namespace std; -int counterTFT; // Added By Daniel 07/02 -int counterRLimit; // Added By Daniel 07/02 -CSCTFEfficiency::CSCTFEfficiency(const edm::ParameterSet& iConfig) -{ +int counterTFT; // Added By Daniel 07/02 +int counterRLimit; // Added By Daniel 07/02 +CSCTFEfficiency::CSCTFEfficiency(const edm::ParameterSet& iConfig) { //now do what ever initialization is needed - inputTag=iConfig.getUntrackedParameter("inputTag"); - dataType=iConfig.getUntrackedParameter("type_of_data"); + inputTag = iConfig.getUntrackedParameter("inputTag"); + dataType = iConfig.getUntrackedParameter("type_of_data"); minPtSim = iConfig.getUntrackedParameter("MinPtSim"); maxPtSim = iConfig.getUntrackedParameter("MaxPtSim"); minEtaSim = iConfig.getUntrackedParameter("MinEtaSim"); @@ -42,303 +41,257 @@ CSCTFEfficiency::CSCTFEfficiency(const edm::ParameterSet& iConfig) minQualityTF = iConfig.getUntrackedParameter("MinQualityTF"); ghostLoseParam = iConfig.getUntrackedParameter("GhostLoseParam"); inputData = iConfig.getUntrackedParameter("InputData"); - minMatchRParam = iConfig.getUntrackedParameter("MinMatchR"); + minMatchRParam = iConfig.getUntrackedParameter("MinMatchR"); statsFilename = iConfig.getUntrackedParameter("StatsFilename"); saveHistImages = iConfig.getUntrackedParameter("SaveHistImages"); singleMuSample = iConfig.getUntrackedParameter("SingleMuSample"); noRefTracks = iConfig.getUntrackedParameter("NoRefTracks"); cutOnModes = iConfig.getUntrackedParameter >("CutOnModes"); nEvents = 0; - configuration= &iConfig; - } -CSCTFEfficiency::~CSCTFEfficiency() -{ - // + configuration = &iConfig; +} +CSCTFEfficiency::~CSCTFEfficiency() { + // } // ------------ method called to for each event ------------ -void CSCTFEfficiency::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ +void CSCTFEfficiency::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { using namespace csctf_analysis; /////////////////////////////// ////// Event Set-Up /////////// /////////////////////////////// - std::vector* Rlist= new std::vector; - std::vector* referenceTrack=new std::vector; - std::vector* trackFinderTrack=new std::vector; + std::vector* Rlist = new std::vector; + std::vector* referenceTrack = new std::vector; + std::vector* trackFinderTrack = new std::vector; std::vector::iterator refTrack; std::vector::iterator tfTrack; - - - if(!noRefTracks) - { - //Reference tracks - edm::Handle BaseSimTracks; - iEvent.getByLabel("g4SimHits",BaseSimTracks); - edm::SimTrackContainer::const_iterator BaseSimTrk; - for(BaseSimTrk=BaseSimTracks->begin(); BaseSimTrk != BaseSimTracks->end(); BaseSimTrk++) - { - RefTrack refTrackTemp= RefTrack(*BaseSimTrk); - double fabsEta = fabs(refTrackTemp.getEta()); - refTrackTemp.setHistList(refHistList); - bool limits = refTrackTemp.getPt() < maxPtSim && refTrackTemp.getPt() > minPtSim && (fabsEta < maxEtaSim) && (fabsEta > minEtaSim); - bool isMuon = fabs(refTrackTemp.getType())==13; - if(isMuon && limits) - { - //std::cout<<"\nMinPtSim= "<push_back(refTrackTemp); - } - } - + if (!noRefTracks) { + //Reference tracks + edm::Handle BaseSimTracks; + iEvent.getByLabel("g4SimHits", BaseSimTracks); + edm::SimTrackContainer::const_iterator BaseSimTrk; + for (BaseSimTrk = BaseSimTracks->begin(); BaseSimTrk != BaseSimTracks->end(); BaseSimTrk++) { + RefTrack refTrackTemp = RefTrack(*BaseSimTrk); + double fabsEta = fabs(refTrackTemp.getEta()); + refTrackTemp.setHistList(refHistList); + bool limits = refTrackTemp.getPt() < maxPtSim && refTrackTemp.getPt() > minPtSim && (fabsEta < maxEtaSim) && + (fabsEta > minEtaSim); + bool isMuon = fabs(refTrackTemp.getType()) == 13; + if (isMuon && limits) { + //std::cout<<"\nMinPtSim= "<push_back(refTrackTemp); + } } + } - //dataType key: 0 - L1CSCTrack // 1 - L1MuRegionalCand // 2 - L1MuGMTExtendedCand - if (dataType==1)//If you want the original production of sim csctf tracks without modes and ghost modes information/plots + if (dataType == + 1) //If you want the original production of sim csctf tracks without modes and ghost modes information/plots { - edm::Handle > trackFinderTracks; - iEvent.getByLabel(inputTag, trackFinderTracks); - std::vector::const_iterator BaseTFTrk; - for(BaseTFTrk=trackFinderTracks->begin();BaseTFTrk != trackFinderTracks->end(); BaseTFTrk++) - { - TFTrack tfTrackTemp= TFTrack(*BaseTFTrk); - if(tfTrackTemp.getQuality() >= minQualityTF && tfTrackTemp.getPt() >= minPtTF ) - { - tfTrackTemp.setHistList(tfHistList); - trackFinderTrack->push_back(tfTrackTemp); - } - } - } - else if(dataType==2) - { - + edm::Handle > trackFinderTracks; + iEvent.getByLabel(inputTag, trackFinderTracks); + std::vector::const_iterator BaseTFTrk; + for (BaseTFTrk = trackFinderTracks->begin(); BaseTFTrk != trackFinderTracks->end(); BaseTFTrk++) { + TFTrack tfTrackTemp = TFTrack(*BaseTFTrk); + if (tfTrackTemp.quality() >= minQualityTF && tfTrackTemp.getPt() >= minPtTF) { + tfTrackTemp.setHistList(tfHistList); + trackFinderTrack->push_back(tfTrackTemp); + } + } + } else if (dataType == 2) { //GMT Tracks edm::Handle gmtreadoutCollectionH; - iEvent.getByLabel(inputTag,gmtreadoutCollectionH); + iEvent.getByLabel(inputTag, gmtreadoutCollectionH); L1MuGMTReadoutCollection const* GMTrc = gmtreadoutCollectionH.product(); vector gmt_records = GMTrc->getRecords(); vector::const_iterator gmt_records_iter; - for(gmt_records_iter=gmt_records.begin(); gmt_records_iter!=gmt_records.end(); gmt_records_iter++){ + for (gmt_records_iter = gmt_records.begin(); gmt_records_iter != gmt_records.end(); gmt_records_iter++) { vector::const_iterator ExtCand_iter; - vector extendedCands = gmt_records_iter->getGMTCands(); - for(ExtCand_iter=extendedCands.begin();ExtCand_iter != extendedCands.end(); ExtCand_iter++){ - + vector extendedCands = gmt_records_iter->getGMTCands(); + for (ExtCand_iter = extendedCands.begin(); ExtCand_iter != extendedCands.end(); ExtCand_iter++) { L1MuGMTExtendedCand gmtec = *ExtCand_iter; - TFTrack tfTrackTemp= TFTrack(gmtec); - - - if(tfTrackTemp.getPt() >= minPtTF && fabs(tfTrackTemp.getEta())<=maxEtaSim && fabs(tfTrackTemp.getEta())>=minEtaSim){ - tfTrackTemp.setHistList(tfHistList); - trackFinderTrack->push_back(tfTrackTemp); + TFTrack tfTrackTemp = TFTrack(gmtec); + + if (tfTrackTemp.getPt() >= minPtTF && fabs(tfTrackTemp.getEta()) <= maxEtaSim && + fabs(tfTrackTemp.getEta()) >= minEtaSim) { + tfTrackTemp.setHistList(tfHistList); + trackFinderTrack->push_back(tfTrackTemp); } } } - } - else //If you want the new production of sim csctf tracks with modes and ghost modes information/plots + } else //If you want the new production of sim csctf tracks with modes and ghost modes information/plots { - edm::Handle trackFinderTracks; - iEvent.getByLabel(inputTag,trackFinderTracks); - L1CSCTrackCollection::const_iterator BaseTFTrk; - - for(BaseTFTrk=trackFinderTracks->begin();BaseTFTrk != trackFinderTracks->end(); BaseTFTrk++) - { - TFTrack tfTrackTemp= TFTrack(*BaseTFTrk,iSetup); + edm::Handle trackFinderTracks; + iEvent.getByLabel(inputTag, trackFinderTracks); + L1CSCTrackCollection::const_iterator BaseTFTrk; - //Skips track if mode is not found in cutOnModes; - if(cutOnModes.size() > 0) - { - std::vector::iterator found; - found = std::find(cutOnModes.begin(),cutOnModes.end(), tfTrackTemp.getMode()); - if(found == cutOnModes.end()) - continue; - } + for (BaseTFTrk = trackFinderTracks->begin(); BaseTFTrk != trackFinderTracks->end(); BaseTFTrk++) { + TFTrack tfTrackTemp = TFTrack(*BaseTFTrk, iSetup); + //Skips track if mode is not found in cutOnModes; + if (cutOnModes.size() > 0) { + std::vector::iterator found; + found = std::find(cutOnModes.begin(), cutOnModes.end(), tfTrackTemp.getMode()); + if (found == cutOnModes.end()) + continue; + } - if(tfTrackTemp.getQuality() >= minQualityTF && tfTrackTemp.getPt() >= minPtTF ) - { - tfTrackTemp.setHistList(tfHistList); - trackFinderTrack->push_back(tfTrackTemp); - } - } + if (tfTrackTemp.quality() >= minQualityTF && tfTrackTemp.getPt() >= minPtTF) { + tfTrackTemp.setHistList(tfHistList); + trackFinderTrack->push_back(tfTrackTemp); + } + } } multHistList->FillMultiplicityHist(trackFinderTrack); - if(trackFinderTrack->size()>=2) - { - rHistogram->fillR(trackFinderTrack->at(0),trackFinderTrack->at(1)); + if (trackFinderTrack->size() >= 2) { + rHistogram->fillR(trackFinderTrack->at(0), trackFinderTrack->at(1)); } ////////////////////////////////////// //////// Track Matching ////////////// ////////////////////////////////////// // Loop over all Reference tracks for an Event - unsigned int iRefTrack=0; - for(refTrack=referenceTrack->begin(); refTrack != referenceTrack->end(); refTrack++) - { - bool tftracksExist = trackFinderTrack->size() > 0; - if (tftracksExist) - { - for(tfTrack=trackFinderTrack->begin(); - tfTrack != trackFinderTrack->end(); tfTrack++) - { - Rlist->push_back(refTrack->distanceTo(&(*tfTrack))); - } - unsigned int iSmallR = minIndex(Rlist); - double smallR = Rlist->at(iSmallR); - bool bestMatch; - bool oldMatch; - if (trackFinderTrack->at(iSmallR).getMatched()) - { - bestMatch=smallR < trackFinderTrack->at(iSmallR).getR(); - oldMatch=true; - } - else if ( smallR < minMatchRParam ) - { - bestMatch=true; oldMatch=false; - } - else - { - bestMatch = false; oldMatch = false; - } - - if (bestMatch) - { - if (oldMatch) - { - int oldRefMatchi = trackFinderTrack->at(iSmallR).getMatchedIndex(); - referenceTrack->at(oldRefMatchi).unMatch(); - } - int tfQ=trackFinderTrack->at(iSmallR).getQuality(); - double tfPt=trackFinderTrack->at(iSmallR).getPt(); - refTrack->matchedTo(iSmallR, smallR,tfQ, tfPt); - refTrack->setQuality(tfQ); - refTrack->setTFPt(tfPt); - trackFinderTrack->at(iSmallR).matchedTo(iRefTrack, smallR); - } - } - Rlist->clear(); + unsigned int iRefTrack = 0; + for (refTrack = referenceTrack->begin(); refTrack != referenceTrack->end(); refTrack++) { + bool tftracksExist = trackFinderTrack->size() > 0; + if (tftracksExist) { + for (tfTrack = trackFinderTrack->begin(); tfTrack != trackFinderTrack->end(); tfTrack++) { + Rlist->push_back(refTrack->distanceTo(&(*tfTrack))); + } + unsigned int iSmallR = minIndex(Rlist); + double smallR = Rlist->at(iSmallR); + bool bestMatch; + bool oldMatch; + if (trackFinderTrack->at(iSmallR).getMatched()) { + bestMatch = smallR < trackFinderTrack->at(iSmallR).getR(); + oldMatch = true; + } else if (smallR < minMatchRParam) { + bestMatch = true; + oldMatch = false; + } else { + bestMatch = false; + oldMatch = false; + } + + if (bestMatch) { + if (oldMatch) { + int oldRefMatchi = trackFinderTrack->at(iSmallR).getMatchedIndex(); + referenceTrack->at(oldRefMatchi).unMatch(); + } + int tfQ = trackFinderTrack->at(iSmallR).quality(); + double tfPt = trackFinderTrack->at(iSmallR).getPt(); + refTrack->matchedTo(iSmallR, smallR, tfQ, tfPt); + refTrack->setQuality(tfQ); + refTrack->setTFPt(tfPt); + trackFinderTrack->at(iSmallR).matchedTo(iRefTrack, smallR); + } } - - + Rlist->clear(); + } //Fill Histograms - int iHighest=0; int i=0; double highestPt=-100.0; - for(refTrack=referenceTrack->begin(); refTrack != referenceTrack->end(); refTrack++) - { - - refTrack->fillHist(); - if(refTrack->getPt()>highestPt){iHighest=i; highestPt=refTrack->getPt();} - if (refTrack->getMatched()) - { - - refTrack->setMatch(trackFinderTrack->at(refTrack->getMatchedIndex())); //this line links the two tracks - refTrack->fillSimvTFHist(*refTrack,refTrack->getMatchedTrack()); - refTrack->fillMatchHist(); - // resolution - int TFTIndex = refTrack->getMatchedIndex(); - TFTrack tfTrk = trackFinderTrack->at( TFTIndex ); - resHistList->FillResolutionHist( *refTrack, tfTrk ); - } - i++; - - + int iHighest = 0; + int i = 0; + double highestPt = -100.0; + for (refTrack = referenceTrack->begin(); refTrack != referenceTrack->end(); refTrack++) { + refTrack->fillHist(); + if (refTrack->getPt() > highestPt) { + iHighest = i; + highestPt = refTrack->getPt(); } - if(!referenceTrack->empty()){referenceTrack->at(iHighest).fillRateHist();} - - iHighest=0; i=0; highestPt=-100.0; - for(tfTrack=trackFinderTrack->begin(); tfTrack != trackFinderTrack->end(); tfTrack++) - { - - tfTrack->fillHist(); - if(tfTrack->getPt()>highestPt){iHighest=i; highestPt=tfTrack->getPt();} - if(tfTrack->getMatched()) - { - tfTrack->fillMatchHist(); - } - + if (refTrack->getMatched()) { + refTrack->setMatch(trackFinderTrack->at(refTrack->getMatchedIndex())); //this line links the two tracks + refTrack->fillSimvTFHist(*refTrack, refTrack->getMatchedTrack()); + refTrack->fillMatchHist(); + // resolution + int TFTIndex = refTrack->getMatchedIndex(); + TFTrack tfTrk = trackFinderTrack->at(TFTIndex); + resHistList->FillResolutionHist(*refTrack, tfTrk); } - if(!trackFinderTrack->empty()){trackFinderTrack->at(iHighest).fillRateHist();} - + i++; + } + if (!referenceTrack->empty()) { + referenceTrack->at(iHighest).fillRateHist(); + } + + iHighest = 0; + i = 0; + highestPt = -100.0; + for (tfTrack = trackFinderTrack->begin(); tfTrack != trackFinderTrack->end(); tfTrack++) { + tfTrack->fillHist(); + if (tfTrack->getPt() > highestPt) { + iHighest = i; + highestPt = tfTrack->getPt(); + } + if (tfTrack->getMatched()) { + tfTrack->fillMatchHist(); + } + } + if (!trackFinderTrack->empty()) { + trackFinderTrack->at(iHighest).fillRateHist(); + } + //////////////////////////////// ////// Ghost Finding /////////// //////////////////////////////// - if(singleMuSample) - { - if(trackFinderTrack->size()>1) - { - std::vector* Qlist= new std::vector; - for(tfTrack=trackFinderTrack->begin(); tfTrack != trackFinderTrack->end(); tfTrack++) - { - if(referenceTrack->size()>0) - { + if (singleMuSample) { + if (trackFinderTrack->size() > 1) { + std::vector* Qlist = new std::vector; + for (tfTrack = trackFinderTrack->begin(); tfTrack != trackFinderTrack->end(); tfTrack++) { + if (referenceTrack->size() > 0) { Rlist->push_back(referenceTrack->begin()->distanceTo(&(*tfTrack))); } - Qlist->push_back(tfTrack->getQuality()); - } + Qlist->push_back(tfTrack->quality()); + } unsigned int iSmallR = minIndex(Rlist); unsigned int iSmallQ = minIndex(Qlist); - if(referenceTrack->size()>0) - { - if(ghostLoseParam=="Q") - { - trackFinderTrack->at(iSmallQ).fillGhostHist(); - } - else if(ghostLoseParam=="R") - { - trackFinderTrack->at(iSmallR).fillGhostHist(); - } - else - { - std::cout << "Warning: ghostLoseParam Not set to R or Q!" << std::endl; - } - referenceTrack->begin()->fillGhostHist(); - } - else - { + if (referenceTrack->size() > 0) { + if (ghostLoseParam == "Q") { + trackFinderTrack->at(iSmallQ).fillGhostHist(); + } else if (ghostLoseParam == "R") { + trackFinderTrack->at(iSmallR).fillGhostHist(); + } else { + std::cout << "Warning: ghostLoseParam Not set to R or Q!" << std::endl; + } + referenceTrack->begin()->fillGhostHist(); + } else { std::cout << "Warning: Multiple TFTracks found, RefTrack NOT found!" << std::endl; - trackFinderTrack->at(iSmallQ).fillGhostHist(); + trackFinderTrack->at(iSmallQ).fillGhostHist(); } delete Qlist; } - } - else - { - unsigned int iTFTrack=0; - for(tfTrack=trackFinderTrack->begin(); tfTrack != trackFinderTrack->end(); tfTrack++) - { - bool reftracksExist = referenceTrack->size() > 0; - if(reftracksExist) - { - for(refTrack=referenceTrack->begin(); refTrack != referenceTrack->end(); refTrack++) - { - Rlist->push_back(refTrack->distanceTo(&(*tfTrack))); - } - unsigned int iSmallR = minIndex(Rlist); - double smallR = Rlist->at(iSmallR); - RefTrack* matchedRefTrack = &referenceTrack->at(iSmallR); - matchedRefTrack->ghostMatchedTo(*tfTrack,iTFTrack,smallR); - Rlist->clear(); - iTFTrack++; - } + } else { + unsigned int iTFTrack = 0; + for (tfTrack = trackFinderTrack->begin(); tfTrack != trackFinderTrack->end(); tfTrack++) { + bool reftracksExist = referenceTrack->size() > 0; + if (reftracksExist) { + for (refTrack = referenceTrack->begin(); refTrack != referenceTrack->end(); refTrack++) { + Rlist->push_back(refTrack->distanceTo(&(*tfTrack))); + } + unsigned int iSmallR = minIndex(Rlist); + double smallR = Rlist->at(iSmallR); + RefTrack* matchedRefTrack = &referenceTrack->at(iSmallR); + matchedRefTrack->ghostMatchedTo(*tfTrack, iTFTrack, smallR); + Rlist->clear(); + iTFTrack++; + } } - for(refTrack=referenceTrack->begin(); refTrack != referenceTrack->end(); refTrack++) - { - if(refTrack->getGhost()) - { - refTrack->loseBestGhostCand(ghostLoseParam); - std::vector* ghosts; - ghosts = refTrack->ghostMatchedIndecies(); - std::vector::const_iterator iGhost; - for(iGhost = ghosts->begin();iGhost != ghosts->end(); iGhost++) - { - TFTrack* tempTFTrack = &trackFinderTrack->at(*iGhost); - int tfQ = tempTFTrack->getQuality(); - refTrack->setQuality(tfQ); - refTrack->fillGhostHist(); - tempTFTrack->fillGhostHist(); - } + for (refTrack = referenceTrack->begin(); refTrack != referenceTrack->end(); refTrack++) { + if (refTrack->getGhost()) { + refTrack->loseBestGhostCand(ghostLoseParam); + std::vector* ghosts; + ghosts = refTrack->ghostMatchedIndecies(); + std::vector::const_iterator iGhost; + for (iGhost = ghosts->begin(); iGhost != ghosts->end(); iGhost++) { + TFTrack* tempTFTrack = &trackFinderTrack->at(*iGhost); + int tfQ = tempTFTrack->quality(); + refTrack->setQuality(tfQ); + refTrack->fillGhostHist(); + tempTFTrack->fillGhostHist(); + } } } } @@ -348,28 +301,25 @@ void CSCTFEfficiency::analyze(const edm::Event& iEvent, const edm::EventSetup& i nEvents++; } // ------------ method called once each job just before starting event loop ------------ -void CSCTFEfficiency::beginJob() -{ +void CSCTFEfficiency::beginJob() { using namespace csctf_analysis; - + gStyle->SetOptStat(0); - tfHistList = new TrackHistogramList("TrackFinder",configuration); - refHistList = new TrackHistogramList("Reference",configuration); - effhistlist = new EffHistogramList("Efficiency",configuration); - resHistList = new ResolutionHistogramList("Resolution",configuration); + tfHistList = new TrackHistogramList("TrackFinder", configuration); + refHistList = new TrackHistogramList("Reference", configuration); + effhistlist = new EffHistogramList("Efficiency", configuration); + resHistList = new ResolutionHistogramList("Resolution", configuration); multHistList = new MultiplicityHistogramList(); - statFile = new StatisticsFile( statsFilename ); + statFile = new StatisticsFile(statsFilename); rHistogram = new RHistogram("RHistograms"); } // ------------ method called once each job just after ending the event loop ------------ -void CSCTFEfficiency::endJob() -{ +void CSCTFEfficiency::endJob() { effhistlist->ComputeEff(refHistList); - statFile->WriteStatistics( *tfHistList, *refHistList); - if(saveHistImages) - { - effhistlist->Print(); - resHistList->Print(); + statFile->WriteStatistics(*tfHistList, *refHistList); + if (saveHistImages) { + effhistlist->Print(); + resHistList->Print(); } delete tfHistList; delete refHistList; @@ -377,32 +327,26 @@ void CSCTFEfficiency::endJob() delete resHistList; delete statFile; } -namespace csctf_analysis -{ - unsigned int minIndex(const std::vector* list){ - unsigned int minI=0; - for(unsigned int i=0;isize();i++) - { - if(list[i]* list) { + unsigned int minI = 0; + for (unsigned int i = 0; i < list->size(); i++) { + if (list[i] < list[minI]) { + minI = i; + } + } + return minI; } - unsigned int minIndex(const std::vector* list){ - unsigned int minI=0; - for(unsigned int i=0;isize();i++) - { - if(list->at(i)at(minI)) - { - minI=i; - } - } - return minI; + unsigned int minIndex(const std::vector* list) { + unsigned int minI = 0; + for (unsigned int i = 0; i < list->size(); i++) { + if (list->at(i) < list->at(minI)) { + minI = i; + } + } + return minI; } -} +} // namespace csctf_analysis //define this as a plug-in DEFINE_FWK_MODULE(CSCTFEfficiency); - diff --git a/L1Trigger/CSCTrackFinder/test/analysis/LCTOccupancies.cc b/L1Trigger/CSCTrackFinder/test/analysis/LCTOccupancies.cc index 888d1a3efd9c4..ecfd4f742e7ad 100644 --- a/L1Trigger/CSCTrackFinder/test/analysis/LCTOccupancies.cc +++ b/L1Trigger/CSCTrackFinder/test/analysis/LCTOccupancies.cc @@ -18,7 +18,7 @@ #include "L1Trigger/CSCTrackFinder/interface/CSCSectorReceiverLUT.h" #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h" -#include "DataFormats/L1CSCTrackFinder/interface/TrackStub.h"// +#include "DataFormats/L1CSCTrackFinder/interface/TrackStub.h" // #include "DataFormats/L1CSCTrackFinder/interface/CSCTriggerContainer.h" #include "DataFormats/MuonDetId/interface/CSCTriggerNumbering.h" #include "L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h" @@ -39,89 +39,87 @@ using namespace std; using namespace edm; class LCTOccupancies : public edm::EDAnalyzer { - public: - explicit LCTOccupancies(const edm::ParameterSet&); - ~LCTOccupancies(); +public: + explicit LCTOccupancies(const edm::ParameterSet&); + ~LCTOccupancies(); +private: + virtual void beginJob(); + virtual void analyze(const edm::Event&, const edm::EventSetup&); + virtual void endJob(); + virtual void beginLuminosityBlock(edm::LuminosityBlock const& iLumiBlock, edm::EventSetup const& iSetup); - private: - virtual void beginJob() ; - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; - virtual void beginLuminosityBlock(edm::LuminosityBlock const& iLumiBlock, - edm::EventSetup const& iSetup); - - // ----------member data --------------------------- + // ----------member data --------------------------- //TH1F* rateHist; - edm::InputTag lctsTag; - edm::InputTag vertexColTag; - edm::Service fs; - csctf_analysis::RunSRLUTs* runSRLUTs; - float insLumi; - int nVertex; - bool haveRECO; - int singleSectorNum; - std::string outTreeFileName; - - TH1F* hNVertex; - TH1F* hInsLumi; - - TH1F* hMPCLink; - TH1F* hLocalPhi; - TH1F* hPhi; - TH1F* hEta; - TH1F* hPhiPacked; - TH1F* hEtaPacked; - TH1F* hBx; - - TH1F* hSector; - TH1F* hStation; - TH1F* hEndcap; - TH1F* hSubSector; - - TH1F* hOccStation1SubSec1; - TH1F* hOccStation1SubSec2; - TH1F* hOccStation2; - TH1F* hOccStation3; - TH1F* hOccStation4; - TH1F* hOccMax; - TH1F* hOccMaxNo0; - TH1F* hStubsTotal; - - TH1F* hOccME11a; - TH1F* hOccME11b; - TH1F* hOccME12; - TH1F* hOccME13; - TH1F* hOccME21; - TH1F* hOccME22; - TH1F* hOccME31; - TH1F* hOccME32; - TH1F* hOccME41; - TH1F* hOccME42; - TH1F* hOccME42SingleSector; - - std::vector hOccME1ChambsSubSec1; - std::vector hOccME1ChambsSubSec2; - std::vector hOccME2Chambs; - std::vector hOccME3Chambs; - std::vector hOccME4Chambs; - - //Tree stuff - TFile* treeFile; - TTree* tree; - std::vector occStation1SubSec1; - std::vector occStation1SubSec2; - std::vector occStation2; - std::vector occStation3; - std::vector occStation4; - - std::vector > occME1ChamberSubSec1; - std::vector > occME1ChamberSubSec2; - std::vector > occME2Chamber; - std::vector > occME3Chamber; - std::vector > occME4Chamber; + edm::InputTag lctsTag; + edm::InputTag vertexColTag; + edm::Service fs; + csctf_analysis::RunSRLUTs* runSRLUTs; + float insLumi; + int nVertex; + bool haveRECO; + int singleSectorNum; + std::string outTreeFileName; + + TH1F* hNVertex; + TH1F* hInsLumi; + + TH1F* hMPCLink; + TH1F* hLocalPhi; + TH1F* hPhi; + TH1F* hEta; + TH1F* hPhiPacked; + TH1F* hEtaPacked; + TH1F* hBx; + + TH1F* hSector; + TH1F* hStation; + TH1F* hEndcap; + TH1F* hSubSector; + + TH1F* hOccStation1SubSec1; + TH1F* hOccStation1SubSec2; + TH1F* hOccStation2; + TH1F* hOccStation3; + TH1F* hOccStation4; + TH1F* hOccMax; + TH1F* hOccMaxNo0; + TH1F* hStubsTotal; + + TH1F* hOccME11a; + TH1F* hOccME11b; + TH1F* hOccME12; + TH1F* hOccME13; + TH1F* hOccME21; + TH1F* hOccME22; + TH1F* hOccME31; + TH1F* hOccME32; + TH1F* hOccME41; + TH1F* hOccME42; + TH1F* hOccME42SingleSector; + + std::vector hOccME1ChambsSubSec1; + std::vector hOccME1ChambsSubSec2; + std::vector hOccME2Chambs; + std::vector hOccME3Chambs; + std::vector hOccME4Chambs; + + //Tree stuff + TFile* treeFile; + TTree* tree; + std::vector occStation1SubSec1; + std::vector occStation1SubSec2; + std::vector occStation2; + std::vector occStation3; + std::vector occStation4; + + std::vector > occME1ChamberSubSec1; + std::vector > occME1ChamberSubSec2; + std::vector > occME2Chamber; + std::vector > occME3Chamber; + std::vector > occME4Chamber; }; // // constants, enums and typedefs @@ -137,273 +135,247 @@ class LCTOccupancies : public edm::EDAnalyzer { LCTOccupancies::LCTOccupancies(const edm::ParameterSet& iConfig) { - //now do what ever initialization is needed - runSRLUTs = new csctf_analysis::RunSRLUTs(); - lctsTag= iConfig.getParameter("lctsTag"); - vertexColTag= iConfig.getParameter("vertexColTag"); - outTreeFileName= iConfig.getUntrackedParameter("outTreeFileName"); - haveRECO = iConfig.getUntrackedParameter("haveRECO"); - singleSectorNum = iConfig.getUntrackedParameter("singleSectorNum"); - - treeFile = new TFile(outTreeFileName.c_str(),"RECREATE"); - tree = new TTree("tree","tree"); - - occStation1SubSec1 = std::vector(12,0); - occStation1SubSec2 = std::vector(12,0); - occStation2 = std::vector(12,0); - occStation3 = std::vector(12,0); - occStation4 = std::vector(12,0); - - for(int iSector = 0; iSector<12; iSector++) - { - occME1ChamberSubSec1.push_back(std::vector(12,0)); - occME1ChamberSubSec2.push_back(std::vector(12,0)); - occME2Chamber.push_back(std::vector(9,0)); - occME3Chamber.push_back(std::vector(9,0)); - occME4Chamber.push_back(std::vector(9,0)); - } - - tree->Branch("nVertex",&nVertex,"nVertex/I"); - tree->Branch("insLumi",&insLumi,"insLumi/F"); - - tree->Branch("occStation1SubSec1","vector",&occStation1SubSec1); - tree->Branch("occStation1SubSec2","vector",&occStation1SubSec2); - tree->Branch("occStation2","vector",&occStation2); - tree->Branch("occStation3","vector",&occStation3); - tree->Branch("occStation4","vector",&occStation4); - - tree->Branch("occME1ChamberSubSec1","vector >",&occME1ChamberSubSec1); - tree->Branch("occME1ChamberSubSec2","vector >",&occME1ChamberSubSec2); - tree->Branch("occME2Chamber","vector >",&occME2Chamber); - tree->Branch("occME3Chamber","vector >",&occME3Chamber); - tree->Branch("occME4Chamber","vector >",&occME4Chamber); -} + //now do what ever initialization is needed + runSRLUTs = new csctf_analysis::RunSRLUTs(); + lctsTag = iConfig.getParameter("lctsTag"); + vertexColTag = iConfig.getParameter("vertexColTag"); + outTreeFileName = iConfig.getUntrackedParameter("outTreeFileName"); + haveRECO = iConfig.getUntrackedParameter("haveRECO"); + singleSectorNum = iConfig.getUntrackedParameter("singleSectorNum"); + + treeFile = new TFile(outTreeFileName.c_str(), "RECREATE"); + tree = new TTree("tree", "tree"); + + occStation1SubSec1 = std::vector(12, 0); + occStation1SubSec2 = std::vector(12, 0); + occStation2 = std::vector(12, 0); + occStation3 = std::vector(12, 0); + occStation4 = std::vector(12, 0); + + for (int iSector = 0; iSector < 12; iSector++) { + occME1ChamberSubSec1.push_back(std::vector(12, 0)); + occME1ChamberSubSec2.push_back(std::vector(12, 0)); + occME2Chamber.push_back(std::vector(9, 0)); + occME3Chamber.push_back(std::vector(9, 0)); + occME4Chamber.push_back(std::vector(9, 0)); + } + tree->Branch("nVertex", &nVertex, "nVertex/I"); + tree->Branch("insLumi", &insLumi, "insLumi/F"); + tree->Branch("occStation1SubSec1", "vector", &occStation1SubSec1); + tree->Branch("occStation1SubSec2", "vector", &occStation1SubSec2); + tree->Branch("occStation2", "vector", &occStation2); + tree->Branch("occStation3", "vector", &occStation3); + tree->Branch("occStation4", "vector", &occStation4); -LCTOccupancies::~LCTOccupancies() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - treeFile->cd(); - tree->Write(); - delete runSRLUTs; + tree->Branch("occME1ChamberSubSec1", "vector >", &occME1ChamberSubSec1); + tree->Branch("occME1ChamberSubSec2", "vector >", &occME1ChamberSubSec2); + tree->Branch("occME2Chamber", "vector >", &occME2Chamber); + tree->Branch("occME3Chamber", "vector >", &occME3Chamber); + tree->Branch("occME4Chamber", "vector >", &occME4Chamber); } +LCTOccupancies::~LCTOccupancies() { + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + treeFile->cd(); + tree->Write(); + delete runSRLUTs; +} // // member functions // // ------------ method called to for each event ------------ -void -LCTOccupancies::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ +void LCTOccupancies::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { /////////////////// //Setup Stuff////// /////////////////// - nVertex=0; + nVertex = 0; std::vector stubs; std::vector::const_iterator stub; - //MuonDigiCollection "csctfunpacker" "" "CsctfFilter" + //MuonDigiCollection "csctfunpacker" "" "CsctfFilter" edm::Handle lctDigiColls; - iEvent.getByLabel(lctsTag,lctDigiColls); + iEvent.getByLabel(lctsTag, lctDigiColls); std::vector* trackStubs = new std::vector; - runSRLUTs->makeTrackStubs(lctDigiColls.product(),trackStubs); + runSRLUTs->makeTrackStubs(lctDigiColls.product(), trackStubs); std::vector::const_iterator ts = trackStubs->begin(); std::vector::const_iterator tsEnd = trackStubs->end(); - for(unsigned i=0;i<12;i++) - { + for (unsigned i = 0; i < 12; i++) { } - std::vector occME11a(24,0); - std::vector occME11b(24,0); - std::vector occME12(24,0); - std::vector occME13(24,0); - std::vector occME21(12,0); - std::vector occME22(12,0); - std::vector occME31(12,0); - std::vector occME32(12,0); - std::vector occME41(12,0); - std::vector occME42(12,0); - int occME42SingleSector=0; - - for(int iSectors = 0; iSectors<12; iSectors++) - { - occStation1SubSec1[iSectors]=0; - occStation1SubSec2[iSectors]=0; - occStation2[iSectors]=0; - occStation3[iSectors]=0; - occStation4[iSectors]=0; - for(int iChambers = 0; iChambers<12; iChambers++) - { - occME1ChamberSubSec1[iSectors][iChambers]=0; - occME1ChamberSubSec2[iSectors][iChambers]=0; - if(iChambers<9) - { - occME2Chamber[iSectors][iChambers]=0; - occME3Chamber[iSectors][iChambers]=0; - occME4Chamber[iSectors][iChambers]=0; + std::vector occME11a(24, 0); + std::vector occME11b(24, 0); + std::vector occME12(24, 0); + std::vector occME13(24, 0); + std::vector occME21(12, 0); + std::vector occME22(12, 0); + std::vector occME31(12, 0); + std::vector occME32(12, 0); + std::vector occME41(12, 0); + std::vector occME42(12, 0); + int occME42SingleSector = 0; + + for (int iSectors = 0; iSectors < 12; iSectors++) { + occStation1SubSec1[iSectors] = 0; + occStation1SubSec2[iSectors] = 0; + occStation2[iSectors] = 0; + occStation3[iSectors] = 0; + occStation4[iSectors] = 0; + for (int iChambers = 0; iChambers < 12; iChambers++) { + occME1ChamberSubSec1[iSectors][iChambers] = 0; + occME1ChamberSubSec2[iSectors][iChambers] = 0; + if (iChambers < 9) { + occME2Chamber[iSectors][iChambers] = 0; + occME3Chamber[iSectors][iChambers] = 0; + occME4Chamber[iSectors][iChambers] = 0; + } } - } } - for (;ts != tsEnd; ts++) - { - //std::cout << "etaValue: \t" <etaValue()<< std::endl; - //std::cout << "phiValue: \t" <phiValue()<< std::endl; - //std::cout << "eta: \t" <etaPacked()<< std::endl; - //std::cout << "phi: \t" <phiPacked()<< std::endl; - //std::cout << "cscid: \t" <cscid()<< std::endl; - //std::cout << "subsector: \t" <subsector()<< std::endl; - //std::cout << "sector: \t" <sector()<< std::endl; - //std::cout << "station: \t" <station()<< std::endl; - //std::cout << "endcap: \t" <endcap()<< std::endl; - //std::cout << "bx: \t" <BX()<< std::endl; - //std::cout << "MPCLink: \t" <getMPCLink()<< std::endl; - //std::cout << std::endl; - - unsigned sector = ts->sector()-1; - - if(ts->BX() != 0) - continue; - hMPCLink->Fill(ts->getMPCLink()); - hLocalPhi->Fill(ts->phiValue()); - hPhi->Fill(ts->phiValue()+15.0*M_PI/180+(sector)*60.0*M_PI/180); - hPhiPacked->Fill(ts->phiPacked()); - hEta->Fill(ts->etaValue()); - hEtaPacked->Fill(ts->etaPacked()); - hBx->Fill(ts->BX()); - int station = ts->station(); - int subsector = ts->subsector(); - //CSCDetId detId(ts->getDetId().rawId()); - CSCDetId detId(ts->getDetId()); - int ring = detId.ring(); - int triggerChamber = CSCTriggerNumbering::triggerCscIdFromLabels(detId); - //ME11a ring==4 doesn't work, no ring==4 events ? - //std::cout << "station: \t" <station()<< std::endl; - //std::cout << "ring: \t" <endcap()==2) - { - station = -station; - sector = sector+6; - } - hSector->Fill(sector+1); - hStation->Fill(station); - hSubSector->Fill(subsector); - - //std::cout << "station: " << station << std::endl; - //std::cout << "my sector packed: " << sector << std::endl; - //std::cout << "trigger Chamber: " << triggerChamber << std::endl; - - station = abs(station); - if (station==1) - { - if(subsector==1) - { - occME1ChamberSubSec1[sector][triggerChamber-1]++; - occStation1SubSec1[sector]++; - if (ring==4) - occME11a[sector]++; - else if (ring==1) - occME11b[sector]++; - else if (ring==2) - occME12[sector]++; - else if (ring==3) - occME13[sector]++; - } - else - { - occME1ChamberSubSec2[sector][triggerChamber-1]++; - occStation1SubSec2[sector]++; - if (ring==4) - occME11a[sector+12]++; - else if (ring==1) - occME11b[sector+12]++; - else if (ring==2) - occME12[sector+12]++; - else if (ring==3) - occME13[sector+12]++; - } - } - if (station==2) - { - occME2Chamber[sector][triggerChamber-1]++; - occStation2[sector]++; - if (ring==1) - occME21[sector]++; - else if (ring==2) - occME22[sector]++; - } - if (station==3) - { - occME3Chamber[sector][triggerChamber-1]++; - occStation3[sector]++; - if (ring==1) - occME31[sector]++; - else if (ring==2) - occME32[sector]++; - } - if (station==4) - { - occME4Chamber[sector][triggerChamber-1]++; - occStation4[sector]++; - if (ring==1) - occME41[sector]++; - else if (ring==2) - { - occME42[sector]++; - occME42SingleSector++; - } - } + for (; ts != tsEnd; ts++) { + //std::cout << "etaValue: \t" <etaValue()<< std::endl; + //std::cout << "phiValue: \t" <phiValue()<< std::endl; + //std::cout << "eta: \t" <etaPacked()<< std::endl; + //std::cout << "phi: \t" <phiPacked()<< std::endl; + //std::cout << "cscid: \t" <cscid()<< std::endl; + //std::cout << "subsector: \t" <subsector()<< std::endl; + //std::cout << "sector: \t" <sector()<< std::endl; + //std::cout << "station: \t" <station()<< std::endl; + //std::cout << "endcap: \t" <endcap()<< std::endl; + //std::cout << "bx: \t" <BX()<< std::endl; + //std::cout << "MPCLink: \t" <mpcLink()<< std::endl; + //std::cout << std::endl; + + unsigned sector = ts->sector() - 1; + + if (ts->BX() != 0) + continue; + hMPCLink->Fill(ts->mpcLink()); + hLocalPhi->Fill(ts->phiValue()); + hPhi->Fill(ts->phiValue() + 15.0 * M_PI / 180 + (sector)*60.0 * M_PI / 180); + hPhiPacked->Fill(ts->phiPacked()); + hEta->Fill(ts->etaValue()); + hEtaPacked->Fill(ts->etaPacked()); + hBx->Fill(ts->BX()); + int station = ts->station(); + int subsector = ts->subsector(); + //CSCDetId detId(ts->getDetId().rawId()); + CSCDetId detId(ts->getDetId()); + int ring = detId.ring(); + int triggerChamber = CSCTriggerNumbering::triggerCscIdFromLabels(detId); + //ME11a ring==4 doesn't work, no ring==4 events ? + //std::cout << "station: \t" <station()<< std::endl; + //std::cout << "ring: \t" <endcap() == 2) { + station = -station; + sector = sector + 6; + } + hSector->Fill(sector + 1); + hStation->Fill(station); + hSubSector->Fill(subsector); + + //std::cout << "station: " << station << std::endl; + //std::cout << "my sector packed: " << sector << std::endl; + //std::cout << "trigger Chamber: " << triggerChamber << std::endl; + + station = abs(station); + if (station == 1) { + if (subsector == 1) { + occME1ChamberSubSec1[sector][triggerChamber - 1]++; + occStation1SubSec1[sector]++; + if (ring == 4) + occME11a[sector]++; + else if (ring == 1) + occME11b[sector]++; + else if (ring == 2) + occME12[sector]++; + else if (ring == 3) + occME13[sector]++; + } else { + occME1ChamberSubSec2[sector][triggerChamber - 1]++; + occStation1SubSec2[sector]++; + if (ring == 4) + occME11a[sector + 12]++; + else if (ring == 1) + occME11b[sector + 12]++; + else if (ring == 2) + occME12[sector + 12]++; + else if (ring == 3) + occME13[sector + 12]++; + } + } + if (station == 2) { + occME2Chamber[sector][triggerChamber - 1]++; + occStation2[sector]++; + if (ring == 1) + occME21[sector]++; + else if (ring == 2) + occME22[sector]++; + } + if (station == 3) { + occME3Chamber[sector][triggerChamber - 1]++; + occStation3[sector]++; + if (ring == 1) + occME31[sector]++; + else if (ring == 2) + occME32[sector]++; + } + if (station == 4) { + occME4Chamber[sector][triggerChamber - 1]++; + occStation4[sector]++; + if (ring == 1) + occME41[sector]++; + else if (ring == 2) { + occME42[sector]++; + occME42SingleSector++; + } + } } int maxOcc = 0; - for (unsigned iSector=0; iSector<12; iSector++) - { - if (singleSectorNum != -1 && singleSectorNum != (int) iSector) - continue; + for (unsigned iSector = 0; iSector < 12; iSector++) { + if (singleSectorNum != -1 && singleSectorNum != (int)iSector) + continue; hOccStation1SubSec1->Fill(occStation1SubSec1[iSector]); hOccStation1SubSec2->Fill(occStation1SubSec2[iSector]); hOccStation2->Fill(occStation2[iSector]); hOccStation3->Fill(occStation3[iSector]); hOccStation4->Fill(occStation4[iSector]); - if (occStation1SubSec1[iSector]>maxOcc) - maxOcc = occStation1SubSec1[iSector]; - if (occStation1SubSec2[iSector]>maxOcc) - maxOcc = occStation1SubSec2[iSector]; - if (occStation2[iSector]>maxOcc) - maxOcc = occStation2[iSector]; - if (occStation3[iSector]>maxOcc) - maxOcc = occStation3[iSector]; - if (occStation4[iSector]>maxOcc) - maxOcc = occStation4[iSector]; + if (occStation1SubSec1[iSector] > maxOcc) + maxOcc = occStation1SubSec1[iSector]; + if (occStation1SubSec2[iSector] > maxOcc) + maxOcc = occStation1SubSec2[iSector]; + if (occStation2[iSector] > maxOcc) + maxOcc = occStation2[iSector]; + if (occStation3[iSector] > maxOcc) + maxOcc = occStation3[iSector]; + if (occStation4[iSector] > maxOcc) + maxOcc = occStation4[iSector]; } hOccMax->Fill(maxOcc); - if(maxOcc>0) + if (maxOcc > 0) hOccMaxNo0->Fill(maxOcc); hStubsTotal->Fill(trackStubs->size()); - for (unsigned iSector=0; iSector<24; iSector++) - { - if (singleSectorNum != -1 && abs(singleSectorNum) != (int) iSector - && abs(singleSectorNum) != (int) iSector-12) - continue; + for (unsigned iSector = 0; iSector < 24; iSector++) { + if (singleSectorNum != -1 && abs(singleSectorNum) != (int)iSector && abs(singleSectorNum) != (int)iSector - 12) + continue; hOccME11a->Fill(occME11a[iSector]); hOccME11b->Fill(occME11b[iSector]); hOccME12->Fill(occME12[iSector]); hOccME13->Fill(occME13[iSector]); - if(iSector<12) - { + if (iSector < 12) { hOccME21->Fill(occME21[iSector]); hOccME22->Fill(occME22[iSector]); hOccME31->Fill(occME31[iSector]); @@ -414,17 +386,13 @@ LCTOccupancies::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) } hOccME42SingleSector->Fill(occME42SingleSector); - for (unsigned iChamb=0; iChamb<12;iChamb++) - { - for (unsigned iSector=0; iSector<12;iSector++) - { - if (singleSectorNum != -1 && abs(singleSectorNum) != (int) iSector - && abs(singleSectorNum) != (int) iSector-12) - continue; + for (unsigned iChamb = 0; iChamb < 12; iChamb++) { + for (unsigned iSector = 0; iSector < 12; iSector++) { + if (singleSectorNum != -1 && abs(singleSectorNum) != (int)iSector && abs(singleSectorNum) != (int)iSector - 12) + continue; hOccME1ChambsSubSec1[iChamb]->Fill(occME1ChamberSubSec1[iSector][iChamb]); hOccME1ChambsSubSec2[iChamb]->Fill(occME1ChamberSubSec2[iSector][iChamb]); - if(iChamb<9) - { + if (iChamb < 9) { hOccME2Chambs[iChamb]->Fill(occME2Chamber[iSector][iChamb]); hOccME3Chambs[iChamb]->Fill(occME3Chamber[iSector][iChamb]); hOccME4Chambs[iChamb]->Fill(occME4Chamber[iSector][iChamb]); @@ -434,126 +402,121 @@ LCTOccupancies::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) //Vertex Counting - if(haveRECO) - if(vertexColTag.label() != "null") - { - edm::Handle vertexCol; - iEvent.getByLabel(vertexColTag,vertexCol); - reco::VertexCollection::const_iterator vertex; - for(vertex = vertexCol->begin(); vertex != vertexCol->end(); vertex++) - { - if(vertex->isValid() && !vertex->isFake()) //&& vertex->normalizedChi2()<10) - nVertex++; - } - //std::cout << "nVertex: " << nVertex << std::endl; - //std::cout << "luminosity: " <Fill(nVertex); - } + if (haveRECO) + if (vertexColTag.label() != "null") { + edm::Handle vertexCol; + iEvent.getByLabel(vertexColTag, vertexCol); + reco::VertexCollection::const_iterator vertex; + for (vertex = vertexCol->begin(); vertex != vertexCol->end(); vertex++) { + if (vertex->isValid() && !vertex->isFake()) //&& vertex->normalizedChi2()<10) + nVertex++; + } + //std::cout << "nVertex: " << nVertex << std::endl; + //std::cout << "luminosity: " <Fill(nVertex); + } tree->Fill(); } - // ------------ method called once each job just before starting event loop ------------ -void -LCTOccupancies::beginJob() -{ - - hNVertex=fs->make("NVertex","N Primary Vertices",30,0,30); +void LCTOccupancies::beginJob() { + hNVertex = fs->make("NVertex", "N Primary Vertices", 30, 0, 30); hNVertex->GetXaxis()->SetTitle("N Primary Vertices"); hNVertex->GetYaxis()->SetTitle("Counts"); - hInsLumi=fs->make("InsLumi","Lumi Section Instantanious Luminosity",10000,0,1000000); + hInsLumi = fs->make("InsLumi", "Lumi Section Instantanious Luminosity", 10000, 0, 1000000); hInsLumi->GetXaxis()->SetTitle("Lumi Section Instantanious Luminosity (Uncorrected HF--10^{30} cm^{2}s^{-1})"); hInsLumi->GetYaxis()->SetTitle("Counts"); - hMPCLink=fs->make("MPCLink","Stub MPC Link Number",5,-1,4); + hMPCLink = fs->make("MPCLink", "Stub MPC Link Number", 5, -1, 4); hMPCLink->GetXaxis()->SetTitle("MPC Link"); hMPCLink->GetYaxis()->SetTitle("Counts"); - hLocalPhi=fs->make("LocalPhi","Stub Local #phi",4096,0,2.0*62.0*M_PI/180.0);//62.0*M_PI/180.0 + hLocalPhi = fs->make("LocalPhi", "Stub Local #phi", 4096, 0, 2.0 * 62.0 * M_PI / 180.0); //62.0*M_PI/180.0 hLocalPhi->GetXaxis()->SetTitle("Local #phi"); hLocalPhi->GetYaxis()->SetTitle("Counts"); - hPhi=fs->make("Phi","Stub #phi",100,0,3.2); + hPhi = fs->make("Phi", "Stub #phi", 100, 0, 3.2); hPhi->GetXaxis()->SetTitle("#phi"); hPhi->GetYaxis()->SetTitle("Counts"); - hPhiPacked=fs->make("PhiPacked","Stub #phi Packed",4096,0,4096);//4096 + hPhiPacked = fs->make("PhiPacked", "Stub #phi Packed", 4096, 0, 4096); //4096 hPhiPacked->GetXaxis()->SetTitle("#phi Packed"); hPhiPacked->GetYaxis()->SetTitle("Counts"); - hEta=fs->make("Eta","Stub |#eta|",128,0.9,2.4); + hEta = fs->make("Eta", "Stub |#eta|", 128, 0.9, 2.4); hEta->GetXaxis()->SetTitle("|#eta|"); hEta->GetYaxis()->SetTitle("Counts"); - hEtaPacked=fs->make("EtaPacked","Stub #eta Packed",128,0,128);//128 + hEtaPacked = fs->make("EtaPacked", "Stub #eta Packed", 128, 0, 128); //128 hEtaPacked->GetXaxis()->SetTitle("#eta Packed"); hEtaPacked->GetYaxis()->SetTitle("Counts"); - hBx=fs->make("Bx","Stub Bx Number",15,0,15); + hBx = fs->make("Bx", "Stub Bx Number", 15, 0, 15); hBx->GetXaxis()->SetTitle("bx"); hBx->GetYaxis()->SetTitle("Counts"); - hStation=fs->make("Station","Stub Station",9,-4.5,4.5); + hStation = fs->make("Station", "Stub Station", 9, -4.5, 4.5); hStation->GetXaxis()->SetTitle("Station"); hStation->GetYaxis()->SetTitle("Counts"); - hSector=fs->make("Sector","Stub Sector",12,0.5,12.5); + hSector = fs->make("Sector", "Stub Sector", 12, 0.5, 12.5); hSector->GetXaxis()->SetTitle("Sector"); hSector->GetYaxis()->SetTitle("Counts"); - hSubSector=fs->make("SubSector","Stub SubSector",3,0,3); + hSubSector = fs->make("SubSector", "Stub SubSector", 3, 0, 3); hSubSector->GetXaxis()->SetTitle("SubSector"); hSubSector->GetYaxis()->SetTitle("Counts"); - hOccStation1SubSec1=fs->make("OccStation1SubSec1","Stub Occupancy, Station 1, Subsector 1",5,-0.5,4.5); + hOccStation1SubSec1 = fs->make("OccStation1SubSec1", "Stub Occupancy, Station 1, Subsector 1", 5, -0.5, 4.5); hOccStation1SubSec1->GetXaxis()->SetTitle("Stub Occupancy, Station 1, Subsector 1, Summed over Sectors"); hOccStation1SubSec1->GetYaxis()->SetTitle("Counts"); - hOccStation1SubSec2=fs->make("OccStation1SubSec2","Stub Occupancy, Station 1, Subsector 2",5,-0.5,4.5); + hOccStation1SubSec2 = fs->make("OccStation1SubSec2", "Stub Occupancy, Station 1, Subsector 2", 5, -0.5, 4.5); hOccStation1SubSec2->GetXaxis()->SetTitle("Stub Occupancy, Station 1, Subsector 1, Summed over Sectors"); hOccStation1SubSec2->GetYaxis()->SetTitle("Counts"); - hOccStation2=fs->make("OccStation2","Stub Occupancy, Station 2",5,-0.5,4.5); + hOccStation2 = fs->make("OccStation2", "Stub Occupancy, Station 2", 5, -0.5, 4.5); hOccStation2->GetXaxis()->SetTitle("Stub Occupancy, Station 2, Summed over Sectors"); hOccStation2->GetYaxis()->SetTitle("Counts"); - hOccStation3=fs->make("OccStation3","Stub Occupancy, Station 3",5,-0.5,4.5); + hOccStation3 = fs->make("OccStation3", "Stub Occupancy, Station 3", 5, -0.5, 4.5); hOccStation3->GetXaxis()->SetTitle("Stub Occupancy, Station 3, Summed over Sectors"); hOccStation3->GetYaxis()->SetTitle("Counts"); - hOccStation4=fs->make("OccStation4","Stub Occupancy, Station 4",5,-0.5,4.5); + hOccStation4 = fs->make("OccStation4", "Stub Occupancy, Station 4", 5, -0.5, 4.5); hOccStation4->GetXaxis()->SetTitle("Stub Occupancy, Station 4, Summed over Sectors"); hOccStation4->GetYaxis()->SetTitle("Counts"); - hOccMax=fs->make("OccMax","Maximum Stub Occupancy",5,-0.5,4.5); + hOccMax = fs->make("OccMax", "Maximum Stub Occupancy", 5, -0.5, 4.5); hOccMax->GetXaxis()->SetTitle("Maximum Stub Occupancy of Stations, Sectors, and Subsectors"); hOccMax->GetYaxis()->SetTitle("Counts"); - hOccMaxNo0=fs->make("OccMaxNo0","Maximum Stub Occupancy",4,0.5,4.5); + hOccMaxNo0 = fs->make("OccMaxNo0", "Maximum Stub Occupancy", 4, 0.5, 4.5); hOccMaxNo0->GetXaxis()->SetTitle("Maximum Stub Occupancy of Stations, Sectors, and Subsectors"); hOccMaxNo0->GetYaxis()->SetTitle("Counts"); - hStubsTotal=fs->make("StubsTotal","N Stubs",20,0,20); + hStubsTotal = fs->make("StubsTotal", "N Stubs", 20, 0, 20); hStubsTotal->GetXaxis()->SetTitle("N Stubs Unpacked in Event"); hStubsTotal->GetYaxis()->SetTitle("Counts"); - hOccME11a=fs->make("OccME11a","Stub Occupancy, ME11a, Summed over Sectors, Subsectors",5,-0.5,4.5); + hOccME11a = fs->make("OccME11a", "Stub Occupancy, ME11a, Summed over Sectors, Subsectors", 5, -0.5, 4.5); hOccME11a->GetXaxis()->SetTitle("Stub Occupancy, ME11a, Summed over Sectors, Subsectors"); hOccME11a->GetYaxis()->SetTitle("Counts"); - hOccME11b=fs->make("OccME11b","Stub Occupancy, ME11b, Summed over Sectors, Subsectors",5,-0.5,4.5); + hOccME11b = fs->make("OccME11b", "Stub Occupancy, ME11b, Summed over Sectors, Subsectors", 5, -0.5, 4.5); hOccME11b->GetXaxis()->SetTitle("Stub Occupancy, ME11b, Summed over Sectors, Subsectors"); hOccME11b->GetYaxis()->SetTitle("Counts"); - hOccME12=fs->make("OccME12","Stub Occupancy, ME12, Summed over Sectors, Subsectors",5,-0.5,4.5); + hOccME12 = fs->make("OccME12", "Stub Occupancy, ME12, Summed over Sectors, Subsectors", 5, -0.5, 4.5); hOccME12->GetXaxis()->SetTitle("Stub Occupancy, ME12, Summed over Sectors, Subsectors"); hOccME12->GetYaxis()->SetTitle("Counts"); - hOccME13=fs->make("OccME13","Stub Occupancy, ME13, Summed over Sectors, Subsectors",5,-0.5,4.5); + hOccME13 = fs->make("OccME13", "Stub Occupancy, ME13, Summed over Sectors, Subsectors", 5, -0.5, 4.5); hOccME13->GetXaxis()->SetTitle("Stub Occupancy, ME13, Summed over Sectors, Subsectors"); hOccME13->GetYaxis()->SetTitle("Counts"); - hOccME21=fs->make("OccME21","Stub Occupancy, ME21, Summed over Sectors",5,-0.5,4.5); + hOccME21 = fs->make("OccME21", "Stub Occupancy, ME21, Summed over Sectors", 5, -0.5, 4.5); hOccME21->GetXaxis()->SetTitle("Stub Occupancy, ME21, Summed over Sectors"); hOccME21->GetYaxis()->SetTitle("Counts"); - hOccME22=fs->make("OccME22","Stub Occupancy, ME22, Summed over Sectors",5,-0.5,4.5); + hOccME22 = fs->make("OccME22", "Stub Occupancy, ME22, Summed over Sectors", 5, -0.5, 4.5); hOccME22->GetXaxis()->SetTitle("Stub Occupancy, ME22, Summed over Sectors"); hOccME22->GetYaxis()->SetTitle("Counts"); - hOccME31=fs->make("OccME31","Stub Occupancy, ME31, Summed over Sectors",5,-0.5,4.5); + hOccME31 = fs->make("OccME31", "Stub Occupancy, ME31, Summed over Sectors", 5, -0.5, 4.5); hOccME31->GetXaxis()->SetTitle("Stub Occupancy, ME31, Summed over Sectors"); hOccME31->GetYaxis()->SetTitle("Counts"); - hOccME32=fs->make("OccME32","Stub Occupancy, ME32, Summed over Sectors",5,-0.5,4.5); + hOccME32 = fs->make("OccME32", "Stub Occupancy, ME32, Summed over Sectors", 5, -0.5, 4.5); hOccME32->GetXaxis()->SetTitle("Stub Occupancy, ME32, Summed over Sectors"); hOccME32->GetYaxis()->SetTitle("Counts"); - hOccME41=fs->make("OccME41","Stub Occupancy, ME41, Summed over Sectors",5,-0.5,4.5); + hOccME41 = fs->make("OccME41", "Stub Occupancy, ME41, Summed over Sectors", 5, -0.5, 4.5); hOccME41->GetXaxis()->SetTitle("Stub Occupancy, ME41, Summed over Sectors"); hOccME41->GetYaxis()->SetTitle("Counts"); - hOccME42=fs->make("OccME42","Stub Occupancy, ME42, Summed over Sectors",5,-0.5,4.5); + hOccME42 = fs->make("OccME42", "Stub Occupancy, ME42, Summed over Sectors", 5, -0.5, 4.5); hOccME42->GetXaxis()->SetTitle("Stub Occupancy, ME42, Summed over Sectors"); hOccME42->GetYaxis()->SetTitle("Counts"); - hOccME42SingleSector=fs->make("OccME42SingleSector","Stub Occupancy, ME42, All Stubs in 1 Sector",5,-0.5,4.5); + hOccME42SingleSector = + fs->make("OccME42SingleSector", "Stub Occupancy, ME42, All Stubs in 1 Sector", 5, -0.5, 4.5); hOccME42SingleSector->GetXaxis()->SetTitle("Stub Occupancy, ME42"); hOccME42SingleSector->GetYaxis()->SetTitle("Counts"); @@ -563,61 +526,49 @@ LCTOccupancies::beginJob() TFileDirectory chambsME3Dir = fs->mkdir("chambsME3"); TFileDirectory chambsME4Dir = fs->mkdir("chambsME4"); - for(int i=0; i<12;i++) - { - std::stringstream tmpName; - std::stringstream tmpTitle; - tmpName << "OccME1Chamb" << i+1; - tmpTitle << "Stub Occupancy ME1, Chamber " << i+1 << " Summed Over Sectors, SubSectors"; - TH1F* tempHist = chambsME1Dir.make(tmpName.str().c_str(),tmpTitle.str().c_str(),3,-0.5,2.5); - tempHist->GetXaxis()->SetTitle(tmpTitle.str().c_str()); - tempHist->GetYaxis()->SetTitle("Counts"); - hOccME1ChambsSubSec1.push_back(tempHist); - hOccME1ChambsSubSec2.push_back((TH1F*) tempHist->Clone()); + for (int i = 0; i < 12; i++) { + std::stringstream tmpName; + std::stringstream tmpTitle; + tmpName << "OccME1Chamb" << i + 1; + tmpTitle << "Stub Occupancy ME1, Chamber " << i + 1 << " Summed Over Sectors, SubSectors"; + TH1F* tempHist = chambsME1Dir.make(tmpName.str().c_str(), tmpTitle.str().c_str(), 3, -0.5, 2.5); + tempHist->GetXaxis()->SetTitle(tmpTitle.str().c_str()); + tempHist->GetYaxis()->SetTitle("Counts"); + hOccME1ChambsSubSec1.push_back(tempHist); + hOccME1ChambsSubSec2.push_back((TH1F*)tempHist->Clone()); } - for(int i=0; i<9;i++) - { - for(int j=2; j<5;j++) - { - std::stringstream tmpName; - std::stringstream tmpTitle; - tmpName << "OccME"<(tmpName.str().c_str(),tmpTitle.str().c_str(),3,-0.5,2.5); - hOccME2Chambs.push_back(tempHist); - } - else if(j==3) - { - tempHist = chambsME3Dir.make(tmpName.str().c_str(),tmpTitle.str().c_str(),3,-0.5,2.5); - hOccME3Chambs.push_back(tempHist); - } - else if(j==4) - { - tempHist = chambsME4Dir.make(tmpName.str().c_str(),tmpTitle.str().c_str(),3,-0.5,2.5); - hOccME4Chambs.push_back(tempHist); - } - else - std::cout << "Warning: problem in initializing Chamber Occ hists!" << std::endl; - - tempHist->GetXaxis()->SetTitle(tmpTitle.str().c_str()); - tempHist->GetYaxis()->SetTitle("Counts"); + for (int i = 0; i < 9; i++) { + for (int j = 2; j < 5; j++) { + std::stringstream tmpName; + std::stringstream tmpTitle; + tmpName << "OccME" << j << "Chamb" << i + 1; + tmpTitle << "Stub Occupancy ME" << j << ", Chamber " << i + 1 << " Summed Over Sectors"; + TH1F* tempHist; + if (j == 2) { + tempHist = chambsME2Dir.make(tmpName.str().c_str(), tmpTitle.str().c_str(), 3, -0.5, 2.5); + hOccME2Chambs.push_back(tempHist); + } else if (j == 3) { + tempHist = chambsME3Dir.make(tmpName.str().c_str(), tmpTitle.str().c_str(), 3, -0.5, 2.5); + hOccME3Chambs.push_back(tempHist); + } else if (j == 4) { + tempHist = chambsME4Dir.make(tmpName.str().c_str(), tmpTitle.str().c_str(), 3, -0.5, 2.5); + hOccME4Chambs.push_back(tempHist); + } else + std::cout << "Warning: problem in initializing Chamber Occ hists!" << std::endl; + + tempHist->GetXaxis()->SetTitle(tmpTitle.str().c_str()); + tempHist->GetYaxis()->SetTitle("Counts"); } } - } // ------------ method called once each job just after ending the event loop ------------ -void -LCTOccupancies::endJob() -{ - TH1F* hOccStation1AddSubSec=fs->make("OccStation1AddSubSec","Stub Occupancy, Station 1",5,-0.5,4.5); +void LCTOccupancies::endJob() { + TH1F* hOccStation1AddSubSec = fs->make("OccStation1AddSubSec", "Stub Occupancy, Station 1", 5, -0.5, 4.5); hOccStation1AddSubSec->GetXaxis()->SetTitle("Stub Occupancy, Station 1, Summed over Sectors, Subsectors"); hOccStation1AddSubSec->GetYaxis()->SetTitle("Counts"); - TH1F* hOccAddStations=fs->make("OccAddStation","Stub Occupancy",5,-0.5,4.5); + TH1F* hOccAddStations = fs->make("OccAddStation", "Stub Occupancy", 5, -0.5, 4.5); hOccAddStations->GetXaxis()->SetTitle("Stub Occupancy, Summed over Stations, Sectors, Subsectors"); hOccAddStations->GetYaxis()->SetTitle("Counts"); @@ -630,21 +581,17 @@ LCTOccupancies::endJob() hOccAddStations->Add(hOccStation4); } -void -LCTOccupancies::beginLuminosityBlock(edm::LuminosityBlock const& iLumiBlock, - edm::EventSetup const& iSetup) -{ - if(haveRECO) - { - edm::Handle lumiSummary; - iLumiBlock.getByLabel("lumiProducer", lumiSummary); - - // - //collect lumi. - // - insLumi=lumiSummary->avgInsDelLumi();//*93.244; - //std::cout << "luminosity: " <Fill(insLumi); +void LCTOccupancies::beginLuminosityBlock(edm::LuminosityBlock const& iLumiBlock, edm::EventSetup const& iSetup) { + if (haveRECO) { + edm::Handle lumiSummary; + iLumiBlock.getByLabel("lumiProducer", lumiSummary); + + // + //collect lumi. + // + insLumi = lumiSummary->avgInsDelLumi(); //*93.244; + //std::cout << "luminosity: " <Fill(insLumi); } } diff --git a/L1Trigger/CSCTrackFinder/test/analysis/LCTPrinter.cc b/L1Trigger/CSCTrackFinder/test/analysis/LCTPrinter.cc index c5cc89b7b0df1..95273b7924b71 100644 --- a/L1Trigger/CSCTrackFinder/test/analysis/LCTPrinter.cc +++ b/L1Trigger/CSCTrackFinder/test/analysis/LCTPrinter.cc @@ -1,11 +1,10 @@ #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h" -#include "DataFormats/L1CSCTrackFinder/interface/TrackStub.h"// +#include "DataFormats/L1CSCTrackFinder/interface/TrackStub.h" // #include "DataFormats/L1CSCTrackFinder/interface/CSCTriggerContainer.h" #include "DataFormats/MuonDetId/interface/CSCTriggerNumbering.h" #include "DataFormats/MuonDetId/interface/CSCDetId.h" #include "L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h" - #include // system include files @@ -30,21 +29,20 @@ using namespace std; using namespace edm; class LCTPrinter : public edm::EDAnalyzer { - public: - explicit LCTPrinter(const edm::ParameterSet&); - ~LCTPrinter(); - +public: + explicit LCTPrinter(const edm::ParameterSet&); + ~LCTPrinter(); - private: - virtual void beginJob() ; - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; +private: + virtual void beginJob(); + virtual void analyze(const edm::Event&, const edm::EventSetup&); + virtual void endJob(); - // ----------member data --------------------------- + // ----------member data --------------------------- //edm::Service fs; //TH1F* rateHist; - CSCSectorReceiverLUT *srLUTs_[5]; + CSCSectorReceiverLUT* srLUTs_[5]; }; // // constants, enums and typedefs @@ -60,45 +58,35 @@ class LCTPrinter : public edm::EDAnalyzer { LCTPrinter::LCTPrinter(const edm::ParameterSet& iConfig) { - //now do what ever initialization is needed + //now do what ever initialization is needed - int endcap=1, sector=1; // assume SR LUTs are all same for every sector in either of endcaps - bool TMB07=true; // specific TMB firmware + int endcap = 1, sector = 1; // assume SR LUTs are all same for every sector in either of endcaps + bool TMB07 = true; // specific TMB firmware edm::ParameterSet srLUTset; srLUTset.addUntrackedParameter("ReadLUTs", false); - srLUTset.addUntrackedParameter("Binary", false); + srLUTset.addUntrackedParameter("Binary", false); srLUTset.addUntrackedParameter("LUTPath", "./"); - for(int station=1,fpga=0; station<=4 && fpga<5; station++) - { - if(station==1) - for(int subSector=0; subSector<2 && fpga<5; subSector++) - srLUTs_[fpga++] = new CSCSectorReceiverLUT(endcap, sector, subSector+1, station, srLUTset, TMB07); - else - srLUTs_[fpga++] = new CSCSectorReceiverLUT(endcap, sector, 0, station, srLUTset, TMB07); + for (int station = 1, fpga = 0; station <= 4 && fpga < 5; station++) { + if (station == 1) + for (int subSector = 0; subSector < 2 && fpga < 5; subSector++) + srLUTs_[fpga++] = new CSCSectorReceiverLUT(endcap, sector, subSector + 1, station, srLUTset, TMB07); + else + srLUTs_[fpga++] = new CSCSectorReceiverLUT(endcap, sector, 0, station, srLUTset, TMB07); } - } - - -LCTPrinter::~LCTPrinter() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - +LCTPrinter::~LCTPrinter() { + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) } - // // member functions // // ------------ method called to for each event ------------ -void -LCTPrinter::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ +void LCTPrinter::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { /////////////////// //Setup Stuff////// /////////////////// @@ -106,99 +94,75 @@ LCTPrinter::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) std::vector stubs; std::vector::const_iterator stub; - //MuonDigiCollection "csctfunpacker" "" "CsctfFilter" + //MuonDigiCollection "csctfunpacker" "" "CsctfFilter" edm::Handle lctDigiColls; - iEvent.getByLabel("csctfunpacker",lctDigiColls); + iEvent.getByLabel("csctfunpacker", lctDigiColls); CSCCorrelatedLCTDigiCollection::DigiRangeIterator lctDigiColl; - for (lctDigiColl = lctDigiColls->begin(); lctDigiColl != lctDigiColls->end(); lctDigiColl++) - { - CSCCorrelatedLCTDigiCollection::const_iterator lctDigi = (*lctDigiColl).second.first; - CSCCorrelatedLCTDigiCollection::const_iterator lctDigiEnd = (*lctDigiColl).second.second; - - for (; lctDigi != lctDigiEnd; lctDigi++) - { - //int endcap = (*lctDigiColl).first.endcap()-1; - int station = (*lctDigiColl).first.station()-1; - //int sector = (*lctDigiColl).first.triggerSector()-1; - int subSector = CSCTriggerNumbering::triggerSubSectorFromLabels((*lctDigiColl).first); - int cscId = (*lctDigiColl).first.triggerCscId()-1; - int fpga = ( subSector ? subSector-1 : station+1 ); - - lclphidat lclPhi; - gblphidat gblPhi; - gbletadat gblEta; - - try - { - lclPhi = srLUTs_[fpga]->localPhi(lctDigi->getStrip(), lctDigi->getPattern(), lctDigi->getQuality(), lctDigi->getBend()); - } - catch(...) - { - bzero(&lclPhi,sizeof(lclPhi)); - std::cout << "Bad local phi!" <globalPhiME(lclPhi.phi_local, lctDigi->getKeyWG(), cscId+1); - } - catch(...) - { - bzero(&gblPhi,sizeof(gblPhi)); - std::cout << "Bad global phi!" <globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lctDigi->getKeyWG(), cscId+1); - } - catch(...) - { - bzero(&gblEta,sizeof(gblEta)); - std::cout << "Bad global eta!" << std::endl; - } - - csctf::TrackStub theStub((*lctDigi), (*lctDigiColl).first); - theStub.setPhiPacked(gblPhi.global_phi); - theStub.setEtaPacked(gblEta.global_eta); - - stubs.push_back(theStub); - } + for (lctDigiColl = lctDigiColls->begin(); lctDigiColl != lctDigiColls->end(); lctDigiColl++) { + CSCCorrelatedLCTDigiCollection::const_iterator lctDigi = (*lctDigiColl).second.first; + CSCCorrelatedLCTDigiCollection::const_iterator lctDigiEnd = (*lctDigiColl).second.second; + + for (; lctDigi != lctDigiEnd; lctDigi++) { + //int endcap = (*lctDigiColl).first.endcap()-1; + int station = (*lctDigiColl).first.station() - 1; + //int sector = (*lctDigiColl).first.triggerSector()-1; + int subSector = CSCTriggerNumbering::triggerSubSectorFromLabels((*lctDigiColl).first); + int cscId = (*lctDigiColl).first.triggerCscId() - 1; + int fpga = (subSector ? subSector - 1 : station + 1); + + lclphidat lclPhi; + gblphidat gblPhi; + gbletadat gblEta; + + try { + lclPhi = srLUTs_[fpga]->localPhi(lctDigi->strip(), lctDigi->pattern(), lctDigi->quality(), lctDigi->bend()); + } catch (...) { + bzero(&lclPhi, sizeof(lclPhi)); + std::cout << "Bad local phi!" << std::endl; + } + try { + gblPhi = srLUTs_[fpga]->globalPhiME(lclPhi.phi_local, lctDigi->keyWireGroup(), cscId + 1); + } catch (...) { + bzero(&gblPhi, sizeof(gblPhi)); + std::cout << "Bad global phi!" << std::endl; + } + try { + gblEta = + srLUTs_[fpga]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lctDigi->keyWireGroup(), cscId + 1); + } catch (...) { + bzero(&gblEta, sizeof(gblEta)); + std::cout << "Bad global eta!" << std::endl; + } + + csctf::TrackStub theStub((*lctDigi), (*lctDigiColl).first); + theStub.setPhiPacked(gblPhi.global_phi); + theStub.setEtaPacked(gblEta.global_eta); + + stubs.push_back(theStub); + } } ////////////// //Analysis//// ////////////// - for(stub=stubs.begin(); stub != stubs.end(); stub++) - { - stub->print(); - std::cout << "Endcap: " << stub->endcap() << - " Station: " << stub->station() << - " Sector: " << stub->sector() << - " Ring: " << CSCDetId(stub->getDetId()).ring() << - " SubSector: " << stub->subsector() << - " CscId: " << stub->cscid() << - " ChamberId: " << CSCDetId(stub->getDetId()).chamber() << - " TriggerChamberId: " << - CSCTriggerNumbering::triggerCscIdFromLabels(stub->getDetId()) << - " Bx: " << stub->BX() << std::endl; - std::cout << "Phi Packed: " << stub->phiPacked() << std::endl; - std::cout << "Eta Packed: " << stub->etaPacked() << std::endl; + for (stub = stubs.begin(); stub != stubs.end(); stub++) { + stub->print(); + std::cout << "Endcap: " << stub->endcap() << " Station: " << stub->station() << " Sector: " << stub->sector() + << " Ring: " << CSCDetId(stub->getDetId()).ring() << " SubSector: " << stub->subsector() + << " CscId: " << stub->cscid() << " ChamberId: " << CSCDetId(stub->getDetId()).chamber() + << " TriggerChamberId: " << CSCTriggerNumbering::triggerCscIdFromLabels(stub->getDetId()) + << " Bx: " << stub->BX() << std::endl; + std::cout << "Phi Packed: " << stub->phiPacked() << std::endl; + std::cout << "Eta Packed: " << stub->etaPacked() << std::endl; } - } - // ------------ method called once each job just before starting event loop ------------ -void -LCTPrinter::beginJob() -{ -} +void LCTPrinter::beginJob() {} // ------------ method called once each job just after ending the event loop ------------ -void -LCTPrinter::endJob() -{ -} +void LCTPrinter::endJob() {} //define this as a plug-in DEFINE_FWK_MODULE(LCTPrinter); diff --git a/L1Trigger/CSCTrackFinder/test/src/RefTrack.cc b/L1Trigger/CSCTrackFinder/test/src/RefTrack.cc index ed2b9d77b240f..67317f4bea7b7 100644 --- a/L1Trigger/CSCTrackFinder/test/src/RefTrack.cc +++ b/L1Trigger/CSCTrackFinder/test/src/RefTrack.cc @@ -1,68 +1,52 @@ #include "L1Trigger/CSCTrackFinder/test/src/RefTrack.h" #include -namespace csctf_analysis -{ - RefTrack::RefTrack():Track() {} - RefTrack::RefTrack(const SimTrack& track):Track() - { - mom.SetPxPyPzE(track.momentum().x(), - track.momentum().y(), - track.momentum().z(), - track.momentum().t()); - Quality=-1; - type = track.type(); +namespace csctf_analysis { + RefTrack::RefTrack() : Track() {} + RefTrack::RefTrack(const SimTrack& track) : Track() { + mom.SetPxPyPzE(track.momentum().x(), track.momentum().y(), track.momentum().z(), track.momentum().t()); + Quality = -1; + type = track.type(); } - RefTrack::RefTrack(const reco::Muon& muon):Track() - { - mom.SetPxPyPzE(muon.p4().x(), - muon.p4().y(), - muon.p4().z(), - muon.p4().t()); - Quality=-1; - type = 13; + RefTrack::RefTrack(const reco::Muon& muon) : Track() { + mom.SetPxPyPzE(muon.p4().x(), muon.p4().y(), muon.p4().z(), muon.p4().t()); + Quality = -1; + type = 13; } - double RefTrack::distanceTo(const TFTrack* tftrack) const - { - double newR; - double dEta =getEta()-tftrack->getEta(); - double dPhi =getPhi()-tftrack->getPhi(); + double RefTrack::distanceTo(const TFTrack* tftrack) const { + double newR; + double dEta = getEta() - tftrack->getEta(); + double dPhi = getPhi() - tftrack->getPhi(); - newR = sqrt( dEta*dEta + dPhi*dPhi ); //Changed to do distance style metric by Daniel 07/02 + newR = sqrt(dEta * dEta + dPhi * dPhi); //Changed to do distance style metric by Daniel 07/02 - return newR; + return newR; } - void RefTrack::matchedTo(int i, double newR,int newQ, double newTFPt) - { - if(matched==false || newRpush_back(i); - ghostR->push_back(newR); - ghostQ->push_back(track.getQuality()); - if (ghostMatchedToIndex->size() > 1) - ghost=true; + void RefTrack::ghostMatchedTo(const TFTrack& track, int i, double newR) { + ghostMatchedToIndex->push_back(i); + ghostR->push_back(newR); + ghostQ->push_back(track.quality()); + if (ghostMatchedToIndex->size() > 1) + ghost = true; } - void RefTrack::print() - { + void RefTrack::print() { std::cout << "RefTrack Info" << std::endl; - std::cout << " Pt: "<< getPt() << std::endl; - std::cout << " Phi: "<< getPhi() << std::endl; - std::cout << " Eta: "<< getEta() << std::endl; - std::cout << " P: "<< getP() << std::endl; - std::cout << " Pz: "<< getPz() << std::endl; - std::cout << " Type: "<< getType() << std::endl; - } - - - void RefTrack::setMatch(TFTrack& trackToMatch) - { - matchedTrack = &trackToMatch; + std::cout << " Pt: " << getPt() << std::endl; + std::cout << " Phi: " << getPhi() << std::endl; + std::cout << " Eta: " << getEta() << std::endl; + std::cout << " P: " << getP() << std::endl; + std::cout << " Pz: " << getPz() << std::endl; + std::cout << " Type: " << getType() << std::endl; } -} + void RefTrack::setMatch(TFTrack& trackToMatch) { matchedTrack = &trackToMatch; } + +} // namespace csctf_analysis diff --git a/L1Trigger/CSCTrackFinder/test/src/ResolutionHistogramList.cc b/L1Trigger/CSCTrackFinder/test/src/ResolutionHistogramList.cc index ba36b86ed6f20..10136a01a26b8 100644 --- a/L1Trigger/CSCTrackFinder/test/src/ResolutionHistogramList.cc +++ b/L1Trigger/CSCTrackFinder/test/src/ResolutionHistogramList.cc @@ -3,127 +3,104 @@ #include "L1Trigger/CSCTrackFinder/test/src/EffHistogramList.h" #include "L1Trigger/CSCTrackFinder/test/src/ResolutionHistogramList.h" -namespace csctf_analysis -{ - ResolutionHistogramList::ResolutionHistogramList(const std::string dirname, const edm::ParameterSet* parameters) - { - - TFileDirectory dir = fs->mkdir(dirname); - - double maxpt=parameters->getUntrackedParameter("MaxPtHist"); - double minpt=parameters->getUntrackedParameter("MinPtHist"); - int ptbins=parameters->getUntrackedParameter("BinsPtHist"); - - - PtQ1Res = dir.make("PtQ1Res","Pt Q>=1 Resolution",300,-1.5,1.5); - PtQ2Res = dir.make("PtQ2Res","Pt Q>=2 Resolution",300,-1.5,1.5); - PtQ3Res = dir.make("PtQ3Res","Pt Q>=3 Resolution",300,-1.5,1.5); - EtaQ1Res = dir.make("EtaQ1Res","Eta Q>=1 Resolution",1000,-1, 1); - EtaQ2Res = dir.make("EtaQ2Res","Eta Q>=2 Resolution",1000,-1, 1); - EtaQ3Res = dir.make("EtaQ3Res","Eta Q>=3 Resolution",1000,-1, 1); - PhiQ1Res = dir.make("PhiQ1Res","Phi Q>=1 Resolution",1000,-1, 1); - PhiQ2Res = dir.make("PhiQ2Res","Phi Q>=2 Resolution",1000,-1, 1); - PhiQ3Res = dir.make("PhiQ3Res","Phi Q>=3 Resolution",1000,-1, 1); - - PtQ2ResGolden = dir.make("PtQ2ResGolden","Pt Q>=2 Resolution; 1.2 <= eta <= 2.1",300,-1.5,1.5); - PhiQ2ResGolden = dir.make("PhiQ2ResGolden","Phi Q>=2 Resolution; 1.2 <= eta <= 2.1",1000,-1, 1); - PtQ2ResHighEta = dir.make("PtQ2ResHighEta","Pt Q>=2 Resolution; eta >= 2.1",300,-1.5,1.5); - PhiQ2ResHighEta = dir.make("PhiQ2ResHighEta","Phi Q>=2 Resolution; eta >= 2.1",1000,-1, 1); - PtQ2ResOverlap = dir.make("PtQ2ResOverlap","Pt Q>=2 Resolution; eta <= 1.2",300,-1.5,1.5); - PhiQ2ResOverlap = dir.make("PhiQ2ResOverlap","Phi Q>=2 Resolution; eta <= 1.2",1000,-1, 1); - - PtQ2Res->GetXaxis()->SetTitle("Pt_{Sim}/Pt_{TF}-1"); - PtQ2Res->GetYaxis()->SetTitle("Counts"); - PhiQ2Res->GetXaxis()->SetTitle("#phi_{Sim}-#phi_{TF}"); - PhiQ2Res->GetYaxis()->SetTitle("Counts"); - EtaQ2Res->GetXaxis()->SetTitle("#eta_{Sim}-#eta_{TF}"); - EtaQ2Res->GetYaxis()->SetTitle("Counts"); - - PtQ2ResGolden->GetXaxis()->SetTitle("Pt_{Sim}/Pt_{TF}-1"); - PtQ2ResGolden->GetYaxis()->SetTitle("Counts"); - PhiQ2ResGolden->GetXaxis()->SetTitle("#phi_{Sim}-#phi_{TF}"); - PhiQ2ResGolden->GetYaxis()->SetTitle("Counts"); - PtQ2ResHighEta->GetXaxis()->SetTitle("Pt_{Sim}/Pt_{TF}-1"); - PtQ2ResHighEta->GetYaxis()->SetTitle("Counts"); - PhiQ2ResHighEta->GetXaxis()->SetTitle("#phi_{Sim}-#phi_{TF}"); - PhiQ2ResHighEta->GetYaxis()->SetTitle("Counts"); - PtQ2ResOverlap->GetXaxis()->SetTitle("Pt_{Sim}/Pt_{TF}-1"); - PtQ2ResOverlap->GetYaxis()->SetTitle("Counts"); - PhiQ2ResOverlap->GetXaxis()->SetTitle("#phi_{Sim}-#phi_{TF}"); - PhiQ2ResOverlap->GetYaxis()->SetTitle("Counts"); +namespace csctf_analysis { + ResolutionHistogramList::ResolutionHistogramList(const std::string dirname, const edm::ParameterSet* parameters) { + TFileDirectory dir = fs->mkdir(dirname); + + double maxpt = parameters->getUntrackedParameter("MaxPtHist"); + double minpt = parameters->getUntrackedParameter("MinPtHist"); + int ptbins = parameters->getUntrackedParameter("BinsPtHist"); + + PtQ1Res = dir.make("PtQ1Res", "Pt Q>=1 Resolution", 300, -1.5, 1.5); + PtQ2Res = dir.make("PtQ2Res", "Pt Q>=2 Resolution", 300, -1.5, 1.5); + PtQ3Res = dir.make("PtQ3Res", "Pt Q>=3 Resolution", 300, -1.5, 1.5); + EtaQ1Res = dir.make("EtaQ1Res", "Eta Q>=1 Resolution", 1000, -1, 1); + EtaQ2Res = dir.make("EtaQ2Res", "Eta Q>=2 Resolution", 1000, -1, 1); + EtaQ3Res = dir.make("EtaQ3Res", "Eta Q>=3 Resolution", 1000, -1, 1); + PhiQ1Res = dir.make("PhiQ1Res", "Phi Q>=1 Resolution", 1000, -1, 1); + PhiQ2Res = dir.make("PhiQ2Res", "Phi Q>=2 Resolution", 1000, -1, 1); + PhiQ3Res = dir.make("PhiQ3Res", "Phi Q>=3 Resolution", 1000, -1, 1); + + PtQ2ResGolden = dir.make("PtQ2ResGolden", "Pt Q>=2 Resolution; 1.2 <= eta <= 2.1", 300, -1.5, 1.5); + PhiQ2ResGolden = dir.make("PhiQ2ResGolden", "Phi Q>=2 Resolution; 1.2 <= eta <= 2.1", 1000, -1, 1); + PtQ2ResHighEta = dir.make("PtQ2ResHighEta", "Pt Q>=2 Resolution; eta >= 2.1", 300, -1.5, 1.5); + PhiQ2ResHighEta = dir.make("PhiQ2ResHighEta", "Phi Q>=2 Resolution; eta >= 2.1", 1000, -1, 1); + PtQ2ResOverlap = dir.make("PtQ2ResOverlap", "Pt Q>=2 Resolution; eta <= 1.2", 300, -1.5, 1.5); + PhiQ2ResOverlap = dir.make("PhiQ2ResOverlap", "Phi Q>=2 Resolution; eta <= 1.2", 1000, -1, 1); + + PtQ2Res->GetXaxis()->SetTitle("Pt_{Sim}/Pt_{TF}-1"); + PtQ2Res->GetYaxis()->SetTitle("Counts"); + PhiQ2Res->GetXaxis()->SetTitle("#phi_{Sim}-#phi_{TF}"); + PhiQ2Res->GetYaxis()->SetTitle("Counts"); + EtaQ2Res->GetXaxis()->SetTitle("#eta_{Sim}-#eta_{TF}"); + EtaQ2Res->GetYaxis()->SetTitle("Counts"); + + PtQ2ResGolden->GetXaxis()->SetTitle("Pt_{Sim}/Pt_{TF}-1"); + PtQ2ResGolden->GetYaxis()->SetTitle("Counts"); + PhiQ2ResGolden->GetXaxis()->SetTitle("#phi_{Sim}-#phi_{TF}"); + PhiQ2ResGolden->GetYaxis()->SetTitle("Counts"); + PtQ2ResHighEta->GetXaxis()->SetTitle("Pt_{Sim}/Pt_{TF}-1"); + PtQ2ResHighEta->GetYaxis()->SetTitle("Counts"); + PhiQ2ResHighEta->GetXaxis()->SetTitle("#phi_{Sim}-#phi_{TF}"); + PhiQ2ResHighEta->GetYaxis()->SetTitle("Counts"); + PtQ2ResOverlap->GetXaxis()->SetTitle("Pt_{Sim}/Pt_{TF}-1"); + PtQ2ResOverlap->GetYaxis()->SetTitle("Counts"); + PhiQ2ResOverlap->GetXaxis()->SetTitle("#phi_{Sim}-#phi_{TF}"); + PhiQ2ResOverlap->GetYaxis()->SetTitle("Counts"); } - - void ResolutionHistogramList::FillResolutionHist( RefTrack refTrk, TFTrack tfTrk ) - { + void ResolutionHistogramList::FillResolutionHist(RefTrack refTrk, TFTrack tfTrk) { double ptResd = (refTrk.getPt() / tfTrk.getPt()) - 1; - double EtaResd = (refTrk.getEta() - tfTrk.getEta() ); - double PhiResd = (refTrk.getPhi() - tfTrk.getPhi() ); - - - if ( refTrk.getQuality() >= 1 ) - { - PhiQ1Res->Fill( PhiResd ); - EtaQ1Res->Fill( EtaResd ); - PtQ1Res->Fill( ptResd ); + double EtaResd = (refTrk.getEta() - tfTrk.getEta()); + double PhiResd = (refTrk.getPhi() - tfTrk.getPhi()); + + if (refTrk.quality() >= 1) { + PhiQ1Res->Fill(PhiResd); + EtaQ1Res->Fill(EtaResd); + PtQ1Res->Fill(ptResd); + } + if (refTrk.quality() >= 2) { + PhiQ2Res->Fill(PhiResd); + EtaQ2Res->Fill(EtaResd); + PtQ2Res->Fill(ptResd); + + double eta = refTrk.getEta(); + //Golden + if (eta <= 2.1 && eta >= 1.2) { + PhiQ2ResGolden->Fill(PhiResd); + PtQ2ResGolden->Fill(ptResd); } - if ( refTrk.getQuality() >= 2 ) - { - PhiQ2Res->Fill( PhiResd ); - EtaQ2Res->Fill( EtaResd ); - PtQ2Res->Fill( ptResd ); - double eta = refTrk.getEta(); - //Golden - if(eta <= 2.1 && eta >= 1.2) - { - PhiQ2ResGolden->Fill( PhiResd ); - PtQ2ResGolden->Fill( ptResd ); - } - - //High Eta - if(eta >= 2.1) - { - PhiQ2ResHighEta->Fill( PhiResd ); - PtQ2ResHighEta->Fill( ptResd ); - } - - //Overlap - if(eta <= 1.2) - { - PhiQ2ResOverlap->Fill( PhiResd ); - PtQ2ResOverlap->Fill( ptResd ); - } - - - } - if ( refTrk.getQuality() >= 3 ) - { - PhiQ3Res->Fill( PhiResd ); - EtaQ3Res->Fill( EtaResd ); - PtQ3Res->Fill( ptResd ); + //High Eta + if (eta >= 2.1) { + PhiQ2ResHighEta->Fill(PhiResd); + PtQ2ResHighEta->Fill(ptResd); } - - - - - + //Overlap + if (eta <= 1.2) { + PhiQ2ResOverlap->Fill(PhiResd); + PtQ2ResOverlap->Fill(ptResd); + } + } + if (refTrk.quality() >= 3) { + PhiQ3Res->Fill(PhiResd); + EtaQ3Res->Fill(EtaResd); + PtQ3Res->Fill(ptResd); + } } - void ResolutionHistogramList::Print() - { - TCanvas* PtRes = new TCanvas("PtRes"); - PtQ2Res->Draw(); - PtRes->Print("ResPt.png","png"); + void ResolutionHistogramList::Print() { + TCanvas* PtRes = new TCanvas("PtRes"); + PtQ2Res->Draw(); + PtRes->Print("ResPt.png", "png"); - TCanvas* PhiRes = new TCanvas("PhiRes"); - PhiQ2Res->Draw(); - PhiRes->Print("ResPhi.png","png"); + TCanvas* PhiRes = new TCanvas("PhiRes"); + PhiQ2Res->Draw(); + PhiRes->Print("ResPhi.png", "png"); - TCanvas* EtaRes = new TCanvas("EtaRes"); - EtaQ2Res->Draw(); - EtaRes->Print("ResEta.png","png"); + TCanvas* EtaRes = new TCanvas("EtaRes"); + EtaQ2Res->Draw(); + EtaRes->Print("ResEta.png", "png"); } -} - +} // namespace csctf_analysis diff --git a/L1Trigger/CSCTrackFinder/test/src/RunSRLUTs.cc b/L1Trigger/CSCTrackFinder/test/src/RunSRLUTs.cc index 5b1ab58ab709e..d2d93dfa50d1d 100644 --- a/L1Trigger/CSCTrackFinder/test/src/RunSRLUTs.cc +++ b/L1Trigger/CSCTrackFinder/test/src/RunSRLUTs.cc @@ -11,122 +11,97 @@ #include "L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h" -namespace csctf_analysis -{ -RunSRLUTs::RunSRLUTs() -{ - - //Set up SRLUTs +namespace csctf_analysis { + RunSRLUTs::RunSRLUTs() { + //Set up SRLUTs bool TMB07 = true; edm::ParameterSet srLUTset; - srLUTset.addUntrackedParameter("Binary",false); - srLUTset.addUntrackedParameter("ReadLUTs",false); - srLUTset.addUntrackedParameter("LUTPath","./"); - srLUTset.addUntrackedParameter("UseMiniLUTs",true); - int endcap=1; - int sector=1; - - for(int station=1,fpga=0; station<=4 && fpga<5; station++) - { - if(station==1) - for(int subSector=0; subSector<2 && fpga<5; subSector++) - srLUTs_[fpga++] = new CSCSectorReceiverLUT(endcap, sector, subSector+1, station, srLUTset, TMB07); - else - srLUTs_[fpga++] = new CSCSectorReceiverLUT(endcap, sector, 0, station, srLUTset, TMB07); + srLUTset.addUntrackedParameter("Binary", false); + srLUTset.addUntrackedParameter("ReadLUTs", false); + srLUTset.addUntrackedParameter("LUTPath", "./"); + srLUTset.addUntrackedParameter("UseMiniLUTs", true); + int endcap = 1; + int sector = 1; + + for (int station = 1, fpga = 0; station <= 4 && fpga < 5; station++) { + if (station == 1) + for (int subSector = 0; subSector < 2 && fpga < 5; subSector++) + srLUTs_[fpga++] = new CSCSectorReceiverLUT(endcap, sector, subSector + 1, station, srLUTset, TMB07); + else + srLUTs_[fpga++] = new CSCSectorReceiverLUT(endcap, sector, 0, station, srLUTset, TMB07); + } } + RunSRLUTs::~RunSRLUTs() {} + + void RunSRLUTs::run(std::vector *stub_list) { + //Assigning (global) eta and phi packed + for (std::vector::iterator itr = stub_list->begin(); itr != stub_list->end(); itr++) { + if (itr->station() != 5) { + CSCDetId id(itr->getDetId().rawId()); + unsigned fpga = (id.station() == 1) ? CSCTriggerNumbering::triggerSubSectorFromLabels(id) - 1 : id.station(); + + lclphidat lclPhi; + try { + lclPhi = srLUTs_[fpga]->localPhi(itr->strip(), itr->pattern(), itr->quality(), itr->bend()); + } catch (cms::Exception &e) { + bzero(&lclPhi, sizeof(lclPhi)); + } + + gblphidat gblPhi; + try { + gblPhi = srLUTs_[fpga]->globalPhiME(lclPhi.phi_local, itr->keyWireGroup(), itr->cscid()); + } catch (cms::Exception &e) { + bzero(&gblPhi, sizeof(gblPhi)); + } + + gbletadat gblEta; + try { + gblEta = + srLUTs_[fpga]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, itr->keyWireGroup(), itr->cscid()); + } catch (cms::Exception &e) { + bzero(&gblEta, sizeof(gblEta)); + } + + itr->setEtaPacked(gblEta.global_eta); + itr->setPhiPacked(gblPhi.global_phi); + } + } + } -} - -RunSRLUTs::~RunSRLUTs() -{ -} - -void RunSRLUTs::run(std::vector *stub_list) -{ - - //Assigning (global) eta and phi packed - for(std::vector::iterator itr=stub_list->begin(); itr!=stub_list->end(); itr++) - { - if(itr->station() != 5) - { - CSCDetId id(itr->getDetId().rawId()); - unsigned fpga = (id.station() == 1) ? CSCTriggerNumbering::triggerSubSectorFromLabels(id) - 1 : id.station(); - - lclphidat lclPhi; - try - { - lclPhi = srLUTs_[fpga]->localPhi(itr->getStrip(), itr->getPattern(), itr->getQuality(), itr->getBend()); - } - catch( cms::Exception &e ) - { - bzero(&lclPhi,sizeof(lclPhi)); - } - - gblphidat gblPhi; - try - { - gblPhi = srLUTs_[fpga]->globalPhiME(lclPhi.phi_local, itr->getKeyWG(), itr->cscid()); - } - catch( cms::Exception &e ) - { - bzero(&gblPhi,sizeof(gblPhi)); - } - - gbletadat gblEta; - try - { - gblEta = srLUTs_[fpga]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, itr->getKeyWG(), itr->cscid()); - } - catch( cms::Exception &e ) - { - bzero(&gblEta,sizeof(gblEta)); - } - - itr->setEtaPacked(gblEta.global_eta); - itr->setPhiPacked(gblPhi.global_phi); - } - } -} - -void RunSRLUTs::makeTrackStubs(const CSCCorrelatedLCTDigiCollection * inClcts,std::vector *outStubVec) -{ - - // Making a list of track stubs from lct collection - CSCCorrelatedLCTDigiCollection::DigiRangeIterator Citer; - for(Citer = inClcts->begin(); Citer != inClcts->end(); Citer++) - { - CSCCorrelatedLCTDigiCollection::const_iterator Diter = (*Citer).second.first; - CSCCorrelatedLCTDigiCollection::const_iterator Dend = (*Citer).second.second; - - for(; Diter != Dend; Diter++) - { - csctf::TrackStub theStub((*Diter),(*Citer).first); - outStubVec->push_back(theStub); - } - } - - run(outStubVec); -} - -void RunSRLUTs::makeAssociatedTrackStubs(const L1CSCTrackCollection * inTrackColl,TrackAndAssociatedStubsCollection *outTrkStubCol) -{ - L1CSCTrackCollection::const_iterator l1CSCTrack; - for (l1CSCTrack = inTrackColl->begin(); l1CSCTrack != inTrackColl->end(); l1CSCTrack++) - { - std::vector stubList; - - csc::L1Track track = l1CSCTrack->first; - CSCCorrelatedLCTDigiCollection clctDigiCol = l1CSCTrack->second; - - makeTrackStubs(&clctDigiCol,&stubList); - - //Addding Stubs and Track to l1TrackAndEasyStubs - TrackAndAssociatedStubs tempTrackAndStubs; - tempTrackAndStubs.first = track; - tempTrackAndStubs.second = stubList; - outTrkStubCol->push_back(tempTrackAndStubs); + void RunSRLUTs::makeTrackStubs(const CSCCorrelatedLCTDigiCollection *inClcts, + std::vector *outStubVec) { + // Making a list of track stubs from lct collection + CSCCorrelatedLCTDigiCollection::DigiRangeIterator Citer; + for (Citer = inClcts->begin(); Citer != inClcts->end(); Citer++) { + CSCCorrelatedLCTDigiCollection::const_iterator Diter = (*Citer).second.first; + CSCCorrelatedLCTDigiCollection::const_iterator Dend = (*Citer).second.second; + + for (; Diter != Dend; Diter++) { + csctf::TrackStub theStub((*Diter), (*Citer).first); + outStubVec->push_back(theStub); + } + } + + run(outStubVec); } -} -} + void RunSRLUTs::makeAssociatedTrackStubs(const L1CSCTrackCollection *inTrackColl, + TrackAndAssociatedStubsCollection *outTrkStubCol) { + L1CSCTrackCollection::const_iterator l1CSCTrack; + for (l1CSCTrack = inTrackColl->begin(); l1CSCTrack != inTrackColl->end(); l1CSCTrack++) { + std::vector stubList; + + csc::L1Track track = l1CSCTrack->first; + CSCCorrelatedLCTDigiCollection clctDigiCol = l1CSCTrack->second; + + makeTrackStubs(&clctDigiCol, &stubList); + + //Addding Stubs and Track to l1TrackAndEasyStubs + TrackAndAssociatedStubs tempTrackAndStubs; + tempTrackAndStubs.first = track; + tempTrackAndStubs.second = stubList; + outTrkStubCol->push_back(tempTrackAndStubs); + } + } +} // namespace csctf_analysis diff --git a/L1Trigger/CSCTrackFinder/test/src/TFTrack.h b/L1Trigger/CSCTrackFinder/test/src/TFTrack.h index 11399f20020ce..71be66b10848b 100644 --- a/L1Trigger/CSCTrackFinder/test/src/TFTrack.h +++ b/L1Trigger/CSCTrackFinder/test/src/TFTrack.h @@ -17,48 +17,52 @@ #include -namespace csctf_analysis -{ - class TFTrack : public Track - { - public: - TFTrack(); - TFTrack(const L1MuRegionalCand& track); - TFTrack(const L1CSCTrack& track, const edm::EventSetup& iSetup ); - TFTrack(L1MuGMTExtendedCand track); -// double distanceTo(RefTrack* reftrack); - void print(); - double getPt() const {return Pt;}; - double getPhi() const {return Phi;}; - double getEta() const {return Eta;}; - double getTFPt() const {return Pt;}; - double getRank() const {return Rank;}; - int getMode() const {return Mode;}; - int getPtPacked() const {return PtPacked;}; - int getEtaPacked() const {return EtaPacked;}; - int getPhiPacked() const {return PhiPacked;}; - int getChargePacked() const {return ChargePacked;}; - int getFR() const {return FR;}; - int getBX() const {return Bx;}; - int getLUTAddress() const {return LUTAddress;} - int getEndcap() const {if(isEndcap1==true){return 1;} else{return 2;}} - //added by josh and nathaniel - private: - float Pt; - double Phi; - double Eta; - int PtPacked; - int EtaPacked; - int PhiPacked; - int ChargePacked; - int Bx; - int Charge; - int Halo; - int Mode; - int Rank; - int FR; - int LUTAddress; - bool isEndcap1; +namespace csctf_analysis { + class TFTrack : public Track { + public: + TFTrack(); + TFTrack(const L1MuRegionalCand& track); + TFTrack(const L1CSCTrack& track, const edm::EventSetup& iSetup); + TFTrack(L1MuGMTExtendedCand track); + // double distanceTo(RefTrack* reftrack); + void print(); + double getPt() const { return Pt; }; + double getPhi() const { return Phi; }; + double getEta() const { return Eta; }; + double getTFPt() const { return Pt; }; + double getRank() const { return Rank; }; + int getMode() const { return Mode; }; + int getPtPacked() const { return PtPacked; }; + int getEtaPacked() const { return EtaPacked; }; + int getPhiPacked() const { return PhiPacked; }; + int getChargePacked() const { return ChargePacked; }; + int getFR() const { return FR; }; + int bx() const { return Bx; }; + int getLUTAddress() const { return LUTAddress; } + int getEndcap() const { + if (isEndcap1 == true) { + return 1; + } else { + return 2; + } + } + //added by josh and nathaniel + private: + float Pt; + double Phi; + double Eta; + int PtPacked; + int EtaPacked; + int PhiPacked; + int ChargePacked; + int Bx; + int Charge; + int Halo; + int Mode; + int Rank; + int FR; + int LUTAddress; + bool isEndcap1; }; -} +} // namespace csctf_analysis #endif diff --git a/L1Trigger/CSCTrackFinder/test/src/Track.cc b/L1Trigger/CSCTrackFinder/test/src/Track.cc index 2a0f6582c8527..cd10875fe15ef 100644 --- a/L1Trigger/CSCTrackFinder/test/src/Track.cc +++ b/L1Trigger/CSCTrackFinder/test/src/Track.cc @@ -1,472 +1,385 @@ #include "L1Trigger/CSCTrackFinder/test/src/Track.h" #include using namespace std; -namespace csctf_analysis -{ -Track::Track() -{ - matched = false; - matchedIndex = -1; - R = 20; - ghost = false; - TFPt=-1; - Quality=-1; - ghostMatchedToIndex = new std::vector; - ghostR = new std::vector; - ghostQ = new std::vector; -} -Track::Track(const Track& track) -{ - ghostMatchedToIndex = new std::vector; - ghostR = new std::vector; - ghostQ = new std::vector; - *ghostMatchedToIndex= *track.ghostMatchedToIndex; - *ghostR = *track.ghostR; - *ghostQ = *track.ghostQ; - matched=track.matched; - matchedIndex=track.matchedIndex; - R=track.R; - histlist=track.histlist; - ghost=track.ghost; - Quality=track.Quality; - TFPt=track.TFPt; -} -Track::~Track() -{ - delete ghostMatchedToIndex; - delete ghostR; - delete ghostQ; -} -void Track::matchedTo(int i, double newR) -{ - if(matched==false || newRsize(); - if(param == 'Q') - { - for(int i=0;iat(i)< ghostQ->at(loseindex)) - { - loseindex=i; - } - } - } - else if(param == 'R') - { - for(int i=0;iat(i)>ghostR->at(loseindex)) - { - loseindex=i; - } - } - } - else - { - std::cout <<"\nChoose Q or R for ghost Candidate parameter!!!\n"; - } - ghostMatchedToIndex->erase(ghostMatchedToIndex->begin()+loseindex); - ghostQ->erase(ghostQ->begin()+loseindex); - ghostR->erase(ghostR->begin()+loseindex); -} -void Track::fillSimvTFHist(const Track& simtrack, const Track& tftrack) const -{ - double simfabsEta=fabs(simtrack.getEta()); - double simpt=simtrack.getPt(); - double tfpt=tftrack.getPt(); - if(simfabsEta>=0.9) - { - histlist->SimPt_vs_TFPt_FWD->Fill(simpt,tfpt); - } - if(simfabsEta<=0.9) - { - histlist->SimPt_vs_TFPt_DT->Fill(simpt,tfpt); - } -} -void Track::fillHist() -{ - int qual=getQuality(); - double pt=getPt(); - double mode=getMode(); - double fabsEta=fabs(getEta()); - - - //for phi mod 10 deg histograms - double phi_deg=getPhi()*180/3.1415927; - double result=phi_deg-5; - if(result<0) {result+=360;} - while(result>=10){result-=10.0;} - double phi_bar=result; - +namespace csctf_analysis { + Track::Track() { + matched = false; + matchedIndex = -1; + R = 20; + ghost = false; + TFPt = -1; + Quality = -1; + ghostMatchedToIndex = new std::vector; + ghostR = new std::vector; + ghostQ = new std::vector; + } + Track::Track(const Track& track) { + ghostMatchedToIndex = new std::vector; + ghostR = new std::vector; + ghostQ = new std::vector; + *ghostMatchedToIndex = *track.ghostMatchedToIndex; + *ghostR = *track.ghostR; + *ghostQ = *track.ghostQ; + matched = track.matched; + matchedIndex = track.matchedIndex; + R = track.R; + histlist = track.histlist; + ghost = track.ghost; + Quality = track.Quality; + TFPt = track.TFPt; + } + Track::~Track() { + delete ghostMatchedToIndex; + delete ghostR; + delete ghostQ; + } + void Track::matchedTo(int i, double newR) { + if (matched == false || newR < R) { + matched = true; + R = newR; + matchedIndex = i; + } + } + void Track::unMatch() { + matched = false; + matchedIndex = -1; + R = 20; + TFPt = -1; + Quality = -1; + } + void Track::loseBestGhostCand(std::string param) { + int loseindex = 0; + int size = ghostMatchedToIndex->size(); + if (param == 'Q') { + for (int i = 0; i < size; i++) { + if (ghostQ->at(i) < ghostQ->at(loseindex)) { + loseindex = i; + } + } + } else if (param == 'R') { + for (int i = 0; i < size; i++) { + if (ghostR->at(i) > ghostR->at(loseindex)) { + loseindex = i; + } + } + } else { + std::cout << "\nChoose Q or R for ghost Candidate parameter!!!\n"; + } + ghostMatchedToIndex->erase(ghostMatchedToIndex->begin() + loseindex); + ghostQ->erase(ghostQ->begin() + loseindex); + ghostR->erase(ghostR->begin() + loseindex); + } + void Track::fillSimvTFHist(const Track& simtrack, const Track& tftrack) const { + double simfabsEta = fabs(simtrack.getEta()); + double simpt = simtrack.getPt(); + double tfpt = tftrack.getPt(); + if (simfabsEta >= 0.9) { + histlist->SimPt_vs_TFPt_FWD->Fill(simpt, tfpt); + } + if (simfabsEta <= 0.9) { + histlist->SimPt_vs_TFPt_DT->Fill(simpt, tfpt); + } + } + void Track::fillHist() { + int qual = quality(); + double pt = getPt(); + double mode = getMode(); + double fabsEta = fabs(getEta()); - histlist->Eta->Fill(fabsEta); - histlist->signedEta->Fill(getEta()); + //for phi mod 10 deg histograms + double phi_deg = getPhi() * 180 / 3.1415927; + double result = phi_deg - 5; + if (result < 0) { + result += 360; + } + while (result >= 10) { + result -= 10.0; + } + double phi_bar = result; - histlist->Phi->Fill(getPhi()); + histlist->Eta->Fill(fabsEta); + histlist->signedEta->Fill(getEta()); + histlist->Phi->Fill(getPhi()); - if(getEta()>0.9 && getEta()<2.4) - { - histlist->Phi_mod_10_endcap1->Fill(phi_bar); - } - if(getEta()<-0.9 && getEta()>-2.4) - { - histlist->Phi_mod_10_endcap2->Fill(phi_bar); - } - histlist->Pt->Fill(pt); - histlist->Pz->Fill(getPz()); - histlist->P->Fill(getP()); - histlist->Radius->Fill(getRadius()); - histlist->Quality->Fill(qual); - histlist->modeOcc->Fill(mode); - histlist->BX->Fill(getBX()); - histlist->FR->Fill(getFR()); - histlist->ptDenOverall->Fill(pt); + if (getEta() > 0.9 && getEta() < 2.4) { + histlist->Phi_mod_10_endcap1->Fill(phi_bar); + } + if (getEta() < -0.9 && getEta() > -2.4) { + histlist->Phi_mod_10_endcap2->Fill(phi_bar); + } + histlist->Pt->Fill(pt); + histlist->Pz->Fill(getPz()); + histlist->P->Fill(getP()); + histlist->Radius->Fill(getRadius()); + histlist->Quality->Fill(qual); + histlist->modeOcc->Fill(mode); + histlist->BX->Fill(bx()); + histlist->FR->Fill(getFR()); + histlist->ptDenOverall->Fill(pt); - //DT Region - if( fabsEta >= 0 && fabsEta <= 0.9 )// getEta() changed to fabsEta - { - histlist->ptDenDTOnly->Fill(pt); - //histlist->fidPtDen->Fill(pt); - histlist->modeOccDT->Fill(mode); - } - //CSC Only - if( fabsEta >= 1.2 && fabsEta <= 2.4) - { - histlist->ptDenCSCOnly->Fill(pt); - histlist->modeOccCSCOnly->Fill(mode); - } - //CSC Restricted - if( fabsEta >= 1.2 && fabsEta <= 2.1) - { - histlist->ptDenCSCRestricted->Fill(pt); - } - //Overlap - if( fabsEta <= 1.2 && fabsEta >= 0.9) - { - histlist->ptDenOverlap->Fill(pt); - histlist->modeOccOverlap->Fill(mode); - } - if(fabsEta >= 2.1) - { - histlist->ptDenHighEta->Fill(pt); - histlist->modeOccHighEta->Fill(mode); - } -} -void Track::fillMatchHist() -{ - int i=0; - int qual=getQuality(); - double tfpt=getTFPt(); - double simpt=getPt(); - double mode=getMode(); - double fabsEta = fabs(getEta()); - double phi_deg = getPhi()*180/3.1415926; - double result=phi_deg-5; - if(result<0) - { - result+=360; - } - while(result>=10) - { - result-=10.0; - i++; - } - double phi_bar=result; - if(fabsEta>=0.9) - { - histlist->matchedRefPt_FWD->Fill(simpt); - } - if(fabsEta<=0.9) - { - histlist->matchedRefPt_DT->Fill(simpt); - } - histlist->matchEta->Fill(fabsEta); - histlist->signedMatchEta->Fill(getEta()); - histlist->matchPhi->Fill(getPhi()); - histlist->matchRadius->Fill(getRadius()); - histlist->matchMode->Fill(mode); - if(qual>0) - { - histlist->EtaQ1->Fill(fabsEta); - histlist->signedEtaQ1->Fill(getEta()); - histlist->PhiQ1->Fill(getPhi()); - histlist->PtQ1->Fill(simpt); - } - if(qual>1) - { - histlist->EtaQ2->Fill(fabsEta); - histlist->signedEtaQ2->Fill(getEta()); - histlist->PhiQ2->Fill(getPhi()); - histlist->PtQ2->Fill(simpt); - if(getEta()>0.9&&getEta()<2.4) - { - histlist->matchPhi_mod_10_Q2_endcap1->Fill(phi_bar); - } - if(getEta()<-0.9&&getEta()>-2.4) - { - histlist->matchPhi_mod_10_Q2_endcap2->Fill(phi_bar); - } - } - if(qual>2) - { - histlist->EtaQ3->Fill(fabsEta); - histlist->signedEtaQ3->Fill(getEta()); - histlist->PhiQ3->Fill(getPhi()); - histlist->PtQ3->Fill(simpt); - if(getEta()>0.9 && getEta()<2.4) - { - histlist->matchPhi_mod_10_Q3_endcap1->Fill(phi_bar); - } - if(getEta()<-0.9 && getEta()>-2.4) - { - histlist->matchPhi_mod_10_Q3_endcap2->Fill(phi_bar); - } - } - /////////////////////////// - // Section filling pt - /////////////////////////// - //Overall - - if(qual>1) - { - histlist->matchPtOverall->Fill(simpt); - if (tfpt>10) - { - histlist->matchTFPt10Overall->Fill(simpt); - } - if (tfpt>12) - { - histlist->matchTFPt12Overall->Fill(simpt); - } - if (tfpt>16) - { - histlist->matchTFPt16Overall->Fill(simpt); - } - if (tfpt>20) - { - histlist->matchTFPt20Overall->Fill(simpt); - } - if (tfpt>40) - { - histlist->matchTFPt40Overall->Fill(simpt); - } - if (tfpt>60) - { - histlist->matchTFPt60Overall->Fill(simpt); - } - } - //DT Region - if(fabsEta>=0&&fabsEta<=0.9&&qual>1) - { - //histlist->matchPt->Fill(simpt); - histlist->matchPtDTOnly->Fill(simpt); - if (tfpt>10) - { - histlist->matchTFPt10DTOnly->Fill(simpt); - } - if (tfpt>12) - { - histlist->matchTFPt12DTOnly->Fill(simpt); - } - if (tfpt>16) - { - histlist->matchTFPt16DTOnly->Fill(simpt); - } - if (tfpt>20) - { - histlist->matchTFPt20DTOnly->Fill(simpt); - } - if (tfpt>40) - { - histlist->matchTFPt40DTOnly->Fill(simpt); - } - if (tfpt>60) - { - histlist->matchTFPt60DTOnly->Fill(simpt); - } - } - //CSC Only - if(fabsEta>=1.2&&fabsEta<=2.4&&qual>1) - { - histlist->matchPtCSCOnly->Fill(simpt); - if (tfpt>10) - { - histlist->matchTFPt10CSCOnly->Fill(simpt); - } - if (tfpt>12) - { - histlist->matchTFPt12CSCOnly->Fill(simpt); - } - if (tfpt>16) - { - histlist->matchTFPt16CSCOnly->Fill(simpt); - } - if (tfpt>20) - { - histlist->matchTFPt20CSCOnly->Fill(simpt); - } - if (tfpt>40) - { - histlist->matchTFPt40CSCOnly->Fill(simpt); - } - if (tfpt>60) - { - histlist->matchTFPt60CSCOnly->Fill(simpt); - } - } - //CSC Restricted - if(fabsEta>=1.2&&fabsEta<=2.1&&qual>1) - { - histlist->matchPtCSCRestricted->Fill(simpt); - if (tfpt>10) - { - histlist->matchTFPt10CSCRestricted->Fill(simpt); - } - if (tfpt>12) - { - histlist->matchTFPt12CSCRestricted->Fill(simpt); - } - if (tfpt>16) - { - histlist->matchTFPt16CSCRestricted->Fill(simpt); - } - if (tfpt>20) - { - histlist->matchTFPt20CSCRestricted->Fill(simpt); - } - if (tfpt>40) - { - histlist->matchTFPt40CSCRestricted->Fill(simpt); - } - if (tfpt>60) - { - histlist->matchTFPt60CSCRestricted->Fill(simpt); - } - } - //Overlap - if(fabsEta<=1.2&&fabsEta>=0.9&&qual>1) - { - histlist->matchPtOverlap->Fill(simpt); - if (tfpt>10) - { - histlist->matchTFPt10Overlap->Fill(simpt); - } - if (tfpt>12) - { - histlist->matchTFPt12Overlap->Fill(simpt); - } - if (tfpt>16) - { - histlist->matchTFPt16Overlap->Fill(simpt); - } - if (tfpt>20) - { - histlist->matchTFPt20Overlap->Fill(simpt); - } - if (tfpt>40) - { - histlist->matchTFPt40Overlap->Fill(simpt); - } - if (tfpt>60) - { - histlist->matchTFPt60Overlap->Fill(simpt); - } - } - //High Eta - if(fabsEta>=2.1&&qual>1) - { - histlist->matchPtHighEta->Fill(simpt); - if (tfpt>10) - { - histlist->matchTFPt10HighEta->Fill(simpt); - } - if (tfpt>12) - { - histlist->matchTFPt12HighEta->Fill(simpt); - } - if (tfpt>16) - { - histlist->matchTFPt16HighEta->Fill(simpt); - } - if (tfpt>20) - { - histlist->matchTFPt20HighEta->Fill(simpt); - } - if (tfpt>40) - { - histlist->matchTFPt40HighEta->Fill(simpt); - } - if (tfpt>60) - { - histlist->matchTFPt60HighEta->Fill(simpt); - } - } - -} - void Track::fillGhostHist() -{ - int qual=getQuality(); - double Eta=getEta(); - double fabsEta=fabs(Eta); - double simpt=getPt(); - double Phi=getPhi(); - histlist->ghostEta->Fill(fabsEta); - histlist->ghostSignedEta->Fill(Eta); - histlist->ghostPhi->Fill(Phi); - histlist->ghostPt->Fill(simpt); - histlist->ghostRadius->Fill(getRadius()); - //histlist->ghostQuality->Fill(qual); + //DT Region + if (fabsEta >= 0 && fabsEta <= 0.9) // getEta() changed to fabsEta + { + histlist->ptDenDTOnly->Fill(pt); + //histlist->fidPtDen->Fill(pt); + histlist->modeOccDT->Fill(mode); + } + //CSC Only + if (fabsEta >= 1.2 && fabsEta <= 2.4) { + histlist->ptDenCSCOnly->Fill(pt); + histlist->modeOccCSCOnly->Fill(mode); + } + //CSC Restricted + if (fabsEta >= 1.2 && fabsEta <= 2.1) { + histlist->ptDenCSCRestricted->Fill(pt); + } + //Overlap + if (fabsEta <= 1.2 && fabsEta >= 0.9) { + histlist->ptDenOverlap->Fill(pt); + histlist->modeOccOverlap->Fill(mode); + } + if (fabsEta >= 2.1) { + histlist->ptDenHighEta->Fill(pt); + histlist->modeOccHighEta->Fill(mode); + } + } + void Track::fillMatchHist() { + int i = 0; + int qual = quality(); + double tfpt = getTFPt(); + double simpt = getPt(); + double mode = getMode(); + double fabsEta = fabs(getEta()); + double phi_deg = getPhi() * 180 / 3.1415926; + double result = phi_deg - 5; + if (result < 0) { + result += 360; + } + while (result >= 10) { + result -= 10.0; + i++; + } + double phi_bar = result; + if (fabsEta >= 0.9) { + histlist->matchedRefPt_FWD->Fill(simpt); + } + if (fabsEta <= 0.9) { + histlist->matchedRefPt_DT->Fill(simpt); + } + histlist->matchEta->Fill(fabsEta); + histlist->signedMatchEta->Fill(getEta()); + histlist->matchPhi->Fill(getPhi()); + histlist->matchRadius->Fill(getRadius()); + histlist->matchMode->Fill(mode); + if (qual > 0) { + histlist->EtaQ1->Fill(fabsEta); + histlist->signedEtaQ1->Fill(getEta()); + histlist->PhiQ1->Fill(getPhi()); + histlist->PtQ1->Fill(simpt); + } + if (qual > 1) { + histlist->EtaQ2->Fill(fabsEta); + histlist->signedEtaQ2->Fill(getEta()); + histlist->PhiQ2->Fill(getPhi()); + histlist->PtQ2->Fill(simpt); + if (getEta() > 0.9 && getEta() < 2.4) { + histlist->matchPhi_mod_10_Q2_endcap1->Fill(phi_bar); + } + if (getEta() < -0.9 && getEta() > -2.4) { + histlist->matchPhi_mod_10_Q2_endcap2->Fill(phi_bar); + } + } + if (qual > 2) { + histlist->EtaQ3->Fill(fabsEta); + histlist->signedEtaQ3->Fill(getEta()); + histlist->PhiQ3->Fill(getPhi()); + histlist->PtQ3->Fill(simpt); + if (getEta() > 0.9 && getEta() < 2.4) { + histlist->matchPhi_mod_10_Q3_endcap1->Fill(phi_bar); + } + if (getEta() < -0.9 && getEta() > -2.4) { + histlist->matchPhi_mod_10_Q3_endcap2->Fill(phi_bar); + } + } + /////////////////////////// + // Section filling pt + /////////////////////////// + //Overall - if (qual>0) - { - histlist->ghostEtaQ1->Fill(fabsEta); - histlist->ghostSignedEtaQ1->Fill(Eta); - histlist->ghostPhiQ1->Fill(Phi); - histlist->ghostPtQ1->Fill(simpt); - } - if (qual>1) - { - histlist->ghostEtaQ2->Fill(fabsEta); - histlist->ghostSignedEtaQ2->Fill(Eta); - histlist->ghostPhiQ2->Fill(Phi); - histlist->ghostPtQ2->Fill(simpt); - } - if (qual>2) - { - histlist->ghostEtaQ3->Fill(fabsEta); - histlist->ghostSignedEtaQ3->Fill(Eta); - histlist->ghostPhiQ3->Fill(Phi); - histlist->ghostPtQ3->Fill(simpt); + if (qual > 1) { + histlist->matchPtOverall->Fill(simpt); + if (tfpt > 10) { + histlist->matchTFPt10Overall->Fill(simpt); + } + if (tfpt > 12) { + histlist->matchTFPt12Overall->Fill(simpt); + } + if (tfpt > 16) { + histlist->matchTFPt16Overall->Fill(simpt); + } + if (tfpt > 20) { + histlist->matchTFPt20Overall->Fill(simpt); + } + if (tfpt > 40) { + histlist->matchTFPt40Overall->Fill(simpt); + } + if (tfpt > 60) { + histlist->matchTFPt60Overall->Fill(simpt); + } + } + //DT Region + if (fabsEta >= 0 && fabsEta <= 0.9 && qual > 1) { + //histlist->matchPt->Fill(simpt); + histlist->matchPtDTOnly->Fill(simpt); + if (tfpt > 10) { + histlist->matchTFPt10DTOnly->Fill(simpt); + } + if (tfpt > 12) { + histlist->matchTFPt12DTOnly->Fill(simpt); + } + if (tfpt > 16) { + histlist->matchTFPt16DTOnly->Fill(simpt); + } + if (tfpt > 20) { + histlist->matchTFPt20DTOnly->Fill(simpt); + } + if (tfpt > 40) { + histlist->matchTFPt40DTOnly->Fill(simpt); + } + if (tfpt > 60) { + histlist->matchTFPt60DTOnly->Fill(simpt); + } + } + //CSC Only + if (fabsEta >= 1.2 && fabsEta <= 2.4 && qual > 1) { + histlist->matchPtCSCOnly->Fill(simpt); + if (tfpt > 10) { + histlist->matchTFPt10CSCOnly->Fill(simpt); } + if (tfpt > 12) { + histlist->matchTFPt12CSCOnly->Fill(simpt); + } + if (tfpt > 16) { + histlist->matchTFPt16CSCOnly->Fill(simpt); + } + if (tfpt > 20) { + histlist->matchTFPt20CSCOnly->Fill(simpt); + } + if (tfpt > 40) { + histlist->matchTFPt40CSCOnly->Fill(simpt); + } + if (tfpt > 60) { + histlist->matchTFPt60CSCOnly->Fill(simpt); + } + } + //CSC Restricted + if (fabsEta >= 1.2 && fabsEta <= 2.1 && qual > 1) { + histlist->matchPtCSCRestricted->Fill(simpt); + if (tfpt > 10) { + histlist->matchTFPt10CSCRestricted->Fill(simpt); + } + if (tfpt > 12) { + histlist->matchTFPt12CSCRestricted->Fill(simpt); + } + if (tfpt > 16) { + histlist->matchTFPt16CSCRestricted->Fill(simpt); + } + if (tfpt > 20) { + histlist->matchTFPt20CSCRestricted->Fill(simpt); + } + if (tfpt > 40) { + histlist->matchTFPt40CSCRestricted->Fill(simpt); + } + if (tfpt > 60) { + histlist->matchTFPt60CSCRestricted->Fill(simpt); + } + } + //Overlap + if (fabsEta <= 1.2 && fabsEta >= 0.9 && qual > 1) { + histlist->matchPtOverlap->Fill(simpt); + if (tfpt > 10) { + histlist->matchTFPt10Overlap->Fill(simpt); + } + if (tfpt > 12) { + histlist->matchTFPt12Overlap->Fill(simpt); + } + if (tfpt > 16) { + histlist->matchTFPt16Overlap->Fill(simpt); + } + if (tfpt > 20) { + histlist->matchTFPt20Overlap->Fill(simpt); + } + if (tfpt > 40) { + histlist->matchTFPt40Overlap->Fill(simpt); + } + if (tfpt > 60) { + histlist->matchTFPt60Overlap->Fill(simpt); + } + } + //High Eta + if (fabsEta >= 2.1 && qual > 1) { + histlist->matchPtHighEta->Fill(simpt); + if (tfpt > 10) { + histlist->matchTFPt10HighEta->Fill(simpt); + } + if (tfpt > 12) { + histlist->matchTFPt12HighEta->Fill(simpt); + } + if (tfpt > 16) { + histlist->matchTFPt16HighEta->Fill(simpt); + } + if (tfpt > 20) { + histlist->matchTFPt20HighEta->Fill(simpt); + } + if (tfpt > 40) { + histlist->matchTFPt40HighEta->Fill(simpt); + } + if (tfpt > 60) { + histlist->matchTFPt60HighEta->Fill(simpt); + } + } } - void Track::fillRateHist() - { - double pt=getPt()+0.001; //addition of 0.001 is to ensure the Pt is not on the border of a bin- which causes problems with the iterative stepping through bins - double stepPt=histlist->getPtStep(); - - for(double threshold=pt;threshold>=-1;threshold-=stepPt) - { - histlist->rateHist->Fill(threshold); - } - - + void Track::fillGhostHist() { + int qual = quality(); + double Eta = getEta(); + double fabsEta = fabs(Eta); + double simpt = getPt(); + double Phi = getPhi(); + histlist->ghostEta->Fill(fabsEta); + histlist->ghostSignedEta->Fill(Eta); + histlist->ghostPhi->Fill(Phi); + histlist->ghostPt->Fill(simpt); + histlist->ghostRadius->Fill(getRadius()); + //histlist->ghostQuality->Fill(qual); + + if (qual > 0) { + histlist->ghostEtaQ1->Fill(fabsEta); + histlist->ghostSignedEtaQ1->Fill(Eta); + histlist->ghostPhiQ1->Fill(Phi); + histlist->ghostPtQ1->Fill(simpt); + } + if (qual > 1) { + histlist->ghostEtaQ2->Fill(fabsEta); + histlist->ghostSignedEtaQ2->Fill(Eta); + histlist->ghostPhiQ2->Fill(Phi); + histlist->ghostPtQ2->Fill(simpt); + } + if (qual > 2) { + histlist->ghostEtaQ3->Fill(fabsEta); + histlist->ghostSignedEtaQ3->Fill(Eta); + histlist->ghostPhiQ3->Fill(Phi); + histlist->ghostPtQ3->Fill(simpt); + } + } + void Track::fillRateHist() { + double pt = + getPt() + + 0.001; //addition of 0.001 is to ensure the Pt is not on the border of a bin- which causes problems with the iterative stepping through bins + double stepPt = histlist->getPtStep(); + + for (double threshold = pt; threshold >= -1; threshold -= stepPt) { + histlist->rateHist->Fill(threshold); + } } -} +} // namespace csctf_analysis diff --git a/L1Trigger/CSCTrackFinder/test/src/Track.h b/L1Trigger/CSCTrackFinder/test/src/Track.h index 67b1a1a4de575..4b9886d54bbd8 100644 --- a/L1Trigger/CSCTrackFinder/test/src/Track.h +++ b/L1Trigger/CSCTrackFinder/test/src/Track.h @@ -7,68 +7,61 @@ #include "L1Trigger/CSCTrackFinder/test/src/TrackHistogramList.h" -namespace csctf_analysis -{ - class Track - { - public: - Track(); - virtual ~Track(); - Track(const Track& track); - virtual void print() {}; - virtual void matchedTo(int i, double newR); - virtual void unMatch(); - virtual void setHistList(TrackHistogramList* histolist) - { - histlist=histolist; - }; - virtual void fillHist(); - virtual void fillMatchHist(); - //virtual void ghostMatchedTo(int i, double newR); - virtual bool getGhost() const {return ghost;}; - virtual void loseBestGhostCand(std::string param); - virtual std::vector* ghostMatchedIndecies()const - { - return ghostMatchedToIndex; - }; - virtual void fillGhostHist(); - virtual double getPt() const {return 0;}; - virtual double getPhi() const {return 0;}; - virtual double getEta() const {return 0;}; - virtual int getQuality() const {return Quality;}; - virtual double getP() const {return 0;}; - virtual double getPz() const {return 0;}; - virtual double getRadius() const {return 0;}; - virtual bool getMatched() const {return matched;}; - virtual bool getMatchedIndex() const {return matchedIndex;}; - virtual double getR() const {return R;}; - virtual double getTFPt() const {return TFPt;}; - virtual void setTFPt(const double Pt) {TFPt=Pt;}; - virtual void setQuality(const int Q) {Quality=Q;}; - virtual int getMode() const {return -1;};//Added by nathaniel - virtual double getRank() const {return -1;}; - virtual int getPtPacked() const {return -1;}; - virtual int getEtaPacked() const {return -1;}; - virtual int getPhiPacked() const {return -1;}; - virtual int getChargePacked() const {return -1;}; - virtual int getFR() const {return -1;}; - virtual int getBX() const {return -1;}; - virtual int getLUTAddress() const {return -1;}; - virtual void fillSimvTFHist(const Track& simtrack, const Track& tftrack) const; - virtual void fillRateHist(); +namespace csctf_analysis { + class Track { + public: + Track(); + virtual ~Track(); + Track(const Track& track); + virtual void print(){}; + virtual void matchedTo(int i, double newR); + virtual void unMatch(); + virtual void setHistList(TrackHistogramList* histolist) { histlist = histolist; }; + virtual void fillHist(); + virtual void fillMatchHist(); + //virtual void ghostMatchedTo(int i, double newR); + virtual bool getGhost() const { return ghost; }; + virtual void loseBestGhostCand(std::string param); + virtual std::vector* ghostMatchedIndecies() const { return ghostMatchedToIndex; }; + virtual void fillGhostHist(); + virtual double getPt() const { return 0; }; + virtual double getPhi() const { return 0; }; + virtual double getEta() const { return 0; }; + virtual int quality() const { return Quality; }; + virtual double getP() const { return 0; }; + virtual double getPz() const { return 0; }; + virtual double getRadius() const { return 0; }; + virtual bool getMatched() const { return matched; }; + virtual bool getMatchedIndex() const { return matchedIndex; }; + virtual double getR() const { return R; }; + virtual double getTFPt() const { return TFPt; }; + virtual void setTFPt(const double Pt) { TFPt = Pt; }; + virtual void setQuality(const int Q) { Quality = Q; }; + virtual int getMode() const { return -1; }; //Added by nathaniel + virtual double getRank() const { return -1; }; + virtual int getPtPacked() const { return -1; }; + virtual int getEtaPacked() const { return -1; }; + virtual int getPhiPacked() const { return -1; }; + virtual int getChargePacked() const { return -1; }; + virtual int getFR() const { return -1; }; + virtual int bx() const { return -1; }; + virtual int getLUTAddress() const { return -1; }; + virtual void fillSimvTFHist(const Track& simtrack, const Track& tftrack) const; + virtual void fillRateHist(); - private: - TrackHistogramList* histlist; - protected: - int matchedIndex; - double R; - bool matched; - int Quality; - double TFPt; - bool ghost; - std::vector* ghostMatchedToIndex; - std::vector* ghostR; - std::vector* ghostQ; + private: + TrackHistogramList* histlist; + + protected: + int matchedIndex; + double R; + bool matched; + int Quality; + double TFPt; + bool ghost; + std::vector* ghostMatchedToIndex; + std::vector* ghostR; + std::vector* ghostQ; }; -} +} // namespace csctf_analysis #endif From 8a07dec679a658ab2389aacbd23140fff99f0fe6 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sat, 9 May 2020 10:11:44 -0500 Subject: [PATCH 07/12] CMS code rules for CSC TPs --- DataFormats/CSCDigi/interface/CSCALCTDigi.h | 16 +-- .../CSCDigi/interface/CSCALCTPreTriggerDigi.h | 14 +- DataFormats/CSCDigi/interface/CSCCLCTDigi.h | 26 ++-- .../CSCDigi/interface/CSCCLCTPreTriggerDigi.h | 20 +-- .../CSCDigi/interface/CSCCorrelatedLCTDigi.h | 88 ++++++------- DataFormats/CSCDigi/src/CSCALCTDigi.cc | 35 +++-- .../CSCDigi/src/CSCALCTPreTriggerDigi.cc | 30 ++--- DataFormats/CSCDigi/src/CSCCLCTDigi.cc | 63 +++++---- .../CSCDigi/src/CSCCLCTPreTriggerDigi.cc | 41 +++--- .../CSCDigi/src/CSCCorrelatedLCTDigi.cc | 122 +++++++++--------- DataFormats/CSCDigi/src/classes_def.xml | 3 +- DataFormats/CSCDigi/test/testCSCDigis.cpp | 70 +++++----- 12 files changed, 263 insertions(+), 265 deletions(-) diff --git a/DataFormats/CSCDigi/interface/CSCALCTDigi.h b/DataFormats/CSCDigi/interface/CSCALCTDigi.h index 1a2c12e23e8b9..021c3d06682fd 100644 --- a/DataFormats/CSCDigi/interface/CSCALCTDigi.h +++ b/DataFormats/CSCDigi/interface/CSCALCTDigi.h @@ -40,14 +40,14 @@ class CSCALCTDigi { void setValid(const uint16_t valid) { valid_ = valid; } /// return quality of a pattern - uint16_t getQuality() const { return quality_; } + uint16_t quality() const { return quality_; } /// set quality void setQuality(const uint16_t quality) { quality_ = quality; } /// return Accelerator bit /// 1-Accelerator pattern, 0-CollisionA or CollisionB pattern - uint16_t getAccelerator() const { return accel_; } + uint16_t accelerator() const { return accel_; } /// set accelerator bit void setAccelerator(const uint16_t accelerator) { accel_ = accelerator; } @@ -55,37 +55,37 @@ class CSCALCTDigi { /// return Collision Pattern B bit /// 1-CollisionB pattern (accel_ = 0), /// 0-CollisionA pattern (accel_ = 0) - uint16_t getCollisionB() const { return patternb_; } + uint16_t collisionB() const { return patternb_; } /// set Collision Pattern B bit void setCollisionB(const uint16_t collision) { patternb_ = collision; } /// return key wire group - uint16_t getKeyWG() const { return keywire_; } + uint16_t keyWireGroup() const { return keywire_; } /// set key wire group void setKeyWG(const uint16_t keyWG) { keywire_ = keyWG; } /// return BX - five low bits of BXN counter tagged by the ALCT - uint16_t getBX() const { return bx_; } + uint16_t bx() const { return bx_; } /// set BX void setBX(const uint16_t BX) { bx_ = BX; } /// return track number (1,2) - uint16_t getTrknmb() const { return trknmb_; } + uint16_t trackNumber() const { return trknmb_; } /// Set track number (1,2) after sorting ALCTs. void setTrknmb(const uint16_t number) { trknmb_ = number; } /// return 12-bit full BX. - uint16_t getFullBX() const { return fullbx_; } + uint16_t fullBX() const { return fullbx_; } /// Set 12-bit full BX. void setFullBX(const uint16_t fullbx) { fullbx_ = fullbx; } /// return the high multiplicity bits - uint16_t getHMT() const; + uint16_t hmt() const; /// set the high multiplicity bits void setHMT(const uint16_t hmt); diff --git a/DataFormats/CSCDigi/interface/CSCALCTPreTriggerDigi.h b/DataFormats/CSCDigi/interface/CSCALCTPreTriggerDigi.h index b33c32670b717..6a2d37a72355d 100644 --- a/DataFormats/CSCDigi/interface/CSCALCTPreTriggerDigi.h +++ b/DataFormats/CSCDigi/interface/CSCALCTPreTriggerDigi.h @@ -33,14 +33,14 @@ class CSCALCTPreTriggerDigi { void setValid(const int valid) { valid_ = valid; } /// return quality of a pattern - int getQuality() const { return quality_; } + int quality() const { return quality_; } /// set quality void setQuality(const int quality) { quality_ = quality; } /// return Accelerator bit /// 1-Accelerator pattern, 0-CollisionA or CollisionB pattern - int getAccelerator() const { return accel_; } + int accelerator() const { return accel_; } /// set accelerator bit void setAccelerator(const int accelerator) { accel_ = accelerator; } @@ -48,31 +48,31 @@ class CSCALCTPreTriggerDigi { /// return Collision Pattern B bit /// 1-CollisionB pattern (accel_ = 0), /// 0-CollisionA pattern (accel_ = 0) - int getCollisionB() const { return patternb_; } + int collisionB() const { return patternb_; } /// set Collision Pattern B bit void setCollisionB(const int collision) { patternb_ = collision; } /// return key wire group - int getKeyWG() const { return keywire_; } + int keyWireGroup() const { return keywire_; } /// set key wire group void setKeyWG(const int keyWG) { keywire_ = keyWG; } /// return BX - five low bits of BXN counter tagged by the ALCT - int getBX() const { return bx_; } + int bx() const { return bx_; } /// set BX void setBX(const int BX) { bx_ = BX; } /// return track number (1,2) - int getTrknmb() const { return trknmb_; } + int trackNumber() const { return trknmb_; } /// Set track number (1,2) after sorting ALCTs. void setTrknmb(const uint16_t number) { trknmb_ = number; } /// return 12-bit full BX. - int getFullBX() const { return fullbx_; } + int fullBX() const { return fullbx_; } /// Set 12-bit full BX. void setFullBX(const uint16_t fullbx) { fullbx_ = fullbx; } diff --git a/DataFormats/CSCDigi/interface/CSCCLCTDigi.h b/DataFormats/CSCDigi/interface/CSCCLCTDigi.h index 57733e2c900fb..5bcde06355388 100644 --- a/DataFormats/CSCDigi/interface/CSCCLCTDigi.h +++ b/DataFormats/CSCDigi/interface/CSCCLCTDigi.h @@ -48,31 +48,31 @@ class CSCCLCTDigi { void setValid(const uint16_t valid) { valid_ = valid; } /// return quality of a pattern (number of layers hit!) - uint16_t getQuality() const { return quality_; } + uint16_t quality() const { return quality_; } /// set quality void setQuality(const uint16_t quality) { quality_ = quality; } /// return pattern - uint16_t getPattern() const { return pattern_; } + uint16_t pattern() const { return pattern_; } /// set pattern void setPattern(const uint16_t pattern) { pattern_ = pattern; } /// return striptype - uint16_t getStripType() const { return striptype_; } + uint16_t stripType() const { return striptype_; } /// set stripType void setStripType(const uint16_t stripType) { striptype_ = stripType; } /// return bend - uint16_t getBend() const { return bend_; } + uint16_t bend() const { return bend_; } /// set bend void setBend(const uint16_t bend) { bend_ = bend; } /// return halfstrip that goes from 0 to 31 in a (D)CFEB - uint16_t getStrip() const; + uint16_t strip() const; /// set strip void setStrip(const uint16_t strip) { strip_ = strip; } @@ -81,28 +81,28 @@ class CSCCLCTDigi { void setQuartStrip(const bool quartStrip); /// get single quart strip bit - bool getQuartStrip() const; + bool quartStrip() const; /// set single eight strip bit void setEightStrip(const bool eightStrip); /// get single eight strip bit - bool getEightStrip() const; + bool eightStrip() const; /// return Key CFEB ID - uint16_t getCFEB() const { return cfeb_; } + uint16_t cfeb() const { return cfeb_; } /// set Key CFEB ID void setCFEB(const uint16_t cfeb) { cfeb_ = cfeb; } /// return BX - uint16_t getBX() const { return bx_; } + uint16_t bx() const { return bx_; } /// set bx void setBX(const uint16_t bx) { bx_ = bx; } /// return track number (1,2) - uint16_t getTrknmb() const { return trknmb_; } + uint16_t trackNumber() const { return trknmb_; } /// Convert strip_ and cfeb_ to keyStrip. Each CFEB has up to 16 strips /// (32 halfstrips). There are 5 cfebs. The "strip_" variable is one @@ -110,19 +110,19 @@ class CSCCLCTDigi { /// Halfstrip = (cfeb*32 + strip). /// This function can also return the quartstrip or eightstrip /// when the comparator code has been set - uint16_t getKeyStrip(uint16_t n = 2) const; + uint16_t keyStrip(uint16_t n = 2) const; /// Set track number (1,2) after sorting CLCTs. void setTrknmb(const uint16_t number) { trknmb_ = number; } /// return 12-bit full BX. - uint16_t getFullBX() const { return fullbx_; } + uint16_t fullBX() const { return fullbx_; } /// Set 12-bit full BX. void setFullBX(const uint16_t fullbx) { fullbx_ = fullbx; } // 12-bit comparator code - int16_t getCompCode() const { return (isRun3() ? compCode_ : -1); } + int16_t compCode() const { return (isRun3() ? compCode_ : -1); } void setCompCode(const int16_t code) { compCode_ = code; } diff --git a/DataFormats/CSCDigi/interface/CSCCLCTPreTriggerDigi.h b/DataFormats/CSCDigi/interface/CSCCLCTPreTriggerDigi.h index 47ef156253891..7ba808630e0b9 100644 --- a/DataFormats/CSCDigi/interface/CSCCLCTPreTriggerDigi.h +++ b/DataFormats/CSCDigi/interface/CSCCLCTPreTriggerDigi.h @@ -35,28 +35,28 @@ class CSCCLCTPreTriggerDigi { bool isValid() const { return valid_; } /// return quality of a pattern (number of layers hit!) - int getQuality() const { return quality_; } + int quality() const { return quality_; } /// return pattern - int getPattern() const { return pattern_; } + int pattern() const { return pattern_; } /// return striptype - int getStripType() const { return striptype_; } + int stripType() const { return striptype_; } /// return bend - int getBend() const { return bend_; } + int bend() const { return bend_; } /// return halfstrip that goes from 0 to 31 - int getStrip() const { return strip_; } + int strip() const { return strip_; } /// return Key CFEB ID - int getCFEB() const { return cfeb_; } + int cfeb() const { return cfeb_; } /// return BX - int getBX() const { return bx_; } + int bx() const { return bx_; } /// return track number (1,2) - int getTrknmb() const { return trknmb_; } + int trackNumber() const { return trknmb_; } /// Convert strip_ and cfeb_ to keyStrip. Each CFEB has up to 16 strips /// (32 halfstrips). There are 5 cfebs. The "strip_" variable is one @@ -67,7 +67,7 @@ class CSCCLCTPreTriggerDigi { /// the correlated LCT digi. For distrip patterns, the convention is /// the same as for persistent strip numbers: low halfstrip of a distrip. /// SV, June 15th, 2006. - int getKeyStrip() const { + int keyStrip() const { int keyStrip = cfeb_ * 32 + strip_; return keyStrip; } @@ -76,7 +76,7 @@ class CSCCLCTPreTriggerDigi { void setTrknmb(const uint16_t number) { trknmb_ = number; } /// return 12-bit full BX. - int getFullBX() const { return fullbx_; } + int fullBX() const { return fullbx_; } /// Set 12-bit full BX. void setFullBX(const uint16_t fullbx) { fullbx_ = fullbx; } diff --git a/DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h b/DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h index 0a9a04a1c45c7..df53e8611fd50 100644 --- a/DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h +++ b/DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h @@ -44,70 +44,70 @@ class CSCCorrelatedLCTDigi { void clear(); /// return track number - uint16_t getTrknmb() const { return trknmb; } + uint16_t trackNumber() const { return trackNumber_; } /// return valid pattern bit - bool isValid() const { return valid; } + bool isValid() const { return valid_; } /// return the Quality - uint16_t getQuality() const { return quality; } + uint16_t quality() const { return quality_; } /// return the key wire group. counts from 0. - uint16_t getKeyWG() const { return keywire; } + uint16_t keyWireGroup() const { return keyWireGroup_; } /// return the key halfstrip from 0,159 - uint16_t getStrip(uint16_t n = 2) const; + uint16_t strip(uint16_t n = 2) const; /// set single quart strip bit void setQuartStrip(const bool quartStrip); /// get single quart strip bit - bool getQuartStrip() const; + bool quartStrip() const; /// set single eight strip bit void setEightStrip(const bool eightStrip); /// get single eight strip bit - bool getEightStrip() const; + bool eightStrip() const; /// return the fractional strip. counts from 0.25 - float getFractionalStrip(uint16_t n = 2) const; + float fractionalStrip(uint16_t n = 2) const; /// Legacy: return pattern ID /// Run-3: return the bending angle value - uint16_t getPattern() const { return pattern; } + uint16_t pattern() const { return pattern_; } /// return left/right bending - uint16_t getBend() const { return bend; } + uint16_t bend() const { return bend_; } /// return BX - uint16_t getBX() const { return bx; } + uint16_t bx() const { return bx_; } /// return CLCT pattern number (in use again Feb 2011) /// This function should not be used for Run-3 - uint16_t getCLCTPattern() const; + uint16_t clctPattern() const; /// return strip type (obsolete since mid-2008) - uint16_t getStripType() const { return ((pattern & 0x8) >> 3); } + uint16_t stripType() const { return ((pattern_ & 0x8) >> 3); } /// return MPC link number, 0 means not sorted, 1-3 give MPC sorting rank - uint16_t getMPCLink() const { return mpclink; } + uint16_t mpcLink() const { return mpcLink_; } - uint16_t getCSCID() const { return cscID; } - uint16_t getBX0() const { return bx0; } - uint16_t getSyncErr() const { return syncErr; } + uint16_t cscID() const { return cscID_; } + uint16_t bx0() const { return bx0_; } + uint16_t syncErr() const { return syncErr_; } /// Run-3 introduces high-multiplicity bits for CSCs. /// The allocation is different for ME1/1 and non-ME1/1 /// chambers. Both LCTs in a chamber are needed for the complete /// high-multiplicity trigger information - uint16_t getHMT() const; + uint16_t hmt() const; /// Set track number (1,2) after sorting LCTs. - void setTrknmb(const uint16_t number) { trknmb = number; } + void setTrknmb(const uint16_t number) { trackNumber_ = number; } /// Set mpc link number after MPC sorting - void setMPCLink(const uint16_t& link) { mpclink = link; } + void setMPCLink(const uint16_t& link) { mpcLink_ = link; } /// Print content of correlated LCT digi void print() const; @@ -117,34 +117,34 @@ class CSCCorrelatedLCTDigi { bool operator!=(const CSCCorrelatedLCTDigi& rhs) const { return !(this->operator==(rhs)); } /// set wiregroup number - void setWireGroup(const uint16_t wiregroup) { keywire = wiregroup; } + void setWireGroup(const uint16_t wiregroup) { keyWireGroup_ = wiregroup; } /// set quality code - void setQuality(const uint16_t q) { quality = q; } + void setQuality(const uint16_t q) { quality_ = q; } /// set valid - void setValid(const uint16_t v) { valid = v; } + void setValid(const uint16_t v) { valid_ = v; } /// set strip - void setStrip(const uint16_t s) { strip = s; } + void setStrip(const uint16_t s) { strip_ = s; } /// set pattern - void setPattern(const uint16_t p) { pattern = p; } + void setPattern(const uint16_t p) { pattern_ = p; } /// set bend - void setBend(const uint16_t b) { bend = b; } + void setBend(const uint16_t b) { bend_ = b; } /// set bx - void setBX(const uint16_t b) { bx = b; } + void setBX(const uint16_t b) { bx_ = b; } /// set bx0 - void setBX0(const uint16_t b) { bx0 = b; } + void setBX0(const uint16_t b) { bx0_ = b; } /// set syncErr - void setSyncErr(const uint16_t s) { syncErr = s; } + void setSyncErr(const uint16_t s) { syncErr_ = s; } /// set cscID - void setCSCID(const uint16_t c) { cscID = c; } + void setCSCID(const uint16_t c) { cscID_ = c; } /// set high-multiplicity bits void setHMT(const uint16_t h); @@ -166,7 +166,7 @@ class CSCCorrelatedLCTDigi { ALCTONLY // Missing CLCT }; - int getType() const { return type_; } + int type() const { return type_; } void setType(int type) { type_ = type; } @@ -185,40 +185,40 @@ class CSCCorrelatedLCTDigi { // more information, please check "DN-20-016". // Run-1, Run-2 and Run-3 trknmb is either 1 or 2. - uint16_t trknmb; + uint16_t trackNumber_; // In Run-3, the valid will be encoded as a quality // value "000" or "00". - uint16_t valid; + uint16_t valid_; // In Run-3, the LCT quality number will be 2 or 3 bits // For ME1/1 chambers: 3 bits // For non-ME1/1 chambers: 2 bits - uint16_t quality; + uint16_t quality_; // 7-bit key wire - uint16_t keywire; + uint16_t keyWireGroup_; // In Run-3, the strip number receives two additional bits // strip[7:0] -> 1/2 strip value // strip[8] -> 1/4 strip bit // strip[9] -> 1/8 strip bit - uint16_t strip; + uint16_t strip_; // In Run-3, the 4-bit pattern number is reinterpreted as the // 4-bit bending value. There will be 16 bending values * 2 (left/right) - uint16_t pattern; + uint16_t pattern_; // Common definition for left/right bending in Run-1, Run-2 and Run-3. // 0: right; 1: left - uint16_t bend; - uint16_t bx; - uint16_t mpclink; - uint16_t bx0; + uint16_t bend_; + uint16_t bx_; + uint16_t mpcLink_; + uint16_t bx0_; // The synchronization bit is actually not used by MPC or EMTF - uint16_t syncErr; + uint16_t syncErr_; // 4-bit CSC chamber identifier - uint16_t cscID; + uint16_t cscID_; // In Run-3, LCT data will be carrying the high-multiplicity bits // for chamber. These bits may indicate the observation of "exotic" events // Depending on the chamber type 2 or 3 bits will be repurposed // in the 32-bit LCT data word from the synchronization bit and // quality bits. - uint16_t hmt; + uint16_t hmt_; /// SIMULATION ONLY //// int type_; diff --git a/DataFormats/CSCDigi/src/CSCALCTDigi.cc b/DataFormats/CSCDigi/src/CSCALCTDigi.cc index bbea930ebd28c..9fd2fe1881f44 100644 --- a/DataFormats/CSCDigi/src/CSCALCTDigi.cc +++ b/DataFormats/CSCDigi/src/CSCALCTDigi.cc @@ -52,7 +52,7 @@ void CSCALCTDigi::clear() { hmt_ = 0; } -uint16_t CSCALCTDigi::getHMT() const { return (isRun3() ? hmt_ : std::numeric_limits::max()); } +uint16_t CSCALCTDigi::hmt() const { return (isRun3() ? hmt_ : std::numeric_limits::max()); } void CSCALCTDigi::setHMT(const uint16_t h) { hmt_ = isRun3() ? h : std::numeric_limits::max(); } @@ -62,21 +62,21 @@ bool CSCALCTDigi::operator>(const CSCALCTDigi& rhs) const { bool returnValue = false; // Early ALCTs are always preferred to the ones found at later bx's. - if (getBX() < rhs.getBX()) { + if (bx() < rhs.bx()) { returnValue = true; } - if (getBX() != rhs.getBX()) { + if (bx() != rhs.bx()) { return returnValue; } // The > operator then checks the quality of ALCTs. // If two qualities are equal, the ALCT furthest from the beam axis // (lowest eta, highest wire group number) is selected. - uint16_t quality1 = getQuality(); - uint16_t quality2 = rhs.getQuality(); + uint16_t quality1 = quality(); + uint16_t quality2 = rhs.quality(); if (quality1 > quality2) { returnValue = true; - } else if (quality1 == quality2 && getKeyWG() > rhs.getKeyWG()) { + } else if (quality1 == quality2 && keyWireGroup() > rhs.keyWireGroup()) { returnValue = true; } return returnValue; @@ -85,9 +85,9 @@ bool CSCALCTDigi::operator>(const CSCALCTDigi& rhs) const { bool CSCALCTDigi::operator==(const CSCALCTDigi& rhs) const { // Exact equality. bool returnValue = false; - if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() && getAccelerator() == rhs.getAccelerator() && - getCollisionB() == rhs.getCollisionB() && getKeyWG() == rhs.getKeyWG() && getBX() == rhs.getBX() && - getHMT() == rhs.getHMT()) { + if (isValid() == rhs.isValid() && quality() == rhs.quality() && accelerator() == rhs.accelerator() && + collisionB() == rhs.collisionB() && keyWireGroup() == rhs.keyWireGroup() && bx() == rhs.bx() && + hmt() == rhs.hmt()) { returnValue = true; } return returnValue; @@ -104,19 +104,18 @@ bool CSCALCTDigi::operator!=(const CSCALCTDigi& rhs) const { /// Debug void CSCALCTDigi::print() const { if (isValid()) { - edm::LogVerbatim("CSCDigi") << "CSC ALCT #" << setw(1) << getTrknmb() << ": Valid = " << setw(1) << isValid() - << " Quality = " << setw(2) << getQuality() << " Accel. = " << setw(1) - << getAccelerator() << " PatternB = " << setw(1) << getCollisionB() - << " Key wire group = " << setw(3) << getKeyWG() << " BX = " << setw(2) << getBX() - << " Full BX = " << std::setw(1) << getFullBX() << " HMT = " << std::setw(1) - << getHMT(); + edm::LogVerbatim("CSCDigi") << "CSC ALCT #" << setw(1) << trackNumber() << ": Valid = " << setw(1) << isValid() + << " Quality = " << setw(2) << quality() << " Accel. = " << setw(1) << accelerator() + << " PatternB = " << setw(1) << collisionB() << " Key wire group = " << setw(3) + << keyWireGroup() << " BX = " << setw(2) << bx() << " Full BX = " << std::setw(1) + << fullBX() << " HMT = " << std::setw(1) << hmt(); } else { edm::LogVerbatim("CSCDigi") << "Not a valid Anode LCT."; } } std::ostream& operator<<(std::ostream& o, const CSCALCTDigi& digi) { - return o << "CSC ALCT #" << digi.getTrknmb() << ": Valid = " << digi.isValid() << " Quality = " << digi.getQuality() - << " Accel. = " << digi.getAccelerator() << " PatternB = " << digi.getCollisionB() - << " Key wire group = " << digi.getKeyWG() << " BX = " << digi.getBX() << " HMT = " << digi.getHMT(); + return o << "CSC ALCT #" << digi.trackNumber() << ": Valid = " << digi.isValid() << " Quality = " << digi.quality() + << " Accel. = " << digi.accelerator() << " PatternB = " << digi.collisionB() + << " Key wire group = " << digi.keyWireGroup() << " BX = " << digi.bx() << " HMT = " << digi.hmt(); } diff --git a/DataFormats/CSCDigi/src/CSCALCTPreTriggerDigi.cc b/DataFormats/CSCDigi/src/CSCALCTPreTriggerDigi.cc index 6e321d7d6e703..1fa2b1a60c6e6 100644 --- a/DataFormats/CSCDigi/src/CSCALCTPreTriggerDigi.cc +++ b/DataFormats/CSCDigi/src/CSCALCTPreTriggerDigi.cc @@ -43,21 +43,21 @@ bool CSCALCTPreTriggerDigi::operator>(const CSCALCTPreTriggerDigi& rhs) const { bool returnValue = false; // Early ALCTs are always preferred to the ones found at later bx's. - if (getBX() < rhs.getBX()) { + if (bx() < rhs.bx()) { returnValue = true; } - if (getBX() != rhs.getBX()) { + if (bx() != rhs.bx()) { return returnValue; } // The > operator then checks the quality of ALCTs. // If two qualities are equal, the ALCT furthest from the beam axis // (lowest eta, highest wire group number) is selected. - int quality1 = getQuality(); - int quality2 = rhs.getQuality(); + int quality1 = quality(); + int quality2 = rhs.quality(); if (quality1 > quality2) { returnValue = true; - } else if (quality1 == quality2 && getKeyWG() > rhs.getKeyWG()) { + } else if (quality1 == quality2 && keyWireGroup() > rhs.keyWireGroup()) { returnValue = true; } return returnValue; @@ -66,8 +66,8 @@ bool CSCALCTPreTriggerDigi::operator>(const CSCALCTPreTriggerDigi& rhs) const { bool CSCALCTPreTriggerDigi::operator==(const CSCALCTPreTriggerDigi& rhs) const { // Exact equality. bool returnValue = false; - if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() && getAccelerator() == rhs.getAccelerator() && - getCollisionB() == rhs.getCollisionB() && getKeyWG() == rhs.getKeyWG() && getBX() == rhs.getBX()) { + if (isValid() == rhs.isValid() && quality() == rhs.quality() && accelerator() == rhs.accelerator() && + collisionB() == rhs.collisionB() && keyWireGroup() == rhs.keyWireGroup() && bx() == rhs.bx()) { returnValue = true; } return returnValue; @@ -84,18 +84,18 @@ bool CSCALCTPreTriggerDigi::operator!=(const CSCALCTPreTriggerDigi& rhs) const { /// Debug void CSCALCTPreTriggerDigi::print() const { if (isValid()) { - edm::LogVerbatim("CSCDigi") << "CSC ALCT #" << setw(1) << getTrknmb() << ": Valid = " << setw(1) << isValid() - << " Quality = " << setw(2) << getQuality() << " Accel. = " << setw(1) - << getAccelerator() << " PatternB = " << setw(1) << getCollisionB() - << " Key wire group = " << setw(3) << getKeyWG() << " BX = " << setw(2) << getBX() - << " Full BX= " << std::setw(1) << getFullBX(); + edm::LogVerbatim("CSCDigi") << "CSC ALCT #" << setw(1) << trackNumber() << ": Valid = " << setw(1) << isValid() + << " Quality = " << setw(2) << quality() << " Accel. = " << setw(1) << accelerator() + << " PatternB = " << setw(1) << collisionB() << " Key wire group = " << setw(3) + << keyWireGroup() << " BX = " << setw(2) << bx() << " Full BX= " << std::setw(1) + << fullBX(); } else { edm::LogVerbatim("CSCDigi") << "Not a valid Anode LCT."; } } std::ostream& operator<<(std::ostream& o, const CSCALCTPreTriggerDigi& digi) { - return o << "CSC ALCT #" << digi.getTrknmb() << ": Valid = " << digi.isValid() << " Quality = " << digi.getQuality() - << " Accel. = " << digi.getAccelerator() << " PatternB = " << digi.getCollisionB() - << " Key wire group = " << digi.getKeyWG() << " BX = " << digi.getBX(); + return o << "CSC ALCT #" << digi.trackNumber() << ": Valid = " << digi.isValid() << " Quality = " << digi.quality() + << " Accel. = " << digi.accelerator() << " PatternB = " << digi.collisionB() + << " Key wire group = " << digi.keyWireGroup() << " BX = " << digi.bx(); } diff --git a/DataFormats/CSCDigi/src/CSCCLCTDigi.cc b/DataFormats/CSCDigi/src/CSCCLCTDigi.cc index c0330d799b955..823e5e5911d5a 100644 --- a/DataFormats/CSCDigi/src/CSCCLCTDigi.cc +++ b/DataFormats/CSCDigi/src/CSCCLCTDigi.cc @@ -84,26 +84,26 @@ void CSCCLCTDigi::clear() { } } -uint16_t CSCCLCTDigi::getKeyStrip(const uint16_t n) const { +uint16_t CSCCLCTDigi::keyStrip(const uint16_t n) const { // 10-bit case for strip data word if (compCode_ != -1 and n == 8) { - return getKeyStrip(4) * 2 + getEightStrip(); + return keyStrip(4) * 2 + eightStrip(); } // 9-bit case for strip data word else if (compCode_ != -1 and n == 4) { - return getKeyStrip(2) * 2 + getQuartStrip(); + return keyStrip(2) * 2 + quartStrip(); } // 8-bit case for strip data word (all other cases) else { - return cfeb_ * 32 + getStrip(); + return cfeb_ * 32 + strip(); } } -uint16_t CSCCLCTDigi::getStrip() const { return strip_ & kHalfStripMask; } +uint16_t CSCCLCTDigi::strip() const { return strip_ & kHalfStripMask; } -bool CSCCLCTDigi::getQuartStrip() const { return (strip_ >> kQuartStripShift) & kQuartStripMask; } +bool CSCCLCTDigi::quartStrip() const { return (strip_ >> kQuartStripShift) & kQuartStripMask; } -bool CSCCLCTDigi::getEightStrip() const { return (strip_ >> kEightStripShift) & kEightStripMask; } +bool CSCCLCTDigi::eightStrip() const { return (strip_ >> kEightStripShift) & kEightStripMask; } void CSCCLCTDigi::setQuartStrip(const bool quartStrip) { // clear the old value @@ -129,8 +129,8 @@ bool CSCCLCTDigi::operator>(const CSCCLCTDigi& rhs) const { // the latest one, used in TMB-07 firmware (w/o distrips). bool returnValue = false; - uint16_t quality1 = getQuality(); - uint16_t quality2 = rhs.getQuality(); + uint16_t quality1 = quality(); + uint16_t quality2 = rhs.quality(); // Run-3 case if (version_ == Version::Run3) { @@ -140,8 +140,8 @@ bool CSCCLCTDigi::operator>(const CSCCLCTDigi& rhs) const { // the same quality. This corresponds to "pattern" being smaller!!! // If both qualities and pattern id's are the same, lower keystrip // is preferred. - if ((quality1 > quality2) || (quality1 == quality2 && getPattern() < rhs.getPattern()) || - (quality1 == quality2 && getPattern() == rhs.getPattern() && getKeyStrip() < rhs.getKeyStrip())) { + if ((quality1 > quality2) || (quality1 == quality2 && pattern() < rhs.pattern()) || + (quality1 == quality2 && pattern() == rhs.pattern() && keyStrip() < rhs.keyStrip())) { returnValue = true; } } @@ -149,8 +149,8 @@ bool CSCCLCTDigi::operator>(const CSCCLCTDigi& rhs) const { else { // The bend-direction bit pid[0] is ignored (left and right bends have // equal quality). - uint16_t pattern1 = getPattern() & 14; - uint16_t pattern2 = rhs.getPattern() & 14; + uint16_t pattern1 = pattern() & 14; + uint16_t pattern2 = rhs.pattern() & 14; // Better-quality CLCTs are preferred. // If two qualities are equal, larger pattern id (i.e., straighter pattern) @@ -159,7 +159,7 @@ bool CSCCLCTDigi::operator>(const CSCCLCTDigi& rhs) const { // If both qualities and pattern id's are the same, lower keystrip // is preferred. if ((quality1 > quality2) || (quality1 == quality2 && pattern1 > pattern2) || - (quality1 == quality2 && pattern1 == pattern2 && getKeyStrip() < rhs.getKeyStrip())) { + (quality1 == quality2 && pattern1 == pattern2 && keyStrip() < rhs.keyStrip())) { returnValue = true; } } @@ -169,9 +169,9 @@ bool CSCCLCTDigi::operator>(const CSCCLCTDigi& rhs) const { bool CSCCLCTDigi::operator==(const CSCCLCTDigi& rhs) const { // Exact equality. bool returnValue = false; - if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() && getPattern() == rhs.getPattern() && - getKeyStrip() == rhs.getKeyStrip() && getStripType() == rhs.getStripType() && getBend() == getBend() && - getBX() == rhs.getBX() && getCompCode() == rhs.getCompCode()) { + if (isValid() == rhs.isValid() && quality() == rhs.quality() && pattern() == rhs.pattern() && + keyStrip() == rhs.keyStrip() && stripType() == rhs.stripType() && bend() == bend() && bx() == rhs.bx() && + compCode() == rhs.compCode()) { returnValue = true; } return returnValue; @@ -188,25 +188,24 @@ bool CSCCLCTDigi::operator!=(const CSCCLCTDigi& rhs) const { /// Debug void CSCCLCTDigi::print() const { if (isValid()) { - char stripType = (getStripType() == 0) ? 'D' : 'H'; - char bend = (getBend() == 0) ? 'L' : 'R'; - - edm::LogVerbatim("CSCDigi") << " CSC CLCT #" << std::setw(1) << getTrknmb() << ": Valid = " << std::setw(1) - << isValid() << " Key Strip = " << std::setw(3) << getKeyStrip() - << " Strip = " << std::setw(2) << getStrip() << " Quality = " << std::setw(1) - << getQuality() << " Pattern = " << std::setw(1) << getPattern() - << " Bend = " << std::setw(1) << bend << " Strip type = " << std::setw(1) << stripType - << " CFEB ID = " << std::setw(1) << getCFEB() << " BX = " << std::setw(1) << getBX() - << " Full BX= " << std::setw(1) << getFullBX() << " Comp Code= " << std::setw(1) - << getCompCode(); + char stripTypeChar = (stripType() == 0) ? 'D' : 'H'; + char bendChar = (bend() == 0) ? 'L' : 'R'; + + edm::LogVerbatim("CSCDigi") << " CSC CLCT #" << std::setw(1) << trackNumber() << ": Valid = " << std::setw(1) + << isValid() << " Key Strip = " << std::setw(3) << keyStrip() + << " Strip = " << std::setw(2) << strip() << " Quality = " << std::setw(1) << quality() + << " Pattern = " << std::setw(1) << pattern() << " Bend = " << std::setw(1) << bendChar + << " Strip type = " << std::setw(1) << stripTypeChar << " CFEB ID = " << std::setw(1) + << cfeb() << " BX = " << std::setw(1) << bx() << " Full BX= " << std::setw(1) + << fullBX() << " Comp Code= " << std::setw(1) << compCode(); } else { edm::LogVerbatim("CSCDigi") << "Not a valid Cathode LCT."; } } std::ostream& operator<<(std::ostream& o, const CSCCLCTDigi& digi) { - return o << "CSC CLCT #" << digi.getTrknmb() << ": Valid = " << digi.isValid() << " Quality = " << digi.getQuality() - << " Pattern = " << digi.getPattern() << " StripType = " << digi.getStripType() - << " Bend = " << digi.getBend() << " Strip = " << digi.getStrip() << " KeyStrip = " << digi.getKeyStrip() - << " CFEB = " << digi.getCFEB() << " BX = " << digi.getBX() << " Comp Code " << digi.getCompCode(); + return o << "CSC CLCT #" << digi.trackNumber() << ": Valid = " << digi.isValid() << " Quality = " << digi.quality() + << " Pattern = " << digi.pattern() << " StripType = " << digi.stripType() << " Bend = " << digi.bend() + << " Strip = " << digi.strip() << " KeyStrip = " << digi.keyStrip() << " CFEB = " << digi.cfeb() + << " BX = " << digi.bx() << " Comp Code " << digi.compCode(); } diff --git a/DataFormats/CSCDigi/src/CSCCLCTPreTriggerDigi.cc b/DataFormats/CSCDigi/src/CSCCLCTPreTriggerDigi.cc index fd5ff41d2c2a6..99a35bd56bf65 100644 --- a/DataFormats/CSCDigi/src/CSCCLCTPreTriggerDigi.cc +++ b/DataFormats/CSCDigi/src/CSCCLCTPreTriggerDigi.cc @@ -59,12 +59,12 @@ bool CSCCLCTPreTriggerDigi::operator>(const CSCCLCTPreTriggerDigi& rhs) const { // the latest one, used in TMB-07 firmware (w/o distrips). bool returnValue = false; - int quality1 = getQuality(); - int quality2 = rhs.getQuality(); + int quality1 = quality(); + int quality2 = rhs.quality(); // The bend-direction bit pid[0] is ignored (left and right bends have // equal quality). - int pattern1 = getPattern() & 14; - int pattern2 = rhs.getPattern() & 14; + int pattern1 = pattern() & 14; + int pattern2 = rhs.pattern() & 14; // Better-quality CLCTs are preferred. // If two qualities are equal, larger pattern id (i.e., straighter pattern) @@ -73,7 +73,7 @@ bool CSCCLCTPreTriggerDigi::operator>(const CSCCLCTPreTriggerDigi& rhs) const { // If both qualities and pattern id's are the same, lower keystrip // is preferred. if ((quality1 > quality2) || (quality1 == quality2 && pattern1 > pattern2) || - (quality1 == quality2 && pattern1 == pattern2 && getKeyStrip() < rhs.getKeyStrip())) { + (quality1 == quality2 && pattern1 == pattern2 && keyStrip() < rhs.keyStrip())) { returnValue = true; } @@ -83,9 +83,8 @@ bool CSCCLCTPreTriggerDigi::operator>(const CSCCLCTPreTriggerDigi& rhs) const { bool CSCCLCTPreTriggerDigi::operator==(const CSCCLCTPreTriggerDigi& rhs) const { // Exact equality. bool returnValue = false; - if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() && getPattern() == rhs.getPattern() && - getKeyStrip() == rhs.getKeyStrip() && getStripType() == rhs.getStripType() && getBend() == getBend() && - getBX() == rhs.getBX()) { + if (isValid() == rhs.isValid() && quality() == rhs.quality() && pattern() == rhs.pattern() && + keyStrip() == rhs.keyStrip() && stripType() == rhs.stripType() && bend() == bend() && bx() == rhs.bx()) { returnValue = true; } return returnValue; @@ -102,24 +101,24 @@ bool CSCCLCTPreTriggerDigi::operator!=(const CSCCLCTPreTriggerDigi& rhs) const { /// Debug void CSCCLCTPreTriggerDigi::print() const { if (isValid()) { - char stripType = (getStripType() == 0) ? 'D' : 'H'; - char bend = (getBend() == 0) ? 'L' : 'R'; + char stripTypeChar = (stripType() == 0) ? 'D' : 'H'; + char bendChar = (bend() == 0) ? 'L' : 'R'; - edm::LogVerbatim("CSCDigi") << " CSC CLCT #" << std::setw(1) << getTrknmb() << ": Valid = " << std::setw(1) - << isValid() << " Key Strip = " << std::setw(3) << getKeyStrip() - << " Strip = " << std::setw(2) << getStrip() << " Quality = " << std::setw(1) - << getQuality() << " Pattern = " << std::setw(1) << getPattern() - << " Bend = " << std::setw(1) << bend << " Strip type = " << std::setw(1) << stripType - << " CFEB ID = " << std::setw(1) << getCFEB() << " BX = " << std::setw(1) << getBX() - << " Full BX= " << std::setw(1) << getFullBX(); + edm::LogVerbatim("CSCDigi") << " CSC CLCT #" << std::setw(1) << trackNumber() << ": Valid = " << std::setw(1) + << isValid() << " Key Strip = " << std::setw(3) << keyStrip() + << " Strip = " << std::setw(2) << strip() << " Quality = " << std::setw(1) << quality() + << " Pattern = " << std::setw(1) << pattern() << " Bend = " << std::setw(1) << bendChar + << " Strip type = " << std::setw(1) << stripTypeChar << " CFEB ID = " << std::setw(1) + << cfeb() << " BX = " << std::setw(1) << bx() << " Full BX= " << std::setw(1) + << fullBX(); } else { edm::LogVerbatim("CSCDigi") << "Not a valid Cathode LCT."; } } std::ostream& operator<<(std::ostream& o, const CSCCLCTPreTriggerDigi& digi) { - return o << "CSC CLCT #" << digi.getTrknmb() << ": Valid = " << digi.isValid() << " Quality = " << digi.getQuality() - << " Pattern = " << digi.getPattern() << " StripType = " << digi.getStripType() - << " Bend = " << digi.getBend() << " Strip = " << digi.getStrip() << " KeyStrip = " << digi.getKeyStrip() - << " CFEB = " << digi.getCFEB() << " BX = " << digi.getBX(); + return o << "CSC CLCT #" << digi.trackNumber() << ": Valid = " << digi.isValid() << " Quality = " << digi.quality() + << " Pattern = " << digi.pattern() << " StripType = " << digi.stripType() << " Bend = " << digi.bend() + << " Strip = " << digi.strip() << " KeyStrip = " << digi.keyStrip() << " CFEB = " << digi.cfeb() + << " BX = " << digi.bx(); } diff --git a/DataFormats/CSCDigi/src/CSCCorrelatedLCTDigi.cc b/DataFormats/CSCDigi/src/CSCCorrelatedLCTDigi.cc index bd0b2afddadc8..a88c7e4232edc 100644 --- a/DataFormats/CSCDigi/src/CSCCorrelatedLCTDigi.cc +++ b/DataFormats/CSCDigi/src/CSCCorrelatedLCTDigi.cc @@ -11,33 +11,33 @@ #include /// Constructors -CSCCorrelatedLCTDigi::CSCCorrelatedLCTDigi(const uint16_t itrknmb, +CSCCorrelatedLCTDigi::CSCCorrelatedLCTDigi(const uint16_t iTrackNumber, const uint16_t ivalid, const uint16_t iquality, - const uint16_t ikeywire, + const uint16_t ikeyWireGroup, const uint16_t istrip, const uint16_t ipattern, const uint16_t ibend, const uint16_t ibx, - const uint16_t impclink, + const uint16_t impcLink, const uint16_t ibx0, const uint16_t isyncErr, const uint16_t icscID, const uint16_t ihmt, const Version version) - : trknmb(itrknmb), - valid(ivalid), - quality(iquality), - keywire(ikeywire), - strip(istrip), - pattern(ipattern), - bend(ibend), - bx(ibx), - mpclink(impclink), - bx0(ibx0), - syncErr(isyncErr), - cscID(icscID), - hmt(ihmt), + : trackNumber_(iTrackNumber), + valid_(ivalid), + quality_(iquality), + keyWireGroup_(ikeyWireGroup), + strip_(istrip), + pattern_(ipattern), + bend_(ibend), + bx_(ibx), + mpcLink_(impcLink), + bx0_(ibx0), + syncErr_(isyncErr), + cscID_(icscID), + hmt_(ihmt), version_(version) {} /// Default @@ -48,102 +48,102 @@ CSCCorrelatedLCTDigi::CSCCorrelatedLCTDigi() { /// Clears this LCT. void CSCCorrelatedLCTDigi::clear() { - trknmb = 0; - valid = 0; - quality = 0; - keywire = 0; - strip = 0; - pattern = 0; - bend = 0; - bx = 0; - mpclink = 0; - bx0 = 0; - syncErr = 0; - cscID = 0; - hmt = 0; + trackNumber_ = 0; + valid_ = 0; + quality_ = 0; + keyWireGroup_ = 0; + strip_ = 0; + pattern_ = 0; + bend_ = 0; + bx_ = 0; + mpcLink_ = 0; + bx0_ = 0; + syncErr_ = 0; + cscID_ = 0; + hmt_ = 0; } -uint16_t CSCCorrelatedLCTDigi::getStrip(const uint16_t n) const { +uint16_t CSCCorrelatedLCTDigi::strip(const uint16_t n) const { // all 10 bits if (n == 8) { - return 2 * getStrip(4) + getEightStrip(); + return 2 * strip(4) + eightStrip(); } // lowest 9 bits else if (n == 4) { - return 2 * getStrip(2) + getQuartStrip(); + return 2 * strip(2) + quartStrip(); } // lowest 8 bits else { - return strip & kHalfStripMask; + return strip_ & kHalfStripMask; } } void CSCCorrelatedLCTDigi::setQuartStrip(const bool quartStrip) { // clear the old value - strip &= ~(kQuartStripMask << kQuartStripShift); + strip_ &= ~(kQuartStripMask << kQuartStripShift); // set the new value - strip |= quartStrip << kQuartStripShift; + strip_ |= quartStrip << kQuartStripShift; } void CSCCorrelatedLCTDigi::setEightStrip(const bool eightStrip) { // clear the old value - strip &= ~(kEightStripMask << kEightStripShift); + strip_ &= ~(kEightStripMask << kEightStripShift); // set the new value - strip |= eightStrip << kEightStripShift; + strip_ |= eightStrip << kEightStripShift; } -bool CSCCorrelatedLCTDigi::getQuartStrip() const { return (strip >> kQuartStripShift) & kQuartStripMask; } +bool CSCCorrelatedLCTDigi::quartStrip() const { return (strip_ >> kQuartStripShift) & kQuartStripMask; } -bool CSCCorrelatedLCTDigi::getEightStrip() const { return (strip >> kEightStripShift) & kEightStripMask; } +bool CSCCorrelatedLCTDigi::eightStrip() const { return (strip_ >> kEightStripShift) & kEightStripMask; } /// return the fractional strip -float CSCCorrelatedLCTDigi::getFractionalStrip(const uint16_t n) const { +float CSCCorrelatedLCTDigi::fractionalStrip(const uint16_t n) const { if (n == 8) { - return 0.125f * (getStrip() + 1) - 0.0625f; + return 0.125f * (strip() + 1) - 0.0625f; } else if (n == 4) { - return 0.25f * (getStrip() + 1) - 0.125f; + return 0.25f * (strip() + 1) - 0.125f; } else { - return 0.5f * (getStrip() + 1) - 0.25f; + return 0.5f * (strip() + 1) - 0.25f; } } -uint16_t CSCCorrelatedLCTDigi::getCLCTPattern() const { - return (isRun3() ? std::numeric_limits::max() : (pattern & 0xF)); +uint16_t CSCCorrelatedLCTDigi::clctPattern() const { + return (isRun3() ? std::numeric_limits::max() : (pattern_ & 0xF)); } -uint16_t CSCCorrelatedLCTDigi::getHMT() const { return (isRun3() ? hmt : std::numeric_limits::max()); } +uint16_t CSCCorrelatedLCTDigi::hmt() const { return (isRun3() ? hmt_ : std::numeric_limits::max()); } -void CSCCorrelatedLCTDigi::setHMT(const uint16_t h) { hmt = isRun3() ? h : std::numeric_limits::max(); } +void CSCCorrelatedLCTDigi::setHMT(const uint16_t h) { hmt_ = isRun3() ? h : std::numeric_limits::max(); } void CSCCorrelatedLCTDigi::setRun3(const bool isRun3) { version_ = isRun3 ? Version::Run3 : Version::Legacy; } /// Comparison bool CSCCorrelatedLCTDigi::operator==(const CSCCorrelatedLCTDigi& rhs) const { - return ((trknmb == rhs.trknmb) && (quality == rhs.quality) && (keywire == rhs.keywire) && (strip == rhs.strip) && - (pattern == rhs.pattern) && (bend == rhs.bend) && (bx == rhs.bx) && (valid == rhs.valid) && - (mpclink == rhs.mpclink) && (hmt == rhs.hmt)); + return ((trackNumber_ == rhs.trackNumber_) && (quality_ == rhs.quality_) && (keyWireGroup_ == rhs.keyWireGroup_) && + (strip_ == rhs.strip_) && (pattern_ == rhs.pattern_) && (bend_ == rhs.bend_) && (bx_ == rhs.bx_) && + (valid_ == rhs.valid_) && (mpcLink_ == rhs.mpcLink_) && (hmt_ == rhs.hmt_)); } /// Debug void CSCCorrelatedLCTDigi::print() const { if (isValid()) { - edm::LogVerbatim("CSCDigi") << "CSC LCT #" << getTrknmb() << ": Valid = " << isValid() - << " Quality = " << getQuality() << " Key Wire = " << getKeyWG() - << " Strip = " << getStrip() << " Pattern = " << getPattern() - << " Bend = " << ((getBend() == 0) ? 'L' : 'R') << " BX = " << getBX() - << " MPC Link = " << getMPCLink() << " HMT Bit = " << getHMT(); + edm::LogVerbatim("CSCDigi") << "CSC LCT #" << trackNumber() << ": Valid = " << isValid() + << " Quality = " << quality() << " Key Wire = " << keyWireGroup() + << " Strip = " << strip() << " Pattern = " << pattern() + << " Bend = " << ((bend() == 0) ? 'L' : 'R') << " BX = " << bx() + << " MPC Link = " << mpcLink() << " HMT Bit = " << hmt(); } else { edm::LogVerbatim("CSCDigi") << "Not a valid correlated LCT."; } } std::ostream& operator<<(std::ostream& o, const CSCCorrelatedLCTDigi& digi) { - return o << "CSC LCT #" << digi.getTrknmb() << ": Valid = " << digi.isValid() << " Quality = " << digi.getQuality() - << " MPC Link = " << digi.getMPCLink() << " cscID = " << digi.getCSCID() << "\n" - << " cathode info: Strip = " << digi.getStrip() << " Pattern = " << digi.getPattern() - << " Bend = " << ((digi.getBend() == 0) ? 'L' : 'R') << "\n" - << " anode info: Key wire = " << digi.getKeyWG() << " BX = " << digi.getBX() << " bx0 = " << digi.getBX0() - << " syncErr = " << digi.getSyncErr() << " HMT Bit = " << digi.getHMT() << "\n"; + return o << "CSC LCT #" << digi.trackNumber() << ": Valid = " << digi.isValid() << " Quality = " << digi.quality() + << " MPC Link = " << digi.mpcLink() << " cscID = " << digi.cscID() << "\n" + << " cathode info: Strip = " << digi.strip() << " Pattern = " << digi.pattern() + << " Bend = " << ((digi.bend() == 0) ? 'L' : 'R') << "\n" + << " anode info: Key wire = " << digi.keyWireGroup() << " BX = " << digi.bx() << " bx0 = " << digi.bx0() + << " syncErr = " << digi.syncErr() << " HMT Bit = " << digi.hmt() << "\n"; } diff --git a/DataFormats/CSCDigi/src/classes_def.xml b/DataFormats/CSCDigi/src/classes_def.xml index e0817b8f2b6db..c6ccedd369764 100644 --- a/DataFormats/CSCDigi/src/classes_def.xml +++ b/DataFormats/CSCDigi/src/classes_def.xml @@ -11,7 +11,8 @@ - + + diff --git a/DataFormats/CSCDigi/test/testCSCDigis.cpp b/DataFormats/CSCDigi/test/testCSCDigis.cpp index 40c75d34ae363..ab05c0c58e7ec 100644 --- a/DataFormats/CSCDigi/test/testCSCDigis.cpp +++ b/DataFormats/CSCDigi/test/testCSCDigis.cpp @@ -393,16 +393,16 @@ void testCSCDigis::readCSCCorrLCTDigi(CSCCorrelatedLCTDigiCollection &collection for (CSCCorrelatedLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) { ++count; CPPUNIT_ASSERT(digiIt->isValid() == 1); - CPPUNIT_ASSERT(digiIt->getQuality() == 15); - CPPUNIT_ASSERT(digiIt->getCLCTPattern() == 2); - CPPUNIT_ASSERT(digiIt->getStrip() == 16); - CPPUNIT_ASSERT(digiIt->getKeyWG() == 10); - CPPUNIT_ASSERT(digiIt->getBend() == 1); - CPPUNIT_ASSERT(digiIt->getBX() == 0); + CPPUNIT_ASSERT(digiIt->quality() == 15); + CPPUNIT_ASSERT(digiIt->clctPattern() == 2); + CPPUNIT_ASSERT(digiIt->strip() == 16); + CPPUNIT_ASSERT(digiIt->keyWireGroup() == 10); + CPPUNIT_ASSERT(digiIt->bend() == 1); + CPPUNIT_ASSERT(digiIt->bx() == 0); std::cout << "CSC Correlated LCT - endcap station ring csc layer LCT# Quality: " << id.endcap() << " " << id.station() << " " << id.ring() << " " << id.chamber() << " " << id.layer() << " " - << digiIt->getTrknmb() << " " << digiIt->getQuality() << std::endl; + << digiIt->trackNumber() << " " << digiIt->quality() << std::endl; } } std::cout << "CSC Correlated LCT Digi count - " << count << std::endl; @@ -545,12 +545,12 @@ void testCSCDigis::readCSCALCTDigi(CSCALCTDigiCollection &collection) { for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) { count++; CPPUNIT_ASSERT((*digiIt).isValid()); - CPPUNIT_ASSERT((*digiIt).getQuality() == 3); - CPPUNIT_ASSERT((*digiIt).getAccelerator() == 0); - CPPUNIT_ASSERT((*digiIt).getCollisionB() == 1); - CPPUNIT_ASSERT((*digiIt).getKeyWG() == 16); - CPPUNIT_ASSERT((*digiIt).getBX() == 4); - CPPUNIT_ASSERT((*digiIt).getTrknmb() == 1); + CPPUNIT_ASSERT((*digiIt).quality() == 3); + CPPUNIT_ASSERT((*digiIt).accelerator() == 0); + CPPUNIT_ASSERT((*digiIt).collisionB() == 1); + CPPUNIT_ASSERT((*digiIt).keyWireGroup() == 16); + CPPUNIT_ASSERT((*digiIt).bx() == 4); + CPPUNIT_ASSERT((*digiIt).trackNumber() == 1); printf( "CSC ALCT - endcap station ring csc layer valid quality accel pattern wire bx track: %3d %3d %3d %3d %3d %3d " @@ -561,12 +561,12 @@ void testCSCDigis::readCSCALCTDigi(CSCALCTDigiCollection &collection) { id.chamber(), id.layer(), (*digiIt).isValid(), - (*digiIt).getQuality(), - (*digiIt).getAccelerator(), - (*digiIt).getCollisionB(), - (*digiIt).getKeyWG(), - (*digiIt).getBX(), - (*digiIt).getTrknmb()); + (*digiIt).quality(), + (*digiIt).accelerator(), + (*digiIt).collisionB(), + (*digiIt).keyWireGroup(), + (*digiIt).bx(), + (*digiIt).trackNumber()); } // for digis in layer } // end of for (detUnitIt=... printf("CSC ALCT count: %3d \n", count); @@ -582,14 +582,14 @@ void testCSCDigis::readCSCCLCTDigi(CSCCLCTDigiCollection &collection) { for (CSCCLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) { count++; CPPUNIT_ASSERT((*digiIt).isValid()); - CPPUNIT_ASSERT((*digiIt).getQuality() == 3); - CPPUNIT_ASSERT((*digiIt).getPattern() == 2); - CPPUNIT_ASSERT((*digiIt).getStripType() == 1); - CPPUNIT_ASSERT((*digiIt).getBend() == 0); - CPPUNIT_ASSERT((*digiIt).getStrip() == 16); - CPPUNIT_ASSERT((*digiIt).getCFEB() == 5); - CPPUNIT_ASSERT((*digiIt).getBX() == 3); - CPPUNIT_ASSERT((*digiIt).getTrknmb() == 1); + CPPUNIT_ASSERT((*digiIt).quality() == 3); + CPPUNIT_ASSERT((*digiIt).pattern() == 2); + CPPUNIT_ASSERT((*digiIt).stripType() == 1); + CPPUNIT_ASSERT((*digiIt).bend() == 0); + CPPUNIT_ASSERT((*digiIt).strip() == 16); + CPPUNIT_ASSERT((*digiIt).cfeb() == 5); + CPPUNIT_ASSERT((*digiIt).bx() == 3); + CPPUNIT_ASSERT((*digiIt).trackNumber() == 1); printf( "CSC CLCT - endcap station ring csc layer valid quality pattern striptype bend strip cfeb bx tracknmb %3d " @@ -600,14 +600,14 @@ void testCSCDigis::readCSCCLCTDigi(CSCCLCTDigiCollection &collection) { id.chamber(), id.layer(), (*digiIt).isValid(), - (*digiIt).getQuality(), - (*digiIt).getPattern(), - (*digiIt).getStripType(), - (*digiIt).getBend(), - (*digiIt).getStrip(), - (*digiIt).getCFEB(), - (*digiIt).getBX(), - (*digiIt).getTrknmb()); + (*digiIt).quality(), + (*digiIt).pattern(), + (*digiIt).stripType(), + (*digiIt).bend(), + (*digiIt).strip(), + (*digiIt).cfeb(), + (*digiIt).bx(), + (*digiIt).trackNumber()); } // for digis in layer } // end of for (detUnitIt=... From b377500e38e6a0c8ccbfe894bbeadda79cf9c41f Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sat, 9 May 2020 10:11:59 -0500 Subject: [PATCH 08/12] CMS code rules for CSC TPs --- DataFormats/L1CSCTrackFinder/interface/TrackStub.h | 2 +- DataFormats/L1CSCTrackFinder/src/TrackStub.cc | 12 ++++++------ DataFormats/L1CSCTrackFinder/src/classes_def.xml | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/DataFormats/L1CSCTrackFinder/interface/TrackStub.h b/DataFormats/L1CSCTrackFinder/interface/TrackStub.h index 7d2a68c223fac..4a3fbc6f1f5aa 100644 --- a/DataFormats/L1CSCTrackFinder/interface/TrackStub.h +++ b/DataFormats/L1CSCTrackFinder/interface/TrackStub.h @@ -53,7 +53,7 @@ namespace csctf { unsigned subsector() const; unsigned cscid() const; unsigned cscidSeparateME1a() const; - int BX() const { return getBX(); } + int BX() const { return bx(); } /// Comparision Operators, used for MPC sorting bool operator>(const TrackStub &) const; diff --git a/DataFormats/L1CSCTrackFinder/src/TrackStub.cc b/DataFormats/L1CSCTrackFinder/src/TrackStub.cc index 7ae9e8bca6173..d29d50cab4889 100644 --- a/DataFormats/L1CSCTrackFinder/src/TrackStub.cc +++ b/DataFormats/L1CSCTrackFinder/src/TrackStub.cc @@ -113,15 +113,15 @@ namespace csctf { } bool TrackStub::operator<(const TrackStub& rhs) const { - return (rhs.isValid() && ((!(isValid())) || (getQuality() < rhs.getQuality()) || - (getQuality() == rhs.getQuality() && cscid() < rhs.cscid()) || - (getQuality() == rhs.getQuality() && cscid() == rhs.cscid() && (getTrknmb() == 2)))); + return (rhs.isValid() && + ((!(isValid())) || (quality() < rhs.quality()) || (quality() == rhs.quality() && cscid() < rhs.cscid()) || + (quality() == rhs.quality() && cscid() == rhs.cscid() && (trackNumber() == 2)))); } bool TrackStub::operator>(const TrackStub& rhs) const { - return (isValid() && ((!(rhs.isValid())) || (getQuality() > rhs.getQuality()) || - (getQuality() == rhs.getQuality() && cscid() > rhs.cscid()) || - (getQuality() == rhs.getQuality() && cscid() == rhs.cscid() && (getTrknmb() == 1)))); + return (isValid() && ((!(rhs.isValid())) || (quality() > rhs.quality()) || + (quality() == rhs.quality() && cscid() > rhs.cscid()) || + (quality() == rhs.quality() && cscid() == rhs.cscid() && (trackNumber() == 1)))); } } // namespace csctf diff --git a/DataFormats/L1CSCTrackFinder/src/classes_def.xml b/DataFormats/L1CSCTrackFinder/src/classes_def.xml index 969b0f82291b7..f604d31d8e904 100644 --- a/DataFormats/L1CSCTrackFinder/src/classes_def.xml +++ b/DataFormats/L1CSCTrackFinder/src/classes_def.xml @@ -13,7 +13,8 @@ - + + From 3a74bff33534f3e649511fee867fc2ba696fba76 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sat, 9 May 2020 10:12:07 -0500 Subject: [PATCH 09/12] CMS code rules for CSC TPs --- .../CSCDQM_EventProcessor_processCSC.cc | 144 +++++++++--------- DQM/L1TMonitor/src/L1TCSCTF.cc | 36 ++--- DQM/L1TMonitor/src/L1TCSCTPG.cc | 28 ++-- DQM/L1TMonitor/src/L1TdeCSCTF.cc | 12 +- 4 files changed, 110 insertions(+), 110 deletions(-) diff --git a/DQM/CSCMonitorModule/plugins/CSCDQM_EventProcessor_processCSC.cc b/DQM/CSCMonitorModule/plugins/CSCDQM_EventProcessor_processCSC.cc index 2a17c8c94b76f..8b3d68bcae0e5 100644 --- a/DQM/CSCMonitorModule/plugins/CSCDQM_EventProcessor_processCSC.cc +++ b/DQM/CSCMonitorModule/plugins/CSCDQM_EventProcessor_processCSC.cc @@ -31,7 +31,7 @@ namespace cscdqm { } /** - * @brief Set a single bit in the 3D Histogram (aka EMU level event display). Checks if mo and x != null. + * @brief Set a single bit in the 3D Histogram (aka EMU level event display). Checks if mo and x != null. * @param eventNumber number of event * @param mo Histogram * @param x X bin number @@ -511,7 +511,7 @@ namespace cscdqm { if (alctsDatas.size() == 2) { if (getCSCHisto(h::CSC_ALCT1_VS_ALCT0_KEYWG, crateID, dmbID, mo)) - mo->Fill(alctsDatas[0].getKeyWG(), alctsDatas[1].getKeyWG()); + mo->Fill(alctsDatas[0].keyWireGroup(), alctsDatas[1].keyWireGroup()); } MonitorObject* mo_CSC_ALCT0_BXN_mean = nullptr; @@ -532,18 +532,18 @@ namespace cscdqm { continue; if (getCSCHisto(h::CSC_ALCTXX_KEYWG, crateID, dmbID, lct, mo)) { - mo->Fill(alctsDatas[lct].getKeyWG()); + mo->Fill(alctsDatas[lct].keyWireGroup()); } if (lct == 0) - alct_keywg = alctsDatas[lct].getKeyWG(); + alct_keywg = alctsDatas[lct].keyWireGroup(); int alct_dtime = 0; if (fwVersion == 2007) { - alct_dtime = alctsDatas[lct].getBX(); + alct_dtime = alctsDatas[lct].bx(); } else { // Older 2006 Format - alct_dtime = (int)(alctsDatas[lct].getBX() - (alctHeader->BXNCount() & 0x1F)); + alct_dtime = (int)(alctsDatas[lct].bx() - (alctHeader->BXNCount() & 0x1F)); } // == Those two summary histos need to be outside of per-chamber CSC_ALCTXX_DTIME histo check. @@ -595,27 +595,27 @@ namespace cscdqm { if (getCSCHisto(h::CSC_ALCTXX_DTIME_VS_KEYWG, crateID, dmbID, lct, mo)) { if (alct_dtime < -16) { - mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime + 32); + mo->Fill(alctsDatas[lct].keyWireGroup(), alct_dtime + 32); } else { if (alct_dtime >= 16) - mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime - 32); + mo->Fill(alctsDatas[lct].keyWireGroup(), alct_dtime - 32); else - mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime); + mo->Fill(alctsDatas[lct].keyWireGroup(), alct_dtime); } } if (getCSCHisto(h::CSC_ALCTXX_DTIME_PROFILE, crateID, dmbID, lct, mo)) { if (alct_dtime < -16) { - mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime + 32); + mo->Fill(alctsDatas[lct].keyWireGroup(), alct_dtime + 32); } else { if (alct_dtime >= 16) - mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime - 32); + mo->Fill(alctsDatas[lct].keyWireGroup(), alct_dtime - 32); else - mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime); + mo->Fill(alctsDatas[lct].keyWireGroup(), alct_dtime); } } - int alct_bxn = alctsDatas[lct].getBX(); + int alct_bxn = alctsDatas[lct].bx(); if (fwVersion == 2007) { alct_bxn = (alct_bxn + alctHeader->BXNCount()) & 0x1F; } @@ -624,15 +624,15 @@ namespace cscdqm { mo->Fill(alct_bxn); if (getCSCHisto(h::CSC_ALCTXX_QUALITY, crateID, dmbID, lct, mo)) - mo->Fill(alctsDatas[lct].getKeyWG(), alctsDatas[lct].getQuality()); + mo->Fill(alctsDatas[lct].keyWireGroup(), alctsDatas[lct].quality()); if (mo_EventDisplay) { - mo_EventDisplay->SetBinContent(2, alctsDatas[lct].getKeyWG(), alct_bxn + 1); - mo_EventDisplay->SetBinContent(3, alctsDatas[lct].getKeyWG(), alctsDatas[lct].getQuality()); + mo_EventDisplay->SetBinContent(2, alctsDatas[lct].keyWireGroup(), alct_bxn + 1); + mo_EventDisplay->SetBinContent(3, alctsDatas[lct].keyWireGroup(), alctsDatas[lct].quality()); } if (getCSCHisto(h::CSC_ALCTXX_QUALITY_DISTR, crateID, dmbID, lct, mo)) { - mo->Fill(alctsDatas[lct].getQuality()); + mo->Fill(alctsDatas[lct].quality()); if (lct == 0) { MonitorObject* mo1 = nullptr; if (cscPosition && getEMUHisto(h::EMU_CSC_ALCT0_QUALITY, mo1)) { @@ -642,16 +642,16 @@ namespace cscdqm { } if (getCSCHisto(h::CSC_ALCTXX_QUALITY_PROFILE, crateID, dmbID, lct, mo)) - mo->Fill(alctsDatas[lct].getKeyWG(), alctsDatas[lct].getQuality()); + mo->Fill(alctsDatas[lct].keyWireGroup(), alctsDatas[lct].quality()); if (getCSCHisto(h::CSC_ALCTXX_PATTERN, crateID, dmbID, lct, mo)) { - int pattern = (alctsDatas[lct].getAccelerator() << 1) + alctsDatas[lct].getCollisionB(); - int keywg = alctsDatas[lct].getKeyWG(); + int pattern = (alctsDatas[lct].accelerator() << 1) + alctsDatas[lct].collisionB(); + int keywg = alctsDatas[lct].keyWireGroup(); mo->Fill(keywg, pattern); } if (getCSCHisto(h::CSC_ALCTXX_PATTERN_DISTR, crateID, dmbID, lct, mo)) { - int pattern = (alctsDatas[lct].getAccelerator() << 1) + alctsDatas[lct].getCollisionB(); + int pattern = (alctsDatas[lct].accelerator() << 1) + alctsDatas[lct].collisionB(); mo->Fill(pattern); } } @@ -863,7 +863,7 @@ namespace cscdqm { CSCTMBTrailer* tmbTrailer = tmbData->tmbTrailer(); if (tmbHeader && tmbTrailer) { - CSCCLCTData* clctData = data.clctData(); + CSCComparatorData* comparatorData = data.comparatorData(); std::vector clctsDatasTmp = tmbHeader->CLCTDigis(cid.rawId()); std::vector clctsDatas; @@ -986,7 +986,7 @@ namespace cscdqm { if (clctsDatas.size() == 1) { if (getCSCHisto(h::CSC_CLCT0_CLSSIFICATION, crateID, dmbID, mo)) { - if (clctsDatas[0].getStripType()) + if (clctsDatas[0].stripType()) mo->Fill(0.0); else mo->Fill(1.0); @@ -995,15 +995,15 @@ namespace cscdqm { if (clctsDatas.size() == 2) { if (getCSCHisto(h::CSC_CLCT1_VS_CLCT0_KEY_STRIP, crateID, dmbID, mo)) - mo->Fill(clctsDatas[0].getKeyStrip(), clctsDatas[1].getKeyStrip()); + mo->Fill(clctsDatas[0].keyStrip(), clctsDatas[1].keyStrip()); if (getCSCHisto(h::CSC_CLCT0_CLCT1_CLSSIFICATION, crateID, dmbID, mo)) { - if (clctsDatas[0].getStripType() && clctsDatas[1].getStripType()) + if (clctsDatas[0].stripType() && clctsDatas[1].stripType()) mo->Fill(0.0); - if (clctsDatas[0].getStripType() && !clctsDatas[1].getStripType()) + if (clctsDatas[0].stripType() && !clctsDatas[1].stripType()) mo->Fill(1.0); - if (!clctsDatas[0].getStripType() && clctsDatas[1].getStripType()) + if (!clctsDatas[0].stripType() && clctsDatas[1].stripType()) mo->Fill(2.0); - if (!clctsDatas[0].getStripType() && !clctsDatas[1].getStripType()) + if (!clctsDatas[0].stripType() && !clctsDatas[1].stripType()) mo->Fill(3.0); } } @@ -1026,9 +1026,9 @@ namespace cscdqm { for (uint32_t lct = 0; lct < clctsDatas.size(); lct++) { if (getCSCHisto(h::CSC_CLCTXX_BXN, crateID, dmbID, lct, mo)) - mo->Fill(clctsDatas[lct].getFullBX() % 64); + mo->Fill(clctsDatas[lct].fullBX() % 64); - int clct_dtime = clctsDatas[lct].getFullBX() - tmbHeader->BXNCount(); + int clct_dtime = clctsDatas[lct].fullBX() - tmbHeader->BXNCount(); if (clct_dtime > 0) { clct_dtime -= 3564; } @@ -1064,7 +1064,7 @@ namespace cscdqm { // == For CLCT0 Fill Summary dTime Histograms if (lct == 0) { - /* -- Moved + /* -- Moved if (cid.endcap() == 1) { if (mo_CSC_Plus_endcap_CLCT0_dTime) mo_CSC_Plus_endcap_CLCT0_dTime->Fill(dTime); } @@ -1081,43 +1081,43 @@ namespace cscdqm { } } - /** LOG_DEBUG << "CLCT BX = " << clctsDatas[lct].getBX() << " TMB BX = " << tmbHeader->BXNCount() << " 03 = " << (int)(tmbHeader->BXNCount()&0x3); */ - /** LOG_DEBUG << "diff = " << clctsDatas[lct].getBX()-(tmbHeader->BXNCount()&0x3); */ - LOG_DEBUG << "LCT:" << lct << " Type:" << clctsDatas[lct].getStripType() - << " Strip:" << clctsDatas[lct].getKeyStrip(); + /** LOG_DEBUG << "CLCT BX = " << clctsDatas[lct].bx() << " TMB BX = " << tmbHeader->BXNCount() << " 03 = " << (int)(tmbHeader->BXNCount()&0x3); */ + /** LOG_DEBUG << "diff = " << clctsDatas[lct].bx()-(tmbHeader->BXNCount()&0x3); */ + LOG_DEBUG << "LCT:" << lct << " Type:" << clctsDatas[lct].stripType() + << " Strip:" << clctsDatas[lct].keyStrip(); - if (clctsDatas[lct].getStripType()) { // HalfStrip Type + if (clctsDatas[lct].stripType()) { // HalfStrip Type if (getCSCHisto(h::CSC_CLCTXX_KEYHALFSTRIP, crateID, dmbID, lct, mo)) - mo->Fill(clctsDatas[lct].getKeyStrip()); + mo->Fill(clctsDatas[lct].keyStrip()); if (getCSCHisto(h::CSC_CLCTXX_DTIME_VS_HALF_STRIP, crateID, dmbID, lct, mo)) { - mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime); + mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime); /* if (clct_dtime < -16) { - mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime + 32); + mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime + 32); } else { - if (clct_dtime > 16) mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime - 32); - else mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime); + if (clct_dtime > 16) mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime - 32); + else mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime); } */ } if (getCSCHisto(h::CSC_CLCTXX_DTIME_PROFILE, crateID, dmbID, lct, mo)) { - mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime); + mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime); /* if (clct_dtime < -16) { - mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime + 32); + mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime + 32); } else { - if (clct_dtime > 16) mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime - 32); - else mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime); + if (clct_dtime > 16) mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime - 32); + else mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime); } */ } if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_PATTERN, crateID, dmbID, lct, mo)) { - int pattern_clct = clctsDatas[lct].getPattern(); - /** int pattern_clct = (int)((clctsDatas[lct].getPattern()>>1)&0x3); */ + int pattern_clct = clctsDatas[lct].pattern(); + /** int pattern_clct = (int)((clctsDatas[lct].pattern()>>1)&0x3); */ /** pattern_clct = Number of patterns in CLCT */ /** Last (left) bit is bend. Positive bend = 1, negative bend = 0 */ double tbin = -1; @@ -1159,7 +1159,7 @@ namespace cscdqm { } if (tbin >= 0) - mo->Fill(clctsDatas[lct].getKeyStrip(), tbin); + mo->Fill(clctsDatas[lct].keyStrip(), tbin); MonitorObject* mo1 = nullptr; if (getCSCHisto(h::CSC_CLCT_HALF_STRIP_PATTERN_DISTR, crateID, dmbID, lct, mo1)) @@ -1167,15 +1167,15 @@ namespace cscdqm { } if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY, crateID, dmbID, lct, mo)) - mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality())); + mo->Fill((int)(clctsDatas[lct].keyStrip()), (int)(clctsDatas[lct].quality())); if (mo_EventDisplay) { - mo_EventDisplay->SetBinContent(10, clctsDatas[lct].getKeyStrip(), clct_dtime); - mo_EventDisplay->SetBinContent(11, clctsDatas[lct].getKeyStrip(), clctsDatas[lct].getQuality()); + mo_EventDisplay->SetBinContent(10, clctsDatas[lct].keyStrip(), clct_dtime); + mo_EventDisplay->SetBinContent(11, clctsDatas[lct].keyStrip(), clctsDatas[lct].quality()); } if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY_DISTR, crateID, dmbID, lct, mo)) { - mo->Fill((int)(clctsDatas[lct].getQuality())); + mo->Fill((int)(clctsDatas[lct].quality())); if (lct == 0) { MonitorObject* mo1 = nullptr; if (cscPosition && getEMUHisto(h::EMU_CSC_CLCT0_QUALITY, mo1)) { @@ -1185,58 +1185,58 @@ namespace cscdqm { } if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY_PROFILE, crateID, dmbID, lct, mo)) - mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality())); + mo->Fill((int)(clctsDatas[lct].keyStrip()), (int)(clctsDatas[lct].quality())); } else { // DiStrip Type LOG_INFO << "Entering block!"; if (getCSCHisto(h::CSC_CLCTXX_KEYDISTRIP, crateID, dmbID, lct, mo)) - mo->Fill(clctsDatas[lct].getKeyStrip()); + mo->Fill(clctsDatas[lct].keyStrip()); else LOG_ERROR << "Not found h::CSC_CLCTXX_KEYDISTRIP = " << h::CSC_CLCTXX_KEYDISTRIP; if (lct == 0) - clct_kewdistrip = clctsDatas[lct].getKeyStrip(); + clct_kewdistrip = clctsDatas[lct].keyStrip(); if (getCSCHisto(h::CSC_CLCTXX_DTIME_VS_DISTRIP, crateID, dmbID, lct, mo)) { - mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime); + mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime); /* - if(clct_dtime < -16) mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime + 32); + if(clct_dtime < -16) mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime + 32); else { - if(clct_dtime > 16) mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime - 32); - else mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime); + if(clct_dtime > 16) mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime - 32); + else mo->Fill((int)(clctsDatas[lct].keyStrip()), clct_dtime); } */ } if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_PATTERN, crateID, dmbID, lct, mo)) { - int pattern_clct = (int)((clctsDatas[lct].getPattern() >> 1) & 0x3); + int pattern_clct = (int)((clctsDatas[lct].pattern() >> 1) & 0x3); /** pattern_clct = Number of patterns in CLCT */ /** Last (left) bit is bend. Positive bend = 1, negative bend = 0 */ if (pattern_clct == 1) - mo->Fill(clctsDatas[lct].getKeyStrip(), 7.0); + mo->Fill(clctsDatas[lct].keyStrip(), 7.0); if (pattern_clct == 3) - mo->Fill(clctsDatas[lct].getKeyStrip(), 6.0); + mo->Fill(clctsDatas[lct].keyStrip(), 6.0); if (pattern_clct == 5) - mo->Fill(clctsDatas[lct].getKeyStrip(), 5.0); + mo->Fill(clctsDatas[lct].keyStrip(), 5.0); if (pattern_clct == 7) - mo->Fill(clctsDatas[lct].getKeyStrip(), 4.0); + mo->Fill(clctsDatas[lct].keyStrip(), 4.0); if (pattern_clct == 6) - mo->Fill(clctsDatas[lct].getKeyStrip(), 3.0); + mo->Fill(clctsDatas[lct].keyStrip(), 3.0); if (pattern_clct == 4) - mo->Fill(clctsDatas[lct].getKeyStrip(), 2.0); + mo->Fill(clctsDatas[lct].keyStrip(), 2.0); if (pattern_clct == 2) - mo->Fill(clctsDatas[lct].getKeyStrip(), 1.0); + mo->Fill(clctsDatas[lct].keyStrip(), 1.0); if (pattern_clct == 0) - mo->Fill(clctsDatas[lct].getKeyStrip(), 0.0); + mo->Fill(clctsDatas[lct].keyStrip(), 0.0); } if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_QUALITY, crateID, dmbID, lct, mo)) - mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality())); + mo->Fill((int)(clctsDatas[lct].keyStrip()), (int)(clctsDatas[lct].quality())); if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_QUALITY_PROFILE, crateID, dmbID, lct, mo)) - mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality())); + mo->Fill((int)(clctsDatas[lct].keyStrip()), (int)(clctsDatas[lct].quality())); } } @@ -1246,7 +1246,7 @@ namespace cscdqm { int NumberOfLayersWithHitsInCLCT = 0; int NumberOfHalfStripsWithHitsInCLCT = 0; - if (clctData && clctData->check()) { + if (comparatorData && comparatorData->check()) { MonitorObject* mo_CFEB_Comparators_TimeSamples = nullptr; getCSCHisto(h::CSC_CFEB_COMPARATORS_TIMESAMPLES, crateID, dmbID, mo_CFEB_Comparators_TimeSamples); @@ -1268,7 +1268,7 @@ namespace cscdqm { int tbin_clct_previous = -1; bool CheckLayerCLCT = true; - std::vector compOutData = clctData->comparatorDigis(nLayer, nCFEB); + std::vector compOutData = comparatorData->comparatorDigis(nLayer, nCFEB); for (std::vector::iterator compOutDataItr = compOutData.begin(); compOutDataItr != compOutData.end(); diff --git a/DQM/L1TMonitor/src/L1TCSCTF.cc b/DQM/L1TMonitor/src/L1TCSCTF.cc index 53fa20efb8d43..d116ec955958e 100644 --- a/DQM/L1TMonitor/src/L1TCSCTF.cc +++ b/DQM/L1TMonitor/src/L1TCSCTF.cc @@ -948,9 +948,9 @@ void L1TCSCTF::analyze(const Event& e, const EventSetup& c) { int ring = (*csc).first.ring(); int cscId = (*csc).first.triggerCscId() - 1; int fpga = (subSector ? subSector - 1 : station + 1); - int strip = lct->getStrip(); - int keyWire = lct->getKeyWG(); - int bx = lct->getBX(); + int strip = lct->strip(); + int keyWire = lct->keyWireGroup(); + int bx = lct->bx(); int endcapAssignment = 1; int shift = 1; @@ -1015,7 +1015,7 @@ void L1TCSCTF::analyze(const Event& e, const EventSetup& c) { lclphidat lclPhi; try { lclPhi = srLUTs_[fpga][EndCapLUT][sector]->localPhi( - lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend(), gangedME11a_); + lct->strip(), lct->pattern(), lct->quality(), lct->bend(), gangedME11a_); } catch (cms::Exception&) { bzero(&lclPhi, sizeof(lclPhi)); } @@ -1023,7 +1023,7 @@ void L1TCSCTF::analyze(const Event& e, const EventSetup& c) { gblphidat gblPhi; try { gblPhi = - srLUTs_[fpga][EndCapLUT][sector]->globalPhiME(lclPhi.phi_local, lct->getKeyWG(), cscId + 1, gangedME11a_); + srLUTs_[fpga][EndCapLUT][sector]->globalPhiME(lclPhi.phi_local, lct->keyWireGroup(), cscId + 1, gangedME11a_); } catch (cms::Exception&) { bzero(&gblPhi, sizeof(gblPhi)); } @@ -1031,7 +1031,7 @@ void L1TCSCTF::analyze(const Event& e, const EventSetup& c) { gbletadat gblEta; try { gblEta = srLUTs_[fpga][EndCapLUT][sector]->globalEtaME( - lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId + 1, gangedME11a_); + lclPhi.phi_bend_local, lclPhi.phi_local, lct->keyWireGroup(), cscId + 1, gangedME11a_); } catch (cms::Exception&) { bzero(&gblEta, sizeof(gblEta)); } @@ -1399,9 +1399,9 @@ void L1TCSCTF::analyze(const Event& e, const EventSetup& c) { lclphidat lclPhi; lclPhi = srLUTs_[fpga]->localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend()); gblphidat gblPhi; - gblPhi = srLUTs_[fpga]->globalPhiME(lclPhi.phi_local, lct->getKeyWG(), cscId+1); + gblPhi = srLUTs_[fpga]->globalPhiME(lclPhi.phi_local, lct->keyWireGroup(), cscId+1); gbletadat gblEta; - gblEta = srLUTs_[fpga]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1); + gblEta = srLUTs_[fpga]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->keyWireGroup(), cscId+1); haloVals[indexHalo][2] = gblEta.global_eta/127. * 1.5 + 0.9; } //station1 or 2 @@ -1448,9 +1448,9 @@ void L1TCSCTF::analyze(const Event& e, const EventSetup& c) { // lclphidat lclPhi; // lclPhi = srLUTs_[fpga]->localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend()); // gblphidat gblPhi; - // gblPhi = srLUTs_[fpga]->globalPhiME(lclPhi.phi_local, lct->getKeyWG(), cscId+1); + // gblPhi = srLUTs_[fpga]->globalPhiME(lclPhi.phi_local, lct->keyWireGroup(), cscId+1); // gbletadat gblEta; - // gblEta = srLUTs_[fpga]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1); + // gblEta = srLUTs_[fpga]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->keyWireGroup(), cscId+1); // haloEta[station-1] = gblEta.global_eta/127. * 1.5 + 0.9; // if(station==1 && cscId<2) haloME11 = true; // } @@ -1489,15 +1489,15 @@ void L1TCSCTF::analyze(const Event& e, const EventSetup& c) { for (std::vector::const_iterator stub = vstubs.begin(); stub != vstubs.end(); stub++) { if (verbose_) { edm::LogInfo("DataNotFound") << "\n mbEndcap: " << stub->endcap(); - edm::LogInfo("DataNotFound") << "\n stub->getStrip()[FLAG]: " << stub->getStrip(); - edm::LogInfo("DataNotFound") << "\n stub->getKeyWG()[CAL]: " << stub->getKeyWG(); - edm::LogInfo("DataNotFound") << "\n stub->BX(): " << stub->BX(); + edm::LogInfo("DataNotFound") << "\n stub->strip()[FLAG]: " << stub->strip(); + edm::LogInfo("DataNotFound") << "\n stub->keyWireGroup()[CAL]: " << stub->keyWireGroup(); + edm::LogInfo("DataNotFound") << "\n stub->bx(): " << stub->bx(); edm::LogInfo("DataNotFound") << "\n stub->sector(): " << stub->sector(); edm::LogInfo("DataNotFound") << "\n stub->subsector(): " << stub->subsector(); edm::LogInfo("DataNotFound") << "\n stub->station(): " << stub->station(); edm::LogInfo("DataNotFound") << "\n stub->phiPacked(): " << stub->phiPacked(); - edm::LogInfo("DataNotFound") << "\n stub->getBend(): " << stub->getBend(); - edm::LogInfo("DataNotFound") << "\n stub->getQuality(): " << stub->getQuality(); + edm::LogInfo("DataNotFound") << "\n stub->bend(): " << stub->bend(); + edm::LogInfo("DataNotFound") << "\n stub->quality(): " << stub->quality(); edm::LogInfo("DataNotFound") << "\n stub->cscid(): " << stub->cscid() << endl; } // define the sector ID @@ -1507,10 +1507,10 @@ void L1TCSCTF::analyze(const Event& e, const EventSetup& c) { // horrible! They used the same class to write up the LCT and MB info, // but given the MB does not have strip and WG they replaced this two // with the flag and cal bits... :S - if (stub->getKeyWG() == 0) //!CAL as Janos adviced + if (stub->keyWireGroup() == 0) //!CAL as Janos adviced { // if FLAG =1, muon belong to previous BX - int bxDT = stub->BX() - stub->getStrip(); // correct by the FLAG + int bxDT = stub->BX() - stub->strip(); // correct by the FLAG int subDT = stub->subsector(); // Fill the event only if CSC had or would have triggered @@ -1542,7 +1542,7 @@ void L1TCSCTF::analyze(const Event& e, const EventSetup& c) { } } // loop on the tracks } //if (isCSCcand_){ - } //if (stub->getKeyWG() == 0) { + } //if (stub->keyWireGroup() == 0) { } } } diff --git a/DQM/L1TMonitor/src/L1TCSCTPG.cc b/DQM/L1TMonitor/src/L1TCSCTPG.cc index 87896c5a7115b..2927ca05c0e3d 100644 --- a/DQM/L1TMonitor/src/L1TCSCTPG.cc +++ b/DQM/L1TMonitor/src/L1TCSCTPG.cc @@ -63,39 +63,39 @@ void L1TCSCTPG::analyze(const Event& e, const EventSetup& c) { cscItr1++) { CSCCorrelatedLCTDigiCollection::Range range1 = pCSCTPGcorrlcts->get((*cscItr1).first); for (CSCCorrelatedLCTDigiCollection::const_iterator lctItr1 = range1.first; lctItr1 != range1.second; lctItr1++) { - csctpgpattern->Fill(lctItr1->getCLCTPattern()); + csctpgpattern->Fill(lctItr1->clctPattern()); if (verbose_) { - std::cout << "CSC TPG CLCT pattern " << lctItr1->getCLCTPattern() << std::endl; + std::cout << "CSC TPG CLCT pattern " << lctItr1->clctPattern() << std::endl; } - csctpgquality->Fill(lctItr1->getQuality()); + csctpgquality->Fill(lctItr1->quality()); if (verbose_) { - std::cout << "CSC LCT quality " << lctItr1->getQuality() << std::endl; + std::cout << "CSC LCT quality " << lctItr1->quality() << std::endl; } - csctpgwg->Fill(lctItr1->getKeyWG()); + csctpgwg->Fill(lctItr1->keyWireGroup()); if (verbose_) { - std::cout << "CSC LCT wire group " << lctItr1->getKeyWG() << std::endl; + std::cout << "CSC LCT wire group " << lctItr1->keyWireGroup() << std::endl; } - csctpgstrip->Fill(lctItr1->getStrip()); + csctpgstrip->Fill(lctItr1->strip()); if (verbose_) { - std::cout << "CSC LCT strip " << lctItr1->getStrip() << std::endl; + std::cout << "CSC LCT strip " << lctItr1->strip() << std::endl; } - csctpgstriptype->Fill(lctItr1->getStripType()); + csctpgstriptype->Fill(lctItr1->stripType()); if (verbose_) { - std::cout << "CSC LCT strip type" << lctItr1->getStripType() << std::endl; + std::cout << "CSC LCT strip type" << lctItr1->stripType() << std::endl; } - csctpgbend->Fill(lctItr1->getBend()); + csctpgbend->Fill(lctItr1->bend()); if (verbose_) { - std::cout << "CSC LCT bend " << lctItr1->getBend() << std::endl; + std::cout << "CSC LCT bend " << lctItr1->bend() << std::endl; } - csctpgbx->Fill(lctItr1->getBX()); + csctpgbx->Fill(lctItr1->bx()); if (verbose_) { - std::cout << "CSC LCT bx " << lctItr1->getBX() << std::endl; + std::cout << "CSC LCT bx " << lctItr1->bx() << std::endl; } } } diff --git a/DQM/L1TMonitor/src/L1TdeCSCTF.cc b/DQM/L1TMonitor/src/L1TdeCSCTF.cc index d4ce91fb7992b..3d00e14924881 100644 --- a/DQM/L1TMonitor/src/L1TdeCSCTF.cc +++ b/DQM/L1TMonitor/src/L1TdeCSCTF.cc @@ -3,11 +3,11 @@ * written by J. Gartner * * 2011.03.11 expanded by GP Di Giovanni - * + * * There is quality test allowing to check elements outside the * diagonal, so I need to add the 1D plot with all elements in the diagonal * in the first bin and all elements outside the diagonal in the second bin - * + * * In such way we can run the ContentsXRange quality test... */ @@ -71,10 +71,10 @@ L1TdeCSCTF::L1TdeCSCTF(ParameterSet const& pset) { { for(int subsectorItr = 0; subsectorItr < 2; subsectorItr++) { - srLUTs_[endcapItr-1][sectorItr-1][subsectorItr] = new CSCSectorReceiverLUT(endcapItr, sectorItr, subsectorItr+1, stationItr, srLUTset, TMB07); + srLUTs_[endcapItr-1][sectorItr-1][subsectorItr] = new CSCSectorReceiverLUT(endcapItr, sectorItr, subsectorItr+1, stationItr, srLUTset, TMB07); } } else { - srLUTs_[endcapItr-1][sectorItr-1][stationItr] = new CSCSectorReceiverLUT(endcapItr, sectorItr, 0, stationItr, srLUTset, TMB07); + srLUTs_[endcapItr-1][sectorItr-1][stationItr] = new CSCSectorReceiverLUT(endcapItr, sectorItr, 0, stationItr, srLUTset, TMB07); } //if for station 1 or 234 } // stationItr loop } // sectorItr loop @@ -461,7 +461,7 @@ void L1TdeCSCTF::analyze(Event const& e, EventSetup const& es) { break; if ((stu->BX() > 4) && (stu->BX() < 9)) { dDtStub[0][dDtCounter] = stu->phiPacked(); - dDtStub[1][dDtCounter] = stu->getQuality(); + dDtStub[1][dDtCounter] = stu->quality(); dDtStub[2][dDtCounter] = stu->endcap(); dDtStub[3][dDtCounter] = stu->sector(); dDtStub[4][dDtCounter] = stu->subsector(); @@ -489,7 +489,7 @@ void L1TdeCSCTF::analyze(Event const& e, EventSetup const& es) { break; if ((eStu->BX() > 4) && (eStu->BX() < 9)) { eDtStub[0][eDtCounter] = eStu->phiPacked(); - eDtStub[1][eDtCounter] = eStu->getQuality(); + eDtStub[1][eDtCounter] = eStu->quality(); eDtStub[2][eDtCounter] = eStu->endcap(); eDtStub[3][eDtCounter] = eStu->sector(); eDtStub[4][eDtCounter] = eStu->subsector(); From 77808c8eb542a048677f4ac54a2f8ec684569c64 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 10 May 2020 14:12:25 -0500 Subject: [PATCH 10/12] CMS code rules for CSC TPs --- DQMOffline/Muon/interface/CSCOfflineMonitor.h | 14 +- DQMOffline/Muon/src/CSCOfflineMonitor.cc | 44 +- .../CSCRawToDigi/src/CSCComparatorData.cc | 361 +++++++++++++++ .../interface/CSCGEMMotherboard.h | 22 +- .../plugins/CSCAnodeLCTAnalyzer.cc | 12 +- .../plugins/CSCCathodeLCTAnalyzer.cc | 12 +- .../plugins/CSCTriggerPrimitivesReader.cc | 434 +++++++++--------- .../src/CSCAnodeLCTProcessor.cc | 76 +-- .../src/CSCCathodeLCTProcessor.cc | 27 +- .../src/CSCGEMMotherboard.cc | 48 +- .../src/CSCGEMMotherboardME11.cc | 30 +- .../src/CSCGEMMotherboardME21.cc | 26 +- .../src/CSCMotherboard.cc | 48 +- .../src/CSCMotherboardME11.cc | 6 +- .../src/CSCMuonPortCard.cc | 2 +- .../src/CSCUpgradeAnodeLCTProcessor.cc | 6 +- .../src/CSCUpgradeMotherboard.cc | 2 +- .../src/CSCUpgradeMotherboardLUT.cc | 4 +- .../DTTrackFinder/src/L1MuDTSectorReceiver.cc | 2 +- .../HardwareValidation/interface/DEutils.h | 160 +++---- .../HardwareValidation/plugins/L1EmulBias.h | 6 +- .../L1TMuonEndCap/src/PrimitiveSelection.cc | 6 +- .../L1TMuonOverlap/src/AngleConverter.cc | 8 +- .../L1TMuonOverlap/src/OMTFinputMaker.cc | 2 +- L1Trigger/L1TNtuples/src/L1AnalysisCSCTF.cc | 64 +-- .../CSCValidation/src/CSCValidation.h | 2 +- 26 files changed, 889 insertions(+), 535 deletions(-) diff --git a/DQMOffline/Muon/interface/CSCOfflineMonitor.h b/DQMOffline/Muon/interface/CSCOfflineMonitor.h index 7054c541aa27b..52a4b39df2a84 100644 --- a/DQMOffline/Muon/interface/CSCOfflineMonitor.h +++ b/DQMOffline/Muon/interface/CSCOfflineMonitor.h @@ -60,7 +60,7 @@ #include "DataFormats/FEDRawData/interface/FEDNumbering.h" #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" -#include "EventFilter/CSCRawToDigi/interface/CSCCLCTData.h" +#include "EventFilter/CSCRawToDigi/interface/CSCComparatorData.h" #include "EventFilter/CSCRawToDigi/interface/CSCDCCExaminer.h" #include "EventFilter/CSCRawToDigi/interface/CSCDCCEventData.h" #include "EventFilter/CSCRawToDigi/interface/CSCDDUEventData.h" @@ -231,12 +231,12 @@ class CSCOfflineMonitor : public DQMEDAnalyzer { MonitorElement *hSensitiveAreaEvt; // BX monitoring - MonitorElement *hALCTgetBX; - MonitorElement *hALCTgetBXSerial; - // MonitorElement *hALCTgetBXChamberMeans; - // MonitorElement *hALCTgetBX2DMeans; - MonitorElement *hALCTgetBX2Denominator; - MonitorElement *hALCTgetBX2DNumerator; + MonitorElement *hALCTbx; + MonitorElement *hALCTbxSerial; + // MonitorElement *hALCTbxChamberMeans; + // MonitorElement *hALCTbx2DMeans; + MonitorElement *hALCTbx2Denominator; + MonitorElement *hALCTbx2DNumerator; MonitorElement *hALCTMatch; MonitorElement *hALCTMatchSerial; diff --git a/DQMOffline/Muon/src/CSCOfflineMonitor.cc b/DQMOffline/Muon/src/CSCOfflineMonitor.cc index 320921bb3f5e5..540948ca19c62 100644 --- a/DQMOffline/Muon/src/CSCOfflineMonitor.cc +++ b/DQMOffline/Muon/src/CSCOfflineMonitor.cc @@ -739,18 +739,18 @@ void CSCOfflineMonitor::bookHistograms(DQMStore::IBooker& ibooker, // bx monitor for trigger synchronization ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/BXMonitor"); - hALCTgetBX = ibooker.book1D("hALCTgetBX", "ALCT position in ALCT-L1A match window [BX]", 7, -0.5, 6.5); - // hALCTgetBXChamberMeans = ibooker.book1D("hALCTgetBXChamberMeans","Chamber Mean ALCT position in ALCT-L1A match window [BX]",60,0,6); - hALCTgetBXSerial = - ibooker.book2D("hALCTgetBXSerial", "ALCT position in ALCT-L1A match window [BX]", 601, -0.5, 600.5, 7, -0.5, 6.5); - hALCTgetBXSerial->setAxisTitle("Chamber Serial Number"); - hALCTgetBX2DNumerator = ibooker.book2D( - "hALCTgetBX2DNumerator", "ALCT position in ALCT-L1A match window [BX] (sum)", 36, 0.5, 36.5, 20, 0.5, 20.5); - // hALCTgetBX2DMeans = ibooker.book2D("hALCTgetBX2DMeans","ALCT position in ALCT-L1A match window [BX]",36,0.5,36.5,20,0.5,20.5); - hALCTgetBX2Denominator = - ibooker.book2D("hALCTgetBX2Denominator", "Number of ALCT Digis checked", 36, 0.5, 36.5, 20, 0.5, 20.5); - // hALCTgetBX2DMeans->setAxisTitle("Chamber #"); - hALCTgetBX2Denominator->setAxisTitle("Chamber #"); + hALCTbx = ibooker.book1D("hALCTbx", "ALCT position in ALCT-L1A match window [BX]", 7, -0.5, 6.5); + // hALCTbxChamberMeans = ibooker.book1D("hALCTbxChamberMeans","Chamber Mean ALCT position in ALCT-L1A match window [BX]",60,0,6); + hALCTbxSerial = + ibooker.book2D("hALCTbxSerial", "ALCT position in ALCT-L1A match window [BX]", 601, -0.5, 600.5, 7, -0.5, 6.5); + hALCTbxSerial->setAxisTitle("Chamber Serial Number"); + hALCTbx2DNumerator = ibooker.book2D( + "hALCTbx2DNumerator", "ALCT position in ALCT-L1A match window [BX] (sum)", 36, 0.5, 36.5, 20, 0.5, 20.5); + // hALCTbx2DMeans = ibooker.book2D("hALCTbx2DMeans","ALCT position in ALCT-L1A match window [BX]",36,0.5,36.5,20,0.5,20.5); + hALCTbx2Denominator = + ibooker.book2D("hALCTbx2Denominator", "Number of ALCT Digis checked", 36, 0.5, 36.5, 20, 0.5, 20.5); + // hALCTbx2DMeans->setAxisTitle("Chamber #"); + hALCTbx2Denominator->setAxisTitle("Chamber #"); hALCTMatch = ibooker.book1D("hALCTMatch", "ALCT position in ALCT-CLCT match window [BX]", 7, -0.5, 6.5); // hALCTMatchChamberMeans = ibooker.book1D("hALCTMatchChamberMeans","Chamber Mean ALCT position in ALCT-CLCT match window [BX]",60,0,6); hALCTMatchSerial = ibooker.book2D( @@ -794,8 +794,8 @@ void CSCOfflineMonitor::bookHistograms(DQMStore::IBooker& ibooker, // applyCSClabels(hWireEff2, SMALL, Y); applyCSClabels(hWireSTE2, EXTENDED, Y); applyCSClabels(hSensitiveAreaEvt, EXTENDED, Y); - // applyCSClabels(hALCTgetBX2DMeans, EXTENDED, Y); - applyCSClabels(hALCTgetBX2Denominator, EXTENDED, Y); + // applyCSClabels(hALCTbx2DMeans, EXTENDED, Y); + applyCSClabels(hALCTbx2Denominator, EXTENDED, Y); // applyCSClabels(hALCTMatch2DMeans, EXTENDED, Y); applyCSClabels(hALCTMatch2Denominator, EXTENDED, Y); // applyCSClabels(hCLCTL1A2DMeans, EXTENDED, Y); @@ -886,7 +886,7 @@ void CSCOfflineMonitor::doOccupancies(edm::Handle strips // Valid digi in the chamber (or in neighbouring chamber) if ((*digiIt).isValid()) { //Check whether this CLCT came from ME11a - if (kStation == 1 && kRing == 1 && (*digiIt).getKeyStrip() > 128) + if (kStation == 1 && kRing == 1 && (*digiIt).keyStrip() > 128) kRing = 4; clcto[kEndcap - 1][kStation - 1][kRing - 1][kChamber - 1] = true; } @@ -1791,10 +1791,10 @@ void CSCOfflineMonitor::doBXMonitor(edm::Handle alcts, for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) { // Valid digi in the chamber (or in neighbouring chamber) if ((*digiIt).isValid()) { - hALCTgetBX->Fill((*digiIt).getBX()); - hALCTgetBXSerial->Fill(chamberSerial(idALCT), (*digiIt).getBX()); - hALCTgetBX2DNumerator->Fill(idALCT.chamber(), typeIndex(idALCT, 2), (*digiIt).getBX()); - hALCTgetBX2Denominator->Fill(idALCT.chamber(), typeIndex(idALCT, 2)); + hALCTbx->Fill((*digiIt).bx()); + hALCTbxSerial->Fill(chamberSerial(idALCT), (*digiIt).bx()); + hALCTbx2DNumerator->Fill(idALCT.chamber(), typeIndex(idALCT, 2), (*digiIt).bx()); + hALCTbx2Denominator->Fill(idALCT.chamber(), typeIndex(idALCT, 2)); } } } // end ALCT Digi loop @@ -1932,7 +1932,7 @@ void CSCOfflineMonitor::doBXMonitor(edm::Handle alcts, bool goodTMB = false; if (nclct && cscData[iCSC].tmbData()) { if (cscData[iCSC].tmbHeader()->check()) { - if (cscData[iCSC].clctData()->check()) + if (cscData[iCSC].comparatorData()->check()) goodTMB = true; } } @@ -1943,7 +1943,7 @@ void CSCOfflineMonitor::doBXMonitor(edm::Handle alcts, if (clcts.empty() || !(clcts[0].isValid())) continue; // Check if the CLCT was in ME11a (ring 4) - if (layer.station() == 1 && layer.ring() == 1 && clcts[0].getKeyStrip() > 128) { + if (layer.station() == 1 && layer.ring() == 1 && clcts[0].keyStrip() > 128) { layer = CSCDetId(layer.endcap(), layer.station(), 4, layer.chamber()); } hALCTMatch->Fill(tmbHead->ALCTMatchTime()); @@ -1955,7 +1955,7 @@ void CSCOfflineMonitor::doBXMonitor(edm::Handle alcts, hALCTMatch2Denominator->Fill(layer.chamber(), typeIndex(layer, 2)); } - int TMB_CLCTpre_rel_L1A = tmbHead->BXNCount() - clcts[0].getFullBX(); + int TMB_CLCTpre_rel_L1A = tmbHead->BXNCount() - clcts[0].fullBX(); if (TMB_CLCTpre_rel_L1A > 3563) TMB_CLCTpre_rel_L1A = TMB_CLCTpre_rel_L1A - 3564; if (TMB_CLCTpre_rel_L1A < 0) diff --git a/EventFilter/CSCRawToDigi/src/CSCComparatorData.cc b/EventFilter/CSCRawToDigi/src/CSCComparatorData.cc index e69de29bb2d1d..a8571f243c3fa 100644 --- a/EventFilter/CSCRawToDigi/src/CSCComparatorData.cc +++ b/EventFilter/CSCRawToDigi/src/CSCComparatorData.cc @@ -0,0 +1,361 @@ +#include "EventFilter/CSCRawToDigi/interface/CSCComparatorData.h" +#include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h" +#include "DataFormats/MuonDetId/interface/CSCDetId.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include +#include +#include + +#ifdef LOCAL_UNPACK +bool CSCComparatorData::debug = false; +#else +#include +std::atomic CSCComparatorData::debug{false}; +#endif + +CSCComparatorData::CSCComparatorData(const CSCTMBHeader* tmbHeader) : ncfebs_(tmbHeader->NCFEBs()), ntbins_(tmbHeader->NTBins()) { + if (tmbHeader != nullptr) + theFirmwareVersion = tmbHeader->FirmwareVersion(); + else + theFirmwareVersion = 2007; + size_ = nlines(); + zero(); +} + +CSCComparatorData::CSCComparatorData(int ncfebs, int ntbins, int firmware_version) + : ncfebs_(ncfebs), ntbins_(ntbins), theFirmwareVersion(firmware_version) { + size_ = nlines(); + zero(); +} + +CSCComparatorData::CSCComparatorData(int ncfebs, int ntbins, const unsigned short* buf, int firmware_version) + : ncfebs_(ncfebs), ntbins_(ntbins), theFirmwareVersion(firmware_version) { + // add two more for odd ntbins, plus one for the e0c + // Oct 2004 Rick: e0c line belongs to CSCTMBTrailer + size_ = (nlines() % 2 == 1) ? nlines() + 2 : nlines(); + + memcpy(theData, buf, size_ * 2); +} + +void CSCComparatorData::zero() { + for (int ifeb = 0; ifeb < ncfebs_; ++ifeb) { + for (int tbin = 0; tbin < ntbins_; ++tbin) { + for (int layer = 1; layer <= 6; ++layer) { + dataWord(ifeb, tbin, layer) = CSCComparatorDataWord(ifeb, tbin, 0); + } + } + } +} + +std::vector CSCComparatorData::comparatorDigis(uint32_t idlayer, unsigned cfeb) { + static const bool doStripSwapping = true; + bool me1a = (CSCDetId::station(idlayer) == 1) && (CSCDetId::ring(idlayer) == 4); + bool zplus = (CSCDetId::endcap(idlayer) == 1); + bool me1b = (CSCDetId::station(idlayer) == 1) && (CSCDetId::ring(idlayer) == 1); + // bool me11 = (CSCDetId::station(idlayer)==1) && ((CSCDetId::ring(idlayer)==1) || (CSCDetId::ring(idlayer)==4)); + unsigned layer = CSCDetId::layer(idlayer); + + //looking for comp output on layer + std::vector result; + assert(layer > 0 && layer <= 6); + // this is pretty sparse data, so I wish we could check the + // data word by word, not bit by bit, but I don't see how to + // do the time sequencing that way. + for (int distrip = 0; distrip < 8; ++distrip) { + uint16_t tbinbitsS0HS0 = 0; + uint16_t tbinbitsS0HS1 = 0; + uint16_t tbinbitsS1HS0 = 0; + uint16_t tbinbitsS1HS1 = 0; + for (int tbin = 0; tbin < ntbins_ - 2; ++tbin) { + if (bitValue(cfeb, tbin, layer, distrip)) { + /// first do some checks + CSCComparatorDataWord word = dataWord(cfeb, tbin, layer); + assert(word.tbin_ == tbin); + assert(word.cfeb_ == cfeb); + // we have a hit. The next two time samples + // are the other two bits in the triad + int bit2 = bitValue(cfeb, tbin + 1, layer, distrip); + int bit3 = bitValue(cfeb, tbin + 2, layer, distrip); + // should count from zero + int chamberDistrip = distrip + cfeb * 8; + int HalfStrip = 4 * chamberDistrip + bit2 * 2 + bit3; + int output = 4 + bit2 * 2 + bit3; + /* + * Handles distrip logic; comparator output is for pairs of strips: + * hit bin dec + * x--- 100 4 + * -x-- 101 5 + * --x- 110 6 + * ---x 111 7 + * + */ + + if (debug) + LogTrace("CSCComparatorData|CSCRawToDigi") + << "fillComparatorOutputs: layer = " << layer << " timebin = " << tbin << " cfeb = " << cfeb + << " distrip = " << chamberDistrip << " HalfStrip = " << HalfStrip << " Output " << output << std::endl; + ///what is actually stored in comparator digis are 0/1 for left/right halfstrip for each strip + + ///constructing four bitted words for tbits on + if (output == 4) + tbinbitsS0HS0 = tbinbitsS0HS0 + (1 << tbin); + if (output == 5) + tbinbitsS0HS1 = tbinbitsS0HS1 + (1 << tbin); + if (output == 6) + tbinbitsS1HS0 = tbinbitsS1HS0 + (1 << tbin); + if (output == 7) + tbinbitsS1HS1 = tbinbitsS1HS1 + (1 << tbin); + + tbin += 2; + } + } //end of loop over time bins + //we do not have to check over the last couple of time bins if there are no hits since + //comparators take 3 time bins + + // Store digis each of possible four halfstrips for given distrip: + if (tbinbitsS0HS0 || tbinbitsS0HS1 || tbinbitsS1HS0 || tbinbitsS1HS1) { + unsigned int cfeb_corr = cfeb; + unsigned int distrip_corr = distrip; + + if (doStripSwapping) { + // Fix ordering of strips and CFEBs in ME1/1. + // SV, 27/05/08: keep CFEB=4 for ME1/a until CLCT trigger logic + // stops combining it with the info from the other 4 CFEBs (ME1/b). + // + if (theFirmwareVersion >= 2013) { + if (me1a && zplus) { + distrip_corr = 7 - distrip; // 0-7 -> 7-0 + cfeb_corr = 10 - cfeb; + } + if (me1b && !zplus) { + distrip_corr = 7 - distrip; + cfeb_corr = 3 - cfeb; + } + } else { + // if ( me1a ) { cfeb_corr = 0; } // reset 4 to 0 + if (me1a && zplus) { + distrip_corr = 7 - distrip; // 0-7 -> 7-0 + } + if (me1b && !zplus) { + distrip_corr = 7 - distrip; + cfeb_corr = 3 - cfeb; + } + } + } + + int strip = 16 * cfeb_corr + 2 * distrip_corr + 1; + + if (debug) + LogTrace("CSCComparatorData|CSCRawToDigi") << "fillComparatorOutputs: cfeb_corr = " << cfeb_corr + << " distrip_corr = " << distrip_corr << " strip = " << strip; + + if (doStripSwapping && ((me1a && zplus) || (me1b && !zplus))) { + // Half-strips need to be flipped too. + if (tbinbitsS1HS1) + result.push_back(CSCComparatorDigi(strip, 0, tbinbitsS1HS1)); + if (tbinbitsS1HS0) + result.push_back(CSCComparatorDigi(strip, 1, tbinbitsS1HS0)); + if (tbinbitsS0HS1) + result.push_back(CSCComparatorDigi(strip + 1, 0, tbinbitsS0HS1)); + if (tbinbitsS0HS0) + result.push_back(CSCComparatorDigi(strip + 1, 1, tbinbitsS0HS0)); + } else { + if (tbinbitsS0HS0) + result.push_back(CSCComparatorDigi(strip, 0, tbinbitsS0HS0)); + if (tbinbitsS0HS1) + result.push_back(CSCComparatorDigi(strip, 1, tbinbitsS0HS1)); + if (tbinbitsS1HS0) + result.push_back(CSCComparatorDigi(strip + 1, 0, tbinbitsS1HS0)); + if (tbinbitsS1HS1) + result.push_back(CSCComparatorDigi(strip + 1, 1, tbinbitsS1HS1)); + } + //uh oh ugly ugly ugly! + } + } //end of loop over distrips + return result; +} + +std::vector CSCComparatorData::comparatorDigis(int layer) { + //returns comparators for one layer for all cfebs + std::vector result; + assert(layer > 0 && layer <= 6); + + for (int cfeb = 0; cfeb < ncfebs_; ++cfeb) { + std::vector oneCfebDigi = comparatorDigis(layer, cfeb); + result.insert(result.end(), oneCfebDigi.begin(), oneCfebDigi.end()); + } + + return result; +} + +void CSCComparatorData::add(const CSCComparatorDigi& digi, int layer) { + //FIXME do flipping + int strip = digi.getStrip(); + int halfStrip = (strip - 1) * 2 + digi.getComparator(); + int cfeb = (strip - 1) / 16; + int distrip = ((strip - 1) % 16) / 2; + + // assert(distrip < 8 && cfeb < 6 && halfStrip < 161); + ///!!! Do we need to introduce format version here to accomodate 7 CFEBs + assert(distrip < 8 && cfeb < 8 && halfStrip < 225); + + std::vector timeBinsOn = digi.getTimeBinsOn(); + for (std::vector::const_iterator tbinItr = timeBinsOn.begin(); tbinItr != timeBinsOn.end(); ++tbinItr) { + int tbin = *tbinItr; + if (tbin >= 0 && tbin < ntbins_ - 2) { + // First triad bit indicates the presence of the hit + dataWord(cfeb, tbin, layer).set(distrip, true); + // Second bit indicates which of the two strips contains the hit + if (strip % 2 == 0) + dataWord(cfeb, tbin + 1, layer).set(distrip, true); + // Third bit indicates whether the hit is located on the left or on the + // right side of the strip. + if (digi.getComparator()) + dataWord(cfeb, tbin + 2, layer).set(distrip, true); + } + } +} + +/*** + * Comparator packing version with ME11 strips swapping + ***/ +void CSCComparatorData::add(const CSCComparatorDigi& digi, const CSCDetId& cid) { + static const bool doStripSwapping = true; + bool me1a = (cid.station() == 1) && (cid.ring() == 4); + bool zplus = (cid.endcap() == 1); + bool me1b = (cid.station() == 1) && (cid.ring() == 1); + // bool me11 = (cid.station()==1) && ((cid.ring()==1) || (cid.ring()==4)); + + unsigned layer = cid.layer(); + + int strip = digi.getStrip(); + int halfstrip = (strip - 1) * 2 + digi.getComparator(); + int cfeb = (strip - 1) / 16; + int distrip = ((strip - 1) % 16) / 2; + int bit2 = (strip - 1) % 2; + int bit3 = digi.getComparator(); + + // assert(distrip < 8 && cfeb < 6 && halfStrip < 161); + ///!!! Do we need to introduce format version here to accomodate 7 CFEBs + if (theFirmwareVersion >= 2013) { + assert(distrip < 8 && cfeb < 8 && halfstrip < 225); + } else { + assert(distrip < 8 && cfeb < 6 && halfstrip < 161); + } + + // Lets try to do ME11 strip flipping + if (doStripSwapping) { + if (theFirmwareVersion >= 2013) { + if ((me1a || (me1b && (cfeb > 3))) && zplus) { + distrip = 7 - distrip; // 0-7 -> 7-0 + cfeb = 10 - cfeb; + bit2 = ((31 - (halfstrip % 32)) % 4) / 2; + bit3 = ((31 - (halfstrip % 32)) % 4) % 2; + } + if (me1b && !zplus && (cfeb < 4)) { + distrip = 7 - distrip; + cfeb = 3 - cfeb; + bit2 = ((31 - (halfstrip % 32)) % 4) / 2; + bit3 = ((31 - (halfstrip % 32)) % 4) % 2; + } + } else { + // if ( me1a ) { cfeb_corr = 0; } // reset 4 to 0 + if ((me1a || (me1b && (cfeb > 3))) && zplus) { + distrip = 7 - distrip; // 0-7 -> 7-0 + bit2 = ((31 - (halfstrip % 32)) % 4) / 2; + bit3 = ((31 - (halfstrip % 32)) % 4) % 2; + } + if (me1b && !zplus && (cfeb < 4)) { + distrip = 7 - distrip; + cfeb = 3 - cfeb; + bit2 = ((31 - (halfstrip % 32)) % 4) / 2; + bit3 = ((31 - (halfstrip % 32)) % 4) % 2; + } + } + } + + std::vector timeBinsOn = digi.getTimeBinsOn(); + for (std::vector::const_iterator tbinItr = timeBinsOn.begin(); tbinItr != timeBinsOn.end(); ++tbinItr) { + int tbin = *tbinItr; + if (tbin >= 0 && tbin < ntbins_ - 2) { + // First triad bit indicates the presence of the hit + dataWord(cfeb, tbin, layer).set(distrip, true); + // Second bit indicates which of the two strips contains the hit + // if (strip%2 == 0) + if (bit2) + dataWord(cfeb, tbin + 1, layer).set(distrip, true); + // Third bit indicates whether the hit is located on the left or on the + // right side of the strip. + // if (digi.getComparator()) + if (bit3) + dataWord(cfeb, tbin + 2, layer).set(distrip, true); + } + } +} + +bool CSCComparatorData::check() const { + bool result = true; + for (int cfeb = 0; cfeb < ncfebs_; ++cfeb) { + for (int tbin = 0; tbin < ntbins_; ++tbin) { + for (int layer = 1; layer <= 6; ++layer) { + /// first do some checks + const CSCComparatorDataWord& word = dataWord(cfeb, tbin, layer); + bool wordIsGood = (word.tbin_ == tbin) && (word.cfeb_ == cfeb); + result = result && wordIsGood; + if (!wordIsGood && debug) { + LogTrace("CSCComparatorData|CSCRawToDigi") + << "Bad CLCT data in layer " << layer << " expect CFEB " << cfeb << " tbin " << tbin; + LogTrace("CSCComparatorData|CSCRawToDigi") << " See " << word.cfeb_ << " " << word.tbin_; + } + } + } + } + if (!result) + LogTrace("CSCComparatorData|CSCRawToDigi") << "++ Bad CLCT Data ++ "; + return result; +} + +void CSCComparatorData::dump() const { + for (int i = 0; i < size_; i++) { + printf("%04x %04x %04x %04x\n", theData[i + 3], theData[i + 2], theData[i + 1], theData[i]); + i += 3; + } +} + +void CSCComparatorData::selfTest() { + CSCComparatorData comparatorData(5, 16); + // aim for output 4 in 5th time bin, = 0000000000010000 + CSCComparatorDigi comparatorDigi1(1, 0, 0x10); + // aim for output 5 in 6th time bin, = 0000 0000 0010 0000 + CSCComparatorDigi comparatorDigi2(39, 1, 0x20); + // aim for output 7 in 7th time bin, = 000 0000 0100 0000 + CSCComparatorDigi comparatorDigi3(80, 1, 0x40); + + comparatorData.add(comparatorDigi1, 1); + comparatorData.add(comparatorDigi2, 4); + comparatorData.add(comparatorDigi3, 6); + + CSCDetId layer1(1, 4, 1, 2, 1); + CSCDetId layer4(1, 4, 1, 2, 4); + CSCDetId layer6(1, 4, 1, 2, 6); + + std::vector digis1 = comparatorData.comparatorDigis(1); + std::vector digis2 = comparatorData.comparatorDigis(4); + std::vector digis3 = comparatorData.comparatorDigis(6); + + assert(digis1.size() == 1); + assert(digis2.size() == 1); + assert(digis3.size() == 1); + + assert(digis1[0].getStrip() == 1); + assert(digis1[0].getComparator() == 0); + assert(digis1[0].getTimeBin() == 4); + + assert(digis2[0].getStrip() == 39); + assert(digis2[0].getComparator() == 1); + assert(digis2[0].getTimeBin() == 5); + + assert(digis3[0].getStrip() == 80); + assert(digis3[0].getComparator() == 1); + assert(digis3[0].getTimeBin() == 6); +} diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMotherboard.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMotherboard.h index 3da30e9482edd..e4db5a9d2ecc5 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMotherboard.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMotherboard.h @@ -247,16 +247,16 @@ void CSCGEMMotherboard::matchingPads(const CSCALCTDigi& alct, matches& result return; // Get the corresponding roll numbers for a given ALCT - std::pair alctRoll = (getLUT()->get_csc_wg_to_gem_roll(theParity))[alct.getKeyWG()]; + std::pair alctRoll = (getLUT()->get_csc_wg_to_gem_roll(theParity))[alct.keyWireGroup()]; // Get the pads in the ALCT bx const matchesBX& lut = getPads(); // If no pads in that bx... - if (lut.count(alct.getBX()) == 0) + if (lut.count(alct.bx()) == 0) return; - for (const auto& p : lut.at(alct.getBX())) { + for (const auto& p : lut.at(alct.bx())) { auto padRoll(getRoll(p)); int delta; @@ -266,7 +266,7 @@ void CSCGEMMotherboard::matchingPads(const CSCALCTDigi& alct, matches& result // pad bx needs to match to ALCT bx int pad_bx = getBX(p.second) + CSCConstants::LCT_CENTRAL_BX; - if (std::abs(alct.getBX() - pad_bx) > getMaxDeltaBX()) + if (std::abs(alct.bx() - pad_bx) > getMaxDeltaBX()) continue; // gem roll number if invalid @@ -295,10 +295,10 @@ void CSCGEMMotherboard::matchingPads(const CSCCLCTDigi& clct, matches& result if (not clct.isValid()) return; - auto part(getCSCPart(clct.getKeyStrip())); + auto part(getCSCPart(clct.keyStrip())); // Get the corresponding pad numbers for a given CLCT const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(theParity, part)); - int keyStrip = clct.getKeyStrip(); + int keyStrip = clct.keyStrip(); //ME1A part, convert halfstrip from 128-223 to 0-95 if (part == CSCPart::ME1A and keyStrip > CSCConstants::MAX_HALF_STRIP_ME1B) keyStrip = keyStrip - CSCConstants::MAX_HALF_STRIP_ME1B - 1; @@ -309,13 +309,13 @@ void CSCGEMMotherboard::matchingPads(const CSCCLCTDigi& clct, matches& result const matchesBX& lut = getPads(); // If no pads in that bx... - if (lut.count(clct.getBX()) == 0) + if (lut.count(clct.bx()) == 0) return; - for (const auto& p : lut.at(clct.getBX())) { + for (const auto& p : lut.at(clct.bx())) { // pad bx needs to match to CLCT bx int pad_bx = getBX(p.second) + CSCConstants::LCT_CENTRAL_BX; - if (std::abs(clct.getBX() - pad_bx) > getMaxDeltaBX()) + if (std::abs(clct.bx() - pad_bx) > getMaxDeltaBX()) continue; // pad number must match @@ -404,7 +404,7 @@ S CSCGEMMotherboard::bestMatchingPad(const CSCCLCTDigi& clct, const matches& if (not clct.isValid()) return result; - auto part(getCSCPart(clct.getKeyStrip())); + auto part(getCSCPart(clct.keyStrip())); // return the pad with the smallest bending angle float averagePadNumberCSC = getPad(clct, part); @@ -432,7 +432,7 @@ S CSCGEMMotherboard::bestMatchingPad(const CSCALCTDigi& alct1, const CSCCLCTDigi return result; } - auto part(getCSCPart(clct1.getKeyStrip())); + auto part(getCSCPart(clct1.keyStrip())); // return the pad with the smallest bending angle float averagePadNumberCSC = getPad(clct1, part); diff --git a/L1Trigger/CSCTriggerPrimitives/plugins/CSCAnodeLCTAnalyzer.cc b/L1Trigger/CSCTriggerPrimitives/plugins/CSCAnodeLCTAnalyzer.cc index 0846f75762029..2f0103155964f 100644 --- a/L1Trigger/CSCTriggerPrimitives/plugins/CSCAnodeLCTAnalyzer.cc +++ b/L1Trigger/CSCTriggerPrimitives/plugins/CSCAnodeLCTAnalyzer.cc @@ -30,9 +30,9 @@ vector CSCAnodeLCTAnalyzer::getSimInfo(const CSCALCTDigi& alc << ", exceeds max expected, " << CSCConstants::NUM_LAYERS << " +++\n"; } // not a good check for high PU - //if (alctInfo.size() != (unsigned)alct.getQuality()+3) { + //if (alctInfo.size() != (unsigned)alct.quality()+3) { // edm::LogWarning("L1CSCTPEmulatorWrongValues") - // << "+++ Warning: mismatch between ALCT quality, " << alct.getQuality() + // << "+++ Warning: mismatch between ALCT quality, " << alct.quality() // << ", and the number of layers with digis, " << alctInfo.size() // << ", in alctInfo! +++\n"; //} @@ -58,10 +58,10 @@ vector CSCAnodeLCTAnalyzer::lctDigis(const CSCALCTDigi& alct, // Inquire the alct for its pattern and key wiregroup. int alct_pattern = 0; - if (!alct.getAccelerator()) - alct_pattern = alct.getCollisionB() + 1; - int alct_keywire = alct.getKeyWG(); - int alct_bx = alct.getBX(); + if (!alct.accelerator()) + alct_pattern = alct.collisionB() + 1; + int alct_keywire = alct.keyWireGroup(); + int alct_bx = alct.bx(); // Choose pattern envelope. int MESelection = (alctId.station() < 3) ? 0 : 1; diff --git a/L1Trigger/CSCTriggerPrimitives/plugins/CSCCathodeLCTAnalyzer.cc b/L1Trigger/CSCTriggerPrimitives/plugins/CSCCathodeLCTAnalyzer.cc index 3f5f74e493cd9..b4f50ecf67bd4 100644 --- a/L1Trigger/CSCTriggerPrimitives/plugins/CSCCathodeLCTAnalyzer.cc +++ b/L1Trigger/CSCTriggerPrimitives/plugins/CSCCathodeLCTAnalyzer.cc @@ -30,9 +30,9 @@ vector CSCCathodeLCTAnalyzer::getSimInfo(const CSCCLCTDigi& << ", exceeds max expected, " << CSCConstants::NUM_LAYERS << " +++\n"; } // not a good check for high PU - //if (clctInfo.size() != (unsigned)clct.getQuality()) { + //if (clctInfo.size() != (unsigned)clct.quality()) { // edm::LogWarning("L1CSCTPEmulatorWrongValues") - // << "+++ Warning: mismatch between CLCT quality, " << clct.getQuality() + // << "+++ Warning: mismatch between CLCT quality, " << clct.quality() // << ", and the number of layers with digis, " << clctInfo.size() // << ", in clctInfo! +++\n"; //} @@ -61,10 +61,10 @@ vector CSCCathodeLCTAnalyzer::lctDigis(const CSCCLCTDigi& c vector vectInfo; // Inquire the clct for its key half-strip, strip type and pattern number. - int clct_keystrip = clct.getKeyStrip(); - int clct_stripType = clct.getStripType(); - int clct_pattern = clct.getPattern(); - int clct_bx = clct.getBX(); + int clct_keystrip = clct.keyStrip(); + int clct_stripType = clct.stripType(); + int clct_pattern = clct.pattern(); + int clct_bx = clct.bx(); // Re-scale the key di-strip number to the count used in the search. if (clct_stripType == 0) diff --git a/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesReader.cc b/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesReader.cc index 08f11b7506de8..5f92db00f6636 100644 --- a/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesReader.cc +++ b/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesReader.cc @@ -1141,18 +1141,18 @@ void CSCTriggerPrimitivesReader::fillALCTHistos(const CSCALCTDigiCollection* alc bool alct_valid = (*digiIt).isValid(); hAlctValid->Fill(alct_valid); if (alct_valid) { - hAlctQuality->Fill((*digiIt).getQuality()); - hAlctAccel->Fill((*digiIt).getAccelerator()); - hAlctCollis->Fill((*digiIt).getCollisionB()); - hAlctKeyGroup->Fill((*digiIt).getKeyWG()); - hAlctBXN->Fill((*digiIt).getBX()); + hAlctQuality->Fill((*digiIt).quality()); + hAlctAccel->Fill((*digiIt).accelerator()); + hAlctCollis->Fill((*digiIt).collisionB()); + hAlctKeyGroup->Fill((*digiIt).keyWireGroup()); + hAlctBXN->Fill((*digiIt).bx()); int csctype = getCSCType(id); hAlctPerCSC->Fill(csctype); hAlctCsc[id.endcap() - 1][csctype]->Fill(id.chamber()); if (csctype == 0) - hAlctKeyGroupME11->Fill((*digiIt).getKeyWG()); + hAlctKeyGroupME11->Fill((*digiIt).keyWireGroup()); nValidALCTs++; nValidALCTsPerCSC++; @@ -1188,17 +1188,17 @@ void CSCTriggerPrimitivesReader::fillCLCTHistos(const CSCCLCTDigiCollection* clc bool clct_valid = (*digiIt).isValid(); hClctValid->Fill(clct_valid); if (clct_valid) { - int striptype = (*digiIt).getStripType(); - int keystrip = (*digiIt).getKeyStrip(); // halfstrip # + int striptype = (*digiIt).stripType(); + int keystrip = (*digiIt).keyStrip(); // halfstrip # if (striptype == 0) keystrip /= 4; // distrip # for distrip ptns - hClctQuality->Fill((*digiIt).getQuality()); + hClctQuality->Fill((*digiIt).quality()); hClctStripType->Fill(striptype); - hClctSign->Fill((*digiIt).getBend()); - hClctCFEB->Fill((*digiIt).getCFEB()); - hClctBXN->Fill((*digiIt).getBX()); + hClctSign->Fill((*digiIt).bend()); + hClctCFEB->Fill((*digiIt).cfeb()); + hClctBXN->Fill((*digiIt).bx()); hClctKeyStrip[striptype]->Fill(keystrip); - hClctPattern[striptype]->Fill((*digiIt).getPattern()); + hClctPattern[striptype]->Fill((*digiIt).pattern()); int csctype = getCSCType(id); hClctPerCSC->Fill(csctype); @@ -1208,7 +1208,7 @@ void CSCTriggerPrimitivesReader::fillCLCTHistos(const CSCCLCTDigiCollection* clc hClctKeyStripME11->Fill(keystrip); int phibend; - int pattern = (*digiIt).getPattern(); + int pattern = (*digiIt).pattern(); phibend = ptype_TMB07[pattern]; hClctBendCsc[csctype][striptype]->Fill(abs(phibend)); @@ -1256,21 +1256,21 @@ void CSCTriggerPrimitivesReader::fillLCTTMBHistos(const CSCCorrelatedLCTDigiColl hLctTMBRing->Fill(id.ring()); hLctTMBChamber[id.station() - 1]->Fill(id.triggerCscId()); - int quality = (*digiIt).getQuality(); + int quality = (*digiIt).quality(); hLctTMBQuality->Fill(quality); - hLctTMBBXN->Fill((*digiIt).getBX()); + hLctTMBBXN->Fill((*digiIt).bx()); alct_valid = (quality != 0 && quality != 2); if (alct_valid) { - hLctTMBKeyGroup->Fill((*digiIt).getKeyWG()); + hLctTMBKeyGroup->Fill((*digiIt).keyWireGroup()); } clct_valid = (quality != 0 && quality != 1); if (clct_valid) { - hLctTMBKeyStrip->Fill((*digiIt).getStrip()); + hLctTMBKeyStrip->Fill((*digiIt).strip()); hLctTMBStripType->Fill(1.); - hLctTMBPattern->Fill((*digiIt).getPattern()); - hLctTMBBend->Fill((*digiIt).getBend()); + hLctTMBPattern->Fill((*digiIt).pattern()); + hLctTMBBend->Fill((*digiIt).bend()); } int csctype = getCSCType(id); @@ -1281,10 +1281,10 @@ void CSCTriggerPrimitivesReader::fillLCTTMBHistos(const CSCCorrelatedLCTDigiColl hCorrLctTMBPerCSC->Fill(csctype); if (alct_valid && csctype == 0) { - hLctTMBKeyGroupME11->Fill((*digiIt).getKeyWG()); + hLctTMBKeyGroupME11->Fill((*digiIt).keyWireGroup()); } if (clct_valid && csctype == 0) { - hLctTMBKeyStripME11->Fill((*digiIt).getStrip()); + hLctTMBKeyStripME11->Fill((*digiIt).strip()); } nValidLCTs++; @@ -1327,21 +1327,21 @@ void CSCTriggerPrimitivesReader::fillLCTMPCHistos(const CSCCorrelatedLCTDigiColl hLctMPCRing->Fill(id.ring()); hLctMPCChamber[id.station() - 1]->Fill(id.triggerCscId()); - int quality = (*digiIt).getQuality(); + int quality = (*digiIt).quality(); hLctMPCQuality->Fill(quality); - hLctMPCBXN->Fill((*digiIt).getBX()); + hLctMPCBXN->Fill((*digiIt).bx()); alct_valid = (quality != 0 && quality != 2); if (alct_valid) { - hLctMPCKeyGroup->Fill((*digiIt).getKeyWG()); + hLctMPCKeyGroup->Fill((*digiIt).keyWireGroup()); } clct_valid = (quality != 0 && quality != 1); if (clct_valid) { - hLctMPCKeyStrip->Fill((*digiIt).getStrip()); + hLctMPCKeyStrip->Fill((*digiIt).strip()); hLctMPCStripType->Fill(1.); - hLctMPCPattern->Fill((*digiIt).getPattern()); - hLctMPCBend->Fill((*digiIt).getBend()); + hLctMPCPattern->Fill((*digiIt).pattern()); + hLctMPCBend->Fill((*digiIt).bend()); } int csctype = getCSCType(id); @@ -1351,10 +1351,10 @@ void CSCTriggerPrimitivesReader::fillLCTMPCHistos(const CSCCorrelatedLCTDigiColl hCorrLctMPCPerCSC->Fill(csctype); if (alct_valid && csctype == 0) { - hLctMPCKeyGroupME11->Fill((*digiIt).getKeyWG()); + hLctMPCKeyGroupME11->Fill((*digiIt).keyWireGroup()); } if (clct_valid && csctype == 0) { - hLctMPCKeyStripME11->Fill((*digiIt).getStrip()); + hLctMPCKeyStripME11->Fill((*digiIt).strip()); } nValidLCTs++; @@ -1447,14 +1447,14 @@ void CSCTriggerPrimitivesReader::compareALCTs(const CSCALCTDigiCollection* alcts << detid.triggerCscId() << "):\n"; strstrm << " **** " << ndata << " valid data ALCTs found:\n"; for (pd = alctV_data.begin(); pd != alctV_data.end(); pd++) { - strstrm << " " << (*pd) << " Full BX = " << (*pd).getFullBX() << "\n"; + strstrm << " " << (*pd) << " Full BX = " << (*pd).fullBX() << "\n"; } strstrm << " **** " << nemul << " valid emul ALCTs found:\n"; for (pe = alctV_emul.begin(); pe != alctV_emul.end(); pe++) { strstrm << " " << (*pe); for (pd = alctV_data.begin(); pd != alctV_data.end(); pd++) { - if ((*pd).getTrknmb() == (*pe).getTrknmb()) { - int emul_bx = (*pe).getBX(); + if ((*pd).trackNumber() == (*pe).trackNumber()) { + int emul_bx = (*pe).bx(); emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay; strstrm << " Corr BX = " << emul_corr_bx; break; @@ -1528,12 +1528,12 @@ void CSCTriggerPrimitivesReader::compareALCTs(const CSCALCTDigiCollection* alcts for (int i = 0; i < ndata; i++) { if (alctV_data[i].isValid() == 0) continue; - int data_trknmb = alctV_data[i].getTrknmb(); - //int data_quality = alctV_data[i].getQuality(); - //int data_accel = alctV_data[i].getAccelerator(); - //int data_collB = alctV_data[i].getCollisionB(); - int data_wiregroup = alctV_data[i].getKeyWG(); - int data_bx = alctV_data[i].getBX(); + int data_trknmb = alctV_data[i].trackNumber(); + //int data_quality = alctV_data[i].quality(); + //int data_accel = alctV_data[i].accelerator(); + //int data_collB = alctV_data[i].collisionB(); + int data_wiregroup = alctV_data[i].keyWireGroup(); + int data_bx = alctV_data[i].bx(); stubs_comparison[0].init(RUN_, Event_); stubs_comparison[0].firstfill = firstfill; @@ -1550,10 +1550,10 @@ void CSCTriggerPrimitivesReader::compareALCTs(const CSCALCTDigiCollection* alcts stubs_comparison[0].totStubs_emul_readout = nemul; stubs_comparison[0].nStub_data = i + 1; stubs_comparison[0].has_data = true; - stubs_comparison[0].quality_data = alctV_data[i].getQuality(); - stubs_comparison[0].key_WG_data = alctV_data[i].getKeyWG(); + stubs_comparison[0].quality_data = alctV_data[i].quality(); + stubs_comparison[0].key_WG_data = alctV_data[i].keyWireGroup(); stubs_comparison[0].bx_data = data_bx; - stubs_comparison[0].fullbx_data = alctV_data[i].getFullBX(); + stubs_comparison[0].fullbx_data = alctV_data[i].fullBX(); stubs_comparison[0].trknmb_data = data_trknmb; GlobalPoint gp_alct_data(getGlobalPosition(detid.rawId(), data_wiregroup, 60)); stubs_comparison[0].eta_data = gp_alct_data.eta(); @@ -1563,12 +1563,12 @@ void CSCTriggerPrimitivesReader::compareALCTs(const CSCALCTDigiCollection* alcts if (bookedalctV_emul[j]) continue; //used alct - int emul_trknmb = alctV_emul[j].getTrknmb(); - //int emul_quality = alctV_emul[j].getQuality(); - //int emul_accel = alctV_emul[j].getAccelerator(); - //int emul_collB = alctV_emul[j].getCollisionB(); - int emul_wiregroup = alctV_emul[j].getKeyWG(); - int emul_bx = alctV_emul[j].getBX(); + int emul_trknmb = alctV_emul[j].trackNumber(); + //int emul_quality = alctV_emul[j].quality(); + //int emul_accel = alctV_emul[j].accelerator(); + //int emul_collB = alctV_emul[j].collisionB(); + int emul_wiregroup = alctV_emul[j].keyWireGroup(); + int emul_bx = alctV_emul[j].bx(); // Emulator BX re-calculated for comparison with BX in the data. emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay; if (dataIsAnotherMC_) @@ -1599,9 +1599,9 @@ void CSCTriggerPrimitivesReader::compareALCTs(const CSCALCTDigiCollection* alcts LogTrace("CSCTriggerPrimitivesReader") << " Identical ALCTs #" << data_trknmb; stubs_comparison[0].nStub_emul = j + 1; stubs_comparison[0].has_emul = true; - stubs_comparison[0].quality_emul = alctV_emul[j].getQuality(); - stubs_comparison[0].key_WG_emul = alctV_emul[j].getKeyWG(); - stubs_comparison[0].bx_emul = alctV_emul[j].getBX(); + stubs_comparison[0].quality_emul = alctV_emul[j].quality(); + stubs_comparison[0].key_WG_emul = alctV_emul[j].keyWireGroup(); + stubs_comparison[0].bx_emul = alctV_emul[j].bx(); stubs_comparison[0].trknmb_emul = emul_trknmb; GlobalPoint gp_alct_emul(getGlobalPosition(detid.rawId(), emul_wiregroup, 60)); stubs_comparison[0].eta_emul = gp_alct_emul.eta(); @@ -1626,7 +1626,7 @@ void CSCTriggerPrimitivesReader::compareALCTs(const CSCALCTDigiCollection* alcts for (int i = 0; i < nemul; i++) { if (alctV_emul[i].isValid() == 0 or bookedalctV_emul[i]) continue; - int emul_bx = alctV_emul[i].getBX(); + int emul_bx = alctV_emul[i].bx(); stubs_comparison[0].init(RUN_, Event_); stubs_comparison[0].firstfill = firstfill; if (firstfill) @@ -1644,12 +1644,12 @@ void CSCTriggerPrimitivesReader::compareALCTs(const CSCALCTDigiCollection* alcts stubs_comparison[0].nStub_emul = i + 1; stubs_comparison[0].has_data = false; stubs_comparison[0].has_emul = true; - stubs_comparison[0].trknmb_emul = alctV_emul[i].getTrknmb(); - stubs_comparison[0].quality_emul = alctV_emul[i].getQuality(); - stubs_comparison[0].key_WG_emul = alctV_emul[i].getKeyWG(); - stubs_comparison[0].bx_emul = alctV_emul[i].getBX(); - stubs_comparison[0].fullbx_emul = alctV_emul[i].getFullBX(); - GlobalPoint gp_alct_emul(getGlobalPosition(detid.rawId(), alctV_emul[i].getKeyWG(), 60)); + stubs_comparison[0].trknmb_emul = alctV_emul[i].trackNumber(); + stubs_comparison[0].quality_emul = alctV_emul[i].quality(); + stubs_comparison[0].key_WG_emul = alctV_emul[i].keyWireGroup(); + stubs_comparison[0].bx_emul = alctV_emul[i].bx(); + stubs_comparison[0].fullbx_emul = alctV_emul[i].fullBX(); + GlobalPoint gp_alct_emul(getGlobalPosition(detid.rawId(), alctV_emul[i].keyWireGroup(), 60)); stubs_comparison[0].eta_emul = gp_alct_emul.eta(); // Emulator BX re-calculated for comparison with BX in the data. emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay; @@ -1704,7 +1704,7 @@ void CSCTriggerPrimitivesReader::compareCLCTs(const CSCCLCTDigiCollection* clcts for (auto digiIt = erange.first; digiIt != erange.second; digiIt++) { if ((*digiIt).isValid()) { for (auto pclct : clctV_emul) { - if (digiIt->getBX() != pclct.getBX() and abs(digiIt->getBX() - pclct.getBX()) < 5) + if (digiIt->bx() != pclct.bx() and abs(digiIt->bx() - pclct.bx()) < 5) LogTrace("CSCTriggerPrimitivesReader") << "Two CLCTs very close in timing!!! Special event: first clct " << pclct << " second clct " << *digiIt << std::endl; @@ -1730,10 +1730,10 @@ void CSCTriggerPrimitivesReader::compareCLCTs(const CSCCLCTDigiCollection* clcts int nemul_readout = 0; for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) { for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) { - int emul_bx = (*pe).getBX(); - int corr_bx = ((*pd).getFullBX() + emul_bx - tbin_cathode_offset) & 0x03; - int bx_data = pd->getBX(); - //if (corr_bx == bx_data or abs(pe->getKeyStrip() - pd->getKeyStrip())<=1){//if emulated BX after correction is same as data bx, it will be readout + int emul_bx = (*pe).bx(); + int corr_bx = ((*pd).fullBX() + emul_bx - tbin_cathode_offset) & 0x03; + int bx_data = pd->bx(); + //if (corr_bx == bx_data or abs(pe->keyStrip() - pd->keyStrip())<=1){//if emulated BX after correction is same as data bx, it will be readout if (corr_bx == bx_data) { //if emulated BX after correction is same as data bx, it will be readout nemul_readout++; break; @@ -1750,15 +1750,15 @@ void CSCTriggerPrimitivesReader::compareCLCTs(const CSCCLCTDigiCollection* clcts << detid.triggerCscId() << "):\n"; strstrm << " **** " << ndata << " valid data CLCTs found:\n"; for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) { - strstrm << " " << (*pd) << " Full BX = " << (*pd).getFullBX() << "\n"; + strstrm << " " << (*pd) << " Full BX = " << (*pd).fullBX() << "\n"; } strstrm << " **** " << nemul << " valid emul CLCTs found:\n"; for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) { strstrm << " " << (*pe); for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) { - if ((*pd).getTrknmb() == (*pe).getTrknmb() or abs((*pe).getKeyStrip() - (*pd).getKeyStrip()) < 5) { - int emul_bx = (*pe).getBX(); - int corr_bx = ((*pd).getFullBX() + emul_bx - tbin_cathode_offset) & 0x03; + if ((*pd).trackNumber() == (*pe).trackNumber() or abs((*pe).keyStrip() - (*pd).keyStrip()) < 5) { + int emul_bx = (*pe).bx(); + int corr_bx = ((*pd).fullBX() + emul_bx - tbin_cathode_offset) & 0x03; strstrm << " Corr BX = " << corr_bx; break; } @@ -1832,15 +1832,15 @@ void CSCTriggerPrimitivesReader::compareCLCTs(const CSCCLCTDigiCollection* clcts i++; if ((*pd).isValid() == 0) continue; - int data_trknmb = (*pd).getTrknmb(); - int data_quality = (*pd).getQuality(); - int data_pattern = (*pd).getPattern(); - int data_striptype = (*pd).getStripType(); - int data_bend = (*pd).getBend(); - int data_keystrip = (*pd).getKeyStrip(); - int data_cfeb = (*pd).getCFEB(); - int data_bx = (*pd).getBX(); - int fullBX = (*pd).getFullBX(); // 12-bit full BX + int data_trknmb = (*pd).trackNumber(); + int data_quality = (*pd).quality(); + int data_pattern = (*pd).pattern(); + int data_striptype = (*pd).stripType(); + int data_bend = (*pd).bend(); + int data_keystrip = (*pd).keyStrip(); + int data_cfeb = (*pd).cfeb(); + int data_bx = (*pd).bx(); + int fullBX = (*pd).fullBX(); // 12-bit full BX if (data_keystrip >= 128 and stat == 1 and ring == 1) testwg = 5; @@ -1862,14 +1862,14 @@ void CSCTriggerPrimitivesReader::compareCLCTs(const CSCCLCTDigiCollection* clcts stubs_comparison[1].totStubs_emul_readout = nemul_readout; stubs_comparison[1].nStub_data = i + 1; stubs_comparison[1].has_data = true; - stubs_comparison[1].quality_data = (*pd).getQuality(); - stubs_comparison[1].key_hs_data = (*pd).getKeyStrip(); - stubs_comparison[1].bend_data = (*pd).getBend(); - stubs_comparison[1].pattern_data = (*pd).getPattern(); - stubs_comparison[1].bx_data = (*pd).getBX(); - stubs_comparison[1].fullbx_data = (*pd).getFullBX(); + stubs_comparison[1].quality_data = (*pd).quality(); + stubs_comparison[1].key_hs_data = (*pd).keyStrip(); + stubs_comparison[1].bend_data = (*pd).bend(); + stubs_comparison[1].pattern_data = (*pd).pattern(); + stubs_comparison[1].bx_data = (*pd).bx(); + stubs_comparison[1].fullbx_data = (*pd).fullBX(); stubs_comparison[1].trknmb_data = data_trknmb; - GlobalPoint gp_clct_data(getGlobalPosition(detid.rawId(), testwg, (*pd).getKeyStrip())); + GlobalPoint gp_clct_data(getGlobalPosition(detid.rawId(), testwg, (*pd).keyStrip())); stubs_comparison[1].phi_data = gp_clct_data.phi(); int j = -1; @@ -1879,14 +1879,14 @@ void CSCTriggerPrimitivesReader::compareCLCTs(const CSCCLCTDigiCollection* clcts continue; if (bookedclctV_emul[j]) continue; //used alct - int emul_trknmb = (*pe).getTrknmb(); - int emul_quality = (*pe).getQuality(); - int emul_pattern = (*pe).getPattern(); - int emul_striptype = (*pe).getStripType(); - int emul_bend = (*pe).getBend(); - int emul_keystrip = (*pe).getKeyStrip(); - int emul_cfeb = (*pe).getCFEB(); - int emul_bx = (*pe).getBX(); + int emul_trknmb = (*pe).trackNumber(); + int emul_quality = (*pe).quality(); + int emul_pattern = (*pe).pattern(); + int emul_striptype = (*pe).stripType(); + int emul_bend = (*pe).bend(); + int emul_keystrip = (*pe).keyStrip(); + int emul_cfeb = (*pe).cfeb(); + int emul_bx = (*pe).bx(); if (abs(data_keystrip - emul_keystrip) <= 2) { // Emulator BX re-calculated using 12-bit full BX number. @@ -1924,27 +1924,27 @@ void CSCTriggerPrimitivesReader::compareCLCTs(const CSCCLCTDigiCollection* clcts } stubs_comparison[1].nStub_emul = j + 1; stubs_comparison[1].has_emul = true; - stubs_comparison[1].quality_emul = (*pe).getQuality(); - stubs_comparison[1].key_hs_emul = (*pe).getKeyStrip(); - stubs_comparison[1].bend_emul = (*pe).getBend(); - stubs_comparison[1].pattern_emul = (*pe).getPattern(); - stubs_comparison[1].bx_emul = (*pe).getBX(); + stubs_comparison[1].quality_emul = (*pe).quality(); + stubs_comparison[1].key_hs_emul = (*pe).keyStrip(); + stubs_comparison[1].bend_emul = (*pe).bend(); + stubs_comparison[1].pattern_emul = (*pe).pattern(); + stubs_comparison[1].bx_emul = (*pe).bx(); stubs_comparison[1].bx_corr_emul = emul_corr_bx; stubs_comparison[1].trknmb_emul = emul_trknmb; - GlobalPoint gp_clct_emul(getGlobalPosition(detid.rawId(), testwg, (*pe).getKeyStrip())); + GlobalPoint gp_clct_emul(getGlobalPosition(detid.rawId(), testwg, (*pe).keyStrip())); stubs_comparison[1].phi_emul = gp_clct_emul.phi(); bookedclctV_emul[j] = true; //int mingap_trig_pretrig = pretrig_trig_zone*2; int num_pretrig = 0; for (pretrig = pretrigV_emul.begin(); pretrig != pretrigV_emul.end(); pretrig++) { - if ((*pretrig).getBX() != (*pe).getBX()) + if ((*pretrig).bx() != (*pe).bx()) continue; - int hsgap = std::abs((*pretrig).getKeyStrip() - (*pe).getKeyStrip()); + int hsgap = std::abs((*pretrig).keyStrip() - (*pe).keyStrip()); bool samechamber = true; if (stat == 1 and ring == 1) - samechamber = (((*pretrig).getKeyStrip() < 128 and (*pe).getKeyStrip() < 128) || - ((*pretrig).getKeyStrip() >= 128 and (*pe).getKeyStrip() >= 128)); + samechamber = (((*pretrig).keyStrip() < 128 and (*pe).keyStrip() < 128) || + ((*pretrig).keyStrip() >= 128 and (*pe).keyStrip() >= 128)); if (not samechamber) continue; @@ -1952,14 +1952,14 @@ void CSCTriggerPrimitivesReader::compareCLCTs(const CSCCLCTDigiCollection* clcts num_pretrig++; else continue; - if ((*pretrig).getPattern() > stubs_comparison[1].maxpattern_pretrig) - stubs_comparison[1].maxpattern_pretrig = (*pretrig).getPattern(); - if ((*pretrig).getQuality() > stubs_comparison[1].maxquality_pretrig) { - stubs_comparison[1].quality_pretrig = (*pretrig).getQuality(); - stubs_comparison[1].key_hs_pretrig = (*pretrig).getKeyStrip(); - stubs_comparison[1].bend_pretrig = (*pretrig).getBend(); - stubs_comparison[1].pattern_pretrig = (*pretrig).getPattern(); - stubs_comparison[1].bx_pretrig = (*pretrig).getBX(); + if ((*pretrig).pattern() > stubs_comparison[1].maxpattern_pretrig) + stubs_comparison[1].maxpattern_pretrig = (*pretrig).pattern(); + if ((*pretrig).quality() > stubs_comparison[1].maxquality_pretrig) { + stubs_comparison[1].quality_pretrig = (*pretrig).quality(); + stubs_comparison[1].key_hs_pretrig = (*pretrig).keyStrip(); + stubs_comparison[1].bend_pretrig = (*pretrig).bend(); + stubs_comparison[1].pattern_pretrig = (*pretrig).pattern(); + stubs_comparison[1].bx_pretrig = (*pretrig).bx(); } } stubs_comparison[1].npretrig = num_pretrig; @@ -1992,23 +1992,23 @@ void CSCTriggerPrimitivesReader::compareCLCTs(const CSCCLCTDigiCollection* clcts stubs_comparison[1].totStubs_data = ndata; stubs_comparison[1].totStubs_emul = nemul; stubs_comparison[1].totStubs_emul_readout = nemul_readout; - stubs_comparison[1].trknmb_emul = clctV_emul[i].getTrknmb(); + stubs_comparison[1].trknmb_emul = clctV_emul[i].trackNumber(); stubs_comparison[1].nStub_data = -1; stubs_comparison[1].has_data = false; stubs_comparison[1].nStub_emul = k + 1; stubs_comparison[1].has_emul = true; - stubs_comparison[1].quality_emul = clctV_emul[k].getQuality(); - stubs_comparison[1].key_hs_emul = clctV_emul[k].getKeyStrip(); - stubs_comparison[1].bend_emul = clctV_emul[k].getBend(); - stubs_comparison[1].pattern_emul = clctV_emul[k].getPattern(); - stubs_comparison[1].bx_emul = clctV_emul[k].getBX(); - stubs_comparison[1].fullbx_emul = clctV_emul[k].getFullBX(); - if (clctV_emul[k].getKeyStrip() >= 128 and stat == 1 and ring == 1) + stubs_comparison[1].quality_emul = clctV_emul[k].quality(); + stubs_comparison[1].key_hs_emul = clctV_emul[k].keyStrip(); + stubs_comparison[1].bend_emul = clctV_emul[k].bend(); + stubs_comparison[1].pattern_emul = clctV_emul[k].pattern(); + stubs_comparison[1].bx_emul = clctV_emul[k].bx(); + stubs_comparison[1].fullbx_emul = clctV_emul[k].fullBX(); + if (clctV_emul[k].keyStrip() >= 128 and stat == 1 and ring == 1) testwg = 5; else testwg = 20; // Emulator BX NOT Known from the data. - GlobalPoint gp_clct_emul(getGlobalPosition(detid.rawId(), testwg, clctV_emul[k].getKeyStrip())); + GlobalPoint gp_clct_emul(getGlobalPosition(detid.rawId(), testwg, clctV_emul[k].keyStrip())); stubs_comparison[1].phi_emul = gp_clct_emul.phi(); bookedclctV_emul[k] = true; stub_tree[1]->Fill(); @@ -2063,9 +2063,9 @@ void CSCTriggerPrimitivesReader::compareLCTs(const CSCCorrelatedLCTDigiCollectio int nemul_readout = 0; for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) { for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) { - int bx_data = pd->getBX(); - int bx_corr = convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data); - if ((bx_data == bx_corr) or (abs(pe->getKeyWG() - pd->getKeyWG()) <= 2)) { + int bx_data = pd->bx(); + int bx_corr = convertBXofLCT((*pe).bx(), detid, alcts_data, clcts_data); + if ((bx_data == bx_corr) or (abs(pe->keyWireGroup() - pd->keyWireGroup()) <= 2)) { nemul_readout++; break; } @@ -2086,8 +2086,8 @@ void CSCTriggerPrimitivesReader::compareLCTs(const CSCCorrelatedLCTDigiCollectio strstrm << "\n **** " << nemul << " valid emul LCTs found:\n"; for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) { strstrm << " " << (*pe); - strstrm << " corr BX = " << convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data); - strstrm << " LCT pattern = " << (*pe).getPattern(); + strstrm << " corr BX = " << convertBXofLCT((*pe).bx(), detid, alcts_data, clcts_data); + strstrm << " LCT pattern = " << (*pe).pattern(); strstrm << "\n"; } LogTrace("CSCTriggerPrimitivesReader") << strstrm.str(); @@ -2157,14 +2157,14 @@ void CSCTriggerPrimitivesReader::compareLCTs(const CSCCorrelatedLCTDigiCollectio i++; if ((*pd).isValid() == 0) continue; - int data_trknmb = (*pd).getTrknmb(); - int data_quality = (*pd).getQuality(); - int data_wiregroup = (*pd).getKeyWG(); - int data_keystrip = (*pd).getStrip(); - int data_pattern = (*pd).getCLCTPattern(); - int data_striptype = (*pd).getStripType(); - int data_bend = (*pd).getBend(); - int data_bx = (*pd).getBX(); + int data_trknmb = (*pd).trackNumber(); + int data_quality = (*pd).quality(); + int data_wiregroup = (*pd).keyWireGroup(); + int data_keystrip = (*pd).strip(); + int data_pattern = (*pd).clctPattern(); + int data_striptype = (*pd).stripType(); + int data_bend = (*pd).bend(); + int data_bx = (*pd).bx(); stubs_comparison[2].init(RUN_, Event_); stubs_comparison[2].firstfill = firstfill; @@ -2181,16 +2181,16 @@ void CSCTriggerPrimitivesReader::compareLCTs(const CSCCorrelatedLCTDigiCollectio stubs_comparison[2].totStubs_emul_readout = nemul_readout; stubs_comparison[2].nStub_data = i + 1; stubs_comparison[2].has_data = true; - stubs_comparison[2].quality_data = (*pd).getQuality(); - stubs_comparison[2].key_WG_data = (*pd).getKeyWG(); - stubs_comparison[2].key_hs_data = (*pd).getStrip(); + stubs_comparison[2].quality_data = (*pd).quality(); + stubs_comparison[2].key_WG_data = (*pd).keyWireGroup(); + stubs_comparison[2].key_hs_data = (*pd).strip(); //cout <<" CSC detid "<< detid <<" LCT in data "<< (*pd) <<" do doesALCTCrossCLCT "<< endl; - stubs_comparison[2].WGcrossHS_data = doesALCTCrossCLCT(detid, (*pd).getKeyWG(), (*pd).getStrip()); - stubs_comparison[2].bend_data = (*pd).getBend(); - stubs_comparison[2].pattern_data = (*pd).getCLCTPattern(); - stubs_comparison[2].bx_data = (*pd).getBX(); + stubs_comparison[2].WGcrossHS_data = doesALCTCrossCLCT(detid, (*pd).keyWireGroup(), (*pd).strip()); + stubs_comparison[2].bend_data = (*pd).bend(); + stubs_comparison[2].pattern_data = (*pd).clctPattern(); + stubs_comparison[2].bx_data = (*pd).bx(); stubs_comparison[2].trknmb_data = data_trknmb; - GlobalPoint gp_lct_data(getGlobalPosition(detid.rawId(), (*pd).getKeyWG(), (*pd).getStrip())); + GlobalPoint gp_lct_data(getGlobalPosition(detid.rawId(), (*pd).keyWireGroup(), (*pd).strip())); stubs_comparison[2].eta_data = gp_lct_data.eta(); stubs_comparison[2].phi_data = gp_lct_data.phi(); int j = -1; @@ -2200,14 +2200,14 @@ void CSCTriggerPrimitivesReader::compareLCTs(const CSCCorrelatedLCTDigiCollectio continue; if (bookedlctV_emul[j]) continue; //used alct - int emul_trknmb = (*pe).getTrknmb(); - int emul_quality = (*pe).getQuality(); - int emul_wiregroup = (*pe).getKeyWG(); - int emul_keystrip = (*pe).getStrip(); - int emul_pattern = (*pe).getCLCTPattern(); - int emul_striptype = (*pe).getStripType(); - int emul_bend = (*pe).getBend(); - int emul_bx = (*pe).getBX(); + int emul_trknmb = (*pe).trackNumber(); + int emul_quality = (*pe).quality(); + int emul_wiregroup = (*pe).keyWireGroup(); + int emul_keystrip = (*pe).strip(); + int emul_pattern = (*pe).clctPattern(); + int emul_striptype = (*pe).stripType(); + int emul_bend = (*pe).bend(); + int emul_bx = (*pe).bx(); if (abs(data_keystrip - emul_keystrip) <= 2 || abs(data_wiregroup - emul_wiregroup) <= 2) { // Convert emulator BX into hardware BX using full 12-bit // BX words in ALCT and CLCT digi collections. @@ -2246,17 +2246,17 @@ void CSCTriggerPrimitivesReader::compareLCTs(const CSCCorrelatedLCTDigiCollectio } stubs_comparison[2].nStub_emul = j + 1; stubs_comparison[2].has_emul = true; - stubs_comparison[2].quality_emul = (*pe).getQuality(); - stubs_comparison[2].key_WG_emul = (*pe).getKeyWG(); - stubs_comparison[2].key_hs_emul = (*pe).getStrip(); - stubs_comparison[2].bend_emul = (*pe).getBend(); - stubs_comparison[2].pattern_emul = (*pe).getCLCTPattern(); - stubs_comparison[2].bx_emul = (*pe).getBX(); + stubs_comparison[2].quality_emul = (*pe).quality(); + stubs_comparison[2].key_WG_emul = (*pe).keyWireGroup(); + stubs_comparison[2].key_hs_emul = (*pe).strip(); + stubs_comparison[2].bend_emul = (*pe).bend(); + stubs_comparison[2].pattern_emul = (*pe).clctPattern(); + stubs_comparison[2].bx_emul = (*pe).bx(); //cout <<" CSC detid "<< detid <<" LCT in emul "<< (*pe) <<" do doesALCTCrossCLCT "<< endl; - stubs_comparison[2].WGcrossHS_emul = doesALCTCrossCLCT(detid, (*pe).getKeyWG(), (*pe).getStrip()); + stubs_comparison[2].WGcrossHS_emul = doesALCTCrossCLCT(detid, (*pe).keyWireGroup(), (*pe).strip()); stubs_comparison[2].bx_corr_emul = emul_corr_bx; stubs_comparison[2].trknmb_emul = emul_trknmb; - GlobalPoint gp_lct_emul(getGlobalPosition(detid.rawId(), (*pe).getKeyWG(), (*pe).getStrip())); + GlobalPoint gp_lct_emul(getGlobalPosition(detid.rawId(), (*pe).keyWireGroup(), (*pe).strip())); stubs_comparison[2].eta_emul = gp_lct_emul.eta(); stubs_comparison[2].phi_emul = gp_lct_emul.phi(); bookedlctV_emul[j] = true; @@ -2285,22 +2285,23 @@ void CSCTriggerPrimitivesReader::compareLCTs(const CSCCorrelatedLCTDigiCollectio stubs_comparison[2].totStubs_data = ndata; stubs_comparison[2].totStubs_emul = nemul; stubs_comparison[2].totStubs_emul_readout = nemul_readout; - stubs_comparison[2].trknmb_emul = lctV_emul[i].getTrknmb(); + stubs_comparison[2].trknmb_emul = lctV_emul[i].trackNumber(); stubs_comparison[2].nStub_data = -1; stubs_comparison[2].has_data = false; stubs_comparison[2].nStub_emul = k + 1; stubs_comparison[2].has_emul = true; stubs_comparison[2].WGcrossHS_emul = - doesALCTCrossCLCT(detid, lctV_emul[k].getKeyWG(), lctV_emul[k].getStrip()); - stubs_comparison[2].quality_emul = lctV_emul[k].getQuality(); - stubs_comparison[2].key_WG_emul = lctV_emul[k].getKeyWG(); - stubs_comparison[2].key_hs_emul = lctV_emul[k].getStrip(); - stubs_comparison[2].bend_emul = lctV_emul[k].getBend(); - stubs_comparison[2].pattern_emul = lctV_emul[k].getCLCTPattern(); - stubs_comparison[2].bx_emul = lctV_emul[k].getBX(); - //stubs_comparison[2].fullbx_emul = lctV_emul[k].getFullBX(); + doesALCTCrossCLCT(detid, lctV_emul[k].keyWireGroup(), lctV_emul[k].strip()); + stubs_comparison[2].quality_emul = lctV_emul[k].quality(); + stubs_comparison[2].key_WG_emul = lctV_emul[k].keyWireGroup(); + stubs_comparison[2].key_hs_emul = lctV_emul[k].strip(); + stubs_comparison[2].bend_emul = lctV_emul[k].bend(); + stubs_comparison[2].pattern_emul = lctV_emul[k].clctPattern(); + stubs_comparison[2].bx_emul = lctV_emul[k].bx(); + //stubs_comparison[2].fullbx_emul = lctV_emul[k].fullBX(); // Emulator BX NOT Known from the data. - GlobalPoint gp_lct_emul(getGlobalPosition(detid.rawId(), lctV_emul[k].getKeyWG(), lctV_emul[k].getStrip())); + GlobalPoint gp_lct_emul( + getGlobalPosition(detid.rawId(), lctV_emul[k].keyWireGroup(), lctV_emul[k].strip())); stubs_comparison[2].eta_emul = gp_lct_emul.eta(); stubs_comparison[2].phi_emul = gp_lct_emul.phi(); bookedlctV_emul[k] = true; @@ -2366,8 +2367,8 @@ void CSCTriggerPrimitivesReader::compareMPCLCTs(const CSCCorrelatedLCTDigiCollec strstrm << "\n **** " << nemul << " valid emul LCTs found:\n"; for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) { strstrm << " " << (*pe); - strstrm << " corr BX = " << convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data); - strstrm << " LCT pattern = " << (*pe).getPattern(); + strstrm << " corr BX = " << convertBXofLCT((*pe).bx(), detid, alcts_data, clcts_data); + strstrm << " LCT pattern = " << (*pe).pattern(); strstrm << "\n"; } LogTrace("CSCTriggerPrimitivesReader") << strstrm.str(); @@ -2396,14 +2397,14 @@ void CSCTriggerPrimitivesReader::compareMPCLCTs(const CSCCorrelatedLCTDigiCollec i++; if ((*pd).isValid() == 0) continue; - int data_trknmb = (*pd).getTrknmb(); - int data_quality = (*pd).getQuality(); - int data_wiregroup = (*pd).getKeyWG(); - int data_keystrip = (*pd).getStrip(); - int data_pattern = (*pd).getCLCTPattern(); - int data_striptype = (*pd).getStripType(); - int data_bend = (*pd).getBend(); - int data_bx = (*pd).getBX(); + int data_trknmb = (*pd).trackNumber(); + int data_quality = (*pd).quality(); + int data_wiregroup = (*pd).keyWireGroup(); + int data_keystrip = (*pd).strip(); + int data_pattern = (*pd).clctPattern(); + int data_striptype = (*pd).stripType(); + int data_bend = (*pd).bend(); + int data_bx = (*pd).bx(); stubs_comparison[3].init(RUN_, Event_); stubs_comparison[3].firstfill = firstfill; @@ -2419,15 +2420,15 @@ void CSCTriggerPrimitivesReader::compareMPCLCTs(const CSCCorrelatedLCTDigiCollec stubs_comparison[3].totStubs_emul = nemul; stubs_comparison[3].nStub_data = i + 1; stubs_comparison[3].has_data = true; - stubs_comparison[3].WGcrossHS_data = doesALCTCrossCLCT(detid, (*pd).getKeyWG(), (*pd).getStrip()); - stubs_comparison[3].quality_data = (*pd).getQuality(); - stubs_comparison[3].key_WG_data = (*pd).getKeyWG(); - stubs_comparison[3].key_hs_data = (*pd).getStrip(); - stubs_comparison[3].bend_data = (*pd).getBend(); - stubs_comparison[3].pattern_data = (*pd).getCLCTPattern(); - stubs_comparison[3].bx_data = (*pd).getBX(); + stubs_comparison[3].WGcrossHS_data = doesALCTCrossCLCT(detid, (*pd).keyWireGroup(), (*pd).strip()); + stubs_comparison[3].quality_data = (*pd).quality(); + stubs_comparison[3].key_WG_data = (*pd).keyWireGroup(); + stubs_comparison[3].key_hs_data = (*pd).strip(); + stubs_comparison[3].bend_data = (*pd).bend(); + stubs_comparison[3].pattern_data = (*pd).clctPattern(); + stubs_comparison[3].bx_data = (*pd).bx(); stubs_comparison[3].trknmb_data = data_trknmb; - GlobalPoint gp_lct_data(getGlobalPosition(detid.rawId(), (*pd).getKeyWG(), (*pd).getStrip())); + GlobalPoint gp_lct_data(getGlobalPosition(detid.rawId(), (*pd).keyWireGroup(), (*pd).strip())); stubs_comparison[3].eta_data = gp_lct_data.eta(); stubs_comparison[3].phi_data = gp_lct_data.phi(); int j = -1; @@ -2435,14 +2436,14 @@ void CSCTriggerPrimitivesReader::compareMPCLCTs(const CSCCorrelatedLCTDigiCollec j++; if ((*pe).isValid() == 0) continue; - int emul_trknmb = (*pe).getTrknmb(); - int emul_quality = (*pe).getQuality(); - int emul_wiregroup = (*pe).getKeyWG(); - int emul_keystrip = (*pe).getStrip(); - int emul_pattern = (*pe).getCLCTPattern(); - int emul_striptype = (*pe).getStripType(); - int emul_bend = (*pe).getBend(); - int emul_bx = (*pe).getBX(); + int emul_trknmb = (*pe).trackNumber(); + int emul_quality = (*pe).quality(); + int emul_wiregroup = (*pe).keyWireGroup(); + int emul_keystrip = (*pe).strip(); + int emul_pattern = (*pe).clctPattern(); + int emul_striptype = (*pe).stripType(); + int emul_bend = (*pe).bend(); + int emul_bx = (*pe).bx(); if (data_trknmb == emul_trknmb) { // Convert emulator BX into hardware BX using full 12-bit // BX words in ALCT and CLCT digi collections. @@ -2479,16 +2480,16 @@ void CSCTriggerPrimitivesReader::compareMPCLCTs(const CSCCorrelatedLCTDigiCollec LogTrace("CSCTriggerPrimitivesReader") << " Identical LCTs #" << data_trknmb; stubs_comparison[3].nStub_emul = j + 1; stubs_comparison[3].has_emul = true; - stubs_comparison[3].WGcrossHS_emul = doesALCTCrossCLCT(detid, (*pe).getKeyWG(), (*pe).getStrip()); - stubs_comparison[3].quality_emul = (*pe).getQuality(); - stubs_comparison[3].key_WG_emul = (*pe).getKeyWG(); - stubs_comparison[3].key_hs_emul = (*pe).getStrip(); - stubs_comparison[3].bend_emul = (*pe).getBend(); - stubs_comparison[3].pattern_emul = (*pe).getCLCTPattern(); - stubs_comparison[3].bx_emul = (*pe).getBX(); + stubs_comparison[3].WGcrossHS_emul = doesALCTCrossCLCT(detid, (*pe).keyWireGroup(), (*pe).strip()); + stubs_comparison[3].quality_emul = (*pe).quality(); + stubs_comparison[3].key_WG_emul = (*pe).keyWireGroup(); + stubs_comparison[3].key_hs_emul = (*pe).strip(); + stubs_comparison[3].bend_emul = (*pe).bend(); + stubs_comparison[3].pattern_emul = (*pe).clctPattern(); + stubs_comparison[3].bx_emul = (*pe).bx(); stubs_comparison[3].bx_corr_emul = emul_corr_bx; stubs_comparison[3].trknmb_emul = emul_trknmb; - GlobalPoint gp_lct_emul(getGlobalPosition(detid.rawId(), (*pe).getKeyWG(), (*pe).getStrip())); + GlobalPoint gp_lct_emul(getGlobalPosition(detid.rawId(), (*pe).keyWireGroup(), (*pe).strip())); stubs_comparison[3].eta_emul = gp_lct_emul.eta(); stubs_comparison[3].phi_emul = gp_lct_emul.phi(); bookedlctV_emul[j] = true; @@ -2523,22 +2524,23 @@ void CSCTriggerPrimitivesReader::compareMPCLCTs(const CSCCorrelatedLCTDigiCollec stubs_comparison[3].chambertype = detid.iChamberType(); stubs_comparison[3].totStubs_data = ndata; stubs_comparison[3].totStubs_emul = nemul; - stubs_comparison[3].trknmb_emul = lctV_emul[i].getTrknmb(); + stubs_comparison[3].trknmb_emul = lctV_emul[i].trackNumber(); stubs_comparison[3].nStub_data = -1; stubs_comparison[3].has_data = false; stubs_comparison[3].nStub_emul = k + 1; stubs_comparison[3].has_emul = true; stubs_comparison[3].WGcrossHS_emul = - doesALCTCrossCLCT(detid, lctV_emul[k].getKeyWG(), lctV_emul[k].getStrip()); - stubs_comparison[3].quality_emul = lctV_emul[k].getQuality(); - stubs_comparison[3].key_WG_emul = lctV_emul[k].getKeyWG(); - stubs_comparison[3].key_hs_emul = lctV_emul[k].getStrip(); - stubs_comparison[3].bend_emul = lctV_emul[k].getBend(); - stubs_comparison[3].pattern_emul = lctV_emul[k].getCLCTPattern(); - stubs_comparison[3].bx_emul = lctV_emul[k].getBX(); - //stubs_comparison[2].fullbx_emul = lctV_emul[k].getFullBX(); + doesALCTCrossCLCT(detid, lctV_emul[k].keyWireGroup(), lctV_emul[k].strip()); + stubs_comparison[3].quality_emul = lctV_emul[k].quality(); + stubs_comparison[3].key_WG_emul = lctV_emul[k].keyWireGroup(); + stubs_comparison[3].key_hs_emul = lctV_emul[k].strip(); + stubs_comparison[3].bend_emul = lctV_emul[k].bend(); + stubs_comparison[3].pattern_emul = lctV_emul[k].clctPattern(); + stubs_comparison[3].bx_emul = lctV_emul[k].bx(); + //stubs_comparison[2].fullbx_emul = lctV_emul[k].fullBX(); // Emulator BX NOT Known from the data. - GlobalPoint gp_lct_emul(getGlobalPosition(detid.rawId(), lctV_emul[k].getKeyWG(), lctV_emul[k].getStrip())); + GlobalPoint gp_lct_emul( + getGlobalPosition(detid.rawId(), lctV_emul[k].keyWireGroup(), lctV_emul[k].strip())); stubs_comparison[3].eta_emul = gp_lct_emul.eta(); stubs_comparison[3].phi_emul = gp_lct_emul.phi(); bookedlctV_emul[k] = true; @@ -2563,7 +2565,7 @@ int CSCTriggerPrimitivesReader::convertBXofLCT(const int emul_bx, const auto& arange = alcts_data->get(detid); for (auto digiIt = arange.first; digiIt != arange.second; digiIt++) { if ((*digiIt).isValid()) { - full_anode_bx = (*digiIt).getFullBX(); + full_anode_bx = (*digiIt).fullBX(); break; } } @@ -2572,7 +2574,7 @@ int CSCTriggerPrimitivesReader::convertBXofLCT(const int emul_bx, const auto& crange = clcts_data->get(detid); for (auto digiIt = crange.first; digiIt != crange.second; digiIt++) { if ((*digiIt).isValid()) { - //full_cathode_bx = (*digiIt).getFullBX(); + //full_cathode_bx = (*digiIt).fullBX(); break; } } @@ -2739,7 +2741,7 @@ void CSCTriggerPrimitivesReader::calcResolution(const CSCALCTDigiCollection* alc int hitWG = alct_analyzer.nearestWG(alctInfo, hitPhi, hitEta); if (hitWG >= 0.) { // Key wire group and key layer id. - int wiregroup = (*digiIt).getKeyWG(); + int wiregroup = (*digiIt).keyWireGroup(); CSCDetId layerId(id.endcap(), id.station(), id.ring(), id.chamber(), CSCConstants::KEY_ALCT_LAYER); int endc = id.endcap(); @@ -2792,10 +2794,10 @@ void CSCTriggerPrimitivesReader::calcResolution(const CSCALCTDigiCollection* alc int hitHS = clct_analyzer.nearestHS(clctInfo, hitPhi, hitEta); if (hitHS >= 0.) { // Key strip and key layer id. - int halfstrip = (*digiIt).getKeyStrip(); + int halfstrip = (*digiIt).keyStrip(); int strip = halfstrip / 2; int distrip = halfstrip / 4; - int stripType = (*digiIt).getStripType(); + int stripType = (*digiIt).stripType(); CSCDetId layerId(id.endcap(), id.station(), id.ring(), id.chamber(), key_layer); int endc = id.endcap(); @@ -2853,7 +2855,7 @@ void CSCTriggerPrimitivesReader::calcResolution(const CSCALCTDigiCollection* alc if (stripType == 1) { // half-strips double hsperrad = getHsPerRad(csctype); // halfstrips-per-radian if ((endc == 1 && (stat == 1 || stat == 2)) || (endc == 2 && (stat == 3 || stat == 4))) { - hPhiDiffPattern[(*digiIt).getPattern()]->Fill(deltaPhi / 1000 * hsperrad); + hPhiDiffPattern[(*digiIt).pattern()]->Fill(deltaPhi / 1000 * hsperrad); } } } @@ -4648,7 +4650,7 @@ GlobalPoint CSCTriggerPrimitivesReader::getGlobalPosition(unsigned int rawId, in auto cscChamber = geom_->chamber(cscId); float fractional_strip = 0.5 * (keyHS + 1) - 0.25; auto layer_geo = cscChamber->layer(CSCConstants::KEY_CLCT_LAYER)->geometry(); - // LCT::getKeyWG() also starts from 0 + // LCT::keyWireGroup() also starts from 0 float wire = layer_geo->middleWireOfGroup(keyWg + 1); LocalPoint csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire); GlobalPoint csc_gp = geom_->idToDet(key_id)->surface().toGlobal(csc_intersect); diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc index e5eacc99e2281..c1152a7d28a50 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc @@ -806,12 +806,12 @@ void CSCAnodeLCTProcessor::ghostCancellationLogicOneWire(const int key_wire, int //ignore whether ALCT is valid or not in ghost cancellation //if wiregroup 10, 11, 12 all have trigger and same quality, only wiregroup 10 can keep the trigger //this met with firmware - if (not(p.getKeyWG() == key_wire - 1 and 1 - p.getAccelerator() == i_pattern)) + if (not(p.keyWireGroup() == key_wire - 1 and 1 - p.accelerator() == i_pattern)) continue; bool ghost_cleared_prev = false; - int qual_prev = p.getQuality(); - int first_bx_prev = p.getBX(); + int qual_prev = p.quality(); + int first_bx_prev = p.bx(); if (infoV > 1) LogTrace("CSCAnodeLCTProcessor") << "ghost concellation logic " << ((i_pattern == 0) ? "Accelerator" : "Collision") << " key_wire " @@ -868,11 +868,11 @@ void CSCAnodeLCTProcessor::lctSearch() { if (infoV > 0) { int n_alct_all = 0, n_alct = 0; for (const auto& p : lct_list) { - if (p.isValid() && p.getBX() == CSCConstants::LCT_CENTRAL_BX) + if (p.isValid() && p.bx() == CSCConstants::LCT_CENTRAL_BX) n_alct_all++; } for (const auto& p : fourBest) { - if (p.isValid() && p.getBX() == CSCConstants::LCT_CENTRAL_BX) + if (p.isValid() && p.bx() == CSCConstants::LCT_CENTRAL_BX) n_alct++; } @@ -883,7 +883,7 @@ void CSCAnodeLCTProcessor::lctSearch() { // Select two best of four per time bin, based on quality and // accel_mode parameter. for (const auto& p : fourBest) { - const int bx = p.getBX(); + const int bx = p.bx(); if (bx >= CSCConstants::MAX_ALCT_TBINS) { if (infoV > 0) edm::LogWarning("CSCAnodeLCTProcessor|OutOfTimeALCT") @@ -906,7 +906,8 @@ void CSCAnodeLCTProcessor::lctSearch() { if (bestALCT[bx].isValid()) { bestALCT[bx].setTrknmb(1); if (infoV > 0) { - LogDebug("CSCAnodeLCTProcessor") << bestALCT[bx] << " fullBX = " << bestALCT[bx].getFullBX() << " found in " + LogDebug("CSCAnodeLCTProcessor") << "\n" + << bestALCT[bx] << " fullBX = " << bestALCT[bx].fullBX() << " found in " << theCSCName_ << " (sector " << theSector << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")" << "\n"; @@ -915,8 +916,8 @@ void CSCAnodeLCTProcessor::lctSearch() { secondALCT[bx].setTrknmb(2); if (infoV > 0) { LogDebug("CSCAnodeLCTProcessor") - << secondALCT[bx] << " fullBX = " << secondALCT[bx].getFullBX() << " found in " << theCSCName_ - << " (sector " << theSector << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")" + << secondALCT[bx] << " fullBX = " << secondALCT[bx].fullBX() << " found in " << theCSCName_ << " (sector " + << theSector << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")" << "\n"; } } @@ -965,16 +966,16 @@ std::vector CSCAnodeLCTProcessor::bestTrackSelector(const std::vect // the priority is given to the ALCT with larger wiregroup number // in the search for tA (collision and accelerator), and to the ALCT // with smaller wiregroup number in the search for tB. - int bx = p.getBX(); - int accel = p.getAccelerator(); - int qual = p.getQuality(); - int wire = p.getKeyWG(); + int bx = p.bx(); + int accel = p.accelerator(); + int qual = p.quality(); + int wire = p.keyWireGroup(); bool vA = tA[bx][accel].isValid(); bool vB = tB[bx][accel].isValid(); - int qA = tA[bx][accel].getQuality(); - int qB = tB[bx][accel].getQuality(); - int wA = tA[bx][accel].getKeyWG(); - int wB = tB[bx][accel].getKeyWG(); + int qA = tA[bx][accel].quality(); + int qB = tB[bx][accel].quality(); + int wA = tA[bx][accel].keyWireGroup(); + int wB = tB[bx][accel].keyWireGroup(); if (!vA || qual > qA || (qual == qA && wire > wA)) { tA[bx][accel] = p; } @@ -994,7 +995,7 @@ std::vector CSCAnodeLCTProcessor::bestTrackSelector(const std::vect bestALCTs[bx][accel] = tA[bx][accel]; // If tA exists, tB exists too. - if (tA[bx][accel] != tB[bx][accel] && tA[bx][accel].getQuality() == tB[bx][accel].getQuality()) { + if (tA[bx][accel] != tB[bx][accel] && tA[bx][accel].quality() == tB[bx][accel].quality()) { secondALCTs[bx][accel] = tB[bx][accel]; } else { // Funny part: if tA and tB are the same, or the quality of tB @@ -1002,10 +1003,9 @@ std::vector CSCAnodeLCTProcessor::bestTrackSelector(const std::vect // not tB. Instead it is the largest-wiregroup ALCT among those // ALCT whose qualities are lower than the quality of the best one. for (const auto& p : all_alcts) { - if (p.isValid() && p.getAccelerator() == accel && p.getBX() == bx && - p.getQuality() < bestALCTs[bx][accel].getQuality() && - p.getQuality() >= secondALCTs[bx][accel].getQuality() && - p.getKeyWG() >= secondALCTs[bx][accel].getKeyWG()) { + if (p.isValid() && p.accelerator() == accel && p.bx() == bx && + p.quality() < bestALCTs[bx][accel].quality() && p.quality() >= secondALCTs[bx][accel].quality() && + p.keyWireGroup() >= secondALCTs[bx][accel].keyWireGroup()) { secondALCTs[bx][accel] = p; } } @@ -1048,16 +1048,16 @@ bool CSCAnodeLCTProcessor::isBetterALCT(const CSCALCTDigi& lhsALCT, const CSCALC // ALCTs found at earlier bx times are ranked higher than ALCTs found at // later bx times regardless of the quality. - if (lhsALCT.getBX() < rhsALCT.getBX()) { + if (lhsALCT.bx() < rhsALCT.bx()) { returnValue = true; } - if (lhsALCT.getBX() != rhsALCT.getBX()) { + if (lhsALCT.bx() != rhsALCT.bx()) { return returnValue; } // First check the quality of ALCTs. - const int qual1 = lhsALCT.getQuality(); - const int qual2 = rhsALCT.getQuality(); + const int qual1 = lhsALCT.quality(); + const int qual2 = rhsALCT.quality(); if (qual1 > qual2) { returnValue = true; } @@ -1065,14 +1065,14 @@ bool CSCAnodeLCTProcessor::isBetterALCT(const CSCALCTDigi& lhsALCT, const CSCALC // If they are not the same, rank according to accel_mode value. // If they are the same, keep the track selector assignment. //else if (qual1 == qual2 && - // lhsALCT.getAccelerator() != rhsALCT.getAccelerator() && - // quality[lhsALCT.getKeyWG()][1-lhsALCT.getAccelerator()] > - // quality[rhsALCT.getKeyWG()][1-rhsALCT.getAccelerator()]) + // lhsALCT.accelerator() != rhsALCT.accelerator() && + // quality[lhsALCT.keyWireGroup()][1-lhsALCT.accelerator()] > + // quality[rhsALCT.keyWireGroup()][1-rhsALCT.accelerator()]) // {returnValue = true;} - else if (qual1 == qual2 && lhsALCT.getAccelerator() != rhsALCT.getAccelerator()) { - if ((accel_mode == 0 || accel_mode == 1) && rhsALCT.getAccelerator() == 0) + else if (qual1 == qual2 && lhsALCT.accelerator() != rhsALCT.accelerator()) { + if ((accel_mode == 0 || accel_mode == 1) && rhsALCT.accelerator() == 0) returnValue = true; - if ((accel_mode == 2 || accel_mode == 3) && lhsALCT.getAccelerator() == 0) + if ((accel_mode == 2 || accel_mode == 3) && lhsALCT.accelerator() == 0) returnValue = true; } @@ -1254,20 +1254,20 @@ std::vector CSCAnodeLCTProcessor::readoutALCTs(int nMaxALCTs) const if (!p.isValid()) continue; - int bx = p.getBX(); + int bx = p.bx(); // Skip ALCTs found too early relative to L1Accept. if (bx <= early_tbins) { if (infoV > 1) - LogDebug("CSCAnodeLCTProcessor") << " Do not report ALCT on keywire " << p.getKeyWG() << ": found at bx " << bx - << ", whereas the earliest allowed bx is " << early_tbins + 1; + LogDebug("CSCAnodeLCTProcessor") << " Do not report ALCT on keywire " << p.keyWireGroup() << ": found at bx " + << bx << ", whereas the earliest allowed bx is " << early_tbins + 1; continue; } // Skip ALCTs found too late relative to L1Accept. if (bx > late_tbins) { if (infoV > 1) - LogDebug("CSCAnodeLCTProcessor") << " Do not report ALCT on keywire " << p.getKeyWG() << ": found at bx " << bx - << ", whereas the latest allowed bx is " << late_tbins; + LogDebug("CSCAnodeLCTProcessor") << " Do not report ALCT on keywire " << p.keyWireGroup() << ": found at bx " + << bx << ", whereas the latest allowed bx is " << late_tbins; continue; } @@ -1281,7 +1281,7 @@ std::vector CSCAnodeLCTProcessor::readoutALCTs(int nMaxALCTs) const // but right before we put emulated ALCTs in the event, we shift the BX // by -5 to make sure they are compatible with real data ALCTs! for (auto& p : tmpV) { - p.setBX(p.getBX() - (CSCConstants::LCT_CENTRAL_BX - l1a_window_width / 2)); + p.setBX(p.bx() - (CSCConstants::LCT_CENTRAL_BX - l1a_window_width / 2)); } return tmpV; } diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc index 5f9d69859199a..291856a197ff6 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc @@ -319,7 +319,7 @@ std::vector CSCCathodeLCTProcessor::run(const CSCComparatorDigiColl // this shift does not affect the readout of the CLCTs // emulated CLCTs put in the event should be centered at bin 7 (as in data) for (auto& p : tmpV) { - p.setBX(p.getBX() + alctClctOffset_); + p.setBX(p.bx() + alctClctOffset_); } return tmpV; @@ -342,7 +342,7 @@ void CSCCathodeLCTProcessor::run( int CLCTIndex_[CSCConstants::MAX_CLCT_TBINS] = {}; for (const auto& p : CLCTlist) { - const int bx = p.getBX(); + const int bx = p.bx(); if (bx >= CSCConstants::MAX_CLCT_TBINS) { if (infoV > 0) edm::LogWarning("L1CSCTPEmulatorOutOfTimeCLCT") @@ -1109,12 +1109,12 @@ std::vector CSCCathodeLCTProcessor::readoutCLCTs(int nMaxCLCTs) con if (!p.isValid()) continue; - const int bx = p.getBX(); + const int bx = p.bx(); // Skip CLCTs found too early relative to L1Accept. if (bx <= early_tbins) { if (infoV > 1) LogDebug("CSCCathodeLCTProcessor") - << " Do not report CLCT on key halfstrip " << p.getKeyStrip() << ": found at bx " << bx + << " Do not report CLCT on key halfstrip " << p.keyStrip() << ": found at bx " << bx << ", whereas the earliest allowed bx is " << early_tbins + 1; continue; } @@ -1123,7 +1123,7 @@ std::vector CSCCathodeLCTProcessor::readoutCLCTs(int nMaxCLCTs) con if (bx > late_tbins) { if (infoV > 1) LogDebug("CSCCathodeLCTProcessor") - << " Do not report CLCT on key halfstrip " << p.getKeyStrip() << ": found at bx " << bx + << " Do not report CLCT on key halfstrip " << p.keyStrip() << ": found at bx " << bx << ", whereas the latest allowed bx is " << late_tbins; continue; } @@ -1157,7 +1157,7 @@ std::vector CSCCathodeLCTProcessor::readoutCLCTsME1a(int nMaxCLCTs) return tmpV; const std::vector& allCLCTs = readoutCLCTs(nMaxCLCTs); for (const auto& clct : allCLCTs) - if (clct.getCFEB() >= 4) + if (clct.cfeb() >= 4) tmpV.push_back(clct); return tmpV; } @@ -1170,7 +1170,7 @@ std::vector CSCCathodeLCTProcessor::readoutCLCTsME1b(int nMaxCLCTs) return tmpV; const std::vector& allCLCTs = readoutCLCTs(nMaxCLCTs); for (const auto& clct : allCLCTs) - if (clct.getCFEB() < 4) + if (clct.cfeb() < 4) tmpV.push_back(clct); return tmpV; } @@ -1181,7 +1181,7 @@ std::vector CSCCathodeLCTProcessor::preTriggerDigisME1a() return tmpV; const std::vector& allPretriggerdigis = preTriggerDigis(); for (const auto& preclct : allPretriggerdigis) - if (preclct.getCFEB() >= 4) + if (preclct.cfeb() >= 4) tmpV.push_back(preclct); return tmpV; } @@ -1192,7 +1192,7 @@ std::vector CSCCathodeLCTProcessor::preTriggerDigisME1b() return tmpV; const std::vector& allPretriggerdigis = preTriggerDigis(); for (const auto& preclct : allPretriggerdigis) - if (preclct.getCFEB() < 4) + if (preclct.cfeb() < 4) tmpV.push_back(preclct); return tmpV; } @@ -1216,13 +1216,14 @@ std::vector CSCCathodeLCTProcessor::getCLCTs() const { // to make a proper comparison with ALCTs we need // CLCT and ALCT to have the central BX in the same bin CSCCLCTDigi CSCCathodeLCTProcessor::getBestCLCT(int bx) const { - CSCCLCTDigi lct = CLCTContainer_[bx][0]; - lct.setBX(lct.getBX() + alctClctOffset_); + CSCCLCTDigi lct = CLCTCont()ainer_[bx][0]; + lct.setBX(lct.bx() + alctClctOffset_); return lct; } + CSCCLCTDigi CSCCathodeLCTProcessor::getSecondCLCT(int bx) const { - CSCCLCTDigi lct = CLCTContainer_[bx][1]; - lct.setBX(lct.getBX() + alctClctOffset_); + CSCCLCTDgetSecondCLCTCLCTContainer_[bx][1]; + lct.setBX(lct.bx() + alctClctOffset_); return lct; } diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboard.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboard.cc index ea5c3cea83def..3d72f3a613b13 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboard.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboard.cc @@ -105,24 +105,24 @@ CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& alct // Determine the case and assign properties depending on the LCT dataformat (old/new) if (alct.isValid() and clct.isValid() and gem1.isValid() and not gem2.isValid()) { - pattern = encodePattern(clct.getPattern()); + pattern = encodePattern(clct.pattern()); quality = findQualityGEM(alct, clct, 1); - bx = alct.getBX(); - keyStrip = clct.getKeyStrip(); - keyWG = alct.getKeyWG(); - bend = clct.getBend(); + bx = alct.bx(); + keyStrip = clct.keyStrip(); + keyWG = alct.keyWireGroup(); + bend = clct.bend(); thisLCT.setALCT(getBXShiftedALCT(alct)); thisLCT.setCLCT(getBXShiftedCLCT(clct)); thisLCT.setGEM1(gem1); thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCTGEM); valid = doesWiregroupCrossStrip(keyWG, keyStrip) ? 1 : 0; } else if (alct.isValid() and clct.isValid() and not gem1.isValid() and gem2.isValid()) { - pattern = encodePattern(clct.getPattern()); + pattern = encodePattern(clct.pattern()); quality = findQualityGEM(alct, clct, 2); - bx = alct.getBX(); - keyStrip = clct.getKeyStrip(); - keyWG = alct.getKeyWG(); - bend = clct.getBend(); + bx = alct.bx(); + keyStrip = clct.keyStrip(); + keyWG = alct.keyWireGroup(); + bend = clct.bend(); thisLCT.setALCT(getBXShiftedALCT(alct)); thisLCT.setCLCT(getBXShiftedCLCT(clct)); thisLCT.setGEM1(gem2.first()); @@ -138,7 +138,7 @@ CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& alct auto p(getCSCPart(-1)); //use -1 as fake halfstrip, it returns ME11 if station==1 && (ring==1 or ring==4) if (p == CSCPart::ME11) { - if (alct.getKeyWG() >= 10) + if (alct.keyWireGroup() >= 10) p = CSCPart::ME1B; else p = CSCPart::ME1A; @@ -151,7 +151,7 @@ CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& alct keyStrip = mymap1[gem2.pad(2) - 1]; if (p == CSCPart::ME1A and keyStrip <= CSCConstants::MAX_HALF_STRIP_ME1B) keyStrip += CSCConstants::MAX_HALF_STRIP_ME1B + 1; - keyWG = alct.getKeyWG(); + keyWG = alct.keyWireGroup(); if ((not doesWiregroupCrossStrip(keyWG, keyStrip)) and p == CSCPart::ME1B and keyWG <= 15) { //try ME1A as strip and WG do not cross @@ -162,7 +162,7 @@ CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& alct pattern = promoteALCTGEMpattern_ ? 10 : 0; quality = promoteALCTGEMquality_ ? 15 : 11; - bx = alct.getBX(); + bx = alct.bx(); thisLCT.setALCT(getBXShiftedALCT(alct)); thisLCT.setGEM1(gem2.first()); thisLCT.setGEM2(gem2.second()); @@ -170,13 +170,13 @@ CSCCorrelatedLCTDigi CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& alct valid = true; } else if (clct.isValid() and gem2.isValid() and not alct.isValid()) { const auto& mymap2 = getLUT()->get_gem_roll_to_csc_wg(theParity); - pattern = encodePattern(clct.getPattern()); + pattern = encodePattern(clct.pattern()); quality = promoteCLCTGEMquality_ ? 15 : 11; bx = gem2.bx(1) + CSCConstants::LCT_CENTRAL_BX; - keyStrip = clct.getKeyStrip(); + keyStrip = clct.keyStrip(); // choose the corresponding wire-group in the middle of the partition keyWG = mymap2[gem2.roll() - 1]; - bend = clct.getBend(); + bend = clct.bend(); thisLCT.setCLCT(clct); thisLCT.setGEM1(gem2.first()); thisLCT.setGEM2(gem2.second()); @@ -240,8 +240,8 @@ int CSCGEMMotherboard::getRoll(const GEMPadDigiId& p) const { return GEMDetId(p. int CSCGEMMotherboard::getRoll(const GEMCoPadDigiId& p) const { return p.second.roll(); } std::pair CSCGEMMotherboard::getRolls(const CSCALCTDigi& alct) const { - return std::make_pair((getLUT()->get_csc_wg_to_gem_roll(theParity))[alct.getKeyWG()].first, - (getLUT()->get_csc_wg_to_gem_roll(theParity))[alct.getKeyWG()].second); + return std::make_pair((getLUT()->get_csc_wg_to_gem_roll(theParity))[alct.keyWireGroup()].first, + (getLUT()->get_csc_wg_to_gem_roll(theParity))[alct.keyWireGroup()].second); } float CSCGEMMotherboard::getPad(const GEMPadDigi& p) const { return p.pad(); } @@ -253,7 +253,7 @@ float CSCGEMMotherboard::getPad(const GEMCoPadDigi& p) const { float CSCGEMMotherboard::getPad(const CSCCLCTDigi& clct, enum CSCPart part) const { const auto& mymap = (getLUT()->get_csc_hs_to_gem_pad(theParity, part)); - int keyStrip = clct.getKeyStrip(); + int keyStrip = clct.keyStrip(); //ME1A part, convert halfstrip from 128-223 to 0-95 if (part == CSCPart::ME1A and keyStrip > CSCConstants::MAX_HALF_STRIP_ME1B) keyStrip = keyStrip - CSCConstants::MAX_HALF_STRIP_ME1B - 1; @@ -324,7 +324,7 @@ unsigned int CSCGEMMotherboard::findQualityGEM(const CSCALCTDigi& aLCT, const CS } // Both ALCT and CLCT are valid else { - const int pattern(cLCT.getPattern()); + const int pattern(cLCT.pattern()); // Layer-trigger in CLCT if (pattern == 1) @@ -337,14 +337,14 @@ unsigned int CSCGEMMotherboard::findQualityGEM(const CSCALCTDigi& aLCT, const CS // Case of ME11 with GEMs: require 4 layers for ALCT if (theStation == 1) - a4 = aLCT.getQuality() >= 1; + a4 = aLCT.quality() >= 1; // Case of ME21 with GEMs: require 4 layers for ALCT+GEM if (theStation == 2) - a4 = aLCT.getQuality() + gemlayers >= 1; + a4 = aLCT.quality() + gemlayers >= 1; // CLCT quality is the number of layers hit. - const bool c4((cLCT.getQuality() >= 4) or (cLCT.getQuality() >= 3 and gemlayers >= 1)); + const bool c4((cLCT.quality() >= 4) or (cLCT.quality() >= 3 and gemlayers >= 1)); // quality = 4; "reserved for low-quality muons in future" @@ -362,7 +362,7 @@ unsigned int CSCGEMMotherboard::findQualityGEM(const CSCALCTDigi& aLCT, const CS // HQ muon, but accelerator ALCT else if (a4 && c4) { - if (aLCT.getAccelerator()) + if (aLCT.accelerator()) return LCT_Quality::HQ_ACCEL_ALCT; else { diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboardME11.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboardME11.cc index fa79637b8161c..057d76183800c 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboardME11.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboardME11.cc @@ -174,7 +174,7 @@ void CSCGEMMotherboardME11::run(const CSCWireDigiCollection* wiredc, alctProc->getSecondALCT(bx_alct), mCoPads); - const bool lowQualityCLCT(clctProc->getBestCLCT(bx_clct).getQuality() <= 3); + const bool lowQualityCLCT(clctProc->getBestCLCT(bx_clct).quality() <= 3); const bool hasMatchingPads(!mPads.empty() or !mCoPads.empty()); // Low quality LCTs have at most 3 layers. Check if there is a matching GEM pad to keep the CLCT if (dropLowQualityCLCTsNoGEMs_ME1b_ and lowQualityCLCT and !hasMatchingPads) { @@ -218,9 +218,9 @@ void CSCGEMMotherboardME11::run(const CSCWireDigiCollection* wiredc, LogTrace("CSCGEMMotherboardME11") << "LCT #1 " << allLCTs(bx_alct, mbx, 0) << std::endl; LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 0).getALCT() << std::endl; LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 0).getCLCT() << std::endl; - if (allLCTs(bx_alct, mbx, 0).getType() == 2) + if (allLCTs(bx_alct, mbx, 0).type() == 2) LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 0).getGEM1() << std::endl; - if (allLCTs(bx_alct, mbx, 0).getType() == 3) + if (allLCTs(bx_alct, mbx, 0).type() == 3) LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 0).getGEM1() << " " << allLCTs(bx_alct, mbx, 0).getGEM2() << std::endl; } @@ -229,9 +229,9 @@ void CSCGEMMotherboardME11::run(const CSCWireDigiCollection* wiredc, LogTrace("CSCGEMMotherboardME11") << "LCT #2 " << allLCTs(bx_alct, mbx, 1) << std::endl; LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 1).getALCT() << std::endl; LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 1).getCLCT() << std::endl; - if (allLCTs(bx_alct, mbx, 1).getType() == 2) + if (allLCTs(bx_alct, mbx, 1).type() == 2) LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 1).getGEM1() << std::endl; - if (allLCTs(bx_alct, mbx, 1).getType() == 3) + if (allLCTs(bx_alct, mbx, 1).type() == 3) LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 1).getGEM1() << " " << allLCTs(bx_alct, mbx, 1).getGEM2() << std::endl; } @@ -283,7 +283,7 @@ void CSCGEMMotherboardME11::run(const CSCWireDigiCollection* wiredc, if (allLCTs(bx_alct, 0, 0).isValid()) { LogTrace("CSCGEMMotherboardME11") << "LCT #1 " << allLCTs(bx_alct, 0, 0) << std::endl; LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, 0, 0).getALCT() << std::endl; - if (allLCTs(bx_alct, 0, 0).getType() == 4) + if (allLCTs(bx_alct, 0, 0).type() == 4) LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, 0, 0).getGEM1() << " " << allLCTs(bx_alct, 0, 0).getGEM2() << std::endl << std::endl; @@ -294,7 +294,7 @@ void CSCGEMMotherboardME11::run(const CSCWireDigiCollection* wiredc, if (allLCTs(bx_alct, 0, 1).isValid()) { LogTrace("CSCGEMMotherboardME11") << "LCT #2 " << allLCTs(bx_alct, 0, 1) << std::endl; LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, 0, 1).getALCT() << std::endl; - if (allLCTs(bx_alct, 0, 1).getType() == 4) + if (allLCTs(bx_alct, 0, 1).type() == 4) LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, 0, 1).getGEM1() << " " << allLCTs(bx_alct, 0, 1).getGEM2() << std::endl << std::endl; @@ -347,7 +347,7 @@ void CSCGEMMotherboardME11::run(const CSCWireDigiCollection* wiredc, if (drop_used_clcts and used_clct_mask[bx_clct]) continue; if (clctProc->getBestCLCT(bx_clct).isValid()) { - const int quality(clctProc->getBestCLCT(bx_clct).getQuality()); + const int quality(clctProc->getBestCLCT(bx_clct).quality()); // only use high-Q stubs for the time being if (quality < 4) continue; @@ -370,14 +370,14 @@ void CSCGEMMotherboardME11::run(const CSCWireDigiCollection* wiredc, LogTrace("CSCGEMMotherboardME11") << "LCT #1 " << allLCTs(bx_alct, mbx, 0) << std::endl; LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 0).getALCT() << std::endl; - if (allLCTs(bx_alct, mbx, 0).getType() == 5) + if (allLCTs(bx_alct, mbx, 0).type() == 5) LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 0).getGEM1() << " " << allLCTs(bx_alct, mbx, 0).getGEM2() << std::endl << std::endl; LogTrace("CSCGEMMotherboardME11") << "LCT #2 " << allLCTs(bx_alct, mbx, 1) << std::endl; LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 1).getALCT() << std::endl; - if (allLCTs(bx_alct, mbx, 1).getType() == 5) + if (allLCTs(bx_alct, mbx, 1).type() == 5) LogTrace("CSCGEMMotherboardME11") << allLCTs(bx_alct, mbx, 1).getGEM1() << " " << allLCTs(bx_alct, mbx, 1).getGEM2() << std::endl << std::endl; @@ -455,7 +455,7 @@ std::vector CSCGEMMotherboardME11::readoutLCTsME11(enum CS if (!lct.isValid()) continue; - int bx = lct.getBX(); + int bx = lct.bx(); // Skip LCTs found too early relative to L1Accept. if (bx <= early_tbins) continue; @@ -464,8 +464,8 @@ std::vector CSCGEMMotherboardME11::readoutLCTsME11(enum CS if (bx > late_tbins) continue; - if ((me1ab == CSCPart::ME1B and lct.getStrip() > CSCConstants::MAX_HALF_STRIP_ME1B) or - (me1ab == CSCPart::ME1A and lct.getStrip() <= CSCConstants::MAX_HALF_STRIP_ME1B)) + if ((me1ab == CSCPart::ME1B and lct.strip() > CSCConstants::MAX_HALF_STRIP_ME1B) or + (me1ab == CSCPart::ME1A and lct.strip() <= CSCConstants::MAX_HALF_STRIP_ME1B)) continue; // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window: @@ -525,9 +525,9 @@ void CSCGEMMotherboardME11::correlateLCTsGEM(const CSCALCTDigi& bALCT, const GEMCoPadDigiIds& copads, CSCCorrelatedLCTDigi& lct1, CSCCorrelatedLCTDigi& lct2) const { - CSCALCTDigi bestALCT = bALCT; + const CSCALCTDigi& bestALCT = bALCT; CSCALCTDigi secondALCT = sALCT; - CSCCLCTDigi bestCLCT = bCLCT; + const CSCCLCTDigi& bestCLCT = bCLCT; CSCCLCTDigi secondCLCT = sCLCT; // assume that always anodeBestValid and cathodeBestValid diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboardME21.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboardME21.cc index 216869578a75e..1d4158bdd8997 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboardME21.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMotherboardME21.cc @@ -135,9 +135,9 @@ void CSCGEMMotherboardME21::run(const CSCWireDigiCollection* wiredc, } // clct quality - const bool lowQualityCLCT(clctProc->getBestCLCT(bx_clct).getQuality() <= 3); + const bool lowQualityCLCT(clctProc->getBestCLCT(bx_clct).quality() <= 3); // low quality ALCT - const bool lowQualityALCT(alctProc->getBestALCT(bx_alct).getQuality() == 0); + const bool lowQualityALCT(alctProc->getBestALCT(bx_alct).quality() == 0); // pick the pad that corresponds matches mPads; @@ -186,9 +186,9 @@ void CSCGEMMotherboardME21::run(const CSCWireDigiCollection* wiredc, LogTrace("CSCGEMMotherboardME21") << "LCT #1 " << allLCTs(bx_alct, mbx, 0) << std::endl << allLCTs(bx_alct, mbx, 0).getALCT() << std::endl << allLCTs(bx_alct, mbx, 0).getCLCT() << std::endl; - if (allLCTs(bx_alct, mbx, 0).getType() == 2) + if (allLCTs(bx_alct, mbx, 0).type() == 2) LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, mbx, 0).getGEM1() << std::endl; - if (allLCTs(bx_alct, mbx, 0).getType() == 3) + if (allLCTs(bx_alct, mbx, 0).type() == 3) LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, mbx, 0).getGEM1() << " " << allLCTs(bx_alct, mbx, 0).getGEM2() << std::endl; } @@ -197,9 +197,9 @@ void CSCGEMMotherboardME21::run(const CSCWireDigiCollection* wiredc, LogTrace("CSCGEMMotherboardME21") << "LCT #2 " << allLCTs(bx_alct, mbx, 1) << std::endl << allLCTs(bx_alct, mbx, 1).getALCT() << std::endl << allLCTs(bx_alct, mbx, 1).getCLCT() << std::endl; - if (allLCTs(bx_alct, mbx, 1).getType() == 2) + if (allLCTs(bx_alct, mbx, 1).type() == 2) LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, mbx, 1).getGEM1() << std::endl; - if (allLCTs(bx_alct, mbx, 1).getType() == 3) + if (allLCTs(bx_alct, mbx, 1).type() == 3) LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, mbx, 1).getGEM1() << " " << allLCTs(bx_alct, mbx, 1).getGEM2() << std::endl; } @@ -250,7 +250,7 @@ void CSCGEMMotherboardME21::run(const CSCWireDigiCollection* wiredc, if (allLCTs(bx_alct, 0, 0).isValid()) { LogTrace("CSCGEMMotherboardME21") << "LCT #1 " << allLCTs(bx_alct, 0, 0) << std::endl << allLCTs(bx_alct, 0, 0).getALCT() << std::endl; - if (allLCTs(bx_alct, 0, 0).getType() == 4) + if (allLCTs(bx_alct, 0, 0).type() == 4) LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, 0, 0).getGEM1() << " " << allLCTs(bx_alct, 0, 0).getGEM2() << std::endl << std::endl; @@ -258,7 +258,7 @@ void CSCGEMMotherboardME21::run(const CSCWireDigiCollection* wiredc, if (allLCTs(bx_alct, 0, 1).isValid()) { LogTrace("CSCGEMMotherboardME21") << "LCT #2 " << allLCTs(bx_alct, 0, 1) << std::endl << allLCTs(bx_alct, 0, 1).getALCT() << std::endl; - if (allLCTs(bx_alct, 0, 1).getType() == 4) + if (allLCTs(bx_alct, 0, 1).type() == 4) LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, 0, 1).getGEM1() << " " << allLCTs(bx_alct, 0, 1).getGEM2() << std::endl << std::endl; @@ -319,7 +319,7 @@ void CSCGEMMotherboardME21::run(const CSCWireDigiCollection* wiredc, if (drop_used_clcts and used_clct_mask[bx_clct]) continue; if (clctProc->getBestCLCT(bx_clct).isValid()) { - const int quality(clctProc->getBestCLCT(bx_clct).getQuality()); + const int quality(clctProc->getBestCLCT(bx_clct).quality()); // only use high-Q stubs for the time being if (quality < 4) continue; @@ -342,13 +342,13 @@ void CSCGEMMotherboardME21::run(const CSCWireDigiCollection* wiredc, LogTrace("CSCGEMMotherboardME21") << "LCT #1 " << allLCTs(bx_alct, mbx, 0) << std::endl << allLCTs(bx_alct, mbx, 0).getALCT() << std::endl; - if (allLCTs(bx_alct, mbx, 0).getType() == 5) + if (allLCTs(bx_alct, mbx, 0).type() == 5) LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, mbx, 0).getGEM1() << " " << allLCTs(bx_alct, mbx, 0).getGEM2() << std::endl; LogTrace("CSCGEMMotherboardME21") << "LCT #2 " << allLCTs(bx_alct, mbx, 1) << std::endl << allLCTs(bx_alct, mbx, 1).getALCT() << std::endl; - if (allLCTs(bx_alct, mbx, 1).getType() == 5) + if (allLCTs(bx_alct, mbx, 1).type() == 5) LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, mbx, 1).getGEM1() << " " << allLCTs(bx_alct, mbx, 1).getGEM2() << std::endl; } @@ -447,9 +447,9 @@ void CSCGEMMotherboardME21::correlateLCTsGEM(const CSCALCTDigi& bALCT, const GEMCoPadDigiIds& copads, CSCCorrelatedLCTDigi& lct1, CSCCorrelatedLCTDigi& lct2) const { - CSCALCTDigi bestALCT = bALCT; + const CSCALCTDigi& bestALCT = bALCT; CSCALCTDigi secondALCT = sALCT; - CSCCLCTDigi bestCLCT = bCLCT; + const CSCCLCTDigi& bestCLCT = bCLCT; CSCCLCTDigi secondCLCT = sCLCT; // assume that always anodeBestValid and cathodeBestValid diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc index 0cf847a627286..24804154441ec 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc @@ -366,12 +366,12 @@ std::vector CSCMotherboard::readoutLCTs() const { if (!plct->isValid()) continue; - int bx = (*plct).getBX(); + int bx = (*plct).bx(); // Skip LCTs found too early relative to L1Accept. if (bx <= early_tbins) { if (infoV > 1) - LogDebug("CSCMotherboard") << " Do not report correlated LCT on key halfstrip " << plct->getStrip() - << " and key wire " << plct->getKeyWG() << ": found at bx " << bx + LogDebug("CSCMotherboard") << " Do not report correlated LCT on key halfstrip " << plct->strip() + << " and key wire " << plct->keyWireGroup() << ": found at bx " << bx << ", whereas the earliest allowed bx is " << early_tbins + 1; continue; } @@ -379,8 +379,8 @@ std::vector CSCMotherboard::readoutLCTs() const { // Skip LCTs found too late relative to L1Accept. if (bx > late_tbins) { if (infoV > 1) - LogDebug("CSCMotherboard") << " Do not report correlated LCT on key halfstrip " << plct->getStrip() - << " and key wire " << plct->getKeyWG() << ": found at bx " << bx + LogDebug("CSCMotherboard") << " Do not report correlated LCT on key halfstrip " << plct->strip() + << " and key wire " << plct->keyWireGroup() << ": found at bx " << bx << ", whereas the latest allowed bx is " << late_tbins; continue; } @@ -409,10 +409,10 @@ std::vector CSCMotherboard::getLCTs() const { // Do not report LCTs found in ME1/A if mpc_block_me1/a is set. for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) { if (firstLCT[bx].isValid()) - if (!mpc_block_me1a || (!isME11_ || firstLCT[bx].getStrip() <= 127)) + if (!mpc_block_me1a || (!isME11_ || firstLCT[bx].strip() <= 127)) tmpV.push_back(firstLCT[bx]); if (secondLCT[bx].isValid()) - if (!mpc_block_me1a || (!isME11_ || secondLCT[bx].getStrip() <= 127)) + if (!mpc_block_me1a || (!isME11_ || secondLCT[bx].strip() <= 127)) tmpV.push_back(secondLCT[bx]); } return tmpV; @@ -444,7 +444,7 @@ void CSCMotherboard::correlateLCTs( if ((alct_trig_enable && bestALCT.isValid()) || (clct_trig_enable && bestCLCT.isValid()) || (match_trig_enable && bestALCT.isValid() && bestCLCT.isValid())) { const CSCCorrelatedLCTDigi& lct = constructLCTs(bestALCT, bestCLCT, type, 1); - int bx = lct.getBX(); + int bx = lct.bx(); if (bx >= 0 && bx < CSCConstants::MAX_LCT_TBINS) { firstLCT[bx] = lct; } else { @@ -459,7 +459,7 @@ void CSCMotherboard::correlateLCTs( ((alct_trig_enable && secondALCT.isValid()) || (clct_trig_enable && secondCLCT.isValid()) || (match_trig_enable && secondALCT.isValid() && secondCLCT.isValid()))) { const CSCCorrelatedLCTDigi& lct = constructLCTs(secondALCT, secondCLCT, type, 2); - int bx = lct.getBX(); + int bx = lct.bx(); if (bx >= 0 && bx < CSCConstants::MAX_LCT_TBINS) { secondLCT[bx] = lct; } else { @@ -478,31 +478,21 @@ CSCCorrelatedLCTDigi CSCMotherboard::constructLCTs(const CSCALCTDigi& aLCT, int type, int trknmb) const { // CLCT pattern number - unsigned int pattern = encodePattern(cLCT.getPattern()); + unsigned int pattern = encodePattern(cLCT.pattern()); // LCT quality number unsigned int quality = findQuality(aLCT, cLCT); // Bunch crossing: get it from cathode LCT if anode LCT is not there. - int bx = aLCT.isValid() ? aLCT.getBX() : cLCT.getBX(); + int bx = aLCT.isValid() ? aLCT.bx() : cLCT.bx(); // in Run-3 we plan to use the synchronization error bit // to denote the presence of exotic signatures in the chamber unsigned int syncErr = useHighMultiplicityBits_ ? highMultiplicityBits_ : 0; // construct correlated LCT - CSCCorrelatedLCTDigi thisLCT(trknmb, - 1, - quality, - aLCT.getKeyWG(), - cLCT.getKeyStrip(), - pattern, - cLCT.getBend(), - bx, - 0, - 0, - syncErr, - theTrigChamber); + CSCCorrelatedLCTDigi thisLCT( + trknmb, 1, quality, aLCT.keyWireGroup(), cLCT.keyStrip(), pattern, cLCT.bend(), bx, 0, 0, syncErr, theTrigChamber); thisLCT.setType(type); // make sure to shift the ALCT BX from 8 to 3 and the CLCT BX from 8 to 7! thisLCT.setALCT(getBXShiftedALCT(aLCT)); @@ -533,14 +523,14 @@ unsigned int CSCMotherboard::findQuality(const CSCALCTDigi& aLCT, const CSCCLCTD else quality = 0; // both absent; should never happen. } else { - int pattern = cLCT.getPattern(); + int pattern = cLCT.pattern(); if (pattern == 1) quality = 3; // layer-trigger in CLCT else { // CLCT quality is the number of layers hit minus 3. // CLCT quality is the number of layers hit. - bool a4 = (aLCT.getQuality() >= 1); - bool c4 = (cLCT.getQuality() >= 4); + bool a4 = (aLCT.quality() >= 1); + bool c4 = (cLCT.quality() >= 4); // quality = 4; "reserved for low-quality muons in future" if (!a4 && !c4) quality = 5; // marginal anode and cathode @@ -549,7 +539,7 @@ unsigned int CSCMotherboard::findQuality(const CSCALCTDigi& aLCT, const CSCCLCTD else if (!a4 && c4) quality = 7; // HQ cathode, but marginal anode else if (a4 && c4) { - if (aLCT.getAccelerator()) + if (aLCT.accelerator()) quality = 8; // HQ muon, but accel ALCT else { // quality = 9; "reserved for HQ muons with future patterns @@ -617,13 +607,13 @@ void CSCMotherboard::dumpConfigParams() const { CSCALCTDigi CSCMotherboard::getBXShiftedALCT(const CSCALCTDigi& aLCT) const { CSCALCTDigi aLCT_shifted = aLCT; - aLCT_shifted.setBX(aLCT_shifted.getBX() - (CSCConstants::LCT_CENTRAL_BX - tmb_l1a_window_size / 2)); + aLCT_shifted.setBX(aLCT_shifted.bx() - (CSCConstants::LCT_CENTRAL_BX - tmb_l1a_window_size / 2)); return aLCT_shifted; } CSCCLCTDigi CSCMotherboard::getBXShiftedCLCT(const CSCCLCTDigi& cLCT) const { CSCCLCTDigi cLCT_shifted = cLCT; - cLCT_shifted.setBX(cLCT_shifted.getBX() - alctClctOffset_); + cLCT_shifted.setBX(cLCT_shifted.bx() - alctClctOffset_); return cLCT_shifted; } diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboardME11.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboardME11.cc index 657de7f9ba544..0ba6ed8a9fead 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboardME11.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboardME11.cc @@ -254,7 +254,7 @@ std::vector CSCMotherboardME11::readoutLCTs(int me1ab) con if (!plct->isValid()) continue; - int bx = (*plct).getBX(); + int bx = (*plct).bx(); // Skip LCTs found too early relative to L1Accept. if (bx <= early_tbins) continue; @@ -284,7 +284,7 @@ std::vector CSCMotherboardME11::getLCTs1b() const { for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) { for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) { const CSCCorrelatedLCTDigi& lct = allLCTs.data[bx][mbx][i]; - if (lct.isValid() and lct.getStrip() < CSCConstants::MAX_HALF_STRIP_ME1B) { + if (lct.isValid() and lct.strip() < CSCConstants::MAX_HALF_STRIP_ME1B) { tmpV.push_back(lct); } } @@ -305,7 +305,7 @@ std::vector CSCMotherboardME11::getLCTs1a() const { for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) { for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) { const CSCCorrelatedLCTDigi& lct = allLCTs.data[bx][mbx][i]; - if (lct.isValid() and lct.getStrip() >= CSCConstants::MAX_HALF_STRIP_ME1B) { + if (lct.isValid() and lct.strip() >= CSCConstants::MAX_HALF_STRIP_ME1B) { tmpV.push_back(lct); } } diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCMuonPortCard.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCMuonPortCard.cc index 7e84d97f8f9e0..e67d327412a1b 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCMuonPortCard.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCMuonPortCard.cc @@ -38,7 +38,7 @@ std::vector CSCMuonPortCard::sort( // Make sure no Quality 0 or non-valid LCTs come through the portcard. for (LCT = result.begin(); LCT != result.end(); LCT++) { - if ((drop_invalid_stubs_ && !LCT->isValid()) || (drop_low_quality_stubs_ && LCT->getQuality() == 0)) + if ((drop_invalid_stubs_ && !LCT->isValid()) || (drop_low_quality_stubs_ && LCT->quality() == 0)) result.erase(LCT, LCT); } diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeAnodeLCTProcessor.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeAnodeLCTProcessor.cc index 699b7aac27cc2..6cc938ff8c93d 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeAnodeLCTProcessor.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeAnodeLCTProcessor.cc @@ -132,12 +132,12 @@ void CSCUpgradeAnodeLCTProcessor::ghostCancellationLogicOneWire(const int key_wi // Previous wire. int dt = -1; for (auto& p : lct_list) { - if (not(p.isValid() and p.getKeyWG() == key_wire - 1 and 1 - p.getAccelerator() == i_pattern)) + if (not(p.isValid() and p.keyWireGroup() == key_wire - 1 and 1 - p.accelerator() == i_pattern)) continue; bool ghost_cleared_prev = false; - int qual_prev = p.getQuality(); - int first_bx_prev = p.getBX(); + int qual_prev = p.quality(); + int first_bx_prev = p.bx(); if (infoV > 1) LogTrace("CSCAnodeLCTProcessor") << "ghost concellation logic " << ((i_pattern == 0) ? "Accelerator" : "Collision") << " key_wire " diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeMotherboard.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeMotherboard.cc index a02c2af86e59e..72566d8a4519d 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeMotherboard.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeMotherboard.cc @@ -277,7 +277,7 @@ void CSCUpgradeMotherboard::debugLUTs() { } bool CSCUpgradeMotherboard::sortLCTsByQuality(const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) { - return lct1.getQuality() > lct2.getQuality(); + return lct1.quality() > lct2.quality(); } bool CSCUpgradeMotherboard::sortLCTsByGEMDphi(const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) { diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeMotherboardLUT.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeMotherboardLUT.cc index 4dfecf7c0b57c..0a07dfa47d8e9 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeMotherboardLUT.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeMotherboardLUT.cc @@ -32,8 +32,8 @@ bool CSCMotherboardLUTME11::doesALCTCrossCLCT(const CSCALCTDigi &a, bool gangedME1a) const { if (!c.isValid() || !a.isValid()) return false; - int key_hs = c.getKeyStrip(); - int key_wg = a.getKeyWG(); + int key_hs = c.keyStrip(); + int key_wg = a.keyWireGroup(); return doesWiregroupCrossStrip(key_wg, key_hs, theEndcap, gangedME1a); } diff --git a/L1Trigger/DTTrackFinder/src/L1MuDTSectorReceiver.cc b/L1Trigger/DTTrackFinder/src/L1MuDTSectorReceiver.cc index b1f3ddba7baac..d81e378c676f1 100644 --- a/L1Trigger/DTTrackFinder/src/L1MuDTSectorReceiver.cc +++ b/L1Trigger/DTTrackFinder/src/L1MuDTSectorReceiver.cc @@ -241,7 +241,7 @@ void L1MuDTSectorReceiver::receiveCSCData(int bx, const edm::Event& e, const edm int ncsc = 0; for (csc_iter = csc_list.begin(); csc_iter != csc_list.end(); csc_iter++) { bool etaFlag = (csc_iter->etaPacked() > 17); - int qualCSC = csc_iter->getQuality(); + int qualCSC = csc_iter->quality(); // convert CSC quality code to DTBX quality code unsigned int qual = 7; diff --git a/L1Trigger/HardwareValidation/interface/DEutils.h b/L1Trigger/HardwareValidation/interface/DEutils.h index cd81dd18d6ce3..8d32d23e0b8e4 100644 --- a/L1Trigger/HardwareValidation/interface/DEutils.h +++ b/L1Trigger/HardwareValidation/interface/DEutils.h @@ -455,13 +455,13 @@ template <> inline L1DataEmulDigi DEutils::DEDigi(col_cit itd, col_cit itm, int aflag) { int cid = de_type(); int errt = aflag; - double x1 = (aflag != 4) ? itd->getStrip() : itm->getStrip(); - double x2 = (aflag != 4) ? itd->getKeyWG() : itm->getKeyWG(); - double x3 = (aflag != 4) ? itd->getTrknmb() : itm->getTrknmb(); + double x1 = (aflag != 4) ? itd->strip() : itm->strip(); + double x2 = (aflag != 4) ? itd->keyWireGroup() : itm->keyWireGroup(); + double x3 = (aflag != 4) ? itd->trackNumber() : itm->trackNumber(); //multiple subsystem ctp,ctf L1DataEmulDigi digi(-1, cid, x1, x2, x3, errt); - int dq = (aflag == 4) ? 0 : itd->getQuality(); - int eq = (aflag == 3) ? 0 : itm->getQuality(); + int dq = (aflag == 4) ? 0 : itd->quality(); + int eq = (aflag == 3) ? 0 : itm->quality(); digi.setRank((float)dq, (float)eq); // Pack LCT digi members into 32-bit data words. static const int kValidBitWidth = 1; // Reverse the order of the 1st @@ -477,24 +477,24 @@ inline L1DataEmulDigi DEutils::DEDigi(col_cit i // While packing, check that the right number of bits is retained. unsigned shift = 0, dw = 0, ew = 0; dw = itd->isValid() & ((1 << kValidBitWidth) - 1); - dw += (itd->getQuality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); - dw += (itd->getPattern() & ((1 << kPatternBitWidth) - 1)) << (shift += kQualityBitWidth); - dw += (itd->getKeyWG() & ((1 << kWireGroupBitWidth) - 1)) << (shift += kPatternBitWidth); - dw += (itd->getStrip() & ((1 << kHalfstripBitWidth) - 1)) << (shift += kWireGroupBitWidth); - dw += (itd->getBend() & ((1 << kBendBitWidth) - 1)) << (shift += kHalfstripBitWidth); - dw += (itd->getBX() & ((1 << kBxBitWidth) - 1)) << (shift += kBendBitWidth); - dw += (itd->getMPCLink() & ((1 << kMPCLinkBitWidth) - 1)) << (shift += kBxBitWidth); - dw += (itd->getCSCID() & ((1 << kCSCIdBitWidth) - 1)) << (shift += kMPCLinkBitWidth); + dw += (itd->quality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); + dw += (itd->pattern() & ((1 << kPatternBitWidth) - 1)) << (shift += kQualityBitWidth); + dw += (itd->keyWireGroup() & ((1 << kWireGroupBitWidth) - 1)) << (shift += kPatternBitWidth); + dw += (itd->strip() & ((1 << kHalfstripBitWidth) - 1)) << (shift += kWireGroupBitWidth); + dw += (itd->bend() & ((1 << kBendBitWidth) - 1)) << (shift += kHalfstripBitWidth); + dw += (itd->bx() & ((1 << kBxBitWidth) - 1)) << (shift += kBendBitWidth); + dw += (itd->mpcLink() & ((1 << kMPCLinkBitWidth) - 1)) << (shift += kBxBitWidth); + dw += (itd->cscID() & ((1 << kCSCIdBitWidth) - 1)) << (shift += kMPCLinkBitWidth); shift = 0; ew = itm->isValid() & ((1 << kValidBitWidth) - 1); - ew += (itm->getQuality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); - ew += (itm->getPattern() & ((1 << kPatternBitWidth) - 1)) << (shift += kQualityBitWidth); - ew += (itm->getKeyWG() & ((1 << kWireGroupBitWidth) - 1)) << (shift += kPatternBitWidth); - ew += (itm->getStrip() & ((1 << kHalfstripBitWidth) - 1)) << (shift += kWireGroupBitWidth); - ew += (itm->getBend() & ((1 << kBendBitWidth) - 1)) << (shift += kHalfstripBitWidth); - ew += (itm->getBX() & ((1 << kBxBitWidth) - 1)) << (shift += kBendBitWidth); - ew += (itm->getMPCLink() & ((1 << kMPCLinkBitWidth) - 1)) << (shift += kBxBitWidth); - ew += (itm->getCSCID() & ((1 << kCSCIdBitWidth) - 1)) << (shift += kMPCLinkBitWidth); + ew += (itm->quality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); + ew += (itm->pattern() & ((1 << kPatternBitWidth) - 1)) << (shift += kQualityBitWidth); + ew += (itm->keyWireGroup() & ((1 << kWireGroupBitWidth) - 1)) << (shift += kPatternBitWidth); + ew += (itm->strip() & ((1 << kHalfstripBitWidth) - 1)) << (shift += kWireGroupBitWidth); + ew += (itm->bend() & ((1 << kBendBitWidth) - 1)) << (shift += kHalfstripBitWidth); + ew += (itm->bx() & ((1 << kBxBitWidth) - 1)) << (shift += kBendBitWidth); + ew += (itm->mpcLink() & ((1 << kMPCLinkBitWidth) - 1)) << (shift += kBxBitWidth); + ew += (itm->cscID() & ((1 << kCSCIdBitWidth) - 1)) << (shift += kMPCLinkBitWidth); digi.setData(dw, ew); return digi; } @@ -503,11 +503,11 @@ template <> inline L1DataEmulDigi DEutils::DEDigi(col_cit itd, col_cit itm, int aflag) { int cid = de_type(); int errt = aflag; - double x2 = (aflag != 4) ? itd->getKeyWG() : itm->getKeyWG(); - double x3 = (aflag != 4) ? itd->getTrknmb() : itm->getTrknmb(); + double x2 = (aflag != 4) ? itd->keyWireGroup() : itm->keyWireGroup(); + double x3 = (aflag != 4) ? itd->trackNumber() : itm->trackNumber(); L1DataEmulDigi digi(dedefs::CTP, cid, 0, x2, x3, errt); - int dq = (aflag == 4) ? 0 : itd->getQuality(); - int eq = (aflag == 3) ? 0 : itm->getQuality(); + int dq = (aflag == 4) ? 0 : itd->quality(); + int eq = (aflag == 3) ? 0 : itm->quality(); digi.setRank((float)dq, (float)eq); // Pack anode digi members into 17-bit data words. static const int kValidBitWidth = 1; @@ -519,18 +519,18 @@ inline L1DataEmulDigi DEutils::DEDigi(col_cit itd, col_c // While packing, check that the right number of bits is retained. unsigned shift = 0, dw = 0, ew = 0; dw = itd->isValid() & ((1 << kValidBitWidth) - 1); - dw += (itd->getQuality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); - dw += (itd->getAccelerator() & ((1 << kAccelBitWidth) - 1)) << (shift += kQualityBitWidth); - dw += (itd->getCollisionB() & ((1 << kPatternBBitWidth) - 1)) << (shift += kAccelBitWidth); - dw += (itd->getKeyWG() & ((1 << kWireGroupBitWidth) - 1)) << (shift += kPatternBBitWidth); - dw += (itd->getBX() & ((1 << kBxBitWidth) - 1)) << (shift += kWireGroupBitWidth); + dw += (itd->quality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); + dw += (itd->accelerator() & ((1 << kAccelBitWidth) - 1)) << (shift += kQualityBitWidth); + dw += (itd->collisionB() & ((1 << kPatternBBitWidth) - 1)) << (shift += kAccelBitWidth); + dw += (itd->keyWireGroup() & ((1 << kWireGroupBitWidth) - 1)) << (shift += kPatternBBitWidth); + dw += (itd->bx() & ((1 << kBxBitWidth) - 1)) << (shift += kWireGroupBitWidth); shift = 0; ew = itm->isValid() & ((1 << kValidBitWidth) - 1); - ew += (itm->getQuality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); - ew += (itm->getAccelerator() & ((1 << kAccelBitWidth) - 1)) << (shift += kQualityBitWidth); - ew += (itm->getCollisionB() & ((1 << kPatternBBitWidth) - 1)) << (shift += kAccelBitWidth); - ew += (itm->getKeyWG() & ((1 << kWireGroupBitWidth) - 1)) << (shift += kPatternBBitWidth); - ew += (itm->getBX() & ((1 << kBxBitWidth) - 1)) << (shift += kWireGroupBitWidth); + ew += (itm->quality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); + ew += (itm->accelerator() & ((1 << kAccelBitWidth) - 1)) << (shift += kQualityBitWidth); + ew += (itm->collisionB() & ((1 << kPatternBBitWidth) - 1)) << (shift += kAccelBitWidth); + ew += (itm->keyWireGroup() & ((1 << kWireGroupBitWidth) - 1)) << (shift += kPatternBBitWidth); + ew += (itm->bx() & ((1 << kBxBitWidth) - 1)) << (shift += kWireGroupBitWidth); digi.setData(dw, ew); return digi; } @@ -538,11 +538,11 @@ template <> inline L1DataEmulDigi DEutils::DEDigi(col_cit itd, col_cit itm, int aflag) { int cid = de_type(); int errt = aflag; - double x1 = (aflag != 4) ? itd->getKeyStrip() : itm->getKeyStrip(); - double x3 = (aflag != 4) ? itd->getTrknmb() : itm->getTrknmb(); + double x1 = (aflag != 4) ? itd->keyStrip() : itm->keyStrip(); + double x3 = (aflag != 4) ? itd->trackNumber() : itm->trackNumber(); L1DataEmulDigi digi(dedefs::CTP, cid, x1, 0, x3, errt); - int dq = (aflag == 4) ? 0 : itd->getQuality(); - int eq = (aflag == 3) ? 0 : itm->getQuality(); + int dq = (aflag == 4) ? 0 : itd->quality(); + int eq = (aflag == 3) ? 0 : itm->quality(); digi.setRank((float)dq, (float)eq); // Pack cathode digi members into 19-bit data words. static const int kValidBitWidth = 1; @@ -555,20 +555,20 @@ inline L1DataEmulDigi DEutils::DEDigi(col_cit itd, col_c // While packing, check that the right number of bits is retained. unsigned shift = 0, dw = 0, ew = 0; dw = itd->isValid() & ((1 << kValidBitWidth) - 1); - dw += (itd->getQuality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); - dw += (itd->getPattern() & ((1 << kPatternBitWidth) - 1)) << (shift += kQualityBitWidth); - dw += (itd->getBend() & ((1 << kBendBitWidth) - 1)) << (shift += kPatternBitWidth); - dw += (itd->getStrip() & ((1 << kHalfstripBitWidth) - 1)) << (shift += kBendBitWidth); - dw += (itd->getCFEB() & ((1 << kCFEBBitWidth) - 1)) << (shift += kHalfstripBitWidth); - dw += (itd->getBX() & ((1 << kBxBitWidth) - 1)) << (shift += kCFEBBitWidth); + dw += (itd->quality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); + dw += (itd->pattern() & ((1 << kPatternBitWidth) - 1)) << (shift += kQualityBitWidth); + dw += (itd->bend() & ((1 << kBendBitWidth) - 1)) << (shift += kPatternBitWidth); + dw += (itd->strip() & ((1 << kHalfstripBitWidth) - 1)) << (shift += kBendBitWidth); + dw += (itd->cfeb() & ((1 << kCFEBBitWidth) - 1)) << (shift += kHalfstripBitWidth); + dw += (itd->bx() & ((1 << kBxBitWidth) - 1)) << (shift += kCFEBBitWidth); shift = 0; ew = itm->isValid() & ((1 << kValidBitWidth) - 1); - ew += (itm->getQuality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); - ew += (itm->getPattern() & ((1 << kPatternBitWidth) - 1)) << (shift += kQualityBitWidth); - ew += (itm->getBend() & ((1 << kBendBitWidth) - 1)) << (shift += kPatternBitWidth); - ew += (itm->getStrip() & ((1 << kHalfstripBitWidth) - 1)) << (shift += kBendBitWidth); - ew += (itm->getCFEB() & ((1 << kCFEBBitWidth) - 1)) << (shift += kHalfstripBitWidth); - ew += (itm->getBX() & ((1 << kBxBitWidth) - 1)) << (shift += kCFEBBitWidth); + ew += (itm->quality() & ((1 << kQualityBitWidth) - 1)) << (shift += kValidBitWidth); + ew += (itm->pattern() & ((1 << kPatternBitWidth) - 1)) << (shift += kQualityBitWidth); + ew += (itm->bend() & ((1 << kBendBitWidth) - 1)) << (shift += kPatternBitWidth); + ew += (itm->strip() & ((1 << kHalfstripBitWidth) - 1)) << (shift += kBendBitWidth); + ew += (itm->cfeb() & ((1 << kCFEBBitWidth) - 1)) << (shift += kHalfstripBitWidth); + ew += (itm->bx() & ((1 << kBxBitWidth) - 1)) << (shift += kCFEBBitWidth); digi.setData(dw, ew); return digi; } @@ -784,14 +784,14 @@ inline bool DEutils::de_equal(const cand_type& // unpacked by the CSC TF unpacker). bool val = true; val &= (lhs.isValid() == rhs.isValid()); - val &= (lhs.getQuality() == rhs.getQuality()); - val &= (lhs.getKeyWG() == rhs.getKeyWG()); - val &= (lhs.getStrip() == rhs.getStrip()); - val &= (lhs.getPattern() == rhs.getPattern()); - val &= (lhs.getBend() == rhs.getBend()); - val &= (lhs.getBX() == rhs.getBX()); - val &= (lhs.getMPCLink() == rhs.getMPCLink()); - val &= (lhs.getCSCID() == rhs.getCSCID()); + val &= (lhs.quality() == rhs.quality()); + val &= (lhs.keyWireGroup() == rhs.keyWireGroup()); + val &= (lhs.strip() == rhs.strip()); + val &= (lhs.pattern() == rhs.pattern()); + val &= (lhs.bend() == rhs.bend()); + val &= (lhs.bx() == rhs.bx()); + val &= (lhs.mpcLink() == rhs.mpcLink()); + val &= (lhs.cscID() == rhs.cscID()); return val; //return lhs==rhs; } @@ -958,24 +958,24 @@ inline bool DEutils::de_equal_loc(const cand_type& template <> inline bool DEutils::de_equal_loc(const cand_type& lhs, const cand_type& rhs) { bool val = true; - val &= (lhs.getCSCID() == rhs.getCSCID()); - val &= (lhs.getStrip() == rhs.getStrip()); - val &= (lhs.getKeyWG() == rhs.getKeyWG()); + val &= (lhs.cscID() == rhs.cscID()); + val &= (lhs.strip() == rhs.strip()); + val &= (lhs.keyWireGroup() == rhs.keyWireGroup()); return val; } template <> inline bool DEutils::de_equal_loc(const cand_type& lhs, const cand_type& rhs) { bool val = true; - val &= (lhs.getTrknmb() == rhs.getTrknmb()); - val &= (lhs.getKeyWG() == rhs.getKeyWG()); + val &= (lhs.trackNumber() == rhs.trackNumber()); + val &= (lhs.keyWireGroup() == rhs.keyWireGroup()); return val; } template <> inline bool DEutils::de_equal_loc(const cand_type& lhs, const cand_type& rhs) { bool val = true; - val &= (lhs.getTrknmb() == rhs.getTrknmb()); - val &= (lhs.getKeyStrip() == rhs.getKeyStrip()); + val &= (lhs.trackNumber() == rhs.trackNumber()); + val &= (lhs.keyStrip() == rhs.keyStrip()); return val; } template <> @@ -1329,16 +1329,16 @@ template <> inline std::string DEutils::print(col_cit it) const { std::stringstream ss; ss - //<< " lct#:" << it->getTrknmb() + //<< " lct#:" << it->trackNumber() //<< " val:" << it->isValid() - //<< " qua:" << it->getQuality() - //<< " strip:" << it->getStrip() - //<< " bend:" << ((it->getBend() == 0) ? 'L' : 'R') - //<< " patt:" << it->getPattern() - //<<" key wire:" << it->getKeyWG() - //<< " bx:" << it->getBX() - //<< " mpc-link:" << it->getMPCLink() - //<< " csc id:" << it->getCSCID() + //<< " qua:" << it->quality() + //<< " strip:" << it->strip() + //<< " bend:" << ((it->bend() == 0) ? 'L' : 'R') + //<< " patt:" << it->pattern() + //<<" key wire:" << it->keyWireGroup() + //<< " bx:" << it->bx() + //<< " mpc-link:" << it->mpcLink() + //<< " csc id:" << it->cscID() //<< std::endl; << *it; return ss.str(); @@ -1642,13 +1642,13 @@ inline bool de_rank::operator()(const cand_type& x, const template <> inline bool de_rank::operator()(const cand_type& x, const cand_type& y) const { - if (x.getTrknmb() != y.getTrknmb()) { - return x.getTrknmb() < y.getTrknmb(); + if (x.trackNumber() != y.trackNumber()) { + return x.trackNumber() < y.trackNumber(); } else { - if (x.getKeyWG() != y.getKeyWG()) { - return y.getKeyWG() < x.getKeyWG(); + if (x.keyWireGroup() != y.keyWireGroup()) { + return y.keyWireGroup() < x.keyWireGroup(); } else { - return x.getQuality() < y.getQuality(); + return x.quality() < y.quality(); } } } diff --git a/L1Trigger/HardwareValidation/plugins/L1EmulBias.h b/L1Trigger/HardwareValidation/plugins/L1EmulBias.h index 7cf978989a583..73a8ec6d73638 100644 --- a/L1Trigger/HardwareValidation/plugins/L1EmulBias.h +++ b/L1Trigger/HardwareValidation/plugins/L1EmulBias.h @@ -409,13 +409,13 @@ inline void L1EmulBias::ModifyCollection(std::unique_ptrinsertDigi(did, dg); } @@ -452,7 +452,7 @@ inline void L1EmulBias::ModifyCollection(std::unique_ptr& //for (vecIt vit = ctpRange.first; vit != ctpRange.second; vit++) { for (vecIt vit = ldc.get((*mit).first).first; vit != ldc.get((*mit).first).second; vit++) { CSCCorrelatedLCTDigi dg = *vit; - uint16_t tn = dg.getTrknmb(); + uint16_t tn = dg.trackNumber(); if (tn == 2) tn--; dg.setTrknmb(tn); diff --git a/L1Trigger/L1TMuonEndCap/src/PrimitiveSelection.cc b/L1Trigger/L1TMuonEndCap/src/PrimitiveSelection.cc index 896ca4d778cd2..8c50c7c2be750 100644 --- a/L1Trigger/L1TMuonEndCap/src/PrimitiveSelection.cc +++ b/L1Trigger/L1TMuonEndCap/src/PrimitiveSelection.cc @@ -93,12 +93,12 @@ void PrimitiveSelection::process(CSCTag tag, edm::LogWarning("L1T") << "Found 3 CSC trigger primitives in the same chamber"; for (int ii = 0; ii < 3; ii++) { TriggerPrimitive tp_err = (ii < 2 ? selected_csc_map[selected_csc].at(ii) : new_tp); - edm::LogWarning("L1T") << "LCT #" << ii + 1 << ": BX " << tp_err.getBX() << ", endcap " + edm::LogWarning("L1T") << "LCT #" << ii + 1 << ": BX " << tp_err.bx() << ", endcap " << tp_err.detId().endcap() << ", sector " << tp_err.detId().triggerSector() << ", station " << tp_err.detId().station() << ", ring " << tp_err.detId().ring() << ", chamber " << tp_err.detId().chamber() << ", CSC ID " - << tp_err.getCSCData().cscID << ": strip " << tp_err.getStrip() << ", wire " + << tp_err.getCSCData().cscID << ": strip " << tp_err.strip() << ", wire " << tp_err.getWire(); } edm::LogWarning("L1T") << "************************* ONLY KEEP FIRST TWO *************************\n\n"; @@ -134,7 +134,7 @@ void PrimitiveSelection::process(CSCTag tag, } if (tmp_primitives.size() == 2) { - if ((tmp_primitives.at(0).getStrip() != tmp_primitives.at(1).getStrip()) && + if ((tmp_primitives.at(0).strip() != tmp_primitives.at(1).strip()) && (tmp_primitives.at(0).getWire() != tmp_primitives.at(1).getWire())) { // Swap wire numbers TriggerPrimitive tp0 = tmp_primitives.at(0); // (s1,w1) diff --git a/L1Trigger/L1TMuonOverlap/src/AngleConverter.cc b/L1Trigger/L1TMuonOverlap/src/AngleConverter.cc index 2388651680431..3a814662b43c8 100644 --- a/L1Trigger/L1TMuonOverlap/src/AngleConverter.cc +++ b/L1Trigger/L1TMuonOverlap/src/AngleConverter.cc @@ -265,7 +265,7 @@ int AngleConverter::getProcessorPhi(unsigned int iProcessor, phiHalfStrip0 += 2 * M_PI; int offsetLoc = lround((phiHalfStrip0 - phi15deg) / hsPhiPitch); - int halfStrip = digi.getStrip(); // returns halfStrip 0..159 + int halfStrip = digi.strip(); // returns halfStrip 0..159 //FIXME: to be checked (only important for ME1/3) keep more bits for offset, truncate at the end // a quick fix for towards geometry changes due to global tag. @@ -443,9 +443,9 @@ int AngleConverter::getGlobalEta(unsigned int rawid, const CSCCorrelatedLCTDigi std::unique_ptr layer_geom(chamb->layer(CSCConstants::KEY_ALCT_LAYER)->geometry()); std::unique_ptr layer(chamb->layer(CSCConstants::KEY_ALCT_LAYER)); - const uint16_t halfstrip = aDigi.getStrip(); - const uint16_t pattern = aDigi.getPattern(); - const uint16_t keyWG = aDigi.getKeyWG(); + const uint16_t halfstrip = aDigi.strip(); + const uint16_t pattern = aDigi.pattern(); + const uint16_t keyWG = aDigi.keyWireGroup(); //const unsigned maxStrips = layer_geom->numberOfStrips(); // so we can extend this later diff --git a/L1Trigger/L1TMuonOverlap/src/OMTFinputMaker.cc b/L1Trigger/L1TMuonOverlap/src/OMTFinputMaker.cc index 3d81c19b0be53..c542ad1381909 100644 --- a/L1Trigger/L1TMuonOverlap/src/OMTFinputMaker.cc +++ b/L1Trigger/L1TMuonOverlap/src/OMTFinputMaker.cc @@ -279,7 +279,7 @@ OMTFinput OMTFinputMaker::processCSC(const CSCCorrelatedLCTDigiCollection *cscDi auto dend = (*chamber).second.second; for (; digi != dend; ++digi) { ///Check if LCT trigger primitive has the right BX. - if (digi->getBX() - CSCConstants::LCT_CENTRAL_BX != bxTrg) + if (digi->bx() - CSCConstants::LCT_CENTRAL_BX != bxTrg) continue; unsigned int hwNumber = myOmtfConfig->getLayerNumber(rawid); diff --git a/L1Trigger/L1TNtuples/src/L1AnalysisCSCTF.cc b/L1Trigger/L1TNtuples/src/L1AnalysisCSCTF.cc index b395f4cea49ce..90811048e0460 100644 --- a/L1Trigger/L1TNtuples/src/L1AnalysisCSCTF.cc +++ b/L1Trigger/L1TNtuples/src/L1AnalysisCSCTF.cc @@ -109,8 +109,8 @@ void L1Analysis::L1AnalysisCSCTF::SetTracks(const edm::HandlegetBX(); - csctf_.trLctBx0[nTrk - 1][LctTrkId_] = lctTrk->getBX0(); + csctf_.trLctBx[nTrk - 1][LctTrkId_] = lctTrk->bx(); + csctf_.trLctBx0[nTrk - 1][LctTrkId_] = lctTrk->bx0(); csctf_.trLctStation[nTrk - 1][LctTrkId_] = (*lctOfTrks).first.station(); csctf_.trLctRing[nTrk - 1][LctTrkId_] = (*lctOfTrks).first.ring(); @@ -145,16 +145,16 @@ void L1Analysis::L1AnalysisCSCTF::SetTracks(const edm::HandlegetStrip(); + csctf_.trLctstripNum[nTrk - 1][LctTrkId_] = lctTrk->strip(); lclPhi = srLUTs_[FPGALctTrk][endcap]->localPhi( - lctTrk->getStrip(), lctTrk->getPattern(), lctTrk->getQuality(), lctTrk->getBend()); + lctTrk->strip(), lctTrk->pattern(), lctTrk->quality(), lctTrk->bend()); csctf_.trLctlocalPhi[nTrk - 1][LctTrkId_] = lclPhi.phi_local; //csctf_.trLctlocalPhi_bend[nTrk-1][LctTrkId_] = lclPhi.phi_bend_local; //csctf_.trLctCLCT_pattern[nTrk-1][LctTrkId_] = lctTrk->getPattern(); - csctf_.trLctQuality[nTrk - 1][LctTrkId_] = lctTrk->getQuality(); + csctf_.trLctQuality[nTrk - 1][LctTrkId_] = lctTrk->quality(); - //std::cout <<"lctTrk->getPattern() = " << lctTrk->getPattern() << std::endl; + //std::cout <<"lctTrk->pattern() = " << lctTrk->pattern() << std::endl; } catch (...) { bzero(&lclPhi, sizeof(lclPhi)); csctf_.trLctlocalPhi[nTrk - 1][LctTrkId_] = -999; @@ -175,8 +175,8 @@ void L1Analysis::L1AnalysisCSCTF::SetTracks(const edm::HandlegetKeyWG(); - gblPhi = srLUTs_[FPGALctTrk][endcap]->globalPhiME(lclPhi.phi_local, lctTrk->getKeyWG(), CscIdLctTrk); + csctf_.trLctwireGroup[nTrk - 1][LctTrkId_] = lctTrk->keyWireGroup(); + gblPhi = srLUTs_[FPGALctTrk][endcap]->globalPhiME(lclPhi.phi_local, lctTrk->keyWireGroup(), CscIdLctTrk); csctf_.trLctglobalPhi[nTrk - 1][LctTrkId_] = gblPhi.global_phi; @@ -190,7 +190,7 @@ void L1Analysis::L1AnalysisCSCTF::SetTracks(const edm::HandleglobalEtaME( - lclPhi.phi_bend_local, lclPhi.phi_local, lctTrk->getKeyWG(), CscIdLctTrk); + lclPhi.phi_bend_local, lclPhi.phi_local, lctTrk->keyWireGroup(), CscIdLctTrk); csctf_.trLctglobalEta[nTrk - 1][LctTrkId_] = gblEta.global_eta; csctf_.trLctCLCT_pattern[nTrk - 1][LctTrkId_] = gblEta.global_bend; } catch (...) { @@ -235,8 +235,8 @@ void L1Analysis::L1AnalysisCSCTF::SetLCTs(const edm::HandlegetBX()); - csctf_.lctBx0.push_back(lct->getBX0()); + csctf_.lctBx.push_back(lct->bx()); + csctf_.lctBx0.push_back(lct->bx0()); csctf_.lctStation.push_back((*corrLct).first.station()); csctf_.lctRing.push_back((*corrLct).first.ring()); @@ -270,29 +270,29 @@ void L1Analysis::L1AnalysisCSCTF::SetLCTs(const edm::HandlegetStrip()); - + csctf_.lctstripNum.push_back(lct->strip()); + + csctf_.lctlocalPhi.push_back(lclPhi.phi_local); - } - catch(...) { - bzero(&lclPhi,sizeof(lclPhi)); + } + catch(...) { + bzero(&lclPhi,sizeof(lclPhi)); csctf_.lctlocalPhi.push_back(-999); } - + */ try { - csctf_.lctstripNum.push_back(lct->getStrip()); + csctf_.lctstripNum.push_back(lct->strip()); lclPhi = - srLUTs_[FPGALct][endcap]->localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend()); + srLUTs_[FPGALct][endcap]->localPhi(lct->strip(), lct->pattern(), lct->quality(), lct->bend()); csctf_.lctlocalPhi.push_back(lclPhi.phi_local); //csctf_.lctlocalPhi_bend.push_back(lclPhi.phi_bend_local); //csctf_.lctCLCT_pattern.push_back(lct->getPattern()); - csctf_.lctQuality.push_back(lct->getQuality()); + csctf_.lctQuality.push_back(lct->quality()); //std::cout <<"localPhi: lclPhi.phi_bend_local = " << lclPhi.phi_bend_local << std::endl; - //std::cout <<"localPhi: lct->getBend() = " << lct->getBend() << std::endl; + //std::cout <<"localPhi: lct->bend() = " << lct->bend() << std::endl; } catch (...) { bzero(&lclPhi, sizeof(lclPhi)); @@ -306,13 +306,13 @@ void L1Analysis::L1AnalysisCSCTF::SetLCTs(const edm::HandlegetKeyWG()); + csctf_.lctwireGroup.push_back(lct->keyWireGroup()); //std::cout << "lclPhi.phi_local: " << lclPhi.phi_local << std::endl; - //std::cout << "lct->getKeyWG(): " << lct->getKeyWG() << std::endl; + //std::cout << "lct->keyWireGroup(): " << lct->keyWireGroup() << std::endl; //std::cout << "CscIdLct: " << CscIdLct << std::endl; - gblPhi = srLUTs_[FPGALct][endcap]->globalPhiME(lclPhi.phi_local, lct->getKeyWG(), CscIdLct); + gblPhi = srLUTs_[FPGALct][endcap]->globalPhiME(lclPhi.phi_local, lct->keyWireGroup(), CscIdLct); csctf_.lctglobalPhi.push_back(gblPhi.global_phi); } catch (...) { @@ -325,7 +325,7 @@ void L1Analysis::L1AnalysisCSCTF::SetLCTs(const edm::HandleglobalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), CscIdLct); + srLUTs_[FPGALct][endcap]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->keyWireGroup(), CscIdLct); //std::cout <<"gblEta: lclPhi.phi_bend_local = " << lclPhi.phi_bend_local << std::endl; csctf_.lctglobalEta.push_back(gblEta.global_eta); csctf_.lctCLCT_pattern.push_back(gblEta.global_bend); @@ -366,17 +366,17 @@ void L1Analysis::L1AnalysisCSCTF::SetDTStubs(const edm::Handle vstubs = dtStubs->get(); //iterate through DT Stubs for (std::vector::const_iterator stub = vstubs.begin(); stub != vstubs.end(); stub++) { - csctf_.dtBXN.push_back(stub->BX()); - csctf_.dtFLAG.push_back(stub->getStrip()); //getStrip() is actually the "FLAG" bit - csctf_.dtCAL.push_back(stub->getKeyWG()); //getKeyWG() is actually the "CAL" bit + csctf_.dtBXN.push_back(stub->bx()); + csctf_.dtFLAG.push_back(stub->strip()); //strip() is actually the "FLAG" bit + csctf_.dtCAL.push_back(stub->keyWireGroup()); //keyWireGroup() is actually the "CAL" bit csctf_.dtSector.push_back(6 * (stub->endcap() - 1) + stub->sector()); csctf_.dtSubSector.push_back(stub->subsector()); - csctf_.dtBX0.push_back(stub->getBX0()); //it is unclear what this variable is... - csctf_.dtPhiBend.push_back(stub->getBend()); + csctf_.dtBX0.push_back(stub->bx0()); //it is unclear what this variable is... + csctf_.dtPhiBend.push_back(stub->bend()); csctf_.dtPhiPacked.push_back(stub->phiPacked()); - csctf_.dtQuality.push_back(stub->getQuality()); + csctf_.dtQuality.push_back(stub->quality()); } csctf_.dtSize = vstubs.size(); diff --git a/RecoLocalMuon/CSCValidation/src/CSCValidation.h b/RecoLocalMuon/CSCValidation/src/CSCValidation.h index 667f1dbf88ccd..7e5e6cf64a76d 100644 --- a/RecoLocalMuon/CSCValidation/src/CSCValidation.h +++ b/RecoLocalMuon/CSCValidation/src/CSCValidation.h @@ -46,7 +46,7 @@ #include "EventFilter/CSCRawToDigi/interface/CSCCFEBData.h" #include "EventFilter/CSCRawToDigi/interface/CSCALCTHeader.h" #include "EventFilter/CSCRawToDigi/interface/CSCAnodeData.h" -#include "EventFilter/CSCRawToDigi/interface/CSCCLCTData.h" +#include "EventFilter/CSCRawToDigi/interface/CSCComparatorData.h" #include "EventFilter/CSCRawToDigi/interface/CSCDDUEventData.h" #include "EventFilter/CSCRawToDigi/interface/CSCTMBData.h" #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h" From aa52937571a55ed2cd8d159259493819ce2273e7 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 10 May 2020 14:19:06 -0500 Subject: [PATCH 11/12] bugfix --- L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc index 291856a197ff6..22c9cf9f53fbb 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc @@ -1216,14 +1216,14 @@ std::vector CSCCathodeLCTProcessor::getCLCTs() const { // to make a proper comparison with ALCTs we need // CLCT and ALCT to have the central BX in the same bin CSCCLCTDigi CSCCathodeLCTProcessor::getBestCLCT(int bx) const { - CSCCLCTDigi lct = CLCTCont()ainer_[bx][0]; + CSCCLCTDigi lct = CLCTContainer_[bx][0]; lct.setBX(lct.bx() + alctClctOffset_); return lct; } CSCCLCTDigi CSCCathodeLCTProcessor::getSecondCLCT(int bx) const { - CSCCLCTDgetSecondCLCTCLCTContainer_[bx][1]; + CSCCLCTDigi lct = CLCTContainer_[bx][1]; lct.setBX(lct.bx() + alctClctOffset_); return lct; } From ce7fc64487dbd9f8651c94e03dbde8d68f0717de Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 10 May 2020 14:46:36 -0500 Subject: [PATCH 12/12] code format --- DQM/L1TMonitor/src/L1TCSCTF.cc | 4 ++-- EventFilter/CSCRawToDigi/src/CSCComparatorData.cc | 5 +++-- EventFilter/CSCRawToDigi/src/CSCTMBData.cc | 3 ++- .../src/CSCCathodeLCTProcessor.cc | 1 - L1Trigger/L1TNtuples/src/L1AnalysisCSCTF.cc | 11 +++++------ RecoLocalMuon/CSCValidation/src/CSCValidation.cc | 6 ++---- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/DQM/L1TMonitor/src/L1TCSCTF.cc b/DQM/L1TMonitor/src/L1TCSCTF.cc index d116ec955958e..126615f3693d4 100644 --- a/DQM/L1TMonitor/src/L1TCSCTF.cc +++ b/DQM/L1TMonitor/src/L1TCSCTF.cc @@ -1022,8 +1022,8 @@ void L1TCSCTF::analyze(const Event& e, const EventSetup& c) { gblphidat gblPhi; try { - gblPhi = - srLUTs_[fpga][EndCapLUT][sector]->globalPhiME(lclPhi.phi_local, lct->keyWireGroup(), cscId + 1, gangedME11a_); + gblPhi = srLUTs_[fpga][EndCapLUT][sector]->globalPhiME( + lclPhi.phi_local, lct->keyWireGroup(), cscId + 1, gangedME11a_); } catch (cms::Exception&) { bzero(&gblPhi, sizeof(gblPhi)); } diff --git a/EventFilter/CSCRawToDigi/src/CSCComparatorData.cc b/EventFilter/CSCRawToDigi/src/CSCComparatorData.cc index a8571f243c3fa..6e30fc550d4bf 100644 --- a/EventFilter/CSCRawToDigi/src/CSCComparatorData.cc +++ b/EventFilter/CSCRawToDigi/src/CSCComparatorData.cc @@ -13,7 +13,8 @@ bool CSCComparatorData::debug = false; std::atomic CSCComparatorData::debug{false}; #endif -CSCComparatorData::CSCComparatorData(const CSCTMBHeader* tmbHeader) : ncfebs_(tmbHeader->NCFEBs()), ntbins_(tmbHeader->NTBins()) { +CSCComparatorData::CSCComparatorData(const CSCTMBHeader* tmbHeader) + : ncfebs_(tmbHeader->NCFEBs()), ntbins_(tmbHeader->NTBins()) { if (tmbHeader != nullptr) theFirmwareVersion = tmbHeader->FirmwareVersion(); else @@ -147,7 +148,7 @@ std::vector CSCComparatorData::comparatorDigis(uint32_t idlay if (debug) LogTrace("CSCComparatorData|CSCRawToDigi") << "fillComparatorOutputs: cfeb_corr = " << cfeb_corr - << " distrip_corr = " << distrip_corr << " strip = " << strip; + << " distrip_corr = " << distrip_corr << " strip = " << strip; if (doStripSwapping && ((me1a && zplus) || (me1b && !zplus))) { // Half-strips need to be flipped too. diff --git a/EventFilter/CSCRawToDigi/src/CSCTMBData.cc b/EventFilter/CSCRawToDigi/src/CSCTMBData.cc index 1a74448cd9712..b6629f1c8adae 100644 --- a/EventFilter/CSCRawToDigi/src/CSCTMBData.cc +++ b/EventFilter/CSCRawToDigi/src/CSCTMBData.cc @@ -204,7 +204,8 @@ int CSCTMBData::UnpackTMB(const uint16_t* buf) { int currentPosition = theTMBHeader.sizeInWords(); int theFirmwareVersion = theTMBHeader.FirmwareVersion(); - theComparatorData = CSCComparatorData(theTMBHeader.NCFEBs(), theTMBHeader.NTBins(), buf + e0bLine + 1, theFirmwareVersion); + theComparatorData = + CSCComparatorData(theTMBHeader.NCFEBs(), theTMBHeader.NTBins(), buf + e0bLine + 1, theFirmwareVersion); if (!theComparatorData.check()) { LogTrace("CSCTMBData|CSCRawToDigi") << "+++ CSCTMBData warning: Bad CLCT data"; diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc index 22c9cf9f53fbb..30a04fdf07d03 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc @@ -1221,7 +1221,6 @@ CSCCLCTDigi CSCCathodeLCTProcessor::getBestCLCT(int bx) const { return lct; } - CSCCLCTDigi CSCCathodeLCTProcessor::getSecondCLCT(int bx) const { CSCCLCTDigi lct = CLCTContainer_[bx][1]; lct.setBX(lct.bx() + alctClctOffset_); diff --git a/L1Trigger/L1TNtuples/src/L1AnalysisCSCTF.cc b/L1Trigger/L1TNtuples/src/L1AnalysisCSCTF.cc index 90811048e0460..ed3506df90f17 100644 --- a/L1Trigger/L1TNtuples/src/L1AnalysisCSCTF.cc +++ b/L1Trigger/L1TNtuples/src/L1AnalysisCSCTF.cc @@ -284,8 +284,7 @@ void L1Analysis::L1AnalysisCSCTF::SetLCTs(const edm::Handlestrip()); - lclPhi = - srLUTs_[FPGALct][endcap]->localPhi(lct->strip(), lct->pattern(), lct->quality(), lct->bend()); + lclPhi = srLUTs_[FPGALct][endcap]->localPhi(lct->strip(), lct->pattern(), lct->quality(), lct->bend()); csctf_.lctlocalPhi.push_back(lclPhi.phi_local); //csctf_.lctlocalPhi_bend.push_back(lclPhi.phi_bend_local); @@ -324,8 +323,8 @@ void L1Analysis::L1AnalysisCSCTF::SetLCTs(const edm::HandleglobalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->keyWireGroup(), CscIdLct); + gblEta = srLUTs_[FPGALct][endcap]->globalEtaME( + lclPhi.phi_bend_local, lclPhi.phi_local, lct->keyWireGroup(), CscIdLct); //std::cout <<"gblEta: lclPhi.phi_bend_local = " << lclPhi.phi_bend_local << std::endl; csctf_.lctglobalEta.push_back(gblEta.global_eta); csctf_.lctCLCT_pattern.push_back(gblEta.global_bend); @@ -367,8 +366,8 @@ void L1Analysis::L1AnalysisCSCTF::SetDTStubs(const edm::Handle::const_iterator stub = vstubs.begin(); stub != vstubs.end(); stub++) { csctf_.dtBXN.push_back(stub->bx()); - csctf_.dtFLAG.push_back(stub->strip()); //strip() is actually the "FLAG" bit - csctf_.dtCAL.push_back(stub->keyWireGroup()); //keyWireGroup() is actually the "CAL" bit + csctf_.dtFLAG.push_back(stub->strip()); //strip() is actually the "FLAG" bit + csctf_.dtCAL.push_back(stub->keyWireGroup()); //keyWireGroup() is actually the "CAL" bit csctf_.dtSector.push_back(6 * (stub->endcap() - 1) + stub->sector()); csctf_.dtSubSector.push_back(stub->subsector()); diff --git a/RecoLocalMuon/CSCValidation/src/CSCValidation.cc b/RecoLocalMuon/CSCValidation/src/CSCValidation.cc index 1314687bfeb00..2657025182af5 100644 --- a/RecoLocalMuon/CSCValidation/src/CSCValidation.cc +++ b/RecoLocalMuon/CSCValidation/src/CSCValidation.cc @@ -3145,8 +3145,7 @@ void CSCValidation::doTimeMonitoring(edm::Handle recHits, if ((*digiIt).isValid()) { n_alcts++; histos->fill1DHist((*digiIt).bx(), "ALCT_bx", "ALCT.bx()", 11, -0.5, 10.5, "TimeMonitoring"); - histos->fill1DHist( - (*digiIt).fullBX(), "ALCT_fullBX", "ALCT.fullBX()", 3601, -0.5, 3600.5, "TimeMonitoring"); + histos->fill1DHist((*digiIt).fullBX(), "ALCT_fullBX", "ALCT.fullBX()", 3601, -0.5, 3600.5, "TimeMonitoring"); //if we don't already have digi information stored for this chamber, then we fill it if (ALCT_KeyWG_map.find(idALCT.chamberId()) == ALCT_KeyWG_map.end()) { ALCT_KeyWG_map[idALCT.chamberId()] = (*digiIt).keyWireGroup(); @@ -3169,8 +3168,7 @@ void CSCValidation::doTimeMonitoring(edm::Handle recHits, if ((*digiIt).isValid()) { n_clcts++; histos->fill1DHist((*digiIt).bx(), "CLCT_getBX", "CLCT.getBX()", 11, -0.5, 10.5, "TimeMonitoring"); - histos->fill1DHist( - (*digiIt).fullBX(), "CLCT_fullBX", "CLCT.fullBX()", 3601, -0.5, 3600.5, "TimeMonitoring"); + histos->fill1DHist((*digiIt).fullBX(), "CLCT_fullBX", "CLCT.fullBX()", 3601, -0.5, 3600.5, "TimeMonitoring"); //if we don't already have digi information stored for this chamber, then we fill it if (CLCT_getFullBx_map.find(idCLCT.chamberId()) == CLCT_getFullBx_map.end()) { CLCT_getFullBx_map[idCLCT.chamberId()] = (*digiIt).fullBX();