ATO-78 adding functionality to connect Pulser calibration trees.
authormivanov <marian.ivanov@cern.ch>
Wed, 24 Sep 2014 14:55:35 +0000 (16:55 +0200)
committermivanov <marian.ivanov@cern.ch>
Tue, 28 Oct 2014 23:13:06 +0000 (00:13 +0100)
TPC/Base/AliTPCCalPad.cxx
TPC/Base/AliTPCcalibDButil.cxx
TPC/Base/AliTPCcalibDButil.h

index df3c6c3..2fd9f1a 100644 (file)
@@ -926,7 +926,7 @@ AliTPCCalPad *AliTPCCalPad::MakePadFromTree(TTree * treePad, const char *query,
     AliTPCCalROC* calROC  = calPad->GetCalROC(iSec);
     UInt_t nchannels = (UInt_t)treePad->Draw(query,"1","goff",1,iSec);
     if (nchannels!=calROC->GetNchannels()) {
-      ::Error("AliTPCCalPad::MakePad",TString::Format("Wrong query sector\t%d\t%d",iSec,nchannels).Data());
+      ::Error("AliTPCCalPad::MakePad",TString::Format("%s\t:Wrong query sector\t%d\t%d",treePad->GetName(),iSec,nchannels).Data());
       break;
     }
     for (UInt_t index=0; index<nchannels; index++) calROC->SetValue(index,treePad->GetV1()[index]);
index 250e858..0d59e77 100644 (file)
@@ -3277,3 +3277,47 @@ TTree* AliTPCcalibDButil::ConnectGainTrees(TString baseDir)
   return tMain;
 }
 
+
+//_____________________________________________________________________________________
+TTree* AliTPCcalibDButil::ConnectPulserTrees(TString baseDir, TTree *tMain)
+{
+  //
+  // baseDir:   Base directory with Pulser information
+  // TTrees are added to the base tree as a friend tree
+  //  
+  // === add the calibPulser trees ======================================
+  TString inputTreesPulserCalib       = gSystem->GetFromPipe(Form("ls %s/calibPulser/20*/*.tree.root",baseDir.Data()));
+  TObjArray *arrInputTreesPulserCalib = inputTreesPulserCalib.Tokenize("\n");
+  for (Int_t itree=0; itree<arrInputTreesPulserCalib->GetEntriesFast(); ++itree) {
+    TFile *fin2 = TFile::Open(arrInputTreesPulserCalib->At(itree)->GetName());
+    TTree *tin = (TTree*)fin2->Get("calPads");
+    gROOT->cd();
+    TString friendName=gSystem->BaseName(arrInputTreesPulserCalib->At(itree)->GetName());
+    friendName.ReplaceAll("calibPulser.","");
+    friendName.ReplaceAll(".tree.root","");
+    friendName="Pulser."+friendName;
+    tMain->AddFriend(tin,friendName.Data());    
+    // set aliases
+
+    tMain->SetAlias((friendName+".CEQmean_LTMRatio").Data(),
+                    TString::Format("(%s.CEQmean.fElements/%s.CEQmean_LTM)",
+                                    friendName.Data(),friendName.Data()).Data());    
+    tMain->SetAlias((friendName+".CEQmean_MedianRatio").Data(),
+                    TString::Format("(%s.CEQmean.fElements/%s.CEQmean_Median)",
+                                    friendName.Data(),friendName.Data()).Data());
+    tMain->SetAlias((friendName+".CEQmean_MeanRatio").Data(),
+                    TString::Format("(%s.CEQmean.fElements/%s.CEQmean_Mean)",
+                                    friendName.Data(),friendName.Data()).Data());        
+    //
+    tMain->SetAlias((friendName+".CETmean_LTMDelta").Data(),
+                    TString::Format("(%s.CETmean.fElements-%s.CETmean_LTM)",
+                                    friendName.Data(),friendName.Data()).Data());    
+    tMain->SetAlias((friendName+".CETmean_MedianDelta").Data(),
+                    TString::Format("(%s.CETmean.fElements-s.CETmean_Median)",
+                                    friendName.Data(),friendName.Data()).Data());
+    tMain->SetAlias((friendName+".CETmean_MeanDelta").Data(),
+                    TString::Format("(%s.CETmean.fElements-%s.CETmean_Mean)",
+                                    friendName.Data(),friendName.Data()).Data());        
+  }
+}  
+  
index a11c115..12b7a75 100644 (file)
@@ -179,6 +179,8 @@ public:
   AliCDBEntry* GetRefEntry(const char* cdbPath);
 
   static TTree* ConnectGainTrees(TString baseDir);
+  static TTree* ConnectPulserTrees(TString baseDir, TTree * tree=0);
+  //static TTree* ConnectNoiseTrees(TString baseDir,  TTree * tree=0); 
   
 private:
   AliTPCcalibDB *fCalibDB;            //pointer to calibDB object