CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCTFTrackProducer Class Reference

#include <CSCTFTrackProducer.h>

Inheritance diagram for CSCTFTrackProducer:
edm::one::EDProducer< edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CSCTFTrackProducer (const edm::ParameterSet &)
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

const edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > directProd
 
const edm::EDGetTokenT< L1MuDTChambPhContainerdt_producer
 
const edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectioninput_module
 
unsigned long long m_ptScaleCacheID
 
unsigned long long m_scalesCacheID
 
std::unique_ptr< CSCTFTrackBuildermy_builder
 
CSCTFDTReceiver my_dtrc
 
const bool readDtDirect
 
const edm::ParameterSet sp_pset
 
const bool TMB07
 
const bool useDT
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 22 of file CSCTFTrackProducer.h.

Constructor & Destructor Documentation

CSCTFTrackProducer::CSCTFTrackProducer ( const edm::ParameterSet pset)

Definition at line 24 of file CSCTFTrackProducer.cc.

References directProd, dt_producer, input_module, m_ptScaleCacheID, m_scalesCacheID, muonDTDigis_cfi::pset, readDtDirect, sp_pset, TMB07, and useDT.

24  :
25  my_dtrc{},
26  useDT{pset.getParameter<bool>("useDT")},
27  TMB07{pset.getParameter<bool>("isTMB07")},
28  readDtDirect{pset.getParameter<bool>("readDtDirect")},
29  input_module{consumes<CSCCorrelatedLCTDigiCollection>(pset.getUntrackedParameter<edm::InputTag>("SectorReceiverInput"))},
30  dt_producer{consumes<L1MuDTChambPhContainer>(pset.getUntrackedParameter<edm::InputTag>("DTproducer"))},
31  directProd{consumes<CSCTriggerContainer<csctf::TrackStub> >(pset.getUntrackedParameter<edm::InputTag>("DtDirectProd"))},
32  sp_pset{pset.getParameter<edm::ParameterSet>("SectorProcessor")}
33 {
34  m_scalesCacheID = 0ULL ;
35  m_ptScaleCacheID = 0ULL ;
36  produces<L1CSCTrackCollection>();
37  produces<CSCTriggerContainer<csctf::TrackStub> >();
38 
39  //CSCSectorReceiverLUT has a static member it fills by reading a file
40  usesResource("CSCSectorReceiverLUT");
41  //CSCTFSPcoreLogic has non-const static members
42  usesResource("CSCTFSPCoreLogic");
43  //CSCTFPtLUT has a static member it fills by reading a file
44  usesResource("CSCTFPtLUT");
45 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > input_module
unsigned long long m_scalesCacheID
const edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > directProd
const edm::ParameterSet sp_pset
const edm::EDGetTokenT< L1MuDTChambPhContainer > dt_producer
unsigned long long m_ptScaleCacheID
CSCTFDTReceiver my_dtrc

Member Function Documentation

void CSCTFTrackProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 47 of file CSCTFTrackProducer.cc.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), directProd, dt_producer, edm::EventSetup::get(), edm::Event::getByToken(), input_module, m_ptScaleCacheID, m_scalesCacheID, eostools::move(), my_builder, my_dtrc, CSCTFDTReceiver::process(), edm::Handle< T >::product(), edm::ESHandle< T >::product(), ptScale, CSCTriggerContainer< T >::push_many(), edm::Event::put(), readDtDirect, sp_pset, TMB07, and useDT.

48 {
49  // Update CSCTFTrackBuilder only if the scales have changed. Use the
50  // EventSetup cacheIdentifier to tell when this has happened.
52  c.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != m_ptScaleCacheID )
53  {
55  c.get< L1MuTriggerScalesRcd >().get( scales ) ;
56 
58  c.get< L1MuTriggerPtScaleRcd >().get( ptScale ) ;
59 
60  my_builder = std::make_unique<CSCTFTrackBuilder>(sp_pset,TMB07,
61  scales.product(),ptScale.product());
62  my_builder->initialize(c);
63 
64  m_scalesCacheID = c.get< L1MuTriggerScalesRcd >().cacheIdentifier() ;
65  m_ptScaleCacheID = c.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() ;
66  }
67 
68  // set geometry pointer
70  c.get<MuonGeometryRecord>().get( pDD );
71 
73  std::unique_ptr<L1CSCTrackCollection> track_product(new L1CSCTrackCollection);
74  e.getByToken(input_module, LCTs);
75  std::unique_ptr<CSCTriggerContainer<csctf::TrackStub> > dt_stubs(new CSCTriggerContainer<csctf::TrackStub>);
76 
77  // Either emulate or directly read in DT stubs based on switch
80  if(readDtDirect == false)
81  {
83  e.getByToken(dt_producer, dttrig);
84  emulStub = my_dtrc.process(dttrig.product());
85  } else {
87  //e.getByLabel("csctfunpacker","DT",stubsFromDaq);
88  e.getByToken(directProd, stubsFromDaq);
89  const CSCTriggerContainer<csctf::TrackStub>* stubPointer = stubsFromDaq.product();
90  emulStub.push_many(*stubPointer);
91  }
92 
93  my_builder->buildTracks(LCTs.product(), (useDT?&emulStub:nullptr), track_product.get(), dt_stubs.get());
94 
95  e.put(std::move(track_product));
96  e.put(std::move(dt_stubs));
97 }
unsigned long long cacheIdentifier() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
const edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > input_module
std::unique_ptr< CSCTFTrackBuilder > my_builder
unsigned long long m_scalesCacheID
const edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > directProd
std::vector< L1CSCTrack > L1CSCTrackCollection
CSCTriggerContainer< csctf::TrackStub > process(const L1MuDTChambPhContainer *)
const edm::ParameterSet sp_pset
const edm::EDGetTokenT< L1MuDTChambPhContainer > dt_producer
unsigned long long m_ptScaleCacheID
void push_many(const std::vector< T > &data)
T const * product() const
Definition: Handle.h:74
const std::vector< double > ptScale
Definition: Utilities.cc:35
CSCTFDTReceiver my_dtrc
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

const edm::EDGetTokenT<CSCTriggerContainer<csctf::TrackStub> > CSCTFTrackProducer::directProd
private

Definition at line 35 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

const edm::EDGetTokenT<L1MuDTChambPhContainer> CSCTFTrackProducer::dt_producer
private

Definition at line 34 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

const edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCTFTrackProducer::input_module
private

Definition at line 33 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

unsigned long long CSCTFTrackProducer::m_ptScaleCacheID
private

Definition at line 38 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

unsigned long long CSCTFTrackProducer::m_scalesCacheID
private

Definition at line 37 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

std::unique_ptr<CSCTFTrackBuilder> CSCTFTrackProducer::my_builder
private

Definition at line 39 of file CSCTFTrackProducer.h.

Referenced by produce().

CSCTFDTReceiver CSCTFTrackProducer::my_dtrc
private

Definition at line 29 of file CSCTFTrackProducer.h.

Referenced by produce().

const bool CSCTFTrackProducer::readDtDirect
private

Definition at line 32 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

const edm::ParameterSet CSCTFTrackProducer::sp_pset
private

Definition at line 36 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

const bool CSCTFTrackProducer::TMB07
private

Definition at line 31 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

const bool CSCTFTrackProducer::useDT
private

Definition at line 30 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().