+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+/* $Id: $ */
+
+/////////////////////////////////////////////////////////////////////////////
+// //
+// This class contains the basic functions for the time zero //
+// evaluation with TOF detecyor informations. //
+// //
+/////////////////////////////////////////////////////////////////////////////
+
#include <Riostream.h>
#include <stdlib.h>
ClassImp(AliTOFT0maker)
//____________________________________________________________________________
- AliTOFT0maker::AliTOFT0maker(): fESDswitch(0), fTimeResolution(115), fT0sigma(1000)
+ AliTOFT0maker::AliTOFT0maker():
+fCalib(new AliTOFcalibHisto()),
+ fESDswitch(0),
+ fTimeResolution(115),
+ fT0sigma(1000)
{
- fCalib = new AliTOFcalibHisto();
+ //fCalib = new AliTOFcalibHisto();
fCalib->LoadCalibPar();
if(AliPID::ParticleMass(0) == 0) new AliPID();
}
//____________________________________________________________________________
+AliTOFT0maker::AliTOFT0maker(const AliTOFT0maker & t) :
+TObject(),
+ fCalib(t.fCalib),
+ fESDswitch(t.fESDswitch),
+ fTimeResolution(t.fTimeResolution),
+ fT0sigma(t.fT0sigma)
+{
+}
+
+//____________________________________________________________________________
+AliTOFT0maker& AliTOFT0maker::operator=(const AliTOFT0maker &t)
+{
+ //
+ // assign. operator
+ //
+
+ if (this == &t)
+ return *this;
+ fCalib = t.fCalib;
+ fESDswitch = t.fESDswitch;
+ fTimeResolution = t.fTimeResolution;
+ fT0sigma = t.fT0sigma;
+
+ return *this;
+}
+//____________________________________________________________________________
AliTOFT0maker::~AliTOFT0maker()
{
// dtor
}
//____________________________________________________________________________
Double_t* AliTOFT0maker::RemakePID(AliESDEvent *esd,Double_t t0time,Double_t t0sigma){
- Double_t* calcolot0;
+ //
+ // Remake TOF PID probabilities
+ //
+
+ Double_t calcolot0[3];
+ Double_t *t0tof;
AliTOFT0v1* t0maker=new AliTOFT0v1(esd);
t0maker->SetCalib(fCalib);
t0maker->SetTimeResolution(fTimeResolution*1e-12);
if(! fESDswitch){
- calcolot0=t0maker->DefineT0RawCorrection("all");
+ t0tof=t0maker->DefineT0RawCorrection("all");
TakeTimeRawCorrection(esd);
}
- else calcolot0=t0maker->DefineT0("all");
+ else t0tof=t0maker->DefineT0("all");
- calcolot0[0]*=-1000;
- calcolot0[1]*=1000;
-
- Float_t T0Current;
+ Float_t lT0Current=0.;
fT0sigma=1000;
- if(calcolot0[1] < 300){
+ Int_t nrun = esd->GetRunNumber();
+ Double_t t0fill = GetT0Fill(nrun);
+
+ calcolot0[0]=-1000*t0tof[0];
+ calcolot0[1]=1000*t0tof[1];
+ calcolot0[2] = t0fill;
+
+ if(calcolot0[1] < 150 && TMath::Abs(calcolot0[0] - t0fill) < 500){
fT0sigma=calcolot0[1];
- T0Current=calcolot0[0];
+ lT0Current=calcolot0[0];
}
if(t0sigma < 1000){
Double_t wtot = w1+w2;
- T0Current = (w1*t0time + w2*calcolot0[0]) / wtot;
+ lT0Current = (w1*t0time + w2*calcolot0[0]) / wtot;
fT0sigma = TMath::Sqrt(1./wtot);
}
else{
- T0Current=t0time;
+ lT0Current=t0time;
fT0sigma=t0sigma;
}
}
- Int_t nrun = esd->GetRunNumber();
- Double_t t0fill = GetT0Fill(nrun);
-
if(fT0sigma >= 1000){
- T0Current = t0fill;
+ lT0Current = t0fill;
fT0sigma = 135;
+
+ calcolot0[0] = t0fill;
+ calcolot0[1] = 150;
}
- RemakeTOFpid(esd,T0Current);
+ RemakeTOFpid(esd,lT0Current);
return calcolot0;
}
//____________________________________________________________________________
-void AliTOFT0maker::TakeTimeRawCorrection(AliESDEvent *esd){
+void AliTOFT0maker::TakeTimeRawCorrection(AliESDEvent * const esd){
+ //
+ // Take raw corrections for time measurements
+ //
+
Int_t ntracks = esd->GetNumberOfTracks();
while (ntracks--) {
}
//____________________________________________________________________________
void AliTOFT0maker::RemakeTOFpid(AliESDEvent *esd,Float_t timezero){
+ //
+ // Recalculate TOF PID probabilities
+ //
+
AliESDpid pidESD;
pidESD.GetTOFResponse().SetTimeResolution(TMath::Sqrt(fT0sigma*fT0sigma + fTimeResolution*fTimeResolution));
pidESD.MakePID(esd,kFALSE,timezero);
}
//____________________________________________________________________________
-Double_t AliTOFT0maker::GetT0Fill(Int_t nrun){
+Double_t AliTOFT0maker::GetT0Fill(Int_t nrun) const {
+ //
+ // Return T0 of filling
+ //
+
Double_t t0;
if(nrun==104065) t0= 1771614;
else if(nrun==104068) t0= 1771603;
//-- Mod By SA.
//////////////////////////////////////////////////////////////////////////////
-#include <Riostream.h>
-#include <stdlib.h>
+#include "Riostream.h"
-#include <TBenchmark.h>
-#include <TCanvas.h>
-#include <TClonesArray.h>
-#include <TFile.h>
-#include <TFolder.h>
-#include <TFrame.h>
-#include <TH1.h>
-#include <TH2.h>
-#include <TProfile.h>
-#include <TParticle.h>
-#include <TROOT.h>
-#include <TSystem.h>
-#include <TTree.h>
-#include <TVirtualMC.h>
#include "AliTOFT0v1.h"
-#include "AliMC.h"
#include "AliESDtrack.h"
-#include "AliESD.h"
-#include <AliStack.h>
-#include "AliESDtrackCuts.h"
#include "AliTOFcalibHisto.h"
+#include "AliESDEvent.h"
ClassImp(AliTOFT0v1)
//____________________________________________________________________________
-AliTOFT0v1::AliTOFT0v1(AliESDEvent* event)
+AliTOFT0v1::AliTOFT0v1():
+ fLowerMomBound(0.4),
+ fUpperMomBound(2.0),
+ fTimeResolution(0.80e-10),
+ fTimeCorr(0.),
+ fEvent(0x0),
+ fCalib(0x0)
{
- fLowerMomBound=0.4; // [GeV/c] default value pp
- fUpperMomBound=2.0 ; // [GeV/c] default value pp
- fTimeResolution = 0.80e-10; // 80 ps by default
- fTimeCorr = 0.0; // in ns by default
- fLOffset=0.0;
- fT0Offset=0.0;
- fEvent=event;
-
+ //
+ // default constructor
+ //
+
fT0SigmaT0def[0]=-999.;
fT0SigmaT0def[1]=999.;
fT0SigmaT0def[2]=-999.;
fT0SigmaT0def[3]=-999.;
- fDeltaTfromMisallinement = 0.; // in ps
+}
+
+
+//____________________________________________________________________________
+AliTOFT0v1::AliTOFT0v1(AliESDEvent* event):
+ fLowerMomBound(0.4),
+ fUpperMomBound(2.0),
+ fTimeResolution(0.80e-10),
+ fTimeCorr(0.),
+ fEvent(event),
+ fCalib(0x0)
+{
+ //
+ // real constructor
+ //
+
+ fT0SigmaT0def[0]=-999.;
+ fT0SigmaT0def[1]= 999.;
+ fT0SigmaT0def[2]=-999.;
+ fT0SigmaT0def[3]=-999.;
+
}
//____________________________________________________________________________
-AliTOFT0v1::AliTOFT0v1(const AliTOFT0v1 & tzero)
+AliTOFT0v1::AliTOFT0v1(const AliTOFT0v1 & tzero):
+ TObject(),
+ fLowerMomBound(tzero.fLowerMomBound),
+ fUpperMomBound(tzero.fUpperMomBound),
+ fTimeResolution(tzero.fTimeResolution),
+ fTimeCorr(tzero.fTimeCorr),
+ fEvent(tzero.fEvent),
+ fCalib(tzero.fCalib)
{
- ( (AliTOFT0v1 &)tzero ).Copy(*this);
+ //
+ // copy constructor
+ //
+
+ fT0SigmaT0def[0]=tzero.fT0SigmaT0def[0];
+ fT0SigmaT0def[1]=tzero.fT0SigmaT0def[1];
+ fT0SigmaT0def[2]=tzero.fT0SigmaT0def[2];
+ fT0SigmaT0def[3]=tzero.fT0SigmaT0def[3];
+
}
+//____________________________________________________________________________
+AliTOFT0v1& AliTOFT0v1::operator=(const AliTOFT0v1 &tzero)
+{
+ //
+ // assign. operator
+ //
+
+ if (this == &tzero)
+ return *this;
+
+ fLowerMomBound=tzero.fLowerMomBound;
+ fUpperMomBound=tzero.fUpperMomBound;
+ fTimeResolution=tzero.fTimeResolution;
+ fTimeCorr=tzero.fTimeCorr;
+ fEvent=tzero.fEvent;
+ fCalib=tzero.fCalib;
+ fT0SigmaT0def[0]=tzero.fT0SigmaT0def[0];
+ fT0SigmaT0def[1]=tzero.fT0SigmaT0def[1];
+ fT0SigmaT0def[2]=tzero.fT0SigmaT0def[2];
+ fT0SigmaT0def[3]=tzero.fT0SigmaT0def[3];
+
+ return *this;
+}
//____________________________________________________________________________
AliTOFT0v1::~AliTOFT0v1()
{
// dtor
-
+ fCalib=NULL;
+ fEvent=NULL;
+
}
+//____________________________________________________________________________
void AliTOFT0v1::SetTimeResolution(Double_t timeresolution){
+ // Set the TOF time resolution
fTimeResolution=timeresolution;
}
//____________________________________________________________________________
//____________________________________________________________________________
Double_t * AliTOFT0v1::DefineT0(Option_t *option)
{
- Float_t timeresolutioninns=fTimeResolution*(1.e+9) * TMath::Sqrt(2.); // convert in [ns]
+ // Caluclate the Event Time using the ESD TOF time
+
+ Float_t timeresolutioninns=fTimeResolution*(1.e+9) * TMath::Sqrt(2.); // convert in [ns]
const Int_t nmaxtracksinset=10;
if(strstr(option,"all")){
Int_t nsets=0;
- Int_t NusedTracks=0;
+ Int_t nUsedTracks=0;
Int_t ngoodsetsSel= 0;
Float_t t0bestSel[300];
- Float_t Et0bestSel[300];
- Float_t ChisquarebestSel[300];
- Float_t ConfLevelbestSel[300];
+ Float_t eT0bestSel[300];
+ Float_t chiSquarebestSel[300];
+ Float_t confLevelbestSel[300];
Float_t t0bestallSel=0.;
- Float_t Et0bestallSel=0.;
+ Float_t eT0bestallSel=0.;
Float_t sumWt0bestallSel=0.;
- Float_t Emeantzeropi=0.;
+ Float_t eMeanTzeroPi=0.;
Float_t meantzeropi=0.;
Float_t sumAllweightspi=0.;
Double_t t0def=-999;
if (!(mom<=fUpperMomBound && mom>=fLowerMomBound))continue;
if (!AcceptTrack(t)) continue;
-
-#if 0
- /* old code with dependence from libANALYSIS */
- AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts();
- Bool_t tpcRefit = kTRUE;
- Double_t nSigma = 4;
- Bool_t sigmaToVertex = kTRUE;
- esdTrackCuts->SetRequireSigmaToVertex(sigmaToVertex);
- if (sigmaToVertex) {
- esdTrackCuts->SetMaxNsigmaToVertex(nSigma);
- }
- else{
- esdTrackCuts->SetMaxDCAToVertexZ(3.0);
- esdTrackCuts->SetMaxDCAToVertexXY(3.0);
- }
- esdTrackCuts->SetRequireTPCRefit(tpcRefit);
- esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
- esdTrackCuts->SetMinNClustersTPC(50);
- esdTrackCuts->SetMaxChi2PerClusterTPC(3.5);
- Bool_t accepted;
- accepted=esdTrackCuts->AcceptTrack(t);
- if(!accepted) continue;
-#endif
if(t->GetP() < fLowerMomBound || t->GetIntegratedLength() < 350 || t->GetTOFsignalToT() < 0.000000001)continue; //skip decays
if(time <= mintime) mintime=time;
}
- cout << " T0 offset selected for this sample : " << fT0Offset << endl;
cout << " N. of ESD tracks : " << ntrk << endl;
cout << " N. of preselected tracks : " << ngoodtrk << endl;
cout << " Minimum tof time in set (in ns) : " << mintime << endl;
cout << " number of sets = " << nset << endl;
- if(strstr(option,"tim") || strstr(option,"all"))gBenchmark->Start("TOFT0v1");
-
// Loop over selected sets
if(nset>=1){
for (Int_t i=0; i< nset; i++) {
Float_t t0best=999.;
- Float_t Et0best=999.;
+ Float_t eT0best=999.;
Float_t chisquarebest=99999.;
Int_t npionbest=0;
Double_t toflen=t->GetIntegratedLength();
toflen=toflen/100.; // toflen given in m
- timeofflight[j]=time+fT0Offset;
- tracktoflen[j]=toflen+fLOffset;
+ timeofflight[j]=time;
+ tracktoflen[j]=toflen;
exptof[j][0]=exptime[2]*1.E-3+fTimeCorr;// in ns
exptof[j][1]=exptime[3]*1.E-3+fTimeCorr;
exptof[j][2]=exptime[4]*1.E-3+fTimeCorr;
}
Float_t sumAllweights=0.;
Float_t meantzero=0.;
- Float_t Emeantzero=0.;
+ Float_t eMeanTzero=0.;
for (Int_t itz=0; itz<ntracksinsetmy;itz++) {
sqTrackError[itz]=
} // end loop for (Int_t itz=0; itz<15;itz++)
meantzero=meantzero/sumAllweights; // it is given in [ns]
- Emeantzero=sqrt(1./sumAllweights); // it is given in [ns]
+ eMeanTzero=sqrt(1./sumAllweights); // it is given in [ns]
// calculate chisquare
npionbest=npion;
chisquarebest=chisquare;
t0best=meantzero;
- Et0best=Emeantzero;
+ eT0best=eMeanTzero;
} // close if(dummychisquare<=chisquare)
}
Float_t sumAllweights=0.;
Float_t meantzero=0.;
- Float_t Emeantzero=0.;
+ Float_t eMeanTzero=0.;
for (Int_t itz=0; itz<ntracksinsetmy;itz++) {
if(! usetrack[itz]) continue;
} // end loop for (Int_t itz=0; itz<15;itz++)
meantzero=meantzero/sumAllweights; // it is given in [ns]
- Emeantzero=sqrt(1./sumAllweights); // it is given in [ns]
+ eMeanTzero=sqrt(1./sumAllweights); // it is given in [ns]
// calculate chisquare
npionbest=npion;
chisquarebest=chisquare;
t0best=meantzero;
- Et0best=Emeantzero;
+ eT0best=eMeanTzero;
} // close if(dummychisquare<=chisquare)
}
// Pick up only those with C.L. >1%
// if(confLevel>0.01 && ngoodsetsSel<200){
if(confLevel>0.01 && ngoodsetsSel<200){
- ChisquarebestSel[ngoodsetsSel]=chisquarebest;
- ConfLevelbestSel[ngoodsetsSel]=confLevel;
- t0bestSel[ngoodsetsSel]=t0best/Et0best/Et0best;
- Et0bestSel[ngoodsetsSel]=1./Et0best/Et0best;
- t0bestallSel += t0best/Et0best/Et0best;
- sumWt0bestallSel += 1./Et0best/Et0best;
+ chiSquarebestSel[ngoodsetsSel]=chisquarebest;
+ confLevelbestSel[ngoodsetsSel]=confLevel;
+ t0bestSel[ngoodsetsSel]=t0best/eT0best/eT0best;
+ eT0bestSel[ngoodsetsSel]=1./eT0best/eT0best;
+ t0bestallSel += t0best/eT0best/eT0best;
+ sumWt0bestallSel += 1./eT0best/eT0best;
ngoodsetsSel++;
ngoodtrktrulyused+=ntracksinsetmyCut;
}
} // end for the current set
- NusedTracks = ngoodtrkt0;
+ nUsedTracks = ngoodtrkt0;
if(strstr(option,"all")){
if(sumAllweightspi>0.){
meantzeropi=meantzeropi/sumAllweightspi; // it is given in [ns]
- Emeantzeropi=sqrt(1./sumAllweightspi); // it is given in [ns]
+ eMeanTzeroPi=sqrt(1./sumAllweightspi); // it is given in [ns]
}
if(sumWt0bestallSel>0){
t0bestallSel = t0bestallSel/sumWt0bestallSel;
- Et0bestallSel = sqrt(1./sumWt0bestallSel);
+ eT0bestallSel = sqrt(1./sumWt0bestallSel);
}// end of if(sumWt0bestallSel>0){
- cout << "T0 all " << t0bestallSel << " +/- " << Et0bestallSel << "Number of tracks used: "<<ngoodtrktrulyused<<endl;
+ cout << "T0 all " << t0bestallSel << " +/- " << eT0bestallSel << "Number of tracks used: "<<ngoodtrktrulyused<<endl;
}
t0def=t0bestallSel;
- deltat0def=Et0bestallSel;
- if ((t0bestallSel==0)&&(Et0bestallSel==0)){
+ deltat0def=eT0bestallSel;
+ if ((TMath::Abs(t0bestallSel) < 0.001)&&(TMath::Abs(eT0bestallSel)<0.001)){
t0def=-999; deltat0def=0.600;
}
}
if(strstr(option,"tim") || strstr(option,"all")){
- gBenchmark->Stop("TOFT0v1");
cout << "AliTOFT0v1:" << endl ;
- cout << " took " << gBenchmark->GetCpuTime("TOFT0v1") << " seconds in order to calculate T0 " << endl ;
}
printf("T0 from TOF = %f ns\n",fT0SigmaT0def[0]);
//__________________________________________________________________
Double_t * AliTOFT0v1::DefineT0RawCorrection(Option_t *option)
{
+ // Caluclate the Event Time using the RAW+correction TOF time
+
Float_t timeresolutioninns=fTimeResolution*(1.e+9); // convert in [ns]
const Int_t nmaxtracksinset=10;
Float_t stripmean = 0;
Int_t nsets=0;
- Int_t NusedTracks=0;
+ Int_t nUsedTracks=0;
Int_t ngoodsetsSel= 0;
Float_t t0bestSel[300];
- Float_t Et0bestSel[300];
- Float_t ChisquarebestSel[300];
- Float_t ConfLevelbestSel[300];
+ Float_t eT0bestSel[300];
+ Float_t chiSquarebestSel[300];
+ Float_t confLevelbestSel[300];
Float_t t0bestallSel=0.;
- Float_t Et0bestallSel=0.;
+ Float_t eT0bestallSel=0.;
Float_t sumWt0bestallSel=0.;
- Float_t Emeantzeropi=0.;
+ Float_t eMeanTzeroPi=0.;
Float_t meantzeropi=0.;
Float_t sumAllweightspi=0.;
Double_t t0def=-999;
Double_t corr = fCalib->GetFullCorrection(chan,tot) - fCalib->GetCorrection(AliTOFcalibHisto::kTimeSlewingCorr,chan,0);
time -= corr*1000.;
- Int_t crate = fCalib->GetCalibMap(AliTOFcalibHisto::kDDL,chan);
+ Int_t crate = (Int_t) fCalib->GetCalibMap(AliTOFcalibHisto::kDDL,chan);
if(crate == 63 || crate == 62){
time += 9200;
}
- Int_t strip = fCalib->GetCalibMap(AliTOFcalibHisto::kSectorStrip,chan);
+ Int_t strip = (Int_t) fCalib->GetCalibMap(AliTOFcalibHisto::kSectorStrip,chan);
time*=1.E-3; // tof given in nanoseconds
if (!(mom<=fUpperMomBound && mom>=fLowerMomBound))continue;
if (!AcceptTrack(t)) continue;
-
-#if 0
- /* old code with dependence from libANALYSIS */
- AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts();
- Bool_t tpcRefit = kTRUE;
- Double_t nSigma = 4;
- Bool_t sigmaToVertex = kTRUE;
- esdTrackCuts->SetRequireSigmaToVertex(sigmaToVertex);
- if (sigmaToVertex) {
- esdTrackCuts->SetMaxNsigmaToVertex(nSigma);
- }
- else{
- esdTrackCuts->SetMaxDCAToVertexZ(3.0);
- esdTrackCuts->SetMaxDCAToVertexXY(3.0);
- }
- esdTrackCuts->SetRequireTPCRefit(tpcRefit);
- esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
- esdTrackCuts->SetMinNClustersTPC(50);
- esdTrackCuts->SetMaxChi2PerClusterTPC(3.5);
- Bool_t accepted;
- accepted=esdTrackCuts->AcceptTrack(t);
- if(!accepted) continue;
-#endif
if(t->GetP() < fLowerMomBound || t->GetIntegratedLength() < 350 || t->GetTOFsignalToT() < 0.000000001)continue; //skip decays
if(time <= mintime) mintime=time;
}
if(ngoodtrk) stripmean /= ngoodtrk;
- cout << " T0 offset selected for this sample : " << fT0Offset << endl;
cout << " N. of ESD tracks : " << ntrk << endl;
cout << " N. of preselected tracks : " << ngoodtrk << endl;
cout << " Minimum tof time in set (in ns) : " << mintime << endl;
Double_t corr = fCalib->GetFullCorrection(chan,tot) - fCalib->GetCorrection(AliTOFcalibHisto::kTimeSlewingCorr,chan,0);
time -= corr*1000.;
- Int_t create = fCalib->GetCalibMap(AliTOFcalibHisto::kDDL,chan);
- if(create == 63 || create == 62){
+ Int_t crate = (Int_t) fCalib->GetCalibMap(AliTOFcalibHisto::kDDL,chan);
+ if(crate == 63 || crate == 62){
time += 9200;
}
cout << " number of sets = " << nset << endl;
- if(strstr(option,"tim") || strstr(option,"all"))gBenchmark->Start("TOFT0v1");
-
// Loop over selected sets
if(nset>=1){
for (Int_t i=0; i< nset; i++) {
Float_t t0best=999.;
- Float_t Et0best=999.;
+ Float_t eT0best=999.;
Float_t chisquarebest=99999.;
Int_t npionbest=0;
Double_t corr = fCalib->GetFullCorrection(chan,tot) - fCalib->GetCorrection(AliTOFcalibHisto::kTimeSlewingCorr,chan,0);
time -= corr*1000.;
- Int_t create = fCalib->GetCalibMap(AliTOFcalibHisto::kDDL,chan);
- if(create == 63 || create == 62){
+ Int_t crate = (Int_t) fCalib->GetCalibMap(AliTOFcalibHisto::kDDL,chan);
+ if(crate == 63 || crate == 62){
time += 9200;
}
Double_t toflen=t->GetIntegratedLength();
toflen=toflen/100.; // toflen given in m
- timeofflight[j]=time+fT0Offset;
- tracktoflen[j]=toflen+fLOffset;
+ timeofflight[j]=time;
+ tracktoflen[j]=toflen;
exptof[j][0]=exptime[2]*1.E-3+fTimeCorr;// in ns
exptof[j][1]=exptime[3]*1.E-3+fTimeCorr;
exptof[j][2]=exptime[4]*1.E-3+fTimeCorr;
}
Float_t sumAllweights=0.;
Float_t meantzero=0.;
- Float_t Emeantzero=0.;
+ Float_t eMeanTzero=0.;
Double_t sumAllSquare=0.;
for (Int_t itz=0; itz<ntracksinsetmy;itz++) {
} // end loop for (Int_t itz=0; itz<15;itz++)
meantzero=meantzero/sumAllweights; // it is given in [ns]
- Emeantzero=sqrt(1./sumAllweights); // it is given in [ns]
+ eMeanTzero=sqrt(1./sumAllweights); // it is given in [ns]
//changed
for (Int_t itz=0; itz<ntracksinsetmy;itz++) {
sumAllSquare+= (timezero[itz] - meantzero)*(timezero[itz] - meantzero);
}
- // Emeantzero = TMath::Sqrt(sumAllSquare/ntracksinsetmy);
+ // eMeanTzero = TMath::Sqrt(sumAllSquare/ntracksinsetmy);
// calculate chisquare
npionbest=npion;
chisquarebest=chisquare;
t0best=meantzero;
- Et0best=Emeantzero;
+ eT0best=eMeanTzero;
} // close if(dummychisquare<=chisquare)
}
Float_t sumAllweights=0.;
Float_t meantzero=0.;
- Float_t Emeantzero=0.;
+ Float_t eMeanTzero=0.;
Double_t sumAllSquare=0;
for (Int_t itz=0; itz<ntracksinsetmy;itz++) {
} // end loop for (Int_t itz=0; itz<15;itz++)
meantzero=meantzero/sumAllweights; // it is given in [ns]
- Emeantzero=sqrt(1./sumAllweights); // it is given in [ns]
+ eMeanTzero=sqrt(1./sumAllweights); // it is given in [ns]
//changed
for (Int_t itz=0; itz<ntracksinsetmy;itz++) {
if(! usetrack[itz]) continue;
sumAllSquare+= (timezero[itz] - meantzero)*(timezero[itz] - meantzero);
}
- // Emeantzero = TMath::Sqrt(sumAllSquare/ntracksinsetmyCut);
+ // eMeanTzero = TMath::Sqrt(sumAllSquare/ntracksinsetmyCut);
// calculate chisquare
npionbest=npion;
chisquarebest=chisquare;
t0best=meantzero;
- Et0best=Emeantzero;
+ eT0best=eMeanTzero;
} // close if(dummychisquare<=chisquare)
}
// Pick up only those with C.L. >1%
// if(confLevel>0.01 && ngoodsetsSel<200){
if(confLevel>0.01 && ngoodsetsSel<200){
- ChisquarebestSel[ngoodsetsSel]=chisquarebest;
- ConfLevelbestSel[ngoodsetsSel]=confLevel;
- t0bestSel[ngoodsetsSel]=t0best/Et0best/Et0best;
- Et0bestSel[ngoodsetsSel]=1./Et0best/Et0best;
- t0bestallSel += t0best/Et0best/Et0best;
- sumWt0bestallSel += 1./Et0best/Et0best;
+ chiSquarebestSel[ngoodsetsSel]=chisquarebest;
+ confLevelbestSel[ngoodsetsSel]=confLevel;
+ t0bestSel[ngoodsetsSel]=t0best/eT0best/eT0best;
+ eT0bestSel[ngoodsetsSel]=1./eT0best/eT0best;
+ t0bestallSel += t0best/eT0best/eT0best;
+ sumWt0bestallSel += 1./eT0best/eT0best;
ngoodsetsSel++;
ngoodtrktrulyused+=ntracksinsetmyCut;
} // end for the current set
- NusedTracks = ngoodtrkt0;
+ nUsedTracks = ngoodtrkt0;
if(strstr(option,"all")){
if(sumAllweightspi>0.){
meantzeropi=meantzeropi/sumAllweightspi; // it is given in [ns]
- Emeantzeropi=sqrt(1./sumAllweightspi); // it is given in [ns]
+ eMeanTzeroPi=sqrt(1./sumAllweightspi); // it is given in [ns]
}
if(sumWt0bestallSel>0){
t0bestallSel = t0bestallSel/sumWt0bestallSel;
- Et0bestallSel = sqrt(1./sumWt0bestallSel);
+ eT0bestallSel = sqrt(1./sumWt0bestallSel);
}// end of if(sumWt0bestallSel>0){
- cout << "T0 all " << t0bestallSel << " +/- " << Et0bestallSel << "Number of tracks used: "<<ngoodtrktrulyused<<endl;
+ cout << "T0 all " << t0bestallSel << " +/- " << eT0bestallSel << "Number of tracks used: "<<ngoodtrktrulyused<<endl;
}
t0def=t0bestallSel;
- deltat0def=Et0bestallSel;
- if ((t0bestallSel==0)&&(Et0bestallSel==0)){
+ deltat0def=eT0bestallSel;
+ if ((TMath::Abs(t0bestallSel)<0.001)&&(TMath::Abs(eT0bestallSel)<0.001)){
t0def=-999; deltat0def=0.600;
}
}
}
- if(strstr(option,"tim") || strstr(option,"all")){
- gBenchmark->Stop("TOFT0v1");
- cout << "AliTOFT0v1:" << endl ;
- cout << " took " << gBenchmark->GetCpuTime("TOFT0v1") << " seconds in order to calculate T0 " << endl ;
- }
printf("T0 from TOF = %f ns\n",fT0SigmaT0def[0]);
return fT0SigmaT0def;
}
-//__________________________________________________________________
-void AliTOFT0v1::SetTZeroFile(char * file ){
- cout << "Destination file : " << file << endl ;
- fT0File=file;
-}
-//__________________________________________________________________
-void AliTOFT0v1::Print(Option_t* /*option*/)const
-{
- cout << "------------------- "<< GetName() << " -------------" << endl ;
- if(!fT0File.IsNull())
- cout << " Writing T0 Distribution to file " << (char*) fT0File.Data() << endl ;
-}
//__________________________________________________________________
-Bool_t AliTOFT0v1::operator==( AliTOFT0v1 const &tzero )const
+Float_t AliTOFT0v1::GetMomError(Int_t index, Float_t mom, Float_t texp) const
{
- // Equal operator.
- //
- if( (fTimeResolution==tzero.fTimeResolution)&&(fLowerMomBound==tzero.fLowerMomBound)&&(fUpperMomBound==tzero.fUpperMomBound))
- return kTRUE ;
- else
- return kFALSE ;
-}
+ // Take the error extimate for the TOF time in the track reconstruction
-
-//__________________________________________________________________
-Float_t AliTOFT0v1::GetMomError(Int_t index, Float_t mom, Float_t texp)
-{
static const Double_t kMasses[]={
0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
};
}
//____________________________________________________________________
-Float_t AliTOFT0v1::GetSigmaToVertex(AliESDtrack* esdTrack)
+Float_t AliTOFT0v1::GetSigmaToVertex(AliESDtrack* esdTrack) const
{
// Calculates the number of sigma to the vertex.