23 edm::LogInfo(
"ElectronStudy") <<
"Module Label: " << g4Label <<
" Hits: "
26 double tempPBins[
NPBins+1] = { 0.0, 10.0, 20.0, 40.0, 60.0,
27 100.0, 500.0, 1000.0, 10000.0};
28 double tempEta[
NEtaBins+1] = {0.0, 1.2, 1.6, 3.0};
35 edm::LogInfo(
"ElectronStudy") <<
"TFileService unavailable: no histograms";
38 char name[20],
title[200], cpbin[30], cebin[30];
40 for (
unsigned int i=0;
i<NPBins+1; ++
i) {
41 if (
i == 0) sprintf (cpbin,
" All p");
42 else sprintf (cpbin,
" p (%6.0f:%6.0f)",
pBins[
i-1],
pBins[
i]);
43 for (
unsigned int j=0;
j<NEtaBins+1; ++
j) {
44 if (
j == 0) sprintf (cebin,
" All #eta");
46 sprintf (name,
"R1%d%d", i, j);
47 sprintf (title,
"E1/E9 for %s%s", cpbin, cebin);
49 histoR1[
i][
j]->GetXaxis()->SetTitle(title);
50 histoR1[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
51 sprintf (name,
"R2%d%d", i, j);
52 sprintf (title,
"E1/E25 for %s%s", cpbin, cebin);
54 histoR2[
i][
j]->GetXaxis()->SetTitle(title);
55 histoR2[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
56 sprintf (name,
"R3%d%d", i, j);
57 sprintf (title,
"E9/E25 for %s%s", cpbin, cebin);
59 histoR3[
i][
j]->GetXaxis()->SetTitle(title);
60 histoR3[
i][
j]->GetYaxis()->SetTitle(
"Tracks");
61 sprintf (name,
"E1x1%d%d", i, j);
62 sprintf (title,
"E1/P for %s%s", cpbin, cebin);
66 sprintf (name,
"E3x3%d%d", i, j);
67 sprintf (title,
"E9/P for %s%s", cpbin, cebin);
71 sprintf (name,
"E5x5%d%d", i, j);
72 sprintf (title,
"E25/P for %s%s", cpbin, cebin);
84 << iEvent.
id().
event() << std::endl;
117 <<
" valid[EE]: " << caloHitEE.
isValid() << std::endl;
122 edm::PCaloHitContainer::const_iterator ihit;
123 for (ihit=caloHitEB->begin(),indx=0; ihit!=caloHitEB->end(); ihit++,indx++) {
125 std::cout <<
"Hit[" << indx <<
"] " <<
id <<
" E " << ihit->energy()
126 <<
" T " << ihit->time() << std::endl;
128 for (ihit=caloHitEE->begin(),indx=0; ihit!=caloHitEE->end(); ihit++,indx++) {
130 std::cout <<
"Hit[" << indx <<
"] " <<
id <<
" E " << ihit->energy()
131 <<
" T " << ihit->time() << std::endl;
134 edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
135 for (indx=0; simTrkItr!= SimTk->end(); simTrkItr++,indx++) {
137 << simTrkItr->trackId() <<
" type "
138 << simTrkItr->type() <<
" charge "
139 << simTrkItr->charge() <<
" p "
140 << simTrkItr->momentum()<<
" Generator Index "
141 << simTrkItr->genpartIndex() <<
" vertex "
142 << simTrkItr->vertIndex() << std::endl;
143 if (
std::abs(simTrkItr->type()) == 11 && simTrkItr->vertIndex() != -1) {
144 int thisTrk = simTrkItr->trackId();
148 DetId hotCell = isoCell;
150 double e1x1 =
spr::eECALmatrix(hotCell, caloHitEB, caloHitEE, geo, caloTopology, 0, 0, -100.0, -100.0,-500.0, 500.0, (
verbose>2));
151 double e3x3 =
spr::eECALmatrix(hotCell, caloHitEB, caloHitEE, geo, caloTopology, 1, 1, -100.0, -100.0,-500.0, 500.0, (
verbose>2));
152 double e5x5 =
spr::eECALmatrix(hotCell, caloHitEB, caloHitEE, geo, caloTopology, 2, 2, -100.0, -100.0,-500.0, 500.0, (
verbose>2));
153 double p = simTrkItr->momentum().P();
154 double eta =
std::abs(simTrkItr->momentum().eta());
155 int etaBin=-1, momBin=-1;
156 for (
int ieta=0; ieta<
NEtaBins; ieta++) {
159 for (
int ipt=0; ipt<
NPBins; ipt++) {
160 if (p>
pBins[ipt] && p<
pBins[ipt+1] ) momBin = ipt+1;
162 double r1=-1,
r2=-1, r3=-1;
163 if (e3x3 > 0) r1 = e1x1/e3x3;
164 if (e5x5 > 0) {
r2 = e1x1/e5x5; r3 = e3x3/e5x5;}
166 std::cout <<
"ElectronStudy: p " << p <<
" [" << momBin <<
"] eta "
167 << eta <<
" [" << etaBin <<
"]";
170 std::cout <<
" Cell 0x" << std::hex << isoCell() << std::dec
174 std::cout <<
" Cell 0x" << std::hex << isoCell() << std::dec
177 std::cout <<
" Cell 0x" << std::hex << isoCell() << std::dec
180 std::cout <<
" e1x1 " << e1x1 <<
"|" << r1 <<
"|" <<
r2 <<
" e3x3 "
181 << e3x3 <<
"|" << r3 <<
" e5x5 " << e5x5 << std::endl;
206 histoR1[momBin][etaBin]->Fill(r1);
208 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
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)
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)