28 verbosity(conf.getUntrackedParameter<unsigned int>(
"verbosity", 0)),
29 printErrorSummary(conf.getUntrackedParameter<unsigned int>(
"printErrorSummary", 1)),
30 printUnknownFrameSummary(conf.getUntrackedParameter<unsigned int>(
"printUnknownFrameSummary", 1)),
32 testFootprint(conf.getParameter<unsigned int>(
"testFootprint")),
33 testCRC(conf.getParameter<unsigned int>(
"testCRC")),
34 testID(conf.getParameter<unsigned int>(
"testID")),
35 testECMostFrequent(conf.getParameter<unsigned int>(
"testECMostFrequent")),
36 testBCMostFrequent(conf.getParameter<unsigned int>(
"testBCMostFrequent")),
38 EC_min(conf.getUntrackedParameter<unsigned int>(
"EC_min", 10)),
39 BC_min(conf.getUntrackedParameter<unsigned int>(
"BC_min", 10)),
41 EC_fraction(conf.getUntrackedParameter<double>(
"EC_fraction", 0.6)),
42 BC_fraction(conf.getUntrackedParameter<double>(
"BC_fraction", 0.6))
49 map<TotemFramePosition, RawToDigiConverter::Record> &records)
61 records[
p.first] = { &
p.second,
NULL, st };
73 bool problemsPresent =
false;
74 bool stopProcessing =
false;
77 auto records_it = records.find(fr.Position());
78 if (records_it == records.end())
86 record.
frame = fr.Data();
94 problemsPresent =
true;
97 fes <<
" invalid footprint\n";
102 stopProcessing =
true;
109 problemsPresent =
true;
112 fes <<
" CRC failure\n";
117 stopProcessing =
true;
124 fes <<
" ID mismatch (data: 0x" << hex << record.
frame->
getChipID()
130 stopProcessing =
true;
137 string message = (stopProcessing) ?
"(and will be dropped)" :
"(but will be used though)";
140 ees <<
" Frame at " << fr.Position() <<
" seems corrupted " << message <<
":\n";
143 ees <<
" Frame at " << fr.Position() <<
" seems corrupted " << message <<
".\n";
151 if (fr.Data()->isECPresent())
152 ECChecker.
Fill(fr.Data()->getEC(), fr.Position());
154 if (fr.Data()->isBCPresent())
155 BCChecker.
Fill(fr.Data()->getBC(), fr.Position());
168 for (
const auto &
p : records)
170 if (
p.second.status.isMissing())
171 ees <<
"Frame for VFAT " <<
p.first <<
" is not present in the data.\n";
176 if (
verbosity > 0 && !ees.rdbuf()->str().empty())
179 LogProblem(
"Totem") <<
"Error in RawToDigiConverter::RunCommon > " <<
"event contains the following problems:\n" << ees.rdbuf() << endl;
181 LogProblem(
"Totem") <<
"Error in RawToDigiConverter::RunCommon > " <<
"event contains problems." << endl;
187 for (
const auto &it : records)
189 if (!it.second.status.isOK())
192 m[it.second.status]++;
205 map<TotemFramePosition, Record> records;
211 for (
auto &
p : records)
217 uint8_t chipPosition = chipId.
chip();
234 anMa = analysisIter->second;
242 unsigned short offset = chipPosition * 128;
245 for (
auto ch : activeChannels)
268 map<TotemFramePosition, Record> records;
274 for (
auto &
p : records)
306 LogVerbatim(
"Totem") <<
"* Error summary (error signature : number of such events)" << endl;
311 for (
const auto &it : vit.second)
312 LogVerbatim(
"Totem") <<
" " << it.first <<
" : " << it.second << endl;
318 LogVerbatim(
"Totem") <<
"* Frames found in data, but not in the mapping (frame position : number of events)" << endl;
320 LogVerbatim(
"Totem") <<
" " << it.first <<
" : " << it.second << endl;
Detector ID class for TOTEM Si strip detectors.
void Run(const VFATFrameCollection &coll, const TotemDAQMapping &mapping, const TotemAnalysisMask &mask, edm::DetSetVector< TotemRPDigi > &digi, edm::DetSetVector< TotemVFATStatus > &status)
Creates RP digi.
Contains data on masked channels of a VFAT.
void push_back(const T &t)
unsigned int testECMostFrequent
unsigned int printErrorSummary
void setCRCError(bool val=true)
Class for finding the most popular both EC and BC counter, and filling the conversion status 'wrong E...
uint32_t getLeadingEdgeTime() const
get timing infromation
void Analyze(T &status, bool error, std::ostream &es)
summarizes and fill the status (wrong EC and BC progress error for some frames)
TotemSymbID symbolicID
the symbolic id
void setNumberOfClusters(uint8_t v)
bool checkFootprint() const
RawToDigiConverter(const edm::ParameterSet &conf)
virtual bool checkCRC() const
uint8_t getNumberOfClusters() const
uint32_t getThresholdVoltage() const
VFATFrame::word getMultihit() const
unsigned int testFootprint
flags for which tests to run
std::map< TotemSymbID, TotemVFATAnalysisMask > analysisMask
static std::string const input
reference find_or_insert(det_id_type id)
the VFATFrameCollection interator
unsigned int printUnknownFrameSummary
bool isNumberOfClustersPresent() const
Returns true if the CRC word is present in the frame.
The mapping between FramePosition and VFATInfo.
const TotemVFATInfo * info
bool fullMask
whether all channels of the VFAT shall be masked
void PrintSummaries()
Print error summaries.
void setMissing(bool val=true)
unsigned int symbolicID
chip ID, raw integer representation of DetId class
void setFootprintError(bool val=true)
uint32_t getTrailingEdgeTime() const
void setNumberOfClustersSpecified(bool v)
std::map< TotemFramePosition, unsigned int > unknownSummary
VFATFrame::word getHptdcErrorFlag() const
VFATFrame::word getEC() const
Returns Event Counter (EV<7:0>).
unsigned int hwID
the hardware ID (16 bit)
unsigned int testBCMostFrequent
std::map< TotemFramePosition, TotemVFATInfo > VFATMapping
void setEC(const uint8_t ec)
void Fill(word counter, TotemFramePosition fr)
add new value to map, counter takes value of EC or BC number
void setPartiallyMaskedOut()
std::set< unsigned char > maskedChannels
list of channels to be masked
std::map< TotemFramePosition, std::map< TotemVFATStatus, unsigned int > > errorSummary
error summaries
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
bool IsEnd()
returns whether the iterator points over the end of the collection
void setIDMismatch(bool val=true)
bool isIDPresent() const
Returns true if the ID word is present in the frame.
double EC_fraction
the minimal required (relative) occupancy of the most frequent counter value to be accepted ...
VFATFrame::word getChipID() const
Returns ChipID (ChipID<11:0>).
void setChipPosition(uint8_t _cp)
virtual std::vector< unsigned char > getActiveChannels() const
TotemRPDetId getPlaneId() const
void RunCommon(const VFATFrameCollection &input, const TotemDAQMapping &mapping, std::map< TotemFramePosition, Record > &records)
Common processing for all VFAT based sub-systems.
unsigned int EC_min
the minimal required number of frames to determine the most frequent counter value ...