CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
MaskedMeasurementTrackerEventProducer Class Referencefinal
Inheritance diagram for MaskedMeasurementTrackerEventProducer:
edm::stream::EDProducer<>

Public Member Functions

 MaskedMeasurementTrackerEventProducer (const edm::ParameterSet &iConfig)
 
 ~MaskedMeasurementTrackerEventProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Private Types

typedef edm::ContainerMask< edmNew::DetSetVector< Phase2TrackerCluster1D > > Phase2OTMask
 
typedef edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > PixelMask
 
typedef edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > StripMask
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT< Phase2OTMaskmaskPhase2OTs_
 
edm::EDGetTokenT< PixelMaskmaskPixels_
 
edm::EDGetTokenT< StripMaskmaskStrips_
 
bool phase2skipClusters_
 
bool skipClusters_
 
edm::EDGetTokenT< MeasurementTrackerEventsrc_
 

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 8 of file MaskedMeasurementTrackerEventProducer.cc.

Member Typedef Documentation

Definition at line 17 of file MaskedMeasurementTrackerEventProducer.cc.

Definition at line 16 of file MaskedMeasurementTrackerEventProducer.cc.

Definition at line 15 of file MaskedMeasurementTrackerEventProducer.cc.

Constructor & Destructor Documentation

MaskedMeasurementTrackerEventProducer::MaskedMeasurementTrackerEventProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 30 of file MaskedMeasurementTrackerEventProducer.cc.

References HiRegitMuonDetachedTripletStep_cff::clustersToSkip, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), maskPhase2OTs_, maskPixels_, maskStrips_, ConversionStep_cff::phase2clustersToSkip, phase2skipClusters_, and skipClusters_.

30  :
31  src_(consumes<MeasurementTrackerEvent>(iConfig.getParameter<edm::InputTag>("src"))),
32  skipClusters_(false), phase2skipClusters_(false)
33 {
34  //FIXME:temporary solution in order to use this class for both phase0/1 and phase2
35  if (iConfig.existsAs<edm::InputTag>("clustersToSkip")) {
36  skipClusters_ = true;
37  edm::InputTag clustersToSkip = iConfig.getParameter<edm::InputTag>("clustersToSkip");
38  maskPixels_ = consumes<PixelMask>(clustersToSkip);
39  maskStrips_ = consumes<StripMask>(clustersToSkip);
40  }
41  if (iConfig.existsAs<edm::InputTag>("phase2clustersToSkip")) {
42  phase2skipClusters_ = true;
43  edm::InputTag phase2clustersToSkip = iConfig.getParameter<edm::InputTag>("phase2clustersToSkip");
44  maskPixels_ = consumes<PixelMask>(phase2clustersToSkip);
45  maskPhase2OTs_ = consumes<Phase2OTMask>(phase2clustersToSkip);
46  }
47  produces<MeasurementTrackerEvent>();
48 }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
edm::EDGetTokenT< MeasurementTrackerEvent > src_
MaskedMeasurementTrackerEventProducer::~MaskedMeasurementTrackerEventProducer ( )
inlineoverride

Definition at line 11 of file MaskedMeasurementTrackerEventProducer.cc.

11 {}

Member Function Documentation

void MaskedMeasurementTrackerEventProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 51 of file MaskedMeasurementTrackerEventProducer.cc.

References DEFINE_FWK_MODULE, edm::Event::getByToken(), maskPhase2OTs_, maskPixels_, maskStrips_, eostools::move(), MillePedeFileConverter_cfg::out, phase2skipClusters_, edm::Event::put(), skipClusters_, and src_.

52 {
54  iEvent.getByToken(src_, mte);
55 
56  // prepare output
57  std::unique_ptr<MeasurementTrackerEvent> out;
58 
59  if (skipClusters_) {
60 
61  edm::Handle<PixelMask> maskPixels;
62  iEvent.getByToken(maskPixels_, maskPixels);
63  edm::Handle<StripMask> maskStrips;
64  iEvent.getByToken(maskStrips_, maskStrips);
65 
66  out = std::make_unique<MeasurementTrackerEvent>(*mte, *maskStrips, *maskPixels);
67 
68  } else if (phase2skipClusters_) {
69 
70  edm::Handle<PixelMask> maskPixels;
71  iEvent.getByToken(maskPixels_, maskPixels);
72  edm::Handle<Phase2OTMask> maskPhase2OTs;
73  iEvent.getByToken(maskPhase2OTs_, maskPhase2OTs);
74 
75  out = std::make_unique<MeasurementTrackerEvent>(*mte, *maskPixels, *maskPhase2OTs);
76  }
77 
78  // put into event
79  iEvent.put(std::move(out));
80 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
edm::EDGetTokenT< MeasurementTrackerEvent > src_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::EDGetTokenT<Phase2OTMask> MaskedMeasurementTrackerEventProducer::maskPhase2OTs_
private
edm::EDGetTokenT<PixelMask> MaskedMeasurementTrackerEventProducer::maskPixels_
private
edm::EDGetTokenT<StripMask> MaskedMeasurementTrackerEventProducer::maskStrips_
private
bool MaskedMeasurementTrackerEventProducer::phase2skipClusters_
private
bool MaskedMeasurementTrackerEventProducer::skipClusters_
private
edm::EDGetTokenT<MeasurementTrackerEvent> MaskedMeasurementTrackerEventProducer::src_
private

Definition at line 19 of file MaskedMeasurementTrackerEventProducer.cc.

Referenced by produce().