Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:11

0001 /*
0002  * MuonStubsInput.cc
0003  *
0004  *  Created on: Jan 31, 2019
0005  *      Author: Karol Bunkowski kbunkow@cern.ch
0006  */
0007 
0008 #include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStubsInput.h"
0009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0010 
0011 MuonStubsInput::MuonStubsInput(const ProcConfigurationBase* config)
0012     : config(config), muonStubsInLayers(config->nLayers()) {}
0013 
0014 std::ostream& operator<<(std::ostream& out, const MuonStubsInput& stubsInput) {
0015   out << "MuonStubsInput: " << std::endl;
0016   for (auto& layerStubs : stubsInput.getMuonStubs()) {
0017     for (auto& stub : layerStubs) {
0018       out << (*stub) << std::endl;
0019     }
0020   }
0021   return out;
0022 }
0023 
0024 //gives stub phiHw or phiBHw - depending which layer is requested
0025 //assumes that the banidg layer
0026 int MuonStubsInput::getPhiHw(unsigned int iLayer, unsigned int iInput) const {
0027   if (config->isBendingLayer(iLayer)) {
0028     if (iInput >= muonStubsInLayers[iLayer - 1].size())
0029       return MuonStub::EMTPY_PHI;
0030     return muonStubsInLayers[iLayer - 1][iInput]->phiBHw;
0031   } else {
0032     if (iInput >= muonStubsInLayers[iLayer].size())
0033       return MuonStub::EMTPY_PHI;
0034     return muonStubsInLayers[iLayer][iInput]->phiHw;
0035   }
0036 }