-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24907 from slezki/CMSSW_10_3_X
- Loading branch information
Showing
18 changed files
with
502 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#include "EventFilter/RPCRawToDigi/plugins/RPCDigiMerger.h" | ||
|
||
#include <memory> | ||
|
||
#include "DataFormats/Common/interface/Handle.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | ||
#include "FWCore/Utilities/interface/CRC16.h" | ||
#include "FWCore/Utilities/interface/InputTag.h" | ||
|
||
#include "DataFormats/RPCDigi/interface/RPCDigiCollection.h" | ||
|
||
using namespace edm; | ||
using namespace std; | ||
|
||
|
||
RPCDigiMerger::RPCDigiMerger(edm::ParameterSet const & config) | ||
{ | ||
produces<RPCDigiCollection>(); | ||
twinMux_token_ = consumes<RPCDigiCollection>(config.getParameter<edm::InputTag>("inputTagTwinMuxDigis")); | ||
omtf_token_ = consumes<RPCDigiCollection>(config.getParameter<edm::InputTag>("inputTagOMTFDigis")); | ||
cppf_token_ = consumes<RPCDigiCollection>(config.getParameter<edm::InputTag>("inputTagCPPFDigis")); | ||
} | ||
|
||
RPCDigiMerger::~RPCDigiMerger() | ||
{} | ||
|
||
void RPCDigiMerger::fillDescriptions(edm::ConfigurationDescriptions & descs) | ||
{ | ||
edm::ParameterSetDescription desc; | ||
desc.add<edm::InputTag>("inputTagTwinMuxDigis", edm::InputTag("rpcTwinMuxRawToDigi", "")); | ||
desc.add<edm::InputTag>("inputTagOMTFDigis", edm::InputTag("omtfStage2Digis", "")); | ||
desc.add<edm::InputTag>("inputTagCPPFDigis", edm::InputTag("rpcCPPFRawToDigi", "")); | ||
|
||
descs.add("rpcDigiMerger", desc); | ||
} | ||
|
||
void RPCDigiMerger::beginRun(edm::Run const & run, edm::EventSetup const & setup) | ||
{} | ||
|
||
void RPCDigiMerger::produce(edm::Event & event, edm::EventSetup const & setup) | ||
{ | ||
|
||
// Get the digis | ||
// TwinMux | ||
Handle<RPCDigiCollection> TwinMux_digis; | ||
event.getByToken(twinMux_token_,TwinMux_digis); | ||
// OMTF | ||
Handle<RPCDigiCollection> OMTF_digis; | ||
event.getByToken(omtf_token_,OMTF_digis); | ||
// CPFF | ||
Handle<RPCDigiCollection> CPPF_digis; | ||
event.getByToken(cppf_token_,CPPF_digis); | ||
|
||
// new RPCDigiCollection | ||
std::unique_ptr<RPCDigiCollection> rpc_digi_collection(new RPCDigiCollection()); | ||
|
||
|
||
// loop over TwinMux digis | ||
for (const auto & rpcdgIt : (*TwinMux_digis) ) { | ||
// The layerId | ||
const RPCDetId& rpcId = rpcdgIt.first; | ||
// Get the iterators over the digis associated with this LayerId | ||
const RPCDigiCollection::Range& range = rpcdgIt.second; | ||
|
||
rpc_digi_collection->put(range, rpcId); | ||
} | ||
|
||
// loop over CPPF digis | ||
for (const auto && rpcdgIt : (*CPPF_digis) ) { | ||
// The layerId | ||
const RPCDetId& rpcId = rpcdgIt.first; | ||
// Get the iterators over the digis associated with this LayerId | ||
const RPCDigiCollection::Range& range = rpcdgIt.second; | ||
|
||
rpc_digi_collection->put(range, rpcId); | ||
} | ||
|
||
// loop over OMTF digis | ||
for (const auto & rpcdgIt : (*OMTF_digis) ) { | ||
// The layerId | ||
const RPCDetId& rpcId = rpcdgIt.first; | ||
// Get the iterators over the digis associated with this LayerId | ||
const RPCDigiCollection::Range& range = rpcdgIt.second; | ||
|
||
// accepts only rings: RE-2_R3 ; RE-1_R3 ; RE+1_R3 ; RE+2_R3 ; | ||
if ( ((rpcId.region() == -1 || rpcId.region() == 1) && (rpcId.ring() == 3) && (rpcId.station() == 1 || rpcId.station() == 2)) ) { | ||
rpc_digi_collection->put(range, rpcId); | ||
} | ||
} | ||
|
||
// "put" into the event | ||
event.put(std::move(rpc_digi_collection)); | ||
} | ||
|
||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
DEFINE_FWK_MODULE(RPCDigiMerger); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef EventFilter_RPCRawToDigi_RPCDigiMerger_h | ||
#define EventFilter_RPCRawToDigi_RPCDigiMerger_h | ||
|
||
#include <cstdint> | ||
#include <vector> | ||
#include <utility> | ||
#include <set> | ||
|
||
#include "FWCore/Framework/interface/ESHandle.h" | ||
#include "FWCore/Framework/interface/ESWatcher.h" | ||
#include "FWCore/Framework/interface/stream/EDProducer.h" | ||
|
||
#include "DataFormats/RPCDigi/interface/RPCDigi.h" | ||
#include "DataFormats/RPCDigi/interface/RPCDigiCollection.h" | ||
|
||
namespace edm { | ||
class ConfigurationDescriptions; | ||
class Event; | ||
class EventSetup; | ||
class ParameterSet; | ||
class Run; | ||
} // namespace edm | ||
|
||
class RPCDigiMerger | ||
: public edm::stream::EDProducer<> | ||
{ | ||
public: | ||
RPCDigiMerger(edm::ParameterSet const & config); | ||
~RPCDigiMerger() override; | ||
|
||
static void fillDescriptions(edm::ConfigurationDescriptions & descs); | ||
|
||
void beginRun(edm::Run const & run, edm::EventSetup const & setup) override; | ||
void produce(edm::Event & event, edm::EventSetup const & setup) override; | ||
|
||
protected: | ||
|
||
edm::EDGetTokenT<RPCDigiCollection> twinMux_token_; | ||
edm::EDGetTokenT<RPCDigiCollection> omtf_token_; | ||
edm::EDGetTokenT<RPCDigiCollection> cppf_token_; | ||
|
||
}; | ||
|
||
#endif // EventFilter_RPCRawToDigi_RPCDigiMerger_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from EventFilter.RPCRawToDigi.rpcDigiMerger_cfi import rpcDigiMerger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from EventFilter.RPCRawToDigi.RPCTwinMuxRawToDigi_cfi import RPCTwinMuxRawToDigi | ||
from EventFilter.RPCRawToDigi.rpcTwinMuxRawToDigi_cfi import rpcTwinMuxRawToDigi |
2 changes: 1 addition & 1 deletion
2
EventFilter/RPCRawToDigi/python/RPCTwinMuxRawToDigi_sqlite_cff.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from CondTools.RPC.RPCLinkMap_sqlite_cff import RPCLinkMapSource | ||
from EventFilter.RPCRawToDigi.RPCTwinMuxRawToDigi_cfi import RPCTwinMuxRawToDigi | ||
from EventFilter.RPCRawToDigi.rpcTwinMuxRawToDigi_cfi import rpcTwinMuxRawToDigi |
Oops, something went wrong.