CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CSCTriggerPrimitivesProducer Class Reference

#include <CSCTriggerPrimitivesProducer.h>

Inheritance diagram for CSCTriggerPrimitivesProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CSCTriggerPrimitivesProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~CSCTriggerPrimitivesProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool checkBadChambers_
 
edm::InputTag compDigiProducer_
 
bool debugParameters_
 
int iev
 
CSCTriggerPrimitivesBuilderlctBuilder_
 
edm::InputTag wireDigiProducer_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Implementation of the local Level-1 Cathode Strip Chamber trigger. Simulates functionalities of the anode and cathode Local Charged Tracks (LCT) processors, of the Trigger Mother Board (TMB), and of the Muon Port Card (MPC).

Input to the simulation are collections of the CSC wire and comparator digis.

Produces four collections of the Level-1 CSC Trigger Primitives (track stubs, or LCTs): anode LCTs (ALCTs), cathode LCTs (CLCTs), correlated LCTs at TMB, and correlated LCTs at MPC.

Author
Slava Valuev, UCLA.

Definition at line 31 of file CSCTriggerPrimitivesProducer.h.

Constructor & Destructor Documentation

CSCTriggerPrimitivesProducer::CSCTriggerPrimitivesProducer ( const edm::ParameterSet conf)
explicit

Definition at line 37 of file CSCTriggerPrimitivesProducer.cc.

References checkBadChambers_, compDigiProducer_, debugParameters_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), lctBuilder_, and wireDigiProducer_.

37  : iev(0) {
38 
39  // if false, parameters will be read in from DB using EventSetup mechanism
40  // else will use all parameters from the config file
41  debugParameters_ = conf.getUntrackedParameter<bool>("debugParameters",false);
42 
43  wireDigiProducer_ = conf.getParameter<edm::InputTag>("CSCWireDigiProducer");
44  compDigiProducer_ = conf.getParameter<edm::InputTag>("CSCComparatorDigiProducer");
45  checkBadChambers_ = conf.getUntrackedParameter<bool>("checkBadChambers", true);
46 
47  lctBuilder_ = new CSCTriggerPrimitivesBuilder(conf); // pass on the conf
48 
49  // register what this produces
50  produces<CSCALCTDigiCollection>();
51  produces<CSCCLCTDigiCollection>();
52  produces<CSCCLCTPreTriggerCollection>();
53  produces<CSCCorrelatedLCTDigiCollection>();
54  produces<CSCCorrelatedLCTDigiCollection>("MPCSORTED");
55 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
CSCTriggerPrimitivesBuilder * lctBuilder_
CSCTriggerPrimitivesProducer::~CSCTriggerPrimitivesProducer ( )

Definition at line 57 of file CSCTriggerPrimitivesProducer.cc.

References iev, lctBuilder_, and LogDebug.

57  {
58  LogDebug("L1CSCTrigger")
59  << "deleting trigger primitives after " << iev << " events.";
60  delete lctBuilder_;
61 }
#define LogDebug(id)
CSCTriggerPrimitivesBuilder * lctBuilder_

Member Function Documentation

void CSCTriggerPrimitivesProducer::produce ( edm::Event ev,
const edm::EventSetup setup 
)
virtual

Implements edm::EDProducer.

Definition at line 66 of file CSCTriggerPrimitivesProducer.cc.

References CSCTriggerPrimitivesBuilder::build(), checkBadChambers_, compDigiProducer_, dbtoconf::conf, debugParameters_, edm::EventSetup::get(), edm::Event::getByLabel(), h, iev, edm::InputTag::instance(), edm::HandleBase::isValid(), edm::InputTag::label(), lctBuilder_, LogDebug, edm::Handle< T >::product(), edm::ESHandle< class >::product(), edm::Event::put(), CSCTriggerPrimitivesBuilder::setConfigParameters(), CSCTriggerGeometry::setGeometry(), groupFilesInBlocks::temp, and wireDigiProducer_.

67  {
68 
69  LogDebug("L1CSCTrigger") << "start producing LCTs for event " << ++iev;
70 
71  // Find the geometry (& conditions?) for this event & cache it in
72  // CSCTriggerGeometry.
73  {
75  setup.get<MuonGeometryRecord>().get(h);
77  }
78 
79  // Find conditions data for bad chambers.
80  edm::ESHandle<CSCBadChambers> pBadChambers;
81  setup.get<CSCBadChambersRcd>().get(pBadChambers);
82 
83  // If !debugParameters then get config parameters using EventSetup mechanism.
84  // This must be done in produce() for every event and not in beginJob()
85  // (see mail from Jim Brooke sent to hn-cms-L1TrigEmulator on July 30, 2007).
86  if (!debugParameters_) {
88  setup.get<CSCDBL1TPParametersRcd>().get(conf);
89  if (conf.product() == 0) {
90  edm::LogError("L1CSCTPEmulatorConfigError")
91  << "+++ Failed to find a CSCDBL1TPParametersRcd in EventSetup! +++\n"
92  << "+++ Cannot continue emulation without these parameters +++\n";
93  return;
94  }
96  }
97 
98  // Get the collections of comparator & wire digis from event.
103 
104  // Create empty collections of ALCTs, CLCTs, and correlated LCTs upstream
105  // and downstream of MPC.
106  std::auto_ptr<CSCALCTDigiCollection> oc_alct(new CSCALCTDigiCollection);
107  std::auto_ptr<CSCCLCTDigiCollection> oc_clct(new CSCCLCTDigiCollection);
108  std::auto_ptr<CSCCLCTPreTriggerCollection> oc_pretrig(new CSCCLCTPreTriggerCollection);
109  std::auto_ptr<CSCCorrelatedLCTDigiCollection> oc_lct(new CSCCorrelatedLCTDigiCollection);
110  std::auto_ptr<CSCCorrelatedLCTDigiCollection> oc_sorted_lct(new CSCCorrelatedLCTDigiCollection);
111 
112  if (!wireDigis.isValid()) {
113  edm::LogWarning("L1CSCTPEmulatorNoInputCollection")
114  << "+++ Warning: Collection of wire digis with label "
116  << " requested in configuration, but not found in the event..."
117  << " Skipping production of CSC TP digis +++\n";
118  }
119  if (!compDigis.isValid()) {
120  edm::LogWarning("L1CSCTPEmulatorNoInputCollection")
121  << "+++ Warning: Collection of comparator digis with label "
123  << " requested in configuration, but not found in the event..."
124  << " Skipping production of CSC TP digis +++\n";
125  }
126  // Fill output collections if valid input collections are available.
127  if (wireDigis.isValid() && compDigis.isValid()) {
128  const CSCBadChambers* temp = checkBadChambers_ ? pBadChambers.product() : new CSCBadChambers;
129  lctBuilder_->build(temp,
130  wireDigis.product(), compDigis.product(),
131  *oc_alct, *oc_clct, *oc_pretrig, *oc_lct, *oc_sorted_lct);
132  if (!checkBadChambers_)
133  delete temp;
134  }
135 
136  // Put collections in event.
137  ev.put(oc_alct);
138  ev.put(oc_clct);
139  ev.put(oc_pretrig);
140  ev.put(oc_lct);
141  ev.put(oc_sorted_lct,"MPCSORTED");
142 }
#define LogDebug(id)
void build(const CSCBadChambers *badChambers, const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, CSCALCTDigiCollection &oc_alct, CSCCLCTDigiCollection &oc_clct, CSCCLCTPreTriggerCollection &oc_pretrig, CSCCorrelatedLCTDigiCollection &oc_lct, CSCCorrelatedLCTDigiCollection &oc_sorted_lct)
static void setGeometry(const edm::ESHandle< CSCGeometry > &thegeom)
void setConfigParameters(const CSCDBL1TPParameters *conf)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
tuple conf
Definition: dbtoconf.py:185
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
CSCTriggerPrimitivesBuilder * lctBuilder_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:81
std::string const & label() const
Definition: InputTag.h:42
std::string const & instance() const
Definition: InputTag.h:43

Member Data Documentation

bool CSCTriggerPrimitivesProducer::checkBadChambers_
private

Definition at line 47 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

edm::InputTag CSCTriggerPrimitivesProducer::compDigiProducer_
private

Definition at line 42 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

bool CSCTriggerPrimitivesProducer::debugParameters_
private

Definition at line 45 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

int CSCTriggerPrimitivesProducer::iev
private

Definition at line 41 of file CSCTriggerPrimitivesProducer.h.

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

CSCTriggerPrimitivesBuilder* CSCTriggerPrimitivesProducer::lctBuilder_
private
edm::InputTag CSCTriggerPrimitivesProducer::wireDigiProducer_
private

Definition at line 43 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().