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::one::EDProducer< edm::one::SharedResources > edm::one::EDProducerBase 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::one::EDProducer< edm::one::SharedResources >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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::EDGetTokenT
< CSCComparatorDigiCollection
comp_token_
 
edm::InputTag compDigiProducer_
 
bool debugParameters_
 
edm::EDGetTokenT
< GEMPadDigiCollection
gem_pad_token_
 
edm::InputTag gemPadDigiProducer_
 
int iev
 
std::unique_ptr
< CSCTriggerPrimitivesBuilder
lctBuilder_
 
edm::EDGetTokenT
< RPCDigiCollection
rpc_digi_token_
 
edm::InputTag rpcDigiProducer_
 
edm::EDGetTokenT
< CSCWireDigiCollection
wire_token_
 
edm::InputTag wireDigiProducer_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 37 of file CSCTriggerPrimitivesProducer.h.

Constructor & Destructor Documentation

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

Definition at line 42 of file CSCTriggerPrimitivesProducer.cc.

References checkBadChambers_, comp_token_, compDigiProducer_, debugParameters_, edm::ParameterSet::existsAs(), gem_pad_token_, gemPadDigiProducer_, edm::ParameterSet::getParameter(), HLT_25ns10e33_v2_cff::InputTag, lctBuilder_, rpc_digi_token_, rpcDigiProducer_, wire_token_, and wireDigiProducer_.

42  : iev(0) {
43 
44  // if false, parameters will be read in from DB using EventSetup mechanism
45  // else will use all parameters from the config file
46  debugParameters_ = conf.getParameter<bool>("debugParameters");
47 
48  wireDigiProducer_ = conf.getParameter<edm::InputTag>("CSCWireDigiProducer");
49  compDigiProducer_ = conf.getParameter<edm::InputTag>("CSCComparatorDigiProducer");
50  gemPadDigiProducer_ = conf.existsAs<edm::InputTag>("GEMPadDigiProducer")?conf.getParameter<edm::InputTag>("GEMPadDigiProducer"):edm::InputTag("");
51  rpcDigiProducer_ = conf.existsAs<edm::InputTag>("RPCDigiProducer")?conf.getParameter<edm::InputTag>("RPCDigiProducer"):edm::InputTag("");
52  checkBadChambers_ = conf.getParameter<bool>("checkBadChambers");
53  lctBuilder_.reset( new CSCTriggerPrimitivesBuilder(conf) ); // pass on the conf
54 
55  wire_token_ = consumes<CSCWireDigiCollection>(wireDigiProducer_);
56  comp_token_ = consumes<CSCComparatorDigiCollection>(compDigiProducer_);
57  gem_pad_token_ = consumes<GEMPadDigiCollection>(gemPadDigiProducer_);
58  rpc_digi_token_ = consumes<RPCDigiCollection>(rpcDigiProducer_);
59 
60  // register what this produces
61  produces<CSCALCTDigiCollection>();
62  produces<CSCCLCTDigiCollection>();
63  produces<CSCCLCTPreTriggerCollection>();
64  produces<CSCCorrelatedLCTDigiCollection>();
65  produces<CSCCorrelatedLCTDigiCollection>("MPCSORTED");
66  produces<GEMCoPadDigiCollection>();
67  produces<GEMCSCLCTDigiCollection>();
68  usesResource("CSCTriggerGeometry");
69  consumes<CSCComparatorDigiCollection>(compDigiProducer_);
70  consumes<CSCWireDigiCollection>(wireDigiProducer_);
71  consumes<GEMPadDigiCollection>(gemPadDigiProducer_);
72  consumes<RPCDigiCollection>(rpcDigiProducer_);
73 }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
edm::EDGetTokenT< CSCComparatorDigiCollection > comp_token_
edm::EDGetTokenT< RPCDigiCollection > rpc_digi_token_
edm::EDGetTokenT< GEMPadDigiCollection > gem_pad_token_
edm::EDGetTokenT< CSCWireDigiCollection > wire_token_
std::unique_ptr< CSCTriggerPrimitivesBuilder > lctBuilder_
CSCTriggerPrimitivesProducer::~CSCTriggerPrimitivesProducer ( )

Definition at line 75 of file CSCTriggerPrimitivesProducer.cc.

References iev, and LogDebug.

75  {
76  LogDebug("L1CSCTrigger")
77  << "deleting trigger primitives after " << iev << " events.";
78 }
#define LogDebug(id)

Member Function Documentation

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

Implements edm::one::EDProducerBase.

Definition at line 83 of file CSCTriggerPrimitivesProducer.cc.

References checkBadChambers_, comp_token_, compDigiProducer_, debugParameters_, alignCSCRings::e, edm::Event::eventAuxiliary(), gem_pad_token_, gemPadDigiProducer_, edm::EventSetup::get(), edm::Event::getByToken(), h, iev, edm::EventAuxiliary::isRealData(), edm::HandleBase::isValid(), edm::InputTag::label(), lctBuilder_, LogDebug, edm::Handle< T >::product(), edm::ESHandle< class >::product(), edm::Event::put(), rpc_digi_token_, rpcDigiProducer_, CSCTriggerGeometry::setGeometry(), groupFilesInBlocks::temp, wire_token_, and wireDigiProducer_.

84  {
85 
86  LogDebug("L1CSCTrigger") << "start producing LCTs for event " << ++iev;
87 
88  // Find the geometry (& conditions?) for this event & cache it in
89  // CSCTriggerGeometry.
90  {
92  setup.get<MuonGeometryRecord>().get(h);
94  lctBuilder_->setCSCGeometry(&*h);
95 
97  try {
98  setup.get<MuonGeometryRecord>().get(h_gem);
99  lctBuilder_->setGEMGeometry(&*h_gem);
101  edm::LogInfo("L1CSCTPEmulatorNoGEMGeometry")
102  << "+++ Info: GEM geometry is unavailable. Running CSC-only trigger algorithm. +++\n";
103  }
104 
106  try {
107  setup.get<MuonGeometryRecord>().get(h_rpc);
108  lctBuilder_->setRPCGeometry(&*h_rpc);
110  edm::LogInfo("L1CSCTPEmulatorNoRPCGeometry")
111  << "+++ Info: RPC geometry is unavailable. Running CSC-only trigger algorithm. +++\n";
112  }
113  }
114 
115  // Find conditions data for bad chambers.
116  edm::ESHandle<CSCBadChambers> pBadChambers;
117  setup.get<CSCBadChambersRcd>().get(pBadChambers);
118 
119  // If !debugParameters then get config parameters using EventSetup mechanism.
120  // This must be done in produce() for every event and not in beginJob()
121  // (see mail from Jim Brooke sent to hn-cms-L1TrigEmulator on July 30, 2007).
122  if (!debugParameters_) {
124  setup.get<CSCDBL1TPParametersRcd>().get(conf);
125  if (conf.product() == 0) {
126  edm::LogError("L1CSCTPEmulatorConfigError")
127  << "+++ Failed to find a CSCDBL1TPParametersRcd in EventSetup! +++\n"
128  << "+++ Cannot continue emulation without these parameters +++\n";
129  return;
130  }
131  lctBuilder_->setConfigParameters(conf.product());
132  }
133 
134  // temporary hack to run on data
135  lctBuilder_->runOnData(ev.eventAuxiliary().isRealData());
136 
137  // Get the collections of comparator & wire digis from event.
140  // ev.getByLabel(compDigiProducer_.label(), compDigiProducer_.instance(), compDigis);
141  // ev.getByLabel(wireDigiProducer_.label(), wireDigiProducer_.instance(), wireDigis);
142  ev.getByToken(comp_token_, compDigis);
143  ev.getByToken(wire_token_, wireDigis);
144 
145 
146  const GEMPadDigiCollection *gemPads = nullptr;
147  if (!gemPadDigiProducer_.label().empty()) {
149  ev.getByToken(gem_pad_token_, gemPadDigis);
150  gemPads = gemPadDigis.product();
151  }
152 
153  const RPCDigiCollection *rpcDigis = nullptr;
154  if (!rpcDigiProducer_.label().empty()) {
156  ev.getByToken(rpc_digi_token_, rpcs);
157  rpcDigis = rpcs.product();
158  }
159 
160  // Create empty collections of ALCTs, CLCTs, and correlated LCTs upstream
161  // and downstream of MPC.
162  std::auto_ptr<CSCALCTDigiCollection> oc_alct(new CSCALCTDigiCollection);
163  std::auto_ptr<CSCCLCTDigiCollection> oc_clct(new CSCCLCTDigiCollection);
164  std::auto_ptr<CSCCLCTPreTriggerCollection> oc_pretrig(new CSCCLCTPreTriggerCollection);
165  std::auto_ptr<CSCCorrelatedLCTDigiCollection> oc_lct(new CSCCorrelatedLCTDigiCollection);
166  std::auto_ptr<CSCCorrelatedLCTDigiCollection> oc_sorted_lct(new CSCCorrelatedLCTDigiCollection);
167  std::auto_ptr<GEMCoPadDigiCollection> oc_gemcopad(new GEMCoPadDigiCollection);
168  std::auto_ptr<GEMCSCLCTDigiCollection> oc_gemcsclct(new GEMCSCLCTDigiCollection);
169 
170  if (!wireDigis.isValid()) {
171  edm::LogWarning("L1CSCTPEmulatorNoInputCollection")
172  << "+++ Warning: Collection of wire digis with label "
174  << " requested in configuration, but not found in the event..."
175  << " Skipping production of CSC TP digis +++\n";
176  }
177  if (!compDigis.isValid()) {
178  edm::LogWarning("L1CSCTPEmulatorNoInputCollection")
179  << "+++ Warning: Collection of comparator digis with label "
181  << " requested in configuration, but not found in the event..."
182  << " Skipping production of CSC TP digis +++\n";
183  }
184  // Fill output collections if valid input collections are available.
185  if (wireDigis.isValid() && compDigis.isValid()) {
186  const CSCBadChambers* temp = checkBadChambers_ ? pBadChambers.product() : new CSCBadChambers;
187  lctBuilder_->build(temp,
188  wireDigis.product(), compDigis.product(), gemPads, rpcDigis,
189  *oc_alct, *oc_clct, *oc_pretrig, *oc_lct, *oc_sorted_lct, *oc_gemcopad, *oc_gemcsclct);
190  if (!checkBadChambers_)
191  delete temp;
192  }
193 
194  // Put collections in event.
195  ev.put(oc_alct);
196  ev.put(oc_clct);
197  ev.put(oc_pretrig);
198  ev.put(oc_lct);
199  ev.put(oc_sorted_lct,"MPCSORTED");
200  ev.put(oc_gemcopad);
201  ev.put(oc_gemcsclct);
202 }
#define LogDebug(id)
bool isRealData() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
static void setGeometry(const edm::ESHandle< CSCGeometry > &thegeom)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< CSCComparatorDigiCollection > comp_token_
edm::EDGetTokenT< RPCDigiCollection > rpc_digi_token_
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:77
edm::EDGetTokenT< GEMPadDigiCollection > gem_pad_token_
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< CSCWireDigiCollection > wire_token_
std::unique_ptr< CSCTriggerPrimitivesBuilder > lctBuilder_

Member Data Documentation

bool CSCTriggerPrimitivesProducer::checkBadChambers_
private

Definition at line 61 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

edm::EDGetTokenT<CSCComparatorDigiCollection> CSCTriggerPrimitivesProducer::comp_token_
private

Definition at line 53 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

edm::InputTag CSCTriggerPrimitivesProducer::compDigiProducer_
private

Definition at line 49 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

bool CSCTriggerPrimitivesProducer::debugParameters_
private

Definition at line 59 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

edm::EDGetTokenT<GEMPadDigiCollection> CSCTriggerPrimitivesProducer::gem_pad_token_
private

Definition at line 55 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

edm::InputTag CSCTriggerPrimitivesProducer::gemPadDigiProducer_
private

Definition at line 51 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

int CSCTriggerPrimitivesProducer::iev
private

Definition at line 47 of file CSCTriggerPrimitivesProducer.h.

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

std::unique_ptr<CSCTriggerPrimitivesBuilder> CSCTriggerPrimitivesProducer::lctBuilder_
private

Definition at line 62 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

edm::EDGetTokenT<RPCDigiCollection> CSCTriggerPrimitivesProducer::rpc_digi_token_
private

Definition at line 56 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

edm::InputTag CSCTriggerPrimitivesProducer::rpcDigiProducer_
private

Definition at line 52 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

edm::EDGetTokenT<CSCWireDigiCollection> CSCTriggerPrimitivesProducer::wire_token_
private

Definition at line 54 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

edm::InputTag CSCTriggerPrimitivesProducer::wireDigiProducer_
private

Definition at line 50 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().