47 MonitorElement* mapEnergy_N =
nullptr, *mapEnergy_E =
nullptr, *mapEnergy_H =
nullptr, *mapEnergy_EH =
nullptr;
48 MonitorElement* occupancy_map =
nullptr, *occupancy_vs_ieta =
nullptr;
49 for(
unsigned int ih=0; ih<hcalMEs.size(); ih++){
50 if( strcmp(hcalMEs[ih]->getName().c_str(),
"Ntowers_per_event_vs_ieta") ==0 ){
51 Ntowers_vs_ieta = hcalMEs[ih];
53 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_Nentries") ==0 ){
54 mapEnergy_N = hcalMEs[ih];
56 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_energy_H") ==0 ){
57 useAllHistos++; mapEnergy_H = hcalMEs[ih];
59 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_energy_E") ==0 ){
60 useAllHistos++; mapEnergy_E = hcalMEs[ih];
62 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_energy_EH") ==0 ){
63 useAllHistos++; mapEnergy_EH = hcalMEs[ih];
65 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_occupancy") ==0 ){
66 occupancy_map = hcalMEs[ih];
68 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_occupancy_vs_ieta") ==0 ){
69 occupancy_vs_ieta = hcalMEs[ih];
73 if( useAllHistos !=0 && useAllHistos !=3 )
return 0;
82 float fev =
float(nevent);
84 for (
int i = 1;
i <= nx;
i++) {
85 cont = Ntowers_vs_ieta -> getBinContent(
i) / fev ;
86 conte =
pow(Ntowers_vs_ieta -> getBinContent(
i),0.5) / fev ;
87 Ntowers_vs_ieta -> setBinContent(
i,cont);
88 Ntowers_vs_ieta -> setBinError(
i,conte);
99 for (
int i = 1;
i <= nx;
i++) {
102 for (
int j = 1; j <= ny; j++) {
105 cnorm = mapEnergy_N -> getBinContent(
i,j);
107 if(cnorm > 0.000001 && useAllHistos) {
109 cont = mapEnergy_E -> getBinContent(
i,j) / cnorm ;
110 conte = mapEnergy_E -> getBinError(
i,j) / cnorm ;
111 mapEnergy_E -> setBinContent(
i,j,cont);
112 mapEnergy_E -> setBinError(
i,j,conte);
114 cont = mapEnergy_H -> getBinContent(
i,j) / cnorm ;
115 conte = mapEnergy_H -> getBinError(
i,j) / cnorm ;
116 mapEnergy_H -> setBinContent(
i,j,cont);
117 mapEnergy_H -> setBinError(
i,j,conte);
119 cont = mapEnergy_EH -> getBinContent(
i,j) / cnorm ;
120 conte = mapEnergy_EH -> getBinError(
i,j) / cnorm ;
121 mapEnergy_EH -> setBinContent(
i,j,cont);
122 mapEnergy_EH -> setBinError(
i,j,conte);
126 cont = occupancy_map -> getBinContent(
i,j);
127 conte = occupancy_map -> getBinError(
i,j);
128 if(fev>0. && cnorm>1.
e-30){
129 occupancy_map -> setBinContent(
i,j,cont/fev);
130 occupancy_map -> setBinError(
i,j,conte/fev);
141 if(ieta >= -20 && ieta <= 20 )
144 if(ieta >= 40 || ieta <= -40 ) {phi_factor = 18.;}
149 cnorm = sumphi / phi_factor;
150 cnorme =
pow(sumphi,0.5) / phi_factor;
151 if(fev>0. && cnorm>1.
e-30){
152 occupancy_vs_ieta->setBinContent(
i, cnorm/fev);
153 occupancy_vs_ieta->setBinError(
i, cnorme/fev);
168 std::vector<MonitorElement*> hcalMEs;
172 std::vector<std::string> fullPathHLTFolders = igetter.
getSubdirs();
173 for(
unsigned int i=0;
i<fullPathHLTFolders.size();
i++) {
178 std::vector<std::string> fullSubPathHLTFolders = igetter.
getSubdirs();
179 for(
unsigned int j=0;j<fullSubPathHLTFolders.size();j++) {
183 if( strcmp(fullSubPathHLTFolders[j].c_str(),
"CaloTowersD/CaloTowersTask") ==0 ){
184 hcalMEs = igetter.
getContents(fullSubPathHLTFolders[j]);
std::vector< MonitorElement * > getContents(Args &&...args)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int CaloTowersEndjob(const std::vector< MonitorElement * > &hcalMEs)
#define DEFINE_FWK_MODULE(type)
~CaloTowersDQMClient() override
double getEntries() const
get # of entries
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
int getNbinsY() const
get # of bins in Y-axis
void setCurrentFolder(const std::string &fullpath)
std::vector< std::string > getSubdirs()
void beginJob(void) override
int getNbinsX() const
get # of bins in X-axis
CaloTowersDQMClient(const edm::ParameterSet &)
Power< A, B >::type pow(const A &a, const B &b)