43 uint32_t word[2]={0,0};
47 const uint32_t rocmsk = 0x3e00000;
48 const uint32_t chnlmsk = 0xfc000000;
50 for(
int jk=1;jk<9;jk++)gap[jk]=0;
51 for(
int jk=1;jk<9;jk++)dum[jk]=0;
54 for(
size_t kk=0;
kk<buffer.size(); ++
kk)
57 word[0] = (uint32_t) buffer[
kk];
58 word[1] = (uint32_t) (buffer[
kk]>>32);
60 for(
size_t iw=0; iw<2; iw++)
62 chan= ((word[iw]&chnlmsk)>>26);
63 roc= ((word[iw]&rocmsk)>>21);
67 if((chan>4)&&(chan<10)&&(fifcnt!=2)) {fif2cnt=0;fifcnt=2;}
68 if((chan>9)&&(chan<14)&&(fifcnt!=3)) {fif2cnt=0;fifcnt=3;}
69 if((chan>13)&&(chan<19)&&(fifcnt!=4)){fif2cnt=0;fifcnt=4;}
70 if((chan>18)&&(chan<23)&&(fifcnt!=5)){fif2cnt=0;fifcnt=5;}
71 if((chan>22)&&(chan<28)&&(fifcnt!=6)){fif2cnt=0;fifcnt=6;}
72 if((chan>27)&&(chan<32)&&(fifcnt!=7)){fif2cnt=0;fifcnt=7;}
73 if((chan>31)&&(fifcnt!=8)){fif2cnt=0;fifcnt=8;}
76 if(roc==26){gap[fifcnt]=(0x1000+(word[iw]&0xff));gapcnt++;}
78 if((roc==27)&&((fif2cnt+dumcnt)<6)){dumcnt++;dum[fifcnt]=(0x1000+(word[iw]&0xff));}
79 else if((roc==27)&&((fif2cnt+dumcnt)>6)){dumcnt=1;fif2cnt=0;fifcnt++;}
83 if(((fif2cnt+dumcnt)==6)&&(dumcnt>0))
84 {dumcnt=0;fif2cnt=0;fifcnt++;}
85 if((gapcnt>0)&&((dumcnt+fif2cnt)>5))
86 {gapcnt=0;fifcnt++;fif2cnt=0;dumcnt=0;}
87 else if((gapcnt>0)&&((dumcnt+fif2cnt)<6)) gapcnt=0;
93 if(gap[1]>0) {totword=(gap[1]&0xff);status=1;}
94 else if(gap[2]>0){totword=(gap[2]&0xff);status=1;}
95 else if(dum[1]>0){totword=(dum[1]&0xff);status=1;}
96 else if(dum[2]>0){totword=(dum[2]&0xff);status=1;}
98 if(gap[3]>0) {totword=totword|((gap[3]&0xff)<<8);status=status|0x2;}
99 else if(gap[4]>0){totword=totword|((gap[4]&0xff)<<8);status=status|0x2;}
100 else if(dum[3]>0){totword=totword|((dum[3]&0xff)<<8);status=status|0x2;}
101 else if(dum[4]>0){totword=totword|((dum[4]&0xff)<<8);status=status|0x2;}
103 if(gap[5]>0) {totword=totword|((gap[5]&0xff)<<16);status=status|0x4;}
104 else if(gap[6]>0){totword=totword|((gap[6]&0xff)<<16);status=status|0x4;}
105 else if(dum[5]>0){totword=totword|((dum[5]&0xff)<<16);status=status|0x4;}
106 else if(dum[6]>0){totword=totword|((dum[6]&0xff)<<16);status=status|0x4;}
108 if(gap[7]>0){totword=totword|((gap[7]&0xff)<<24);status=status|0x8;}
109 else if(gap[8]>0){totword=totword|((gap[8]&0xff)<<24);status=status|0x8;}
110 else if(dum[7]>0){totword=totword|((dum[7]&0xff)<<24);status=status|0x8;}
111 else if(dum[8]>0){totword=totword|((dum[8]&0xff)<<24);status=status|0x8;}
120 m_fedid(pset.getUntrackedParameter<int>(
"fedid")),
122 m_runnumber(pset.getUntrackedParameter<int>(
"runNumber",-1)),
123 m_currenteventnumber(0),
124 m_currenttriggernumber(0),
125 m_eventnumber_shift(0)
127 produces<FEDRawDataCollection>();
130 edm::LogInfo(
"") <<
"no more file to read " << std::endl;
134 edm::LogInfo(
"") <<
"now examining file "<< currentfilename ;
140 edm::LogInfo(
"PixelSLinkDataInputSource") <<
" unsigned long int size = " <<
sizeof(
unsigned long int) <<
"\n unsigned long size = " <<
sizeof(
unsigned long)<<
"\n unsigned long long size = " <<
sizeof(
unsigned long long) <<
"\n uint32_t size = " <<
sizeof(uint32_t) <<
"\n uint64_t size = " <<
sizeof(
uint64_t) << std::endl;
144 edm::LogInfo(
"PixelSLinkDataInputSource") <<
"file size " << size << std::endl;
147 edm::LogInfo(
"") <<
"file " << currentfilename <<
" cannot be found.";
159 if((
m_data >> 60) != 0x5){
162 edm::LogInfo(
"") <<
"WARNING: observed run number encoded in S-Link dump. Overwriting run number as defined in .cfg file!!! Run number now set to " << runnum <<
" (was " <<
m_runnumber <<
")";
182 uint32_t eventnumber =(
m_data >> 32)&0x00ffffff ;
185 std::vector<uint64_t> buffer;
190 eventnumber = (
m_data >> 32)&0x00ffffff ;
193 edm::LogInfo(
"PixelSLinkDataInputSource::produce()") <<
"**** event number = " << eventnumber <<
" global event number " <<
m_currenteventnumber <<
" data " << std::hex <<
m_data << std::dec << std::endl;
194 while ((
m_data >> 60) != 0x5){
199 << std::hex<<
m_data<<std::dec ;
214 edm::LogWarning(
"")<<
"Had to read "<<count<<
" words before finding header!"<<std::endl;
221 uint16_t fed_id=(
m_data>>8)&0xfff;
229 while((
m_data >> 60) != 0xa);
232 std::auto_ptr<FEDRawData> rawData(
new FEDRawData(8*buffer.size()));
234 unsigned char* dataptr=rawData->data();
236 for (uint16_t
i=0;
i<buffer.size();
i++){
239 uint32_t thetriggernumber=0;
257 LogError(
"PixelSLinkDataInputSource") <<
" error, the previous event number (" << eventnumber <<
") is LARGER than the next event number (" <<
m_currenteventnumber <<
")" << std::endl;
bool enableAccounting(bool enabled)
virtual IOSize read(void *into, IOSize n, IOOffset pos)
std::vector< std::string > const & fileNames() const
static StorageFactory * get(void)
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
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 but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
unsigned long long TimeValue_t
unsigned long long uint64_t
LuminosityBlockNumber_t luminosityBlock() const
tuple size
Write out results.