CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Public Attributes

double delta_
 
edm::ESHandle
< SiStripRegionCabling
strip_cabling
 
edm::EDGetTokenT
< FEDRawDataCollection
tok_raw_
 
edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
tok_seed_
 

Private Member Functions

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

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
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)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 24 of file SiStripRegFEDSelector.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file SiStripRegFEDSelector.cc.

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

9 {
10  tok_seed_ = consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<edm::InputTag>("regSeedLabel"));
11  delta_=iConfig.getParameter<double>("delta");
12 
13  tok_raw_ = consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("rawInputLabel"));
14 
15  produces<FEDRawDataCollection>();
16 }
T getParameter(std::string const &) const
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
SiStripRegFEDSelector::~SiStripRegFEDSelector ( )

Definition at line 19 of file SiStripRegFEDSelector.cc.

20 {
21 
22 }

Member Function Documentation

void SiStripRegFEDSelector::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 145 of file SiStripRegFEDSelector.cc.

145  {
146 }
void SiStripRegFEDSelector::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 149 of file SiStripRegFEDSelector.cc.

Referenced by o2o.O2ORunMgr::executeJob().

149  {
150 }
void SiStripRegFEDSelector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 25 of file SiStripRegFEDSelector.cc.

References SiStripRegionCabling::ALLLAYERS, SiStripRegionCabling::ALLSUBDETS, FEDRawData::data(), AlCaHLTBitMon_QueryRunRegistry::data, delta_, FEDRawDataCollection::FEDData(), stage2BMTFBufferRaw_cfi::fedId, edm::EventSetup::get(), edm::Event::getByToken(), i, j, relval_2017::k, FEDNumbering::MAXFEDID, AlCaHLTBitMon_ParallelJobs::p, funct::pow(), edm::Handle< T >::product(), edm::Event::put(), dttmaxenums::R, FEDRawData::resize(), FEDRawData::size(), findQualityFiles::size, mathSSE::sqrt(), strip_cabling, tok_raw_, tok_seed_, and trigger::TriggerTrack.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

26 {
27  std::auto_ptr<FEDRawDataCollection> producedData(new FEDRawDataCollection);
28 
30  iEvent.getByToken(tok_seed_,trigSeedTrks);
31 
32  std::vector< edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
33  trigSeedTrks->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
34 
36  iEvent.getByToken(tok_raw_,rawIn);
37 
39 
40  std::vector<int> stripFEDVec;
41 
42  //get vector of regions
43  const SiStripRegionCabling::Cabling ccab=strip_cabling->getRegionCabling();
44 
45  //size of region (eta,phi)
46  const std::pair<double,double> regDim=strip_cabling->regionDimensions();
47 
49 
50  bool fedSaved[1000];
51  for (int i=0; i<1000; i++) fedSaved[i]=false;
52 
53  //cycle on seeds
54  for (uint32_t p=0; p<isoPixTrackRefs.size(); p++)
55  {
56  double etaObj_=isoPixTrackRefs[p]->track()->eta();
57  double phiObj_=isoPixTrackRefs[p]->track()->phi();
58 
59  //cycle on regions
60  for (uint32_t i=0; i<ccab.size(); i++)
61  {
63  double dphi=fabs(pos.second-phiObj_);
64  if (dphi>acos(-1)) dphi=2*acos(-1)-dphi;
65  double R=sqrt(pow(pos.first-etaObj_,2)+dphi*dphi);
66  if (R-sqrt(pow(regDim.first/2,2)+pow(regDim.second/2,2))>delta_) continue;
67  //get vector of subdets within region
68  const SiStripRegionCabling::RegionCabling regSubdets= ccab[i];
69  //cycle on subdets
70  for (uint32_t idet=0; idet<SiStripRegionCabling::ALLSUBDETS; idet++)
71  {
72  //get vector of layers within subdet of region
73  const SiStripRegionCabling::WedgeCabling regSubdetLayers=regSubdets[idet];
74  for (uint32_t ilayer=0; ilayer<SiStripRegionCabling::ALLLAYERS; ilayer++)
75  {
76  //get map of vectors of feds withing the layer of subdet of region
77  const SiStripRegionCabling::ElementCabling fedVectorMap=regSubdetLayers[ilayer];
78  SiStripRegionCabling::ElementCabling::const_iterator it=fedVectorMap.begin();
79  for( ; it!=fedVectorMap.end(); it++)
80  {
81  for (uint32_t op=0; op<(it->second).size(); op++)
82  {
83  //get fed id
84  int fediid=(it->second)[op].fedId();
85  if (!fedSaved[fediid])
86  {
87  stripFEDVec.push_back(fediid);
88  }
89  fedSaved[fediid]=true;
90 
91  }
92  }
93 
94  }
95 
96  }
97  }
98  }
99 
100 
102 
103  const FEDRawDataCollection *rdc=rawIn.product();
104 
105  // if ( ( rawData[i].provenance()->processName() != e.processHistory().rbegin()->processName() ) )
106  // continue ; // skip all raw collections not produced by the current process
107 
108  for ( int j=0; j< FEDNumbering::MAXFEDID; ++j )
109  {
110  bool rightFED=false;
111  for (uint32_t k=0; k<stripFEDVec.size(); k++)
112  {
113  if (j==stripFEDVec[k])
114  {
115  rightFED=true;
116  }
117  }
118  if (!rightFED) continue;
119  const FEDRawData & fedData = rdc->FEDData(j);
120  size_t size=fedData.size();
121 
122  if ( size > 0 )
123  {
124  // this fed has data -- lets copy it
125  FEDRawData & fedDataProd = producedData->FEDData(j);
126  if ( fedDataProd.size() != 0 ) {
127 // std::cout << " More than one FEDRawDataCollection with data in FED ";
128 // std::cout << j << " Skipping the 2nd\n";
129  continue;
130  }
131  fedDataProd.resize(size);
132  unsigned char *dataProd=fedDataProd.data();
133  const unsigned char *data=fedData.data();
134  for ( unsigned int k=0; k<size; ++k ) {
135  dataProd[k]=data[k];
136  }
137  }
138  }
139 
140  iEvent.put(producedData);
141 
142 }
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::vector< Element > ElementCabling
edm::ESHandle< SiStripRegionCabling > strip_cabling
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void resize(size_t newsize)
Definition: FEDRawData.cc:32
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
std::vector< ElementCabling > WedgeCabling
T sqrt(T t)
Definition: SSEVec.h:18
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
std::pair< double, double > Position
int j
Definition: DBlmapReader.cc:9
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
std::vector< WedgeCabling > RegionCabling
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
std::vector< RegionCabling > Cabling

Member Data Documentation

double SiStripRegFEDSelector::delta_

Definition at line 31 of file SiStripRegFEDSelector.h.

Referenced by produce(), and SiStripRegFEDSelector().

edm::ESHandle<SiStripRegionCabling> SiStripRegFEDSelector::strip_cabling

Definition at line 29 of file SiStripRegFEDSelector.h.

Referenced by produce().

edm::EDGetTokenT<FEDRawDataCollection> SiStripRegFEDSelector::tok_raw_

Definition at line 33 of file SiStripRegFEDSelector.h.

Referenced by produce(), and SiStripRegFEDSelector().

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

Definition at line 34 of file SiStripRegFEDSelector.h.

Referenced by produce(), and SiStripRegFEDSelector().