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
ECALRegFEDSelector Class Reference

#include <ECALRegFEDSelector.h>

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

Public Member Functions

 ECALRegFEDSelector (const edm::ParameterSet &)
 
 ~ECALRegFEDSelector ()
 
- 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_
 
const EcalElectronicsMappingec_mapping
 
bool fedSaved [1200]
 
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 31 of file ECALRegFEDSelector.h.

Constructor & Destructor Documentation

ECALRegFEDSelector::ECALRegFEDSelector ( const edm::ParameterSet iConfig)

Definition at line 7 of file ECALRegFEDSelector.cc.

References delta_, ec_mapping, fedSaved, edm::ParameterSet::getParameter(), AlCaHLTBitMon_ParallelJobs::p, tok_raw_, and tok_seed_.

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 
15 
16  produces<FEDRawDataCollection>();
17  produces<EcalListOfFEDS>();
18 
19  for (int p=0; p<1200; p++)
20  {
21  fedSaved[p]=false;
22  }
23 }
T getParameter(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
const EcalElectronicsMapping * ec_mapping
ECALRegFEDSelector::~ECALRegFEDSelector ( )

Definition at line 26 of file ECALRegFEDSelector.cc.

27 {
28 }

Member Function Documentation

void ECALRegFEDSelector::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 116 of file ECALRegFEDSelector.cc.

116  {
117 }
void ECALRegFEDSelector::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 120 of file ECALRegFEDSelector.cc.

120  {
121 }
void ECALRegFEDSelector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 31 of file ECALRegFEDSelector.cc.

References FEDRawData::data(), data, delta_, ec_mapping, FEDRawDataCollection::FEDData(), EcalRegionCabling::fedIndex(), HLT_25ns10e33_v2_cff::fedList, fedSaved, edm::Event::getByToken(), EcalElectronicsMapping::GetListofFEDs(), j, relval_2017::k, FEDNumbering::MAXFEDID, FEDNumbering::MAXPreShowerFEDID, FEDNumbering::MINPreShowerFEDID, AlCaHLTBitMon_ParallelJobs::p, edm::Handle< T >::product(), edm::Event::put(), FEDRawData::resize(), FEDRawData::size(), findQualityFiles::size, tok_raw_, tok_seed_, and trigger::TriggerTrack.

Referenced by JSONExport.JsonExport::export().

32 {
33  for (int p=0; p<1200; p++)
34  {
35  fedSaved[p]=false;
36  }
37 
38  std::auto_ptr<FEDRawDataCollection> producedData(new FEDRawDataCollection);
39 
40  std::auto_ptr<EcalListOfFEDS> fedList(new EcalListOfFEDS);
41 
43  iEvent.getByToken(tok_seed_,trigSeedTrks);
44 
45  std::vector< edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
46  trigSeedTrks->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
47 
49  iEvent.getByToken(tok_raw_,rawIn);
50 
51  // std::vector<int> EC_FED_IDs;
52 
53  for (uint32_t p=0; p<isoPixTrackRefs.size(); p++)
54  {
55  double etaObj_=isoPixTrackRefs[p]->track()->eta();
56  double phiObj_=isoPixTrackRefs[p]->track()->phi();
57 
58  EcalEtaPhiRegion ecEtaPhi(etaObj_-delta_,etaObj_+delta_,phiObj_-delta_,phiObj_+delta_);
59 
60  const std::vector<int> EC_FED_IDs=ec_mapping->GetListofFEDs(ecEtaPhi);
61 
62  const FEDRawDataCollection *rdc=rawIn.product();
63 
64  for ( int j=0; j< FEDNumbering::MAXFEDID; j++ )
65  {
66  bool rightFED=false;
67  for (uint32_t k=0; k<EC_FED_IDs.size(); k++)
68  {
69  if (j==EcalRegionCabling::fedIndex(EC_FED_IDs[k]))
70  {
71  if (!fedSaved[j])
72  {
73  fedList->AddFED(j);
74  rightFED=true;
75  fedSaved[j]=true;
76  }
77  }
78  }
80  {
81  fedSaved[j]=true;
82  rightFED=true;
83  }
84  if (!rightFED) continue;
85  const FEDRawData & fedData = rdc->FEDData(j);
86  size_t size=fedData.size();
87 
88  if ( size > 0 )
89  {
90  // this fed has data -- lets copy it
91  FEDRawData & fedDataProd = producedData->FEDData(j);
92  if ( fedDataProd.size() != 0 )
93  {
94 // std::cout << " More than one FEDRawDataCollection with data in FED ";
95 // std::cout << j << " Skipping the 2nd\n";
96  continue;
97  }
98  fedDataProd.resize(size);
99  unsigned char *dataProd=fedDataProd.data();
100  const unsigned char *data=fedData.data();
101  for ( unsigned int k=0; k<size; ++k )
102  {
103  dataProd[k]=data[k];
104  }
105  }
106 
107  }
108  }
109 
110  iEvent.put(producedData);
111  iEvent.put(fedList);
112 
113 }
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const EcalElectronicsMapping * ec_mapping
static int fedIndex(const uint32_t index)
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
int j
Definition: DBlmapReader.cc:9
T const * product() const
Definition: Handle.h:81
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< int > GetListofFEDs(const EcalEtaPhiRegion &region) const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
tuple size
Write out results.

Member Data Documentation

double ECALRegFEDSelector::delta_

Definition at line 37 of file ECALRegFEDSelector.h.

Referenced by ECALRegFEDSelector(), and produce().

const EcalElectronicsMapping* ECALRegFEDSelector::ec_mapping

Definition at line 35 of file ECALRegFEDSelector.h.

Referenced by ECALRegFEDSelector(), and produce().

bool ECALRegFEDSelector::fedSaved[1200]

Definition at line 38 of file ECALRegFEDSelector.h.

Referenced by ECALRegFEDSelector(), and produce().

edm::EDGetTokenT<FEDRawDataCollection> ECALRegFEDSelector::tok_raw_

Definition at line 40 of file ECALRegFEDSelector.h.

Referenced by ECALRegFEDSelector(), and produce().

Definition at line 41 of file ECALRegFEDSelector.h.

Referenced by ECALRegFEDSelector(), and produce().