Go to the documentation of this file.00001 #include "EventFilter/CSCRawToDigi/src/CSCDigiToPattern.h"
00002 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h"
00003 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
00004 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00005
00006 CSCDigiToPattern::CSCDigiToPattern(edm::ParameterSet const& conf) {
00007
00008
00009
00010
00011
00012 }
00013
00014 void CSCDigiToPattern::analyze(edm::Event const& e, edm::EventSetup const& iSetup) {
00015
00016
00017
00018
00019 edm::Handle<CSCCorrelatedLCTDigiCollection> correlatedlcts;
00020 e.getByLabel("muonCSCDigis","MuonCSCCorrelatedLCTDigi",correlatedlcts);
00021 for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator j=correlatedlcts->begin(); j!=correlatedlcts->end(); j++) {
00022 CSCDetId id=(*j).first;
00023 std::cout<<id<<std::endl;
00024 std::vector<CSCCorrelatedLCTDigi>::const_iterator digiIt = (*j).second.first;
00025 std::vector<CSCCorrelatedLCTDigi>::const_iterator last = (*j).second.second;
00026 for( ; digiIt != last; ++digiIt) {
00027 uint16_t wire = digiIt->getKeyWG();
00028 uint16_t pattern = digiIt->getPattern();
00029 uint16_t quality = digiIt->getQuality();
00030 uint16_t valid = digiIt->isValid();
00031 uint16_t strip = digiIt->getStrip();
00032 uint16_t bend = digiIt->getBend();
00033 uint16_t syncErr = digiIt->getSyncErr();
00034 uint16_t bx = digiIt->getBX();
00035 uint16_t bx0 = digiIt->getBX0();
00036 uint16_t cscId = digiIt->getCSCID();
00037
00038
00039 long unsigned int mpc =
00040 ((cscId&0xF)<<28) | ((bx0&0x1)<<27) | ((bx&0x1)<<26) |
00041 ((syncErr&0x1)<<25) | ((bend&0x1)<<24) | ((strip&0xFF)<<16) |
00042 ((valid&0x1)<<15) | ((quality&0xF)<<11) | ((pattern&0xF)<<7) |
00043 (wire&0x7F);
00044 std::cout <<"MPC"<<digiIt->getTrknmb()<< " " << std::hex << mpc <<std::dec <<std::endl;
00045 }
00046 }
00047 }
00048
00049
00050
00051