27 double fitf(
double *x,
double *par) {
31 double v1 =
pow(wc/n*(x[0]-par[1]), n);
32 double v2 = TMath::Exp(n-wc*(x[0]-par[1]));
33 double v = par[0]*v1*v2;
35 if (x[0] < par[1]) v = 0;
47 fit_ =
new TF1(
"fitShape",
fitf, -200, 200, 4);
48 fit_->SetParameters(50, 10, 0, 0);
51 for (
int i = 0;
i < 2; ++
i)
52 for (
int j = 0; j < 2; ++j)
53 hTiming_[
i][j] =
nullptr;
55 htESP_ =
new TH1F(
"htESP",
"Timing ES+", 81, -20.5, 20.5);
56 htESM_ =
new TH1F(
"htESM",
"Timing ES-", 81, -20.5, 20.5);
67 for (
int i=0 ;
i<2; ++
i)
68 for (
int j=0 ; j<2; ++j) {
69 int iz = (
i==0)? 1:-1;
70 sprintf(histo,
"ES Timing Z %d P %d", iz, j+1);
71 hTiming_[
i][j] = iBooker.
book1D(histo, histo, 81, -20.5, 20.5);
75 sprintf(histo,
"ES 2D Timing");
76 h2DTiming_ = iBooker.
book2D(histo, histo, 81, -20.5, 20.5, 81, -20.5, 20.5);
78 h2DTiming_->setAxisTitle(
"ES+ Timing (ns)", 2);
91 runNum_ = e.
id().
run();
98 int zside, plane, ix, iy, is;
117 if (zside==1 && plane==1 && ix==7 && iy==28)
continue;
118 if (zside==1 && plane==1 && ix==24 && iy==9 && is==21)
continue;
119 if (zside==-1 && plane==2 && ix==35 && iy==17 && is==23)
continue;
121 int i = (zside==1)? 0:1;
124 for (
int k=0;
k<dataframe.
size(); ++
k)
128 if (adc[1] < 200) status = 1;
129 if (fabs(adc[0]) > 10) status = 1;
130 if (adc[1] < 0 || adc[2] < 0) status = 1;
131 if (adc[0] > adc[1] || adc[0] > adc[2]) status = 1;
132 if (adc[2] > adc[1]) status = 1;
134 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);
159 if (zside == 1) htESP_->Fill(t0);
160 else if (zside == -1) htESM_->Fill(t0);
165 LogWarning(
"ESTimingTask") <<
"DigiCollection not available";
168 if (htESP_->GetEntries() > 0 && htESM_->GetEntries() > 0)
169 h2DTiming_->Fill(htESM_->GetMean(), htESP_->GetMean());
int adc(sample_type sample)
get the ADC sample (12 bits)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
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
const_iterator begin() const
void setCurrentFolder(std::string const &fullpath)
MonitorElement * book1D(Args &&...args)
const ESSample & sample(int i) const
double fitf(double *x, double *par)
Namespace of DDCMS conversion namespace.
MonitorElement * book2D(Args &&...args)
const_iterator end() const
int adc() const
get the ADC sample (singed 16 bits)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
ESTimingTask(const edm::ParameterSet &ps)
Power< A, B >::type pow(const A &a, const B &b)