73 usesResource(
"TFileService");
86 edm::LogInfo(
"ElectronStudy") <<
"Module Label: " << g4Label <<
" Hits: " << hitLabEB <<
", " << hitLabEE;
88 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
90 tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
92 double tempP[
NPBins_ + 1] = {0.0, 10.0, 20.0, 40.0, 60.0, 100.0, 500.0, 1000.0, 10000.0};
93 double tempEta[
NEtaBins_ + 1] = {0.0, 1.2, 1.6, 3.0};
101 if (!
tfile.isAvailable()) {
102 edm::LogInfo(
"ElectronStudy") <<
"TFileService unavailable: no histograms";
105 char name[20],
title[200], cpbin[30], cebin[30];
107 for (
unsigned int i = 0;
i <
NPBins_ + 1; ++
i) {
109 sprintf(cpbin,
" All p");
114 sprintf(cebin,
" All #eta");
117 sprintf(
name,
"R1%d%d",
i,
j);
118 sprintf(
title,
"E1/E9 for %s%s", cpbin, cebin);
121 histoR1[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
122 sprintf(
name,
"R2%d%d",
i,
j);
123 sprintf(
title,
"E1/E25 for %s%s", cpbin, cebin);
126 histoR2[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
127 sprintf(
name,
"R3%d%d",
i,
j);
128 sprintf(
title,
"E9/E25 for %s%s", cpbin, cebin);
131 histoR3[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
132 sprintf(
name,
"E1x1%d%d",
i,
j);
133 sprintf(
title,
"E1/P for %s%s", cpbin, cebin);
137 sprintf(
name,
"E3x3%d%d",
i,
j);
138 sprintf(
title,
"E9/P for %s%s", cpbin, cebin);
142 sprintf(
name,
"E5x5%d%d",
i,
j);
143 sprintf(
title,
"E25/P for %s%s", cpbin, cebin);
157 desc.addUntracked<
int>(
"Verbosity", 0);
158 descriptions.
add(
"electronStudy",
desc);
188 <<
" valid[EE]: " << caloHitEE.
isValid();
193 edm::PCaloHitContainer::const_iterator ihit;
194 for (ihit = caloHitEB->begin(), indx = 0; ihit != caloHitEB->end(); ihit++, indx++) {
196 edm::LogVerbatim(
"IsoTrack") <<
"Hit[" << indx <<
"] " <<
id <<
" E " << ihit->energy() <<
" T " 199 for (ihit = caloHitEE->begin(), indx = 0; ihit != caloHitEE->end(); ihit++, indx++) {
201 edm::LogVerbatim(
"IsoTrack") <<
"Hit[" << indx <<
"] " <<
id <<
" E " << ihit->energy() <<
" T " 205 edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin();
206 for (indx = 0; simTrkItr != SimTk->end(); simTrkItr++, indx++) {
208 edm::LogVerbatim(
"IsoTrack") <<
"ElectronStudy: Track[" << indx <<
"] ID " << simTrkItr->trackId() <<
" type " 209 << simTrkItr->type() <<
" charge " << simTrkItr->charge() <<
" p " 210 << simTrkItr->momentum() <<
" Generator Index " << simTrkItr->genpartIndex()
211 <<
" vertex " << simTrkItr->vertIndex();
212 if (
std::abs(simTrkItr->type()) == 11 && simTrkItr->vertIndex() != -1) {
213 int thisTrk = simTrkItr->trackId();
217 DetId hotCell = isoCell;
222 hotCell, caloHitEB, caloHitEE, geo, caloTopology, 0, 0, -100.0, -100.0, -500.0, 500.0, (
verbose_ > 2));
224 hotCell, caloHitEB, caloHitEE, geo, caloTopology, 1, 1, -100.0, -100.0, -500.0, 500.0, (
verbose_ > 2));
226 hotCell, caloHitEB, caloHitEE, geo, caloTopology, 2, 2, -100.0, -100.0, -500.0, 500.0, (
verbose_ > 2));
227 double p = simTrkItr->momentum().P();
228 double eta =
std::abs(simTrkItr->momentum().eta());
229 int etaBin = -1, momBin = -1;
234 for (
int ipt = 0; ipt <
NPBins_; ipt++) {
238 double r1 = -1,
r2 = -1, r3 = -1;
246 edm::LogVerbatim(
"IsoTrack") <<
"ElectronStudy: p " <<
p <<
" [" << momBin <<
"] eta " <<
eta <<
" [" 253 edm::LogVerbatim(
"IsoTrack") <<
" e1x1 " << e1x1 <<
"|" <<
r1 <<
"|" <<
r2 <<
" e3x3 " << e3x3 <<
"|" << r3
Log< level::Info, true > LogVerbatim
ElectronStudy(const edm::ParameterSet &ps)
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
~ElectronStudy() override
TH1F * histoR3[NPBins_+1][NEtaBins_+1]
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
static const int NEtaBins_
TH1F * histoE3x3[NPBins_+1][NEtaBins_+1]
TH1F * histoR2[NPBins_+1][NEtaBins_+1]
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_magField_
T getUntrackedParameter(std::string const &, T const &) const
Abs< T >::type abs(const T &t)
double etaBins_[NEtaBins_+1]
#define DEFINE_FWK_MODULE(type)
TH1F * histoE1x1[NPBins_+1][NEtaBins_+1]
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
edm::EDGetTokenT< edm::PCaloHitContainer > tok_EBhit_
Log< level::Info, false > LogInfo
TH1F * histoE5x5[NPBins_+1][NEtaBins_+1]
DetId hotCrystal(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double tMin=-500, double tMax=500, bool debug=false)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< edm::PCaloHitContainer > tok_EEhit_
void analyze(edm::Event const &, edm::EventSetup const &) override
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
edm::ESGetToken< CaloTopology, CaloTopologyRecord > tok_caloTopology_
TH1F * histoR1[NPBins_+1][NEtaBins_+1]