CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripRegFEDSelector Class Reference

#include <SiStripRegFEDSelector.h>

Inheritance diagram for SiStripRegFEDSelector:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SiStripRegFEDSelector (const edm::ParameterSet &)
 
 ~SiStripRegFEDSelector () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 beginJob () override
 
void endJob () override
 
void produce (edm::Event &, const edm::EventSetup &) 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::EDProducer
typedef EDProducer 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::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 24 of file SiStripRegFEDSelector.h.

Constructor & Destructor Documentation

◆ SiStripRegFEDSelector()

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

Definition at line 8 of file SiStripRegFEDSelector.cc.

9  : tok_seed_(consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<edm::InputTag>("regSeedLabel"))),
10  tok_raw_(consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("rawInputLabel"))),
11  tok_strip_(esConsumes<SiStripRegionCabling, SiStripRegionCablingRcd>()),
12  delta_(iConfig.getParameter<double>("delta")) {
13  produces<FEDRawDataCollection>();
14 }

◆ ~SiStripRegFEDSelector()

SiStripRegFEDSelector::~SiStripRegFEDSelector ( )
override

Definition at line 16 of file SiStripRegFEDSelector.cc.

16 {}

Member Function Documentation

◆ beginJob()

void SiStripRegFEDSelector::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 123 of file SiStripRegFEDSelector.cc.

123 {}

◆ endJob()

void SiStripRegFEDSelector::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 125 of file SiStripRegFEDSelector.cc.

125 {}

Referenced by o2olib.O2ORunMgr::executeJob().

◆ produce()

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

Implements edm::EDProducer.

Definition at line 18 of file SiStripRegFEDSelector.cc.

18  {
19  auto producedData = std::make_unique<FEDRawDataCollection>();
20 
22  iEvent.getByToken(tok_seed_, trigSeedTrks);
23 
24  std::vector<edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
25  trigSeedTrks->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
26 
28  iEvent.getByToken(tok_raw_, rawIn);
29 
30  const SiStripRegionCabling* strip_cabling = &iSetup.getData(tok_strip_);
31  std::vector<int> stripFEDVec;
32 
33  //get vector of regions
34  const SiStripRegionCabling::Cabling& ccab = strip_cabling->getRegionCabling();
35 
36  //size of region (eta,phi)
37  const std::pair<double, double> regDim = strip_cabling->regionDimensions();
38 
40 
41  bool fedSaved[1000];
42  for (int i = 0; i < 1000; i++)
43  fedSaved[i] = false;
44 
45  //cycle on seeds
46  for (uint32_t p = 0; p < isoPixTrackRefs.size(); p++) {
47  double etaObj_ = isoPixTrackRefs[p]->track()->eta();
48  double phiObj_ = isoPixTrackRefs[p]->track()->phi();
49 
50  //cycle on regions
51  for (uint32_t i = 0; i < ccab.size(); i++) {
52  SiStripRegionCabling::Position pos = strip_cabling->position(i);
53  double dphi = fabs(pos.second - phiObj_);
54  if (dphi > acos(-1))
55  dphi = 2 * acos(-1) - dphi;
56  double R = sqrt(pow(pos.first - etaObj_, 2) + dphi * dphi);
57  if (R - sqrt(pow(regDim.first / 2, 2) + pow(regDim.second / 2, 2)) > delta_)
58  continue;
59  //get vector of subdets within region
60  const SiStripRegionCabling::RegionCabling regSubdets = ccab[i];
61  //cycle on subdets
62  for (uint32_t idet = 0; idet < SiStripRegionCabling::ALLSUBDETS; idet++) {
63  //get vector of layers within subdet of region
64  const SiStripRegionCabling::WedgeCabling regSubdetLayers = regSubdets[idet];
65  for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
66  //get map of vectors of feds withing the layer of subdet of region
67  const SiStripRegionCabling::ElementCabling fedVectorMap = regSubdetLayers[ilayer];
68  SiStripRegionCabling::ElementCabling::const_iterator it = fedVectorMap.begin();
69  for (; it != fedVectorMap.end(); it++) {
70  for (uint32_t op = 0; op < (it->second).size(); op++) {
71  //get fed id
72  int fediid = (it->second)[op].fedId();
73  if (!fedSaved[fediid]) {
74  stripFEDVec.push_back(fediid);
75  }
76  fedSaved[fediid] = true;
77  }
78  }
79  }
80  }
81  }
82  }
83 
85 
86  const FEDRawDataCollection* rdc = rawIn.product();
87 
88  // if ( ( rawData[i].provenance()->processName() != e.processHistory().rbegin()->processName() ) )
89  // continue ; // skip all raw collections not produced by the current process
90 
91  for (int j = 0; j < FEDNumbering::MAXFEDID; ++j) {
92  bool rightFED = false;
93  for (uint32_t k = 0; k < stripFEDVec.size(); k++) {
94  if (j == stripFEDVec[k]) {
95  rightFED = true;
96  }
97  }
98  if (!rightFED)
99  continue;
100  const FEDRawData& fedData = rdc->FEDData(j);
101  size_t size = fedData.size();
102 
103  if (size > 0) {
104  // this fed has data -- lets copy it
105  FEDRawData& fedDataProd = producedData->FEDData(j);
106  if (fedDataProd.size() != 0) {
107  edm::LogVerbatim("HcalIsoTrack") << " More than one FEDRawDataCollection with data in FED " << j
108  << " Skipping the 2nd *****";
109  continue;
110  }
111  fedDataProd.resize(size);
112  unsigned char* dataProd = fedDataProd.data();
113  const unsigned char* data = fedData.data();
114  for (unsigned int k = 0; k < size; ++k) {
115  dataProd[k] = data[k];
116  }
117  }
118  }
119 
120  iEvent.put(std::move(producedData));
121 }

References SiStripRegionCabling::ALLLAYERS, SiStripRegionCabling::ALLSUBDETS, FEDRawData::data(), data, delta_, FEDRawDataCollection::FEDData(), l1tstage2_dqm_sourceclient-live_cfg::fedId, edm::EventSetup::getData(), trigger::TriggerRefsCollections::getObjects(), SiStripRegionCabling::getRegionCabling(), mps_fire::i, iEvent, dqmiolumiharvest::j, dqmdumpme::k, FEDNumbering::MAXFEDID, eostools::move(), 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.

Member Data Documentation

◆ delta_

const double SiStripRegFEDSelector::delta_
private

Definition at line 37 of file SiStripRegFEDSelector.h.

Referenced by produce().

◆ tok_raw_

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

Definition at line 35 of file SiStripRegFEDSelector.h.

Referenced by produce().

◆ tok_seed_

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

Definition at line 34 of file SiStripRegFEDSelector.h.

Referenced by produce().

◆ tok_strip_

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

Definition at line 36 of file SiStripRegFEDSelector.h.

Referenced by produce().

SiStripRegionCabling::Position
std::pair< double, double > Position
Definition: SiStripRegionCabling.h:38
SiStripRegionCabling::RegionCabling
std::vector< WedgeCabling > RegionCabling
Definition: SiStripRegionCabling.h:33
SiStripRegionCabling::ALLLAYERS
Definition: SiStripRegionCabling.h:27
mps_fire.i
i
Definition: mps_fire.py:428
SiStripRegFEDSelector::delta_
const double delta_
Definition: SiStripRegFEDSelector.h:37
SiStripRegionCabling::WedgeCabling
std::vector< ElementCabling > WedgeCabling
Definition: SiStripRegionCabling.h:32
SiStripRegionCabling::getRegionCabling
const Cabling & getRegionCabling() const
Definition: SiStripRegionCabling.h:118
edm::Handle::product
T const * product() const
Definition: Handle.h:70
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
pos
Definition: PixelAliasList.h:18
SiStripRegionCabling::position
const Position position(const uint32_t) const
Definition: SiStripRegionCabling.h:128
SiStripRegionCabling::ALLSUBDETS
Definition: SiStripRegionCabling.h:26
FEDNumbering::MAXFEDID
Definition: FEDNumbering.h:26
trigger::TriggerTrack
Definition: TriggerTypeDefs.h:87
edm::Handle< trigger::TriggerFilterObjectWithRefs >
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:590
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
SiStripRegFEDSelector::tok_strip_
const edm::ESGetToken< SiStripRegionCabling, SiStripRegionCablingRcd > tok_strip_
Definition: SiStripRegFEDSelector.h:36
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqmdumpme.k
k
Definition: dqmdumpme.py:60
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
iEvent
int iEvent
Definition: GenABIO.cc:224
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:89
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
SiStripRegFEDSelector::tok_raw_
const edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
Definition: SiStripRegFEDSelector.h:35
eostools.move
def move(src, dest)
Definition: eostools.py:511
SiStripRegionCabling::Cabling
std::vector< RegionCabling > Cabling
Definition: SiStripRegionCabling.h:34
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
FEDRawData::resize
void resize(size_t newsize)
Definition: FEDRawData.cc:28
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SiStripRegionCabling::ElementCabling
std::vector< Element > ElementCabling
Definition: SiStripRegionCabling.h:31
dttmaxenums::R
Definition: DTTMax.h:29
edm::InputTag
Definition: InputTag.h:15
SiStripRegionCabling
Definition: SiStripRegionCabling.h:23
SiStripRegFEDSelector::tok_seed_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
Definition: SiStripRegFEDSelector.h:34
SiStripRegionCabling::regionDimensions
const std::pair< double, double > regionDimensions() const
Definition: SiStripRegionCabling.h:124
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443