00001 #include "Validation/HcalRecHits/interface/HcalRecHitsClient.h"
00002 #include "FWCore/Framework/interface/MakerMacros.h"
00003
00004 #include "FWCore/Framework/interface/Run.h"
00005 #include "FWCore/Framework/interface/Event.h"
00006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00007 #include "FWCore/ServiceRegistry/interface/Service.h"
00008
00009 #include "DQMServices/Core/interface/DQMStore.h"
00010 #include "DQMServices/Core/interface/MonitorElement.h"
00011
00012 HcalRecHitsClient::HcalRecHitsClient(const edm::ParameterSet& iConfig):conf_(iConfig)
00013 {
00014
00015 outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root");
00016
00017 dbe_ = edm::Service<DQMStore>().operator->();
00018 if (!dbe_) {
00019 edm::LogError("HcalRecHitsClient") << "unable to get DQMStore service, upshot is no client histograms will be made";
00020 }
00021 if(iConfig.getUntrackedParameter<bool>("DQMStore", false)) {
00022 if(dbe_) dbe_->setVerbose(0);
00023 }
00024
00025 debug_ = false;
00026 verbose_ = false;
00027
00028 dirName_=iConfig.getParameter<std::string>("DQMDirName");
00029 if(dbe_) dbe_->setCurrentFolder(dirName_);
00030
00031 }
00032
00033
00034 HcalRecHitsClient::~HcalRecHitsClient()
00035 {
00036
00037 }
00038
00039 void HcalRecHitsClient::beginJob()
00040 {
00041
00042
00043 }
00044
00045 void HcalRecHitsClient::endJob()
00046 {
00047 if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
00048 }
00049
00050 void HcalRecHitsClient::beginRun(const edm::Run& run, const edm::EventSetup& c)
00051 {
00052
00053 }
00054
00055
00056 void HcalRecHitsClient::endRun(const edm::Run& run, const edm::EventSetup& c)
00057 {
00058 runClient_();
00059 }
00060
00061
00062 void HcalRecHitsClient::analyze(const edm::Event& iEvent,const edm::EventSetup& iSetup)
00063 {
00064
00065 }
00066
00067 void HcalRecHitsClient::endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,const edm::EventSetup& c)
00068 {
00069
00070 }
00071
00072 void HcalRecHitsClient::runClient_()
00073 {
00074 if(!dbe_) return;
00075 dbe_->setCurrentFolder(dirName_);
00076
00077 if (verbose_) std::cout << "\nrunClient" << std::endl;
00078
00079 std::vector<MonitorElement*> hcalMEs;
00080
00081
00082
00083 std::vector<std::string> fullPathHLTFolders = dbe_->getSubdirs();
00084 for(unsigned int i=0;i<fullPathHLTFolders.size();i++) {
00085
00086 if (verbose_) std::cout <<"\nfullPath: "<< fullPathHLTFolders[i] << std::endl;
00087 dbe_->setCurrentFolder(fullPathHLTFolders[i]);
00088
00089 std::vector<std::string> fullSubPathHLTFolders = dbe_->getSubdirs();
00090 for(unsigned int j=0;j<fullSubPathHLTFolders.size();j++) {
00091
00092 if (verbose_) std::cout <<"fullSub: "<<fullSubPathHLTFolders[j] << std::endl;
00093
00094 if( strcmp(fullSubPathHLTFolders[j].c_str(), "HcalRecHitsV/HcalRecHitTask") ==0 ){
00095 hcalMEs = dbe_->getContents(fullSubPathHLTFolders[j]);
00096 if (verbose_) std::cout <<"hltMES size : "<<hcalMEs.size()<<std::endl;
00097 if( !HcalRecHitsEndjob(hcalMEs) ) std::cout<<"\nError in HcalRecHitsEndjob!"<<std::endl<<std::endl;
00098 }
00099
00100 }
00101
00102 }
00103
00104 }
00105
00106
00107
00108
00109 int HcalRecHitsClient::HcalRecHitsEndjob(const std::vector<MonitorElement*> &hcalMEs){
00110
00111 int useAllHistos = 0, subdet =5;
00112
00113
00114
00115 MonitorElement* ZS_HO=0, *ZS_seqHO=0;
00116 MonitorElement* ZS_HB1=0, *ZS_seqHB1=0, *ZS_HB2=0, *ZS_seqHB2=0;
00117 MonitorElement* ZS_HF1=0, *ZS_seqHF1=0, *ZS_HF2=0, *ZS_seqHF2=0;
00118 MonitorElement* ZS_HE1=0, *ZS_seqHE1=0, *ZS_HE2=0, *ZS_seqHE2=0, *ZS_HE3=0, *ZS_seqHE3=0;
00119 MonitorElement* map_depth1 =0, *map_depth2 =0, *map_depth3 =0, *map_depth4 =0;
00120
00121 MonitorElement* Nhf=0;
00122 MonitorElement* emap_depth1 =0, *emap_depth2 =0, *emap_depth3 =0, *emap_depth4 =0;
00123 MonitorElement* occupancy_seqHB1 =0, *occupancy_seqHB2 =0;
00124 MonitorElement* occupancy_seqHE1 =0, *occupancy_seqHE2 =0, *occupancy_seqHE3 =0;
00125 MonitorElement* occupancy_seqHF1 =0, *occupancy_seqHF2 =0;
00126 MonitorElement* occupancy_seqHO =0;
00127 MonitorElement* emean_seqHB1 =0, *emean_seqHB2 =0;
00128 MonitorElement* emean_seqHE1 =0, *emean_seqHE2 =0, *emean_seqHE3 =0;
00129 MonitorElement* emean_seqHF1 =0, *emean_seqHF2 =0;
00130 MonitorElement* emean_seqHO =0;
00131
00132 MonitorElement* RMS_seq_HB1 =0, *RMS_seq_HB2 =0;
00133 MonitorElement* RMS_seq_HE1 =0, *RMS_seq_HE2 =0, *RMS_seq_HE3 =0;
00134 MonitorElement* RMS_seq_HF1 =0, *RMS_seq_HF2 =0;
00135 MonitorElement* RMS_seq_HO =0;
00136
00137 MonitorElement *occupancy_map_HO =0;
00138 MonitorElement* occupancy_map_HB1 =0, *occupancy_map_HB2 =0;
00139 MonitorElement* occupancy_map_HF1 =0, *occupancy_map_HF2 =0;
00140 MonitorElement* occupancy_map_HE1 =0, *occupancy_map_HE2 =0, *occupancy_map_HE3 =0;
00141
00142 MonitorElement* emean_vs_ieta_HB1 =0, *emean_vs_ieta_HB2 =0;
00143 MonitorElement* emean_vs_ieta_HE1 =0, *emean_vs_ieta_HE2 =0, *emean_vs_ieta_HE3 =0;
00144 MonitorElement* emean_vs_ieta_HF1 =0, *emean_vs_ieta_HF2 =0;
00145 MonitorElement* emean_vs_ieta_HO =0;
00146 MonitorElement* RMS_vs_ieta_HB1 =0, *RMS_vs_ieta_HB2 =0;
00147 MonitorElement* RMS_vs_ieta_HE1 =0, *RMS_vs_ieta_HE2 =0, *RMS_vs_ieta_HE3 =0;
00148 MonitorElement* RMS_vs_ieta_HF1 =0, *RMS_vs_ieta_HF2 =0;
00149 MonitorElement* RMS_vs_ieta_HO =0;
00150 MonitorElement* occupancy_vs_ieta_HB1 =0, *occupancy_vs_ieta_HB2 =0;
00151 MonitorElement* occupancy_vs_ieta_HE1 =0, *occupancy_vs_ieta_HE2 =0, *occupancy_vs_ieta_HE3 =0;
00152 MonitorElement* occupancy_vs_ieta_HF1 =0, *occupancy_vs_ieta_HF2 =0;
00153 MonitorElement* occupancy_vs_ieta_HO =0;
00154
00155 MonitorElement* RecHit_StatusWord_HB =0, *RecHit_StatusWord_HE=0, *RecHit_StatusWord_HO =0, *RecHit_StatusWord_HF =0, *RecHit_StatusWord_HF67 =0;
00156 MonitorElement* RecHit_Aux_StatusWord_HB =0, *RecHit_Aux_StatusWord_HE=0, *RecHit_Aux_StatusWord_HO =0, *RecHit_Aux_StatusWord_HF =0;
00157
00158 for(unsigned int ih=0; ih<hcalMEs.size(); ih++){
00159 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_map_depth1") ==0 ){
00160 useAllHistos =1; subdet =6;
00161 }
00162 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HB1") ==0 ){
00163 useAllHistos =1;
00164 }
00165
00166 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HO") ==0 ){ ZS_HO = hcalMEs[ih]; }
00167 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HO") ==0 ){ ZS_seqHO = hcalMEs[ih]; }
00168 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HB1") ==0 ){ ZS_HB1 = hcalMEs[ih]; }
00169 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HB1") ==0 ){ ZS_seqHB1 = hcalMEs[ih]; }
00170 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HB2") ==0 ){ ZS_HB2 = hcalMEs[ih]; }
00171 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HB2") ==0 ){ ZS_seqHB2 = hcalMEs[ih]; }
00172 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HF1") ==0 ){ ZS_HF1 = hcalMEs[ih]; }
00173 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HF1") ==0 ){ ZS_seqHF1 = hcalMEs[ih]; }
00174 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HF2") ==0 ){ ZS_HF2 = hcalMEs[ih]; }
00175 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HF2") ==0 ){ ZS_seqHF2 = hcalMEs[ih]; }
00176 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HE1") ==0 ){ ZS_HE1 = hcalMEs[ih]; }
00177 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HE1") ==0 ){ ZS_seqHE1 = hcalMEs[ih]; }
00178 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HE2") ==0 ){ ZS_HE2 = hcalMEs[ih]; }
00179 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HE2") ==0 ){ ZS_seqHE2 = hcalMEs[ih]; }
00180 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HE3") ==0 ){ ZS_HE3 = hcalMEs[ih]; }
00181 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HE3") ==0 ){ ZS_seqHE3 = hcalMEs[ih]; }
00182 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_map_depth1") ==0 ){ map_depth1= hcalMEs[ih]; }
00183 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_map_depth2") ==0 ){ map_depth2= hcalMEs[ih]; }
00184 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_map_depth3") ==0 ){ map_depth3= hcalMEs[ih]; }
00185 if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_map_depth4") ==0 ){ map_depth4= hcalMEs[ih]; }
00186
00187 if( strcmp(hcalMEs[ih]->getName().c_str(), "N_HF") ==0 ){ Nhf= hcalMEs[ih]; }
00188 if( strcmp(hcalMEs[ih]->getName().c_str(), "emap_depth1") ==0 ){ emap_depth1= hcalMEs[ih]; }
00189 if( strcmp(hcalMEs[ih]->getName().c_str(), "emap_depth2") ==0 ){ emap_depth2= hcalMEs[ih]; }
00190 if( strcmp(hcalMEs[ih]->getName().c_str(), "emap_depth3") ==0 ){ emap_depth3= hcalMEs[ih]; }
00191 if( strcmp(hcalMEs[ih]->getName().c_str(), "emap_depth4") ==0 ){ emap_depth4= hcalMEs[ih]; }
00192
00193 if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HB1") ==0 ){ occupancy_seqHB1= hcalMEs[ih]; }
00194 if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HB2") ==0 ){ occupancy_seqHB2= hcalMEs[ih]; }
00195 if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HE1") ==0 ){ occupancy_seqHE1= hcalMEs[ih]; }
00196 if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HE2") ==0 ){ occupancy_seqHE2= hcalMEs[ih]; }
00197 if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HE3") ==0 ){ occupancy_seqHE3= hcalMEs[ih]; }
00198 if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HF1") ==0 ){ occupancy_seqHF1= hcalMEs[ih]; }
00199 if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HF2") ==0 ){ occupancy_seqHF2= hcalMEs[ih]; }
00200 if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HO") ==0 ){ occupancy_seqHO= hcalMEs[ih]; }
00201 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HB1") ==0 ){ emean_seqHB1= hcalMEs[ih]; }
00202 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HB2") ==0 ){ emean_seqHB2= hcalMEs[ih]; }
00203 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HE1") ==0 ){ emean_seqHE1= hcalMEs[ih]; }
00204 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HE2") ==0 ){ emean_seqHE2= hcalMEs[ih]; }
00205 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HE3") ==0 ){ emean_seqHE3= hcalMEs[ih]; }
00206 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HF1") ==0 ){ emean_seqHF1= hcalMEs[ih]; }
00207 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HF2") ==0 ){ emean_seqHF2= hcalMEs[ih]; }
00208 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HO") ==0 ){ emean_seqHO= hcalMEs[ih]; }
00209 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HB1") ==0 ){ RMS_seq_HB1= hcalMEs[ih]; }
00210 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HB2") ==0 ){ RMS_seq_HB2= hcalMEs[ih]; }
00211 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HE1") ==0 ){ RMS_seq_HE1= hcalMEs[ih]; }
00212 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HE2") ==0 ){ RMS_seq_HE2= hcalMEs[ih]; }
00213 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HE3") ==0 ){ RMS_seq_HE3= hcalMEs[ih]; }
00214 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HF1") ==0 ){ RMS_seq_HF1= hcalMEs[ih]; }
00215 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HF2") ==0 ){ RMS_seq_HF2= hcalMEs[ih]; }
00216 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HO") ==0 ){ RMS_seq_HO= hcalMEs[ih]; }
00217 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HB1") ==0 ){ occupancy_map_HB1= hcalMEs[ih]; }
00218 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HB2") ==0 ){ occupancy_map_HB2= hcalMEs[ih]; }
00219 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HE1") ==0 ){ occupancy_map_HE1= hcalMEs[ih]; }
00220 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HE2") ==0 ){ occupancy_map_HE2= hcalMEs[ih]; }
00221 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HE3") ==0 ){ occupancy_map_HE3= hcalMEs[ih]; }
00222 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HF1") ==0 ){ occupancy_map_HF1= hcalMEs[ih]; }
00223 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HF2") ==0 ){ occupancy_map_HF2= hcalMEs[ih]; }
00224 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HO") ==0 ){ occupancy_map_HO= hcalMEs[ih]; }
00225 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HB1") ==0 ){ emean_vs_ieta_HB1= hcalMEs[ih]; }
00226 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HB2") ==0 ){ emean_vs_ieta_HB2= hcalMEs[ih]; }
00227 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HE1") ==0 ){ emean_vs_ieta_HE1= hcalMEs[ih]; }
00228 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HE2") ==0 ){ emean_vs_ieta_HE2= hcalMEs[ih]; }
00229 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HE3") ==0 ){ emean_vs_ieta_HE3= hcalMEs[ih]; }
00230 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HF1") ==0 ){ emean_vs_ieta_HF1= hcalMEs[ih]; }
00231 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HF2") ==0 ){ emean_vs_ieta_HF2= hcalMEs[ih]; }
00232 if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HO") ==0 ){ emean_vs_ieta_HO= hcalMEs[ih]; }
00233 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HB1") ==0 ){ RMS_vs_ieta_HB1= hcalMEs[ih]; }
00234 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HB2") ==0 ){ RMS_vs_ieta_HB2= hcalMEs[ih]; }
00235 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HE1") ==0 ){ RMS_vs_ieta_HE1= hcalMEs[ih]; }
00236 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HE2") ==0 ){ RMS_vs_ieta_HE2= hcalMEs[ih]; }
00237 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HE3") ==0 ){ RMS_vs_ieta_HE3= hcalMEs[ih]; }
00238 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HF1") ==0 ){ RMS_vs_ieta_HF1= hcalMEs[ih]; }
00239 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HF2") ==0 ){ RMS_vs_ieta_HF2= hcalMEs[ih]; }
00240 if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HO") ==0 ){ RMS_vs_ieta_HO= hcalMEs[ih]; }
00241 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HB1") ==0 ){ occupancy_vs_ieta_HB1= hcalMEs[ih]; }
00242 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HB2") ==0 ){ occupancy_vs_ieta_HB2= hcalMEs[ih]; }
00243 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HE1") ==0 ){ occupancy_vs_ieta_HE1= hcalMEs[ih]; }
00244 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HE2") ==0 ){ occupancy_vs_ieta_HE2= hcalMEs[ih]; }
00245 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HE3") ==0 ){ occupancy_vs_ieta_HE3= hcalMEs[ih]; }
00246 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HF1") ==0 ){ occupancy_vs_ieta_HF1= hcalMEs[ih]; }
00247 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HF2") ==0 ){ occupancy_vs_ieta_HF2= hcalMEs[ih]; }
00248 if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HO") ==0 ){ occupancy_vs_ieta_HO= hcalMEs[ih]; }
00249 if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_StatusWord_HB") ==0 ){ RecHit_StatusWord_HB= hcalMEs[ih]; }
00250 if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_StatusWord_HE") ==0 ){ RecHit_StatusWord_HE= hcalMEs[ih]; }
00251 if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_StatusWord_HO") ==0 ){ RecHit_StatusWord_HO= hcalMEs[ih]; }
00252 if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_StatusWord_HF") ==0 ){ RecHit_StatusWord_HF= hcalMEs[ih]; }
00253 if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_StatusWord_HF67") ==0 ){ RecHit_StatusWord_HF67= hcalMEs[ih]; }
00254 if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_Aux_StatusWord_HB") ==0 ){ RecHit_Aux_StatusWord_HB= hcalMEs[ih]; }
00255 if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_Aux_StatusWord_HE") ==0 ){ RecHit_Aux_StatusWord_HE= hcalMEs[ih]; }
00256 if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_Aux_StatusWord_HO") ==0 ){ RecHit_Aux_StatusWord_HO= hcalMEs[ih]; }
00257 if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_Aux_StatusWord_HF") ==0 ){ RecHit_Aux_StatusWord_HF= hcalMEs[ih]; }
00258 }
00259 if( useAllHistos !=0 && useAllHistos !=1 ) return 0;
00260
00261
00262 if (subdet==6 && useAllHistos) {
00263
00264
00265 double emap_min[82][72][4][4];
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278 for (unsigned int i1 = 0; i1 < 82; i1++) {
00279 for (unsigned int i2 = 0; i2 < 72; i2++) {
00280
00281 int index = (i1-41) * 72 + i2;
00282
00283 double e = emap_min[i1][i2][0][0];
00284 if( e < 10000.) {
00285 ZS_HB1->Fill(e);
00286 ZS_seqHB1->Fill(double(index),e);
00287 }
00288 e = emap_min[i1][i2][1][0];
00289 if( e < 10000.) {
00290 ZS_HB2->Fill(e);
00291 ZS_seqHB2->Fill(double(index),e);
00292 }
00293
00294 e = emap_min[i1][i2][0][1];
00295 if( e < 10000.) {
00296 ZS_HE1->Fill(e);
00297 ZS_seqHE1->Fill(double(index),e);
00298 }
00299 e = emap_min[i1][i2][1][1];
00300 if( e < 10000.) {
00301 ZS_HE2->Fill(e);
00302 ZS_seqHE2->Fill(double(index),e);
00303 }
00304 e = emap_min[i1][i2][2][1];
00305 if( e < 10000.) {
00306 ZS_HE3->Fill(e);
00307 ZS_seqHE3->Fill(double(index),e);
00308 }
00309
00310 e = emap_min[i1][i2][3][2];
00311 if( e < 10000.) {
00312 ZS_HO->Fill(e);
00313 ZS_seqHO->Fill(double(index),e);
00314 }
00315
00316 e = emap_min[i1][i2][0][3];
00317 if( e < 10000.) {
00318 ZS_HF1->Fill(e);
00319 ZS_seqHF1->Fill(double(index),e);
00320 }
00321
00322 e = emap_min[i1][i2][1][3];
00323 if( e < 10000.) {
00324 ZS_HF2->Fill(e);
00325 ZS_seqHF2->Fill(double(index),e);
00326 }
00327
00328 for (unsigned int i3 = 0; i3 < 4; i3++) {
00329 double emin = 100000.;
00330 for (unsigned int i4 = 0; i4 < 4; i4++) {
00331
00332
00333
00334
00335
00336
00337 if ( emin > emap_min [i1][i2][i3][i4])
00338 emin = emap_min [i1][i2][i3][i4];
00339 }
00340
00341 int ieta = i1-41;
00342 if( i3 == 0 && emin < 10000.) {
00343 map_depth1->Fill(double(ieta),double(i2),emin);
00344
00345
00346
00347
00348 }
00349 if( i3 == 1 && emin < 10000.)
00350 map_depth2->Fill(double(ieta),double(i2),emin);
00351 if( i3 == 2 && emin < 10000.)
00352 map_depth3->Fill(double(ieta),double(i2),emin);
00353 if( i3 == 3 && emin < 10000.)
00354 map_depth4->Fill(double(ieta),double(i2),emin);
00355 }
00356 }
00357 }
00358 }
00359
00360 else {
00361
00362 double nevtot = Nhf->getEntries();
00363 if(verbose_) std::cout<<"nevtot : "<<nevtot<<std::endl;
00364
00365 int nx = emap_depth1->getNbinsX();
00366 int ny = emap_depth1->getNbinsY();
00367 float cnorm;
00368 float fev = float (nevtot);
00369
00370
00371 float sumphi_hb1, sumphi_hb2, sumphi_he1, sumphi_he2, sumphi_he3,
00372 sumphi_ho, sumphi_hf1, sumphi_hf2;
00373
00374
00375
00376
00377 float phi_factor;
00378
00379 for (int i = 1; i <= nx; i++) {
00380 sumphi_hb1 = 0.;
00381 sumphi_hb2 = 0.;
00382 sumphi_he1 = 0.;
00383 sumphi_he2 = 0.;
00384 sumphi_he3 = 0.;
00385 sumphi_ho = 0.;
00386 sumphi_hf1 = 0.;
00387 sumphi_hf2 = 0.;
00388
00389 for (int j = 1; j <= ny; j++) {
00390
00391 int index = (i-42) * ny + j-1;
00392
00393
00394 cnorm = occupancy_map_HB1->getBinContent(i,j) / fev;
00395 occupancy_map_HB1->setBinContent(i,j,cnorm);
00396
00397 cnorm = occupancy_map_HB2->getBinContent(i,j) / fev;
00398 occupancy_map_HB2->setBinContent(i,j,cnorm);
00399
00400 cnorm = occupancy_map_HE1->getBinContent(i,j) / fev;
00401 occupancy_map_HE1->setBinContent(i,j,cnorm);
00402
00403 cnorm = occupancy_map_HE2->getBinContent(i,j) / fev;
00404 occupancy_map_HE2->setBinContent(i,j,cnorm);
00405
00406 cnorm = occupancy_map_HE3->getBinContent(i,j) / fev;
00407 occupancy_map_HE3->setBinContent(i,j,cnorm);
00408
00409 cnorm = occupancy_map_HO->getBinContent(i,j) / fev;
00410 occupancy_map_HO->setBinContent(i,j,cnorm);
00411
00412 cnorm = occupancy_map_HF1->getBinContent(i,j) / fev;
00413 occupancy_map_HF1->setBinContent(i,j,cnorm);
00414
00415 cnorm = occupancy_map_HF2->getBinContent(i,j) / fev;
00416 occupancy_map_HF2->setBinContent(i,j,cnorm);
00417
00418 sumphi_hb1 += occupancy_map_HB1->getBinContent(i,j);
00419 sumphi_hb2 += occupancy_map_HB2->getBinContent(i,j);
00420 sumphi_he1 += occupancy_map_HE1->getBinContent(i,j);
00421 sumphi_he2 += occupancy_map_HE2->getBinContent(i,j);
00422 sumphi_he3 += occupancy_map_HE3->getBinContent(i,j);
00423 sumphi_ho += occupancy_map_HO->getBinContent(i,j);
00424 sumphi_hf1 += occupancy_map_HF1->getBinContent(i,j);
00425 sumphi_hf2 += occupancy_map_HF2->getBinContent(i,j);
00426
00427
00428 cnorm = emap_depth1->getBinContent(i,j) / fev;
00429 emap_depth1->setBinContent(i,j,cnorm);
00430 cnorm = emap_depth2->getBinContent(i,j) / fev;
00431 emap_depth2->setBinContent(i,j,cnorm);
00432 cnorm = emap_depth3->getBinContent(i,j) / fev;
00433 emap_depth3->setBinContent(i,j,cnorm);
00434 cnorm = emap_depth4->getBinContent(i,j) / fev;
00435 emap_depth4->setBinContent(i,j,cnorm);
00436
00437
00438 if(useAllHistos){
00439 occupancy_seqHB1->Fill(double(index),cnorm);
00440 occupancy_seqHB2->Fill(double(index),cnorm);
00441 occupancy_seqHE1->Fill(double(index),cnorm);
00442 occupancy_seqHE2->Fill(double(index),cnorm);
00443 occupancy_seqHE3->Fill(double(index),cnorm);
00444 occupancy_seqHO->Fill(double(index),cnorm);
00445 occupancy_seqHF1->Fill(double(index),cnorm);
00446 occupancy_seqHF2->Fill(double(index),cnorm);
00447 }
00448 }
00449
00450 int ieta = i - 42;
00451 if(ieta >=0 ) ieta +=1;
00452
00453 if(ieta >= -20 && ieta <= 20 )
00454 {phi_factor = 72.;}
00455 else {
00456 if(ieta >= 40 || ieta <= -40 ) {phi_factor = 18.;}
00457 else
00458 phi_factor = 36.;
00459 }
00460 if(ieta >= 0) ieta -= 1;
00461
00462
00463
00464
00465
00466
00467
00468
00469 cnorm = sumphi_hb1 / phi_factor;
00470 occupancy_vs_ieta_HB1->Fill(float(ieta), cnorm);
00471 cnorm = sumphi_hb2 / phi_factor;
00472 occupancy_vs_ieta_HB2->Fill(float(ieta), cnorm);
00473 cnorm = sumphi_he1 / phi_factor;
00474 occupancy_vs_ieta_HE1->Fill(float(ieta), cnorm);
00475 cnorm = sumphi_he2 / phi_factor;
00476 occupancy_vs_ieta_HE2->Fill(float(ieta), cnorm);
00477 cnorm = sumphi_he3 / phi_factor;
00478 occupancy_vs_ieta_HE3->Fill(float(ieta), cnorm);
00479 cnorm = sumphi_ho / phi_factor;
00480 occupancy_vs_ieta_HO->Fill(float(ieta), cnorm);
00481 cnorm = sumphi_hf1 / phi_factor;
00482 occupancy_vs_ieta_HF1->Fill(float(ieta), cnorm);
00483 cnorm = sumphi_hf2 / phi_factor;
00484 occupancy_vs_ieta_HF2->Fill(float(ieta), cnorm);
00485
00486 if (useAllHistos){
00487
00488 cnorm = emean_vs_ieta_HB1->getBinError(i);
00489 RMS_vs_ieta_HB1->Fill(ieta,cnorm);
00490 cnorm = emean_vs_ieta_HB2->getBinError(i);
00491 RMS_vs_ieta_HB2->Fill(ieta,cnorm);
00492 cnorm = emean_vs_ieta_HE1->getBinError(i);
00493 RMS_vs_ieta_HE1->Fill(ieta,cnorm);
00494 cnorm = emean_vs_ieta_HE2->getBinError(i);
00495 RMS_vs_ieta_HE2->Fill(ieta,cnorm);
00496 cnorm = emean_vs_ieta_HE1->getBinError(i);
00497 RMS_vs_ieta_HE3->Fill(ieta,cnorm);
00498 cnorm = emean_vs_ieta_HB1->getBinError(i);
00499 RMS_vs_ieta_HO->Fill(ieta,cnorm);
00500 cnorm = emean_vs_ieta_HB1->getBinError(i);
00501 RMS_vs_ieta_HF1->Fill(ieta,cnorm);
00502 cnorm = emean_vs_ieta_HB1->getBinError(i);
00503 RMS_vs_ieta_HF2->Fill(ieta,cnorm);
00504 }
00505 }
00506
00507
00508
00509 if(useAllHistos){
00510 nx = emean_seqHB1->getNbinsX();
00511 for(int ibin = 1; ibin <= nx; ibin++ ){
00512 cnorm = emean_seqHB1->getBinError(ibin);
00513 RMS_seq_HB1->setBinContent(ibin, cnorm);
00514 cnorm = emean_seqHB2->getBinError(ibin);
00515 RMS_seq_HB2->setBinContent(ibin, cnorm);
00516 cnorm = emean_seqHO->getBinError(ibin);
00517 RMS_seq_HO->setBinContent(ibin, cnorm);
00518 }
00519 nx = emean_seqHE1->getNbinsX();
00520 for(int ibin = 1; ibin <= nx; ibin++ ){
00521 cnorm = emean_seqHE1->getBinError(ibin);
00522 RMS_seq_HE1->setBinContent(ibin, cnorm);
00523 cnorm = emean_seqHE2->getBinError(ibin);
00524 RMS_seq_HE2->setBinContent(ibin, cnorm);
00525 cnorm = emean_seqHE3->getBinError(ibin);
00526 RMS_seq_HE3->setBinContent(ibin, cnorm);
00527 }
00528 nx = emean_seqHF1->getNbinsX();
00529 for(int ibin = 1; ibin <= nx; ibin++ ){
00530 cnorm = emean_seqHF1->getBinError(ibin);
00531 RMS_seq_HF1->setBinContent(ibin, cnorm);
00532 cnorm = emean_seqHF2->getBinError(ibin);
00533 RMS_seq_HF2->setBinContent(ibin, cnorm);
00534 }
00535 }
00536
00537 nx = RecHit_StatusWord_HB->getNbinsX();
00538 for (int ibin = 1; ibin <= nx; ibin++) {
00539 cnorm = RecHit_StatusWord_HB->getBinContent(ibin) / (fev * 2592.);
00540 RecHit_StatusWord_HB->setBinContent(ibin,cnorm);
00541
00542 cnorm = RecHit_StatusWord_HE->getBinContent(ibin) / (fev * 2592.);
00543 RecHit_StatusWord_HE->setBinContent(ibin,cnorm);
00544
00545 cnorm = RecHit_StatusWord_HO->getBinContent(ibin) / (fev * 2160.);
00546 RecHit_StatusWord_HO->setBinContent(ibin,cnorm);
00547
00548 cnorm = RecHit_StatusWord_HF->getBinContent(ibin) / (fev * 1728.);
00549 RecHit_StatusWord_HF->setBinContent(ibin,cnorm);
00550
00551 cnorm = RecHit_Aux_StatusWord_HB->getBinContent(ibin) / (fev * 2592.);
00552 RecHit_Aux_StatusWord_HB->setBinContent(ibin,cnorm);
00553
00554 cnorm = RecHit_Aux_StatusWord_HE->getBinContent(ibin) / (fev * 2592.);
00555 RecHit_Aux_StatusWord_HE->setBinContent(ibin,cnorm);
00556
00557 cnorm = RecHit_Aux_StatusWord_HO->getBinContent(ibin) / (fev * 2160.);
00558 RecHit_Aux_StatusWord_HO->setBinContent(ibin,cnorm);
00559
00560 cnorm = RecHit_Aux_StatusWord_HF->getBinContent(ibin) / (fev * 1728.);
00561 RecHit_Aux_StatusWord_HF->setBinContent(ibin,cnorm);
00562 }
00563
00564 if(useAllHistos){
00565 nx = RecHit_StatusWord_HF67->getNbinsX();
00566 for (int ibin = 1; ibin <= nx; ibin++) {
00567 cnorm = RecHit_StatusWord_HF67->getBinContent(ibin) / (fev * 1728.);
00568 RecHit_StatusWord_HF67->setBinContent(ibin,cnorm);
00569 }
00570 }
00571 }
00572
00573 return 1;
00574 }
00575
00576 DEFINE_FWK_MODULE(HcalRecHitsClient);