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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  HistLim
 

Public Member Functions

virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
 
 HcalDigisValidation (const edm::ParameterSet &)
 
 ~HcalDigisValidation ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 &)
 
void beginRun ()
 
void book1D (DQMStore::IBooker &ib, std::string name, int n, double min, double max)
 
void book1D (DQMStore::IBooker &ib, std::string name, const HistLim &limX)
 
void book2D (DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)
 
void booking (DQMStore::IBooker &ib, std::string subdetopt, int bnoise, int bmc)
 
void bookPf (DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)
 
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
 
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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 dirName_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLT_25ns14e33_v1_cff::InputTag, inputTag_, mc_, mode_, msm_, nevent1, nevent2, nevent3, nevent4, nevtot, outputFile_, 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 
39  nevent1 = 0;
40  nevent2 = 0;
41  nevent3 = 0;
42  nevent4 = 0;
43  nevtot = 0;
44 
45  msm_ = new std::map<std::string, MonitorElement*>();
46 
47  if (outputFile_.size() != 0) edm::LogInfo("OutputInfo") << " Hcal Digi Task histograms will be saved to '" << outputFile_.c_str() << "'";
48  else edm::LogInfo("OutputInfo") << " Hcal Digi Task histograms will NOT be saved";
49 
50 }
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_
std::map< std::string, MonitorElement * > * msm_
edm::EDGetTokenT< edm::SortedCollection< HFDataFrame > > tok_hf_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_mc_
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::stream::EDAnalyzerBase.

Definition at line 435 of file HcalDigisValidation.cc.

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

435  {
436  using namespace edm;
437 
438  iSetup.get<CaloGeometryRecord > ().get(geometry);
439  iSetup.get<HcalDbRecord > ().get(conditions);
440 
441  // std::cout << " >>>>> HcalDigiTester::analyze hcalselector = "
442  // << subdet_ << std::endl;
443 
444  if (subdet_ != "all") {
445  noise_ = 0;
446  if (subdet_ == "HB") reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
447  if (subdet_ == "HE") reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
448  if (subdet_ == "HO") reco<HODataFrame > (iEvent, iSetup, tok_ho_);
449  if (subdet_ == "HF") reco<HFDataFrame > (iEvent, iSetup, tok_hf_);
450 
451  if (subdet_ == "noise") {
452  noise_ = 1;
453  // std::cout << " >>>>> HcalDigiTester::analyze entering noise "
454  // << std::endl;
455  subdet_ = "HB";
456  reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
457  subdet_ = "HE";
458  reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
459  subdet_ = "HO";
460  reco<HODataFrame > (iEvent, iSetup, tok_ho_);
461  subdet_ = "HF";
462  reco<HFDataFrame > (iEvent, iSetup, tok_hf_);
463  subdet_ = "noise";
464  }
465  }// all subdetectors
466  else {
467  noise_ = 0;
468 
469  subdet_ = "HB";
470  reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
471  subdet_ = "HE";
472  reco<HBHEDataFrame > (iEvent, iSetup, tok_hbhe_);
473  subdet_ = "HO";
474  reco<HODataFrame > (iEvent, iSetup, tok_ho_);
475  subdet_ = "HF";
476  reco<HFDataFrame > (iEvent, iSetup, tok_hf_);
477  subdet_ = "all";
478  }
479 
480  fill1D("nevtot", 0);
481  nevtot++;
482 }
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::beginRun ( void  )
private

Definition at line 938 of file HcalDigisValidation.cc.

938  {
939 
940 }
void HcalDigisValidation::book1D ( DQMStore::IBooker ib,
std::string  name,
int  n,
double  min,
double  max 
)
private

Definition at line 946 of file HcalDigisValidation.cc.

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

Referenced by bookHistograms(), and booking().

946  {
947  if (!msm_->count(name)) (*msm_)[name] = ib.book1D(name.c_str(), name.c_str(), n, min, max);
948 }
std::map< std::string, MonitorElement * > * msm_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
T min(T a, T b)
Definition: MathUtil.h:58
void HcalDigisValidation::book1D ( DQMStore::IBooker ib,
std::string  name,
const HistLim limX 
)
private

Definition at line 950 of file HcalDigisValidation.cc.

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

950  {
951  if (!msm_->count(name)) (*msm_)[name] = ib.book1D(name.c_str(), name.c_str(), limX.n, limX.min, limX.max);
952 }
std::map< std::string, MonitorElement * > * msm_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void HcalDigisValidation::book2D ( DQMStore::IBooker ib,
std::string  name,
const HistLim limX,
const HistLim limY 
)
private

Definition at line 958 of file HcalDigisValidation.cc.

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

Referenced by booking().

958  {
959  if (!msm_->count(name)) (*msm_)[name] = ib.book2D(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max);
960 }
std::map< std::string, MonitorElement * > * msm_
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void HcalDigisValidation::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  run,
edm::EventSetup const &  es 
)
virtual

Implements DQMEDAnalyzer.

Definition at line 52 of file HcalDigisValidation.cc.

References book1D(), booking(), dirName_, mc_, DQMStore::IBooker::setCurrentFolder(), and subdet_.

53 {
54 
56 
57  // book
58  book1D(ib,"nevtot", 1, 0, 1);
59  int bnoise = 0;
60  int bmc = 0;
61  if (subdet_ == "noise") bnoise = 1;
62  if (mc_ == "yes") bmc = 1;
63  if (subdet_ == "noise" || subdet_ == "all") {
64  booking(ib,"HB", bnoise, bmc);
65  booking(ib,"HO", bnoise, bmc);
66  booking(ib,"HF", bnoise, bmc);
67  booking(ib,"HE", bnoise, bmc);
68  } else {
69  booking(ib,subdet_, 0, bmc);
70  }
71 
72 }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void booking(DQMStore::IBooker &ib, std::string subdetopt, int bnoise, int bmc)
void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max)
void HcalDigisValidation::booking ( DQMStore::IBooker ib,
std::string  subdetopt,
int  bnoise,
int  bmc 
)
private

Definition at line 74 of file HcalDigisValidation.cc.

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

Referenced by bookHistograms().

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

Definition at line 966 of file HcalDigisValidation.cc.

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

Referenced by booking().

966  {
967  if (!msm_->count(name)) (*msm_)[name] = ib.bookProfile(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max);
968 }
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
std::map< std::string, MonitorElement * > * msm_
void HcalDigisValidation::endRun ( void  )
private

Definition at line 942 of file HcalDigisValidation.cc.

942  {
943 
944 }
void HcalDigisValidation::eval_occupancy ( )
private

Definition at line 855 of file HcalDigisValidation.cc.

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

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

References msm_.

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

954  {
955  msm_->find(name)->second->Fill(X, weight);
956 }
#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 962 of file HcalDigisValidation.cc.

References msm_.

Referenced by reco().

962  {
963  msm_->find(name)->second->Fill(X, Y, weight);
964 }
#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 970 of file HcalDigisValidation.cc.

References msm_.

Referenced by reco().

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

Definition at line 974 of file HcalDigisValidation.cc.

References msm_, and NULL.

Referenced by eval_occupancy().

974  {
975  if (!msm_->count(name)) return NULL;
976  else return msm_->find(name)->second;
977 }
#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 484 of file HcalDigisValidation.cc.

References HcalCoderDb::adc2fC(), conditions, HLT_25ns14e33_v1_cff::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_.

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

Definition at line 979 of file HcalDigisValidation.cc.

References dbtoconf::out, and x.

Referenced by reco().

979  {
980  std::stringstream out;
981  out << x;
982  return out.str();
983 }
tuple out
Definition: dbtoconf.py:99

Member Data Documentation

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

Definition at line 114 of file HcalDigisValidation.h.

Referenced by analyze(), and reco().

std::string HcalDigisValidation::dirName_
private

Definition at line 102 of file HcalDigisValidation.h.

Referenced by bookHistograms(), and HcalDigisValidation().

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

Definition at line 103 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation().

std::string HcalDigisValidation::mc_
private

Definition at line 105 of file HcalDigisValidation.h.

Referenced by bookHistograms(), HcalDigisValidation(), and reco().

std::string HcalDigisValidation::mode_
private

Definition at line 104 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation(), and reco().

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

Definition at line 115 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation(), and reco().

int HcalDigisValidation::nevent2
private

Definition at line 116 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation(), and reco().

int HcalDigisValidation::nevent3
private

Definition at line 117 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation(), and reco().

int HcalDigisValidation::nevent4
private

Definition at line 118 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation(), and reco().

int HcalDigisValidation::nevtot
private

Definition at line 119 of file HcalDigisValidation.h.

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

int HcalDigisValidation::noise_
private

Definition at line 106 of file HcalDigisValidation.h.

Referenced by analyze(), and reco().

std::string HcalDigisValidation::outputFile_
private

Definition at line 99 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation().

std::string HcalDigisValidation::subdet_
private
edm::EDGetTokenT<edm::SortedCollection<HBHEDataFrame> > HcalDigisValidation::tok_hbhe_
private

Definition at line 109 of file HcalDigisValidation.h.

Referenced by analyze(), and HcalDigisValidation().

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

Definition at line 111 of file HcalDigisValidation.h.

Referenced by analyze(), and HcalDigisValidation().

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

Definition at line 110 of file HcalDigisValidation.h.

Referenced by analyze(), and HcalDigisValidation().

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

Definition at line 108 of file HcalDigisValidation.h.

Referenced by HcalDigisValidation(), and reco().

std::string HcalDigisValidation::zside_
private

Definition at line 101 of file HcalDigisValidation.h.