Newer
Older
Buddhini Waidyawansa
committed
// Author : Buddhini Waidyawansa
// Date : 12-09-2013
///////////////////////////////////////////////////////////////////////////////
// //
// THcRaster //
// //
// A class to decode the fast raster signals. //
Buddhini Waidyawansa
committed
// Measures the two magnet currents which are propotioanl to horizontal and //
// vertical beam position //
Buddhini Waidyawansa
committed
// //
///////////////////////////////////////////////////////////////////////////////
Buddhini Waidyawansa
committed
#include "THcRaster.h"
#include "THcHitList.h"
Buddhini Waidyawansa
committed
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
//_____________________________________________________________________________
THcRaster::THcRaster( const char* name, const char* description,
THaApparatus* apparatus ) :
Buddhini Waidyawansa
committed
THaBeamDet(name,description,apparatus)
Buddhini Waidyawansa
committed
{
Buddhini Waidyawansa
committed
// // Initializing channels
// fRasterXADC = new TClonesArray("THcSignalHit",16);
// fRasterYADC = new TClonesArray("THcSignalHit",16);
Buddhini Waidyawansa
committed
}
//_____________________________________________________________________________
THcRaster::THcRaster( ) :
Buddhini Waidyawansa
committed
THaBeamDet()
Buddhini Waidyawansa
committed
{
// Default constructor
}
//_____________________________________________________________________________
THcRaster::~THRaster()
{
// Distructor
}
Buddhini Waidyawansa
committed
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//_____________________________________________________________________________
void THcRaster::ClearEvent(){
// do nothing for now
}
//_____________________________________________________________________________
// ReadDatabase: if detectors cant be added to detmap
Int_t THcRaster::ReadDatabase( const TDatime& date )
{
static const char* const here = "THcRaster::ReadDatabase";
InitializeReconstruction();
char prefix[2];
cout << " GetName() " << GetName() << endl;
prefix[0]=tolower(GetName()[0]);
prefix[1]='\0';
string channelNames;
DBRequest channellist[]={
{"graster_channels",&channelNames,kString},
{0}
};
// get the channel list from the parameter file
gHcParms->LoadParmValues((DBRequest*)&channellist,prefix);
std::cout << "Raster channel list : " << channellist << std::endl;
vector<string> channel_names = vsplit(channellist);
Int_t NChannels = channel_names.size_of();
for(Int_t i=0;i<NChannels;i++) {
// fPlaneNames[i] = new char[plane_names[i].length()];
// strcpy(fPlaneNames[i], plane_names[i].c_str());
std::cout<<" channel = "<<channel_names.at(i)<<std::endl;
}
return kOK
}
//_____________________________________________________________________________
Int_t THcRaster::Decode( const THaEvData& evdata )
{
// Get the Hall C style hitlist (fRawHitList) for this event
// empty for now while I work on reading the channel map.
return 0;
}
//_____________________________________________________________________________
Int_t THaRaster::Process( ){
// empty for now while I work on reading the channel map.
return o;
}
Buddhini Waidyawansa
committed
ClassImp(THcRaster)
////////////////////////////////////////////////////////////////////////////////