CbmSttMatchTracks.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // -------------------------------------------------------------------------
  2. // ----- CbmStsMatchTracks header file -----
  3. // ----- Created 22/11/05 by V. Friese -----
  4. // -------------------------------------------------------------------------
  5. /** CbmSttMatchTracks.h
  6. *@author V.Friese <v.friese@gsi.de>
  7. **
  8. ** Task class for matching a reconstructed CbmSttTrack with a simulated
  9. ** CbmMCTrack. The matching criterion is a maximal number of common
  10. ** hits/points. The task fills the data class CbmSttTrackMatch for
  11. ** each CbmSttTrack.
  12. **/
  13. #ifndef CBMSTTMATCHTRACKS_H
  14. #define CBMSTTMATCHTRACKS_H 1
  15. #include "FairTask.h"
  16. #include "CbmSttHit.h"
  17. #include "FairMCPoint.h"
  18. #include <vector>
  19. #include <string>
  20. #include <map>
  21. class TClonesArray;
  22. class CbmSttMatchTracks : public FairTask
  23. {
  24. public:
  25. /** Default constructor **/
  26. CbmSttMatchTracks();
  27. /** Constructor with verbosity level **/
  28. CbmSttMatchTracks(Int_t verbose);
  29. /** Constructor with name, title and verbosity
  30. **
  31. *@param name Name of taks
  32. *@param title Title of task (default FairTask)
  33. *@param verbose Verbosity level (default 1)
  34. **/
  35. CbmSttMatchTracks(const char* name, const char* title = "FairTask",
  36. Int_t verbose = 1);
  37. /** Destructor **/
  38. virtual ~CbmSttMatchTracks();
  39. /** Intialisation at beginning of each event **/
  40. virtual InitStatus Init();
  41. /** Execution **/
  42. virtual void Exec(Option_t* opt);
  43. /** Finishing */
  44. virtual void Finish();
  45. /** Add an hit collection to perform trackfinding on */
  46. void AddHitCollectionName(char *hitCollectionName, char *pointCollectionName);
  47. CbmSttHit* GetHitFromCollections(Int_t hitCounter);
  48. FairMCPoint* GetPointFromCollections(Int_t hitCounter);
  49. private:
  50. void AddAllCollections();
  51. void AddHitCollection(char const *collectionName, char const *pointCollectionName);
  52. TClonesArray* fTracks; // Array of CbmSttTracks
  53. TClonesArray* fMatches; // Array of CbmSttTrackMatch
  54. /** Map from MCTrackID to number of common hits **/
  55. map<Int_t, Int_t> fMatchMap;
  56. /** Verbosity level **/
  57. Int_t fVerbose;
  58. Bool_t fCollectionsComplete;
  59. vector<string> fHitCollectionNames;
  60. vector<string> fPointCollectionNames;
  61. TList fHitCollectionList;
  62. TList fPointCollectionList;
  63. ClassDef(CbmSttMatchTracks,1);
  64. };
  65. #endif