Skip to content

Commit

Permalink
Merge pull request #9730 from mcepeda/fedVectorHFUpgradeFix
Browse files Browse the repository at this point in the history
Fed vector hf upgrade fix
  • Loading branch information
cmsbuild committed Jul 7, 2015
2 parents 2009029 + 30780c9 commit ac37365
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 52 deletions.
2 changes: 1 addition & 1 deletion DQM/L1TMonitor/interface/L1TdeRCT.h
Expand Up @@ -249,7 +249,7 @@ class L1TdeRCT : public DQMEDAnalyzer {


//begin fed vector information
static const int crateFED[90];
static const int crateFED[108];
MonitorElement *fedVectorMonitorRUN_;
MonitorElement *fedVectorMonitorLS_;
///////////////////////////////
Expand Down
46 changes: 23 additions & 23 deletions DQM/L1TMonitor/src/L1TdeRCT.cc
Expand Up @@ -73,25 +73,25 @@ const float CHNLMIN = -0.5;
const float CHNLMAX = 395.5;


const int L1TdeRCT::crateFED[90]=
{613, 614, 603, 702, 1118,
611, 612, 602, 700, 1118,
627, 610, 601,716, 1122,
625, 626, 609, 714, 1122,
623, 624, 608, 712, 1122,
621, 622, 607, 710, 1120,
619, 620, 606, 708, 1120,
617, 618, 605, 706, 1120,
615, 616, 604, 704, 1118,
631, 632, 648, 703, 1118,
629, 630, 647, 701, 1118,
645, 628, 646, 717, 1122,
643, 644, 654, 715, 1122,
641, 642, 653, 713, 1122,
639, 640, 652, 711, 1120,
637, 638, 651, 709, 1120,
635, 636, 650, 707, 1120,
633, 634, 649, 705, 1118
const int L1TdeRCT::crateFED[108]=
{613, 614, 603, 702, 718,1118,
611, 612, 602, 700, 718, 1118,
627, 610, 601,716, 722, 1122,
625, 626, 609, 714, 722, 1122,
623, 624, 608, 712, 722, 1122,
621, 622, 607, 710, 720, 1120,
619, 620, 606, 708, 720, 1120,
617, 618, 605, 706, 720, 1120,
615, 616, 604, 704, 718, 1118,
631, 632, 648, 703, 719, 1118,
629, 630, 647, 701, 719, 1118,
645, 628, 646, 717, 723, 1122,
643, 644, 654, 715, 723, 1122,
641, 642, 653, 713, 723, 1122,
639, 640, 652, 711, 721, 1120,
637, 638, 651, 709, 721, 1120,
635, 636, 650, 707, 721, 1120,
633, 634, 649, 705, 719, 1118
};


Expand Down Expand Up @@ -1801,10 +1801,10 @@ void L1TdeRCT::bookHistograms(DQMStore::IBooker &ibooker, const edm::Run& run ,


ibooker.setCurrentFolder(histFolder_+"/DBData");
fedVectorMonitorRUN_ = ibooker.book2D("rctFedVectorMonitorRUN", "FED Vector Monitor Per Run",90,0,90,2,0,2);
fedVectorMonitorLS_ = ibooker.book2D("rctFedVectorMonitorLS", "FED Vector Monitor Per LS",90,0,90,2,0,2);
fedVectorMonitorRUN_ = ibooker.book2D("rctFedVectorMonitorRUN", "FED Vector Monitor Per Run",108,0,108,2,0,2);
fedVectorMonitorLS_ = ibooker.book2D("rctFedVectorMonitorLS", "FED Vector Monitor Per LS",108,0,108,2,0,2);

for(unsigned int i=0;i<90;++i) {
for(unsigned int i=0;i<108;++i) {
char fed[10];
sprintf(fed,"%d",crateFED[i]);
fedVectorMonitorRUN_->getTH2F()->GetXaxis()->SetBinLabel(i+1,fed);
Expand Down Expand Up @@ -1919,7 +1919,7 @@ void L1TdeRCT::readFEDVector(MonitorElement* histogram,const edm::EventSetup& es
caloFeds.push_back(fedNum);
}

for(unsigned int i=0;i<90;++i) {
for(unsigned int i=0;i<108;++i) {
std::vector<int>::iterator fv = std::find(caloFeds.begin(),caloFeds.end(),crateFED[i]);
if(fv!=caloFeds.end()) {
histogram->setBinContent(i+1,2,1);
Expand Down
6 changes: 3 additions & 3 deletions L1Trigger/RegionalCaloTrigger/interface/L1RCTProducer.h
Expand Up @@ -88,12 +88,12 @@ class L1RCTProducer : public edm::EDProducer
eeFed,
hbheFed,
hfFed,
c_max = hfFed
hfFedUp,
c_max = hfFedUp
};

static const int crateFED[18][6];


static const int crateFED[18][5];
static const int minBarrel = 1;
static const int maxBarrel = 17;
static const int minEndcap = 17;
Expand Down
70 changes: 45 additions & 25 deletions L1Trigger/RegionalCaloTrigger/plugins/L1RCTProducer.cc
Expand Up @@ -13,27 +13,25 @@ using std::vector;

using std::cout;
using std::endl;
const int L1RCTProducer::crateFED[18][5]=
{{613, 614, 603, 702, 1118},
{611, 612, 602, 700, 1118},
{627, 610, 601, 716, 1122},
{625, 626, 609, 714, 1122},
{623, 624, 608, 712, 1122},
{621, 622, 607, 710, 1120},
{619, 620, 606, 708, 1120},
{617, 618, 605, 706, 1120},
{615, 616, 604, 704, 1118},
{631, 632, 648, 703, 1118},
{629, 630, 647, 701, 1118},
{645, 628, 646, 717, 1122},
{643, 644, 654, 715, 1122},
{641, 642, 653, 713, 1122},
{639, 640, 652, 711, 1120},
{637, 638, 651, 709, 1120},
{635, 636, 650, 707, 1120},
{633, 634, 649, 705, 1118}};


const int L1RCTProducer::crateFED[18][6]=
{{613, 614, 603, 702, 718, 1118},
{611, 612, 602, 700, 718, 1118},
{627, 610, 601, 716, 722, 1122},
{625, 626, 609, 714, 722, 1122},
{623, 624, 608, 712, 722, 1122},
{621, 622, 607, 710, 720, 1120},
{619, 620, 606, 708, 720, 1120},
{617, 618, 605, 706, 720, 1120},
{615, 616, 604, 704, 718, 1118},
{631, 632, 648, 703, 719, 1118},
{629, 630, 647, 701, 719, 1118},
{645, 628, 646, 717, 723, 1122},
{643, 644, 654, 715, 723, 1122},
{641, 642, 653, 713, 723, 1122},
{639, 640, 652, 711, 721, 1120},
{637, 638, 651, 709, 721, 1120},
{635, 636, 650, 707, 721, 1120},
{633, 634, 649, 705, 719, 1118}};

L1RCTProducer::L1RCTProducer(const edm::ParameterSet& conf) :
rctLookupTables(new L1RCTLookupTables),
Expand Down Expand Up @@ -185,14 +183,17 @@ void L1RCTProducer::updateFedVector(const edm::EventSetup& eventSetup, bool getF

// // adding fed mask into channel mask

const std::vector<int> Feds = getFromOmds ? getFedVectorFromOmds(eventSetup) : getFedVectorFromRunInfo(eventSetup); // so can create/initialize/assign const quantity in one line accounting for if statement
const std::vector<int> Feds = getFromOmds ? getFedVectorFromOmds(eventSetup) : getFedVectorFromRunInfo(eventSetup);
// so can create/initialize/assign const quantity in one line accounting for if statement
// wikipedia says this is exactly what it's for: http://en.wikipedia.org/wiki/%3F:#C.2B.2B

// std::cout << "Contents of ";
// std::cout << (getFromOmds ? "OMDS RunInfo" : "standard RunInfo");
// std::cout << " FED vector" << std::endl;
// printFedVector(Feds);

bool useUpgradedHF=false;

std::vector<int> caloFeds; // pare down the feds to the interesting ones
// is this unneccesary?
// Mike B : This will decrease the find speed so better do it
Expand All @@ -201,6 +202,9 @@ void L1RCTProducer::updateFedVector(const edm::EventSetup& eventSetup, bool getF
int fedNum = *cf;
if((fedNum > 600 && fedNum <724) || fedNum==1118 || fedNum == 1120 || fedNum == 1122)
caloFeds.push_back(fedNum);

if(fedNum==1118 || fedNum == 1120 || fedNum == 1122) useUpgradedHF=true;

}

for(int cr = 0; cr < 18; ++cr)
Expand All @@ -210,12 +214,13 @@ void L1RCTProducer::updateFedVector(const edm::EventSetup& eventSetup, bool getF
{
bool fedFound = false;


//Try to find the FED
std::vector<int>::iterator fv = std::find(caloFeds.begin(),caloFeds.end(),crateFED[cr][cs]);
std::vector<int>::iterator fv= std::find(caloFeds.begin(),caloFeds.end(),crateFED[cr][cs]);
if(fv!=caloFeds.end())
fedFound = true;




if(!fedFound) {
int eta_min=0;
int eta_max=0;
Expand Down Expand Up @@ -254,13 +259,28 @@ void L1RCTProducer::updateFedVector(const edm::EventSetup& eventSetup, bool getF
break;

case hfFed:
if(useUpgradedHF) break;

eta_min = minHF;
eta_max = maxHF;

phi_even[0] = true;
phi_even[1] = true;
ecal = false;
break;

case hfFedUp:
if(!useUpgradedHF) break;

eta_min = minHF;
eta_max = maxHF;

phi_even[0] = true;
phi_even[1] = true;
ecal = false;
break;


default:
break;

Expand Down

0 comments on commit ac37365

Please sign in to comment.