CMS 3D CMS Logo

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)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

bool checkBadChambers_
 
edm::EDGetTokenT< CSCComparatorDigiCollectioncomp_token_
 
edm::InputTag compDigiProducer_
 
bool debugParameters_
 
edm::EDGetTokenT< GEMPadDigiCollectiongem_pad_token_
 
edm::InputTag gemPadDigiProducer_
 
int iev
 
std::unique_ptr< CSCTriggerPrimitivesBuilderlctBuilder_
 
edm::EDGetTokenT< RPCDigiCollectionrpc_digi_token_
 
edm::InputTag rpcDigiProducer_
 
bool runME11ILT_
 
bool runME21ILT_
 
edm::EDGetTokenT< CSCWireDigiCollectionwire_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 41 of file CSCTriggerPrimitivesProducer.cc.

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

41  : iev(0) {
42 
43  // if false, parameters will be read in from DB using EventSetup mechanism
44  // else will use all parameters from the config file
45  debugParameters_ = conf.getParameter<bool>("debugParameters");
46 
47  wireDigiProducer_ = conf.getParameter<edm::InputTag>("CSCWireDigiProducer");
48  compDigiProducer_ = conf.getParameter<edm::InputTag>("CSCComparatorDigiProducer");
49  gemPadDigiProducer_ = conf.existsAs<edm::InputTag>("GEMPadDigiProducer")?conf.getParameter<edm::InputTag>("GEMPadDigiProducer"):edm::InputTag("");
50  rpcDigiProducer_ = conf.existsAs<edm::InputTag>("RPCDigiProducer")?conf.getParameter<edm::InputTag>("RPCDigiProducer"):edm::InputTag("");
51  checkBadChambers_ = conf.getParameter<bool>("checkBadChambers");
52 
53  const edm::ParameterSet commonParam(conf.getParameter<edm::ParameterSet>("commonParam"));
54  runME11ILT_ = commonParam.existsAs<bool>("runME11ILT")?commonParam.getParameter<bool>("runME11ILT"):false;
55  runME21ILT_ = commonParam.existsAs<bool>("runME21ILT")?commonParam.getParameter<bool>("runME21ILT"):false;
56 
57  lctBuilder_.reset( new CSCTriggerPrimitivesBuilder(conf) ); // pass on the conf
58 
59  wire_token_ = consumes<CSCWireDigiCollection>(wireDigiProducer_);
60  comp_token_ = consumes<CSCComparatorDigiCollection>(compDigiProducer_);
61  gem_pad_token_ = consumes<GEMPadDigiCollection>(gemPadDigiProducer_);
62  rpc_digi_token_ = consumes<RPCDigiCollection>(rpcDigiProducer_);
63 
64  // register what this produces
65  produces<CSCALCTDigiCollection>();
66  produces<CSCCLCTDigiCollection>();
67  produces<CSCCLCTPreTriggerCollection>();
68  produces<CSCCorrelatedLCTDigiCollection>();
69  produces<CSCCorrelatedLCTDigiCollection>("MPCSORTED");
71  produces<GEMCoPadDigiCollection>();
72  usesResource("CSCTriggerGeometry");
73  consumes<CSCComparatorDigiCollection>(compDigiProducer_);
74  consumes<CSCWireDigiCollection>(wireDigiProducer_);
75  consumes<GEMPadDigiCollection>(gemPadDigiProducer_);
76  consumes<RPCDigiCollection>(rpcDigiProducer_);
77 }
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
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 79 of file CSCTriggerPrimitivesProducer.cc.

References iev, and LogDebug.

79  {
80  LogDebug("L1CSCTrigger")
81  << "deleting trigger primitives after " << iev << " events.";
82 }
#define LogDebug(id)

Member Function Documentation

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

Definition at line 87 of file CSCTriggerPrimitivesProducer.cc.

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

88  {
89 
90  LogDebug("L1CSCTrigger") << "start producing LCTs for event " << ++iev;
91 
92  // Find the geometry (& conditions?) for this event & cache it in
93  // CSCTriggerGeometry.
94 
96  setup.get<MuonGeometryRecord>().get(h);
98  lctBuilder_->setCSCGeometry(&*h);
99 
101  setup.get<MuonGeometryRecord>().get(h_gem);
102  if (h_gem.isValid()) {
103  lctBuilder_->setGEMGeometry(&*h_gem);
104  } else {
105  edm::LogInfo("L1CSCTPEmulatorNoGEMGeometry")
106  << "+++ Info: GEM geometry is unavailable. Running CSC-only trigger algorithm. +++\n";
107  }
108 
110  setup.get<MuonGeometryRecord>().get(h_rpc);
111  if (h_rpc.isValid()) {
112  lctBuilder_->setRPCGeometry(&*h_rpc);
113  } else {
114  edm::LogInfo("L1CSCTPEmulatorNoRPCGeometry")
115  << "+++ Info: RPC geometry is unavailable. Running CSC-only trigger algorithm. +++\n";
116  }
117 
118  // Find conditions data for bad chambers.
119  edm::ESHandle<CSCBadChambers> pBadChambers;
120  setup.get<CSCBadChambersRcd>().get(pBadChambers);
121 
122  // If !debugParameters then get config parameters using EventSetup mechanism.
123  // This must be done in produce() for every event and not in beginJob()
124  // (see mail from Jim Brooke sent to hn-cms-L1TrigEmulator on July 30, 2007).
125  if (!debugParameters_) {
127  setup.get<CSCDBL1TPParametersRcd>().get(conf);
128  if (conf.product() == 0) {
129  edm::LogError("L1CSCTPEmulatorConfigError")
130  << "+++ Failed to find a CSCDBL1TPParametersRcd in EventSetup! +++\n"
131  << "+++ Cannot continue emulation without these parameters +++\n";
132  return;
133  }
134  lctBuilder_->setConfigParameters(conf.product());
135  }
136 
137  // temporary hack to run on data
138  lctBuilder_->runOnData(ev.eventAuxiliary().isRealData());
139 
140  // Get the collections of comparator & wire digis from event.
143  // ev.getByLabel(compDigiProducer_.label(), compDigiProducer_.instance(), compDigis);
144  // ev.getByLabel(wireDigiProducer_.label(), wireDigiProducer_.instance(), wireDigis);
145  ev.getByToken(comp_token_, compDigis);
146  ev.getByToken(wire_token_, wireDigis);
147 
148 
149  const GEMPadDigiCollection *gemPads = nullptr;
150  if (!gemPadDigiProducer_.label().empty()) {
152  ev.getByToken(gem_pad_token_, gemPadDigis);
153  gemPads = gemPadDigis.product();
154  }
155 
156  const RPCDigiCollection *rpcDigis = nullptr;
157  if (!rpcDigiProducer_.label().empty()) {
159  ev.getByToken(rpc_digi_token_, rpcs);
160  rpcDigis = rpcs.product();
161  }
162 
163  // Create empty collections of ALCTs, CLCTs, and correlated LCTs upstream
164  // and downstream of MPC.
165  std::unique_ptr<CSCALCTDigiCollection> oc_alct(new CSCALCTDigiCollection);
166  std::unique_ptr<CSCCLCTDigiCollection> oc_clct(new CSCCLCTDigiCollection);
167  std::unique_ptr<CSCCLCTPreTriggerCollection> oc_pretrig(new CSCCLCTPreTriggerCollection);
168  std::unique_ptr<CSCCorrelatedLCTDigiCollection> oc_lct(new CSCCorrelatedLCTDigiCollection);
169  std::unique_ptr<CSCCorrelatedLCTDigiCollection> oc_sorted_lct(new CSCCorrelatedLCTDigiCollection);
170  std::unique_ptr<GEMCoPadDigiCollection> oc_gemcopad(new GEMCoPadDigiCollection);
171 
172  if (!wireDigis.isValid()) {
173  edm::LogWarning("L1CSCTPEmulatorNoInputCollection")
174  << "+++ Warning: Collection of wire digis with label "
176  << " requested in configuration, but not found in the event..."
177  << " Skipping production of CSC TP digis +++\n";
178  }
179  if (!compDigis.isValid()) {
180  edm::LogWarning("L1CSCTPEmulatorNoInputCollection")
181  << "+++ Warning: Collection of comparator digis with label "
183  << " requested in configuration, but not found in the event..."
184  << " Skipping production of CSC TP digis +++\n";
185  }
186  // Fill output collections if valid input collections are available.
187  if (wireDigis.isValid() && compDigis.isValid()) {
188  const CSCBadChambers* temp = checkBadChambers_ ? pBadChambers.product() : new CSCBadChambers;
189  lctBuilder_->build(temp,
190  wireDigis.product(), compDigis.product(), gemPads, rpcDigis,
191  *oc_alct, *oc_clct, *oc_pretrig, *oc_lct, *oc_sorted_lct, *oc_gemcopad);
192  if (!checkBadChambers_)
193  delete temp;
194  }
195 
196  // Put collections in event.
197  ev.put(std::move(oc_alct));
198  ev.put(std::move(oc_clct));
199  ev.put(std::move(oc_pretrig));
200  ev.put(std::move(oc_lct));
201  ev.put(std::move(oc_sorted_lct),"MPCSORTED");
203  ev.put(std::move(oc_gemcopad));
204 }
#define LogDebug(id)
bool isRealData() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
EventAuxiliary const & eventAuxiliary() const override
Definition: Event.h:78
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
static void setGeometry(const edm::ESHandle< CSCGeometry > &thegeom)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< CSCComparatorDigiCollection > comp_token_
edm::EDGetTokenT< RPCDigiCollection > rpc_digi_token_
edm::EDGetTokenT< GEMPadDigiCollection > gem_pad_token_
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< CSCWireDigiCollection > wire_token_
std::unique_ptr< CSCTriggerPrimitivesBuilder > lctBuilder_
bool isValid() const
Definition: ESHandle.h:47
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510

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 64 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().

bool CSCTriggerPrimitivesProducer::runME11ILT_
private

Definition at line 62 of file CSCTriggerPrimitivesProducer.h.

Referenced by CSCTriggerPrimitivesProducer(), and produce().

bool CSCTriggerPrimitivesProducer::runME21ILT_
private

Definition at line 63 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().