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

CMSSW74x update CSCTF ME minus LUT configuration #9562

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
2 changes: 1 addition & 1 deletion DQM/L1TMonitor/interface/L1TCSCTF.h
Expand Up @@ -177,7 +177,7 @@ class L1TCSCTF : public thread_unsafe::DQMEDAnalyzer {
edm::InputTag gmtProducer, lctProducer, trackProducer, statusProducer, mbProducer;
bool gangedME11a_; // needed this be set false for Run2

CSCSectorReceiverLUT *srLUTs_[5];
CSCSectorReceiverLUT* srLUTs_[5][2][6];

const L1MuTriggerScales *ts;
const L1MuTriggerPtScale *tpts;
Expand Down
2 changes: 1 addition & 1 deletion DQM/L1TMonitor/python/L1TCSCTF_cfi.py
Expand Up @@ -7,7 +7,7 @@
outputFile = cms.untracked.string(''),
lctProducer = cms.InputTag("csctfDigis"),
verbose = cms.untracked.bool(False),
gangedME11a = cms.untracked.bool(True),
gangedME11a = cms.untracked.bool(True), ## Run2: False; Run1: True
trackProducer = cms.InputTag("csctfDigis"),
mbProducer = cms.InputTag("csctfDigis:DT"),
DQMStore = cms.untracked.bool(True),
Expand Down
72 changes: 51 additions & 21 deletions DQM/L1TMonitor/src/L1TCSCTF.cc
Expand Up @@ -50,24 +50,46 @@ L1TCSCTF::L1TCSCTF(const ParameterSet& ps)

gangedME11a_ = ps.getUntrackedParameter<bool>("gangedME11a", false);

// instantiate standard on-fly SR LUTs from CSC TF emulator package
bzero(srLUTs_,sizeof(srLUTs_));
int endcap=1, sector=1; // assume SR LUTs are all same for every sector in either of endcaps
bool TMB07=true; // specific TMB firmware
// Create a dummy pset for SR LUTs
edm::ParameterSet srLUTset;
srLUTset.addUntrackedParameter<bool>("ReadLUTs", false);
srLUTset.addUntrackedParameter<bool>("Binary", false);
srLUTset.addUntrackedParameter<std::string>("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);
// instantiate standard on-fly SR LUTs from CSC TF emulator package
bzero(srLUTs_ , sizeof(srLUTs_));
//int sector=1; // assume SR LUTs are all same for every sector
bool TMB07=true; // specific TMB firmware
// Create a pset for SR/PT LUTs: if you do not change the value in the
// configuration file, it will load the default minitLUTs
edm::ParameterSet srLUTset;
srLUTset.addUntrackedParameter<bool>("ReadLUTs", false);
srLUTset.addUntrackedParameter<bool>("Binary", false);
srLUTset.addUntrackedParameter<std::string>("LUTPath", "./");

// positive endcap
int endcap = 1;
for(int sector=0; sector<6; sector++) {
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++][1][sector] = new CSCSectorReceiverLUT(endcap,sector+1,subSector+1,
station, srLUTset, TMB07);
else
srLUTs_[fpga++][1][sector] = new CSCSectorReceiverLUT(endcap, sector+1, 0,
station, srLUTset, TMB07);
}
}

// negative endcap
endcap = 2;
for(int sector=0; sector<6; sector++) {
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++][0][sector] = new CSCSectorReceiverLUT(endcap,sector+1,subSector+1,
station, srLUTset, TMB07);
else
srLUTs_[fpga++][0][sector] = new CSCSectorReceiverLUT(endcap, sector+1, 0,
station, srLUTset, TMB07);
}
}


//set Token(-s)
edm::InputTag statusTag_(statusProducer.label(),statusProducer.instance());
edm::InputTag corrlctsTag_(lctProducer.label(),lctProducer.instance());
Expand All @@ -86,8 +108,11 @@ L1TCSCTF::L1TCSCTF(const ParameterSet& ps)
L1TCSCTF::~L1TCSCTF()
{

for(int i=0; i<5; i++)
delete srLUTs_[i]; //free the array of pointers
for(unsigned int j=0; j<2; j++)
for(unsigned int i=0; i<5; i++)
for(unsigned int s=0; s<6; s++)
delete srLUTs_[i][j][s]; //free the array of pointers

}

void L1TCSCTF::dqmBeginRun(const edm::Run& r, const edm::EventSetup& c){
Expand Down Expand Up @@ -806,23 +831,28 @@ void L1TCSCTF::analyze(const Event& e, const EventSetup& c)
edm::LogError("L1CSCTF: CSC TP are out of range: ")<<" endcap: "<<(endcap+1)<<" station: "<<(station+1) <<" sector: "<<(sector+1)<<" subSector: "<<subSector<<" fpga: "<<fpga<<" cscId: "<<(cscId+1);
continue;
}

int EndCapLUT=1;
//if(endcap==0) EndCapLUT=1; // ME+
if(endcap==1) EndCapLUT=0; // ME-

lclphidat lclPhi;
try {
lclPhi = srLUTs_[fpga]->localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend(), gangedME11a_);
lclPhi = srLUTs_[fpga][EndCapLUT][sector]->localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend(), gangedME11a_);
} catch(cms::Exception &) {
bzero(&lclPhi,sizeof(lclPhi));
}

gblphidat gblPhi;
try {
gblPhi = srLUTs_[fpga]->globalPhiME(lclPhi.phi_local, lct->getKeyWG(), cscId+1, gangedME11a_);
gblPhi = srLUTs_[fpga][EndCapLUT][sector]->globalPhiME(lclPhi.phi_local, lct->getKeyWG(), cscId+1, gangedME11a_);
} catch(cms::Exception &) {
bzero(&gblPhi,sizeof(gblPhi));
}

gbletadat gblEta;
try {
gblEta = srLUTs_[fpga]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1, gangedME11a_);
gblEta = srLUTs_[fpga][EndCapLUT][sector]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1, gangedME11a_);
} catch(cms::Exception &) {
bzero(&gblEta,sizeof(gblEta));
}
Expand Down
81 changes: 42 additions & 39 deletions DQM/L1TMonitor/test/l1t_dqm_sourceclient-file_cfg.py
Expand Up @@ -20,12 +20,12 @@

# for 'file' choose also the type of the global tag and (edit) the actual global tag
if l1DqmEnv == 'file' :

globalTagType = 'HLT'
#globalTagType = 'P'
#globalTagType = 'E'
#globalTagType = 'R'

if globalTagType == 'HLT' :
#globalTagValue = 'GR_H_V26'
globalTagValue = 'MCRUN2_74_V5'
Expand All @@ -45,8 +45,8 @@

# check that a valid choice for environment exists

if not ((l1DqmEnv == 'live') or l1DqmEnv == 'playback' or l1DqmEnv == 'file-P5' or l1DqmEnv == 'file' ) :
print 'No valid input source was chosen. Your value for l1DqmEnv input parameter is:'
if not ((l1DqmEnv == 'live') or l1DqmEnv == 'playback' or l1DqmEnv == 'file-P5' or l1DqmEnv == 'file' ) :
print 'No valid input source was chosen. Your value for l1DqmEnv input parameter is:'
print 'l1DqmEnv = ', l1DqmEnv
print 'Available options: "live", "playback", "file-P5", "file" '
sys.exit()
Expand All @@ -62,16 +62,16 @@
)
process.EventStreamHttpReader.consumerName = 'L1T DQM Consumer'
process.EventStreamHttpReader.maxEventRequestRate = cms.untracked.double(25.0)

elif l1DqmEnv == 'playback' :
print 'FIXME'
sys.exit()
else :

else :
# running on a file
process.load("DQM.L1TMonitor.inputsource_file_cfi")


#----------------------------
# DQM Environment
#
Expand All @@ -93,22 +93,22 @@

elif l1DqmEnv == 'playback' :
print 'FIXME'

elif l1DqmEnv == 'file-P5' :
process.load("DQM.Integration.test.FrontierCondition_GT_cfi")
es_prefer_GlobalTag = cms.ESPrefer('GlobalTag')
process.GlobalTag.RefreshEachRun = cms.untracked.bool(True)
else :

else :
# running on a file, on lxplus (not on .cms)
process.load("DQM.L1TMonitor.environment_file_cff")

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')

if globalTagType == 'HLT' :
process.GlobalTag.connect = 'frontier://FrontierProd/CMS_COND_31X_GLOBALTAG'
process.GlobalTag.pfnPrefix = cms.untracked.string('frontier://FrontierProd/')
process.GlobalTag.connect = 'frontier://FrontierProd/CMS_COND_31X_GLOBALTAG'
process.GlobalTag.pfnPrefix = cms.untracked.string('frontier://FrontierProd/')

process.GlobalTag.globaltag = globalTagValue+'::All'
es_prefer_GlobalTag = cms.ESPrefer('GlobalTag')

Expand All @@ -120,34 +120,34 @@
# sequences needed for L1 trigger DQM
#

# standard unpacking sequence
process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
# standard unpacking sequence
process.load("Configuration.StandardSequences.RawToDigi_Data_cff")

# L1 Trigger sequences
# L1 Trigger sequences

# l1tMonitor and l1tMonitorEndPathSeq
process.load("DQM.L1TMonitor.L1TMonitor_cff")
process.load("DQM.L1TMonitor.L1TMonitor_cff")

# L1 trigger synchronization module - it uses also HltHighLevel filter
process.load("DQM.L1TMonitor.L1TSync_cff")
process.load("DQM.L1TMonitor.L1TSync_cff")

# l1tMonitorClient and l1tMonitorClientEndPathSeq
process.load("DQM.L1TMonitorClient.L1TMonitorClient_cff")
process.load("DQM.L1TMonitorClient.L1TMonitorClient_cff")

# change the DB connections when not at P5 - works on lxplus only...
if ( l1DqmEnv == 'file' ) :
if ( l1DqmEnv == 'file' ) :
process.l1tSync.oracleDB = cms.string("oracle://cms_orcon_adg/CMS_COND_31X_L1T")
process.l1tSync.pathCondDB = cms.string("/afs/cern.ch/cms/DB/conddb/ADG")
#
process.l1tRate.oracleDB = cms.string("oracle://cms_orcon_adg/CMS_COND_31X_L1T")
process.l1tRate.pathCondDB = cms.string("/afs/cern.ch/cms/DB/conddb/ADG")


#-------------------------------------
# paths & schedule for L1 Trigger DQM
#

# TODO define a L1 trigger L1TriggerRawToDigi in the standard sequence
# TODO define a L1 trigger L1TriggerRawToDigi in the standard sequence
# to avoid all these remove
process.rawToDigiPath = cms.Path(process.RawToDigi)
#
Expand Down Expand Up @@ -181,9 +181,9 @@
1.20, 1.21, 1.22, 1.23, 1.24, 1.25, 1.26, 1.27
)
else :
process.l1tMonitorPath = cms.Path(process.l1tMonitorOnline)
process.l1tMonitorPath = cms.Path(process.l1tMonitorOnline)
process.l1tMonitorClientPath = cms.Path(process.l1tMonitorClient)

# separate L1TSync path due to the use of the HltHighLevel filter
process.l1tSyncPath = cms.Path(process.l1tSyncHltFilter+process.l1tSync)

Expand Down Expand Up @@ -212,7 +212,7 @@

#---------------------------------------------

# examples for quick fixes in case of troubles
# examples for quick fixes in case of troubles
# please do not modify the commented lines
#

Expand All @@ -232,13 +232,13 @@

#process.l1tMonitorOnline.remove(process.l1Dttf)

#process.l1tMonitorOnline.remove(process.l1tCsctf)
#process.l1tMonitorOnline.remove(process.l1tCsctf)

#process.l1tMonitorOnline.remove(process.l1tRpctf)

#process.l1tMonitorOnline.remove(process.l1tGmt)

#process.l1tMonitorOnline.remove(process.l1tGt)
#process.l1tMonitorOnline.remove(process.l1tGt)

#process.l1tMonitorOnline.remove(process.l1ExtraDqmSeq)

Expand All @@ -258,7 +258,7 @@
process.schedule.remove(process.l1tSyncPath)


#
#
# un-comment next lines in case you use the file for private tests using data from the L1T server
#
#process.dqmSaver.dirName = '.'
Expand All @@ -270,32 +270,32 @@
process.load('FWCore.MessageService.MessageLogger_cfi')
process.MessageLogger.debugModules = ['l1tGt']
process.MessageLogger.categories.append('L1TGT')
process.MessageLogger.destinations = ['L1TDQM_errors',
'L1TDQM_warnings',
'L1TDQM_info',
process.MessageLogger.destinations = ['L1TDQM_errors',
'L1TDQM_warnings',
'L1TDQM_info',
'L1TDQM_debug'
]

process.MessageLogger.L1TDQM_errors = cms.untracked.PSet(
process.MessageLogger.L1TDQM_errors = cms.untracked.PSet(
threshold = cms.untracked.string('ERROR'),
ERROR = cms.untracked.PSet( limit = cms.untracked.int32(-1) )
)

process.MessageLogger.L1TDQM_warnings = cms.untracked.PSet(
process.MessageLogger.L1TDQM_warnings = cms.untracked.PSet(
threshold = cms.untracked.string('WARNING'),
WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) )
)

process.MessageLogger.L1TDQM_info = cms.untracked.PSet(
process.MessageLogger.L1TDQM_info = cms.untracked.PSet(
threshold = cms.untracked.string('INFO'),
INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
L1TGT = cms.untracked.PSet( limit = cms.untracked.int32(-1) )
)

process.MessageLogger.L1TDQM_debug = cms.untracked.PSet(
process.MessageLogger.L1TDQM_debug = cms.untracked.PSet(
threshold = cms.untracked.string('DEBUG'),
DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
Expand Down Expand Up @@ -325,7 +325,7 @@
process.siStripDigis.ProductLabel = cms.InputTag("rawDataCollector")
process.bxTiming.FedSource = cms.untracked.InputTag("rawDataCollector")
process.l1s.fedRawData = cms.InputTag("rawDataCollector")

if (process.runType.getRunType() == process.runType.hi_run):
process.castorDigis.InputLabel = cms.InputTag("rawDataRepacker")
process.csctfDigis.producer = cms.InputTag("rawDataRepacker")
Expand All @@ -346,3 +346,6 @@
process.l1s.fedRawData = cms.InputTag("rawDataRepacker")


from SLHCUpgradeSimulations.Configuration.postLS1Customs import customise_DQM
#call to customisation function customise_DQM imported from SLHCUpgradeSimulations.Configuration.postLS1Customs
process = customise_DQM(process)