diff --git a/src/THcHodoscope.cxx b/src/THcHodoscope.cxx index 01dda244384d4a6589d77c9ee2cae7e00cf201f1..4a7f365f3cb78d3258b051d56060fe427bcde181 100644 --- a/src/THcHodoscope.cxx +++ b/src/THcHodoscope.cxx @@ -79,7 +79,7 @@ void THcHodoscope::Setup(const char* name, const char* description) {"hodo_plane_names",&planenamelist, kString}, {0} }; - fNPlanes = 4; // Default if not defined + //fNPlanes = 4; // Default if not defined gHcParms->LoadParmValues((DBRequest*)&listextra,prefix); cout << "Plane Name List : " << planenamelist << endl; @@ -111,7 +111,7 @@ void THcHodoscope::Setup(const char* name, const char* description) strcpy(desc, description); strcat(desc, " Plane "); strcat(desc, fPlaneNames[i]); - fPlanes[i] = new THcScintillatorPlane(fPlaneNames[i], desc, i+1,this); // Number planes starting from zero!! + fPlanes[i] = new THcScintillatorPlane(fPlaneNames[i], desc, i+1,fNPlanes,this); // Number planes starting from zero!! cout << "Created Scintillator Plane " << fPlaneNames[i] << ", " << desc << endl; } } @@ -317,7 +317,7 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) strcpy(parname,prefix); strcat(parname,"scin_"); Int_t plen=strlen(parname); - + cout << " readdatabse hodo fnplanes = " << fNPlanes << endl; fNPaddle = new Int_t [fNPlanes]; // fSpacing = new Double_t [fNPlanes]; //fCenter = new Double_t* [fNPlanes]; @@ -406,6 +406,11 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) {"hodo_pos_ped_limit",&fHodoPosPedLimit[0],kInt,fMaxHodoScin}, {"hodo_neg_ped_limit",&fHodoNegPedLimit[0],kInt,fMaxHodoScin}, {"tofusinginvadc",&fTofUsingInvAdc,kInt}, + {0} + }; + gHcParms->LoadParmValues((DBRequest*)&list,prefix); + if (fTofUsingInvAdc) { + DBRequest list2[]={ {"hodo_pos_invadc_offset",&fHodoPosInvAdcOffset[0],kDouble,fMaxHodoScin}, {"hodo_neg_invadc_offset",&fHodoNegInvAdcOffset[0],kDouble,fMaxHodoScin}, {"hodo_pos_invadc_linear",&fHodoPosInvAdcLinear[0],kDouble,fMaxHodoScin}, @@ -414,7 +419,8 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) {"hodo_neg_invadc_adc",&fHodoNegInvAdcAdc[0],kDouble,fMaxHodoScin}, {0} }; - gHcParms->LoadParmValues((DBRequest*)&list,prefix); + gHcParms->LoadParmValues((DBRequest*)&list2,prefix); + }; if (fDebug >=1) { cout <<"******* Testing Hodoscope Parameter Reading ***\n"; cout<<"StarTimeCenter = "<<fStartTimeCenter<<endl;