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);
67 hTiming_[
i][
j] = iBooker.
book1D(histo, histo, 81, -20.5, 20.5);
71 sprintf(histo,
"ES 2D Timing");
72 h2DTiming_ = iBooker.
book2D(histo, histo, 81, -20.5, 20.5, 81, -20.5, 20.5);
74 h2DTiming_->setAxisTitle(
"ES+ Timing (ns)", 2);
86 runNum_ = e.
id().
run();
93 int zside, plane, ix, iy, is;
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)
130 if (adc[0] > adc[1] || adc[0] > adc[2])
135 if (
int(status) == 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());
T getUntrackedParameter(std::string const &, T const &) const
static std::vector< std::string > checklist log
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
double fitf(double *x, double *par)
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const ESDetId & id() const
void set(const edm::EventSetup &es)
void analyze(const edm::Event &, const edm::EventSetup &) override
Exp< T >::type exp(const T &t)
bool getData(T &iHolder) const
const ESSample & sample(int i) const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
int adc() const
get the ADC sample (singed 16 bits)
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)
Power< A, B >::type pow(const A &a, const B &b)
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)