CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes
RPCDigiMerger Class Reference

#include <RPCDigiMerger.h>

Inheritance diagram for RPCDigiMerger:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void produce (edm::Event &event, edm::EventSetup const &setup) override
 
 RPCDigiMerger (edm::ParameterSet const &config)
 
 ~RPCDigiMerger () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descs)
 

Protected Attributes

edm::EDGetTokenT< RPCDigiCollectioncppf_token_
 
edm::EDGetTokenT< RPCDigiCollectionomtf_token_
 
edm::EDGetTokenT< RPCDigiCollectiontwinMux_token_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 24 of file RPCDigiMerger.h.

Constructor & Destructor Documentation

RPCDigiMerger::RPCDigiMerger ( edm::ParameterSet const &  config)

Definition at line 21 of file RPCDigiMerger.cc.

References edm::ParameterSet::getParameter().

22 {
23  produces<RPCDigiCollection>();
24  twinMux_token_ = consumes<RPCDigiCollection>(config.getParameter<edm::InputTag>("inputTagTwinMuxDigis"));
25  omtf_token_ = consumes<RPCDigiCollection>(config.getParameter<edm::InputTag>("inputTagOMTFDigis"));
26  cppf_token_ = consumes<RPCDigiCollection>(config.getParameter<edm::InputTag>("inputTagCPPFDigis"));
27 }
Definition: config.py:1
edm::EDGetTokenT< RPCDigiCollection > omtf_token_
Definition: RPCDigiMerger.h:39
edm::EDGetTokenT< RPCDigiCollection > twinMux_token_
Definition: RPCDigiMerger.h:38
edm::EDGetTokenT< RPCDigiCollection > cppf_token_
Definition: RPCDigiMerger.h:40
RPCDigiMerger::~RPCDigiMerger ( )
override

Definition at line 29 of file RPCDigiMerger.cc.

30 {}

Member Function Documentation

void RPCDigiMerger::beginRun ( edm::Run const &  run,
edm::EventSetup const &  setup 
)
override

Definition at line 42 of file RPCDigiMerger.cc.

43 {}
void RPCDigiMerger::fillDescriptions ( edm::ConfigurationDescriptions descs)
static

Definition at line 32 of file RPCDigiMerger.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

33 {
35  desc.add<edm::InputTag>("inputTagTwinMuxDigis", edm::InputTag("rpcTwinMuxRawToDigi", ""));
36  desc.add<edm::InputTag>("inputTagOMTFDigis", edm::InputTag("omtfStage2Digis", ""));
37  desc.add<edm::InputTag>("inputTagCPPFDigis", edm::InputTag("rpcCPPFRawToDigi", ""));
38 
39  descs.add("rpcDigiMerger", desc);
40 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void RPCDigiMerger::produce ( edm::Event event,
edm::EventSetup const &  setup 
)
override

Definition at line 45 of file RPCDigiMerger.cc.

References DEFINE_FWK_MODULE, eostools::move(), RPCDetId::region(), RPCDetId::ring(), and RPCDetId::station().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

46 {
47 
48  // Get the digis
49  // TwinMux
50  Handle<RPCDigiCollection> TwinMux_digis;
51  event.getByToken(twinMux_token_,TwinMux_digis);
52  // OMTF
53  Handle<RPCDigiCollection> OMTF_digis;
54  event.getByToken(omtf_token_,OMTF_digis);
55  // CPFF
56  Handle<RPCDigiCollection> CPPF_digis;
57  event.getByToken(cppf_token_,CPPF_digis);
58 
59  // new RPCDigiCollection
60  std::unique_ptr<RPCDigiCollection> rpc_digi_collection(new RPCDigiCollection());
61 
62 
63  // loop over TwinMux digis
64  for (const auto & rpcdgIt : (*TwinMux_digis) ) {
65  // The layerId
66  const RPCDetId& rpcId = rpcdgIt.first;
67  // Get the iterators over the digis associated with this LayerId
68  const RPCDigiCollection::Range& range = rpcdgIt.second;
69 
70  rpc_digi_collection->put(range, rpcId);
71  }
72 
73  // loop over CPPF digis
74  for (const auto && rpcdgIt : (*CPPF_digis) ) {
75  // The layerId
76  const RPCDetId& rpcId = rpcdgIt.first;
77  // Get the iterators over the digis associated with this LayerId
78  const RPCDigiCollection::Range& range = rpcdgIt.second;
79 
80  rpc_digi_collection->put(range, rpcId);
81  }
82 
83  // loop over OMTF digis
84  for (const auto & rpcdgIt : (*OMTF_digis) ) {
85  // The layerId
86  const RPCDetId& rpcId = rpcdgIt.first;
87  // Get the iterators over the digis associated with this LayerId
88  const RPCDigiCollection::Range& range = rpcdgIt.second;
89 
90  // accepts only rings: RE-2_R3 ; RE-1_R3 ; RE+1_R3 ; RE+2_R3 ;
91  if ( ((rpcId.region() == -1 || rpcId.region() == 1) && (rpcId.ring() == 3) && (rpcId.station() == 1 || rpcId.station() == 2)) ) {
92  rpc_digi_collection->put(range, rpcId);
93  }
94  }
95 
96  // "put" into the event
97  event.put(std::move(rpc_digi_collection));
98 }
int ring() const
Definition: RPCDetId.h:72
MuonDigiCollection< RPCDetId, RPCDigi > RPCDigiCollection
edm::EDGetTokenT< RPCDigiCollection > omtf_token_
Definition: RPCDigiMerger.h:39
std::pair< const_iterator, const_iterator > Range
edm::EDGetTokenT< RPCDigiCollection > twinMux_token_
Definition: RPCDigiMerger.h:38
edm::EDGetTokenT< RPCDigiCollection > cppf_token_
Definition: RPCDigiMerger.h:40
def move(src, dest)
Definition: eostools.py:511
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96

Member Data Documentation

edm::EDGetTokenT<RPCDigiCollection> RPCDigiMerger::cppf_token_
protected

Definition at line 40 of file RPCDigiMerger.h.

edm::EDGetTokenT<RPCDigiCollection> RPCDigiMerger::omtf_token_
protected

Definition at line 39 of file RPCDigiMerger.h.

edm::EDGetTokenT<RPCDigiCollection> RPCDigiMerger::twinMux_token_
protected

Definition at line 38 of file RPCDigiMerger.h.