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 }
static Tokens consumes(const edm::ParameterSet &pset, edm::ConsumesCollector iC)
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > m_pDDToken
const edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcd > m_scalesToken
const edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > input_module
T const * product() const
Definition: Handle.h:70
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 *)
unsigned long long cacheIdentifier() const
CSCTFTrackProducer(const edm::ParameterSet &)
const edm::ParameterSet sp_pset
const edm::EDGetTokenT< L1MuDTChambPhContainer > dt_producer
unsigned long long m_ptScaleCacheID
const edm::ESGetToken< L1MuTriggerPtScale, L1MuTriggerPtScaleRcd > m_ptScaleToken
void push_many(const std::vector< T > &data)
const std::vector< double > ptScale
Definition: Utilities.cc:33
CSCTFDTReceiver my_dtrc
const CSCTFTrackBuilder::Tokens m_builderTokens
def move(src, dest)
Definition: eostools.py:511
void produce(edm::Event &e, const edm::EventSetup &c) override