43 meESDaqFraction_ =
nullptr;
44 meESDaqActiveMap_ =
nullptr;
45 meESDaqError_ =
nullptr;
47 for (
int i = 0;
i < 56;
i++) {
48 meESDaqActive_[
i] =
nullptr;
51 if (ps.
exists(
"esMapping")){
55 edm::LogError(
"ESDaqInfoTask")<<
"preshower mapping pointer not initialized. Temporary.";
73 dqmStore_->setCurrentFolder(prefixME_ +
"/EventInfo");
75 sprintf(histo,
"DAQSummary");
76 meESDaqFraction_ = dqmStore_->bookFloat(histo);
77 meESDaqFraction_->Fill(0.0);
79 sprintf(histo,
"DAQSummaryMap");
80 meESDaqActiveMap_ = dqmStore_->book2D(histo,histo, 80, 0.5, 80.5, 80, 0.5, 80.5);
81 meESDaqActiveMap_->setAxisTitle(
"Si X", 1);
82 meESDaqActiveMap_->setAxisTitle(
"Si Y", 2);
84 dqmStore_->setCurrentFolder(prefixME_ +
"/EventInfo/DAQContents");
86 for (
int i = 0;
i < 56;
i++) {
87 sprintf(histo,
"EcalPreshower_%d", ESFedRangeMin_+
i);
88 meESDaqActive_[
i] = dqmStore_->bookFloat(histo);
89 meESDaqActive_[
i]->Fill(0.0);
92 for (
int x = 0; x < 80; x++ ) {
93 for (
int y = 0; y < 80; y++ ) {
94 if(getFEDNumber(x, y) == ESFedRangeMin_+
i){
99 if(ESOnFed_[
i] ==
true)
break;
103 dqmStore_->setCurrentFolder(prefixME_ +
"/ESIntegrityTask");
104 sprintf(histo,
"DAQError");
105 meESDaqError_ = dqmStore_->book1D(histo, histo, 56, ESFedRangeMin_-0.5, ESFedRangeMax_+0.5);
106 meESDaqError_->setAxisTitle(
"FedID", 1);
114 if ( enableCleanup_ ) this->
cleanup();
122 for (
int x = 0; x < 80; ++x) {
123 for (
int y = 0; y < 80; ++y) {
124 if( getFEDNumber(x, y) > 0 ) meESDaqActiveMap_->setBinContent( x+1, y+1, 0.0 );
125 else meESDaqActiveMap_->setBinContent( x+1, y+1, -1.0 );
129 for (
int i = 0;
i < 56;
i++) {
130 if ( meESDaqError_ ) meESDaqError_->setBinContent(
i, 0.0);
135 if( iSetup.
find( recordKey ) ) {
140 std::vector<int> FedsInIds= sumFED->
m_fed_in;
142 float ESFedCount = 0.;
144 for(
unsigned int fedItr=0; fedItr<FedsInIds.size(); ++fedItr ) {
146 int fedID=FedsInIds[fedItr];
148 if ( fedID >= ESFedRangeMin_ && fedID <= ESFedRangeMax_ ) {
150 if( ESOnFed_[fedID - ESFedRangeMin_] ) ESFedCount++;
152 if ( meESDaqActive_[fedID-ESFedRangeMin_] ) meESDaqActive_[fedID-ESFedRangeMin_]->Fill(1.0);
154 if( meESDaqActiveMap_ ) {
156 for (
int x = 0; x < 80; x++) {
157 for (
int y = 0; y < 80; y++) {
158 if (fedID == getFEDNumber(x, y))
159 meESDaqActiveMap_->setBinContent( x+1, y+1, 1.0 );
165 if( meESDaqFraction_ ) meESDaqFraction_->Fill( ESFedCount/40. );
168 for(
int i = 0;
i < 56;
i++){
169 if( ESOnFed_[fedID-ESFedRangeMin_] ) meESDaqError_->setBinContent(
i+1, 1.0);
170 else meESDaqError_->setBinContent(
i+1, 2.0);
180 LogWarning(
"ESDaqInfoTask") <<
"Cannot find any RunInfoRcd" << endl;
189 if ( meESDaqFraction_ ) meESDaqFraction_->Reset();
191 for (
int i = 0;
i < 56;
i++) {
192 if ( meESDaqActive_[
i] ) meESDaqActive_[
i]->Reset();
195 if ( meESDaqActiveMap_ ) meESDaqActiveMap_->Reset();
197 if ( meESDaqError_ ) meESDaqError_->Reset();
206 dqmStore_->setCurrentFolder(prefixME_ +
"/EventInfo");
208 if ( meESDaqFraction_ ) dqmStore_->removeElement( meESDaqFraction_->getName() );
210 if ( meESDaqActiveMap_ ) dqmStore_->removeElement( meESDaqActiveMap_->getName() );
212 if ( meESDaqError_ ) dqmStore_->removeElement( meESDaqError_->getName() );
214 dqmStore_->setCurrentFolder(prefixME_ +
"/EventInfo/DAQContents");
216 for (
int i = 0;
i < 56;
i++) {
217 if ( meESDaqActive_[
i] ) dqmStore_->removeElement( meESDaqActive_[i]->getName() );
void endJob(void) override
EndJob.
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void cleanup(void)
Cleanup.
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
static void cleanup(const Factory::MakerMap::value_type &v)
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
void beginJob(void) override
BeginJob.
~ESDaqInfoTask() override
Destructor.
std::vector< int > m_fed_in
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
Namespace of DDCMS conversion namespace.
void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) override
BeginLuminosityBlock.
boost::optional< eventsetup::EventSetupRecordGeneric > find(const eventsetup::EventSetupRecordKey &) const
void reset(double vett[256])
ESDaqInfoTask(const edm::ParameterSet &ps)
Constructor.