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

Retrieve a few variables in THcDriftChamber with DBRequest/LoadValues

parent bd67b2c1
No related branches found
No related tags found
No related merge requests found
...@@ -60,18 +60,15 @@ void THcDriftChamber::Setup(const char* name, const char* description) ...@@ -60,18 +60,15 @@ void THcDriftChamber::Setup(const char* name, const char* description)
prefix[0]=tolower(app->GetName()[0]); prefix[0]=tolower(app->GetName()[0]);
prefix[1]='\0'; prefix[1]='\0';
strcpy(parname,prefix); DBRequest list[]={
strcat(parname,name); // Append "dc" {"dc_num_planes",&fNPlanes, kInt},
Int_t plen=strlen(parname); {"dc_num_chambers",&fNChambers, kDouble},
cout << "parname=" << parname << endl; {0}
};
// Get number of planes and number wires for each plane gHcParms->LoadParmValues((DBRequest*)&list,prefix);
strcat(parname,"_num_planes");
fNPlanes = *(Int_t *)gHcParms->Find(parname)->GetValuePointer(); cout << "Drift Chambers: " << fNPlanes << " planes in " << fNChambers << " chambers" << endl;
parname[plen] = '\0';
strcat(parname,"_num_chambers");
fNChambers = *(Int_t *)gHcParms->Find(parname)->GetValuePointer();
fPlaneNames = new char* [fNPlanes]; fPlaneNames = new char* [fNPlanes];
...@@ -172,22 +169,18 @@ Int_t THcDriftChamber::ReadDatabase( const TDatime& date ) ...@@ -172,22 +169,18 @@ Int_t THcDriftChamber::ReadDatabase( const TDatime& date )
prefix[1]='\0'; prefix[1]='\0';
strcpy(parname,prefix);
strcat(parname,"dc");
Int_t plen=strlen(parname);
// Get number of planes and number wires for each plane
strcat(parname,"_num_planes");
fNPlanes = *(Int_t *)gHcParms->Find(parname)->GetValuePointer();
parname[plen]='\0';
strcat(parname,"_nrwire");
fNWires = new Int_t [fNPlanes]; fNWires = new Int_t [fNPlanes];
Int_t* p= (Int_t *)gHcParms->Find(parname)->GetValuePointer(); DBRequest list[]={
{"dc_nrwire",fNWires, kInt, fNPlanes},
{0}
};
gHcParms->LoadParmValues((DBRequest*)&list,prefix);
cout << "Plane counts:";
for(Int_t i=0;i<fNPlanes;i++) { for(Int_t i=0;i<fNPlanes;i++) {
fNWires[i] = p[i]; cout << " " << fNWires[i];
} }
cout << endl;
fIsInit = true; fIsInit = true;
......
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