/* * PndTrackingQA.h * * Created on: Aug 23, 2013 * Author: stockman */ #ifndef PndTrackingQA_H_ #define PndTrackingQA_H_ #include "FairMultiLinkedData.h" #include "FairRootManager.h" #include "PndTrackCand.h" #include "PndTrackingQualityRecoInfo.h" #include #include #include #include #include #include #include "PndTrackFunctor.h" /** * @brief Holding statically callable quality numbers * @details Per event, a track can have a certain quality. On a MC level, it can be below a threshold to be even found. If found, it can be found fully, or partially. * The struct holds the identifiers needed to categorize tracks. * The rough idea is: * Positive numbers are referring to reconstructed tracks, negative numbers to track before reconstruction. * The five numbers from -5 to -1 are repeating from -11 to -7 and there referring to monte carlo data. * */ struct qualityNumbers { static const int // Following: Default statuses. // Are the 'not found' tracks in the quality histogram of PndTrackingQualityTask. kPossibleSec = -1, // possible: As defined through the possibleFunctor; secondary: a non-primary particle kPossiblePrim = -2, // possible: As defined through the possibleFunctor; primary: coming directly from particle generator (e.g. EvtGen) kAtLeastThreeSec = -3, // atLeastThree: min. 3 hit points in central tracking detectors (MVD, STT, GEM); secondary: a non-primary particle kAtLeastThreePrim = -4, // atLeastThree: min. 3 hit points in central tracking detectors (MVD, STT, GEM); primary: coming directly from particle generator (e.g. EvtGen) kLessThanThreePrim = -5, // LessThanThree: fewer than 3 hit points in central tracking detectors (MVD, STT, GEM); primar: coming directly from particle generator (e.g. EvtGen) // Following: MC statuses of all (found+notfound) tracks kMcPossibleSec = -7, // see above kMcPossiblePrim = -8, kMcAtLeastThreeSec = -9, kMcAtLeastThreePrim = -10, kMcLessThanThreePrim = -11, kMcAllTracksWithHits = -12, // sum of -7 - -10 kMcAllTracks = -13, // sum of -11 and -12 // Following: Status of reconstructed tracks (= created PndTracks) kSpuriousFound = 1, // spuriousFound: at least 70% of hits of reco'd track come from one MC track ('mostProbableTrack') kPartiallyFound = 2, // partiallyFound: all hits of reco'd track come from one single MC track; at least 70% of hits of MC track have been found in reco'd track kFullyFound = 3, // fullyFound: all hits of reco'd track come from one single MC track; all hits of MC track have been found in reco'd track kGhost = 5, // ghost: less than 70% of hits of reco'd track come from one MC track ('mostProbableTrack') kNotFound = 7, // notFound: total number of not reco'd tracks kFound = 8; // found: total number of reco'd tracks; the sum of fullyFound, partiallyFound, spuriousFound }; class PndTrackingQA : public TObject { public: PndTrackingQA(TString trackBranchName, TString idealTrackName, Bool_t pndTrackData = kTRUE); PndTrackingQA(TString trackBranchName, TString idealTrackName, PndTrackFunctor* posTrack, Bool_t pndTrackData = kTRUE); virtual ~PndTrackingQA(); virtual void Init(); void SetVerbose(Int_t val){fVerbose = val;} //! Adds branch names of detector data which should be taken into account in the analysis void AddHitsBranchName(TString name){ fBranchNames.push_back(name);} void SetHitsBranchNames(std::vector names){ fBranchNames = names;} void AnalyseEvent(TClonesArray *recoTrackInfo); // Int_t GetNIdealHits(Int_t trackId, TString branchName); Int_t GetNIdealHits(FairMultiLinkedData& track, TString branchName); std::map GetMCTrackFound() {return fMCTrackFound;} std::map GetTrackQualification() {return fMapTrackQualification;} std::map GetTrackMCStatus() {return fMapTrackMCStatus;} std::map > > GetEfficiencies() {return fMapEfficiencies;} std::map GetPResolution() {return fMapPResolution;} std::map GetP() {return fMapP;} std::map GetPtResolution() {return fMapPtResolution;} std::map GetPt() {return fMapPt;} std::map GetPlResolution() {return fMapPlResolution;} std::map GetPl() {return fMapPl;} std::map GetPResolutionRel() {return fMapPResolutionRel;} std::map GetPtResolutionRel() {return fMapPtResolutionRel;} std::map GetPlResolutionRel() {return fMapPlResolutionRel;} std::map GetTrackIdMCId() {return fTrackIdMCId;} Int_t GetNGhosts() {return fNGhosts;} void PrintTrackDataSummary(FairMultiLinkedData& trackData, Bool_t detailedInfo = kFALSE); void PrintTrackDataSummaryCompare(FairMultiLinkedData& recoTrackData, FairMultiLinkedData& idealTrackData); /** * The description of the quality map IDs is now located a but further up, at struct qualityNumbers */ void PrintTrackQualityMap(Bool_t detailedInfo = kFALSE); void PrintTrackMCStatusMap(); void PrintTrackInfo(std::map info); Int_t GetIdealTrackIdFromMCTrackId(int mctrackid) { return fMCIdIdealTrackId[mctrackid]; } Int_t GetIdealTrackIdFromRecoTrackId(int trackid) { int mctrackid = fTrackIdMCId[trackid]; return fMCIdIdealTrackId[mctrackid]; } PndTrackingQualityRecoInfo GetRecoInfoFromRecoTrack(Int_t trackId, Int_t mctrackId); private: virtual void FillMapTrackQualifikation(); Bool_t IsBetterTrackExisting(Int_t& mcIndex, int quality); // virtual Bool_t PossibleTrack(FairMultiLinkedData& mcForward); Int_t GetSumOfAllValidMCHits(FairMultiLinkedData* trackData); virtual Int_t AnalyseTrackInfo(std::map& trackInfo, Int_t trackId); virtual void CalcEfficiencies(Int_t mostProbableTrack, std::map& trackInfo); FairMultiLinkedData GetMCInfoForBranch(TString branchName, PndTrackCand* trackCand); ///< returns how often a MCTrack (marked by a FairLink) was seen by the hits of a PndTrackCand std::map AnalyseTrackCand(PndTrackCand* trackCand); // virtual Bool_t IsCorrectGemHit(FairLink& gemLink); FairRootManager* ioman; TString fTrackBranchName; TString fIdealTrackName; Bool_t fPndTrackOrTrackCand; //kTRUE if track and kFALSE if track cand std::string fPossibleTrackName; PndTrackFunctor* fPossibleTrack; Bool_t fCleanFunctor; Int_t fNGhosts; Bool_t fUseCorrectedSkewedHits; Int_t fVerbose; std::vector fBranchNames; //! std::map fTrackIdMCId; //! fMCIdTrackId; //! fMCIdIdealTrackId; //! fMCTrackFound; //! fMapTrackMCStatus; //! fMapTrackQualification; //! > > fMapEfficiencies; //! fMapPResolution; //! std::map fMapP; //! std::map fMapPtResolution; //! std::map fMapPt; //! std::map fMapPResolutionRel; //! std::map fMapPtResolutionRel; //! std::map fMapPlResolution; //! std::map fMapPl; //! std::map fMapPlResolutionRel; //! TClonesArray* fTrack; TClonesArray* fMCTrack; TClonesArray* fIdealTrack; TClonesArray* fIdealTrackCand; ClassDef(PndTrackingQA, 1) }; #endif /* PNDTRACKINGQUALITY_H_ */