/*
T0 DA for online calibration
-
+
Contact: Michal.Oledzki@cern.ch
Link: http://users.jyu.fi/~mioledzk/
Run Type: PHYSICS
case 'a': {fscanf(inp, "%d", &ccbx ); break;} //N of X bins hCFD1_CFD
case 'b': {fscanf(inp, "%f", &cclx ); break;} //Low x hCFD1_CFD
case 'c': {fscanf(inp, "%f", &ccmx ); break;} //High x hCFD1_CFD
- case 'd': {fscanf(inp, "%d", &cbx ); break;} //N of X bins hCFD
- case 'e': {fscanf(inp, "%f", &clx ); break;} //Low x hCFD
- case 'f': {fscanf(inp, "%f", &cmx ); break;} //High x hCFD
+// case 'd': {fscanf(inp, "%d", &cbx ); break;} //N of X bins hCFD
+// case 'e': {fscanf(inp, "%f", &clx ); break;} //Low x hCFD
+// case 'f': {fscanf(inp, "%f", &cmx ); break;} //High x hCFD
}
}
fclose(inp);
// Allocation of histograms - start
- TH1F *hCFD1_CFD[24];
- TH1F *hCFD[24];
+ TH1F *hCFD1minCFD[24];
for(Int_t ic=0; ic<24; ic++) {
- if(ic<12) {
- hCFD1_CFD[ic] = new TH1F(Form("CFD1-CFD%d",ic+1),"CFD-CFD",ccbx,cclx,ccmx);
- hCFD[ic] = new TH1F(Form("CFD%i",ic+1),"CFD",cbx,clx,cmx);
- }
- if(ic>11){
- hCFD1_CFD[ic] = new TH1F(Form("CFD13-CFD%i",ic+1),"CFD-CFD",ccbx,cclx,ccmx);
- hCFD[ic] = new TH1F(Form("CFD%i",ic+1),"CFD",cbx,clx,cmx);
- }
+ hCFD1minCFD[ic] = new TH1F(Form("CFD1-CFD%d",ic+1),"CFD-CFD",ccbx,cclx,ccmx);
}
// Allocation of histograms - end
if (event==NULL) {
continue;
}
-
-// iev++;
/* use event - here, just write event id to result file */
eventT=event->eventType;
break;
case PHYSICS_EVENT:
+// case CALIBRATION_EVENT:
iev++;
if(iev==1){
printf("First event - %i\n",iev);
}
-// printf(" event number = %i \n",iev);
-
// Initalize raw-data reading and decoding
AliRawReader *reader = new AliRawReaderDate((void*)event);
// Enable the following two lines in case of real-data
- // reader->LoadEquipmentIdsMap("T0map.txt");
- // reader->RequireHeader(kFALSE);
- // reader->RequireHeader(kTRUE);
+ reader->RequireHeader(kTRUE);
AliT0RawReader *start = new AliT0RawReader(reader, kTRUE);
// Read raw data
for(Int_t i0=0;i0<105;i0++)
for(Int_t j0=0;j0<5;j0++)
allData[i0][j0] = 0;
-
-
- if(start->Next())
- for (Int_t i=0; i<105; i++) {
+
+ if(start->Next()){
+ for (Int_t i=0; i<105; i++) {
for(Int_t iHit=0;iHit<5;iHit++){
allData[i][iHit]= start->GetData(i,iHit);
}
+ }
}
else
- printf("No T0 data found!!\n");
+ printf("No T0 data found!!!\n");
// Fill the histograms
- for (Int_t ik = 0; ik<24; ik+=2)
+ for (Int_t ik = 0; ik<24; ik++)
for (Int_t iHt=0; iHt<5; iHt++){
- Int_t cc = ik/2;
- if(allData[cc+1][iHt]!=0 ){
- hCFD1_CFD[cc]->Fill(allData[cc+1][iHt]-allData[1][iHt]);
- hCFD[cc]->Fill(allData[cc+13][iHt]);
+ if(allData[ik+1][iHt]!=0 ){
+ if(ik<12){
+ hCFD1minCFD[ik]->Fill(allData[ik+1][iHt]-allData[1][iHt]);
+ }
+ if(ik>11){
+ hCFD1minCFD[ik]->Fill(allData[ik+45][iHt]-allData[57][iHt]);
+ }
}
}
- for (Int_t ik = 24; ik<48; ik+=2)
- for (Int_t iHt=0; iHt<5; iHt++){
- Int_t cc = ik/2;
- if(allData[cc+45][iHt]!=0 ){
- hCFD1_CFD[cc]->Fill(allData[cc+45][iHt]-allData[57][iHt]);
- hCFD[cc]->Fill(allData[cc+45][iHt]);
- }
- }
-
delete start;
start = 0x0;
reader->Reset();
}
-
-
/* free resources */
free(event);
TFile *hist = new TFile(FILE_OUT,"RECREATE");
for(Int_t j=0;j<24;j++){
- hCFD1_CFD[j]->Write();
- hCFD[j]->Write();
+ hCFD1minCFD[j]->Write();
}
hist->Close();
delete hist;
status=0;
/* export file to FXS */
- if (daqDA_FES_storeFile(FILE_OUT, FILE_OUT)) {
+ if (daqDA_FES_storeFile(FILE_OUT, "PHYSICS")) {
status=-2;
}