17 : dataTag_(conf.getParameter<
edm::
InputTag>(
"InputLabel")),
18 unpacker_(conf.getParameter<
int>(
"CastorFirstFED"),
19 conf.getParameter<
int>(
"firstSample"),
20 conf.getParameter<
int>(
"lastSample")),
21 zdcunpacker_(conf.getParameter<
int>(
"CastorFirstFED"),
22 conf.getParameter<
int>(
"firstSample"),
23 conf.getParameter<
int>(
"lastSample")),
24 ctdcunpacker_(conf.getParameter<
int>(
"CastorFirstFED"),
25 conf.getParameter<
int>(
"firstSample"),
26 conf.getParameter<
int>(
"lastSample")),
28 conf.getParameter<
bool>(
"FilterDataQuality"), conf.getParameter<
bool>(
"FilterDataQuality"),
false, 0, 0, -1),
30 firstFED_(conf.getParameter<
int>(
"CastorFirstFED")),
31 complainEmptyData_(conf.getUntrackedParameter<
bool>(
"ComplainEmptyData",
false)),
32 usingctdc_(conf.getParameter<
bool>(
"CastorCtdc")),
33 unpackTTP_(conf.getParameter<
bool>(
"UnpackTTP")),
34 unpackZDC_(conf.getParameter<
bool>(
"UnpackZDC")),
35 silent_(conf.getUntrackedParameter<
bool>(
"silent",
true)),
36 usenominalOrbitMessageTime_(conf.getParameter<
bool>(
"UseNominalOrbitMessageTime")),
37 expectedOrbitMessageTime_(conf.getParameter<
int>(
"ExpectedOrbitMessageTime"))
46 std::ostringstream
ss;
49 edm::LogInfo(
"CASTOR") <<
"CastorRawToDigi will unpack FEDs ( " <<
ss.str() <<
")";
52 produces<CastorDigiCollection>();
53 produces<ZDCDigiCollection>();
54 produces<CastorTrigPrimDigiCollection>();
55 produces<HcalUnpackerReport>();
57 produces<HcalTTPDigiCollection>();
60 tok_pSetup_ = esConsumes<CastorDbService, CastorDbRecord>();
76 std::vector<CastorDataFrame>
castor;
77 std::vector<ZDCDataFrame>
zdc;
78 std::vector<HcalTTPDigi> ttp;
79 std::vector<CastorTriggerPrimitiveDigi> htp;
81 auto report = std::make_unique<HcalUnpackerReport>();
92 const int fed722size = fed722.
size();
94 const int fed693size = fed693.
size();
98 if (*
i == 693 && fed693size == 0 && fed722size != 0)
100 if (*
i == 722 && fed722size == 0 && fed693size != 0)
103 if (*
i != 693 && *
i != 722) {
104 if (fed.
size() == 0) {
109 }
else if (fed.
size() < 8 * 3) {
131 if (fed.
size() == 0) {
137 if (fed.
size() != 0) {
144 if (fed.
size() == 0) {
150 if (fed.
size() != 0) {
159 auto castor_prod = std::make_unique<CastorDigiCollection>();
160 auto htp_prod = std::make_unique<CastorTrigPrimDigiCollection>();
162 castor_prod->swap_contents(
castor);
163 htp_prod->swap_contents(htp);
169 castor_prod->
swap(filtered_castor);
178 auto zdc_prod = std::make_unique<ZDCDigiCollection>();
179 zdc_prod->swap_contents(
zdc);
189 auto prod = std::make_unique<HcalTTPDigiCollection>();
190 prod->swap_contents(ttp);
199 if (irun.
run() > 132640) {
201 }
else if (irun.
run() > 132174) {
203 }
else if (irun.
run() > 124371) {
205 }
else if (irun.
run() > 123984) {
207 }
else if (irun.
run() > 123584) {
CastorDataFrameFilter filter_
CastorDigiCollection filter(const CastorDigiCollection &incol, HcalUnpackerReport &r)
filter Castor data frames
void swap(SortedCollection &other)
size_t size() const
Lenght of the data buffer in bytes.
CastorCtdcUnpacker ctdcunpacker_
edm::ESGetToken< CastorDbService, CastorDbRecord > tok_pSetup_
std::vector< int > fedUnpackList_
void beginRun(edm::Run const &, edm::EventSetup const &) override
void unpack(const FEDRawData &raw, const CastorElectronicsMap &emap, CastorRawCollections &conts, HcalUnpackerReport &report, bool silent=false)
For histograms, no begin and end.
edm::EDGetTokenT< FEDRawDataCollection > tok_input_
bool active() const
whether any filters are on
void unpack(const FEDRawData &raw, const CastorElectronicsMap &emap, CastorRawCollections &conts, HcalUnpackerReport &report)
void setExpectedOrbitMessageTime(int time)
CastorRawToDigi(const edm::ParameterSet &ps)
std::vector< CastorDataFrame > * castorCont
const CastorElectronicsMap * getCastorMapping() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Log< level::Info, false > LogInfo
void unpack(const FEDRawData &raw, const CastorElectronicsMap &emap, CastorRawCollections &conts, HcalUnpackerReport &report, bool silent=false)
For histograms, no begin and end.
int expectedOrbitMessageTime_
bool usenominalOrbitMessageTime_
~CastorRawToDigi() override
void produce(edm::Event &e, const edm::EventSetup &c) override
Log< level::Warning, false > LogWarning