Skip to content
Snippets Groups Projects
Commit a0e0b496 authored by Stephen A. Wood's avatar Stephen A. Wood
Browse files

Create the Scintillator planes in Hodoscope

parent 4359d3f9
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,52 @@ THcHodoscope::THcHodoscope( const char* name, const char* description, ...@@ -37,7 +37,52 @@ THcHodoscope::THcHodoscope( const char* name, const char* description,
{ {
// Constructor // Constructor
fTrackProj = new TClonesArray( "THaTrackProj", 5 ); //fTrackProj = new TClonesArray( "THaTrackProj", 5 );
// Construct the planes
Setup(name, description);
}
//_____________________________________________________________________________
void THcHodoscope::Setup(const char* name, const char* description)
{
static const char* const here = "Setup()";
static const char* const message =
"Must construct %s detector with valid name! Object construction failed.";
// Base class constructor failed?
if( IsZombie()) return;
fNPlanes = 4; // Eventually get # planes and plane names from a DB
fPlaneNames = new char* [fNPlanes];
for(Int_t i=0;i<fNPlanes;i++) {fPlaneNames[i] = new char[3];}
strcpy(fPlaneNames[0],"1x");
strcpy(fPlaneNames[1],"1y");
strcpy(fPlaneNames[2],"2x");
strcpy(fPlaneNames[3],"2y");
size_t nlen = strlen(name);
size_t slen = 0;
for(Int_t i=0;i < fNPlanes;i++)
{slen = TMath::Max(slen,strlen(fPlaneNames[i]));}
size_t len = nlen+slen+1;
// Probably shouldn't assume that description is defined
char* desc = new char[strlen(description)+50+slen];
char* subname = new char[len+1];
fPlanes = new THcScintillatorPlane* [fNPlanes];
for(Int_t i=0;i < fNPlanes;i++) {
strcpy(subname, name);
strcat(subname, ".");
strcat(subname, fPlaneNames[i]);
strcpy(desc, description);
strcpy(desc, " Hodoscope Plane ");
strcpy(desc, fPlaneNames[i]);
fPlanes[i] = new THcScintillatorPlane(subname, desc);
}
} }
//_____________________________________________________________________________ //_____________________________________________________________________________
...@@ -55,19 +100,6 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date ) ...@@ -55,19 +100,6 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date )
if( THaNonTrackingDetector::Init( date ) ) if( THaNonTrackingDetector::Init( date ) )
return fStatus; return fStatus;
// Construct the planes
fPlane = new THcScintillatorPlane* [fNPlanes];
for(Int_t ip=0; ip<fNPlanes; ip++) {
// Create a name and description
// Is it going to be a problem that I create these object in init?
// I could actually do it in the constructor, since the parameters
// will already have been read. Then I don't have to manually call
// ReadDatabase for each plane
GetTitle()
fPlane[ip] = THcScintillatorPlane( name, description);
}
// Replace with what we need for Hall C // Replace with what we need for Hall C
// const DataDest tmp[NDEST] = { // const DataDest tmp[NDEST] = {
// { &fRTNhit, &fRANhit, fRT, fRT_c, fRA, fRA_p, fRA_c, fROff, fRPed, fRGain }, // { &fRTNhit, &fRANhit, fRT, fRT_c, fRA, fRA_p, fRA_c, fROff, fRPed, fRGain },
...@@ -131,20 +163,20 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) ...@@ -131,20 +163,20 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date )
fNPlanes = 4; // Hardwire for now fNPlanes = 4; // Hardwire for now
fNPaddle = new Int_t [4]; fNPaddle = new Int_t [fNPlanes];
fNPaddle[0] = *(Int_t *)gHcParms->Find("hscin_1x_nr")->GetValuePointer(); fNPaddle[0] = *(Int_t *)gHcParms->Find("hscin_1x_nr")->GetValuePointer();
fNPaddle[1] = *(Int_t *)gHcParms->Find("hscin_1y_nr")->GetValuePointer(); fNPaddle[1] = *(Int_t *)gHcParms->Find("hscin_1y_nr")->GetValuePointer();
fNPaddle[2] = *(Int_t *)gHcParms->Find("hscin_2x_nr")->GetValuePointer(); fNPaddle[2] = *(Int_t *)gHcParms->Find("hscin_2x_nr")->GetValuePointer();
fNPaddle[3] = *(Int_t *)gHcParms->Find("hscin_2y_nr")->GetValuePointer(); fNPaddle[3] = *(Int_t *)gHcParms->Find("hscin_2y_nr")->GetValuePointer();
fSpacing = new Double_t [4]; fSpacing = new Double_t [fNPlanes];
fSpacing[0] = gHcParms->Find("hscin_1x_spacing")->GetValue(0); fSpacing[0] = gHcParms->Find("hscin_1x_spacing")->GetValue(0);
fSpacing[1] = gHcParms->Find("hscin_1y_spacing")->GetValue(0); fSpacing[1] = gHcParms->Find("hscin_1y_spacing")->GetValue(0);
fSpacing[2] = gHcParms->Find("hscin_2x_spacing")->GetValue(0); fSpacing[2] = gHcParms->Find("hscin_2x_spacing")->GetValue(0);
fSpacing[3] = gHcParms->Find("hscin_2y_spacing")->GetValue(0); fSpacing[3] = gHcParms->Find("hscin_2y_spacing")->GetValue(0);
fCenter = new Double_t* [4]; fCenter = new Double_t* [fNPlanes];
Double_t* p; Double_t* p;
Int_t iplane; Int_t iplane;
......
...@@ -46,11 +46,12 @@ protected: ...@@ -46,11 +46,12 @@ protected:
// Potential Hall C parameters. Mostly here for demonstration // Potential Hall C parameters. Mostly here for demonstration
Int_t fNPlanes; Int_t fNPlanes;
char** fPlaneNames;
Int_t* fNPaddle; // Number of paddles per plane Int_t* fNPaddle; // Number of paddles per plane
Double_t* fSpacing; // Paddle spacing in cm Double_t* fSpacing; // Paddle spacing in cm
Double_t** fCenter; // Center position of each paddle Double_t** fCenter; // Center position of each paddle
THcScintillatorPlane** fPlane; // List of plane objects THcScintillatorPlane** fPlanes; // List of plane objects
TClonesArray* fTrackProj; // projection of track onto scintillator plane TClonesArray* fTrackProj; // projection of track onto scintillator plane
// and estimated match to TOF paddle // and estimated match to TOF paddle
...@@ -81,6 +82,8 @@ protected: ...@@ -81,6 +82,8 @@ protected:
virtual Double_t TimeWalkCorrection(const Int_t& paddle, virtual Double_t TimeWalkCorrection(const Int_t& paddle,
const ESide side); const ESide side);
void Setup(const char* name, const char* description);
ClassDef(THcHodoscope,0) // Generic hodoscope class ClassDef(THcHodoscope,0) // Generic hodoscope class
}; };
......
...@@ -26,3 +26,22 @@ THcScintillatorPlane::~THcScintillatorPlane() ...@@ -26,3 +26,22 @@ THcScintillatorPlane::~THcScintillatorPlane()
// Destructor // Destructor
} }
//_____________________________________________________________________________
Int_t THcScintillatorPlane::Decode( const THaEvData& evdata )
{
return 0;
}
//_____________________________________________________________________________
Int_t THcScintillatorPlane::CoarseProcess( TClonesArray& tracks )
{
// HitCount();
return 0;
}
//_____________________________________________________________________________
Int_t THcScintillatorPlane::FineProcess( TClonesArray& tracks )
{
return 0;
}
...@@ -17,13 +17,15 @@ ...@@ -17,13 +17,15 @@
class THcScintillatorPlane : public THaNonTrackingDetector { class THcScintillatorPlane : public THaNonTrackingDetector {
public: public:
virtual ~THcScintillatorPlane();
THcScintillatorPlane( const char* name, const char* description, THcScintillatorPlane( const char* name, const char* description,
THaApparatus* a = NULL); THaApparatus* a = NULL);
virtual ~THcScintillatorPlane();
virtual Int_t Decode( const THaEvData& );
virtual Int_t CoarseProcess( TClonesArray& tracks ) = 0; virtual Int_t CoarseProcess( TClonesArray& tracks );
virtual Int_t FineProcess( TClonesArray& tracks ) = 0; virtual Int_t FineProcess( TClonesArray& tracks );
Bool_t IsTracking() { return kFALSE; } Bool_t IsTracking() { return kFALSE; }
virtual Bool_t IsPid() { return kFALSE; } virtual Bool_t IsPid() { return kFALSE; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment