30 edm::LogInfo(
"ElectronStudy") <<
"Module Label: " << g4Label <<
" Hits: "
33 double tempPBins[
NPBins+1] = { 0.0, 10.0, 20.0, 40.0, 60.0,
34 100.0, 500.0, 1000.0, 10000.0};
35 double tempEta[
NEtaBins+1] = {0.0, 1.2, 1.6, 3.0};
42 edm::LogInfo(
"ElectronStudy") <<
"TFileService unavailable: no histograms";
45 char name[20],
title[200], cpbin[30], cebin[30];
47 for (
unsigned int i=0;
i<NPBins+1; ++
i) {
48 if (
i == 0) sprintf (cpbin,
" All p");
49 else sprintf (cpbin,
" p (%6.0f:%6.0f)",
pBins[
i-1],
pBins[
i]);
50 for (
unsigned int j=0;
j<NEtaBins+1; ++
j) {
51 if (
j == 0) sprintf (cebin,
" All #eta");
53 sprintf (name,
"R1%d%d", i, j);
54 sprintf (title,
"E1/E9 for %s%s", cpbin, cebin);
56 histoR1[
i][
j]->GetXaxis()->SetTitle(title);
57 histoR1[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
58 sprintf (name,
"R2%d%d", i, j);
59 sprintf (title,
"E1/E25 for %s%s", cpbin, cebin);
61 histoR2[
i][
j]->GetXaxis()->SetTitle(title);
62 histoR2[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
63 sprintf (name,
"R3%d%d", i, j);
64 sprintf (title,
"E9/E25 for %s%s", cpbin, cebin);
66 histoR3[
i][
j]->GetXaxis()->SetTitle(title);
67 histoR3[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
68 sprintf (name,
"E1x1%d%d", i, j);
69 sprintf (title,
"E1/P for %s%s", cpbin, cebin);
73 sprintf (name,
"E3x3%d%d", i, j);
74 sprintf (title,
"E9/P for %s%s", cpbin, cebin);
78 sprintf (name,
"E5x5%d%d", i, j);
79 sprintf (title,
"E25/P for %s%s", cpbin, cebin);
91 << iEvent.
id().
event() << std::endl;
124 <<
" valid[EE]: " << caloHitEE.
isValid() << std::endl;
129 edm::PCaloHitContainer::const_iterator ihit;
130 for (ihit=caloHitEB->begin(),indx=0; ihit!=caloHitEB->end(); ihit++,indx++) {
132 std::cout <<
"Hit[" << indx <<
"] " <<
id <<
" E " << ihit->energy()
133 <<
" T " << ihit->time() << std::endl;
135 for (ihit=caloHitEE->begin(),indx=0; ihit!=caloHitEE->end(); ihit++,indx++) {
137 std::cout <<
"Hit[" << indx <<
"] " <<
id <<
" E " << ihit->energy()
138 <<
" T " << ihit->time() << std::endl;
141 edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
142 for (indx=0; simTrkItr!= SimTk->end(); simTrkItr++,indx++) {
144 << simTrkItr->trackId() <<
" type "
145 << simTrkItr->type() <<
" charge "
146 << simTrkItr->charge() <<
" p "
147 << simTrkItr->momentum()<<
" Generator Index "
148 << simTrkItr->genpartIndex() <<
" vertex "
149 << simTrkItr->vertIndex() << std::endl;
150 if (
std::abs(simTrkItr->type()) == 11 && simTrkItr->vertIndex() != -1) {
151 int thisTrk = simTrkItr->trackId();
155 DetId hotCell = isoCell;
157 double e1x1 =
spr::eECALmatrix(hotCell, caloHitEB, caloHitEE, geo, caloTopology, 0, 0, -100.0, -100.0,-500.0, 500.0, (
verbose>2));
158 double e3x3 =
spr::eECALmatrix(hotCell, caloHitEB, caloHitEE, geo, caloTopology, 1, 1, -100.0, -100.0,-500.0, 500.0, (
verbose>2));
159 double e5x5 =
spr::eECALmatrix(hotCell, caloHitEB, caloHitEE, geo, caloTopology, 2, 2, -100.0, -100.0,-500.0, 500.0, (
verbose>2));
160 double p = simTrkItr->momentum().P();
161 double eta =
std::abs(simTrkItr->momentum().eta());
163 for (
int ieta=0; ieta<
NEtaBins; ieta++) {
166 for (
int ipt=0; ipt<
NPBins; ipt++) {
167 if (p>
pBins[ipt] && p<
pBins[ipt+1] ) momBin = ipt+1;
169 double r1=-1,
r2=-1, r3=-1;
170 if (e3x3 > 0) r1 = e1x1/e3x3;
171 if (e5x5 > 0) {
r2 = e1x1/e5x5; r3 = e3x3/e5x5;}
173 std::cout <<
"ElectronStudy: p " << p <<
" [" << momBin <<
"] eta "
174 << eta <<
" [" << etaBin <<
"]";
187 std::cout <<
" e1x1 " << e1x1 <<
"|" << r1 <<
"|" <<
r2 <<
" e3x3 "
188 << e3x3 <<
"|" << r3 <<
" e5x5 " << e5x5 << std::endl;
ElectronStudy(const edm::ParameterSet &ps)
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
TH1F * histoR2[NPBins+1][NEtaBins+1]
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)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
TH1F * histoE3x3[NPBins+1][NEtaBins+1]
TH1F * histoE1x1[NPBins+1][NEtaBins+1]
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
T * make(const Args &...args) const
make new ROOT object
void analyze(const edm::Event &e, const edm::EventSetup &c)
Abs< T >::type abs(const T &t)
TH1F * histoR3[NPBins+1][NEtaBins+1]
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
double etaBins[NEtaBins+1]
TH1F * histoR1[NPBins+1][NEtaBins+1]
edm::EDGetTokenT< edm::PCaloHitContainer > tok_EBhit_
TH1F * histoE5x5[NPBins+1][NEtaBins+1]
T const * product() const
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)
edm::EDGetTokenT< edm::PCaloHitContainer > tok_EEhit_
static const int NEtaBins
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)