#ifndef ROOT_TreeSearch_MWDC
#define ROOT_TreeSearch_MWDC
#include "THaTrackingDetector.h"
#include "THaBBShower.h"
#include "THaDetMap.h"
#include "Types.h"
#include "TMatrixDSym.h"
#include <vector>
#include <utility>
#include <set>
#include <list>
#include <cassert>
class THaTrack;
class THaBenchmark;
class TClonesArray;
class THashTable;
using std::vector;
namespace TreeSearch {
class WirePlane;
class Projection;
class Road;
class ThreadCtrl;
typedef std::vector<Road*> Rvec_t;
typedef std::set<Road*> Rset_t;
extern const Double_t kBig;
class MWDC : public THaTrackingDetector {
public:
MWDC( const char* name, const char* description = "",
THaApparatus* app = 0 );
virtual ~MWDC();
virtual void Clear( Option_t* opt="" );
virtual Int_t Decode( const THaEvData& );
virtual EStatus Init( const TDatime& date );
virtual Int_t CoarseTrack( TClonesArray& tracks );
virtual Int_t FineTrack( TClonesArray& tracks );
virtual Int_t DefineVariables( EMode mode = kDefine );
virtual void Print(const Option_t* opt) const;
virtual void SetDebug( Int_t level );
void EnableEventDisplay( Bool_t enable = true );
const pdbl_t& GetChisqLimits( UInt_t i ) const;
Double_t GetRefTime( UInt_t i ) const
{ return (i<(UInt_t)fRefMap->GetSize()) ? fRefTime[i] : kBig; }
EProjType NameToType( const char* name );
#ifdef TESTCODE
Int_t GetEvNum() const { return fEvNum; }
vector<TreeSearch::WirePlane*>& GetListOfPlanes() { return fPlanes; }
vector<TreeSearch::Projection*>& GetListOfProjections() { return fProj; }
#endif
enum {
kDoTimeCut = BIT(14),
kPairsOnly = BIT(15),
kMCdata = BIT(16),
kNoPartner = BIT(17),
k3dFastMatch= BIT(18),
kEventDisplay = BIT(19),
kDoCoarse = BIT(20),
kDoFine = BIT(21)
};
protected:
friend class WirePlane;
friend class SpecialWirePlane;
class TrackFitWeight;
struct FitRes_t {
vector<Double_t> coef;
Double_t matchval;
Double_t chi2;
Int_t ndof;
Rvec_t* roads;
FitRes_t() : roads(0) {}
};
typedef std::vector<WirePlane*> Wpvec_t;
typedef std::vector<Projection*> Prvec_t;
Wpvec_t fPlanes;
Prvec_t fProj;
Wpvec_t fCalibPlanes;
THaDetMap* fRefMap;
vector<float> fRefTime;
THashTable* fCrateMap;
Int_t fMaxThreads;
ThreadCtrl* fThreads;
Double_t f3dMatchvalScalefact;
Double_t f3dMatchCut;
Int_t fMinNdof;
vec_pdbl_t fChisqLimits;
Int_t fFailNhits;
Int_t fFailNpat;
#ifdef TESTCODE
UInt_t fNcombos;
UInt_t fN3dFits;
Int_t fEvNum;
Double_t t_track, t_3dmatch, t_3dfit, t_coarse;
#endif
Int_t fuseshower;
THaBBShower* fshower;
void Add3dMatch( const Rvec_t& selected, Double_t matchval,
std::list<std::pair<Double_t,Rvec_t> >& combos_found,
Rset_t& unique_found ) const;
void FindNearestHits( WirePlane* wp, const THaTrack* track,
const Rvec_t& roads ) const;
void FitErrPrint( Int_t err ) const;
Int_t FitTrack( const Rvec_t& roads, vector<Double_t>& coef,
Double_t& chi2, TMatrixDSym* coef_covar = 0 ) const;
template< typename Action > static
Action ForAllTrackPoints( const Rvec_t& roads,
const vector<Double_t>& coef, Action action );
UInt_t MatchRoads( vector<Rvec_t>& roads,
std::list<std::pair<Double_t,Rvec_t> >& combos_found,
Rset_t& unique_found );
THaTrack* NewTrack( TClonesArray& tracks, const FitRes_t& fit_par );
Bool_t PassTrackCuts( const FitRes_t& fit_par ) const;
UInt_t LoadDAQmodel( THaDetMap::Module* m ) const;
Double_t LoadDAQresolution( THaDetMap::Module* m ) const;
UInt_t GetDAQnchan( THaDetMap::Module* m ) const;
virtual Int_t ReadDatabase( const TDatime& date );
ClassDef(MWDC,0)
};
inline const pdbl_t& MWDC::GetChisqLimits( UInt_t i ) const
{
assert( i < fChisqLimits.size() );
return fChisqLimits[i];
}
}
#endif
Last update: Tue Jul 7 19:26:19 2009
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.