/// /// For questions or suggestions about this module please contact the /// current responsible and CC in the oaAnalysis package manager. /// /// 21-Jul-2010: Current responsible for this module is, /// Daniel Roberge (droberge [*a*t*] triumf.ca) /// #ifndef _TFgdOnlyModule_hxx_seen #define _TFgdOnlyModule_hxx_seen #include "IAnalysisReconModuleBase.hxx" #include #include #include #include #include #include #include #include #include namespace COMET { class IFgdOnlyModule; } class COMET::IFgdOnlyModule : public IAnalysisReconModuleBase { public: class IFgd2DIsoTrack : public TObject { public: virtual ~IFgd2DIsoTrack(); // info on isorecon tracks std::string AlgorithmName; int NHits; double Angle; double SumCharge; double Range; TLorentzVector Origin; TLorentzVector OriginVariance; TVector3 Direction; std::vector HitPositions; int TrajId; double Completeness; double Cleanliness; ClassDef(IFgdOnlyModule::IFgd2DIsoTrack, 2); }; class IFgd3DIsoTrack : public TObject { public: virtual ~IFgd3DIsoTrack(); // info on isorecon tracks std::string AlgorithmName; int NHits; double SumCharge; double Range; TLorentzVector Origin; TLorentzVector OriginVariance; TVector3 Direction; double muonPull; double pionPull; double protonPull; std::vector XZHitPositions, YZHitPositions; int TrajId; double Completeness; double Cleanliness; ClassDef(IFgdOnlyModule::IFgd3DIsoTrack, 2); }; public: /// IFgd2DCluster /// The main object that contains information on clusters of hits after the 2D reconstruction /// stage of the FGD shower-based reconstruciton. class IFgd2DCluster : public TObject { public: virtual ~IFgd2DCluster(); std::string AlgorithmName; ///< The name of the algorithm.. TLorentzVector Position; ///< Charge-weighted position of the cluster. TVector3 PCADirection; ///< Primary PCA eigenvector, associated with the direction of the cluster. TVector3 StartPosition; ///< Identified "start" position of the cluster, from extrapolating along PCADrection. TVector3 EndPosition; ///< Identified "end" position of the cluster, from extrapolating along PCADirection. double Range; ///< Range of shower along PCADirection double AvgHitTime; ///< Average time of hits in the cluster double EDeposit; ///< The energy deposited in the cluster. int NumHits; ///< The number of hits contributing to this cluster. std::map Trajectories; ///< Map of true trajectory IDs to the number of G4 contributors that contributed to this cluster. int NDOF; ///< The number of degrees of freedom in the reconstruction. double Quality; ///< The goodness of fit for the reconstruction. int Status; ///< The fit status. ClassDef(IFgdOnlyModule::IFgd2DCluster, 1); }; public: /// IFgd3DShowerHyp /// Information on a specific hypothesis of an FGD shower. There are two hypotheses - one for a /// forward-going particle, one for a backward-going particle. class IFgd3DShowerHyp : public TObject { public: virtual ~IFgd3DShowerHyp(); TLorentzVector Position; ///< Identified start position of the shower. TLorentzVector PositionVar; ///< Variance on the start position of the shower. TVector3 Direction; ///< Identified direction of the shower, found using PCA. TVector3 DirectionVar; ///< Variance on the direction of the shower. TVector3 ConeAngle; ///< Opening angle of the cone describing this shower. TVector3 ConeAngleVar; ///< Variance on the cone opening angle. double EDeposit; ///< Energy deposited in this shower. /// Hits are split into three groups based on their distance from the start of the shower. /// The X, Y and Z components of this variable contain the average charge of hits in the /// 1st, 2nd and 3rd groups, respectively. TVector3 QAvgInThirds; // Charge of hits in 1st, 2nd and 3rd groups, based on distance from the start of the shower. /// Hits are split into three groups based on their distance from the start of the shower. /// The X, Y and Z components of this variable contain the average transverse spread of hits /// in the 1st, 2nd and 3rd groups, respectively. Transverse spread is defined as the distance /// from a hit to the closest position on the PCA major axis. TVector3 SpreadInThirds; // Average transverse spread of hits in the 1st, 2nd and 3rd groups, defined as the distance from a hit to the closest position on the PCA major axis. ClassDef(IFgdOnlyModule::IFgd3DShowerHyp, 1); }; public: /// IFgd3DShowerPID /// Information on an object reconstructed using the FGD shower-based reconstruction. /// There is currently no particle identification, although variables that can be used /// for a PID are stored. There are two hypotheses saved for each reconstructed object - /// one for a forward-going particle, one for a backward-going particle. class IFgd3DShowerPID : public TObject { public: virtual ~IFgd3DShowerPID(); IFgd3DShowerHyp Hyp1; ///< Information assuming the particle is forward-going. IFgd3DShowerHyp Hyp2; ///< Information assuming the particle is backward-going. TVector3 PCAEigenValues; ///< The three PCA eigenvalues. int NumHits; ///< The number of hits contributing to this cluster. /// The MVA likelihood value returned when matching 2D clusters in the XZ and YZ /// views into a single 3D cluster. Values range from 0 -> 1, with higher values /// indicating better matches. double MatchingLikelihood3D; // MVA likelihood value when matching 2D clusters in the XZ and YZ views into a single 3D cluster. /// Dan Scully's Circularity variable, adapted for FGDs. Value goes from 0 (spherical) /// -> 1 (track). double Circularity; // Dan Scully's Circularity variable, adapted for FGDs. std::map Trajectories; ///< Map of true trajectory IDs to the number of G4 contributors that contributed to this cluster int NDOF; ///< The number of degrees of freedom in the reconstruction. double Quality; ///< The goodness of fit for the reconstruction. int Status; ///< The fit status. ClassDef(IFgdOnlyModule::IFgd3DShowerPID, 1); }; public: IFgdOnlyModule(const char *name = "FGDOnly", const char *title = "FGD Only Recon Module"); virtual ~IFgdOnlyModule(); virtual Bool_t ProcessFirstEvent(COMET::ICOMETEvent &event); protected: // virtual void InitializeModule(); virtual void InitializeBranches(); virtual bool FillTree(COMET::ICOMETEvent &); private: void Fill2DIsoTrack(COMET::IHandle tr, COMET::IHandle state, IFgd2DIsoTrack *isoTrack, char Axis); void Fill3DIsoTrack(COMET::IHandle tr, COMET::IHandle state, IFgd3DIsoTrack *isoTrack); void Fill2DCluster(IFgd2DCluster *TempObject, COMET::IHandle cluster); void Fill3DShower(IFgd3DShowerPID *TempObject, COMET::IHandle pid); IFgd3DShowerHyp Fill3DShowerHyp(COMET::IHandle hyp); public: /// These tracks use only hits unused by the TPC+FGD fits Int_t* fNXZTracks;//! TClonesArray** fXZTracks; //! /// These tracks use only hits unused by the TPC+FGD fits Int_t* fNYZTracks;//! TClonesArray** fYZTracks; //! /// These tracks use only hits unused by the TPC+FGD fits Int_t* fNXYZTracks;//! TClonesArray** fXYZTracks; //! /// All and only FGD hits used for these tracks Int_t* fNXZTracksAllFGD;//! TClonesArray** fXZTracksAllFGD; //! /// All and only FGD hits used for these tracks Int_t* fNYZTracksAllFGD;//! TClonesArray** fYZTracksAllFGD; //! /// All and only FGD hits used for these tracks Int_t* fNXYZTracksAllFGD;//! TClonesArray** fXYZTracksAllFGD; //! Int_t fN3DShowers; ///< Number of Showers TClonesArray *f3DShowers; ///< Showers Int_t fN2DClustersXZ; ///< Number of 2D constituents of showers TClonesArray *f2DClustersXZ; ///< 2D constituents of showers Int_t fN2DClustersYZ; ///< Number of 2D constituents of showers TClonesArray *f2DClustersYZ; ///< 2D constituents of showers private: std::vector fTrackAlgorithms;//! std::vector fPids;//! // IFGDPid* fFGDPid;//! ClassDef(IFgdOnlyModule, 4); }; #endif