20 dataTag_(conf.getParameter<
edm::InputTag>(
"InputLabel")),
21 unpacker_(conf.getParameter<
int>(
"CastorFirstFED"),conf.getParameter<
int>(
"firstSample"),conf.getParameter<
int>(
"lastSample")),
22 zdcunpacker_(conf.getParameter<
int>(
"CastorFirstFED"),conf.getParameter<
int>(
"firstSample"),conf.getParameter<
int>(
"lastSample")),
23 ctdcunpacker_(conf.getParameter<
int>(
"CastorFirstFED"),conf.getParameter<
int>(
"firstSample"),conf.getParameter<
int>(
"lastSample")),
24 filter_(conf.getParameter<
bool>(
"FilterDataQuality"),conf.getParameter<
bool>(
"FilterDataQuality"),
false,0,0,-1),
25 fedUnpackList_(conf.getUntrackedParameter<
std::vector<
int> >(
"FEDs",
std::vector<
int>())),
26 firstFED_(conf.getParameter<
int>(
"CastorFirstFED")),
27 complainEmptyData_(conf.getUntrackedParameter<
bool>(
"ComplainEmptyData",
false)),
28 usingctdc_(conf.getParameter<
bool>(
"CastorCtdc")),
29 unpackTTP_(conf.getParameter<
bool>(
"UnpackTTP")),
30 unpackZDC_(conf.getParameter<
bool>(
"UnpackZDC")),
31 silent_(conf.getUntrackedParameter<
bool>(
"silent",
true)),
32 usenominalOrbitMessageTime_(conf.getParameter<
bool>(
"UseNominalOrbitMessageTime")),
33 expectedOrbitMessageTime_(conf.getParameter<
int>(
"ExpectedOrbitMessageTime"))
42 std::ostringstream ss;
45 edm::LogInfo(
"CASTOR") <<
"CastorRawToDigi will unpack FEDs ( " << ss.str() <<
")";
48 produces<CastorDigiCollection>();
49 produces<ZDCDigiCollection>();
50 produces<CastorTrigPrimDigiCollection>();
51 produces<HcalUnpackerReport>();
53 produces<HcalTTPDigiCollection>();
74 std::vector<CastorDataFrame>
castor;
75 std::vector<ZDCDataFrame>
zdc;
76 std::vector<HcalTTPDigi> ttp;
77 std::vector<CastorTriggerPrimitiveDigi> htp;
79 auto report = std::make_unique<HcalUnpackerReport>();
89 const int fed722size = fed722.
size();
91 const int fed693size = fed693.
size();
95 if (*
i == 693 && fed693size == 0 && fed722size != 0)
97 if (*
i == 722 && fed722size == 0 && fed693size != 0)
100 if (*
i!=693 && *
i!=722)
110 else if (fed.
size()<8*3)
178 auto castor_prod = std::make_unique<CastorDigiCollection>();
179 auto htp_prod = std::make_unique<CastorTrigPrimDigiCollection>();
181 castor_prod->swap_contents(castor);
182 htp_prod->swap_contents(htp);
188 castor_prod->
swap(filtered_castor);
198 auto zdc_prod = std::make_unique<ZDCDigiCollection>();
199 zdc_prod->swap_contents(zdc);
209 auto prod = std::make_unique<HcalTTPDigiCollection>();
210 prod->swap_contents(ttp);
219 if ( irun.
run() > 132640 ) {
221 }
else if ( irun.
run() > 132174 ) {
223 }
else if ( irun.
run() > 124371 ) {
225 }
else if ( irun.
run() > 123984 ) {
227 }
else if ( irun.
run() > 123584 ) {
CastorDataFrameFilter filter_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
CastorDigiCollection filter(const CastorDigiCollection &incol, HcalUnpackerReport &r)
filter Castor data frames
void swap(SortedCollection &other)
char const * what() const override
CastorCtdcUnpacker ctdcunpacker_
std::vector< int > fedUnpackList_
void beginRun(edm::Run const &, edm::EventSetup const &) override
size_t size() const
Lenght of the data buffer in bytes.
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_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void unpack(const FEDRawData &raw, const CastorElectronicsMap &emap, CastorRawCollections &conts, HcalUnpackerReport &report)
void setExpectedOrbitMessageTime(int time)
bool active() const
whether any filters are on
CastorRawToDigi(const edm::ParameterSet &ps)
std::vector< CastorDataFrame > * castorCont
const CastorElectronicsMap * getCastorMapping() const
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