CMS 3D CMS Logo

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

#include <CSCTFTrackProducer.h>

Inheritance diagram for CSCTFTrackProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob ()
 
 CSCTFTrackProducer (const edm::ParameterSet &)
 
void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~CSCTFTrackProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > directProd
 
edm::EDGetTokenT< L1MuDTChambPhContainerdt_producer
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectioninput_module
 
unsigned long long m_ptScaleCacheID
 
unsigned long long m_scalesCacheID
 
CSCTFTrackBuildermy_builder
 
CSCTFDTReceivermy_dtrc
 
bool readDtDirect
 
edm::ParameterSet sp_pset
 
bool TMB07
 
bool useDT
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
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 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 21 of file CSCTFTrackProducer.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file CSCTFTrackProducer.cc.

References directProd, dt_producer, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), input_module, m_ptScaleCacheID, m_scalesCacheID, my_builder, my_dtrc, readDtDirect, sp_pset, TMB07, and useDT.

26 {
27  input_module = consumes<CSCCorrelatedLCTDigiCollection>(pset.getUntrackedParameter<edm::InputTag>("SectorReceiverInput"));
28  dt_producer = consumes<L1MuDTChambPhContainer>(pset.getUntrackedParameter<edm::InputTag>("DTproducer"));
29  directProd = consumes<CSCTriggerContainer<csctf::TrackStub> >(pset.getUntrackedParameter<edm::InputTag>("DtDirectProd"));
30  sp_pset = pset.getParameter<edm::ParameterSet>("SectorProcessor");
31  useDT = pset.getParameter<bool>("useDT");
32  readDtDirect = pset.getParameter<bool>("readDtDirect");
33  TMB07 = pset.getParameter<bool>("isTMB07");
34  my_dtrc = new CSCTFDTReceiver();
35  m_scalesCacheID = 0ULL ;
36  m_ptScaleCacheID = 0ULL ;
37  my_builder = 0 ;
38  produces<L1CSCTrackCollection>();
39  produces<CSCTriggerContainer<csctf::TrackStub> >();
40 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
CSCTFDTReceiver * my_dtrc
unsigned long long m_scalesCacheID
edm::EDGetTokenT< L1MuDTChambPhContainer > dt_producer
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > directProd
CSCTFTrackBuilder * my_builder
unsigned long long m_ptScaleCacheID
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > input_module
edm::ParameterSet sp_pset
CSCTFTrackProducer::~CSCTFTrackProducer ( )
virtual

Definition at line 42 of file CSCTFTrackProducer.cc.

References my_builder, my_dtrc, and NULL.

43 {
44  delete my_dtrc;
45  my_dtrc = NULL;
46 
47  delete my_builder;
48  my_builder = 0;
49 }
CSCTFDTReceiver * my_dtrc
#define NULL
Definition: scimark2.h:8
CSCTFTrackBuilder * my_builder

Member Function Documentation

void CSCTFTrackProducer::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 51 of file CSCTFTrackProducer.cc.

51  {
52  // my_builder->initialize(es);
53 }
void CSCTFTrackProducer::produce ( edm::Event e,
const edm::EventSetup c 
)

Definition at line 55 of file CSCTFTrackProducer.cc.

References CSCTFTrackBuilder::buildTracks(), edm::eventsetup::EventSetupRecord::cacheIdentifier(), directProd, dt_producer, edm::EventSetup::get(), edm::Event::getByToken(), CSCTFTrackBuilder::initialize(), 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, CSCTriggerGeometry::setGeometry(), sp_pset, TMB07, and useDT.

56 {
57  // Update CSCTFTrackBuilder only if the scales have changed. Use the
58  // EventSetup cacheIdentifier to tell when this has happened.
60  c.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != m_ptScaleCacheID )
61  {
62  if(my_builder) delete my_builder ;
63 
65  c.get< L1MuTriggerScalesRcd >().get( scales ) ;
66 
68  c.get< L1MuTriggerPtScaleRcd >().get( ptScale ) ;
69 
71  scales.product(),ptScale.product());
73 
74  m_scalesCacheID = c.get< L1MuTriggerScalesRcd >().cacheIdentifier() ;
75  m_ptScaleCacheID = c.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() ;
76  }
77 
78  // set geometry pointer
80 
81  c.get<MuonGeometryRecord>().get( pDD );
83 
85  std::unique_ptr<L1CSCTrackCollection> track_product(new L1CSCTrackCollection);
86  e.getByToken(input_module, LCTs);
87  std::unique_ptr<CSCTriggerContainer<csctf::TrackStub> > dt_stubs(new CSCTriggerContainer<csctf::TrackStub>);
88 
89  // Either emulate or directly read in DT stubs based on switch
92  if(readDtDirect == false)
93  {
95  e.getByToken(dt_producer, dttrig);
96  emulStub = my_dtrc->process(dttrig.product());
97  } else {
99  //e.getByLabel("csctfunpacker","DT",stubsFromDaq);
100  e.getByToken(directProd, stubsFromDaq);
101  const CSCTriggerContainer<csctf::TrackStub>* stubPointer = stubsFromDaq.product();
102  emulStub.push_many(*stubPointer);
103  }
104 
105  my_builder->buildTracks(LCTs.product(), (useDT?&emulStub:0), track_product.get(), dt_stubs.get());
106 
107  e.put(std::move(track_product));
108  e.put(std::move(dt_stubs));
109 }
const std::vector< Double_t > ptScale
Definition: Utilities.cc:32
unsigned long long cacheIdentifier() const
CSCTFDTReceiver * my_dtrc
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
void initialize(const edm::EventSetup &c)
unsigned long long m_scalesCacheID
std::vector< L1CSCTrack > L1CSCTrackCollection
CSCTriggerContainer< csctf::TrackStub > process(const L1MuDTChambPhContainer *)
static void setGeometry(const edm::ESHandle< CSCGeometry > &thegeom)
edm::EDGetTokenT< L1MuDTChambPhContainer > dt_producer
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > directProd
CSCTFTrackBuilder * my_builder
unsigned long long m_ptScaleCacheID
void push_many(const std::vector< T > &data)
T const * product() const
Definition: Handle.h:81
void buildTracks(const CSCCorrelatedLCTDigiCollection *, const CSCTriggerContainer< csctf::TrackStub > *, L1CSCTrackCollection *, CSCTriggerContainer< csctf::TrackStub > *)
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > input_module
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
edm::ParameterSet sp_pset
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

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

Definition at line 34 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

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

Definition at line 33 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

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

Definition at line 32 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

unsigned long long CSCTFTrackProducer::m_ptScaleCacheID
private

Definition at line 37 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

unsigned long long CSCTFTrackProducer::m_scalesCacheID
private

Definition at line 36 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

CSCTFTrackBuilder* CSCTFTrackProducer::my_builder
private

Definition at line 38 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), produce(), and ~CSCTFTrackProducer().

CSCTFDTReceiver* CSCTFTrackProducer::my_dtrc
private

Definition at line 30 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), produce(), and ~CSCTFTrackProducer().

bool CSCTFTrackProducer::readDtDirect
private

Definition at line 31 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

edm::ParameterSet CSCTFTrackProducer::sp_pset
private

Definition at line 35 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

bool CSCTFTrackProducer::TMB07
private

Definition at line 31 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

bool CSCTFTrackProducer::useDT
private

Definition at line 31 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().