Hall C ROOT/C++ Analyzer (hcana)
THcDriftChamber.h
Go to the documentation of this file.
1 #ifndef ROOT_THcDriftChamber
2 #define ROOT_THcDriftChamber
3 
5 // //
6 // THcDriftChamber //
7 // //
9 
10 #include "THaSubDetector.h"
11 #include "THcDriftChamberPlane.h"
12 #include "TClonesArray.h"
13 #include "TMatrixD.h"
14 
15 #include <map>
16 #include <vector>
18  std::vector<Int_t> SpNHits; //< [] Number of Hits in space point
19  std::vector<Int_t> SpHitIndex; //< []*SpNHits Hit index for each hit in sp point
20  void clear() {
21  SpNHits.clear();
22  SpHitIndex.clear();
23  }
24 };
25 
26 #define MAX_SPACE_POINTS 100
27 #define MAX_HITS_PER_POINT 20
28 
29 //#include "TMath.h"
30 
31 
32 //class THaScCalib;
33 class TClonesArray;
34 class THcSpacePoint;
35 
36 
37 class THcDriftChamber : public THaSubDetector {
38 
39 public:
40  THcDriftChamber( const char* name, const char* description, Int_t chambernum,
41  THaDetectorBase* parent = NULL );
42  virtual ~THcDriftChamber();
43 
44  virtual Int_t Decode( const THaEvData& );
45  virtual EStatus Init( const TDatime& run_time );
46 
47  virtual void AddPlane(THcDriftChamberPlane *plane);
48  virtual Int_t ApplyCorrections( void );
49  virtual void ProcessHits( void );
50  virtual Int_t FindSpacePoints( void ) ;
51  virtual Int_t NewFindSpacePoints( void ) ;
52  virtual void PrintDecode( void ) ;
53  virtual void CorrectHitTimes( void ) ;
54  virtual void LeftRight(void);
55 
56 
57  virtual void Clear( Option_t* opt="" );
58 
59  Int_t GetNHits() const { return fNhits; }
60  Int_t GetNSpacePoints() const { return(fNSpacePoints);}
61  Int_t GetNTracks() const { return fTrackProj->GetLast()+1; }
62  const TClonesArray* GetTrackHits() const { return fTrackProj; }
64  Int_t GetChamberNum() const { return fChamberNum;}
65  Double_t GetZPos() const {return fZPos;}
66  // friend class THaScCalib;
68 
69 
70  THcDriftChamber(); // for ROOT I/O
71 protected:
73 
74  // Calibration
75 
76  // Per-event data
80 
81  Int_t fNPlanes; // Number of planes in the chamber
82 
84 
85  // HMS Specific
86  Int_t YPlaneInd; // Index of Yplane for this chamber
87  Int_t YPlanePInd; // Index of Yplanep for this chamber
88  Int_t YPlaneNum; // Absolute plane number of Yplane
89  Int_t YPlanePNum; // Absolute plane number of Yplanep
90  // SOS Specific
91  Int_t XPlaneInd; // Index of Xplane for this chamber
92  Int_t XPlanePInd; // Index of Xplanep for this chamber
93  Int_t XPlaneNum; // Absolute plane number of Xplane
94  Int_t XPlanePNum; // Absolute plane number of Xplanep
95 
96  // Parameters
97  Int_t fMinHits; // Minimum hits required to do something
98  Int_t fMaxHits; // Maximum required to do something
99  Int_t fMinCombos; // Minimum # pairs in a space point
108  Double_t fRatio_xpfp_to_xfp; // Used in selecting stubs
113  Double_t fMaxDist; // Max dist used in EasySpacePoint methods
120 
121  std::vector<THcDriftChamberPlane*> fPlanes;
122  // THcDriftChamberPlane* fPlanes[20]; // List of plane objects
123 
124  TClonesArray* fTrackProj; // projection of track onto scintillator plane
125  // and estimated match to TOF paddle
126  // void ClearEvent();
127  void DeleteArrays();
128  virtual Int_t ReadDatabase( const TDatime& date );
129  virtual Int_t DefineVariables( EMode mode = kDefine );
130 
131  void Setup(const char* name, const char* description);
132  Int_t FindEasySpacePoint_HMS(Int_t yplane_hitind, Int_t yplanep_hitind);
133  Int_t FindEasySpacePoint_SOS(Int_t xplane_hitind, Int_t xplanep_hitind);
137  void ChooseSingleHit(void);
138  void SelectSpacePoints(void);
141  Int_t* plane_list, UInt_t bitpat,
142  Int_t* plusminus, Double_t* stub);
143 
144  std::vector<THcDCHit*> fHits; /* All hits for this chamber */
157  Int_t fEasySpacePoint; /* This event is an easy space point */
158  SpacePointHitOutputData fSpHit; //< Space point hit structure
159 
161  std::map<int,TMatrixD> fAA3Inv;
162 
163  THaDetectorBase* fParent;
164 
165  ClassDef(THcDriftChamber,0) // A single drift chamber
166 };
167 
169 
170 #endif
Double_t GetZPos() const
virtual Int_t NewFindSpacePoints(void)
TClonesArray * GetSpacePointsP() const
Int_t DestroyPoorSpacePoints(void)
virtual Int_t DefineVariables(EMode mode=kDefine)
Double_t fStubMaxXPDiff
Int_t SpacePointMultiWire(void)
void SelectSpacePoints(void)
SpacePointHitOutputData fSpHit
Int_t GetLast() const
TClonesArray * fSpacePoints
const char Option_t
std::vector< THcDriftChamberPlane * > fPlanes
Class for a a single Hall C horizontal drift chamber plane.
Double_t * fCosBeta
virtual void AddPlane(THcDriftChamberPlane *plane)
Int_t GetChamberNum() const
virtual ~THcDriftChamber()
int Int_t
Double_t fRatio_xpfp_to_xfp
virtual void PrintDecode(void)
Int_t FindEasySpacePoint_SOS(Int_t xplane_hitind, Int_t xplanep_hitind)
virtual Int_t Decode(const THaEvData &)
Double_t ** fStubCoefs
#define ClassDef(name, id)
TClonesArray * fVPlaneClusters
virtual void LeftRight(void)
Int_t GetNTracks() const
std::map< int, TMatrixD > fAA3Inv
virtual Int_t FindSpacePoints(void)
virtual Int_t ReadDatabase(const TDatime &date)
Int_t fRemove_Sppt_If_One_YPlane
Double_t fSpacePointCriterion
Class representing a single hit DC.
Definition: THcSpacePoint.h:13
void SetHMSStyleFlag(Int_t flag)
TClonesArray * fUXPlaneClusters
virtual void Clear(Option_t *opt="")
Int_t FindEasySpacePoint_HMS(Int_t yplane_hitind, Int_t yplanep_hitind)
virtual void ProcessHits(void)
void ChooseSingleHit(void)
TClonesArray * fTrackProj
TClonesArray * fXPlaneClusters
Int_t fFixPropagationCorrection
unsigned int UInt_t
std::vector< THcDCHit * > fHits
virtual void CorrectHitTimes(void)
Double_t * stubcoef[4]
UInt_t Count1Bits(UInt_t x)
Double_t * fTanBeta
void Setup(const char *name, const char *description)
const TClonesArray * GetTrackHits() const
Int_t GetNSpacePoints() const
std::vector< Int_t > SpHitIndex
Int_t FindHardSpacePoints(void)
double Double_t
virtual EStatus Init(const TDatime &run_time)
TClonesArray * fVXPlaneClusters
virtual Int_t ApplyCorrections(void)
Double_t fWireVelocity
Subdetector class for a single drift chamber with several planes.
Int_t GetNHits() const
Double_t * fSinBeta
TClonesArray * fUPlaneClusters
std::vector< Int_t > SpNHits
Double_t FindStub(Int_t nhits, THcSpacePoint *sp, Int_t *plane_list, UInt_t bitpat, Int_t *plusminus, Double_t *stub)
THaDetectorBase * fParent
char name[80]