CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
HcalDigisValidation Class Reference

#include <Validation/HcalDigis/src/HcalDigisValidation.cc>

Inheritance diagram for HcalDigisValidation:
edm::EDAnalyzer edm::EDConsumerBase

Classes

struct  HistLim
 

Public Member Functions

 HcalDigisValidation (const edm::ParameterSet &)
 
 ~HcalDigisValidation ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
void beginRun ()
 
void book1D (std::string name, int n, double min, double max)
 
void book1D (std::string name, HistLim limX)
 
void book2D (std::string name, HistLim limX, HistLim limY)
 
void booking (std::string subdetopt, int bnoise, int bmc)
 
void bookPf (std::string name, HistLim limX, HistLim limY)
 
virtual void endJob ()
 
void endRun ()
 
void eval_occupancy ()
 
void fill1D (std::string name, double X, double weight=1)
 
void fill2D (std::string name, double X, double Y, double weight=1)
 
void fillPf (std::string name, double X, double Y)
 
MonitorElementmonitor (std::string name)
 
template<class Digi >
void reco (const edm::Event &iEvent, const edm::EventSetup &iSetup)
 
std::string str (int x)
 

Private Attributes

edm::ESHandle< HcalDbServiceconditions
 
DQMStoredbe_
 
std::string dirName_
 
edm::ESHandle< CaloGeometrygeometry
 
edm::InputTag inputTag_
 
std::string mc_
 
std::string mode_
 
std::map< std::string,
MonitorElement * > * 
msm_
 
int nevent1
 
int nevent2
 
int nevent3
 
int nevent4
 
int nevtot
 
int noise_
 
std::string outputFile_
 
std::string subdet_
 
std::string zside_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 47 of file HcalDigisValidation.h.

Constructor & Destructor Documentation

HcalDigisValidation::HcalDigisValidation ( const edm::ParameterSet iConfig)
explicit

Definition at line 23 of file HcalDigisValidation.cc.

References book1D(), booking(), dbe_, dirName_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputTag_, mc_, mode_, msm_, cppFunctionSkipper::operator, outputFile_, DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and subdet_.

23  {
24 
25  using namespace std;
26 
27  subdet_ = iConfig.getUntrackedParameter<std::string > ("subdetector", "all");
28  outputFile_ = iConfig.getUntrackedParameter<std::string > ("outputFile", "");
29  inputTag_ = iConfig.getParameter<edm::InputTag > ("digiLabel");
30  mc_ = iConfig.getUntrackedParameter<std::string > ("mc", "no");
31  mode_ = iConfig.getUntrackedParameter<std::string > ("mode", "multi");
32  dirName_ = iConfig.getUntrackedParameter<std::string > ("dirName", "HcalDigisV/HcalDigiTask");
33 
35  msm_ = new std::map<std::string, MonitorElement*>();
36 
37  if (outputFile_.size() != 0) edm::LogInfo("OutputInfo") << " Hcal Digi Task histograms will be saved to '" << outputFile_.c_str() << "'";
38  else edm::LogInfo("OutputInfo") << " Hcal Digi Task histograms will NOT be saved";
39 
41 
42  // book
43  book1D("nevtot", 1, 0, 1);
44  int bnoise = 0;
45  int bmc = 0;
46  if (subdet_ == "noise") bnoise = 1;
47  if (mc_ == "yes") bmc = 1;
48  if (subdet_ == "noise" || subdet_ == "all") {
49  booking("HB", bnoise, bmc);
50  booking("HO", bnoise, bmc);
51  booking("HF", bnoise, bmc);
52  booking("HE", bnoise, bmc);
53  } else {
54  booking(subdet_, 0, bmc);
55  }
56 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void book1D(std::string name, int n, double min, double max)
std::map< std::string, MonitorElement * > * msm_
void booking(std::string subdetopt, int bnoise, int bmc)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
HcalDigisValidation::~HcalDigisValidation ( )
inline

Definition at line 51 of file HcalDigisValidation.h.

51  {
52  };

Member Function Documentation

void HcalDigisValidation::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 419 of file HcalDigisValidation.cc.

References conditions, fill1D(), geometry, edm::EventSetup::get(), iEvent, nevtot, noise_, and subdet_.

419  {
420  using namespace edm;
421 
422  iSetup.get<CaloGeometryRecord > ().get(geometry);
423  iSetup.get<HcalDbRecord > ().get(conditions);
424 
425  // std::cout << " >>>>> HcalDigiTester::analyze hcalselector = "
426  // << subdet_ << std::endl;
427 
428  if (subdet_ != "all") {
429  noise_ = 0;
430  if (subdet_ == "HB") reco<HBHEDataFrame > (iEvent, iSetup);
431  if (subdet_ == "HE") reco<HBHEDataFrame > (iEvent, iSetup);
432  if (subdet_ == "HO") reco<HODataFrame > (iEvent, iSetup);
433  if (subdet_ == "HF") reco<HFDataFrame > (iEvent, iSetup);
434 
435  if (subdet_ == "noise") {
436  noise_ = 1;
437  // std::cout << " >>>>> HcalDigiTester::analyze entering noise "
438  // << std::endl;
439  subdet_ = "HB";
440  reco<HBHEDataFrame > (iEvent, iSetup);
441  subdet_ = "HE";
442  reco<HBHEDataFrame > (iEvent, iSetup);
443  subdet_ = "HO";
444  reco<HODataFrame > (iEvent, iSetup);
445  subdet_ = "HF";
446  reco<HFDataFrame > (iEvent, iSetup);
447  subdet_ = "noise";
448  }
449  }// all subdetectors
450  else {
451  noise_ = 0;
452 
453  subdet_ = "HB";
454  reco<HBHEDataFrame > (iEvent, iSetup);
455  subdet_ = "HE";
456  reco<HBHEDataFrame > (iEvent, iSetup);
457  subdet_ = "HO";
458  reco<HODataFrame > (iEvent, iSetup);
459  subdet_ = "HF";
460  reco<HFDataFrame > (iEvent, iSetup);
461  subdet_ = "all";
462  }
463 
464  fill1D("nevtot", 0);
465  nevtot++;
466 }
edm::ESHandle< CaloGeometry > geometry
int iEvent
Definition: GenABIO.cc:243
void fill1D(std::string name, double X, double weight=1)
const T & get() const
Definition: EventSetup.h:55
edm::ESHandle< HcalDbService > conditions
void HcalDigisValidation::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 922 of file HcalDigisValidation.cc.

References nevent1, nevent2, nevent3, nevent4, and nevtot.

922  {
923  nevent1 = 0;
924  nevent2 = 0;
925  nevent3 = 0;
926  nevent4 = 0;
927 
928  nevtot = 0;
929 }
void HcalDigisValidation::beginRun ( void  )
private

Definition at line 935 of file HcalDigisValidation.cc.

935  {
936 
937 }
void HcalDigisValidation::book1D ( std::string  name,
int  n,
double  min,
double  max 
)
private

Definition at line 943 of file HcalDigisValidation.cc.

References DQMStore::book1D(), dbe_, max(), min, msm_, n, and mergeVDriftHistosByStation::name.

Referenced by booking(), and HcalDigisValidation().

943  {
944  if (!msm_->count(name)) (*msm_)[name] = dbe_->book1D(name.c_str(), name.c_str(), n, min, max);
945 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
#define min(a, b)
Definition: mlp_lapack.h:161
std::map< std::string, MonitorElement * > * msm_
const T & max(const T &a, const T &b)
void HcalDigisValidation::book1D ( std::string  name,
HistLim  limX 
)
private

Definition at line 947 of file HcalDigisValidation.cc.

References DQMStore::book1D(), dbe_, HcalDigisValidation::HistLim::max, HcalDigisValidation::HistLim::min, msm_, HcalDigisValidation::HistLim::n, and mergeVDriftHistosByStation::name.

947  {
948  if (!msm_->count(name)) (*msm_)[name] = dbe_->book1D(name.c_str(), name.c_str(), limX.n, limX.min, limX.max);
949 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
std::map< std::string, MonitorElement * > * msm_
void HcalDigisValidation::book2D ( std::string  name,
HistLim  limX,
HistLim  limY 
)
private

Definition at line 955 of file HcalDigisValidation.cc.

References DQMStore::book2D(), dbe_, HcalDigisValidation::HistLim::max, HcalDigisValidation::HistLim::min, msm_, HcalDigisValidation::HistLim::n, and mergeVDriftHistosByStation::name.

Referenced by booking().

955  {
956  if (!msm_->count(name)) (*msm_)[name] = dbe_->book2D(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max);
957 }
std::map< std::string, MonitorElement * > * msm_
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:850
void HcalDigisValidation::booking ( std::string  subdetopt,
int  bnoise,
int  bmc 
)
private

Definition at line 58 of file HcalDigisValidation.cc.

References book1D(), book2D(), bookPf(), cropTnPTrees::frac, timingPdfMaker::histo, and subdet_.

Referenced by HcalDigisValidation().

58  {
59 
60  // defaults are for HB
61 
62  HistLim Ndigis(2600, 0., 2600.);
63  HistLim ndigis(505, -10., 1000.);
64  HistLim sime(200, 0., 1.0);
65 // HistLim digiAmp(2050, -100., 4000.);
66  HistLim digiAmp(205, -100., 4000.);
67  HistLim ratio(2000, -100., 3900.);
68  HistLim sumAmp(100, -500., 1500.);
69 
70  HistLim nbin(10, 0., 10.);
71 
72  HistLim pedestal(75, 0., 15.);
73  HistLim pedestalfC(400, -10., 30.);
74 
75  HistLim frac(52, -0.02, 1.02);
76 
77  HistLim pedLim(80, 0., 8.);
78  HistLim pedWidthLim(100, 0., 2.);
79 
80  HistLim gainLim(120, 0., 0.6);
81  HistLim gainWidthLim(100, 0., 0.3);
82 
83  HistLim ietaLim(82, -41., 41.);
84  HistLim iphiLim(72, 0., 72.);
85 
86  if (bsubdet == "HE") {
87  sime = HistLim(200, 0., 1.0);
88 // digiAmp = HistLim(250, -100., 1000.);
89  } else if (bsubdet == "HF") {
90 // ndigis = HistLim(500, 0., 500.);
91  sime = HistLim(100, 0., 100.);
92 // digiAmp = HistLim(420, -100., 2000.);
93 // ratio = HistLim(120, 0., 120.);
94  pedLim = HistLim(100, 0., 20.);
95  pedWidthLim = HistLim(100, 0., 5.);
96  frac = HistLim(400, -4.00, 4.00);
97 
98  } else if (bsubdet == "HO") {
99  sime = HistLim(200, 0., 1.0);
100 // digiAmp = HistLim(200, 0., 1000.);
101  gainLim = HistLim(150, 0., 1.5);
102  }
103 
104  Char_t histo[100];
105  const char * sub = bsubdet.c_str();
106  if (bnoise == 0) {
107  // number of digis in each subdetector
108  sprintf(histo, "HcalDigiTask_Ndigis_%s", sub);
109  book1D(histo, Ndigis);
110 
111  // maps of occupancies
112  sprintf(histo, "HcalDigiTask_ieta_iphi_occupancy_map_depth1_%s", sub);
113  book2D(histo, ietaLim, iphiLim);
114 
115  sprintf(histo, "HcalDigiTask_ieta_iphi_occupancy_map_depth2_%s", sub);
116  book2D(histo, ietaLim, iphiLim);
117 
118  sprintf(histo, "HcalDigiTask_ieta_iphi_occupancy_map_depth3_%s", sub);
119  book2D(histo, ietaLim, iphiLim);
120 
121  sprintf(histo, "HcalDigiTask_ieta_iphi_occupancy_map_depth4_%s", sub);
122  book2D(histo, ietaLim, iphiLim);
123 
124  // occupancies vs ieta
125  sprintf(histo, "HcalDigiTask_occupancy_vs_ieta_depth1_%s", sub);
126  book1D(histo, ietaLim);
127 
128  sprintf(histo, "HcalDigiTask_occupancy_vs_ieta_depth2_%s", sub);
129  book1D(histo, ietaLim);
130 
131  sprintf(histo, "HcalDigiTask_occupancy_vs_ieta_depth3_%s", sub);
132  book1D(histo, ietaLim);
133 
134  sprintf(histo, "HcalDigiTask_occupancy_vs_ieta_depth4_%s", sub);
135  book1D(histo, ietaLim);
136 
137 
138  // maps of sum of amplitudes (sum lin.digis(4,5,6,7) - ped) all depths
139 /*
140  sprintf(histo, "HcalDigiTask_ieta_iphi_map_of_amplitudes_fC_depth1_%s", sub);
141  book2D(histo, ietaLim, iphiLim);
142  sprintf(histo, "HcalDigiTask_ieta_iphi_map_of_amplitudes_fC_depth2_%s", sub);
143  book2D(histo, ietaLim, iphiLim);
144  sprintf(histo, "HcalDigiTask_ieta_iphi_map_of_amplitudes_fC_depth3_%s", sub);
145  book2D(histo, ietaLim, iphiLim);
146  sprintf(histo, "HcalDigiTask_ieta_iphi_map_of_amplitudes_fC_depth4_%s", sub);
147  book2D(histo, ietaLim, iphiLim);
148 */
149  // just 1D of all cells' amplitudes
150  sprintf(histo, "HcalDigiTask_sum_all_amplitudes_%s", sub);
151  book1D(histo, sumAmp);
152 
153  sprintf(histo, "HcalDigiTask_number_of_amplitudes_above_10fC_%s", sub);
154  book1D(histo, ndigis);
155 
156  sprintf(histo, "HcalDigiTask_ADC0_adc_depth1_%s", sub);
157  book1D(histo, pedestal);
158  sprintf(histo, "HcalDigiTask_ADC0_adc_depth2_%s", sub);
159  book1D(histo, pedestal);
160  sprintf(histo, "HcalDigiTask_ADC0_adc_depth3_%s", sub);
161  book1D(histo, pedestal);
162  sprintf(histo, "HcalDigiTask_ADC0_adc_depth4_%s", sub);
163  book1D(histo, pedestal);
164 
165  sprintf(histo, "HcalDigiTask_ADC0_fC_depth1_%s", sub);
166  book1D(histo, pedestalfC);
167  sprintf(histo, "HcalDigiTask_ADC0_fC_depth2_%s", sub);
168  book1D(histo, pedestalfC);
169  sprintf(histo, "HcalDigiTask_ADC0_fC_depth3_%s", sub);
170  book1D(histo, pedestalfC);
171  sprintf(histo, "HcalDigiTask_ADC0_fC_depth4_%s", sub);
172  book1D(histo, pedestalfC);
173 
174  sprintf(histo, "HcalDigiTask_signal_amplitude_%s", sub);
175  book1D(histo, digiAmp);
176  sprintf(histo, "HcalDigiTask_signal_amplitude_depth1_%s", sub);
177  book1D(histo, digiAmp);
178  sprintf(histo, "HcalDigiTask_signal_amplitude_depth2_%s", sub);
179  book1D(histo, digiAmp);
180  sprintf(histo, "HcalDigiTask_signal_amplitude_depth3_%s", sub);
181  book1D(histo, digiAmp);
182  sprintf(histo, "HcalDigiTask_signal_amplitude_depth4_%s", sub);
183  book1D(histo, digiAmp);
184 
185  sprintf(histo, "HcalDigiTask_signal_amplitude_vs_bin_all_depths_%s", sub);
186  book2D(histo, nbin, digiAmp);
187 
188 /*
189  sprintf(histo, "HcalDigiTask_all_amplitudes_vs_bin_depth1_%s", sub);
190  book2D(histo, nbin, digiAmp);
191  sprintf(histo, "HcalDigiTask_all_amplitudes_vs_bin_depth2_%s", sub);
192  book2D(histo, nbin, digiAmp);
193 */
194  sprintf(histo, "HcalDigiTask_all_amplitudes_vs_bin_1D_depth1_%s", sub);
195  book1D(histo, nbin);
196  sprintf(histo, "HcalDigiTask_all_amplitudes_vs_bin_1D_depth2_%s", sub);
197  book1D(histo, nbin);
198 
199  sprintf(histo, "HcalDigiTask_bin_5_frac_%s", sub);
200  book1D(histo, frac);
201  sprintf(histo, "HcalDigiTask_bin_6_7_frac_%s", sub);
202  book1D(histo, frac);
203 
204  if (bmc == 1) {
205  sprintf(histo, "HcalDigiTask_amplitude_vs_simhits_%s", sub);
206  book2D(histo, sime, digiAmp);
207  sprintf(histo, "HcalDigiTask_amplitude_vs_simhits_depth1_%s", sub);
208  book2D(histo, sime, digiAmp);
209  sprintf(histo, "HcalDigiTask_amplitude_vs_simhits_depth2_%s", sub);
210  book2D(histo, sime, digiAmp);
211  sprintf(histo, "HcalDigiTask_amplitude_vs_simhits_depth3_%s", sub);
212  book2D(histo, sime, digiAmp);
213  sprintf(histo, "HcalDigiTask_amplitude_vs_simhits_depth4_%s", sub);
214  book2D(histo, sime, digiAmp);
215 
216  sprintf(histo, "HcalDigiTask_amplitude_vs_simhits_profile_%s", sub);
217  bookPf(histo, sime, digiAmp);
218  sprintf(histo, "HcalDigiTask_amplitude_vs_simhits_profile_depth1_%s", sub);
219  bookPf(histo, sime, digiAmp);
220  sprintf(histo, "HcalDigiTask_amplitude_vs_simhits_profile_depth2_%s", sub);
221  bookPf(histo, sime, digiAmp);
222  sprintf(histo, "HcalDigiTask_amplitude_vs_simhits_profile_depth3_%s", sub);
223  bookPf(histo, sime, digiAmp);
224  sprintf(histo, "HcalDigiTask_amplitude_vs_simhits_profile_depth4_%s", sub);
225  bookPf(histo, sime, digiAmp);
226 
227  sprintf(histo, "HcalDigiTask_ratio_amplitude_vs_simhits_%s", sub);
228  book1D(histo, ratio);
229  sprintf(histo, "HcalDigiTask_ratio_amplitude_vs_simhits_depth1_%s", sub);
230  book1D(histo, ratio);
231  sprintf(histo, "HcalDigiTask_ratio_amplitude_vs_simhits_depth2_%s", sub);
232  book1D(histo, ratio);
233  sprintf(histo, "HcalDigiTask_ratio_amplitude_vs_simhits_depth3_%s", sub);
234  book1D(histo, ratio);
235  sprintf(histo, "HcalDigiTask_ratio_amplitude_vs_simhits_depth4_%s", sub);
236  book1D(histo, ratio);
237  }//mc only
238 
239  } else { // noise only
240 
241  // EVENT "1" distributions of all cells properties
242 
243 
244  if (subdet_ == "HB" || subdet_ == "HE" || subdet_ == "HF") {
245  sprintf(histo, "HcalDigiTask_gain_capId0_Depth1_%s", sub);
246  book1D(histo, gainLim);
247  sprintf(histo, "HcalDigiTask_gain_capId1_Depth1_%s", sub);
248  book1D(histo, gainLim);
249  sprintf(histo, "HcalDigiTask_gain_capId2_Depth1_%s", sub);
250  book1D(histo, gainLim);
251  sprintf(histo, "HcalDigiTask_gain_capId3_Depth1_%s", sub);
252  book1D(histo, gainLim);
253 
254  sprintf(histo, "HcalDigiTask_gain_capId0_Depth2_%s", sub);
255  book1D(histo, gainLim);
256  sprintf(histo, "HcalDigiTask_gain_capId1_Depth2_%s", sub);
257  book1D(histo, gainLim);
258  sprintf(histo, "HcalDigiTask_gain_capId2_Depth2_%s", sub);
259  book1D(histo, gainLim);
260  sprintf(histo, "HcalDigiTask_gain_capId3_Depth2_%s", sub);
261  book1D(histo, gainLim);
262 
263  sprintf(histo, "HcalDigiTask_gainWidth_capId0_Depth1_%s", sub);
264  book1D(histo, gainWidthLim);
265  sprintf(histo, "HcalDigiTask_gainWidth_capId1_Depth1_%s", sub);
266  book1D(histo, gainWidthLim);
267  sprintf(histo, "HcalDigiTask_gainWidth_capId2_Depth1_%s", sub);
268  book1D(histo, gainWidthLim);
269  sprintf(histo, "HcalDigiTask_gainWidth_capId3_Depth1_%s", sub);
270  book1D(histo, gainWidthLim);
271 
272  sprintf(histo, "HcalDigiTask_gainWidth_capId0_Depth2_%s", sub);
273  book1D(histo, gainWidthLim);
274  sprintf(histo, "HcalDigiTask_gainWidth_capId1_Depth2_%s", sub);
275  book1D(histo, gainWidthLim);
276  sprintf(histo, "HcalDigiTask_gainWidth_capId2_Depth2_%s", sub);
277  book1D(histo, gainWidthLim);
278  sprintf(histo, "HcalDigiTask_gainWidth_capId3_Depth2_%s", sub);
279  book1D(histo, gainWidthLim);
280 
281  sprintf(histo, "HcalDigiTask_pedestal_capId0_Depth1_%s", sub);
282  book1D(histo, pedLim);
283  sprintf(histo, "HcalDigiTask_pedestal_capId1_Depth1_%s", sub);
284  book1D(histo, pedLim);
285  sprintf(histo, "HcalDigiTask_pedestal_capId2_Depth1_%s", sub);
286  book1D(histo, pedLim);
287  sprintf(histo, "HcalDigiTask_pedestal_capId3_Depth1_%s", sub);
288  book1D(histo, pedLim);
289 
290  sprintf(histo, "HcalDigiTask_pedestal_capId0_Depth2_%s", sub);
291  book1D(histo, pedLim);
292  sprintf(histo, "HcalDigiTask_pedestal_capId1_Depth2_%s", sub);
293  book1D(histo, pedLim);
294  sprintf(histo, "HcalDigiTask_pedestal_capId2_Depth2_%s", sub);
295  book1D(histo, pedLim);
296  sprintf(histo, "HcalDigiTask_pedestal_capId3_Depth2_%s", sub);
297  book1D(histo, pedLim);
298 
299  sprintf(histo, "HcalDigiTask_pedestal_width_capId0_Depth1_%s", sub);
300  book1D(histo, pedWidthLim);
301  sprintf(histo, "HcalDigiTask_pedestal_width_capId1_Depth1_%s", sub);
302  book1D(histo, pedWidthLim);
303  sprintf(histo, "HcalDigiTask_pedestal_width_capId2_Depth1_%s", sub);
304  book1D(histo, pedWidthLim);
305  sprintf(histo, "HcalDigiTask_pedestal_width_capId3_Depth1_%s", sub);
306  book1D(histo, pedWidthLim);
307 
308  sprintf(histo, "HcalDigiTask_pedestal_width_capId0_Depth2_%s", sub);
309  book1D(histo, pedWidthLim);
310  sprintf(histo, "HcalDigiTask_pedestal_width_capId1_Depth2_%s", sub);
311  book1D(histo, pedWidthLim);
312  sprintf(histo, "HcalDigiTask_pedestal_width_capId2_Depth2_%s", sub);
313  book1D(histo, pedWidthLim);
314  sprintf(histo, "HcalDigiTask_pedestal_width_capId3_Depth2_%s", sub);
315  book1D(histo, pedWidthLim);
316 
317  }
318 
319  if (subdet_ == "HE") {
320  sprintf(histo, "HcalDigiTask_gain_capId0_Depth3_%s", sub);
321  book1D(histo, gainLim);
322  sprintf(histo, "HcalDigiTask_gain_capId1_Depth3_%s", sub);
323  book1D(histo, gainLim);
324  sprintf(histo, "HcalDigiTask_gain_capId2_Depth3_%s", sub);
325  book1D(histo, gainLim);
326  sprintf(histo, "HcalDigiTask_gain_capId3_Depth3_%s", sub);
327  book1D(histo, gainLim);
328 
329  sprintf(histo, "HcalDigiTask_gainWidth_capId0_Depth3_%s", sub);
330  book1D(histo, gainWidthLim);
331  sprintf(histo, "HcalDigiTask_gainWidth_capId1_Depth3_%s", sub);
332  book1D(histo, gainWidthLim);
333  sprintf(histo, "HcalDigiTask_gainWidth_capId2_Depth3_%s", sub);
334  book1D(histo, gainWidthLim);
335  sprintf(histo, "HcalDigiTask_gainWidth_capId3_Depth3_%s", sub);
336  book1D(histo, gainWidthLim);
337 
338  sprintf(histo, "HcalDigiTask_pedestal_capId0_Depth3_%s", sub);
339  book1D(histo, pedLim);
340  sprintf(histo, "HcalDigiTask_pedestal_capId1_Depth3_%s", sub);
341  book1D(histo, pedLim);
342  sprintf(histo, "HcalDigiTask_pedestal_capId2_Depth3_%s", sub);
343  book1D(histo, pedLim);
344  sprintf(histo, "HcalDigiTask_pedestal_capId3_Depth3_%s", sub);
345  book1D(histo, pedLim);
346 
347  sprintf(histo, "HcalDigiTask_pedestal_width_capId0_Depth3_%s", sub);
348  book1D(histo, pedWidthLim);
349  sprintf(histo, "HcalDigiTask_pedestal_width_capId1_Depth3_%s", sub);
350  book1D(histo, pedWidthLim);
351  sprintf(histo, "HcalDigiTask_pedestal_width_capId2_Depth3_%s", sub);
352  book1D(histo, pedWidthLim);
353  sprintf(histo, "HcalDigiTask_pedestal_width_capId3_Depth3_%s", sub);
354  book1D(histo, pedWidthLim);
355 
356  }
357 
358  if (subdet_ == "HO") {
359  sprintf(histo, "HcalDigiTask_gain_capId0_Depth4_%s", sub);
360  book1D(histo, gainLim);
361  sprintf(histo, "HcalDigiTask_gain_capId1_Depth4_%s", sub);
362  book1D(histo, gainLim);
363  sprintf(histo, "HcalDigiTask_gain_capId2_Depth4_%s", sub);
364  book1D(histo, gainLim);
365  sprintf(histo, "HcalDigiTask_gain_capId3_Depth4_%s", sub);
366  book1D(histo, gainLim);
367 
368  sprintf(histo, "HcalDigiTask_gainWidth_capId0_Depth4_%s", sub);
369  book1D(histo, gainWidthLim);
370  sprintf(histo, "HcalDigiTask_gainWidth_capId1_Depth4_%s", sub);
371  book1D(histo, gainWidthLim);
372  sprintf(histo, "HcalDigiTask_gainWidth_capId2_Depth4_%s", sub);
373  book1D(histo, gainWidthLim);
374  sprintf(histo, "HcalDigiTask_gainWidth_capId3_Depth4_%s", sub);
375  book1D(histo, gainWidthLim);
376 
377 
378  sprintf(histo, "HcalDigiTask_pedestal_capId0_Depth4_%s", sub);
379  book1D(histo, pedLim);
380  sprintf(histo, "HcalDigiTask_pedestal_capId1_Depth4_%s", sub);
381  book1D(histo, pedLim);
382  sprintf(histo, "HcalDigiTask_pedestal_capId2_Depth4_%s", sub);
383  book1D(histo, pedLim);
384  sprintf(histo, "HcalDigiTask_pedestal_capId3_Depth4_%s", sub);
385  book1D(histo, pedLim);
386 
387  sprintf(histo, "HcalDigiTask_pedestal_width_capId0_Depth4_%s", sub);
388  book1D(histo, pedWidthLim);
389  sprintf(histo, "HcalDigiTask_pedestal_width_capId1_Depth4_%s", sub);
390  book1D(histo, pedWidthLim);
391  sprintf(histo, "HcalDigiTask_pedestal_width_capId2_Depth4_%s", sub);
392  book1D(histo, pedWidthLim);
393  sprintf(histo, "HcalDigiTask_pedestal_width_capId3_Depth4_%s", sub);
394  book1D(histo, pedWidthLim);
395 
396  }
397 
398  sprintf(histo, "HcalDigiTask_gainMap_Depth1_%s", sub);
399  book2D(histo, ietaLim, iphiLim);
400  sprintf(histo, "HcalDigiTask_gainMap_Depth2_%s", sub);
401  book2D(histo, ietaLim, iphiLim);
402  sprintf(histo, "HcalDigiTask_gainMap_Depth3_%s", sub);
403  book2D(histo, ietaLim, iphiLim);
404  sprintf(histo, "HcalDigiTask_gainMap_Depth4_%s", sub);
405  book2D(histo, ietaLim, iphiLim);
406 
407  sprintf(histo, "HcalDigiTask_pwidthMap_Depth1_%s", sub);
408  book2D(histo, ietaLim, iphiLim);
409  sprintf(histo, "HcalDigiTask_pwidthMap_Depth2_%s", sub);
410  book2D(histo, ietaLim, iphiLim);
411  sprintf(histo, "HcalDigiTask_pwidthMap_Depth3_%s", sub);
412  book2D(histo, ietaLim, iphiLim);
413  sprintf(histo, "HcalDigiTask_pwidthMap_Depth4_%s", sub);
414  book2D(histo, ietaLim, iphiLim);
415 
416  } //end of noise-only
417 }//book
void book1D(std::string name, int n, double min, double max)
void bookPf(std::string name, HistLim limX, HistLim limY)
void book2D(std::string name, HistLim limX, HistLim limY)
void HcalDigisValidation::bookPf ( std::string  name,
HistLim  limX,
HistLim  limY 
)
private

Definition at line 963 of file HcalDigisValidation.cc.

References DQMStore::bookProfile(), dbe_, HcalDigisValidation::HistLim::max, HcalDigisValidation::HistLim::min, msm_, HcalDigisValidation::HistLim::n, and mergeVDriftHistosByStation::name.

Referenced by booking().

963  {
964  if (!msm_->count(name)) (*msm_)[name] = dbe_->bookProfile(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max);
965 }
std::map< std::string, MonitorElement * > * msm_
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1036
void HcalDigisValidation::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 931 of file HcalDigisValidation.cc.

931  {
932  // if (outputFile_.size() != 0 && dbe_) dbe_->save(outputFile_);
933 }
void HcalDigisValidation::endRun ( void  )
private

Definition at line 939 of file HcalDigisValidation.cc.

939  {
940 
941 }
void HcalDigisValidation::eval_occupancy ( )
private

Definition at line 839 of file HcalDigisValidation.cc.

References gather_cfg::cout, fill1D(), MonitorElement::getBinContent(), i, j, monitor(), nevtot, MonitorElement::setBinContent(), AlCaHLTBitMon_QueryRunRegistry::string, and subdet_.

839  {
840 
841  std::string strtmp;
842  HistLim ietaLim(82, -41., 41.);
843 
844  int nx = 82;
845  int ny = 72;
846  float cnorm;
847  float fev = float (nevtot);
848  std::cout << "*** nevtot " << nevtot << std::endl;
849 
850  float sumphi_1, sumphi_2, sumphi_3, sumphi_4;
851  float phi_factor;
852 
853  for (int i = 1; i <= nx; i++) {
854  sumphi_1 = 0.;
855  sumphi_2 = 0.;
856  sumphi_3 = 0.;
857  sumphi_4 = 0.;
858 
859  for (int j = 1; j <= ny; j++) {
860 
861  // occupancies
862 
863  strtmp = "HcalDigiTask_ieta_iphi_occupancy_map_depth1_" + subdet_;
864  cnorm = monitor(strtmp)->getBinContent(i, j) / fev;
865  monitor(strtmp)->setBinContent(i, j, cnorm);
866  sumphi_1 += monitor(strtmp)->getBinContent(i, j);
867 
868  strtmp = "HcalDigiTask_ieta_iphi_occupancy_map_depth2_" + subdet_;
869  cnorm = monitor(strtmp)->getBinContent(i, j) / fev;
870  monitor(strtmp)->setBinContent(i, j, cnorm);
871  sumphi_2 += monitor(strtmp)->getBinContent(i, j);
872 
873  strtmp = "HcalDigiTask_ieta_iphi_occupancy_map_depth3_" + subdet_;
874  cnorm = monitor(strtmp)->getBinContent(i, j) / fev;
875  monitor(strtmp)->setBinContent(i, j, cnorm);
876  sumphi_3 += monitor(strtmp)->getBinContent(i, j);
877 
878  strtmp = "HcalDigiTask_ieta_iphi_occupancy_map_depth4_" + subdet_;
879  cnorm = monitor(strtmp)->getBinContent(i, j) / fev;
880  monitor(strtmp)->setBinContent(i, j, cnorm);
881  sumphi_4 += monitor(strtmp)->getBinContent(i, j);
882 
883  }
884 
885  int ieta = i - 42; // -41 -1, 0 40
886  if (ieta >= 0) ieta += 1; // -41 -1, 1 41 - to make it detector-like
887 
888  if (ieta >= -20 && ieta <= 20) {
889  phi_factor = 72.;
890  } else {
891  if (ieta >= 40 || ieta <= -40) {
892  phi_factor = 18.;
893  } else
894  phi_factor = 36.;
895  }
896 
897 
898  if (ieta >= 0) ieta -= 1; // -41 -1, 0 40 - to bring back to strtmp num !!!
899  double deta = double(ieta);
900 
901  // occupancies vs ieta
902  cnorm = sumphi_1 / phi_factor;
903  strtmp = "HcalDigiTask_occupancy_vs_ieta_depth1_" + subdet_;
904  fill1D(strtmp, deta, cnorm);
905 
906  cnorm = sumphi_2 / phi_factor;
907  strtmp = "HcalDigiTask_occupancy_vs_ieta_depth2_" + subdet_;
908  fill1D(strtmp, deta, cnorm);
909 
910  cnorm = sumphi_3 / phi_factor;
911  strtmp = "HcalDigiTask_occupancy_vs_ieta_depth3_" + subdet_;
912  fill1D(strtmp, deta, cnorm);
913 
914  cnorm = sumphi_4 / phi_factor;
915  strtmp = "HcalDigiTask_occupancy_vs_ieta_depth4_" + subdet_;
916  fill1D(strtmp, deta, cnorm);
917 
918  } // end of i-loop
919 
920 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * monitor(std::string name)
int j
Definition: DBlmapReader.cc:9
void fill1D(std::string name, double X, double weight=1)
double getBinContent(int binx) const
get content of bin (1-D)
tuple cout
Definition: gather_cfg.py:121
void HcalDigisValidation::fill1D ( std::string  name,
double  X,
double  weight = 1 
)
private

Definition at line 951 of file HcalDigisValidation.cc.

References msm_.

Referenced by analyze(), eval_occupancy(), and reco().

951  {
952  msm_->find(name)->second->Fill(X, weight);
953 }
#define X(str)
Definition: MuonsGrabber.cc:49
std::map< std::string, MonitorElement * > * msm_
int weight
Definition: histoStyle.py:50
void HcalDigisValidation::fill2D ( std::string  name,
double  X,
double  Y,
double  weight = 1 
)
private

Definition at line 959 of file HcalDigisValidation.cc.

References msm_.

Referenced by reco().

959  {
960  msm_->find(name)->second->Fill(X, Y, weight);
961 }
#define X(str)
Definition: MuonsGrabber.cc:49
std::map< std::string, MonitorElement * > * msm_
int weight
Definition: histoStyle.py:50
void HcalDigisValidation::fillPf ( std::string  name,
double  X,
double  Y 
)
private

Definition at line 967 of file HcalDigisValidation.cc.

References msm_.

Referenced by reco().

967  {
968  msm_->find(name)->second->Fill(X, Y);
969 }
#define X(str)
Definition: MuonsGrabber.cc:49
std::map< std::string, MonitorElement * > * msm_
MonitorElement * HcalDigisValidation::monitor ( std::string  name)
private

Definition at line 971 of file HcalDigisValidation.cc.

References msm_, and NULL.

Referenced by eval_occupancy().

971  {
972  if (!msm_->count(name)) return NULL;
973  else return msm_->find(name)->second;
974 }
#define NULL
Definition: scimark2.h:8
std::map< std::string, MonitorElement * > * msm_
template<class Digi >
void HcalDigisValidation::reco ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 468 of file HcalDigisValidation.cc.

References HcalCoderDb::adc2fC(), conditions, HcalDetId::depth(), reco_application_2006_simpleTBanalysis_cfg::digiCollection, fill1D(), fill2D(), fillPf(), edm::Event::getByLabel(), HcalGainWidth::getValue(), HcalGain::getValue(), HcalPedestalWidth::getWidth(), i, HcalDetId::ieta(), cuy::ii, inputTag_, mc_, mode_, nevent1, nevent2, nevent3, nevent4, noise_, HcalCalibrations::pedestal(), edm::Handle< T >::product(), str(), AlCaHLTBitMon_QueryRunRegistry::string, HcalDetId::subdet(), and subdet_.

468  {
469 
470 
471  // HistLim =============================================================
472 
473  std::string strtmp;
474 
475  // ======================================================================
476  using namespace edm;
479 
480  // ADC2fC
481  HcalCalibrations calibrations;
482  CaloSamples tool;
484 // std::cout << "***************RECO*****************" << std::endl;
485  int isubdet = 0;
486  if (subdet_ == "HB") isubdet = 1;
487  if (subdet_ == "HE") isubdet = 2;
488  if (subdet_ == "HO") isubdet = 3;
489  if (subdet_ == "HF") isubdet = 4;
490 
491  if (isubdet == 1) nevent1++;
492  if (isubdet == 2) nevent2++;
493  if (isubdet == 3) nevent3++;
494  if (isubdet == 4) nevent4++;
495 
496  int indigis = 0;
497  // amplitude for signal cell at diff. depths
498  double ampl1_c = 0.;
499  double ampl2_c = 0.;
500  double ampl3_c = 0.;
501  double ampl4_c = 0.;
502  double ampl_c = 0.;
503 
504  // is set to 1 if "seed" SimHit is found
505  int seedSimHit = 0;
506 
507  // std::cout << " HcalDigiTester::reco : "
508  // << "subdet=" << subdet << " noise="<< noise_ << std::endl;
509 
510  int ieta_Sim = 9999;
511  int iphi_Sim = 9999;
512  double emax_Sim = -9999.;
513 
514 
515  // SimHits MC only
516  if (mc_ == "yes") {
518  iEvent.getByLabel("g4SimHits", "HcalHits", hcalHits);
519  const edm::PCaloHitContainer * simhitResult = hcalHits.product();
520 
521  if (isubdet != 0 && noise_ == 0) { // signal only SimHits
522 
523  for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
524 
525  HcalDetId cell(simhits->id());
526  double en = simhits->energy();
527  int sub = cell.subdet();
528  int ieta = cell.ieta();
529  if (ieta > 0) ieta--;
530  int iphi = cell.iphi() - 1;
531 
532 
533  if (en > emax_Sim && sub == isubdet) {
534  emax_Sim = en;
535  ieta_Sim = ieta;
536  iphi_Sim = iphi;
537  // to limit "seed" SimHit energy in case of "multi" event
538  if (mode_ == "multi" &&
539  ((sub == 4 && en < 100. && en > 1.)
540  || ((sub != 4) && en < 1. && en > 0.02))) {
541  seedSimHit = 1;
542  break;
543  }
544  }
545 
546  } // end of SimHits cycle
547 
548 
549  // found highest-energy SimHit for single-particle
550  if (mode_ != "multi" && emax_Sim > 0.) seedSimHit = 1;
551  } // end of SimHits
552  }// end of mc_ == "yes"
553 
554  // CYCLE OVER CELLS ========================================================
555  int Ndig = 0;
556 
557  /*
558  std::cout << " HcalDigiTester::reco : nevent 1,2,3,4 = "
559  << nevent1 << " " << nevent2 << " " << nevent3 << " "
560  << nevent4 << std::endl;
561  */
562 
563  for (digiItr = digiCollection->begin(); digiItr != digiCollection->end(); digiItr++) {
564 
565  HcalDetId cell(digiItr->id());
566  int depth = cell.depth();
567  int iphi = cell.iphi() - 1;
568  int ieta = cell.ieta();
569  if (ieta > 0) ieta--;
570  int sub = cell.subdet();
571 
572 
573  // amplitude for signal cell at diff. depths
574  double ampl = 0.;
575  double ampl1 = 0.;
576  double ampl2 = 0.;
577  double ampl3 = 0.;
578  double ampl4 = 0.;
579 
580 
581  // Gains, pedestals (once !) and only for "noise" case
582  if (((nevent1 == 1 && isubdet == 1) ||
583  (nevent2 == 1 && isubdet == 2) ||
584  (nevent3 == 1 && isubdet == 3) ||
585  (nevent4 == 1 && isubdet == 4)) && noise_ == 1 && sub == isubdet) {
586 
587  HcalGenericDetId hcalGenDetId(digiItr->id());
588  const HcalPedestal* pedestal = conditions->getPedestal(hcalGenDetId);
589  const HcalGain* gain = conditions->getGain(hcalGenDetId);
590  const HcalGainWidth* gainWidth = conditions->getGainWidth(hcalGenDetId);
591  const HcalPedestalWidth* pedWidth = conditions-> getPedestalWidth(hcalGenDetId);
592 
593  for (int i = 0; i < 4; i++) {
594  fill1D("HcalDigiTask_gain_capId" + str(i) + "_Depth" + str(depth) + "_" + subdet_, gain->getValue(i));
595  fill1D("HcalDigiTask_gainWidth_capId" + str(i) + "_Depth" + str(depth) + "_" + subdet_, gainWidth->getValue(i));
596  fill1D("HcalDigiTask_pedestal_capId" + str(i) + "_Depth" + str(depth) + "_" + subdet_, pedestal->getValue(i));
597  fill1D("HcalDigiTask_pedestal_width_capId" + str(i) + "_Depth" + str(depth) + "_" + subdet_, pedWidth->getWidth(i));
598  }
599 
600  fill2D("HcalDigiTask_gainMap_Depth" + str(depth) + "_" + subdet_, double(ieta), double(iphi), gain->getValue(0));
601  fill2D("HcalDigiTask_pwidthMap_Depth" + str(depth) + "_" + subdet_, double(ieta), double(iphi), pedWidth->getWidth(0));
602 
603  }// end of event #1
604  //std::cout << "==== End of event noise block in cell cycle" << std::endl;
605 
606  if (sub == isubdet) Ndig++; // subdet number of digi
607 
608  // No-noise case, only single subdet selected ===========================
609 
610  if (sub == isubdet && noise_ == 0) {
611 
612 
613  HcalCalibrations calibrations = conditions->getHcalCalibrations(cell);
614 
615  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
616  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
617  HcalCoderDb coder(*channelCoder, *shape);
618  coder.adc2fC(*digiItr, tool);
619 
620  double noiseADC = (*digiItr)[0].adc();
621  double noisefC = tool[0];
622  // noise evaluations from "pre-samples"
623  fill1D("HcalDigiTask_ADC0_adc_depth" + str(depth) + "_" + subdet_, noiseADC);
624  fill1D("HcalDigiTask_ADC0_fC_depth" + str(depth) + "_" + subdet_, noisefC);
625 
626 
627  // OCCUPANCY maps fill
628  fill2D("HcalDigiTask_ieta_iphi_occupancy_map_depth" + str(depth) + "_" + subdet_, double(ieta), double(iphi));
629 
630  // Cycle on time slices
631  // - for each Digi
632  // - for one Digi with max SimHits E in subdet
633 
634 
635  int closen = 0; // =1 if 1) seedSimHit = 1 and 2) the cell is the same
636  if (ieta == ieta_Sim && iphi == iphi_Sim) closen = seedSimHit;
637 
638  for (int ii = 0; ii < tool.size(); ii++) {
639  int capid = (*digiItr)[ii].capid();
640  // single ts amplitude
641  double val = (tool[ii] - calibrations.pedestal(capid));
642 /*
643  if (val > 10.) {
644  if (depth == 1) strtmp = "HcalDigiTask_all_amplitudes_vs_bin_depth1_" + subdet_;
645  else strtmp = "HcalDigiTask_all_amplitudes_vs_bin_depth2_" + subdet_;
646  fill2D(strtmp, double(ii), val);
647  }
648 */
649  if (val > 100.) {
650  if (depth == 1) strtmp = "HcalDigiTask_all_amplitudes_vs_bin_1D_depth1_" + subdet_;
651  else strtmp = "HcalDigiTask_all_amplitudes_vs_bin_1D_depth2_" + subdet_;
652  fill1D(strtmp, double(ii), val);
653  }
654 
655  if (closen == 1) {
656  strtmp = "HcalDigiTask_signal_amplitude_vs_bin_all_depths_" + subdet_;
657  fill2D(strtmp, double(ii), val);
658  }
659 
660 
661  // HB/HE/HO
662  if (isubdet != 4 && ii >= 4 && ii <= 7) {
663  ampl += val;
664  if (depth == 1) ampl1 += val;
665  if (depth == 2) ampl2 += val;
666  if (depth == 3) ampl3 += val;
667  if (depth == 4) ampl4 += val;
668 
669  if (closen == 1) {
670  ampl_c += val;
671  if (depth == 1) ampl1_c += val;
672  if (depth == 2) ampl2_c += val;
673  if (depth == 3) ampl3_c += val;
674  if (depth == 4) ampl4_c += val;
675  }
676  }
677 
678  // HF
679  if (isubdet == 4 && ii >= 2 && ii <= 4) {
680  ampl += val;
681  if (depth == 1) ampl1 += val;
682  if (depth == 2) ampl2 += val;
683  if (depth == 3) ampl3 += val;
684  if (depth == 4) ampl4 += val;
685  if (closen == 1) {
686  ampl_c += val;
687  if (depth == 1) ampl1_c += val;
688  if (depth == 2) ampl2_c += val;
689  if (depth == 3) ampl3_c += val;
690  if (depth == 4) ampl4_c += val;
691 
692  }
693  }
694  }
695  // end of time bucket sample
696 
697 
698  // maps of sum of amplitudes (sum lin.digis(4,5,6,7) - ped) all depths
699 /*
700  strtmp = "HcalDigiTask_ieta_iphi_map_of_amplitudes_fC_depth1_" + subdet_;
701  fill2D(strtmp, double(ieta), double(iphi), ampl1);
702  strtmp = "HcalDigiTask_ieta_iphi_map_of_amplitudes_fC_depth2_" + subdet_;
703  fill2D(strtmp, double(ieta), double(iphi), ampl2);
704  strtmp = "HcalDigiTask_ieta_iphi_map_of_amplitudes_fC_depth3_" + subdet_;
705  fill2D(strtmp, double(ieta), double(iphi), ampl3);
706  strtmp = "HcalDigiTask_ieta_iphi_map_of_amplitudes_fC_depth4_" + subdet_;
707  fill2D(strtmp, double(ieta), double(iphi), ampl4);
708 */
709  // just 1D of all cells' amplitudes
710  strtmp = "HcalDigiTask_sum_all_amplitudes_" + subdet_;
711  fill1D(strtmp, ampl);
712 
713 
714  if (ampl1 > 10. || ampl2 > 10. || ampl3 > 10. || ampl4 > 10.) indigis++;
715 
716  // fraction 5,6 bins if ampl. is big.
717  if (ampl1 > 30. && depth == 1 && closen == 1 && isubdet != 4) {
718  double fBin5 = tool[4] - calibrations.pedestal((*digiItr)[4].capid());
719  double fBin67 = tool[5] + tool[6]
720  - calibrations.pedestal((*digiItr)[5].capid())
721  - calibrations.pedestal((*digiItr)[6].capid());
722 
723  fBin5 /= ampl1;
724  fBin67 /= ampl1;
725 
726  strtmp = "HcalDigiTask_bin_5_frac_" + subdet_;
727  fill1D(strtmp, fBin5);
728  strtmp = "HcalDigiTask_bin_6_7_frac_" + subdet_;
729  fill1D(strtmp, fBin67);
730 
731  }
732 
733  //Special for HF
734  if (isubdet == 4 && ampl1 > 30. && depth == 1) {
735  double fBin5 = tool[2] - calibrations.pedestal((*digiItr)[2].capid());
736  double fBin67 = tool[3] + tool[4]
737  - calibrations.pedestal((*digiItr)[3].capid())
738  - calibrations.pedestal((*digiItr)[4].capid());
739  fBin5 /= ampl1;
740  fBin67 /= ampl1;
741  strtmp = "HcalDigiTask_bin_5_frac_" + subdet_;
742  fill1D(strtmp, fBin5);
743  strtmp = "HcalDigiTask_bin_6_7_frac_" + subdet_;
744  fill1D(strtmp, fBin67);
745  }
746 
747 
748  strtmp = "HcalDigiTask_signal_amplitude_" + subdet_;
749  fill1D(strtmp, ampl);
750  strtmp = "HcalDigiTask_signal_amplitude_depth1_" + subdet_;
751  fill1D(strtmp, ampl1);
752  strtmp = "HcalDigiTask_signal_amplitude_depth2_" + subdet_;
753  fill1D(strtmp, ampl2);
754  strtmp = "HcalDigiTask_signal_amplitude_depth3_" + subdet_;
755  fill1D(strtmp, ampl3);
756  strtmp = "HcalDigiTask_signal_amplitude_depth4_" + subdet_;
757  fill1D(strtmp, ampl4);
758  }
759  } // End of CYCLE OVER CELLS =============================================
760 
761  if (isubdet != 0 && noise_ == 0) { // signal only, once per event
762  strtmp = "HcalDigiTask_number_of_amplitudes_above_10fC_" + subdet_;
763  fill1D(strtmp, indigis);
764 
765  // SimHits once again !!!
766  double eps = 1.e-3;
767  double ehits = 0.;
768  double ehits1 = 0.;
769  double ehits2 = 0.;
770  double ehits3 = 0.;
771  double ehits4 = 0.;
772 
773  if (mc_ == "yes") {
775  iEvent.getByLabel("g4SimHits", "HcalHits", hcalHits);
776  const edm::PCaloHitContainer * simhitResult = hcalHits.product();
777  for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end(); ++simhits) {
778 
779  HcalDetId cell(simhits->id());
780  int ieta = cell.ieta();
781  if (ieta > 0) ieta--;
782  int iphi = cell.iphi() - 1;
783  int sub = cell.subdet();
784 
785  // take cell already found to be max energy in a particular subdet
786  if (sub == isubdet && ieta == ieta_Sim && iphi == iphi_Sim) {
787  int depth = cell.depth();
788  double en = simhits->energy();
789 
790  ehits += en;
791  if (depth == 1) ehits1 += en;
792  if (depth == 2) ehits2 += en;
793  if (depth == 3) ehits3 += en;
794  if (depth == 4) ehits4 += en;
795  }
796  }
797 
798  strtmp = "HcalDigiTask_amplitude_vs_simhits_" + subdet_;
799  if (ehits > eps) fill2D(strtmp, ehits, ampl_c);
800  strtmp = "HcalDigiTask_amplitude_vs_simhits_depth1_" + subdet_;
801  if (ehits1 > eps) fill2D(strtmp, ehits1, ampl1_c);
802  strtmp = "HcalDigiTask_amplitude_vs_simhits_depth2_" + subdet_;
803  if (ehits2 > eps) fill2D(strtmp, ehits2, ampl2_c);
804  strtmp = "HcalDigiTask_amplitude_vs_simhits_depth3_" + subdet_;
805  if (ehits3 > eps) fill2D(strtmp, ehits3, ampl3_c);
806  strtmp = "HcalDigiTask_amplitude_vs_simhits_depth4_" + subdet_;
807  if (ehits4 > eps) fill2D(strtmp, ehits4, ampl4_c);
808 
809  strtmp = "HcalDigiTask_amplitude_vs_simhits_profile_" + subdet_;
810  if (ehits > eps) fillPf(strtmp, ehits, ampl_c);
811  strtmp = "HcalDigiTask_amplitude_vs_simhits_profile_depth1_" + subdet_;
812  if (ehits1 > eps) fillPf(strtmp, ehits1, ampl1_c);
813  strtmp = "HcalDigiTask_amplitude_vs_simhits_profile_depth2_" + subdet_;
814  if (ehits2 > eps) fillPf(strtmp, ehits2, ampl2_c);
815  strtmp = "HcalDigiTask_amplitude_vs_simhits_profile_depth3_" + subdet_;
816  if (ehits3 > eps) fillPf(strtmp, ehits3, ampl3_c);
817  strtmp = "HcalDigiTask_amplitude_vs_simhits_profile_depth4_" + subdet_;
818  if (ehits4 > eps) fillPf(strtmp, ehits4, ampl4_c);
819 
820  strtmp = "HcalDigiTask_ratio_amplitude_vs_simhits_" + subdet_;
821  if (ehits > eps) fill1D(strtmp, ampl_c / ehits);
822  strtmp = "HcalDigiTask_ratio_amplitude_vs_simhits_depth1_" + subdet_;
823  if (ehits1 > eps) fill1D(strtmp, ampl1_c / ehits1);
824  strtmp = "HcalDigiTask_ratio_amplitude_vs_simhits_depth2_" + subdet_;
825  if (ehits2 > eps) fill1D(strtmp, ampl2_c / ehits2);
826  strtmp = "HcalDigiTask_ratio_amplitude_vs_simhits_depth3_" + subdet_;
827  if (ehits3 > eps) fill1D(strtmp, ampl3_c / ehits3);
828  strtmp = "HcalDigiTask_ratio_amplitude_vs_simhits_depth4_" + subdet_;
829  if (ehits4 > eps) fill1D(strtmp, ampl4_c / ehits4);
830 
831  } // end of if(mc_ == "yes")
832 
833  strtmp = "HcalDigiTask_Ndigis_" + subdet_;
834  fill1D(strtmp, double(Ndig));
835 
836  } // end of if( subdet != 0 && noise_ == 0) { // signal only
837 }
int i
Definition: DBlmapReader.cc:9
std::vector< PCaloHit > PCaloHitContainer
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:32
std::vector< T >::const_iterator const_iterator
double pedestal(int fCapId) const
get pedestal for capid=0..3
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalGain.h:20
int ii
Definition: cuy.py:588
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalGainWidth.h:19
int depth() const
get the tower depth
Definition: HcalDetId.h:42
void fillPf(std::string name, double X, double Y)
void fill2D(std::string name, double X, double Y, double weight=1)
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
void fill1D(std::string name, double X, double weight=1)
float getWidth(int fCapId) const
get width (sqrt(sigma_i_i)) for capId = 0..3
T const * product() const
Definition: Handle.h:74
std::string str(int x)
edm::ESHandle< HcalDbService > conditions
std::string HcalDigisValidation::str ( int  x)
private

Definition at line 976 of file HcalDigisValidation.cc.

References dbtoconf::out, and x.

Referenced by reco().

976  {
977  std::stringstream out;
978  out << x;
979  return out.str();
980 }
tuple out
Definition: dbtoconf.py:99
Definition: DDAxes.h:10

Member Data Documentation

edm::ESHandle<HcalDbService> HcalDigisValidation::conditions
private

Definition at line 112 of file HcalDigisValidation.h.

Referenced by analyze(), and reco().

DQMStore* HcalDigisValidation::dbe_
private

Definition at line 76 of file HcalDigisValidation.h.

Referenced by book1D(), book2D(), bookPf(), and HcalDigisValidation().

std::string HcalDigisValidation::dirName_
private

Definition at line 105 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation().

edm::ESHandle<CaloGeometry> HcalDigisValidation::geometry
private
edm::InputTag HcalDigisValidation::inputTag_
private

Definition at line 106 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation(), and reco().

std::string HcalDigisValidation::mc_
private

Definition at line 108 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation(), and reco().

std::string HcalDigisValidation::mode_
private

Definition at line 107 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation(), and reco().

std::map<std::string, MonitorElement*>* HcalDigisValidation::msm_
private
int HcalDigisValidation::nevent1
private

Definition at line 113 of file HcalDigisValidation.h.

Referenced by beginJob(), and reco().

int HcalDigisValidation::nevent2
private

Definition at line 114 of file HcalDigisValidation.h.

Referenced by beginJob(), and reco().

int HcalDigisValidation::nevent3
private

Definition at line 115 of file HcalDigisValidation.h.

Referenced by beginJob(), and reco().

int HcalDigisValidation::nevent4
private

Definition at line 116 of file HcalDigisValidation.h.

Referenced by beginJob(), and reco().

int HcalDigisValidation::nevtot
private

Definition at line 117 of file HcalDigisValidation.h.

Referenced by analyze(), beginJob(), and eval_occupancy().

int HcalDigisValidation::noise_
private

Definition at line 109 of file HcalDigisValidation.h.

Referenced by analyze(), and reco().

std::string HcalDigisValidation::outputFile_
private

Definition at line 102 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation().

std::string HcalDigisValidation::subdet_
private

Definition at line 103 of file HcalDigisValidation.h.

Referenced by analyze(), booking(), eval_occupancy(), HcalDigisValidation(), and reco().

std::string HcalDigisValidation::zside_
private

Definition at line 104 of file HcalDigisValidation.h.