40 FEDRawDataCollection_ = consumes<FEDRawDataCollection>(ps.
getParameter<
InputTag>(
"FEDRawDataCollection"));
53 dqmStore_->setCurrentFolder(prefixME_ +
"/ESRawDataTask");
54 dqmStore_->rmdir(prefixME_ +
"/ESRawDataTask");
61 if ( ! mergeRuns_ ) this->
reset();
80 dqmStore_->setCurrentFolder(prefixME_ +
"/ESRawDataTask");
87 sprintf(histo,
"ES L1A DCC errors");
88 meL1ADCCErrors_ = dqmStore_->book1D(histo, histo, 56, 519.5, 575.5);
89 meL1ADCCErrors_->setAxisTitle(
"ES FED", 1);
90 meL1ADCCErrors_->setAxisTitle(
"Num of Events", 2);
92 sprintf(histo,
"ES BX DCC errors");
93 meBXDCCErrors_ = dqmStore_->book1D(histo, histo, 56, 519.5, 575.5);
94 meBXDCCErrors_->setAxisTitle(
"ES FED", 1);
95 meBXDCCErrors_->setAxisTitle(
"Num of Events", 2);
97 sprintf(histo,
"ES Orbit Number DCC errors");
98 meOrbitNumberDCCErrors_ = dqmStore_->book1D(histo, histo, 56, 519.5, 575.5);
99 meOrbitNumberDCCErrors_->setAxisTitle(
"ES FED", 1);
100 meOrbitNumberDCCErrors_->setAxisTitle(
"Num of Events", 2);
102 sprintf(histo,
"Difference between ES and GT L1A");
103 meL1ADiff_ = dqmStore_->book1D(histo, histo, 201, -100.5, 100.5);
104 meL1ADiff_->setAxisTitle(
"ES - GT L1A", 1);
105 meL1ADiff_->setAxisTitle(
"Num of Events", 2);
107 sprintf(histo,
"Difference between ES and GT BX");
108 meBXDiff_ = dqmStore_->book1D(histo, histo, 201, -100.5, 100.5);
109 meBXDiff_->setAxisTitle(
"ES - GT BX", 1);
110 meBXDiff_->setAxisTitle(
"Num of Events", 2);
112 sprintf(histo,
"Difference between ES and GT Orbit Number");
113 meOrbitNumberDiff_ = dqmStore_->book1D(histo, histo, 201, -100.5, 100.5);
114 meOrbitNumberDiff_->setAxisTitle(
"ES - GT orbit number", 1);
115 meOrbitNumberDiff_->setAxisTitle(
"Num of Events", 2);
122 if ( ! init_ )
return;
128 if ( meL1ADCCErrors_ ) dqmStore_->removeElement( meL1ADCCErrors_->getName() );
131 if ( meBXDCCErrors_ ) dqmStore_->removeElement( meBXDCCErrors_->getName() );
134 if ( meOrbitNumberDCCErrors_ ) dqmStore_->removeElement( meOrbitNumberDCCErrors_->getName() );
135 meOrbitNumberDCCErrors_ = 0;
137 if ( meL1ADiff_ ) dqmStore_->removeElement( meL1ADiff_->getName() );
140 if ( meBXDiff_ ) dqmStore_->removeElement( meBXDiff_->getName() );
143 if ( meOrbitNumberDiff_ ) dqmStore_->removeElement( meOrbitNumberDiff_->getName() );
144 meOrbitNumberDiff_ = 0;
153 LogInfo(
"ESRawDataTask") <<
"analyzed " << ievt_ <<
" events";
155 if ( enableCleanup_ ) this->
cleanup();
161 if ( ! init_ ) this->
setup();
164 runNum_ = e.
id().
run();
166 int gt_L1A = 0, gt_OrbitNumber = 0, gt_BX = 0;
167 int esDCC_L1A_MostFreqCounts = 0;
168 int esDCC_BX_MostFreqCounts = 0;
169 int esDCC_OrbitNumber_MostFreqCounts = 0;
174 int gtFedDataSize = 0;
176 if ( e.
getByToken(FEDRawDataCollection_, allFedRawData) ) {
179 const FEDRawData& gtFedData = allFedRawData->FEDData(812);
183 if ( gtFedDataSize > 0 ) {
192 map<int, int> esDCC_L1A_FreqMap;
193 map<int, int> esDCC_BX_FreqMap;
194 map<int, int> esDCC_OrbitNumber_FreqMap;
200 esDCC_L1A_FreqMap[esdcc.
getLV1()]++;
201 esDCC_BX_FreqMap[esdcc.
getBX()]++;
204 if (esDCC_L1A_FreqMap[esdcc.
getLV1()] > esDCC_L1A_MostFreqCounts) {
205 esDCC_L1A_MostFreqCounts = esDCC_L1A_FreqMap[esdcc.
getLV1()];
209 if (esDCC_BX_FreqMap[esdcc.
getBX()] > esDCC_BX_MostFreqCounts) {
210 esDCC_BX_MostFreqCounts = esDCC_BX_FreqMap[esdcc.
getBX()];
211 gt_BX = esdcc.
getBX();
214 if (esDCC_OrbitNumber_FreqMap[esdcc.
getOrbitNumber()] > esDCC_OrbitNumber_MostFreqCounts) {
215 esDCC_OrbitNumber_MostFreqCounts = esDCC_OrbitNumber_FreqMap[esdcc.
getOrbitNumber()];
221 LogWarning(
"ESRawDataTask") <<
"dccCollections not available";
226 LogWarning(
"ESRawDataTask") <<
"FEDRawDataCollection not available";
230 vector<int> fiberStatus;
241 if (dcc.
getLV1() != gt_L1A) {
242 meL1ADCCErrors_->Fill(dcc.
fedId());
244 Float_t l1a_diff = dcc.
getLV1() - gt_L1A;
245 if (l1a_diff > 100) l1a_diff = 100;
246 else if (l1a_diff < -100) l1a_diff = -100;
247 meL1ADiff_->Fill(l1a_diff);
250 if (dcc.
getBX() != gt_BX) {
251 meBXDCCErrors_->Fill(dcc.
fedId());
253 Float_t bx_diff = dcc.
getBX() - gt_BX;
254 if (bx_diff > 100) bx_diff = 100;
255 else if (bx_diff < -100) bx_diff = -100;
256 meBXDiff_->Fill(bx_diff);
259 meOrbitNumberDCCErrors_->Fill(dcc.
fedId());
262 if (orbitnumber_diff > 100) orbitnumber_diff = 100;
263 else if (orbitnumber_diff < -100) orbitnumber_diff = -100;
264 meOrbitNumberDiff_->Fill(orbitnumber_diff);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void cleanup(void)
Cleanup.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< ESDCCHeaderBlock >::const_iterator const_iterator
static void cleanup(const Factory::MakerMap::value_type &v)
int bunchCrossing() const
void beginJob(void)
BeginJob.
ESRawDataTask(const edm::ParameterSet &ps)
size_t size() const
Lenght of the data buffer in bytes.
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
DEFINE_FWK_MODULE(CaloMETProducer)
unsigned long long uint64_t
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
void reset(double vett[256])
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")