13 #include <TGraphErrors.h>
41 for (
int i=0;i<48*4;i++){
42 if ((EU[i]>0) && (ED[i]>0)) {
69 int CenterOffsetU = 20-MaxU;
70 int CenterOffsetD = 20-MaxD;
76 int idx = n+CenterOffsetU;
81 if ((idx>=60)||(idx<0)){
88 for (
unsigned int k=0;k<
Sector.size();k++){
117 int idx = n+CenterOffsetU;
129 for (
unsigned int k=0;k<
Sector.size();k++){
156 int idx = n+CenterOffsetD;
161 if ((idx>=60)||(idx<0)){
175 int idx = n+CenterOffsetD;
195 for (
int k=0; k<60; k++){
199 for (
int k=0; k<60; k++){
212 for (
int k=0;k<60;k++){
229 TGraph* grU =
new TGraph(60,x,
ProfileU);
232 grU->Fit(
"gaus",
"Q",
"r",15.,25.);
233 TF1 *f1U = grU->GetFunction(
"gaus");
237 posU = f1U->GetParameter(1);
242 if (TMath::Abs(posU-20.)>2.){
243 f1U->SetParameter(1,20.);
244 f1U->FixParameter(2,1.0);
246 grU->Fit(
"gaus",
"Q",
"r",15.,25.);
247 f1U = grU->GetFunction(
"gaus");
248 posU = f1U->GetParameter(1);
249 if (TMath::Abs(posU-20.)>2.){
253 }
else if (UCounter){
257 cout<<
"Error no data to fit U: this should never happen!!!"<<endl;
276 TGraph* grD =
new TGraph(60,x,
ProfileD);
278 grD->Fit(
"gaus",
"Q",
"r",15.,25.);
280 TF1 *f1D = grD->GetFunction(
"gaus");
283 posD = f1D->GetParameter(1);
288 if (TMath::Abs(posD-20.)>2.){
289 f1D->SetParameter(1,20.);
290 f1D->FixParameter(2,1.0);
292 grD->Fit(
"gaus",
"Q",
"r",15.,25.);
293 f1D = grD->GetFunction(
"gaus");
294 posD = f1D->GetParameter(1);
295 if (TMath::Abs(posD-20.)>2.){
299 }
else if (DCounter){
303 cout<<
"Error no data to fit D: this should never happen!!!"<<endl;
316 float phiD = (posD-20.+MaxD+0.5) * 2.*3.1415926/(48.*4.) ;
317 float phiU = (posU-20.+MaxU+0.5) * 2.*3.1415926/(48.*4.) ;
326 for (
unsigned int k=0;k<60;k++){
332 double E = TMath::Sqrt(ESumU*ESumD)/TMath::Exp(-195./300.);
337 double Position[4] = {0.,0.,0.,0.};
338 double err[4] = {200.,200.,200.,200.};
339 double ex[4] = {0.,0.,0.,0.};
340 double Pcnt[4] = {0.,0.,0.,0.};
341 for (
unsigned int k=0;k<
MeanTime.size();k++){
348 MTaverage /= (float)
MeanTime.size();
356 for (
int k=0;k<4;k++){
358 Position[k] /= Pcnt[k];
375 for (
int k=0;k<4;k++){
392 double xx[4] = {1.,3.,8.,15.};
393 TGraphErrors* grT =
new TGraphErrors(4,xx,Position,ex,err);
394 grT->Fit(
"pol1",
"Q",
"R",low,high);
395 TF1 * lfit = grT->GetFunction(
"pol1");
396 double offset = lfit->GetParameter(0);
417 for (
int i=0;i<48*4;i++){
422 for (
unsigned int i=0;i<
HitsU.size();i++){
427 for (
unsigned int i=0;i<
HitsD.size();i++){
436 for (
int k=0;k<60;k++){
vector< float > DeltaTime
void fillArrays(float *, float *)
DBCALClump(vector< const DBCALHit * >, vector< const DBCALHit * >)
vector< const DBCALHit * > HitsU
vector< const DBCALHit * > HitsD