73 MonitorElement* mapEnergy_N =
nullptr, *mapEnergy_E =
nullptr, *mapEnergy_H =
nullptr, *mapEnergy_EH =
nullptr;
74 MonitorElement* occupancy_map =
nullptr, *occupancy_vs_ieta =
nullptr;
75 for(
unsigned int ih=0; ih<hcalMEs.size(); ih++){
76 if( strcmp(hcalMEs[ih]->getName().c_str(),
"Ntowers_per_event_vs_ieta") ==0 ){
77 Ntowers_vs_ieta = hcalMEs[ih];
79 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_Nentries") ==0 ){
80 mapEnergy_N = hcalMEs[ih];
82 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_energy_H") ==0 ){
83 useAllHistos++; mapEnergy_H = hcalMEs[ih];
85 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_energy_E") ==0 ){
86 useAllHistos++; mapEnergy_E = hcalMEs[ih];
88 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_energy_EH") ==0 ){
89 useAllHistos++; mapEnergy_EH = hcalMEs[ih];
91 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_map_occupancy") ==0 ){
92 occupancy_map = hcalMEs[ih];
94 if( strcmp(hcalMEs[ih]->getName().c_str(),
"CaloTowersTask_occupancy_vs_ieta") ==0 ){
95 occupancy_vs_ieta = hcalMEs[ih];
99 if( useAllHistos !=0 && useAllHistos !=3 )
return 0;
108 float fev =
float(nevent);
110 for (
int i = 1;
i <= nx;
i++) {
111 cont = Ntowers_vs_ieta -> getBinContent(
i) / fev ;
112 econt = Ntowers_vs_ieta -> getBinError(
i) / fev ;
113 Ntowers_vs_ieta -> setBinContent(
i,cont);
114 Ntowers_vs_ieta -> setBinError(
i,econt);
125 for (
int i = 1;
i <= nx;
i++) {
129 for (
int j = 1; j <= ny; j++) {
132 cnorm = mapEnergy_N -> getBinContent(
i,j);
134 if(cnorm > 0.000001 && useAllHistos) {
136 cont = mapEnergy_E -> getBinContent(
i,j) / cnorm ;
137 econt = mapEnergy_E -> getBinError(
i,j) / cnorm;
138 mapEnergy_E -> setBinContent(
i,j,cont);
139 mapEnergy_E -> setBinError(
i,j,econt);
142 cont = mapEnergy_H -> getBinContent(
i,j) / cnorm ;
143 econt = mapEnergy_H -> getBinError(
i,j) / cnorm;
144 mapEnergy_H -> setBinContent(
i,j,cont);
145 mapEnergy_H -> setBinError(
i,j,econt);
147 cont = mapEnergy_EH -> getBinContent(
i,j) / cnorm ;
148 econt = mapEnergy_EH -> getBinError(
i,j) / cnorm;
149 mapEnergy_EH -> setBinContent(
i,j,cont);
150 mapEnergy_EH -> setBinError(
i,j,econt);
155 cnorm = occupancy_map -> getBinContent(
i,j) / fev;
156 enorm = occupancy_map -> getBinError(
i,j) / fev;
157 if(cnorm > 1.
e-30) occupancy_map -> setBinContent(
i,j,cnorm);
160 sumphie += enorm*enorm;
167 if(ieta >= -20 && ieta <= 20 )
170 if(ieta >= 40 || ieta <= -40 ) {phi_factor = 18.;}
175 cnorm = sumphi / phi_factor;
176 enorm =
sqrt(sumphie) / phi_factor;
177 occupancy_vs_ieta->setBinContent(
i, cnorm);
178 occupancy_vs_ieta->setBinError(
i,enorm);
double getEntries() const
get # of entries
int getNbinsY() const
get # of bins in Y-axis
int getNbinsX() const
get # of bins in X-axis