19 std::cout <<
"CastorRecHitMonitor Constructor: " <<
this << std::endl;
29 std::cout <<
"CastorRecHitMonitor::bookHistograms" << std::endl;
34 float ySec[nySec + 1];
35 float xSec[N_Sec + 1];
36 double E0sec = 1. / 1024.;
39 double lnBsec =
log(2.);
40 for (
int j = 1;
j < nySec;
j++)
41 ySec[
j + 1] = E0sec *
exp(
j * lnBsec);
42 for (
int i = 0;
i <= N_Sec;
i++)
45 sprintf(
s,
"Castor Energy by Sectors #Phi");
46 h2RHvsSec = ibooker.
book2D(
s,
s, N_Sec, xSec, nySec, ySec);
48 h2RHvsSec->setAxisTitle(
"RecHit / GeV", 2);
49 h2RHvsSec->setOption(
"colz");
55 for (
int i = 0;
i <= nxCh;
i++)
57 double E0 = 1. / 1024.;
61 for (
int j = 1;
j < nyE;
j++)
62 yErh[
j + 1] = E0 *
exp(
j * lnA);
64 string st =
"Castor Cell Energy Map (cell-wise)";
65 h2RHchan = ibooker.
book2D(st, st +
";moduleZ*16 + sector #Phi;RecHit / GeV", nxCh, xCh, nyE, yErh);
68 sprintf(
s,
"Castor Cell Energy");
69 hallchan = ibooker.
book1D(
s,
s, nyE, yErh);
72 st =
"Castor cell avr Energy per event Map Z-Phi";
73 h2RHoccmap = ibooker.
bookProfile2D(st, st +
";module Z;sector Phi", 14, 0, 14, 16, 0, 16, 0., 1.e10,
"");
76 sprintf(
s,
"CastorRecHitEntriesMap");
77 h2RHentriesMap = ibooker.
book2D(
s,
s, 14, 0, 14, 16, 0, 16);
79 h2RHentriesMap->setAxisTitle(
"sector #Phi", 2);
80 h2RHentriesMap->setOption(
"colz");
82 sprintf(
s,
"CastorRecHitTime");
83 hRHtime = ibooker.
book1D(
s,
s, 301, -101., 200.);
85 sprintf(
s,
"CASTORTowerDepth");
86 hTowerDepth = ibooker.
book1D(
s,
s, 130, -15500., -14200.);
89 sprintf(
s,
"CASTORTowerMultiplicity");
90 hTowerMultipl = ibooker.
book1D(
s,
s, 20, 0., 20.);
93 float EhadTow[NEtow + 1];
94 float EMTow[NEtow + 1];
95 float ETower[NEtow + 2];
96 double E0tow = 1. / 1024.;
103 double lnBtow =
log(2.);
104 for (
int j = 1;
j < NEtow;
j++)
105 EMTow[
j + 1] = E0tow *
exp(
j * lnBtow);
106 for (
int j = 1;
j < NEtow;
j++)
107 EhadTow[
j + 1] = E0tow *
exp(
j * lnBtow);
108 for (
int j = 1;
j <= NEtow;
j++)
109 ETower[
j + 1] = E0tow *
exp(
j * lnBtow);
111 sprintf(
s,
"CASTORTowerEMvsEhad");
112 h2TowerEMhad = ibooker.
book2D(
s,
s, NEtow, EhadTow, NEtow, EMTow);
114 h2TowerEMhad->setAxisTitle(
"EM / GeV", 2);
115 h2TowerEMhad->setOption(
"colz");
117 sprintf(
s,
"CASTORTowerTotalEnergy");
118 hTowerE = ibooker.
book1D(
s,
s, NEtow + 1, ETower);
121 sprintf(
s,
"CASTORJetsMultiplicity");
122 hJetsMultipl = ibooker.
book1D(
s,
s, 16, 0., 16.);
124 sprintf(
s,
"CASTORJetEnergy");
125 hJetEnergy = ibooker.
book1D(
s,
s, 5000, 0., 500.);
127 sprintf(
s,
"CASTORJetEta");
128 hJetEta = ibooker.
book1D(
s,
s, 126, -6.3, 6.3);
130 sprintf(
s,
"CASTORJetPhi");
131 hJetPhi = ibooker.
book1D(
s,
s, 63, -3.15, 3.15);
134 std::cout <<
"CastorRecHitMonitor::bookHistograms(end)" << std::endl;
139 if (castorTowers.empty())
143 for (reco::CastorTowerCollection::const_iterator iTower = castorTowers.begin(); iTower != castorTowers.end();
145 hTowerE->Fill(iTower->energy() * 0.001);
146 h2TowerEMhad->Fill(iTower->hadEnergy() * 0.001, iTower->emEnergy() * 0.001);
147 hTowerDepth->Fill(iTower->depth());
155 std::cout <<
"CastorRecHitMonitor::processEvent (begin)" << std::endl;
157 for (
int z = 0; z < 14; z++)
158 for (
int phi = 0; phi < 16; phi++)
159 energyInEachChannel[z][phi] = 0.;
164 if (castorHits.
empty())
167 for (CASTORiter = castorHits.
begin(); CASTORiter != castorHits.
end(); ++CASTORiter) {
168 float energy = CASTORiter->energy();
169 float time = CASTORiter->time();
173 hRHtime->Fill(time2);
185 for (
int phi = 0; phi < 16; phi++) {
187 for (
int z = 0; z < 14; z++) {
188 float rh = energyInEachChannel[z][phi] * 0.001;
189 int ind = z * 16 + phi + 1;
191 h2RHchan->Fill(ind, rh);
195 h2RHoccmap->Fill(z, phi, rh);
198 h2RHvsSec->Fill(phi, es);
202 std::cout <<
"CastorRecHitMonitor::processEvent (end)" << std::endl;
208 for (reco::BasicJetCollection::const_iterator ibegin =
Jets.begin(), iend =
Jets.end(), ijet = ibegin; ijet != iend;
211 float energy = ijet->energy() * 0.001;
213 hJetEta->Fill(ijet->eta());
214 hJetPhi->Fill(ijet->phi());
216 hJetsMultipl->Fill(
nJets);
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", FUNC onbooking=NOOP())
virtual void setCurrentFolder(std::string const &fullpath)
virtual void setOption(const char *option)
std::vector< T >::const_iterator const_iterator
static constexpr int nJets
T getUntrackedParameter(std::string const &, T const &) const
void processEventJets(const reco::BasicJetCollection &Jets)
void bookHistograms(DQMStore::IBooker &, edm::Run const &)
CastorRecHitMonitor(const edm::ParameterSet &ps)
const_iterator begin() const
const_iterator end() const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void processEventTowers(const reco::CastorTowerCollection &castorTowers)
virtual TProfile2D * getTProfile2D() const
void processEvent(const CastorRecHitCollection &castorHits)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
std::vector< CastorTower > CastorTowerCollection
collection of CastorTower objects
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)