30 produces<std::vector<uint32_t> > (
"FillerWordEventNumber1");
31 produces<std::vector<uint32_t> > (
"FillerWordEventNumber2");
33 produces<std::vector<uint32_t> > (
"SaveFillerWord");
35 consumes <FEDRawDataCollection>(
label);
45 unsigned int Filler1 = (totword)&0x000000ff;
46 unsigned int Filler2 = ((totword)&0x0000ff00)>>8;
47 unsigned int Filler3 = ((totword)&0x00ff0000)>>16;
48 unsigned int Filler4 = ((totword)&0xffff0000)>>16;
49 unsigned int maskFiller4 = ((totword)&0xff000000)>>16;
50 unsigned int Filler14 = (Filler1&maskFiller4);
51 unsigned int Filler24 = (Filler2&maskFiller4);
52 unsigned int CalibFiller1 = 0;
53 unsigned int CalibFiller2 = 0;
54 bool BoolStat =
false;
57 if ((status == 0x1)||(status == 0x9)){
58 CalibFiller1 = Filler1;
59 if((status == 0x9)){CalibFiller2 = Filler14;}
61 if ((status == 0x2)||(status == 0xa)){
62 CalibFiller1 = Filler2;
63 if((status == 0xa)){CalibFiller2 = Filler24;}
65 if ((status == 0x4)||(status == 0xc)){
66 CalibFiller1 = Filler3;
67 if((status == 0xc)){CalibFiller2 = Filler4;}
69 if ((status == 0x8)){CalibFiller2 = Filler4;}
70 if((status == 0x7)||(status == 0xf)){
71 if((Filler1 == Filler2)&&(Filler1 == Filler3)&&(Filler2 == Filler3)){
72 CalibFiller1 = Filler1;
74 if(status == 0xf){CalibFiller2 = Filler4;}
76 edm::LogError(
"AnazrFedFillerWords")<<
"Status: "<<status <<
"Event ID in Filler words don't match"
77 <<
'\t'<<
"Filler1: "<<(Filler1%256)
78 <<
'\t'<<
"Filler2: "<<(Filler2%256)
79 <<
'\t'<<
"Filler3: "<<(Filler3%256)
83 if((status == 0x3)||(status == 0xb)){
84 if((Filler1 == Filler2)){
85 CalibFiller1 = Filler1;
87 if(status == 0xb){CalibFiller2 = Filler14;}
89 edm::LogError(
"AnazrFedFillerWords")<<
"Status: "<<status <<
"Event ID in Filler words don't match"
90 <<
'\t'<<
"Filler1: "<<(Filler1%256)
91 <<
'\t'<<
"Filler2: "<<(Filler2%256)
95 if((status == 0x5)||(status == 0xd)){
96 if((Filler1 == Filler3)){
97 CalibFiller1 = Filler1;
99 if(status == 0xd){CalibFiller2 = Filler4;}
101 edm::LogError(
"AnazrFedFillerWords")<<
"Status: "<<status <<
"Event ID in Filler words don't match"
102 <<
'\t'<<
"Filler1: "<<(Filler1%256)
103 <<
'\t'<<
"Filler3: "<<(Filler3%256)
107 if((status == 0x6)||(status == 0xe)){
108 if((Filler2 == Filler3)){
109 CalibFiller1 = Filler2;
111 if(status == 0xe){CalibFiller2 = Filler4;}
113 edm::LogError(
"AnazrFedFillerWords")<<
"Status: "<<status <<
"Event ID Filler words don't match"
114 <<
'\t'<<
"Filler2: "<<(Filler2%256)
115 <<
'\t'<<
"Filler3: "<<(Filler3%256)
121 unsigned int CalibEvtNum = ((
EventNum -1)/10);
122 if((CalibFiller1 != 0)&&(CalibEvtNum != CalibFiller1)){
123 edm::LogError(
"AnazrFedFillerWords")<<
"Error, Event ID Numbers Don't match---->"<<
"Filler1 Event ID: "
124 << CalibFiller1 <<
'\t'<<
"Run Event ID: "
125 <<CalibEvtNum<<
'\t'<<std::endl;
126 }
else if((CalibFiller1 != 0)&&(CalibEvtNum == CalibFiller1)){
128 edm::LogInfo(
"AnazrFedFillerWords")<<
"Filler1 Event ID: "
129 <<(CalibFiller1%256)<<std::endl;
130 }
else if((CalibFiller2 != 0)&&(BoolStat ==
true)){
132 edm::LogInfo(
"AnazrFedFillerWords")<<
"Filler2 Event ID:"
133 <<(((CalibFiller2%65536)&(0xff00))>>8)<<std::endl;
134 }
else if((CalibFiller2 != 0)&&(BoolStat ==
false)){
135 if((status == 0x9)||(status == 0xa)||(status == 0xc)){
137 edm::LogInfo(
"AnazrFedFillerWords")<<
"Filler2 Event ID:"<<(((CalibFiller2%65536)&(0xff00))>>8)<<std::endl;
138 }
else if((status == 0x8)){
140 <<
" No Filler1 found, is not possible get any Event ID Number"
149 edm::LogInfo(
"FedFillerWords") <<
"Begin of data"<<std::endl;
151 if( (ldata[0]&0xf000000000000000LL) != 0x5000000000000000LL )
169 const uint32_t rocmsk = 0x3e00000;
170 const uint32_t chnlmsk = 0xfc000000;
172 for(
int jk=0;jk<8;jk++)gap[jk]=0;
173 for(
int jk=0;jk<8;jk++)dum[jk]=0;
176 for(
int kk=1;
kk<length-1;
kk++) {
178 if((((ldata[
kk]&0xff00000000000000LL)>>32) == 0xa0000000)
179 && (((ldata[
kk]&0xffffff00000000LL)>>32)== (
uint64_t)(
kk+1))){
break;}
181 word2 = (uint32_t) ldata[
kk];
182 word1 = (uint32_t) (ldata[
kk]>>32);
186 chan= ((word1&chnlmsk)>>26);
187 roc= ((word1&rocmsk)>>21);
194 if((chan<5)&&(fifcnt!=1)){
195 edm::LogError(
"FedFillerWords") <<
" error in fifo counting!"<<std::endl;
197 if((chan>4)&&(chan<10)&&(fifcnt!=2)) {fif2cnt=0;fifcnt=2;}
198 if((chan>9)&&(chan<14)&&(fifcnt!=3)) {fif2cnt=0;fifcnt=3;}
199 if((chan>13)&&(chan<19)&&(fifcnt!=4)){fif2cnt=0;fifcnt=4;}
200 if((chan>18)&&(chan<23)&&(fifcnt!=5)){fif2cnt=0;fifcnt=5;}
201 if((chan>22)&&(chan<28)&&(fifcnt!=6)){fif2cnt=0;fifcnt=6;}
202 if((chan>27)&&(chan<32)&&(fifcnt!=7)){fif2cnt=0;fifcnt=7;}
203 if((chan>31)&&(fifcnt!=8)){fif2cnt=0;fifcnt=8;}
208 gap[fifcnt-1]=(0x1000+(word1&0xff));
212 if((roc==27)&&((fif2cnt+dumcnt)<6)){
213 dum[fifcnt-1]=(0x1000+(word1&0xff));
216 else if((roc==27)&&((fif2cnt+dumcnt)>6)){
224 chan= ((word2&chnlmsk)>>26);
225 roc= ((word2&rocmsk)>>21);
231 edm::LogInfo(
"FedFillerWords") <<
" ***Stale dummy!"<<std::endl;
233 if((chan<5)&&(fifcnt!=1)){
234 edm::LogError(
"FedFillerWords") <<
" error in fifo counting!"<<std::endl;
236 if((chan>4)&&(chan<10)&&(fifcnt!=2)) {fif2cnt=0;fifcnt=2;}
237 if((chan>9)&&(chan<14)&&(fifcnt!=3)) {fif2cnt=0;fifcnt=3;}
238 if((chan>13)&&(chan<19)&&(fifcnt!=4)){fif2cnt=0;fifcnt=4;}
239 if((chan>18)&&(chan<23)&&(fifcnt!=5)){fif2cnt=0;fifcnt=5;}
240 if((chan>22)&&(chan<28)&&(fifcnt!=6)){fif2cnt=0;fifcnt=6;}
241 if((chan>27)&&(chan<32)&&(fifcnt!=7)){fif2cnt=0;fifcnt=7;}
242 if((chan>31)&&(fifcnt!=8)){fif2cnt=0;fifcnt=8;}
246 gap[fifcnt-1]=(0x1000+(word2&0xff));
249 if ((roc==27)&&((fif2cnt+dumcnt)<6)){
250 dum[fifcnt-1]=(0x1000+(word1&0xff));
253 else if((roc==27)&&((fif2cnt+dumcnt)>6)){
260 if(((fif2cnt+dumcnt)==6)&&(dumcnt>0)){
265 if((gapcnt>0)&&((dumcnt+fif2cnt)>5)){
271 else if((gapcnt>0)&&((dumcnt+fif2cnt)<6)){
280 totword=(gap[0]&0xff);
284 totword=(gap[1]&0xff);
288 totword=(dum[0]&0xff);
292 totword=(dum[1]&0xff);
297 totword=totword|((gap[2]&0xff)<<8);
301 totword=totword|((gap[3]&0xff)<<8);
305 totword=totword|((dum[2]&0xff)<<8);
309 totword=totword|((dum[3]&0xff)<<8);
314 totword=totword|((gap[4]&0xff)<<16);
318 totword=totword|((gap[5]&0xff)<<16);
322 totword=totword|((dum[4]&0xff)<<16);
326 totword=totword|((dum[5]&0xff)<<16);
331 totword=totword|((gap[6]&0xff)<<24);
335 totword=totword|((gap[7]&0xff)<<24);
339 totword=totword|((dum[6]&0xff)<<24);
343 totword=totword|((dum[7]&0xff)<<24);
352 <<std::hex<<
" Status = 0x"
364 std::auto_ptr<std::vector<uint32_t> > FillerWordEventNumbers1(
new std::vector<uint32_t>);
365 std::auto_ptr<std::vector<uint32_t> > FillerWordEventNumbers2(
new std::vector<uint32_t>);
366 std::auto_ptr<std::vector<uint32_t> > SaveFillerWords(
new std::vector<uint32_t>);
369 std::pair<int,int> fedIds;
373 for (
int fedId = fedIds.first; fedId <= fedIds.second; fedId++) {
374 edm::LogInfo(
"FedFillerWords") <<
" examining FED: " << fedId << std::endl;
375 const FEDRawData& fedRawData = buffers->FEDData( fedId );
377 if(fedRawData.
size()!= 0){
387 edm::LogWarning(
"FedFillerWords") <<
"========= Filler Words Vector is empty! ==========" <<std::endl;
390 edm::LogInfo(
"FedFillerWords") <<
"Found " << value <<
" filler words in FED " << fedId << std::endl;
399 iEvent.
put(FillerWordEventNumbers1 ,
"FillerWordEventNumber1");
400 iEvent.
put(FillerWordEventNumbers2 ,
"FillerWordEventNumber2");
405 iEvent.
put(SaveFillerWords,
"SaveFillerWord");
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int CalibStatFillWord(unsigned int, int)
std::vector< uint32_t > vecFillerWordsEventNumber1
#define DEFINE_FWK_MODULE(type)
size_t size() const
Lenght of the data buffer in bytes.
virtual void produce(edm::Event &, const edm::EventSetup &)
int PwordSlink64(uint64_t *, const int, uint32_t &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
unsigned int CalibStatFill
~SiPixelFedFillerWordEventNumber()
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned long long uint64_t
std::vector< uint32_t > vecSaveFillerWords
std::vector< uint32_t >::iterator vecSaveFillerWords_It
std::vector< uint32_t > vecFillerWordsEventNumber2
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
std::vector< uint32_t >::iterator vecFillerWordsEventNumber2_It
SiPixelFedFillerWordEventNumber(const edm::ParameterSet &)
std::vector< uint32_t >::iterator vecFillerWordsEventNumber1_It