Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate RPCPointProducer to a global::EDProducer (76x) #10936

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Expand Up @@ -119,14 +119,24 @@ def customiseFor10418(process):
setattr(process.hltBSoftMuonMu5L3,'algorithmMaskContains', cms.vstring())
return process

# migrate RPCPointProducer to a global::EDProducer (PR #10927)
def customiseFor10927(process):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this number "10972" (instead of 10936 or 10935) matter?

if any(module.type_() is 'RPCPointProducer' for module in process.producers.itervalues()):
if not hasattr(process, 'CSCObjectMapESProducer'):
process.CSCObjectMapESProducer = cms.ESProducer( 'CSCObjectMapESProducer' )
if not hasattr(process, 'DTObjectMapESProducer'):
process.DTObjectMapESProducer = cms.ESProducer( 'DTObjectMapESProducer' )
return process

# CMSSW version specific customizations
def customiseHLTforCMSSW(process,menuType="GRun",fastSim=False):
def customiseHLTforCMSSW(process, menuType="GRun", fastSim=False):
import os
cmsswVersion = os.environ['CMSSW_VERSION']

if cmsswVersion >= "CMSSW_7_6":
process = customiseFor10418(process)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do the lines from customiseFor10927 make it to the 76X setup?
Are they just not needed in the tests running there ? (jenkins tests in 76X appear to pass)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... sorry, the logic is cmsswVersion >= ==> ignore the earlier comment

if cmsswVersion >= "CMSSW_7_5":
process = customiseFor10927(process)
process = customiseFor9232(process)
process = customiseFor8679(process)
process = customiseFor8356(process)
Expand All @@ -136,4 +146,5 @@ def customiseHLTforCMSSW(process,menuType="GRun",fastSim=False):
process = customizeHLTforNewJetCorrectors(process)
if cmsswVersion >= "CMSSW_7_4":
process = customiseFor10234(process)

return process
2 changes: 1 addition & 1 deletion HLTrigger/special/test/testHLTRPCFilter.py
Expand Up @@ -31,7 +31,7 @@
fileName = cms.untracked.string('/tmp/carrillo/afterfilter.root')
)

process.load("RecoLocalMuon.RPCRecHit.rpcPointProducer_cfi")
process.load("RecoLocalMuon.RPCRecHit.rpcPointProducer_cff")
process.load("HLTrigger.special.hltRPCFilter_cfi")

process.selrpc = cms.Path(process.rpcPointProducer*process.hltRPCFilter)
Expand Down
49 changes: 3 additions & 46 deletions RecoLocalMuon/RPCRecHit/interface/CSCSegtoRPC.h
@@ -1,12 +1,12 @@
#ifndef CSCSEGTORPC_H
#define CSCSEGTORPC_H


#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
#include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"


class CSCSegtoRPC {
public:
explicit CSCSegtoRPC(edm::Handle<CSCSegmentCollection> allCSCSegments,const edm::EventSetup& iSetup, const edm::Event& iEvent, bool debug, double eyr);
Expand All @@ -20,47 +20,4 @@ class CSCSegtoRPC {
double MaxD;
};

class CSCStationIndex{
public:
CSCStationIndex():_region(0),_station(0),_ring(0),_chamber(0){}
CSCStationIndex(int region, int station, int ring, int chamber):
_region(region),
_station(station),
_ring(ring),
_chamber(chamber){}
~CSCStationIndex(){}
int region() const {return _region;}
int station() const {return _station;}
int ring() const {return _ring;}
int chamber() const {return _chamber;}
bool operator<(const CSCStationIndex& cscind) const{
if(cscind.region()!=this->region())
return cscind.region()<this->region();
else if(cscind.station()!=this->station())
return cscind.station()<this->station();
else if(cscind.ring()!=this->ring())
return cscind.ring()<this->ring();
else if(cscind.chamber()!=this->chamber())
return cscind.chamber()<this->chamber();
return false;
}

private:
int _region;
int _station;
int _ring;
int _chamber;
};

class ObjectMapCSC{
public:
static ObjectMapCSC* GetInstance(const edm::EventSetup& iSetup);
std::set<RPCDetId> GetRolls(CSCStationIndex cscstationindex){return mapInstance->rollstoreCSC[cscstationindex];}
//protected:
std::map<CSCStationIndex,std::set<RPCDetId> > rollstoreCSC;
ObjectMapCSC(const edm::EventSetup& iSetup);
private:
static ObjectMapCSC* mapInstance;
};

#endif
49 changes: 3 additions & 46 deletions RecoLocalMuon/RPCRecHit/interface/DTSegtoRPC.h
@@ -1,12 +1,12 @@
#ifndef DTSEGTORPC_H
#define DTSEGTORPC_H


#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
#include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"


class DTSegtoRPC {
public:
explicit DTSegtoRPC(edm::Handle<DTRecSegment4DCollection> all4DSegments,const edm::EventSetup& iSetup, const edm::Event& iEvent,bool debug, double eyr);
Expand All @@ -25,47 +25,4 @@ class DTSegtoRPC {
std::vector<uint32_t> extrapolatedRolls;
};

class DTStationIndex{
public:
DTStationIndex():_region(0),_wheel(0),_sector(0),_station(0){}
DTStationIndex(int region, int wheel, int sector, int station) :
_region(region),
_wheel(wheel),
_sector(sector),
_station(station){}
~DTStationIndex(){}
int region() const {return _region;}
int wheel() const {return _wheel;}
int sector() const {return _sector;}
int station() const {return _station;}
bool operator<(const DTStationIndex& dtind) const{
if(dtind.region()!=this->region())
return dtind.region()<this->region();
else if(dtind.wheel()!=this->wheel())
return dtind.wheel()<this->wheel();
else if(dtind.sector()!=this->sector())
return dtind.sector()<this->sector();
else if(dtind.station()!=this->station())
return dtind.station()<this->station();
return false;
}

private:
int _region;
int _wheel;
int _sector;
int _station;
};

class ObjectMap{
public:
static ObjectMap* GetInstance(const edm::EventSetup& iSetup);
std::set<RPCDetId> GetRolls(DTStationIndex dtstationindex){return mapInstance->rollstoreDT[dtstationindex];}
//protected:
std::map<DTStationIndex,std::set<RPCDetId> > rollstoreDT;
ObjectMap(const edm::EventSetup& iSetup);
private:
static ObjectMap* mapInstance;
};

#endif
49 changes: 22 additions & 27 deletions RecoLocalMuon/RPCRecHit/interface/RPCPointProducer.h
@@ -1,15 +1,15 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/global/EDProducer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include <DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h>
#include <DataFormats/CSCRecHit/interface/CSCSegmentCollection.h>
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"

#include "FWCore/Framework/interface/ESHandle.h"
#include <DataFormats/RPCRecHit/interface/RPCRecHit.h>
#include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
#include "DataFormats/MuonDetId/interface/RPCDetId.h"
#include "RecoLocalMuon/RPCRecHit/interface/DTSegtoRPC.h"
#include "RecoLocalMuon/RPCRecHit/interface/CSCSegtoRPC.h"
Expand All @@ -19,31 +19,26 @@
// class decleration
//

class RPCPointProducer : public edm::EDProducer {
class RPCPointProducer : public edm::global::EDProducer<> {
public:
explicit RPCPointProducer(const edm::ParameterSet&);
~RPCPointProducer();
// edm::InputTag cscSegments;
edm::EDGetTokenT<CSCSegmentCollection> cscSegments;
edm::EDGetTokenT<DTRecSegment4DCollection> dt4DSegments;
// edm::InputTag dt4DSegments;
edm::EDGetTokenT<reco::TrackCollection> tracks;
edm::InputTag tracks_;

private:
virtual void beginJob() ;
virtual void produce(edm::Event&, const edm::EventSetup&);
virtual void endJob() ;
bool incldt;
bool inclcsc;
bool incltrack;
bool debug;
double MinCosAng;
double MaxD;
double MaxDrb4;
double MaxDistanceBetweenSegments;
double ExtrapolatedRegion;
edm::ParameterSet trackTransformerParam;
edm::ParameterSet serviceParameters;
// ----------member data ---------------------------
virtual void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;

const edm::EDGetTokenT<CSCSegmentCollection> cscSegments;
const edm::EDGetTokenT<DTRecSegment4DCollection> dt4DSegments;
const edm::EDGetTokenT<reco::TrackCollection> tracks;
const edm::InputTag tracks_;

const bool incldt;
const bool inclcsc;
const bool incltrack;
const bool debug;
const double MinCosAng;
const double MaxD;
const double MaxDrb4;
const double ExtrapolatedRegion;
const edm::ParameterSet trackTransformerParam;
};

92 changes: 2 additions & 90 deletions RecoLocalMuon/RPCRecHit/interface/TracktoRPC.h
Expand Up @@ -3,8 +3,6 @@


#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
Expand Down Expand Up @@ -51,8 +49,7 @@
#include "TrackingTools/TrackRefitter/interface/TrackTransformerForCosmicMuons.h"
#include "TrackingTools/TrackRefitter/interface/TrackTransformerBase.h"
#include "TrackingTools/TrackRefitter/interface/TrackTransformer.h"
//#include "RecoLocalMuon/RPCRecHit/interface/DTSegtoRPC.h"
//#include "RecoLocalMuon/RPCRecHit/interface/CSCSegtoRPC.h"


using reco::MuonCollection;
using reco::TrackCollection;
Expand All @@ -62,7 +59,7 @@ class TracktoRPC {
public:


explicit TracktoRPC(edm::Handle<reco::TrackCollection> alltracks,const edm::EventSetup& iSetup, const edm::Event& iEvent,bool debug, const edm::ParameterSet& iConfig,edm::InputTag& tracklabel);
explicit TracktoRPC(edm::Handle<reco::TrackCollection> alltracks,const edm::EventSetup& iSetup, const edm::Event& iEvent,bool debug, const edm::ParameterSet& iConfig, const edm::InputTag & tracklabel);

~TracktoRPC();
RPCRecHitCollection* thePoints(){return _ThePoints;}
Expand All @@ -77,89 +74,4 @@ class TracktoRPC {
edm::ESHandle<Propagator> thePropagator;
};

class DTStationIndex2{
public:
DTStationIndex2():_region(0),_wheel(0),_sector(0),_station(0){}
DTStationIndex2(int region, int wheel, int sector, int station) :
_region(region),
_wheel(wheel),
_sector(sector),
_station(station){}
~DTStationIndex2(){}
int region() const {return _region;}
int wheel() const {return _wheel;}
int sector() const {return _sector;}
int station() const {return _station;}
bool operator<(const DTStationIndex2& dtind) const{
if(dtind.region()!=this->region())
return dtind.region()<this->region();
else if(dtind.wheel()!=this->wheel())
return dtind.wheel()<this->wheel();
else if(dtind.sector()!=this->sector())
return dtind.sector()<this->sector();
else if(dtind.station()!=this->station())
return dtind.station()<this->station();
return false;
}

private:
int _region;
int _wheel;
int _sector;
int _station;
};

class ObjectMap2{
public:
static ObjectMap2* GetInstance(const edm::EventSetup& iSetup);
std::set<RPCDetId> GetRolls(DTStationIndex2 dtstationindex){return mapInstance->rollstoreDT[dtstationindex];}
//protected:
std::map<DTStationIndex2,std::set<RPCDetId> > rollstoreDT;
ObjectMap2(const edm::EventSetup& iSetup);
private:
static ObjectMap2* mapInstance;
};
class CSCStationIndex2{
public:
CSCStationIndex2():_region(0),_station(0),_ring(0),_chamber(0){}
CSCStationIndex2(int region, int station, int ring, int chamber):
_region(region),
_station(station),
_ring(ring),
_chamber(chamber){}
~CSCStationIndex2(){}
int region() const {return _region;}
int station() const {return _station;}
int ring() const {return _ring;}
int chamber() const {return _chamber;}
bool operator<(const CSCStationIndex2& cscind) const{
if(cscind.region()!=this->region())
return cscind.region()<this->region();
else if(cscind.station()!=this->station())
return cscind.station()<this->station();
else if(cscind.ring()!=this->ring())
return cscind.ring()<this->ring();
else if(cscind.chamber()!=this->chamber())
return cscind.chamber()<this->chamber();
return false;
}

private:
int _region;
int _station;
int _ring;
int _chamber;
};

class ObjectMap2CSC{
public:
static ObjectMap2CSC* GetInstance(const edm::EventSetup& iSetup);
std::set<RPCDetId> GetRolls(CSCStationIndex2 cscstationindex){return mapInstance->rollstoreCSC[cscstationindex];}
//protected:
std::map<CSCStationIndex2,std::set<RPCDetId> > rollstoreCSC;
ObjectMap2CSC(const edm::EventSetup& iSetup);
private:
static ObjectMap2CSC* mapInstance;
};

#endif
8 changes: 8 additions & 0 deletions RecoLocalMuon/RPCRecHit/python/rpcPointProducer_cff.py
@@ -0,0 +1,8 @@
import FWCore.ParameterSet.Config as cms

# EventSetup modules
from RecoLocalMuon.RPCRecHit.cscObjectMapESProducer_cfi import *
from RecoLocalMuon.RPCRecHit.dtObjectMapESProducer_cfi import *

# EDProducer
from RecoLocalMuon.RPCRecHit.rpcPointProducer_cfi import *