19 std::cout <<
"CastorRecHitMonitor Constructor: " <<
this << std::endl;
31 std::cout <<
"CastorRecHitMonitor::bookHistograms" << std::endl;
36 float ySec[nySec + 1];
37 float xSec[N_Sec + 1];
38 double E0sec = 1. / 1024.;
41 double lnBsec =
log(2.);
42 for (
int j = 1;
j < nySec;
j++)
43 ySec[
j + 1] = E0sec *
exp(
j * lnBsec);
44 for (
int i = 0;
i <= N_Sec;
i++)
47 sprintf(s,
"Castor Energy by Sectors #Phi");
48 h2RHvsSec = ibooker.
book2D(s, s, N_Sec, xSec, nySec, ySec);
50 h2RHvsSec->setAxisTitle(
"RecHit / GeV", 2);
51 h2RHvsSec->setOption(
"colz");
57 for (
int i = 0;
i <= nxCh;
i++)
59 double E0 = 1. / 1024.;
63 for (
int j = 1;
j < nyE;
j++)
64 yErh[
j + 1] = E0 *
exp(
j * lnA);
66 string st =
"Castor Cell Energy Map (cell-wise)";
67 h2RHchan = ibooker.
book2D(st, st +
";moduleZ*16 + sector #Phi;RecHit / GeV", nxCh, xCh, nyE, yErh);
70 sprintf(s,
"Castor Cell Energy");
71 hallchan = ibooker.
book1D(s, s, nyE, yErh);
74 st =
"Castor cell avr Energy per event Map Z-Phi";
75 h2RHoccmap = ibooker.
bookProfile2D(st, st +
";module Z;sector Phi", 14, 0, 14, 16, 0, 16, 0., 1.e10,
"");
78 sprintf(s,
"CastorRecHitEntriesMap");
79 h2RHentriesMap = ibooker.
book2D(s, s, 14, 0, 14, 16, 0, 16);
81 h2RHentriesMap->setAxisTitle(
"sector #Phi", 2);
82 h2RHentriesMap->setOption(
"colz");
84 sprintf(s,
"CastorRecHitTime");
85 hRHtime = ibooker.
book1D(s, s, 301, -101., 200.);
87 sprintf(s,
"CASTORTowerDepth");
88 hTowerDepth = ibooker.
book1D(s, s, 130, -15500., -14200.);
91 sprintf(s,
"CASTORTowerMultiplicity");
92 hTowerMultipl = ibooker.
book1D(s, s, 20, 0., 20.);
95 float EhadTow[NEtow + 1];
96 float EMTow[NEtow + 1];
97 float ETower[NEtow + 2];
98 double E0tow = 1. / 1024.;
105 double lnBtow =
log(2.);
106 for (
int j = 1;
j < NEtow;
j++)
107 EMTow[
j + 1] = E0tow *
exp(
j * lnBtow);
108 for (
int j = 1;
j < NEtow;
j++)
109 EhadTow[
j + 1] = E0tow *
exp(
j * lnBtow);
110 for (
int j = 1;
j <= NEtow;
j++)
111 ETower[
j + 1] = E0tow *
exp(
j * lnBtow);
113 sprintf(s,
"CASTORTowerEMvsEhad");
114 h2TowerEMhad = ibooker.
book2D(s, s, NEtow, EhadTow, NEtow, EMTow);
116 h2TowerEMhad->setAxisTitle(
"EM / GeV", 2);
117 h2TowerEMhad->setOption(
"colz");
119 sprintf(s,
"CASTORTowerTotalEnergy");
120 hTowerE = ibooker.
book1D(s, s, NEtow + 1, ETower);
123 sprintf(s,
"CASTORJetsMultiplicity");
124 hJetsMultipl = ibooker.
book1D(s, s, 16, 0., 16.);
126 sprintf(s,
"CASTORJetEnergy");
127 hJetEnergy = ibooker.
book1D(s, s, 5000, 0., 500.);
129 sprintf(s,
"CASTORJetEta");
130 hJetEta = ibooker.
book1D(s, s, 126, -6.3, 6.3);
132 sprintf(s,
"CASTORJetPhi");
133 hJetPhi = ibooker.
book1D(s, s, 63, -3.15, 3.15);
136 std::cout <<
"CastorRecHitMonitor::bookHistograms(end)" << std::endl;
141 if (castorTowers.empty())
145 for (reco::CastorTowerCollection::const_iterator iTower = castorTowers.begin(); iTower != castorTowers.end();
147 hTowerE->Fill(iTower->energy() * 0.001);
148 h2TowerEMhad->Fill(iTower->hadEnergy() * 0.001, iTower->emEnergy() * 0.001);
149 hTowerDepth->Fill(iTower->depth());
152 hTowerMultipl->Fill(nTowers);
157 std::cout <<
"CastorRecHitMonitor::processEvent (begin)" << std::endl;
159 for (
int z = 0; z < 14; z++)
160 for (
int phi = 0; phi < 16; phi++)
161 energyInEachChannel[z][phi] = 0.;
166 if (castorHits.
empty())
169 for (CASTORiter = castorHits.
begin(); CASTORiter != castorHits.
end(); ++CASTORiter) {
170 float energy = CASTORiter->energy();
171 float time = CASTORiter->time();
175 hRHtime->Fill(time2);
180 int sector = (
int)
id.sector();
182 energyInEachChannel[module - 1][sector - 1] +=
energy;
184 h2RHentriesMap->Fill(module - 1, sector - 1);
188 for (
int phi = 0; phi < 16; phi++) {
190 for (
int z = 0; z < 14; z++) {
191 float rh = energyInEachChannel[z][phi] * 0.001;
192 int ind = z * 16 + phi + 1;
194 h2RHchan->Fill(ind, rh);
198 h2RHoccmap->Fill(z, phi, rh);
201 h2RHvsSec->Fill(phi, es);
206 std::cout <<
"CastorRecHitMonitor::processEvent (end)" << std::endl;
212 for (reco::BasicJetCollection::const_iterator ibegin = Jets.begin(), iend = Jets.end(), ijet = ibegin; ijet != iend;
215 float energy = ijet->energy() * 0.001;
216 hJetEnergy->Fill(energy);
217 hJetEta->Fill(ijet->eta());
218 hJetPhi->Fill(ijet->phi());
220 hJetsMultipl->Fill(nJets);
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getUntrackedParameter(std::string const &, T const &) const
virtual void setOption(const char *option)
void setCurrentFolder(std::string const &fullpath)
std::vector< T >::const_iterator const_iterator
void processEventJets(const reco::BasicJetCollection &Jets)
CastorRecHitMonitor(const edm::ParameterSet &ps)
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s")
virtual TProfile2D * getTProfile2D() const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
const_iterator end() const
void processEventTowers(const reco::CastorTowerCollection &castorTowers)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
void processEvent(const CastorRecHitCollection &castorHits)
std::vector< CastorTower > CastorTowerCollection
collection of CastorTower objects
const_iterator begin() const
std::vector< BasicJet > BasicJetCollection
collection of BasicJet objects
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)