Skip to content

Commit

Permalink
Merge pull request #9563 from rjwang/CMSSW_7_5_X_updateCSCTFLUT_MEmin…
Browse files Browse the repository at this point in the history
…us_configuration

update CSCTF LUTs configuration for ME-
  • Loading branch information
cmsbuild committed Jun 18, 2015
2 parents 4149cd3 + 2026cef commit 1566d78
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 22 deletions.
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];

const L1MuTriggerScales *ts;
const L1MuTriggerPtScale *tpts;
Expand Down
67 changes: 46 additions & 21 deletions DQM/L1TMonitor/src/L1TCSCTF.cc
Expand Up @@ -50,24 +50,42 @@ 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 station=1,fpga=0; station<=4 && fpga<5; station++) {
if(station==1)
for(int subSector=0; subSector<2 && fpga<5; subSector++)
srLUTs_[fpga++][1] = new CSCSectorReceiverLUT(endcap,sector,subSector+1,
station, srLUTset, TMB07);
else
srLUTs_[fpga++][1] = new CSCSectorReceiverLUT(endcap, sector, 0,
station, srLUTset, TMB07);
}

// negative endcap
endcap = 2;
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] = new CSCSectorReceiverLUT(endcap,sector,subSector+1,
station, srLUTset, TMB07);
else
srLUTs_[fpga++][0] = new CSCSectorReceiverLUT(endcap, sector, 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 +104,10 @@ 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++)
delete srLUTs_[i][j]; //free the array of pointers

}

void L1TCSCTF::dqmBeginRun(const edm::Run& r, const edm::EventSetup& c){
Expand Down Expand Up @@ -806,23 +826,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]->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]->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]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1, gangedME11a_);
} catch(cms::Exception &) {
bzero(&gblEta,sizeof(gblEta));
}
Expand Down

0 comments on commit 1566d78

Please sign in to comment.