CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
MaskOrbitBx< T > Class Template Reference
Inheritance diagram for MaskOrbitBx< T >:
edm::stream::EDProducer<>

Public Member Functions

 MaskOrbitBx (const edm::ParameterSet &)
 
 ~MaskOrbitBx ()
 
- Public Member Functions inherited from edm::stream::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
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const int NBX = 3565
 
std::vector< std::vector< T > > orbitBuffer_
 
std::string productLabel_
 
edm::EDGetTokenT< OrbitCollection< T > > tokenData_
 
edm::EDGetTokenT< std::vector< unsigned > > tokenSelBxs_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

template<typename T>
class MaskOrbitBx< T >

Definition at line 27 of file MaskOrbitBx.cc.

Constructor & Destructor Documentation

◆ MaskOrbitBx()

template<typename T >
MaskOrbitBx< T >::MaskOrbitBx ( const edm::ParameterSet iPSet)
explicit

Definition at line 50 of file MaskOrbitBx.cc.

References MaskOrbitBx< T >::NBX, MaskOrbitBx< T >::orbitBuffer_, and MaskOrbitBx< T >::productLabel_.

51  : tokenData_(consumes<OrbitCollection<T>>(iPSet.getParameter<edm::InputTag>("dataTag"))),
52  tokenSelBxs_(consumes<std::vector<unsigned>>(iPSet.getParameter<edm::InputTag>("selectBxs"))),
53  productLabel_(iPSet.getParameter<std::string>("productLabel")) {
54  // prepare module buffer
55  orbitBuffer_ = std::vector<std::vector<T>>(NBX);
56 
57  // products
58  produces<OrbitCollection<T>>(productLabel_).setBranchAlias(productLabel_ + "OrbitCollection");
59 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< OrbitCollection< T > > tokenData_
Definition: MaskOrbitBx.cc:39
const int NBX
Definition: MaskOrbitBx.cc:46
std::string productLabel_
Definition: MaskOrbitBx.cc:44
std::vector< std::vector< T > > orbitBuffer_
Definition: MaskOrbitBx.cc:36
edm::EDGetTokenT< std::vector< unsigned > > tokenSelBxs_
Definition: MaskOrbitBx.cc:42

◆ ~MaskOrbitBx()

template<typename T >
MaskOrbitBx< T >::~MaskOrbitBx ( )
inline

Definition at line 30 of file MaskOrbitBx.cc.

30 {}

Member Function Documentation

◆ fillDescriptions()

template<typename T >
void MaskOrbitBx< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 94 of file MaskOrbitBx.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

94  {
96  desc.setUnknown();
97  descriptions.addDefault(desc);
98 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ produce()

template<typename T >
void MaskOrbitBx< T >::produce ( edm::Event iEvent,
const edm::EventSetup  
)
overrideprivate

Definition at line 63 of file MaskOrbitBx.cc.

References nano_mu_digi_cff::bx, iEvent, eostools::move(), and getGTfromDQMFile::obj.

63  {
64  // get selected BXs
66  iEvent.getByToken(tokenSelBxs_, selBxs);
67 
68  // get the data
69  edm::Handle<OrbitCollection<T>> objCollection;
70  iEvent.getByToken(tokenData_, objCollection);
71 
72  // prepare new collections
73  std::unique_ptr<OrbitCollection<T>> selectedObjs(new OrbitCollection<T>);
74 
75  int nObjOrbit_ = 0;
76 
77  // fill collections with objects
78  for (const unsigned& bx : *selBxs) {
79  for (const auto& obj : objCollection->bxIterator(bx)) {
80  orbitBuffer_[bx].push_back(obj);
81  nObjOrbit_++;
82  }
83  }
84 
85  // fill orbit collection and clear the Bx buffer vector
86  selectedObjs->fillAndClear(orbitBuffer_, nObjOrbit_);
87 
88  // store collections in the event
89  iEvent.put(std::move(selectedObjs), productLabel_);
90 
91 } // end produce
edm::EDGetTokenT< OrbitCollection< T > > tokenData_
Definition: MaskOrbitBx.cc:39
int iEvent
Definition: GenABIO.cc:224
std::string productLabel_
Definition: MaskOrbitBx.cc:44
std::vector< std::vector< T > > orbitBuffer_
Definition: MaskOrbitBx.cc:36
edm::EDGetTokenT< std::vector< unsigned > > tokenSelBxs_
Definition: MaskOrbitBx.cc:42
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ NBX

template<typename T >
const int MaskOrbitBx< T >::NBX = 3565
private

Definition at line 46 of file MaskOrbitBx.cc.

Referenced by MaskOrbitBx< T >::MaskOrbitBx().

◆ orbitBuffer_

template<typename T >
std::vector<std::vector<T> > MaskOrbitBx< T >::orbitBuffer_
private

Definition at line 36 of file MaskOrbitBx.cc.

Referenced by MaskOrbitBx< T >::MaskOrbitBx().

◆ productLabel_

template<typename T >
std::string MaskOrbitBx< T >::productLabel_
private

Definition at line 44 of file MaskOrbitBx.cc.

Referenced by MaskOrbitBx< T >::MaskOrbitBx().

◆ tokenData_

template<typename T >
edm::EDGetTokenT<OrbitCollection<T> > MaskOrbitBx< T >::tokenData_
private

Definition at line 39 of file MaskOrbitBx.cc.

◆ tokenSelBxs_

template<typename T >
edm::EDGetTokenT<std::vector<unsigned> > MaskOrbitBx< T >::tokenSelBxs_
private

Definition at line 42 of file MaskOrbitBx.cc.