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

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
< FEDRawDataCollection
tok_raw_
 
const edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
tok_seed_
 
const edm::ESGetToken
< SiStripRegionCabling,
SiStripRegionCablingRcd
tok_strip_
 

Additional Inherited Members

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

Definition at line 22 of file SiStripRegFEDSelector.cc.

Constructor & Destructor Documentation

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 }
const edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< SiStripRegionCabling, SiStripRegionCablingRcd > tok_strip_
SiStripRegFEDSelector::~SiStripRegFEDSelector ( )
override

Definition at line 48 of file SiStripRegFEDSelector.cc.

48 {}

Member Function Documentation

void SiStripRegFEDSelector::beginJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 30 of file SiStripRegFEDSelector.cc.

30 {}
void SiStripRegFEDSelector::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 32 of file SiStripRegFEDSelector.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

32 {}
void SiStripRegFEDSelector::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 155 of file SiStripRegFEDSelector.cc.

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

155  {
157  desc.add<edm::InputTag>("regSeedLabel", edm::InputTag("hltIsolPixelTrackFilter"));
158  desc.add<edm::InputTag>("rawInputLabel", edm::InputTag("rawDataCollector"));
159  desc.add<double>("delta", 1.0);
160  descriptions.add("stripFED", desc);
161 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
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::Event::getByToken(), edm::EventSetup::getData(), SiStripRegionCabling::getRegionCabling(), mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, FEDNumbering::MAXFEDID, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, SiStripRegionCabling::position(), funct::pow(), edm::Handle< T >::product(), edm::Event::put(), 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  iEvent.getByToken(tok_seed_, trigSeedTrks);
55 
56  std::vector<edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
57  trigSeedTrks->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
58 
60  iEvent.getByToken(tok_raw_, rawIn);
61 
62  const SiStripRegionCabling* strip_cabling = &iSetup.getData(tok_strip_);
63  std::vector<int> stripFEDVec;
64 
65  //get vector of regions
66  const SiStripRegionCabling::Cabling& ccab = strip_cabling->getRegionCabling();
67 
68  //size of region (eta,phi)
69  const std::pair<double, double> regDim = strip_cabling->regionDimensions();
70 
72 
73  bool fedSaved[1000];
74  for (int i = 0; i < 1000; i++)
75  fedSaved[i] = false;
76 
77  //cycle on seeds
78  for (uint32_t p = 0; p < isoPixTrackRefs.size(); p++) {
79  double etaObj_ = isoPixTrackRefs[p]->track()->eta();
80  double phiObj_ = isoPixTrackRefs[p]->track()->phi();
81 
82  //cycle on regions
83  for (uint32_t i = 0; i < ccab.size(); i++) {
84  SiStripRegionCabling::Position pos = strip_cabling->position(i);
85  double dphi = fabs(pos.second - phiObj_);
86  if (dphi > acos(-1))
87  dphi = 2 * acos(-1) - dphi;
88  double R = sqrt(pow(pos.first - etaObj_, 2) + dphi * dphi);
89  if (R - sqrt(pow(regDim.first / 2, 2) + pow(regDim.second / 2, 2)) > delta_)
90  continue;
91  //get vector of subdets within region
92  const SiStripRegionCabling::RegionCabling regSubdets = ccab[i];
93  //cycle on subdets
94  for (uint32_t idet = 0; idet < SiStripRegionCabling::ALLSUBDETS; idet++) {
95  //get vector of layers within subdet of region
96  const SiStripRegionCabling::WedgeCabling regSubdetLayers = regSubdets[idet];
97  for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
98  //get map of vectors of feds withing the layer of subdet of region
99  const SiStripRegionCabling::ElementCabling fedVectorMap = regSubdetLayers[ilayer];
100  SiStripRegionCabling::ElementCabling::const_iterator it = fedVectorMap.begin();
101  for (; it != fedVectorMap.end(); it++) {
102  for (uint32_t op = 0; op < (it->second).size(); op++) {
103  //get fed id
104  int fediid = (it->second)[op].fedId();
105  if (!fedSaved[fediid]) {
106  stripFEDVec.push_back(fediid);
107  }
108  fedSaved[fediid] = true;
109  }
110  }
111  }
112  }
113  }
114  }
115 
117 
118  const FEDRawDataCollection* rdc = rawIn.product();
119 
120  // if ( ( rawData[i].provenance()->processName() != e.processHistory().rbegin()->processName() ) )
121  // continue ; // skip all raw collections not produced by the current process
122 
123  for (int j = 0; j < FEDNumbering::MAXFEDID; ++j) {
124  bool rightFED = false;
125  for (uint32_t k = 0; k < stripFEDVec.size(); k++) {
126  if (j == stripFEDVec[k]) {
127  rightFED = true;
128  }
129  }
130  if (!rightFED)
131  continue;
132  const FEDRawData& fedData = rdc->FEDData(j);
133  size_t size = fedData.size();
134 
135  if (size > 0) {
136  // this fed has data -- lets copy it
137  FEDRawData& fedDataProd = producedData->FEDData(j);
138  if (fedDataProd.size() != 0) {
139  edm::LogVerbatim("HcalIsoTrack") << " More than one FEDRawDataCollection with data in FED " << j
140  << " Skipping the 2nd *****";
141  continue;
142  }
143  fedDataProd.resize(size);
144  unsigned char* dataProd = fedDataProd.data();
145  const unsigned char* data = fedData.data();
146  for (unsigned int k = 0; k < size; ++k) {
147  dataProd[k] = data[k];
148  }
149  }
150  }
151 
152  iEvent.put(std::move(producedData));
153 }
Log< level::Info, true > LogVerbatim
const std::pair< double, double > regionDimensions() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
const edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
std::vector< Element > ElementCabling
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
bool getData(T &iHolder) const
Definition: EventSetup.h:128
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void resize(size_t newsize)
Definition: FEDRawData.cc:28
T sqrt(T t)
Definition: SSEVec.h:19
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
def move
Definition: eostools.py:511
std::vector< RegionCabling > Cabling
const Cabling & getRegionCabling() const
const Position position(const uint32_t) const
T const * product() const
Definition: Handle.h:70
std::pair< double, double > Position
std::vector< WedgeCabling > RegionCabling
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
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_
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

Member Data Documentation

const double SiStripRegFEDSelector::delta_
private

Definition at line 37 of file SiStripRegFEDSelector.cc.

Referenced by produce().

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

Definition at line 35 of file SiStripRegFEDSelector.cc.

Referenced by produce().

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

Definition at line 34 of file SiStripRegFEDSelector.cc.

Referenced by produce().

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

Definition at line 36 of file SiStripRegFEDSelector.cc.

Referenced by produce().