26 double fitf(
double* x,
double* par) {
29 double v1 =
pow(wc /
n * (
x[0] - par[1]),
n);
30 double v2 = TMath::Exp(
n - wc * (
x[0] - par[1]));
31 double v = par[0] * v1 * v2;
45 fit_ =
new TF1(
"fitShape",
fitf, -200, 200, 4);
46 fit_->SetParameters(50, 10, 0, 0);
49 for (
int i = 0;
i < 2; ++
i)
50 for (
int j = 0;
j < 2; ++
j)
51 hTiming_[
i][
j] =
nullptr;
53 htESP_ =
new TH1F(
"htESP",
"Timing ES+", 81, -20.5, 20.5);
54 htESM_ =
new TH1F(
"htESM",
"Timing ES-", 81, -20.5, 20.5);
63 for (
int i = 0;
i < 2; ++
i)
64 for (
int j = 0;
j < 2; ++
j) {
65 int iz = (
i == 0) ? 1 : -1;
66 sprintf(
histo,
"ES Timing Z %d P %d", iz,
j + 1);
71 sprintf(
histo,
"ES 2D Timing");
74 h2DTiming_->setAxisTitle(
"ES+ Timing (ns)", 2);
86 runNum_ =
e.id().run();
93 int zside, plane, ix, iy, is;
98 if (
e.getByToken(digilabel_, digis)) {
110 if (
zside == 1 && plane == 1 && ix == 7 && iy == 28)
112 if (
zside == 1 && plane == 1 && ix == 24 && iy == 9 && is == 21)
114 if (
zside == -1 && plane == 2 && ix == 35 && iy == 17 && is == 23)
117 int i = (
zside == 1) ? 0 : 1;
120 for (
int k = 0;
k < dataframe.
size(); ++
k)
126 if (fabs(
adc[0]) > 10)
128 if (
adc[1] < 0 ||
adc[2] < 0)
139 double aaa = (A2 > 0 && A1 > 0) ?
log(A2 / A1) / n_ : 20.;
140 double bbb = wc_ / n_ * DeltaT;
141 double ccc =
exp(aaa + bbb);
143 double t0 = (2. - ccc) / (1. - ccc) * DeltaT - 5;
144 hTiming_[
i][
j]->Fill(
t0);
161 else if (
zside == -1)
166 LogWarning(
"ESTimingTask") <<
"DigiCollection not available";
169 if (htESP_->GetEntries() > 0 && htESM_->GetEntries() > 0)
170 h2DTiming_->Fill(htESM_->GetMean(), htESP_->GetMean());
const ESDetId & id() const
T getParameter(std::string const &) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
virtual void setCurrentFolder(std::string const &fullpath)
void set(const edm::EventSetup &es)
void analyze(const edm::Event &, const edm::EventSetup &) override
T getUntrackedParameter(std::string const &, T const &) const
int adc() const
get the ADC sample (singed 16 bits)
const ESSample & sample(int i) const
#define DEFINE_FWK_MODULE(type)
double fitf(double *x, double *par)
const_iterator end() const
Namespace of DDCMS conversion namespace.
const_iterator begin() const
The iterator returned can not safely be used across threads.
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
ESTimingTask(const edm::ParameterSet &ps)
uint16_t *__restrict__ uint16_t const *__restrict__ adc
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)