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 <stdio.h>
13 
14 using namespace std;
15 using namespace edm;
16 
17 auto_ptr<FEDRawDataCollection> RawDataFEDSelector::select(const Handle<FEDRawDataCollection> & rawData) {
18 
19  auto_ptr<FEDRawDataCollection> selectedRawData(new FEDRawDataCollection);
20 
21  // if vector of FED indexes is defined, loop over it
22  if (fedList.size()) {
23  vector<int>::const_iterator it = fedList.begin();
24  vector<int>::const_iterator itEnd = fedList.end();
25  for (;it != itEnd; ++it) {
26 
27  const FEDRawData & fedData = rawData->FEDData(*it);
28  size_t size=fedData.size();
29 
30  FEDRawData & fedDataProd = selectedRawData->FEDData(*it);
31  fedDataProd.resize(size);
32 
33  memcpy(fedDataProd.data(),fedData.data(),size);
34  }
35  }
36 
37  // if vector of FED indexes is NOT defined, loop over it FED range
38  else {
39 
40  // FED range is <0,0> (i.e. neither the list nor the rage are defined) copy the entire payload
41  if (fedRange.second==0) setRange(pair<int,int>(0,FEDNumbering::lastFEDId()));
42 
43  for (int i = fedRange.first; i <= fedRange.second; ++i) {
44 
45  const FEDRawData & fedData = rawData->FEDData(i);
46  size_t size=fedData.size();
47 
48  FEDRawData & fedDataProd = selectedRawData->FEDData(i);
49  fedDataProd.resize(size);
50 
51  memcpy(fedDataProd.data(),fedData.data(),size);
52  }
53  }
54 
55  return selectedRawData;
56 }
57 
58 
59 auto_ptr<FEDRawDataCollection> RawDataFEDSelector::select(const Handle<FEDRawDataCollection> & rawData,
60  const pair<int,int> & range) {
61  setRange(range);
62  return select(rawData);
63 }
64 
65 auto_ptr<FEDRawDataCollection> RawDataFEDSelector::select(const Handle<FEDRawDataCollection> & rawData,
66  const vector<int> & list) {
67  setRange(list);
68  return select(rawData);
69 }
70 
71 
72 
73 
int i
Definition: DBlmapReader.cc:9
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
void resize(size_t newsize)
Definition: FEDRawData.cc:33
std::auto_ptr< FEDRawDataCollection > select(const edm::Handle< FEDRawDataCollection > &rawData)
static int lastFEDId()
Definition: FEDNumbering.cc:19
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
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