diff --git a/src/THcDC.cxx b/src/THcDC.cxx index 23185946fd6c0c5807d1ec93844f38f4fcde99d2..568fcec6042bce18198d7ca013fc5d10f9917fe3 100644 --- a/src/THcDC.cxx +++ b/src/THcDC.cxx @@ -151,8 +151,7 @@ void THcDC::Setup(const char* name, const char* description) THcDriftChamber* newchamber = new THcDriftChamber(desc, desc, i+1, this); fChambers.push_back(newchamber); cout << "Created Drift Chamber " << i+1 << ", " << desc << endl; - - + newchamber->SetHMSStyleFlag(fHMSStyleChambers); // Tell the chamber its style } } diff --git a/src/THcDriftChamber.cxx b/src/THcDriftChamber.cxx index b511b7b41a4a4c298be5675c55acecf8f9671658..2e88272cfc7df2085075f3733ee656bd012d72ef 100644 --- a/src/THcDriftChamber.cxx +++ b/src/THcDriftChamber.cxx @@ -47,32 +47,13 @@ THcDriftChamber::THcDriftChamber( fSpacePoints = new TClonesArray("THcSpacePoint",10); + fHMSStyleChambers = 0; // Default } //_____________________________________________________________________________ void THcDriftChamber::Setup(const char* name, const char* description) { - char prefix[2]; - - THaApparatus *app = GetApparatus(); - if(app) { - cout << app->GetName() << endl; - } else { - cout << "No apparatus found" << endl; - } - - prefix[0]=tolower(app->GetName()[0]); - prefix[1]='\0'; - - // For now, decide chamber style from the spectrometer name. - // Should override with a paramter - if(prefix[0]=='h') { - fHMSStyleChambers = 1; - } else { - fHMSStyleChambers = 0; - } - } //_____________________________________________________________________________ @@ -138,6 +119,8 @@ void THcDriftChamber::AddPlane(THcDriftChamberPlane *plane) } } fNPlanes++; + cout << fHMSStyleChambers << "P" << fNPlanes << " " << YPlaneNum << " " << YPlanePNum << " " + << YPlaneInd << " " << YPlanePInd << endl; return; } diff --git a/src/THcDriftChamber.h b/src/THcDriftChamber.h index 7dda3e601dea1031b5fa8482d0a6665bfba7aba7..d49dfeb42795d73e7c476330adb26ab1c3e96bf4 100644 --- a/src/THcDriftChamber.h +++ b/src/THcDriftChamber.h @@ -53,6 +53,7 @@ public: Int_t GetChamberNum() const { return fChamberNum;} Double_t GetZPos() const {return fZPos;} // friend class THaScCalib; + void SetHMSStyleFlag(Int_t flag) {fHMSStyleChambers = flag;} THcDriftChamber(); // for ROOT I/O // Why do we need this? protected: