Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove L1Trigger/L1TMuon dependency from DataFormats/L1TMuon #31417

Merged
merged 1 commit into from Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,5 +1,5 @@
#ifndef L1Trigger_CSCCommonTrigger_CSCConstants_h
#define L1Trigger_CSCCommonTrigger_CSCConstants_h
#ifndef DataFormats_L1TMuon_CSCConstants_h
#define DataFormats_L1TMuon_CSCConstants_h

/**
* \class CSCConstants
Expand Down
16 changes: 6 additions & 10 deletions DataFormats/L1TMuon/interface/EMTFHit.h
Expand Up @@ -16,10 +16,7 @@
#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h"
#include "DataFormats/GEMDigi/interface/GEMPadDigiCluster.h"
#include "DataFormats/L1TMuon/interface/CPPFDigi.h"

// Included *only* for TrigerPrimitive::subsystem_type enum...
// surely there's a better way/place for such common definitions
#include "L1Trigger/L1TMuon/interface/MuonTriggerPrimitive.h"
#include "DataFormats/L1TMuon/interface/L1TMuonSubsystems.h"

namespace l1t {

Expand Down Expand Up @@ -267,12 +264,11 @@ namespace l1t {
int ALCT_quality() const { return alct_quality; }
int CLCT_quality() const { return clct_quality; }

// See L1Trigger/L1TMuon/interface/MuonTriggerPrimitive.h
bool Is_DT() const { return subsystem == l1tmu::TriggerPrimitive::kDT; }
bool Is_CSC() const { return subsystem == l1tmu::TriggerPrimitive::kCSC; }
bool Is_RPC() const { return subsystem == l1tmu::TriggerPrimitive::kRPC; }
bool Is_GEM() const { return subsystem == l1tmu::TriggerPrimitive::kGEM; }
bool Is_ME0() const { return subsystem == l1tmu::TriggerPrimitive::kME0; }
bool Is_DT() const { return subsystem == l1tmu::kDT; }
bool Is_CSC() const { return subsystem == l1tmu::kCSC; }
bool Is_RPC() const { return subsystem == l1tmu::kRPC; }
bool Is_GEM() const { return subsystem == l1tmu::kGEM; }
bool Is_ME0() const { return subsystem == l1tmu::kME0; }

private:
//CSCDetId csc_DetId;
Expand Down
8 changes: 8 additions & 0 deletions DataFormats/L1TMuon/interface/L1TMuonSubsystems.h
@@ -0,0 +1,8 @@
#ifndef DataFormats_L1TMuon_L1TMuonSubsystems_hh
#define DataFormats_L1TMuon_L1TMuonSubsystems_hh

namespace L1TMuon {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a enum class be better since this is presently violating the CMS naming rules for namespaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this namespace is used extensively already...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but of course its easy to change if we don't mind it being different from the rest of the L1TMuon code.

enum subsystem_type { kDT, kCSC, kRPC, kGEM, kME0, kNSubsystems };
}

#endif
2 changes: 1 addition & 1 deletion DataFormats/L1TMuon/src/EMTFHit.cc
@@ -1,5 +1,5 @@
#include "DataFormats/L1TMuon/interface/EMTFHit.h"
#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
#include "DataFormats/L1TMuon/interface/CSCConstants.h"

namespace l1t {

Expand Down
@@ -1,5 +1,5 @@

#include "EMTFUnpackerTools.h"
#include "DataFormats/L1TMuon/interface/L1TMuonSubsystems.h"

namespace l1t {
namespace stage2 {
Expand All @@ -18,7 +18,7 @@ namespace l1t {
_hit.set_sync_err(_ME.SE());
_hit.set_bx(_ME.TBIN() - 3);
_hit.set_bc0(_ME.BC0());
_hit.set_subsystem(l1tmu::TriggerPrimitive::kCSC);
_hit.set_subsystem(l1tmu::kCSC);
// _hit.set_layer();

_hit.set_ring(L1TMuonEndCap::calc_ring(_hit.Station(), _hit.CSC_ID(), _hit.Strip()));
Expand All @@ -43,7 +43,7 @@ namespace l1t {
_hit.set_bx(_RPC.TBIN() - 3);
_hit.set_valid(_RPC.VP());
_hit.set_bc0(_RPC.BC0());
_hit.set_subsystem(l1tmu::TriggerPrimitive::kRPC);
_hit.set_subsystem(l1tmu::kRPC);

_hit.SetRPCDetId(_hit.CreateRPCDetId());
// // Not yet implemented - AWB 15.03.17
Expand Down Expand Up @@ -77,7 +77,7 @@ namespace l1t {
_hit.set_bx(_GEM.TBIN() - 3);
_hit.set_valid(_GEM.VP());
_hit.set_bc0(_GEM.BC0());
_hit.set_subsystem(l1tmu::TriggerPrimitive::kGEM);
_hit.set_subsystem(l1tmu::kGEM);

_hit.set_ring(1); // GEM only on ring 1
// TODO: FIXME correct for GEM, should match CSC chamber, but GEM have 2 chambers (layers in a superchamber) per CSC chamber - JS 13.07.20
Expand Down
2 changes: 1 addition & 1 deletion EventFilter/L1TRawToDigi/src/OmtfCscPacker.cc
Expand Up @@ -2,7 +2,7 @@

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DataFormats/L1TMuon/interface/OMTF/OmtfCscDataWord64.h"
#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
#include "DataFormats/L1TMuon/interface/CSCConstants.h"

namespace omtf {

Expand Down
2 changes: 1 addition & 1 deletion EventFilter/L1TRawToDigi/src/OmtfCscUnpacker.cc
Expand Up @@ -4,7 +4,7 @@

#include "DataFormats/MuonDetId/interface/CSCDetId.h"
#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h"
#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
#include "DataFormats/L1TMuon/interface/CSCConstants.h"

#include "DataFormats/L1TMuon/interface/OMTF/OmtfCscDataWord64.h"

Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/CSCCommonTrigger/interface/CSCPatternLUT.h
Expand Up @@ -9,7 +9,7 @@
* This was factored out of the Sector Receiver since it is used in
* parts of the trigger primitive generator (I think).
*/
#include <L1Trigger/CSCCommonTrigger/interface/CSCConstants.h>
#include <DataFormats/L1TMuon/interface/CSCConstants.h>

class CSCPatternLUT {
public:
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/CSCTrackFinder/src/CSCSectorReceiverLUT.cc
Expand Up @@ -4,7 +4,7 @@
#include <L1Trigger/CSCCommonTrigger/interface/CSCFrontRearLUT.h>
#include <DataFormats/L1CSCTrackFinder/interface/CSCBitWidths.h>
#include <DataFormats/L1CSCTrackFinder/interface/CSCTFConstants.h>
#include <L1Trigger/CSCCommonTrigger/interface/CSCConstants.h>
#include <DataFormats/L1TMuon/interface/CSCConstants.h>

#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
#include <Geometry/CSCGeometry/interface/CSCLayerGeometry.h>
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/CSCTrackFinder/src/CSCSectorReceiverMiniLUT.cc
Expand Up @@ -2,7 +2,7 @@
#include <L1Trigger/CSCCommonTrigger/interface/CSCFrontRearLUT.h>
#include <DataFormats/L1CSCTrackFinder/interface/CSCBitWidths.h>
#include <DataFormats/L1CSCTrackFinder/interface/CSCTFConstants.h>
#include <L1Trigger/CSCCommonTrigger/interface/CSCConstants.h>
#include <DataFormats/L1TMuon/interface/CSCConstants.h>

#include <Geometry/CSCGeometry/interface/CSCLayerGeometry.h>
#include "DataFormats/GeometryVector/interface/LocalPoint.h"
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/CSCTrackFinder/src/CSCTFDTReceiver.cc
Expand Up @@ -4,7 +4,7 @@
#include <DataFormats/MuonDetId/interface/CSCDetId.h>
#include <DataFormats/MuonDetId/interface/CSCTriggerNumbering.h>
#include <DataFormats/L1CSCTrackFinder/interface/CSCBitWidths.h>
#include <L1Trigger/CSCCommonTrigger/interface/CSCConstants.h>
#include <DataFormats/L1TMuon/interface/CSCConstants.h>
#include <DataFormats/MuonDetId/interface/DTChamberId.h>

#include <L1Trigger/CSCTrackFinder/src/CSCTFDTReceiverLUT.h>
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/CSCTrackFinder/src/CSCTFMuonSorter.cc
@@ -1,5 +1,5 @@
#include <L1Trigger/CSCTrackFinder/interface/CSCTFMuonSorter.h>
#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
#include "DataFormats/L1TMuon/interface/CSCConstants.h"
#include <FWCore/MessageLogger/interface/MessageLogger.h>

CSCTFMuonSorter::CSCTFMuonSorter(const edm::ParameterSet& pset) {
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h
Expand Up @@ -6,7 +6,7 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
#include "DataFormats/L1TMuon/interface/CSCConstants.h"
#include "L1Trigger/CSCTriggerPrimitives/interface/CSCPatternBank.h"
#include "L1Trigger/CSCTriggerPrimitives/interface/CSCUpgradeMotherboardLUT.h"
#include "L1Trigger/CSCTriggerPrimitives/interface/CSCUpgradeMotherboardLUTGenerator.h"
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/CSCTriggerPrimitives/interface/CSCPatternBank.h
@@ -1,7 +1,7 @@
#ifndef L1Trigger_CSCTriggerPrimitives_CSCPatternBank_h
#define L1Trigger_CSCTriggerPrimitives_CSCPatternBank_h

#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
#include "DataFormats/L1TMuon/interface/CSCConstants.h"
#include <vector>

//
Expand Down
@@ -1,7 +1,7 @@
#ifndef L1Trigger_CSCTriggerPrimitives_CSCUpgradeMotherboardLUT_h
#define L1Trigger_CSCTriggerPrimitives_CSCUpgradeMotherboardLUT_h

#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
#include "DataFormats/L1TMuon/interface/CSCConstants.h"
#include "DataFormats/CSCDigi/interface/CSCALCTDigi.h"
#include "DataFormats/CSCDigi/interface/CSCCLCTDigi.h"

Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/CSCTriggerPrimitives/interface/LCTContainer.h
Expand Up @@ -10,7 +10,7 @@
*/

#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h"
#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
#include "DataFormats/L1TMuon/interface/CSCConstants.h"

#include <vector>
#include <algorithm>
Expand Down
Expand Up @@ -20,7 +20,7 @@
#include "FWCore/Utilities/interface/InputTag.h"
#include "FWCore/Utilities/interface/ESGetToken.h"

#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
#include "DataFormats/L1TMuon/interface/CSCConstants.h"
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"
#include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h"
#include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h"
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/CSCTriggerPrimitives/src/CSCMuonPortCard.cc
@@ -1,5 +1,5 @@
#include "L1Trigger/CSCTriggerPrimitives/interface/CSCMuonPortCard.h"
#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
#include "DataFormats/L1TMuon/interface/CSCConstants.h"
#include <algorithm>

CSCMuonPortCard::CSCMuonPortCard() {}
Expand Down
4 changes: 1 addition & 3 deletions L1Trigger/L1TMuon/interface/MuonTriggerPrimitive.h
Expand Up @@ -23,6 +23,7 @@

#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"
#include "DataFormats/L1TMuon/interface/L1TMuonSubsystems.h"

// DT digi types
class DTChamberId;
Expand Down Expand Up @@ -55,9 +56,6 @@ namespace L1TMuon {

class TriggerPrimitive {
public:
// define the subsystems that we have available
enum subsystem_type { kDT, kCSC, kRPC, kGEM, kME0, kNSubsystems };

// define the data we save locally from each subsystem type
// variables in these structs keep their colloquial meaning
// within a subsystem
Expand Down
42 changes: 21 additions & 21 deletions L1Trigger/L1TMuon/src/GeometryTranslator.cc
Expand Up @@ -12,7 +12,7 @@
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"

#include "L1Trigger/DTUtilities/interface/DTTrigGeom.h"
#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
#include "DataFormats/L1TMuon/interface/CSCConstants.h"
#include "L1Trigger/CSCCommonTrigger/interface/CSCPatternLUT.h"

#include "L1Trigger/L1TMuon/interface/MuonTriggerPrimitive.h"
Expand All @@ -27,19 +27,19 @@ GeometryTranslator::~GeometryTranslator() {}

double GeometryTranslator::calculateGlobalEta(const TriggerPrimitive& tp) const {
switch (tp.subsystem()) {
case TriggerPrimitive::kDT:
case L1TMuon::kDT:
return calcDTSpecificEta(tp);
break;
case TriggerPrimitive::kCSC:
case L1TMuon::kCSC:
return calcCSCSpecificEta(tp);
break;
case TriggerPrimitive::kRPC:
case L1TMuon::kRPC:
return calcRPCSpecificEta(tp);
break;
case TriggerPrimitive::kGEM:
case L1TMuon::kGEM:
return calcGEMSpecificEta(tp);
break;
case TriggerPrimitive::kME0:
case L1TMuon::kME0:
return calcME0SpecificEta(tp);
break;
default:
Expand All @@ -50,19 +50,19 @@ double GeometryTranslator::calculateGlobalEta(const TriggerPrimitive& tp) const

double GeometryTranslator::calculateGlobalPhi(const TriggerPrimitive& tp) const {
switch (tp.subsystem()) {
case TriggerPrimitive::kDT:
case L1TMuon::kDT:
return calcDTSpecificPhi(tp);
break;
case TriggerPrimitive::kCSC:
case L1TMuon::kCSC:
return calcCSCSpecificPhi(tp);
break;
case TriggerPrimitive::kRPC:
case L1TMuon::kRPC:
return calcRPCSpecificPhi(tp);
break;
case TriggerPrimitive::kGEM:
case L1TMuon::kGEM:
return calcGEMSpecificPhi(tp);
break;
case TriggerPrimitive::kME0:
case L1TMuon::kME0:
return calcME0SpecificPhi(tp);
break;
default:
Expand All @@ -73,19 +73,19 @@ double GeometryTranslator::calculateGlobalPhi(const TriggerPrimitive& tp) const

double GeometryTranslator::calculateBendAngle(const TriggerPrimitive& tp) const {
switch (tp.subsystem()) {
case TriggerPrimitive::kDT:
case L1TMuon::kDT:
return calcDTSpecificBend(tp);
break;
case TriggerPrimitive::kCSC:
case L1TMuon::kCSC:
return calcCSCSpecificBend(tp);
break;
case TriggerPrimitive::kRPC:
case L1TMuon::kRPC:
return calcRPCSpecificBend(tp);
break;
case TriggerPrimitive::kGEM:
case L1TMuon::kGEM:
return calcGEMSpecificBend(tp);
break;
case TriggerPrimitive::kME0:
case L1TMuon::kME0:
return calcME0SpecificBend(tp);
break;
default:
Expand All @@ -96,19 +96,19 @@ double GeometryTranslator::calculateBendAngle(const TriggerPrimitive& tp) const

GlobalPoint GeometryTranslator::getGlobalPoint(const TriggerPrimitive& tp) const {
switch (tp.subsystem()) {
case TriggerPrimitive::kDT:
case L1TMuon::kDT:
return calcDTSpecificPoint(tp);
break;
case TriggerPrimitive::kCSC:
case L1TMuon::kCSC:
return getCSCSpecificPoint(tp);
break;
case TriggerPrimitive::kRPC:
case L1TMuon::kRPC:
return getRPCSpecificPoint(tp);
break;
case TriggerPrimitive::kGEM:
case L1TMuon::kGEM:
return getGEMSpecificPoint(tp);
break;
case TriggerPrimitive::kME0:
case L1TMuon::kME0:
return getME0SpecificPoint(tp);
break;
default:
Expand Down