LCOV - code coverage report
Current view: top level - TPC/TPCutil - AliTPCGenDBTemp.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 52 1.9 %
Date: 2016-06-14 17:26:59 Functions: 1 15 6.7 %

          Line data    Source code
       1             : 
       2             : // TTimeStamp startTime(2006,10,18,0,0,0,0,kFALSE)
       3             : // TTimeStamp endTime(2006,10,19,0,0,0,0,kFALSE)
       4             : // Int_t run=2546
       5             : // AliTPCGenDBTemp db
       6             : // db->Init(run,"TPC/Config/Temperature","TPC/*/*")
       7             : // db->MakeCalib("TempSensor.txt","DCSMap.root",startTime,endTime,run)
       8             : 
       9             : //  Data base entry generation:
      10             :   
      11             : //  AliTPCGenDBTemp db
      12             : //  db->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
      13             : //  db->SetSpecificStorage("local:///afs/cern.ch/alice/tpctest/Calib/");
      14             : //  db->Init(0,"TPC/Config/Temperature","TPC/*/*")
      15             : //  db->MakeConfig("TempSensor.txt",0,999999999,"TPC/Config/Temperature")
      16             : 
      17             :   
      18             : 
      19             : 
      20             : 
      21             : 
      22             : #include "AliTPCGenDBTemp.h"
      23             : #include "AliLog.h"
      24             : 
      25          12 : ClassImp(AliTPCGenDBTemp)
      26             : 
      27             : const Int_t kValCut = 100;         // discard temperatures > 100 degrees
      28             : const Int_t kDiffCut = 5;          // discard temperature differences > 5 degrees
      29             : 
      30             : //______________________________________________________________________________________________
      31             : 
      32             : AliTPCGenDBTemp::AliTPCGenDBTemp():
      33           0 :    AliDCSGenDB()
      34           0 : {
      35           0 : }
      36             : 
      37             : //______________________________________________________________________________________________
      38             : 
      39             : AliTPCGenDBTemp::AliTPCGenDBTemp(const char *defaultStorage, const char *specificStorage) :
      40           0 :    AliDCSGenDB(defaultStorage,specificStorage)
      41           0 : {
      42           0 : }
      43             : 
      44             : //______________________________________________________________________________________________
      45             : 
      46           0 : AliTPCGenDBTemp::AliTPCGenDBTemp(const AliTPCGenDBTemp& ) : AliDCSGenDB()
      47           0 : {
      48             : 
      49             : //
      50             : //  Copy constructor
      51             : //
      52           0 :  AliError("copy constructor not implemented");
      53             : 
      54           0 : }
      55             : 
      56             : //______________________________________________________________________________________________
      57           0 : AliTPCGenDBTemp::~AliTPCGenDBTemp(){
      58             : //
      59             : // destructor
      60             : //
      61             : 
      62           0 : }
      63             : //______________________________________________________________________________________________
      64             : AliTPCGenDBTemp& AliTPCGenDBTemp::operator= (const AliTPCGenDBTemp&  )
      65             : {
      66             :  //
      67             :  // assignment operator
      68             :  //
      69           0 :  AliError("assignment operator not implemented");
      70           0 :  return *this;
      71             : }
      72             : 
      73             : 
      74             : //______________________________________________________________________________________________
      75             : 
      76             : void AliTPCGenDBTemp::MakeCalib(const char *fList, const char *fMap,
      77             :                              const TTimeStamp& startTime,
      78             :                              const TTimeStamp& endTime,
      79             :                              Int_t run, const TString& amandaString )
      80             : {
      81             :    // The Terminate() function is the last function to be called during
      82             :    // a query. It always runs on the client, it can be used to present
      83             :    // the results graphically or save the results to file.
      84             : 
      85             :    AliTPCSensorTempArray *temperature=0;
      86           0 :    if ( amandaString.Length()== 0 ) {
      87           0 :     temperature = new AliTPCSensorTempArray(fList);
      88           0 :    } else {
      89           0 :     temperature = new AliTPCSensorTempArray(fList,amandaString);
      90             :    }
      91           0 :    temperature->SetStartTime(startTime);
      92           0 :    temperature->SetEndTime(endTime);
      93           0 :    temperature->SetValCut(kValCut);
      94           0 :    temperature->SetDiffCut(kDiffCut);
      95           0 :    TMap* map = SetGraphFile(fMap);
      96           0 :    if (map) {
      97           0 :      temperature->MakeSplineFit(map);
      98           0 :    }
      99           0 :    delete map;
     100             :    map=0;
     101             :    fMap=0;
     102             : 
     103           0 :    SetFirstRun(run);
     104           0 :    SetLastRun(run);
     105           0 :    SetSensorArray(temperature);
     106           0 :    StoreObject("TPC/Calib/Temperature",temperature, fMetaData);
     107           0 : }
     108             : 
     109             : //______________________________________________________________________________________________
     110             : 
     111             : TClonesArray * AliTPCGenDBTemp::ReadList(const char *fname, const char *title,
     112             :                        const TString& amandaString) {
     113             :   //
     114             :   // read values from ascii file
     115             :   //
     116           0 :   TTree* tree = new TTree(title,title);
     117           0 :   tree->ReadFile(fname,"");
     118             :   TClonesArray *arr;
     119           0 :   if ( amandaString.Length()== 0 ) {
     120           0 :     arr = AliTPCSensorTemp::ReadTree(tree);
     121           0 :   } else {
     122           0 :     arr = AliTPCSensorTemp::ReadTree(tree,amandaString);
     123             :   }
     124           0 :   delete tree;
     125           0 :   return arr;
     126           0 : }
     127             : 
     128             : //______________________________________________________________________________________________
     129             : 
     130             : TTree * AliTPCGenDBTemp::ReadListTree(const char *fname, const char *title) {
     131             :   //
     132             :   // read values from ascii file
     133             :   //
     134           0 :   TTree* tree = new TTree(title,title);
     135           0 :   tree->ReadFile(fname,"");
     136           0 :   return tree;
     137           0 : }
     138             : 
     139             : //______________________________________________________________________________________________
     140             : void AliTPCGenDBTemp::MakeConfig(const char *file, Int_t firstRun, Int_t lastRun, 
     141             :                              const char *confDir)
     142             : {
     143             :    //
     144             :    // Store Configuration file to OCDB
     145             :    //
     146             : 
     147           0 :    TTree *tree = ReadListTree(file,"tempConf");
     148           0 :    SetConfTree(tree);
     149           0 :    SetFirstRun(firstRun);
     150           0 :    SetLastRun(lastRun);
     151             : 
     152           0 :    StoreObject(confDir, fConfTree, fMetaData);
     153           0 : }
     154             : 
     155             : 

Generated by: LCOV version 1.11