22 edm::LogInfo(
"ElectronStudy") <<
"Module Label: " << g4Label <<
" Hits: "
25 double tempPBins[
NPBins+1] = { 0.0, 10.0, 20.0, 40.0, 60.0,
26 100.0, 500.0, 1000.0, 10000.0};
27 double tempEta[
NEtaBins+1] = {0.0, 1.2, 1.6, 3.0};
34 edm::LogInfo(
"ElectronStudy") <<
"TFileService unavailable: no histograms";
37 char name[20],
title[200], cpbin[30], cebin[30];
39 for (
unsigned int i=0;
i<NPBins+1; ++
i) {
40 if (
i == 0) sprintf (cpbin,
" All p");
41 else sprintf (cpbin,
" p (%6.0f:%6.0f)",
pBins[
i-1],
pBins[
i]);
42 for (
unsigned int j=0;
j<NEtaBins+1; ++
j) {
43 if (
j == 0) sprintf (cebin,
" All #eta");
45 sprintf (name,
"R1%d%d", i, j);
46 sprintf (title,
"E1/E9 for %s%s", cpbin, cebin);
48 histoR1[
i][
j]->GetXaxis()->SetTitle(title);
49 histoR1[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
50 sprintf (name,
"R2%d%d", i, j);
51 sprintf (title,
"E1/E25 for %s%s", cpbin, cebin);
53 histoR2[
i][
j]->GetXaxis()->SetTitle(title);
54 histoR2[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
55 sprintf (name,
"R3%d%d", i, j);
56 sprintf (title,
"E9/E25 for %s%s", cpbin, cebin);
58 histoR3[
i][
j]->GetXaxis()->SetTitle(title);
59 histoR3[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
60 sprintf (name,
"E1x1%d%d", i, j);
61 sprintf (title,
"E1/P for %s%s", cpbin, cebin);
65 sprintf (name,
"E3x3%d%d", i, j);
66 sprintf (title,
"E9/P for %s%s", cpbin, cebin);
70 sprintf (name,
"E5x5%d%d", i, j);
71 sprintf (title,
"E25/P for %s%s", cpbin, cebin);
83 << iEvent.
id().
event() << std::endl;
116 <<
" valid[EE]: " << caloHitEE.
isValid() << std::endl;
121 edm::PCaloHitContainer::const_iterator ihit;
122 for (ihit=caloHitEB->begin(),indx=0; ihit!=caloHitEB->end(); ihit++,indx++) {
124 std::cout <<
"Hit[" << indx <<
"] " <<
id <<
" E " << ihit->energy()
125 <<
" T " << ihit->time() << std::endl;
127 for (ihit=caloHitEE->begin(),indx=0; ihit!=caloHitEE->end(); ihit++,indx++) {
129 std::cout <<
"Hit[" << indx <<
"] " <<
id <<
" E " << ihit->energy()
130 <<
" T " << ihit->time() << std::endl;
133 edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
134 for (indx=0; simTrkItr!= SimTk->end(); simTrkItr++,indx++) {
136 << simTrkItr->trackId() <<
" type "
137 << simTrkItr->type() <<
" charge "
138 << simTrkItr->charge() <<
" p "
139 << simTrkItr->momentum()<<
" Generator Index "
140 << simTrkItr->genpartIndex() <<
" vertex "
141 << simTrkItr->vertIndex() << std::endl;
142 if (
std::abs(simTrkItr->type()) == 11 && simTrkItr->vertIndex() != -1) {
143 int thisTrk = simTrkItr->trackId();
147 double e1x1 =
spr::eECALmatrix(isoCell, caloHitEB, caloHitEE, geo, caloTopology, 0, 0, -100.0, -100.0,-500.0, 500.0, (
verbose>2));
148 double e3x3 =
spr::eECALmatrix(isoCell, caloHitEB, caloHitEE, geo, caloTopology, 1, 1, -100.0, -100.0,-500.0, 500.0, (
verbose>2));
149 double e5x5 =
spr::eECALmatrix(isoCell, caloHitEB, caloHitEE, geo, caloTopology, 2, 2, -100.0, -100.0,-500.0, 500.0, (
verbose>2));
150 double p = simTrkItr->momentum().P();
151 double eta =
std::abs(simTrkItr->momentum().eta());
152 int etaBin=-1, momBin=-1;
153 for (
int ieta=0; ieta<
NEtaBins; ieta++) {
156 for (
int ipt=0; ipt<
NPBins; ipt++) {
157 if (p>
pBins[ipt] && p<
pBins[ipt+1] ) momBin = ipt+1;
159 double r1=-1,
r2=-1, r3=-1;
160 if (e3x3 > 0) r1 = e1x1/e3x3;
161 if (e5x5 > 0) {
r2 = e1x1/e5x5; r3 = e3x3/e5x5;}
163 std::cout <<
"ElectronStudy: p " << p <<
" [" << momBin <<
"] eta "
164 << eta <<
" [" << etaBin <<
"]";
167 std::cout <<
" Cell 0x" << std::hex << isoCell() << std::dec
171 std::cout <<
" Cell 0x" << std::hex << isoCell() << std::dec
174 std::cout <<
" Cell 0x" << std::hex << isoCell() << std::dec
177 std::cout <<
" e1x1 " << e1x1 <<
"|" << r1 <<
"|" <<
r2 <<
" e3x3 "
178 << e3x3 <<
"|" << r3 <<
" e5x5 " << e5x5 << std::endl;
203 histoR1[momBin][etaBin]->Fill(r1);
205 histoR3[momBin][etaBin]->Fill(r3);
ElectronStudy(const edm::ParameterSet &ps)
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
TH1F * histoR2[NPBins+1][NEtaBins+1]
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
#define DEFINE_FWK_MODULE(type)
TH1F * histoE3x3[NPBins+1][NEtaBins+1]
TH1F * histoE1x1[NPBins+1][NEtaBins+1]
void analyze(const edm::Event &e, const edm::EventSetup &c)
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]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
TH1F * histoR1[NPBins+1][NEtaBins+1]
TH1F * histoE5x5[NPBins+1][NEtaBins+1]
T const * product() const
T * make() const
make new ROOT object
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)