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

Put residuals in an RVarDef and make a script to histogram them.

parent 5e124f83
No related branches found
No related tags found
No related merge requests found
{
TFile* f = new TFile("hodtest.root");
TTree *T=(TTree*)f->Get("T");
TCanvas *c1 = new TCanvas("c1", "Drift Chamber Residuals", 800, 1000);
c1->Divide(2,6);
TH1F* h=new TH1F("h", "Residual", 100, -1.0, 1.0);
c1->cd(1);
T->Draw("H.dc.residual[0]","H.dc.residual[0] < 999");
c1->cd(2);
T->Draw("H.dc.residual[1]","H.dc.residual[1] < 999");
c1->cd(3);
T->Draw("H.dc.residual[2]","H.dc.residual[2] < 999");
c1->cd(4);
T->Draw("H.dc.residual[3]","H.dc.residual[3] < 999");
c1->cd(5);
T->Draw("H.dc.residual[4]","H.dc.residual[4] < 999");
c1->cd(6);
T->Draw("H.dc.residual[5]","H.dc.residual[5] < 999");
c1->cd(7);
T->Draw("H.dc.residual[6]","H.dc.residual[6] < 999");
c1->cd(8);
T->Draw("H.dc.residual[7]","H.dc.residual[7] < 999");
c1->cd(9);
T->Draw("H.dc.residual[8]","H.dc.residual[8] < 999");
c1->cd(10);
T->Draw("H.dc.residual[9]","H.dc.residual[9] < 999");
c1->cd(11);
T->Draw("H.dc.residual[10]","H.dc.residual[10] < 999");
c1->cd(12);
T->Draw("H.dc.residual[11]","H.dc.residual[11] < 999");
}
......@@ -191,6 +191,8 @@ THaAnalysisObject::EStatus THcDC::Init( const TDatime& date )
fPlaneCoeffs[ip] = fPlanes[ip]->GetPlaneCoef();
}
fResiduals = new Double_t [fNPlanes];
// Replace with what we need for Hall C
// const DataDest tmp[NDEST] = {
// { &fRTNhit, &fRANhit, fRT, fRT_c, fRA, fRA_p, fRA_c, fROff, fRPed, fRGain },
......@@ -333,7 +335,7 @@ Int_t THcDC::DefineVariables( EMode mode )
{ "y", "Y at focal plane", "fDCTracks.THcDCTrack.GetY()"},
{ "xp", "YP at focal plane", "fDCTracks.THcDCTrack.GetXP()"},
{ "yp", "YP at focal plane", "fDCTracks.THcDCTrack.GetYP()"},
{ "p1residual", "Plane 1 Residual", "fDCTracks.THcDCTrack.GetResidual1()"},
{ "residual", "Residuals", "fResiduals"},
{ 0 }
};
return DefineVarsFromList( vars, mode );
......@@ -406,6 +408,9 @@ void THcDC::ClearEvent()
fChambers[i]->Clear();
}
for(Int_t i=0;i<fNPlanes;i++) {
fResiduals[i] = 1000.0;
}
// fTrackProj->Clear();
}
......@@ -859,6 +864,12 @@ void THcDC::TrackFit()
}
}
}
if(fNDCTracks>0) {
for(Int_t ip=0;ip<fNPlanes;ip++) {
THcDCTrack *theDCTrack = static_cast<THcDCTrack*>( fDCTracks->At(0));
fResiduals[ip] = theDCTrack->GetResidual(ip);
}
}
// print tracks if hdebugtrackprint is on
}
Double_t THcDC::DpsiFun(Double_t ray[4], Int_t plane)
......
......@@ -80,14 +80,15 @@ protected:
TClonesArray* fDCTracks; // Tracks found from stubs (THcDCTrack obj)
// Calibration
// Hall C Parameters
Int_t fNPlanes; // Total number of DC planes
char** fPlaneNames;
Int_t fNChambers;
// Per-event data
Int_t fNhits;
Int_t ntracks_fp; /* Change this to fN something */
// Potential Hall C parameters. Mostly here for demonstration
Int_t fNPlanes;
char** fPlaneNames;
Int_t fNChambers;
Double_t* fResiduals; //[fNPlanes] Array of residuals
Double_t fNSperChan; /* TDC bin size */
Double_t fWireVelocity;
......
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