Skip to content

Commit

Permalink
remove enums. put everything in vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Dildick committed Nov 4, 2021
1 parent d4ee5ee commit aefeb23
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 38 deletions.
15 changes: 6 additions & 9 deletions L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeDataFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ namespace L1Analysis {
kAsymHtHF
};

enum MuonShowerType {
kInvalid = 0,
kOneNominal,
kOneTight,
kTwoLoose
};

struct L1AnalysisL1UpgradeDataFormat {
L1AnalysisL1UpgradeDataFormat() { Reset(); };
~L1AnalysisL1UpgradeDataFormat(){};
Expand Down Expand Up @@ -134,7 +127,9 @@ namespace L1Analysis {

nMuonShowers = 0;
muonShowerBx.clear();
muonShowerType.clear();
muonShowerOneNominal.clear();
muonShowerOneTight.clear();
muonShowerTwoLoose.clear();

nSums = 0;
sumType.clear();
Expand Down Expand Up @@ -224,7 +219,9 @@ namespace L1Analysis {

unsigned short int nMuonShowers;
std::vector<short int> muonShowerBx;
std::vector<short int> muonShowerType;
std::vector<short int> muonShowerOneNominal;
std::vector<short int> muonShowerOneTight;
std::vector<short int> muonShowerTwoLoose;

unsigned short int nSums;
std::vector<short int> sumType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@ namespace L1Analysis {

struct L1AnalysisL1UpgradeTfMuonShowerDataFormat {

enum TfMuonShowerType {
kInvalid = 0,
kOneNominal,
kOneTight,
kTwoLoose
};

L1AnalysisL1UpgradeTfMuonShowerDataFormat() { Reset(); };
~L1AnalysisL1UpgradeTfMuonShowerDataFormat(){};

void Reset() {
nTfMuonShowers = 0;
tfMuonShowerBx.clear();
tfMuonShowerType.clear();
tfMuonShowerOneNominal.clear();
tfMuonShowerOneTight.clear();
tfMuonShowerTwoLoose.clear();
tfMuonShowerEndcap.clear();
tfMuonShowerSector.clear();
}

unsigned short int nTfMuonShowers;
std::vector<short int> tfMuonShowerBx;
std::vector<short int> tfMuonShowerType;
std::vector<short int> tfMuonShowerOneNominal;
std::vector<short int> tfMuonShowerOneTight;
std::vector<short int> tfMuonShowerTwoLoose;
std::vector<short int> tfMuonShowerEndcap;
std::vector<short int> tfMuonShowerSector;
};
} // namespace L1Analysis
#endif
13 changes: 3 additions & 10 deletions L1Trigger/L1TNtuples/src/L1AnalysisL1Upgrade.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,9 @@ void L1Analysis::L1AnalysisL1Upgrade::SetMuonShower(const edm::Handle<l1t::MuonS
it++) {
if (it->isValid()) {
l1upgrade_.muonShowerBx.push_back(ibx);
int type;
if (it->isOneNominalInTime())
type = kOneNominal;
else if (it->isOneTightInTime())
type = kOneTight;
else if (it->isTwoLooseInTime())
type = kTwoLoose;
else
type = kInvalid;
l1upgrade_.muonShowerType.push_back(type);
l1upgrade_.muonShowerOneNominal.push_back(it->isOneNominalInTime());
l1upgrade_.muonShowerOneTight.push_back(it->isOneTightInTime());
l1upgrade_.muonShowerTwoLoose.push_back(it->isTwoLooseInTime());
l1upgrade_.nMuonShowers++;
}
}
Expand Down
15 changes: 5 additions & 10 deletions L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuonShower.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuonShower::SetTfMuonShower(const l1t::Reg
++it) {
if (it->isValid()) {
l1upgradetfmuonshower_.tfMuonShowerBx.push_back(ibx);
int type;
if (it->isOneNominalInTime())
type = L1AnalysisL1UpgradeTfMuonShowerDataFormat::kOneNominal;
else if (it->isOneTightInTime())
type = L1AnalysisL1UpgradeTfMuonShowerDataFormat::kOneTight;
else if (it->isTwoLooseInTime())
type = L1AnalysisL1UpgradeTfMuonShowerDataFormat::kTwoLoose;
else
type = L1AnalysisL1UpgradeTfMuonShowerDataFormat::kInvalid;
l1upgradetfmuonshower_.tfMuonShowerType.push_back(type);
l1upgradetfmuonshower_.tfMuonShowerEndcap.push_back(it->endcap());
l1upgradetfmuonshower_.tfMuonShowerSector.push_back(it->sector());
l1upgradetfmuonshower_.tfMuonShowerOneNominal.push_back(it->isOneNominalInTime());
l1upgradetfmuonshower_.tfMuonShowerOneTight.push_back(it->isOneTightInTime());
l1upgradetfmuonshower_.tfMuonShowerTwoLoose.push_back(it->isTwoLooseInTime());
l1upgradetfmuonshower_.nTfMuonShowers++;
}
}
Expand Down

0 comments on commit aefeb23

Please sign in to comment.