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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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, const HistLim &limX)
 
void book2D (std::string name, const HistLim &limX, const HistLim &limY)
 
void booking (std::string subdetopt, int bnoise, int bmc)
 
void bookPf (std::string name, const HistLim &limX, const 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, const edm::EDGetTokenT< edm::SortedCollection< Digi > > &tok)
 
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_
 
edm::EDGetTokenT
< edm::SortedCollection
< HBHEDataFrame > > 
tok_hbhe_
 
edm::EDGetTokenT
< edm::SortedCollection
< HFDataFrame > > 
tok_hf_
 
edm::EDGetTokenT
< edm::SortedCollection
< HODataFrame > > 
tok_ho_
 
edm::EDGetTokenT
< edm::PCaloHitContainer
tok_mc_
 
std::string zside_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::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 22 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, subdet_, tok_hbhe_, tok_hf_, tok_ho_, and tok_mc_.

22  {
23 
24  using namespace std;
25 
26  subdet_ = iConfig.getUntrackedParameter<std::string > ("subdetector", "all");
27  outputFile_ = iConfig.getUntrackedParameter<std::string > ("outputFile", "");
28  inputTag_ = iConfig.getParameter<edm::InputTag > ("digiLabel");
29  mc_ = iConfig.getUntrackedParameter<std::string > ("mc", "no");
30  mode_ = iConfig.getUntrackedParameter<std::string > ("mode", "multi");
31  dirName_ = iConfig.getUntrackedParameter<std::string > ("dirName", "HcalDigisV/HcalDigiTask");
32 
33  // register for data access
34  tok_mc_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "HcalHits"));
35  tok_hbhe_ = consumes<edm::SortedCollection<HBHEDataFrame> >(inputTag_);
36  tok_ho_ = consumes<edm::SortedCollection<HODataFrame> >(inputTag_);
37  tok_hf_ = consumes<edm::SortedCollection<HFDataFrame> >(inputTag_);
38 
40  msm_ = new std::map<std::string, MonitorElement*>();
41 
42  if (outputFile_.size() != 0) edm::LogInfo("OutputInfo") << " Hcal Digi Task histograms will be saved to '" << outputFile_.c_str() << "'";
43  else edm::LogInfo("OutputInfo") << " Hcal Digi Task histograms will NOT be saved";
44 
46 
47  // book
48  book1D("nevtot", 1, 0, 1);
49  int bnoise = 0;
50  int bmc = 0;
51  if (subdet_ == "noise") bnoise = 1;
52  if (mc_ == "yes") bmc = 1;
53  if (subdet_ == "noise" || subdet_ == "all") {
54  booking("HB", bnoise, bmc);
55  booking("HO", bnoise, bmc);
56  booking("HF", bnoise, bmc);
57  booking("HE", bnoise, bmc);
58  } else {
59  booking(subdet_, 0, bmc);
60  }
61 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::SortedCollection< HBHEDataFrame > > tok_hbhe_
edm::EDGetTokenT< edm::SortedCollection< HODataFrame > > tok_ho_
void book1D(std::string name, int n, double min, double max)
std::map< std::string, MonitorElement * > * msm_
edm::EDGetTokenT< edm::SortedCollection< HFDataFrame > > tok_hf_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_mc_
void booking(std::string subdetopt, int bnoise, int bmc)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
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 424 of file HcalDigisValidation.cc.

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

424  {
425  using namespace edm;
426 
427  iSetup.get<CaloGeometryRecord > ().get(geometry);
428  iSetup.get<HcalDbRecord > ().get(conditions);
429 
430  // std::cout << " >>>>> HcalDigiTester::analyze hcalselector = "
431  // << subdet_ << std::endl;
432 
433  if (subdet_ != "all") {
434  noise_ = 0;
435  if (subdet_ == "HB") reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
436  if (subdet_ == "HE") reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
437  if (subdet_ == "HO") reco<HODataFrame > (iEvent, iSetup, tok_ho_);
438  if (subdet_ == "HF") reco<HFDataFrame > (iEvent, iSetup, tok_hf_);
439 
440  if (subdet_ == "noise") {
441  noise_ = 1;
442  // std::cout << " >>>>> HcalDigiTester::analyze entering noise "
443  // << std::endl;
444  subdet_ = "HB";
445  reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
446  subdet_ = "HE";
447  reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
448  subdet_ = "HO";
449  reco<HODataFrame > (iEvent, iSetup, tok_ho_);
450  subdet_ = "HF";
451  reco<HFDataFrame > (iEvent, iSetup, tok_hf_);
452  subdet_ = "noise";
453  }
454  }// all subdetectors
455  else {
456  noise_ = 0;
457 
458  subdet_ = "HB";
459  reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
460  subdet_ = "HE";
461  reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
462  subdet_ = "HO";
463  reco<HODataFrame > (iEvent, iSetup, tok_ho_);
464  subdet_ = "HF";
465  reco<HFDataFrame > (iEvent, iSetup, tok_hf_);
466  subdet_ = "all";
467  }
468 
469  fill1D("nevtot", 0);
470  nevtot++;
471 }
edm::ESHandle< CaloGeometry > geometry
edm::EDGetTokenT< edm::SortedCollection< HBHEDataFrame > > tok_hbhe_
edm::EDGetTokenT< edm::SortedCollection< HODataFrame > > tok_ho_
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< edm::SortedCollection< HFDataFrame > > tok_hf_
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 927 of file HcalDigisValidation.cc.

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

927  {
928  nevent1 = 0;
929  nevent2 = 0;
930  nevent3 = 0;
931  nevent4 = 0;
932 
933  nevtot = 0;
934 }
void HcalDigisValidation::beginRun ( void  )
private

Definition at line 940 of file HcalDigisValidation.cc.

940  {
941 
942 }
void HcalDigisValidation::book1D ( std::string  name,
int  n,
double  min,
double  max 
)
private

Definition at line 948 of file HcalDigisValidation.cc.

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

Referenced by booking(), and HcalDigisValidation().

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

Definition at line 952 of file HcalDigisValidation.cc.

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

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

Definition at line 960 of file HcalDigisValidation.cc.

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

Referenced by booking().

960  {
961  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);
962 }
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:1070
void HcalDigisValidation::booking ( std::string  subdetopt,
int  bnoise,
int  bmc 
)
private

Definition at line 63 of file HcalDigisValidation.cc.

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

Referenced by HcalDigisValidation().

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

Definition at line 968 of file HcalDigisValidation.cc.

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

Referenced by booking().

968  {
969  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);
970 }
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:1256
void HcalDigisValidation::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 936 of file HcalDigisValidation.cc.

936  {
937  // if (outputFile_.size() != 0 && dbe_) dbe_->save(outputFile_);
938 }
void HcalDigisValidation::endRun ( void  )
private

Definition at line 944 of file HcalDigisValidation.cc.

944  {
945 
946 }
void HcalDigisValidation::eval_occupancy ( )
private

Definition at line 844 of file HcalDigisValidation.cc.

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

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

References msm_.

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

956  {
957  msm_->find(name)->second->Fill(X, weight);
958 }
#define X(str)
Definition: MuonsGrabber.cc:48
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 964 of file HcalDigisValidation.cc.

References msm_.

Referenced by reco().

964  {
965  msm_->find(name)->second->Fill(X, Y, weight);
966 }
#define X(str)
Definition: MuonsGrabber.cc:48
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 972 of file HcalDigisValidation.cc.

References msm_.

Referenced by reco().

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

Definition at line 976 of file HcalDigisValidation.cc.

References msm_, and NULL.

Referenced by eval_occupancy().

976  {
977  if (!msm_->count(name)) return NULL;
978  else return msm_->find(name)->second;
979 }
#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,
const edm::EDGetTokenT< edm::SortedCollection< Digi > > &  tok 
)
private

Definition at line 473 of file HcalDigisValidation.cc.

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

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

Definition at line 981 of file HcalDigisValidation.cc.

References dbtoconf::out, and x.

Referenced by reco().

981  {
982  std::stringstream out;
983  out << x;
984  return out.str();
985 }
tuple out
Definition: dbtoconf.py:99
Definition: DDAxes.h:10

Member Data Documentation

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

Definition at line 117 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().

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 118 of file HcalDigisValidation.h.

Referenced by beginJob(), and reco().

int HcalDigisValidation::nevent2
private

Definition at line 119 of file HcalDigisValidation.h.

Referenced by beginJob(), and reco().

int HcalDigisValidation::nevent3
private

Definition at line 120 of file HcalDigisValidation.h.

Referenced by beginJob(), and reco().

int HcalDigisValidation::nevent4
private

Definition at line 121 of file HcalDigisValidation.h.

Referenced by beginJob(), and reco().

int HcalDigisValidation::nevtot
private

Definition at line 122 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().

edm::EDGetTokenT<edm::SortedCollection<HBHEDataFrame> > HcalDigisValidation::tok_hbhe_
private

Definition at line 112 of file HcalDigisValidation.h.

Referenced by analyze(), and HcalDigisValidation().

edm::EDGetTokenT<edm::SortedCollection<HFDataFrame> > HcalDigisValidation::tok_hf_
private

Definition at line 114 of file HcalDigisValidation.h.

Referenced by analyze(), and HcalDigisValidation().

edm::EDGetTokenT<edm::SortedCollection<HODataFrame> > HcalDigisValidation::tok_ho_
private

Definition at line 113 of file HcalDigisValidation.h.

Referenced by analyze(), and HcalDigisValidation().

edm::EDGetTokenT<edm::PCaloHitContainer> HcalDigisValidation::tok_mc_
private

Definition at line 111 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation(), and reco().

std::string HcalDigisValidation::zside_
private

Definition at line 104 of file HcalDigisValidation.h.