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

Extend L1T CSC DQM with option for ME234/2 chambers and ME2/1 chamber at B904 #35100

Merged
merged 2 commits into from
Sep 16, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions DQM/L1TMonitor/interface/L1TdeCSCTPG.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ class L1TdeCSCTPG : public DQMEDAnalyzer {
/*
When set to True, we assume that the data comes from
the Building 904 CSC test-stand. This test-stand is a single
ME1/1 chamber.
ME1/1 chamber or ME4/2 chamber.
*/
bool B904Setup_;
bool useB904_;
bool useB904ME11_;
bool useB904ME21_;
bool useB904ME234s2_;

bool isRun3_;

Expand Down
4 changes: 3 additions & 1 deletion DQM/L1TMonitor/python/L1TdeCSCTPG_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
lctNBin = cms.vuint32(16, 116, 224, 16, 2, 448, 896, 5, 16, 2, 2),
lctMinBin = cms.vdouble(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
lctMaxBin = cms.vdouble(16, 116, 224, 16, 2, 448, 896, 5, 16, 2, 2),
B904Setup = cms.bool(False),
useB904ME11 = cms.bool(False),
useB904ME21 = cms.bool(False),
useB904ME234s2 = cms.bool(False),
isRun3 = cms.bool(False),
preTriggerAnalysis = cms.bool(False)
)
Expand Down
108 changes: 86 additions & 22 deletions DQM/L1TMonitor/src/L1TdeCSCTPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ L1TdeCSCTPG::L1TdeCSCTPG(const edm::ParameterSet& ps)
alctMaxBin_(ps.getParameter<std::vector<double>>("alctMaxBin")),
clctMaxBin_(ps.getParameter<std::vector<double>>("clctMaxBin")),
lctMaxBin_(ps.getParameter<std::vector<double>>("lctMaxBin")),
B904Setup_(ps.getParameter<bool>("B904Setup")),
useB904ME11_(ps.getParameter<bool>("useB904ME11")),
useB904ME21_(ps.getParameter<bool>("useB904ME21")),
useB904ME234s2_(ps.getParameter<bool>("useB904ME234s2")),
isRun3_(ps.getParameter<bool>("isRun3")),
preTriggerAnalysis_(ps.getParameter<bool>("preTriggerAnalysis")) {}
preTriggerAnalysis_(ps.getParameter<bool>("preTriggerAnalysis")) {
useB904_ = useB904ME11_ or useB904ME21_ or useB904ME234s2_;
}

L1TdeCSCTPG::~L1TdeCSCTPG() {}

Expand All @@ -45,10 +49,23 @@ void L1TdeCSCTPG::bookHistograms(DQMStore::IBooker& iBooker, const edm::Run&, co
lctVars_.resize(5);
}

// remove the non-ME1/1 chambers from the list when B904Setup is set to true
if (B904Setup_) {
// remove the non-ME1/1 chambers from the list when useB904ME11 is set to true
if (useB904ME11_) {
chambers_.resize(1);
}
// similar for ME2/1
else if (useB904ME21_) {
auto temp = chambers_[3];
chambers_.resize(1);
chambers_[0] = temp;
}
// similar for ME4/2
else if (useB904ME234s2_) {
auto temp = chambers_.back();
chambers_.resize(1);
chambers_[0] = temp;
}

// do not analyze the 1/4-strip bit, 1/8-strip bit
else {
clctVars_.resize(9);
Expand Down Expand Up @@ -109,15 +126,23 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
e.getByToken(dataLCT_token_, dataLCTs);
e.getByToken(emulLCT_token_, emulLCTs);
// only do pre-trigger analysis when B904 setup is used
if (B904Setup_)
if (useB904_)
e.getByToken(emulpreCLCT_token_, emulpreCLCTs);

for (auto it = dataALCTs->begin(); it != dataALCTs->end(); it++) {
auto range = dataALCTs->get((*it).first);
const int type = ((*it).first).iChamberType() - 2;
const CSCDetId& detid((*it).first);
int type = ((*it).first).iChamberType() - 2;
// ignore non-ME1/1 chambers when using B904 test-stand data
if (B904Setup_ and !((*it).first).isME11())
if (useB904ME11_ and !(detid.isME11()))
continue;
if (useB904ME21_ and !(detid.isME21()))
continue;
if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42()))
continue;
// to prevent crashes because you are booking histos for single b904 chamber
if (useB904ME234s2_ or useB904ME21_)
type = 0;
for (auto alct = range.first; alct != range.second; alct++) {
if (alct->isValid()) {
chamberHistos[type]["alct_quality_data"]->Fill(alct->getQuality());
Expand All @@ -129,10 +154,18 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {

for (auto it = emulALCTs->begin(); it != emulALCTs->end(); it++) {
auto range = emulALCTs->get((*it).first);
const int type = ((*it).first).iChamberType() - 2;
const CSCDetId& detid((*it).first);
int type = ((*it).first).iChamberType() - 2;
// ignore non-ME1/1 chambers when using B904 test-stand data
if (B904Setup_ and !((*it).first).isME11())
if (useB904ME11_ and !(detid.isME11()))
continue;
if (useB904ME21_ and !(detid.isME21()))
continue;
if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42()))
continue;
// to prevent crashes because you are booking histos for single b904 chamber
if (useB904ME234s2_ or useB904ME21_)
type = 0;
for (auto alct = range.first; alct != range.second; alct++) {
if (alct->isValid()) {
chamberHistos[type]["alct_quality_emul"]->Fill(alct->getQuality());
Expand All @@ -148,10 +181,18 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {

for (auto it = dataCLCTs->begin(); it != dataCLCTs->end(); it++) {
auto range = dataCLCTs->get((*it).first);
const int type = ((*it).first).iChamberType() - 2;
const CSCDetId& detid((*it).first);
int type = ((*it).first).iChamberType() - 2;
// ignore non-ME1/1 chambers when using B904 test-stand data
if (B904Setup_ and !((*it).first).isME11())
if (useB904ME11_ and !(detid.isME11()))
continue;
if (useB904ME21_ and !(detid.isME21()))
continue;
if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42()))
continue;
// to prevent crashes because you are booking histos for single b904 chamber
if (useB904ME234s2_ or useB904ME21_)
type = 0;
for (auto clct = range.first; clct != range.second; clct++) {
if (clct->isValid()) {
if (preTriggerAnalysis_) {
Expand All @@ -167,7 +208,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
chamberHistos[type]["clct_eighthstrip_data"]->Fill(clct->getKeyStrip(8));
chamberHistos[type]["clct_slope_data"]->Fill(clct->getSlope());
chamberHistos[type]["clct_compcode_data"]->Fill(clct->getCompCode());
if (B904Setup_) {
if (useB904_) {
chamberHistos[type]["clct_quartstripbit_data"]->Fill(clct->getQuartStripBit());
chamberHistos[type]["clct_eighthstripbit_data"]->Fill(clct->getEighthStripBit());
}
Expand All @@ -178,10 +219,18 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {

for (auto it = emulCLCTs->begin(); it != emulCLCTs->end(); it++) {
auto range = emulCLCTs->get((*it).first);
const int type = ((*it).first).iChamberType() - 2;
const CSCDetId& detid((*it).first);
int type = ((*it).first).iChamberType() - 2;
// ignore non-ME1/1 chambers when using B904 test-stand data
if (B904Setup_ and !((*it).first).isME11())
if (useB904ME11_ and !(detid.isME11()))
continue;
if (useB904ME21_ and !(detid.isME21()))
continue;
if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42()))
continue;
// to prevent crashes because you are booking histos for single b904 chamber
if (useB904ME234s2_ or useB904ME21_)
type = 0;
// remove the duplicate CLCTs
// these are CLCTs that have the same properties as CLCTs found
// before by the emulator, except for the BX, which is off by +1
Expand All @@ -205,7 +254,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
chamberHistos[type]["clct_eighthstrip_emul"]->Fill(clct.getKeyStrip(8));
chamberHistos[type]["clct_slope_emul"]->Fill(clct.getSlope());
chamberHistos[type]["clct_compcode_emul"]->Fill(clct.getCompCode());
if (B904Setup_) {
if (useB904_) {
chamberHistos[type]["clct_quartstripbit_emul"]->Fill(clct.getQuartStripBit());
chamberHistos[type]["clct_eighthstripbit_emul"]->Fill(clct.getEighthStripBit());
}
Expand Down Expand Up @@ -234,10 +283,18 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {

for (auto it = dataLCTs->begin(); it != dataLCTs->end(); it++) {
auto range = dataLCTs->get((*it).first);
const int type = ((*it).first).iChamberType() - 2;
const CSCDetId& detid((*it).first);
int type = ((*it).first).iChamberType() - 2;
// ignore non-ME1/1 chambers when using B904 test-stand data
if (B904Setup_ and !((*it).first).isME11())
if (useB904ME11_ and !(detid.isME11()))
continue;
if (useB904ME21_ and !(detid.isME21()))
continue;
if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42()))
continue;
// to prevent crashes because you are booking histos for single b904 chamber
if (useB904ME234s2_ or useB904ME21_)
type = 0;
for (auto lct = range.first; lct != range.second; lct++) {
if (lct->isValid()) {
chamberHistos[type]["lct_pattern_data"]->Fill(lct->getPattern());
Expand All @@ -250,7 +307,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
chamberHistos[type]["lct_slope_data"]->Fill(lct->getSlope());
chamberHistos[type]["lct_quartstrip_data"]->Fill(lct->getStrip(4));
chamberHistos[type]["lct_eighthstrip_data"]->Fill(lct->getStrip(8));
if (B904Setup_) {
if (useB904_) {
chamberHistos[type]["lct_quartstripbit_data"]->Fill(lct->getQuartStripBit());
chamberHistos[type]["lct_eighthstripbit_data"]->Fill(lct->getEighthStripBit());
}
Expand All @@ -261,11 +318,18 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {

for (auto it = emulLCTs->begin(); it != emulLCTs->end(); it++) {
auto range = emulLCTs->get((*it).first);
const int type = ((*it).first).iChamberType() - 2;
const CSCDetId& detid((*it).first);
int type = ((*it).first).iChamberType() - 2;
// ignore non-ME1/1 chambers when using B904 test-stand data
if (B904Setup_ and !((*it).first).isME11())
if (useB904ME11_ and !(detid.isME11()))
continue;

if (useB904ME21_ and !(detid.isME21()))
continue;
if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42()))
continue;
// to prevent crashes because you are booking histos for single b904 chamber
if (useB904ME234s2_ or useB904ME21_)
type = 0;
// remove the duplicate LCTs
// these are LCTs that have the same properties as LCTs found
// before by the emulator, except for the BX, which is off by +1
Expand All @@ -287,7 +351,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
chamberHistos[type]["lct_slope_emul"]->Fill(lct.getSlope());
chamberHistos[type]["lct_quartstrip_emul"]->Fill(lct.getStrip(4));
chamberHistos[type]["lct_eighthstrip_emul"]->Fill(lct.getStrip(8));
if (B904Setup_) {
if (useB904_) {
chamberHistos[type]["lct_quartstripbit_emul"]->Fill(lct.getQuartStripBit());
chamberHistos[type]["lct_eighthstripbit_emul"]->Fill(lct.getEighthStripBit());
}
Expand Down
5 changes: 4 additions & 1 deletion DQM/L1TMonitorClient/interface/L1TdeCSCTPGClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ class L1TdeCSCTPGClient : public DQMEDHarvester {
the Building 904 CSC test-stand. This test-stand is a single
ME1/1 chamber.
*/
bool B904Setup_;
bool useB904_;
bool useB904ME11_;
bool useB904ME21_;
bool useB904ME234s2_;

bool isRun3_;

Expand Down
24 changes: 20 additions & 4 deletions DQM/L1TMonitorClient/src/L1TdeCSCTPGClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ L1TdeCSCTPGClient::L1TdeCSCTPGClient(const edm::ParameterSet &ps)
alctMaxBin_(ps.getParameter<std::vector<double>>("alctMaxBin")),
clctMaxBin_(ps.getParameter<std::vector<double>>("clctMaxBin")),
lctMaxBin_(ps.getParameter<std::vector<double>>("lctMaxBin")),
B904Setup_(ps.getParameter<bool>("B904Setup")),
isRun3_(ps.getParameter<bool>("isRun3")) {}
useB904ME11_(ps.getParameter<bool>("useB904ME11")),
useB904ME21_(ps.getParameter<bool>("useB904ME21")),
useB904ME234s2_(ps.getParameter<bool>("useB904ME234s2")),
isRun3_(ps.getParameter<bool>("isRun3")) {
useB904_ = useB904ME11_ or useB904ME21_ or useB904ME234s2_;
}

L1TdeCSCTPGClient::~L1TdeCSCTPGClient() {}

Expand All @@ -55,9 +59,21 @@ void L1TdeCSCTPGClient::book(DQMStore::IBooker &iBooker) {
lctVars_.resize(5);
}

// remove the non-ME1/1 chambers from the list when B904Setup is set to true
if (B904Setup_) {
// remove the non-ME1/1 chambers from the list when useB904ME11 is set to true
if (useB904ME11_) {
chambers_.resize(1);
}
// similar for ME2/1
else if (useB904ME21_) {
auto temp = chambers_[3];
chambers_.resize(1);
chambers_[0] = temp;
}
// similar for ME4/2
else if (useB904ME234s2_) {
auto temp = chambers_.back();
chambers_.resize(1);
chambers_[0] = temp;
}
// do not analyze the 1/4-strip bit, 1/8-strip bit
else {
Expand Down
4 changes: 2 additions & 2 deletions IORawData/CSCCommissioning/src/CSCFileReader.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef CSCFileReader_h
#define CSCFileReader_h

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "DataFormats/Provenance/interface/EventID.h"
Expand All @@ -15,7 +15,7 @@
#include "FileReaderDDU.h"
#include "FileReaderDCC.h"

class CSCFileReader : public edm::EDProducer {
class CSCFileReader : public edm::stream::EDProducer<> {
private:
std::vector<std::string> fileNames[40];
std::vector<std::string>::const_iterator currentFile[40];
Expand Down
38 changes: 31 additions & 7 deletions IORawData/CSCCommissioning/test/readFile_b904_Run3.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
options.register ("firstRun", 341761, VarParsing.multiplicity.singleton, VarParsing.varType.int)
options.register ("inputFilesGEM", "", VarParsing.multiplicity.singleton, VarParsing.varType.string)
options.register ("readGEMData", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
options.register ("useB904ME11", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
options.register ("useB904ME21", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
options.register ("useB904ME234s2", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
options.maxEvents = 10000
options.parseArguments()

Expand Down Expand Up @@ -50,18 +53,39 @@
)
)

# Note by Sven Dildick: I had to change the CSC producer module name to process.rawDataCollectorCSC so
# that the name would not conflict with the GEM source.

# For B904 setup ME11 chamber, which corresponds to ME+1/1/02 in the production system mapping
# changing to FED837 and RUI16 could let to pass data without disabling mapping consistency check unpacking flags
if options.useB904ME11:
FEDRUI = cms.PSet(
FED846 = cms.untracked.vstring('RUI01'),
RUI01 = cms.untracked.vstring(options.inputFiles[0])
)
# For B904 setup ME21 chamber, which corresponds to ME+2/1/03 VMECrate13 / DMBSlot2 RUI17 / FED838 in the production system mapping
elif options.useB904ME21:
FEDRUI = cms.PSet(
FED838 = cms.untracked.vstring('RUI16'),
RUI17 = cms.untracked.vstring(options.inputFiles[0])
)
# Please note that after passing mapping check this chamber still would be recognized as production chamber
# ME+2/2/03, which is OK, because this is the same chamber type as ME42 hardware-wise.
elif options.useB904ME234s2:
FEDRUI = cms.PSet(
FED839 = cms.untracked.vstring('RUI18'),
RUI18 = cms.untracked.vstring(options.inputFiles[0])
)
## default case
else:
FEDRUI = cms.PSet(
FED837 = cms.untracked.vstring('RUI16'),
RUI16 = cms.untracked.vstring('/afs/cern.ch/user/b/barvic/public/cscgem_tests/csc_00000001_EmuRUI01_Local_000_210519_162820_UTC.raw')
)

# Note by Sven Dildick: I had to change the CSC producer module name to process.rawDataCollectorCSC so
# that the name would not conflict with the GEM source.
process.rawDataCollectorCSC = cms.EDProducer(
'CSCFileReader',
FEDRUI,
firstEvent = cms.untracked.int32(0),
FED846 = cms.untracked.vstring('RUI01'),
RUI01 = cms.untracked.vstring(options.inputFiles[0])
# FED837 = cms.untracked.vstring('RUI16'),
# RUI16 = cms.untracked.vstring('/afs/cern.ch/user/b/barvic/public/cscgem_tests/csc_00000001_EmuRUI01_Local_000_210519_162820_UTC.raw')
)

process.FEVT = cms.OutputModule(
Expand Down
Loading