test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
L1TMicroGMTProducer Class Reference

#include <L1Trigger/L1TMuon/src/L1TMicroGMTProducer.cc>

Inheritance diagram for L1TMicroGMTProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1TMicroGMTProducer (const edm::ParameterSet &)
 
 ~L1TMicroGMTProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void addMuonsToCollections (MicroGMTConfiguration::InterMuonList &coll, MicroGMTConfiguration::InterMuonList &interout, std::auto_ptr< MuonBxCollection > &out, int bx) const
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (edm::LuminosityBlock &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run &, edm::EventSetup const &)
 
void calculateRank (MicroGMTConfiguration::InterMuonList &muons) const
 
void convertMuons (edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out, GMTInternalWedges &wedges, int bx) const
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock &, edm::EventSetup const &)
 
virtual void endRun (edm::Run &, edm::EventSetup const &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
void sortMuons (MicroGMTConfiguration::InterMuonList &, unsigned) const
 
void splitAndConvertMuons (edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out_pos, MicroGMTConfiguration::InterMuonList &out_neg, GMTInternalWedges &wedges_pos, GMTInternalWedges &wedges_neg, int bx) const
 

Static Private Member Functions

static bool compareMuons (const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu1, const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu2)
 

Private Attributes

edm::InputTag m_barrelTfInputTag
 
edm::EDGetTokenT
< MicroGMTConfiguration::InputCollection
m_barrelTfInputToken
 
edm::EDGetTokenT
< MicroGMTConfiguration::CaloInputCollection
m_caloTowerInputToken
 
MicroGMTCancelOutUnit m_cancelOutUnit
 
std::ofstream m_debugOut
 
edm::InputTag m_endcapTfInputTag
 
edm::EDGetTokenT
< MicroGMTConfiguration::InputCollection
m_endcapTfInputToken
 
MicroGMTIsolationUnit m_isolationUnit
 
edm::InputTag m_overlapTfInputTag
 
edm::EDGetTokenT
< MicroGMTConfiguration::InputCollection
m_overlapTfInputToken
 
MicroGMTRankPtQualLUT m_rankPtQualityLUT
 
edm::InputTag m_trigTowerTag
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: Takes txt-file input and produces barrel- / overlap- / forward TF muons

Implementation: [Notes on implementation]

Definition at line 52 of file L1TMicroGMTProducer.cc.

Constructor & Destructor Documentation

L1TMicroGMTProducer::L1TMicroGMTProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 122 of file L1TMicroGMTProducer.cc.

References edm::ParameterSet::getParameter(), m_barrelTfInputTag, m_barrelTfInputToken, m_caloTowerInputToken, m_endcapTfInputTag, m_endcapTfInputToken, m_overlapTfInputTag, m_overlapTfInputToken, and m_trigTowerTag.

122  : m_rankPtQualityLUT(iConfig), m_isolationUnit(iConfig), m_cancelOutUnit(iConfig), m_debugOut("test/debug/iso_debug.dat")
123 {
124  // edm::InputTag barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
125  // edm::InputTag overlapTfInputTag = iConfig.getParameter<edm::InputTag>("overlapTFInput");
126  // edm::InputTag forwardTfInputTag = iConfig.getParameter<edm::InputTag>("forwardTFInput");
127 
128  m_barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
129  m_overlapTfInputTag = iConfig.getParameter<edm::InputTag>("overlapTFInput");
130  m_endcapTfInputTag = iConfig.getParameter<edm::InputTag>("forwardTFInput");
131  m_trigTowerTag = iConfig.getParameter<edm::InputTag>("triggerTowerInput");
132 
133  m_barrelTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_barrelTfInputTag);
134  m_overlapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_overlapTfInputTag);
135  m_endcapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_endcapTfInputTag);
136  m_caloTowerInputToken = consumes<MicroGMTConfiguration::CaloInputCollection>(m_trigTowerTag);
137 
138  //register your products
139  produces<MuonBxCollection>();
140  produces<MuonBxCollection>("imdMuonsBMTF");
141  produces<MuonBxCollection>("imdMuonsEMTFPos");
142  produces<MuonBxCollection>("imdMuonsEMTFNeg");
143  produces<MuonBxCollection>("imdMuonsOMTFPos");
144  produces<MuonBxCollection>("imdMuonsOMTFNeg");
145 
146 
147 
148 }
T getParameter(std::string const &) const
MicroGMTIsolationUnit m_isolationUnit
edm::InputTag m_trigTowerTag
edm::InputTag m_endcapTfInputTag
MicroGMTRankPtQualLUT m_rankPtQualityLUT
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_endcapTfInputToken
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_overlapTfInputToken
MicroGMTCancelOutUnit m_cancelOutUnit
edm::InputTag m_overlapTfInputTag
edm::EDGetTokenT< MicroGMTConfiguration::CaloInputCollection > m_caloTowerInputToken
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_barrelTfInputToken
edm::InputTag m_barrelTfInputTag
L1TMicroGMTProducer::~L1TMicroGMTProducer ( )

Definition at line 150 of file L1TMicroGMTProducer.cc.

References m_debugOut.

151 {
152  m_debugOut.close();
153 }

Member Function Documentation

void L1TMicroGMTProducer::addMuonsToCollections ( MicroGMTConfiguration::InterMuonList coll,
MicroGMTConfiguration::InterMuonList interout,
std::auto_ptr< MuonBxCollection > &  out,
int  bx 
) const
private

Definition at line 330 of file L1TMicroGMTProducer.cc.

References RPCpg::mu.

Referenced by produce().

333 {
334  for (auto& mu : coll) {
335  interout.push_back(mu);
336  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > vec{};
337  // FIXME: once we debugged the change global -> local: Change hwLocalPhi -> hwGlobalPhi to test offsets
338  Muon outMu{vec, mu->hwPt(), mu->hwEta(), mu->hwGlobalPhi(), mu->hwQual(), mu->hwSign(), mu->hwSignValid(), -1, 0, true, -1, mu->hwDPhi(), mu->hwDEta(), mu->hwRank()};
339 
340  out->push_back(bx, outMu);
341  }
342 }
const int mu
Definition: Constants.h:22
Definition: Muon.h:12
tuple out
Definition: dbtoconf.py:99
JetCorrectorParametersCollection coll
Definition: classes.h:10
void L1TMicroGMTProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 399 of file L1TMicroGMTProducer.cc.

400 {
401 }
void L1TMicroGMTProducer::beginLuminosityBlock ( edm::LuminosityBlock ,
edm::EventSetup const &   
)
privatevirtual

Definition at line 422 of file L1TMicroGMTProducer.cc.

423 {
424 }
void L1TMicroGMTProducer::beginRun ( edm::Run ,
edm::EventSetup const &   
)
privatevirtual

Definition at line 410 of file L1TMicroGMTProducer.cc.

411 {
412 }
void L1TMicroGMTProducer::calculateRank ( MicroGMTConfiguration::InterMuonList muons) const
private

Definition at line 320 of file L1TMicroGMTProducer.cc.

References l1t::MicroGMTRankPtQualLUT::lookup(), and m_rankPtQualityLUT.

Referenced by produce().

321 {
322  for (auto& mu1 : muons) {
323  int rank = m_rankPtQualityLUT.lookup(mu1->hwPt(), mu1->hwQual());
324  mu1->setHwRank(rank);
325  }
326 }
MicroGMTRankPtQualLUT m_rankPtQualityLUT
int lookup(int pt, int qual) const
tuple muons
Definition: patZpeak.py:38
bool L1TMicroGMTProducer::compareMuons ( const std::shared_ptr< MicroGMTConfiguration::InterMuon > &  mu1,
const std::shared_ptr< MicroGMTConfiguration::InterMuon > &  mu2 
)
staticprivate

Definition at line 277 of file L1TMicroGMTProducer.cc.

Referenced by sortMuons().

278  {
279  return (mu1->hwWins() > mu2->hwWins());
280 }
void L1TMicroGMTProducer::convertMuons ( edm::Handle< MicroGMTConfiguration::InputCollection > const &  in,
MicroGMTConfiguration::InterMuonList out,
GMTInternalWedges wedges,
int  bx 
) const
private

Definition at line 377 of file L1TMicroGMTProducer.cc.

References i, and findQualityFiles::size.

Referenced by produce().

380 {
381  // initialize the wedge collection:
382  for (int i = 0; i < 12; ++i) {
383  wedges[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
384  wedges[i].reserve(3);
385  }
386  for (size_t i = 0; i < in->size(bx); ++i) {
387  int gPhi = MicroGMTConfiguration::calcGlobalPhi(in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor());
388  std::shared_ptr<GMTInternalMuon> outMu = std::make_shared<GMTInternalMuon>(in->at(bx, i), gPhi);
389  out.emplace_back(outMu);
390  wedges[in->at(bx, i).processor()].push_back(outMu);
391  }
392  for (int i = 0; i < 12; ++i) {
393  if(wedges[i].size() > 3) edm::LogWarning("Input Mismatch") << " too many inputs per processor for barrel" << std::endl;
394  }
395 }
int i
Definition: DBlmapReader.cc:9
tuple out
Definition: dbtoconf.py:99
tuple size
Write out results.
void L1TMicroGMTProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 405 of file L1TMicroGMTProducer.cc.

405  {
406 }
void L1TMicroGMTProducer::endLuminosityBlock ( edm::LuminosityBlock ,
edm::EventSetup const &   
)
privatevirtual

Definition at line 428 of file L1TMicroGMTProducer.cc.

429 {
430 }
void L1TMicroGMTProducer::endRun ( edm::Run ,
edm::EventSetup const &   
)
privatevirtual

Definition at line 416 of file L1TMicroGMTProducer.cc.

417 {
418 }
void L1TMicroGMTProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 434 of file L1TMicroGMTProducer.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

434  {
435  //The following says we do not know what parameters are allowed so do no validation
436  // Please change this to state exactly what you do use, even if it is no parameters
438  desc.setUnknown();
439  descriptions.addDefault(desc);
440 }
void addDefault(ParameterSetDescription const &psetDescription)
void L1TMicroGMTProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 164 of file L1TMicroGMTProducer.cc.

References addMuonsToCollections(), l1t::bmtf, calculateRank(), convertMuons(), l1t::coordinate, l1t::emtf_neg, l1t::emtf_pos, l1t::MicroGMTIsolationUnit::extrapolateMuons(), edm::Event::getByToken(), l1t::MicroGMTIsolationUnit::isolatePreSummed(), m_barrelTfInputToken, m_caloTowerInputToken, m_cancelOutUnit, m_debugOut, m_endcapTfInputToken, m_isolationUnit, m_overlapTfInputToken, RPCpg::mu, l1t::omtf_neg, l1t::omtf_pos, edm::Event::put(), l1t::MicroGMTCancelOutUnit::setCancelOutBits(), l1t::MicroGMTCancelOutUnit::setCancelOutBitsOverlapBarrel(), l1t::MicroGMTCancelOutUnit::setCancelOutBitsOverlapEndcap(), l1t::MicroGMTIsolationUnit::setTowerSums(), sortMuons(), and splitAndConvertMuons().

165 {
166  using namespace edm;
167  std::auto_ptr<MuonBxCollection> outMuons (new MuonBxCollection());
168  std::auto_ptr<MuonBxCollection> imdMuonsBMTF (new MuonBxCollection());
169  std::auto_ptr<MuonBxCollection> imdMuonsEMTFPos (new MuonBxCollection());
170  std::auto_ptr<MuonBxCollection> imdMuonsEMTFNeg (new MuonBxCollection());
171  std::auto_ptr<MuonBxCollection> imdMuonsOMTFPos (new MuonBxCollection());
172  std::auto_ptr<MuonBxCollection> imdMuonsOMTFNeg (new MuonBxCollection());
173 
174 
179 
180  // iEvent.getByToken(m_barrelTfInputToken, bmtfMuons);
181  iEvent.getByToken(m_barrelTfInputToken, bmtfMuons);
182  iEvent.getByToken(m_endcapTfInputToken, emtfMuons);
183  iEvent.getByToken(m_overlapTfInputToken, omtfMuons);
184  iEvent.getByToken(m_caloTowerInputToken, trigTowers);
185 
186  int bx = 0;
187 
188  m_isolationUnit.setTowerSums(*trigTowers, bx);
189  MicroGMTConfiguration::InterMuonList internMuonsBmtf;
190  MicroGMTConfiguration::InterMuonList internMuonsEmtfPos;
191  MicroGMTConfiguration::InterMuonList internMuonsEmtfNeg;
192  MicroGMTConfiguration::InterMuonList internMuonsOmtfPos;
193  MicroGMTConfiguration::InterMuonList internMuonsOmtfNeg;
194 
195  // These wedges contain shared pointers to the ones in the InterMuonList
196  GMTInternalWedges omtfNegWedges;
197  GMTInternalWedges bmtfWedges;
198  GMTInternalWedges emtfPosWedges;
199  GMTInternalWedges emtfNegWedges;
200  GMTInternalWedges omtfPosWedges;
201 
202  // this converts the InputMuon type to the InternalMuon type and splits them into
203  // positive / negative eta collections necessary as LUTs may differ for pos / neg.
204  convertMuons(bmtfMuons, internMuonsBmtf, bmtfWedges, bx);
205  splitAndConvertMuons(emtfMuons, internMuonsEmtfPos, internMuonsEmtfNeg, emtfPosWedges, emtfNegWedges, bx);
206  splitAndConvertMuons(omtfMuons, internMuonsOmtfPos, internMuonsOmtfNeg, omtfPosWedges, omtfNegWedges, bx);
207 
208  // cancel out within the track finders:
212  // cancel-out for endcap will be done in the sorter
215 
216  // cancel out between track finder acceptance overlaps:
221 
222  m_isolationUnit.extrapolateMuons(internMuonsBmtf);
223  m_isolationUnit.extrapolateMuons(internMuonsEmtfNeg);
224  m_isolationUnit.extrapolateMuons(internMuonsEmtfPos);
225  m_isolationUnit.extrapolateMuons(internMuonsOmtfNeg);
226  m_isolationUnit.extrapolateMuons(internMuonsOmtfPos);
227 
228  // the rank calculated here is used in the sort below
229  calculateRank(internMuonsBmtf);
230  calculateRank(internMuonsEmtfNeg);
231  calculateRank(internMuonsEmtfPos);
232  calculateRank(internMuonsOmtfNeg);
233  calculateRank(internMuonsOmtfPos);
234 
235  // The sort function both sorts and removes all but best "nSurvivors"
236  sortMuons(internMuonsBmtf, 8);
237  sortMuons(internMuonsOmtfPos, 4);
238  sortMuons(internMuonsOmtfNeg, 4);
239  sortMuons(internMuonsEmtfPos, 4);
240  sortMuons(internMuonsEmtfNeg, 4);
241 
242  // This combines the 5 streams into one InternalMuon collection for
243  // the final global sort.
245  addMuonsToCollections(internMuonsEmtfPos, internalMuons, imdMuonsEMTFPos, bx);
246  addMuonsToCollections(internMuonsOmtfPos, internalMuons, imdMuonsOMTFPos, bx);
247  addMuonsToCollections(internMuonsBmtf, internalMuons, imdMuonsBMTF, bx);
248  addMuonsToCollections(internMuonsOmtfNeg, internalMuons, imdMuonsOMTFNeg, bx);
249  addMuonsToCollections(internMuonsEmtfNeg, internalMuons, imdMuonsEMTFNeg, bx);
250 
251  // sort internal muons and delete all but best 8
252  sortMuons(internalMuons, 8);
253 
254  m_isolationUnit.isolatePreSummed(internalMuons);
255  // copy muons to output collection...
256  for (const auto& mu : internalMuons) {
257  if (mu->hwPt() > 0) {
258  math::PtEtaPhiMLorentzVector vec{mu->hwPt()*0.5, mu->hwEta()*0.010875, mu->hwGlobalPhi()*0.010908, 0.0};
259  int iso = mu->hwAbsIso() + (mu->hwRelIso() << 1);
260  Muon outMu{vec, mu->hwPt(), mu->hwEta(), mu->hwGlobalPhi(), mu->hwQual(), mu->hwSign(), mu->hwSignValid(), iso, 0, true, mu->hwIsoSum(), mu->hwDPhi(), mu->hwDEta(), mu->hwRank()};
261  m_debugOut << mu->hwCaloPhi() << " " << mu->hwCaloEta() << std::endl;
262  outMuons->push_back(bx, outMu);
263  }
264  }
265 
266 
267  iEvent.put(outMuons);
268  iEvent.put(imdMuonsBMTF, "imdMuonsBMTF");
269  iEvent.put(imdMuonsEMTFPos, "imdMuonsEMTFPos");
270  iEvent.put(imdMuonsEMTFNeg, "imdMuonsEMTFNeg");
271  iEvent.put(imdMuonsOMTFPos, "imdMuonsOMTFPos");
272  iEvent.put(imdMuonsOMTFNeg, "imdMuonsOMTFNeg");
273 }
MicroGMTIsolationUnit m_isolationUnit
void extrapolateMuons(MicroGMTConfiguration::InterMuonList &) const
void setCancelOutBitsOverlapEndcap(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and endcap track finders.
void setCancelOutBitsOverlapBarrel(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and barrel track finders.
void sortMuons(MicroGMTConfiguration::InterMuonList &, unsigned) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
void setTowerSums(const MicroGMTConfiguration::CaloInputCollection &inputs, int bx)
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_endcapTfInputToken
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_overlapTfInputToken
MicroGMTCancelOutUnit m_cancelOutUnit
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
void splitAndConvertMuons(edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out_pos, MicroGMTConfiguration::InterMuonList &out_neg, GMTInternalWedges &wedges_pos, GMTInternalWedges &wedges_neg, int bx) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
void calculateRank(MicroGMTConfiguration::InterMuonList &muons) const
const int mu
Definition: Constants.h:22
GMTInternalMuonList InterMuonList
void addMuonsToCollections(MicroGMTConfiguration::InterMuonList &coll, MicroGMTConfiguration::InterMuonList &interout, std::auto_ptr< MuonBxCollection > &out, int bx) const
Definition: Muon.h:12
BXVector< Muon > MuonBxCollection
Definition: Muon.h:9
void setCancelOutBits(GMTInternalWedges &, tftype, cancelmode)
Cancel out between sectors/wedges in one track finder.
edm::EDGetTokenT< MicroGMTConfiguration::CaloInputCollection > m_caloTowerInputToken
void convertMuons(edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out, GMTInternalWedges &wedges, int bx) const
std::map< int, std::vector< std::shared_ptr< GMTInternalMuon > > > GMTInternalWedges
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_barrelTfInputToken
void isolatePreSummed(MicroGMTConfiguration::InterMuonList &muons) const
void L1TMicroGMTProducer::sortMuons ( MicroGMTConfiguration::InterMuonList muons,
unsigned  nSurvivors 
) const
private

Definition at line 283 of file L1TMicroGMTProducer.cc.

References compareMuons().

Referenced by produce().

283  {
284  MicroGMTConfiguration::InterMuonList::iterator mu1;
285  // reset from previous sort stage
286  for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
287  (*mu1)->setHwWins(0);
288  }
289 
290  for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
291  auto mu2 = mu1;
292  mu2++;
293  for ( ; mu2 != muons.end(); ++mu2) {
294  if ((*mu1)->hwRank() >= (*mu2)->hwRank() && (*mu1)->hwCancelBit() != 1) {
295  (*mu1)->increaseWins();
296  } else if ((*mu2)->hwCancelBit() != 1) {
297  (*mu2)->increaseWins();
298  }
299  }
300  }
301 
302  size_t nMuonsBefore = muons.size();
303  mu1 = muons.begin();
304  int minWins = nMuonsBefore-nSurvivors;
305 
306  // remove all muons that were cancelled or that do not have sufficient rank
307  // (reduces the container size to nSurvivors)
308  while (mu1 != muons.end()) {
309  if ((*mu1)->hwWins() < minWins || (*mu1)->hwCancelBit() == 1) {
310  muons.erase(mu1);
311  }
312  ++mu1;
313  }
315 }
static bool compareMuons(const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu1, const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu2)
tuple muons
Definition: patZpeak.py:38
void L1TMicroGMTProducer::splitAndConvertMuons ( edm::Handle< MicroGMTConfiguration::InputCollection > const &  in,
MicroGMTConfiguration::InterMuonList out_pos,
MicroGMTConfiguration::InterMuonList out_neg,
GMTInternalWedges wedges_pos,
GMTInternalWedges wedges_neg,
int  bx 
) const
private

Definition at line 345 of file L1TMicroGMTProducer.cc.

References i, dbtoconf::out, and findQualityFiles::size.

Referenced by produce().

351 {
352  // initialize the wedge collections:
353  for (int i = 0; i < 6; ++i) {
354  wedges_pos[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
355  wedges_pos[i].reserve(3);
356  wedges_neg[i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
357  wedges_neg[i].reserve(3);
358  }
359  for (size_t i = 0; i < in->size(bx); ++i) {
360  int gPhi = MicroGMTConfiguration::calcGlobalPhi(in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor());
361  std::shared_ptr<GMTInternalMuon> out = std::make_shared<GMTInternalMuon>(in->at(bx, i), gPhi);
362  if(in->at(bx, i).hwEta() > 0) {
363  out_pos.push_back(out);
364  wedges_pos[in->at(bx, i).processor()].push_back(out);
365  } else {
366  out_neg.emplace_back(out);
367  wedges_neg[in->at(bx, i).processor()].push_back(out);
368  }
369  }
370  for (int i = 0; i < 6; ++i) {
371  if(wedges_pos[i].size() > 3) edm::LogWarning("Input Mismatch") << " too many inputs per processor for emtf+ / omtf+" << std::endl;
372  if(wedges_neg[i].size() > 3) edm::LogWarning("Input Mismatch") << " too many inputs per processor for emtf- / omtf-" << std::endl;
373  }
374 }
int i
Definition: DBlmapReader.cc:9
tuple out
Definition: dbtoconf.py:99
tuple size
Write out results.

Member Data Documentation

edm::InputTag L1TMicroGMTProducer::m_barrelTfInputTag
private

Definition at line 94 of file L1TMicroGMTProducer.cc.

Referenced by L1TMicroGMTProducer().

edm::EDGetTokenT<MicroGMTConfiguration::InputCollection> L1TMicroGMTProducer::m_barrelTfInputToken
private

Definition at line 103 of file L1TMicroGMTProducer.cc.

Referenced by L1TMicroGMTProducer(), and produce().

edm::EDGetTokenT<MicroGMTConfiguration::CaloInputCollection> L1TMicroGMTProducer::m_caloTowerInputToken
private

Definition at line 106 of file L1TMicroGMTProducer.cc.

Referenced by L1TMicroGMTProducer(), and produce().

MicroGMTCancelOutUnit L1TMicroGMTProducer::m_cancelOutUnit
private

Definition at line 100 of file L1TMicroGMTProducer.cc.

Referenced by produce().

std::ofstream L1TMicroGMTProducer::m_debugOut
private

Definition at line 101 of file L1TMicroGMTProducer.cc.

Referenced by produce(), and ~L1TMicroGMTProducer().

edm::InputTag L1TMicroGMTProducer::m_endcapTfInputTag
private

Definition at line 96 of file L1TMicroGMTProducer.cc.

Referenced by L1TMicroGMTProducer().

edm::EDGetTokenT<MicroGMTConfiguration::InputCollection> L1TMicroGMTProducer::m_endcapTfInputToken
private

Definition at line 105 of file L1TMicroGMTProducer.cc.

Referenced by L1TMicroGMTProducer(), and produce().

MicroGMTIsolationUnit L1TMicroGMTProducer::m_isolationUnit
private

Definition at line 99 of file L1TMicroGMTProducer.cc.

Referenced by produce().

edm::InputTag L1TMicroGMTProducer::m_overlapTfInputTag
private

Definition at line 95 of file L1TMicroGMTProducer.cc.

Referenced by L1TMicroGMTProducer().

edm::EDGetTokenT<MicroGMTConfiguration::InputCollection> L1TMicroGMTProducer::m_overlapTfInputToken
private

Definition at line 104 of file L1TMicroGMTProducer.cc.

Referenced by L1TMicroGMTProducer(), and produce().

MicroGMTRankPtQualLUT L1TMicroGMTProducer::m_rankPtQualityLUT
private

Definition at line 98 of file L1TMicroGMTProducer.cc.

Referenced by calculateRank().

edm::InputTag L1TMicroGMTProducer::m_trigTowerTag
private

Definition at line 97 of file L1TMicroGMTProducer.cc.

Referenced by L1TMicroGMTProducer().