43 m_textFileName(iConfig.getParameter<std::
string>(
"TextFileName")),
44 m_fileEventOffset(iConfig.getParameter<int>(
"FileEventOffset")),
48 produces<L1CaloEmCollection>();
49 produces<L1CaloRegionCollection>();
53 std::stringstream fileStream;
54 fileStream <<
m_textFileName << std::setw(2) << std::setfill(
'0') <<
i <<
".txt";
62 <<
"RctTextToRctDigi::RctTextToRctDigi : "
63 <<
" couldn't open the file " <<
fileName <<
"...skipping!" << std::endl;
81 for (
unsigned j=0;
j<4;
j++) {
85 for (
unsigned j=0;
j<14;
j++)
87 for (
unsigned j=0;
j<8;
j++)
99 for (
int j=0;
j<6;
j++){
100 getline(
m_file[crate],tmp);
102 m_file[crate] >> tmp >> bx;
105 <<
"RctTextToRctDigi::bxSynchro : "
106 <<
" something screwy happened Crossing!=" << tmp << std::endl;
141 <<
"RctTextToRctDigi::produce : "
143 <<
" adding empty collection for event !"
155 <<
"RctTextToRctDigi::produce : "
156 <<
" something screwy happened Crossing!=" << tmp << std::endl;
169 <<
"RctTextToRctDigi::produce : "
170 <<
" something screwy happened "
175 unsigned long int uLongBuffer;
176 bool mipBitBuffer[14],qBitBuffer[14];
182 for (
unsigned j=0;
j<4;
j++){
184 em->push_back(
L1CaloEmCand(uLongBuffer, i,
true,
j,BXNum,0));
188 for (
unsigned j=0;
j<4;
j++){
190 em->push_back(
L1CaloEmCand(uLongBuffer, i,
false,
j,BXNum,0));
194 for (
unsigned j=0;
j<14;
j++){
199 for (
unsigned j=0;
j<14;
j++){
204 for (
unsigned j=0;
j<14;
j++){
207 unsigned et = uLongBuffer & 0x3ff;
210 bool overFlow = ((uLongBuffer & 0x1) != 0);
211 bool tauVeto = (((uLongBuffer & 0x2) >> 1) != 0);
213 rgn->push_back(
L1CaloRegion(et,overFlow,tauVeto,mipBitBuffer[
j],qBitBuffer[j],i,j/2,j%2));
217 for (
unsigned j=0;
j<8;
j++){
220 unsigned et = uLongBuffer & 0xff;
std::vector< L1CaloEmCand > L1CaloEmCollection
void bxSynchro(int &, int)
Synchronize bunch crossing.
Level-1 Region Calorimeter Trigger EM candidate.
void putEmptyDigi(edm::Event &)
Create empty digi collection.
std::string m_textFileName
Name out input file.
RctTextToRctDigi(const edm::ParameterSet &)
static const unsigned NUM_RCT_CRATES
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
int m_fileEventOffset
Number of events to be offset wrt input.
std::vector< std::vector< double > > tmp
virtual void produce(edm::Event &, const edm::EventSetup &)
A calorimeter trigger region (sum of 4x4 trigger towers)
std::vector< L1CaloRegion > L1CaloRegionCollection
std::ifstream m_file[18]
file handle