LCOV - code coverage report
Current view: top level - EMCAL/EMCALbase - AliEMCALSensorTemp.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 47 2.1 %
Date: 2016-06-14 17:26:59 Functions: 1 8 12.5 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 2006-07, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : 
      17             : ////////////////////////////////////////////////////////////////////////////////
      18             : //                                                                            //
      19             : // Class describing EMCAL temperature sensors (including pointers to graphs/fits//
      20             : // Authors: David Silvermyr, copied from TPC (Ivanov, Helstrup, Siska)        //
      21             : //                                                                            //
      22             : ////////////////////////////////////////////////////////////////////////////////
      23             : 
      24             : // Running instructions:
      25             : /*
      26             :   TClonesArray * arr = AliEMCALSensorTemp::ReadList("TempSensor.txt","emc_PT_%d.Temperature");
      27             :   TFile f("TempSensors.root","RECREATE");
      28             :   TTree * tree = new TTree("TempSensor", "TempSensor");
      29             :   tree->Branch("Temp",&arr);
      30             :   tree->Fill();
      31             :   tree->Write();
      32             :   
      33             : */
      34             : 
      35             : //
      36             : 
      37             : #include <strings.h>
      38             : #include "AliEMCALSensorTemp.h"
      39          42 : ClassImp(AliEMCALSensorTemp)
      40             : 
      41             : //______________________________________________________________________________________________
      42             : 
      43           0 : AliEMCALSensorTemp::AliEMCALSensorTemp(): AliDCSSensor(),
      44           0 :   fSide(0),
      45           0 :   fSector(0),
      46           0 :   fNum(0)
      47           0 : {
      48             :   //
      49             :   //  Standard constructor
      50             :   //
      51           0 : }
      52             : //______________________________________________________________________________________________
      53             : 
      54             : AliEMCALSensorTemp::AliEMCALSensorTemp(const AliEMCALSensorTemp& source) :
      55           0 :   AliDCSSensor(source),
      56           0 :    fSide(source.fSide),
      57           0 :    fSector(source.fSector),
      58           0 :    fNum(source.fNum)
      59             : 
      60             : //
      61             : //  Copy constructor
      62             : //
      63           0 : { }
      64             : //______________________________________________________________________________________________
      65             : 
      66             : AliEMCALSensorTemp& AliEMCALSensorTemp::operator=(const AliEMCALSensorTemp& source){
      67             : //
      68             : // assignment operator
      69             : //
      70           0 :   if (&source == this) return *this;
      71           0 :   new (this) AliEMCALSensorTemp(source);
      72             :   
      73           0 :   return *this;  
      74           0 : }
      75             : //______________________________________________________________________________________________
      76             : 
      77             : TClonesArray * AliEMCALSensorTemp::ReadList(const char *fname,
      78             :                                           const TString& amandaString) {
      79             :   //
      80             :   // read values from ascii file
      81             :   //
      82           0 :   TTree * tree = new TTree("asci","asci");
      83           0 :   tree->ReadFile(fname,"");
      84           0 :   TClonesArray *arr = ReadTree(tree, amandaString);
      85           0 :   delete tree;
      86           0 :   return arr;
      87           0 : }
      88             :      
      89             : //______________________________________________________________________________________________
      90             : 
      91             : TClonesArray * AliEMCALSensorTemp::ReadTree(TTree *tree, 
      92             :                                           const TString& amandaString) 
      93             : { // read selected info from TTree
      94             :   
      95           0 :   Int_t nentries = tree->GetEntries();
      96           0 :   Int_t sensor=0;
      97           0 :   Int_t sector=0;
      98           0 :   char  side[100];
      99           0 :   Int_t num=0;
     100           0 :   Int_t echa=0;
     101             :   //Double_t x=0;
     102             :   //Double_t y=0;
     103             :   //Double_t z=0;
     104             :   //String_t namedtp[100];
     105             : 
     106           0 :   tree->SetBranchAddress("Sensor",&sensor);
     107           0 :   tree->SetBranchAddress("Side",&side);
     108           0 :   tree->SetBranchAddress("Sec",&sector);
     109           0 :   tree->SetBranchAddress("Num",&num);
     110           0 :   tree->SetBranchAddress("ECha",&echa);
     111             :   //tree->SetBranchAddress("X",&x);
     112             :   //tree->SetBranchAddress("Y",&y);
     113             :   //tree->SetBranchAddress("Z",&z);
     114             : 
     115             :   // firstSensor = (Int_t)tree->GetMinimum("ECha");
     116             :   // lastSensor = (Int_t)tree->GetMaximum("ECha");
     117             : 
     118           0 :   TClonesArray * array = new TClonesArray("AliEMCALSensorTemp",nentries);
     119             : 
     120           0 :   for (Int_t isensor=0; isensor<nentries; isensor++){
     121           0 :     AliEMCALSensorTemp * temp = new ((*array)[isensor])AliEMCALSensorTemp;
     122           0 :     tree->GetEntry(isensor);
     123           0 :     temp->SetId(sensor);
     124           0 :     temp->SetIdDCS(echa);
     125           0 :     TString stringID = Form (amandaString.Data(),echa);
     126           0 :     temp->SetStringID(stringID);
     127           0 :     if (side[0]=='C') temp->SetSide(1);
     128           0 :     temp->SetSector(sector);
     129           0 :     temp->SetNum(num);
     130             : 
     131             :     // Don't yet know the local or global coordinates for where the sensors will be placed..
     132             :     //temp->SetX(x);
     133             :     //temp->SetY(y);
     134             :     //temp->SetZ(z);
     135             : 
     136           0 :   }
     137           0 :   return array;
     138           0 : }

Generated by: LCOV version 1.11