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

#include <SubdetFEDSelector.h>

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

Public Member Functions

 SubdetFEDSelector (const edm::ParameterSet &)
 
 ~SubdetFEDSelector ()
 
- 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

bool getEcal_
 
bool getHcal_
 
bool getMuon_
 
bool getPixel_
 
bool getStrip_
 
bool getTrigger_
 
edm::EDGetTokenT
< FEDRawDataCollection
tok_raw_
 

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 20 of file SubdetFEDSelector.h.

Constructor & Destructor Documentation

SubdetFEDSelector::SubdetFEDSelector ( const edm::ParameterSet iConfig)

Definition at line 4 of file SubdetFEDSelector.cc.

References getEcal_, getHcal_, getMuon_, edm::ParameterSet::getParameter(), getPixel_, getStrip_, getTrigger_, and tok_raw_.

5 {
6  getEcal_=iConfig.getParameter<bool>("getECAL");
7  getStrip_=iConfig.getParameter<bool>("getSiStrip");
8  getPixel_=iConfig.getParameter<bool>("getSiPixel");
9  getHcal_=iConfig.getParameter<bool>("getHCAL");
10  getMuon_=iConfig.getParameter<bool>("getMuon");
11  getTrigger_=iConfig.getParameter<bool>("getTrigger");
12 
13  tok_raw_ = consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("rawInputLabel"));
14 
15  produces<FEDRawDataCollection>();
16 
17 }
T getParameter(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
SubdetFEDSelector::~SubdetFEDSelector ( )

Definition at line 19 of file SubdetFEDSelector.cc.

20 {
21 }

Member Function Documentation

void SubdetFEDSelector::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 226 of file SubdetFEDSelector.cc.

226  {
227 }
void SubdetFEDSelector::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 230 of file SubdetFEDSelector.cc.

230  {
231 }
void SubdetFEDSelector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 24 of file SubdetFEDSelector.cc.

References FEDRawData::data(), data, FEDRawDataCollection::FEDData(), edm::Event::getByToken(), getEcal_, getHcal_, getMuon_, getPixel_, getStrip_, getTrigger_, i, j, relval_2017::k, FEDNumbering::MAXCSCContingencyFEDID, FEDNumbering::MAXCSCDDUFEDID, FEDNumbering::MAXCSCFEDID, FEDNumbering::MAXCSCTFFEDID, FEDNumbering::MAXCSCTFSPFEDID, FEDNumbering::MAXDAQeFEDFEDID, FEDNumbering::MAXDTFEDID, FEDNumbering::MAXDTTFFEDID, FEDNumbering::MAXECALFEDID, FEDNumbering::MAXFEDID, FEDNumbering::MAXHCALFEDID, FEDNumbering::MAXPreShowerFEDID, FEDNumbering::MAXRPCFEDID, FEDNumbering::MAXSiPixelFEDID, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MAXTriggerEGTPFEDID, FEDNumbering::MAXTriggerGCTFEDID, FEDNumbering::MAXTriggerGTPFEDID, FEDNumbering::MAXTriggerLTCCSCFEDID, FEDNumbering::MAXTriggerLTCDTFEDID, FEDNumbering::MAXTriggerLTCECALFEDID, FEDNumbering::MAXTriggerLTCFEDID, FEDNumbering::MAXTriggerLTCHCALFEDID, FEDNumbering::MAXTriggerLTCmtccFEDID, FEDNumbering::MAXTriggerLTCRPCFEDID, FEDNumbering::MAXTriggerLTCSiPixelFEDID, FEDNumbering::MAXTriggerLTCSiStripFEDID, FEDNumbering::MAXTriggerLTCTotemCastorFEDID, FEDNumbering::MAXTriggerLTCTriggerFEDID, FEDNumbering::MINCSCContingencyFEDID, FEDNumbering::MINCSCDDUFEDID, FEDNumbering::MINCSCFEDID, FEDNumbering::MINCSCTFFEDID, FEDNumbering::MINCSCTFSPFEDID, FEDNumbering::MINDAQeFEDFEDID, FEDNumbering::MINDTFEDID, FEDNumbering::MINDTTFFEDID, FEDNumbering::MINECALFEDID, FEDNumbering::MINHCALFEDID, FEDNumbering::MINPreShowerFEDID, FEDNumbering::MINRPCFEDID, FEDNumbering::MINSiPixelFEDID, FEDNumbering::MINSiStripFEDID, FEDNumbering::MINTriggerEGTPFEDID, FEDNumbering::MINTriggerGCTFEDID, FEDNumbering::MINTriggerGTPFEDID, FEDNumbering::MINTriggerLTCCSCFEDID, FEDNumbering::MINTriggerLTCDTFEDID, FEDNumbering::MINTriggerLTCECALFEDID, FEDNumbering::MINTriggerLTCFEDID, FEDNumbering::MINTriggerLTCHCALFEDID, FEDNumbering::MINTriggerLTCmtccFEDID, FEDNumbering::MINTriggerLTCRPCFEDID, FEDNumbering::MINTriggerLTCSiPixelFEDID, FEDNumbering::MINTriggerLTCSiStripFEDID, FEDNumbering::MINTriggerLTCTotemCastorFEDID, FEDNumbering::MINTriggerLTCTriggerFEDID, edm::Handle< T >::product(), edm::Event::put(), FEDRawData::resize(), FEDRawData::size(), findQualityFiles::size, and tok_raw_.

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

25 {
26 
27  std::auto_ptr<FEDRawDataCollection> producedData(new FEDRawDataCollection);
28 
30  iEvent.getByToken(tok_raw_,rawIn);
31 
32  std::vector<int> selFEDs;
33 
34  if (getEcal_)
35  {
37  {
38  selFEDs.push_back(i);
39  }
41  {
42  selFEDs.push_back(i);
43  }
44  }
45 
46  if (getMuon_)
47  {
49  {
50  selFEDs.push_back(i);
51  }
53  {
54  selFEDs.push_back(i);
55  }
57  {
58  selFEDs.push_back(i);
59  }
61  {
62  selFEDs.push_back(i);
63  }
65  {
66  selFEDs.push_back(i);
67  }
69  {
70  selFEDs.push_back(i);
71  }
73  {
74  selFEDs.push_back(i);
75  }
77  {
78  selFEDs.push_back(i);
79  }
80  }
81 
82 
83  if (getHcal_)
84  {
86  {
87  selFEDs.push_back(i);
88  }
89  }
90 
91 
92  if (getStrip_)
93  {
95  {
96  selFEDs.push_back(i);
97  }
98  }
99 
100 
101  if (getPixel_)
102  {
104  {
105  selFEDs.push_back(i);
106  }
107  }
108 
109  if (getTrigger_)
110  {
112  {
113  selFEDs.push_back(i);
114  }
116  {
117  selFEDs.push_back(i);
118  }
120  {
121  selFEDs.push_back(i);
122  }
124  {
125  selFEDs.push_back(i);
126  }
128  {
129  selFEDs.push_back(i);
130  }
131 
133  {
134  selFEDs.push_back(i);
135  }
136 
138  {
139  selFEDs.push_back(i);
140  }
141 
143  {
144  selFEDs.push_back(i);
145  }
146 
148  {
149  selFEDs.push_back(i);
150  }
151 
153  {
154  selFEDs.push_back(i);
155  }
157  {
158  selFEDs.push_back(i);
159  }
160 
162  {
163  selFEDs.push_back(i);
164  }
166  {
167  selFEDs.push_back(i);
168  }
170  {
171  selFEDs.push_back(i);
172  }
173 
174  }
175 
177  {
178  selFEDs.push_back(i);
179  }
180 
181 
182  // Copying:
183  const FEDRawDataCollection *rdc=rawIn.product();
184 
185  // if ( ( rawData[i].provenance()->processName() != e.processHistory().rbegin()->processName() ) )
186  // continue ; // skip all raw collections not produced by the current process
187 
188  for ( int j=0; j< FEDNumbering::MAXFEDID; ++j )
189  {
190  bool rightFED=false;
191  for (uint32_t k=0; k<selFEDs.size(); k++)
192  {
193  if (j==selFEDs[k])
194  {
195  rightFED=true;
196  }
197  }
198  if (!rightFED) continue;
199  const FEDRawData & fedData = rdc->FEDData(j);
200  size_t size=fedData.size();
201 
202  if ( size > 0 )
203  {
204  // this fed has data -- lets copy it
205  FEDRawData & fedDataProd = producedData->FEDData(j);
206  if ( fedDataProd.size() != 0 ) {
207 // std::cout << " More than one FEDRawDataCollection with data in FED ";
208 // std::cout << j << " Skipping the 2nd\n";
209  continue;
210  }
211  fedDataProd.resize(size);
212  unsigned char *dataProd=fedDataProd.data();
213  const unsigned char *data=fedData.data();
214  for ( unsigned int k=0; k<size; ++k ) {
215  dataProd[k]=data[k];
216  }
217  }
218  }
219 
220  iEvent.put(producedData);
221 
222 }
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
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
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
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

bool SubdetFEDSelector::getEcal_

Definition at line 25 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getHcal_

Definition at line 26 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getMuon_

Definition at line 29 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getPixel_

Definition at line 28 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getStrip_

Definition at line 27 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getTrigger_

Definition at line 30 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

edm::EDGetTokenT<FEDRawDataCollection> SubdetFEDSelector::tok_raw_

Definition at line 32 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().