/// /// For questions or suggestions about this module please contact the /// current responsible and CC in the oaAnalysis package manager. /// /// 26-Nov-2012: Current responsible for this module is, /// Steve Dennis (stephen.dennis [*a*t*] warwick.ac.uk) /// #ifndef TTruthVerticesModule_hxx_seen #define TTruthVerticesModule_hxx_seen // Root #include // oaEvent #include // oaAnalysis #include "IAnalysisTruthModuleBase.hxx" #include "IoaAnalysisUtils.hxx" #include "EoaAnalysis.hxx" namespace COMET { class ITruthVerticesModule; OA_EXCEPTION(ETruthVerticesModule,EoaAnalysis); OA_EXCEPTION(EUndefinedParticleCategoryVertex,ETruthVerticesModule); } /// oaAnalysis module for storing the truth information for primary /// vertices in events class COMET::ITruthVerticesModule : public IAnalysisTruthModuleBase { public: class ITruthVertex; ITruthVerticesModule(const char* name = "Vertices", const char* title = "True Primary Vertex information" ); virtual ~ITruthVerticesModule(); virtual Bool_t IsEnabledByDefault() const { return kTRUE; } virtual void InitializeBranches(); virtual bool FillTree(COMET::ICOMETEvent&); virtual Bool_t ProcessFirstEvent(COMET::ICOMETEvent&); private: /// The maximum number of vertices that the module will save in /// a single event const unsigned int fMaxNVertices; public: //-------------------------------------------------------------- // Tree Entries Int_t fNVtx; ///< The total number of vertices recorded Int_t fNVtxFGD1; ///< The number of vertices recorded in FGD 1 Int_t fNVtxFGD2; ///< The number of vertices recorded in FGD 2 Int_t fNVtxP0D; ///< The number of vertices recorded in the P0D Int_t fNVtxDsECal; ///< The number of vertices recorded in the Downstream ECal Int_t fNVtxBrlECal; ///< The number of vertices recorded in the Barrel ECal Int_t fNVtxP0DECal; ///< The number of vertices recorded in the P0D ECal Int_t fNVtxTPC1; ///< The number of vertices recorded in TPC 1 Int_t fNVtxTPC2; ///< The number of vertices recorded in TPC 2 Int_t fNVtxTPC3; ///< The number of vertices recorded in TPC 3 Int_t fNVtxSMRD; ///< The number of vertices recorded in the SMRD Int_t fNVtxRestOfOffAxis; ///< The number of vertices recorded in the rest of the off-axis detector Int_t fNVtxINGRID; ///< The number of vertices recorded in INGRID Int_t fNVtxOther; ///< The number of vertices recorded anywhere which does not fall into the other available categories /// The array is sorted by the vertices ID number to enable more /// efficient retrieval by analysis tools. TClonesArray *fVertices;///< The TClonesArray storing the ITruthVertex objects holding the information relating to each vertex. private: ClassDef(ITruthVerticesModule, 1); }; /// Class used by the Truth Vertices Module to store information relating /// to an individual true primary vertex. class COMET::ITruthVerticesModule::ITruthVertex : public TObject { public: ITruthVertex(); virtual ~ITruthVertex() {}; /// Compare the values of the vertices' IDs so that a /// TClonesArray can be sorted in order of increasing ID. Int_t Compare(const TObject* obj) const; /// Make the object sortable so that a TClonesArray can be /// sorted in ID order. Bool_t IsSortable() const { return kTRUE; } // Vertex information Int_t ID; ///< A number which uniquely identifies this vertex within the event. ///< This ID is the interface between the Truth Vertices module ///< and other oaAnalysis modules. Other modules should use this ///< number to reference trajectories. TLorentzVector Position; ///< Position and time of the vertex std::string Generator; ///< The generator that created the vertex. eg: "genie:mean@free-spill" std::string ReactionCode;///< The Reaction code according to the generator ///< For Genie this will be of the form: ///< "nu:14;tgt:1000260560;N:2112;proc:Weak[CC],QES;" ///< For Neut it will be an integer, see definitions here: ///< http://www.t2k.org/asg/xsec/niwgdocs/neut_xsecs/neutmodesC.h/view COMET::IoaAnalysisUtils::ESubdetector Subdetector;///< Subdetector which the vertex occurs in. ///< There are also ///< values for INGRID, rest of the off-zxis detector, and ///< Other. Double_t Fiducial;///< The distance inside the local fiducial volume [mm]. ///< Not currently set for any detector other than the P0D. Int_t NPrimaryTraj;///< The number of primary trajectories ///< (ie: the number of primary ///< particles exiting the interaction vertex). std::vector< Int_t > PrimaryTrajIDs; ///< ID numbers which uniquely identify the trajectories of the primary particles of the vertex within the event. // The PDG number of the incoming neutrino. Set to 0 in the // absence of a neutrino. Int_t NeutrinoPDG;///< The PDG number of the incoming neutrino. Set to 0 in the absence of a neutrino. // The four-momentum of the incoming neutrino. // Set to (-999999.9, -999999.9, -999999.9, -999999.9) in the // absence of a neutrino. TLorentzVector NeutrinoMomentum;///< The four-momentum of the incoming neutrino. Set to (-999999.9, -999999.9, -999999.9, -999999.9) in the absence of a neutrino. // The (extended for nuclei) PDG number of the target. // Set to 0 in the absence of a target. Int_t TargetPDG;///< The (extended for nuclei) PDG number of the target. Set to 0 in the absence of a target. TLorentzVector TargetMomentum;///< The four-momentum of the target. ///< Set to (-999999.9, -999999.9, -999999.9, -999999.9) in the ///< absence of a target. private: ClassDef(ITruthVerticesModule::ITruthVertex, 1); }; #endif