]>
Commit | Line | Data |
---|---|---|
d3da6dc4 | 1 | #include "AliHMPIDPreprocessor.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 <TF2.h> //Process() | |
13 | #include <TGraph.h> //Process() | |
14 | ||
15 | ClassImp(AliHMPIDPreprocessor) | |
16 | ||
17 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
18 | void AliHMPIDPreprocessor::Initialize(Int_t run, UInt_t startTime,UInt_t endTime) | |
19 | { | |
20 | AliPreprocessor::Initialize(run, startTime, endTime); | |
21 | } | |
22 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23 | UInt_t AliHMPIDPreprocessor::Process(TMap* pDcsMap) | |
24 | { | |
25 | // | |
26 | // Argumets: pDcsMap - map of structure "alias name" - TObjArray of AliDCSValue | |
27 | ||
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 | // } | |
34 | ||
35 | if(!pDcsMap) return 0; //no DCS map provided | |
36 | ||
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) | |
42 | ||
43 | ||
44 | for(Int_t iCh=0;iCh<7;iCh++){ //aliases loop | |
45 | for(Int_t iRad=0;iRad<3;iRad++){ | |
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 | |
52 | TIter next(pValLst); AliDCSValue *pDcsVal; Int_t i=0; | |
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); | |
64 | }//radiators loop | |
65 | }//chambers loop | |
66 | ||
67 | AliCDBMetaData metaData; metaData.SetBeamPeriod(0); metaData.SetResponsible("AliHMPIDPreprocessor"); metaData.SetComment("SIMULATED"); | |
68 | ||
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; | |
73 | ||
74 | }//Process() | |
75 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |