47 : m_textFileName(iConfig.getParameter<std::
string>(
"TextFileName")),
48 m_fileEventOffset(iConfig.getParameter<int>(
"FileEventOffset")),
51 produces<L1CaloEmCollection>();
52 produces<L1CaloRegionCollection>();
56 std::stringstream fileStream;
57 fileStream <<
m_textFileName << std::setw(2) << std::setfill(
'0') <<
i <<
".txt";
63 LogDebug(
"RctTextToRctDigi") <<
"RctTextToRctDigi::RctTextToRctDigi : "
64 <<
" 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++)
86 rgn->push_back(
L1CaloRegion(0,
false,
false,
false,
false,
i,
j / 2,
j % 2));
87 for (
unsigned j = 0;
j < 8;
j++)
99 for (
int j = 0;
j < 6;
j++) {
100 getline(
m_file[crate], tmp);
103 if (tmp !=
"Crossing")
105 <<
"RctTextToRctDigi::bxSynchro : "
106 <<
" something screwy happened Crossing!=" << tmp << std::endl;
136 LogDebug(
"RctTextToRctDigi") <<
"RctTextToRctDigi::produce : "
138 <<
" adding empty collection for event !" << std::endl;
146 if (tmp !=
"Crossing") {
148 <<
"RctTextToRctDigi::produce : "
149 <<
" something screwy happened Crossing!=" << tmp << std::endl;
162 <<
"RctTextToRctDigi::produce : "
163 <<
" something screwy happened "
167 unsigned long int uLongBuffer;
168 bool mipBitBuffer[14], qBitBuffer[14];
174 for (
unsigned j = 0;
j < 4;
j++) {
176 em->push_back(
L1CaloEmCand(uLongBuffer, i,
true,
j, BXNum,
false));
180 for (
unsigned j = 0;
j < 4;
j++) {
182 em->push_back(
L1CaloEmCand(uLongBuffer, i,
false,
j, BXNum,
false));
186 for (
unsigned j = 0;
j < 14;
j++) {
191 for (
unsigned j = 0;
j < 14;
j++) {
196 for (
unsigned j = 0;
j < 14;
j++) {
199 unsigned et = uLongBuffer & 0x3ff;
202 bool overFlow = ((uLongBuffer & 0x1) != 0);
203 bool tauVeto = (((uLongBuffer & 0x2) >> 1) != 0);
205 rgn->push_back(
L1CaloRegion(et, overFlow, tauVeto, mipBitBuffer[
j], qBitBuffer[j], i, j / 2, j % 2));
209 for (
unsigned j = 0;
j < 8;
j++) {
212 unsigned et = uLongBuffer & 0xff;
std::vector< L1CaloEmCand > L1CaloEmCollection
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
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
~RctTextToRctDigi() override
auto const good
min quality of good
int m_fileEventOffset
Number of events to be offset wrt input.
A calorimeter trigger region (sum of 4x4 trigger towers)
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< L1CaloRegion > L1CaloRegionCollection
std::ifstream m_file[18]
file handle