Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "L1Trigger/L1TNtuples/interface/L1AnalysisBMTFInputs.h"
0002 #include <FWCore/ParameterSet/interface/ParameterSet.h>
0003 
0004 #include <sstream>
0005 #include <string>
0006 
0007 using namespace std;
0008 
0009 L1Analysis::L1AnalysisBMTFInputs::L1AnalysisBMTFInputs() {}
0010 
0011 L1Analysis::L1AnalysisBMTFInputs::~L1AnalysisBMTFInputs() {}
0012 
0013 void L1Analysis::L1AnalysisBMTFInputs::SetBMPH(const edm::Handle<L1MuDTChambPhContainer> L1MuDTChambPhContainer,
0014                                                unsigned int maxDTPH) {
0015   L1MuDTChambPhContainer::Phi_Container const *PhContainer = L1MuDTChambPhContainer->getContainer();
0016 
0017   bmtf_.phSize = PhContainer->size();
0018   int iphtr = 0;
0019   for (L1MuDTChambPhContainer::Phi_Container::const_iterator DTPhDigiItr = PhContainer->begin();
0020        DTPhDigiItr != PhContainer->end();
0021        ++DTPhDigiItr) {
0022     if ((unsigned int)iphtr > maxDTPH - 1)
0023       continue;
0024     bmtf_.phBx.push_back(DTPhDigiItr->bxNum());
0025     bmtf_.phTs2Tag.push_back(DTPhDigiItr->Ts2Tag());
0026     bmtf_.phWh.push_back(DTPhDigiItr->whNum());
0027     bmtf_.phSe.push_back(DTPhDigiItr->scNum());
0028     bmtf_.phSt.push_back(DTPhDigiItr->stNum());
0029     bmtf_.phAng.push_back(DTPhDigiItr->phi());
0030     bmtf_.phBandAng.push_back(DTPhDigiItr->phiB());
0031     bmtf_.phCode.push_back(DTPhDigiItr->code());
0032 
0033     iphtr++;
0034   }
0035 }
0036 
0037 void L1Analysis::L1AnalysisBMTFInputs::SetBMTH(const edm::Handle<L1MuDTChambThContainer> L1MuDTChambThContainer,
0038                                                unsigned int maxDTTH) {
0039   L1MuDTChambThContainer::The_Container const *ThContainer = L1MuDTChambThContainer->getContainer();
0040 
0041   int ithtr = 0;
0042   bmtf_.thSize = ThContainer->size();
0043 
0044   for (L1MuDTChambThContainer::The_Container::const_iterator DTThDigiItr = ThContainer->begin();
0045        DTThDigiItr != ThContainer->end();
0046        ++DTThDigiItr) {
0047     if ((unsigned int)ithtr > maxDTTH - 1)
0048       continue;
0049     bmtf_.thBx.push_back(DTThDigiItr->bxNum());
0050     bmtf_.thWh.push_back(DTThDigiItr->whNum());
0051     bmtf_.thSe.push_back(DTThDigiItr->scNum());
0052     bmtf_.thSt.push_back(DTThDigiItr->stNum());
0053 
0054     ostringstream ss1, ss2;
0055     ss1.clear();
0056     ss2.clear();
0057     ss1 << "9";
0058     ss2 << "9";
0059 
0060     for (int j = 0; j < 7; j++) {
0061       ss1 << DTThDigiItr->position(j);
0062       ss2 << DTThDigiItr->code(j);
0063     }
0064     bmtf_.thTheta.push_back(stoi(ss1.str()));
0065     bmtf_.thCode.push_back(stoi(ss2.str()));
0066 
0067     ithtr++;
0068   }
0069 }