/// /// For questions or suggestions about this module please contact the /// current responsible and CC in the oaAnalysis package manager. /// /// 21-Dec-2011: Current responsible for this module is, /// Per Jonsson (per.jonsson@imperial.ac.uk) /// Previous author: /// Anselmo Cervera Villanueva (anselmo [*a*t*] cervera@cern.ch) /// #ifndef TGlobalReconModule_hxx_seen #define TGlobalReconModule_hxx_seen #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "IAnalysisReconModuleBase.hxx" #include "ITrueVertex.hxx" #include "IGlobalBaseObjects.hxx" #include "recpack/Trajectory.h" #include "recpack/HelixEquation.h" #include "recpack/Surface.h" #include "recpack/Volume.h" #include "ITrueVertex.hxx" const int NDETSEXTRAP = 25; const int NDETSUSED = 19; const int NCONSTITUENTS = 6; const int NSVERTICES = 12; const int NTIMEBINS = 8; namespace COMET { class IGlobalReconModule; OA_EXCEPTION(EoaAnalysisInfiniteLoop2,EoaAnalysis); }; /// This module summarizes the reconstruction information from the Global. /// The first version of this package is written in order to use /// this information for CCQE selection: the saved information is therefore /// biased towards this analysis and might need to be changed for other /// analyses. class COMET::IGlobalReconModule : public IAnalysisReconModuleBase { // using namespace IGlobalReconModule; public: /// An object to store HIT class IGlobalHit : public TObject { public: virtual ~IGlobalHit(); double Charge; ///< Deposited charge double Time; ///< The time TVector3 Position; ///< The position TVector3 PositionError; ///< The position variance; int Type; ///< the hit type (0=X,1=Y,2=Z) ClassDef(IGlobalReconModule::IGlobalHit, 1); }; /// An object to store HIT for the SMRD subdetector class ISMRDHit : public TObject { public: virtual ~ISMRDHit(); int Wall;///< SMRD wall number, 0=Top, 1=Bottom, 2= Right, 3= Left. int Yoke; ///< Yoke ring number. int Layer;///< SMRD ring number. int Tower; int Counter; ///< SMRD scint number. double Charge; ///< Deposited charge double Time; ///< The time TVector3 Position; ///< The position TVector3 PositionError; ///< The position variance; int Type; ///< the hit type (0=X,1=Y,2=Z) ClassDef(IGlobalReconModule::ISMRDHit, 1); }; /// An object to store outermost HITs class IOutermostHits : public TObject { public: virtual ~IOutermostHits(); IGlobalHit hitMinX; ///< Hit with lowest X position. IGlobalHit hitMaxX; ///< Hit with highest X position. IGlobalHit hitMinY; ///< Hit with lowest Y position. IGlobalHit hitMaxY; ///< Hit with highest Y position. IGlobalHit hitMinZ; ///< Hit with lowest Z position. IGlobalHit hitMaxZ; ///< Hit with highest Z position. ClassDef(IGlobalReconModule::IOutermostHits, 1); }; /// Deprecated class, use IFgdTimeBin instead. An object to store an FGD cluster. class IFgdCluster : public TObject { public: virtual ~IFgdCluster(); double TotalCharge; ///< Deposited charge double TimeDisp; ///< time dispersion of the cluster double SpatialDisp; ///< spatial dispersion of the cluster (distance between the two most far hits in the cluster) int NHits; ///< number of hits in the cluster TLorentzVector PosRMS; ///< rms of the cluster position and time TLorentzVector Position; ///< The position of the cluster. TLorentzVector Variance; ///< The position variance; ClassDef(IGlobalReconModule::IFgdCluster, 1); }; /// An object to store information about an FGD Time Bin. class IFgdTimeBin : public TObject { public: IFgdTimeBin(); virtual ~IFgdTimeBin(); double minTime; ///< Bin start time. double maxTime; ///< Bin end time. int nHits[2]; double rawChargeSum[2]; float chargePerLayer[2][30]; TVector3 chargeWeightedPos[2]; IOutermostHits FGD1OutermostHits; IOutermostHits FGD2OutermostHits; Int_t NFGD1Unused; ///< Number of hits unused in FGD1 TClonesArray *FGD1Unused; ///< The vector unused hits in FGD1 Int_t NFGD2Unused; ///< Number of hits unused in FGD2 TClonesArray *FGD2Unused; ///< The vector unused hits in FGD2 int g4ID; ///< The ID for the G4 trajectory that contributed most to this time bin. IGlobalHit hackFGDUnused;///< This is just here to fool TFile::MakeProject, not a real object. ClassDef(IGlobalReconModule::IFgdTimeBin, 1); }; /// An object to hold vertex constituents class IVertexConstituent : public TObject { public: virtual ~IVertexConstituent(); int Charge; ///< Charge of constituent tracks double Quality; ///< Quality (chi2) of constituent tracks TVector3 Momentum; ///< 3-momentum of constituent tracks int PID; ///< The TGlobalPIDs associated to the vertex ClassDef(IGlobalReconModule::IVertexConstituent, 1); }; /// An object to describe a reconstructed primary vertex. class IGlobalVertex : public TObject { public: IGlobalVertex(); virtual ~IGlobalVertex(); int PrimaryIndex; ///< The index of the corresponding primary vertex std::string AlgorithmName; ///< The name of the algorithm that created this object. int Status; ///< The status for the fit. double Quality; ///< The quality of the fit. int NDOF; ///< The number of degrees of freedom. TLorentzVector Position; ///< The position of the vertex. TLorentzVector Variance; ///< The position variance; Int_t NTrueVertices; ///< The true vertex TClonesArray* TrueVertices; ///< The true vertex Int_t NConstituents; ///< Constituent tracks TClonesArray* Constituents;///< Constituent tracks ITrueVertex hackTrueVertexObject;///< This is just here to fool TFile::MakeProject, not a real object. IVertexConstituent hackVertexConstituentObject; ClassDef(IGlobalReconModule::IGlobalVertex, 1); }; /// An object to hold specific P0D variables class IP0DObject : public ISubBaseShowerObject { public: virtual ~IP0DObject(); /// The P0D muon likelihood // double MuonLikelihood; /// The P0D proton likelihood; // double ProtonLikelihood; double Width; ///< The width of the shower (perpendicular to the direction) std::vector ParticleId; ///< A vector of potential PIDs, sorted by weight std::vector PIDWeight; ClassDef(IGlobalReconModule::IP0DObject, 1); }; /// An object to hold specific ECAL variables class IECALObject : public ISubBaseShowerObject { public: virtual ~IECALObject(); double TrShVal; ///< Value to seperate track from shower double EMHadVal; ///< Value to seperate EM from Hadronic. TVector3 Width; ///< The width of track /// The position of the track/shower // TLorentzVector Position; --> is in base class /// The direction of the track/shower // TVector3 Direction; --> Is in Base class /// The Ecal cluster number of hits // int NHits; --> is in Base class double AverageHitTime; ///< The charged weighted average time for the ECal cluster double EMEnergy; ///< fitted em energy for the shower double EMEnergyError; double KFParameter; ///< The Kalman Fitter Pid variables int KFNNodes; ///< The Kalman Fitter Pid variables double KFParameterNodes; ///< The Kalman Fitter Pid variables double KFQuality; ///< The Kalman Fitter Pid variables int KFNDOF; ///< The Kalman Fitter Pid variables double KFHitQuality; ///< The Kalman Fitter Pid variables //bool KFIsMatched; //int KFMultiTracksTPC; //int KFMultiTracksECAL; double MElectronTag_NDelayedCluster; ///< Michel Electron Delayed Cluster Variables // Tagged a candidate output. std::vector MElectronTag_NDelayedHits; ///< The number of hits in a Michel electron candidate. std::vector MElectronTag_DeltaX; ///< The X displacement of the Michel electron candidate from the original ECal cluster. std::vector MElectronTag_DeltaY; ///< The Y displacement of the Michel electron candidate from the original ECal cluster. std::vector MElectronTag_DeltaZ; ///< The Z displacement of the Michel electron candidate from the original ECal cluster. std::vector MElectronTag_DeltaT; ///< The time displacement of the Michel electron candidate from the original ECal cluster. std::vector MElectronTag_EDep; ///< The energy deposited by the Michel electron candidate. std::vector MElectronTag_TrackEnd; /// T0Source;///< The T0Source, the values are defined in TTPCFitStatusBranch.hxx, the TTPCT0Source enumeration. std::vector NHorRows;///< The number of horizontal clusters in the track std::vector NVerRows;///< The number of vertical clusters in the track ClassDef(IGlobalReconModule::ITPCObject, 1); }; /// An object to hold specific TPC variables class ITPCOtherObject : public TObject { public: virtual ~ITPCOtherObject(); double Charge; int Detector; int NHits; double Chi2; double EDeposit; TLorentzVector FrontPosition;///< The Front position of the object. TLorentzVector BackPosition;///< The Back position of the object. TVector3 FrontDirection;///< The Front direction of the object. TVector3 BackDirection;///< The Back direction of the object. double Momentum;///< the momentum of the object ITrueParticle TrueParticle;///< The true particle ClassDef(IGlobalReconModule::ITPCOtherObject, 1); }; /// An object to hold specific TRACKER variables class ITrackerObject : public ISubBaseObject { public: virtual ~ITrackerObject(); double Charge; ClassDef(IGlobalReconModule::ITrackerObject, 1); }; /// An object to hold specific FGD variables class IFGDObject : public ISubBaseObject { public: virtual ~IFGDObject(); double avgtime; ///< Average fully corrected FGD hit time. float chargePerLayer[30]; float chargePerLayerAttenCorr[30]; int fgdContainment; ///< Fully contained PID information. Indicates whether the FGD PID algorithm determined the track to be fully contained in FGD1 or FGD2 (=1 or 2), stopping in FGD1 or FGD2 (=-1 or -2), or other (0). double E; ///< Measured energy in an FGD. double x; ///< Distance traveled in an FGD. double E_exp_muon; ///< Expected energy deposit for a muon. double E_exp_pion; ///< Expected energy deposit for a pion. double E_exp_proton; ///< Expected energy deposit for a proton. double sigmaE_muon; ///< Expected energy uncertainty for a muon. double sigmaE_pion; ///< Expected energy uncertainty for a pion. double sigmaE_proton; ///< Expected energy uncertainty for a proton. double PullMuon; ///< The FGD PID pull value for a muon. double PullPion; ///< The FGD PID pull value for a pion. double PullProton; ///< The FGD PID pull value for a proton. double PullNotSet; ///< PullNotSet = 1 if the pull is not set, and 0 otherwise. bool isFgdVA; bool isFgdVA_flag; double fgdVA_upMinZ;///< FGD vertex activity values. double fgdVA_downMaxZ; ///< FGD vertex activity values. double fgdVA_upCosTheta;///< FGD vertex activity values. double fgdVA_downCosTheta; ///< FGD vertex activity values. double fgdVA_otherUpQ; ///< FGD vertex activity values. double fgdVA_otherDownQ;///< FGD vertex activity values. double fgdVA_verQ;///< FGD vertex activity values. double fgdVA_verLayQ;///< FGD vertex activity values. double fgdVA_verNearQ;///< FGD vertex activity values. double fgdVA_verNextNearQ;///< FGD vertex activity values. double fgdVA_verNextNextNearQ;///< FGD vertex activity values. double fgdVA_totalQ;///< FGD vertex activity values. double fgdVA_totalCorrE; ///< FGD vertex activity values. ClassDef(IGlobalReconModule::IFGDObject, 1); }; /// An object to hold specific SMRD variables class ISMRDObject : public ISubBaseObject { public: virtual ~ISMRDObject(); double avgtime; ClassDef(IGlobalReconModule::ISMRDObject, 1); }; /// An object to describe a reconstructed PID. class ITpcPID : public TObject { public: // ITpcPID(); virtual ~ITpcPID(); std::string AlgorithmName; ///< The name of the algorithm that created this object. unsigned long Detectors; ///< Detectors used, defined according to the algorithm in GetDetectorNumber. unsigned long Status; ///< The status for the fit, from: object->CheckStatus(object->kSuccess). int NDOF; ///< The number of degrees of freedom. double Chi2;///< The chi2 of the fit. int NNodes;///< The number of nodes int NHits;///< The number of hits. int NConstituents;///< The number of constituents. bool isForward;///< Sense of object. double Charge;///< The Charge double EDeposit;///< The deposited charge for the object. TVector3 Cone;///< The opening angles of the cone (only for showers) double Width;///< The width of the shower (perpendicular to the direction) double Length;///< The total length of the object std::vector Likelihoods; /// the PID likelihoods for combined PID TLorentzVector FrontPosition;///< The position of the object. TLorentzVector BackPosition;///< The position of the object. TLorentzVector FrontPositionVar;///< The position variance; TLorentzVector BackPositionVar;///< The position variance; TVector3 FrontDirection;///< The direction of the object. TVector3 BackDirection;///< The direction of the object. TVector3 FrontDirectionVar;///< The direction variance of the object. TVector3 BackDirectionVar;///< The direction variance of the object. double FrontMomentum;///< the momentum of the object double BackMomentum;///< the momentum of the object double FrontMomentumError;///< the error on the momentum of the object double BackMomentumError;///< the error on the momentum of the object // Kinematics at vertex TLorentzVector PositionAtTrueVertex; ///< Position at true vertex. TLorentzVector PositionVarAtTrueVertex; ///< The position variance at the true vertex. TVector3 DirectionAtTrueVertex; ///< Direction at the true vertex. TVector3 DirectionVarAtTrueVertex;///< The direction variance at the true vertex. double MomentumAtTrueVertex; ///< Momentum at the true vertex. double MomentumErrorAtTrueVertex; ///< The momentum variance at the true vertex. std::vector EntrancePosition; ///< the position of the object at the entrance of each subdetector std::vector ExitPosition;///< the position of the object at the exit of each subdetector ITrueParticle TrueParticle;///< The true particle ClassDef(IGlobalReconModule::ITpcPID, 1); }; /// An object to describe a reconstructed PID. class IGlobalPIDAlternate : public TObject { public: IGlobalPIDAlternate(){}; virtual ~IGlobalPIDAlternate(){}; unsigned long Detectors; ///< Detectors used, defined according to the formula in GetDetectorNumber. bool DetectorUsed[NDETSUSED]; ///< Detectors used (NDETSUSED = 19) unsigned long Status; ///< The status for the fit. int NDOF; ///< The number of degrees of freedom. double Chi2; ///< The chi2 of the fit. double Charge; ///< The Charge double Length; ///< The length of the track or shower (RMS) int ParticleId; ///< the PDG code obtained in the recon combined PID double PIDWeight; ///< the PID weight for this hypothesis TLorentzVector FrontPosition; ///< The position of the object. TLorentzVector BackPosition; ///< The position of the object. TLorentzVector FrontPositionVar; ///< The position variance; TLorentzVector BackPositionVar; ///< The position variance; TVector3 FrontDirection; ///< The direction of the object. TVector3 BackDirection; ///< The direction of the object. TVector3 FrontDirectionVar; ///< The direction variance of the object. TVector3 BackDirectionVar; ///< The direction variance of the object. double FrontMomentum; ///< the momentum of the object double BackMomentum; ///< the momentum of the object double FrontMomentumError; ///< the error on the momentum of the object double BackMomentumError; ///< the error on the momentum of the object // Kinematics at vertex TLorentzVector PositionAtTrueVertex; ///< The position at the true vertex. TLorentzVector PositionVarAtTrueVertex; ///< The position variance at the true vertex. TVector3 DirectionAtTrueVertex; ///< The direction at the true vertex. TVector3 DirectionVarAtTrueVertex; ///< The direction variance at the true vertex. double MomentumAtTrueVertex; ///< The momentum at the true vertex. double MomentumErrorAtTrueVertex; ///< The error of the momentum at the true vertex. ClassDef(IGlobalReconModule::IGlobalPIDAlternate, 1); }; /// An object to describe a reconstructed PID. class IGlobalPID : public TObject { public: IGlobalPID(); virtual ~IGlobalPID(); UInt_t UniqueID; ///< Unique identifier for global recon objects (needed fro broken association) std::vector BrokenUniqueIDs; ///< the broken partners unique IDs std::string AlgorithmName; ///< The name of the algorithm that created this object. unsigned long Detectors;///< Detectors used bool DetectorUsed[NDETSUSED]; ///< Detectors used. Index order from 0 to 18: [TPC1, TPC2, TPC3, FGD1, FGD2,P0D, DSECal, TopSMRD, BottomSMRD, LeftSMRD, RightSMRD, TopPECal, BottomPECal, LeftPECal, RightPECal, TopTECal, BottomTECal, LeftTECal, RightTECal]. unsigned long Status;///< The status for the fit. int NDOF;///< The number of degrees of freedom. double Chi2;///< The chi2 of the fit. int NNodes;///< The number of nodes. int NHits;///< The number of hits. int NConstituents;///< The number of constituents. bool isForward;///< Sense of object. bool SenseOK;///< Sense of object. double Charge;///< The Charge double EDeposit;///< The deposited charge for the object. TVector3 Cone;///< The opening angles of the cone (only for showers) double Width;///< The width of the shower (perpendicular to the direction) double Length;///< The length of the track or shower (RMS) std::vector ParticleIds;///< the PDG codes obtained in the recon combined PID std::vector PIDWeights;///< the PID likelihoods for combined PID TLorentzVector FrontPosition;///< The position of the object. TLorentzVector BackPosition;///< The position of the object TLorentzVector FrontPositionVar;///< The position variance. TLorentzVector BackPositionVar;///< The position variance. TVector3 FrontDirection;///< The direction of the object. TVector3 BackDirection;///< The direction of the object. TVector3 FrontDirectionVar;///< The direction variance of the object. TVector3 BackDirectionVar;///< The direction variance of the object. double FrontMomentum;///< the momentum of the object double BackMomentum;///< the momentum of the object double FrontMomentumError;///< the error on the momentum of the object double BackMomentumError;///< the error on the momentum of the object double RangeMomentumMuon;///< the momentum by range for the muon hypothesis double RangeMomentumMuonFlip;///< the momentum by range for the flipped muon hypothesis double RangeMomentumElectron;///< the momentum by range for the electron hypothesis double RangeMomentumElectronFlip;///< the momentum by range for the flipped electron hypothesis double RangeMomentumProton;///< the momentum by range for the proton hypothesis double RangeMomentumProtonFlip;///< the momentum by range for the flipped proton hypothesis TLorentzVector PositionAtTrueVertex;///< Position at the true vertex. TLorentzVector PositionVarAtTrueVertex;///< Position variance at the true vertex. TVector3 DirectionAtTrueVertex;///< Direction at the true vertex. TVector3 DirectionVarAtTrueVertex;///< Direction variance at the true vertex. double MomentumAtTrueVertex; ///< Momentum at the true vertex. double MomentumErrorAtTrueVertex; ///< Error of the momentum at the true vertex. // the position, direction and momentum, of the object at the entrance and exit of each subdetector int EntranceOK[NDETSEXTRAP ]; ///< Status of the subdetector entrance. int ExitOK[NDETSEXTRAP]; ///< Status of the subdetector exit. TLorentzVector EntrancePosition[NDETSEXTRAP]; ///< The position of the object at the entrance of each subdetector. TLorentzVector ExitPosition[NDETSEXTRAP]; ///< The position of the object at the exit of each subdetector. TVector3 EntranceDirection[NDETSEXTRAP]; ///< The direction of the object at the entrance of each subdetector volume. TVector3 ExitDirection[NDETSEXTRAP]; ///< The direction of the object at the exit of each subdetector. double EntranceMomentum[NDETSEXTRAP]; ///< The momentum of the object at the entrance of each subdetector. double ExitMomentum[NDETSEXTRAP]; ///< The momentum of the object at the exit of each subdetector. TLorentzVector EntrancePositionErr[NDETSEXTRAP]; ///< The error of the position of the object at the entrance of each subdetector. TLorentzVector ExitPositionErr[NDETSEXTRAP]; ///< The error of the position of the object at the exit of each subdetector. TVector3 EntranceDirectionErr[NDETSEXTRAP]; ///< The error of the direction of the object at the entrance of each subdetector. TVector3 ExitDirectionErr[NDETSEXTRAP]; ///< The error of the direction of the object at the exit of each subdetector. double EntranceMomentumErr[NDETSEXTRAP]; ///< The error of the momentum of the object at the entrance of each subdetector. double ExitMomentumErr[NDETSEXTRAP]; ///< The error of the momentum of the object at the exit of each subdetector. Int_t NHitsSaved; ///< Number of entries in the HitsSaved array. TClonesArray *HitsSaved; ///< the two first and two last hits (IGlobalHit). ITrueParticle TrueParticle; ///< The true particle // The subdetector specific variables Int_t NTRACKERs; ///< Number of Tracker objects. TClonesArray *TRACKER; ///< Tracker specific variables. Int_t NTPCs; ///< Number of TPC objects. TClonesArray *TPC; ///< TPC specific variables. Int_t NFGDs; ///< Number of FGD objects. TClonesArray *FGD; ///< FGD specific variables. Int_t NECALs; ///< Number of ECAL objects. Int_t NDsECALs; ///< Number of DsECAL objects. Int_t NTrECALs; ///< Number of TrECAL objects. TClonesArray *ECAL; ///< ECAL specific variables. Int_t NP0DECALs; ///< Number of P0DECAL objects. TClonesArray *P0DECAL; ///< P0DECAL specific variables. Int_t NP0Ds; ///< Number of P0D objects. TClonesArray *P0D; ///< P0D specific variables. Int_t NSMRDs; ///< Number of SMRD objects. TClonesArray *SMRD; ///< SMRD specific variables. Int_t NAlternates; ///< Number of entries in the alternate hypotheses list. TClonesArray *Alternates; ///< List of alternate hypotheses // JIMHACK - Just for now include an instance of TPC, ECAL and FGD objects here as // TFile::MakeProject does not seem able to find them when they are hidden inside a // TClonesArray. Nothing is done with these - it is just an ugly workaround. ITPCObject hackTPCObject; ///< This is just here to fool TFile::MakeProject, not a real object. IFGDObject hackFGDObject; ///< This is just here to fool TFile::MakeProject, not a real object. IECALObject hackECALObject;///< This is just here to fool TFile::MakeProject, not a real object. IP0DObject hackP0DObject; ///< This is just here to fool TFile::MakeProject, not a real object. ISMRDObject hackSMRDObject;///< This is just here to fool TFile::MakeProject, not a real object. ITrackerObject hackTrackerObject;///< This is just here to fool TFile::MakeProject, not a real object. IGlobalPIDAlternate hackGlobalPIDAlternate;///< This is just here to fool TFile::MakeProject, not a real object. ClassDef(IGlobalReconModule::IGlobalPID, 1); }; public: /// Default Constructor IGlobalReconModule(const char *name = "Global", const char *title = "Global Recon Module"); virtual ~IGlobalReconModule(); virtual Bool_t ProcessFirstEvent(COMET::ICOMETEvent& event); protected: virtual void InitializeModule(); int GetNumberOfHits(COMET::IHandle object); virtual void InitializeBranches(); virtual bool FillTree(COMET::ICOMETEvent&); bool FillVertex(COMET::IHandle vertex, bool primary); void MatchTrueVertex(COMET::IHandle g4PrimVert); void FillGlobalPIDs(COMET::ICOMETEvent& event, COMET::IHandle object); void FillGlobalPIDAlternates(COMET::IHandle G4track, COMET::IHandle object, IGlobalPID& globalObject); void FillGlobalPIDAlternate(COMET::IHandle G4track, COMET::IHandle object, IGlobalPIDAlternate& PIDAlternate); void FillTPCPID(COMET::IHandle object); COMET::IHandle GetG4Vertex(const COMET::IReconBase& object, double& pur, double& eff); bool GetG4Vertex(COMET::IHandle G4track, COMET::IG4PrimaryVertex& G4vertex); void FillTrueParticle( COMET::IHandle G4track, double pur, double eff,COMET::ITrueParticle& part ); void FillTrueVertex( bool, const COMET::IG4PrimaryVertex& G4vertex, double pur, double eff, COMET::ITrueVertex& vertex); void FillSubBaseObject(COMET::IHandle object, ISubBaseObject& sub, int det ); void FillTPCObject(COMET::IHandle object, ITPCObject& sub, int det ); void FillP0DECALInfo(COMET::IHandle object, IGlobalPID& pid ); void FillECALInfo(COMET::IHandle object, IGlobalPID& pid ); void FillTPCInfo(COMET::IHandle object, IGlobalPID& pid ); void FillFGDInfo(COMET::IHandle object, IGlobalPID& pid ); void FillP0DInfo(COMET::IHandle object, IGlobalPID& pid ); void FillSMRDInfo(COMET::IHandle object, IGlobalPID& pid ); void FillTrackerInfo(COMET::IHandle object, IGlobalPID& pid ); void FillTPCOther(COMET::ICOMETEvent& event); void FillUnusedHits(COMET::ICOMETEvent& event); void FillGlobalHit(COMET::IHandle hit, IGlobalHit& gHit); void FillGlobalHit(COMET::IHandle hit, ISMRDHit& smrdHit); //a function to fill info related to smrd hit void FillSmrdHit(COMET::IHandle hit, ISMRDHit& smrdHit); void FillDetectorUsed(COMET::IHandle object, bool dets[]); void FillOutermostHits(COMET::IHitSelection& hits, double charge_cut, IOutermostHits& outer); void FillFirstLastHits(COMET::IHitSelection& hits, IGlobalPID& globalObject); void FillDelayedFgdClusters(COMET::ICOMETEvent& event, COMET::IHandle globalObjects); double MedianObjectTime(COMET::IHandle object); void GetFGDSimpleVA( COMET::ICOMETEvent& event, COMET::IHandle& object, TLorentzVector& vertexPos ); void FillFgdTimeBins(COMET::ICOMETEvent& event); void FillVertexInfo(COMET::ICOMETEvent& event, COMET::IHandle globalObjects); int GetDetectorNumber(COMET::IHandle object); std::string GetObjectType(COMET::IHandle object); bool IsTrackLike(COMET::IHandle object); COMET::IHandle GetParent(COMET::IHandle G4track); bool GetIncomingParticle(const COMET::IG4PrimaryVertex& G4vertex, COMET::IG4PrimaryParticle& incoming); void InitializeExtrapolationToDetectors(); void FillExtrapolationToDetectors(COMET::IHandle object, IGlobalPID& globalObject); void FillExtrapolationToDetectors(COMET::IHandle object, IGlobalPID& globalObject, Trajectory& traj, int sense); void FillKinematicsAtTrueVertex(COMET::IHandle G4track, COMET::IHandle object, TLorentzVector& pos, TLorentzVector& posVar, TVector3& dir, TVector3& dirVar, double& mom, double& momErr); void FillKinematics(COMET::IHandle state, TLorentzVector& pos, TLorentzVector& posVar, TVector3& dir, TVector3& dirVar, double& mom, double& momErr); double ComputeTrackLength(COMET::IHandle object); int ComputeParticleId(COMET::IHandle PID); void GetConstituentsInTracker(COMET::IHandle t1, COMET::IReconObjectContainer& trackerObjects); bool IsTrackerOnly(COMET::IHandle t1); void DoAssociationBetweenTrackerAndGlobalObjects(const COMET::IReconObjectContainer& globalObjects, const COMET::IReconObjectContainer& trackerObjects); COMET::IHandle GetG4Trajectory(const COMET::IReconBase &object, double& pur, double& eff); void GetHitsAssociatedToG4Trajectory(const COMET::IHitSelection& hits, COMET::IHandle traj, COMET::IHitSelection& traj_hits); void UpdateCoincidences(COMET::IHandle mch, COMET::IMCDigit* mcdigit, std::vector& coinc, int& nhits); COMET::IHandle GetMainContributor(COMET::IHandle mch, COMET::IHandle trajectories); void FillBrokenTracksMap(const COMET::IReconObjectContainer& globalObjects); bool GetBrokenIDs(COMET::IHandle object, std::vector& brokenIDs1, std::vector& brokenIDs2); // Keep track if recpack is initialized. bool fRecPackInitialized; std::vector fALLMODULES; HelixEquation fEquation; //! // std::map fDetIndex dict::dictionary fDetIndex; //! surface_vector fDetSurfaces[NDETSEXTRAP]; //! bool fPassedDetector[NDETSEXTRAP]; std::map, int > fGlobalIndexMap; //! std::map, int > fTrackerGlobalIndexMap; //! std::map< COMET::IHandle, std::vector > fBrokenIndexMap; //! COMET::IHandle GetTrackerReconVersionOfFGDIsoTrack(COMET::IHandle object); public: // this is just for tests bool fTestTPCInfo; ///< For tests only. Int_t fNTPCPIDs; ///< For tests only. TClonesArray *fTPCPIDs; ///< For tests only (ITpcPID). //---- Actual information saved in the tree ----------------------------- Int_t fNVertices; ///< The number of added primary vertices. TClonesArray *fVertices; ///< The IGlobalVertex vector of vertices. Int_t fPVInd; ///< The last primary vertex index. Int_t fNSVertices; ///< Number of added secondary vertices. Int_t fNPIDs; ///< The number of global objects. TClonesArray *fPIDs; ///< The vector of IGlobalPID. Int_t fNTPCOthers; ///< The number of TPC other objects. TClonesArray *fTPCOthers; ///< The vector of TPC other objects (ITPCOtherObject). Int_t fNTPCUnused; ///< Number of hits unused in the TPC. Int_t fNFGD1Unused; ///< Number of hits unused in the FGD1. Int_t fNFGD2Unused; ///< Number of hits unused in the FGD2. Int_t fNP0DUnused; ///< Number of hits unused in the P0D. TClonesArray *fP0DUnused; ///< The vector unused hits in the P0D (IGlobalHit). TClonesArray *fSMRDUnused; ///< The vector unused hits in the SMRD (ISMRDHit). Int_t fNSMRDTopUnused; ///< Number of hits unused in the SMRDTop. Int_t fNSMRDBottomUnused; ///< Number of hits unused in the SMRDBottom. Int_t fNSMRDLeftUnused; ///< Number of hits unused in the SMRDLeft. Int_t fNSMRDRightUnused; ///< Number of hits unused in the SMRDRight. Int_t fNSMRDUnused; ///< Number of all hits unused in the SMRD // Int_t fNECALUnused; //! Number of hits unused in ECAL IOutermostHits fP0DOutermostHits; ///< Outermost hits in the P0D. double fEarliestTrackMedianHitTime; ///< Median hit time of the earliest track. Int_t fNDelayedClusters; ///< Number of delayed clusters in the FGD (>200 ns). TClonesArray *fDelayedClusters; ///< Deprecated vector of delayed clusters in the FGD (IFgdCluster). // Information about unused FGD hits and outermost FGD hits is saved for each time bin Int_t fNFgdTimeBins; ///< Number of hit time bins in the FGD as determined by ReconFGD. TClonesArray *fFgdTimeBins; ///< Information for each hit time bin (TFgdTimeBins). Int_t fNP0DECAL; ///< Number of objects containing the P0DECAL. Int_t fNDsECAL; ///< Number of objects containing the DsECAL. Int_t fNTrECAL; ///< Number of objects containing the TrECAL. Int_t fNTPC; ///< Number of objects containing the TPC. Int_t fNFGD; ///< Number of objects containing the FGD. Int_t fNP0D; ///< Number of objects containing the P0D. Int_t fNSMRD; ///< Number of objects containing the SMRD. Int_t fNP0DECALIso; ///< Number of objects in the P0DECAL only. Int_t fNTrECALIso; ///< Number of objects in the TrECAL only. Int_t fNDsECALIso; ///< Number of objects in the DsECAL only. Int_t fNTPCIso; ///< Number of objects in the TPC only. Int_t fNFGDIso; ///< Number of objects in the FGD only. Int_t fNP0DIso; ///< Number of objects in the P0D only. Int_t fNSMRDIso; ///< Number on objects in the SMRD only. private: ClassDef(IGlobalReconModule,3); }; #endif