Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcSpacePoint.h
Go to the documentation of this file.
1#ifndef ROOT_THcSpacePoint
2#define ROOT_THcSpacePoint
3
5// //
6// THcSpacePoint //
7// //
9
10#include "TObject.h"
11#include "THcDCHit.h"
12
13class THcSpacePoint : public TObject {
14
15public:
16
17 THcSpacePoint(Int_t nhits=0, Int_t ncombos=0) :
18 fNHits(nhits), fNCombos(ncombos),fSetStubFlag(kFALSE) {
19 fHits.clear();
20 }
21 virtual ~THcSpacePoint() {}
22
23 struct Hit {
25 Double_t distCorr; // Drift distance corrected by propagation along wire
26 Int_t lr; // Left right flag (+/- 1)
27 // Should we copy into here the information from hit
28 // this is likely to be often used?
29 };
30
31 void SetXY(Double_t x, Double_t y) {fX = x; fY = y;};
32 void Clear(Option_t* opt="") {fNHits=0; fNCombos=0; fHits.clear();};
33 void AddHit(THcDCHit* hit) {
34 Hit newhit;
35 newhit.dchit = hit;
36 newhit.distCorr = 0.0;
37 newhit.lr = 0;
38 fHits.push_back(newhit);
39 fNHits++;
40 }
41 Int_t GetNHits() {return fNHits;};
42 void SetNHits(Int_t nhits) {fNHits = nhits;};
43 Double_t GetX() {return fX;};
44 Double_t GetY() {return fY;};
46 THcDCHit* GetHit(Int_t ihit) {return fHits[ihit].dchit;};
47 // std::vector<THcDCHit*>* GetHitVectorP() {return &fHits;};
48 //std::vector<Hit>* GetHitStuffVectorP() {return &fHits;};
49 void ReplaceHit(Int_t ihit, THcDCHit *hit) {
50 fHits[ihit].dchit = hit;
51 fHits[ihit].distCorr = 0.0;
52 fHits[ihit].lr = 0;
53 };
54 void SetHitDist(Int_t ihit, Double_t dist) {
55 fHits[ihit].distCorr = dist;
56 };
57 void SetHitLR(Int_t ihit, Int_t lr) {
58 fHits[ihit].lr = lr;
59 };
60 void SetStub(Double_t stub[4]) {
61 for(Int_t i=0;i<4;i++) {
62 fStub[i] = stub[i];
63 }
65 };
66 Double_t GetHitDist(Int_t ihit) { return fHits[ihit].distCorr; };
67 Int_t GetHitLR(Int_t ihit) { return fHits[ihit].lr; };
68 Double_t* GetStubP() { return fStub; };
69 void IncCombos() { fNCombos++; };
70 void SetCombos(Int_t ncombos) { fNCombos=ncombos; };
71 Int_t GetCombos() { return fNCombos; };
72 Double_t GetStubX() {return fStub[0];};
73 Double_t GetStubXP() {return fStub[2];};
74 Double_t GetStubY() {return fStub[1];};
75 Double_t GetStubYP() {return fStub[3];};
76
77 // This is the chamber number (1,2), not index (0,1). Sometime
78 // we need figure out how to avoid confusion between number and index.
81
82protected:
83
88 // This adds more indirection to getting hit information.
89 std::vector<Hit> fHits;
90 //std::vector<THcDCHit*> fHits;
93 // Should we also have a pointer back to the chamber object
94
95 ClassDef(THcSpacePoint,0); // Space Point/stub track in a single drift chamber
96};
97
99
100#endif
int Int_t
bool Bool_t
const Bool_t kFALSE
double Double_t
const Bool_t kTRUE
const char Option_t
Drift chamber wire hit info.
Definition THcDCHit.h:16
Class representing a single hit DC.
Double_t GetStubXP()
void SetHitLR(Int_t ihit, Int_t lr)
void SetStub(Double_t stub[4])
std::vector< Hit > fHits
void SetCombos(Int_t ncombos)
Int_t GetHitLR(Int_t ihit)
Double_t GetY()
void SetNHits(Int_t nhits)
virtual ~THcSpacePoint()
void SetXY(Double_t x, Double_t y)
Int_t fNChamber_spnum
void AddHit(THcDCHit *hit)
Bool_t fSetStubFlag
THcDCHit * GetHit(Int_t ihit)
Double_t * GetStubP()
Double_t GetStubYP()
Double_t GetStubY()
void ReplaceHit(Int_t ihit, THcDCHit *hit)
Double_t GetHitDist(Int_t ihit)
void Clear(Option_t *opt="")
Double_t fStub[4]
Double_t GetStubX()
Bool_t GetSetStubFlag()
THcSpacePoint(Int_t nhits=0, Int_t ncombos=0)
Double_t GetX()
Int_t GetCombos()
void SetHitDist(Int_t ihit, Double_t dist)
ClassDef(THcSpacePoint, 0)
Double_t y[n]
Double_t x[n]
double dist(AxisAngle const &r1, AxisAngle const &r2)