]>
Commit | Line | Data |
---|---|---|
f7c046aa | 1 | #include "AliRICHPreprocessor.h" //header |
2 | ||
3 | #include <AliCDBMetaData.h> | |
9de8d990 | 4 | #include <AliDCSValue.h> |
5 | #include <TObjArray.h> //Test() | |
6 | #include <TObjString.h> //Test() | |
7 | #include <AliCDBManager.h> //Test() | |
8 | #include <AliCDBEntry.h> //Test() | |
aebb712c | 9 | //#include <AliTestShuttle.h> //Test() |
9de8d990 | 10 | #include <TRandom.h> //Test() |
11 | #include <TF1.h> //Process() | |
2da90160 | 12 | #include <TF2.h> //Process() |
9de8d990 | 13 | #include <TGraph.h> //Process() |
14 | ||
15 | ClassImp(AliRICHPreprocessor) | |
16 | ||
f7c046aa | 17 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
18 | void AliRICHPreprocessor::Initialize(Int_t run, UInt_t startTime,UInt_t endTime) | |
19 | { | |
f7c046aa | 20 | AliPreprocessor::Initialize(run, startTime, endTime); |
f7c046aa | 21 | } |
22 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23 | UInt_t AliRICHPreprocessor::Process(TMap* pDcsMap) | |
24 | { | |
37522ef0 | 25 | // |
26 | // Argumets: pDcsMap - map of structure "alias name" - TObjArray of AliDCSValue | |
27 | ||
2da90160 | 28 | // TList* list = GetFileSources(kDAQ, "MAP"); //first analyse a set of pedestal files |
29 | // if (list){ | |
30 | // Log("The following sources produced files with the id MAP"); | |
31 | // list->Print(); | |
32 | // delete list; | |
33 | // } | |
f7c046aa | 34 | |
9de8d990 | 35 | if(!pDcsMap) return 0; //no DCS map provided |
f7c046aa | 36 | |
2da90160 | 37 | TF2 idxC6F14("RidxC4F14","sqrt(1+0.554*(1239.84/x)^2/((1239.84/x)^2-5796)-0.0005*(y-20))",5.5,8.5,0,50); //DiMauro mail temp 0-50 degrees C |
38 | Double_t eMean=6.67786; //mean energy of photon defined by transperancy window | |
39 | ||
40 | TObjArray radTemp; radTemp.SetOwner(kTRUE); //store temp versus time as TF1 array for all radiators (21) | |
41 | TObjArray meanIdx; meanIdx.SetOwner(kTRUE); //store ref idx versus time as TF1 array for all radiators (21) | |
9de8d990 | 42 | |
43 | ||
37522ef0 | 44 | for(Int_t iCh=0;iCh<7;iCh++){ //aliases loop |
45 | for(Int_t iRad=0;iRad<3;iRad++){ | |
2da90160 | 46 | 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 points for this alias |
47 | if(!pValLst) continue; //no data points | |
48 | TF1 *pRadTempF=new TF1(Form("RadTemp%i%i",iCh,iRad),"[0]+[1]*x+[2]*sin([3]*x)",0,10); pRadTempF->SetLineColor(iRad+2); //temp=f(time) | |
49 | TF1 *pMeanIdxF=new TF1(Form("MeanIdx%i%i",iCh,iRad),"[0]+[1]*x+[2]*sin([3]*x)",0,10); pMeanIdxF->SetLineColor(iRad+2); //idx=f(time) | |
50 | TGraph *pRadTempG=new TGraph; //tmp graph of rad temp versus time | |
51 | TGraph *pMeanIdxG=new TGraph; //tmp graph of mean ref idx versus time | |
37522ef0 | 52 | TIter next(pValLst); AliDCSValue *pDcsVal; Int_t i=0; |
2da90160 | 53 | while((pDcsVal=(AliDCSValue*)next())){ //loop over data points for this sensor |
54 | pRadTempG->SetPoint(i,pDcsVal->GetTimeStamp(), pDcsVal->GetFloat()); //and fill the temp graph | |
55 | pMeanIdxG->SetPoint(i,pDcsVal->GetTimeStamp(),idxC6F14.Eval(eMean,pDcsVal->GetFloat())); //and fill the maen ref idx graph | |
56 | i++; | |
57 | } | |
58 | pRadTempG->Fit(pRadTempF,"Q"); //now fit the temp graph | |
59 | pMeanIdxG->Fit(pMeanIdxF,"Q"); //now fit the mean idx graph | |
60 | delete pRadTempG; | |
61 | delete pMeanIdxG; | |
62 | radTemp.Add(pRadTempF); | |
63 | meanIdx.Add(pMeanIdxF); | |
37522ef0 | 64 | }//radiators loop |
65 | }//chambers loop | |
9de8d990 | 66 | |
67 | AliCDBMetaData metaData; metaData.SetBeamPeriod(0); metaData.SetResponsible("AliRICHPreprocessor"); metaData.SetComment("SIMULATED"); | |
f7c046aa | 68 | |
2da90160 | 69 | Store("DCS", "RadTemp" , &radTemp , &metaData); //use AliPreprocessor::Store(), not allowed to use AliCDBManager directly |
70 | Store("DCS", "MeanIdx" , &meanIdx , &metaData); | |
71 | ||
72 | return 1; | |
9de8d990 | 73 | |
74 | }//Process() | |
75 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |