#ifndef HPidTrackSorter_H
#define HPidTrackSorter_H
#include "hcategory.h"
#include "hiterator.h"
#include <vector>
#include "TString.h"
#include "TFile.h"
#include "TNtuple.h"
using std::vector;
using std::iostream;
# define NUMBER_OF_INDEX 7
# define NUMBER_OF_QUALITY_CRITERIA 12
class HPidTrackCand;
class HPidTrackSorter : public TNamed {
public:
enum ERichMatch {
kUseRICHIndex = 0,
kUseRKRICHCorrelation = 1,
kUseRKRICHWindow = 2
};
enum ESelect {
kIsLepton = 0,
kIsHadron = 1
};
enum ESwitch {
kIsIndexRICH = 0,
kIsIndexInnerMDC = 1,
kIsIndexOuterMDC = 2,
kIsIndexTOF = 3,
kIsIndexSHOWER = 4,
kIsIndexRPC = 5,
kIsIndexMETA = 6,
kIsBestHitRICH = 7,
kIsBestHitInnerMDC = 8,
kIsBestHitOuterMDC = 9,
kIsBestHitMETA = 10,
kIsBestRKMETA = 11,
kIsBestRKRICH = 12,
kIsBestRK = 13,
kIsBestSPLINE = 14,
kIsBestKICK = 15,
kIsBestRKRKMETA = 16,
kIsBestRKRKRICH = 17,
kIsBestRKMETAQA = 18
};
protected:
typedef struct {
Short_t ind_PidCand;
Short_t ind_RICH ;
Short_t ind_innerMDC;
Short_t ind_outerMDC;
Short_t ind_TOF;
Short_t ind_SHOWER;
Short_t ind_RPC;
Short_t ring_PadNr;
Double_t innerMDCChi2;
Double_t outerMDCChi2;
Double_t metamatch_Quality;
Double_t RK_META_match_Quality;
Double_t RK_RICH_match_Quality;
Double_t RK_Chi2;
Double_t SPLINE_Chi2;
Double_t KICK_Pull;
Bool_t RICH_RK_Corr;
} candidate;
static Bool_t kDebug;
static Int_t printLevel;
static Int_t kSwitchIndex;
static Int_t kSwitchQuality;
static Int_t kSwitchParticle;
static Int_t kSwitchRICHMatching;
static Float_t fRICHMDCWindow ;
static Bool_t kIgnoreRICH;
static Bool_t kIgnoreInnerMDC;
static Bool_t kIgnoreOuterMDC;
static Bool_t kIgnoreMETA;
static Bool_t kIgnorePreviousIndex;
Int_t kSwitchRICHMatchingBackup;
Float_t fRICHMDCWindowBackup ;
Bool_t kIgnoreRICHBackup;
Bool_t kIgnoreInnerMDCBackup;
Bool_t kIgnoreOuterMDCBackup;
Bool_t kIgnoreMETABackup;
Bool_t kIgnorePreviousIndexBackup;
Int_t fill_Iteration;
Int_t selectBest_Iteration;
Int_t currentEvent;
vector < candidate *> all_candidates;
vector < Int_t > index_RICH;
vector < Int_t > index_InnerMDC;
vector < Int_t > index_OuterMDC;
vector < Int_t > index_SHOWER;
vector < Int_t > index_TOF;
vector < Int_t > index_RPC;
vector < Int_t > old_flags;
TString* nameIndex ;
TString* nameQuality;
Bool_t isSimulation;
TFile* fout;
TNtuple* nt;
HCategory* pPidTrackCandCat;
HIterator* iterPidTrackCandCat;
void printCand (candidate*, Int_t, TString spacer = " ");
static Bool_t cmpIndex (candidate*, candidate*);
static Bool_t cmpQuality(candidate*, candidate*);
Bool_t rejectIndex (candidate*, HPidTrackSorter::ESwitch, Int_t&);
Bool_t rejectQuality (candidate*, HPidTrackSorter::ESwitch);
Int_t flagAccepted (vector<candidate*>&, HPidTrackSorter::ESwitch);
Int_t flagDouble (vector<candidate*>&, HPidTrackSorter::ESwitch);
Int_t setFlagsDouble (vector<candidate*>&, HPidTrackSorter::ESwitch);
Int_t clearVector (vector<candidate*>&);
Int_t fillInput (vector<candidate*>&);
void selection(Bool_t (*function)(HPidTrackCand* ));
Int_t fillAndSetFlags ();
void clear(void);
public:
HPidTrackSorter(void);
HPidTrackSorter(TString name,TString title);
~HPidTrackSorter(void);
Bool_t init (void);
Bool_t finalize (void);
static void setDebug (Bool_t debug = kTRUE) { kDebug = debug;}
static void setIgnoreRICH (Bool_t ignore = kTRUE) { kIgnoreRICH = ignore;}
static void setIgnoreInnerMDC (Bool_t ignore = kTRUE) { kIgnoreInnerMDC = ignore;}
static void setIgnoreOuterMDC (Bool_t ignore = kTRUE) { kIgnoreOuterMDC = ignore;}
static void setIgnoreMETA (Bool_t ignore = kTRUE) { kIgnoreMETA = ignore;}
static void setIgnorePreviousIndex(Bool_t ignore = kTRUE) { kIgnorePreviousIndex = ignore;}
static void setPrintLevel (Int_t level) { printLevel = level;}
void setOutputFile(TString filename = "");
void resetFlags(Bool_t flag = kTRUE,Bool_t reject = kTRUE,Bool_t used = kTRUE,Bool_t lepton = kTRUE);
void cleanUp(Bool_t final = kTRUE);
Int_t fill(Bool_t (*function)(HPidTrackCand* ));
void backupFlags();
Bool_t restoreFlags();
Int_t selectBest(HPidTrackSorter::ESwitch byQuality, Int_t byParticle);
static void setRICHMatching(HPidTrackSorter::ERichMatch match, Float_t window = 4.);
static Bool_t selectLeptons(HPidTrackCand* pcand = 0);
static Bool_t selectHadrons(HPidTrackCand* pcand = 0);
void fillNtuple();
void printEvent(TString comment);
ClassDef(HPidTrackSorter,0);
};
#endif /* !HPidTrackSorter_H */
Last change: Sat May 22 13:07:38 2010
Last generated: 2010-05-22 13:07
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.