CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
CSCDigiToRawModule Class Reference
Inheritance diagram for CSCDigiToRawModule:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CSCDigiToRawModule (const edm::ParameterSet &pset)
 Constructor. More...
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector
< edm::ProductResolverIndex >
const & 
putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT
< CSCALCTDigiCollection
al_token
 
edm::EDGetTokenT
< CSCComparatorDigiCollection
cd_token
 
edm::ESGetToken< CSCChamberMap,
CSCChamberMapRcd
cham_token
 
edm::EDGetTokenT
< CSCCLCTDigiCollection
cl_token
 
edm::EDGetTokenT
< CSCCorrelatedLCTDigiCollection
co_token
 
edm::EDGetTokenT
< GEMPadDigiClusterCollection
gem_token
 
std::unique_ptr< const
CSCDigiToRaw
packer_
 
edm::EDGetTokenT
< CSCCLCTPreTriggerCollection
pr_token
 
edm::EDGetTokenT
< CSCCLCTPreTriggerDigiCollection
prdigi_token
 
edm::EDPutTokenT
< FEDRawDataCollection
put_token_
 
edm::EDGetTokenT
< CSCStripDigiCollection
sd_token
 
edm::EDGetTokenT
< CSCShowerDigiCollection
shower_token
 
bool useCSCShowers_
 
bool useGEMs_
 
bool usePreTriggers_
 
edm::EDGetTokenT
< CSCWireDigiCollection
wd_token
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 42 of file CSCDigiToRawModule.cc.

Constructor & Destructor Documentation

CSCDigiToRawModule::CSCDigiToRawModule ( const edm::ParameterSet pset)

Constructor.

Definition at line 75 of file CSCDigiToRawModule.cc.

References al_token, cd_token, cham_token, cl_token, co_token, gem_token, edm::ParameterSet::getParameter(), pr_token, prdigi_token, put_token_, sd_token, shower_token, useCSCShowers_, useGEMs_, usePreTriggers_, and wd_token.

75  : packer_(std::make_unique<CSCDigiToRaw>(pset)) {
76  usePreTriggers_ = pset.getParameter<bool>("usePreTriggers"); // disable checking CLCT PreTriggers digis
77 
78  useGEMs_ = pset.getParameter<bool>("useGEMs");
79  useCSCShowers_ = pset.getParameter<bool>("useCSCShowers");
80  wd_token = consumes<CSCWireDigiCollection>(pset.getParameter<edm::InputTag>("wireDigiTag"));
81  sd_token = consumes<CSCStripDigiCollection>(pset.getParameter<edm::InputTag>("stripDigiTag"));
82  cd_token = consumes<CSCComparatorDigiCollection>(pset.getParameter<edm::InputTag>("comparatorDigiTag"));
83  if (usePreTriggers_) {
84  pr_token = consumes<CSCCLCTPreTriggerCollection>(pset.getParameter<edm::InputTag>("preTriggerTag"));
85  prdigi_token = consumes<CSCCLCTPreTriggerDigiCollection>(pset.getParameter<edm::InputTag>("preTriggerDigiTag"));
86  }
87  al_token = consumes<CSCALCTDigiCollection>(pset.getParameter<edm::InputTag>("alctDigiTag"));
88  cl_token = consumes<CSCCLCTDigiCollection>(pset.getParameter<edm::InputTag>("clctDigiTag"));
89  co_token = consumes<CSCCorrelatedLCTDigiCollection>(pset.getParameter<edm::InputTag>("correlatedLCTDigiTag"));
90  cham_token = esConsumes<CSCChamberMap, CSCChamberMapRcd>();
91  if (useGEMs_) {
92  gem_token = consumes<GEMPadDigiClusterCollection>(pset.getParameter<edm::InputTag>("padDigiClusterTag"));
93  }
94  if (useCSCShowers_) {
95  shower_token = consumes<CSCShowerDigiCollection>(pset.getParameter<edm::InputTag>("showerDigiTag"));
96  }
97  put_token_ = produces<FEDRawDataCollection>("CSCRawData");
98 }
edm::EDGetTokenT< CSCCLCTPreTriggerCollection > pr_token
edm::EDGetTokenT< CSCCLCTPreTriggerDigiCollection > prdigi_token
edm::EDPutTokenT< FEDRawDataCollection > put_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co_token
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
edm::EDGetTokenT< GEMPadDigiClusterCollection > gem_token
edm::ESGetToken< CSCChamberMap, CSCChamberMapRcd > cham_token
edm::EDGetTokenT< CSCShowerDigiCollection > shower_token
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< const CSCDigiToRaw > packer_
edm::EDGetTokenT< CSCStripDigiCollection > sd_token

Member Function Documentation

void CSCDigiToRawModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 100 of file CSCDigiToRawModule.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

100  {
102 
103  desc.add<unsigned int>("formatVersion", 2005)
104  ->setComment("Set to 2005 for pre-LS1 CSC data format, 2013 - new post-LS1 CSC data format");
105  desc.add<bool>("usePreTriggers", true)->setComment("Set to false if CSCCLCTPreTrigger digis are not available");
106  desc.add<bool>("packEverything", false)
107  ->setComment("Set to true to disable trigger-related constraints on readout data");
108  desc.add<bool>("packByCFEB", false)->setComment("Pack strip digis using CFEB info");
109  desc.add<bool>("useGEMs", false)->setComment("Pack GEM trigger data");
110  desc.add<bool>("useCSCShowers", false)->setComment("Pack CSC shower trigger data");
111 
112  desc.add<edm::InputTag>("wireDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCWireDigi"));
113  desc.add<edm::InputTag>("stripDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCStripDigi"));
114  desc.add<edm::InputTag>("comparatorDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCComparatorDigi"));
115  desc.add<edm::InputTag>("alctDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
116  desc.add<edm::InputTag>("clctDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
117  desc.add<edm::InputTag>("preTriggerTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
118  desc.add<edm::InputTag>("preTriggerDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
119  desc.add<edm::InputTag>("correlatedLCTDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"));
120  desc.add<edm::InputTag>("padDigiClusterTag", edm::InputTag("simMuonGEMPadDigiClusters"));
121  desc.add<edm::InputTag>("showerDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
122 
123  desc.add<int32_t>("alctWindowMin", -3)->setComment("If min parameter = -999 always accept");
124  desc.add<int32_t>("alctWindowMax", 3);
125  desc.add<int32_t>("clctWindowMin", -3)->setComment("If min parameter = -999 always accept");
126  desc.add<int32_t>("clctWindowMax", 3);
127  desc.add<int32_t>("preTriggerWindowMin", -3)->setComment("If min parameter = -999 always accept");
128  desc.add<int32_t>("preTriggerWindowMax", 1);
129 
130  descriptions.add("cscPackerDef", desc);
131 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CSCDigiToRawModule::produce ( edm::StreamID  ,
edm::Event e,
const edm::EventSetup c 
) const
overridevirtual

reverse mapping for packer

Implements edm::global::EDProducerBase.

Definition at line 133 of file CSCDigiToRawModule.cc.

References al_token, cd_token, cham_token, cl_token, co_token, edm::Event::emplace(), gem_token, edm::Event::get(), edm::Event::getByToken(), edm::EventSetup::getHandle(), edm::EventBase::id(), eostools::move(), packer_, pr_token, prdigi_token, edm::ESHandle< class >::product(), put_token_, sd_token, shower_token, useCSCShowers_, useGEMs_, usePreTriggers_, and wd_token.

133  {
136  const CSCChamberMap* theMapping = hcham.product();
137 
138  FEDRawDataCollection fed_buffers;
139 
140  // Take digis from the event
147 
148  // collections that are always packed
149  e.getByToken(wd_token, wireDigis);
150  e.getByToken(sd_token, stripDigis);
151  e.getByToken(cd_token, comparatorDigis);
152  e.getByToken(al_token, alctDigis);
153  e.getByToken(cl_token, clctDigis);
154  e.getByToken(co_token, correlatedLCTDigis);
155 
156  // packing with pre-triggers
157  CSCCLCTPreTriggerCollection const* preTriggersPtr = nullptr;
158  CSCCLCTPreTriggerDigiCollection const* preTriggerDigisPtr = nullptr;
159  if (usePreTriggers_) {
160  preTriggersPtr = &e.get(pr_token);
161  preTriggerDigisPtr = &e.get(prdigi_token);
162  }
163 
164  // collections that are packed optionally
165 
166  // packing of GEM hits
167  const GEMPadDigiClusterCollection* padDigiClustersPtr = nullptr;
168  if (useGEMs_) {
169  padDigiClustersPtr = &e.get(gem_token);
170  }
171 
172  // packing of CSC shower digis
173  const CSCShowerDigiCollection* cscShowerDigisPtr = nullptr;
174  if (useCSCShowers_) {
175  cscShowerDigisPtr = &e.get(shower_token);
176  }
177 
178  // Create the packed data
179  packer_->createFedBuffers(*stripDigis,
180  *wireDigis,
181  *comparatorDigis,
182  *alctDigis,
183  *clctDigis,
184  preTriggersPtr,
185  preTriggerDigisPtr,
186  *correlatedLCTDigis,
187  cscShowerDigisPtr,
188  padDigiClustersPtr,
189  fed_buffers,
190  theMapping,
191  e.id());
192 
193  // put the raw data to the event
194  e.emplace(put_token_, std::move(fed_buffers));
195 }
edm::EDGetTokenT< CSCCLCTPreTriggerCollection > pr_token
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< CSCCLCTPreTriggerDigiCollection > prdigi_token
edm::EDPutTokenT< FEDRawDataCollection > put_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co_token
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
def move
Definition: eostools.py:511
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
edm::EDGetTokenT< GEMPadDigiClusterCollection > gem_token
edm::ESGetToken< CSCChamberMap, CSCChamberMapRcd > cham_token
edm::EDGetTokenT< CSCShowerDigiCollection > shower_token
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:433
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< const CSCDigiToRaw > packer_
edm::EventID id() const
Definition: EventBase.h:59
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
A container for a generic type of digis indexed by some index, implemented with a map&lt;IndexType...

Member Data Documentation

edm::EDGetTokenT<CSCALCTDigiCollection> CSCDigiToRawModule::al_token
private

Definition at line 63 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCComparatorDigiCollection> CSCDigiToRawModule::cd_token
private

Definition at line 62 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::ESGetToken<CSCChamberMap, CSCChamberMapRcd> CSCDigiToRawModule::cham_token
private

Definition at line 69 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCCLCTDigiCollection> CSCDigiToRawModule::cl_token
private

Definition at line 64 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCDigiToRawModule::co_token
private

Definition at line 67 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<GEMPadDigiClusterCollection> CSCDigiToRawModule::gem_token
private

Definition at line 70 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

std::unique_ptr<const CSCDigiToRaw> CSCDigiToRawModule::packer_
private

Definition at line 58 of file CSCDigiToRawModule.cc.

Referenced by produce().

edm::EDGetTokenT<CSCCLCTPreTriggerCollection> CSCDigiToRawModule::pr_token
private

Definition at line 65 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCCLCTPreTriggerDigiCollection> CSCDigiToRawModule::prdigi_token
private

Definition at line 66 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDPutTokenT<FEDRawDataCollection> CSCDigiToRawModule::put_token_
private

Definition at line 72 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCStripDigiCollection> CSCDigiToRawModule::sd_token
private

Definition at line 61 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCShowerDigiCollection> CSCDigiToRawModule::shower_token
private

Definition at line 68 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

bool CSCDigiToRawModule::useCSCShowers_
private

Definition at line 56 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

bool CSCDigiToRawModule::useGEMs_
private

Definition at line 55 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

bool CSCDigiToRawModule::usePreTriggers_
private

Definition at line 54 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCWireDigiCollection> CSCDigiToRawModule::wd_token
private

Definition at line 60 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().