$Log: AliT0Preprocessor.cxx,v $
Revision 1.8 2007/12/07 15:22:51 alla
bug fixed by Alberto
-
+
Revision 1.7 2007/12/06 16:35:24 alla
new bugs fixed by Tomek
fData(0)
{
//constructor
+ AddRunType("PHYSICS");
+ AddRunType("STANDALONE");
+ AddRunType("LASER");
}
//____________________________________________________
// Creates AliT0DataDCS object
AliPreprocessor::Initialize(run, startTime, endTime);
AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run, TTimeStamp(startTime).AsString(), TTimeStamp(endTime).AsString()));
- fData = new AliT0DataDCS(fRun, fStartTime, fEndTime);
+ fData = new AliT0DataDCS(fRun, fStartTime, fEndTime, GetStartTimeDCSQuery(), GetEndTimeDCSQuery());
}
//____________________________________________________
TString runType = GetRunType();
Log(Form("ProcessDCS - RunType: %s",runType.Data()));
- if((runType == "STANDALONE")||(runType == "PHYSICS")){
- return kFALSE;
+ if((runType == "STANDALONE")||
+ (runType == "PHYSICS")||
+ (runType == "LASER")){
+ // return kFALSE;
+ return kTRUE;
}else{
return kFALSE;
}
metaDataDCS.SetResponsible("Tomasz Malkiewicz");
metaDataDCS.SetComment("This preprocessor fills an AliTODataDCS object.");
AliInfo("Storing DCS Data");
- resultDCSStore = Store("Calib","DCSData",fData, &metaDataDCS);
+ resultDCSStore = StoreReferenceData("Calib","DCSData",fData, &metaDataDCS);
if (!resultDCSStore)
{
Log("Some problems occurred while storing DCS data results in ReferenceDB");
UInt_t AliT0Preprocessor::ProcessLaser(){
// Processing data from DAQ Standalone run
- Log("Processing Laser calibration");
+ Log("Processing Laser calibration - Walk Correction");
Bool_t resultLaser=kFALSE;
//processing DAQ
metaData.SetComment("Walk correction from laser runs.");
resultLaser=Store("Calib","Slewing_Walk", laser, &metaData, 0, 1);
delete laser;
+ Log(Form("resultLaser = %d",resultLaser));
}
else
{
//Processing data from DAQ Physics run
Log("Processing Physics");
- Bool_t resultOnline=kFALSE;
+ Bool_t resultOnline=kFALSE;
//processing DAQ
TList* listPhys = GetFileSources(kDAQ, "PHYSICS");
if (listPhys)
metaData.SetResponsible("Tomek&Michal");
metaData.SetComment("Time equalizing result.");
resultOnline = Store("Calib","TimeDelay", online, &metaData, 0, 1);
+ Log(Form("resultOnline = %d",resultOnline));
delete online;
}
- else
+ else
{
Log(Form("Could not find file with Id PHYSICS in source %s!", sourcePhys->GetName()));
return 1;
}
+
}
if (!resultOnline)
{
- Log("No Laser Data stored");
+ Log("No Data stored");
return 4;//return error code for failure in storing OCDB Data
}
} else {
}
//____________________________________________________
+UInt_t AliT0Preprocessor::ProcessCosmic(){
+ //Processing data from DAQ Physics run
+ Log("Processing Laser Physics");
+
+ Bool_t resultLaserOnline=kFALSE;
+ //processing DAQ
+ TList* listLaser = GetFileSources(kDAQ, "COSMIC");
+ if (listLaser)
+ {
+ TIter iter(listLaser);
+ TObjString *sourceLaser;
+ while ((sourceLaser = dynamic_cast<TObjString *> (iter.Next())))
+ {
+ const char *fileLaser = GetFile(kDAQ, "COSMIC", sourceLaser->GetName());
+ if (fileLaser)
+ {
+ AliT0CalibTimeEq *onlineLaser = new AliT0CalibTimeEq();
+ onlineLaser->Reset();
+ onlineLaser->ComputeOnlineParams(fileLaser);
+ AliCDBMetaData metaData;
+ metaData.SetBeamPeriod(0);
+ metaData.SetResponsible("Tomek&Michal");
+ metaData.SetComment("Time equalizing result.");
+ resultLaserOnline = Store("Calib","LaserTimeDelay", onlineLaser, &metaData, 0, 1);
+ Log(Form("resultLaserOnline = %d",resultLaserOnline));
+ delete onlineLaser;
+ }
+ else
+ {
+ Log(Form("Could not find file with Id COSMIC in source %s!", sourceLaser->GetName()));
+ return 0;
+ }
+
+ }
+ if (!resultLaserOnline)
+ {
+ Log("No Laser Data stored");
+ return 0;//return error code for failure in storing OCDB Data
+ }
+ } else {
+ Log("No sources found for id COSMIC!");
+ return 0;
+ }
+ return 0;
+}
+//____________________________________________________
+
UInt_t AliT0Preprocessor::Process(TMap* dcsAliasMap )
{
// T0 preprocessor return codes:
Log(Form("RunType: %s",runType.Data()));
//processing
if(runType == "STANDALONE"){
- Int_t iresultLaser = ProcessLaser();
- if(dcsDP==1){
- Int_t iresultDCS = ProcessDCSDataPoints(dcsAliasMap);
- return iresultDCS;
- }
- return iresultLaser;
+ if(dcsDP==1){
+ Int_t iresultDCS = ProcessDCSDataPoints(dcsAliasMap);
+ return iresultDCS;
+ }
}
- else if(runType == "PHYSICS"){
- Int_t iresultPhysics = ProcessPhysics();
- if(dcsDP==1){
- Int_t iresultDCS = ProcessDCSDataPoints(dcsAliasMap);
- return iresultDCS;
- }
- return iresultPhysics;
- }
-
- return 0;
+ if(runType == "LASER"){
+ Int_t iresultLaser = ProcessLaser();
+ if(dcsDP==1){
+ Int_t iresultDCS = ProcessDCSDataPoints(dcsAliasMap);
+ return iresultDCS;
+ }
+ Log(Form("iresultLaser = %d",iresultLaser));
+ return iresultLaser;
+ }
+ else if(runType == "PHYSICS"){
+ Int_t iresultPhysics = ProcessPhysics();
+ // Int_t iresultCosmic = ProcessCosmic();
+ if(dcsDP==1){
+ Int_t iresultDCS = ProcessDCSDataPoints(dcsAliasMap);
+ return iresultDCS;
+ }
+ Log(Form("iresultPhysics = %d",iresultPhysics));
+ return iresultPhysics;
+ // Log(Form("iresultPhysics =iresultCosmic %d",iresultCosmic));
+ // return iresultCosmic;
+ }
+
+ return 0;
}