diff --git a/src/THcHallCSpectrometer.cxx b/src/THcHallCSpectrometer.cxx index b5f5723b920359e20b315b910e3098914cfd218e..b5f68c1cc6400b07d39f762bca9e5a03e256358a 100644 --- a/src/THcHallCSpectrometer.cxx +++ b/src/THcHallCSpectrometer.cxx @@ -206,7 +206,7 @@ Int_t THcHallCSpectrometer::ReadDatabase( const TDatime& date ) {"thetacentral_offset", &fThetaCentralOffset, kDouble }, {"_oopcentral_offset", &fOopCentralOffset, kDouble }, {"pcentral_offset", &fPCentralOffset, kDouble }, - {"pcentral", &fPCentral, kDouble }, + {"pcentral", &fPcentral, kDouble }, {"theta_lab", &fTheta_lab, kDouble }, {"partmass", &fPartMass, kDouble }, {"sel_using_scin", &fSelUsingScin, kInt, 0, 1}, @@ -251,9 +251,9 @@ Int_t THcHallCSpectrometer::ReadDatabase( const TDatime& date ) cout << "fPruneNPMT = " << fPruneNPMT << endl; cout << "sel using prune = " << fSelUsingPrune << endl; cout << "fPartMass = " << fPartMass << endl; - cout << "fPcentral = " << fPCentral << " " <<fPCentralOffset << endl; + cout << "fPcentral = " << fPcentral << " " <<fPCentralOffset << endl; cout << "fThate_lab = " << fTheta_lab << " " <<fThetaCentralOffset << endl; - fPCentral= fPCentral*(1.+fPCentralOffset/100.); + fPcentral= fPcentral*(1.+fPCentralOffset/100.); // Check that these offsets are in radians fTheta_lab=fTheta_lab + fThetaCentralOffset*TMath::RadToDeg(); Double_t ph = 0.0+fPhiOffset*TMath::RadToDeg(); @@ -378,7 +378,7 @@ Int_t THcHallCSpectrometer::FindVertices( TClonesArray& tracks ) track->SetDp(sum[3]*100.0+fDeltaOffset); // Percent. (Don't think podd cares if it is % or fraction) // There is an hpcentral_offset that needs to be applied somewhere. // (happly_offs) - track->SetMomentum(fPCentral*(1+track->GetDp()/100.0)); + track->SetMomentum(fPcentral*(1+track->GetDp()/100.0)); } diff --git a/src/THcHallCSpectrometer.h b/src/THcHallCSpectrometer.h index 4306196e3a3cd19b4d48e139ba5a89c198daf285..1e132ad52c2024163b60c49c2706782dfd8edafc 100644 --- a/src/THcHallCSpectrometer.h +++ b/src/THcHallCSpectrometer.h @@ -123,9 +123,8 @@ protected: Double_t fThetaCentralOffset; // Offset of Central spectrometer angle (rad) Double_t fOopCentralOffset; //Offset of central out-of-plane angle (rad) Double_t fPCentralOffset; // Offset Central spectrometer momentum (%) - Double_t fPCentral; // Central spectrometer momentum (GeV) Double_t fTheta_lab; // Central spectrometer angle (deg) - + // For spectrometer central momentum use fPcentral in THaSpectrometer.h // THaScintillator *sc_ref; // calculate time track hits this plane // Flag for fProperties indicating that tracks are to be sorted by chi2 diff --git a/src/THcShower.cxx b/src/THcShower.cxx index d7983c3c60f0ab13caf3a91f181e619570317b8b..bb89477bc70f3d2de8a1f589d0546cab1e46e3f4 100644 --- a/src/THcShower.cxx +++ b/src/THcShower.cxx @@ -10,6 +10,7 @@ /////////////////////////////////////////////////////////////////////////////// #include "THcShower.h" +#include "THcHallCSpectrometer.h" //#include "THcShowerCluster.h" #include "THaEvData.h" #include "THaDetMap.h" @@ -135,6 +136,7 @@ THaAnalysisObject::EStatus THcShower::Init( const TDatime& date ) return kInitError; } + cout << "---------------------------------------------------------------\n"; cout << "From THcShower::Init: initialized " << GetName() << endl; cout << "---------------------------------------------------------------\n"; @@ -466,6 +468,8 @@ Int_t THcShower::DefineVariables( EMode mode ) RVarDef vars[] = { { "nhits", "Number of hits", "fNhits" }, { "nclust", "Number of clusters", "fNclust" }, + { "etot", "Total energy", "fEtot" }, + { "etotnorm", "Total energy divided by Central Momentum", "fEtotNorm" }, { "ntracks", "Number of shower tracks", "fNtracks" }, { 0 } }; @@ -514,6 +518,8 @@ void THcShower::Clear(Option_t* opt) fNhits = 0; fNclust = 0; fNtracks = 0; + fEtot = 0.; + fEtotNorm = 0.; fClusterList->purge(); @@ -549,8 +555,11 @@ Int_t THcShower::Decode( const THaEvData& evdata ) Int_t nexthit = 0; for(UInt_t ip=0;ip<fNLayers;ip++) { nexthit = fPlanes[ip]->ProcessHits(fRawHitList, nexthit); + fEtot += fPlanes[ip]->GetEplane(); } - + THcHallCSpectrometer *app = static_cast<THcHallCSpectrometer*>(GetApparatus()); + fEtotNorm=fEtot/(app->GetPcentral()); + return nhits; } diff --git a/src/THcShower.h b/src/THcShower.h index 8f3b50afae9d6a291a8b5f6dd8ccddef7f2bd39b..0e1880ed431b6628e37c2965c3290704b3cfb645 100644 --- a/src/THcShower.h +++ b/src/THcShower.h @@ -459,9 +459,12 @@ protected: Int_t fNclust; // Number of clusters Int_t fNtracks; // Number of shower tracks, i.e. number of // cluster-to-track association + Double_t fEtot; // Total energy + Double_t fEtotNorm; // Total energy divided by spec central momentum THcShowerClusterList* fClusterList; // List of hit clusters + // Geometrical parameters. char** fLayerNames;