CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCTFTrackProducer Class Reference

#include <CSCTFTrackProducer.h>

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

List of all members.

Public Member Functions

void beginJob ()
 CSCTFTrackProducer (const edm::ParameterSet &)
void produce (edm::Event &e, const edm::EventSetup &c)
virtual ~CSCTFTrackProducer ()

Private Attributes

edm::InputTag directProd
edm::InputTag dt_producer
edm::InputTag input_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

Detailed Description

Definition at line 14 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.

{
  input_module = pset.getUntrackedParameter<edm::InputTag>("SectorReceiverInput");
  dt_producer  = pset.getUntrackedParameter<edm::InputTag>("DTproducer");
  directProd   = pset.getUntrackedParameter<edm::InputTag>("DtDirectProd");
  sp_pset = pset.getParameter<edm::ParameterSet>("SectorProcessor");
  useDT = pset.getParameter<bool>("useDT");
  readDtDirect = pset.getParameter<bool>("readDtDirect");
  TMB07 = pset.getParameter<bool>("isTMB07");
  my_dtrc = new CSCTFDTReceiver();
  m_scalesCacheID = 0ULL ;
  m_ptScaleCacheID = 0ULL ;
  my_builder = 0 ;
  produces<L1CSCTrackCollection>();
  produces<CSCTriggerContainer<csctf::TrackStub> >();
}
CSCTFTrackProducer::~CSCTFTrackProducer ( ) [virtual]

Definition at line 42 of file CSCTFTrackProducer.cc.

References my_builder, my_dtrc, and NULL.

{
  delete my_dtrc;
  my_dtrc = NULL;

  delete my_builder;
  my_builder = 0;
}

Member Function Documentation

void CSCTFTrackProducer::beginJob ( void  ) [virtual]

Reimplemented from edm::EDProducer.

Definition at line 51 of file CSCTFTrackProducer.cc.

                                 {
  //  my_builder->initialize(es);
}
void CSCTFTrackProducer::produce ( edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDProducer.

Definition at line 55 of file CSCTFTrackProducer.cc.

References CSCTFTrackBuilder::buildTracks(), edm::eventsetup::EventSetupRecord::cacheIdentifier(), directProd, dt_producer, edm::EventSetup::get(), edm::Event::getByLabel(), CSCTFTrackBuilder::initialize(), input_module, edm::InputTag::instance(), edm::InputTag::label(), m_ptScaleCacheID, m_scalesCacheID, my_builder, my_dtrc, CSCTFDTReceiver::process(), edm::ESHandle< T >::product(), edm::Handle< T >::product(), CSCTriggerContainer< T >::push_many(), edm::Event::put(), readDtDirect, CSCTriggerGeometry::setGeometry(), sp_pset, TMB07, and useDT.

{
  // Update CSCTFTrackBuilder only if the scales have changed.  Use the
  // EventSetup cacheIdentifier to tell when this has happened.
  if(  c.get< L1MuTriggerScalesRcd >().cacheIdentifier() != m_scalesCacheID ||
       c.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != m_ptScaleCacheID )
    {
      if(my_builder) delete my_builder ;

      edm::ESHandle< L1MuTriggerScales > scales ;
      c.get< L1MuTriggerScalesRcd >().get( scales ) ;

      edm::ESHandle< L1MuTriggerPtScale > ptScale ;
      c.get< L1MuTriggerPtScaleRcd >().get( ptScale ) ;

      my_builder = new CSCTFTrackBuilder(sp_pset,TMB07,
                                         scales.product(),ptScale.product());
      my_builder->initialize(c);

      m_scalesCacheID = c.get< L1MuTriggerScalesRcd >().cacheIdentifier() ;
      m_ptScaleCacheID = c.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() ;
    }

  // set geometry pointer
  edm::ESHandle<CSCGeometry> pDD;

  c.get<MuonGeometryRecord>().get( pDD );
  CSCTriggerGeometry::setGeometry(pDD);

  edm::Handle<CSCCorrelatedLCTDigiCollection> LCTs;
  std::auto_ptr<L1CSCTrackCollection> track_product(new L1CSCTrackCollection);
  e.getByLabel(input_module.label(),input_module.instance(), LCTs);
  std::auto_ptr<CSCTriggerContainer<csctf::TrackStub> > dt_stubs(new CSCTriggerContainer<csctf::TrackStub>);
 
  // Either emulate or directly read in DT stubs based on switch
  CSCTriggerContainer<csctf::TrackStub> emulStub;
  if(readDtDirect == false)
  {
    edm::Handle<L1MuDTChambPhContainer> dttrig;
        e.getByLabel(dt_producer.label(),dt_producer.instance(), dttrig);
        emulStub = my_dtrc->process(dttrig.product());
  } else {
    edm::Handle<CSCTriggerContainer<csctf::TrackStub> > stubsFromDaq;
    //e.getByLabel("csctfunpacker","DT",stubsFromDaq);
        e.getByLabel(directProd.label(),directProd.instance(), stubsFromDaq);
        const CSCTriggerContainer<csctf::TrackStub>* stubPointer = stubsFromDaq.product();
        emulStub.push_many(*stubPointer);
  } 

  my_builder->buildTracks(LCTs.product(), (useDT?&emulStub:0), track_product.get(), dt_stubs.get());

  e.put(track_product);
  e.put(dt_stubs);
}

Member Data Documentation

Definition at line 25 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

Definition at line 25 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

Definition at line 25 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

unsigned long long CSCTFTrackProducer::m_ptScaleCacheID [private]

Definition at line 28 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

unsigned long long CSCTFTrackProducer::m_scalesCacheID [private]

Definition at line 27 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

Definition at line 29 of file CSCTFTrackProducer.h.

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

Definition at line 23 of file CSCTFTrackProducer.h.

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

Definition at line 24 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

Definition at line 26 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

bool CSCTFTrackProducer::TMB07 [private]

Definition at line 24 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().

bool CSCTFTrackProducer::useDT [private]

Definition at line 24 of file CSCTFTrackProducer.h.

Referenced by CSCTFTrackProducer(), and produce().