#include "TFitter.h"
#include "TMatrixD.h"
#include "TRobustEstimator.h"
+#include "TTimeStamp.h"
#include "AliLog.h"
#include "AliMagF.h"
void FitSignals(TTree * treeB, TCut cut="Max-Median>150&&RMS06<2&&abs(Median-Mean09)<0.5", Int_t maxS=100);
-void LaserCalib(TTreeSRedirector & cstream, TTree * chain, Float_t tmin, Float_t tmax, Float_t fraction=0.8);
+void LaserCalib(TTreeSRedirector & cstream, TTree * chain, Float_t tmin, Float_t tmax, Float_t fraction=0.7);
void AnalyzeESDtracks(Int_t run){
//
TTreeSRedirector * pcestream = new TTreeSRedirector("TimeRoot.root");
TTree * treece = (TTree*)fs.Get("Signalce");
if (tree) {
- LaserCalib(*pcestream, treece, 900,1000, 0.8);
+ LaserCalib(*pcestream, treece, 800,1000, 0.7);
delete pcestream;
}
- FitSignals(treeB,"Max-Median>150&&RMS06<1.0&&RMS09<1.5&&abs(Median-Mean09)<0.2&&abs(Mean06-Mean09)<0.2",200);
+ FitSignals(treeB,"Max-Median>150&&RMS06<1.0&&RMS09<1.5&&abs(Median-Mean09)<0.2&&abs(Mean06-Mean09)<0.2",1000);
//
}
//
//
//
+ const Double_t kMaxDelta=10;
AliTPCParamSR param;
param.Update();
TFile fce("TPCsignal.root");
TBranch * brsector = treece->GetBranch("Sector");
TBranch * brpad = treece->GetBranch("Pad");
TBranch * brrow = treece->GetBranch("Row");
+ TBranch * brTimeStamp = treece->GetBranch("TimeStamp");
//
TBranch * brtime = treece->GetBranch("Time");
TBranch * brrms = treece->GetBranch("RMS06");
Int_t sector, pad, row=0;
Double_t time=0, rms=0, qMax=0, qSum=0;
+ UInt_t timeStamp=0;
brsector->SetAddress(§or);
brrow->SetAddress(&row);
brpad->SetAddress(&pad);
+ brTimeStamp->SetAddress(&timeStamp);
brtime->SetAddress(&time);
brrms->SetAddress(&rms);
firstS[isector]=-1;
lastS[isector] =-1;
};
+ TH1F hisT("hisT","hisT",100,tmin,tmax);
+ treece->Draw("Time>>hisT","");
+ Float_t cbin = hisT.GetBinCenter(hisT.GetMaximumBin());
for (Int_t ientry=0; ientry<treece->GetEntriesFast(); ientry++){
treece->GetEvent(ientry);
if (sector!=lastSector && sector==firstSector){
//if (sector!=lastSector){
lentry = ientry;
+ TTimeStamp stamp(timeStamp);
+ stamp.Print();
printf("\nEvent\t%d\tFirst\t%d\tLast\t%d\t%d\n",count, fentry, lentry, lentry-fentry);
//
//
// brtime->GetEvent(ientry2);
// brsector->GetEvent(ientry2);
treece->GetEvent(ientry2);
- if (time>tmin&&time<tmax){
+ if (time>tmin&&time<tmax && TMath::Abs(time-cbin)<kMaxDelta){
padTimes[ngood]=time;
ngood++;
if (firstS[sector]<0) firstS[sector]= ngood;
//
//
Double_t mean,sigma;
- restim.EvaluateUni(ngood,padTimes,mean, sigma,int(ngood*fraction));
+ restim.EvaluateUni(ngood,padTimes,mean, sigma,int(float(ngood)*fraction));
printf("Event\t%d\t%f\t%f\n",count, mean, sigma);
for (Int_t isector=0; isector<72; isector++){
sectorsID[isector]=sector;
if (firstS[isector]>=0 &&lastS[isector]>=0 && lastS[isector]>firstS[isector] ){
Int_t ngoodS = lastS[isector]-firstS[isector];
restim.EvaluateUni(ngoodS, &padTimes[firstS[isector]],meanS[isector],
- sigmaS[isector],int(ngoodS*fraction));
+ sigmaS[isector],int(float(ngoodS)*fraction));
}
}
TGraph graphM(72,sectorsID,meanS);
TGraph graphS(72,sectorsID,sigmaS);
cstream<<"TimeS"<<
+ "CBin="<<cbin<<
"Event="<<count<<
- "GM.="<<&graphM<<
- "GS.="<<&graphS<<
+ "GM="<<&graphM<<
+ "GS="<<&graphS<<
"\n";
Int_t npadS = lastS[sector]-firstS[sector];
cstream<<"Time"<<
"Event="<<count<<
+ "TimeStamp="<<timeStamp<<
+ "CBin="<<cbin<<
"x="<<x<<
"y="<<y<<
"gx="<<gx<<