// -*- mode: c++ -*- #ifndef BRAT_BrBfsTrackingModule #define BRAT_BrBfsTrackingModule // $Id: BrBfsTrackingModule.h,v 1.16 2002/06/25 08:56:34 ufstasze Exp $ #ifndef ROOT_TObject #include "TObject.h" #endif #ifndef ROOT_TObjArray #include "TObjArray.h" #endif #ifndef ROOT_TH1 #include "TH1.h" #endif #ifndef ROOT_TH2 #include "TH2.h" #endif #ifndef ROOT_TNtuple #include "TNtuple.h" #endif #ifndef ROOT_TString #include "TString.h" #endif #ifndef BRAT_BrModule #include "BrModule.h" #endif #ifndef BRAT_BrDetectorVolume #include "BrDetectorVolume.h" #endif #ifndef BRAT_BrModuleMatchTrack #include "BrModuleMatchTrack.h" #endif #ifndef BRAT_BrDataTable #include "BrDataTable.h" #endif #ifndef BRAT_BrDetectorParamsTof #include "BrDetectorParamsTof.h" #endif #ifndef ROOT_TString #include "TString.h" #endif #ifndef BRAT_BrBbVertex #include "BrBbVertex.h" #endif #ifndef BRAT_BrSpectrometerTracks #include "BrSpectrometerTracks.h" #endif class BrEventNode; class BrBfsTrackingModule : public BrModule { public: enum EFrontMode { kT2 = 1, kT3 }; enum ECleanUp { kCUT2 = 1, kCUT3 }; BrBfsTrackingModule(); BrBfsTrackingModule(const Char_t* name, const Char_t* title); ~BrBfsTrackingModule(); BrModuleMatchTrack* GetCombineT2T4() { return fCombineT2T4; } BrModuleMatchTrack* GetCombineT3T4() { return fCombineT3T4; } BrModuleMatchTrack* GetCombineT4T5() { return fCombineT4T5; } void Clear(); virtual void Init(); virtual void Begin(); virtual void Event(BrEventNode*, BrEventNode*); virtual void DefineHistograms(); virtual void Finish(); virtual void Print(Option_t* option="") const; void SetD3FieldScaleFactor(Float_t D3fsf = 1.) { fD3FieldScaleFactor = D3fsf;} void SetD4FieldScaleFactor(Float_t D4fsf = 1.) { fD4FieldScaleFactor = D4fsf;} void SetUseDb(Bool_t usedDb = kTRUE) { fUseDb = usedDb; } void SetExtendD3Match(Bool_t v = kTRUE) { fVirtualBack = v; } void SetExtendD4Match(Bool_t v = kTRUE) { fVirtualFront = v; } void SetFrontMode(EFrontMode b, Bool_t on) { if (on) SETBIT(fFrontMode, b); else CLRBIT(fFrontMode, b); } void SetFrontMode(Int_t m) { fFrontMode = m; } void SetCleanUp(ECleanUp b, Bool_t on) { if (on) SETBIT(fCleanUp, b); else CLRBIT(fCleanUp, b); } void SetKeepMatched(Bool_t b) {fKeepMatched = b;} private: void RemoveDuplicates(TClonesArray*, TClonesArray*, Bool_t*); void SetMagnetFields(); void CheckD3Tracks(TClonesArray*, EFrontMode); void CheckD4Tracks(); void CombineMatched(BrDataTable*, TClonesArray*, EFrontMode, Bool_t*); void ExtendD3MatchedTracks(BrDataTable*, TClonesArray*, EFrontMode, Bool_t*); void ExtendD4MatchedTracks(BrDataTable*); void TrackToVertex(BrBfsTrack* trk, BrBbVertex* vtx); Float_t VirtualLength(BrMatchedTrack*, BrDetectorVolume*, BrMagnetVolume*, BrDetectorVolume*); Bool_t fUseDb; // Indicator for picking Magnetfield from Db Int_t fFrontMode; Int_t fCleanUp; // Remove one combined (T2_T4 or T3_T4) if they share T4 Bool_t fVirtualBack; Bool_t fVirtualFront; Bool_t fKeepMatched; // YACK!! Float_t fD3FieldScaleFactor; Float_t fD4FieldScaleFactor; BrLine3D FrontDettoH1(BrDetectorTrack* track, Double_t P); BrLine3D T5toH2(BrDetectorTrack* track); BrModuleMatchTrack* fCombineT2T4; // Module combining T2/T4 track. BrModuleMatchTrack* fCombineT3T4; // Module combining T3/T4 track. BrModuleMatchTrack* fCombineT4T5; // Module combining T4/T5 track. BrDetectorVolume* fT2Volume; // Pointer to T2 volume BrDetectorVolume* fT3Volume; // Pointer to T3 volume BrDetectorVolume* fT4Volume; // Pointer to T4 volume BrDetectorVolume* fT5Volume; // Pointer to T5 volume BrDetectorVolume* fH1Volume; // Pointer to H1 detector volume BrDetectorVolume* fH2Volume; // Pointer to H2 detector volume BrDetectorParamsTof* fH1Params; // Pointer to H1 detector parameters BrDetectorParamsTof* fH2Params; // Pointer to H2 detector parameters BrMagnetVolume* fD3Volume; // Pointer to magnet D3 volume BrMagnetVolume* fD4Volume; // Pointer to magnet D4 volume TClonesArray* fT2T4Tracks; // Container of T2-T4 matched tracks TClonesArray* fT3T4Tracks; // Container of T3-T4 matched tracks TClonesArray* fT4T5Tracks; // Container of T4-T5 matched tracks Bool_t fArmsAligned; // if FFS and BFS are aligned, use H1 for checking // histograms TH2F* fT3H1Proj; // T3 tracks projected to H1 if arms aligned TH2F* fT2H1Proj; // T2 tracks projected to H1 if arms aligned TH1F* fT3H1Slat; // H1 slats pointed by T3 tracks if arms aligned TH1F* fT2H1Slat; // H1 slats pointed by T2 tracks if arms aligned TH2F* fT4H1Proj; // T4 tracks projected to H1 if arms aligned TH1F* fT4H1Slat; // H1 slats pointed by T4 tracks if arms aligned TH2F* fT4H2Proj; // same for T4 and H2 TH1F* fT4H2Slat; // same for T4 and H2 TH2F* fT5H2Proj; // same for T5 and H2 TH1F* fT5H2Slat; // same for T5 and H2 TH1F* fD3Mom; // momentum obtained with D3 TH1F* fD4Mom; // momentum obtained with D4 TH1F* fD3D4Mom; // momentum obtained with D3 and D4 TH1F* fMomDiff; // 1D momentum correlation TH2F* fMomCorr; // 2D momentum correlation TH2F* fMomDevVsMom; TH1F* fPathLength; // track path length TH1F* fPartialLength; // path lenth from front chamber to H2 TH1F* fTrkVX; TH1F* fTrkVY; TH2F* fTrkVXY; TH1F* fTheta; TH1F* fPhi; TH1F* fD4Tracks; TH1F* fD4Virtual; TH2F* fBfsTracksL; TH1F* fD3Tracks; TH1F* fD3Virtual; public: ClassDef(BrBfsTrackingModule, 0) // BRAHMS BFS Tracking Module Interface }; #endif //_______________________________________________________________________________________ // // $Log: BrBfsTrackingModule.h,v $ // Revision 1.16 2002/06/25 08:56:34 ufstasze // Added method SetKeepMatched(bool) and member fKeepMatched // // Revision 1.15 2002/04/09 02:08:35 ouerdane // extend D4 matched tracks to D3 matched if no D3 matched tracks available // // Revision 1.14 2002/04/05 11:44:37 ekman // Deleted one of the Finish() method declaration (so that BRAT compiles without errors!). // // Revision 1.13 2002/04/03 13:04:31 ouerdane // removed correction of local track IDs // // Revision 1.12 2002/04/03 08:59:46 bjornhs // Added a missing // virtual void Finish(); // to make brat compile again... // // Revision 1.11 2002/04/02 15:05:32 ouerdane // changed name of SetVirtualBack to SetExtendD3Match // // Revision 1.10 2002/04/02 14:42:17 ouerdane // a lot of updates added into this somewhat messy module, cf brahms-dev-l email for details // // Revision 1.9 2001/12/20 15:55:56 ouerdane // Added methods SetCombineMode() and ExtendBfsFrontToBfs() originally written by Pawel // and debugged for production. // // The idea is that we shouldn't restrict ourselves with combining D3 matched tracks // to D4 matched tracks since T5 had a module off for a long time, thus decreasing // its efficiency. When a D3 track can't find a D4 track to create a BFS track, // it will be swimmed forward through D4. If the swim status is good, a virtual D4 // track (matched track)is created (reason why I introduced a new bit in the status of the // matched track; this bit can be retrieved this way: // // Int_t virt = (d4Track->GetStatus() >> 4) & 1; // // if virt is 0, then it's a real track, if 1, it's a virtual track. // // This procedure gives around twice more BFS tracks. The correlation with H2 hits will remove // most of the ghosts (hopefully). // // Revision 1.8 2001/12/13 13:36:03 ouerdane // completed tracking down to vertex by swimming tracks through D1 and D2 // // Revision 1.7 2001/12/07 21:36:59 videbaek // Add UseDb method to bypass RunDb. For particular Geant use. // Bypass (in FFS) swimstatus if momentum undetermined, but D1 is on. This happens for // some zero filed runs. SwinStatus would give an error message per track if not bypassed. // complete analysis in ffs even if no Vtx from BB. Set vz to 0 in Ntuples, etc. // Needed and useful for Geant + pp running when this comes up. // // Revision 1.6 2001/11/20 13:13:53 ufstasze // Added SetD3FieldScaleFactor method and fD3FieldScaleFactor new private member. // // Revision 1.5 2001/11/05 06:42:21 ouerdane // added new classes replacing older spectrometer track modules // // Revision 1.4 2001/10/02 20:22:26 ouerdane // Added method SetUseNewBb to use the new BrBbVertex or not. // Fixed minor things consequently in the method PathLength() // // Revision 1.3 2001/10/02 02:01:36 ouerdane // added track length evaluation from final tof plane to primary vertex for FFS, // from H2 to H1 for BFS if arms are not aligned. // moved SetMagnetField to event method for simple reason: // when dealing with mutiple files (sequences) of more than one run, one would like to // update the field if changed. In principle it should in Begin but one might have a file // mixing more than one run (which I strongly warn not to do...) // // Revision 1.2 2001/09/07 14:03:29 staszel // Temporary added fD4FieldScaleFactor. // // Revision 1.1 2001/09/06 09:28:19 staszel // Initial release. //