]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/AliRICHPreprocessor.cxx
Real aliases names
[u/mrichter/AliRoot.git] / RICH / AliRICHPreprocessor.cxx
1 #include "AliRICHPreprocessor.h" //header
2
3 #include <AliCDBMetaData.h>
4 #include <AliDCSValue.h>      
5 #include <TObjArray.h>        //Test()
6 #include <TObjString.h>       //Test()
7 #include <AliCDBManager.h>    //Test()
8 #include <AliCDBEntry.h>      //Test()
9 //#include <AliTestShuttle.h>   //Test()
10 #include <TRandom.h>          //Test()
11 #include <TF1.h>              //Process()
12 #include <TGraph.h>           //Process()
13
14 ClassImp(AliRICHPreprocessor)
15
16 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
17 void AliRICHPreprocessor::Initialize(Int_t run, UInt_t startTime,UInt_t endTime)
18 {
19   AliPreprocessor::Initialize(run, startTime, endTime);
20 }
21 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
22 UInt_t AliRICHPreprocessor::Process(TMap* pDcsMap)
23 {
24 // 
25 // Argumets: pDcsMap - map of structure "alias name" - TObjArray of AliDCSValue
26    
27   TList* list = GetFileSources(kDAQ, "MAP"); //first analyse a set of pedestal files
28   if (list){
29     Log("The following sources produced files with the id MAP");
30     list->Print();
31     delete list;
32   }
33
34   if(!pDcsMap)  return 0;                    //no DCS map provided 
35
36   TObjArray result; result.SetOwner(kTRUE);  //result is a array of TF1
37     
38   
39   for(Int_t iCh=0;iCh<7;iCh++){                             //aliases loop
40     for(Int_t iRad=0;iRad<3;iRad++){
41       TObjArray *pValLst=(TObjArray*)pDcsMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iIn_Temp",iCh,iCh,iRad));//get data serias
42       if(!pValLst) continue;                                                                                               //no data serias this alias
43       TF1    *pF1=new TF1("t11","[0]+[1]*x+[2]*sin([3]*x)",0,10); pF1->SetLineColor(iRad+2);     //temp=f(time) for fitting data seria 
44       TGraph *pGr=new TGraph;                                                  //tmp graph of sensor data versus time 
45       TIter next(pValLst);  AliDCSValue *pDcsVal; Int_t i=0;
46       while((pDcsVal=(AliDCSValue*)next()))                                    //loop over data points for this sensor 
47         pGr->SetPoint(i++,pDcsVal->GetTimeStamp(),pDcsVal->GetFloat());        //and fill the graph
48       pGr->Fit(pF1);                                                           //now fit the graph 
49       delete pGr;
50       result.Add(pF1);
51     }//radiators loop
52   }//chambers loop
53   
54   AliCDBMetaData metaData; metaData.SetBeamPeriod(0); metaData.SetResponsible("AliRICHPreprocessor"); metaData.SetComment("SIMULATED");
55
56   return Store("DCS", "RefIdx", &result, &metaData); //use AliPreprocessor::Store(), not allowed to use AliCDBManager directly
57
58 }//Process()
59 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++