1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //#include <Riostream.h>
28 #include <TObjArray.h>
29 #include <TObjString.h>
30 #include <TTimeStamp.h>
32 #include "AliCDBMetaData.h"
33 #include "AliCDBEntry.h"
35 #include "AliTOFChannelOnline.h"
36 #include "AliTOFChannelOnlineStatus.h"
37 #include "AliTOFDataDCS.h"
38 #include "AliTOFGeometry.h"
39 #include "AliTOFPreprocessor.h"
40 #include "AliTOFFEEReader.h"
44 //class AliTOFGeometry;
46 // TOF preprocessor class.
47 // It takes data from DCS and passes them to the class AliTOFDataDCS, which
48 // processes them. The result is then written to the CDB.
49 // analogously, it takes data form DAQ (both at Run level and inclusive -
50 // of all the runs - level, processes them, and stores both Reference Data
51 // and Online Calibration files in the CDB.
52 // Processing of Pulser/Noise Run data and of TOF FEE DCS map
56 // return=1 : no DCS input data Map
57 // return=2 : no DCS input data processing
58 // return=3 : no DCS processed data was stored in Ref Data
59 // return=4 : no DAQ input for Ref Data
60 // return=5 : failed to store DAQ Ref Data
61 // return=6 : failed to retrieve DAQ data for calibration
62 // return=7 : problems in processing histos in the input DAQ file
63 // return=8 : failed to store Online Delays
64 // return=9 : failed to store Reference Data for Pulser
65 // return=10: failed to retrieve Pulser data
66 // return=11: failed to store Pulser map in OCDB
67 // return=12: failed to store Reference Data for Noise
68 // return=13: failed to retrieve Noise data
69 // return=14: failed to store Noise map in OCDB
70 // return=15: failed to retrieve FEE data from FXS
71 // return=16: failed to retrieve FEE data from OCDB
72 // return=17: failed to store FEE data in OCDB
73 // return=18: failed to store FEE reference data in OCDB
75 ClassImp(AliTOFPreprocessor)
77 const Int_t AliTOFPreprocessor::fgkBinRangeAve = 13; // number of bins where to calculate the mean
78 const Double_t AliTOFPreprocessor::fgkIntegralThr = 100; // min number of entries to perform computation of delay per channel
79 const Double_t AliTOFPreprocessor::fgkThrPar = 0.013; // parameter used to trigger the calculation of the delay
81 //_____________________________________________________________________________
83 AliTOFPreprocessor::AliTOFPreprocessor(AliShuttleInterface* shuttle) :
84 AliPreprocessor("TOF", shuttle),
95 AddRunType("PHYSICS");
101 //_____________________________________________________________________________
103 AliTOFPreprocessor::~AliTOFPreprocessor()
129 //______________________________________________________________________________
130 void AliTOFPreprocessor::Initialize(Int_t run, UInt_t startTime,
133 // Creates AliTOFDataDCS object
135 AliPreprocessor::Initialize(run, startTime, endTime);
137 AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
138 TTimeStamp(startTime).AsString(),
139 TTimeStamp(endTime).AsString()));
141 fData = new AliTOFDataDCS(fRun, fStartTime, fEndTime);
142 fData->SetFDRFlag(fFDRFlag);
144 fNChannels = AliTOFGeometry::NSectors()*(2*(AliTOFGeometry::NStripC()+AliTOFGeometry::NStripB())+AliTOFGeometry::NStripA())*AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX();
145 fCal = new TObjArray(fNChannels);
147 for (Int_t ich = 0; ich<fNChannels; ich ++){
148 AliTOFChannelOnline * calChOnline = new AliTOFChannelOnline();
149 fCal->AddAt(calChOnline,ich);
151 fCalStatus = new TObjArray(fNChannels);
152 fCalStatus->SetOwner();
153 for (Int_t ich = 0; ich<fNChannels; ich ++){
154 AliTOFChannelOnlineStatus * calChOnlineStatus = new AliTOFChannelOnlineStatus();
155 fCalStatus->AddAt(calChOnlineStatus,ich);
157 fFEEStatus = new TObjArray(fNChannels);
158 fFEEStatus->SetOwner();
159 for (Int_t ich = 0; ich<fNChannels; ich ++){
160 AliTOFChannelOnlineStatus * calChOnlineStatus = new AliTOFChannelOnlineStatus();
161 fFEEStatus->AddAt(calChOnlineStatus,ich);
164 //_____________________________________________________________________________
165 Bool_t AliTOFPreprocessor::ProcessDCS(){
167 // check whether DCS should be processed or not...
169 TString runType = GetRunType();
170 Log(Form("RunType %s",runType.Data()));
172 if (runType != "PHYSICS"){
178 //_____________________________________________________________________________
180 UInt_t AliTOFPreprocessor::ProcessDCSDataPoints(TMap* dcsAliasMap)
182 // Fills data into a AliTOFDataDCS object
185 Log("Processing DCS DP");
186 TH1::AddDirectory(0);
188 Bool_t resultDCSMap=kFALSE;
189 Bool_t resultDCSStore=kFALSE;
194 Log("No DCS map found: TOF exiting from Shuttle");
195 return 1;// return error Code for DCS input data not found
198 // The processing of the DCS input data is forwarded to AliTOFDataDCS
199 resultDCSMap=fData->ProcessData(*dcsAliasMap);
201 Log("Some problems occurred while processing DCS data, TOF exiting from Shuttle");
202 return 2;// return error Code for processed DCS data not stored
205 AliCDBMetaData metaDataDCS;
206 metaDataDCS.SetBeamPeriod(0);
207 metaDataDCS.SetResponsible("Chiara Zampolli");
208 metaDataDCS.SetComment("This preprocessor fills an AliTOFDataDCS object.");
209 AliInfo("Storing DCS Data");
210 resultDCSStore = StoreReferenceData("Calib","DCSData",fData, &metaDataDCS);
211 if (!resultDCSStore){
212 Log("Some problems occurred while storing DCS data results in Reference Data, TOF exiting from Shuttle");
213 return 3;// return error Code for processed DCS data not stored
221 //_____________________________________________________________________________
223 UInt_t AliTOFPreprocessor::ProcessOnlineDelays()
225 // Processing data from DAQ for online calibration
227 Log("Processing DAQ delays");
229 TH1::AddDirectory(0);
231 Bool_t resultDAQRef=kFALSE;
232 Bool_t resultTOFPP=kFALSE;
238 //retrieving data at Run level
239 TList* list = GetFileSources(kDAQ, "RUNLevel");
240 if (list !=0x0 && list->GetEntries()!=0)
242 AliInfo("The following sources produced files with the id RUNLevel");
244 for (Int_t jj=0;jj<list->GetEntries();jj++){
245 TObjString * str = dynamic_cast<TObjString*> (list->At(jj));
246 AliInfo(Form("found source %s", str->String().Data()));
247 // file to be stored run per run
248 TString fileNameRun = GetFile(kDAQ, "RUNLevel", str->GetName());
249 if (fileNameRun.Length()>0){
250 AliInfo(Form("Got the file %s, now we can store the Reference Data for the current Run.", fileNameRun.Data()));
251 daqFile = new TFile(fileNameRun.Data(),"READ");
252 fh2 = (TH2S*) daqFile->Get("htof");
253 AliCDBMetaData metaDataHisto;
254 metaDataHisto.SetBeamPeriod(0);
255 metaDataHisto.SetResponsible("Chiara Zampolli");
256 metaDataHisto.SetComment("This preprocessor stores the array of histos object as Reference Data.");
257 AliInfo("Storing Reference Data");
258 resultDAQRef = StoreReferenceData("Calib","DAQData",fh2, &metaDataHisto);
260 Log("some problems occurred::No Reference Data stored, TOF exiting from Shuttle");
261 return 5;//return error code for failure in storing Ref Data
268 Log("The input data file from DAQ (run-level) was not found, TOF exiting from Shuttle ");
269 return 4;//return error code for failure in retrieving Ref Data
275 Log("The input data file list from DAQ (run-level) was not found, TOF exiting from Shuttle ");
276 return 4;//return error code for failure in retrieving Ref Data
281 //Total files, with cumulative histos
283 TList* listTot = GetFileSources(kDAQ, "DELAYS");
284 if (listTot !=0x0 && listTot->GetEntries()!=0)
286 AliInfo("The following sources produced files with the id DELAYS");
288 for (Int_t jj=0;jj<listTot->GetEntries();jj++){
289 TObjString * str = dynamic_cast<TObjString*> (listTot->At(jj));
290 AliInfo(Form("found source %s", str->String().Data()));
292 // file with summed histos, to extract calib params
293 TString fileName = GetFile(kDAQ, "DELAYS", str->GetName());
294 if (fileName.Length()>0){
295 AliInfo(Form("Got the file %s, now we can extract some values.", fileName.Data()));
297 daqFile = new TFile(fileName.Data(),"READ");
299 fh2 = (TH2S*) daqFile->Get("htoftot");
301 Log("some problems occurred:: No histo retrieved, TOF exiting from Shuttle");
303 return 7; //return error code for histograms not existing/junky
306 static const Int_t kSize=fh2->GetNbinsX();
307 static const Int_t kNBins=fh2->GetNbinsY();
308 static const Double_t kXBinmin=fh2->GetYaxis()->GetBinLowEdge(1);
309 if (kSize != fNChannels){
310 Log(" number of bins along x different from number of pads, found only a subset of the histograms, TOF exiting from Shuttle");
312 return 7; //return error code for histograms not existing/junky
314 Int_t nNotStatistics = 0; // number of channel with not enough statistics
315 for (Int_t ich=0;ich<kSize;ich++){
316 TH1S *h1 = new TH1S("h1","h1",kNBins,kXBinmin-0.5,kNBins*1.+kXBinmin-0.5);
317 for (Int_t ibin=0;ibin<kNBins;ibin++){
318 h1->SetBinContent(ibin+1,fh2->GetBinContent(ich+1,ibin+1));
320 if(h1->Integral()<fgkIntegralThr) {
322 if (!fFDRFlag) Log(Form(" Not enough statistics for bin %i, skipping this channel",ich)); // printing message only if not in FDR runs
327 if (!fFDRFlag) { // not computing delays if in FDR runs
329 Float_t minContent=h1->Integral()*fgkThrPar;
330 Int_t nbinsX = h1->GetNbinsX();
332 for (Int_t j=1; j<=nbinsX; j++){
334 h1->GetBinContent(j) +
335 h1->GetBinContent(j+1)+
336 h1->GetBinContent(j+2)+
337 h1->GetBinContent(j+3))>minContent){
343 if(!found) AliInfo(Form("WARNING!!! no start of fit found for histo # %i",ich));
344 // Now calculate the mean over the interval.
348 for(Int_t k=0;k<fgkBinRangeAve;k++){
349 mean=mean+h1->GetBinCenter(startBin+k)*h1->GetBinContent(startBin+k);
350 nent=nent+h1->GetBinContent(startBin+k);
351 sumw2=sumw2+(h1->GetBinCenter(startBin+k))*(h1->GetBinCenter(startBin+k))*(h1->GetBinContent(startBin+k));
353 mean= mean/nent; //<x>
354 sumw2=sumw2/nent; //<x^2>
356 rmsmean = TMath::Sqrt((sumw2-mean*mean)/nent);
357 if (ich<fNChannels) {
358 AliTOFChannelOnline * ch = (AliTOFChannelOnline *)fCal->At(ich);
359 ch->SetDelay((Double_t)mean*AliTOFGeometry::TdcBinWidth()*1.E-3); // delay in ns
360 // ch->SetStatus(1); // calibrated channel, removed for the time being from AliTOFChannelOnline
366 if (nNotStatistics!=0) Log(Form("Too little statistics for %d channels!",nNotStatistics));
372 Log("The Cumulative data file from DAQ does not exist, TOF exiting from Shuttle");
373 return 6;//return error code for problems in retrieving DAQ data
379 Log("Problem: no list for Cumulative data file from DAQ was found, TOF exiting from Shuttle");
380 return 6; //return error code for problems in retrieving DAQ data
384 AliCDBMetaData metaData;
385 metaData.SetBeamPeriod(0);
386 metaData.SetResponsible("Chiara Zampolli");
387 metaData.SetComment("This preprocessor fills a TObjArray object.");
388 AliInfo("Storing Calibration Data");
389 resultTOFPP = Store("Calib","ParOnline",fCal, &metaData,0,kTRUE);
391 Log("Some problems occurred while storing online object resulting from DAQ data processing");
392 return 8;//return error code for problems in storing DAQ data
397 //_____________________________________________________________________________
399 UInt_t AliTOFPreprocessor::ProcessPulserData()
401 // Processing Pulser Run data for TOF channel status
403 Log("Processing Pulser");
405 TH1::AddDirectory(0);
407 Bool_t resultPulserRef=kFALSE;
408 Bool_t resultPulser=kFALSE;
410 static const Int_t kSize = AliTOFGeometry::NPadXSector()*AliTOFGeometry::NSectors();
411 TH1S * htofPulser = new TH1S("hTOFpulser","histo with signals on TOF during pulser", kSize,-0.5,kSize-0.5);
412 for (Int_t ibin =1;ibin<=kSize;ibin++){
413 htofPulser->SetBinContent(ibin,-1);
416 // retrieving last stored pulser object, and copying
418 AliCDBEntry *cdbEntry = GetFromOCDB("Calib","Pulser");
420 TObjArray *currentCalStatus = (TObjArray*)cdbEntry->GetObject();
421 for (Int_t ich = 0; ich<fNChannels; ich ++){
422 AliTOFChannelOnlineStatus * calChOnlineSt = (AliTOFChannelOnlineStatus*)fCalStatus->At(ich);
423 calChOnlineSt->SetStatus(((AliTOFChannelOnlineStatus*)currentCalStatus->At(ich))->GetStatus());
432 //retrieving Pulser data
433 TList* listPulser = GetFileSources(kDAQ, "PULSER");
434 if (listPulser !=0x0 && listPulser->GetEntries()!=0)
436 AliInfo("The following sources produced files with the id PULSER");
438 for (Int_t jj=0;jj<listPulser->GetEntries();jj++){
439 TObjString * str = dynamic_cast<TObjString*> (listPulser->At(jj));
440 AliInfo(Form("found source %s", str->String().Data()));
441 // file to be stored run per run
442 TString fileNamePulser = GetFile(kDAQ, "PULSER", str->GetName());
443 if (fileNamePulser.Length()>0){
444 // storing refernce data
445 AliInfo(Form("Got the file %s, now we can process pulser data.", fileNamePulser.Data()));
446 daqFile = new TFile(fileNamePulser.Data(),"READ");
447 h1 = (TH1S*) daqFile->Get("hTOFpulser");
448 for (Int_t ibin=0;ibin<kSize;ibin++){
449 if ((h1->GetBinContent(ibin+1))!=-1){
450 if ((htofPulser->GetBinContent(ibin+1))==-1){
451 htofPulser->SetBinContent(ibin+1,h1->GetBinContent(ibin+1));
454 Log(Form("Something strange occurred during Pulser run, channel %i already read by another LDC, please check!",ibin));
462 Int_t nreadNotEmpty=0;
463 for (Int_t ientry=1;ientry<=h1->GetNbinsX();ientry++){
465 /* check whether channel has been read out during current run.
466 * if the status is bad it means it has not been read out.
467 * in this case skip channel in order to not affect the mean */
468 if (((AliTOFChannelOnlineStatus *)fFEEStatus->At(ientry-1))->GetStatus() == AliTOFChannelOnlineStatus::kTOFHWBad)
471 if (h1->GetBinContent(ientry)==-1) continue;
473 if (h1->GetBinContent(ientry)>0) {
475 AliDebug(1,Form(" channel %i is ok with entry = %f; so far %i channels added ",ientry-1,h1->GetBinContent(ientry),nreadNotEmpty));
477 mean+=h1->GetBinContent(ientry);
483 AliDebug(1,Form(" nread = %i , mean = %f",nread,mean));
484 for (Int_t ich =0;ich<fNChannels;ich++){
485 AliTOFChannelOnlineStatus * chSt = (AliTOFChannelOnlineStatus *)fCalStatus->At(ich);
486 if (h1->GetBinContent(ich+1)==-1) continue;
487 AliDebug(1,Form(" channel %i ",ich));
488 AliDebug(1,Form(" channel status before pulser = %i",(Int_t)chSt->GetStatus()));
490 /* check whether channel has been read out during current run.
491 * if the status is bad it means it has not been read out.
492 * in this case skip channel in order to leave its status
494 if (((AliTOFChannelOnlineStatus *)fFEEStatus->At(ich))->GetStatus() == AliTOFChannelOnlineStatus::kTOFHWBad)
497 if (h1->GetBinContent(ich+1)<0.05*mean){
498 chSt->SetStatus(chSt->GetStatus()|AliTOFChannelOnlineStatus::kTOFPulserBad); // bad status for pulser
499 AliDebug(1,Form(" channel status after pulser = %i",(Int_t)chSt->GetStatus()));
502 chSt->SetStatus(chSt->GetStatus()|AliTOFChannelOnlineStatus::kTOFPulserOk); // bad status for pulser
503 AliDebug(1,Form(" channel status after pulser = %i",(Int_t)chSt->GetStatus()));
508 Log("No channels read!! No action taken, keeping old status");
517 Log("The input data file from DAQ (pulser) was not found, TOF exiting from Shuttle ");
518 return 10;//return error code for failure in retrieving Ref Data
526 Log("The input data file list from DAQ (pulser) was not found, TOF exiting from Shuttle ");
527 return 10;//return error code for failure in retrieving Ref Data
532 AliCDBMetaData metaData;
533 metaData.SetBeamPeriod(0);
534 metaData.SetResponsible("Chiara Zampolli");
535 metaData.SetComment("This preprocessor fills a TObjArray object for Pulser data.");
536 AliInfo("Storing Calibration Data from Pulser Run");
537 resultPulser = Store("Calib","Pulser",fCalStatus, &metaData,0,kTRUE);
539 Log("Some problems occurred while storing online object resulting from Pulser data processing");
540 return 11;//return error code for problems in storing Pulser data
545 AliCDBMetaData metaDataHisto;
546 metaDataHisto.SetBeamPeriod(0);
547 metaDataHisto.SetResponsible("Chiara Zampolli");
549 sprintf(comment,"This preprocessor stores the result of the pulser run");
550 metaDataHisto.SetComment(comment);
551 AliInfo("Storing Reference Data");
552 resultPulserRef = StoreReferenceData("Calib","PulserData",htofPulser, &metaDataHisto);
553 if (!resultPulserRef){
554 Log("some problems occurred::No Reference Data for pulser stored, TOF exiting from Shuttle");
555 return 9;//return error code for failure in storing Ref Data
563 //_____________________________________________________________________________
565 UInt_t AliTOFPreprocessor::ProcessNoiseData()
568 // Processing Noise Run data for TOF channel status
570 Log("Processing Noise");
572 TH1::AddDirectory(0);
574 Bool_t resultNoiseRef=kFALSE;
575 Bool_t resultNoise=kFALSE;
577 static const Int_t kSize = AliTOFGeometry::NPadXSector()*AliTOFGeometry::NSectors();
578 TH1F * htofNoise = new TH1F("hTOFnoise","histo with signals on TOF during pulser", kSize,-0.5,kSize-0.5);
579 for (Int_t ibin =1;ibin<=kSize;ibin++){
580 htofNoise->SetBinContent(ibin,-1);
583 // retrieving last stored noise object, and copying
585 AliCDBEntry *cdbEntry = GetFromOCDB("Calib","Noise");
587 TObjArray *currentCalStatus = (TObjArray*)cdbEntry->GetObject();
588 for (Int_t ich = 0; ich<fNChannels; ich ++){
589 AliTOFChannelOnlineStatus * calChOnlineSt = (AliTOFChannelOnlineStatus*)fCalStatus->At(ich);
590 calChOnlineSt->SetStatus(((AliTOFChannelOnlineStatus*)currentCalStatus->At(ich))->GetStatus());
599 //retrieving Noise data
600 TList* listNoise = GetFileSources(kDAQ, "NOISE");
601 if (listNoise !=0x0 && listNoise->GetEntries()!=0)
603 AliInfo("The following sources produced files with the id NOISE");
605 for (Int_t jj=0;jj<listNoise->GetEntries();jj++){
606 TObjString * str = dynamic_cast<TObjString*> (listNoise->At(jj));
607 AliInfo(Form("found source %s", str->String().Data()));
608 // file to be stored run per run
609 TString fileNameNoise = GetFile(kDAQ, "NOISE", str->GetName());
610 if (fileNameNoise.Length()>0){
611 // storing refernce data
612 AliInfo(Form("Got the file %s, now we can process noise data.", fileNameNoise.Data()));
613 daqFile = new TFile(fileNameNoise.Data(),"READ");
614 h1 = (TH1F*) daqFile->Get("hTOFnoise");
615 for (Int_t ibin=0;ibin<kSize;ibin++){
616 if ((h1->GetBinContent(ibin+1))!=-1){
617 if ((htofNoise->GetBinContent(ibin+1))==-1){
618 htofNoise->SetBinContent(ibin+1,h1->GetBinContent(ibin+1));
621 Log(Form("Something strange occurred during Noise run, channel %i already read by another LDC, please check!",ibin));
626 for (Int_t ich =0;ich<fNChannels;ich++){
627 AliTOFChannelOnlineStatus * chSt = (AliTOFChannelOnlineStatus *)fCalStatus->At(ich);
628 if (h1->GetBinContent(ich+1)==-1) continue;
629 AliDebug(1,Form( " channel %i",ich));
630 AliDebug(1,Form( " channel status before noise = %i",(Int_t)chSt->GetStatus()));
632 /* check whether channel has been read out during current run.
633 * if the status is bad it means it has not been read out.
634 * in this case skip channel in order to leave its status
636 if (((AliTOFChannelOnlineStatus *)fFEEStatus->At(ich))->GetStatus() == AliTOFChannelOnlineStatus::kTOFHWBad)
639 if (h1->GetBinContent(ich+1)>=1){ // setting limit for noise to 1 kHz
640 chSt->SetStatus(chSt->GetStatus()|AliTOFChannelOnlineStatus::kTOFNoiseBad); // bad status for noise
641 AliDebug(1,Form( " channel status after noise = %i",(Int_t)chSt->GetStatus()));
644 chSt->SetStatus(chSt->GetStatus()|AliTOFChannelOnlineStatus::kTOFNoiseOk); // bad status for noise
645 AliDebug(1,Form(" channel status after noise = %i",(Int_t)chSt->GetStatus()));
656 Log("The input data file from DAQ (noise) was not found, TOF exiting from Shuttle ");
657 return 13;//return error code for failure in retrieving Ref Data
664 Log("The input data file list from DAQ (noise) was not found, TOF exiting from Shuttle ");
665 return 13;//return error code for failure in retrieving Ref Data
672 AliCDBMetaData metaData;
673 metaData.SetBeamPeriod(0);
674 metaData.SetResponsible("Chiara Zampolli");
675 metaData.SetComment("This preprocessor fills a TObjArray object for Noise data.");
676 AliInfo("Storing Calibration Data from Noise Run");
677 resultNoise = Store("Calib","Noise",fCalStatus, &metaData,0,kTRUE);
679 Log("Some problems occurred while storing online object resulting from Noise data processing");
680 return 14;//return error code for problems in storing Noise data
685 AliCDBMetaData metaDataHisto;
686 metaDataHisto.SetBeamPeriod(0);
687 metaDataHisto.SetResponsible("Chiara Zampolli");
689 sprintf(comment,"This preprocessor stores the result of the noise run, TOF exiting from Shuttle ");
690 metaDataHisto.SetComment(comment);
691 AliInfo("Storing Reference Data");
692 resultNoiseRef = StoreReferenceData("Calib","NoiseData",htofNoise, &metaDataHisto);
693 if (!resultNoiseRef){
694 Log("some problems occurred::No Reference Data for noise stored");
695 return 12;//return error code for failure in storing Ref Data
701 //_____________________________________________________________________________
703 UInt_t AliTOFPreprocessor::ProcessFEEData()
705 // Processing Pulser Run data for TOF channel status
706 // dummy for the time being
708 Log("Processing FEE");
710 Bool_t updateOCDB = kFALSE;
711 AliTOFFEEReader feeReader;
712 AliTOFChannelOnlineStatus *currentChannel = NULL, *storedChannel = NULL;
713 TObjArray *currentFEE = fFEEStatus;
715 TH1C hCurrentFEE("hCurrentFEE","histo with current FEE channel status", fNChannels, 0, fNChannels);
717 /* load current TOF FEE config from DCS FXS, parse,
718 * fill current FEE histogram and set FEE status */
720 const char * nameFile = GetFile(kDCS,"TofFeeMap","");
721 AliInfo(Form("nameFile = %s",nameFile));
722 if (nameFile == NULL) {
725 feeReader.LoadFEEConfig(nameFile);
726 feeReader.ParseFEEConfig();
727 /* loop over channels */
728 for (Int_t iChannel = 0; iChannel < fNChannels; iChannel++) {
729 currentChannel = (AliTOFChannelOnlineStatus *)currentFEE->At(iChannel);
732 /* channel enabled. set FEE channel status ok */
733 if (feeReader.IsChannelEnabled(iChannel)) {
734 currentChannel->SetStatus(AliTOFChannelOnlineStatus::kTOFHWOk);
735 hCurrentFEE.SetBinContent(iChannel + 1, 1);
737 /* channel disabled. set FEE channel status bad */
739 currentChannel->SetStatus(AliTOFChannelOnlineStatus::kTOFHWBad);
743 /* load stored TOF FEE from OCDB and compare it with current FEE.
744 * if stored FEE is different from current FEE set update flag.
745 * if there is no stored FEE in OCDB set update flag */
747 AliCDBEntry *cdbEntry = GetFromOCDB("Calib","FEE");
748 /* no CDB entry found. set update flag */
749 if (cdbEntry == NULL) {
752 /* CDB entry OK. loop over channels */
754 TObjArray *storedFEE = (TObjArray *)cdbEntry->GetObject();
755 for (Int_t iChannel = 0; iChannel < fNChannels; iChannel++){
756 currentChannel = (AliTOFChannelOnlineStatus *)currentFEE->At(iChannel);
757 storedChannel = (AliTOFChannelOnlineStatus *)storedFEE->At(iChannel);
758 /* compare current FEE channel status with stored one
759 * if different set update flag and break loop */
760 if (currentChannel->GetStatus() != storedChannel->GetStatus()) {
767 /* check whether we don't have to store reference data.
768 * in this case we return without errors. */
770 /* store reference data */
771 AliCDBMetaData metaDataHisto;
772 metaDataHisto.SetBeamPeriod(0);
773 metaDataHisto.SetResponsible("Roberto Preghenella");
774 metaDataHisto.SetComment("This preprocessor stores the FEE referece data of the current run.");
775 AliInfo("Storing FEE reference data");
776 /* store FEE reference data */
777 if (!StoreReferenceData("Calib", "FEEData", &hCurrentFEE, &metaDataHisto)) {
779 Log("problems while storing FEE reference data");
780 return 18; /* error return code for problems while storing FEE reference data */
784 /* check whether we don't need to update OCDB.
785 * in this case we can return without errors and
786 * the current FEE is stored in the fFEEStatus TObjArray. */
788 AliInfo("TOF FEE config has not changed. Do not overwrite stored file.");
789 return 0; /* return ok */
792 /* update the OCDB with the current FEE since even
793 * a little difference has been detected. */
795 AliCDBMetaData metaData;
796 metaData.SetBeamPeriod(0);
797 metaData.SetResponsible("Roberto Preghenella");
798 metaData.SetComment("This preprocessor fills a TObjArray object for FEE data.");
799 AliInfo("Storing FEE data from current run");
801 if (!Store("Calib", "FEE", fFEEStatus, &metaData, 0, kTRUE)) {
803 Log("problems while storing FEE data object");
804 return 17; /* return error code for problems while storing FEE data */
807 /* everything fine. return */
813 //_____________________________________________________________________________
815 UInt_t AliTOFPreprocessor::Process(TMap* dcsAliasMap)
821 TString runType = GetRunType();
822 Log(Form("RunType %s",runType.Data()));
826 /* always process FEE data */
827 Int_t iresultFEE = ProcessFEEData();
831 if (runType == "PULSER") {
832 Int_t iresultPulser = ProcessPulserData();
833 return iresultPulser;
836 if (runType == "NOISE") { // for the time being associating noise runs with pedestal runs; proper run type to be defined
837 Int_t iresultNoise = ProcessNoiseData();
841 if (runType == "PHYSICS") {
842 Int_t iresultDCS = ProcessDCSDataPoints(dcsAliasMap);
843 if (iresultDCS != 0) {
847 Int_t iresultDAQ = ProcessOnlineDelays();