Skip to content
Open
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
33 changes: 17 additions & 16 deletions L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2Prod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ class DTTrigPhase2Prod : public edm::stream::EDProducer<> {
bool activateBuffer_;
int superCellhalfspacewidth_;
float superCelltimewidth_;
std::vector<DTDigiCollection*> distribDigis(std::queue<std::pair<DTLayerId, DTDigi>>& inQ);
std::vector<DTDigiCollection> distribDigis(std::queue<std::pair<DTLayerId, DTDigi>>& inQ);
void processDigi(std::queue<std::pair<DTLayerId, DTDigi>>& inQ,
std::vector<std::queue<std::pair<DTLayerId, DTDigi>>*>& vec);
std::vector<std::queue<std::pair<DTLayerId, DTDigi>>>& vec);

// RPC
std::unique_ptr<RPCIntegrator> rpc_integrator_;
Expand Down Expand Up @@ -375,14 +375,14 @@ void DTTrigPhase2Prod::produce(Event& iEvent, const EventSetup& iEventSetup) {
tmpvec.clear();

// Distribute the digis from the queue into supercells
std::vector<DTDigiCollection*> superCells;
std::vector<DTDigiCollection> superCells;
superCells = distribDigis(timequeue);

// Process each supercell & collect the resulting muonpaths (as the muonpaths std::vector is only enlarged each time
// the groupings access it, it's not needed to "collect" the final products).

while (!superCells.empty()) {
grouping_obj_->run(iEvent, iEventSetup, *(superCells.back()), muonpaths[chid.rawId()]);
grouping_obj_->run(iEvent, iEventSetup, superCells.back(), muonpaths[chid.rawId()]);
superCells.pop_back();
}
} else {
Expand Down Expand Up @@ -1247,35 +1247,36 @@ int DTTrigPhase2Prod::assignQualityOrder(const metaPrimitive& mP) const {
return qmap_.find(mP.quality)->second;
}

std::vector<DTDigiCollection*> DTTrigPhase2Prod::distribDigis(std::queue<std::pair<DTLayerId, DTDigi>>& inQ) {
std::vector<std::queue<std::pair<DTLayerId, DTDigi>>*> tmpVector;
std::vector<DTDigiCollection> DTTrigPhase2Prod::distribDigis(std::queue<std::pair<DTLayerId, DTDigi>>& inQ) {
// Use value-based containers to avoid returning pointers to local variables.
std::vector<std::queue<std::pair<DTLayerId, DTDigi>>> tmpVector;
tmpVector.clear();
std::vector<DTDigiCollection*> collVector;
std::vector<DTDigiCollection> collVector;
collVector.clear();
while (!inQ.empty()) {
processDigi(inQ, tmpVector);
}
for (auto& sQ : tmpVector) {
DTDigiCollection tmpColl;
while (!sQ->empty()) {
tmpColl.insertDigi((sQ->front().first), (sQ->front().second));
sQ->pop();
while (!sQ.empty()) {
tmpColl.insertDigi((sQ.front().first), (sQ.front().second));
sQ.pop();
}
collVector.push_back(&tmpColl);
collVector.push_back(std::move(tmpColl));
}
return collVector;
}

void DTTrigPhase2Prod::processDigi(std::queue<std::pair<DTLayerId, DTDigi>>& inQ,
std::vector<std::queue<std::pair<DTLayerId, DTDigi>>*>& vec) {
std::vector<std::queue<std::pair<DTLayerId, DTDigi>>>& vec) {
bool classified = false;
if (!vec.empty()) {
for (auto& sC : vec) { // Conditions for entering a super cell.
if ((sC->front().second.time() + superCelltimewidth_) > inQ.front().second.time()) {
if ((sC.front().second.time() + superCelltimewidth_) > inQ.front().second.time()) {
// Time requirement
if (std::abs(sC->front().second.wire() - inQ.front().second.wire()) <= superCellhalfspacewidth_) {
if (std::abs(sC.front().second.wire() - inQ.front().second.wire()) <= superCellhalfspacewidth_) {
// Spatial requirement
sC->push(std::move(inQ.front()));
sC.push(std::move(inQ.front()));
classified = true;
}
}
Expand All @@ -1293,7 +1294,7 @@ void DTTrigPhase2Prod::processDigi(std::queue<std::pair<DTLayerId, DTDigi>>& inQ
newQueue.push(tmpPair);
inQ.pop();

vec.push_back(&newQueue);
vec.push_back(std::move(newQueue));
}

void DTTrigPhase2Prod::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
Expand Down
1 change: 0 additions & 1 deletion L1Trigger/L1TMuonOverlapPhase1/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@
<use name="roofit"/>
<use name="root"/>
<use name="xerces-c"/>
<use name="Utilities/Xerces"/>
117 changes: 0 additions & 117 deletions L1Trigger/L1TMuonOverlapPhase1/interface/AngleConverterBase.h

This file was deleted.

3 changes: 1 addition & 2 deletions L1Trigger/L1TMuonOverlapPhase1/interface/MuonStubMakerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "DataFormats/GEMDigi/interface/GEMPadDigiCollection.h"
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
#include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"
#include "DataFormats/MuonDetId/interface/DTChamberId.h"
#include "DataFormats/MuonDetId/interface/RPCDetId.h"
#include "DataFormats/RPCDigi/interface/RPCDigiCollection.h"
Expand Down Expand Up @@ -167,7 +166,7 @@ class RpcDigiToStubsConverter : public DigiToStubsConverterBase {
const RpcClusterization* rpcClusterization;
};

//forward declaration - MuonGeometryTokens is defined and used in the AngleConverterBase
//forward declaration - MuonGeometryTokens is defined and used in the OmtfAngleConverter
struct MuonGeometryTokens;

class MuonStubMakerBase {
Expand Down
37 changes: 24 additions & 13 deletions L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/AlgoMuon.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ class AlgoMuon {
//hardware pt
int getPtConstr() const { return goldenPaternConstr == nullptr ? 0 : goldenPaternConstr->key().thePt; }

//hardware upt, in the phase1 the upt scale unit is 1 GeV, while for the pt the unit is 0.5GeV
int getPtUnconstr() const {
return goldenPaternUnconstr == nullptr ? 0 : (goldenPaternUnconstr->key().thePt - 1) / 2 + 1;
}
//hardware upt, in the pattens scale, not in the GMT scale
int getPtUnconstr() const { return goldenPaternUnconstr == nullptr ? 0 : goldenPaternUnconstr->key().thePt; }

int getChargeConstr() const { return goldenPaternConstr == nullptr ? -1 : goldenPaternConstr->key().theCharge; }

Expand Down Expand Up @@ -125,21 +123,29 @@ class AlgoMuon {
this->goldenPaternUnconstr = goldenPaternUnconstr;
}

int getQuality() const { return quality; }

void setQuality(int quality = 0) { this->quality = quality; }

int getChargeNNConstr() const { return chargeNNConstr; }

void setChargeNNConstr(int chargeNn = 0) { chargeNNConstr = chargeNn; }

int getPtNNConstr() const { return ptNNConstr; }
float getPtNNConstr() const { return ptNNConstr; }

void setPtNNConstr(float ptNn = 0) { ptNNConstr = ptNn; }

void setPtNNConstr(int ptNn = 0) { ptNNConstr = ptNn; }
float getPtNNUnconstr() const { return ptNNUnconstr; }

int getChargeNNUnconstr() const { return chargeNNUnconstr; }
void setPtNNUnconstr(float ptNnUnconstr) { ptNNUnconstr = ptNnUnconstr; }

void setChargeNNUnconstr(int chargeNnUnconstr = 0) { chargeNNUnconstr = chargeNnUnconstr; }
int getDxyNn() const { return dxyNN; }

int getPtNNUnconstr() const { return ptNNUnconstr; }
void setDxyNn(int dxyNn = 0) { dxyNN = dxyNn; }

void setPtNNUnconstr(int ptNnUnconstr = 0) { ptNNUnconstr = ptNnUnconstr; }
const std::vector<double>& getNnOutputs() const { return nnOutputs; }

void setNnOutputs(const std::vector<double>& nnOutputs) { this->nnOutputs = nnOutputs; }

private:
///FIXME maybe the gpResult cannot be a reference or pointer, ad not a copy
Expand All @@ -165,11 +171,16 @@ class AlgoMuon {

std::vector<std::shared_ptr<AlgoMuon>> killedMuons;

int ptNNConstr = 0;
int quality = 0;

float ptNNConstr = 0;
int chargeNNConstr = 0;

int ptNNUnconstr = 0;
int chargeNNUnconstr = 0;
float ptNNUnconstr = 0;

int dxyNN = 0;

std::vector<double> nnOutputs;
};

typedef std::shared_ptr<AlgoMuon> AlgoMuonPtr;
Expand Down
Loading