CMS 3D CMS Logo

CSCTFTrackProducer.cc
Go to the documentation of this file.
2 
3 
4 #include <vector>
10 
13 
18 
23 
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 }
46 
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:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
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 *)
CSCTFTrackProducer(const edm::ParameterSet &)
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:81
const std::vector< double > ptScale
Definition: Utilities.cc:35
CSCTFDTReceiver my_dtrc
T get() const
Definition: EventSetup.h:68
T const * product() const
Definition: ESHandle.h:84
def move(src, dest)
Definition: eostools.py:511
void produce(edm::Event &e, const edm::EventSetup &c) override