45 void analyzeDigi(
const T&,
double const&,
bool const&,
int const&,
unsigned int&);
64 : g4Label_(ps.getParameter<std::
string>(
"ModuleLabel")),
65 hits_((ps.getParameter<std::
string>(
"HitCollection"))),
66 digis_(ps.getParameter<edm::
InputTag>(
"DigiCollection")),
67 iSample_(ps.getParameter<int>(
"Sample")),
68 threshold_(ps.getParameter<double>(
"Threshold")),
75 <<
" Digits:" <<
digis_ <<
" Sample: " <<
iSample_ <<
" Threshold "
84 desc.
add<
int>(
"Sample", 5);
85 desc.
add<
double>(
"Threshold", 15.0);
86 descriptions.
add(
"hgcalBHAnalysis", desc);
90 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalBHValidation::Maximum Number of"
91 <<
" eta sectors:" <<
etaMax_ <<
"\nHitsValidationHcal::Booking the Histograms";
94 hsimE1_ =
fs_->
make<TH1D>(
"SimHitEn1",
"Sim Hit Energy", 1000, 0.0, 1.0);
95 hsimE2_ =
fs_->
make<TH1D>(
"SimHitEn2",
"Sim Hit Energy", 1000, 0.0, 1.0);
96 hsimTm_ =
fs_->
make<TH1D>(
"SimHitTime",
"Sim Hit Time", 1000, 0.0, 500.0);
97 hsimLn_ =
fs_->
make<TH1D>(
"SimHitLong",
"Sim Hit Long. Profile", 50, 0.0, 25.0);
99 hsi2Oc_ =
fs_->
make<TH2D>(
"SimHitOccu2",
"Sim Hit Occupnacy", 2 * etaMax_ + 1, -
etaMax_, etaMax_ + 1, 360, 0, 360);
100 hsi3Oc_ =
fs_->
make<TH2D>(
"SimHitOccu3",
"Sim Hit Occupnacy", 2 * etaMax_ + 1, -
etaMax_, etaMax_ + 1, 50, 0, 25);
102 hdigEn_ =
fs_->
make<TH1D>(
"DigiEnergy",
"Digi ADC Sample", 1000, 0.0, 1000.0);
103 hdigLn_ =
fs_->
make<TH1D>(
"DigiLong",
"Digi Long. Profile", 50, 0.0, 25.0);
104 hdigOc_ =
fs_->
make<TH2D>(
"DigiOccup",
"Digi Occupnacy", 2 * etaMax_ + 1, -
etaMax_, etaMax_ + 1, 360, 0, 360);
105 hdi2Oc_ =
fs_->
make<TH2D>(
"DigiOccu2",
"Digi Occupnacy", 2 * etaMax_ + 1, -
etaMax_, etaMax_ + 1, 360, 0, 360);
106 hdi3Oc_ =
fs_->
make<TH2D>(
"DigiOccu3",
"Digi Occupnacy", 2 * etaMax_ + 1, -
etaMax_, etaMax_ + 1, 50, 0, 25);
115 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalBHValidation.: PCaloHitContainer"
116 <<
" obtained with flag " << hitsHE.
isValid();
118 edm::LogVerbatim(
"HGCalValidation") <<
"HGCalBHValidation: PCaloHit buffer " << hitsHE->size();
120 std::map<unsigned int, double> map_try;
121 for (edm::PCaloHitContainer::const_iterator it = hitsHE->begin(); it != hitsHE->end(); ++it) {
122 double energy = it->energy();
123 double time = it->time();
124 unsigned int id = it->id();
125 int eta(0),
phi(0), lay(0);
139 hsi3Oc_->Fill(eta1, lay, energy);
141 if (map_try.count(
id) != 0)
150 for (std::map<unsigned int, double>::iterator itr = map_try.begin(); itr != map_try.end(); ++itr) {
156 unsigned int kount(0);
160 <<
"HGCalDigiCollection obtained with"
161 <<
" flag " << hecoll.
isValid();
164 <<
"buffer " << hecoll->size();
171 int depth = cell.layer();
180 const T& cell,
double const&
energy,
bool const& bh,
int const&
depth,
unsigned int& kount) {
182 int eta = cell.ieta();
183 int phi = cell.iphi();
184 double eta1 = (eta >= 0) ? (eta + 0.1) : (eta - 0.1);
185 hdi2Oc_->Fill(eta1, (phi - 0.1));
188 hdigOc_->Fill(eta1, (phi - 0.1));
193 <<
"HGCalBHDigit[" << kount <<
"] ID " << cell <<
" E " << energy <<
":" << (energy >
threshold_);
static const std::string kSharedResource
Log< level::Info, true > LogVerbatim
EventNumber_t event() const
std::vector< PCaloHit > PCaloHitContainer
const std::vector< S > & data() const
uint16_t *__restrict__ id
~HGCalBHValidation() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
const edm::InputTag digis_
std::vector< T >::const_iterator const_iterator
T * make(const Args &...args) const
make new ROOT object
const edm::EDGetToken tok_digi_
etaMax_(conf.getParameter< double >("etaMax"))
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::string g4Label_
edm::Service< TFileService > fs_
HGCalBHValidation(const edm::ParameterSet &ps)
int iphi() const
get the phi index
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const D & id() const
det id
void beginRun(edm::Run const &, edm::EventSetup const &) override
void analyze(edm::Event const &, edm::EventSetup const &) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int layer() const
get the layer #
void endRun(edm::Run const &, edm::EventSetup const &) override
constexpr Detector det() const
get the detector field from this detid
void analyzeDigi(const T &, double const &, bool const &, int const &, unsigned int &)