CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RawDataFEDSelector.cc
Go to the documentation of this file.
1 //
2 // Original Author: Marco ZANETTI
3 // Created: Mon Jan 28 18:22:13 CET 2008
4 
5 
7 
11 
12 #include <cstdio>
13 #include <cstring>
14 
15 using namespace std;
16 using namespace edm;
17 
18 auto_ptr<FEDRawDataCollection> RawDataFEDSelector::select(const Handle<FEDRawDataCollection> & rawData) {
19 
20  auto_ptr<FEDRawDataCollection> selectedRawData(new FEDRawDataCollection);
21 
22  // if vector of FED indexes is defined, loop over it
23  if (fedList.size()) {
24  vector<int>::const_iterator it = fedList.begin();
25  vector<int>::const_iterator itEnd = fedList.end();
26  for (;it != itEnd; ++it) {
27 
28  const FEDRawData & fedData = rawData->FEDData(*it);
29  size_t size=fedData.size();
30 
31  FEDRawData & fedDataProd = selectedRawData->FEDData(*it);
32  fedDataProd.resize(size);
33 
34  memcpy(fedDataProd.data(),fedData.data(),size);
35  }
36  }
37 
38  // if vector of FED indexes is NOT defined, loop over it FED range
39  else {
40 
41  // FED range is <0,0> (i.e. neither the list nor the rage are defined) copy the entire payload
42  if (fedRange.second==0) setRange(pair<int,int>(0,FEDNumbering::lastFEDId()));
43 
44  for (int i = fedRange.first; i <= fedRange.second; ++i) {
45 
46  const FEDRawData & fedData = rawData->FEDData(i);
47  size_t size=fedData.size();
48 
49  FEDRawData & fedDataProd = selectedRawData->FEDData(i);
50  fedDataProd.resize(size);
51 
52  memcpy(fedDataProd.data(),fedData.data(),size);
53  }
54  }
55 
56  return selectedRawData;
57 }
58 
59 
60 auto_ptr<FEDRawDataCollection> RawDataFEDSelector::select(const Handle<FEDRawDataCollection> & rawData,
61  const pair<int,int> & range) {
62  setRange(range);
63  return select(rawData);
64 }
65 
66 auto_ptr<FEDRawDataCollection> RawDataFEDSelector::select(const Handle<FEDRawDataCollection> & rawData,
67  const vector<int> & list) {
68  setRange(list);
69  return select(rawData);
70 }
71 
72 
73 
74 
int i
Definition: DBlmapReader.cc:9
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
void resize(size_t newsize)
Definition: FEDRawData.cc:32
std::auto_ptr< FEDRawDataCollection > select(const edm::Handle< FEDRawDataCollection > &rawData)
static int lastFEDId()
Definition: FEDNumbering.cc:17
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.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run