19 edm::LogError(
"CaloTowersDQMClient") <<
"unable to get DQMStore service, upshot is no client histograms will be made";
22 if(dbe_) dbe_->setVerbose(0);
29 if(dbe_) dbe_->setCurrentFolder(
dirName_);
79 std::vector<MonitorElement*> hcalMEs;
84 for(
unsigned int i=0;
i<fullPathHLTFolders.size();
i++) {
89 std::vector<std::string> fullSubPathHLTFolders =
dbe_->
getSubdirs();
90 for(
unsigned int j=0;
j<fullSubPathHLTFolders.size();
j++) {
94 if( strcmp(fullSubPathHLTFolders[
j].c_str(),
"CaloTowersV/CaloTowersTask") ==0 ){
110 int useAllHistos = 0;
112 MonitorElement* mapEnergy_N =0, *mapEnergy_E =0, *mapEnergy_H =0, *mapEnergy_EH =0;
114 for(
unsigned int ih=0; ih<hcalMEs.size(); ih++){
115 if( strcmp(hcalMEs[ih]->getName().c_str(),
"Ntowers_per_event_vs_ieta") ==0 ){
116 Ntowers_vs_ieta = hcalMEs[ih];
118 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_Nentries") ==0 ){
119 mapEnergy_N = hcalMEs[ih];
121 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_energy_H") ==0 ){
122 useAllHistos++; mapEnergy_H = hcalMEs[ih];
124 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_energy_E") ==0 ){
125 useAllHistos++; mapEnergy_E = hcalMEs[ih];
127 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_energy_EH") ==0 ){
128 useAllHistos++; mapEnergy_EH = hcalMEs[ih];
130 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_occupancy") ==0 ){
131 occupancy_map = hcalMEs[ih];
133 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_occupancy_vs_ieta") ==0 ){
134 occupancy_vs_ieta = hcalMEs[ih];
138 if( useAllHistos !=0 && useAllHistos !=3 )
return 0;
146 float fev = float(nevent);
148 for (
int i = 1;
i <= nx;
i++) {
149 cont = Ntowers_vs_ieta -> getBinContent(
i) / fev ;
150 Ntowers_vs_ieta -> setBinContent(
i,cont);
160 for (
int i = 1;
i <= nx;
i++) {
163 for (
int j = 1;
j <= ny;
j++) {
166 cnorm = mapEnergy_N -> getBinContent(
i,
j);
168 if(cnorm > 0.000001 && useAllHistos) {
170 cont = mapEnergy_E -> getBinContent(
i,
j) / cnorm ;
171 mapEnergy_E -> setBinContent(
i,
j,cont);
173 cont = mapEnergy_H -> getBinContent(
i,
j) / cnorm ;
174 mapEnergy_H -> setBinContent(
i,
j,cont);
176 cont = mapEnergy_EH -> getBinContent(
i,
j) / cnorm ;
177 mapEnergy_EH -> setBinContent(
i,
j,cont);
181 cnorm = occupancy_map -> getBinContent(
i,
j) / fev;
182 if(cnorm > 1.
e-30) occupancy_map -> setBinContent(
i,
j,cnorm);
191 if(ieta >=0 ) ieta +=1;
193 if(ieta >= -20 && ieta <= 20 )
196 if(ieta >= 40 || ieta <= -40 ) {phi_factor = 18.;}
200 if(ieta >= 0) ieta -= 1;
202 cnorm = sumphi / phi_factor;
203 occupancy_vs_ieta->Fill(
double(ieta), cnorm);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int CaloTowersEndjob(const std::vector< MonitorElement * > &hcalMEs)
std::vector< std::string > getSubdirs(void) const
#define DEFINE_FWK_MODULE(type)
double getEntries(void) const
get # of entries
virtual void analyze(const edm::Event &, const edm::EventSetup &)
int getNbinsY(void) const
get # of bins in Y-axis
virtual ~CaloTowersDQMClient()
virtual void endRun(const edm::Run &run, const edm::EventSetup &c)
std::vector< MonitorElement * > getContents(const std::string &path) const
virtual void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
virtual void beginJob(void)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
int getNbinsX(void) const
get # of bins in X-axis
virtual void runClient_()
CaloTowersDQMClient(const edm::ParameterSet &)
void setCurrentFolder(const std::string &fullpath)