CMS 3D CMS Logo

SubdetFEDSelector.cc
Go to the documentation of this file.
1 
3 
5  getEcal_ = iConfig.getParameter<bool>("getECAL");
6  getStrip_ = iConfig.getParameter<bool>("getSiStrip");
7  getPixel_ = iConfig.getParameter<bool>("getSiPixel");
8  getHcal_ = iConfig.getParameter<bool>("getHCAL");
9  getMuon_ = iConfig.getParameter<bool>("getMuon");
10  getTrigger_ = iConfig.getParameter<bool>("getTrigger");
11 
12  tok_raw_ = consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("rawInputLabel"));
13 
14  produces<FEDRawDataCollection>();
15 }
16 
18 
20  auto producedData = std::make_unique<FEDRawDataCollection>();
21 
23  iEvent.getByToken(tok_raw_, rawIn);
24 
25  std::vector<int> selFEDs;
26 
27  if (getEcal_) {
29  selFEDs.push_back(i);
30  }
32  selFEDs.push_back(i);
33  }
34  }
35 
36  if (getMuon_) {
38  selFEDs.push_back(i);
39  }
41  selFEDs.push_back(i);
42  }
44  selFEDs.push_back(i);
45  }
47  selFEDs.push_back(i);
48  }
50  selFEDs.push_back(i);
51  }
53  selFEDs.push_back(i);
54  }
56  selFEDs.push_back(i);
57  }
59  selFEDs.push_back(i);
60  }
61  }
62 
63  if (getHcal_) {
65  selFEDs.push_back(i);
66  }
67  }
68 
69  if (getStrip_) {
71  selFEDs.push_back(i);
72  }
73  }
74 
75  if (getPixel_) {
77  selFEDs.push_back(i);
78  }
79  }
80 
81  if (getTrigger_) {
83  selFEDs.push_back(i);
84  }
86  selFEDs.push_back(i);
87  }
89  selFEDs.push_back(i);
90  }
92  selFEDs.push_back(i);
93  }
95  selFEDs.push_back(i);
96  }
97 
99  selFEDs.push_back(i);
100  }
101 
103  selFEDs.push_back(i);
104  }
105 
107  selFEDs.push_back(i);
108  }
109 
111  selFEDs.push_back(i);
112  }
113 
115  selFEDs.push_back(i);
116  }
118  selFEDs.push_back(i);
119  }
120 
122  selFEDs.push_back(i);
123  }
125  selFEDs.push_back(i);
126  }
128  selFEDs.push_back(i);
129  }
130  }
131 
133  selFEDs.push_back(i);
134  }
135 
136  // Copying:
137  const FEDRawDataCollection* rdc = rawIn.product();
138 
139  // if ( ( rawData[i].provenance()->processName() != e.processHistory().rbegin()->processName() ) )
140  // continue ; // skip all raw collections not produced by the current process
141 
142  for (int j = 0; j < FEDNumbering::MAXFEDID; ++j) {
143  bool rightFED = false;
144  for (uint32_t k = 0; k < selFEDs.size(); k++) {
145  if (j == selFEDs[k]) {
146  rightFED = true;
147  }
148  }
149  if (!rightFED)
150  continue;
151  const FEDRawData& fedData = rdc->FEDData(j);
152  size_t size = fedData.size();
153 
154  if (size > 0) {
155  // this fed has data -- lets copy it
156  FEDRawData& fedDataProd = producedData->FEDData(j);
157  if (fedDataProd.size() != 0) {
158  // std::cout << " More than one FEDRawDataCollection with data in FED ";
159  // std::cout << j << " Skipping the 2nd\n";
160  continue;
161  }
162  fedDataProd.resize(size);
163  unsigned char* dataProd = fedDataProd.data();
164  const unsigned char* data = fedData.data();
165  for (unsigned int k = 0; k < size; ++k) {
166  dataProd[k] = data[k];
167  }
168  }
169  }
170 
171  iEvent.put(std::move(producedData));
172 }
173 
174 // ------------ method called once each job just before starting event loop ------------
176 
177 // ------------ method called once each job just after ending the event loop ------------
FEDNumbering::MINTriggerLTCFEDID
Definition: FEDNumbering.h:67
FEDNumbering::MAXTriggerLTCSiStripFEDID
Definition: FEDNumbering.h:76
SubdetFEDSelector::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: SubdetFEDSelector.cc:19
FEDNumbering::MINCSCFEDID
Definition: FEDNumbering.h:51
mps_fire.i
i
Definition: mps_fire.py:428
FEDNumbering::MAXTriggerLTCCSCFEDID
Definition: FEDNumbering.h:84
FEDNumbering::MINTriggerEGTPFEDID
Definition: FEDNumbering.h:63
FEDNumbering::MAXCSCTFFEDID
Definition: FEDNumbering.h:54
FEDNumbering::MINTriggerLTCRPCFEDID
Definition: FEDNumbering.h:81
edm::Handle::product
T const * product() const
Definition: Handle.h:70
FEDNumbering::MAXTriggerLTCFEDID
Definition: FEDNumbering.h:68
FEDNumbering::MAXTriggerLTCECALFEDID
Definition: FEDNumbering.h:78
FEDNumbering::MINSiPixelFEDID
Definition: FEDNumbering.h:27
FEDNumbering::MAXTriggerLTCRPCFEDID
Definition: FEDNumbering.h:82
FEDNumbering::MAXSiPixelFEDID
Definition: FEDNumbering.h:28
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
FEDNumbering::MINDTTFFEDID
Definition: FEDNumbering.h:57
FEDNumbering::MAXCSCDDUFEDID
Definition: FEDNumbering.h:90
FEDNumbering::MINTriggerGCTFEDID
Definition: FEDNumbering.h:65
FEDNumbering::MINTriggerLTCSiStripFEDID
Definition: FEDNumbering.h:75
FEDNumbering::MAXFEDID
Definition: FEDNumbering.h:26
FEDNumbering::MAXECALFEDID
Definition: FEDNumbering.h:44
FEDNumbering::MAXDTFEDID
Definition: FEDNumbering.h:56
SubdetFEDSelector::getMuon_
bool getMuon_
Definition: SubdetFEDSelector.h:28
edm::Handle< FEDRawDataCollection >
FEDNumbering::MAXTriggerGCTFEDID
Definition: FEDNumbering.h:66
FEDNumbering::MINTriggerLTCCSCFEDID
Definition: FEDNumbering.h:83
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
FEDNumbering::MINTriggerGTPFEDID
Definition: FEDNumbering.h:61
FEDNumbering::MAXHCALFEDID
Definition: FEDNumbering.h:48
SubdetFEDSelector::endJob
void endJob() override
Definition: SubdetFEDSelector.cc:178
FEDNumbering::MAXTriggerLTCTotemCastorFEDID
Definition: FEDNumbering.h:80
FEDNumbering::MINTriggerLTCHCALFEDID
Definition: FEDNumbering.h:73
FEDNumbering::MAXTriggerGTPFEDID
Definition: FEDNumbering.h:62
SubdetFEDSelector::getTrigger_
bool getTrigger_
Definition: SubdetFEDSelector.h:29
FEDNumbering::MINSiStripFEDID
Definition: FEDNumbering.h:29
FEDNumbering::MINRPCFEDID
Definition: FEDNumbering.h:59
FEDNumbering::MINDAQeFEDFEDID
Definition: FEDNumbering.h:95
SubdetFEDSelector::getStrip_
bool getStrip_
Definition: SubdetFEDSelector.h:26
FEDNumbering::MAXCSCTFSPFEDID
Definition: FEDNumbering.h:94
FEDNumbering::MAXDTTFFEDID
Definition: FEDNumbering.h:58
dqmdumpme.k
k
Definition: dqmdumpme.py:60
FEDNumbering::MINTriggerLTCTriggerFEDID
Definition: FEDNumbering.h:71
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
FEDNumbering::MAXDAQeFEDFEDID
Definition: FEDNumbering.h:96
edm::ParameterSet
Definition: ParameterSet.h:47
FEDNumbering::MINTriggerLTCTotemCastorFEDID
Definition: FEDNumbering.h:79
FEDNumbering::MINHCALFEDID
Definition: FEDNumbering.h:47
SubdetFEDSelector::getPixel_
bool getPixel_
Definition: SubdetFEDSelector.h:27
FEDNumbering::MINCSCDDUFEDID
Definition: FEDNumbering.h:89
iEvent
int iEvent
Definition: GenABIO.cc:224
FEDNumbering::MINPreShowerFEDID
Definition: FEDNumbering.h:31
FEDNumbering::MAXTriggerLTCDTFEDID
Definition: FEDNumbering.h:86
SubdetFEDSelector::getEcal_
bool getEcal_
Definition: SubdetFEDSelector.h:24
edm::EventSetup
Definition: EventSetup.h:58
FEDNumbering::MAXTriggerLTCTriggerFEDID
Definition: FEDNumbering.h:72
SubdetFEDSelector::tok_raw_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
Definition: SubdetFEDSelector.h:31
FEDNumbering::MAXTriggerLTCmtccFEDID
Definition: FEDNumbering.h:70
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
FEDNumbering::MINCSCTFFEDID
Definition: FEDNumbering.h:53
FEDNumbering::MINCSCContingencyFEDID
Definition: FEDNumbering.h:91
FEDNumbering::MINTriggerLTCmtccFEDID
Definition: FEDNumbering.h:69
SubdetFEDSelector::SubdetFEDSelector
SubdetFEDSelector(const edm::ParameterSet &)
Definition: SubdetFEDSelector.cc:4
eostools.move
def move(src, dest)
Definition: eostools.py:511
FEDNumbering::MAXTriggerLTCSiPixelFEDID
Definition: FEDNumbering.h:88
FEDNumbering::MAXTriggerEGTPFEDID
Definition: FEDNumbering.h:64
SubdetFEDSelector::~SubdetFEDSelector
~SubdetFEDSelector() override
Definition: SubdetFEDSelector.cc:17
FEDNumbering::MAXCSCFEDID
Definition: FEDNumbering.h:52
FEDRawData::resize
void resize(size_t newsize)
Definition: FEDRawData.cc:28
FEDNumbering::MINTriggerLTCDTFEDID
Definition: FEDNumbering.h:85
SubdetFEDSelector.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SubdetFEDSelector::beginJob
void beginJob() override
Definition: SubdetFEDSelector.cc:175
FEDNumbering::MINECALFEDID
Definition: FEDNumbering.h:43
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
FEDNumbering::MAXSiStripFEDID
Definition: FEDNumbering.h:30
FEDNumbering::MAXCSCContingencyFEDID
Definition: FEDNumbering.h:92
FEDNumbering::MINCSCTFSPFEDID
Definition: FEDNumbering.h:93
FEDNumbering::MINDTFEDID
Definition: FEDNumbering.h:55
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
FEDNumbering::MINTriggerLTCSiPixelFEDID
Definition: FEDNumbering.h:87
edm::Event
Definition: Event.h:73
FEDNumbering::MAXRPCFEDID
Definition: FEDNumbering.h:60
edm::InputTag
Definition: InputTag.h:15
SubdetFEDSelector::getHcal_
bool getHcal_
Definition: SubdetFEDSelector.h:25
FEDNumbering::MINTriggerLTCECALFEDID
Definition: FEDNumbering.h:77
FEDNumbering::MAXTriggerLTCHCALFEDID
Definition: FEDNumbering.h:74
FEDNumbering::MAXPreShowerFEDID
Definition: FEDNumbering.h:32
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443