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 | Private Member Functions | Private Attributes
AlcaPCCProducer Class Reference
Inheritance diagram for AlcaPCCProducer:
edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::LuminosityBlockCache< reco::PixelClusterCounts > > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 AlcaPCCProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::LuminosityBlockCache< reco::PixelClusterCounts > >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () 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)
 

Private Member Functions

void endLuminosityBlockProduce (edm::LuminosityBlock &lumiSeg, const edm::EventSetup &iSetup) final
 
std::shared_ptr
< reco::PixelClusterCounts
globalBeginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) const final
 
void globalEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) final
 

Private Attributes

edm::EDGetTokenT
< edmNew::DetSetVector
< SiPixelCluster > > 
pixelToken_
 
edm::EDPutTokenT
< reco::PixelClusterCounts
putToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::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
 
- 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::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


class: AlcaPCCProducer.cc

authors:Sam Higginbotham (shigg.nosp@m.inb@.nosp@m.cern..nosp@m.ch) and Chris Palmer (capal.nosp@m.mer@.nosp@m.cern..nosp@m.ch)


Definition at line 29 of file AlcaPCCProducer.cc.

Constructor & Destructor Documentation

AlcaPCCProducer::AlcaPCCProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 46 of file AlcaPCCProducer.cc.

47  : pixelToken_(consumes(iConfig.getParameter<edm::InputTag>("pixelClusterLabel"))),
48  //specifies the trigger Rand or ZeroBias
49  putToken_(produces<reco::PixelClusterCounts, edm::Transition::EndLuminosityBlock>(
50  iConfig.getUntrackedParameter<std::string>("trigstring", "alcaPCC"))) {}
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDPutTokenT< reco::PixelClusterCounts > putToken_

Member Function Documentation

void AlcaPCCProducer::endLuminosityBlockProduce ( edm::LuminosityBlock lumiSeg,
const edm::EventSetup iSetup 
)
finalprivate

Definition at line 90 of file AlcaPCCProducer.cc.

References edm::LuminosityBlock::emplace(), edm::LuminosityBlock::index(), eostools::move(), and putToken_.

90  {
91  //Saving the PCC object
92  lumiSeg.emplace(putToken_, std::move(*luminosityBlockCache(lumiSeg.index())));
93 }
LuminosityBlockIndex index() const
void emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
def move
Definition: eostools.py:511
edm::EDPutTokenT< reco::PixelClusterCounts > putToken_
std::shared_ptr< reco::PixelClusterCounts > AlcaPCCProducer::globalBeginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  iSetup 
) const
finalprivate

Definition at line 83 of file AlcaPCCProducer.cc.

84  {
85  //New PCC object at the beginning of each lumi section
86  return std::make_shared<reco::PixelClusterCounts>();
87 }
void AlcaPCCProducer::globalEndLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
inlinefinalprivate

Definition at line 38 of file AlcaPCCProducer.cc.

38 {}
void AlcaPCCProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
finalprivatevirtual

Implements edm::one::EDProducerBase.

Definition at line 53 of file AlcaPCCProducer.cc.

References edm::EventBase::bunchCrossing(), makePileupJSON::bx, edm::Event::get(), edm::Event::getLuminosityBlock(), edm::LuminosityBlock::index(), mod(), and pixelToken_.

53  {
54  unsigned int bx = iEvent.bunchCrossing();
55  //std::cout<<"The Bunch Crossing"<<bx<<std::endl;
56  auto* pccOb = luminosityBlockCache(iEvent.getLuminosityBlock().index());
57  pccOb->eventCounter(bx);
58 
59  //Looping over the clusters and adding the counts up
60  const edmNew::DetSetVector<SiPixelCluster>& clustColl = iEvent.get(pixelToken_);
61  // ----------------------------------------------------------------------
62  // -- Clusters without tracks
63  for (auto const& mod : clustColl) {
64  if (mod.empty()) {
65  continue;
66  }
67  DetId detId = mod.id();
68 
69  //--The following will be used when we make a theshold for the clusters.
70  //--Keeping this for features that may be implemented later.
71  // -- clusters on this det
72  //edmNew::DetSet<SiPixelCluster>::const_iterator di;
73  //int nClusterCount=0;
74  //for (di = mod.begin(); di != mod.end(); ++di) {
75  // nClusterCount++;
76  //}
77  int nCluster = mod.size();
78  pccOb->increment(detId(), bx, nCluster);
79  }
80 }
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelToken_
LuminosityBlockIndex index() const
int bunchCrossing() const
Definition: EventBase.h:64
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:100
Definition: DetId.h:17
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

Member Data Documentation

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > AlcaPCCProducer::pixelToken_
private

Definition at line 41 of file AlcaPCCProducer.cc.

Referenced by produce().

edm::EDPutTokenT<reco::PixelClusterCounts> AlcaPCCProducer::putToken_
private

Definition at line 42 of file AlcaPCCProducer.cc.

Referenced by endLuminosityBlockProduce().