74 usesResource(
"TFileService");
88 edm::LogInfo(
"ElectronStudy") <<
"Module Label: " << g4Label <<
" Hits: " 89 << hitLabEB <<
", " << hitLabEE;
91 double tempP[
NPBins_+1] = { 0.0, 10.0, 20.0, 40.0, 60.0,
92 100.0, 500.0, 1000.0, 10000.0};
93 double tempEta[
NEtaBins_+1] = {0.0, 1.2, 1.6, 3.0};
100 edm::LogInfo(
"ElectronStudy") <<
"TFileService unavailable: no histograms";
103 char name[20],
title[200], cpbin[30], cebin[30];
105 for (
unsigned int i=0;
i<NPBins_+1; ++
i) {
106 if (
i == 0) sprintf (cpbin,
" All p");
108 for (
unsigned int j=0; j<NEtaBins_+1; ++j) {
109 if (j == 0) sprintf (cebin,
" All #eta");
111 sprintf (name,
"R1%d%d", i, j);
112 sprintf (title,
"E1/E9 for %s%s", cpbin, cebin);
114 histoR1[
i][j]->GetXaxis()->SetTitle(title);
115 histoR1[
i][j]->GetYaxis()->SetTitle(
"Tracks");
116 sprintf (name,
"R2%d%d", i, j);
117 sprintf (title,
"E1/E25 for %s%s", cpbin, cebin);
119 histoR2[
i][j]->GetXaxis()->SetTitle(title);
120 histoR2[
i][j]->GetYaxis()->SetTitle(
"Tracks");
121 sprintf (name,
"R3%d%d", i, j);
122 sprintf (title,
"E9/E25 for %s%s", cpbin, cebin);
124 histoR3[
i][j]->GetXaxis()->SetTitle(title);
125 histoR3[
i][j]->GetYaxis()->SetTitle(
"Tracks");
126 sprintf (name,
"E1x1%d%d", i, j);
127 sprintf (title,
"E1/P for %s%s", cpbin, cebin);
130 histoE1x1[
i][j]->GetYaxis()->SetTitle(
"Tracks");
131 sprintf (name,
"E3x3%d%d", i, j);
132 sprintf (title,
"E9/P for %s%s", cpbin, cebin);
135 histoE3x3[
i][j]->GetYaxis()->SetTitle(
"Tracks");
136 sprintf (name,
"E5x5%d%d", i, j);
137 sprintf (title,
"E25/P for %s%s", cpbin, cebin);
140 histoE5x5[
i][j]->GetYaxis()->SetTitle(
"Tracks");
153 descriptions.
add(
"electronStudy",desc);
160 <<
" Event = " << iEvent.
id().
event();
193 << caloHitEB.
isValid() <<
" valid[EE]: " 199 edm::PCaloHitContainer::const_iterator ihit;
200 for (ihit=caloHitEB->begin(),indx=0; ihit!=caloHitEB->end();
204 << ihit->energy() <<
" T " << ihit->time();
206 for (ihit=caloHitEE->begin(),indx=0; ihit!=caloHitEE->end();
210 << ihit->energy() <<
" T " << ihit->time();
213 edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
214 for (indx=0; simTrkItr!= SimTk->end(); simTrkItr++,indx++) {
217 <<
"] ID " << simTrkItr->trackId()
218 <<
" type " << simTrkItr->type()
219 <<
" charge " << simTrkItr->charge()
220 <<
" p " << simTrkItr->momentum()
221 <<
" Generator Index " 222 << simTrkItr->genpartIndex() <<
" vertex " 223 << simTrkItr->vertIndex();
224 if (
std::abs(simTrkItr->type()) == 11 && simTrkItr->vertIndex() != -1) {
225 int thisTrk = simTrkItr->trackId();
229 DetId hotCell = isoCell;
231 double e1x1 =
spr::eECALmatrix(hotCell, caloHitEB, caloHitEE, geo, caloTopology, 0, 0, -100.0, -100.0,-500.0, 500.0, (
verbose_>2));
232 double e3x3 =
spr::eECALmatrix(hotCell, caloHitEB, caloHitEE, geo, caloTopology, 1, 1, -100.0, -100.0,-500.0, 500.0, (
verbose_>2));
233 double e5x5 =
spr::eECALmatrix(hotCell, caloHitEB, caloHitEE, geo, caloTopology, 2, 2, -100.0, -100.0,-500.0, 500.0, (
verbose_>2));
234 double p = simTrkItr->momentum().P();
235 double eta =
std::abs(simTrkItr->momentum().eta());
237 for (
int ieta=0; ieta<
NEtaBins_; ieta++) {
240 for (
int ipt=0; ipt<
NPBins_; ipt++) {
243 double r1=-1,
r2=-1, r3=-1;
244 if (e3x3 > 0) r1 = e1x1/e3x3;
245 if (e5x5 > 0) {
r2 = e1x1/
e5x5; r3 = e3x3/
e5x5;}
248 << momBin <<
"] eta " << eta <<
" [" 249 << etaBin <<
"] Cell 0x" << std::hex
257 <<
"|" <<
r2 <<
" e3x3 " << e3x3
258 <<
"|" << r3 <<
" e5x5 " <<
e5x5;
ElectronStudy(const edm::ParameterSet &ps)
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
~ElectronStudy() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
TH1F * histoR3[NPBins_+1][NEtaBins_+1]
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
T * make(const Args &...args) const
make new ROOT object
static const int NEtaBins_
TH1F * histoE3x3[NPBins_+1][NEtaBins_+1]
TH1F * histoR2[NPBins_+1][NEtaBins_+1]
Abs< T >::type abs(const T &t)
double etaBins_[NEtaBins_+1]
TH1F * histoE1x1[NPBins_+1][NEtaBins_+1]
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
edm::EDGetTokenT< edm::PCaloHitContainer > tok_EBhit_
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
T const * product() const
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)
TH1F * histoR1[NPBins_+1][NEtaBins_+1]