TOF DA for online calibration
+Contact: Chiara.Zampolli@bo.infn.it
+Link: www.bo.infn.it/~zampolli
+Run Type: PHYSICS
+DA Type: MON
+Number of events needed: depending on the run, being run-level
+Input Files: TOFdaTotal.root, to be updated if existing
+Output Files: TOFdaRun.root, TOFdaTotal.root, both to be exported to the DAQ FXS
+Trigger types used: PHYSICS_EVENT
+
*/
#define FILE_TOTAL "TOFdaTotal.root"
#define FILE_RUN "TOFdaRun.root"
// DATE
-extern "C" {
#include <daqDA.h>
-}
#include <event.h>
#include <monitor.h>
#include <AliRawReaderDate.h>
#include <AliRawReader.h>
#include <AliTOFGeometry.h>
-#include <AliTOFGeometryV5.h>
#include <AliT0RawReader.h>
#include <AliDAQ.h>
#include <AliTOFHitData.h>
#include <TObject.h>
#include <TMath.h>
#include <TSystem.h>
+#include "TROOT.h"
+#include "TPluginManager.h"
/* Main routine
int main(int argc, char **argv) {
- AliTOFGeometry * geomV5 = new AliTOFGeometryV5();
+ /* magic line from Rene */
+ gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
+ "*",
+ "TStreamerInfo",
+ "RIO",
+ "TStreamerInfo()");
+
AliTOFGeometry * geom = new AliTOFGeometry();
- static const Int_t size = geomV5->NPadXSector()*geomV5->NSectors();
+ static const Int_t size = AliTOFGeometry::NPadXSector()*AliTOFGeometry::NSectors();
static const Int_t nbins = 500;
static const Int_t binmin = -20;
const Float_t c = 2.99792458E10; //speed of light
//T0 event
Int_t meantime = 0;
- AliT0RawReader *rawReaderT0 = new AliT0RawReader(rawReader);
+ AliT0RawReader *rawReaderT0 = new AliT0RawReader(rawReader,kTRUE);
if (!rawReaderT0->Next()) {
printf("T0: no raw data found!\n");
- } else {
- Int_t allData[110][5];
- for (Int_t i=0; i<110; i++) {
+ }
+ else {
+ /*
+ Int_t allData[105][5];
+ for (Int_t i=0; i<105; i++) {
allData[i][0]=rawReaderT0->GetData(i,0);
- }
+ }
meantime = allData[49][0];
- //printf("time zero (ns) = %i (%f) \n", meantime, meantime*25*1E-3-200);
+ */
+ meantime = rawReaderT0->GetData(49,0);
+ // printf("time zero (ns) = %i (%f) \n", meantime, (meantime*24.4-200)*1E-3); // debugging purpose
}
delete rawReaderT0;
rawReaderT0 = 0x0;
rawReader->Reset();
-
+
//TOF event
Int_t dummy = -1;
Int_t Volume[5];
Volume[3] = Volume[4];
Volume[4] = dummy;
Int_t tof = (Int_t)((Double_t)HitData->GetTime()*1E3/AliTOFGeometry::TdcBinWidth());
- Int_t index = rawStreamTOF->GetIndex(Volume);
+ Int_t index = geom->GetIndex(Volume);
Float_t pos[3];
- geomV5->GetPosPar(Volume,pos);
+ geom->GetPosPar(Volume,pos);
Float_t texp=TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]+pos[2]*pos[2])/c*1E9; //expected time in ns
Float_t texpBin=(texp*1E3-32)/AliTOFGeometry::TdcBinWidth(); //expected time in number of TDC bin
Int_t deltabin = tof-TMath::Nint(texpBin); //to be used with real data; rounding expected time to Int_t
}
}
- delete geomV5;
- geomV5 = 0x0;
delete geom;
geom = 0x0;
status=0;
/* export file to FXS */
- if (daqDA_FES_storeFile(FILE_RUN, FILE_RUN)) {
+ if (daqDA_FES_storeFile(FILE_RUN, "RUNLevel")) {
status=-2;
}
- if (daqDA_FES_storeFile(FILE_TOTAL, FILE_TOTAL)) {
+ if (daqDA_FES_storeFile(FILE_TOTAL, "DELAYS")) {
status=-2;
}