File indexing completed on 2024-04-06 12:10:29
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef EventFilter_CTPPSRawToDigi_RawToDigiConverter
0012 #define EventFilter_CTPPSRawToDigi_RawToDigiConverter
0013
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "DataFormats/Common/interface/DetSetVector.h"
0016 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0017
0018 #include "EventFilter/CTPPSRawToDigi/interface/VFATFrameCollection.h"
0019
0020 #include "CondFormats/PPSObjects/interface/TotemDAQMapping.h"
0021 #include "CondFormats/PPSObjects/interface/TotemAnalysisMask.h"
0022
0023 #include "DataFormats/CTPPSDigi/interface/TotemRPDigi.h"
0024 #include "DataFormats/CTPPSDigi/interface/TotemVFATStatus.h"
0025 #include "DataFormats/CTPPSDigi/interface/CTPPSDiamondDigi.h"
0026 #include "DataFormats/CTPPSDigi/interface/TotemTimingDigi.h"
0027 #include "DataFormats/TotemReco/interface/TotemT2Digi.h"
0028
0029
0030 class RawToDigiConverter {
0031 public:
0032 RawToDigiConverter(const edm::ParameterSet &conf);
0033
0034
0035 void run(const VFATFrameCollection &coll,
0036 const TotemDAQMapping &mapping,
0037 const TotemAnalysisMask &mask,
0038 edm::DetSetVector<TotemRPDigi> &digi,
0039 edm::DetSetVector<TotemVFATStatus> &status);
0040
0041
0042 void run(const VFATFrameCollection &coll,
0043 const TotemDAQMapping &mapping,
0044 const TotemAnalysisMask &mask,
0045 edm::DetSetVector<CTPPSDiamondDigi> &digi,
0046 edm::DetSetVector<TotemVFATStatus> &status);
0047
0048
0049 void run(const VFATFrameCollection &coll,
0050 const TotemDAQMapping &mapping,
0051 const TotemAnalysisMask &mask,
0052 edm::DetSetVector<TotemTimingDigi> &digi,
0053 edm::DetSetVector<TotemVFATStatus> &status);
0054
0055
0056 void run(const VFATFrameCollection &coll,
0057 const TotemDAQMapping &mapping,
0058 const TotemAnalysisMask &mask,
0059 edmNew::DetSetVector<TotemT2Digi> &digi,
0060 edm::DetSetVector<TotemVFATStatus> &status);
0061
0062
0063 void printSummaries() const;
0064
0065 private:
0066 struct Record {
0067 const TotemVFATInfo *info;
0068 const VFATFrame *frame;
0069 TotemVFATStatus status;
0070 };
0071
0072 const unsigned char verbosity;
0073
0074 const bool printErrorSummary;
0075 const bool printUnknownFrameSummary;
0076
0077 enum TestFlag { tfNoTest, tfWarn, tfErr };
0078
0079
0080 const unsigned int testFootprint;
0081 const unsigned int testCRC;
0082 const unsigned int testID;
0083 const unsigned int testECMostFrequent;
0084 const unsigned int testBCMostFrequent;
0085
0086
0087 const unsigned int EC_min, BC_min;
0088
0089
0090 const double EC_fraction, BC_fraction;
0091
0092
0093 const bool olderTotemT2FileTest;
0094
0095
0096 std::map<TotemFramePosition, std::map<TotemVFATStatus, unsigned int> > errorSummary;
0097 std::map<TotemFramePosition, unsigned int> unknownSummary;
0098
0099
0100 void runCommon(const VFATFrameCollection &input,
0101 const TotemDAQMapping &mapping,
0102 std::map<TotemFramePosition, Record> &records);
0103 };
0104
0105 #endif