From 824e50dcd9e6d76214dfbd5893b1e58f7f39a028 Mon Sep 17 00:00:00 2001 From: Whitney Armstrong <warmstrong@anl.gov> Date: Mon, 4 Feb 2019 11:09:40 -0600 Subject: [PATCH] modified: src/THcDC.cxx modified: src/THcDC.h modified: src/THcDriftChamberPlane.cxx modified: src/THcDriftChamberPlane.h modified: src/include/HallC_LinkDef.h --- src/THcDC.cxx | 2 ++ src/THcDC.h | 10 ++++++---- src/THcDriftChamberPlane.cxx | 3 +-- src/THcDriftChamberPlane.h | 2 ++ src/include/HallC_LinkDef.h | 1 + 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/THcDC.cxx b/src/THcDC.cxx index cb5c128..2651bb7 100644 --- a/src/THcDC.cxx +++ b/src/THcDC.cxx @@ -688,7 +688,9 @@ void THcDC::SetFocalPlaneBestTrack(Int_t golden_track_index) for (UInt_t ihit = 0; ihit < UInt_t (tr1->GetNHits()); ihit++) { THcDCHit *hit = tr1->GetHit(ihit); Int_t plane = hit->GetPlaneNum() - 1; + _basic_data._Residuals[plane] = tr1->GetResidual(plane); fResiduals[plane] = tr1->GetResidual(plane); + _basic_data._ResidualsExclPlane[plane] = tr1->GetResidualExclPlane(plane); fResidualsExclPlane[plane] = tr1->GetResidualExclPlane(plane); } EfficiencyPerWire(golden_track_index); diff --git a/src/THcDC.h b/src/THcDC.h index 9275974..df5c89f 100644 --- a/src/THcDC.h +++ b/src/THcDC.h @@ -15,6 +15,7 @@ #include "THcDriftChamber.h" #include "TMath.h" +#include <map> #include "hcana/Logger.h" #define NUM_FPRAY 4 @@ -27,10 +28,11 @@ namespace hallc { */ struct DriftChamber { - std::vector<double> _Residuals; - std::vector<double> _ResidualsExclPlane; - std::vector<double> _Wire_hit_did; - std::vector<double> _Wire_hit_should; + // Plane number + std::map<int,double> _Residuals; + std::map<int,double> _ResidualsExclPlane; + std::map<int,double> _Wire_hit_did; + std::map<int,double> _Wire_hit_should; ClassDef(DriftChamber,1) }; diff --git a/src/THcDriftChamberPlane.cxx b/src/THcDriftChamberPlane.cxx index e6f97eb..0948adb 100644 --- a/src/THcDriftChamberPlane.cxx +++ b/src/THcDriftChamberPlane.cxx @@ -257,8 +257,7 @@ Int_t THcDriftChamberPlane::ReadDatabase( const TDatime& date ) // For HMS, wire numbers start with one, but arrays start with zero. // So wire number is index+1 for (int i=0; i<nWires; i++) { - Double_t pos = fPitch*( (fWireOrder==0?(i+1):fNWires-i) - - fCentralWire) - fCenter; + Double_t pos = fPitch * ((fWireOrder == 0 ? (i + 1) : fNWires - i) - fCentralWire) - fCenter; Int_t readoutside = GetReadoutSide(i+1); new((*fWires)[i]) THcDCWire( i+1, pos , fTzeroWire[i], fSigmaWire[i], readoutside, fTTDConv); //added fTzeroWire/fSigmaWire to be read in as fTOffset --Carlos } diff --git a/src/THcDriftChamberPlane.h b/src/THcDriftChamberPlane.h index 204e4e3..0a65b24 100644 --- a/src/THcDriftChamberPlane.h +++ b/src/THcDriftChamberPlane.h @@ -52,6 +52,8 @@ public: { assert( i>=1 && i<=GetNWires() ); return (THcDCWire*)fWires->UncheckedAt(i-1); } + TClonesArray* GetWires() { return fWires; } + Int_t GetNHits() const { return fHits->GetLast()+1; } Int_t GetNRawhits() const {return fNRawhits; } TClonesArray* GetHits() const { return fHits; } diff --git a/src/include/HallC_LinkDef.h b/src/include/HallC_LinkDef.h index 76b06d2..aae8615 100644 --- a/src/include/HallC_LinkDef.h +++ b/src/include/HallC_LinkDef.h @@ -21,6 +21,7 @@ #pragma link C++ global gHcParms; #pragma link C++ global gHcDetectorMap; + #pragma link C++ class Decoder::Scaler9001+; #pragma link C++ class Decoder::Scaler9250+; #pragma link C++ class THcAerogel+; -- GitLab