CMS 3D CMS Logo

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

Public Member Functions

 SiStripRegFEDSelector (const edm::ParameterSet &)
 
 ~SiStripRegFEDSelector () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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 Member Functions

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

Private Attributes

const double delta_
 
const edm::EDGetTokenT< FEDRawDataCollectiontok_raw_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstok_seed_
 
const edm::ESGetToken< SiStripRegionCabling, SiStripRegionCablingRcdtok_strip_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
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< Bconsumes (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 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 ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
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 22 of file SiStripRegFEDSelector.cc.

Constructor & Destructor Documentation

◆ SiStripRegFEDSelector()

SiStripRegFEDSelector::SiStripRegFEDSelector ( const edm::ParameterSet iConfig)

Definition at line 40 of file SiStripRegFEDSelector.cc.

41  : tok_seed_(consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<edm::InputTag>("regSeedLabel"))),
42  tok_raw_(consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("rawInputLabel"))),
43  tok_strip_(esConsumes<SiStripRegionCabling, SiStripRegionCablingRcd>()),
44  delta_(iConfig.getParameter<double>("delta")) {
45  produces<FEDRawDataCollection>();
46 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
const edm::ESGetToken< SiStripRegionCabling, SiStripRegionCablingRcd > tok_strip_

◆ ~SiStripRegFEDSelector()

SiStripRegFEDSelector::~SiStripRegFEDSelector ( )
override

Definition at line 48 of file SiStripRegFEDSelector.cc.

48 {}

Member Function Documentation

◆ beginJob()

void SiStripRegFEDSelector::beginJob ( )
inlineoverrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 30 of file SiStripRegFEDSelector.cc.

30 {}

◆ endJob()

void SiStripRegFEDSelector::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 32 of file SiStripRegFEDSelector.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

32 {}

◆ fillDescriptions()

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

Definition at line 153 of file SiStripRegFEDSelector.cc.

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

153  {
155  desc.add<edm::InputTag>("regSeedLabel", edm::InputTag("hltIsolPixelTrackFilter"));
156  desc.add<edm::InputTag>("rawInputLabel", edm::InputTag("rawDataCollector"));
157  desc.add<double>("delta", 1.0);
158  descriptions.add("stripFED", desc);
159 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void SiStripRegFEDSelector::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 50 of file SiStripRegFEDSelector.cc.

References SiStripRegionCabling::ALLLAYERS, SiStripRegionCabling::ALLSUBDETS, FEDRawData::data(), data, delta_, FEDRawDataCollection::FEDData(), l1tstage2_dqm_sourceclient-live_cfg::fedId, edm::EventSetup::getData(), SiStripRegionCabling::getRegionCabling(), mps_fire::i, iEvent, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, dqmdumpme::k, FEDNumbering::MAXFEDID, eostools::move(), findAndChange::op, AlCaHLTBitMon_ParallelJobs::p, SiStripRegionCabling::position(), funct::pow(), edm::Handle< T >::product(), dttmaxenums::R, SiStripRegionCabling::regionDimensions(), FEDRawData::resize(), FEDRawData::size(), findQualityFiles::size, mathSSE::sqrt(), tok_raw_, tok_seed_, tok_strip_, and trigger::TriggerTrack.

50  {
51  auto producedData = std::make_unique<FEDRawDataCollection>();
52 
54 
55  std::vector<edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
56  trigSeedTrks->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
57 
58  const edm::Handle<FEDRawDataCollection>& rawIn = iEvent.getHandle(tok_raw_);
59 
60  const SiStripRegionCabling* strip_cabling = &iSetup.getData(tok_strip_);
61  std::vector<int> stripFEDVec;
62 
63  //get vector of regions
64  const SiStripRegionCabling::Cabling& ccab = strip_cabling->getRegionCabling();
65 
66  //size of region (eta,phi)
67  const std::pair<double, double> regDim = strip_cabling->regionDimensions();
68 
70 
71  bool fedSaved[1000];
72  for (int i = 0; i < 1000; i++)
73  fedSaved[i] = false;
74 
75  //cycle on seeds
76  for (uint32_t p = 0; p < isoPixTrackRefs.size(); p++) {
77  double etaObj_ = isoPixTrackRefs[p]->track()->eta();
78  double phiObj_ = isoPixTrackRefs[p]->track()->phi();
79 
80  //cycle on regions
81  for (uint32_t i = 0; i < ccab.size(); i++) {
82  SiStripRegionCabling::Position pos = strip_cabling->position(i);
83  double dphi = fabs(pos.second - phiObj_);
84  if (dphi > acos(-1))
85  dphi = 2 * acos(-1) - dphi;
86  double R = sqrt(pow(pos.first - etaObj_, 2) + dphi * dphi);
87  if (R - sqrt(pow(regDim.first / 2, 2) + pow(regDim.second / 2, 2)) > delta_)
88  continue;
89  //get vector of subdets within region
90  const SiStripRegionCabling::RegionCabling regSubdets = ccab[i];
91  //cycle on subdets
92  for (uint32_t idet = 0; idet < SiStripRegionCabling::ALLSUBDETS; idet++) {
93  //get vector of layers within subdet of region
94  const SiStripRegionCabling::WedgeCabling& regSubdetLayers = regSubdets[idet];
95  for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
96  //get map of vectors of feds withing the layer of subdet of region
97  const SiStripRegionCabling::ElementCabling& fedVectorMap = regSubdetLayers[ilayer];
98  SiStripRegionCabling::ElementCabling::const_iterator it = fedVectorMap.begin();
99  for (; it != fedVectorMap.end(); it++) {
100  for (uint32_t op = 0; op < (it->second).size(); op++) {
101  //get fed id
102  int fediid = (it->second)[op].fedId();
103  if (!fedSaved[fediid]) {
104  stripFEDVec.push_back(fediid);
105  }
106  fedSaved[fediid] = true;
107  }
108  }
109  }
110  }
111  }
112  }
113 
115 
116  const FEDRawDataCollection* rdc = rawIn.product();
117 
118  // if ( ( rawData[i].provenance()->processName() != e.processHistory().rbegin()->processName() ) )
119  // continue ; // skip all raw collections not produced by the current process
120 
121  for (int j = 0; j <= FEDNumbering::MAXFEDID; ++j) {
122  bool rightFED = false;
123  for (uint32_t k = 0; k < stripFEDVec.size(); k++) {
124  if (j == stripFEDVec[k]) {
125  rightFED = true;
126  }
127  }
128  if (!rightFED)
129  continue;
130  const FEDRawData& fedData = rdc->FEDData(j);
131  size_t size = fedData.size();
132 
133  if (size > 0) {
134  // this fed has data -- lets copy it
135  FEDRawData& fedDataProd = producedData->FEDData(j);
136  if (fedDataProd.size() != 0) {
137  edm::LogVerbatim("HcalIsoTrack") << " More than one FEDRawDataCollection with data in FED " << j
138  << " Skipping the 2nd *****";
139  continue;
140  }
141  fedDataProd.resize(size);
142  unsigned char* dataProd = fedDataProd.data();
143  const unsigned char* data = fedData.data();
144  for (unsigned int k = 0; k < size; ++k) {
145  dataProd[k] = data[k];
146  }
147  }
148  }
149 
150  iEvent.put(std::move(producedData));
151 }
size
Write out results.
Log< level::Info, true > LogVerbatim
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
T const * product() const
Definition: Handle.h:70
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:48
const edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
const Cabling & getRegionCabling() const
std::vector< Element > ElementCabling
const Position position(const uint32_t) const
int iEvent
Definition: GenABIO.cc:224
T sqrt(T t)
Definition: SSEVec.h:19
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
std::vector< RegionCabling > Cabling
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void resize(size_t newsize, size_t wordsize=8)
Definition: FEDRawData.cc:28
std::pair< double, double > Position
std::vector< WedgeCabling > RegionCabling
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
const std::pair< double, double > regionDimensions() const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
std::vector< ElementCabling > WedgeCabling
const edm::ESGetToken< SiStripRegionCabling, SiStripRegionCablingRcd > tok_strip_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ delta_

const double SiStripRegFEDSelector::delta_
private

Definition at line 37 of file SiStripRegFEDSelector.cc.

Referenced by produce().

◆ tok_raw_

const edm::EDGetTokenT<FEDRawDataCollection> SiStripRegFEDSelector::tok_raw_
private

Definition at line 35 of file SiStripRegFEDSelector.cc.

Referenced by produce().

◆ tok_seed_

const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> SiStripRegFEDSelector::tok_seed_
private

Definition at line 34 of file SiStripRegFEDSelector.cc.

Referenced by produce().

◆ tok_strip_

const edm::ESGetToken<SiStripRegionCabling, SiStripRegionCablingRcd> SiStripRegFEDSelector::tok_strip_
private

Definition at line 36 of file SiStripRegFEDSelector.cc.

Referenced by produce().