Preprocessor
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Nov 2007 17:22:10 +0000 (17:22 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Nov 2007 17:22:10 +0000 (17:22 +0000)
T0/AliT0DataDCS.cxx
T0/AliT0DataDCS.h

index 4b57970..4a26c2a 100644 (file)
@@ -55,34 +55,39 @@ AliT0DataDCS::~AliT0DataDCS() {
 }
 
 //---------------------------------------------------------------
-void AliT0DataDCS::ProcessData(TMap& aliasMap){
-
+Bool_t AliT0DataDCS::ProcessData(TMap& aliasMap)
+{
+/* ** TM 23.11.2007 for testing preprocessor **
        if(!(fHv[0])) Init();
 
        TObjArray *aliasArr;
        AliDCSValue* aValue;
-       for(int j=0; j<kNAliases; j++){
+       for(int j=0; j<kNAliases; j++)
+       {
                aliasArr = (TObjArray*) aliasMap.GetValue(fAliasNames[j].Data());
-               if(!aliasArr){
+               if(!aliasArr)
+               {
                        AliError(Form("Alias %s not found!", fAliasNames[j].Data()));
                        continue;
                }
                Introduce(j, aliasArr);
 
-               if(aliasArr->GetEntries()<2){
+               if(aliasArr->GetEntries()<2)
+               {
                        AliError(Form("Alias %s has just %d entries!",
                                        fAliasNames[j].Data(),aliasArr->GetEntries()));
                        continue;
                }
 
+// TM, 6.10.2007
                TIter iterarray(aliasArr);
 
                Double_t *time = new Double_t[aliasArr->GetEntries()];
                Double_t *val = new Double_t[aliasArr->GetEntries()];
 
                UInt_t ne=0;
-               while ((aValue = (AliDCSValue*) iterarray.Next())) {
-
+               while ((aValue = (AliDCSValue*) iterarray.Next())) 
+               {
                val[ne] = aValue->GetFloat();
                time[ne] = (Double_t) (aValue->GetTimeStamp());
                // fill histos (alias 0-2)
@@ -93,41 +98,96 @@ void AliT0DataDCS::ProcessData(TMap& aliasMap){
                if(j >= 3) CreateGraph(j, aliasArr->GetEntries(), time, val);
                delete[] val;
                delete[] time;
+
+// TM, 21.11.2007
+          TObjArray *aliasArr;
+       // AliDCSValue *aValue;
+//TM, 19.11.2007        Float_t t00_a_hv_imon[12]={0,0,0,0,0,0,0,0,0,0,0,0};
+//TM, 19.11.2007        Float_t t00_a_hv_vmon[12]={0,0,0,0,0,0,0,0,0,0,0,0};
+//TM, 19.11.2007        Float_t t00_a_lv_imon[2]={0,0};
+//TM, 19.11.2007        Float_t t00_a_lv_vmon[2]={0,0};
+//TM, 19.11.2007        Float_t t00_c_hv_imon[12]={0,0,0,0,0,0,0,0,0,0,0,0};
+//TM, 19.11.2007        Float_t t00_c_hv_vmon[12]={0,0,0,0,0,0,0,0,0,0,0,0};
+//TM, 19.11.2007        Float_t t00_c_lv_imon[2]={0,0};
+//TM, 19.11.2007        Float_t t00_c_lv_vmon[2]={0,0};
+//TM, 19.11.2007        Float_t t00_a_cfd_thre[12]={0,0,0,0,0,0,0,0,0,0,0,0};
+//TM, 19.11.2007        Float_t t00_a_cfd_walk[12]={0,0,0,0,0,0,0,0,0,0,0,0};
+//TM, 19.11.2007        Float_t t00_c_cfd_thre[12]={0,0,0,0,0,0,0,0,0,0,0,0};
+//TM, 19.11.2007        Float_t t00_c_cfd_walk[12]={0,0,0,0,0,0,0,0,0,0,0,0};
+        Float_t t00_ac_scaler[32]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+//TM, 19.11.2007        Float_t t00_ac_trm[20]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+//TM, 19.11.2007        Float_t t00_ac_drm= 0;
+
+        for(int j=0; j<32; j++)
+        {
+                TString aliasName =Form("t00_ac_scaler_%d",j);
+//TM, 19.11.2007                TString aliasName =Form("t00_a_hv_imon_%d",j);
+//TM, 19.11.2007                TString aliasName1 =Form("t00_a_hv_vmon_%d",j);
+//TM, 19.11.2007                TString aliasName2 =Form("t00_c_hv_imon_%d",j);
+//TM, 19.11.2007                TString aliasName3 =Form("t00_c_hv_vmon_%d",j);
+//TM, 19.11.2007                TString aliasName4 =Form("t00_a_cfd_thre_%d",j);
+//TM, 19.11.2007                  TString aliasName5 =Form("t00_a_cfd_walk_%d",j);
+//TM, 19.11.2007                  TString aliasName6 =Form("t00_c_cfd_thre_%d",j);
+//TM, 19.11.2007                  TString aliasName7 =Form("t00_c_cfd_walk_%d",j);
+
+                printf("aliasname: %s\n",aliasName.Data());
+                aliasArr = dynamic_cast<TObjArray*> (dcsAliasMap->GetValue(aliasName.Data()));
+                if(!aliasArr){
+                        AliError(Form("Alias %s not found!", aliasName.Data()));
+                        continue;
+        }
+                AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(0));
+               // printf("I'm here! %f %x\n", aValue->GetFloat(), aValue->GetTimeStamp());
+               // TM, 6.10.2007 hv[j]= aValue->GetFloat()*100;
+               //Float_t timestamp= (Float_t) (aValue->GetTimeStamp());
+                // printf("hello! hv = %f timestamp = %f\n" ,hv[j], timestamp);
+
+
        }
 
+** ** */
+
+/* TM, 6.10.2007
+
        // calculate mean and rms of the first two histos
-       for(int i=0;i<kNHistos;i++){
+       for(int i=0;i<kNHistos;i++)
+       {
                fMean[i] = fHv[i]->GetMean();
                fWidth[i] = fHv[i]->GetRMS();
        }
 
        // pol1 fit of the first graph
-       if(fGraphs.GetEntries() > 0){
+       if(fGraphs.GetEntries() > 0)
+       {
                ((TGraph*) fGraphs.UncheckedAt(0))->Fit("pol1");
                fFunc = ((TGraph*) fGraphs.UncheckedAt(0))->GetFunction("pol1");
        }
+*/
 
        fIsProcessed=kTRUE;
-
-
 }
 
 //---------------------------------------------------------------
-void AliT0DataDCS::Init(){
+void AliT0DataDCS::Init()
+{
 
        TH1::AddDirectory(kFALSE);
 
        fGraphs.SetOwner(1);
 
-       for(int i=0;i<kNAliases;i++){
+       for(int i=0;i<kNAliases;i++)
+       {
                fAliasNames[i] = "DCSAlias";
                fAliasNames[i] += i;
        }
 
-       for(int i=0;i<kNHistos;i++){
+/* TM, 6.10.2007
+       for(int i=0;i<kNHistos;i++)
+       {
                fHv[i] = new TH1F(fAliasNames[i].Data(),fAliasNames[i].Data(), 20, kHvMin, kHvMax);
                fHv[i]->GetXaxis()->SetTitle("Hv");
        }
+*/
 }
 
 //---------------------------------------------------------------
@@ -140,6 +200,7 @@ void AliT0DataDCS::Introduce(UInt_t numAlias, const TObjArray* aliasArr){
 }
 
 //---------------------------------------------------------------
+/* TM, 6.10.2007
 void AliT0DataDCS::CreateGraph(int i, int dim, const Double_t *x, const Double_t *y)
 {
 
@@ -153,43 +214,46 @@ void AliT0DataDCS::CreateGraph(int i, int dim, const Double_t *x, const Double_t
 
 }
 
+*/
+
 //---------------------------------------------------------------
-void AliT0DataDCS::Draw(const Option_t* /*option*/)
-{
-// Draw all histos and graphs
-
-  if(!fIsProcessed) return;
-
-  TCanvas *ch;
-  TString canvasHistoName="Histos";
-  ch=new TCanvas(canvasHistoName,canvasHistoName,20,20,600,600);
-  ch->Divide(2,2);
-  ch->cd(1);
-  fHv[0]->Draw();
-  ch->cd(2);
-  fHv[1]->Draw();
-  ch->cd(3);
-  fHv[2]->Draw();
-
-
-  if(fGraphs.GetEntries() == 0) return;
-
-  TCanvas *cg;
-  TString canvasGraphName="Graphs";
-  cg=new TCanvas(canvasGraphName,canvasGraphName,40,40,600,600);
-  cg->Divide(2,2);
-  cg->cd(1);
-  ((TGraph*) fGraphs.UncheckedAt(0))->Draw("alp");
+/* TM, 6.10.2007 
+
+  void AliT0DataDCS::Draw(const Option_t* )
+  {
+   // Draw all histos and graphs
+
+    if(!fIsProcessed) return;
+
+    TCanvas *ch;
+    TString canvasHistoName="Histos";
+    ch=new TCanvas(canvasHistoName,canvasHistoName,20,20,600,600);
+    ch->Divide(2,2);
+    ch->cd(1);
+    fHv[0]->Draw();
+    ch->cd(2);
+    fHv[1]->Draw();
+    ch->cd(3);
+    fHv[2]->Draw();
+
+    if(fGraphs.GetEntries() == 0) return;
+
+    TCanvas *cg;
+    TString canvasGraphName="Graphs";
+    cg=new TCanvas(canvasGraphName,canvasGraphName,40,40,600,600);
+    cg->Divide(2,2);
+    cg->cd(1);
+    ((TGraph*) fGraphs.UncheckedAt(0))->Draw("alp");
   
-  cg->cd(2);
-  ((TGraph*) fGraphs.UncheckedAt(1))->Draw("alp");
-  cg->cd(3);
-  ((TGraph*) fGraphs.UncheckedAt(2))->Draw("alp");
-
-  if(fFunc){
-       cg->cd(4);
-       fFunc->Draw("l");
+    cg->cd(2);
+    ((TGraph*) fGraphs.UncheckedAt(1))->Draw("alp");
+    cg->cd(3);
+    ((TGraph*) fGraphs.UncheckedAt(2))->Draw("alp");
+
+    if(fFunc)
+    {
+      cg->cd(4);
+      fFunc->Draw("l");
+    }
   }
-}
-
+*/
index ae261ec..d78cc6b 100644 (file)
@@ -23,7 +23,7 @@ public:
        Int_t GetStartTime() {return fStartTime;}
        Int_t GetEndTime() {return fEndTime;}
 
-       void ProcessData(TMap& aliasMap);
+       Bool_t ProcessData(TMap& aliasMap);
 
        const char* GetAliasName(UInt_t pos)
                        {return pos<kNAliases ? fAliasNames[pos].Data() : 0;}