|
// $Id: BrSpectrometerTracks.cxx,v 1.7 2002/08/30 17:37:58 videbaek Exp $ // $Author: videbaek $ // $Date: 2002/08/30 17:37:58 $ // ////////////////////////////////////////////////////////////////////// // // // BrSpectrometerTracks // // // // BRAHMS Spectrometer Track class // // These track are the final result from the combine track and // // matching algorithms. The only contain members of the classes // // BrMatchedTrack and BrDetectorTrack. The BrDetectorTrack is in // // fact the local tracks from the various detectors. // // This contains 4 classes // // BrMatchedTrack that is used whenever combining two tracks // // in a magnet. // // BrMrsTrack specific to the MidRapidity spectrometer // // BrFfsTrack specific for the Front Forward spectrometer // // // // Author : F.Videbaek videbaek@bnl.gov // // Created : 24-Oct-1998 // // Version : 1.0 // // Changed : 07-Nov-1998 // // // ////////////////////////////////////////////////////////////////////// // // #ifndef WIN_32 #include <iostream> #include <iomanip> #else #include <iostream.h> #include <iomanip.h> #endif #include "BrSpectrometerTracks.h" #ifndef ROOT_TString #include "TString.h" #endif // ******* Matched Track ******* //____________________________________________________________________ ClassImp(BrMatchedTrack); //____________________________________________________________________ BrMatchedTrack::BrMatchedTrack() { SetID(0); fMomentum = -9999.; fStatus = 0; } //____________________________________________________________________ BrMatchedTrack::~BrMatchedTrack() { } //____________________________________________________________________ void BrMatchedTrack::Print(Option_t* option) const { // print method for this object // Option: // "" -> momentum, length, Vertex // p -> theta and phi, partial path, pointed slat // m -> magnet stuff // a -> All of that TString op(option); op.ToUpper(); cout << "-- MatchedTrack # " << GetId() << " --" << endl << " Momentum : " << GetMomentum() << " GeV/c" << endl; if (op.Contains("A") || op.Contains("M")) cout << " Dang : " << GetDang() << " rad " << endl << " Daly : " << GetDaly() << " rad " << endl << " Dy : " << GetDy() << " cm" << endl << " Matching chi2 : " << GetMatchChisq() << endl << " Status : " << GetStatus() << endl; } // ******* global Track ******* //____________________________________________________________________ ClassImp(BrGlbTrack); //____________________________________________________________________ BrGlbTrack::BrGlbTrack() { SetTrackId(0); SetTheta(-999); SetPhi(-999); SetPathLength(0); SetPartialPath(0); SetPointedSlat(0); } //____________________________________________________________________ BrGlbTrack::~BrGlbTrack() { } // ******* FFS Track ******* //____________________________________________________________________ ClassImp(BrFfsTrack); //____________________________________________________________________ BrFfsTrack::BrFfsTrack() : BrGlbTrack() { SetD1SwimStatus(kFALSE); } //____________________________________________________________________ BrFfsTrack::~BrFfsTrack() { } //____________________________________________________________________ Float_t BrGlbTrack::RelativeOverlap(const BrGlbTrack* trk, Float_t z_1, Float_t z_2, Float_t r_1, Float_t r_2) { Float_t overlap = GetFrontTrack()->RelativeOverlap(trk->GetFrontTrack(), z_1, r_1); return (overlap *= GetBackTrack()->RelativeOverlap(trk->GetBackTrack() , z_2, r_2)); } //____________________________________________________________________ void BrFfsTrack::Print(Option_t* option) const { // print method for this object // Option: // "" -> momentum, length, Vertex // p -> theta and phi, partial path, pointed slat // m -> magnet stuff // a -> All of that TString op(option); op.ToUpper(); cout << "-- FfsTrack # " << GetTrackId() << " --" << endl << " Momentum : " << GetMomentum() << " GeV/c" << endl << " Path length : " << GetPathLength() << " cm " << endl << " Vertex : " << GetTrackVertex() << endl; if (op.Contains("A") || op.Contains("P")) cout << " Theta : " << GetTheta() << " deg. " << endl << " phi : " << GetPhi() << " deg. " << endl << " H1 to D1 path : " << GetPartialPath() << " cm" << endl << " Pointed slat : " << GetPointedSlat() << endl << " Proj. on H1 : " << GetProjOnTof() << endl; if (op.Contains("A") || op.Contains("M")) cout << " Matching chi2 : " << GetMatchChisq() << endl << " D1 Ent. line : " << GetD1EntranceLine() << endl << " D1 Exit line : " << GetD1ExitLine() << endl << " D1 swim status: " << (Int_t)GetD1SwimStatus()<< endl << " D2 Ent. point : " << GetEntranceD2() << endl << " D2 Exit point : " << GetExitD2() << endl; } // ******* FS Track ******* //____________________________________________________________________ ClassImp(BrFsTrack); //____________________________________________________________________ BrFsTrack::BrFsTrack() { fFfsTrack = 0; fBfsTrack = 0; fPathLength = 0; fMomentum = 0; fD1Status = kFALSE; fFfsTrackId = -1; fBfsTrackId = -1; fTof1Proj = BrVector3D(999, 999, 999); fTof2Proj = BrVector3D(999, 999, 999); fTrackVertex = BrVector3D(999, 999, 999); fPhi = 999; fTheta = 999; fTof1Slat = -10; fTof1Slat = -10; } //____________________________________________________________________ BrFsTrack::~BrFsTrack() { } //____________________________________________________________________ void BrFsTrack::Print(Option_t* option) const { // print method for this object // Option: TString op(option); op.ToUpper(); cout << "---- FS Track # " << GetTrackId() << " ---- " << endl << " Momentum : " << GetMomentum() << " GeV/c" << endl << " Path length : " << GetPathLength() << " cm " << endl << " Vertex : " << GetTrackVertex() << endl << " Theta (deg.) : " << GetTheta()/BrUnits::degree << endl << " Phi (deg.) : " << GetPhi()/BrUnits::degree << endl << " Tof1 proj : " << GetTof1Proj() << endl << " Tof2 proj : " << GetTof2Proj() << endl << " Tof1 slat : " << GetTof1Slat() << endl << " Tof2 slat : " << GetTof2Slat() << endl << " D1 swim status: " << (Int_t)GetD1SwimStatus() << endl << " FFS Track id : " << GetFfsTrackId() << endl << " BFS Track id : " << GetBfsTrackId() << endl; } // ******* MRS Track ******* //____________________________________________________________________ ClassImp(BrMrsTrack); //____________________________________________________________________ BrMrsTrack::BrMrsTrack() : BrGlbTrack() { SetPointedPanel(-1); } //____________________________________________________________________ BrMrsTrack::~BrMrsTrack() { } //____________________________________________________________________ void BrMrsTrack::Print(Option_t* option) const { // print method for this object // Option: // "" -> momentum, length, Vertex // p -> theta and phi, partial path, pointed slat // m -> magnet stuff // a -> All of that TString op(option); op.ToUpper(); cout << "-- MrsTrack # " << GetTrackId() << " --" << endl << " Momentum : " << GetMomentum() << " GeV/c" << endl << " Path length : " << GetPathLength() << " cm " << endl << " Vertex : " << GetTrackVertex() << endl; if (op.Contains("A") || op.Contains("P")) cout << " Theta : " << GetTheta() << " deg. " << endl << " phi : " << GetPhi() << " deg. " << endl << " Tpm1 to Tofw : " << GetPartialPath() << " cm" << endl << " Pointed slat : " << GetPointedSlat() << endl << " Pointed panel : " << GetPointedPanel() << endl << " Proj. on Tofw : " << GetProjOnTof() << endl; if (op.Contains("A") || op.Contains("M")) cout << " Matching chi2 : " << GetMatchChisq() << endl << " D5 Ent. point : " << GetEntrance() << endl << " D5 Exit point : " << GetExit() << endl; if (op.Contains("A")) { BrMatchedTrack* match = GetMatchedTrack(); match->Print("A"); } } // ******* BFS Track ******* //____________________________________________________________________ ClassImp(BrBfsTrack); //____________________________________________________________________ BrBfsTrack::BrBfsTrack() { SetT2WasUsed(kFALSE); SetD1SwimStatus(kFALSE); SetD2SwimStatus(kFALSE); SetProjOnTof1(999, 999, 999); } //____________________________________________________________________ BrBfsTrack::~BrBfsTrack() { } //____________________________________________________________________ void BrBfsTrack::Print(Option_t* option) const { // print method for this object // Option: // "" -> momentum, length, Vertex // p -> theta and phi, partial path, pointed slat // m -> magnet stuff // a -> All of that TString op(option); op.ToUpper(); cout << "-- BfsTrack # " << GetTrackId() << " --" << endl << " Momentum : " << GetMomentum() << " GeV/c" << endl << " Momentum D3 : " << GetD3Momentum() << " GeV/c" << endl << " Momentum D4 : " << GetD4Momentum() << " GeV/c" << endl << " Path length : " << GetPathLength() << " cm " << endl << " Vertex : " << GetTrackVertex() << endl << " Theta : " << GetTheta()/BrUnits::degree << " deg." << endl << " Phi : " << GetPhi()/BrUnits::degree << " deg." << endl; if (op.Contains("A") || op.Contains("P")) { cout << " Front chamber : T" << 3 - (Int_t)fT2WasUsed << endl << " Partial path : " << GetPartialPath() << " cm" << endl << " H2 Slat : " << GetPointedSlat() << endl << " Proj. on H2 : " << GetProjOnTof() << endl; if (fT2WasUsed) cout << " H1 Slat : " << GetTof1PointedSlat() << endl << " Proj. on H1 : " << GetProjOnTof1() << endl; } if (op.Contains("A") || op.Contains("M")) { cout << " D3 Match Chi2 : " << GetD3MatchChisq() << endl << " D4 Match Chi2 : " << GetMatchChisq() << endl << " D3 Ent. point : " << GetEntranceD3() << endl << " D3 Exit point : " << GetExitD3() << endl << " D4 Ent. point : " << GetEntranceD4() << endl << " D4 Exit point : " << GetExitD4() << endl; if (fT2WasUsed) cout << " D1 swim status : " << GetD1SwimStatus() << endl << " D2 swim status : " << GetD2SwimStatus() << endl; } } // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // OLD Class //____________________________________________________________________ ClassImp(BrFSTrack); //____________________________________________________________________ BrFSTrack::BrFSTrack() { /* All of these variables are not used at the moment Double_t fMomentum = 0; Double_t fPhi = 0; Double_t fTheta = 0; // Polar angle of Track Int_t fStatus = 0; // Status variables (to be defined...) Double_t fQuality = 0; // Quality factor (to be defined) Double_t fTx = 0; // projected vertex position (at nominal // z=0 plane in spec systeM) Double_t fTy = 0; // as above but for Y. Double_t fDxT2 = 0; // Matching deviation in T2; horizontal position Double_t fDyT2 = 0; // Matching deviation in T2; vertical position Double_t fDaxT2 = 0; // Matching deviation in T2; slope dx/dz Double_t fDayT2 = 0; // Matching deviation in T2; slope dy/dz Double_t fEntranceD1X = 0; // Entrance position for track in D1 Double_t fEntranceD1Y = 0; // Note that the positions for the other magnets Double_t fExitD1X = 0; // are given in the matched tracks Double_t fExitD1Y = 0; Double_t fEntranceD2X = 0; Double_t fEntranceD2Y = 0; Double_t fExitD2X = 0; Double_t fExitD2Y = 0; Double_t fVx = 0; // projected nominal vertex (x) (at z=0 // in spectrometer system) Double_t fVy = 0; // projected nominal vertex (y) (at z=0 // in spectrometer system) */ fTrack12.SetID(0); fTrack34.SetID(0); fTrack45.SetID(0); fTrackT1.SetID(0); fTrackT2.SetID(0); fTrackT3.SetID(0); fTrackT4.SetID(0); fTrackT5.SetID(0); } //____________________________________________________________________ BrFSTrack::~BrFSTrack(){ } //____________________________________________________________________ const BrDetectorTrack* BrFSTrack::GetTtr(int i) const { // Get pointer to detector track of tracking station i switch (i) { case 1: return &fTrackT1; case 2: return &fTrackT2; case 3: return &fTrackT3; case 4: return &fTrackT4; case 5: return &fTrackT5; default: return 0; } } //____________________________________________________________________ // // $Log: BrSpectrometerTracks.cxx,v $ // Revision 1.7 2002/08/30 17:37:58 videbaek // Added Pront method to BrMatchedTracks. This method // will also be called from Mrs track printing with A. // // Revision 1.6 2002/04/09 02:02:06 ouerdane // updated BrBfsTrack and introduced new class BrFsTrack // // Revision 1.5 2002/03/06 21:05:25 ekman // BrBfsTrack: Added output of D3 and D4 momenta in Print method. // // Revision 1.4 2001/12/13 12:36:18 ouerdane // Added more information in BrBfsTrack::Print // // Revision 1.3 2001/11/05 06:50:43 ouerdane // changed the spectrometer track classes and updated the matched track to deal with these new classes // // Revision 1.2 2001/08/07 13:44:12 ouerdane // Added BrBfsTrack (cf brahms_app/do_app/dc for the tracking module) // // Revision 1.1.1.1 2001/06/21 14:55:03 hagel // Initial revision of brat2 // // Revision 1.15 2001/06/19 19:41:02 trine // Added function RelativeOverlap(....) to BrMrsTrack and BrFfsTrack // // Revision 1.14 2001/05/09 01:37:20 videbaek // Imporved tracking in the magnet matching. See e-mail for further // comments. There are also comments in the code. // Changed members in BrMatchedTrack. May affect reading of old files. // // Revision 1.13 2001/04/18 20:18:07 videbaek // initialize fHelix // // Revision 1.12 2000/12/18 21:54:08 ouerdane // Made fHelix a pointer to BrHelix, // Removed private members fEntranceX, Y, Z etc. Use now BrVector3D fEntrance, // etc. Replaced removed members in Getters and Setters by fEntrance.GetX(), etc. // // Revision 1.11 2000/12/06 22:21:41 videbaek // Several modification to the BrMrsTrackingModule, particluar logic for finding TOF panel // position and slat. Tracks are only assigned a hit if inside 'area in x. The logic also takes care (in an not // optimal way of the 20-21-21-21 slat configuration. // The TrackToVertex now calculate tx,Ty and Tz in IP system rather than MIDS local. // Tracklength from TPM1 to this vertex is added to track. // The streamer method is included for the bRMrsTrack (since added members) // // Revision 1.10 2000/10/31 19:38:41 ouerdane // A few changes in the matching and global tracking classes: // Matching: // --------- // BrModuleMatchTrack now calculates the length from the track position // in the front tracking chamber to the track position to the back // tracking chamber. It calculates the helix branch inside the intermediate // magnetic field, the entrance and exit points at the magnetic gap front and // back planes (in global coordinates). // Note that it uses the local track positions given by // BrDetectorTrack::GetPos() // The result is stored in a private member of BrMatchedTrack, namely // fMatchedTrackLength that a user can get thanks to // BrMtachedTrack::GetMatchedTrackLength() // (the corresponding setter method exists too). // the helix object is also stored as a private member of the matched track // and is accessible via BrMatchedTrack::GetHelix() // // Global tracking: // --------------- // BrMrsTrackingModule and BrFfsTrackingModule now calculate: // FFS: track length from front plane of D1 to TOF1 plane // MRS: track length from TPM1 track position to TOFW panel // (gets the matched track length and add the piece from TPM2 to TOFW) // The methods are called: // FFS: EvalD1ToTOFWTrackLength() // MRS: EvalTPM1ToTOFWTrackLength() // // Both of these modules calculate the number of the pointed slat on the // time of flight detector (TOFW or TOF1) as well as the coordinates // of the track projection on these TOF detectors. // The results are stored in private members of BrMrsTrack and BrFFTrack, // namely fPointedSlat, fProjOnTOF1 and fProjOnTOFW, fD1ToTOF1TrackLength // fTPM1ToTOFWTrackLength. These values are accessible with the getter methods // (setters exist too). // // --------------- // The previous TrackLength methods have been removed (they were not appropriate // because of their location and the assumption concerning the vertex at (0,0,0)) // Also removed the cxx files BrMrsTrack.cxx and BrFfsTrack.cxx (useless). // // All the points (entrance and exit points in a magnet detector) are accessible. // The coordinates are calculated in the global c.s. // // Revision 1.9 2000/09/20 15:52:59 ouerdane // Removed sections concerning BrFfsTrack and BrMrsTrack, // they are now in independant source files (BrFfsTrack.cxx and BrMrsTrack.cxx) // // Revision 1.8 2000/09/13 16:49:42 ouerdane // Added BrFfsTrack class (looks a lot like BrMrsTrack). // // Revision 1.7 2000/09/07 20:45:18 videbaek // Move cvs log. Change histogram limits. // // Revision 1.6 2000/03/21 21:22:46 cholm // Several changes: A few hacks where needed to compile on Digital Unix, noticably in my - Christian Holm - classes for the DB and Exceptions. Proberly still need to do something to some of Konstantins stuff. Also, I removed a lot of warnings fromt the compiler, by teddying up the code. Several places, old C-style indecies in for loops were assumed. Corrected. Unused variables have been commented out. // // Revision 1.5 1999/04/12 19:20:40 hagel // Added GetTtr(Int_t i) // // Revision 1.4 1999/03/07 00:00:47 hagel // 1. Implemented BrFSTrackingModule. Started with BrMrsTrackingModule and made // appropriate changes to handle the forward spectrometer. It uses the new // track classes as well as extensively using geometry classes. It also uses // new methods and functionality as described below. // 2. Changed BrMagnetVolume // a. Added method SwimBack(BrLine3D &,Double_t momentum): takes a // track at the exit of magnet and given the momentum, calculates // where the track would come into the front of the magnet. // b. Added method GlobalToLocal(BrLine3D &): does a combination of // GlobalToLocal(BrVector3D &,BrVector3D&,0) and // GlobalToLocal(BrVector3D &,BrVector3D&,1) // c. Added method LocalToGlobal(BrLine3D &): does a combination of // LocalToGlobal(BrVector3D &,BrVector3D&,0) and // LocalToGlobal(BrVector3D &,BrVector3D&,1) // d. Changed BrDetectorVolume: same additions of methods GlobalToLocal // and LocalToGlobal as in BrMagnetVolume // 2. Added a parameter base class BrDetectorParamsBase: helps when reading // in database files. Declared ASCII reading routines to be virtual. // Has main ReadASCIIFile which decodes the ASCII parameter files, then // calls the detector specific methods SetASCIIParameter // 3. Implemented SetASCIIParameter in BrDetectorParamsDC, BrDetectorParamsTPC, // BrDetectorParamsTof, BrDetectorParamsBB // 4. Implemented BrParameterDbManager. It currently works similarly to // BrGeometryDbManager and creates the BrDetectorParamsXXX objects when // called. These objects then read in ASCII parameter files with a currently // "well defined" format using the above implemented routines using a constructor: // BrDetectorParamsXXX(Char_t *name, Char_t *title,Char_t *ASCIIFileName); // 5. If no parameter file is specified, it executes the constructor we // have been using so far, namely BrDetectorParamsXXX(Char_t *name,Char_t *title). // These constructors generate default parameters and are semi-intelligent // which means they generate approximately appropriate parameters depending // upon which detector they are. I should say that the parameters were // deemed appropriate at the time of writing the SetDefaultParams routine. // a. It is used in the same way as BrGeometryDbManager, that is: // BrParameterDbManager *gParamDb = BrParameterDbManager::Instance(); // gParamDb->SetDbParameterFileName("DetectorParameters.txt"); // 6. Added a new directory, params, in BRAT. This directory has the file // DetectorParameters.txt in it. If the BrParameterDbManager is started // and the DetectorParameter.txt file is specified, it will look in the // $BRATSYS/params directory if it cannot find the file in the directory // that the user has set default to. // 7. Implemented BrParameterDbManager in DC digitize and tracking code. The // SetDetectorParams methods have been moved to private and can no longer be // used from the macro or program. // 8. Implemented BrParameterDbManager in TPC digitize and tracking code. // 9. Implemented BrParameterDbManager in Tof Calibrate and GeneratePid code. // 10 Changed the GetEntries() in BrDataTable to use the GetLast()+1 method in // TObjArray. This should be much faster, but has the caveat that it assumes // that all slots in TObjArray are full. That seems to me to be the case // in how we use TObjArray at least in BrDataTable, but if problems arise due // to this change, it can always be easily changed back. It has been used a // fair amount before checking in and no problems were found. // // Modified Files: // base/inc/BrBase_LinkDef.h base/inc/BrDataTable.h // base/inc/BrDetectorVolume.h base/inc/BrMagnetVolume.h // base/inc/LinkDefBratBaseINC.h base/src/BrDataTable.cxx // base/src/BrDetectorVolume.cxx base/src/BrEventNode.cxx // base/src/BrMagnetVolume.cxx base/src/BrTableManager.cxx // base/src/Makefile bb/inc/BrDetectorParamsBB.h // bb/src/BrDetectorParamsBB.cxx db/inc/BrParameterDbManager.h // db/src/BrParameterDbManager.cxx dc/inc/BrDetectorParamsDC.h // dc/src/BrDetectorDC.cxx dc/src/BrDetectorParamsDC.cxx // dc/src/BrDigitizeDC.cxx dc/src/BrLocalTrackDC.cxx // geometry/inc/BrPlane3D.h geometry/src/BrPlane3D.cxx // params/DetectorParameters.txt tof/inc/BrDetectorParamsTof.h // tof/src/BrDetectorParamsTof.cxx tof/src/BrGeneratePid.cxx // tpc/inc/BrDetectorParamsTPC.h tpc/src/BrDetectorParamsTPC.cxx // tpc/src/BrDetectorTPC.cxx tpc/src/BrDigitizeTPC.cxx // tpc/src/BrLocalTrackTPC.cxx track/inc/BrDetectorTrack.h // track/inc/BrFSTrackingModule.h // track/inc/BrSpectrometerTracks.h track/src/BrDetectorTrack.cxx // track/src/BrFSTrackingModule.cxx // track/src/BrSpectrometerTracks.cxx // // Revision 1.3 1999/02/26 21:14:41 hagel // Minor changes to make compatible with BrFSTrackingModule // // Revision 1.2 1999/01/15 16:37:28 videbaek // Working version of MRS tracking of mtp1,mtp2 and new general track // classes. Changes also added to BrModuleMatchTrack for this reason. // Updated makeNt for non-cygnus win95 systems // // |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|