ROOT logo
using namespace std;
#include "hshowerwiretab.h"
#include "hparamlist.h"
#include <iostream> 
#include <iomanip>
#include <stdlib.h>
#include <math.h>

ClassImp(HShowerWireTab)

//_HADES_CLASS_DESCRIPTION 
/////////////////////////////////////////////////////////////
// HShowerWireTab
// Table of local coordinates of wires
//
/////////////////////////////////////////////////////////////

HShowerWireTab::HShowerWireTab() {
//creating empty table
  nWires = 89;
  wiresArr.Set(89);
  reset();
}

void HShowerWireTab::reset() {
//clearing data 
   fDistWire = 0.0f;
   wiresArr.Reset(0.f);
}

void HShowerWireTab::putParams(HParamList* l) {
  // puts the parameters into the list
  if (!l) return;
  l->add(Form("fDistWire_%i",m_nModuleID),fDistWire);
  l->add(Form("pWireYPositions_%i",m_nModuleID),wiresArr);
}

Bool_t HShowerWireTab::getParams(HParamList* l) {
  // gets the parameters from the list
  if (!l) return kFALSE;
  if (!l->fill(Form("fDistWire_%i",m_nModuleID),&fDistWire)) return kFALSE;
  if (!l->fill(Form("pWireYPositions_%i",m_nModuleID),&wiresArr)) return kFALSE;
  if (wiresArr.GetSize()!=nWires) {
    Error("getParams(HParamList*)","Only %i wire positions read instead of %i",
          wiresArr.GetSize(),nWires);
  }
  return kTRUE;
}

Int_t HShowerWireTab::lookupWire(Float_t y) {
  //return number of wire at position y
  Int_t nWireNr = -1;
  Float_t pos=0.f;
  for(Int_t j = 0; j < nWires; j++) {	 
    pos = wiresArr.At(j);
    if ((y >= pos - fDistWire) && (y < pos + fDistWire)) {
      nWireNr = j;
      break;
    }
  }
  return nWireNr;
}
 hshowerwiretab.cc:1
 hshowerwiretab.cc:2
 hshowerwiretab.cc:3
 hshowerwiretab.cc:4
 hshowerwiretab.cc:5
 hshowerwiretab.cc:6
 hshowerwiretab.cc:7
 hshowerwiretab.cc:8
 hshowerwiretab.cc:9
 hshowerwiretab.cc:10
 hshowerwiretab.cc:11
 hshowerwiretab.cc:12
 hshowerwiretab.cc:13
 hshowerwiretab.cc:14
 hshowerwiretab.cc:15
 hshowerwiretab.cc:16
 hshowerwiretab.cc:17
 hshowerwiretab.cc:18
 hshowerwiretab.cc:19
 hshowerwiretab.cc:20
 hshowerwiretab.cc:21
 hshowerwiretab.cc:22
 hshowerwiretab.cc:23
 hshowerwiretab.cc:24
 hshowerwiretab.cc:25
 hshowerwiretab.cc:26
 hshowerwiretab.cc:27
 hshowerwiretab.cc:28
 hshowerwiretab.cc:29
 hshowerwiretab.cc:30
 hshowerwiretab.cc:31
 hshowerwiretab.cc:32
 hshowerwiretab.cc:33
 hshowerwiretab.cc:34
 hshowerwiretab.cc:35
 hshowerwiretab.cc:36
 hshowerwiretab.cc:37
 hshowerwiretab.cc:38
 hshowerwiretab.cc:39
 hshowerwiretab.cc:40
 hshowerwiretab.cc:41
 hshowerwiretab.cc:42
 hshowerwiretab.cc:43
 hshowerwiretab.cc:44
 hshowerwiretab.cc:45
 hshowerwiretab.cc:46
 hshowerwiretab.cc:47
 hshowerwiretab.cc:48
 hshowerwiretab.cc:49
 hshowerwiretab.cc:50
 hshowerwiretab.cc:51
 hshowerwiretab.cc:52
 hshowerwiretab.cc:53
 hshowerwiretab.cc:54
 hshowerwiretab.cc:55
 hshowerwiretab.cc:56
 hshowerwiretab.cc:57
 hshowerwiretab.cc:58
 hshowerwiretab.cc:59
 hshowerwiretab.cc:60
 hshowerwiretab.cc:61
 hshowerwiretab.cc:62