CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions
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
 
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::vector< ModuleDescription const * > &modules, 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Public Attributes

double delta_
 
edm::ESHandle< SiStripRegionCablingstrip_cabling
 
edm::EDGetTokenT< FEDRawDataCollectiontok_raw_
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstok_seed_
 

Private Member Functions

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

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 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>
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)
 
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.

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

References delta_, edm::ParameterSet::getParameter(), tok_raw_, and tok_seed_.

◆ ~SiStripRegFEDSelector()

SiStripRegFEDSelector::~SiStripRegFEDSelector ( )
override

Definition at line 17 of file SiStripRegFEDSelector.cc.

17 {}

Member Function Documentation

◆ beginJob()

void SiStripRegFEDSelector::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 125 of file SiStripRegFEDSelector.cc.

125 {}

◆ endJob()

void SiStripRegFEDSelector::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 127 of file SiStripRegFEDSelector.cc.

127 {}

Referenced by o2olib.O2ORunMgr::executeJob().

◆ produce()

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

Implements edm::EDProducer.

Definition at line 19 of file SiStripRegFEDSelector.cc.

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

References SiStripRegionCabling::ALLLAYERS, SiStripRegionCabling::ALLSUBDETS, FEDRawData::data(), data, delta_, FEDRawDataCollection::FEDData(), l1tstage2_dqm_sourceclient-live_cfg::fedId, edm::EventSetup::get(), get, 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(), strip_cabling, tok_raw_, tok_seed_, and trigger::TriggerTrack.

Member Data Documentation

◆ delta_

double SiStripRegFEDSelector::delta_

Definition at line 31 of file SiStripRegFEDSelector.h.

Referenced by produce(), and SiStripRegFEDSelector().

◆ strip_cabling

edm::ESHandle<SiStripRegionCabling> SiStripRegFEDSelector::strip_cabling

Definition at line 29 of file SiStripRegFEDSelector.h.

Referenced by produce().

◆ tok_raw_

edm::EDGetTokenT<FEDRawDataCollection> SiStripRegFEDSelector::tok_raw_

Definition at line 33 of file SiStripRegFEDSelector.h.

Referenced by produce(), and SiStripRegFEDSelector().

◆ tok_seed_

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

Definition at line 34 of file SiStripRegFEDSelector.h.

Referenced by produce(), and SiStripRegFEDSelector().

SiStripRegFEDSelector::tok_raw_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
Definition: SiStripRegFEDSelector.h:33
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:355
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
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
pos
Definition: PixelAliasList.h:18
SiStripRegionCabling::position
const Position position(const uint32_t) const
Definition: SiStripRegionCabling.h:128
SiStripRegFEDSelector::strip_cabling
edm::ESHandle< SiStripRegionCabling > strip_cabling
Definition: SiStripRegFEDSelector.h:29
SiStripRegionCabling::ALLSUBDETS
Definition: SiStripRegionCabling.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:593
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::delta_
double delta_
Definition: SiStripRegFEDSelector.h:31
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
SiStripRegFEDSelector::tok_seed_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
Definition: SiStripRegFEDSelector.h:34
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
iEvent
int iEvent
Definition: GenABIO.cc:224
SiStripRegionCablingRcd
Definition: SiStripDependentRecords.h:23
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:88
get
#define get
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
SiStripRegionCabling::Cabling
std::vector< RegionCabling > Cabling
Definition: SiStripRegionCabling.h:34
FEDRawData::resize
void resize(size_t newsize)
Definition: FEDRawData.cc:28
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:30
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::regionDimensions
const std::pair< double, double > regionDimensions() const
Definition: SiStripRegionCabling.h:124
FEDNumbering::MAXFEDID
Definition: FEDNumbering.h:26
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443