44 meESDaqActiveMap_ = 0;
47 for (
int i = 0;
i < 56;
i++) {
48 meESDaqActive_[
i] = 0;
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++ ) {
95 int ip = (
y>=40)? 1:2;
96 int ix = (
x<40)?
x:
x-40;
97 int iy = (
y<40)?
y:
y-40;
98 int ifed = (*es_mapping_).getFED( iz, ip, ix, iy);
99 if(ifed == ESFedRangeMin_+
i){
104 if(ESOnFed_[
i] ==
true)
break;
108 dqmStore_->setCurrentFolder(prefixME_ +
"/ESIntegrityTask");
109 sprintf(histo,
"DAQError");
110 meESDaqError_ = dqmStore_->book1D(histo, histo, 56, ESFedRangeMin_-0.5, ESFedRangeMax_+0.5);
111 meESDaqError_->setAxisTitle(
"FedID", 1);
119 if ( enableCleanup_ ) this->
cleanup();
127 for (
int x = 0;
x < 80; ++
x) {
128 for (
int y = 0;
y < 80; ++
y) {
129 int iz = (
x<40) ? 1:2;
130 int ip = (
y>=40) ? 1:2;
131 int ix = (
x<40) ?
x:
x-40;
132 int iy = (
y<40) ?
y:
y-40;
133 int ifed = (*es_mapping_).getFED( iz, ip, ix+1, iy+1);
134 if( ifed > 0 ) meESDaqActiveMap_->setBinContent(
x+1,
y+1, 0.0 );
135 else meESDaqActiveMap_->setBinContent(
x+1,
y+1, -1.0 );
139 for (
int i = 0;
i < 56;
i++) {
140 if ( meESDaqError_ ) meESDaqError_->setBinContent(
i, 0.0);
145 if( iSetup.
find( recordKey ) ) {
150 std::vector<int> FedsInIds= sumFED->m_fed_in;
152 float ESFedCount = 0.;
154 for(
unsigned int fedItr=0; fedItr<FedsInIds.size(); ++fedItr ) {
156 int fedID=FedsInIds[fedItr];
158 if ( fedID >= ESFedRangeMin_ && fedID <= ESFedRangeMax_ ) {
160 if( ESOnFed_[fedID - ESFedRangeMin_] ) ESFedCount++;
162 if ( meESDaqActive_[fedID-ESFedRangeMin_] ) meESDaqActive_[fedID-ESFedRangeMin_]->Fill(1.0);
164 if( meESDaqActiveMap_ ) {
166 for(
int x = 0;
x < 80;
x++ ) {
167 for(
int y = 0;
y < 80;
y++ ) {
168 int iz = (
x<40)? 1:2;
169 int ip = (
y>=40)? 1:2;
170 int ix = (
x<40) ?
x:
x-40;
171 int iy = (
x<40) ?
y:
y-40;
172 int ifed = es_mapping_->getFED(iz, ip, ix, iy);
173 if( fedID==ifed ) meESDaqActiveMap_->setBinContent(
x+1,
y+1, 1.0 );
179 if( meESDaqFraction_ ) meESDaqFraction_->Fill( ESFedCount/40. );
182 for(
int i = 0;
i < 56;
i++){
183 if( ESOnFed_[fedID-ESFedRangeMin_] ) meESDaqError_->setBinContent(
i+1, 1.0);
184 else meESDaqError_->setBinContent(
i+1, 2.0);
194 LogWarning(
"ESDaqInfoTask") <<
"Cannot find any RunInfoRcd" << endl;
206 if ( meESDaqFraction_ ) meESDaqFraction_->Reset();
208 for (
int i = 0;
i < 56;
i++) {
209 if ( meESDaqActive_[
i] ) meESDaqActive_[
i]->Reset();
212 if ( meESDaqActiveMap_ ) meESDaqActiveMap_->Reset();
214 if ( meESDaqError_ ) meESDaqError_->Reset();
223 dqmStore_->setCurrentFolder(prefixME_ +
"/EventInfo");
225 if ( meESDaqFraction_ ) dqmStore_->removeElement( meESDaqFraction_->getName() );
227 if ( meESDaqActiveMap_ ) dqmStore_->removeElement( meESDaqActiveMap_->getName() );
229 if ( meESDaqError_ ) dqmStore_->removeElement( meESDaqError_->getName() );
231 dqmStore_->setCurrentFolder(prefixME_ +
"/EventInfo/DAQContents");
233 for (
int i = 0;
i < 56;
i++) {
234 if ( meESDaqActive_[
i] ) dqmStore_->removeElement( meESDaqActive_[i]->
getName() );
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DEFINE_FWK_MODULE(TauMET)
void beginJob(void)
BeginJob.
void cleanup(void)
Cleanup.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
static void cleanup(const Factory::MakerMap::value_type &v)
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
std::string getName(Reflex::Type &cc)
void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
BeginLuminosityBlock.
void reset(double vett[256])
ESDaqInfoTask(const edm::ParameterSet &ps)
Constructor.
void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
EndLuminosityBlock.
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
virtual ~ESDaqInfoTask()
Destructor.