+
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
for (Int_t i=0; i<24; i++){
fMaxValue[i]=0;
fTimeDelayCFD[i] = Int_t (param->GetTimeDelayCFD(i));
-
- TGraph* fu = param ->GetWalk(i);
+
+ TGraph* fu = param ->GetWalk(i);
// TGraph* fu = param ->GetAmpLEDRec(i);
fWalk.AddAtAndExpand(fu,i);
}
if (option == "pdc") {
timeWalk = time + Int_t(fMaxValue[ipmt]-walk) ;
- timeEq= timeWalk - fTimeDelayCFD[ipmt];
+ // timeEq= timeWalk - fTimeDelayCFD[ipmt];
+ timeEq= timeWalk - fTimeDelayCFD[ipmt]; //for the same as cosmic
AliDebug(10,Form(" ipmt %i time before %i timeWalk %i , qt %i timeEq %i \n ",
ipmt, time,timeWalk, qt, timeEq ));
}
Float_t zdetA, zdetC;
Int_t sumMultCoeff = 100;
Int_t refpoint=0;
- TH1F *hr;
-
-
-
+
Int_t ph2Mip = fParam->GetPh2Mip();
Float_t channelWidth = fParam->GetChannelWidth() ;
Float_t delayVertex = fParam->GetTimeDelayTVD();
}
timeDelayCFD[0] = fParam->GetTimeDelayCFD(0);
- Int_t meanTimeDelay=200;
-
+
for (Int_t i=0; i<24; i++)
{
Float_t al = countE[i];
TGraph *fu=(TGraph*) fParam ->GetWalk(i) ;
Float_t slew=fu->Eval(Float_t(qtCh));
- trCFD=trCFD-Int_t(fMaxValue[i]-slew);
+ // trCFD=trCFD-Int_t(fMaxValue[i]-slew);
+ trCFD = trCFD-Int_t(fMaxValue[i]-slew) + 2000; //for the same channel as cosmic
ftimeCFD->AddAt(Int_t (trCFD),i);
- AliDebug(10,Form(" pmt %i : time in ns %f time in channels %i ",
- i, timeGaus[i],trCFD ));
+ AliDebug(10,Form(" pmt %i : time in ns %f time in channels %i LEd %i ", i, timeGaus[i],trCFD, trLED ));
AliDebug(10,Form(" qt in mV %f qt in ns %f qt in channels %i ",qt,
TMath::Log(qt), qtCh));
{
timeDiff=Int_t (((besttimeC-besttimeA)+1000*delayVertex)
/channelWidth);
- meanTime=Int_t (((besttimeC+besttimeA)/2. + meanTimeDelay)/channelWidth);
+ meanTime=Int_t (((besttimeC+besttimeA)/2. )/channelWidth);
}
AliDebug(10,Form(" time A& C %i %i time diff && mean time in channels %i %i",bestATDC,bestCTDC, timeDiff, meanTime));
#include <TIterator.h>
#include <TKey.h>
#include <TFile.h>
+#include <TMath.h>
// --- Standard library ---
// Super-basic check on the QA histograms on the input list:
// look whether they are empty!
- printf (" AliT0QAChecker >>check start ");
+
Double_t test = 0.0 ;
Int_t count = 0 ;
+ Double_t nent[100];
+ memset(nent,0,100*sizeof(Double_t));
+ Double_t w[100];
+ memset(w,1.,100*sizeof(Double_t));
+
if (list->GetEntries() == 0){
test = 1. ; // nothing to check
- printf (" AliT0QAChecker >> list->GetEntries() == 0");
}
else {
-
- printf (" AliT0QAChecker >> list->GetEntries() %i",list->GetEntries() );
+
TIter next(list) ;
TH1 * hdata ;
count = 0 ;
while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
if (hdata) {
- printf("!!!! inside count %i; test %f ", count,test);
+ nent[count] = hdata->GetEntries();
+ AliDebug(1,Form("count %i %s -> %f",count, hdata->GetName(),nent[count])) ;
+
Double_t rv = 0.;
if(hdata->GetEntries()>0) rv = 1;
- AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
count++ ;
test += rv ;
+
}
else{
AliError("Data type cannot be processed") ;
}
}
+
if (count != 0) {
if (test==0) {
AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
}
else {
test /= count ;
+ AliDebug(10,Form(" MaxElement %f ", TMath::MaxElement(count,nent)));
+ if(TMath::MaxElement(count,nent) > 1000) {
+ Double_t mean = TMath::Mean(count,nent,w);
+ AliDebug(10,Form(" Mean %f ", mean));
+ for (Int_t i=0; i<count; i++)
+ {
+ Double_t diff = TMath::Abs(nent[i]-mean);
+ if (diff > 0.1*mean )
+ AliInfo(Form("Problem in Number of entried in hist %i is %f\n", i, nent[i])) ;
+ }
+ }
}
}
}
-
AliInfo(Form("Test Result = %f", test)) ;
return test ;
}
void AliT0QADataMakerRec::InitRaws()
{
// create Raw histograms in Raw subdir
- printf(" AliT0QADataMakerRec::InitRaws() started\n");
+ // printf(" AliT0QADataMakerRec::InitRaws() started\n");
TString timename, ampname, qtcname;
TH1F* fhRefPoint = new TH1F("hRefPoint","Ref Point", 10,1252170, 1252180);
qtcname += i;
fhRawCFD[i] = new TH1F(timename.Data(), timename.Data(),500,2100,2800);
Add2RawsList( fhRawCFD[i],i+1);
- fhRawLEDamp[i] = new TH1F(ampname.Data(), ampname.Data(),300,350,650);
+ fhRawLEDamp[i] = new TH1F(ampname.Data(), ampname.Data(),100,300,600);
Add2RawsList( fhRawLEDamp[i],i+24+1);
fhRawQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),1500,1000,7000);
Add2RawsList( fhRawQTC[i],i+48+1);
Add2DigitsList( fhRecMean,3);
*/
+ // printf(" !!!!! AliT0QADataMakerRec::InitRecPoints() started\n");
TString timename,ampname, qtcname;
TH1F *fhRecCFD[24]; TH1F *fhRecLEDAmp[24]; TH1F * fhRecQTC[24];
for (Int_t i=0; i<24; i++)
timename += i;
ampname += i;
qtcname += i;
- fhRecCFD[i] = new TH1F(timename.Data(), timename.Data(),100,0,1000);
+ fhRecCFD[i] = new TH1F(timename.Data(), timename.Data(),100,2100,2800);
Add2RecPointsList ( fhRecCFD[i],i);
- fhRecLEDAmp[i] = new TH1F(ampname.Data(), ampname.Data(),100,0,200);
+ fhRecLEDAmp[i] = new TH1F(ampname.Data(), ampname.Data(),100,3000,4000);
Add2RecPointsList ( fhRecLEDAmp[i],i+24);
- fhRecQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,0,200);
+ fhRecQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,0,10000);
Add2RecPointsList ( fhRecQTC[i],i+48);
}
TH1F *fhRecEff = new TH1F("hRecEff","Efficiency rec.points",25,-0.5,24.5);
- Add2RecPointsList ( fhRecEff,72);
- TH1F * fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,500,600);
- Add2RecPointsList( fhRecMean,73);
+ Add2RecPointsList ( fhRecEff,72);
+ TH1F * fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,2400,2500);
+ Add2RecPointsList( fhRecMean,73);
+ // printf(" !!!!!! AliT0QADataMakerRec::InitRecPoints() ended\n");
}
void AliT0QADataMakerRec::InitESDs()
{
//create ESDs histograms in ESDs subdir
- TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean",100,0,100);
+ /// printf(" !!!!! AliT0QADataMakerESD::InitRecPoints() started\n");
+ TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean",100,2400,2500);
Add2ESDsList(fhESDMean, 0) ;
TH1F * fhESDVertex = new TH1F("hESDvertex","EAD vertex",100,-50,50);
Add2ESDsList(fhESDVertex, 1) ;
+ // printf(" !!!!!! AliT0QADataMakerRec::InitESD() ended\n");
}
for (Int_t iHit=0; iHit<5; iHit++)
allData[i][iHit]= start->GetData(i,iHit);
+ GetRawsData(0) -> Fill( allData[0][0]);
allData[0][0] = allData[0][0] - 5000;
-
+
for (Int_t ik = 0; ik<12; ik++){
for (Int_t iHt=0; iHt<5; iHt++){
if(allData[ik+1][iHt]>0){
{
//fills QA histos for clusters
- AliT0RecPoint* frecpoints= new AliT0RecPoint ();
+ // printf(" !!!!! AliT0QADataMakerRec::MakeRecPoints() started\n");
+ AliT0RecPoint* frecpoints= new AliT0RecPoint ();
if (!frecpoints) {
AliError("Reconstruct Fill ESD >> no recpoints found");
return;
brRec->GetEntry(0);
for ( Int_t i=0; i<24; i++) {
+
GetRecPointsData(i) -> Fill(frecpoints -> GetTime(i));
GetRecPointsData(i+24) -> Fill(frecpoints -> GetAmp(i));
GetRecPointsData(i+48) -> Fill(frecpoints->AmpLED(i));
+
// if(frecpoints -> GetTime(i) > 0) fhRecEff->Fill(i);
}
GetRecPointsData(72) ->Fill(frecpoints->GetMeanTime());
+ // printf(" !!!!! AliT0QADataMakerRec::MakeRecPoints() end\n");
}
void AliT0QADataMakerRec::MakeESDs(AliESDEvent * esd)
{
//fills QA histos for ESD
+ // printf(" !!!!! AliT0QADataMakerRec::MakeESD() started\n");
GetESDsData(0) -> Fill(esd->GetT0());
GetESDsData(1)-> Fill(esd->GetT0zVertex());
virtual ~AliT0RecPoint() {}
const Int_t GetMeanTime() {return fTimeAverage;}
+ const Int_t GetOnlineMean() {return fTimeOnlineMean;}
const Int_t GetBestTimeA() {return fTimeBestA ;}
const Int_t GetBestTimeC() {return fTimeBestC ;}
const Int_t GetMultC() {return fMultC;}
void SetMeanTime(Int_t time) {fTimeAverage=time;}
+ void SetOnlineMean(Int_t time) {fTimeOnlineMean=time;}
void SetTimeBestA( Int_t time) {fTimeBestA = time;}
void SetTimeBestC( Int_t time) {fTimeBestC = time;}
void SetVertex( Float_t vertex) {fVertexPosition= vertex;}
private:
Int_t fTimeAverage; // Average time
+ Int_t fTimeOnlineMean; // online mean signal
Float_t fVertexPosition; // Diffrence time between C and A
Int_t fTimeBestA; //TOF first particle on the A
Int_t fTimeBestC; //TOF first particle on the C
Float_t fADCLED[24]; // array's LED amplitude
- ClassDef(AliT0RecPoint,3) //Digit (Header) object for set:T0
+ ClassDef(AliT0RecPoint,4) //Digit (Header) object for set:T0
};
typedef AliT0RecPoint AliSTARTRecPoint; // for backward compatibility
fDigits->GetTimeLED(*timeLED);
fDigits->GetQT0(*chargeQT0);
fDigits->GetQT1(*chargeQT1);
-
+ Int_t onlineMean = fDigits->MeanTime();
+ cout<<" !!!! onlineMean "<<onlineMean<<endl;
Float_t besttimeA=999999;
Float_t besttimeC=999999;
Float_t vertex = 0;
if(besttimeA !=999999 && besttimeC != 999999 ){
timeDiff = (besttimeC - besttimeA)*channelWidth;
- meanTime = (Float_t((besttimeA + besttimeC)/2) * channelWidth);
+ meanTime = (Float_t((besttimeA + besttimeC -4000)/2) * channelWidth);
// meanTime = (meanT0 - (besttimeA + besttimeC)/2) * channelWidth;
vertex = c*(timeDiff)/2. + (fdZonA - fdZonC)/2; //-(lenr-lenl))/2;
- AliDebug(1,Form(" timeDiff %f ps, meanTime %f ps, vertex %f cm",timeDiff, meanTime,vertex ));
frecpoints->SetVertex(vertex);
frecpoints->SetMeanTime(Int_t(meanTime));
+ //online mean
+ frecpoints->SetOnlineMean(Int_t(onlineMean * channelWidth));
+ AliDebug(1,Form(" timeDiff %f ps, meanTime %f ps, vertex %f cm online mean %i ps",timeDiff, meanTime,vertex, Int_t(onlineMean * channelWidth )));
}
+
//time in each channel as time[ipmt]-MeanTimeinThisChannel(with vertex=0)
+ /*
for (Int_t ipmt=0; ipmt<24; ipmt++) {
if(time[ipmt]>1) {
-// time[ipmt] = (time[ipmt] - fTime0vertex[ipmt])*channelWidth;
+ // time[ipmt] = (time[ipmt] - fTime0vertex[ipmt])*channelWidth;
time[ipmt] =Int_t ( Float_t(time[ipmt]) * channelWidth);
frecpoints->SetTime(ipmt,time[ipmt]);
}
}
+*/
clustersTree->Fill();
delete timeCFD;
}
for (Int_t in=0; in<24; in++)
AliDebug(10, Form(" readed Raw %i %i %i %i %i", in, timeLED[in],timeCFD[in],chargeQT0[in],chargeQT1[in]));
-
+ Int_t onlineMean = allData[49][0];
Float_t time[24], adc[24];
for (Int_t ipmt=0; ipmt<24; ipmt++) {
frecpoints->SetTime(ipmt,Int_t(time[ipmt]));
frecpoints->SetAmp(ipmt,Int_t(adc[ipmt]));
frecpoints->SetAmpLED(ipmt,qt);
- AliDebug(10,Form(" QTC %f mv, time in chann %f ",adc[ipmt] ,time[ipmt]));
+ AliDebug(10,Form(" QTC %f mv, time in chann %f ampLED %f",adc[ipmt] ,time[ipmt], qt));
}
if(option == "cosmic") {
// if(ipmt == 15) continue; //skip crashed PMT
// time[ipmt] = timeCFD[ipmt] ;
Double_t sl = timeLED[ipmt] - timeCFD[ipmt];
time[ipmt] = fCalib-> WalkCorrection( ipmt, Int_t(sl), timeCFD[ipmt],"cosmic" ) ;
- // if(fAmpLEDrec.At(ipmt))
- // qt=((TGraph*)fAmpLEDrec.At(ipmt))->Eval(sl);
+ if(fAmpLEDrec.At(ipmt))
+ qt=((TGraph*)fAmpLEDrec.At(ipmt))->Eval(sl);
time[ipmt] = time[ipmt] - allData[0][0] + 5000;
- AliDebug(10,Form(" ipmt %i QTC %i , time in chann %i (led-cfd) %i ",
- ipmt, Int_t(adc[ipmt]) ,Int_t(time[ipmt]),Int_t( sl)));
+ AliDebug(10,Form(" ipmt %i QTC %i , time in chann %i (led-cfd) %i ampLED %f",
+ ipmt, Int_t(adc[ipmt]) ,Int_t(time[ipmt]),Int_t( sl), qt));
frecpoints->SetTime(ipmt, Float_t(time[ipmt]) );
frecpoints->SetAmp(ipmt, Float_t(adc[ipmt]));
frecpoints->SetAmpLED(ipmt, Float_t(qt));
Float_t vertex = 99999;
if(besttimeA <9999999 && besttimeC < 9999999 ){
timeDiff = ( besttimeC - besttimeA) *channelWidth;
- if(option == "pdc")
- // meanTime = Int_t((meanT0 - (besttimeA + besttimeC)/2) * channelWidth);
- meanTime = (besttimeA + besttimeC)/2 * channelWidth;
- if(option == "cosmic")
+ if(option == "pdc"){
+ // meanTime = (besttimeA + besttimeC)/2 * channelWidth;
+ meanTime = (besttimeA + besttimeC-4000.)/2 * channelWidth;
+ onlineMean = Int_t (onlineMean * channelWidth);
+ }
+ if(option == "cosmic") {
meanTime = Float_t((besttimeA + besttimeC)/2);
+ onlineMean = onlineMean -allData[0][0];;
+ }
vertex = c*(timeDiff)/2.+ (fdZonA - fdZonC)/2;
- AliDebug(1,Form(" timeDiff %f ps, meanTime %f ps, vertex %f cm",timeDiff, meanTime,vertex ));
frecpoints->SetVertex(vertex);
frecpoints->SetMeanTime(Int_t(meanTime));
+ AliDebug(1,Form(" timeDiff %f ps, meanTime %f ps, vertex %f cm online mean %i ",timeDiff, meanTime,vertex, onlineMean));
}
} // if (else )raw data