CMS 3D CMS Logo

CSCTFTrackProducer.cc
Go to the documentation of this file.
2 
3 #include <vector>
9 
12 
17 
22 
24  : my_dtrc{},
25  useDT{pset.getParameter<bool>("useDT")},
26  TMB07{pset.getParameter<bool>("isTMB07")},
27  readDtDirect{pset.getParameter<bool>("readDtDirect")},
28  input_module{
29  consumes<CSCCorrelatedLCTDigiCollection>(pset.getUntrackedParameter<edm::InputTag>("SectorReceiverInput"))},
30  dt_producer{consumes<L1MuDTChambPhContainer>(pset.getUntrackedParameter<edm::InputTag>("DTproducer"))},
31  directProd{
32  consumes<CSCTriggerContainer<csctf::TrackStub> >(pset.getUntrackedParameter<edm::InputTag>("DtDirectProd"))},
33  sp_pset{pset.getParameter<edm::ParameterSet>("SectorProcessor")} {
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 }
46 
48  // Update CSCTFTrackBuilder only if the scales have changed. Use the
49  // EventSetup cacheIdentifier to tell when this has happened.
51  c.get<L1MuTriggerPtScaleRcd>().cacheIdentifier() != m_ptScaleCacheID) {
53  c.get<L1MuTriggerScalesRcd>().get(scales);
54 
57 
58  my_builder = std::make_unique<CSCTFTrackBuilder>(sp_pset, TMB07, scales.product(), ptScale.product());
59  my_builder->initialize(c);
60 
61  m_scalesCacheID = c.get<L1MuTriggerScalesRcd>().cacheIdentifier();
62  m_ptScaleCacheID = c.get<L1MuTriggerPtScaleRcd>().cacheIdentifier();
63  }
64 
65  // set geometry pointer
67  c.get<MuonGeometryRecord>().get(pDD);
68 
70  std::unique_ptr<L1CSCTrackCollection> track_product(new L1CSCTrackCollection);
71  e.getByToken(input_module, LCTs);
72  std::unique_ptr<CSCTriggerContainer<csctf::TrackStub> > dt_stubs(new CSCTriggerContainer<csctf::TrackStub>);
73 
74  // Either emulate or directly read in DT stubs based on switch
77  if (readDtDirect == false) {
79  e.getByToken(dt_producer, dttrig);
80  emulStub = my_dtrc.process(dttrig.product());
81  } else {
83  //e.getByLabel("csctfunpacker","DT",stubsFromDaq);
84  e.getByToken(directProd, stubsFromDaq);
85  const CSCTriggerContainer<csctf::TrackStub>* stubPointer = stubsFromDaq.product();
86  emulStub.push_many(*stubPointer);
87  }
88 
89  my_builder->buildTracks(LCTs.product(), (useDT ? &emulStub : nullptr), track_product.get(), dt_stubs.get());
90 
91  e.put(std::move(track_product));
92  e.put(std::move(dt_stubs));
93 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
Handle.h
CSCCorrelatedLCTDigiCollection.h
CSCTFDTReceiver::process
CSCTriggerContainer< csctf::TrackStub > process(const L1MuDTChambPhContainer *)
Definition: CSCTFDTReceiver.cc:12
edm::Handle::product
T const * product() const
Definition: Handle.h:70
ESHandle.h
L1MuTriggerPtScaleRcd.h
CSCTFTrackProducer::CSCTFTrackProducer
CSCTFTrackProducer(const edm::ParameterSet &)
Definition: CSCTFTrackProducer.cc:23
L1MuTriggerScalesRcd.h
CSCTriggerContainer::push_many
void push_many(const std::vector< T > &data)
Definition: CSCTriggerContainer.h:52
L1CSCTrackCollection
std::vector< L1CSCTrack > L1CSCTrackCollection
Definition: L1CSCTrackCollection.h:8
edm::Handle< CSCCorrelatedLCTDigiCollection >
CSCTFTrackProducer::my_dtrc
CSCTFDTReceiver my_dtrc
Definition: CSCTFTrackProducer.h:29
CSCTFTrackProducer::useDT
const bool useDT
Definition: CSCTFTrackProducer.h:30
CSCTFTrackProducer::m_ptScaleCacheID
unsigned long long m_ptScaleCacheID
Definition: CSCTFTrackProducer.h:38
CSCTFTrackProducer::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition: CSCTFTrackProducer.cc:47
edm::ESHandle
Definition: DTSurvey.h:22
CSCTFTrackProducer::directProd
const edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > directProd
Definition: CSCTFTrackProducer.h:35
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
L1CSCTrackCollection.h
CSCTFTrackProducer::readDtDirect
const bool readDtDirect
Definition: CSCTFTrackProducer.h:32
CSCTFTrackProducer::sp_pset
const edm::ParameterSet sp_pset
Definition: CSCTFTrackProducer.h:36
L1MuTriggerPtScale.h
CSCTriggerContainer.h
L1MuTriggerScales.h
CSCTFTrackProducer::m_scalesCacheID
unsigned long long m_scalesCacheID
Definition: CSCTFTrackProducer.h:37
edm::EventSetup
Definition: EventSetup.h:57
L1MuTriggerPtScaleRcd
Definition: L1MuTriggerPtScaleRcd.h:12
CSCTFTrackProducer::input_module
const edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > input_module
Definition: CSCTFTrackProducer.h:33
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
L1MuDTChambPhContainer.h
ptScale
const std::vector< double > ptScale
Definition: Utilities.cc:33
get
#define get
CSCTFTrackProducer::my_builder
std::unique_ptr< CSCTFTrackBuilder > my_builder
Definition: CSCTFTrackProducer.h:39
L1MuTriggerScalesRcd
Definition: L1MuTriggerScalesRcd.h:12
CSCTFTrackProducer::TMB07
const bool TMB07
Definition: CSCTFTrackProducer.h:31
eostools.move
def move(src, dest)
Definition: eostools.py:511
CSCTriggerContainer< csctf::TrackStub >
EventSetup.h
CSCTFTrackProducer.h
CSCTFTrackProducer::dt_producer
const edm::EDGetTokenT< L1MuDTChambPhContainer > dt_producer
Definition: CSCTFTrackProducer.h:34
edm::eventsetup::EventSetupRecord::cacheIdentifier
unsigned long long cacheIdentifier() const
Definition: EventSetupRecord.h:185
csctfTrackDigis_cfi.readDtDirect
readDtDirect
Definition: csctfTrackDigis_cfi.py:123
csctfTrackDigis_cfi.useDT
useDT
Definition: csctfTrackDigis_cfi.py:122
MuonGeometryRecord.h
edm::Event
Definition: Event.h:73
TrackStub.h
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
CSCGeometry.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37