51 void analyzeDigi(
const T&,
double const&,
bool const&,
int const&,
unsigned int&);
74 iSample_(ps.getUntrackedParameter<
int>(
"Sample", 5)),
75 geomType_(ps.getUntrackedParameter<
int>(
"GeometryType", 0)),
76 threshold_(ps.getUntrackedParameter<double>(
"Threshold", 12.0)),
100 descriptions.
add(
"hgcalBHAnalysis", desc);
109 const std::vector<int> etaM = hpar->
etaMax;
112 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalBHValidation::Maximum Number of" 113 <<
" eta sectors:" <<
etaMax_ <<
"\nHitsValidationHcal::Booking the Histograms";
116 hsimE1_ =
fs_->
make<TH1D>(
"SimHitEn1",
"Sim Hit Energy", 1000, 0.0, 1.0);
117 hsimE2_ =
fs_->
make<TH1D>(
"SimHitEn2",
"Sim Hit Energy", 1000, 0.0, 1.0);
118 hsimTm_ =
fs_->
make<TH1D>(
"SimHitTime",
"Sim Hit Time", 1000, 0.0, 500.0);
119 hsimLn_ =
fs_->
make<TH1D>(
"SimHitLong",
"Sim Hit Long. Profile", 40, 0.0, 20.0);
121 hsi2Oc_ =
fs_->
make<TH2D>(
"SimHitOccu2",
"Sim Hit Occupnacy", 2 * etaMax_ + 1, -
etaMax_, etaMax_ + 1, 360, 0, 360);
122 hsi3Oc_ =
fs_->
make<TH2D>(
"SimHitOccu3",
"Sim Hit Occupnacy", 2 * etaMax_ + 1, -
etaMax_, etaMax_ + 1, 40, 0, 20);
124 hdigEn_ =
fs_->
make<TH1D>(
"DigiEnergy",
"Digi ADC Sample", 1000, 0.0, 1000.0);
125 hdigLn_ =
fs_->
make<TH1D>(
"DigiLong",
"Digi Long. Profile", 40, 0.0, 20.0);
126 hdigOc_ =
fs_->
make<TH2D>(
"DigiOccup",
"Digi Occupnacy", 2 * etaMax_ + 1, -
etaMax_, etaMax_ + 1, 360, 0, 360);
127 hdi2Oc_ =
fs_->
make<TH2D>(
"DigiOccu2",
"Digi Occupnacy", 2 * etaMax_ + 1, -
etaMax_, etaMax_ + 1, 360, 0, 360);
128 hdi3Oc_ =
fs_->
make<TH2D>(
"DigiOccu3",
"Digi Occupnacy", 2 * etaMax_ + 1, -
etaMax_, etaMax_ + 1, 40, 0, 20);
137 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalBHValidation.: PCaloHitContainer" 138 <<
" obtained with flag " << hitsHcal.
isValid();
140 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalBHValidation: PCaloHit buffer " << hitsHcal->size();
142 std::map<unsigned int, double> map_try;
143 for (edm::PCaloHitContainer::const_iterator it = hitsHcal->begin(); it != hitsHcal->end(); ++it) {
144 double energy = it->energy();
145 double time = it->time();
146 unsigned int id = it->id();
154 bh = (subdet ==
static_cast<int>(
HcalEndcap));
164 hsi2Oc_->Fill((eta + 0.1), (phi - 0.1), energy);
168 hsimOc_->Fill((eta + 0.1), (phi - 0.1), energy);
170 hsi3Oc_->Fill((eta + 0.1), lay, energy);
172 if (map_try.count(
id) != 0)
178 <<
"HGCalBHHit[" << i <<
"] ID " << std::hex <<
" " <<
id <<
std::dec <<
" SubDet " << subdet <<
" depth " 179 << depth <<
" Eta " << eta <<
" Phi " << phi <<
" layer " << lay <<
" E " << energy <<
" time " <<
time;
182 for (std::map<unsigned int, double>::iterator itr = map_try.begin(); itr != map_try.end(); ++itr) {
188 unsigned int kount(0);
193 <<
"HBHEQIE11DigiCollection obtained " 194 <<
"with flag " << hbhecoll.
isValid();
197 <<
"buffer " << hbhecoll->
size();
202 ((cell.subdetId() ==
static_cast<int>(
HcalEndcap)) || (cell.subdetId() ==
static_cast<int>(
HcalBarrel)));
204 bool bh = (cell.subdetId() ==
static_cast<int>(
HcalEndcap));
205 int depth = cell.depth();
215 <<
"HGCalDigiCollection obtained with" 216 <<
" flag " << hbhecoll.
isValid();
219 <<
"buffer " << hbhecoll->
size();
226 ((cell.subdetId() ==
static_cast<int>(
HcalEndcap)) || (cell.subdetId() ==
static_cast<int>(
HcalBarrel)));
228 bool bh = (cell.subdetId() ==
static_cast<int>(
HcalEndcap));
229 int depth = cell.depth();
236 int depth = cell.layer();
247 const T& cell,
double const&
energy,
bool const& bh,
int const&
depth,
unsigned int& kount) {
249 int eta = cell.ieta();
250 int phi = cell.iphi();
251 hdi2Oc_->Fill((eta + 0.1), (phi - 0.1));
254 hdigOc_->Fill((eta + 0.1), (phi - 0.1));
256 hdi3Oc_->Fill((eta + 0.1), depth);
259 <<
"HGCalBHDigit[" << kount <<
"] ID " << cell <<
" E " << energy <<
":" << (energy >
threshold_);
static const std::string kSharedResource
EventNumber_t event() const
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
const std::vector< S > & data() const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
virtual void beginJob() override
~HGCalBHValidation() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< T >::const_iterator const_iterator
T * make(const Args &...args) const
make new ROOT object
const_iterator begin() const
std::vector< int > etaMax
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::string g4Label_
#define DEFINE_FWK_MODULE(type)
edm::Service< TFileService > fs_
HGCalBHValidation(const edm::ParameterSet &ps)
edm::DataFrame::id_type id() const
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
int iphi() const
get the phi index
const D & id() const
det id
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
const_iterator end() const
const edm::InputTag hcalDigis_
virtual void analyze(edm::Event const &, edm::EventSetup const &) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetToken tok_hbhe_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
int layer() const
get the layer #
const_iterator end() const
const std::string hcalHits_
const_iterator begin() const
constexpr Detector det() const
get the detector field from this detid
void analyzeDigi(const T &, double const &, bool const &, int const &, unsigned int &)