CMS 3D CMS Logo

CSCTFTrackProducer.cc
Go to the documentation of this file.
2 
3 #include <vector>
15 
17  : my_dtrc{},
18  useDT{pset.getParameter<bool>("useDT")},
19  TMB07{pset.getParameter<bool>("isTMB07")},
20  readDtDirect{pset.getParameter<bool>("readDtDirect")},
21  input_module{
22  consumes<CSCCorrelatedLCTDigiCollection>(pset.getUntrackedParameter<edm::InputTag>("SectorReceiverInput"))},
23  dt_producer{consumes<L1MuDTChambPhContainer>(pset.getUntrackedParameter<edm::InputTag>("DTproducer"))},
24  directProd{
25  consumes<CSCTriggerContainer<csctf::TrackStub> >(pset.getUntrackedParameter<edm::InputTag>("DtDirectProd"))},
26  m_scalesToken(esConsumes<L1MuTriggerScales, L1MuTriggerScalesRcd>()),
27  m_ptScaleToken(esConsumes<L1MuTriggerPtScale, L1MuTriggerPtScaleRcd>()),
28  m_pDDToken(esConsumes<CSCGeometry, MuonGeometryRecord>()),
29  sp_pset{pset.getParameter<edm::ParameterSet>("SectorProcessor")},
30  m_builderTokens(CSCTFTrackBuilder::consumes(sp_pset, consumesCollector())) {
31  m_scalesCacheID = 0ULL;
32  m_ptScaleCacheID = 0ULL;
33  produces<L1CSCTrackCollection>();
34  produces<CSCTriggerContainer<csctf::TrackStub> >();
35 
36  //CSCSectorReceiverLUT has a static member it fills by reading a file
37  usesResource("CSCSectorReceiverLUT");
38  //CSCTFSPcoreLogic has non-const static members
39  usesResource("CSCTFSPCoreLogic");
40  //CSCTFPtLUT has a static member it fills by reading a file
41  usesResource("CSCTFPtLUT");
42 }
43 
45  // Update CSCTFTrackBuilder only if the scales have changed. Use the
46  // EventSetup cacheIdentifier to tell when this has happened.
48  c.get<L1MuTriggerPtScaleRcd>().cacheIdentifier() != m_ptScaleCacheID) {
50 
52 
53  my_builder = std::make_unique<CSCTFTrackBuilder>(sp_pset, TMB07, scales.product(), ptScale.product());
54  my_builder->initialize(c, m_builderTokens);
55 
56  m_scalesCacheID = c.get<L1MuTriggerScalesRcd>().cacheIdentifier();
57  m_ptScaleCacheID = c.get<L1MuTriggerPtScaleRcd>().cacheIdentifier();
58  }
59 
60  // set geometry pointer
61  edm::ESHandle<CSCGeometry> pDD = c.getHandle(m_pDDToken);
62 
64  std::unique_ptr<L1CSCTrackCollection> track_product(new L1CSCTrackCollection);
65  e.getByToken(input_module, LCTs);
66  std::unique_ptr<CSCTriggerContainer<csctf::TrackStub> > dt_stubs(new CSCTriggerContainer<csctf::TrackStub>);
67 
68  // Either emulate or directly read in DT stubs based on switch
71  if (readDtDirect == false) {
73  e.getByToken(dt_producer, dttrig);
74  emulStub = my_dtrc.process(dttrig.product());
75  } else {
77  //e.getByLabel("csctfunpacker","DT",stubsFromDaq);
78  e.getByToken(directProd, stubsFromDaq);
79  const CSCTriggerContainer<csctf::TrackStub>* stubPointer = stubsFromDaq.product();
80  emulStub.push_many(*stubPointer);
81  }
82 
83  my_builder->buildTracks(LCTs.product(), (useDT ? &emulStub : nullptr), track_product.get(), dt_stubs.get());
84 
85  e.put(std::move(track_product));
86  e.put(std::move(dt_stubs));
87 }
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
CSCTFTrackProducer::CSCTFTrackProducer
CSCTFTrackProducer(const edm::ParameterSet &)
Definition: CSCTFTrackProducer.cc:16
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:34
CSCTFTrackProducer::m_scalesToken
const edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcd > m_scalesToken
Definition: CSCTFTrackProducer.h:41
CSCTFTrackProducer::useDT
const bool useDT
Definition: CSCTFTrackProducer.h:35
CSCTFTrackProducer::m_ptScaleCacheID
unsigned long long m_ptScaleCacheID
Definition: CSCTFTrackProducer.h:47
CSCTFTrackProducer::m_pDDToken
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > m_pDDToken
Definition: CSCTFTrackProducer.h:43
CSCTFTrackProducer::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition: CSCTFTrackProducer.cc:44
edm::ESHandle
Definition: DTSurvey.h:22
CSCTFTrackProducer::directProd
const edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > directProd
Definition: CSCTFTrackProducer.h:40
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
L1CSCTrackCollection.h
CSCTFTrackProducer::readDtDirect
const bool readDtDirect
Definition: CSCTFTrackProducer.h:37
CSCTFTrackProducer::sp_pset
const edm::ParameterSet sp_pset
Definition: CSCTFTrackProducer.h:44
L1MuTriggerPtScale.h
CSCTriggerContainer.h
L1MuTriggerScales.h
CSCTFTrackProducer::m_scalesCacheID
unsigned long long m_scalesCacheID
Definition: CSCTFTrackProducer.h:46
edm::EventSetup
Definition: EventSetup.h:57
CSCTFTrackProducer::m_ptScaleToken
const edm::ESGetToken< L1MuTriggerPtScale, L1MuTriggerPtScaleRcd > m_ptScaleToken
Definition: CSCTFTrackProducer.h:42
L1MuTriggerPtScaleRcd
Definition: L1MuTriggerPtScaleRcd.h:12
CSCTFTrackProducer::input_module
const edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > input_module
Definition: CSCTFTrackProducer.h:38
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
L1MuDTChambPhContainer.h
ptScale
const std::vector< double > ptScale
Definition: Utilities.cc:33
CSCTFTrackProducer::my_builder
std::unique_ptr< CSCTFTrackBuilder > my_builder
Definition: CSCTFTrackProducer.h:48
L1MuTriggerScalesRcd
Definition: L1MuTriggerScalesRcd.h:12
CSCTFTrackProducer::TMB07
const bool TMB07
Definition: CSCTFTrackProducer.h:36
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:39
edm::eventsetup::EventSetupRecord::cacheIdentifier
unsigned long long cacheIdentifier() const
Definition: EventSetupRecord.h:184
csctfTrackDigis_cfi.readDtDirect
readDtDirect
Definition: csctfTrackDigis_cfi.py:123
CSCTFTrackBuilder::consumes
static Tokens consumes(const edm::ParameterSet &pset, edm::ConsumesCollector iC)
Definition: CSCTFTrackBuilder.h:22
csctfTrackDigis_cfi.useDT
useDT
Definition: csctfTrackDigis_cfi.py:122
edm::Event
Definition: Event.h:73
TrackStub.h
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
CSCTFTrackProducer::m_builderTokens
const CSCTFTrackBuilder::Tokens m_builderTokens
Definition: CSCTFTrackProducer.h:45
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37