29 double fitf(
double *
x,
double *par) {
33 double v1 =
pow(wc/n*(x[0]-par[1]), n);
34 double v2 = TMath::Exp(n-wc*(x[0]-par[1]));
35 double v = par[0]*v1*v2;
37 if (x[0] < par[1]) v = 0;
50 fit_ =
new TF1(
"fitShape",
fitf, -200, 200, 4);
51 fit_->SetParameters(50, 10, 0, 0);
54 for (
int i = 0;
i < 2; ++
i)
55 for (
int j = 0;
j < 2; ++
j)
58 dqmStore_->setCurrentFolder(prefixME_ +
"/ESTimingTask");
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] = dqmStore_->book1D(histo, histo, 81, -20.5, 20.5);
68 hTiming_[
i][
j]->setAxisTitle(
"ES Timing (ns)", 1);
71 sprintf(histo,
"ES 2D Timing");
72 h2DTiming_ = dqmStore_->book2D(histo, histo, 81, -20.5, 20.5, 81, -20.5, 20.5);
73 h2DTiming_->setAxisTitle(
"ES- Timing (ns)", 1);
74 h2DTiming_->setAxisTitle(
"ES+ Timing (ns)", 2);
76 htESP_ =
new TH1F(
"htESP",
"Timing ES+", 81, -20.5, 20.5);
77 htESM_ =
new TH1F(
"htESM",
"Timing ES-", 81, -20.5, 20.5);
95 runNum_ = e.
id().
run();
102 int zside, plane, ix, iy, is;
121 if (zside==1 && plane==1 && ix==7 && iy==28)
continue;
122 if (zside==1 && plane==1 && ix==24 && iy==9 && is==21)
continue;
123 if (zside==-1 && plane==2 && ix==35 && iy==17 && is==23)
continue;
125 int i = (zside==1)? 0:1;
128 for (
int k=0;
k<dataframe.
size(); ++
k)
132 if (adc[1] < 200) status = 1;
133 if (fabs(adc[0]) > 10) status = 1;
134 if (adc[1] < 0 || adc[2] < 0) status = 1;
135 if (adc[0] > adc[1] || adc[0] > adc[2]) status = 1;
136 if (adc[2] > adc[1]) status = 1;
138 if (
int(status) == 0) {
143 double aaa = (A2 > 0 && A1 > 0) ?
log(A2/A1)/n_ : 20.;
144 double bbb = wc_/n_*DeltaT;
145 double ccc=
exp(aaa+bbb);
147 double t0 = (2.-ccc)/(1.-ccc) * DeltaT - 5;
148 hTiming_[
i][
j]->Fill(t0);
163 if (zside == 1) htESP_->Fill(t0);
164 else if (zside == -1) htESM_->Fill(t0);
169 LogWarning(
"ESTimingTask") <<
"DigiCollection not available";
172 if (htESP_->GetEntries() > 0 && htESM_->GetEntries() > 0)
173 h2DTiming_->Fill(htESM_->GetMean(), htESP_->GetMean());
181 const ESGain *gain = esgain_.product();
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
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
virtual void beginJob(void)
double fitf(double *x, double *par)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const ESDetId & id() const
void set(const edm::EventSetup &es)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
const ESSample & sample(int i) const
DEFINE_FWK_MODULE(CaloMETProducer)
virtual void endJob(void)
int adc() const
get the ADC sample (singed 16 bits)
ESTimingTask(const edm::ParameterSet &ps)
Power< A, B >::type pow(const A &a, const B &b)